mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
Compare commits
90 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| b0b1978c76 | |||
| 965e958222 | |||
| 8de4863426 | |||
| 9235833413 | |||
| a0e9ee73a8 | |||
| 99fd2f9bc5 | |||
| 7eb61b71f1 | |||
| 2a49673dce | |||
| 20e958bf12 | |||
| d8df116047 | |||
| d432fbcd10 | |||
| 5f69895326 | |||
| 194cb94d43 | |||
| 22535ba84d | |||
| ab65f42816 | |||
| 0508acaa79 | |||
| bf83f40ec5 | |||
| ada67f1be1 | |||
| d876c62822 | |||
| c26b05b1dd | |||
| 97c459a614 | |||
| cd9bb31b02 | |||
| e37c912053 | |||
| 4e42af6cd8 | |||
| 87a95fb1b8 | |||
| 83b210e26c | |||
| 158f31d056 |
+49
-41
@@ -8,8 +8,9 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
# SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -21,13 +22,13 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: GCC x86_64
|
||||
runner: ubuntu-latest
|
||||
runner: [self-hosted, Linux]
|
||||
preset: gcc
|
||||
artifact_arch: x86_64
|
||||
- name: GCC aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
preset: gcc
|
||||
artifact_arch: aarch64
|
||||
# - name: GCC aarch64
|
||||
# runner: ubuntu-24.04-arm
|
||||
# preset: gcc
|
||||
# artifact_arch: aarch64
|
||||
# - name: Clang x86_64
|
||||
# runner: ubuntu-latest
|
||||
# preset: clang
|
||||
@@ -40,17 +41,22 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false' # disabled for self-hosted
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
|
||||
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
||||
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \
|
||||
libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \
|
||||
libxss-dev libfuse2
|
||||
libxss-dev libfuse2 libusb-1.0-0-dev libdecor-0-dev libpipewire-0.3-dev libunwind-dev
|
||||
|
||||
- name: Setup sccache
|
||||
if: 'false' # disabled for self-hosted
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
- name: Print sccache stats
|
||||
run: sccache --show-stats
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset x-linux-ci-${{matrix.preset}}
|
||||
|
||||
@@ -61,6 +67,7 @@ jobs:
|
||||
run: ci/build-appimage.sh
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
||||
@@ -68,23 +75,26 @@ jobs:
|
||||
build/install/Dusk-*.AppImage
|
||||
build/install/debug.tar.*
|
||||
|
||||
|
||||
build-apple:
|
||||
name: Build Apple (${{matrix.name}})
|
||||
runs-on: macos-latest
|
||||
runs-on: [self-hosted, macOS]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: AppleClang macOS universal
|
||||
- name: AppleClang macOS arm64
|
||||
platform: macos
|
||||
preset: x-macos-ci
|
||||
artifact_name: macos-appleclang-universal
|
||||
# - name: AppleClang iOS arm64 # TODO enable when CI is free
|
||||
preset: x-macos-ci-arm64
|
||||
artifact_name: macos-appleclang-arm64
|
||||
# - name: AppleClang macOS x86_64
|
||||
# platform: macos
|
||||
# preset: x-macos-ci-x86_64
|
||||
# artifact_name: macos-appleclang-x86_64
|
||||
# - name: AppleClang iOS arm64
|
||||
# platform: ios
|
||||
# preset: x-ios-ci
|
||||
# artifact_name: ios-appleclang-arm64
|
||||
# - name: AppleClang tvOS arm64 # TODO enable when CI is free
|
||||
# - name: AppleClang tvOS arm64
|
||||
# platform: tvos
|
||||
# preset: x-tvos-ci
|
||||
# artifact_name: tvos-appleclang-arm64
|
||||
@@ -95,22 +105,15 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Update Homebrew
|
||||
if: matrix.platform == 'tvos'
|
||||
run: |
|
||||
brew update
|
||||
brew upgrade --formula
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false'
|
||||
run: brew install cmake ninja
|
||||
|
||||
- name: Install markupsafe
|
||||
if: matrix.platform == 'tvos'
|
||||
run: pip3 install --break-system-packages markupsafe
|
||||
|
||||
- name: Install Rust iOS target
|
||||
if: matrix.platform == 'ios'
|
||||
run: rustup target add aarch64-apple-ios
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup target add aarch64-apple-ios
|
||||
|
||||
- name: Install Rust tvOS target
|
||||
if: matrix.platform == 'tvos'
|
||||
@@ -118,6 +121,12 @@ jobs:
|
||||
rustup toolchain install nightly
|
||||
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
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
@@ -128,6 +137,7 @@ jobs:
|
||||
run: cmake --build --preset ${{matrix.preset}}
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
||||
@@ -139,26 +149,22 @@ jobs:
|
||||
name: Build Windows (${{matrix.name}})
|
||||
runs-on: ${{matrix.runner}}
|
||||
|
||||
env:
|
||||
BUILD_DIR: C:\build
|
||||
SCCACHE_DIR: C:\sccache
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: MSVC x86_64
|
||||
runner: windows-latest
|
||||
runner: [self-hosted, Windows]
|
||||
preset: msvc
|
||||
msvc_arch: amd64
|
||||
vcpkg_arch: x64
|
||||
artifact_arch: x86_64
|
||||
- name: MSVC arm64
|
||||
runner: windows-11-arm
|
||||
preset: arm64-msvc
|
||||
msvc_arch: arm64
|
||||
vcpkg_arch: arm64
|
||||
artifact_arch: arm64
|
||||
# - name: MSVC arm64
|
||||
# runner: windows-11-arm
|
||||
# preset: arm64-msvc
|
||||
# msvc_arch: arm64
|
||||
# vcpkg_arch: arm64
|
||||
# artifact_arch: arm64
|
||||
# - name: Clang x86_64
|
||||
# runner: windows-latest
|
||||
# preset: clang
|
||||
@@ -185,11 +191,10 @@ jobs:
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false' # disabled for self-hosted
|
||||
run: |
|
||||
choco install ninja
|
||||
vcpkg install zlib:${{matrix.vcpkg_arch}}-windows-static bzip2:${{matrix.vcpkg_arch}}-windows-static `
|
||||
zstd:${{matrix.vcpkg_arch}}-windows-static liblzma:${{matrix.vcpkg_arch}}-windows-static `
|
||||
freetype:${{matrix.vcpkg_arch}}-windows-static
|
||||
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset x-windows-ci-${{matrix.preset}}
|
||||
@@ -198,9 +203,12 @@ jobs:
|
||||
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
||||
path: |
|
||||
${{env.BUILD_DIR}}/install/*.exe
|
||||
${{env.BUILD_DIR}}/install/debug.7z
|
||||
build/install/*.exe
|
||||
build/install/*.dll
|
||||
build/install/res/
|
||||
build/install/debug.7z
|
||||
|
||||
+109
-71
@@ -68,6 +68,9 @@ endif()
|
||||
message(STATUS "Dusk version set to ${DUSK_WC_DESCRIBE}")
|
||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
project(dusk LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
||||
if (APPLE)
|
||||
enable_language(OBJC)
|
||||
endif ()
|
||||
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
||||
# ios.toolchain.cmake hack for SDL
|
||||
set(TVOS ON)
|
||||
@@ -113,7 +116,7 @@ set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
|
||||
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
|
||||
|
||||
if (DUSK_MOVIE_SUPPORT)
|
||||
find_package(libjpeg-turbo QUIET)
|
||||
find_package(libjpeg-turbo 3.0 CONFIG QUIET)
|
||||
if (libjpeg-turbo_FOUND)
|
||||
message(STATUS "dusk: Using system libjpeg-turbo")
|
||||
else ()
|
||||
@@ -125,19 +128,37 @@ if (DUSK_MOVIE_SUPPORT)
|
||||
else ()
|
||||
set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a)
|
||||
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
|
||||
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz
|
||||
URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}
|
||||
-DENABLE_SHARED=OFF
|
||||
-DWITH_TURBOJPEG=ON
|
||||
-DWITH_JAVA=OFF
|
||||
CMAKE_ARGS ${_jpeg_cmake_args}
|
||||
BUILD_BYPRODUCTS ${_jpeg_lib}
|
||||
)
|
||||
file(MAKE_DIRECTORY ${_jpeg_install_dir}/include)
|
||||
@@ -249,7 +270,7 @@ include(files.cmake)
|
||||
# TODO: version handling for res includes
|
||||
|
||||
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_FILE_DESCRIPTION "Dusk")
|
||||
set(DUSK_PRODUCT_NAME "Dusk")
|
||||
@@ -277,7 +298,7 @@ set(GAME_INCLUDE_DIRS
|
||||
${CMAKE_BINARY_DIR})
|
||||
|
||||
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
|
||||
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient)
|
||||
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt)
|
||||
|
||||
list(APPEND GAME_LIBS libzstd_static)
|
||||
|
||||
@@ -297,8 +318,12 @@ endif ()
|
||||
|
||||
# Edit & Continue
|
||||
if (MSVC)
|
||||
add_compile_options("/ZI")
|
||||
add_link_options("/INCREMENTAL")
|
||||
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
|
||||
endif ()
|
||||
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
||||
add_link_options("/INCREMENTAL")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if(ANDROID)
|
||||
@@ -358,12 +383,14 @@ if (ANDROID)
|
||||
target_link_options(dusk PRIVATE "-Wl,-u,SDL_main")
|
||||
endif ()
|
||||
|
||||
add_custom_command(TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/res"
|
||||
"$<TARGET_FILE_DIR:dusk>/res"
|
||||
COMMENT "Copying resources"
|
||||
)
|
||||
if (NOT APPLE)
|
||||
add_custom_command(TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/res"
|
||||
"$<TARGET_FILE_DIR:dusk>/res"
|
||||
COMMENT "Copying resources"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
set(DUSK_WINDOWS_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/windows)
|
||||
@@ -397,44 +424,49 @@ endif ()
|
||||
if (APPLE)
|
||||
if (IOS)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
|
||||
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
||||
file(GLOB_RECURSE DUSK_RESOURCE_FILES "${DUSK_RESOURCE_DIR}/Base.lproj/*")
|
||||
endif ()
|
||||
if (IOS OR TVOS)
|
||||
target_sources(dusk PRIVATE ${DUSK_RESOURCE_FILES})
|
||||
foreach (FILE ${DUSK_RESOURCE_FILES})
|
||||
file(RELATIVE_PATH NEW_FILE "${DUSK_RESOURCE_DIR}" ${FILE})
|
||||
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
|
||||
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
|
||||
endforeach ()
|
||||
set_target_properties(
|
||||
dusk PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
|
||||
OUTPUT_NAME dusk
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||
)
|
||||
if (CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
set_target_properties(dusk PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST})
|
||||
elseif (DEFINED DUSK_INFO_PLIST)
|
||||
set(MACOSX_BUNDLE_EXECUTABLE_NAME dusk)
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER})
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME})
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING})
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING})
|
||||
set(DUSK_GENERATED_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/dusk.Info.plist)
|
||||
configure_file(${DUSK_INFO_PLIST} ${DUSK_GENERATED_INFO_PLIST})
|
||||
add_custom_command(
|
||||
TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DUSK_GENERATED_INFO_PLIST} $<TARGET_FILE_DIR:dusk>/Info.plist
|
||||
VERBATIM
|
||||
)
|
||||
endif ()
|
||||
elseif (TVOS)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos)
|
||||
else ()
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos)
|
||||
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 ()
|
||||
|
||||
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
||||
@@ -483,7 +515,9 @@ if (TARGET crashpad_handler)
|
||||
endif ()
|
||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${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)
|
||||
set(DEBUG_FILES_LIST "")
|
||||
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
|
||||
@@ -505,18 +539,22 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
endif ()
|
||||
list(APPEND DEBUG_FILES_LIST "${output_name}")
|
||||
endforeach ()
|
||||
if (WIN32)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
|
||||
elseif (APPLE)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
elseif (UNIX)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
# This is a terrible hack to only run this on CI
|
||||
# until I turn this into a script or something
|
||||
if(DEFINED ENV{GITHUB_ENV})
|
||||
if (WIN32)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
|
||||
elseif (APPLE)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
elseif (UNIX)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
foreach (target IN LISTS BINARY_TARGETS)
|
||||
|
||||
+85
-27
@@ -22,6 +22,20 @@
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_ENABLE_SENTRY_NATIVE": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
|
||||
"DUSK_SENTRY_ENVIRONMENT": "production"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-default",
|
||||
"displayName": "Linux (default)",
|
||||
@@ -134,8 +148,7 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "cl",
|
||||
"CMAKE_CXX_COMPILER": "cl",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"AURORA_DAWN_PROVIDER": "vendor"
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -343,12 +356,9 @@
|
||||
"name": "x-linux-ci",
|
||||
"hidden": true,
|
||||
"inherits": [
|
||||
"relwithdebinfo"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
}
|
||||
"relwithdebinfo",
|
||||
"ci"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x-linux-ci-gcc",
|
||||
@@ -367,11 +377,40 @@
|
||||
{
|
||||
"name": "x-macos-ci",
|
||||
"inherits": [
|
||||
"macos-default-relwithdebinfo"
|
||||
"macos-default-relwithdebinfo",
|
||||
"ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -381,7 +420,11 @@
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_MOVIE_SUPPORT": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -391,21 +434,27 @@
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_MOVIE_SUPPORT": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x-windows-ci",
|
||||
"hidden": true,
|
||||
"inherits": [
|
||||
"relwithdebinfo"
|
||||
"relwithdebinfo",
|
||||
"ci"
|
||||
],
|
||||
"binaryDir": "$env{BUILD_DIR}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "$env{BUILD_DIR}/install",
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded"
|
||||
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded",
|
||||
"CMAKE_TOOLCHAIN_FILE": {
|
||||
"type": "FILEPATH",
|
||||
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
"VCPKG_TARGET_TRIPLET": "x64-windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -546,10 +595,19 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x-macos-ci",
|
||||
"configurePreset": "x-macos-ci",
|
||||
"description": "(Internal) macOS CI",
|
||||
"displayName": "(Internal) macOS CI",
|
||||
"name": "x-macos-ci-arm64",
|
||||
"configurePreset": "x-macos-ci-arm64",
|
||||
"description": "(Internal) macOS CI arm64",
|
||||
"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": [
|
||||
"install"
|
||||
]
|
||||
@@ -557,8 +615,8 @@
|
||||
{
|
||||
"name": "x-ios-ci",
|
||||
"configurePreset": "x-ios-ci",
|
||||
"description": "(Internal) iOS CI",
|
||||
"displayName": "(Internal) iOS CI",
|
||||
"description": "(Internal) iOS CI arm64",
|
||||
"displayName": "(Internal) iOS CI arm64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
@@ -566,8 +624,8 @@
|
||||
{
|
||||
"name": "x-tvos-ci",
|
||||
"configurePreset": "x-tvos-ci",
|
||||
"description": "(Internal) tvOS CI",
|
||||
"displayName": "(Internal) tvOS CI",
|
||||
"description": "(Internal) tvOS CI arm64",
|
||||
"displayName": "(Internal) tvOS CI arm64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
|
||||
@@ -1,103 +1,59 @@
|
||||
## Dusk
|
||||

|
||||
|
||||
### 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
|
||||
```
|
||||
- ### **[Official Website](https://twilitrealm.dev)**
|
||||
- ### **[Discord](https://discord.gg/QACynxeyna)**
|
||||
|
||||
#### 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
|
||||
cmake --preset macos-default-relwithdebinfo
|
||||
cmake --build --preset macos-default-relwithdebinfo
|
||||
```
|
||||
#### iOS
|
||||
- TODO
|
||||
|
||||
Alternate presets available:
|
||||
- `macos-default-debug`: Clang, Debug
|
||||
#### android
|
||||
- TODO
|
||||
|
||||
**ninja (Linux)**
|
||||
# Building
|
||||
If you'd like to build Dusk from source, please read the [build instructions](docs/building.md).
|
||||
|
||||
```sh
|
||||
cmake --preset linux-default-relwithdebinfo
|
||||
cmake --build --preset linux-default-relwithdebinfo
|
||||
```
|
||||
# Credits
|
||||
- Taka
|
||||
- encounter
|
||||
- Antidote
|
||||
- caseif
|
||||
- CraftyBoss
|
||||
- crowell
|
||||
- dooplecks
|
||||
- gymnast86
|
||||
- Irastris
|
||||
- kipcode66
|
||||
- Lars
|
||||
- LunarSoap
|
||||
- Maddie
|
||||
- MelonSpeedruns
|
||||
- Pheenoh
|
||||
- PJB
|
||||
- Roeming
|
||||
- YunataSavior
|
||||
|
||||
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.
|
||||
|
||||
#### 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"`
|
||||
Special thanks to the TP Decomp team, the GC/Wii Decomp community, the Aurora developers, and the TP speedrunning community.
|
||||
|
||||
@@ -9,10 +9,10 @@ chmod +x linuxdeploy-$(uname -m).AppImage
|
||||
# Build AppImage
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
mkdir -p build/appdir/usr/{bin,share/{applications,icons/hicolor}}
|
||||
cp build/install/!(*.*) build/appdir/usr/bin
|
||||
cp -r build/install/!(*.*) build/appdir/usr/bin
|
||||
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
|
||||
cp platforms/freedesktop/dusk.desktop build/appdir/usr/share/applications
|
||||
|
||||
cd build/install
|
||||
VERSION="$DUSK_VERSION" NO_STRIP=1 "$RUNNER_WORKSPACE"/linuxdeploy-$(uname -m).AppImage \
|
||||
--appdir "$GITHUB_WORKSPACE"/build/appdir --output appimage
|
||||
-l /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$GITHUB_WORKSPACE"/build/appdir --output appimage
|
||||
|
||||
@@ -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: 4dd23c74d8...672f1e8e5e
+8
-1
@@ -1334,6 +1334,7 @@ set(DUSK_FILES
|
||||
include/dusk/endian_gx.hpp
|
||||
include/dusk/config.hpp
|
||||
include/dusk/dvd_asset.hpp
|
||||
include/dusk/scope_guard.hpp
|
||||
src/dusk/dvd_asset.cpp
|
||||
src/d/actor/d_a_alink_dusk.cpp
|
||||
src/dusk/asserts.cpp
|
||||
@@ -1342,9 +1343,12 @@ set(DUSK_FILES
|
||||
src/dusk/endian.cpp
|
||||
src/dusk/extras.c
|
||||
src/dusk/extras.cpp
|
||||
src/dusk/file_select.cpp
|
||||
src/dusk/file_select.hpp
|
||||
src/dusk/frame_interpolation.cpp
|
||||
src/dusk/game_clock.cpp
|
||||
src/dusk/globals.cpp
|
||||
src/dusk/gyro_aim.cpp
|
||||
src/dusk/gyro.cpp
|
||||
src/dusk/io.cpp
|
||||
src/dusk/layout.cpp
|
||||
src/dusk/logging.cpp
|
||||
@@ -1358,6 +1362,8 @@ set(DUSK_FILES
|
||||
src/dusk/imgui/ImGuiEngine.hpp
|
||||
src/dusk/imgui/ImGuiMenuGame.cpp
|
||||
src/dusk/imgui/ImGuiMenuGame.hpp
|
||||
src/dusk/imgui/ImGuiBloomWindow.cpp
|
||||
src/dusk/imgui/ImGuiBloomWindow.hpp
|
||||
src/dusk/imgui/ImGuiMenuTools.cpp
|
||||
src/dusk/imgui/ImGuiMenuTools.hpp
|
||||
src/dusk/imgui/ImGuiMenuEnhancements.cpp
|
||||
@@ -1376,6 +1382,7 @@ set(DUSK_FILES
|
||||
src/dusk/imgui/ImGuiSaveEditor.cpp
|
||||
src/dusk/imgui/ImGuiStateShare.hpp
|
||||
src/dusk/imgui/ImGuiStateShare.cpp
|
||||
src/dusk/iso_validate.cpp
|
||||
src/dusk/offset_ptr.cpp
|
||||
src/dusk/OSContext.cpp
|
||||
src/dusk/OSThread.cpp
|
||||
|
||||
@@ -4551,7 +4551,7 @@ public:
|
||||
#if TARGET_PC
|
||||
void handleWolfHowl();
|
||||
void handleQuickTransform();
|
||||
bool checkGyroAimItemContext();
|
||||
bool checkGyroAimContext();
|
||||
#endif
|
||||
}; // Size: 0x385C
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ public:
|
||||
int draw();
|
||||
int execute();
|
||||
void drawMeter();
|
||||
#if TARGET_PC
|
||||
void updateOnWide();
|
||||
#endif
|
||||
void setComboCount(u8, u8);
|
||||
void setScoreCount(u32);
|
||||
void addScoreCount(cXyz*, u32, u8);
|
||||
|
||||
@@ -204,6 +204,9 @@ private:
|
||||
/* 0x6D1 */ u8 field_0x6d1;
|
||||
/* 0x6D2 */ u8 field_0x6d2;
|
||||
/* 0x6D3 */ u8 field_0x6d3;
|
||||
#if TARGET_PC
|
||||
f32 mSelectItemSlideElapsed[4];
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* D_MENU_D_MENU_RING_H */
|
||||
|
||||
@@ -110,6 +110,10 @@ struct dMsgScrnHowl_c : public dMsgScrnBase_c {
|
||||
/* 0x27A0 */ f32 field_0x27a0;
|
||||
/* 0x27A4 */ f32 field_0x27a4;
|
||||
/* 0x27A8 */ f32 field_0x27a8;
|
||||
|
||||
#if TARGET_PC
|
||||
u8 showCursor;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* MSG_SCRN_D_MSG_SCRN_HOWL_H */
|
||||
|
||||
+18
-6
@@ -487,19 +487,31 @@ public:
|
||||
}
|
||||
}
|
||||
char* getPlayerName() const { return const_cast<char*>(mPlayerName); }
|
||||
void setPlayerName(const char* i_name) { strcpy(mPlayerName, i_name); }
|
||||
void setPlayerName(const char* i_name) {
|
||||
#if AVOID_UB
|
||||
strncpy(mPlayerName, i_name, sizeof(mPlayerName) - 1);
|
||||
mPlayerName[sizeof(mPlayerName) - 1] = '\0';
|
||||
#else
|
||||
strcpy(mPlayerName, i_name);
|
||||
#endif
|
||||
}
|
||||
char* getHorseName() const { return const_cast<char*>(mHorseName); }
|
||||
void setHorseName(const char* i_name) { strcpy(mHorseName, i_name); }
|
||||
void setHorseName(const char* i_name) {
|
||||
#if AVOID_UB
|
||||
strncpy(mHorseName, i_name, sizeof(mHorseName) - 1);
|
||||
mHorseName[sizeof(mHorseName) - 1] = '\0';
|
||||
#else
|
||||
strcpy(mHorseName, i_name);
|
||||
#endif
|
||||
}
|
||||
u8 getClearCount() const { return mClearCount; }
|
||||
|
||||
/* 0x00 */ BE(u64) unk0;
|
||||
/* 0x08 */ BE(s64) mTotalTime;
|
||||
/* 0x10 */ BE(u16) unk16;
|
||||
/* 0x12 */ BE(u16) mDeathCount;
|
||||
/* 0x14 */ char mPlayerName[16];
|
||||
/* 0x24 */ u8 unk36;
|
||||
/* 0x25 */ char mHorseName[16];
|
||||
/* 0x35 */ u8 unk53;
|
||||
/* 0x14 */ char mPlayerName[17];
|
||||
/* 0x25 */ char mHorseName[17];
|
||||
/* 0x36 */ u8 mClearCount;
|
||||
/* 0x37 */ u8 unk55[5];
|
||||
}; // Size: 0x40
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct cXyz;
|
||||
class camera_process_class;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,32 +14,40 @@ namespace frame_interp {
|
||||
|
||||
void ensure_initialized();
|
||||
|
||||
void begin_record_camera();
|
||||
void begin_record();
|
||||
void end_record();
|
||||
void interpolate(float step);
|
||||
float get_interpolation_step();
|
||||
|
||||
void notify_presentation_frame();
|
||||
void request_presentation_sync();
|
||||
bool presentation_sync_active();
|
||||
|
||||
void notify_sim_tick_complete();
|
||||
uint32_t begin_presentation_ui_pass();
|
||||
uint32_t get_presentation_ui_advance_ticks();
|
||||
void end_presentation_ui_pass();
|
||||
// TODO: These should be phased out as UI is progressively updated to use game_clock
|
||||
void set_ui_tick_pending(bool value);
|
||||
bool get_ui_tick_pending();
|
||||
|
||||
void open_child(const void* key, int32_t id);
|
||||
void close_child();
|
||||
void record_camera(::camera_process_class* cam, int camera_id);
|
||||
void record_final_mtx_raw(const Mtx* dest, const Mtx src);
|
||||
void record_final_mtx_raw_tagged(const Mtx* dest, const Mtx src, uint64_t stable_tag);
|
||||
|
||||
bool lookup_replacement(const void* source, 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);
|
||||
bool build_star_view(Mtx o_view, Mtx o_cam_billboard_base, cXyz* o_anchor_eye, float* o_fovy);
|
||||
void begin_presentation_camera();
|
||||
void end_presentation_camera();
|
||||
|
||||
struct PresentationCameraScope {
|
||||
PresentationCameraScope() { begin_presentation_camera(); }
|
||||
~PresentationCameraScope() { end_presentation_camera(); }
|
||||
PresentationCameraScope(const PresentationCameraScope&) = delete;
|
||||
PresentationCameraScope& operator=(const PresentationCameraScope&) = delete;
|
||||
PresentationCameraScope(PresentationCameraScope&&) = delete;
|
||||
PresentationCameraScope& operator=(PresentationCameraScope&&) = delete;
|
||||
};
|
||||
|
||||
uint64_t alloc_simple_shadow_pair_base();
|
||||
} // namespace frame_interp
|
||||
} // namespace dusk
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef DUSK_GAME_CLOCK_H
|
||||
#define DUSK_GAME_CLOCK_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
namespace dusk {
|
||||
namespace game_clock {
|
||||
|
||||
void ensure_initialized();
|
||||
void reset_accumulator();
|
||||
|
||||
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;
|
||||
bool do_sim_tick;
|
||||
float interpolation_step;
|
||||
float sim_pace;
|
||||
};
|
||||
|
||||
MainLoopPacer advance_main_loop();
|
||||
|
||||
float consume_interval(const void* consumer);
|
||||
|
||||
} // namespace game_clock
|
||||
} // namespace dusk
|
||||
|
||||
#endif // DUSK_GAME_CLOCK_H
|
||||
@@ -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
|
||||
@@ -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
|
||||
+21
-4
@@ -61,17 +61,20 @@ struct UserSettings {
|
||||
ConfigVar<bool> noMissClimbing;
|
||||
ConfigVar<bool> fastTears;
|
||||
ConfigVar<bool> instantSaves;
|
||||
ConfigVar<bool> instantText;
|
||||
ConfigVar<bool> sunsSong;
|
||||
|
||||
// Preferences
|
||||
ConfigVar<bool> enableMirrorMode;
|
||||
ConfigVar<bool> invertCameraXAxis;
|
||||
ConfigVar<bool> disableMainHUD;
|
||||
|
||||
// Graphics
|
||||
ConfigVar<BloomMode> bloomMode;
|
||||
ConfigVar<float> bloomMultiplier;
|
||||
ConfigVar<bool> enableWaterRefraction;
|
||||
ConfigVar<bool> enableFrameInterpolation;
|
||||
ConfigVar<int> internalResolutionScale;
|
||||
ConfigVar<int> shadowResolutionMultiplier;
|
||||
|
||||
// Audio
|
||||
@@ -80,12 +83,25 @@ struct UserSettings {
|
||||
|
||||
// Input
|
||||
ConfigVar<bool> enableGyroAim;
|
||||
ConfigVar<float> gyroAimSensitivityX;
|
||||
ConfigVar<float> gyroAimSensitivityY;
|
||||
ConfigVar<bool> gyroAimInvertPitch;
|
||||
ConfigVar<bool> gyroAimInvertYaw;
|
||||
ConfigVar<bool> enableGyroRollgoal;
|
||||
ConfigVar<float> gyroSensitivityX;
|
||||
ConfigVar<float> gyroSensitivityY;
|
||||
ConfigVar<float> gyroSensitivityRollgoal;
|
||||
ConfigVar<float> gyroSmoothing;
|
||||
ConfigVar<float> gyroDeadband;
|
||||
ConfigVar<bool> gyroInvertPitch;
|
||||
ConfigVar<bool> gyroInvertYaw;
|
||||
|
||||
// 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> canTransformAnywhere;
|
||||
ConfigVar<bool> fastSpinner;
|
||||
@@ -105,6 +121,7 @@ struct UserSettings {
|
||||
ConfigVar<bool> showPipelineCompilation;
|
||||
ConfigVar<bool> wasPresetChosen;
|
||||
ConfigVar<bool> enableCrashReporting;
|
||||
ConfigVar<bool> duskMenuOpen;
|
||||
} backend;
|
||||
};
|
||||
|
||||
|
||||
@@ -125,8 +125,15 @@ public:
|
||||
#if TARGET_PC
|
||||
static f32 hudAspectScaleDown;
|
||||
static f32 hudAspectScaleUp;
|
||||
static f32 ScaleHUDXLeft(f32 baseX) { return getMinXF() + baseX; }
|
||||
static f32 ScaleHUDXRight(f32 baseX) { return -getMinXF() + baseX; }
|
||||
static void updateSafeAreaBounds();
|
||||
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
|
||||
|
||||
static void setBlureMtx(const Mtx m) {
|
||||
@@ -279,12 +286,7 @@ public:
|
||||
#if WIDESCREEN_SUPPORT
|
||||
static void setTvSize();
|
||||
|
||||
#if TARGET_PC
|
||||
static void onWide(f32 width, f32 height);
|
||||
#else
|
||||
static void onWide();
|
||||
#endif
|
||||
|
||||
static void offWide();
|
||||
static u8 isWide();
|
||||
|
||||
@@ -297,7 +299,7 @@ public:
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
static void setWindowSize(AuroraWindowSize const& size);
|
||||
static void updateRenderSize();
|
||||
#endif
|
||||
|
||||
static TGXTexObj mFrameBufferTexObj;
|
||||
@@ -369,6 +371,15 @@ public:
|
||||
static int m_height;
|
||||
static f32 m_heightF;
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@ struct mDoLib_clipper {
|
||||
};
|
||||
|
||||
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,
|
||||
GXTlutObj* o_tlutObj);
|
||||
void mDoLib_pos2camera(Vec* src, Vec* dst);
|
||||
|
||||
@@ -101,10 +101,6 @@ public:
|
||||
|
||||
void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; }
|
||||
void setFader(JUTFader* fader) { mFader = fader; }
|
||||
#ifdef TARGET_PC
|
||||
// For frame interpolation
|
||||
void setFaderSimSteps(u32 steps);
|
||||
#endif
|
||||
void resetFader() { setFader(NULL); }
|
||||
JUTFader* getFader() const { return mFader; }
|
||||
void setClearColor(JUtility::TColor color) { mClearColor = color; }
|
||||
|
||||
@@ -33,24 +33,16 @@ public:
|
||||
static void postRetraceProc(u32);
|
||||
static void drawDoneCallback();
|
||||
|
||||
u16 getFbWidth() const {
|
||||
#if TARGET_PC
|
||||
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
|
||||
}
|
||||
u16 getFbWidth() const { return mRenderObj->fbWidth; }
|
||||
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
|
||||
void getBounds(u16& width, u16& height) const {
|
||||
width = (u16)getFbWidth();
|
||||
height = (u16)getEfbHeight();
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
u32 getRenderWidth() const { return mRenderWidth; }
|
||||
u32 getRenderHeight() const { return mRenderHeight; }
|
||||
#endif
|
||||
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
||||
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
||||
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
||||
@@ -63,7 +55,7 @@ public:
|
||||
|
||||
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
||||
#if TARGET_PC
|
||||
void setWindowSize(AuroraWindowSize const& size);
|
||||
void setRenderSize(u32 width, u32 height);
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -89,7 +81,8 @@ private:
|
||||
|
||||
#if TARGET_PC
|
||||
public:
|
||||
AuroraWindowSize m_WindowSize;
|
||||
u32 mRenderWidth;
|
||||
u32 mRenderHeight;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -64,10 +64,6 @@ void J2DGrafContext::setup2D() {
|
||||
}
|
||||
|
||||
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> curBounds(mScissorBounds);
|
||||
mScissorBounds.intersect(bounds);
|
||||
@@ -81,7 +77,6 @@ void J2DGrafContext::setScissor() {
|
||||
} else {
|
||||
GXSetScissor(0, 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
||||
|
||||
@@ -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() {
|
||||
s32 bufferNum = JUTXfb::getManager()->getBufferNum();
|
||||
u16 width = JUTVideo::getManager()->getFbWidth();
|
||||
@@ -224,14 +216,7 @@ void JFWDisplay::endGX() {
|
||||
if (mFader != NULL) {
|
||||
ortho.setPort();
|
||||
#ifdef TARGET_PC
|
||||
u32 advance_count = 1;
|
||||
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++) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||
mFader->advance();
|
||||
}
|
||||
if (mFader->getStatus() != 1) {
|
||||
@@ -393,7 +378,7 @@ static void waitPrecise(Limiter& limiter, Uint64 targetNs) {
|
||||
|
||||
static void waitForTick(u32 p1, u16 p2) {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
||||
return;
|
||||
}
|
||||
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()(
|
||||
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_();
|
||||
// not sure what this bit is
|
||||
u32 idx = *(u32*)(((uintptr_t)adaptor - 1) + field_0x8);
|
||||
#endif
|
||||
u8 idx_lowBytes = idx;
|
||||
u8 idx_highBytes = idx >> 8;
|
||||
|
||||
|
||||
@@ -205,7 +205,8 @@ void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
||||
void JUTVideo::waitRetraceIfNeed() {}
|
||||
|
||||
#if TARGET_PC
|
||||
void JUTVideo::setWindowSize(AuroraWindowSize const& size) {
|
||||
m_WindowSize = size;
|
||||
void JUTVideo::setRenderSize(u32 width, u32 height) {
|
||||
mRenderWidth = width;
|
||||
mRenderHeight = height;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:appCategory="game"
|
||||
android:icon="@android:drawable/sym_def_app_icon"
|
||||
android:icon="@mipmap/icon"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@android:style/Theme.NoTitleBar"
|
||||
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>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>mainicon.icns</string>
|
||||
<string>Dusk</string>
|
||||
<key>CFBundleIconName</key>
|
||||
<string>Dusk</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleName</key>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
@@ -4258,6 +4258,12 @@ int daAlink_c::createHeap() {
|
||||
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);
|
||||
if (field_0x2060 == NULL) {
|
||||
return 0;
|
||||
|
||||
@@ -817,6 +817,12 @@ BOOL daAlink_c::checkDownAttackState() {
|
||||
}
|
||||
|
||||
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))
|
||||
&& dComIfGs_getLife() == dComIfGs_getMaxLifeGauge()
|
||||
)
|
||||
|
||||
@@ -143,12 +143,14 @@ void daAlink_c::handleQuickTransform() {
|
||||
procCoMetamorphoseInit();
|
||||
}
|
||||
|
||||
bool daAlink_c::checkGyroAimItemContext() {
|
||||
if (checkWolf()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool daAlink_c::checkGyroAimContext() {
|
||||
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_BOOMERANG_SUBJECT:
|
||||
case PROC_COPY_ROD_SUBJECT:
|
||||
|
||||
@@ -290,6 +290,12 @@ BOOL daAlink_c::checkHookshotStickBG(cBgS_PolyInfo& i_polyinfo) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dComIfG_Bgsp().ChkPolyHSStick(i_polyinfo)) {
|
||||
dBgW_Base* bgw_p = dComIfG_Bgsp().GetBgWBasePointer(i_polyinfo);
|
||||
if (bgw_p != NULL && bgw_p->ChkPushPullOk()) {
|
||||
@@ -448,6 +454,12 @@ void daAlink_c::setHookshotSight() {
|
||||
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);
|
||||
|
||||
if (mHookTargetAcKeep.getActor() != NULL) {
|
||||
@@ -890,6 +902,14 @@ void daAlink_c::setHookshotPos() {
|
||||
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 (targetAc_p != NULL) {
|
||||
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)) {
|
||||
return_speed += current.pos.abs(field_0x3798);
|
||||
}
|
||||
@@ -1548,6 +1574,12 @@ int daAlink_c::procHookshotFly() {
|
||||
f32 temp_f31 = field_0x37d4.abs();
|
||||
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) {
|
||||
setHookshotReturnEnd();
|
||||
} else {
|
||||
|
||||
@@ -180,12 +180,7 @@ void daAlink_c::preKandelaarDraw() {
|
||||
mat_p->setTevColor(2, &color);
|
||||
|
||||
cXyz proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&mKandelaarFlamePos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&mKandelaarFlamePos, &proj);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera_p = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "d/actor/d_a_tag_mhint.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/gyro_aim.h"
|
||||
#include "dusk/gyro.h"
|
||||
#endif
|
||||
|
||||
bool daAlink_c::checkNoSubjectModeCamera() {
|
||||
@@ -130,7 +130,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableGyroAim && checkGyroAimItemContext()) {
|
||||
if (dusk::getSettings().game.enableGyroAim && checkGyroAimContext()) {
|
||||
f32 gyro_scale = 1.0f;
|
||||
if (checkWolfEyeUp()) {
|
||||
gyro_scale *= 0.6f;
|
||||
@@ -142,17 +142,7 @@ BOOL daAlink_c::setBodyAngleToCamera() {
|
||||
|
||||
f32 gy_yaw = 0.f;
|
||||
f32 gy_pitch = 0.f;
|
||||
dusk::gyro_aim::consumeAimDeltas(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;
|
||||
}
|
||||
dusk::gyro::getAimDeltas(gy_yaw, gy_pitch);
|
||||
|
||||
shape_angle.y = shape_angle.y + cM_rad2s(gy_yaw * gyro_scale);
|
||||
sp8 = sp8 + cM_rad2s(gy_pitch * gyro_scale);
|
||||
|
||||
@@ -268,6 +268,11 @@ int daBalloon2D_c::draw() {
|
||||
int daBalloon2D_c::execute() {
|
||||
setAllAlpha();
|
||||
setComboAlpha();
|
||||
|
||||
#if TARGET_PC
|
||||
updateOnWide();
|
||||
#endif
|
||||
|
||||
setHIO(false);
|
||||
return 1;
|
||||
}
|
||||
@@ -278,6 +283,15 @@ void daBalloon2D_c::drawMeter() {
|
||||
drawAddScore();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void daBalloon2D_c::updateOnWide() {
|
||||
// Combo HUD
|
||||
l_HOSTIO = {};
|
||||
|
||||
l_HOSTIO.m.m2DNumberCombo2PosX = mDoGph_gInf_c::ScaleHUDXRight(l_HOSTIO.m.m2DNumberCombo2PosX);
|
||||
l_HOSTIO.m.mAdjustmentToggle = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
void daBalloon2D_c::setComboCount(u8 size, u8 comboNum) {
|
||||
if (mComboNum != comboNum) {
|
||||
@@ -304,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;
|
||||
}
|
||||
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);
|
||||
#endif
|
||||
field_0x5f8[0].field_0x0.set(acStack_2c);
|
||||
field_0x5f8[0].field_0xc = param_2;
|
||||
field_0x5f8[0].field_0xe = 60;
|
||||
|
||||
@@ -337,13 +337,7 @@ void daBoomerang_sight_c::setSight(const cXyz* i_pos, int i_no) {
|
||||
}
|
||||
|
||||
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);
|
||||
#endif
|
||||
|
||||
m_proj_posX[i_no] = proj.x;
|
||||
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());
|
||||
spb0.set(0.0f, 0.0f, 0.0f);
|
||||
mDoMtx_stack_c::multVec(&spb0, &sp98);
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp98, &spa4, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp98, &spa4);
|
||||
#endif
|
||||
|
||||
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) {
|
||||
|
||||
@@ -215,7 +215,16 @@ int daDsh_c::create() {
|
||||
|
||||
mType = getType();
|
||||
|
||||
#ifdef TARGET_PC
|
||||
const char* l_resName[] = {l_arcName[mType], ""};
|
||||
#else
|
||||
// !@bug By making this static, it is only initialized the first time it runs
|
||||
// If gate types that use other arcs are loaded later (without reloading the code)
|
||||
// this array never gets updated and will load the incorrect arc
|
||||
// On GC/Wii, REL loading causes this to reset/reinitialize so the bug is avoided
|
||||
// but TPHD is all statically linked so daDsh_c::CreateHeap fails to get model data and the gate unloads
|
||||
static const char* l_resName[] = {l_arcName[mType], ""};
|
||||
#endif
|
||||
|
||||
int phase = mResLoader.load(l_resName, NULL);
|
||||
if (phase == cPhs_COMPLEATE_e) {
|
||||
|
||||
@@ -429,13 +429,7 @@ void daE_FK_c::DamageAction() {
|
||||
|
||||
bool daE_FK_c::checkViewArea() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤t.pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤t.pos, &proj);
|
||||
#endif
|
||||
|
||||
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) {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(i_pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(i_pos, &proj);
|
||||
#endif
|
||||
|
||||
bool ret = false;
|
||||
if (proj.x >= 0.0f && proj.x <= FB_WIDTH && proj.y >= 0.0f && proj.y <= FB_HEIGHT) {
|
||||
ret = true;
|
||||
|
||||
@@ -1362,13 +1362,7 @@ void daE_SM_c::E_SM_C_Hook() {
|
||||
|
||||
bool daE_SM_c::CheckViewArea() {
|
||||
Vec vec;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤t.pos, &vec, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤t.pos, &vec);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
|
||||
if (vec.x >= 0.0f && vec.x <= FB_WIDTH && vec.y >= 0.0f && vec.y <= FB_HEIGHT) {
|
||||
|
||||
+119
-1
@@ -12,6 +12,7 @@
|
||||
|
||||
#if TARGET_PC
|
||||
#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_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; }
|
||||
@@ -267,6 +268,37 @@ static void* tex_d[2] = {
|
||||
|
||||
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() {
|
||||
#if TARGET_PC
|
||||
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_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_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
|
||||
|
||||
GXSetZCompLoc(0);
|
||||
@@ -329,9 +425,14 @@ void daMant_packet_c::draw() {
|
||||
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
|
||||
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
||||
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);
|
||||
#endif
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
@@ -347,8 +448,13 @@ void daMant_packet_c::draw() {
|
||||
GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
||||
|
||||
GXSetCullMode(GX_CULL_FRONT);
|
||||
#if TARGET_PC
|
||||
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
|
||||
cMtx_inverseTranspose(j3dSys.getViewMtx(), MStack_54);
|
||||
#else
|
||||
GXLoadPosMtxImm(this->mMtx2, GX_PNMTX0);
|
||||
cMtx_inverseTranspose(this->mMtx2, MStack_54);
|
||||
#endif
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
@@ -360,11 +466,13 @@ void daMant_packet_c::draw() {
|
||||
static int daMant_Draw(mant_class* i_this) {
|
||||
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
|
||||
|
||||
#if !TARGET_PC
|
||||
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.getMtx2());
|
||||
#endif
|
||||
|
||||
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) {
|
||||
#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;
|
||||
cXyz* pcVar5 = i_this->field_0x0570.getPos();
|
||||
#endif
|
||||
mant_v_calc(i_this);
|
||||
for (int i = 0; i < 13; i++) {
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int mant_cut_type;
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include "d/d_s_play.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/gyro.h"
|
||||
#endif
|
||||
|
||||
enum koro2_parts {
|
||||
KORO2_PART_BOX = 1,
|
||||
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.z, 0, 2, 0x200);
|
||||
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;
|
||||
if (i_this->field_0x4010 == 2) {
|
||||
static f32 old_stick_x = 0.0f;
|
||||
@@ -739,6 +751,11 @@ static void koro2_game(fshop_class* i_this) {
|
||||
|
||||
old_stick_x = mDoCPd_c::getSubStickX(PAD_1);
|
||||
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);
|
||||
|
||||
sp5C.x = mDoCPd_c::getStickX3D(PAD_1);
|
||||
@@ -765,9 +782,26 @@ static void koro2_game(fshop_class* i_this) {
|
||||
reg_f30 = 0.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableGyroRollgoal) {
|
||||
s16 rg_add_x;
|
||||
s16 rg_add_z;
|
||||
dusk::gyro::rollgoalTableOffset(rg_add_x, rg_add_z);
|
||||
s16 tgt_x = static_cast<s16>(reg_f30 * (-6000.0f + JREG_F(7))) + rg_add_x;
|
||||
s16 tgt_z = static_cast<s16>(reg_f31 * (-6000.0f + JREG_F(8))) + rg_add_z;
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, tgt_x, 4, 0x200);
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, tgt_z, 4, 0x200);
|
||||
}
|
||||
#else
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)), 4, 0x200);
|
||||
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)), 4, 0x200);
|
||||
#endif
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (i_this->field_0x4010 != 2) {
|
||||
dusk::gyro::rollgoalTick(false, i_this->field_0x4060);
|
||||
}
|
||||
#endif
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1054,7 +1054,7 @@ void daMidna_c::setBodyPartMatrix() {
|
||||
}
|
||||
mpModel->calcWeightEnvelopeMtx();
|
||||
#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++) {
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(mpModel->getWeightAnmMtx(i)), mpModel->getWeightAnmMtx(i));
|
||||
}
|
||||
|
||||
@@ -3342,13 +3342,8 @@ static void daMP_THPGXYuv2RgbSetup(const GXRenderModeObj* rmode) {
|
||||
Mtx44 m;
|
||||
Mtx e_m;
|
||||
|
||||
#if TARGET_PC
|
||||
w = JUTVideo::getManager()->getFbWidth();
|
||||
h = JUTVideo::getManager()->getEfbHeight();
|
||||
#else
|
||||
w = rmode->fbWidth;
|
||||
h = rmode->efbHeight;
|
||||
#endif
|
||||
var_f31 = 0.0f;
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
|
||||
@@ -363,6 +363,18 @@ int daMyna_c::destroy() {
|
||||
mpMorf->stopZelAnime();
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// !@bug d_a_myna.rel unload used to zero these file-statics; with static linking they dangle across scenes.
|
||||
daMyna_LightActor = NULL;
|
||||
daMyna_evtTagActor0 = NULL;
|
||||
daMyna_evtTagActor1 = NULL;
|
||||
daMyna_actor_count = 0;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
daMyna_targetActor[i] = NULL;
|
||||
daMyna_subActor[i] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
l_HOSTIO.removeHIO();
|
||||
#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++) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos_array[i], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos_array[i], &proj);
|
||||
#endif
|
||||
|
||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,10 @@ static int daNpc_Inko_Execute(npc_inko_class* i_this) {
|
||||
}
|
||||
|
||||
f32 var_f31;
|
||||
|
||||
#if AVOID_UB
|
||||
var_f31 = 0.0f;
|
||||
#endif
|
||||
if (i_this->field_0x598 == 0) {
|
||||
if (i_this->field_0x59c[1] == 0) {
|
||||
i_this->field_0x59c[1] = 30.0f + cM_rndF(70.0f);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "f_op/f_op_kankyo_mng.h"
|
||||
#include "c/c_damagereaction.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
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;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
// fallthrough
|
||||
|
||||
case 2:
|
||||
@@ -2683,6 +2687,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
if (i_this->mDemoCounter == 0) {
|
||||
i_this->mCameraCenter1.set(387.0f, 133.0f, -866.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) {
|
||||
@@ -2719,6 +2726,9 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
i_this->mCameraFovY = 45.0f;
|
||||
camera->mCamera.SetTrimSize(3);
|
||||
daPy_getPlayerActorClass()->changeOriginalDemo();
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
// fallthrough
|
||||
|
||||
case 11:
|
||||
@@ -2799,8 +2809,14 @@ static void demo_camera(npc_ne_class* i_this) {
|
||||
MtxPosition(&vec, &i_this->mCameraEye2);
|
||||
i_this->mCameraEye2 += player->current.pos;
|
||||
player->changeDemoParam2(2);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::request_presentation_sync();
|
||||
#endif
|
||||
} else if (i_this->mDemoCounter == 120) {
|
||||
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.y += 20.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,
|
||||
|
||||
@@ -239,6 +239,17 @@ cPhs_Step daNpcTheB_c::create() {
|
||||
fopAcM_ct(this, daNpcTheB_c);
|
||||
|
||||
cPhs_Step phase = dComIfG_resLoad(&mPhase, l_arcName);
|
||||
#if TARGET_PC
|
||||
// !@bug On PC (and presumably the WiiU version) during the wagon escort,
|
||||
// Telma's main() can queue the PERSONAL_COMBAT_INTRO (Telma's initial dialog when the escort starts)
|
||||
// before Link's create() sets getPlayer(0), so demoCheck drops the event and the dialog never shows up
|
||||
if (phase == cPhs_COMPLEATE_e && dComIfGp_getPlayer(0) == NULL &&
|
||||
strcmp(dComIfGp_getStartStageName(), "F_SP121") == 0 &&
|
||||
dComIfG_play_c::getLayerNo(0) == 3)
|
||||
{
|
||||
return cPhs_INIT_e;
|
||||
}
|
||||
#endif
|
||||
if (phase == cPhs_COMPLEATE_e) {
|
||||
if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x2CB0)) {
|
||||
return cPhs_ERROR_e;
|
||||
|
||||
@@ -499,13 +499,7 @@ void daObjARI_c::Z_BufferChk() {
|
||||
cXyz vec2, vec1;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -285,13 +285,7 @@ bool Hahen_c::CheckCull() {
|
||||
|
||||
bool Hahen_c::checkViewArea() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos, &proj);
|
||||
#endif
|
||||
|
||||
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;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -224,13 +224,7 @@ void daObjCRVFENCE_c::NormalAction() {
|
||||
|
||||
bool daObjCRVFENCE_c::checkViewArea(cXyz* param_1) {
|
||||
Vec sp24;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(param_1, &sp24, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(param_1, &sp24);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
bool bVar1 = false;
|
||||
|
||||
|
||||
@@ -137,13 +137,7 @@ void daObjCRVHAHEN_c::CheckCull() {
|
||||
|
||||
bool daObjCRVHAHEN_c::checkViewArea(cXyz* i_this) {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(i_this, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(i_this, &proj);
|
||||
#endif
|
||||
|
||||
bool ret = false;
|
||||
|
||||
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;
|
||||
vec1 = current.pos;
|
||||
vec1.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&vec1, &vec2, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&vec1, &vec2);
|
||||
#endif
|
||||
|
||||
f32 trim_height;
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -201,13 +201,7 @@ void daObjGOMIKABE_c::CheckCull() {
|
||||
|
||||
bool daObjGOMIKABE_c::checkViewArea(cXyz param_1) {
|
||||
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);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
if (local_24.x >= 0.0f && local_24.x <= FB_WIDTH && local_24.y >= 0.0f && local_24.y <= FB_HEIGHT) {
|
||||
rv = true;
|
||||
|
||||
@@ -214,13 +214,7 @@ void daObjHHASHI_c::CheckCull() {
|
||||
|
||||
bool daObjHHASHI_c::checkViewArea(int param_1) {
|
||||
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);
|
||||
#endif
|
||||
|
||||
bool rv = false;
|
||||
if (local_20.x >= 0.0f && local_20.x <= FB_WIDTH && local_20.y >= 0.0f && local_20.y <= FB_HEIGHT) {
|
||||
rv = true;
|
||||
|
||||
@@ -517,13 +517,7 @@ void daObjKAM_c::Z_BufferChk() {
|
||||
cXyz currentOffset;
|
||||
currentOffset = current.pos;
|
||||
currentOffset.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(¤tOffset, ¤tProj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(¤tOffset, ¤tProj);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 cameraHeight;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -611,13 +611,7 @@ void daObjKAT_c::Z_BufferChk() {
|
||||
cXyz curWithOff;
|
||||
curWithOff = current.pos;
|
||||
curWithOff.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&curWithOff, &projected, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&curWithOff, &projected);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 unkFloat1;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -528,13 +528,7 @@ void daObjKUW_c::Z_BufferChk() {
|
||||
|
||||
cStack_68 = current.pos;
|
||||
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);
|
||||
#endif
|
||||
|
||||
camera_process_class* cc = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (cc != NULL) {
|
||||
|
||||
@@ -593,13 +593,7 @@ void daObjTEN_c::Z_BufferChk() {
|
||||
cXyz cStack_68;
|
||||
cStack_68 = current.pos;
|
||||
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);
|
||||
#endif
|
||||
|
||||
camera_process_class* camera = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (camera != NULL) {
|
||||
|
||||
@@ -504,13 +504,7 @@ void daObjTOMBO_c::Z_BufferChk() {
|
||||
cXyz cStack_68;
|
||||
cStack_68 = current.pos;
|
||||
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);
|
||||
#endif
|
||||
|
||||
camera_process_class* pCamera = dComIfGp_getCamera(0);
|
||||
f32 trimHeight;
|
||||
if (pCamera != NULL) {
|
||||
|
||||
@@ -38,12 +38,7 @@ BOOL daZraFreeze_c::chkActorInScreen() {
|
||||
mDoMtx_stack_c::transM(0.0f, 0.0f, 0.0f);
|
||||
PSMTXMultVecArray(mDoMtx_stack_c::get(), vec, vec, 8);
|
||||
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);
|
||||
#endif
|
||||
|
||||
if (0.0f < proj.x && proj.x < FB_WIDTH && 0.0f < proj.y && proj.y < FB_HEIGHT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -421,13 +421,7 @@ void daPy_sightPacket_c::draw() {
|
||||
|
||||
void daPy_sightPacket_c::setSight() {
|
||||
Vec proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&mPos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&mPos, &proj);
|
||||
#endif
|
||||
|
||||
mDoMtx_stack_c::transS(proj.x, proj.y, proj.z);
|
||||
mDoMtx_stack_c::scaleM(32.0f, 32.0f, 32.0f);
|
||||
mDoMtx_copy(mDoMtx_stack_c::get(), mProjMtx);
|
||||
|
||||
@@ -147,7 +147,7 @@ void dBrightCheck_c::modeMove() {
|
||||
void dBrightCheck_c::brightCheckWide() {
|
||||
// Main Canvas
|
||||
mBrightCheck.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mBrightCheck.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mBrightCheck.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
// Right Square
|
||||
mBrightCheck.Scr->search(MULTI_CHAR('fuchi_1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
@@ -11079,7 +11079,6 @@ static int camera_draw(camera_process_class* i_this) {
|
||||
&process->view.lookat.up, process->view.bank);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_camera(process, camera_id);
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(process->view.viewMtx), process->view.viewMtx);
|
||||
#endif
|
||||
|
||||
#if WIDESCREEN_SUPPORT
|
||||
|
||||
+21
-13
@@ -1,28 +1,29 @@
|
||||
#include "d/dolzel.h" // IWYU pragma: keep
|
||||
|
||||
#include <cstdio>
|
||||
#include "JSystem/J2DGraph/J2DAnimation.h"
|
||||
#include "JSystem/J2DGraph/J2DGrafContext.h"
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "SSystem/SComponent/c_bg_s_shdw_draw.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_drawlist.h"
|
||||
|
||||
#include <typeindex>
|
||||
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include "client/TracyScoped.hpp"
|
||||
#include "d/d_s_play.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/gx_helper.h"
|
||||
#include "dusk/logging.h"
|
||||
#include "m_Do/m_Do_graphic.h"
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include <cstdio>
|
||||
#include <typeindex>
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include "client/TracyScoped.hpp"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/gx_helper.h"
|
||||
#include "dusk/logging.h"
|
||||
#endif
|
||||
|
||||
class dDlst_2Dm_c {
|
||||
public:
|
||||
virtual void draw();
|
||||
@@ -1432,8 +1433,14 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
|
||||
mDoMtx_stack_c::scaleM(param_2, 1.0f, param_2 * param_5);
|
||||
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(&mVolumeMtx, mVolumeMtx);
|
||||
dusk::frame_interp::record_final_mtx_raw(&mMtx, mMtx);
|
||||
const uint64_t shadow_tag_base = dusk::frame_interp::alloc_simple_shadow_pair_base();
|
||||
if (shadow_tag_base != 0) {
|
||||
dusk::frame_interp::record_final_mtx_raw_tagged(&mVolumeMtx, mVolumeMtx, shadow_tag_base);
|
||||
dusk::frame_interp::record_final_mtx_raw_tagged(&mMtx, mMtx, shadow_tag_base + 1u);
|
||||
} else {
|
||||
dusk::frame_interp::record_final_mtx_raw(&mVolumeMtx, mVolumeMtx);
|
||||
dusk::frame_interp::record_final_mtx_raw(&mMtx, mMtx);
|
||||
}
|
||||
#endif
|
||||
mpTexObj = param_6;
|
||||
}
|
||||
@@ -1537,9 +1544,10 @@ void dDlst_shadowControl_c::imageDraw(Mtx param_0) {
|
||||
#ifdef TARGET_PC
|
||||
GXCreateFrameBuffer(r26, r26);
|
||||
needsRestore = true;
|
||||
#endif
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, r26, r26, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, r26, r26);
|
||||
#endif
|
||||
}
|
||||
GXSetTevColor(GX_TEVREG0, l_imageDrawColor[chan]);
|
||||
if (chan == 3) {
|
||||
|
||||
+9
-10
@@ -3776,7 +3776,7 @@ bool dFile_select_c::yesnoWakuAlpahAnm(u8 param_1) {
|
||||
#if TARGET_PC
|
||||
void dFile_select_c::fileSelectWide() {
|
||||
mYnSel.ScrYn->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mYnSel.ScrYn->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mYnSel.ScrYn->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('w_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('f_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3784,7 +3784,7 @@ void dFile_select_c::fileSelectWide() {
|
||||
mYnSel.ScrYn->search(MULTI_CHAR('f_yes_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
m3mSel.Scr3m->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
m3mSel.Scr3m->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
m3mSel.Scr3m->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('w_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('f_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3794,7 +3794,7 @@ void dFile_select_c::fileSelectWide() {
|
||||
m3mSel.Scr3m->search(MULTI_CHAR('f_cop_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
fileSel.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
fileSel.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
fileSel.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
fileSel.Scr->search(MULTI_CHAR('t_for'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
fileSel.Scr->search(MULTI_CHAR('t_for1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -3870,16 +3870,10 @@ void dFile_select_c::_draw() {
|
||||
dComIfGd_set2DOpa(mSelIcon2);
|
||||
|
||||
#if PLATFORM_GCN
|
||||
#if TARGET_PC
|
||||
mpFadePict->draw(0, 0,
|
||||
mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), false, false,
|
||||
false);
|
||||
#else
|
||||
mpFadePict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
|
||||
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false,
|
||||
false);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5584,7 +5578,13 @@ void dFile_select3D_c::createMirrorModel() {
|
||||
void dFile_select3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz* param_3) {
|
||||
Mtx adStack_98;
|
||||
Mtx auStack_c8;
|
||||
#if TARGET_PC
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getSafeMinXF()) / mDoGph_gInf_c::getSafeWidthF()) -
|
||||
1.0f);
|
||||
#else
|
||||
param_0 = (2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
|
||||
#endif
|
||||
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
|
||||
calcViewMtx(adStack_98);
|
||||
cMtx_inverse(adStack_98, auStack_c8);
|
||||
@@ -5601,4 +5601,3 @@ void dFile_select3D_c::calcViewMtx(Mtx param_0) {
|
||||
cXyz pos2(0.0f, 1.0f, 0.0f);
|
||||
cMtx_lookAt(param_0, &pos1, &cXyz::Zero, &pos2, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,11 +37,10 @@ void dDlst_Gameover_CAPTURE_c::draw() {
|
||||
TGXTexObj tex_obj;
|
||||
Mtx44 m;
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), GX_TF_RGB565, GX_TRUE);
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, GX_TF_RGB565, GX_FALSE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, GX_TF_RGB565, GX_TRUE);
|
||||
#endif
|
||||
GXCopyTex(mDoGph_gInf_c::mZbufferTex, 0);
|
||||
|
||||
@@ -82,11 +82,7 @@ void dInsect_c::CalcZBuffer(f32 param_0) {
|
||||
pos = current.pos;
|
||||
pos.y += 20.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&pos, &pos_projected, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&pos, &pos_projected);
|
||||
#endif
|
||||
|
||||
if (dComIfGp_getCamera(0)) {
|
||||
camera_trim_height = dComIfGp_getCamera(0)->mCamera.mTrimHeight;
|
||||
|
||||
+5
-4
@@ -33,6 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#if TARGET_PC
|
||||
#include "dusk/imgui/ImGuiBloomWindow.hpp"
|
||||
#include "dusk/settings.h"
|
||||
#endif
|
||||
|
||||
@@ -2578,6 +2579,10 @@ void dScnKy_env_light_c::setLight() {
|
||||
mDoGph_gInf_c::getBloom()->setMode(mode);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
dusk::ApplyBloomOverride();
|
||||
#endif
|
||||
|
||||
f32 var_f30;
|
||||
if (dKy_Outdoor_check() == true) {
|
||||
static f32 now_shadow_alpha[] = {0.25f, 0.35f, 0.6f, 0.6f, 0.25f, 0.35f};
|
||||
@@ -10999,11 +11004,7 @@ void dKy_depth_dist_set(void* process_p) {
|
||||
|
||||
f32 var_f31 = sp24.abs(camera_p->view.lookat.eye);
|
||||
if (var_f31 < 2000.0f && var_f31 < kankyo->field_0x1268) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&actor_p->eyePos, &sp30, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&actor_p->eyePos, &sp30);
|
||||
#endif
|
||||
|
||||
if ((sp30.x >= 0.0f && sp30.x < FB_WIDTH) && (sp30.y >= 0.0f &&
|
||||
#if DEBUG
|
||||
|
||||
@@ -915,12 +915,7 @@ void dKydb_dungeonlight_draw() {
|
||||
rot.y = 0;
|
||||
dDbVw_drawCubeXlu(player->current.pos, size, rot, color);
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&g_env_light.dungeonlight[i].mPosition, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&g_env_light.dungeonlight[i].mPosition, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > 30.0f) {
|
||||
proj.x -= 30.0f;
|
||||
}
|
||||
|
||||
@@ -116,12 +116,7 @@ void dKyr_lenzflare_move() {
|
||||
cXyz vect;
|
||||
cXyz proj;
|
||||
cXyz center;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(lenz_packet->mPositions, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(lenz_packet->mPositions, &proj);
|
||||
#endif
|
||||
|
||||
center.x = FB_WIDTH / 2;
|
||||
center.y = FB_HEIGHT / 2;
|
||||
@@ -221,12 +216,7 @@ void dKyr_sun_move() {
|
||||
}
|
||||
|
||||
cXyz proj;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(sun_packet->mPos, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(sun_packet->mPos, &proj);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
cXyz chkpnt = proj;
|
||||
@@ -4110,62 +4100,24 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
color_reg0.b = 0xFF;
|
||||
color_reg0.a = 0xFF;
|
||||
|
||||
#if TARGET_PC
|
||||
Mtx star_gx_view;
|
||||
cXyz anchor_eye;
|
||||
f32 star_fovy = 45.0f;
|
||||
MtxP gx_load_view = drawMtx;
|
||||
bool star_use_present_view = false;
|
||||
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
star_use_present_view = dusk::frame_interp::build_star_view(star_gx_view, camMtx, &anchor_eye, &star_fovy);
|
||||
}
|
||||
|
||||
if (star_use_present_view) {
|
||||
gx_load_view = star_gx_view;
|
||||
} else {
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
MTXInverse(dComIfGd_getView()->viewMtxNoTrans, camMtx);
|
||||
anchor_eye = camera->view.lookat.eye;
|
||||
star_fovy = dComIfGd_getView()->fovy;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
MTXInverse(dComIfGd_getView()->viewMtxNoTrans, camMtx);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(dComIfGp_getStartStageName(), "F_SP200") == 0 && dComIfG_play_c::getLayerNo(0) == 0) {
|
||||
moon_pos = envlight->moon_pos;
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
moon_pos = anchor_eye + envlight->moon_pos;
|
||||
#else
|
||||
moon_pos = camera->view.lookat.eye + envlight->moon_pos;
|
||||
#endif
|
||||
if (sp38) {
|
||||
#if TARGET_PC
|
||||
moon_pos.x = 3900.0f + anchor_eye.x;
|
||||
moon_pos.y = 8052.0f + anchor_eye.y;
|
||||
moon_pos.z = -9072.0f + anchor_eye.z;
|
||||
#else
|
||||
moon_pos.x = 3900.0f + camera->view.lookat.eye.x;
|
||||
moon_pos.y = 8052.0f + camera->view.lookat.eye.y;
|
||||
moon_pos.z = -9072.0f + camera->view.lookat.eye.z;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&moon_pos, &moon_proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&moon_pos, &moon_proj);
|
||||
#endif
|
||||
|
||||
// Dusk optimization: we use vertex color rather than GX_TEVREG0 to set star color.
|
||||
// This allows us to merge all the stars into a single draw.
|
||||
@@ -4193,11 +4145,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
MTXConcat(camMtx, rotMtx, camMtx);
|
||||
|
||||
#if TARGET_PC
|
||||
GXLoadPosMtxImm(gx_load_view, GX_PNMTX0);
|
||||
#else
|
||||
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
|
||||
#endif
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
|
||||
rot += 0.65f;
|
||||
@@ -4205,23 +4153,12 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
rot = 0.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
spBC = anchor_eye;
|
||||
#else
|
||||
spBC.x = camera->view.lookat.eye.x;
|
||||
spBC.y = camera->view.lookat.eye.y;
|
||||
spBC.z = camera->view.lookat.eye.z;
|
||||
#endif
|
||||
|
||||
f32 sp34 = -1.0f;
|
||||
int sp30 = 0;
|
||||
#if TARGET_PC
|
||||
f32 var_f30 = star_fovy / 45.0f;
|
||||
if (var_f30 >= 1.0f) {
|
||||
var_f30 = 1.0f;
|
||||
}
|
||||
var_f30 = 1.0f - var_f30;
|
||||
#else
|
||||
f32 var_f30 = 0.0f;
|
||||
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
@@ -4231,7 +4168,6 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
var_f30 = 1.0f - var_f30;
|
||||
}
|
||||
#endif
|
||||
f32 temp_f27 = 0.28f * (1.0f - var_f30);
|
||||
|
||||
sp98.x = 0.0f;
|
||||
@@ -4330,11 +4266,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
sp68.y = spBC.y + star_pos.y;
|
||||
sp68.z = spBC.z + star_pos.z;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp68, &star_proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp68, &star_proj);
|
||||
#endif
|
||||
|
||||
moon_proj.z = 0.0f;
|
||||
star_proj.z = 0.0f;
|
||||
@@ -4749,11 +4681,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
}
|
||||
|
||||
if (g_env_light.daytime > 105.0f && g_env_light.daytime < 240.0f && !dComIfGp_event_runCheck() && sun_packet != NULL && sun_packet->mSunAlpha > 0.0f) {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sun_packet->mPos[0], &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sun_packet->mPos[0], &proj);
|
||||
#endif
|
||||
if (proj.x > 0.0f && proj.x < FB_WIDTH && proj.y > spC4 && proj.y < (458.0f - spC4)) {
|
||||
pass = 0;
|
||||
}
|
||||
@@ -5018,12 +4946,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
x = 100.0f;
|
||||
y = 100.0f;
|
||||
z = 100.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spF0, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spF0, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > -x && proj.x < (FB_WIDTH + x) && proj.y > -y && proj.y < (458.0f + z)) {
|
||||
break;
|
||||
@@ -5073,12 +4996,7 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
x = 100.0f;
|
||||
y = 100.0f;
|
||||
z = 100.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spE4, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spE4, &proj);
|
||||
#endif
|
||||
|
||||
if (proj.x > -x && proj.x < (FB_WIDTH + x) && proj.y > -y && proj.y < (458.0f + z)) {
|
||||
break;
|
||||
@@ -6118,13 +6036,7 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
sp34.x = 80.0f;
|
||||
sp34.y = 80.0f;
|
||||
sp34.z = 80.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&sp7C, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&sp7C, &proj);
|
||||
#endif
|
||||
|
||||
if (!(proj.x > -sp34.x) || !(proj.x < (FB_WIDTH + sp34.x)) ||
|
||||
!(proj.y > -sp34.y) || !(proj.y < (458.0f + sp34.z)))
|
||||
{
|
||||
@@ -6349,12 +6261,7 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
sp44.y = 80.0f;
|
||||
sp44.z = 80.0f;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&spA4, &proj, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&spA4, &proj);
|
||||
#endif
|
||||
|
||||
if (!(proj.x > -sp44.x) || !(proj.x < (FB_WIDTH + sp44.x)) ||
|
||||
!(proj.y > -sp44.y) || !(proj.y < (458.0f + sp44.z)))
|
||||
{
|
||||
|
||||
+13
-16
@@ -16,10 +16,6 @@
|
||||
|
||||
#ifdef TARGET_PC
|
||||
constexpr u16 kMapResolutionMultiplier = 4;
|
||||
// Line widths are relative to the framebuffer size. Since we're rendering to a separate
|
||||
// framebuffer, we have to scale them accordingly. The original game used about half of the
|
||||
// EFB for the map rendering, so this is a reasonable approximation.
|
||||
constexpr u8 kMapLineWidthMultiplier = 2;
|
||||
#endif
|
||||
|
||||
void dMpath_n::dTexObjAggregate_c::create() {
|
||||
@@ -242,11 +238,7 @@ void dDrawPath_c::rendering(dDrawPath_c::line_class const* p_line) {
|
||||
int width = getLineWidth(p_line->field_0x1);
|
||||
|
||||
if (width > 0 && p_line->mDataNum >= 2) {
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
#else
|
||||
GXSetLineWidth(width * 2, GX_TO_ZERO);
|
||||
#endif
|
||||
GXSetLineWidth(width, GX_TO_ZERO);
|
||||
GXSetTevColor(GX_TEVREG0, *getLineColor(p_line->field_0x0 & 0x3F, p_line->field_0x1));
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, p_line->mDataNum);
|
||||
|
||||
@@ -435,8 +427,12 @@ void dRenderingFDAmap_c::preRenderingMap() {
|
||||
const u16 w = mTexWidth * kMapResolutionMultiplier;
|
||||
const u16 h = mTexHeight * kMapResolutionMultiplier;
|
||||
GXCreateFrameBuffer(w, h);
|
||||
GXSetViewport(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, w, h);
|
||||
// Set logical viewport dimensions
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
// Set render viewport dimensions
|
||||
GXSetViewportRender(0.0f, 0.0f, w, h, 0.0f, 1.0f);
|
||||
GXSetScissorRender(0, 0, w, h);
|
||||
#else
|
||||
GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f);
|
||||
GXSetScissor(0, 0, mTexWidth, mTexHeight);
|
||||
@@ -456,6 +452,12 @@ void dRenderingFDAmap_c::preRenderingMap() {
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
setTevSettingNonTextureDirectColor();
|
||||
f32 right = field_0x8 * 0.5f;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
right = field_0x8 * -0.5f;
|
||||
}
|
||||
#endif
|
||||
|
||||
f32 top = field_0xc * 0.5f;
|
||||
Mtx44 matrix;
|
||||
C_MTXOrtho(matrix, top, -top, -right, right, 0.0f, 10000.0f);
|
||||
@@ -511,13 +513,8 @@ void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_li
|
||||
|
||||
BE(u16)* data_p = p_line->mpData;
|
||||
s32 data_num = p_line->mDataNum;
|
||||
#ifdef TARGET_PC
|
||||
GXSetLineWidth(width * kMapLineWidthMultiplier, GX_TO_ZERO);
|
||||
GXSetPointSize(width * kMapLineWidthMultiplier, GX_TO_ONE);
|
||||
#else
|
||||
GXSetLineWidth(width, GX_TO_ONE);
|
||||
GXSetPointSize(width, GX_TO_ONE);
|
||||
#endif
|
||||
GXColor lineColor = *getDecoLineColor(p_line->field_0x0 & 0x3f, p_line->field_0x1);
|
||||
GXSetTevColor(GX_TEVREG0, lineColor);
|
||||
lineColor.r = lineColor.r - 4;
|
||||
|
||||
@@ -99,7 +99,7 @@ dMenu_Collect2D_c::~dMenu_Collect2D_c() {
|
||||
void dMenu_Collect2D_c::menuCollectWide() {
|
||||
// Main Canvas
|
||||
mpScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mpScreen->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mpScreen->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
// Pieces of Heart
|
||||
mpScreen->search(MULTI_CHAR('heart_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
@@ -182,7 +182,7 @@ void dMenu_Collect2D_c::_create() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mpScreenIcon->translate(-mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mpScreenIcon->translate(-mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
#endif
|
||||
|
||||
dPaneClass_showNullPane(mpScreenIcon);
|
||||
@@ -2688,12 +2688,7 @@ u8 dMenu_Collect3D_c::getMaskMdlVisible() {
|
||||
f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f;
|
||||
|
||||
void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
#if TARGET_PC
|
||||
f32 scaleFactor = mDoGph_gInf_c::getHeight() / FB_HEIGHT;
|
||||
GXSetViewport(0.0f, mViewOffsetY * scaleFactor, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), 0.0f, 1.0f);
|
||||
#else
|
||||
GXSetViewport(0.0f, mViewOffsetY, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f);
|
||||
#endif
|
||||
mViewOffsetY = -100.0f;
|
||||
Mtx44 projection;
|
||||
C_MTXPerspective(projection, 45.0f, mDoGph_gInf_c::getAspect(), 1.0f, 100000.0f);
|
||||
@@ -2706,8 +2701,14 @@ void dMenu_Collect3D_c::setupItem3D(Mtx param_0) {
|
||||
void dMenu_Collect3D_c::toItem3Dpos(f32 param_0, f32 param_1, f32 param_2, cXyz* param_3) {
|
||||
Mtx adStack_98;
|
||||
Mtx auStack_c8;
|
||||
#if TARGET_PC
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getSafeMinXF()) / mDoGph_gInf_c::getSafeWidthF()) -
|
||||
1.0f);
|
||||
#else
|
||||
param_0 =
|
||||
(2.0f * ((param_0 - mDoGph_gInf_c::getMinXF()) / mDoGph_gInf_c::getWidthF()) - 1.0f);
|
||||
#endif
|
||||
param_1 = (2.0f * ((param_1 - -100.0f) / FB_HEIGHT_BASE) - 1.0f);
|
||||
calcViewMtx(adStack_98);
|
||||
MTXInverse(adStack_98, auStack_c8);
|
||||
|
||||
+1
-29
@@ -864,33 +864,15 @@ void dMenu_DmapBg_c::draw() {
|
||||
J2DOrthoGraph* grafContext = (J2DOrthoGraph*)dComIfGp_getCurrentGrafPort();
|
||||
grafContext->setup2D();
|
||||
|
||||
#if TARGET_PC
|
||||
// GXGetScissor uses 11-bit GC register fields (max 2047) which overflow
|
||||
// at window widths > ~1705px, producing garbage values on restore.
|
||||
scissor_left = 0;
|
||||
scissor_top = 0;
|
||||
scissor_width = (u32)mDoGph_gInf_c::getWidth();
|
||||
scissor_height = (u32)mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafContext->scissor(field_0xd94, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
grafContext->setScissor();
|
||||
|
||||
mBaseScreen->draw(field_0xd94, field_0xd98, grafContext);
|
||||
dMenu_Dmap_c::myclass->drawFloorScreenBack(mFloorScreen, field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar21 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
mMapScreen[0]->draw(field_0xd94, field_0xd98, grafContext);
|
||||
|
||||
if (mpBackTexture != NULL) {
|
||||
@@ -922,15 +904,9 @@ void dMenu_DmapBg_c::draw() {
|
||||
mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(),
|
||||
mpBackTexture->getHeight(), false, false, false);
|
||||
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94,
|
||||
0, mDoGph_gInf_c::getWidth(),
|
||||
scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(),
|
||||
scissor_top, mDoGph_gInf_c::getWidthF(),
|
||||
scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
}
|
||||
|
||||
@@ -957,11 +933,7 @@ void dMenu_DmapBg_c::draw() {
|
||||
|
||||
Vec local_26c = pane.getGlobalVtx(mMapPane, &local_110, 0, false, 0);
|
||||
drawIcon(local_26c.x + field_0xd94, local_26c.y, field_0xda8, 1.0f);
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(field_0xd94, scissor_top, mDoGph_gInf_c::getWidth(), scissor_height);
|
||||
#else
|
||||
grafContext->scissor(field_0xd94 + mDoGph_gInf_c::getMinXF(), scissor_top, mDoGph_gInf_c::getWidthF(), scissor_height);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
grafContext->setScissor();
|
||||
|
||||
+4
-22
@@ -276,18 +276,14 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
u32 scissorLeft, scissorTop, scissorWidth, scissorHeight;
|
||||
GXGetScissor(&scissorLeft, &scissorTop, &scissorWidth, &scissorHeight);
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
mpBackTex->setBlackWhite(field_0x1208, field_0x120c);
|
||||
mpBackTex->setAlpha(mAlphaRate * 255.0f * g_fmapHIO.mBackgroundAlpha);
|
||||
mpBackTex->draw(mTransX + mDoGph_gInf_c::getMinXF(),
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidth(),
|
||||
mDoGph_gInf_c::getHeight(), false, false, false);
|
||||
mTransZ + mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(),
|
||||
mDoGph_gInf_c::getHeightF(), false, false, false);
|
||||
|
||||
mpBackScreen->draw(mTransX, mTransZ, grafPort);
|
||||
mpBaseScreen->draw(mTransX, mTransZ, grafPort);
|
||||
@@ -297,13 +293,8 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
|
||||
Vec vec2 = mpMapArea->getGlobalVtx(&mtx, 3, false, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 width = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 height = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
|
||||
grafPort->scissor(mTransX + ((vec1.x - mDoGph_gInf_c::getMinXF()) / width),
|
||||
mTransZ + (vec1.y / height), (vec2.x - vec1.x) / width,
|
||||
@@ -360,11 +351,7 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
drawDebugRegionArea();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
grafPort->scissor(scissorLeft, scissorTop, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
grafPort->scissor(scissorLeft, scissorTop, scissorWidth, scissorHeight);
|
||||
#endif
|
||||
grafPort->setScissor();
|
||||
|
||||
if (isArrowDrawFlag()) {
|
||||
@@ -392,16 +379,15 @@ void dMenu_Fmap2DBack_c::draw() {
|
||||
&mArrowPos2DY);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
for (u32 i = 0; i < dusk::frame_interp::get_presentation_ui_advance_ticks(); ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x11e0 -= g_fmapHIO.mCursorSpeed;
|
||||
|
||||
if (field_0x11e0 < 0.0f) {
|
||||
field_0x11e0 += 360.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mpPointParent->getPanePtr()->rotate(mpPointParent->getSizeX() / 2.0f,
|
||||
mpPointParent->getSizeY() / 2.0f, ROTATE_Z,
|
||||
@@ -2580,11 +2566,7 @@ void dMenu_Fmap2DTop_c::draw() {
|
||||
J2DOrthoGraph* ctx = static_cast<J2DOrthoGraph*>(dComIfGp_getCurrentGrafPort());
|
||||
ctx->setup2D();
|
||||
GXGetScissor(&scissor_left, &scissor_top, &scissor_width, &scissor_height);
|
||||
#if TARGET_PC
|
||||
ctx->scissor(mTransX, 0.0f, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
ctx->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
ctx->setScissor();
|
||||
mpTitleScreen->draw(mTransX, mTransY, ctx);
|
||||
ctx->scissor(scissor_left, scissor_top, scissor_width, scissor_height);
|
||||
|
||||
@@ -223,13 +223,8 @@ void dMenu_Letter_c::_draw() {
|
||||
f32 y1 = local_178.y;
|
||||
Vec local_184;
|
||||
local_184 = afStack_138.getGlobalVtx(field_0x1ec, &mtx, 3, false, 0);
|
||||
#if TARGET_PC
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth();
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
#else
|
||||
f32 dVar17 = mDoGph_gInf_c::getWidthF() / FB_WIDTH;
|
||||
f32 dVar16 = mDoGph_gInf_c::getHeightF() / FB_HEIGHT;
|
||||
#endif
|
||||
f32 fVar1 = (x1 - mDoGph_gInf_c::getMinXF()) / dVar17;
|
||||
f32 fVar2 = y1 / dVar16;
|
||||
grafContext->scissor(fVar1, fVar2,
|
||||
|
||||
@@ -555,19 +555,11 @@ void dMenu_Option_c::_draw() {
|
||||
#endif
|
||||
|
||||
mpBlackTex->setAlpha(0xff);
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
mpBackScreen->draw(0.0f, 0.0f, ctx);
|
||||
f32 alpha = (f32)g_drawHIO.mOptionScreen.mBackgroundAlpha * (f32)field_0x374;
|
||||
mpBlackTex->setAlpha(alpha);
|
||||
#if TARGET_PC
|
||||
mpBlackTex->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(), mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), 0, 0, 0);
|
||||
#else
|
||||
mpBlackTex->draw(0.0f, 0.0f, FB_WIDTH, FB_HEIGHT, 0, 0, 0);
|
||||
#endif
|
||||
mpScreen->draw(0.0f, 0.0f, ctx);
|
||||
mpClipScreen->draw(0.0f, 0.0f, ctx);
|
||||
#if TARGET_PC
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/game_clock.h"
|
||||
#endif
|
||||
|
||||
typedef void (dMenu_Ring_c::*initFunc)();
|
||||
static initFunc stick_init[] = {
|
||||
/* STATUS_WAIT */ &dMenu_Ring_c::stick_wait_init,
|
||||
@@ -183,6 +187,9 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x674[i] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i] = 0.0f;
|
||||
#endif
|
||||
field_0x518[i] = 0.0f;
|
||||
field_0x528[i] = 0.0f;
|
||||
field_0x538[i] = 0.0f;
|
||||
@@ -1022,6 +1029,9 @@ void dMenu_Ring_c::setJumpItem(bool i_useVibrationM) {
|
||||
field_0x6b8[0] != dComIfGs_getMixItemIndex(0))
|
||||
{
|
||||
field_0x674[0] = 1;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[0] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
} else if (field_0x6b3 == 1) {
|
||||
field_0x538[0] = g_ringHIO.mUnselectItemScale;
|
||||
@@ -1030,6 +1040,9 @@ void dMenu_Ring_c::setJumpItem(bool i_useVibrationM) {
|
||||
field_0x6b8[1] != dComIfGs_getMixItemIndex(1))
|
||||
{
|
||||
field_0x674[1] = 1;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[1] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (field_0x674[0] == 1) {
|
||||
@@ -1520,7 +1533,15 @@ void dMenu_Ring_c::setSelectItem(int i_idx, u8 i_itemNo) {
|
||||
void dMenu_Ring_c::drawSelectItem() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (field_0x674[i] != 0) {
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i] += dusk::game_clock::consume_interval(this);
|
||||
const f32 u = std::min(mSelectItemSlideElapsed[i] / dusk::game_clock::period_for_original_frames(10.0f), 1.0f);
|
||||
if (u >= 1.0f) {
|
||||
setSelectItemForce(i);
|
||||
} else {
|
||||
#else
|
||||
if (field_0x674[i] < 10) {
|
||||
#endif
|
||||
f32 initSizeX = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeX() * 1.7f;
|
||||
f32 initSizeY = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeY() * 1.7f;
|
||||
f32 initScaleX = dMeter2Info_getMeterItemPanePtr(i)->getInitScaleX();
|
||||
@@ -1528,7 +1549,11 @@ void dMenu_Ring_c::drawSelectItem() {
|
||||
Vec pos = dMeter2Info_getMeterItemPanePtr(i)->getGlobalVtxCenter(
|
||||
dMeter2Info_getMeterItemPanePtr(i)->mPane, true, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 fVar14 = 0.1f + 0.8f * u;
|
||||
#else
|
||||
f32 fVar14 = field_0x674[i] / 10.0f;
|
||||
#endif
|
||||
if (field_0x6cd != 0xff) {
|
||||
fVar14 = 1.0f - fVar14;
|
||||
}
|
||||
@@ -1549,9 +1574,11 @@ void dMenu_Ring_c::drawSelectItem() {
|
||||
0);
|
||||
}
|
||||
}
|
||||
#if !TARGET_PC
|
||||
field_0x674[i]++;
|
||||
} else {
|
||||
setSelectItemForce(i);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1562,6 +1589,9 @@ void dMenu_Ring_c::setSelectItemForce(int i_idx) {
|
||||
if (field_0x674[i_idx] != 0) {
|
||||
dComIfGs_setSelectItemIndex(i_idx, field_0x6b4[i_idx]);
|
||||
field_0x674[i_idx] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i_idx] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
} else if (field_0x674[i_idx] != 0) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
@@ -1569,6 +1599,9 @@ void dMenu_Ring_c::setSelectItemForce(int i_idx) {
|
||||
dComIfGs_setSelectItemIndex(i, field_0x6b4[i]);
|
||||
}
|
||||
field_0x674[i_idx] = 0;
|
||||
#if TARGET_PC
|
||||
mSelectItemSlideElapsed[i_idx] = 0.0f;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2782,7 +2782,7 @@ void dMenu_save_c::_draw() {
|
||||
#if TARGET_PC
|
||||
void dMenu_save_c::menuSaveWide() {
|
||||
mSaveSel.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f);
|
||||
mSaveSel.Scr->translate(mDoGph_gInf_c::getMinXF(), 0.0f);
|
||||
mSaveSel.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f);
|
||||
|
||||
mSaveSel.Scr->search(MULTI_CHAR('t_for'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
mSaveSel.Scr->search(MULTI_CHAR('t_for1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
|
||||
|
||||
+8
-14
@@ -32,15 +32,9 @@ public:
|
||||
if (getDrawFlag() == 1) {
|
||||
setDrawFlag();
|
||||
dComIfGp_onPauseFlag();
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopySrc(0, 0, mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight());
|
||||
#else
|
||||
GXSetTexCopySrc(0, 0, FB_WIDTH, FB_HEIGHT);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
GXSetTexCopyDst(mDoGph_gInf_c::getWidth(), mDoGph_gInf_c::getHeight(), (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
GXSetTexCopyDst(FB_WIDTH, FB_HEIGHT, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_DISABLE);
|
||||
#else
|
||||
GXSetTexCopyDst(FB_WIDTH / 2, FB_HEIGHT / 2, (GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_ENABLE);
|
||||
#endif
|
||||
@@ -48,17 +42,17 @@ public:
|
||||
GXPixModeSync();
|
||||
#if TARGET_PC
|
||||
// init mTexObj at capture time so the gpu ref survives window resizes
|
||||
mCaptureWidth = mDoGph_gInf_c::getWidth();
|
||||
mCaptureHeight = mDoGph_gInf_c::getHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), mCaptureWidth, mCaptureHeight,
|
||||
mCaptureWidth = JUTVideo::getManager()->getRenderWidth();
|
||||
mCaptureHeight = JUTVideo::getManager()->getRenderHeight();
|
||||
GXInitTexObj(&mTexObj, mDoGph_gInf_c::getFrameBufferTex(), FB_WIDTH / 2, FB_HEIGHT / 2,
|
||||
(GXTexFmt)mDoGph_gInf_c::getFrameBufferTimg()->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&mTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
// If the window was resized since capture, force a re-capture at the new size
|
||||
if (mCaptureWidth != (u16)mDoGph_gInf_c::getWidth() ||
|
||||
mCaptureHeight != (u16)mDoGph_gInf_c::getHeight()) {
|
||||
if (mCaptureWidth != JUTVideo::getManager()->getRenderWidth() ||
|
||||
mCaptureHeight != JUTVideo::getManager()->getRenderHeight()) {
|
||||
mFlag = 1;
|
||||
return;
|
||||
}
|
||||
@@ -137,8 +131,8 @@ private:
|
||||
/* 0x5 */ u8 mAlpha;
|
||||
/* 0x6 */ u8 mTopFlag;
|
||||
#if TARGET_PC
|
||||
u16 mCaptureWidth;
|
||||
u16 mCaptureHeight;
|
||||
u32 mCaptureWidth;
|
||||
u32 mCaptureHeight;
|
||||
TGXTexObj mTexObj;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -423,6 +423,13 @@ void dMeter2_c::setLifeZero() {
|
||||
|
||||
void dMeter2_c::checkStatus() {
|
||||
mStatus = 0;
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.disableMainHUD) {
|
||||
mStatus |= 0xF0000000;
|
||||
}
|
||||
#endif
|
||||
|
||||
field_0x12c = field_0x128;
|
||||
|
||||
field_0x128 = daPy_py_c::checkNowWolf();
|
||||
|
||||
+5
-13
@@ -638,12 +638,11 @@ void dMeter2Draw_c::draw() {
|
||||
var_f29 = g_drawHIO.mLightDrop.mDropPikariAnimSpeed_Completed;
|
||||
int temp_r5_2 = g_drawHIO.mLightDrop.mPikariInterval * 15;
|
||||
#ifdef TARGET_PC
|
||||
// Set even if not advancing
|
||||
// FRAME INTERP NOTE: Set even if not advancing
|
||||
var_f28 = g_drawHIO.mLightDrop.mPikariScaleComplete;
|
||||
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 tick = 0; tick < ui_advance_ticks; ++tick) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (field_0x756 <= temp_r5_2) {
|
||||
int temp_r4 = (field_0x756 % g_drawHIO.mLightDrop.mPikariInterval);
|
||||
int temp_r3_5 = field_0x756 / g_drawHIO.mLightDrop.mPikariInterval;
|
||||
@@ -669,17 +668,12 @@ void dMeter2Draw_c::draw() {
|
||||
}
|
||||
|
||||
field_0x756 = -1;
|
||||
#ifdef TARGET_PC
|
||||
break;
|
||||
#endif
|
||||
} else {
|
||||
field_0x756++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (field_0x66c[i] > 0.0f) {
|
||||
@@ -1349,9 +1343,9 @@ void dMeter2Draw_c::drawPikari(f32 i_posX, f32 i_posY, f32* i_framep, f32 i_scal
|
||||
*i_framep = 0.0f;
|
||||
} else {
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
*i_framep += param_8;
|
||||
if (*i_framep > var_f31) {
|
||||
if (param_9 == 1 || param_9 == 2 || param_9 == 3) {
|
||||
@@ -1366,9 +1360,7 @@ void dMeter2Draw_c::drawPikari(f32 i_posX, f32 i_posY, f32* i_framep, f32 i_scal
|
||||
} else if (*i_framep == 18.0f && param_9 == 2) {
|
||||
mDoAud_seStart(Z2SE_SY_ITEM_COMBINE_ICON, NULL, 0, 0);
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
playPikariBckAnimation(*i_framep);
|
||||
playPikariBpkAnimation(*i_framep);
|
||||
|
||||
@@ -2289,7 +2289,8 @@ dMeter_drawHIO_c::dMeter_drawHIO_c() {
|
||||
#if WIDESCREEN_SUPPORT
|
||||
void dMeter_drawHIO_c::updateOnWide() {
|
||||
#if TARGET_PC
|
||||
g_drawHIO = {}; // this might be a bad idea
|
||||
// Main HUD
|
||||
g_drawHIO = {};
|
||||
|
||||
g_drawHIO.mMainHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX);
|
||||
g_drawHIO.mRingHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRingHUDButtonsPosX);
|
||||
@@ -2301,6 +2302,10 @@ void dMeter_drawHIO_c::updateOnWide() {
|
||||
g_drawHIO.mButtonCrossONPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossONPosX);
|
||||
g_drawHIO.mLifeGaugePosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLifeGaugePosX);
|
||||
g_drawHIO.mLanternMeterPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLanternMeterPosX);
|
||||
|
||||
// River Canoe Minigame
|
||||
g_drawHIO.mMiniGame.mCounterPosX[1] = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMiniGame.mCounterPosX[1]);
|
||||
g_drawHIO.mMiniGame.mIconPosX[1] = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMiniGame.mIconPosX[1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "d/d_msg_out_font.h"
|
||||
#include "d/d_msg_string.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
#if VERSION == VERSION_GCN_JPN
|
||||
@@ -280,15 +281,20 @@ void dMeterButton_c::draw() {
|
||||
|
||||
s16 temp_r6 = g_drawHIO.mEmpButton.mRepeatHitFrameNum;
|
||||
s16 temp_r6_2 = g_drawHIO.mEmpButton.mRepeatHitFrameNum / 2;
|
||||
field_0x4b8[i]++;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
field_0x4b8[i]++;
|
||||
|
||||
if (field_0x4b8[i] >= temp_r6) {
|
||||
field_0x4b8[i] = 0;
|
||||
if (field_0x4b8[i] >= temp_r6) {
|
||||
field_0x4b8[i] = 0;
|
||||
|
||||
if (field_0x4bc[i] == 0) {
|
||||
field_0x4bc[i] = 1;
|
||||
} else {
|
||||
field_0x4bc[i] = 0;
|
||||
if (field_0x4bc[i] == 0) {
|
||||
field_0x4bc[i] = 1;
|
||||
} else {
|
||||
field_0x4bc[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+37
-21
@@ -11,6 +11,7 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_meter_HIO.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
dMeterHaihai_c::dMeterHaihai_c(u8 i_type) {
|
||||
mType = i_type;
|
||||
@@ -286,14 +287,19 @@ void dMeterHaihai_c::updateHaihai() {
|
||||
void dMeterHaihai_c::playBckAnime(J2DAnmTransformKey* i_bck) {
|
||||
if (checkPlayAnime(1)) {
|
||||
if (i_bck != NULL) {
|
||||
if (mType == 4) {
|
||||
mBckFrame += g_drawHIO.mWiiLockArrowBCKAnimSpeed;
|
||||
} else {
|
||||
mBckFrame += g_drawHIO.mScrollArrowBCKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBckFrame += g_drawHIO.mWiiLockArrowBCKAnimSpeed;
|
||||
} else {
|
||||
mBckFrame += g_drawHIO.mScrollArrowBCKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBckFrame >= i_bck->getFrameMax()) {
|
||||
mBckFrame -= i_bck->getFrameMax();
|
||||
if (mBckFrame >= i_bck->getFrameMax()) {
|
||||
mBckFrame -= i_bck->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBtkFrame = 1.0f;
|
||||
@@ -309,14 +315,19 @@ void dMeterHaihai_c::playBckAnime(J2DAnmTransformKey* i_bck) {
|
||||
void dMeterHaihai_c::playBtkAnime(J2DAnmTextureSRTKey* i_btk) {
|
||||
if (checkPlayAnime(2)) {
|
||||
if (i_btk != NULL) {
|
||||
if (mType == 4) {
|
||||
mBtkFrame += g_drawHIO.mWiiLockArrowBTKAnimSpeed;
|
||||
} else {
|
||||
mBtkFrame += g_drawHIO.mScrollArrowBTKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBtkFrame += g_drawHIO.mWiiLockArrowBTKAnimSpeed;
|
||||
} else {
|
||||
mBtkFrame += g_drawHIO.mScrollArrowBTKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBtkFrame >= i_btk->getFrameMax()) {
|
||||
mBtkFrame -= i_btk->getFrameMax();
|
||||
if (mBtkFrame >= i_btk->getFrameMax()) {
|
||||
mBtkFrame -= i_btk->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBtkFrame = 1.0f;
|
||||
@@ -331,14 +342,19 @@ void dMeterHaihai_c::playBtkAnime(J2DAnmTextureSRTKey* i_btk) {
|
||||
void dMeterHaihai_c::playBpkAnime(J2DAnmColor* i_bpk) {
|
||||
if (checkPlayAnime(0)) {
|
||||
if (i_bpk != NULL) {
|
||||
if (mType == 4) {
|
||||
mBpkFrame += g_drawHIO.mWiiLockArrowBPKAnimSpeed;
|
||||
} else {
|
||||
mBpkFrame += g_drawHIO.mScrollArrowBPKAnimSpeed;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mType == 4) {
|
||||
mBpkFrame += g_drawHIO.mWiiLockArrowBPKAnimSpeed;
|
||||
} else {
|
||||
mBpkFrame += g_drawHIO.mScrollArrowBPKAnimSpeed;
|
||||
}
|
||||
|
||||
if (mBpkFrame >= i_bpk->getFrameMax()) {
|
||||
mBpkFrame -= i_bpk->getFrameMax();
|
||||
if (mBpkFrame >= i_bpk->getFrameMax()) {
|
||||
mBpkFrame -= i_bpk->getFrameMax();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mBpkFrame = 1.0f;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "d/d_meter2_info.h"
|
||||
#include "d/d_meter_HIO.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
dMeterString_c::dMeterString_c(int i_stringID) {
|
||||
@@ -105,16 +106,27 @@ void dMeterString_c::draw() {
|
||||
f32 var_f30 = 1.0f;
|
||||
|
||||
if (mAnimFrame < 60.0f) {
|
||||
mAnimFrame += g_drawHIO.mMiniGame.mReadyFightTextAnimSpeed;
|
||||
if (mAnimFrame > 60.0f) {
|
||||
mAnimFrame = 60.0f;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
mAnimFrame += g_drawHIO.mMiniGame.mReadyFightTextAnimSpeed;
|
||||
if (mAnimFrame > 60.0f) {
|
||||
mAnimFrame = 60.0f;
|
||||
}
|
||||
}
|
||||
|
||||
playBckAnimation(mAnimFrame);
|
||||
} else if (mAnimFrame < (f32)g_drawHIO.mMiniGame.mReadyFightTextWaitFrames + 60.0f) {
|
||||
mAnimFrame += var_f30;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
mAnimFrame += var_f30;
|
||||
} else if (mAnimFrame < var_f31) {
|
||||
mAnimFrame += var_f30;
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
mAnimFrame += var_f30;
|
||||
var_f30 = acc(g_drawHIO.mMiniGame.field_0x172, var_f31 - mAnimFrame, 0);
|
||||
}
|
||||
|
||||
@@ -128,13 +140,21 @@ void dMeterString_c::draw() {
|
||||
if (mPikariAnimFrame > 0.0f) {
|
||||
drawPikari();
|
||||
} else if (mPikariAnimFrame == -1.0f &&
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::get_ui_tick_pending() &&
|
||||
#endif
|
||||
mAnimFrame > g_drawHIO.mMiniGame.mReadyFightPikariAppearFrames)
|
||||
{
|
||||
mPikariAnimFrame = 18.0f - g_drawHIO.mMiniGame.mReadyFightPikariAnimSpeed;
|
||||
}
|
||||
|
||||
if (mAnimFrame >= var_f31) {
|
||||
dMeter2Info_resetMeterString();
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
#endif
|
||||
{
|
||||
if (mAnimFrame >= var_f31) {
|
||||
dMeter2Info_resetMeterString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
#include "d/d_lib.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/scope_guard.hpp"
|
||||
#endif
|
||||
|
||||
#if REGION_JPN
|
||||
#define CHAR_CODE_MALE_ICON 0x8189
|
||||
#define CHAR_CODE_FEMALE_ICON 0x818A
|
||||
@@ -1918,6 +1922,11 @@ void jmessage_tSequenceProcessor::do_begin(void const* pEntry, char const* pszTe
|
||||
|
||||
pReference->resetReference();
|
||||
field_0xb5 = 0;
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
|
||||
field_0xb2 = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void jmessage_tSequenceProcessor::do_end() {
|
||||
@@ -2154,6 +2163,18 @@ void jmessage_tSequenceProcessor::do_character(int iCharacter) {
|
||||
bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_size) {
|
||||
jmessage_tReference* pReference = (jmessage_tReference*)getReference();
|
||||
|
||||
#if TARGET_PC
|
||||
// This class runs the lambda function when it goes out of scope. We want to run
|
||||
// this code after the switch statement and this saves us from having to litter
|
||||
// the switch statement with IF_DUSK before every return.
|
||||
auto instantTextRun = SimpleScopeGuard([&]() {
|
||||
if (dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) {
|
||||
field_0xb2 = 1;
|
||||
pReference->setSendTimer(0);
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
switch (i_tag & 0xFF0000) {
|
||||
case MSGTAG_GROUP(1): {
|
||||
cXyz pos = pReference->getActorPos();
|
||||
|
||||
+10
-15
@@ -28,6 +28,10 @@
|
||||
#include "m_Do/m_Do_lib.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/settings.h"
|
||||
#endif
|
||||
|
||||
static void dMsgObject_addFundRaising(s16 param_0);
|
||||
static void dMsgObject_addTotalPayment(s16 param_0);
|
||||
|
||||
@@ -1464,24 +1468,12 @@ void dMsgObject_c::fukiPosCalc(bool param_1) {
|
||||
fopAc_ac_c* player = dComIfGp_getPlayer(0);
|
||||
cXyz local_3c;
|
||||
cXyz cStack_48;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&player->eyePos, &cStack_48, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&player->eyePos, &cStack_48);
|
||||
#endif
|
||||
|
||||
f32 temp;
|
||||
if ((field_0x100->pos == cXyz(0.0f, 0.0f, 0.0f))) {
|
||||
temp = cStack_48.y;
|
||||
} else {
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&field_0x100->pos, &local_3c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&field_0x100->pos, &local_3c);
|
||||
#endif
|
||||
|
||||
if (local_3c.x >= 0.0f && local_3c.x <= FB_WIDTH && local_3c.y >= 0.0f &&
|
||||
local_3c.y <= FB_HEIGHT)
|
||||
{
|
||||
@@ -1566,7 +1558,8 @@ u8 dMsgObject_c::isSend() {
|
||||
if (pRef->getSendFlag() == 5) {
|
||||
if (getStatusLocal() == 21) {
|
||||
setButtonStatusLocal();
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
@@ -1585,7 +1578,8 @@ u8 dMsgObject_c::isSend() {
|
||||
}
|
||||
if (pRef->getSendFlag() == 2) {
|
||||
setButtonStatusLocal();
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -1598,7 +1592,8 @@ u8 dMsgObject_c::isSend() {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
if (mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
if (IF_DUSK((dusk::getSettings().game.instantText && mDoCPd_c::getHoldB(0)) ||)
|
||||
mDoCPd_c::getTrigA(0) != 0 || mDoCPd_c::getTrigB(0) != 0) {
|
||||
return 2;
|
||||
}
|
||||
if (mesgCancelButton) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "d/d_meter2_info.h"
|
||||
#include "d/d_msg_object.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "f_op/f_op_msg_mng.h"
|
||||
|
||||
COutFontSet_c::COutFontSet_c() {
|
||||
@@ -311,6 +312,15 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param
|
||||
sp256[i] = field_0x1b4[i];
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
bool uiTickPending = dusk::frame_interp::get_ui_tick_pending();
|
||||
if (!uiTickPending) {
|
||||
for (int i = 0; i < 70; i++) {
|
||||
sp256[i] = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 35; i++) {
|
||||
u8 type = mpOfs[i]->getType();
|
||||
J2DTextBox* tbox = mpOfs[i]->getTextBoxPtr();
|
||||
@@ -505,9 +515,14 @@ void COutFont_c::draw(J2DTextBox* i_textbox, f32 param_1, f32 param_2, f32 param
|
||||
case 20:
|
||||
case 21:
|
||||
case 22:
|
||||
field_0x1b4[type]++;
|
||||
if (field_0x1b4[type] >= 28) {
|
||||
field_0x1b4[type] = 0;
|
||||
#ifdef TARGET_PC
|
||||
if (uiTickPending)
|
||||
#endif
|
||||
{
|
||||
field_0x1b4[type]++;
|
||||
if (field_0x1b4[type] >= 28) {
|
||||
field_0x1b4[type] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mpPane[type]->rotate(0.5f * sizeX, 0.5f * sizeY, ROTATE_Z,
|
||||
|
||||
+24
-22
@@ -19,6 +19,10 @@
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "Z2AudioLib/Z2WolfHowlMgr.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/settings.h"
|
||||
#endif
|
||||
|
||||
// POSIX already defines a macro with this name, but we know that this specific name is
|
||||
// used in TP based on assertion messages. This redefinition is scoped to this TU which
|
||||
// is unlikely to ever actually need the POSIX define, so we can just redefine it.
|
||||
@@ -307,6 +311,17 @@ void dMsgScrnHowl_c::exec() {
|
||||
mpButtonIcon[1]->setAlphaRate(field_0x1994 * alphaRate);
|
||||
mpButtonText[0]->setAlphaRate(field_0x1998 * alphaRate);
|
||||
mpButtonText[1]->setAlphaRate(field_0x1998 * alphaRate);
|
||||
|
||||
#if TARGET_PC
|
||||
showCursor = true;
|
||||
if (field_0x2798 == 0) {
|
||||
if (mPlotTime != field_0x212c) {
|
||||
field_0x212c = mPlotTime;
|
||||
} else {
|
||||
showCursor = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMsgScrnHowl_c::drawSelf() {
|
||||
@@ -490,6 +505,7 @@ void dMsgScrnHowl_c::drawWave() {
|
||||
grafContext->setScissor();
|
||||
#endif
|
||||
|
||||
#if !TARGET_PC
|
||||
bool bVar5 = true;
|
||||
if (field_0x2798 == 0) {
|
||||
if (mPlotTime != field_0x212c) {
|
||||
@@ -498,7 +514,14 @@ void dMsgScrnHowl_c::drawWave() {
|
||||
bVar5 = false;
|
||||
}
|
||||
}
|
||||
if (bVar5) {
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (showCursor)
|
||||
#else
|
||||
if (bVar5)
|
||||
#endif
|
||||
{
|
||||
for (int iVar10 = 0; iVar10 < field_0x2128 - 1; iVar10++) {
|
||||
f32 local_54 = local_e0;
|
||||
f32 local_c8 = field_0x180[sVar14];
|
||||
@@ -584,17 +607,10 @@ void dMsgScrnHowl_c::drawGuide() {
|
||||
J2DGrafContext* grafContext = dComIfGp_getCurrentGrafPort();
|
||||
Vec local_b0 = field_0x128;
|
||||
Vec local_bc = field_0x140;
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(local_b0.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_bc.x - local_b0.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_cc = mpLineH[0]->getGlobalPosX();
|
||||
s16 sVar12 = 0;
|
||||
@@ -722,19 +738,11 @@ void dMsgScrnHowl_c::drawGuide2() {
|
||||
}
|
||||
Vec local_58 = field_0x128;
|
||||
Vec local_64 = field_0x140;
|
||||
#if TARGET_PC
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()),
|
||||
field_0x2120);
|
||||
#else
|
||||
f32 local_70 = mDoGph_gInf_c::getHeightF() / mDoGph_gInf_c::getHeight();
|
||||
grafContext->scissor(
|
||||
(local_58.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2118, (local_64.x - local_58.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH),
|
||||
field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
f32 local_74 = mpLineH[0]->getGlobalPosX();
|
||||
s16 local_134 = 0;
|
||||
@@ -836,15 +844,9 @@ void dMsgScrnHowl_c::drawEffect() {
|
||||
Vec vec1 = field_0x128;
|
||||
Vec vec2 = field_0x140;
|
||||
mDoGph_gInf_c::getHeightF();
|
||||
#if TARGET_PC
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth()), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getWidth())), field_0x2120);
|
||||
#else
|
||||
grafContext->scissor(
|
||||
(vec1.x - mDoGph_gInf_c::getMinXF()) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH), field_0x2118,
|
||||
12.0f + ((vec2.x - vec1.x) / (mDoGph_gInf_c::getWidthF() / FB_WIDTH)), field_0x2120);
|
||||
#endif
|
||||
grafContext->setScissor();
|
||||
u8 timer = daAlink_getAlinkActorClass()->getWolfHowlMgrP()->getReleaseTimer();
|
||||
u8 screenAlpha = mpScreen->search(MULTI_CHAR('line00'))->getAlpha();
|
||||
|
||||
@@ -557,22 +557,11 @@ void dMsgScrnItem_c::fukiPosCalc(u8 param_1) {
|
||||
cXyz local_70;
|
||||
cXyz cStack_7c;
|
||||
f32 f3;
|
||||
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&player->eyePos, &cStack_7c, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&player->eyePos, &cStack_7c);
|
||||
#endif
|
||||
|
||||
if (iVar6->pos == cXyz(0.0f, 0.0f, 0.0f)) {
|
||||
f3 = cStack_7c.y;
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
mDoLib_project(&iVar6->pos, &local_70, {0, 0, FB_WIDTH, FB_HEIGHT});
|
||||
#else
|
||||
mDoLib_project(&iVar6->pos, &local_70);
|
||||
#endif
|
||||
|
||||
if (local_70.x >= 0.0f && local_70.x <= FB_WIDTH && local_70.y >= 0.0f &&
|
||||
local_70.y <= FB_HEIGHT)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user