mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 03:12:48 -04:00
Compare commits
147 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 319efbe662 | |||
| 6f34bb050a | |||
| a2a56122e2 | |||
| 58f2679def | |||
| 396ea02fe5 | |||
| 8100ddb990 | |||
| d78c46a628 | |||
| 1e93657ab5 | |||
| 366e47245e | |||
| 4c53ba91be | |||
| cf080523cb | |||
| a15d0af139 | |||
| d99205ecc6 | |||
| dd3a61d84c | |||
| 595a6f1c9e | |||
| 18d70df188 | |||
| 46f6dc67c1 | |||
| 6267b79da3 | |||
| 62f3d09076 | |||
| 4b3c559df3 | |||
| 30a99c22f1 | |||
| 360cb37028 | |||
| 4b6b41a6aa | |||
| faa8618124 | |||
| 89acf923e0 | |||
| c42a33154c | |||
| a074e30147 | |||
| 2ce272d586 | |||
| e1636e20bd | |||
| 9904720e5a | |||
| 9910320fb4 | |||
| b43a9e2ccc | |||
| 23d81492e6 | |||
| 65b0ec3f90 | |||
| 91248d10db | |||
| f76a4d7087 | |||
| c7b609945b | |||
| 6ca6ea8065 | |||
| 315f621176 | |||
| 10d9a818c2 | |||
| e3761784af | |||
| d85556a063 | |||
| c43f33a5bc | |||
| e63897d1f7 | |||
| 35a69e7ff1 | |||
| 8b9f09bda5 | |||
| 32cddc725b | |||
| 55eec3b0de | |||
| 1cf14f176c | |||
| 74550b031f | |||
| 2f84f0eaa4 | |||
| 3ed7ef1c88 | |||
| eace147652 | |||
| 53c005c4f1 | |||
| a4ff97564c | |||
| c6beeba14f | |||
| e470278717 | |||
| 783230b654 | |||
| 4e7711725a | |||
| e5bf7606ec | |||
| aa377cd5c1 | |||
| bb9a88d7dc | |||
| 341e97ba82 | |||
| 8d3cb51157 | |||
| 7fff3b5ae0 | |||
| 6beb73b7a6 | |||
| c239a5a226 | |||
| b3f8fecfe4 | |||
| 6dcf4942f5 | |||
| cd7e429a66 | |||
| fcfcb35929 | |||
| 82b20be436 | |||
| 33101d8050 | |||
| 05160a968c | |||
| 623f29eb24 | |||
| 0a3833818a | |||
| 4f276252a3 | |||
| d17c629ce0 | |||
| 5bcc969778 | |||
| 09e3e17aa6 | |||
| f02a39d921 | |||
| effe5cb9e2 | |||
| 767bb6826f | |||
| a9f8595901 | |||
| 56239e77ff | |||
| 763cb7f92f | |||
| 85120648b1 | |||
| b77ef63d5e | |||
| 45adce4af2 | |||
| 7b8f9c6f46 | |||
| 1c8bb1206e | |||
| 78d1596f66 | |||
| 4cda2cd5f0 | |||
| d34be5143a | |||
| c00fc756e3 | |||
| 6ea3fef8c6 | |||
| 8010e16cab | |||
| 2ec6f65572 | |||
| 5c20f527ac | |||
| 3d9dfbd447 | |||
| 3a538d45cf | |||
| 59d2014fb9 | |||
| bc6c132d69 | |||
| 83ddb2c6c8 | |||
| 3fe26f8dd6 | |||
| 054c4384be | |||
| 439cc936a1 | |||
| 570d00ee8c | |||
| 7ae1818550 | |||
| 4ddd243eca | |||
| edea6a1418 | |||
| 9614614981 | |||
| 4e433f646b | |||
| 5ba04524eb | |||
| e566202c26 | |||
| f293281eb2 | |||
| e9689f9abb | |||
| 36bfce534c | |||
| 8ba1133e34 | |||
| 2db4040843 | |||
| f2848f0be0 | |||
| 363788accd | |||
| c7de341484 | |||
| b182e18fab | |||
| 72a73ba661 | |||
| d882ce47fc | |||
| 2cc11c74b7 | |||
| c7d9a8733f | |||
| 88bdea1fd3 | |||
| 6c055d462f | |||
| dd84c3f46d | |||
| 3db0281088 | |||
| 8230ebcced | |||
| a2882711ee | |||
| 6bc1d3d847 | |||
| 06e6a97ee7 | |||
| ff92ba3abc | |||
| 5c61c5ede8 | |||
| 98b0c8296e | |||
| 269505a69f | |||
| 433f058aea | |||
| 1c057bb24a | |||
| 2a49673dce | |||
| 20e958bf12 | |||
| d432fbcd10 | |||
| bf83f40ec5 | |||
| ada67f1be1 |
+29
-24
@@ -67,6 +67,7 @@ jobs:
|
|||||||
run: ci/build-appimage.sh
|
run: ci/build-appimage.sh
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusk-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
name: dusk-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
||||||
@@ -76,24 +77,27 @@ jobs:
|
|||||||
|
|
||||||
build-apple:
|
build-apple:
|
||||||
name: Build Apple (${{matrix.name}})
|
name: Build Apple (${{matrix.name}})
|
||||||
if: 'false' # TODO enable when CI is free
|
runs-on: [self-hosted, macOS]
|
||||||
runs-on: macos-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: AppleClang macOS universal
|
- name: AppleClang macOS arm64
|
||||||
platform: macos
|
platform: macos
|
||||||
preset: x-macos-ci
|
preset: x-macos-ci-arm64
|
||||||
artifact_name: macos-appleclang-universal
|
artifact_name: macos-appleclang-arm64
|
||||||
- name: AppleClang iOS arm64
|
# - name: AppleClang macOS x86_64
|
||||||
platform: ios
|
# platform: macos
|
||||||
preset: x-ios-ci
|
# preset: x-macos-ci-x86_64
|
||||||
artifact_name: ios-appleclang-arm64
|
# artifact_name: macos-appleclang-x86_64
|
||||||
- name: AppleClang tvOS arm64
|
# - name: AppleClang iOS arm64
|
||||||
platform: tvos
|
# platform: ios
|
||||||
preset: x-tvos-ci
|
# preset: x-ios-ci
|
||||||
artifact_name: tvos-appleclang-arm64
|
# artifact_name: ios-appleclang-arm64
|
||||||
|
# - name: AppleClang tvOS arm64
|
||||||
|
# platform: tvos
|
||||||
|
# preset: x-tvos-ci
|
||||||
|
# artifact_name: tvos-appleclang-arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
@@ -101,22 +105,15 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Update Homebrew
|
|
||||||
if: matrix.platform == 'tvos'
|
|
||||||
run: |
|
|
||||||
brew update
|
|
||||||
brew upgrade --formula
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: 'false'
|
||||||
run: brew install cmake ninja
|
run: brew install cmake ninja
|
||||||
|
|
||||||
- name: Install markupsafe
|
|
||||||
if: matrix.platform == 'tvos'
|
|
||||||
run: pip3 install --break-system-packages markupsafe
|
|
||||||
|
|
||||||
- name: Install Rust iOS target
|
- name: Install Rust iOS target
|
||||||
if: matrix.platform == 'ios'
|
if: matrix.platform == 'ios'
|
||||||
run: rustup target add aarch64-apple-ios
|
run: |
|
||||||
|
rustup toolchain install stable
|
||||||
|
rustup target add aarch64-apple-ios
|
||||||
|
|
||||||
- name: Install Rust tvOS target
|
- name: Install Rust tvOS target
|
||||||
if: matrix.platform == 'tvos'
|
if: matrix.platform == 'tvos'
|
||||||
@@ -124,6 +121,12 @@ jobs:
|
|||||||
rustup toolchain install nightly
|
rustup toolchain install nightly
|
||||||
rustup target add --toolchain nightly aarch64-apple-tvos
|
rustup target add --toolchain nightly aarch64-apple-tvos
|
||||||
|
|
||||||
|
- name: Install Rust x86_64 macOS target
|
||||||
|
if: endsWith(matrix.preset, 'x86_64')
|
||||||
|
run: |
|
||||||
|
rustup toolchain install stable
|
||||||
|
rustup target add x86_64-apple-darwin
|
||||||
|
|
||||||
- name: Setup sccache
|
- name: Setup sccache
|
||||||
uses: mozilla-actions/sccache-action@v0.0.9
|
uses: mozilla-actions/sccache-action@v0.0.9
|
||||||
|
|
||||||
@@ -134,6 +137,7 @@ jobs:
|
|||||||
run: cmake --build --preset ${{matrix.preset}}
|
run: cmake --build --preset ${{matrix.preset}}
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusk-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
name: dusk-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
||||||
@@ -199,6 +203,7 @@ jobs:
|
|||||||
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"type": "cppvsdbg",
|
"type": "cppvsdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${command:cmake.launchTargetPath}",
|
"program": "${command:cmake.launchTargetPath}",
|
||||||
"args": ["-l", "1", "--dvd", "${workspaceRoot}/orig/GZ2E01/GZ2E01.iso"],
|
"args": ["-l", "1", "--dvd", "${workspaceRoot}/orig/GZ2E01/GZ2E01.iso", "--console"],
|
||||||
"MIMode": "gdb",
|
"MIMode": "gdb",
|
||||||
"miDebuggerPath": "gdb",
|
"miDebuggerPath": "gdb",
|
||||||
"symbolSearchPath": "${command:cmake.launchTargetPath}",
|
"symbolSearchPath": "${command:cmake.launchTargetPath}",
|
||||||
|
|||||||
+146
-76
@@ -68,6 +68,9 @@ endif()
|
|||||||
message(STATUS "Dusk version set to ${DUSK_WC_DESCRIBE}")
|
message(STATUS "Dusk version set to ${DUSK_WC_DESCRIBE}")
|
||||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
project(dusk LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
project(dusk LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
||||||
|
if (APPLE)
|
||||||
|
enable_language(OBJC)
|
||||||
|
endif ()
|
||||||
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
||||||
# ios.toolchain.cmake hack for SDL
|
# ios.toolchain.cmake hack for SDL
|
||||||
set(TVOS ON)
|
set(TVOS ON)
|
||||||
@@ -125,19 +128,37 @@ if (DUSK_MOVIE_SUPPORT)
|
|||||||
else ()
|
else ()
|
||||||
set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a)
|
set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a)
|
||||||
endif ()
|
endif ()
|
||||||
|
set(_jpeg_cmake_args
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
|
||||||
|
-DENABLE_SHARED=OFF
|
||||||
|
-DWITH_TURBOJPEG=ON
|
||||||
|
-DWITH_JAVA=OFF
|
||||||
|
)
|
||||||
|
if (CMAKE_TOOLCHAIN_FILE)
|
||||||
|
get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
|
list(APPEND _jpeg_cmake_args -DCMAKE_TOOLCHAIN_FILE=${_jpeg_toolchain_file})
|
||||||
|
endif ()
|
||||||
|
set(_jpeg_passthrough_vars
|
||||||
|
CMAKE_BUILD_TYPE
|
||||||
|
CMAKE_C_COMPILER
|
||||||
|
CMAKE_C_COMPILER_LAUNCHER
|
||||||
|
CMAKE_MAKE_PROGRAM
|
||||||
|
CMAKE_MSVC_RUNTIME_LIBRARY
|
||||||
|
CMAKE_OSX_ARCHITECTURES
|
||||||
|
DEPLOYMENT_TARGET
|
||||||
|
ENABLE_ARC
|
||||||
|
ENABLE_BITCODE
|
||||||
|
PLATFORM
|
||||||
|
)
|
||||||
|
foreach(_var IN LISTS _jpeg_passthrough_vars)
|
||||||
|
if (DEFINED ${_var})
|
||||||
|
list(APPEND _jpeg_cmake_args -D${_var}=${${_var}})
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
ExternalProject_Add(libjpeg-turbo-ext
|
ExternalProject_Add(libjpeg-turbo-ext
|
||||||
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz
|
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz
|
||||||
URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285
|
URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS ${_jpeg_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}
|
BUILD_BYPRODUCTS ${_jpeg_lib}
|
||||||
)
|
)
|
||||||
file(MAKE_DIRECTORY ${_jpeg_install_dir}/include)
|
file(MAKE_DIRECTORY ${_jpeg_install_dir}/include)
|
||||||
@@ -249,7 +270,7 @@ include(files.cmake)
|
|||||||
# TODO: version handling for res includes
|
# TODO: version handling for res includes
|
||||||
|
|
||||||
set(DUSK_BUNDLE_NAME Dusk)
|
set(DUSK_BUNDLE_NAME Dusk)
|
||||||
set(DUSK_BUNDLE_IDENTIFIER dev.decomp.dusk)
|
set(DUSK_BUNDLE_IDENTIFIER dev.twilitrealm.dusk)
|
||||||
set(DUSK_COMPANY_NAME "Twilit Realm")
|
set(DUSK_COMPANY_NAME "Twilit Realm")
|
||||||
set(DUSK_FILE_DESCRIPTION "Dusk")
|
set(DUSK_FILE_DESCRIPTION "Dusk")
|
||||||
set(DUSK_PRODUCT_NAME "Dusk")
|
set(DUSK_PRODUCT_NAME "Dusk")
|
||||||
@@ -277,7 +298,7 @@ set(GAME_INCLUDE_DIRS
|
|||||||
${CMAKE_BINARY_DIR})
|
${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
|
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)
|
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt)
|
||||||
|
|
||||||
list(APPEND GAME_LIBS libzstd_static)
|
list(APPEND GAME_LIBS libzstd_static)
|
||||||
|
|
||||||
@@ -295,9 +316,51 @@ if (DUSK_MOVIE_SUPPORT)
|
|||||||
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
|
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
option(DUSK_ENABLE_DISCORD_RPC "Enable Discord Rich Presence support" ON)
|
||||||
|
if (DUSK_ENABLE_DISCORD_RPC AND NOT ANDROID AND NOT IOS AND NOT TVOS)
|
||||||
|
|
||||||
|
FetchContent_Populate(discord_rpc
|
||||||
|
URL https://github.com/discord/discord-rpc/archive/refs/tags/v3.4.0.tar.gz
|
||||||
|
URL_HASH SHA256=e13427019027acd187352dacba6c65953af66fdf3c35fcf38fc40b454a9d7855
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||||
|
)
|
||||||
|
# RapidJSON is a git submodule absent from the discord-rpc tarball; fetch separately.
|
||||||
|
FetchContent_Populate(rapidjson
|
||||||
|
URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz
|
||||||
|
URL_HASH SHA256=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
if (NOT TARGET discord-rpc)
|
||||||
|
set(_drpc ${discord_rpc_SOURCE_DIR}/src)
|
||||||
|
set(_drpc_src
|
||||||
|
${_drpc}/discord_rpc.cpp
|
||||||
|
${_drpc}/rpc_connection.cpp
|
||||||
|
${_drpc}/serialization.cpp
|
||||||
|
)
|
||||||
|
if (WIN32)
|
||||||
|
list(APPEND _drpc_src ${_drpc}/connection_win.cpp ${_drpc}/discord_register_win.cpp)
|
||||||
|
elseif (APPLE)
|
||||||
|
list(APPEND _drpc_src ${_drpc}/connection_unix.cpp ${_drpc}/discord_register_osx.m)
|
||||||
|
else ()
|
||||||
|
list(APPEND _drpc_src ${_drpc}/connection_unix.cpp ${_drpc}/discord_register_linux.cpp)
|
||||||
|
endif ()
|
||||||
|
add_library(discord-rpc STATIC ${_drpc_src})
|
||||||
|
target_include_directories(discord-rpc PUBLIC
|
||||||
|
${discord_rpc_SOURCE_DIR}/include
|
||||||
|
${rapidjson_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
|
if (UNIX)
|
||||||
|
target_link_libraries(discord-rpc PUBLIC pthread)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
list(APPEND GAME_LIBS discord-rpc)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD_RPC=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Edit & Continue
|
# Edit & Continue
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL Debug)
|
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
|
||||||
endif ()
|
endif ()
|
||||||
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
||||||
@@ -336,12 +399,6 @@ target_include_directories(game_base PRIVATE ${GAME_INCLUDE_DIRS})
|
|||||||
target_link_libraries(game_debug PRIVATE ${GAME_LIBS})
|
target_link_libraries(game_debug PRIVATE ${GAME_LIBS})
|
||||||
target_link_libraries(game_base PRIVATE ${GAME_LIBS})
|
target_link_libraries(game_base PRIVATE ${GAME_LIBS})
|
||||||
|
|
||||||
# Combined game library
|
|
||||||
add_library(game STATIC
|
|
||||||
$<TARGET_OBJECTS:game_base>
|
|
||||||
$<TARGET_OBJECTS:game_debug>)
|
|
||||||
target_link_libraries(game PUBLIC ${GAME_LIBS})
|
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
add_library(dusk SHARED src/dusk/main.cpp)
|
add_library(dusk SHARED src/dusk/main.cpp)
|
||||||
set_target_properties(dusk PROPERTIES OUTPUT_NAME main)
|
set_target_properties(dusk PROPERTIES OUTPUT_NAME main)
|
||||||
@@ -351,7 +408,7 @@ endif ()
|
|||||||
|
|
||||||
target_compile_definitions(dusk PRIVATE TARGET_PC AVOID_UB=1 VERSION=0)
|
target_compile_definitions(dusk PRIVATE TARGET_PC AVOID_UB=1 VERSION=0)
|
||||||
target_include_directories(dusk PRIVATE include)
|
target_include_directories(dusk PRIVATE include)
|
||||||
target_link_libraries(dusk PRIVATE game aurora::main)
|
target_link_libraries(dusk PRIVATE game_base game_debug aurora::main)
|
||||||
if (TARGET crashpad_handler)
|
if (TARGET crashpad_handler)
|
||||||
add_dependencies(dusk crashpad_handler)
|
add_dependencies(dusk crashpad_handler)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -362,12 +419,14 @@ if (ANDROID)
|
|||||||
target_link_options(dusk PRIVATE "-Wl,-u,SDL_main")
|
target_link_options(dusk PRIVATE "-Wl,-u,SDL_main")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_custom_command(TARGET dusk POST_BUILD
|
if (NOT APPLE)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
add_custom_command(TARGET dusk POST_BUILD
|
||||||
"${CMAKE_SOURCE_DIR}/res"
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
"$<TARGET_FILE_DIR:dusk>/res"
|
"${CMAKE_SOURCE_DIR}/res"
|
||||||
COMMENT "Copying resources"
|
"$<TARGET_FILE_DIR:dusk>/res"
|
||||||
)
|
COMMENT "Copying resources"
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(DUSK_WINDOWS_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/windows)
|
set(DUSK_WINDOWS_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/windows)
|
||||||
@@ -401,44 +460,49 @@ endif ()
|
|||||||
if (APPLE)
|
if (APPLE)
|
||||||
if (IOS)
|
if (IOS)
|
||||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
|
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
|
||||||
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
elseif (TVOS)
|
||||||
file(GLOB_RECURSE DUSK_RESOURCE_FILES "${DUSK_RESOURCE_DIR}/Base.lproj/*")
|
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos)
|
||||||
endif ()
|
else ()
|
||||||
if (IOS OR TVOS)
|
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos)
|
||||||
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 ()
|
||||||
|
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
||||||
|
file(GLOB_RECURSE DUSK_RESOURCE_FILES
|
||||||
|
"${DUSK_RESOURCE_DIR}/Assets.car"
|
||||||
|
"${DUSK_RESOURCE_DIR}/Base.lproj/*"
|
||||||
|
"${DUSK_RESOURCE_DIR}/Dusk.icns")
|
||||||
|
file(GLOB_RECURSE DUSK_APP_RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/res/*")
|
||||||
|
target_sources(dusk PRIVATE ${DUSK_RESOURCE_FILES})
|
||||||
|
target_sources(dusk PRIVATE ${DUSK_APP_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 ()
|
||||||
|
foreach (FILE ${DUSK_APP_RESOURCE_FILES})
|
||||||
|
file(RELATIVE_PATH NEW_FILE "${CMAKE_CURRENT_SOURCE_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}
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST}
|
||||||
|
OUTPUT_NAME Dusk
|
||||||
|
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||||
|
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (IOS)
|
||||||
|
find_library(UIKIT_FRAMEWORK UIKit REQUIRED)
|
||||||
|
find_library(UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK UniformTypeIdentifiers REQUIRED)
|
||||||
|
target_sources(dusk PRIVATE src/dusk/ios/FileSelectDialog.m)
|
||||||
|
set_source_files_properties(src/dusk/ios/FileSelectDialog.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||||
|
target_link_libraries(dusk PRIVATE ${UIKIT_FRAMEWORK} ${UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
||||||
@@ -487,7 +551,9 @@ if (TARGET crashpad_handler)
|
|||||||
endif ()
|
endif ()
|
||||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
aurora_install_runtime_dlls(dusk ${CMAKE_INSTALL_PREFIX})
|
aurora_install_runtime_dlls(dusk ${CMAKE_INSTALL_PREFIX})
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
if (NOT APPLE)
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||||
|
endif ()
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||||
set(DEBUG_FILES_LIST "")
|
set(DEBUG_FILES_LIST "")
|
||||||
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
|
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
|
||||||
@@ -509,18 +575,22 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
|||||||
endif ()
|
endif ()
|
||||||
list(APPEND DEBUG_FILES_LIST "${output_name}")
|
list(APPEND DEBUG_FILES_LIST "${output_name}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
if (WIN32)
|
# This is a terrible hack to only run this on CI
|
||||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
# until I turn this into a script or something
|
||||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
if(DEFINED ENV{GITHUB_ENV})
|
||||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
|
if (WIN32)
|
||||||
elseif (APPLE)
|
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
||||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||||
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})")
|
||||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
elseif (APPLE)
|
||||||
elseif (UNIX)
|
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
||||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
|
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||||
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})")
|
||||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${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 ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
foreach (target IN LISTS BINARY_TARGETS)
|
foreach (target IN LISTS BINARY_TARGETS)
|
||||||
|
|||||||
+65
-14
@@ -148,8 +148,7 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "cl",
|
"CMAKE_C_COMPILER": "cl",
|
||||||
"CMAKE_CXX_COMPILER": "cl",
|
"CMAKE_CXX_COMPILER": "cl",
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||||
"AURORA_DAWN_PROVIDER": "vendor"
|
|
||||||
},
|
},
|
||||||
"vendor": {
|
"vendor": {
|
||||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||||
@@ -359,7 +358,10 @@
|
|||||||
"inherits": [
|
"inherits": [
|
||||||
"relwithdebinfo",
|
"relwithdebinfo",
|
||||||
"ci"
|
"ci"
|
||||||
]
|
],
|
||||||
|
"cacheVariables": {
|
||||||
|
"AURORA_SDL3_PROVIDER": "vendor"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x-linux-ci-gcc",
|
"name": "x-linux-ci-gcc",
|
||||||
@@ -380,7 +382,39 @@
|
|||||||
"inherits": [
|
"inherits": [
|
||||||
"macos-default-relwithdebinfo",
|
"macos-default-relwithdebinfo",
|
||||||
"ci"
|
"ci"
|
||||||
]
|
],
|
||||||
|
"cacheVariables": {
|
||||||
|
"AURORA_NOD_PROVIDER": "vendor",
|
||||||
|
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
|
||||||
|
"type": "BOOL",
|
||||||
|
"value": true
|
||||||
|
},
|
||||||
|
"CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
|
||||||
|
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew",
|
||||||
|
"DUSK_MOVIE_SUPPORT": {
|
||||||
|
"type": "BOOL",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x-macos-ci-arm64",
|
||||||
|
"inherits": [
|
||||||
|
"x-macos-ci"
|
||||||
|
],
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_OSX_ARCHITECTURES": "arm64"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x-macos-ci-x86_64",
|
||||||
|
"inherits": [
|
||||||
|
"x-macos-ci"
|
||||||
|
],
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_OSX_ARCHITECTURES": "x86_64",
|
||||||
|
"Rust_CARGO_TARGET": "x86_64-apple-darwin"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x-ios-ci",
|
"name": "x-ios-ci",
|
||||||
@@ -389,7 +423,11 @@
|
|||||||
],
|
],
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||||
|
"DUSK_MOVIE_SUPPORT": {
|
||||||
|
"type": "BOOL",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -399,7 +437,11 @@
|
|||||||
],
|
],
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||||
|
"DUSK_MOVIE_SUPPORT": {
|
||||||
|
"type": "BOOL",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -556,10 +598,19 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x-macos-ci",
|
"name": "x-macos-ci-arm64",
|
||||||
"configurePreset": "x-macos-ci",
|
"configurePreset": "x-macos-ci-arm64",
|
||||||
"description": "(Internal) macOS CI",
|
"description": "(Internal) macOS CI arm64",
|
||||||
"displayName": "(Internal) macOS CI",
|
"displayName": "(Internal) macOS CI arm64",
|
||||||
|
"targets": [
|
||||||
|
"install"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x-macos-ci-x86_64",
|
||||||
|
"configurePreset": "x-macos-ci-x86_64",
|
||||||
|
"description": "(Internal) macOS CI x86_64",
|
||||||
|
"displayName": "(Internal) macOS CI x86_64",
|
||||||
"targets": [
|
"targets": [
|
||||||
"install"
|
"install"
|
||||||
]
|
]
|
||||||
@@ -567,8 +618,8 @@
|
|||||||
{
|
{
|
||||||
"name": "x-ios-ci",
|
"name": "x-ios-ci",
|
||||||
"configurePreset": "x-ios-ci",
|
"configurePreset": "x-ios-ci",
|
||||||
"description": "(Internal) iOS CI",
|
"description": "(Internal) iOS CI arm64",
|
||||||
"displayName": "(Internal) iOS CI",
|
"displayName": "(Internal) iOS CI arm64",
|
||||||
"targets": [
|
"targets": [
|
||||||
"install"
|
"install"
|
||||||
]
|
]
|
||||||
@@ -576,8 +627,8 @@
|
|||||||
{
|
{
|
||||||
"name": "x-tvos-ci",
|
"name": "x-tvos-ci",
|
||||||
"configurePreset": "x-tvos-ci",
|
"configurePreset": "x-tvos-ci",
|
||||||
"description": "(Internal) tvOS CI",
|
"description": "(Internal) tvOS CI arm64",
|
||||||
"displayName": "(Internal) tvOS CI",
|
"displayName": "(Internal) tvOS CI arm64",
|
||||||
"targets": [
|
"targets": [
|
||||||
"install"
|
"install"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,103 +1,59 @@
|
|||||||
## Dusk
|

|
||||||
|
|
||||||
### Building
|
- ### **[Official Website](https://twilitrealm.dev)**
|
||||||
#### Prerequisites
|
- ### **[Discord](https://discord.gg/QACynxeyna)**
|
||||||
* [CMake 3.25+](https://cmake.org)
|
|
||||||
* Windows: Install `CMake Tools` in Visual Studio
|
|
||||||
* macOS: `brew install cmake`
|
|
||||||
* [Python 3+](https://python.org)
|
|
||||||
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
|
|
||||||
* Verify it's added to `%PATH%` by typing `python` in `cmd`.
|
|
||||||
* macOS: `brew install python@3`
|
|
||||||
* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
|
|
||||||
* Select `C++ Development` and verify the following packages are included:
|
|
||||||
* `Windows 11 SDK`
|
|
||||||
* `CMake Tools`
|
|
||||||
* `C++ Clang Compiler`
|
|
||||||
* `C++ Clang-cl`
|
|
||||||
* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
|
|
||||||
* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
|
|
||||||
* Ubuntu 24.04+ packages
|
|
||||||
```
|
|
||||||
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
|
|
||||||
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
|
|
||||||
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
|
|
||||||
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
|
|
||||||
libxss-dev libxtst-dev
|
|
||||||
```
|
|
||||||
* Arch Linux packages
|
|
||||||
```
|
|
||||||
base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
|
|
||||||
```
|
|
||||||
* Fedora packages
|
|
||||||
```
|
|
||||||
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
|
|
||||||
```
|
|
||||||
* It's also important that you install the developer tools and libraries
|
|
||||||
```
|
|
||||||
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
|
||||||
```
|
|
||||||
#### Setup
|
|
||||||
Clone and initialize the Dusk repository
|
|
||||||
```sh
|
|
||||||
git clone --recursive https://github.com/TwilitRealm/dusk.git
|
|
||||||
cd dusk
|
|
||||||
git pull
|
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Building
|
# Setup
|
||||||
|
**⚠️Dusk does NOT provide any copyrighted assets. You must provide your own copy of the game.**
|
||||||
|
|
||||||
**CLion (Windows / macOS / Linux)**
|
### 1. Verify your ROM dump
|
||||||
|
First make sure your dump of the game is clean and supported by Dusk. You can do this by checking the sha1 hash of your dump against this list of supported versions.
|
||||||
|
|
||||||
Open the project directory in CLion. Enable the appropriate presets for your platform:
|
| Version | sha1 hash |
|
||||||
|
| ------------ | ---------------------------------------- |
|
||||||
|
| GameCube USA | 75edd3ddff41f125d1b4ce1a40378f1b565519e7 |
|
||||||
|
|
||||||

|
### 2. Download [Dusk](https://github.com/TwilitRealm/dusk/releases)
|
||||||
|
|
||||||
**Visual Studio (Windows)**
|
### 3. Setup the game
|
||||||
|
#### Windows
|
||||||
|
- Extract the zip folder
|
||||||
|
- Place your dump of the game into the same folder where you extracted to
|
||||||
|
- Launch `dusk.exe`
|
||||||
|
|
||||||
Open the project directory in Visual Studio. The CMake configuration will be loaded automatically.
|
#### macOS
|
||||||
|
- TODO
|
||||||
|
|
||||||
**ninja (macOS)**
|
#### Linux
|
||||||
|
- TODO
|
||||||
|
|
||||||
```sh
|
#### iOS
|
||||||
cmake --preset macos-default-relwithdebinfo
|
- TODO
|
||||||
cmake --build --preset macos-default-relwithdebinfo
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternate presets available:
|
#### android
|
||||||
- `macos-default-debug`: Clang, Debug
|
- TODO
|
||||||
|
|
||||||
**ninja (Linux)**
|
# Building
|
||||||
|
If you'd like to build Dusk from source, please read the [build instructions](docs/building.md).
|
||||||
|
|
||||||
```sh
|
# Credits
|
||||||
cmake --preset linux-default-relwithdebinfo
|
- Taka
|
||||||
cmake --build --preset linux-default-relwithdebinfo
|
- encounter
|
||||||
```
|
- Antidote
|
||||||
|
- caseif
|
||||||
|
- CraftyBoss
|
||||||
|
- crowell
|
||||||
|
- dooplecks
|
||||||
|
- gymnast86
|
||||||
|
- Irastris
|
||||||
|
- kipcode66
|
||||||
|
- Lars
|
||||||
|
- LunarSoap
|
||||||
|
- Maddie
|
||||||
|
- MelonSpeedruns
|
||||||
|
- Pheenoh
|
||||||
|
- PJB
|
||||||
|
- Roeming
|
||||||
|
- YunataSavior
|
||||||
|
|
||||||
Alternate presets available:
|
Special thanks to the TP Decomp team, the GC/Wii Decomp community, the Aurora developers, and the TP speedrunning community.
|
||||||
- `linux-default-debug`: GCC, Debug
|
|
||||||
- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
|
|
||||||
- `linux-clang-debug`: Clang, Debug
|
|
||||||
|
|
||||||
**ninja (Windows)**
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cmake --preset windows-msvc-relwithdebinfo
|
|
||||||
cmake --build --preset windows-msvc-relwithdebinfo
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternate presets available:
|
|
||||||
- `windows-msvc-debug`: MSVC, Debug
|
|
||||||
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
|
|
||||||
- `windows-clang-debug`: Clang-cl, Debug
|
|
||||||
|
|
||||||
#### Running
|
|
||||||
Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
|
|
||||||
```sh
|
|
||||||
build/{preset}/dusk /path/to/game.rvz
|
|
||||||
```
|
|
||||||
If no path is specified, Dusk defaults to `game.iso` in the current working directory.
|
|
||||||
|
|
||||||
#### 30 FPS on Debug
|
|
||||||
When compiled fully in a Debug the game runs too slowly to hit playable 30 FPS. To avoid this, you can set a CMake cache variable to optimize specific critical files without hampering debuggability in the rest of the program: `-DDUSK_SELECTED_OPT=ON`. When building for MSVC (Windows) you must also modify `CMAKE_CXX_FLAGS_DEBUG` and `CMAKE_C_FLAGS_DEBUG` to remove `/RTC1` from the flags, like so: `-DCMAKE_CXX_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od" -DCMAKE_C_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od"`
|
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
### Building
|
||||||
|
#### Prerequisites
|
||||||
|
* [CMake 3.25+](https://cmake.org)
|
||||||
|
* Windows: Install `CMake Tools` in Visual Studio
|
||||||
|
* macOS: `brew install cmake`
|
||||||
|
* [Python 3+](https://python.org)
|
||||||
|
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
|
||||||
|
* Verify it's added to `%PATH%` by typing `python` in `cmd`.
|
||||||
|
* macOS: `brew install python@3`
|
||||||
|
* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
|
||||||
|
* Select `C++ Development` and verify the following packages are included:
|
||||||
|
* `Windows 11 SDK`
|
||||||
|
* `CMake Tools`
|
||||||
|
* `C++ Clang Compiler`
|
||||||
|
* `C++ Clang-cl`
|
||||||
|
* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
|
||||||
|
* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
|
||||||
|
* Ubuntu 24.04+ packages
|
||||||
|
```
|
||||||
|
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
|
||||||
|
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||||
|
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
|
||||||
|
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
|
||||||
|
libxss-dev libxtst-dev
|
||||||
|
```
|
||||||
|
* Arch Linux packages
|
||||||
|
```
|
||||||
|
base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
|
||||||
|
```
|
||||||
|
* Fedora packages
|
||||||
|
```
|
||||||
|
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
|
||||||
|
```
|
||||||
|
* It's also important that you install the developer tools and libraries
|
||||||
|
```
|
||||||
|
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
||||||
|
```
|
||||||
|
#### Setup
|
||||||
|
Clone and initialize the Dusk repository
|
||||||
|
```sh
|
||||||
|
git clone --recursive https://github.com/TwilitRealm/dusk.git
|
||||||
|
cd dusk
|
||||||
|
git pull
|
||||||
|
git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Building
|
||||||
|
|
||||||
|
**CLion (Windows / macOS / Linux)**
|
||||||
|
|
||||||
|
Open the project directory in CLion. Enable the appropriate presets for your platform:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Visual Studio (Windows)**
|
||||||
|
|
||||||
|
Open the project directory in Visual Studio. The CMake configuration will be loaded automatically.
|
||||||
|
|
||||||
|
**ninja (macOS)**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cmake --preset macos-default-relwithdebinfo
|
||||||
|
cmake --build --preset macos-default-relwithdebinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternate presets available:
|
||||||
|
- `macos-default-debug`: Clang, Debug
|
||||||
|
|
||||||
|
**ninja (Linux)**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cmake --preset linux-default-relwithdebinfo
|
||||||
|
cmake --build --preset linux-default-relwithdebinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternate presets available:
|
||||||
|
- `linux-default-debug`: GCC, Debug
|
||||||
|
- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
|
||||||
|
- `linux-clang-debug`: Clang, Debug
|
||||||
|
|
||||||
|
**ninja (Windows)**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cmake --preset windows-msvc-relwithdebinfo
|
||||||
|
cmake --build --preset windows-msvc-relwithdebinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternate presets available:
|
||||||
|
- `windows-msvc-debug`: MSVC, Debug
|
||||||
|
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
|
||||||
|
- `windows-clang-debug`: Clang-cl, Debug
|
||||||
|
|
||||||
|
#### Running
|
||||||
|
Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
|
||||||
|
```sh
|
||||||
|
build/{preset}/dusk /path/to/game.rvz
|
||||||
|
```
|
||||||
|
If no path is specified, Dusk defaults to `game.iso` in the current working directory.
|
||||||
Vendored
+1
-1
Submodule extern/aurora updated: 4d7ff2ac11...6d69b7822e
+8
-4
@@ -15,7 +15,6 @@ set(DOLZEL_FILES
|
|||||||
src/m_Do/m_Do_DVDError.cpp
|
src/m_Do/m_Do_DVDError.cpp
|
||||||
src/m_Do/m_Do_MemCard.cpp
|
src/m_Do/m_Do_MemCard.cpp
|
||||||
src/m_Do/m_Do_MemCardRWmng.cpp
|
src/m_Do/m_Do_MemCardRWmng.cpp
|
||||||
src/m_Do/m_Do_machine_exception.cpp
|
|
||||||
src/m_Do/m_Do_hostIO.cpp
|
src/m_Do/m_Do_hostIO.cpp
|
||||||
src/c/c_damagereaction.cpp
|
src/c/c_damagereaction.cpp
|
||||||
src/c/c_dylink.cpp
|
src/c/c_dylink.cpp
|
||||||
@@ -1334,6 +1333,7 @@ set(DUSK_FILES
|
|||||||
include/dusk/endian_gx.hpp
|
include/dusk/endian_gx.hpp
|
||||||
include/dusk/config.hpp
|
include/dusk/config.hpp
|
||||||
include/dusk/dvd_asset.hpp
|
include/dusk/dvd_asset.hpp
|
||||||
|
include/dusk/scope_guard.hpp
|
||||||
src/dusk/dvd_asset.cpp
|
src/dusk/dvd_asset.cpp
|
||||||
src/d/actor/d_a_alink_dusk.cpp
|
src/d/actor/d_a_alink_dusk.cpp
|
||||||
src/dusk/asserts.cpp
|
src/dusk/asserts.cpp
|
||||||
@@ -1342,9 +1342,12 @@ set(DUSK_FILES
|
|||||||
src/dusk/endian.cpp
|
src/dusk/endian.cpp
|
||||||
src/dusk/extras.c
|
src/dusk/extras.c
|
||||||
src/dusk/extras.cpp
|
src/dusk/extras.cpp
|
||||||
|
src/dusk/file_select.cpp
|
||||||
|
src/dusk/file_select.hpp
|
||||||
src/dusk/frame_interpolation.cpp
|
src/dusk/frame_interpolation.cpp
|
||||||
|
src/dusk/game_clock.cpp
|
||||||
src/dusk/globals.cpp
|
src/dusk/globals.cpp
|
||||||
src/dusk/gyro_aim.cpp
|
src/dusk/gyro.cpp
|
||||||
src/dusk/io.cpp
|
src/dusk/io.cpp
|
||||||
src/dusk/layout.cpp
|
src/dusk/layout.cpp
|
||||||
src/dusk/logging.cpp
|
src/dusk/logging.cpp
|
||||||
@@ -1358,10 +1361,10 @@ set(DUSK_FILES
|
|||||||
src/dusk/imgui/ImGuiEngine.hpp
|
src/dusk/imgui/ImGuiEngine.hpp
|
||||||
src/dusk/imgui/ImGuiMenuGame.cpp
|
src/dusk/imgui/ImGuiMenuGame.cpp
|
||||||
src/dusk/imgui/ImGuiMenuGame.hpp
|
src/dusk/imgui/ImGuiMenuGame.hpp
|
||||||
|
src/dusk/imgui/ImGuiBloomWindow.cpp
|
||||||
|
src/dusk/imgui/ImGuiBloomWindow.hpp
|
||||||
src/dusk/imgui/ImGuiMenuTools.cpp
|
src/dusk/imgui/ImGuiMenuTools.cpp
|
||||||
src/dusk/imgui/ImGuiMenuTools.hpp
|
src/dusk/imgui/ImGuiMenuTools.hpp
|
||||||
src/dusk/imgui/ImGuiMenuEnhancements.cpp
|
|
||||||
src/dusk/imgui/ImGuiMenuEnhancements.hpp
|
|
||||||
src/dusk/imgui/ImGuiPreLaunchWindow.cpp
|
src/dusk/imgui/ImGuiPreLaunchWindow.cpp
|
||||||
src/dusk/imgui/ImGuiPreLaunchWindow.hpp
|
src/dusk/imgui/ImGuiPreLaunchWindow.hpp
|
||||||
src/dusk/imgui/ImGuiFirstRunPreset.hpp
|
src/dusk/imgui/ImGuiFirstRunPreset.hpp
|
||||||
@@ -1381,4 +1384,5 @@ set(DUSK_FILES
|
|||||||
src/dusk/OSContext.cpp
|
src/dusk/OSContext.cpp
|
||||||
src/dusk/OSThread.cpp
|
src/dusk/OSThread.cpp
|
||||||
src/dusk/OSMutex.cpp
|
src/dusk/OSMutex.cpp
|
||||||
|
src/dusk/discord_presence.cpp
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4551,7 +4551,7 @@ public:
|
|||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
void handleWolfHowl();
|
void handleWolfHowl();
|
||||||
void handleQuickTransform();
|
void handleQuickTransform();
|
||||||
bool checkGyroAimItemContext();
|
bool checkGyroAimContext();
|
||||||
#endif
|
#endif
|
||||||
}; // Size: 0x385C
|
}; // Size: 0x385C
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,15 @@ public:
|
|||||||
/* 0x17E2 */ s16 wait_roll_angle; ///< @brief Roll angle during wait state.
|
/* 0x17E2 */ s16 wait_roll_angle; ///< @brief Roll angle during wait state.
|
||||||
/* 0x17E4 */ u8 field_0x17e4[0x17e8 - 0x17e4];
|
/* 0x17E4 */ u8 field_0x17e4[0x17e8 - 0x17e4];
|
||||||
/* 0x17E8 */ f32 ride_speed_max; ///< @brief Speed rate for riding calculations.
|
/* 0x17E8 */ f32 ride_speed_max; ///< @brief Speed rate for riding calculations.
|
||||||
|
#if TARGET_PC
|
||||||
|
cXyz himo_mat_interp_prev[2][16];
|
||||||
|
cXyz himo_mat_interp_curr[2][16];
|
||||||
|
cXyz himo_tex_interp_prev[2];
|
||||||
|
cXyz himo_tex_interp_curr[2];
|
||||||
|
bool himo_interp_prev_valid;
|
||||||
|
bool himo_interp_curr_valid;
|
||||||
|
s8 demo_cam_sync_ticks;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
STATIC_ASSERT(sizeof(e_wb_class) == 0x17EC);
|
STATIC_ASSERT(sizeof(e_wb_class) == 0x17EC);
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ public:
|
|||||||
/* 0x164 */ cXyz mMinVal;
|
/* 0x164 */ cXyz mMinVal;
|
||||||
/* 0x170 */ cXyz mMaxVal;
|
/* 0x170 */ cXyz mMaxVal;
|
||||||
/* 0x17C */ cXyz mViewScale;
|
/* 0x17C */ cXyz mViewScale;
|
||||||
|
#if TARGET_PC
|
||||||
|
bool mbReset = false;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
|
|||||||
#define THP_TEXTURE_SET_COUNT 3
|
#define THP_TEXTURE_SET_COUNT 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
namespace dusk {
|
||||||
|
void MoviePlayerShutdown();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct daMP_THPPlayer {
|
struct daMP_THPPlayer {
|
||||||
/* 0x000 */ DVDFileInfo fileInfo;
|
/* 0x000 */ DVDFileInfo fileInfo;
|
||||||
/* 0x03C */ THPHeader header;
|
/* 0x03C */ THPHeader header;
|
||||||
|
|||||||
@@ -68,10 +68,8 @@ public:
|
|||||||
/* 0x904 */ cXyz field_0x904[2];
|
/* 0x904 */ cXyz field_0x904[2];
|
||||||
/* 0x91C */ int field_0x91c;
|
/* 0x91C */ int field_0x91c;
|
||||||
/* 0x920 */ cXyz field_0x920[63];
|
/* 0x920 */ cXyz field_0x920[63];
|
||||||
/* 0xC14 */ f32 field_0xc14[4];
|
/* 0xC14 */ f32 field_0xc14[63];
|
||||||
/* 0xC24 */ u8 field_0xc24[0xd10 - 0xc24];
|
/* 0xD10 */ s8 field_0xd10[64];
|
||||||
/* 0xD10 */ s8 field_0xd10[4];
|
|
||||||
/* 0xD14 */ u8 field_0xd14[0xd50 - 0xd14];
|
|
||||||
/* 0xD50 */ mDoExt_3DlineMat1_c field_0xd50;
|
/* 0xD50 */ mDoExt_3DlineMat1_c field_0xd50;
|
||||||
/* 0xD8C */ int field_0xd8c;
|
/* 0xD8C */ int field_0xd8c;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4834,8 +4834,7 @@ inline void dComIfGd_drawXluListDark() {
|
|||||||
inline void dComIfGd_drawXluListInvisible() {
|
inline void dComIfGd_drawXluListInvisible() {
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
if (dusk::getSettings().game.enableWaterRefraction &&
|
if (!dusk::getSettings().game.disableWaterRefraction) {
|
||||||
!dusk::getSettings().game.enableFrameInterpolation) {
|
|
||||||
#endif
|
#endif
|
||||||
g_dComIfG_gameInfo.drawlist.drawXluListInvisible();
|
g_dComIfG_gameInfo.drawlist.drawXluListInvisible();
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
@@ -4846,8 +4845,7 @@ inline void dComIfGd_drawXluListInvisible() {
|
|||||||
inline void dComIfGd_drawOpaListInvisible() {
|
inline void dComIfGd_drawOpaListInvisible() {
|
||||||
ZoneScoped;
|
ZoneScoped;
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
if (dusk::getSettings().game.enableWaterRefraction &&
|
if (!dusk::getSettings().game.disableWaterRefraction) {
|
||||||
!dusk::getSettings().game.enableFrameInterpolation) {
|
|
||||||
#endif
|
#endif
|
||||||
g_dComIfG_gameInfo.drawlist.drawOpaListInvisible();
|
g_dComIfG_gameInfo.drawlist.drawOpaListInvisible();
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
|
|||||||
@@ -209,6 +209,10 @@ public:
|
|||||||
/* 0x04 */ TGXTexObj* mpTexObj;
|
/* 0x04 */ TGXTexObj* mpTexObj;
|
||||||
/* 0x08 */ Mtx mVolumeMtx;
|
/* 0x08 */ Mtx mVolumeMtx;
|
||||||
/* 0x38 */ Mtx mMtx;
|
/* 0x38 */ Mtx mMtx;
|
||||||
|
#if TARGET_PC
|
||||||
|
const void* mVolumeMtxKey;
|
||||||
|
const void* mMtxKey;
|
||||||
|
#endif
|
||||||
}; // Size: 0x68
|
}; // Size: 0x68
|
||||||
|
|
||||||
struct cBgD_Vtx_t;
|
struct cBgD_Vtx_t;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
|
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
|
||||||
|
|
||||||
class dFile_info_c;
|
class dFile_info_c;
|
||||||
|
class J2DPicture;
|
||||||
|
|
||||||
class dDlst_FileSel_c : public dDlst_base_c {
|
class dDlst_FileSel_c : public dDlst_base_c {
|
||||||
public:
|
public:
|
||||||
@@ -113,6 +114,14 @@ public:
|
|||||||
/* 0x04 */ J2DScreen* Scr3m;
|
/* 0x04 */ J2DScreen* Scr3m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class dDlst_FileSelFade_c : public dDlst_base_c {
|
||||||
|
public:
|
||||||
|
void draw();
|
||||||
|
virtual ~dDlst_FileSelFade_c() {}
|
||||||
|
|
||||||
|
/* 0x04 */ J2DPicture* mpPict;
|
||||||
|
};
|
||||||
|
|
||||||
class dFs_HIO_c : public JORReflexible {
|
class dFs_HIO_c : public JORReflexible {
|
||||||
public:
|
public:
|
||||||
dFs_HIO_c();
|
dFs_HIO_c();
|
||||||
@@ -676,6 +685,9 @@ public:
|
|||||||
#if PLATFORM_GCN
|
#if PLATFORM_GCN
|
||||||
/* 0x2378 */ J2DPicture* mpFadePict;
|
/* 0x2378 */ J2DPicture* mpFadePict;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dDlst_FileSelFade_c mFadeDlst;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||||
/* 0x2376 */ u8 field_0x2376[SAVEFILE_SIZE];
|
/* 0x2376 */ u8 field_0x2376[SAVEFILE_SIZE];
|
||||||
@@ -684,6 +696,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C + sizeof(dDlst_FileSelFade_c));
|
||||||
|
#else
|
||||||
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C);
|
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* D_FILE_D_FILE_SELECT_H */
|
#endif /* D_FILE_D_FILE_SELECT_H */
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ public:
|
|||||||
/* 0x8 */ BE(u16) mAreaName;
|
/* 0x8 */ BE(u16) mAreaName;
|
||||||
/* 0xA */ u8 mCount;
|
/* 0xA */ u8 mCount;
|
||||||
#ifdef _MSVC_LANG
|
#ifdef _MSVC_LANG
|
||||||
u8* __get_mRoomNos() const { return (u8*)(this + 1); }
|
// Room numbers start at offset 0xB (right after mCount), NOT at sizeof(data)=12.
|
||||||
|
// (u8*)(this+1) would give offset 12 because MSVC sizeof=12; use &mCount+1 instead.
|
||||||
|
u8* __get_mRoomNos() const { return (u8*)&mCount + 1; }
|
||||||
__declspec(property(get = __get_mRoomNos)) u8* mRoomNos;
|
__declspec(property(get = __get_mRoomNos)) u8* mRoomNos;
|
||||||
#else
|
#else
|
||||||
/* 0xB */ u8 mRoomNos[0];
|
/* 0xB */ u8 mRoomNos[0];
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ private:
|
|||||||
/* 0x6D1 */ u8 field_0x6d1;
|
/* 0x6D1 */ u8 field_0x6d1;
|
||||||
/* 0x6D2 */ u8 field_0x6d2;
|
/* 0x6D2 */ u8 field_0x6d2;
|
||||||
/* 0x6D3 */ u8 field_0x6d3;
|
/* 0x6D3 */ u8 field_0x6d3;
|
||||||
|
#if TARGET_PC
|
||||||
|
f32 mSelectItemSlideElapsed[4];
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* D_MENU_D_MENU_RING_H */
|
#endif /* D_MENU_D_MENU_RING_H */
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ public:
|
|||||||
mPositionY = y;
|
mPositionY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
void refreshAspectScale();
|
||||||
|
#endif
|
||||||
|
|
||||||
void onUpdateFlag() { mUpdateFlag = true; }
|
void onUpdateFlag() { mUpdateFlag = true; }
|
||||||
|
|
||||||
void resetUpdateFlag() { mUpdateFlag = false; }
|
void resetUpdateFlag() { mUpdateFlag = false; }
|
||||||
@@ -79,6 +83,9 @@ private:
|
|||||||
/* 0x58 */ f32 mPositionX;
|
/* 0x58 */ f32 mPositionX;
|
||||||
/* 0x5C */ f32 mPositionY;
|
/* 0x5C */ f32 mPositionY;
|
||||||
/* 0x60 */ f32 mParam1;
|
/* 0x60 */ f32 mParam1;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
f32 mBaseParam1;
|
||||||
|
#endif
|
||||||
/* 0x64 */ f32 mParam2;
|
/* 0x64 */ f32 mParam2;
|
||||||
/* 0x68 */ f32 mParam3;
|
/* 0x68 */ f32 mParam3;
|
||||||
/* 0x6C */ f32 mParam4;
|
/* 0x6C */ f32 mParam4;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ namespace dusk::audio {
|
|||||||
|
|
||||||
void SetMasterVolume(f32 value);
|
void SetMasterVolume(f32 value);
|
||||||
|
|
||||||
|
void SetPaused(bool paused);
|
||||||
|
|
||||||
u32 GetResetCount(int channelIdx);
|
u32 GetResetCount(int channelIdx);
|
||||||
|
|
||||||
f32 VolumeFromU16(u16 value);
|
f32 VolumeFromU16(u16 value);
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef DUSK_DISCORD_RPC
|
||||||
|
|
||||||
|
namespace dusk {
|
||||||
|
namespace discord {
|
||||||
|
|
||||||
|
void Initialize();
|
||||||
|
|
||||||
|
void RunCallbacks();
|
||||||
|
|
||||||
|
void UpdatePresence();
|
||||||
|
|
||||||
|
void Shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // DUSK_DISCORD_RPC
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "aurora/gfx.h"
|
#include "aurora/gfx.h"
|
||||||
|
|
||||||
extern AuroraInfo auroraInfo;
|
extern AuroraInfo auroraInfo;
|
||||||
extern const char* configPath;
|
|
||||||
|
|
||||||
namespace dusk {
|
namespace dusk {
|
||||||
extern AuroraStats lastFrameAuroraStats;
|
extern AuroraStats lastFrameAuroraStats;
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
#ifndef DUSK_FRAME_INTERP_H
|
#pragma once
|
||||||
#define DUSK_FRAME_INTERP_H
|
|
||||||
|
|
||||||
#include <dolphin/mtx.h>
|
#include <dolphin/mtx.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
struct cXyz;
|
|
||||||
class camera_process_class;
|
class camera_process_class;
|
||||||
|
class view_class;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
namespace dusk {
|
namespace dusk {
|
||||||
@@ -15,36 +14,39 @@ namespace frame_interp {
|
|||||||
|
|
||||||
void ensure_initialized();
|
void ensure_initialized();
|
||||||
|
|
||||||
void begin_record_camera();
|
|
||||||
void begin_record();
|
void begin_record();
|
||||||
void end_record();
|
void end_record();
|
||||||
void interpolate(float step);
|
void begin_sim_tick();
|
||||||
|
void begin_frame(bool enabled, bool is_sim_frame, float step);
|
||||||
|
void interpolate();
|
||||||
float get_interpolation_step();
|
float get_interpolation_step();
|
||||||
|
|
||||||
void notify_presentation_frame();
|
|
||||||
void request_presentation_sync();
|
void request_presentation_sync();
|
||||||
bool presentation_sync_active();
|
bool presentation_sync_active();
|
||||||
|
|
||||||
void notify_sim_tick_complete();
|
bool is_enabled();
|
||||||
uint32_t begin_presentation_ui_pass();
|
|
||||||
uint32_t get_presentation_ui_advance_ticks();
|
// TODO: These should be phased out as UI is progressively updated to use game_clock
|
||||||
void end_presentation_ui_pass();
|
void set_ui_tick_pending(bool value);
|
||||||
|
bool get_ui_tick_pending();
|
||||||
|
|
||||||
|
bool is_sim_frame();
|
||||||
|
|
||||||
void open_child(const void* key, int32_t id);
|
|
||||||
void close_child();
|
|
||||||
void record_camera(::camera_process_class* cam, int camera_id);
|
void record_camera(::camera_process_class* cam, int camera_id);
|
||||||
void record_final_mtx_raw(const Mtx* dest, const Mtx src);
|
void interp_view(::view_class* view);
|
||||||
void record_final_mtx_raw_tagged(const Mtx* dest, const Mtx src, uint64_t stable_tag);
|
void record_final_mtx(Mtx m, const void *key);
|
||||||
|
void record_final_mtx(Mtx m);
|
||||||
|
|
||||||
bool lookup_replacement(const void* source, Mtx out);
|
bool lookup_replacement(const void* key, Mtx out);
|
||||||
bool lookup_concat_replacement(const void* lhs, const void* rhs, Mtx out);
|
bool lookup_concat_replacement(const void* lhs, const void* rhs, Mtx out);
|
||||||
|
|
||||||
void camera_eye_from_view_mtx(MtxP view_mtx, cXyz* o_eye);
|
typedef void (*InterpolationCallBack)(bool isSimFrame, void* pUserWork);
|
||||||
bool build_star_view(Mtx o_view, Mtx o_cam_billboard_base, cXyz* o_anchor_eye, float* o_fovy);
|
// call on a sim tick, will get called during presentation
|
||||||
|
void add_interpolation_callback(InterpolationCallBack pCallBack, void* pUserWork);
|
||||||
|
|
||||||
|
void begin_presentation_camera();
|
||||||
|
void end_presentation_camera();
|
||||||
|
|
||||||
uint64_t alloc_simple_shadow_pair_base();
|
|
||||||
} // namespace frame_interp
|
} // namespace frame_interp
|
||||||
} // namespace dusk
|
} // namespace dusk
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace dusk::game_clock {
|
||||||
|
|
||||||
|
void ensure_initialized();
|
||||||
|
void reset_frame_timer();
|
||||||
|
|
||||||
|
constexpr float sim_pace() { return 1.0f / 30.0f; }
|
||||||
|
constexpr float period_for_original_frames(float frame_count) { return frame_count * sim_pace(); }
|
||||||
|
constexpr float ui_maximum_dt() { return 0.05f; }
|
||||||
|
constexpr float ui_initial_dt() { return 1.0f / 60.0f; }
|
||||||
|
|
||||||
|
struct MainLoopPacer {
|
||||||
|
float presentation_dt_seconds;
|
||||||
|
bool is_interpolating;
|
||||||
|
int sim_ticks_to_run;
|
||||||
|
float sim_pace;
|
||||||
|
};
|
||||||
|
|
||||||
|
MainLoopPacer advance_main_loop();
|
||||||
|
void commit_sim_tick();
|
||||||
|
float sample_interpolation_step();
|
||||||
|
|
||||||
|
float consume_interval(const void* consumer);
|
||||||
|
|
||||||
|
} // namespace dusk::game_clock
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef DUSK_GYRO_H
|
||||||
|
#define DUSK_GYRO_H
|
||||||
|
|
||||||
|
namespace dusk::gyro {
|
||||||
|
void read(float dt);
|
||||||
|
void getAimDeltas(float& out_yaw, float& out_pitch);
|
||||||
|
bool queryGyroAimContext();
|
||||||
|
|
||||||
|
void rollgoalTick(bool play_active, s16 camera_yaw);
|
||||||
|
void rollgoalTableOffset(s16& out_ax, s16& out_az);
|
||||||
|
|
||||||
|
extern bool s_sensor_keep_alive;
|
||||||
|
bool get_sensor_keep_alive();
|
||||||
|
void set_sensor_keep_alive(bool value);
|
||||||
|
} // namespace dusk::gyro
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#ifndef DUSK_GYRO_AIM_H
|
|
||||||
#define DUSK_GYRO_AIM_H
|
|
||||||
|
|
||||||
namespace dusk::gyro_aim {
|
|
||||||
void read(float dt, bool context_active);
|
|
||||||
void consumeAimDeltas(float& out_yaw_rad, float& out_pitch_rad);
|
|
||||||
bool queryGyroAimItemContext();
|
|
||||||
} // namespace dusk::gyro_aim
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -4,10 +4,12 @@
|
|||||||
#include <aurora/aurora.h>
|
#include <aurora/aurora.h>
|
||||||
#include <aurora/lib/logging.hpp>
|
#include <aurora/lib/logging.hpp>
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message, unsigned int len);
|
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message, unsigned int len);
|
||||||
|
|
||||||
namespace dusk {
|
namespace dusk {
|
||||||
void InitializeFileLogging(const char* configDir, AuroraLogLevel logLevel);
|
void InitializeFileLogging(const std::filesystem::path& configDir, AuroraLogLevel logLevel);
|
||||||
void ShutdownFileLogging();
|
void ShutdownFileLogging();
|
||||||
const char* GetLogFilePath();
|
const char* GetLogFilePath();
|
||||||
void SendToStubLog(AuroraLogLevel level, const char* module, const char* message);
|
void SendToStubLog(AuroraLogLevel level, const char* module, const char* message);
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
#ifndef DUSK_MAIN_H
|
#ifndef DUSK_MAIN_H
|
||||||
#define DUSK_MAIN_H
|
#define DUSK_MAIN_H
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
namespace dusk {
|
namespace dusk {
|
||||||
extern bool IsRunning;
|
extern bool IsRunning;
|
||||||
extern bool IsShuttingDown;
|
extern bool IsShuttingDown;
|
||||||
extern bool IsGameLaunched;
|
extern bool IsGameLaunched;
|
||||||
|
extern bool IsFocusPaused;
|
||||||
|
extern std::filesystem::path ConfigPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DUSK_MAIN_H
|
#endif // DUSK_MAIN_H
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef DUSK_SCOPE_GUARD_HPP
|
||||||
|
#define DUSK_SCOPE_GUARD_HPP
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
class SimpleScopeGuard {
|
||||||
|
public:
|
||||||
|
// Store the function in the constructor
|
||||||
|
explicit SimpleScopeGuard(const std::function<void()>& func) : m_func(func) {}
|
||||||
|
|
||||||
|
// Run the function when the object goes out of scope
|
||||||
|
~SimpleScopeGuard() {
|
||||||
|
if (m_func) m_func();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::function<void()> m_func;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //DUSK_SCOPE_GUARD_HPP
|
||||||
+23
-5
@@ -61,19 +61,23 @@ struct UserSettings {
|
|||||||
ConfigVar<bool> noMissClimbing;
|
ConfigVar<bool> noMissClimbing;
|
||||||
ConfigVar<bool> fastTears;
|
ConfigVar<bool> fastTears;
|
||||||
ConfigVar<bool> instantSaves;
|
ConfigVar<bool> instantSaves;
|
||||||
|
ConfigVar<bool> instantText;
|
||||||
ConfigVar<bool> sunsSong;
|
ConfigVar<bool> sunsSong;
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
ConfigVar<bool> enableMirrorMode;
|
ConfigVar<bool> enableMirrorMode;
|
||||||
ConfigVar<bool> invertCameraXAxis;
|
ConfigVar<bool> invertCameraXAxis;
|
||||||
ConfigVar<bool> disableMainHUD;
|
ConfigVar<bool> disableMainHUD;
|
||||||
|
ConfigVar<bool> pauseOnFocusLost;
|
||||||
|
|
||||||
// Graphics
|
// Graphics
|
||||||
ConfigVar<BloomMode> bloomMode;
|
ConfigVar<BloomMode> bloomMode;
|
||||||
ConfigVar<float> bloomMultiplier;
|
ConfigVar<float> bloomMultiplier;
|
||||||
ConfigVar<bool> enableWaterRefraction;
|
ConfigVar<bool> disableWaterRefraction;
|
||||||
ConfigVar<bool> enableFrameInterpolation;
|
ConfigVar<bool> enableFrameInterpolation;
|
||||||
|
ConfigVar<int> internalResolutionScale;
|
||||||
ConfigVar<int> shadowResolutionMultiplier;
|
ConfigVar<int> shadowResolutionMultiplier;
|
||||||
|
ConfigVar<bool> enableDepthOfField;
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
ConfigVar<bool> noLowHpSound;
|
ConfigVar<bool> noLowHpSound;
|
||||||
@@ -81,12 +85,25 @@ struct UserSettings {
|
|||||||
|
|
||||||
// Input
|
// Input
|
||||||
ConfigVar<bool> enableGyroAim;
|
ConfigVar<bool> enableGyroAim;
|
||||||
ConfigVar<float> gyroAimSensitivityX;
|
ConfigVar<bool> enableGyroRollgoal;
|
||||||
ConfigVar<float> gyroAimSensitivityY;
|
ConfigVar<float> gyroSensitivityX;
|
||||||
ConfigVar<bool> gyroAimInvertPitch;
|
ConfigVar<float> gyroSensitivityY;
|
||||||
ConfigVar<bool> gyroAimInvertYaw;
|
ConfigVar<float> gyroSensitivityRollgoal;
|
||||||
|
ConfigVar<float> gyroSmoothing;
|
||||||
|
ConfigVar<float> gyroDeadband;
|
||||||
|
ConfigVar<bool> gyroInvertPitch;
|
||||||
|
ConfigVar<bool> gyroInvertYaw;
|
||||||
|
|
||||||
// Cheats
|
// Cheats
|
||||||
|
ConfigVar<bool> infiniteHearts;
|
||||||
|
ConfigVar<bool> infiniteArrows;
|
||||||
|
ConfigVar<bool> infiniteBombs;
|
||||||
|
ConfigVar<bool> infiniteOil;
|
||||||
|
ConfigVar<bool> infiniteOxygen;
|
||||||
|
ConfigVar<bool> infiniteRupees;
|
||||||
|
ConfigVar<bool> moonJump;
|
||||||
|
ConfigVar<bool> superClawshot;
|
||||||
|
ConfigVar<bool> alwaysGreatspin;
|
||||||
ConfigVar<bool> enableFastIronBoots;
|
ConfigVar<bool> enableFastIronBoots;
|
||||||
ConfigVar<bool> canTransformAnywhere;
|
ConfigVar<bool> canTransformAnywhere;
|
||||||
ConfigVar<bool> fastSpinner;
|
ConfigVar<bool> fastSpinner;
|
||||||
@@ -106,6 +123,7 @@ struct UserSettings {
|
|||||||
ConfigVar<bool> showPipelineCompilation;
|
ConfigVar<bool> showPipelineCompilation;
|
||||||
ConfigVar<bool> wasPresetChosen;
|
ConfigVar<bool> wasPresetChosen;
|
||||||
ConfigVar<bool> enableCrashReporting;
|
ConfigVar<bool> enableCrashReporting;
|
||||||
|
ConfigVar<bool> duskMenuOpen;
|
||||||
} backend;
|
} backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ typedef struct leafdraw_class : base_process_class {
|
|||||||
#endif
|
#endif
|
||||||
/* 0xB8 */ leafdraw_method_class* leaf_methods;
|
/* 0xB8 */ leafdraw_method_class* leaf_methods;
|
||||||
/* 0xBC */ s8 unk_0xBC;
|
/* 0xBC */ s8 unk_0xBC;
|
||||||
/* 0xBD */ u8 unk_0xBD;
|
/* 0xBD */ u8 draw_interp_frame;
|
||||||
/* 0xBE */ draw_priority_class draw_priority;
|
/* 0xBE */ draw_priority_class draw_priority;
|
||||||
} leafdraw_class;
|
} leafdraw_class;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ typedef struct process_node_class {
|
|||||||
/* 0x0BC */ layer_class layer;
|
/* 0x0BC */ layer_class layer;
|
||||||
/* 0x0E8 */ node_list_class layer_nodelist[16];
|
/* 0x0E8 */ node_list_class layer_nodelist[16];
|
||||||
/* 0x1A8 */ s8 unk_0x1A8;
|
/* 0x1A8 */ s8 unk_0x1A8;
|
||||||
|
/* 0x1A9 */ s8 draw_interp_frame;
|
||||||
} process_node_class;
|
} process_node_class;
|
||||||
|
|
||||||
typedef struct node_process_profile_definition {
|
typedef struct node_process_profile_definition {
|
||||||
|
|||||||
@@ -125,8 +125,15 @@ public:
|
|||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
static f32 hudAspectScaleDown;
|
static f32 hudAspectScaleDown;
|
||||||
static f32 hudAspectScaleUp;
|
static f32 hudAspectScaleUp;
|
||||||
static f32 ScaleHUDXLeft(f32 baseX) { return getMinXF() + baseX; }
|
static void updateSafeAreaBounds();
|
||||||
static f32 ScaleHUDXRight(f32 baseX) { return -getMinXF() + baseX; }
|
static f32 getSafeMinXF() { return m_safeMinXF; }
|
||||||
|
static f32 getSafeMinYF() { return m_safeMinYF; }
|
||||||
|
static f32 getSafeWidthF() { return m_safeWidthF; }
|
||||||
|
static f32 getSafeHeightF() { return m_safeHeightF; }
|
||||||
|
static f32 getSafeMaxXF() { return m_safeMaxXF; }
|
||||||
|
static f32 getSafeMaxYF() { return m_safeMaxYF; }
|
||||||
|
static f32 ScaleHUDXLeft(f32 baseX) { return getSafeMinXF() + baseX; }
|
||||||
|
static f32 ScaleHUDXRight(f32 baseX) { return getSafeMaxXF() - FB_WIDTH_BASE + baseX; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void setBlureMtx(const Mtx m) {
|
static void setBlureMtx(const Mtx m) {
|
||||||
@@ -279,12 +286,7 @@ public:
|
|||||||
#if WIDESCREEN_SUPPORT
|
#if WIDESCREEN_SUPPORT
|
||||||
static void setTvSize();
|
static void setTvSize();
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
static void onWide(f32 width, f32 height);
|
|
||||||
#else
|
|
||||||
static void onWide();
|
static void onWide();
|
||||||
#endif
|
|
||||||
|
|
||||||
static void offWide();
|
static void offWide();
|
||||||
static u8 isWide();
|
static u8 isWide();
|
||||||
|
|
||||||
@@ -297,7 +299,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
static void setWindowSize(AuroraWindowSize const& size);
|
static void updateRenderSize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static TGXTexObj mFrameBufferTexObj;
|
static TGXTexObj mFrameBufferTexObj;
|
||||||
@@ -369,6 +371,15 @@ public:
|
|||||||
static int m_height;
|
static int m_height;
|
||||||
static f32 m_heightF;
|
static f32 m_heightF;
|
||||||
static f32 m_widthF;
|
static f32 m_widthF;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
static f32 m_safeMinXF;
|
||||||
|
static f32 m_safeMinYF;
|
||||||
|
static f32 m_safeMaxXF;
|
||||||
|
static f32 m_safeMaxYF;
|
||||||
|
static f32 m_safeWidthF;
|
||||||
|
static f32 m_safeHeightF;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,10 +43,6 @@ struct mDoLib_clipper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void mDoLib_project(Vec* src, Vec* dst);
|
void mDoLib_project(Vec* src, Vec* dst);
|
||||||
#if TARGET_PC
|
|
||||||
void mDoLib_project(Vec* src, Vec* dst, JGeometry::TBox2<f32> viewport);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
u32 mDoLib_setResTimgObj(ResTIMG const* res, TGXTexObj* o_texObj, u32 tlut_name,
|
u32 mDoLib_setResTimgObj(ResTIMG const* res, TGXTexObj* o_texObj, u32 tlut_name,
|
||||||
GXTlutObj* o_tlutObj);
|
GXTlutObj* o_tlutObj);
|
||||||
void mDoLib_pos2camera(Vec* src, Vec* dst);
|
void mDoLib_pos2camera(Vec* src, Vec* dst);
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ public:
|
|||||||
virtual void viewCalc();
|
virtual void viewCalc();
|
||||||
virtual ~J3DModel() {}
|
virtual ~J3DModel() {}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
static void interp_callback(bool isSimFrame, void* pUserWork);
|
||||||
|
#endif
|
||||||
|
|
||||||
J3DModelData* getModelData() { return mModelData; }
|
J3DModelData* getModelData() { return mModelData; }
|
||||||
|
|
||||||
void onFlag(u32 flag) { mFlags |= flag; }
|
void onFlag(u32 flag) { mFlags |= flag; }
|
||||||
@@ -105,9 +109,7 @@ public:
|
|||||||
void setAnmMtx(int jointNo, Mtx m) {
|
void setAnmMtx(int jointNo, Mtx m) {
|
||||||
mMtxBuffer->setAnmMtx(jointNo, m);
|
mMtxBuffer->setAnmMtx(jointNo, m);
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
dusk::frame_interp::record_final_mtx_raw(
|
dusk::frame_interp::record_final_mtx(mMtxBuffer->getAnmMtx(jointNo));
|
||||||
reinterpret_cast<const Mtx*>(mMtxBuffer->getAnmMtx(jointNo)),
|
|
||||||
mMtxBuffer->getAnmMtx(jointNo));
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }
|
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ public:
|
|||||||
void syncJ3DSysPointers() const;
|
void syncJ3DSysPointers() const;
|
||||||
void syncJ3DSysFlags() const;
|
void syncJ3DSysFlags() const;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
bool needsInterpCallBack() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual ~J3DModelData() {}
|
virtual ~J3DModelData() {}
|
||||||
|
|
||||||
void simpleCalcMaterial(Mtx mtx) { simpleCalcMaterial(0, mtx); }
|
void simpleCalcMaterial(Mtx mtx) { simpleCalcMaterial(0, mtx); }
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public:
|
|||||||
void copy(J3DMaterial*);
|
void copy(J3DMaterial*);
|
||||||
s32 newSharedDisplayList(u32);
|
s32 newSharedDisplayList(u32);
|
||||||
s32 newSingleSharedDisplayList(u32);
|
s32 newSingleSharedDisplayList(u32);
|
||||||
|
#if TARGET_PC
|
||||||
|
bool needsInterpCallBack() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual void calc(f32 const (*)[4]);
|
virtual void calc(f32 const (*)[4]);
|
||||||
virtual void calcDiffTexMtx(f32 const (*)[4]);
|
virtual void calcDiffTexMtx(f32 const (*)[4]);
|
||||||
@@ -46,7 +49,6 @@ public:
|
|||||||
virtual void change();
|
virtual void change();
|
||||||
|
|
||||||
J3DMaterial() { initialize(); }
|
J3DMaterial() { initialize(); }
|
||||||
~J3DMaterial() {}
|
|
||||||
J3DMaterial* getNext() { return mNext; }
|
J3DMaterial* getNext() { return mNext; }
|
||||||
J3DShape* getShape() { return mShape; }
|
J3DShape* getShape() { return mShape; }
|
||||||
J3DTevBlock* getTevBlock() { return mTevBlock; }
|
J3DTevBlock* getTevBlock() { return mTevBlock; }
|
||||||
|
|||||||
@@ -101,10 +101,6 @@ public:
|
|||||||
|
|
||||||
void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; }
|
void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; }
|
||||||
void setFader(JUTFader* fader) { mFader = fader; }
|
void setFader(JUTFader* fader) { mFader = fader; }
|
||||||
#ifdef TARGET_PC
|
|
||||||
// For frame interpolation
|
|
||||||
void setFaderSimSteps(u32 steps);
|
|
||||||
#endif
|
|
||||||
void resetFader() { setFader(NULL); }
|
void resetFader() { setFader(NULL); }
|
||||||
JUTFader* getFader() const { return mFader; }
|
JUTFader* getFader() const { return mFader; }
|
||||||
void setClearColor(JUtility::TColor color) { mClearColor = color; }
|
void setClearColor(JUtility::TColor color) { mClearColor = color; }
|
||||||
|
|||||||
@@ -11,8 +11,10 @@
|
|||||||
class JUTFader {
|
class JUTFader {
|
||||||
public:
|
public:
|
||||||
enum EStatus {
|
enum EStatus {
|
||||||
UNKSTATUS_M1 = -1,
|
None,
|
||||||
UNKSTATUS_0 = 0,
|
Wait,
|
||||||
|
FadeIn,
|
||||||
|
FadeOut,
|
||||||
};
|
};
|
||||||
|
|
||||||
JUTFader(int, int, int, int, JUtility::TColor);
|
JUTFader(int, int, int, int, JUtility::TColor);
|
||||||
@@ -29,12 +31,12 @@ public:
|
|||||||
void setColor(JUtility::TColor color) { mColor.set(color); }
|
void setColor(JUtility::TColor color) { mColor.set(color); }
|
||||||
|
|
||||||
/* 0x04 */ s32 mStatus;
|
/* 0x04 */ s32 mStatus;
|
||||||
/* 0x08 */ u16 field_0x8;
|
/* 0x08 */ u16 mDuration;
|
||||||
/* 0x0A */ u16 field_0xa;
|
/* 0x0A */ u16 mTimer;
|
||||||
/* 0x0C */ JUtility::TColor mColor;
|
/* 0x0C */ JUtility::TColor mColor;
|
||||||
/* 0x10 */ JGeometry::TBox2<f32> mBox;
|
/* 0x10 */ JGeometry::TBox2<f32> mBox;
|
||||||
/* 0x20 */ int mEStatus;
|
/* 0x20 */ int mStatusTimer;
|
||||||
/* 0x24 */ u32 field_0x24;
|
/* 0x24 */ u32 mNextStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* JUTFADER_H */
|
#endif /* JUTFADER_H */
|
||||||
|
|||||||
@@ -33,24 +33,16 @@ public:
|
|||||||
static void postRetraceProc(u32);
|
static void postRetraceProc(u32);
|
||||||
static void drawDoneCallback();
|
static void drawDoneCallback();
|
||||||
|
|
||||||
u16 getFbWidth() const {
|
u16 getFbWidth() const { return mRenderObj->fbWidth; }
|
||||||
#if TARGET_PC
|
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
|
||||||
return m_WindowSize.fb_width;
|
|
||||||
#else
|
|
||||||
return mRenderObj->fbWidth;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
u16 getEfbHeight() const {
|
|
||||||
#if TARGET_PC
|
|
||||||
return m_WindowSize.fb_height;
|
|
||||||
#else
|
|
||||||
return mRenderObj->efbHeight;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void getBounds(u16& width, u16& height) const {
|
void getBounds(u16& width, u16& height) const {
|
||||||
width = (u16)getFbWidth();
|
width = (u16)getFbWidth();
|
||||||
height = (u16)getEfbHeight();
|
height = (u16)getEfbHeight();
|
||||||
}
|
}
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
u32 getRenderWidth() const { return mRenderWidth; }
|
||||||
|
u32 getRenderHeight() const { return mRenderHeight; }
|
||||||
|
#endif
|
||||||
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
||||||
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
||||||
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
||||||
@@ -63,7 +55,7 @@ public:
|
|||||||
|
|
||||||
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
void setWindowSize(AuroraWindowSize const& size);
|
void setRenderSize(u32 width, u32 height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -89,7 +81,8 @@ private:
|
|||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
public:
|
public:
|
||||||
AuroraWindowSize m_WindowSize;
|
u32 mRenderWidth;
|
||||||
|
u32 mRenderHeight;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,6 @@ void J2DGrafContext::setup2D() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void J2DGrafContext::setScissor() {
|
void J2DGrafContext::setScissor() {
|
||||||
#if TARGET_PC
|
|
||||||
GXSetScissor(mScissorBounds.i.x, mScissorBounds.i.y, mScissorBounds.getWidth(),
|
|
||||||
mScissorBounds.getHeight());
|
|
||||||
#else
|
|
||||||
JGeometry::TBox2<f32> bounds(0, 0, 1024, 1024);
|
JGeometry::TBox2<f32> bounds(0, 0, 1024, 1024);
|
||||||
JGeometry::TBox2<f32> curBounds(mScissorBounds);
|
JGeometry::TBox2<f32> curBounds(mScissorBounds);
|
||||||
mScissorBounds.intersect(bounds);
|
mScissorBounds.intersect(bounds);
|
||||||
@@ -81,7 +77,6 @@ void J2DGrafContext::setScissor() {
|
|||||||
} else {
|
} else {
|
||||||
GXSetScissor(0, 0, 0, 0);
|
GXSetScissor(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
||||||
|
|||||||
@@ -97,6 +97,16 @@ s32 J3DModel::entryModelData(J3DModelData* pModelData, u32 mdlFlags, u32 mtxNum)
|
|||||||
return kJ3DError_Success;
|
return kJ3DError_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
void J3DModel::interp_callback(bool isSimFrame, void* pUserWork) {
|
||||||
|
J3DModel* i_this = static_cast<J3DModel*>(pUserWork);
|
||||||
|
if (!isSimFrame) {
|
||||||
|
i_this->calcMaterial();
|
||||||
|
i_this->diff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
s32 J3DModel::createShapePacket(J3DModelData* pModelData) {
|
s32 J3DModel::createShapePacket(J3DModelData* pModelData) {
|
||||||
J3D_ASSERTMSG(173, pModelData != NULL, "Error : null pointer.");
|
J3D_ASSERTMSG(173, pModelData != NULL, "Error : null pointer.");
|
||||||
|
|
||||||
@@ -452,11 +462,11 @@ void J3DModel::calc() {
|
|||||||
|
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
for (u16 i = 0; i < mModelData->getJointNum(); ++i) {
|
for (u16 i = 0; i < mModelData->getJointNum(); ++i) {
|
||||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(getAnmMtx(i)), getAnmMtx(i));
|
dusk::frame_interp::record_final_mtx(getAnmMtx(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u16 i = 0; i < mModelData->getWEvlpMtxNum(); ++i) {
|
for (u16 i = 0; i < mModelData->getWEvlpMtxNum(); ++i) {
|
||||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(getWeightAnmMtx(i)), getWeightAnmMtx(i));
|
dusk::frame_interp::record_final_mtx(getWeightAnmMtx(i));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -485,6 +495,11 @@ void J3DModel::entry() {
|
|||||||
joint->entryIn();
|
joint->entryIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (mModelData->needsInterpCallBack())
|
||||||
|
dusk::frame_interp::add_interpolation_callback(&J3DModel::interp_callback, this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void J3DModel::viewCalc() {
|
void J3DModel::viewCalc() {
|
||||||
@@ -496,7 +511,7 @@ void J3DModel::viewCalc() {
|
|||||||
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
||||||
(MtxP)&mInternalView);
|
(MtxP)&mInternalView);
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
dusk::frame_interp::record_final_mtx_raw(&mInternalView, mInternalView);
|
dusk::frame_interp::record_final_mtx(mInternalView);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (isCpuSkinningOn()) {
|
} else if (isCpuSkinningOn()) {
|
||||||
@@ -504,7 +519,7 @@ void J3DModel::viewCalc() {
|
|||||||
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
||||||
(MtxP)&mInternalView);
|
(MtxP)&mInternalView);
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
dusk::frame_interp::record_final_mtx_raw(&mInternalView, mInternalView);
|
dusk::frame_interp::record_final_mtx(mInternalView);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else if (checkFlag(J3DMdlFlag_SkinPosCpu)) {
|
} else if (checkFlag(J3DMdlFlag_SkinPosCpu)) {
|
||||||
@@ -528,7 +543,7 @@ void J3DModel::viewCalc() {
|
|||||||
|
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
for (u16 i = 0; i < mModelData->getDrawMtxNum(); ++i) {
|
for (u16 i = 0; i < mModelData->getDrawMtxNum(); ++i) {
|
||||||
dusk::frame_interp::record_final_mtx_raw(&getDrawMtxPtr()[i], getDrawMtxPtr()[i]);
|
dusk::frame_interp::record_final_mtx(getDrawMtxPtr()[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,15 @@ void J3DModelData::simpleCalcMaterial(u16 idx, Mtx param_1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
bool J3DModelData::needsInterpCallBack() const {
|
||||||
|
for (u16 i = 0, n = getMaterialNum(); i < n; i++)
|
||||||
|
if (getMaterialNodePointer(i)->needsInterpCallBack())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void J3DModelData::syncJ3DSysPointers() const {
|
void J3DModelData::syncJ3DSysPointers() const {
|
||||||
j3dSys.setTexture(getTexture());
|
j3dSys.setTexture(getTexture());
|
||||||
j3dSys.setVtxPos(getVtxPosArray(), getVtxNum());
|
j3dSys.setVtxPos(getVtxPosArray(), getVtxNum());
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ void J3DMaterial::diff(u32 diffFlags) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void J3DMaterial::calc(f32 const (*param_0)[4]) {
|
void J3DMaterial::calc(f32 const (*param_0)[4]) {
|
||||||
if (j3dSys.checkFlag(0x40000000)) {
|
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||||
mTexGenBlock->calcPostTexMtx(param_0);
|
mTexGenBlock->calcPostTexMtx(param_0);
|
||||||
} else {
|
} else {
|
||||||
mTexGenBlock->calc(param_0);
|
mTexGenBlock->calc(param_0);
|
||||||
@@ -276,7 +276,7 @@ void J3DMaterial::calc(f32 const (*param_0)[4]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void J3DMaterial::calcDiffTexMtx(f32 const (*param_0)[4]) {
|
void J3DMaterial::calcDiffTexMtx(f32 const (*param_0)[4]) {
|
||||||
if (j3dSys.checkFlag(0x40000000)) {
|
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||||
mTexGenBlock->calcPostTexMtxWithoutViewMtx(param_0);
|
mTexGenBlock->calcPostTexMtxWithoutViewMtx(param_0);
|
||||||
} else {
|
} else {
|
||||||
mTexGenBlock->calcWithoutViewMtx(param_0);
|
mTexGenBlock->calcWithoutViewMtx(param_0);
|
||||||
@@ -288,7 +288,7 @@ void J3DMaterial::setCurrentMtx() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void J3DMaterial::calcCurrentMtx() {
|
void J3DMaterial::calcCurrentMtx() {
|
||||||
if (!j3dSys.checkFlag(0x40000000)) {
|
if (!j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||||
mCurrentMtx.setCurrentTexMtx(
|
mCurrentMtx.setCurrentTexMtx(
|
||||||
getTexCoord(0)->getTexGenMtx(),
|
getTexCoord(0)->getTexGenMtx(),
|
||||||
getTexCoord(1)->getTexGenMtx(),
|
getTexCoord(1)->getTexGenMtx(),
|
||||||
@@ -371,6 +371,30 @@ s32 J3DMaterial::newSingleSharedDisplayList(u32 dlSize) {
|
|||||||
return kJ3DError_Success;
|
return kJ3DError_Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
bool J3DMaterial::needsInterpCallBack() const {
|
||||||
|
for (int i = 0, n = getTexGenNum(); i < n; i++) {
|
||||||
|
J3DTexMtx* pTexMtx = mTexGenBlock->getTexMtx(i);
|
||||||
|
if (pTexMtx != NULL) {
|
||||||
|
u32 texMtxMode = pTexMtx->getTexMtxInfo().mInfo & 0x3f;
|
||||||
|
|
||||||
|
// uses j3dSys.getViewMtx()
|
||||||
|
switch (texMtxMode) {
|
||||||
|
case J3DTexMtxMode_EnvmapBasic:
|
||||||
|
case J3DTexMtxMode_EnvmapOld:
|
||||||
|
case J3DTexMtxMode_Envmap:
|
||||||
|
case J3DTexMtxMode_ProjmapBasic:
|
||||||
|
case J3DTexMtxMode_Projmap:
|
||||||
|
case J3DTexMtxMode_ViewProjmap:
|
||||||
|
case J3DTexMtxMode_ViewProjmapBasic:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void J3DPatchedMaterial::initialize() {
|
void J3DPatchedMaterial::initialize() {
|
||||||
J3DMaterial::initialize();
|
J3DMaterial::initialize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ void loadTexCoordGens(u32 texGenNum, J3DTexCoord* texCoords) {
|
|||||||
var_r28 = 61;
|
var_r28 = 61;
|
||||||
J3DGDWriteXFCmdHdr(GX_XF_REG_DUALTEX0, texGenNum);
|
J3DGDWriteXFCmdHdr(GX_XF_REG_DUALTEX0, texGenNum);
|
||||||
|
|
||||||
if (j3dSys.checkFlag(0x40000000)) {
|
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||||
for (int i = 0; i < texGenNum; i++) {
|
for (int i = 0; i < texGenNum; i++) {
|
||||||
if (texCoords[i].getTexGenMtx() != 60) {
|
if (texCoords[i].getTexGenMtx() != GX_IDENTITY) {
|
||||||
var_r28 = i * 3;
|
var_r28 = i * 3;
|
||||||
} else {
|
} else {
|
||||||
var_r28 = 61;
|
var_r28 = 61;
|
||||||
|
|||||||
@@ -120,11 +120,19 @@ void JAISeqMgr::mixOut() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JAISeq* JAISeqMgr::beginStartSeq_() {
|
JAISeq* JAISeqMgr::beginStartSeq_() {
|
||||||
JAISeq* seq = JKR_NEW JAISeq(this, field_0x10);
|
#ifdef TARGET_PC
|
||||||
|
if (JAISeq::getFreeMemCount() == 0) {
|
||||||
|
JUT_WARN(273, "%s", "JASPoolAllocObject::<JAISeq>::operator new failed .\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return JKR_NEW JAISeq(this, field_0x10);
|
||||||
|
#else
|
||||||
|
JAISeq* seq = new JAISeq(this, field_0x10);
|
||||||
if (seq == NULL) {
|
if (seq == NULL) {
|
||||||
JUT_WARN(273, "%s", "JASPoolAllocObject::<JAISeq>::operator new failed .\n");
|
JUT_WARN(273, "%s", "JASPoolAllocObject::<JAISeq>::operator new failed .\n");
|
||||||
}
|
}
|
||||||
return seq;
|
return seq;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JAISeqMgr::endStartSeq_(JAISeq* seq, JAISoundHandle* handle) {
|
bool JAISeqMgr::endStartSeq_(JAISeq* seq, JAISoundHandle* handle) {
|
||||||
|
|||||||
@@ -205,14 +205,6 @@ void JFWDisplay::preGX() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TARGET_PC
|
|
||||||
static s32 s_faderSimSteps = -1;
|
|
||||||
|
|
||||||
void JFWDisplay::setFaderSimSteps(u32 steps) {
|
|
||||||
s_faderSimSteps = static_cast<s32>(steps);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void JFWDisplay::endGX() {
|
void JFWDisplay::endGX() {
|
||||||
s32 bufferNum = JUTXfb::getManager()->getBufferNum();
|
s32 bufferNum = JUTXfb::getManager()->getBufferNum();
|
||||||
u16 width = JUTVideo::getManager()->getFbWidth();
|
u16 width = JUTVideo::getManager()->getFbWidth();
|
||||||
@@ -224,17 +216,10 @@ void JFWDisplay::endGX() {
|
|||||||
if (mFader != NULL) {
|
if (mFader != NULL) {
|
||||||
ortho.setPort();
|
ortho.setPort();
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
u32 advance_count = 1;
|
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||||
if (dusk::getSettings().game.enableFrameInterpolation && s_faderSimSteps >= 0) {
|
|
||||||
advance_count = static_cast<u32>(s_faderSimSteps);
|
|
||||||
s_faderSimSteps = -1;
|
|
||||||
} else {
|
|
||||||
s_faderSimSteps = -1;
|
|
||||||
}
|
|
||||||
for (u32 i = 0; i < advance_count; i++) {
|
|
||||||
mFader->advance();
|
mFader->advance();
|
||||||
}
|
}
|
||||||
if (mFader->getStatus() != 1) {
|
if (mFader->getStatus() != JUTFader::Wait) {
|
||||||
mFader->draw();
|
mFader->draw();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -394,6 +379,7 @@ static void waitPrecise(Limiter& limiter, Uint64 targetNs) {
|
|||||||
static void waitForTick(u32 p1, u16 p2) {
|
static void waitForTick(u32 p1, u16 p2) {
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
||||||
|
dusk::frameUsagePct = 0.f;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (dusk::getTransientSettings().skipFrameRateLimit) {
|
if (dusk::getTransientSettings().skipFrameRateLimit) {
|
||||||
|
|||||||
@@ -314,10 +314,17 @@ void JStudio_JStage::TAdaptor_actor::getJSG_SRT_(JStudio::TControl const* pContr
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(
|
void JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(
|
||||||
f32 param_1, JStudio::TAdaptor* adaptor) const {
|
f32 param_1, JStudio::TAdaptor* adaptor) const {
|
||||||
|
#if TARGET_PC
|
||||||
|
TAdaptor_actor* actor_adaptor = static_cast<TAdaptor_actor*>(adaptor);
|
||||||
|
JStage::TActor* actor = actor_adaptor->get_pJSG_();
|
||||||
|
// field_0x8 is always hardcoded to either 305 or 309
|
||||||
|
u32 idx = (field_0x8 == 305) ? actor_adaptor->field_0x130 : actor_adaptor->field_0x134;
|
||||||
|
#else
|
||||||
JStage::TActor* actor = static_cast<TAdaptor_actor*>(adaptor)->get_pJSG_();
|
JStage::TActor* actor = static_cast<TAdaptor_actor*>(adaptor)->get_pJSG_();
|
||||||
// not sure what this bit is
|
// not sure what this bit is
|
||||||
u32 idx = *(u32*)(((uintptr_t)adaptor - 1) + field_0x8);
|
u32 idx = *(u32*)(((uintptr_t)adaptor - 1) + field_0x8);
|
||||||
|
#endif
|
||||||
u8 idx_lowBytes = idx;
|
u8 idx_lowBytes = idx;
|
||||||
u8 idx_highBytes = idx >> 8;
|
u8 idx_highBytes = idx >> 8;
|
||||||
|
|
||||||
|
|||||||
@@ -10,51 +10,51 @@
|
|||||||
|
|
||||||
JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor)
|
JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor)
|
||||||
: mColor(pColor), mBox(x, y, x + width, y + height) {
|
: mColor(pColor), mBox(x, y, x + width, y + height) {
|
||||||
mStatus = 0;
|
mStatus = None;
|
||||||
field_0x8 = 0;
|
mDuration = 0;
|
||||||
field_0xa = 0;
|
mTimer = 0;
|
||||||
field_0x24 = 0;
|
mNextStatus = 0;
|
||||||
mEStatus = UNKSTATUS_M1;
|
mStatusTimer = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JUTFader::advance() {
|
void JUTFader::advance() {
|
||||||
if (0 <= mEStatus && mEStatus-- == 0) {
|
if (0 <= mStatusTimer && mStatusTimer-- == 0) {
|
||||||
mStatus = field_0x24;
|
mStatus = mNextStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStatus == 1) {
|
if (mStatus == Wait) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mStatus) {
|
switch (mStatus) {
|
||||||
case 0:
|
case None:
|
||||||
mColor.a = 0xFF;
|
mColor.a = 0xFF;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case FadeIn:
|
||||||
#if AVOID_UB
|
#if AVOID_UB
|
||||||
if (field_0x8 == 0) {
|
if (mDuration == 0) {
|
||||||
mStatus = 1;
|
mStatus = Wait;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mColor.a = 0xFF - ((++field_0xa * 0xFF) / field_0x8);
|
mColor.a = 0xFF - ((++mTimer * 0xFF) / mDuration);
|
||||||
|
|
||||||
if (field_0xa >= field_0x8) {
|
if (mTimer >= mDuration) {
|
||||||
mStatus = 1;
|
mStatus = Wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case FadeOut:
|
||||||
#if AVOID_UB
|
#if AVOID_UB
|
||||||
if (field_0x8 == 0) {
|
if (mDuration == 0) {
|
||||||
mStatus = 0;
|
mStatus = None;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mColor.a = ((++field_0xa * 0xFF) / field_0x8);
|
mColor.a = ((++mTimer * 0xFF) / mDuration);
|
||||||
|
|
||||||
if (field_0xa >= field_0x8) {
|
if (mTimer >= mDuration) {
|
||||||
mStatus = 0;
|
mStatus = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -77,53 +77,53 @@ void JUTFader::draw() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JUTFader::startFadeIn(int param_0) {
|
bool JUTFader::startFadeIn(int duration) {
|
||||||
bool statusCheck = mStatus == 0;
|
bool statusCheck = mStatus == 0;
|
||||||
|
|
||||||
if (statusCheck) {
|
if (statusCheck) {
|
||||||
mStatus = 2;
|
mStatus = FadeIn;
|
||||||
field_0xa = 0;
|
mTimer = 0;
|
||||||
field_0x8 = param_0;
|
mDuration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
return statusCheck;
|
return statusCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JUTFader::startFadeOut(int param_0) {
|
bool JUTFader::startFadeOut(int duration) {
|
||||||
bool statusCheck = mStatus == 1;
|
bool statusCheck = mStatus == 1;
|
||||||
|
|
||||||
if (statusCheck) {
|
if (statusCheck) {
|
||||||
mStatus = 3;
|
mStatus = FadeOut;
|
||||||
field_0xa = 0;
|
mTimer = 0;
|
||||||
field_0x8 = param_0;
|
mDuration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
return statusCheck;
|
return statusCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JUTFader::setStatus(JUTFader::EStatus i_status, int param_1) {
|
void JUTFader::setStatus(JUTFader::EStatus i_status, int timer) {
|
||||||
switch (i_status) {
|
switch (i_status) {
|
||||||
case 0:
|
case None:
|
||||||
if (param_1 != 0) {
|
if (timer != 0) {
|
||||||
field_0x24 = 0;
|
mNextStatus = None;
|
||||||
mEStatus = param_1;
|
mStatusTimer = timer;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mStatus = 0;
|
mStatus = None;
|
||||||
field_0x24 = 0;
|
mNextStatus = None;
|
||||||
mEStatus = 0;
|
mStatusTimer = 0;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case Wait:
|
||||||
if (param_1 != 0) {
|
if (timer != 0) {
|
||||||
field_0x24 = 1;
|
mNextStatus = Wait;
|
||||||
mEStatus = param_1;
|
mStatusTimer = timer;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mStatus = 1;
|
mStatus = Wait;
|
||||||
field_0x24 = 1;
|
mNextStatus = Wait;
|
||||||
mEStatus = 0;
|
mStatusTimer = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,8 @@ void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
|||||||
void JUTVideo::waitRetraceIfNeed() {}
|
void JUTVideo::waitRetraceIfNeed() {}
|
||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
void JUTVideo::setWindowSize(AuroraWindowSize const& size) {
|
void JUTVideo::setRenderSize(u32 width, u32 height) {
|
||||||
m_WindowSize = size;
|
mRenderWidth = width;
|
||||||
|
mRenderHeight = height;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:appCategory="game"
|
android:appCategory="game"
|
||||||
android:icon="@android:drawable/sym_def_app_icon"
|
android:icon="@mipmap/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@android:style/Theme.NoTitleBar"
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
android:enableOnBackInvokedCallback="false">
|
android:enableOnBackInvokedCallback="false">
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,9 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>mainicon.icns</string>
|
<string>Dusk</string>
|
||||||
|
<key>CFBundleIconName</key>
|
||||||
|
<string>Dusk</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
@@ -117,8 +117,8 @@ static Z2WolfHowlLine sNewSong3[9] = {
|
|||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
static Z2WolfHowlLine sHowlTimeSong[6] = {
|
static Z2WolfHowlLine sHowlTimeSong[6] = {
|
||||||
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
|
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
|
||||||
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
|
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -368,9 +368,9 @@ void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
|
|||||||
break;
|
break;
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
case Z2WOLFHOWL_TIMESONG:
|
case Z2WOLFHOWL_TIMESONG:
|
||||||
cPitchUp = 1.259906f;
|
cPitchUp = 1.3348f;
|
||||||
cPitchCenter = 0.94387f;
|
cPitchCenter = 1.0f;
|
||||||
cPitchDown = 0.840885f;
|
cPitchDown = 0.7937f;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -4258,6 +4258,12 @@ int daAlink_c::createHeap() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
// lets try to zero-initialize the arrays instead of having garbage values
|
||||||
|
std::memset(sp1C, 0, sizeof(J3DTransformInfo) * sp38);
|
||||||
|
std::memset(sp30, 0, sizeof(Quaternion) * sp38);
|
||||||
|
#endif
|
||||||
|
|
||||||
field_0x2060 = JKR_NEW mDoExt_MtxCalcOldFrame(sp1C, sp30);
|
field_0x2060 = JKR_NEW mDoExt_MtxCalcOldFrame(sp1C, sp30);
|
||||||
if (field_0x2060 == NULL) {
|
if (field_0x2060 == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -37,18 +37,40 @@ void daAlink_c::setCrawlMoveDirectionArrow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (field_0x3198 & 4) {
|
if (field_0x3198 & 4) {
|
||||||
if (!bvar) {
|
#if TARGET_PC
|
||||||
direction |= data_80452F38;
|
if (dusk::getSettings().game.enableMirrorMode) {
|
||||||
} else {
|
if (!bvar) {
|
||||||
direction |= data_80452F39;
|
direction |= data_80452F39;
|
||||||
|
} else {
|
||||||
|
direction |= data_80452F38;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (!bvar) {
|
||||||
|
direction |= data_80452F38;
|
||||||
|
} else {
|
||||||
|
direction |= data_80452F39;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field_0x3198 & 8) {
|
if (field_0x3198 & 8) {
|
||||||
if (!bvar) {
|
#if TARGET_PC
|
||||||
direction |= data_80452F39;
|
if (dusk::getSettings().game.enableMirrorMode) {
|
||||||
} else {
|
if (!bvar) {
|
||||||
direction |= data_80452F38;
|
direction |= data_80452F38;
|
||||||
|
} else {
|
||||||
|
direction |= data_80452F39;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (!bvar) {
|
||||||
|
direction |= data_80452F39;
|
||||||
|
} else {
|
||||||
|
direction |= data_80452F38;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -817,6 +817,12 @@ BOOL daAlink_c::checkDownAttackState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL daAlink_c::checkCutLargeTurnState() const {
|
BOOL daAlink_c::checkCutLargeTurnState() const {
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.alwaysGreatspin) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return ((dComIfGs_isEventBit(dSv_event_flag_c::F_0344) || checkNoResetFlg3(FLG3_TRANING_CUT_LARGE_TURN))
|
return ((dComIfGs_isEventBit(dSv_event_flag_c::F_0344) || checkNoResetFlg3(FLG3_TRANING_CUT_LARGE_TURN))
|
||||||
&& dComIfGs_getLife() == dComIfGs_getMaxLifeGauge()
|
&& dComIfGs_getLife() == dComIfGs_getMaxLifeGauge()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -143,15 +143,18 @@ void daAlink_c::handleQuickTransform() {
|
|||||||
procCoMetamorphoseInit();
|
procCoMetamorphoseInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool daAlink_c::checkGyroAimItemContext() {
|
bool daAlink_c::checkGyroAimContext() {
|
||||||
if (checkWolf()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (mProcID) {
|
switch (mProcID) {
|
||||||
|
case PROC_SUBJECTIVITY:
|
||||||
|
case PROC_SWIM_SUBJECTIVITY:
|
||||||
|
case PROC_HORSE_SUBJECTIVITY:
|
||||||
|
case PROC_CANOE_SUBJECTIVITY:
|
||||||
|
case PROC_BOARD_SUBJECTIVITY:
|
||||||
|
case PROC_WOLF_ROPE_SUBJECTIVITY:
|
||||||
case PROC_BOW_SUBJECT:
|
case PROC_BOW_SUBJECT:
|
||||||
case PROC_BOOMERANG_SUBJECT:
|
case PROC_BOOMERANG_SUBJECT:
|
||||||
case PROC_COPY_ROD_SUBJECT:
|
case PROC_COPY_ROD_SUBJECT:
|
||||||
|
case PROC_HAWK_SUBJECT:
|
||||||
case PROC_HOOKSHOT_SUBJECT:
|
case PROC_HOOKSHOT_SUBJECT:
|
||||||
case PROC_SWIM_HOOKSHOT_SUBJECT:
|
case PROC_SWIM_HOOKSHOT_SUBJECT:
|
||||||
case PROC_HORSE_BOW_SUBJECT:
|
case PROC_HORSE_BOW_SUBJECT:
|
||||||
|
|||||||
@@ -290,6 +290,12 @@ BOOL daAlink_c::checkHookshotStickBG(cBgS_PolyInfo& i_polyinfo) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.superClawshot) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dComIfG_Bgsp().ChkPolyHSStick(i_polyinfo)) {
|
if (dComIfG_Bgsp().ChkPolyHSStick(i_polyinfo)) {
|
||||||
dBgW_Base* bgw_p = dComIfG_Bgsp().GetBgWBasePointer(i_polyinfo);
|
dBgW_Base* bgw_p = dComIfG_Bgsp().GetBgWBasePointer(i_polyinfo);
|
||||||
if (bgw_p != NULL && bgw_p->ChkPushPullOk()) {
|
if (bgw_p != NULL && bgw_p->ChkPushPullOk()) {
|
||||||
@@ -448,6 +454,12 @@ void daAlink_c::setHookshotSight() {
|
|||||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.superClawshot) {
|
||||||
|
max_length = 69420.0f;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOL line_cross = checkSightLine(max_length, &sight_pos);
|
BOOL line_cross = checkSightLine(max_length, &sight_pos);
|
||||||
|
|
||||||
if (mHookTargetAcKeep.getActor() != NULL) {
|
if (mHookTargetAcKeep.getActor() != NULL) {
|
||||||
@@ -890,6 +902,14 @@ void daAlink_c::setHookshotPos() {
|
|||||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.superClawshot) {
|
||||||
|
return_speed = 2870.0f;
|
||||||
|
shoot_speed = 2870.0f;
|
||||||
|
max_length = 69420.0f;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mItemMode == HS_MODE_RETURN_e) {
|
if (mItemMode == HS_MODE_RETURN_e) {
|
||||||
if (targetAc_p != NULL) {
|
if (targetAc_p != NULL) {
|
||||||
if (checkLv7BossRoom()) {
|
if (checkLv7BossRoom()) {
|
||||||
@@ -899,6 +919,12 @@ void daAlink_c::setHookshotPos() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.superClawshot) {
|
||||||
|
return_speed = 500.0f;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (checkModeFlg(0x400)) {
|
if (checkModeFlg(0x400)) {
|
||||||
return_speed += current.pos.abs(field_0x3798);
|
return_speed += current.pos.abs(field_0x3798);
|
||||||
}
|
}
|
||||||
@@ -1548,6 +1574,12 @@ int daAlink_c::procHookshotFly() {
|
|||||||
f32 temp_f31 = field_0x37d4.abs();
|
f32 temp_f31 = field_0x37d4.abs();
|
||||||
f32 temp_f30 = mpHIO->mItem.mHookshot.m.mStickReturnSpeed + spAC.abs(mHookshotTopPos);
|
f32 temp_f30 = mpHIO->mItem.mHookshot.m.mStickReturnSpeed + spAC.abs(mHookshotTopPos);
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.superClawshot) {
|
||||||
|
temp_f30 = 500.0f + spAC.abs(mHookshotTopPos);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (temp_f31 < temp_f30 || mProcVar1.field_0x300a == 0) {
|
if (temp_f31 < temp_f30 || mProcVar1.field_0x300a == 0) {
|
||||||
setHookshotReturnEnd();
|
setHookshotReturnEnd();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -180,12 +180,7 @@ void daAlink_c::preKandelaarDraw() {
|
|||||||
mat_p->setTevColor(2, &color);
|
mat_p->setTevColor(2, &color);
|
||||||
|
|
||||||
cXyz proj;
|
cXyz proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&mKandelaarFlamePos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&mKandelaarFlamePos, &proj);
|
mDoLib_project(&mKandelaarFlamePos, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* camera_p = dComIfGp_getCamera(0);
|
camera_process_class* camera_p = dComIfGp_getCamera(0);
|
||||||
f32 trimHeight;
|
f32 trimHeight;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "d/actor/d_a_tag_mhint.h"
|
#include "d/actor/d_a_tag_mhint.h"
|
||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
#include "dusk/gyro_aim.h"
|
#include "dusk/gyro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool daAlink_c::checkNoSubjectModeCamera() {
|
bool daAlink_c::checkNoSubjectModeCamera() {
|
||||||
@@ -130,7 +130,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
if (dusk::getSettings().game.enableGyroAim && checkGyroAimItemContext()) {
|
if (dusk::getSettings().game.enableGyroAim && checkGyroAimContext()) {
|
||||||
f32 gyro_scale = 1.0f;
|
f32 gyro_scale = 1.0f;
|
||||||
if (checkWolfEyeUp()) {
|
if (checkWolfEyeUp()) {
|
||||||
gyro_scale *= 0.6f;
|
gyro_scale *= 0.6f;
|
||||||
@@ -142,17 +142,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
|||||||
|
|
||||||
f32 gy_yaw = 0.f;
|
f32 gy_yaw = 0.f;
|
||||||
f32 gy_pitch = 0.f;
|
f32 gy_pitch = 0.f;
|
||||||
dusk::gyro_aim::consumeAimDeltas(gy_yaw, gy_pitch);
|
dusk::gyro::getAimDeltas(gy_yaw, gy_pitch);
|
||||||
|
|
||||||
if (dusk::getSettings().game.gyroAimInvertPitch) {
|
|
||||||
gy_pitch = -gy_pitch;
|
|
||||||
}
|
|
||||||
if (dusk::getSettings().game.gyroAimInvertYaw) {
|
|
||||||
gy_yaw = -gy_yaw;
|
|
||||||
}
|
|
||||||
if (dusk::getSettings().game.enableMirrorMode) {
|
|
||||||
gy_yaw = -gy_yaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
shape_angle.y = shape_angle.y + cM_rad2s(gy_yaw * gyro_scale);
|
shape_angle.y = shape_angle.y + cM_rad2s(gy_yaw * gyro_scale);
|
||||||
sp8 = sp8 + cM_rad2s(gy_pitch * gyro_scale);
|
sp8 = sp8 + cM_rad2s(gy_pitch * gyro_scale);
|
||||||
|
|||||||
@@ -318,11 +318,7 @@ void daBalloon2D_c::addScoreCount(cXyz* param_1, u32 param_2, u8 param_3) {
|
|||||||
field_0x5f8[current].field_0xf = field_0x5f8[prev].field_0xf;
|
field_0x5f8[current].field_0xf = field_0x5f8[prev].field_0xf;
|
||||||
}
|
}
|
||||||
cXyz acStack_2c;
|
cXyz acStack_2c;
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(param_1, &acStack_2c, { 0, 0, FB_WIDTH, FB_HEIGHT });
|
|
||||||
#else
|
|
||||||
mDoLib_project(param_1, &acStack_2c);
|
mDoLib_project(param_1, &acStack_2c);
|
||||||
#endif
|
|
||||||
field_0x5f8[0].field_0x0.set(acStack_2c);
|
field_0x5f8[0].field_0x0.set(acStack_2c);
|
||||||
field_0x5f8[0].field_0xc = param_2;
|
field_0x5f8[0].field_0xc = param_2;
|
||||||
field_0x5f8[0].field_0xe = 60;
|
field_0x5f8[0].field_0xe = 60;
|
||||||
|
|||||||
@@ -623,6 +623,11 @@ int daBg_c::create() {
|
|||||||
|
|
||||||
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
|
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
|
||||||
OS_REPORT("<BG> room%d\n", roomNo);
|
OS_REPORT("<BG> room%d\n", roomNo);
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
draw_interp_frame = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return cPhs_COMPLEATE_e;
|
return cPhs_COMPLEATE_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,13 +337,7 @@ void daBoomerang_sight_c::setSight(const cXyz* i_pos, int i_no) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&m_pos[i_no], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&m_pos[i_no], &proj);
|
mDoLib_project(&m_pos[i_no], &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_proj_posX[i_no] = proj.x;
|
m_proj_posX[i_no] = proj.x;
|
||||||
m_proj_posY[i_no] = proj.y;
|
m_proj_posY[i_no] = proj.y;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1658,12 +1658,7 @@ int daDemo00_c::draw() {
|
|||||||
MTXCopy(mModel.field_0x5d4->getAnmMtx(0), mDoMtx_stack_c::get());
|
MTXCopy(mModel.field_0x5d4->getAnmMtx(0), mDoMtx_stack_c::get());
|
||||||
spb0.set(0.0f, 0.0f, 0.0f);
|
spb0.set(0.0f, 0.0f, 0.0f);
|
||||||
mDoMtx_stack_c::multVec(&spb0, &sp98);
|
mDoMtx_stack_c::multVec(&spb0, &sp98);
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&sp98, &spa4, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&sp98, &spa4);
|
mDoLib_project(&sp98, &spa4);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (spa4.x >= -700.0f && spa4.x < 1600.0f && spa4.y >= -200.0f && spa4.y < 600.0f) {
|
if (spa4.x >= -700.0f && spa4.x < 1600.0f && spa4.y >= -200.0f && spa4.y < 600.0f) {
|
||||||
if (mModel.mID.field_0x18 == 0 || mModel.mID.field_0x18 == 1) {
|
if (mModel.mID.field_0x18 == 0 || mModel.mID.field_0x18 == 1) {
|
||||||
|
|||||||
@@ -215,7 +215,15 @@ int daDsh_c::create() {
|
|||||||
|
|
||||||
mType = getType();
|
mType = getType();
|
||||||
|
|
||||||
|
// !@bug Static-init only runs once, so slot 0 keeps the first mType's arc name forever.
|
||||||
|
// GC/Wii dodges this via REL reload; TPHD is statically linked so later gates of a
|
||||||
|
// different type load the wrong arc and CreateHeap fails. The storage must stay static
|
||||||
|
// because mResLoader.load holds the pointer past create(), so we just overwrite slot 0
|
||||||
|
// each call instead.
|
||||||
static const char* l_resName[] = {l_arcName[mType], ""};
|
static const char* l_resName[] = {l_arcName[mType], ""};
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
l_resName[0] = l_arcName[mType];
|
||||||
|
#endif
|
||||||
|
|
||||||
int phase = mResLoader.load(l_resName, NULL);
|
int phase = mResLoader.load(l_resName, NULL);
|
||||||
if (phase == cPhs_COMPLEATE_e) {
|
if (phase == cPhs_COMPLEATE_e) {
|
||||||
|
|||||||
@@ -429,13 +429,7 @@ void daE_FK_c::DamageAction() {
|
|||||||
|
|
||||||
bool daE_FK_c::checkViewArea() {
|
bool daE_FK_c::checkViewArea() {
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(¤t.pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(¤t.pos, &proj);
|
mDoLib_project(¤t.pos, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
return (proj.x >= 0.0f && proj.x <= FB_WIDTH) && (proj.y >= 0.0f && proj.y <= FB_HEIGHT);
|
return (proj.x >= 0.0f && proj.x <= FB_WIDTH) && (proj.y >= 0.0f && proj.y <= FB_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,13 +463,7 @@ static void damage_check(e_fs_class* i_this) {
|
|||||||
|
|
||||||
static bool checkViewArea(cXyz* i_pos) {
|
static bool checkViewArea(cXyz* i_pos) {
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(i_pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(i_pos, &proj);
|
mDoLib_project(i_pos, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|||||||
@@ -6601,13 +6601,14 @@ static int daE_RD_Execute(e_rd_class* i_this) {
|
|||||||
1.2f,
|
1.2f,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if AVOID_UB
|
||||||
|
s16 x = 0;
|
||||||
|
s16 y = 0;
|
||||||
|
#endif
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
MtxPush();
|
MtxPush();
|
||||||
|
#if !AVOID_UB
|
||||||
s16 x, y;
|
s16 x, y;
|
||||||
|
|
||||||
#if AVOID_UB
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|||||||
@@ -1362,13 +1362,7 @@ void daE_SM_c::E_SM_C_Hook() {
|
|||||||
|
|
||||||
bool daE_SM_c::CheckViewArea() {
|
bool daE_SM_c::CheckViewArea() {
|
||||||
Vec vec;
|
Vec vec;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(¤t.pos, &vec, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(¤t.pos, &vec);
|
mDoLib_project(¤t.pos, &vec);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool rv = false;
|
bool rv = false;
|
||||||
|
|
||||||
if (vec.x >= 0.0f && vec.x <= FB_WIDTH && vec.y >= 0.0f && vec.y <= FB_HEIGHT) {
|
if (vec.x >= 0.0f && vec.x <= FB_WIDTH && vec.y >= 0.0f && vec.y <= FB_HEIGHT) {
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
#include "m_Do/m_Do_controller_pad.h"
|
#include "m_Do/m_Do_controller_pad.h"
|
||||||
#include "m_Do/m_Do_graphic.h"
|
#include "m_Do/m_Do_graphic.h"
|
||||||
#include "res/Object/Always.h"
|
#include "res/Object/Always.h"
|
||||||
|
#include "dusk/dusk.h"
|
||||||
|
#include "dusk/frame_interpolation.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
@@ -184,6 +186,30 @@ static bool hio_set;
|
|||||||
|
|
||||||
static daE_WB_HIO_c l_HIO;
|
static daE_WB_HIO_c l_HIO;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
static void e_wb_rein_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||||
|
e_wb_class* i_this = (e_wb_class*)pUserWork;
|
||||||
|
if (!i_this->himo_interp_prev_valid || !i_this->himo_interp_curr_valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||||
|
for (int r = 0; r < 2; r++) {
|
||||||
|
cXyz* dst = i_this->himo_mat[r].getPos(0);
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
const cXyz& p0 = i_this->himo_mat_interp_prev[r][i];
|
||||||
|
const cXyz& p1 = i_this->himo_mat_interp_curr[r][i];
|
||||||
|
dst[i] = p0 + (p1 - p0) * alpha;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cXyz* dst = i_this->himo_tex.getPos(0);
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
const cXyz& p0 = i_this->himo_tex_interp_prev[i];
|
||||||
|
const cXyz& p1 = i_this->himo_tex_interp_curr[i];
|
||||||
|
dst[i] = p0 + (p1 - p0) * alpha;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void himo_control1(e_wb_class* i_this, cXyz* i_pos, int i_no, s8 param_3) {
|
static void himo_control1(e_wb_class* i_this, cXyz* i_pos, int i_no, s8 param_3) {
|
||||||
fopEn_enemy_c* enemy = &i_this->enemy;
|
fopEn_enemy_c* enemy = &i_this->enemy;
|
||||||
cXyz mae, ato;
|
cXyz mae, ato;
|
||||||
@@ -508,6 +534,21 @@ static int daE_WB_Draw(e_wb_class* i_this) {
|
|||||||
dComIfGd_set3DlineMat(&i_this->himo_mat[1]);
|
dComIfGd_set3DlineMat(&i_this->himo_mat[1]);
|
||||||
i_this->himo_tex.update(2, l_color, &actor->tevStr);
|
i_this->himo_tex.update(2, l_color, &actor->tevStr);
|
||||||
dComIfGd_set3DlineMat(&i_this->himo_tex);
|
dComIfGd_set3DlineMat(&i_this->himo_tex);
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||||
|
if (i_this->himo_interp_curr_valid) {
|
||||||
|
memcpy(i_this->himo_mat_interp_prev, i_this->himo_mat_interp_curr, sizeof(i_this->himo_mat_interp_curr));
|
||||||
|
memcpy(i_this->himo_tex_interp_prev, i_this->himo_tex_interp_curr, sizeof(i_this->himo_tex_interp_curr));
|
||||||
|
i_this->himo_interp_prev_valid = true;
|
||||||
|
}
|
||||||
|
for (int r = 0; r < 2; r++) {
|
||||||
|
memcpy(i_this->himo_mat_interp_curr[r], i_this->himo_mat[r].getPos(0), 16 * sizeof(cXyz));
|
||||||
|
}
|
||||||
|
memcpy(i_this->himo_tex_interp_curr, i_this->himo_tex.getPos(0), 2 * sizeof(cXyz));
|
||||||
|
i_this->himo_interp_curr_valid = true;
|
||||||
|
dusk::frame_interp::add_interpolation_callback(&e_wb_rein_interp_callback, i_this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -3726,6 +3767,9 @@ static void demo_camera(e_wb_class* i_this) {
|
|||||||
boss = (e_rdb_class*)fopAcM_SearchByName(fpcNm_E_RDB_e);
|
boss = (e_rdb_class*)fopAcM_SearchByName(fpcNm_E_RDB_e);
|
||||||
}
|
}
|
||||||
cXyz mae, ato, eye, center;
|
cXyz mae, ato, eye, center;
|
||||||
|
#if TARGET_PC
|
||||||
|
const s16 entry_demo_mode = i_this->demo_mode;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (i_this->demo_mode) {
|
switch (i_this->demo_mode) {
|
||||||
case 1: {
|
case 1: {
|
||||||
@@ -4255,6 +4299,9 @@ static void demo_camera(e_wb_class* i_this) {
|
|||||||
|
|
||||||
if (i_this->demo_timer == 325) {
|
if (i_this->demo_timer == 325) {
|
||||||
fpcM_Search(s_wbZrevise_sub, i_this);
|
fpcM_Search(s_wbZrevise_sub, i_this);
|
||||||
|
#if TARGET_PC
|
||||||
|
i_this->demo_cam_sync_ticks = 2;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i_this->demo_timer == 335) {
|
if (i_this->demo_timer == 335) {
|
||||||
@@ -4495,6 +4542,9 @@ static void demo_camera(e_wb_class* i_this) {
|
|||||||
i_this->demo_cam_way_spd.z = fabsf(i_this->demo_cam_way.z - i_this->demo_cam_ctr.z);
|
i_this->demo_cam_way_spd.z = fabsf(i_this->demo_cam_way.z - i_this->demo_cam_ctr.z);
|
||||||
i_this->demo_cam_morf = 0;
|
i_this->demo_cam_morf = 0;
|
||||||
pla->setPlayerPosAndAngle(&pla->current.pos, pla->shape_angle.y - 4000, 0);
|
pla->setPlayerPosAndAngle(&pla->current.pos, pla->shape_angle.y - 4000, 0);
|
||||||
|
#if TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (i_this->demo_timer == 345) {
|
if (i_this->demo_timer == 345) {
|
||||||
daPy_getPlayerActorClass()->setThrowDamage(boss->enemy.shape_angle.y - 8000 + TREG_S(8),
|
daPy_getPlayerActorClass()->setThrowDamage(boss->enemy.shape_angle.y - 8000 + TREG_S(8),
|
||||||
@@ -4741,6 +4791,9 @@ static void demo_camera(e_wb_class* i_this) {
|
|||||||
i_this->demo_cam_eye.x += 300.0f + VREG_F(8);
|
i_this->demo_cam_eye.x += 300.0f + VREG_F(8);
|
||||||
i_this->demo_cam_eye.y += 150.0f + VREG_F(9);
|
i_this->demo_cam_eye.y += 150.0f + VREG_F(9);
|
||||||
i_this->demo_cam_eye.z -= 1400.0f + VREG_F(10);
|
i_this->demo_cam_eye.z -= 1400.0f + VREG_F(10);
|
||||||
|
#if TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
i_this->demo_cam_eye = enemy->current.pos;
|
i_this->demo_cam_eye = enemy->current.pos;
|
||||||
@@ -4996,6 +5049,15 @@ static void demo_camera(e_wb_class* i_this) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if TARGET_PC
|
||||||
|
if (entry_demo_mode != i_this->demo_mode) {
|
||||||
|
i_this->demo_cam_sync_ticks = 2;
|
||||||
|
}
|
||||||
|
if (i_this->demo_cam_sync_ticks > 0) {
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
i_this->demo_cam_sync_ticks--;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void anm_se_eff_set(e_wb_class* i_this) {
|
static void anm_se_eff_set(e_wb_class* i_this) {
|
||||||
|
|||||||
+119
-1
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
#include "dusk/dvd_asset.hpp"
|
#include "dusk/dvd_asset.hpp"
|
||||||
|
#include "dusk/frame_interpolation.h"
|
||||||
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x1C00, 0x4000), true); return buf; }
|
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x1C00, 0x4000), true); return buf; }
|
||||||
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x5C00, 0x4000), true); return buf; }
|
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x5C00, 0x4000), true); return buf; }
|
||||||
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x9C00, 0x60), true); return buf; }
|
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x9C00, 0x60), true); return buf; }
|
||||||
@@ -267,6 +268,37 @@ static void* tex_d[2] = {
|
|||||||
|
|
||||||
static char lbl_277_bss_0;
|
static char lbl_277_bss_0;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
static void mant_build_anchor_frame(const cXyz& anchor_a, const cXyz& anchor_b, Mtx out) {
|
||||||
|
cXyz axis_x = anchor_b - anchor_a;
|
||||||
|
if (!axis_x.normalizeRS()) {
|
||||||
|
axis_x = cXyz::BaseX;
|
||||||
|
}
|
||||||
|
|
||||||
|
cXyz helper = fabsf(axis_x.y) > 0.95f ? cXyz::BaseZ : cXyz::BaseY;
|
||||||
|
cXyz axis_z = axis_x.getCrossProduct(helper);
|
||||||
|
if (!axis_z.normalizeRS()) {
|
||||||
|
axis_z = cXyz::BaseZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
cXyz axis_y = axis_z.getCrossProduct(axis_x);
|
||||||
|
if (!axis_y.normalizeRS()) {
|
||||||
|
axis_y = cXyz::BaseY;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cXyz center = anchor_a + ((anchor_b - anchor_a) * 0.5f);
|
||||||
|
|
||||||
|
const cXyz col[3] = { axis_x, axis_y, axis_z };
|
||||||
|
const f32 t[3] = { center.x, center.y, center.z };
|
||||||
|
for (int r = 0; r < 3; ++r) {
|
||||||
|
out[r][0] = (&col[0].x)[r];
|
||||||
|
out[r][1] = (&col[1].x)[r];
|
||||||
|
out[r][2] = (&col[2].x)[r];
|
||||||
|
out[r][3] = t[r];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void daMant_packet_c::draw() {
|
void daMant_packet_c::draw() {
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
void* image = l_Egnd_mantTEX;
|
void* image = l_Egnd_mantTEX;
|
||||||
@@ -290,8 +322,72 @@ void daMant_packet_c::draw() {
|
|||||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_CLR_RGB, GX_F32, 0);
|
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_CLR_RGB, GX_F32, 0);
|
||||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0);
|
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0);
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
cXyz* draw_pos = &this->mNrm[0][0];
|
||||||
|
{
|
||||||
|
const u8 curr_buffer = this->field_0x74;
|
||||||
|
const cXyz* curr_pos = &this->mPos[curr_buffer][0];
|
||||||
|
const MtxP curr_frame = curr_buffer == 0 ? this->mMtx : this->mMtx2;
|
||||||
|
|
||||||
|
Mtx curr_frame_inverse;
|
||||||
|
MTXInverse(curr_frame, curr_frame_inverse);
|
||||||
|
|
||||||
|
const u8 prev_buffer = curr_buffer ^ 1;
|
||||||
|
const cXyz* prev_pos = &this->mPos[prev_buffer][0];
|
||||||
|
Mtx prev_frame_inverse;
|
||||||
|
MTXInverse(prev_buffer == 0 ? this->mMtx : this->mMtx2, prev_frame_inverse);
|
||||||
|
|
||||||
|
Mtx presented_frame;
|
||||||
|
MTXCopy(curr_frame, presented_frame);
|
||||||
|
|
||||||
|
mant_class* mant_p = reinterpret_cast<mant_class*>(reinterpret_cast<u8*>(this) - offsetof(mant_class, field_0x0570));
|
||||||
|
if (mant_p != NULL) {
|
||||||
|
b_gnd_class* parent = (b_gnd_class*)fopAcM_SearchByID(mant_p->parentActorID);
|
||||||
|
if (parent != NULL && parent->mpModelMorf != NULL) {
|
||||||
|
J3DModel* model = parent->mpModelMorf->getModel();
|
||||||
|
if (model != NULL) {
|
||||||
|
MtxP src34 = model->getAnmMtx(34);
|
||||||
|
MtxP src25 = model->getAnmMtx(25);
|
||||||
|
Mtx joint_34_scratch;
|
||||||
|
Mtx joint_25_scratch;
|
||||||
|
MtxP joint_34 = dusk::frame_interp::lookup_replacement(src34, joint_34_scratch) ? joint_34_scratch : src34;
|
||||||
|
MtxP joint_25 = dusk::frame_interp::lookup_replacement(src25, joint_25_scratch) ? joint_25_scratch : src25;
|
||||||
|
|
||||||
|
cXyz presented_anchor_a;
|
||||||
|
cXyz presented_anchor_b;
|
||||||
|
cXyz local_offset;
|
||||||
|
|
||||||
|
MTXCopy(joint_34, *calc_mtx);
|
||||||
|
local_offset.set(10.0f, 5.0f, -17.0f);
|
||||||
|
MtxPosition(&local_offset, &presented_anchor_a);
|
||||||
|
|
||||||
|
MTXCopy(joint_25, *calc_mtx);
|
||||||
|
local_offset.set(10.0f, 5.0f, 17.0f);
|
||||||
|
MtxPosition(&local_offset, &presented_anchor_b);
|
||||||
|
|
||||||
|
mant_build_anchor_frame(presented_anchor_a, presented_anchor_b, presented_frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const f32 step = dusk::frame_interp::get_interpolation_step();
|
||||||
|
for (int i = 0; i < 169; ++i) {
|
||||||
|
cXyz curr_local;
|
||||||
|
MTXMultVec(curr_frame_inverse, &curr_pos[i], &curr_local);
|
||||||
|
|
||||||
|
cXyz prev_local;
|
||||||
|
MTXMultVec(prev_frame_inverse, &prev_pos[i], &prev_local);
|
||||||
|
cXyz local = prev_local + ((curr_local - prev_local) * step);
|
||||||
|
|
||||||
|
MTXMultVec(presented_frame, &local, &draw_pos[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GXSETARRAY(GX_VA_POS, draw_pos, sizeof(mNrm[0]), 12, true);
|
||||||
|
GXSETARRAY(GX_VA_NRM, &l_normal, sizeof(l_normal), 12, false);
|
||||||
|
#else
|
||||||
GXSETARRAY(GX_VA_POS, this->getPos(), sizeof(mPos[0]), 12, true);
|
GXSETARRAY(GX_VA_POS, this->getPos(), sizeof(mPos[0]), 12, true);
|
||||||
GXSETARRAY(GX_VA_NRM, this->getNrm(), sizeof(mNrm[0]), 12, true);
|
GXSETARRAY(GX_VA_NRM, this->getNrm(), sizeof(mNrm[0]), 12, true);
|
||||||
|
#endif
|
||||||
GXSETARRAY(GX_VA_TEX0, &l_texCoord, sizeof(l_texCoord), 8, false); // TODO: set to true when converted to float literals
|
GXSETARRAY(GX_VA_TEX0, &l_texCoord, sizeof(l_texCoord), 8, false); // TODO: set to true when converted to float literals
|
||||||
|
|
||||||
GXSetZCompLoc(0);
|
GXSetZCompLoc(0);
|
||||||
@@ -329,9 +425,14 @@ void daMant_packet_c::draw() {
|
|||||||
|
|
||||||
GXSetCullMode(GX_CULL_BACK);
|
GXSetCullMode(GX_CULL_BACK);
|
||||||
|
|
||||||
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
|
||||||
Mtx MStack_54;
|
Mtx MStack_54;
|
||||||
|
#if TARGET_PC
|
||||||
|
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
|
||||||
|
cMtx_inverseTranspose(j3dSys.getViewMtx(), MStack_54);
|
||||||
|
#else
|
||||||
|
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
||||||
cMtx_inverseTranspose(this->mMtx, MStack_54);
|
cMtx_inverseTranspose(this->mMtx, MStack_54);
|
||||||
|
#endif
|
||||||
|
|
||||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||||
@@ -347,8 +448,13 @@ void daMant_packet_c::draw() {
|
|||||||
GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
||||||
|
|
||||||
GXSetCullMode(GX_CULL_FRONT);
|
GXSetCullMode(GX_CULL_FRONT);
|
||||||
|
#if TARGET_PC
|
||||||
|
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
|
||||||
|
cMtx_inverseTranspose(j3dSys.getViewMtx(), MStack_54);
|
||||||
|
#else
|
||||||
GXLoadPosMtxImm(this->mMtx2, GX_PNMTX0);
|
GXLoadPosMtxImm(this->mMtx2, GX_PNMTX0);
|
||||||
cMtx_inverseTranspose(this->mMtx2, MStack_54);
|
cMtx_inverseTranspose(this->mMtx2, MStack_54);
|
||||||
|
#endif
|
||||||
|
|
||||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||||
@@ -360,11 +466,13 @@ void daMant_packet_c::draw() {
|
|||||||
static int daMant_Draw(mant_class* i_this) {
|
static int daMant_Draw(mant_class* i_this) {
|
||||||
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
|
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
|
||||||
|
|
||||||
|
#if !TARGET_PC
|
||||||
MtxTrans(0.0f, 0.0f, 0.0f, 0.0f);
|
MtxTrans(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx());
|
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx());
|
||||||
|
|
||||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx2());
|
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx2());
|
||||||
|
#endif
|
||||||
|
|
||||||
i_this->field_0x0570.setTevStr(&i_this->tevStr);
|
i_this->field_0x0570.setTevStr(&i_this->tevStr);
|
||||||
|
|
||||||
@@ -635,8 +743,13 @@ static void mant_v_calc(mant_class* i_this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mant_move(mant_class* i_this) {
|
static void mant_move(mant_class* i_this) {
|
||||||
|
#if TARGET_PC
|
||||||
|
u8 uVar1 = i_this->field_0x0570.field_0x74 ^ 1;
|
||||||
|
cXyz* pcVar5 = &i_this->field_0x0570.mPos[uVar1][0];
|
||||||
|
#else
|
||||||
u8 uVar1 = i_this->field_0x0570.field_0x74;
|
u8 uVar1 = i_this->field_0x0570.field_0x74;
|
||||||
cXyz* pcVar5 = i_this->field_0x0570.getPos();
|
cXyz* pcVar5 = i_this->field_0x0570.getPos();
|
||||||
|
#endif
|
||||||
mant_v_calc(i_this);
|
mant_v_calc(i_this);
|
||||||
for (int i = 0; i < 13; i++) {
|
for (int i = 0; i < 13; i++) {
|
||||||
for (int j = 0; j < 13; j++) {
|
for (int j = 0; j < 13; j++) {
|
||||||
@@ -644,7 +757,12 @@ static void mant_move(mant_class* i_this) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
mant_build_anchor_frame(i_this->field_0x3928[0], i_this->field_0x3928[1], uVar1 == 0 ? i_this->field_0x0570.mMtx : i_this->field_0x0570.mMtx2);
|
||||||
|
i_this->field_0x0570.field_0x74 = uVar1;
|
||||||
|
#else
|
||||||
DCStoreRangeNoSync(i_this->field_0x0570.getPos(), 0x7ec);
|
DCStoreRangeNoSync(i_this->field_0x0570.getPos(), 0x7ec);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mant_cut_type;
|
static int mant_cut_type;
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
#include "d/d_s_play.h"
|
#include "d/d_s_play.h"
|
||||||
#include "Z2AudioLib/Z2Instances.h"
|
#include "Z2AudioLib/Z2Instances.h"
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
#include "dusk/gyro.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
enum koro2_parts {
|
enum koro2_parts {
|
||||||
KORO2_PART_BOX = 1,
|
KORO2_PART_BOX = 1,
|
||||||
KORO2_PART_CURVE_A_U_L,
|
KORO2_PART_CURVE_A_U_L,
|
||||||
@@ -723,6 +727,14 @@ static void koro2_game(fshop_class* i_this) {
|
|||||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, 0, 2, 0x200);
|
cLib_addCalcAngleS2(&i_this->field_0x4020.x, 0, 2, 0x200);
|
||||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, 0, 2, 0x200);
|
cLib_addCalcAngleS2(&i_this->field_0x4020.z, 0, 2, 0x200);
|
||||||
case 2:
|
case 2:
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||||
|
if (!dusk::gyro::get_sensor_keep_alive()) {
|
||||||
|
dusk::gyro::set_sensor_keep_alive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
actor->scale.x = 10.0f;
|
actor->scale.x = 10.0f;
|
||||||
if (i_this->field_0x4010 == 2) {
|
if (i_this->field_0x4010 == 2) {
|
||||||
static f32 old_stick_x = 0.0f;
|
static f32 old_stick_x = 0.0f;
|
||||||
@@ -739,11 +751,21 @@ static void koro2_game(fshop_class* i_this) {
|
|||||||
|
|
||||||
old_stick_x = mDoCPd_c::getSubStickX(PAD_1);
|
old_stick_x = mDoCPd_c::getSubStickX(PAD_1);
|
||||||
cLib_addCalcAngleS2(&i_this->field_0x4060, i_this->field_0x4062, 4, 0x1000);
|
cLib_addCalcAngleS2(&i_this->field_0x4060, i_this->field_0x4062, 4, 0x1000);
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||||
|
dusk::gyro::rollgoalTick(true, i_this->field_0x4060);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
cMtx_YrotS(*calc_mtx, -i_this->field_0x4060);
|
cMtx_YrotS(*calc_mtx, -i_this->field_0x4060);
|
||||||
|
|
||||||
sp5C.x = mDoCPd_c::getStickX3D(PAD_1);
|
sp5C.x = mDoCPd_c::getStickX3D(PAD_1);
|
||||||
sp5C.y = 0.0f;
|
sp5C.y = 0.0f;
|
||||||
sp5C.z = mDoCPd_c::getStickY(PAD_1);
|
sp5C.z = mDoCPd_c::getStickY(PAD_1);
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableMirrorMode) {
|
||||||
|
sp5C.x = -sp5C.x;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
MtxPosition(&sp5C, &sp68);
|
MtxPosition(&sp5C, &sp68);
|
||||||
|
|
||||||
f32 reg_f31 = sp68.x;
|
f32 reg_f31 = sp68.x;
|
||||||
@@ -765,9 +787,21 @@ static void koro2_game(fshop_class* i_this) {
|
|||||||
reg_f30 = 0.0f;
|
reg_f30 = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)), 4, 0x200);
|
s16 gyro_ax = 0;
|
||||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)), 4, 0x200);
|
s16 gyro_az = 0;
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||||
|
dusk::gyro::rollgoalTableOffset(gyro_ax, gyro_az);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)) + gyro_ax, 4, 0x200);
|
||||||
|
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)) + gyro_az, 4, 0x200);
|
||||||
}
|
}
|
||||||
|
#if TARGET_PC
|
||||||
|
if (i_this->field_0x4010 != 2) {
|
||||||
|
dusk::gyro::rollgoalTick(false, i_this->field_0x4060);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1145,6 +1179,12 @@ static int daFshop_Delete(fshop_class* i_this) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||||
|
dusk::gyro::set_sensor_keep_alive(false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1054,9 +1054,9 @@ void daMidna_c::setBodyPartMatrix() {
|
|||||||
}
|
}
|
||||||
mpModel->calcWeightEnvelopeMtx();
|
mpModel->calcWeightEnvelopeMtx();
|
||||||
#ifdef TARGET_PC
|
#ifdef TARGET_PC
|
||||||
// Frame interpolation: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
|
// FRAME INTERP NOTE: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
|
||||||
for (u16 i = 0; i < mpModel->getModelData()->getWEvlpMtxNum(); i++) {
|
for (u16 i = 0; i < mpModel->getModelData()->getWEvlpMtxNum(); i++) {
|
||||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(mpModel->getWeightAnmMtx(i)), mpModel->getWeightAnmMtx(i));
|
dusk::frame_interp::record_final_mtx(mpModel->getWeightAnmMtx(i));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
#include <gf/GFGeometry.h>
|
#include <gf/GFGeometry.h>
|
||||||
#include <gf/GFLight.h>
|
#include <gf/GFLight.h>
|
||||||
#include "m_Do/m_Do_lib.h"
|
#include "m_Do/m_Do_lib.h"
|
||||||
|
#if TARGET_PC
|
||||||
|
#include "dusk/frame_interpolation.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __MWERKS__
|
#ifndef __MWERKS__
|
||||||
#include "dusk/math.h"
|
#include "dusk/math.h"
|
||||||
@@ -27,11 +30,19 @@ static char* l_arcName = "Mirror";
|
|||||||
static char* l_arcName2 = "MR-Table";
|
static char* l_arcName2 = "MR-Table";
|
||||||
|
|
||||||
dMirror_packet_c::dMirror_packet_c() {
|
dMirror_packet_c::dMirror_packet_c() {
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
GXInitTexObj(&mTexObj, nullptr, 0, 0, static_cast<GXTexFmt>(-1), GX_MAX_TEXWRAPMODE,
|
||||||
|
GX_MAX_TEXWRAPMODE, GX_FALSE);
|
||||||
|
#endif
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dMirror_packet_c::reset() {
|
void dMirror_packet_c::reset() {
|
||||||
|
#if TARGET_PC
|
||||||
|
mbReset = true;
|
||||||
|
#else
|
||||||
mModelCount = 0;
|
mModelCount = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void dMirror_packet_c::calcMinMax() {
|
void dMirror_packet_c::calcMinMax() {
|
||||||
@@ -73,6 +84,13 @@ void dMirror_packet_c::calcMinMax() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int dMirror_packet_c::entryModel(J3DModel* i_model) {
|
int dMirror_packet_c::entryModel(J3DModel* i_model) {
|
||||||
|
#if TARGET_PC
|
||||||
|
if (mbReset) {
|
||||||
|
mModelCount = 0;
|
||||||
|
mbReset = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mModelCount >= 0x40) {
|
if (mModelCount >= 0x40) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3342,13 +3342,8 @@ static void daMP_THPGXYuv2RgbSetup(const GXRenderModeObj* rmode) {
|
|||||||
Mtx44 m;
|
Mtx44 m;
|
||||||
Mtx e_m;
|
Mtx e_m;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
w = JUTVideo::getManager()->getFbWidth();
|
|
||||||
h = JUTVideo::getManager()->getEfbHeight();
|
|
||||||
#else
|
|
||||||
w = rmode->fbWidth;
|
w = rmode->fbWidth;
|
||||||
h = rmode->efbHeight;
|
h = rmode->efbHeight;
|
||||||
#endif
|
|
||||||
var_f31 = 0.0f;
|
var_f31 = 0.0f;
|
||||||
|
|
||||||
#if WIDESCREEN_SUPPORT
|
#if WIDESCREEN_SUPPORT
|
||||||
@@ -4383,6 +4378,8 @@ static void daMP_ActivePlayer_Draw() {
|
|||||||
|
|
||||||
daMP_DrawPosX = static_cast<u32>(rect.PosX);
|
daMP_DrawPosX = static_cast<u32>(rect.PosX);
|
||||||
daMP_DrawPosY = static_cast<u32>(rect.PosY);
|
daMP_DrawPosY = static_cast<u32>(rect.PosY);
|
||||||
|
|
||||||
|
daMP_THPPlayerSetVolume((dusk::getSettings().audio.masterVolume / 100.0f) * 127.0f, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int frame = daMP_THPPlayerDrawCurrentFrame(
|
int frame = daMP_THPPlayerDrawCurrentFrame(
|
||||||
@@ -4583,3 +4580,12 @@ actor_process_profile_definition g_profile_MOVIE_PLAYER = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
AUDIO_INSTANCES;
|
AUDIO_INSTANCES;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
void dusk::MoviePlayerShutdown() {
|
||||||
|
// We need to cleanly shut down the threads to avoid crashes on shutdown.
|
||||||
|
if (daMP_c::m_myObj) {
|
||||||
|
daMP_c::m_myObj->daMP_c_Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -2694,12 +2694,7 @@ BOOL daNpcT_chkActorInScreen(fopAc_ac_c* i_ActorP, f32 param_1, f32 param_2, f32
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&pos_array[i], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&pos_array[i], &proj);
|
mDoLib_project(&pos_array[i], &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ static int daNpc_Inko_Execute(npc_inko_class* i_this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
f32 var_f31;
|
f32 var_f31;
|
||||||
|
|
||||||
|
#if AVOID_UB
|
||||||
|
var_f31 = 0.0f;
|
||||||
|
#endif
|
||||||
if (i_this->field_0x598 == 0) {
|
if (i_this->field_0x598 == 0) {
|
||||||
if (i_this->field_0x59c[1] == 0) {
|
if (i_this->field_0x59c[1] == 0) {
|
||||||
i_this->field_0x59c[1] = 30.0f + cM_rndF(70.0f);
|
i_this->field_0x59c[1] = 30.0f + cM_rndF(70.0f);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "f_op/f_op_kankyo_mng.h"
|
#include "f_op/f_op_kankyo_mng.h"
|
||||||
#include "c/c_damagereaction.h"
|
#include "c/c_damagereaction.h"
|
||||||
#include "Z2AudioLib/Z2Instances.h"
|
#include "Z2AudioLib/Z2Instances.h"
|
||||||
|
#include "dusk/frame_interpolation.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
static home_path_pnt home_path[38] = {
|
static home_path_pnt home_path[38] = {
|
||||||
@@ -2655,6 +2656,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
|||||||
i_this->mCameraFovY = 55.0f;
|
i_this->mCameraFovY = 55.0f;
|
||||||
camera->mCamera.SetTrimSize(3);
|
camera->mCamera.SetTrimSize(3);
|
||||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
// fallthrough
|
// fallthrough
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@@ -2683,6 +2687,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
|||||||
if (i_this->mDemoCounter == 0) {
|
if (i_this->mDemoCounter == 0) {
|
||||||
i_this->mCameraCenter1.set(387.0f, 133.0f, -866.0f);
|
i_this->mCameraCenter1.set(387.0f, 133.0f, -866.0f);
|
||||||
i_this->mCameraEye1.set(284.0f, 208.0f, -585.0f);
|
i_this->mCameraEye1.set(284.0f, 208.0f, -585.0f);
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i_this->mDemoCounter == 12) {
|
if (i_this->mDemoCounter == 12) {
|
||||||
@@ -2719,6 +2726,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
|||||||
i_this->mCameraFovY = 45.0f;
|
i_this->mCameraFovY = 45.0f;
|
||||||
camera->mCamera.SetTrimSize(3);
|
camera->mCamera.SetTrimSize(3);
|
||||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
// fallthrough
|
// fallthrough
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
@@ -2799,8 +2809,14 @@ static void demo_camera(npc_ne_class* i_this) {
|
|||||||
MtxPosition(&vec, &i_this->mCameraEye2);
|
MtxPosition(&vec, &i_this->mCameraEye2);
|
||||||
i_this->mCameraEye2 += player->current.pos;
|
i_this->mCameraEye2 += player->current.pos;
|
||||||
player->changeDemoParam2(2);
|
player->changeDemoParam2(2);
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
} else if (i_this->mDemoCounter == 120) {
|
} else if (i_this->mDemoCounter == 120) {
|
||||||
player->changeDemoParam2(0);
|
player->changeDemoParam2(0);
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2853,6 +2869,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
|||||||
i_this->mCameraCenter1 = _this->current.pos;
|
i_this->mCameraCenter1 = _this->current.pos;
|
||||||
i_this->mCameraCenter1.y += 20.0f;
|
i_this->mCameraCenter1.y += 20.0f;
|
||||||
i_this->mCameraFovY = 55.0f;
|
i_this->mCameraFovY = 55.0f;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
dusk::frame_interp::request_presentation_sync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
camera->mCamera.Set(i_this->mCameraCenter1, i_this->mCameraEye1,
|
camera->mCamera.Set(i_this->mCameraCenter1, i_this->mCameraEye1,
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ void daObjLv5Key_c::Fall(int param_0) {
|
|||||||
|
|
||||||
OS_REPORT("FALL SPD = %f\n", speed.y);
|
OS_REPORT("FALL SPD = %f\n", speed.y);
|
||||||
|
|
||||||
if (mAcch.ChkGroundHit()) {
|
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
|
||||||
fopAcM_GetSpeed(this);
|
fopAcM_GetSpeed(this);
|
||||||
fopAcM_SetSpeedF(this, 4.0f);
|
fopAcM_SetSpeedF(this, 4.0f);
|
||||||
fopAcM_SetSpeed(this, 0.0f, 22.0f, 0.0f);
|
fopAcM_SetSpeed(this, 0.0f, 22.0f, 0.0f);
|
||||||
@@ -192,7 +192,7 @@ void daObjLv5Key_c::Fall(int param_0) {
|
|||||||
mAcch.CrrPos(dComIfG_Bgsp());
|
mAcch.CrrPos(dComIfG_Bgsp());
|
||||||
current.pos.y = prev_y;
|
current.pos.y = prev_y;
|
||||||
|
|
||||||
if (mAcch.ChkGroundHit()) {
|
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
|
||||||
setAction(&daObjLv5Key_c::Land, 1);
|
setAction(&daObjLv5Key_c::Land, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -499,13 +499,7 @@ void daObjARI_c::Z_BufferChk() {
|
|||||||
cXyz vec2, vec1;
|
cXyz vec2, vec1;
|
||||||
vec1 = current.pos;
|
vec1 = current.pos;
|
||||||
vec1.y += 20.0f;
|
vec1.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&vec1, &vec2);
|
mDoLib_project(&vec1, &vec2);
|
||||||
#endif
|
|
||||||
|
|
||||||
f32 trim_height;
|
f32 trim_height;
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -285,13 +285,7 @@ bool Hahen_c::CheckCull() {
|
|||||||
|
|
||||||
bool Hahen_c::checkViewArea() {
|
bool Hahen_c::checkViewArea() {
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&pos, &proj);
|
mDoLib_project(&pos, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
return (proj.x >= -50.0f && proj.x <= 658.0f) && (proj.y >= -50.0f && proj.y <= 498.0f);
|
return (proj.x >= -50.0f && proj.x <= 658.0f) && (proj.y >= -50.0f && proj.y <= 498.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -289,13 +289,7 @@ void daObjCHO_c::Z_BufferChk() {
|
|||||||
cXyz vec2, vec1;
|
cXyz vec2, vec1;
|
||||||
vec1 = current.pos;
|
vec1 = current.pos;
|
||||||
vec1.y += 20.0f;
|
vec1.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&vec1, &vec2);
|
mDoLib_project(&vec1, &vec2);
|
||||||
#endif
|
|
||||||
|
|
||||||
f32 trim_height;
|
f32 trim_height;
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -224,13 +224,7 @@ void daObjCRVFENCE_c::NormalAction() {
|
|||||||
|
|
||||||
bool daObjCRVFENCE_c::checkViewArea(cXyz* param_1) {
|
bool daObjCRVFENCE_c::checkViewArea(cXyz* param_1) {
|
||||||
Vec sp24;
|
Vec sp24;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(param_1, &sp24, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(param_1, &sp24);
|
mDoLib_project(param_1, &sp24);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool rv = false;
|
bool rv = false;
|
||||||
bool bVar1 = false;
|
bool bVar1 = false;
|
||||||
|
|
||||||
|
|||||||
@@ -137,13 +137,7 @@ void daObjCRVHAHEN_c::CheckCull() {
|
|||||||
|
|
||||||
bool daObjCRVHAHEN_c::checkViewArea(cXyz* i_this) {
|
bool daObjCRVHAHEN_c::checkViewArea(cXyz* i_this) {
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(i_this, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(i_this, &proj);
|
mDoLib_project(i_this, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
||||||
|
|||||||
@@ -267,13 +267,7 @@ void daObjDAN_c::Z_BufferChk() {
|
|||||||
cXyz vec2, vec1;
|
cXyz vec2, vec1;
|
||||||
vec1 = current.pos;
|
vec1 = current.pos;
|
||||||
vec1.y += 20.0f;
|
vec1.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&vec1, &vec2);
|
mDoLib_project(&vec1, &vec2);
|
||||||
#endif
|
|
||||||
|
|
||||||
f32 trim_height;
|
f32 trim_height;
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -201,13 +201,7 @@ void daObjGOMIKABE_c::CheckCull() {
|
|||||||
|
|
||||||
bool daObjGOMIKABE_c::checkViewArea(cXyz param_1) {
|
bool daObjGOMIKABE_c::checkViewArea(cXyz param_1) {
|
||||||
Vec local_24;
|
Vec local_24;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(¶m_1, &local_24, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(¶m_1, &local_24);
|
mDoLib_project(¶m_1, &local_24);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool rv = false;
|
bool rv = false;
|
||||||
if (local_24.x >= 0.0f && local_24.x <= FB_WIDTH && local_24.y >= 0.0f && local_24.y <= FB_HEIGHT) {
|
if (local_24.x >= 0.0f && local_24.x <= FB_WIDTH && local_24.y >= 0.0f && local_24.y <= FB_HEIGHT) {
|
||||||
rv = true;
|
rv = true;
|
||||||
|
|||||||
@@ -214,13 +214,7 @@ void daObjHHASHI_c::CheckCull() {
|
|||||||
|
|
||||||
bool daObjHHASHI_c::checkViewArea(int param_1) {
|
bool daObjHHASHI_c::checkViewArea(int param_1) {
|
||||||
Vec local_20;
|
Vec local_20;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&field_0x5b0[param_1], &local_20, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&field_0x5b0[param_1], &local_20);
|
mDoLib_project(&field_0x5b0[param_1], &local_20);
|
||||||
#endif
|
|
||||||
|
|
||||||
bool rv = false;
|
bool rv = false;
|
||||||
if (local_20.x >= 0.0f && local_20.x <= FB_WIDTH && local_20.y >= 0.0f && local_20.y <= FB_HEIGHT) {
|
if (local_20.x >= 0.0f && local_20.x <= FB_WIDTH && local_20.y >= 0.0f && local_20.y <= FB_HEIGHT) {
|
||||||
rv = true;
|
rv = true;
|
||||||
|
|||||||
@@ -517,13 +517,7 @@ void daObjKAM_c::Z_BufferChk() {
|
|||||||
cXyz currentOffset;
|
cXyz currentOffset;
|
||||||
currentOffset = current.pos;
|
currentOffset = current.pos;
|
||||||
currentOffset.y += 20.0f;
|
currentOffset.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(¤tOffset, ¤tProj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(¤tOffset, ¤tProj);
|
mDoLib_project(¤tOffset, ¤tProj);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
f32 cameraHeight;
|
f32 cameraHeight;
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -611,13 +611,7 @@ void daObjKAT_c::Z_BufferChk() {
|
|||||||
cXyz curWithOff;
|
cXyz curWithOff;
|
||||||
curWithOff = current.pos;
|
curWithOff = current.pos;
|
||||||
curWithOff.y += 20.0f;
|
curWithOff.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&curWithOff, &projected, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&curWithOff, &projected);
|
mDoLib_project(&curWithOff, &projected);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
f32 unkFloat1;
|
f32 unkFloat1;
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -528,13 +528,7 @@ void daObjKUW_c::Z_BufferChk() {
|
|||||||
|
|
||||||
cStack_68 = current.pos;
|
cStack_68 = current.pos;
|
||||||
cStack_68.y += 20.0f;
|
cStack_68.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&cStack_68, &local_5c);
|
mDoLib_project(&cStack_68, &local_5c);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* cc = dComIfGp_getCamera(0);
|
camera_process_class* cc = dComIfGp_getCamera(0);
|
||||||
f32 trimHeight;
|
f32 trimHeight;
|
||||||
if (cc != NULL) {
|
if (cc != NULL) {
|
||||||
|
|||||||
@@ -981,9 +981,7 @@ int daObjStone_c::draw() {
|
|||||||
if (!model) {
|
if (!model) {
|
||||||
f32 shadow_size = l_shadow_size[mStoneType];
|
f32 shadow_size = l_shadow_size[mStoneType];
|
||||||
TGXTexObj* pTex = dDlst_shadowControl_c::getSimpleTex();
|
TGXTexObj* pTex = dDlst_shadowControl_c::getSimpleTex();
|
||||||
cXyz pos = current.pos;
|
dComIfGd_setSimpleShadow(¤t.pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
|
||||||
|
|
||||||
dComIfGd_setSimpleShadow(&pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
|
|
||||||
1.0f, pTex);
|
1.0f, pTex);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -593,13 +593,7 @@ void daObjTEN_c::Z_BufferChk() {
|
|||||||
cXyz cStack_68;
|
cXyz cStack_68;
|
||||||
cStack_68 = current.pos;
|
cStack_68 = current.pos;
|
||||||
cStack_68.y += 20.0f;
|
cStack_68.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&cStack_68, &local_5c);
|
mDoLib_project(&cStack_68, &local_5c);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||||
f32 trimHeight;
|
f32 trimHeight;
|
||||||
if (camera != NULL) {
|
if (camera != NULL) {
|
||||||
|
|||||||
@@ -504,13 +504,7 @@ void daObjTOMBO_c::Z_BufferChk() {
|
|||||||
cXyz cStack_68;
|
cXyz cStack_68;
|
||||||
cStack_68 = current.pos;
|
cStack_68 = current.pos;
|
||||||
cStack_68.y += 20.0f;
|
cStack_68.y += 20.0f;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&cStack_68, &local_5c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&cStack_68, &local_5c);
|
mDoLib_project(&cStack_68, &local_5c);
|
||||||
#endif
|
|
||||||
|
|
||||||
camera_process_class* pCamera = dComIfGp_getCamera(0);
|
camera_process_class* pCamera = dComIfGp_getCamera(0);
|
||||||
f32 trimHeight;
|
f32 trimHeight;
|
||||||
if (pCamera != NULL) {
|
if (pCamera != NULL) {
|
||||||
|
|||||||
@@ -38,12 +38,7 @@ BOOL daZraFreeze_c::chkActorInScreen() {
|
|||||||
mDoMtx_stack_c::transM(0.0f, 0.0f, 0.0f);
|
mDoMtx_stack_c::transM(0.0f, 0.0f, 0.0f);
|
||||||
PSMTXMultVecArray(mDoMtx_stack_c::get(), vec, vec, 8);
|
PSMTXMultVecArray(mDoMtx_stack_c::get(), vec, vec, 8);
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&vec[i], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&vec[i], &proj);
|
mDoLib_project(&vec[i], &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -421,13 +421,7 @@ void daPy_sightPacket_c::draw() {
|
|||||||
|
|
||||||
void daPy_sightPacket_c::setSight() {
|
void daPy_sightPacket_c::setSight() {
|
||||||
Vec proj;
|
Vec proj;
|
||||||
|
|
||||||
#if TARGET_PC
|
|
||||||
mDoLib_project(&mPos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
|
||||||
#else
|
|
||||||
mDoLib_project(&mPos, &proj);
|
mDoLib_project(&mPos, &proj);
|
||||||
#endif
|
|
||||||
|
|
||||||
mDoMtx_stack_c::transS(proj.x, proj.y, proj.z);
|
mDoMtx_stack_c::transS(proj.x, proj.y, proj.z);
|
||||||
mDoMtx_stack_c::scaleM(32.0f, 32.0f, 32.0f);
|
mDoMtx_stack_c::scaleM(32.0f, 32.0f, 32.0f);
|
||||||
mDoMtx_copy(mDoMtx_stack_c::get(), mProjMtx);
|
mDoMtx_copy(mDoMtx_stack_c::get(), mProjMtx);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user