mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-10 12:54:50 -04:00
Compare commits
197 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c509ff7647 | |||
| 6849baac06 | |||
| f3ca94b338 | |||
| 9b3b827054 | |||
| 4de3c20431 | |||
| 2840843e3c | |||
| 312195920a | |||
| bc11bf3563 | |||
| 36635f8c62 | |||
| 6136d9bbf7 | |||
| 16c573a170 | |||
| e9e16a8ac1 | |||
| 4339e60ba6 | |||
| af5635dd42 | |||
| c876ea558f | |||
| 9b75dc5fd2 | |||
| 5c9c76cc0b | |||
| b474aafe9d | |||
| 84c5729c4e | |||
| e0ab36b7d9 | |||
| d40a30ee13 | |||
| 074b43a089 | |||
| 8e8dc305e6 | |||
| 41389f4a8e | |||
| 8145dec2a1 | |||
| 4089a80a17 | |||
| b772b6d952 | |||
| 42910ab2fd | |||
| f54892b2c2 | |||
| f32e069c4b | |||
| 09f087656a | |||
| fe15366912 | |||
| cfadf7607a | |||
| f81d25b425 | |||
| ebf6f31719 | |||
| 590d209f76 | |||
| ed21cd4fd0 | |||
| 277538bb81 | |||
| 5418b1831d | |||
| 2d4e69466b | |||
| 427dcfab82 | |||
| f5642f3073 | |||
| cc9c15de54 | |||
| 1fd8a2ca3c | |||
| 0c9c8795ce | |||
| 9eb9acfa11 | |||
| facbf35343 | |||
| 7a34830dc7 | |||
| e4557efb23 | |||
| 42e12eb5ab | |||
| 16cc37ca10 | |||
| 44cb2c84ba | |||
| 8e9d4d624a | |||
| db87b91954 | |||
| ad53af5c78 | |||
| a6e5160c71 | |||
| 38a0a7be0b | |||
| 02fdde3768 | |||
| 33e13d508b | |||
| afc3376aec | |||
| b07fb50128 | |||
| d0894853d7 | |||
| cacb768725 | |||
| 00707024bb | |||
| 7c5ed6a0e1 | |||
| 131a09f317 | |||
| a58f9c7b43 | |||
| 7290649bb8 | |||
| 34e1e740ab | |||
| a58f64ed80 | |||
| 28a37f6b4f | |||
| 285691cd19 | |||
| 93e33ecf1a | |||
| e26fab71d6 | |||
| 824389f871 | |||
| aa42265041 | |||
| 8b7ed4b5da | |||
| f33746f373 | |||
| 18c1d11335 | |||
| 710f252d53 | |||
| 2a92a67b87 | |||
| 0d05f9b75b | |||
| e27cce0e3c | |||
| 511721f4d5 | |||
| 08e0f4a2ee | |||
| 7a900471bf | |||
| d9d9966f8f | |||
| 8705e75b9d | |||
| 1b42c4ecac | |||
| 24ca190029 | |||
| eefa69b53d | |||
| da3ac9f546 | |||
| 7f306fe1ec | |||
| 358de64570 | |||
| e484a10018 | |||
| 0936115483 | |||
| b00b7f8f1b | |||
| 08c4442fdf | |||
| 74f20c38e0 | |||
| b7d32918bd | |||
| e99b604dd2 | |||
| 2376e0102e | |||
| 5a9bd6f8dc | |||
| 62a26a639d | |||
| 1a247c2977 | |||
| ef122efccd | |||
| deadde352c | |||
| 460b96c709 | |||
| f8ba14ea8f | |||
| bd9b81f700 | |||
| b531936a1f | |||
| 21692d5a78 | |||
| 7af51e53bd | |||
| bd90c3fc69 | |||
| 37abcaf616 | |||
| b26f3f7f51 | |||
| 81caa89e12 | |||
| bc3cdcc955 | |||
| bf0dc85468 | |||
| 656346a900 | |||
| 5269eadfaf | |||
| e5c032f6e6 | |||
| 030ef0f3bf | |||
| c3c8d459e8 | |||
| 21e0491d43 | |||
| 62c19c0f64 | |||
| 477192f3c2 | |||
| 71961dae85 | |||
| 6592d95199 | |||
| c10e41f02e | |||
| e70fef0650 | |||
| e7e04b7c15 | |||
| 42d9dd23c0 | |||
| 5d68762590 | |||
| db39a9c7f3 | |||
| 23a5e2c48d | |||
| 496ddf63bd | |||
| eab481661d | |||
| a9c8f44a86 | |||
| 5b9e9106ef | |||
| a85f8c203d | |||
| dc0c868bc1 | |||
| 2afc52772c | |||
| 0dc475108b | |||
| a7790d7323 | |||
| 8b6f989315 | |||
| f03bd71612 | |||
| 2e1cc7cb26 | |||
| 498868c17d | |||
| 2a3bc722d9 | |||
| 326ef70afa | |||
| 1f970eb2dc | |||
| 8aaf451708 | |||
| a8a2f5c84c | |||
| fa074a2311 | |||
| 1f1f7e324b | |||
| 8905fbc1eb | |||
| c207150ae9 | |||
| d73b0be801 | |||
| 78e1a05aef | |||
| 8668474a33 | |||
| a6376368ee | |||
| af162bbd0a | |||
| 0504f1dda7 | |||
| edc4aa0be4 | |||
| ac316f6288 | |||
| 114e6e60bb | |||
| e9a7628218 | |||
| 533c76f4d6 | |||
| beb4146f33 | |||
| ce0185adc4 | |||
| db7e2a1e7b | |||
| 7a3e8977f1 | |||
| e4caf20a7a | |||
| a68f4ae1e6 | |||
| 05393fe7aa | |||
| 1711251cf5 | |||
| c804b1f663 | |||
| c49f0e5c6e | |||
| 9655b827f3 | |||
| 6a52cdf80e | |||
| ba6ef0d250 | |||
| f7a5d88dfd | |||
| 8ac2658f54 | |||
| 0cb93a2a9f | |||
| 716a2b4020 | |||
| 069650295c | |||
| 5119135068 | |||
| fa660ebd0f | |||
| 5d6e58eeac | |||
| cd97563d3f | |||
| 43e8563609 | |||
| aa8f905768 | |||
| 273af7beb6 | |||
| 18cbb584c6 | |||
| 42cded342e | |||
| 696e8e6aa9 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
Language: Cpp
|
||||
Standard: C++03
|
||||
Standard: c++20
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: false
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
name: Bug Report
|
||||
description: Report an issue with Dusklight
|
||||
type: Bug
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: official-build-certification
|
||||
attributes:
|
||||
label: Mods and Forks
|
||||
description: Certify that this issue exists on the official builds of Dusklight
|
||||
options:
|
||||
- label: The bug occurs on an **official release** of Dusklight, without any forks or third-party patches installed
|
||||
required: true
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: dusklight-version
|
||||
attributes:
|
||||
label: Dusklight Version
|
||||
placeholder: ex. 1.3.1
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: Bug Description
|
||||
placeholder: Describe the bug you are encountering
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: repro-steps
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
placeholder: |
|
||||
1. Load save
|
||||
2. Go to Hyrule Field
|
||||
3. See bug
|
||||
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
placeholder: Describe what should be happening
|
||||
|
||||
- type: textarea
|
||||
id: current-behavior
|
||||
attributes:
|
||||
label: Current Behavior
|
||||
placeholder: Describe what is happening instead
|
||||
|
||||
- type: dropdown
|
||||
id: system-os-architecture
|
||||
attributes:
|
||||
label: OS / Architecture
|
||||
description: The operating system and architecture you are running Dusklight on
|
||||
options:
|
||||
- Windows x86-64
|
||||
- Windows ARM64
|
||||
- MacOS ARM64
|
||||
- MacOS x86-64
|
||||
- Linux ARM64
|
||||
- Linux x84-64
|
||||
- Android ARM64
|
||||
- iOS ARM64
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: game-region
|
||||
attributes:
|
||||
label: Game Region
|
||||
description: The game region you are playing on
|
||||
options:
|
||||
- NTSC-U (North America)
|
||||
- PAL (Europe)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: game-language
|
||||
attributes:
|
||||
label: Game Language
|
||||
description: The language you are playing the game in
|
||||
placeholder: ex. English, Spanish, etc.
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Graphics Backend
|
||||
options:
|
||||
- Vulkan
|
||||
- D3D12
|
||||
- Metal
|
||||
- D3D11
|
||||
- OpenGL ES
|
||||
- Unsure / Default
|
||||
default: 5
|
||||
|
||||
- type: textarea
|
||||
id: texture-packs-mods
|
||||
attributes:
|
||||
label: Texture Packs and Mods
|
||||
placeholder: List any texture packs or mods you had installed
|
||||
|
||||
- type: upload
|
||||
id: logs-upload
|
||||
attributes:
|
||||
label: Logs and Other Files
|
||||
description: Include any relevant logs, config files, or saves to reproduce the bug
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Additional Context
|
||||
placeholder: Any other information that might be helpful
|
||||
@@ -0,0 +1,24 @@
|
||||
name: Feature Request
|
||||
description: Request a new Dusklight feature. Not all requests can/will be included, but we will take these ideas into consideration.
|
||||
type: Feature
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: Feature Description
|
||||
placeholder: Describe the feature you are requesting
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: feature-platform
|
||||
attributes:
|
||||
label: Platform
|
||||
description: If applicable, list the platforms this feature applies to. If it is for all platforms, feel free to leave this field blank.
|
||||
placeholder: ex. Mac, Android, Steam Deck, etc.
|
||||
|
||||
- type: textarea
|
||||
id: feature-related-info
|
||||
attributes:
|
||||
label: Additional Information
|
||||
placeholder: Any other information that might be helpful (related features, existing implementations, open pull requests or issues, etc.)
|
||||
+22
-13
@@ -5,7 +5,16 @@ on:
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- '*LICENSE'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '*.md'
|
||||
- '*LICENSE'
|
||||
- 'docs/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
@@ -22,13 +31,13 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: GCC x86_64
|
||||
runner: ubuntu-latest
|
||||
runner: ubuntu-24.04
|
||||
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
|
||||
@@ -43,7 +52,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
|
||||
sudo apt-get -y install ninja-build clang lld mold 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 \
|
||||
@@ -221,12 +230,12 @@ jobs:
|
||||
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-latest
|
||||
preset: arm64-msvc
|
||||
msvc_arch: amd64_arm64
|
||||
vcpkg_arch: arm64
|
||||
artifact_arch: arm64
|
||||
# - name: Clang x86_64
|
||||
# runner: windows-latest
|
||||
# preset: clang
|
||||
@@ -255,7 +264,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
choco install ninja
|
||||
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
|
||||
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows zstd:${{matrix.vcpkg_arch}}-windows
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset x-windows-ci-${{matrix.preset}}
|
||||
|
||||
+218
-133
@@ -5,87 +5,15 @@ if (NOT CMAKE_BUILD_TYPE)
|
||||
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
|
||||
endif ()
|
||||
|
||||
set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
|
||||
|
||||
if (DUSK_VERSION_OVERRIDE)
|
||||
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
|
||||
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||
set(DUSK_WC_REVISION "")
|
||||
set(DUSK_WC_BRANCH "")
|
||||
set(DUSK_WC_DATE "")
|
||||
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
|
||||
else ()
|
||||
# obtain revision info from git
|
||||
find_package(Git)
|
||||
if (GIT_FOUND)
|
||||
# make sure version information gets re-run when the current Git HEAD changes
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
|
||||
OUTPUT_VARIABLE dusk_git_head_filename
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
|
||||
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
|
||||
OUTPUT_VARIABLE dusk_git_head_symbolic
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
|
||||
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
|
||||
|
||||
# defines DUSK_WC_REVISION
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE DUSK_WC_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DUSK_WC_DESCRIBE
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
|
||||
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# remove the git hash, then collapse a clean "-0" suffix only
|
||||
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||
|
||||
# defines DUSK_WC_BRANCH
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE DUSK_WC_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DUSK_WC_DATE
|
||||
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
|
||||
OUTPUT_VARIABLE DUSK_WC_DATE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else ()
|
||||
message(STATUS "Unable to find git, commit information will not be available")
|
||||
endif ()
|
||||
|
||||
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
|
||||
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
|
||||
set(DUSK_VERSION_TWEAK "0")
|
||||
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
|
||||
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
|
||||
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||
endif ()
|
||||
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
|
||||
else ()
|
||||
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
|
||||
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
# Add version information to CI environment variables
|
||||
if(DEFINED ENV{GITHUB_ENV})
|
||||
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
|
||||
endif()
|
||||
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
|
||||
include(cmake/DetectVersion.cmake)
|
||||
detect_version()
|
||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
||||
if (APPLE)
|
||||
enable_language(OBJC OBJCXX)
|
||||
endif ()
|
||||
# Adjust CMAKE_SYSTEM_PROCESSOR on Windows to match compiler target
|
||||
include(cmake/WindowsTargetProcessor.cmake)
|
||||
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
||||
# ios.toolchain.cmake hack for SDL
|
||||
set(TVOS ON)
|
||||
@@ -110,6 +38,33 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake")
|
||||
|
||||
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)
|
||||
if (ENABLE_ASAN)
|
||||
if (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" AND
|
||||
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/fsanitize=address>)
|
||||
add_link_options(/fsanitize=address /INCREMENTAL:NO)
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase")
|
||||
foreach (_lang C CXX)
|
||||
foreach (_rtc_flag /RTC1 /RTCc /RTCs /RTCu)
|
||||
string(REPLACE "${_rtc_flag}" "" CMAKE_${_lang}_FLAGS_DEBUG "${CMAKE_${_lang}_FLAGS_DEBUG}")
|
||||
endforeach ()
|
||||
endforeach ()
|
||||
elseif (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" AND
|
||||
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fsanitize=address>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fno-omit-frame-pointer>
|
||||
)
|
||||
add_link_options(-fsanitize=address)
|
||||
else ()
|
||||
message(FATAL_ERROR "ENABLE_ASAN requires GNU-like or MSVC-like C/C++ compiler frontends")
|
||||
endif ()
|
||||
|
||||
add_compile_definitions(NDEBUG_SANITIZER) # Avoids absl issue with SwissTable debug code
|
||||
message(STATUS "dusklight: Enabled AddressSanitizer")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE)
|
||||
endif ()
|
||||
@@ -121,17 +76,25 @@ target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1)
|
||||
|
||||
add_subdirectory(libs/freeverb)
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(DUSK_GFX_DEBUG_GROUPS_DEFAULT ON)
|
||||
else ()
|
||||
set(DUSK_GFX_DEBUG_GROUPS_DEFAULT OFF)
|
||||
endif ()
|
||||
|
||||
option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)")
|
||||
option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.")
|
||||
option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON)
|
||||
option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON)
|
||||
option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF)
|
||||
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
|
||||
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
|
||||
option(DUSK_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF)
|
||||
option(DUSK_GFX_DEBUG_GROUPS "Report debug groups to the native graphics API" ${DUSK_GFX_DEBUG_GROUPS_DEFAULT})
|
||||
option(DUSK_ENABLE_CODE_MODS "Enable code mods" OFF)
|
||||
|
||||
# Edit & Continue
|
||||
if (MSVC)
|
||||
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug"
|
||||
AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
|
||||
endif ()
|
||||
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
||||
@@ -154,6 +117,7 @@ if (DUSK_MOVIE_SUPPORT)
|
||||
endif ()
|
||||
set(_jpeg_cmake_args
|
||||
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
|
||||
-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTargetProcessor.cmake
|
||||
-DENABLE_SHARED=OFF
|
||||
-DWITH_TURBOJPEG=ON
|
||||
-DWITH_JAVA=OFF
|
||||
@@ -172,6 +136,8 @@ if (DUSK_MOVIE_SUPPORT)
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY
|
||||
CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
|
||||
CMAKE_OSX_ARCHITECTURES
|
||||
CMAKE_OSX_DEPLOYMENT_TARGET
|
||||
CMAKE_OSX_SYSROOT
|
||||
DEPLOYMENT_TARGET
|
||||
ENABLE_ARC
|
||||
ENABLE_BITCODE
|
||||
@@ -202,10 +168,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
# -Wno-multichar: Multi-character constants ('ABCD') are implementation-defined but all compilers
|
||||
# (CW, GCC, Clang, MSVC) encode them identically in big-endian order.
|
||||
# For >4-char literals (which GCC/Clang truncate to int), use the MULTI_CHAR() macro.
|
||||
# -Wwrite-strings: Game code relies on implicit const char* -> char* conversions
|
||||
# -Wdeprecated-declarations: JSystem uses std::iterator, deprecated in C++17
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar -Wno-write-strings")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-write-strings -Wno-trigraphs -Wno-deprecated-declarations")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-trigraphs -Wno-deprecated-declarations")
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
set(CMAKE_BUILD_RPATH "$ORIGIN")
|
||||
elseif (APPLE)
|
||||
@@ -215,7 +180,6 @@ elseif (APPLE)
|
||||
elseif (MSVC)
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/Zc:strictStrings->
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
|
||||
)
|
||||
@@ -232,7 +196,6 @@ elseif (MSVC)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/utf-8>)
|
||||
endif ()
|
||||
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
# Declare all dependencies first so CMake can download them in parallel
|
||||
@@ -240,15 +203,55 @@ message(STATUS "dusklight: Fetching cxxopts")
|
||||
FetchContent_Declare(cxxopts
|
||||
URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz
|
||||
URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
|
||||
)
|
||||
message(STATUS "dusklight: Fetching nlohmann/json")
|
||||
FetchContent_Declare(json
|
||||
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
|
||||
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
|
||||
)
|
||||
FetchContent_MakeAvailable(cxxopts json)
|
||||
message(STATUS "dusklight: Fetching miniz")
|
||||
FetchContent_Declare(miniz
|
||||
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
set(_fetch_content_deps cxxopts json miniz)
|
||||
if (DUSK_ENABLE_CODE_MODS)
|
||||
message(STATUS "dusklight: Fetching funchook")
|
||||
# cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a
|
||||
# PATCH_COMMAND into capstone's inner ExternalProject. That PATCH_COMMAND runs
|
||||
# cmake/PatchCapstone.cmake after capstone is cloned, which removes the
|
||||
# cmake_policy(SET CMP0048 OLD) line that CMake >= 3.27 rejects.
|
||||
# This is incredibly scuffed and we should probably think of a better way to do this
|
||||
set(CAPSTONE_FIX_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchCapstone.cmake")
|
||||
FetchContent_Declare(funchook
|
||||
GIT_REPOSITORY https://github.com/kubo/funchook.git
|
||||
GIT_TAG v1.1.3
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_PROGRESS TRUE
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=<SOURCE_DIR> -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchFunchook.cmake
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
set(FUNCHOOK_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(FUNCHOOK_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
||||
set(FUNCHOOK_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES _osx_arch_count)
|
||||
if (_osx_arch_count EQUAL 1)
|
||||
list(GET CMAKE_OSX_ARCHITECTURES 0 _osx_arch)
|
||||
if (_osx_arch MATCHES "^(arm64|aarch64|ARM64)$")
|
||||
set(FUNCHOOK_CPU arm64 CACHE STRING "" FORCE)
|
||||
elseif (_osx_arch MATCHES "^(x86_64|AMD64|amd64|i[3-6]86|x86)$")
|
||||
set(FUNCHOOK_CPU x86 CACHE STRING "" FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
list(APPEND _fetch_content_deps funchook)
|
||||
endif ()
|
||||
FetchContent_MakeAvailable(${_fetch_content_deps})
|
||||
|
||||
if (DUSK_ENABLE_SENTRY_NATIVE)
|
||||
message(STATUS "dusklight: Fetching sentry-native")
|
||||
@@ -282,21 +285,7 @@ if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQU
|
||||
add_compile_options(-fsigned-char)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(PLATFORM_NAME win32)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
if (IOS)
|
||||
set(PLATFORM_NAME ios)
|
||||
elseif (TVOS)
|
||||
set(PLATFORM_NAME tvos)
|
||||
else ()
|
||||
set(PLATFORM_NAME macos)
|
||||
endif ()
|
||||
else ()
|
||||
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
|
||||
endif ()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
|
||||
configure_version_header()
|
||||
|
||||
include(files.cmake)
|
||||
|
||||
@@ -312,24 +301,15 @@ set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors")
|
||||
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES})
|
||||
source_group("dusklight" FILES ${DUSK_FILES} ${DUSK_HTTP_BACKEND_FILES})
|
||||
|
||||
set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1)
|
||||
|
||||
set(GAME_INCLUDE_DIRS
|
||||
include
|
||||
src
|
||||
assets/GZ2E01 # TODO: make this dynamic if needed?
|
||||
libs/JSystem/include
|
||||
libs
|
||||
extern/aurora/include/dolphin
|
||||
extern
|
||||
${CMAKE_BINARY_DIR})
|
||||
include(cmake/GameABIConfig.cmake)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
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 fmt::fmt
|
||||
Threads::Threads)
|
||||
|
||||
list(APPEND GAME_LIBS libzstd_static)
|
||||
Threads::Threads zstd::libzstd dusklight_game_headers)
|
||||
if (DUSK_ENABLE_CODE_MODS)
|
||||
list(APPEND GAME_LIBS funchook-static)
|
||||
endif ()
|
||||
|
||||
if (DUSK_ENABLE_SENTRY_NATIVE)
|
||||
list(APPEND GAME_LIBS sentry)
|
||||
@@ -338,6 +318,10 @@ endif ()
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND GAME_LIBS Ws2_32)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
list(APPEND GAME_LIBS dbghelp)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp)
|
||||
@@ -393,8 +377,18 @@ if (DUSK_ENABLE_DISCORD AND NOT ANDROID AND NOT IOS AND NOT TVOS)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD=1)
|
||||
endif ()
|
||||
|
||||
if(ANDROID)
|
||||
list(APPEND GAME_COMPILE_DEFS TARGET_ANDROID=1)
|
||||
if (DUSK_ENABLE_CODE_MODS)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1)
|
||||
endif ()
|
||||
|
||||
if (DUSK_PACKAGE_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_ASSET_DIR="${CMAKE_INSTALL_FULL_DATADIR}/dusklight/")
|
||||
endif ()
|
||||
|
||||
if (DUSK_GFX_DEBUG_GROUPS)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_GFX_DEBUG_GROUPS=1)
|
||||
target_compile_definitions(aurora_gx PRIVATE AURORA_GFX_DEBUG_GROUPS)
|
||||
endif ()
|
||||
|
||||
# game_debug is for game code files that we know work when compiled with DEBUG=1
|
||||
@@ -411,7 +405,7 @@ set(GAME_DEBUG_FILES
|
||||
set_source_files_properties(
|
||||
${GAME_DEBUG_FILES}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:DEBUG=1>;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
|
||||
COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:DEBUG=1>"
|
||||
)
|
||||
|
||||
# game_base is for all other game code files
|
||||
@@ -425,16 +419,11 @@ set(GAME_BASE_FILES
|
||||
set_source_files_properties(
|
||||
${GAME_BASE_FILES}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
|
||||
COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0"
|
||||
)
|
||||
|
||||
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
|
||||
target_compile_definitions(${jsystem_lib} PRIVATE
|
||||
${GAME_COMPILE_DEFS}
|
||||
$<$<CONFIG:Debug>:DEBUG=1>
|
||||
$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>
|
||||
)
|
||||
target_include_directories(${jsystem_lib} PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
target_compile_definitions(${jsystem_lib} PRIVATE ${GAME_COMPILE_DEFS} $<$<CONFIG:Debug>:DEBUG=1>)
|
||||
target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS})
|
||||
set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem")
|
||||
endforeach()
|
||||
@@ -446,18 +435,67 @@ if (CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_LINK_GROUP_USING_RESCAN
|
||||
set(JSYSTEM_LINK_LIBRARIES "$<LINK_GROUP:RESCAN,${JSYSTEM_LIBRARIES}>")
|
||||
endif ()
|
||||
|
||||
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES})
|
||||
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c)
|
||||
if(ANDROID)
|
||||
add_library(dusklight SHARED ${DUSK_FILES})
|
||||
set_target_properties(dusklight PROPERTIES OUTPUT_NAME main)
|
||||
else ()
|
||||
add_executable(dusklight ${DUSK_FILES})
|
||||
endif ()
|
||||
if (ENABLE_ASAN)
|
||||
target_sources(dusklight PRIVATE src/dusk/asan_options.c)
|
||||
endif ()
|
||||
|
||||
target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS})
|
||||
target_include_directories(dusklight PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
target_include_directories(dusklight PRIVATE ${miniz_SOURCE_DIR})
|
||||
target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES})
|
||||
target_precompile_headers(dusklight PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>")
|
||||
|
||||
if (DUSK_ENABLE_CODE_MODS)
|
||||
include(cmake/SymbolManifest.cmake)
|
||||
if (WIN32)
|
||||
# Game ABI exports & import library for mod linking
|
||||
include(cmake/WindowsExports.cmake)
|
||||
setup_windows_exports(dusklight)
|
||||
endif ()
|
||||
# Post-link symbol manifest: hookable-surface name->address map keyed to the build.
|
||||
setup_symbol_manifest(dusklight)
|
||||
endif ()
|
||||
|
||||
# Hook reliability: guaranteed patchable entries on the game ABI surface, and no identical-code folding.
|
||||
if (MSVC)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>)
|
||||
endif ()
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
|
||||
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN:16 /OPT:NOICF)
|
||||
else ()
|
||||
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF)
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
|
||||
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>)
|
||||
else ()
|
||||
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,5>)
|
||||
endif ()
|
||||
endif ()
|
||||
if (DEFINED DUSK_PATCHABLE_ENTRY_FLAG)
|
||||
target_compile_options(dusklight PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG})
|
||||
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
|
||||
target_compile_options(${jsystem_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG})
|
||||
endforeach()
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(dusklight PRIVATE Psapi)
|
||||
endif ()
|
||||
if (APPLE)
|
||||
# Mods resolve game symbols from the executable at dlopen time.
|
||||
target_link_options(dusklight PRIVATE -Wl,-export_dynamic)
|
||||
elseif (UNIX AND NOT ANDROID)
|
||||
target_link_options(dusklight PRIVATE -rdynamic)
|
||||
endif ()
|
||||
|
||||
if (TARGET crashpad_handler)
|
||||
add_dependencies(dusklight crashpad_handler)
|
||||
add_custom_command(TARGET dusklight POST_BUILD
|
||||
@@ -474,6 +512,11 @@ if (ANDROID)
|
||||
target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
|
||||
target_link_libraries(dusklight PRIVATE dl)
|
||||
endif ()
|
||||
|
||||
if (NOT APPLE)
|
||||
add_custom_command(TARGET dusklight POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
@@ -512,6 +555,13 @@ if (WIN32)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(cmake/ModSDK.cmake)
|
||||
|
||||
if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
add_custom_target(dusklight_mods) # Aggregate target for all in-tree mods
|
||||
add_subdirectory(tools/mod_template)
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
if (IOS)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
|
||||
@@ -519,6 +569,7 @@ if (APPLE)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos)
|
||||
else ()
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos)
|
||||
set(DUSK_ENTITLEMENTS ${DUSK_RESOURCE_DIR}/Dusklight.entitlements)
|
||||
endif ()
|
||||
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
||||
file(GLOB_RECURSE DUSK_RESOURCE_FILES
|
||||
@@ -538,8 +589,7 @@ if (APPLE)
|
||||
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(
|
||||
dusklight PROPERTIES
|
||||
set(_apple_bundle_properties
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
||||
@@ -550,6 +600,31 @@ if (APPLE)
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||
)
|
||||
if (DUSK_ENTITLEMENTS)
|
||||
list(APPEND _apple_bundle_properties
|
||||
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${DUSK_ENTITLEMENTS})
|
||||
endif ()
|
||||
if (NOT IOS AND NOT TVOS)
|
||||
list(APPEND _apple_bundle_properties
|
||||
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES")
|
||||
endif ()
|
||||
set_target_properties(dusklight PROPERTIES ${_apple_bundle_properties})
|
||||
|
||||
if (NOT IOS AND NOT TVOS AND NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
||||
set(_sign_nested_commands)
|
||||
if (TARGET crashpad_handler)
|
||||
list(APPEND _sign_nested_commands
|
||||
COMMAND /usr/bin/codesign --force --sign -
|
||||
"$<TARGET_FILE_DIR:dusklight>/crashpad_handler")
|
||||
endif ()
|
||||
add_custom_command(TARGET dusklight POST_BUILD
|
||||
${_sign_nested_commands}
|
||||
COMMAND /usr/bin/codesign --force --sign - --entitlements
|
||||
"${DUSK_ENTITLEMENTS}" "$<TARGET_BUNDLE_DIR:dusklight>"
|
||||
COMMENT "Signing Dusklight.app with entitlements"
|
||||
VERBATIM
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (APPLE AND NOT IOS AND NOT TVOS)
|
||||
@@ -611,12 +686,20 @@ set(EXTRA_TARGETS "")
|
||||
if (TARGET crashpad_handler)
|
||||
list(APPEND EXTRA_TARGETS crashpad_handler)
|
||||
endif ()
|
||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
if (DUSK_PACKAGE_INSTALL)
|
||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
aurora_install_runtime_dlls(dusklight ${CMAKE_INSTALL_PREFIX})
|
||||
if (NOT APPLE)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
if (DUSK_PACKAGE_INSTALL)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dusklight)
|
||||
else()
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
endif ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND NOT DUSK_PACKAGE_INSTALL)
|
||||
set(DEBUG_FILES_LIST "")
|
||||
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
|
||||
get_target_output_name(${target} output_name)
|
||||
@@ -665,3 +748,5 @@ foreach (target IN LISTS BINARY_TARGETS)
|
||||
endif ()
|
||||
endforeach ()
|
||||
endforeach ()
|
||||
|
||||
install_bundled_mods()
|
||||
|
||||
+143
-24
@@ -19,7 +19,19 @@
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded"
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
|
||||
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -33,7 +45,21 @@
|
||||
"value": true
|
||||
},
|
||||
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
|
||||
"DUSK_SENTRY_ENVIRONMENT": "production"
|
||||
"DUSK_SENTRY_ENVIRONMENT": "production",
|
||||
"Rust_RUSTUP_INSTALL_MISSING_TARGET": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"ENABLE_ASAN": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -42,7 +68,15 @@
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"DUSK_ENABLE_CODE_MODS": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -63,6 +97,15 @@
|
||||
"linux-default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linux-default-debug-asan",
|
||||
"displayName": "Linux (default) Debug ASan",
|
||||
"inherits": [
|
||||
"debug",
|
||||
"linux-default",
|
||||
"asan"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linux-default-relwithdebinfo",
|
||||
"displayName": "Linux (default) RelWithDebInfo",
|
||||
@@ -90,6 +133,15 @@
|
||||
"linux-clang"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-debug-asan",
|
||||
"displayName": "Linux (Clang) Debug ASan",
|
||||
"inherits": [
|
||||
"debug",
|
||||
"linux-clang",
|
||||
"asan"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-relwithdebinfo",
|
||||
"displayName": "Linux (Clang) RelWithDebInfo",
|
||||
@@ -110,7 +162,15 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "cl",
|
||||
"CMAKE_CXX_COMPILER": "cl",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"DUSK_ENABLE_CODE_MODS": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -128,6 +188,15 @@
|
||||
"windows-msvc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-debug-asan",
|
||||
"displayName": "Windows (MSVC) Debug ASan",
|
||||
"inherits": [
|
||||
"debug",
|
||||
"windows-msvc",
|
||||
"asan"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-relwithdebinfo",
|
||||
"displayName": "Windows (MSVC) RelWithDebInfo",
|
||||
@@ -197,7 +266,15 @@
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"DUSK_ENABLE_CODE_MODS": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -215,6 +292,15 @@
|
||||
"macos-default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "macos-default-debug-asan",
|
||||
"displayName": "macOS (default) Debug ASan",
|
||||
"inherits": [
|
||||
"debug",
|
||||
"macos-default",
|
||||
"asan"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "macos-default-relwithdebinfo",
|
||||
"displayName": "macOS (default) RelWithDebInfo",
|
||||
@@ -280,24 +366,21 @@
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"ENABLE_ARC": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"Rust_CARGO_TARGET": "aarch64-apple-tvos",
|
||||
"Rust_TOOLCHAIN": "nightly",
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_BZip2": {
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_LibLZMA": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_zstd": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -322,6 +405,18 @@
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
},
|
||||
"DUSK_ENABLE_CODE_MODS": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_zstd": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -350,7 +445,8 @@
|
||||
"hidden": true,
|
||||
"inherits": [
|
||||
"android-base",
|
||||
"ci"
|
||||
"ci",
|
||||
"release"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"DUSK_ENABLE_SENTRY_NATIVE": {
|
||||
@@ -378,7 +474,8 @@
|
||||
"ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"AURORA_SDL3_PROVIDER": "vendor"
|
||||
"AURORA_SDL3_PROVIDER": "vendor",
|
||||
"CMAKE_LINKER_TYPE": "MOLD"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -407,12 +504,8 @@
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
|
||||
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew",
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0",
|
||||
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -430,7 +523,6 @@
|
||||
"x-macos-ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"AURORA_DAWN_PROVIDER": "vendor",
|
||||
"CMAKE_OSX_ARCHITECTURES": "x86_64",
|
||||
"Rust_CARGO_TARGET": "x86_64-apple-darwin"
|
||||
}
|
||||
@@ -490,7 +582,10 @@
|
||||
"inherits": [
|
||||
"x-windows-ci",
|
||||
"windows-arm64-msvc"
|
||||
]
|
||||
],
|
||||
"cacheVariables": {
|
||||
"VCPKG_TARGET_TRIPLET": "arm64-windows"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
@@ -500,6 +595,12 @@
|
||||
"description": "Linux (default) debug build",
|
||||
"displayName": "Linux (default) Debug"
|
||||
},
|
||||
{
|
||||
"name": "linux-default-debug-asan",
|
||||
"configurePreset": "linux-default-debug-asan",
|
||||
"description": "Linux (default) debug build with AddressSanitizer",
|
||||
"displayName": "Linux (default) Debug ASan"
|
||||
},
|
||||
{
|
||||
"name": "linux-default-relwithdebinfo",
|
||||
"configurePreset": "linux-default-relwithdebinfo",
|
||||
@@ -512,6 +613,12 @@
|
||||
"description": "Linux (Clang) debug build",
|
||||
"displayName": "Linux (Clang) Debug"
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-debug-asan",
|
||||
"configurePreset": "linux-clang-debug-asan",
|
||||
"description": "Linux (Clang) debug build with AddressSanitizer",
|
||||
"displayName": "Linux (Clang) Debug ASan"
|
||||
},
|
||||
{
|
||||
"name": "linux-clang-relwithdebinfo",
|
||||
"configurePreset": "linux-clang-relwithdebinfo",
|
||||
@@ -524,6 +631,12 @@
|
||||
"description": "macOS debug build",
|
||||
"displayName": "macOS Debug"
|
||||
},
|
||||
{
|
||||
"name": "macos-default-debug-asan",
|
||||
"configurePreset": "macos-default-debug-asan",
|
||||
"description": "macOS debug build with AddressSanitizer",
|
||||
"displayName": "macOS Debug ASan"
|
||||
},
|
||||
{
|
||||
"name": "macos-default-relwithdebinfo",
|
||||
"configurePreset": "macos-default-relwithdebinfo",
|
||||
@@ -581,6 +694,12 @@
|
||||
"description": "Windows (MSVC) debug build",
|
||||
"displayName": "Windows (MSVC) Debug"
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-debug-asan",
|
||||
"configurePreset": "windows-msvc-debug-asan",
|
||||
"description": "Windows (MSVC) debug build with AddressSanitizer",
|
||||
"displayName": "Windows (MSVC) Debug ASan"
|
||||
},
|
||||
{
|
||||
"name": "windows-msvc-relwithdebinfo",
|
||||
"configurePreset": "windows-msvc-relwithdebinfo",
|
||||
|
||||
@@ -20,36 +20,17 @@ It aims to be as accurate as possible to the original while also providing new o
|
||||
> Dusklight does *not* provide any copyrighted assets. You must provide your own copy of the original game.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> At a minimum, Dusklight requires a GPU with support for either D3D12, Vulkan, or Metal. Your experience with specific hardware, operating systems, and drivers may vary. In particular, older Intel iGPUs have a high likelihood of incompatibility. We are also aware of a number of issues on devices with Adreno GPUs and are working to resolve them.
|
||||
> At a minimum, Dusklight requires a GPU with support for D3D12, Vulkan 1.1+, or Metal. For older devices, best-effort support is provided for D3D11 and OpenGL ES (Android), but will not achieve full accuracy or performance. Your experience with specific hardware, operating systems, and drivers may vary.
|
||||
|
||||
### 1. Verify your dump
|
||||
### 1. Dump your game
|
||||
|
||||
First, make sure your dump of the game is clean and supported by Dusklight. You can do this by checking the SHA-1 hash of your dump against this list of supported versions:
|
||||
You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space.
|
||||
|
||||
| Version | SHA-1 hash |
|
||||
|--------------| ------------------------------------------ |
|
||||
| GameCube USA | `75edd3ddff41f125d1b4ce1a40378f1b565519e7` |
|
||||
| GameCube EUR | `2601822a488eeb86fb89db16ca8f29c2c953e1ca` |
|
||||
Currently, only the GameCube USA and EUR releases are supported. Support for other versions of the game is planned in the future.
|
||||
|
||||
*Support for other versions of the game is planned in the future.
|
||||
### 2. Install Dusklight
|
||||
|
||||
### 2. Download [Dusklight](https://github.com/TwilitRealm/dusklight/releases)
|
||||
|
||||
### 3. Setup the game
|
||||
**Windows / macOS / Linux**
|
||||
- Extract the .zip file
|
||||
- Launch Dusklight
|
||||
- Press **Select Disc Image** and provide the path to your supported game dump
|
||||
- Press **Play**!
|
||||
|
||||
**iOS**
|
||||
- Follow the [iOS setup guide](docs/ios-install-altstore.md)
|
||||
|
||||
**Android**
|
||||
- Install the Dusklight APK
|
||||
- Launch Dusklight
|
||||
- Press **Select Disc Image** and provide the path to your supported game dump
|
||||
- Press **Play**!
|
||||
Visit the [official installation guide](https://twilitrealm.dev/install/) for full instructions.
|
||||
|
||||
# Building
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ fi
|
||||
|
||||
build_dir="$PWD/build"
|
||||
linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage"
|
||||
lib_dir="/usr/lib/$(uname -m)-linux-gnu"
|
||||
|
||||
# Get linuxdeploy
|
||||
mkdir -p "$build_dir"
|
||||
@@ -19,8 +20,8 @@ for install_path in build/install/*; do
|
||||
cp -r "$install_path" build/appdir/usr/bin
|
||||
done
|
||||
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
|
||||
cp platforms/freedesktop/dusklight.desktop build/appdir/usr/share/applications
|
||||
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
|
||||
|
||||
cd build/install
|
||||
VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \
|
||||
-l /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$build_dir/appdir" --output appimage
|
||||
-l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
# Version detection shared by the main build and the mod SDK (sdk/CMakeLists.txt)
|
||||
include_guard(GLOBAL)
|
||||
|
||||
get_filename_component(_DUSK_VERSION_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
||||
|
||||
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
|
||||
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
|
||||
|
||||
set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
|
||||
|
||||
macro(detect_version)
|
||||
if (DUSK_VERSION_OVERRIDE)
|
||||
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
|
||||
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||
set(DUSK_VERSION_CODE "1")
|
||||
set(DUSK_WC_REVISION "")
|
||||
set(DUSK_WC_BRANCH "")
|
||||
set(DUSK_WC_DATE "")
|
||||
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
|
||||
else ()
|
||||
# obtain revision info from git
|
||||
find_package(Git)
|
||||
if (GIT_FOUND)
|
||||
# make sure version information gets re-run when the current Git HEAD changes
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
|
||||
OUTPUT_VARIABLE dusk_git_head_filename
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
get_filename_component(dusk_git_head_filename "${dusk_git_head_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
|
||||
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
|
||||
OUTPUT_VARIABLE dusk_git_head_symbolic
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT}
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
|
||||
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
get_filename_component(dusk_git_head_symbolic_filename "${dusk_git_head_symbolic_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
|
||||
|
||||
# defines DUSK_WC_REVISION
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE DUSK_WC_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DUSK_WC_DESCRIBE
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
|
||||
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# remove the git hash, then collapse a clean "-0" suffix only
|
||||
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||
|
||||
# defines DUSK_WC_BRANCH
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE DUSK_WC_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# defines DUSK_WC_DATE
|
||||
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
|
||||
OUTPUT_VARIABLE DUSK_WC_DATE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else ()
|
||||
message(STATUS "Unable to find git, commit information will not be available")
|
||||
endif ()
|
||||
|
||||
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
|
||||
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
|
||||
set(_ver_major ${CMAKE_MATCH_1})
|
||||
set(_ver_minor ${CMAKE_MATCH_2})
|
||||
set(_ver_patch ${CMAKE_MATCH_3})
|
||||
set(DUSK_VERSION_TWEAK "0")
|
||||
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
|
||||
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
|
||||
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||
endif ()
|
||||
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
|
||||
if (DUSK_VERSION_TWEAK GREATER 999)
|
||||
set(_tweak 999)
|
||||
else ()
|
||||
set(_tweak ${DUSK_VERSION_TWEAK})
|
||||
endif ()
|
||||
# encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999
|
||||
math(EXPR DUSK_VERSION_CODE
|
||||
"${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}")
|
||||
else ()
|
||||
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
|
||||
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||
set(DUSK_VERSION_CODE "1")
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
# Add version information to CI environment variables
|
||||
if (DEFINED ENV{GITHUB_ENV})
|
||||
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
|
||||
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n")
|
||||
endif ()
|
||||
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
|
||||
endmacro()
|
||||
|
||||
# Sets PLATFORM_NAME and configures version.h into the caller's binary dir.
|
||||
macro(configure_version_header)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(PLATFORM_NAME win32)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
if (IOS)
|
||||
set(PLATFORM_NAME ios)
|
||||
elseif (TVOS)
|
||||
set(PLATFORM_NAME tvos)
|
||||
else ()
|
||||
set(PLATFORM_NAME macos)
|
||||
endif ()
|
||||
else ()
|
||||
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
|
||||
endif ()
|
||||
|
||||
configure_file(${_DUSK_VERSION_ROOT}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
endmacro()
|
||||
@@ -0,0 +1,27 @@
|
||||
# The game ABI surface shared by the main build and the mod SDK (sdk/CMakeLists.txt)
|
||||
include_guard(GLOBAL)
|
||||
|
||||
get_filename_component(_game_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
||||
|
||||
# PARTIAL_DEBUG makes debug and release share one struct/vtable ABI so a mod binary loads into either
|
||||
set(_game_compile_defs TARGET_PC=1 WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 PARTIAL_DEBUG=1)
|
||||
if (ANDROID)
|
||||
list(APPEND _game_compile_defs TARGET_ANDROID=1)
|
||||
endif ()
|
||||
|
||||
set(_game_include_dirs
|
||||
${_game_root}/include
|
||||
${_game_root}/src
|
||||
${_game_root}/assets/GZ2E01 # TODO: make this dynamic if needed?
|
||||
${_game_root}/libs/JSystem/include
|
||||
${_game_root}/libs
|
||||
${_game_root}/extern/aurora/include/dolphin
|
||||
${_game_root}/extern/aurora/include
|
||||
${_game_root}/extern
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
# Interface target for mods and sub-projects to inherit game headers/defines.
|
||||
add_library(dusklight_game_headers INTERFACE)
|
||||
target_include_directories(dusklight_game_headers INTERFACE ${_game_include_dirs})
|
||||
target_compile_definitions(dusklight_game_headers INTERFACE ${_game_compile_defs})
|
||||
@@ -0,0 +1,279 @@
|
||||
# add_mod(<target> SOURCES <file>... MOD_JSON <mod.json> [RES_DIR <res>] [OVERLAY_DIR <overlay>]
|
||||
# [TEXTURES_DIR <textures>] [OUTPUT_DIR <dir>] [BUNDLE])
|
||||
set(DUSK_MODS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/mods" CACHE PATH "Directory to write mod packages into")
|
||||
|
||||
function(_mod_lib_name out_var)
|
||||
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
||||
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
|
||||
list(LENGTH CMAKE_OSX_ARCHITECTURES _count)
|
||||
if (_count GREATER 1)
|
||||
message(FATAL_ERROR "add_mod: universal binaries are not supported")
|
||||
endif ()
|
||||
set(_arch "${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif ()
|
||||
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _platform)
|
||||
string(TOLOWER "${_arch}" _arch)
|
||||
if (_arch MATCHES "^(i[3-6]86|x86)$")
|
||||
set(_arch "x86")
|
||||
endif ()
|
||||
if (WIN32)
|
||||
set(_ext ".dll")
|
||||
elseif (APPLE)
|
||||
set(_ext ".dylib")
|
||||
else ()
|
||||
set(_ext ".so")
|
||||
endif ()
|
||||
set(${out_var} "${_platform}-${_arch}${_ext}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(_mod_resolve_source_path out_var path)
|
||||
if (IS_ABSOLUTE "${path}")
|
||||
set(_path "${path}")
|
||||
else ()
|
||||
set(_path "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
|
||||
endif ()
|
||||
set(${out_var} "${_path}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(_mod_collect_assets out_var dir)
|
||||
if (NOT IS_DIRECTORY "${dir}")
|
||||
message(FATAL_ERROR "add_mod: asset directory does not exist: ${dir}")
|
||||
endif ()
|
||||
|
||||
file(GLOB_RECURSE _files CONFIGURE_DEPENDS LIST_DIRECTORIES false "${dir}/*")
|
||||
set(${out_var} ${_files} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(add_mod target_name)
|
||||
cmake_parse_arguments(ARG "BUNDLE" "MOD_JSON;RES_DIR;OVERLAY_DIR;TEXTURES_DIR;OUTPUT_DIR" "SOURCES" ${ARGN})
|
||||
if (NOT ARG_MOD_JSON)
|
||||
message(FATAL_ERROR "add_mod: MOD_JSON is required")
|
||||
endif ()
|
||||
_mod_resolve_source_path(_mod_json "${ARG_MOD_JSON}")
|
||||
if (NOT EXISTS "${_mod_json}")
|
||||
message(FATAL_ERROR "add_mod: MOD_JSON does not exist: ${_mod_json}")
|
||||
endif ()
|
||||
|
||||
add_library(${target_name} SHARED ${ARG_SOURCES})
|
||||
_mod_lib_name(_lib_name)
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
PREFIX ""
|
||||
C_VISIBILITY_PRESET hidden
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
VISIBILITY_INLINES_HIDDEN ON
|
||||
WINDOWS_EXPORT_ALL_SYMBOLS OFF)
|
||||
target_compile_features(${target_name} PRIVATE cxx_std_20)
|
||||
target_link_libraries(${target_name} PRIVATE dusklight_game_headers)
|
||||
|
||||
if (NOT TARGET dusklight)
|
||||
# Apply global compile options for out-of-tree mod builds
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
target_compile_options(${target_name} PRIVATE
|
||||
-Wno-multichar -Wno-trigraphs -Wno-deprecated-declarations)
|
||||
elseif (APPLE)
|
||||
target_compile_options(${target_name} PRIVATE
|
||||
-Wno-declaration-after-statement -Wno-non-pod-varargs)
|
||||
elseif (MSVC)
|
||||
target_compile_options(${target_name} PRIVATE
|
||||
"$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>"
|
||||
"$<$<COMPILE_LANGUAGE:C,CXX>:/utf-8>")
|
||||
endif ()
|
||||
# Use signed char on ARM to match the original game (and x86)
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _mod_arch)
|
||||
if (_mod_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
|
||||
target_compile_options(${target_name} PRIVATE -fsigned-char)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
# Game symbols resolve against the host executable at dlopen time.
|
||||
target_link_options(${target_name} PRIVATE -undefined dynamic_lookup)
|
||||
elseif (ANDROID)
|
||||
if (TARGET dusklight)
|
||||
target_link_libraries(${target_name} PRIVATE dusklight)
|
||||
elseif (DUSK_GAME_SOLIB)
|
||||
target_link_libraries(${target_name} PRIVATE "${DUSK_GAME_SOLIB}")
|
||||
else ()
|
||||
message(FATAL_ERROR "add_mod: DUSK_GAME_SOLIB is not set (libmain.so)")
|
||||
endif ()
|
||||
elseif (UNIX)
|
||||
target_link_options(${target_name} PRIVATE -Wl,--allow-shlib-undefined)
|
||||
elseif (WIN32)
|
||||
# Link against the generated import library (game ABI surface). Function calls
|
||||
# resolve through import thunks. Data is toolchain dependent:
|
||||
# - clang-cl: lld's mingw mode auto-imports data references, fixed up at load by
|
||||
# the mod SDK's pseudo-relocation runtime (pseudo_reloc.cpp).
|
||||
# - cl (MSVC): only DUSK_GAME_DATA-annotated data is reachable. Un-annotated
|
||||
# references fail to link.
|
||||
if (NOT DUSK_GAME_IMPLIB)
|
||||
message(FATAL_ERROR "add_mod: DUSK_GAME_IMPLIB is not set.")
|
||||
endif ()
|
||||
target_link_libraries(${target_name} PRIVATE "${DUSK_GAME_IMPLIB}")
|
||||
set_target_properties(${target_name} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
|
||||
target_compile_definitions(${target_name} PRIVATE _ITERATOR_DEBUG_LEVEL=0)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(${target_name} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/clang:-mcmodel=large>")
|
||||
target_sources(${target_name} PRIVATE "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../sdk/pseudo_reloc.cpp")
|
||||
# lld mingw mode rewrites /DEFAULTLIB directives to -l style and skips %LIB%, so
|
||||
# the CRT libraries and search paths are spelled out explicitly.
|
||||
target_link_options(${target_name} PRIVATE -lldmingw /nodefaultlib /INCREMENTAL:NO)
|
||||
target_link_libraries(${target_name} PRIVATE
|
||||
msvcrt.lib msvcprt.lib vcruntime.lib ucrt.lib
|
||||
oldnames.lib uuid.lib kernel32.lib user32.lib)
|
||||
set(_lib_dirs "$ENV{LIB}")
|
||||
if ("${_lib_dirs}" STREQUAL "")
|
||||
message(FATAL_ERROR "add_mod: %LIB% is empty; configure from a VS dev shell")
|
||||
endif ()
|
||||
foreach (_libdir IN LISTS _lib_dirs)
|
||||
target_link_options(${target_name} PRIVATE "/libpath:${_libdir}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(_output_dir "${DUSK_MODS_OUTPUT_DIR}")
|
||||
if (ARG_OUTPUT_DIR)
|
||||
set(_output_dir "${ARG_OUTPUT_DIR}")
|
||||
endif ()
|
||||
set(_stage "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_stage")
|
||||
set(_out "${_output_dir}/${target_name}.dusk")
|
||||
|
||||
set(_zip_args "${_lib_name}" mod.json)
|
||||
set(_package_deps "${_mod_json}")
|
||||
set(_package_inputs "${_mod_json}")
|
||||
set(_extra_cmds "")
|
||||
if (ARG_RES_DIR)
|
||||
_mod_resolve_source_path(_res_dir "${ARG_RES_DIR}")
|
||||
_mod_collect_assets(_res_deps "${_res_dir}")
|
||||
list(APPEND _package_deps ${_res_deps})
|
||||
list(APPEND _package_inputs "${_res_dir}" ${_res_deps})
|
||||
list(APPEND _zip_args res)
|
||||
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${_res_dir}" "${_stage}/res")
|
||||
endif ()
|
||||
if (ARG_OVERLAY_DIR)
|
||||
_mod_resolve_source_path(_overlay_dir "${ARG_OVERLAY_DIR}")
|
||||
_mod_collect_assets(_overlay_deps "${_overlay_dir}")
|
||||
list(APPEND _package_deps ${_overlay_deps})
|
||||
list(APPEND _package_inputs "${_overlay_dir}" ${_overlay_deps})
|
||||
list(APPEND _zip_args overlay)
|
||||
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${_overlay_dir}" "${_stage}/overlay")
|
||||
endif ()
|
||||
if (ARG_TEXTURES_DIR)
|
||||
_mod_resolve_source_path(_textures_dir "${ARG_TEXTURES_DIR}")
|
||||
_mod_collect_assets(_textures_deps "${_textures_dir}")
|
||||
list(APPEND _package_deps ${_textures_deps})
|
||||
list(APPEND _package_inputs "${_textures_dir}" ${_textures_deps})
|
||||
list(APPEND _zip_args textures)
|
||||
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${_textures_dir}" "${_stage}/textures")
|
||||
endif ()
|
||||
|
||||
set(_bundle_cmds "")
|
||||
if (ARG_BUNDLE AND TARGET dusklight)
|
||||
file(READ "${_mod_json}" _mod_json_text)
|
||||
string(JSON _mod_id GET "${_mod_json_text}" id)
|
||||
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_TARGETS "${target_name}")
|
||||
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_IDS "${_mod_id}")
|
||||
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_STAGES "${_stage}")
|
||||
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_PACKAGES "${_out}")
|
||||
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES "${_lib_name}")
|
||||
set(_bundle_cmds
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bundled_mods"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_out}" "${CMAKE_BINARY_DIR}/bundled_mods/${target_name}.dusk")
|
||||
endif ()
|
||||
|
||||
set(_package_target "${target_name}_package")
|
||||
set(_package_inputs_file "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_package_inputs.txt")
|
||||
list(SORT _package_inputs)
|
||||
set(_package_inputs_text "")
|
||||
foreach (_package_input IN LISTS _package_inputs)
|
||||
string(APPEND _package_inputs_text "${_package_input}\n")
|
||||
endforeach ()
|
||||
file(GENERATE OUTPUT "${_package_inputs_file}" CONTENT "${_package_inputs_text}")
|
||||
add_custom_command(OUTPUT "${_out}"
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf "${_stage}"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}" "${_output_dir}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${target_name}>" "${_stage}/${_lib_name}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_mod_json}" "${_stage}/mod.json"
|
||||
${_extra_cmds}
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "${_stage}" ${CMAKE_COMMAND} -E tar cvf "${_out}" --format=zip ${_zip_args}
|
||||
${_bundle_cmds}
|
||||
DEPENDS ${target_name} ${_package_deps} "${_package_inputs_file}"
|
||||
COMMENT "Packaging ${target_name} -> ${_out}"
|
||||
COMMAND_EXPAND_LISTS
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(${_package_target} ALL DEPENDS "${_out}")
|
||||
if (TARGET dusklight_mods)
|
||||
add_dependencies(dusklight_mods ${_package_target})
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
# Install rules for BUNDLE mods.
|
||||
# - Windows: the .dusk archives into <install>/mods (the loader extracts native libs to the
|
||||
# user cache).
|
||||
# - Linux: pre-extracted stage dirs into <install>/mods so native libs dlopen in place from
|
||||
# read-only installs.
|
||||
# - macOS: pre-extracted stage dirs into the installed app's Contents/Resources/mods, dylibs
|
||||
# ad-hoc signed in place, then the whole bundle re-signed.
|
||||
# - iOS/tvOS: assets into <app>/mods/<id> and the dylib into Frameworks/<id>.dylib.
|
||||
# - Android: nothing here; gradle packs ${CMAKE_BINARY_DIR}/bundled_mods into APK assets.
|
||||
function(install_bundled_mods)
|
||||
get_property(_targets GLOBAL PROPERTY DUSK_BUNDLED_MOD_TARGETS)
|
||||
if (NOT _targets OR ANDROID)
|
||||
return ()
|
||||
endif ()
|
||||
get_property(_ids GLOBAL PROPERTY DUSK_BUNDLED_MOD_IDS)
|
||||
get_property(_stages GLOBAL PROPERTY DUSK_BUNDLED_MOD_STAGES)
|
||||
get_property(_lib_names GLOBAL PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES)
|
||||
list(LENGTH _targets _count)
|
||||
math(EXPR _last "${_count} - 1")
|
||||
|
||||
if (APPLE)
|
||||
get_target_property(_app_name dusklight OUTPUT_NAME)
|
||||
if (NOT _app_name)
|
||||
set(_app_name dusklight)
|
||||
endif ()
|
||||
set(_bundle_dir "${CMAKE_INSTALL_PREFIX}/${_app_name}.app")
|
||||
if (IOS OR TVOS)
|
||||
foreach (_i RANGE ${_last})
|
||||
list(GET _targets ${_i} _target)
|
||||
list(GET _ids ${_i} _id)
|
||||
list(GET _stages ${_i} _stage)
|
||||
list(GET _lib_names ${_i} _lib_name)
|
||||
install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/mods/${_id}"
|
||||
PATTERN "${_lib_name}" EXCLUDE)
|
||||
install(PROGRAMS "$<TARGET_FILE:${_target}>"
|
||||
DESTINATION "${_bundle_dir}/Frameworks" RENAME "${_id}.dylib")
|
||||
endforeach ()
|
||||
else ()
|
||||
foreach (_i RANGE ${_last})
|
||||
list(GET _ids ${_i} _id)
|
||||
list(GET _stages ${_i} _stage)
|
||||
list(GET _lib_names ${_i} _lib_name)
|
||||
install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/Contents/Resources/mods/${_id}")
|
||||
install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - \"${_bundle_dir}/Contents/Resources/mods/${_id}/${_lib_name}\" COMMAND_ERROR_IS_FATAL ANY)")
|
||||
endforeach ()
|
||||
install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - --entitlements \"${DUSK_ENTITLEMENTS}\" \"${_bundle_dir}\" COMMAND_ERROR_IS_FATAL ANY)")
|
||||
endif ()
|
||||
return ()
|
||||
endif ()
|
||||
|
||||
if (DUSK_PACKAGE_INSTALL)
|
||||
set(_mods_dest "${CMAKE_INSTALL_DATAROOTDIR}/dusklight/mods")
|
||||
else ()
|
||||
set(_mods_dest "${CMAKE_INSTALL_PREFIX}/mods")
|
||||
endif ()
|
||||
if (WIN32)
|
||||
foreach (_target IN LISTS _targets)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/bundled_mods/${_target}.dusk" DESTINATION "${_mods_dest}")
|
||||
endforeach ()
|
||||
else ()
|
||||
foreach (_i RANGE ${_last})
|
||||
list(GET _ids ${_i} _id)
|
||||
list(GET _stages ${_i} _stage)
|
||||
install(DIRECTORY "${_stage}/" DESTINATION "${_mods_dest}/${_id}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
endfunction()
|
||||
@@ -0,0 +1,13 @@
|
||||
# Patches capstone's CMakeLists.txt for compatibility with CMake >= 4.0:
|
||||
# - Bumps cmake_minimum_required to 3.10 (CMake >= 4.0 dropped < 3.5 support; < 3.10 warns)
|
||||
# - Removes cmake_policy(SET CMP0048 OLD) (rejected by CMake >= 3.27)
|
||||
file(READ "${DIR}/CMakeLists.txt" _content)
|
||||
string(REGEX REPLACE
|
||||
"cmake_minimum_required[ \t]*\\([ \t]*VERSION[ \t]+[0-9]+\\.[0-9]+(\\.[0-9]+)?[ \t]*\\)"
|
||||
"cmake_minimum_required(VERSION 3.10)"
|
||||
_content "${_content}")
|
||||
string(REGEX REPLACE
|
||||
"cmake_policy[ \t]*\\([ \t]*SET[ \t]+CMP0048[ \t]+OLD[ \t]*\\)"
|
||||
"# cmake_policy(SET CMP0048 OLD)"
|
||||
_content "${_content}")
|
||||
file(WRITE "${DIR}/CMakeLists.txt" "${_content}")
|
||||
@@ -0,0 +1,60 @@
|
||||
file(READ "${SOURCE_DIR}/cmake/capstone.cmake.in" _content)
|
||||
|
||||
# Insert PATCH_COMMAND before CONFIGURE_COMMAND in the ExternalProject_Add.
|
||||
# Bracket args prevent cmake from substituting ${...} while writing this file.
|
||||
string(REPLACE
|
||||
" CONFIGURE_COMMAND \"\""
|
||||
[=[ PATCH_COMMAND "${CMAKE_COMMAND}" -DDIR=${CMAKE_CURRENT_BINARY_DIR}/capstone-src -P "${CAPSTONE_FIX_SCRIPT}"
|
||||
CONFIGURE_COMMAND ""]=]
|
||||
_content "${_content}")
|
||||
|
||||
file(WRITE "${SOURCE_DIR}/cmake/capstone.cmake.in" "${_content}")
|
||||
|
||||
file(READ "${SOURCE_DIR}/src/funchook_unix.c" _unix_content)
|
||||
|
||||
# macOS rejects the POSIX mprotect RWX/RW transition for executable image pages on arm64.
|
||||
# Use Mach VM_PROT_COPY for the short patch window, then restore RX permissions.
|
||||
if (NOT _unix_content MATCHES "VM_PROT_READ \\| VM_PROT_WRITE \\| VM_PROT_COPY")
|
||||
string(REPLACE
|
||||
[=[ rv = mprotect(mstate->addr, mstate->size, prot);]=]
|
||||
[=[#ifdef __APPLE__
|
||||
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr,
|
||||
(vm_size_t)mstate->size, FALSE,
|
||||
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);
|
||||
if (kr == KERN_SUCCESS) {
|
||||
funchook_log(funchook, " unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR")\n",
|
||||
mstate->addr, mstate->size, start, len);
|
||||
return 0;
|
||||
}
|
||||
funchook_set_error_message(funchook, "Failed to unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR", error=%s)",
|
||||
mstate->addr, mstate->size, start, len,
|
||||
mach_error_string(kr));
|
||||
return FUNCHOOK_ERROR_MEMORY_FUNCTION;
|
||||
#endif
|
||||
rv = mprotect(mstate->addr, mstate->size, prot);]=]
|
||||
_unix_content "${_unix_content}")
|
||||
|
||||
string(REPLACE
|
||||
[=[ char errbuf[128];
|
||||
int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=]
|
||||
[=[ char errbuf[128];
|
||||
#ifdef __APPLE__
|
||||
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr,
|
||||
(vm_size_t)mstate->size, FALSE,
|
||||
VM_PROT_READ | VM_PROT_EXECUTE);
|
||||
|
||||
if (kr == KERN_SUCCESS) {
|
||||
funchook_log(funchook, " protect memory %p (size=%"PRIuPTR", prot=read,exec)\n",
|
||||
mstate->addr, mstate->size);
|
||||
return 0;
|
||||
}
|
||||
funchook_set_error_message(funchook, "Failed to protect memory %p (size=%"PRIuPTR", prot=read,exec, error=%s)",
|
||||
mstate->addr, mstate->size,
|
||||
mach_error_string(kr));
|
||||
return FUNCHOOK_ERROR_MEMORY_FUNCTION;
|
||||
#endif
|
||||
int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=]
|
||||
_unix_content "${_unix_content}")
|
||||
endif ()
|
||||
|
||||
file(WRITE "${SOURCE_DIR}/src/funchook_unix.c" "${_unix_content}")
|
||||
@@ -0,0 +1,125 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
|
||||
|
||||
set(_SYMGEN_VERSION "1.1.0")
|
||||
set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}")
|
||||
set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release")
|
||||
mark_as_advanced(SYMGEN_PATH)
|
||||
|
||||
function(symgen_host_asset out_name)
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" _host_processor)
|
||||
set(_asset "")
|
||||
|
||||
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
if (_host_processor MATCHES "^(arm64|aarch64)$")
|
||||
set(_asset "symgen-macos-arm64")
|
||||
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
|
||||
set(_asset "symgen-macos-x86_64")
|
||||
endif ()
|
||||
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (_host_processor MATCHES "^(aarch64|arm64)$")
|
||||
set(_asset "symgen-linux-aarch64")
|
||||
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
|
||||
set(_asset "symgen-linux-x86_64")
|
||||
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
|
||||
set(_asset "symgen-linux-i686")
|
||||
endif ()
|
||||
elseif (CMAKE_HOST_WIN32)
|
||||
if (_host_processor MATCHES "^(arm64|aarch64)$")
|
||||
set(_asset "symgen-windows-arm64.exe")
|
||||
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
|
||||
set(_asset "symgen-windows-x86_64.exe")
|
||||
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
|
||||
set(_asset "symgen-windows-x86.exe")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set(${out_name} "${_asset}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(ensure_symgen required)
|
||||
if (TARGET symgen)
|
||||
return()
|
||||
endif ()
|
||||
|
||||
if (SYMGEN_PATH)
|
||||
get_filename_component(_symgen "${SYMGEN_PATH}" ABSOLUTE)
|
||||
if (NOT EXISTS "${_symgen}")
|
||||
if (required)
|
||||
message(FATAL_ERROR "symgen: SYMGEN_PATH does not exist: ${_symgen}")
|
||||
endif ()
|
||||
message(STATUS "symgen: SYMGEN_PATH does not exist, symbol manifest generation "
|
||||
"skipped (by-name hook resolution will be unavailable)")
|
||||
return()
|
||||
endif ()
|
||||
else ()
|
||||
symgen_host_asset(_asset)
|
||||
if (_asset STREQUAL "")
|
||||
if (required)
|
||||
message(FATAL_ERROR "symgen: no prebuilt binary for host "
|
||||
"${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR} "
|
||||
"(configure with -DDUSK_ENABLE_CODE_MODS=OFF)")
|
||||
endif ()
|
||||
message(STATUS "symgen: no prebuilt binary for host "
|
||||
"${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR}; "
|
||||
"symbol manifest generation skipped (by-name hook resolution will be unavailable)")
|
||||
return()
|
||||
endif ()
|
||||
|
||||
set(_symgen_dir "${CMAKE_BINARY_DIR}/_deps/symgen")
|
||||
set(_symgen "${_symgen_dir}/${_asset}")
|
||||
set(_url "${_SYMGEN_RELEASE_BASE_URL}/${_asset}")
|
||||
message(STATUS "dusklight: Fetching symgen ${_SYMGEN_VERSION} (${_asset})")
|
||||
file(MAKE_DIRECTORY "${_symgen_dir}")
|
||||
file(DOWNLOAD "${_url}" "${_symgen}"
|
||||
TLS_VERIFY ON
|
||||
STATUS _download_status
|
||||
SHOW_PROGRESS)
|
||||
list(GET _download_status 0 _download_code)
|
||||
if (NOT _download_code EQUAL 0)
|
||||
list(GET _download_status 1 _download_message)
|
||||
file(REMOVE "${_symgen}")
|
||||
if (required)
|
||||
message(FATAL_ERROR "symgen: failed to download ${_url}: ${_download_message}")
|
||||
endif ()
|
||||
message(STATUS "symgen: failed to download ${_url}: ${_download_message}; "
|
||||
"symbol manifest generation skipped (by-name hook resolution will be unavailable)")
|
||||
return()
|
||||
endif ()
|
||||
if (NOT CMAKE_HOST_WIN32)
|
||||
file(CHMOD "${_symgen}" PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
add_custom_target(symgen DEPENDS "${_symgen}")
|
||||
set(SYMGEN_EXE "${_symgen}" CACHE INTERNAL "symgen executable" FORCE)
|
||||
endfunction()
|
||||
|
||||
function(setup_symbol_manifest target)
|
||||
ensure_symgen(TRUE)
|
||||
if (NOT TARGET symgen)
|
||||
return()
|
||||
endif ()
|
||||
add_dependencies(${target} symgen)
|
||||
|
||||
if (WIN32)
|
||||
set(_input --pdb "$<TARGET_PDB_FILE:${target}>")
|
||||
set(_out "$<TARGET_FILE_DIR:${target}>/dusklight.symdb")
|
||||
else ()
|
||||
set(_input --binary "$<TARGET_FILE:${target}>")
|
||||
if (APPLE)
|
||||
set(_out "$<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/dusklight.symdb")
|
||||
else ()
|
||||
set(_out "$<TARGET_FILE_DIR:${target}>/dusklight.symdb")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${SYMGEN_EXE}" manifest ${_input} --out "${_out}"
|
||||
COMMENT "Generating symbol manifest"
|
||||
VERBATIM)
|
||||
endfunction()
|
||||
@@ -0,0 +1,79 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
get_filename_component(_DUSK_WINDOWS_EXPORTS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
|
||||
|
||||
# Windows mod linking: generate the curated export surface for the game executable and the
|
||||
# import library mods link against. symgen scans the built objects, filters by source, and
|
||||
# writes a .def used by the main link and import library generation.
|
||||
function(setup_windows_exports target)
|
||||
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message(WARNING "dusklight: Windows code-mod exports are x64-only for now; skipping")
|
||||
return()
|
||||
endif ()
|
||||
|
||||
include("${_DUSK_WINDOWS_EXPORTS_CMAKE_DIR}/SymbolManifest.cmake")
|
||||
ensure_symgen(TRUE)
|
||||
set(_symgen "${SYMGEN_EXE}")
|
||||
add_dependencies(${target} symgen)
|
||||
|
||||
set(_config_subdir "")
|
||||
if (CMAKE_CONFIGURATION_TYPES)
|
||||
set(_config_subdir "$<CONFIG>/")
|
||||
endif ()
|
||||
|
||||
set(_rsp_lines "$<TARGET_OBJECTS:${target}>")
|
||||
foreach (_lib IN LISTS JSYSTEM_LIBRARIES)
|
||||
list(APPEND _rsp_lines "$<TARGET_FILE:${_lib}>")
|
||||
endforeach ()
|
||||
list(JOIN _rsp_lines "\n" _rsp_content)
|
||||
set(_rsp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports_input.rsp")
|
||||
file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}")
|
||||
|
||||
set(_sdk_args)
|
||||
foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
|
||||
aurora_os aurora_pad aurora_si aurora_vi)
|
||||
if (TARGET ${_lib})
|
||||
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:${_lib}>")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# Generate curated exports list from the main binary
|
||||
set(_def "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports.def")
|
||||
add_custom_command(TARGET ${target} PRE_LINK
|
||||
# TODO: src/dusk/ is NOT excluded: inline code in game headers
|
||||
# currently call into it (e.g. dusk::frame_interp::lookup_replacement).
|
||||
COMMAND "${_symgen}" def
|
||||
--rsp "${_rsp}"
|
||||
--out "${_def}"
|
||||
--exclude cmake_pch
|
||||
--exclude miniz
|
||||
--exclude asan_options
|
||||
--max-exports 58000
|
||||
${_sdk_args}
|
||||
COMMENT "Generating dusklight exports"
|
||||
VERBATIM)
|
||||
target_link_options(${target} PRIVATE "/DEF:${_def}")
|
||||
|
||||
# Generate import library for mods to link against.
|
||||
set(_implib "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_imports.lib")
|
||||
get_filename_component(_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
||||
find_program(DUSK_LLVM_DLLTOOL llvm-dlltool HINTS "${_compiler_dir}")
|
||||
if (DUSK_LLVM_DLLTOOL)
|
||||
set(_implib_cmd "${DUSK_LLVM_DLLTOOL}" -d "${_def}" -D dusklight.exe -m i386:x86-64
|
||||
-l "${_implib}")
|
||||
else ()
|
||||
set(_implib_cmd "${CMAKE_AR}" /nologo "/def:${_def}" /machine:x64 /name:dusklight.exe
|
||||
"/out:${_implib}")
|
||||
endif ()
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND ${_implib_cmd}
|
||||
BYPRODUCTS "${_implib}"
|
||||
COMMENT "Generating dusklight import library"
|
||||
VERBATIM)
|
||||
set(DUSK_GAME_IMPLIB "${_implib}" CACHE INTERNAL "Import library for Windows mod linking")
|
||||
set(DUSK_GAME_DEF "${_def}" CACHE INTERNAL "Curated export .def for the game executable")
|
||||
|
||||
# Ship the import library as sdk/dusklight.lib in the install tree: mods may use it to
|
||||
# compile against Dusklight without having to build the whole game. (See DUSK_GAME_IMPLIB)
|
||||
install(FILES "${_implib}" DESTINATION sdk RENAME dusklight.lib)
|
||||
endfunction()
|
||||
@@ -0,0 +1,9 @@
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" OR CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "ARM64")
|
||||
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
|
||||
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "X86")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "X86")
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -180,6 +180,7 @@ cmake --build --preset macos-default-relwithdebinfo
|
||||
Alternate presets available:
|
||||
|
||||
* `macos-default-debug`: Clang, Debug
|
||||
* `macos-default-debug-asan`: Clang, Debug, AddressSanitizer
|
||||
|
||||
**ninja (Linux)**
|
||||
|
||||
@@ -191,8 +192,10 @@ cmake --build --preset linux-default-relwithdebinfo
|
||||
Alternate presets available:
|
||||
|
||||
* `linux-default-debug`: GCC, Debug
|
||||
* `linux-default-debug-asan`: GCC, Debug, AddressSanitizer
|
||||
* `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
|
||||
* `linux-clang-debug`: Clang, Debug
|
||||
* `linux-clang-debug-asan`: Clang, Debug, AddressSanitizer
|
||||
|
||||
**ninja (Windows)**
|
||||
|
||||
@@ -204,6 +207,7 @@ cmake --build --preset windows-msvc-relwithdebinfo
|
||||
Alternate presets available:
|
||||
|
||||
* `windows-msvc-debug`: MSVC, Debug
|
||||
* `windows-msvc-debug-asan`: MSVC, Debug, AddressSanitizer
|
||||
* `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
|
||||
* `windows-clang-debug`: Clang-cl, Debug
|
||||
|
||||
|
||||
+716
@@ -0,0 +1,716 @@
|
||||
# Dusklight Mod API
|
||||
|
||||
Mods are `.dusk` bundles: zip archives that can contain code (in the form of native libraries), resources, DVD overlay
|
||||
files, and texture replacements. Mods may be enabled, disabled and reloaded at runtime.
|
||||
|
||||
When code mods are loaded, they get dynamically linked by the operating system to the running game process. The mod
|
||||
exports lifecycle functions that Dusklight calls into (`mod_initialize`, `mod_update`, `mod_shutdown`), and the mod
|
||||
communicates with the host via **services**: plain C APIs, individually versioned. Dusklight exports several built-in
|
||||
services, and mods may export services of their own, permitting framework mods and cross-mod integration.
|
||||
|
||||
Beyond services, mods have full access to the original game's code: include game headers, call directly into any public
|
||||
function, read and write data fields, and hook the vast majority of game functions.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Getting Started](#getting-started)
|
||||
2. [mod.json](#modjson)
|
||||
3. [Anatomy of a Code Mod](#anatomy-of-a-code-mod)
|
||||
4. [Services](#services)
|
||||
5. [Built-in Services](#built-in-services)
|
||||
6. [Hooking Game Functions](#hooking-game-functions)
|
||||
7. [Asset Overlays](#asset-overlays)
|
||||
8. [Runtime Lifecycle](#runtime-lifecycle)
|
||||
9. [Error Handling](#error-handling)
|
||||
10. [Advanced: Exporting Services](#advanced-exporting-services)
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
Fork the [mod template](../tools/mod_template/), a self-contained CMake project that uses the Dusklight mod SDK.
|
||||
|
||||
```
|
||||
my_mod/
|
||||
├── CMakeLists.txt
|
||||
├── mod.json
|
||||
├── src/mod.cpp
|
||||
├── res/ (optional bundled resources)
|
||||
├── overlay/ (optional game file overrides)
|
||||
└── textures/ (optional texture replacements)
|
||||
```
|
||||
|
||||
**CMakeLists.txt:**
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
project(my_mod CXX)
|
||||
|
||||
set(DUSKLIGHT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dusklight" CACHE PATH "Path to dusklight source root")
|
||||
add_subdirectory("${DUSKLIGHT_DIR}/sdk" dusklight-sdk EXCLUDE_FROM_ALL)
|
||||
|
||||
add_mod(my_mod
|
||||
SOURCES src/mod.cpp
|
||||
MOD_JSON mod.json
|
||||
RES_DIR res # optional
|
||||
OVERLAY_DIR overlay # optional
|
||||
TEXTURES_DIR textures # optional
|
||||
)
|
||||
```
|
||||
|
||||
Building produces `my_mod.dusk` in `build/<preset>/mods/` (configurable via the `DUSK_MODS_OUTPUT_DIR` cache variable).
|
||||
Dusklight searches a `mods/` directory next to the app in addition to the user directory, so a dev build launched from
|
||||
`build/<preset>/` picks these up automatically: rebuild, relaunch (or click Reload), done.
|
||||
|
||||
For a regular game install, copy the `.dusk` into the user mods folder:
|
||||
|
||||
- Windows: `%APPDATA%\TwilitRealm\Dusklight\mods`
|
||||
- Linux: `~/.local/share/TwilitRealm/Dusklight/mods`
|
||||
- macOS: `~/Library/Application Support/TwilitRealm/Dusklight/mods`
|
||||
|
||||
Passing `--mods <dir>` on the command line replaces the user directory with one of your choosing.
|
||||
|
||||
---
|
||||
|
||||
## mod.json
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "com.example.my_mod",
|
||||
"name": "My Mod",
|
||||
"version": "1.0.0",
|
||||
"author": "Your Name",
|
||||
"description": "A short description shown in the mod manager.",
|
||||
"icon": "res/my_icon.png",
|
||||
"banner": "res/my_banner.png"
|
||||
}
|
||||
```
|
||||
|
||||
`id` is required: a unique, stable identifier (reverse-DNS style; periods, underscores, and alphanumerics). Everything
|
||||
else is optional but recommended.
|
||||
|
||||
`icon` and `banner` are bundle-relative paths to PNG images for the in-game mod manager: the square icon (e.g.
|
||||
512x512), the banner (~3.5:1). If omitted, `res/icon.png` and `res/banner.png` are used automatically when present.
|
||||
|
||||
---
|
||||
|
||||
## Anatomy of a Code Mod
|
||||
|
||||
```cpp
|
||||
#include "mods/service.hpp"
|
||||
#include "mods/svc/log.h"
|
||||
|
||||
DEFINE_MOD(); // once, in exactly one translation unit
|
||||
IMPORT_SERVICE(LogService, svc_log); // resolved by the loader before mod_initialize
|
||||
|
||||
extern "C" {
|
||||
|
||||
MOD_EXPORT ModResult mod_initialize(ModError* error) {
|
||||
svc_log->info(mod_ctx, "hello from my_mod");
|
||||
return MOD_OK;
|
||||
}
|
||||
|
||||
MOD_EXPORT ModResult mod_update(ModError* error) { // called every frame
|
||||
return MOD_OK;
|
||||
}
|
||||
|
||||
MOD_EXPORT ModResult mod_shutdown(ModError* error) {
|
||||
return MOD_OK;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
All three lifecycle exports are required. `mod_ctx` is your mod's identity token, set by the loader before
|
||||
`mod_initialize` runs. Pass it as the first argument to every service call.
|
||||
|
||||
---
|
||||
|
||||
## Services
|
||||
|
||||
A service is a struct of C function pointers with a version header. You declare what you use at file scope, and the
|
||||
loader resolves it before your mod initializes:
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(LogService, svc_log); // required, any minor version
|
||||
IMPORT_SERVICE_VERSION(LogService, svc_log, 2); // required, minor version >= 2
|
||||
IMPORT_OPTIONAL_SERVICE(SomeService, svc_maybe); // may be null
|
||||
```
|
||||
|
||||
Each service is individually versioned, and there may be multiple major versions of a service provided at once,
|
||||
allowing backwards compatibility with older mods while still changing services fundamentally if necessary. A **major**
|
||||
bump is a breaking change, treated as a different service entirely. For **additive** changes, a service appends new
|
||||
functions to the end of the struct without breaking existing callers and simply bumps the minor version. Mods that
|
||||
want the newer functions may use `IMPORT_SERVICE_VERSION` to require that minor at **load time**, or `SERVICE_HAS` to
|
||||
check at **runtime** whether a specific function is available.
|
||||
|
||||
The contract (see `include/mods/api.h` for the full version):
|
||||
|
||||
- **A required import is guaranteed valid.** If the service is missing or too old, the mod fails to load with a clear
|
||||
error. No need to null check at call sites.
|
||||
- **Anything at or below the minor version you imported can be called unconditionally.**
|
||||
- Optional imports may be null; check once in `mod_initialize`.
|
||||
- Fields newer than your imported minor must be gated behind `SERVICE_HAS(service, ServiceType, field)` plus a null
|
||||
check.
|
||||
|
||||
---
|
||||
|
||||
## Built-in Services
|
||||
|
||||
### LogService (`mods/svc/log.h`)
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(LogService, svc_log);
|
||||
|
||||
svc_log->info(mod_ctx, "spawned the thing");
|
||||
svc_log->warn(mod_ctx, "that looks wrong");
|
||||
svc_log->error(mod_ctx, "very bad");
|
||||
svc_log->write(mod_ctx, LOG_LEVEL_DEBUG, "verbose details");
|
||||
```
|
||||
|
||||
Messages appear in the console prefixed with your mod ID. Messages are plain UTF-8 strings and are copied before the
|
||||
call returns; use `snprintf` or `fmt::format` for formatting.
|
||||
|
||||
### ResourceService (`mods/svc/resource.h`)
|
||||
|
||||
Loads files from the `res/` tree of your `.dusk` archive. Paths are relative to `res/` (pass `"config.txt"`, not
|
||||
`"res/config.txt"`); absolute paths and `..` are rejected.
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(ResourceService, svc_resource);
|
||||
|
||||
ResourceBuffer buf = RESOURCE_BUFFER_INIT;
|
||||
if (svc_resource->load(mod_ctx, "config.txt", &buf) == MOD_OK) {
|
||||
// buf.data / buf.size
|
||||
svc_resource->free(mod_ctx, &buf);
|
||||
}
|
||||
```
|
||||
|
||||
Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. Note that the bundle is read-only; for writable
|
||||
storage, use the directory from `svc_host->mod_dir(mod_ctx)`.
|
||||
|
||||
### HostService (`mods/svc/host.h`)
|
||||
|
||||
Mod metadata and runtime interaction with the loader:
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(HostService, svc_host);
|
||||
|
||||
const char* id = svc_host->mod_id(mod_ctx);
|
||||
const char* dir = svc_host->mod_dir(mod_ctx); // writable per-mod directory
|
||||
svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened"); // disables the mod
|
||||
```
|
||||
|
||||
`get_service`/`publish_service` provide dynamic service lookup; see [Advanced](#advanced-exporting-services).
|
||||
|
||||
**Lifecycle watches.** If your mod provides a service that hands out per-caller state (registrations, callbacks,
|
||||
handles), watch other mods' lifecycle and drop what you hold for a mod when it detaches.
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE_VERSION(HostService, svc_host, 1);
|
||||
|
||||
void on_mod_lifecycle(ModContext* ctx, ModContext* subject, const char* subject_id,
|
||||
ModLifecycleEvent event, void* user_data) {
|
||||
if (event == MOD_LIFECYCLE_DETACHED) {
|
||||
drop_state_for(subject); // same ModContext* the subject passed into your service
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t watch = 0;
|
||||
svc_host->watch_mod_lifecycle(mod_ctx, on_mod_lifecycle, nullptr, &watch);
|
||||
```
|
||||
|
||||
`MOD_LIFECYCLE_DETACHED` fires on the game thread at a lifecycle safe point, after the subject's `mod_shutdown` ran and
|
||||
every service dropped its state. For your own mod's teardown, use `mod_shutdown` instead.
|
||||
|
||||
### HookService (`mods/svc/hook.h`)
|
||||
|
||||
Installs hooks on game functions and resolves symbols by name. You'll rarely call it directly; use the typed helpers in
|
||||
`mods/hook.hpp` described in [Hooking Game Functions](#hooking-game-functions).
|
||||
|
||||
### OverlayService (`mods/svc/overlay.h`)
|
||||
|
||||
Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see
|
||||
[Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, or with a caller-owned buffer
|
||||
(copied on registration):
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(OverlayService, svc_overlay);
|
||||
|
||||
OverlayHandle handle = 0;
|
||||
svc_overlay->add_file(mod_ctx, "/res/Msgus.arc", "res/replacement.arc", &handle);
|
||||
svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr);
|
||||
svc_overlay->remove(mod_ctx, handle);
|
||||
```
|
||||
|
||||
`disc_path` must be absolute (leading `/`) and is matched against the disc case-insensitively. Paths that don't exist
|
||||
on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read
|
||||
stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart.
|
||||
|
||||
See [Asset Overlays](#asset-overlays) for priority and conflict handling.
|
||||
|
||||
### TextureService (`mods/svc/texture.h`)
|
||||
|
||||
Registers texture replacements at runtime: the dynamic counterpart to the static `textures/` directory (see
|
||||
[Asset Overlays](#asset-overlays)). Two forms: raw texel data with an explicit key, or an encoded `.dds`/`.png` from
|
||||
your bundle whose filename encodes the key:
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(TextureService, svc_texture);
|
||||
|
||||
// Encoded file; filename follows the replacement naming convention.
|
||||
TextureReplacementHandle handle = 0;
|
||||
svc_texture->register_file(mod_ctx, "res/tex1_32x32_$_6.png", &handle);
|
||||
|
||||
// Raw data: match by texel-data pointer or by content hash (TEXTURE_KEY_SOURCE).
|
||||
TextureKey key = TEXTURE_KEY_INIT;
|
||||
key.kind = TEXTURE_KEY_POINTER;
|
||||
key.pointer = someTexObj.data;
|
||||
TextureData data = TEXTURE_DATA_INIT;
|
||||
data.data = pixels; data.size = pixelsSize;
|
||||
data.width = 32; data.height = 32; data.gx_format = GX_TF_RGBA8_PC;
|
||||
svc_texture->register_data(mod_ctx, &key, &data, nullptr);
|
||||
|
||||
svc_texture->unregister(mod_ctx, handle);
|
||||
```
|
||||
|
||||
Filenames use the same Dolphin-style convention as the user's `texture_replacements` directory:
|
||||
`tex1_{w}x{h}_{texhash}[_{tluthash}]_{fmt}.dds|.png`, where hashes may be `$` (wildcard). `_mipN` sidecar files next to
|
||||
a registered file are picked up automatically. Files are decoded lazily on first use by the renderer; raw data is copied
|
||||
at registration. Registrations follow your mod's lifecycle.
|
||||
|
||||
See [Asset Overlays](#asset-overlays) for priority and conflict handling.
|
||||
|
||||
### ConfigService (`mods/svc/config.h`)
|
||||
|
||||
Persistent, mod-scoped configuration variables. Each var is stored in the user's `config.json` under
|
||||
`mod.<escaped mod id>.<name>` (escaping: `.` → `_`, `_` → `__`, so `com.example.my_mod` becomes `com_example_my__mod`),
|
||||
next to the host's own settings:
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(ConfigService, svc_config);
|
||||
|
||||
ConfigVarDesc desc = CONFIG_VAR_DESC_INIT;
|
||||
desc.name = "speedMultiplier"; // 1-64 chars from [A-Za-z0-9_-]; "enabled" is reserved
|
||||
desc.type = CONFIG_VAR_FLOAT;
|
||||
desc.default_float = 1.0;
|
||||
ConfigVarHandle var = 0;
|
||||
svc_config->register_var(mod_ctx, &desc, &var);
|
||||
|
||||
double speed = 1.0;
|
||||
svc_config->get_float(mod_ctx, var, &speed);
|
||||
svc_config->set_float(mod_ctx, var, 2.0);
|
||||
|
||||
// Optional: get notified when the value changes.
|
||||
void on_speed_changed(ModContext* ctx, ConfigVarHandle var, const ConfigVarValue* value,
|
||||
const ConfigVarValue* previous, void* user_data) {
|
||||
/* value->float_value is the new value, previous->float_value the old one */
|
||||
}
|
||||
svc_config->subscribe(mod_ctx, var, on_speed_changed, nullptr, nullptr);
|
||||
```
|
||||
|
||||
Types: `CONFIG_VAR_BOOL` (`bool`), `CONFIG_VAR_INT` (`int64_t`), `CONFIG_VAR_FLOAT` (`double`), `CONFIG_VAR_STRING`
|
||||
(UTF-8; `get_string` copies into a caller buffer, pass a `NULL` buffer with size 0 to query the length). Accessors are
|
||||
typed and must match the registration.
|
||||
|
||||
Change callbacks fire on the game thread whenever the value changes at runtime (your own `set_*` calls included).
|
||||
Writes that store the same value are silent. Values applied from `config.json` or `--cvar` at registration do
|
||||
**not** fire callbacks; read the value after `register_var` for the starting state.
|
||||
|
||||
### UiService (`mods/svc/ui.h`)
|
||||
|
||||
Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window,
|
||||
create custom windows and modal dialogs, apply custom RCSS stylesheets (anywhere!), and add menu bar tabs.
|
||||
|
||||
**Mod panel:** Registers or replaces the panel rendered in your mod's detail pane; `build` runs every time the detail
|
||||
content is rebuilt, and `update` runs every frame while that mod is selected. While your mod is selected, the detail
|
||||
pane carries your mod's id as a `mod-id` attribute (like custom window roots), so scoped RCSS can target it (e.g.
|
||||
`[mod-id="com.example.mod"]`).
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(UiService, svc_ui);
|
||||
|
||||
UiElementHandle statusText = 0;
|
||||
|
||||
ModResult build(ModContext*, UiElementHandle panel, void*, ModError*) {
|
||||
svc_ui->pane_add_section(mod_ctx, panel, "Status");
|
||||
svc_ui->pane_add_text(mod_ctx, panel, "starting...", &statusText);
|
||||
svc_ui->pane_add_progress(mod_ctx, panel, 0.5f, nullptr);
|
||||
return MOD_OK;
|
||||
}
|
||||
|
||||
ModResult update(ModContext*, void*, ModError*) {
|
||||
svc_ui->elem_set_text(mod_ctx, statusText, "running");
|
||||
return MOD_OK;
|
||||
}
|
||||
|
||||
UiModsPanelDesc panel = UI_MODS_PANEL_DESC_INIT;
|
||||
panel.build = build;
|
||||
panel.update = update;
|
||||
svc_ui->register_mods_panel(mod_ctx, &panel);
|
||||
```
|
||||
|
||||
Element setters must match the element kind: `elem_set_text`/`elem_set_rml` on text rows, and `elem_set_progress` on
|
||||
progress bars. `elem_set_class` sets or clears an RCSS class on any element handle, for styling via scoped or
|
||||
per-window RCSS. A non-`MOD_OK` result from `build`/`update` fails your mod, as do exceptions thrown from any UI
|
||||
callback.
|
||||
|
||||
**Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`,
|
||||
`UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, or `UI_CONTROL_SELECT`. Values bind with callbacks or
|
||||
directly to a config var.
|
||||
|
||||
```cpp
|
||||
UiControlDesc control = UI_CONTROL_DESC_INIT;
|
||||
control.kind = UI_CONTROL_TOGGLE;
|
||||
control.label = "Enable rainbows";
|
||||
control.help_rml = "Shown in the help pane while focused.";
|
||||
control.binding = UI_BINDING_CONFIG_VAR;
|
||||
control.config_var = myBoolVar; // from svc_config->register_var
|
||||
svc_ui->pane_add_control(mod_ctx, leftPane, &control, nullptr);
|
||||
```
|
||||
|
||||
`UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var
|
||||
type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` = string. Float vars are not
|
||||
bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT` controls
|
||||
are only available inside window tabs.
|
||||
|
||||
**Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build`
|
||||
receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update`
|
||||
runs each frame while that tab is active. `on_closed` fires when the window is destroyed. `desc.rcss` optionally styles
|
||||
that window's document only; custom windows carry the owning mod's id as a `mod-id` attribute on the window root, so
|
||||
scoped RCSS can target your specific mod's windows (e.g. `window[mod-id="com.example.mod"]`).
|
||||
|
||||
```cpp
|
||||
UiTabDesc tabs[1] = {UI_TAB_DESC_INIT};
|
||||
tabs[0].title = "Options";
|
||||
tabs[0].build = build_options_tab;
|
||||
|
||||
UiWindowDesc desc = UI_WINDOW_DESC_INIT;
|
||||
desc.tabs = tabs;
|
||||
desc.tab_count = 1;
|
||||
desc.on_closed = options_window_closed;
|
||||
UiWindowHandle window = 0;
|
||||
svc_ui->window_push(mod_ctx, &desc, &window);
|
||||
```
|
||||
|
||||
**Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's
|
||||
default icon, and actions become buttons. After an action's `on_pressed` returns, the dialog closes unless the action
|
||||
sets `keep_open`. A `keep_open` action can close it later (or immediately) with `dialog_close`. Cancel fires
|
||||
`on_dismiss` if present and always closes. `dialog_set_body`, `dialog_set_icon`, and `dialog_add_action` mutate a live
|
||||
dialog.
|
||||
|
||||
**Menu bar tabs:** `register_menu_tab` adds a tab to the in-game menu bar. `on_selected` fires when the user activates
|
||||
the tab: typically you'd push a window from it. The tab is removed by `unregister_menu_tab`, or automatically when the
|
||||
mod is disabled.
|
||||
|
||||
**Custom styles:** `register_styles(scope, rcss, &handle)` applies an RCSS stylesheet to every document of a scope:
|
||||
existing documents restyle immediately, and future ones pick it up when created. `register_styles_file(scope, path,
|
||||
&handle)` reads the sheet from your bundle's `res/` directory. Scopes are `UI_SCOPE_PRELAUNCH`, `UI_SCOPE_WINDOW`,
|
||||
`UI_SCOPE_MENU_BAR`, `UI_SCOPE_OVERLAY`, `UI_SCOPE_TOUCH_CONTROLS`, and `UI_SCOPE_GRAPHICS_TUNER`. Sheets apply after
|
||||
host styles and may override them. Scope selectors tightly (use `[mod-id="..."]`!), especially for `UI_SCOPE_WINDOW`,
|
||||
unless changing host UI is intentional.
|
||||
|
||||
---
|
||||
|
||||
## Hooking Game Functions
|
||||
|
||||
Mods may hook the vast majority of game functions, including file-local static, private and virtual functions.
|
||||
`mods/hook.hpp` provides typed helpers over the hook service:
|
||||
|
||||
```cpp
|
||||
#include "mods/hook.hpp"
|
||||
#include "mods/svc/hook.h"
|
||||
|
||||
IMPORT_SERVICE(HookService, svc_hook);
|
||||
```
|
||||
|
||||
### Pre-hooks
|
||||
|
||||
Run before the original. Return `HOOK_SKIP_ORIGINAL` to cancel it (post-hooks still run).
|
||||
|
||||
```cpp
|
||||
HookAction on_pos_move_pre(ModContext*, void* args, void* retval, void* userdata) {
|
||||
daAlink_c* link = dusk::mods::arg<daAlink_c*>(args, 0); // arg 0 is `this`
|
||||
if (link->shape_angle.y > 10000) {
|
||||
return HOOK_SKIP_ORIGINAL;
|
||||
}
|
||||
return HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
dusk::mods::hook_add_pre<&daAlink_c::posMove>(svc_hook, on_pos_move_pre);
|
||||
```
|
||||
|
||||
### Post-hooks
|
||||
|
||||
Run after the original (or after a replace-hook, or after a cancelled original). `retval` points to the return value,
|
||||
if any.
|
||||
|
||||
```cpp
|
||||
void on_pos_move_post(ModContext*, void* args, void* retval, void* userdata) { ... }
|
||||
|
||||
dusk::mods::hook_add_post<&daAlink_c::posMove>(svc_hook, on_pos_move_post);
|
||||
```
|
||||
|
||||
### Replace-hooks
|
||||
|
||||
Substitute the original entirely. Call through to it via `Hook<...>::g_orig` if needed:
|
||||
|
||||
```cpp
|
||||
using ExecuteEntry = dusk::mods::Hook<&daAlink_c::execute>;
|
||||
|
||||
void on_execute_replace(ModContext*, void* args, void* retval, void*) {
|
||||
int result = ExecuteEntry::g_orig(dusk::mods::arg<daAlink_c*>(args, 0));
|
||||
if (retval != nullptr) {
|
||||
*static_cast<int*>(retval) = result;
|
||||
}
|
||||
}
|
||||
|
||||
dusk::mods::hook_replace<&daAlink_c::execute>(svc_hook, on_execute_replace);
|
||||
```
|
||||
|
||||
By default a second replace-hook on the same function is a conflict; `HookOptions` (`replace_policy`, `priority`,
|
||||
`userdata`) controls this and callback ordering. Multiple mods can attach pre/post hooks to the same function
|
||||
independently.
|
||||
|
||||
### Hooking by name
|
||||
|
||||
Functions you can't name in C++ (file-local statics, private class members, anything not in a header) can be hooked by
|
||||
symbol name instead. You must supply the signature along with the name.
|
||||
|
||||
```cpp
|
||||
// static callback used by Link's hookshot collider in d_a_alink_hook.inc
|
||||
using HookshotHit = dusk::mods::NamedHook<
|
||||
"daAlink_hookshotAtHitCallBack",
|
||||
void(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*)>;
|
||||
|
||||
dusk::mods::hook_add_pre<HookshotHit>(svc_hook, on_hookshot_hit_pre);
|
||||
...
|
||||
HookshotHit::g_orig(link, atObjInf, target, tgObjInf); // call through to the original
|
||||
```
|
||||
|
||||
Class member functions must include `Class*` as the first argument.
|
||||
|
||||
The install fails with the resolve error when the name is missing (`MOD_UNAVAILABLE`), ambiguous (`MOD_CONFLICT`),
|
||||
or the manifest is absent (`MOD_UNSUPPORTED`). Unlike `Hook<&Class::method>`, the signature is **not**
|
||||
compiler-checked: a mismatched signature will corrupt the call.
|
||||
|
||||
### Reading and writing arguments
|
||||
|
||||
`args` is an array of pointers to the arguments. For member functions, index 0 is `this`; parameters follow in
|
||||
declaration order.
|
||||
|
||||
```cpp
|
||||
T value = dusk::mods::arg<T>(args, n); // copy
|
||||
T& ref = dusk::mods::arg_ref<T>(args, n); // read/write reference
|
||||
```
|
||||
|
||||
```cpp
|
||||
// fpc_ProcID fopAcM_createItem(..., int itemNo, ...): turn heart drops into green rupees
|
||||
HookAction on_create_item_pre(ModContext*, void* args, void*, void*) {
|
||||
int& itemNo = dusk::mods::arg_ref<int>(args, 1);
|
||||
if (itemNo == dItemNo_HEART_e) {
|
||||
itemNo = dItemNo_GREEN_RUPEE_e;
|
||||
}
|
||||
return HOOK_CONTINUE;
|
||||
}
|
||||
|
||||
dusk::mods::hook_add_pre<&fopAcM_createItem>(svc_hook, on_create_item_pre);
|
||||
```
|
||||
|
||||
For reference parameters (e.g. `const cXyz& pos`), `arg_ref<cXyz>` yields a direct reference.
|
||||
|
||||
### Resolving symbols by name
|
||||
|
||||
`resolve` looks a symbol up in the **symbol manifest**: a name→address map generated alongside every game build and
|
||||
keyed to that exact binary. It covers the whole image, including functions that aren't exported (file-local statics),
|
||||
which makes them hookable:
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(HookService, svc_hook);
|
||||
|
||||
void* addr = nullptr;
|
||||
uint32_t flags = 0;
|
||||
if (svc_hook->resolve(mod_ctx, "GXSetProjection", &addr, &flags) == MOD_OK) {
|
||||
// addr is the function's real address in the running game; hook or call it.
|
||||
}
|
||||
```
|
||||
|
||||
Two spellings work on every platform:
|
||||
|
||||
- **Display names** (`daAlink_c::posMove`, `fapGm_Before`): the qualified name with no parameter list. They carry no
|
||||
signature, so overload sets (and file-local statics sharing a name) return `MOD_CONFLICT`.
|
||||
- **Decorated names** (`_ZN9daAlink_c7posMoveEv` / `?posMove@daAlink_c@@...`): the platform's mangled spelling in
|
||||
dlsym convention (no Mach-O leading underscore). The escape hatch for overloads.
|
||||
|
||||
`MOD_UNSUPPORTED` means the manifest is missing or was built for a different game binary.
|
||||
|
||||
### Game code ABI contract
|
||||
|
||||
A primary consideration when letting mods link against the game is maintaining ABI stability across Dusklight
|
||||
versions. If your mod calls or hooks game code directly (anything beyond the service APIs), import `GameService`
|
||||
(`mods/svc/game.h`):
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(GameService, svc_game);
|
||||
```
|
||||
|
||||
Its major version is the game code ABI epoch: it's bumped when game struct or vtable layouts change incompatibly, and
|
||||
the ordinary service version check then rejects your mod with a clear error instead of letting it corrupt memory in a
|
||||
version it wasn't built for. Service-only and asset-only mods should *not* import it and will continue to work across
|
||||
game ABI changes.
|
||||
|
||||
The more you can do through services, the better: a mod that avoids touching game code directly sidesteps future ABI
|
||||
breaks entirely and plays nicer with other enabled mods.
|
||||
|
||||
---
|
||||
|
||||
## Asset Overlays
|
||||
|
||||
Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to
|
||||
replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod.
|
||||
|
||||
Files placed under `textures/` register as texture replacements, and act just like the user's general
|
||||
`texture_replacements/` directory: Dolphin-style naming, matched by texture hash
|
||||
(`tex1_{w}x{h}_{texhash}[_{tluthash}]_{fmt}.dds|.png`, `$` as a hash wildcard). Subdirectories are scanned recursively;
|
||||
only the filename needs to match.
|
||||
|
||||
Both mechanisms are tied to the mod's lifecycle: disabling the mod removes its overrides (files revert to the disc
|
||||
contents on their next open; added files stop existing), and reloading serves the new bundle's content. However, game
|
||||
data the engine already read stays as-is until it is loaded again, which may require a scene change or, in the worst
|
||||
case, a full restart. Texture replacements usually take effect immediately.
|
||||
|
||||
If multiple sources replace the same file or texture, the last one wins: runtime registrations override static
|
||||
`textures/` or `overlay/` files, and later-loaded mods override earlier ones. Cross-mod conflicts log warnings.
|
||||
**All** mod-provided texture replacements override the user's `texture_replacements/`.
|
||||
|
||||
To configure overlays and texture replacements at runtime instead, see [OverlayService](#overlayservice-modssvcoverlayh)
|
||||
and [TextureService](#textureservice-modssvctextureh).
|
||||
|
||||
---
|
||||
|
||||
## Runtime Lifecycle
|
||||
|
||||
Mods can be disabled, re-enabled, and reloaded at runtime without restarting the game (the enabled state persists as the
|
||||
`mod.<escaped id>.enabled` config var). Write your mod assuming this happens:
|
||||
|
||||
- **Disable** calls `mod_shutdown`, removes your hooks, services, overlays, and texture replacements (both static and
|
||||
runtime-registered), and unloads your library.
|
||||
- **Enable** and **Reload** load a *fresh copy* of your library, imports are re-resolved, and `mod_initialize` runs
|
||||
again. You never see a second `mod_initialize` on the same image, so just make `mod_shutdown` release anything the
|
||||
loader doesn't manage for you (threads, files, game-side state you mutated).
|
||||
- **Reload** additionally re-reads the `.dusk` from disk, picking up a rebuilt library and changed assets. This is the
|
||||
fast iteration loop during development: rebuild, click Reload.
|
||||
|
||||
**Dependents restart too.** Disabling or reloading a mod that exports services shuts down the mods importing them
|
||||
first (in reverse dependency order) and brings them back afterward. A mod whose *required* provider is disabled stays
|
||||
suspended and resumes automatically when the provider returns. Mods with an *optional* import of a disabled provider
|
||||
restart with that import null.
|
||||
|
||||
**One caution for hooks:** lifecycle changes are applied between frames, which is safe for hooks on functions
|
||||
that return every frame (effectively everything you'd normally hook). Avoid hooking a function that stays on
|
||||
the stack for the whole session (e.g. the outermost main loop); a mod that does cannot be safely unloaded.
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
Service calls report failure through `ModResult` return values (`MOD_OK`, `MOD_UNAVAILABLE`,
|
||||
`MOD_INVALID_ARGUMENT`, ...). Lifecycle exports additionally receive a `ModError*`: fill it (e.g. with
|
||||
`dusk::mods::set_error(error, code, "message")`) and return the code, and the loader disables the mod and shows the
|
||||
message to the user.
|
||||
|
||||
```cpp
|
||||
MOD_EXPORT ModResult mod_initialize(ModError* error) {
|
||||
if (!load_my_data()) {
|
||||
return dusk::mods::set_error(error, MOD_ERROR, "failed to load data");
|
||||
}
|
||||
return MOD_OK;
|
||||
}
|
||||
```
|
||||
|
||||
Throwing exceptions out of lifecycle functions also disables the mod (they are caught by the loader), but prefer
|
||||
explicit results.
|
||||
|
||||
---
|
||||
|
||||
## Advanced: Exporting Services
|
||||
|
||||
Mods may export services of their own, permitting framework mods and cross-mod integration. Define the interface in a
|
||||
header both mods share:
|
||||
|
||||
```cpp
|
||||
// my_mod_api.h
|
||||
#include "mods/api.h"
|
||||
|
||||
#define MY_MOD_SERVICE_ID "com.example.my_mod.api"
|
||||
#define MY_MOD_SERVICE_MAJOR 1u
|
||||
#define MY_MOD_SERVICE_MINOR 0u
|
||||
|
||||
typedef struct MyModService {
|
||||
ServiceHeader header;
|
||||
ModResult (*do_thing)(ModContext* ctx, int value);
|
||||
} MyModService;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "mods/service.hpp"
|
||||
template <>
|
||||
struct dusk::mods::ServiceTraits<MyModService> {
|
||||
static constexpr const char* id = MY_MOD_SERVICE_ID;
|
||||
static constexpr uint16_t major_version = MY_MOD_SERVICE_MAJOR;
|
||||
};
|
||||
#endif
|
||||
```
|
||||
|
||||
**Provider:**
|
||||
|
||||
```cpp
|
||||
ModResult do_thing(ModContext* ctx, int value) { ... }
|
||||
|
||||
constexpr MyModService g_service{
|
||||
.header = SERVICE_HEADER(MyModService, MY_MOD_SERVICE_MAJOR, MY_MOD_SERVICE_MINOR),
|
||||
.do_thing = do_thing,
|
||||
};
|
||||
EXPORT_SERVICE(g_service);
|
||||
```
|
||||
|
||||
**Consumer:**
|
||||
|
||||
```cpp
|
||||
IMPORT_SERVICE(MyModService, svc_my_mod);
|
||||
// or IMPORT_OPTIONAL_SERVICE if the dependency is optional
|
||||
|
||||
svc_my_mod->do_thing(mod_ctx, 42);
|
||||
```
|
||||
|
||||
The loader registers all exports before resolving any imports, so declaration order between mods doesn't matter. Note
|
||||
that the `ctx` a provider receives identifies the *calling* mod.
|
||||
|
||||
### Dependencies between mods
|
||||
|
||||
Service imports are also dependency declarations: the loader initializes mods in dependency order, so by the time your
|
||||
`mod_initialize` runs, every mod you import services from (required *or* optional) has already finished its own
|
||||
`mod_initialize`. This includes deferred services: a service the provider publishes during its initialization resolves
|
||||
into your import slot just like a static export.
|
||||
|
||||
Consequences of that contract:
|
||||
|
||||
- If a provider fails to load, every mod that *requires* one of its services is disabled too, with an error naming the
|
||||
provider. Optional imports of a failed provider simply resolve to `NULL`.
|
||||
- Mods whose **required** imports form a cycle all fail to load. If the cycle runs through an **optional** import, the
|
||||
loader breaks it there: the optional import still resolves, but its provider may not be initialized yet when you run.
|
||||
- `svc_host->get_service(...)` is outside this system. It sees whatever is published at call time and gives no
|
||||
initialization-order guarantee, which also makes it the escape hatch for intentionally cyclic designs.
|
||||
|
||||
Mods shut down in reverse initialization order, so services you import remain safe to call from `mod_shutdown`.
|
||||
|
||||
Rules for providers:
|
||||
|
||||
- Service IDs are global and use reverse-DNS names (e.g. `com.mydomain.mod.service`)
|
||||
- Every function pointer covered by your declared minor version must be populated.
|
||||
- Within a major version, only append fields; never reorder, remove, or repurpose them. Breaking changes require a major
|
||||
bump (which is, in effect, a new service).
|
||||
- Only one provider per `(id, major)` pair may be registered; duplicates are load errors.
|
||||
|
||||
For services whose construction can't happen at static-init time, declare the export with `EXPORT_DEFERRED_SERVICE(...)`
|
||||
and publish the pointer later via `svc_host->publish_service(...)`. Consumers can fetch services dynamically with
|
||||
`svc_host->get_service(...)`; prefer manifest imports whenever possible, since they give the loader dependency
|
||||
information and fail fast with good errors.
|
||||
Vendored
+1
-1
Submodule extern/aurora updated: 10006618ee...0a5a5d90ef
+55
@@ -1418,8 +1418,13 @@ set(DUSK_FILES
|
||||
include/dusk/scope_guard.hpp
|
||||
src/dusk/dvd_asset.cpp
|
||||
src/d/actor/d_a_alink_dusk.cpp
|
||||
src/dusk/android_frame_rate.hpp
|
||||
src/dusk/android_frame_rate.cpp
|
||||
src/dusk/asserts.cpp
|
||||
src/dusk/batch.cpp
|
||||
src/dusk/batch.hpp
|
||||
src/dusk/config.cpp
|
||||
src/dusk/crash_handler.cpp
|
||||
src/dusk/crash_reporting.cpp
|
||||
src/dusk/data.cpp
|
||||
src/dusk/data.hpp
|
||||
@@ -1431,6 +1436,9 @@ set(DUSK_FILES
|
||||
src/dusk/game_clock.cpp
|
||||
src/dusk/globals.cpp
|
||||
src/dusk/gyro.cpp
|
||||
include/dusk/menu_pointer.h
|
||||
src/dusk/menu_pointer.cpp
|
||||
src/dusk/mouse.cpp
|
||||
src/dusk/gamepad_color.cpp
|
||||
src/dusk/autosave.cpp
|
||||
src/dusk/http/http.hpp
|
||||
@@ -1439,7 +1447,11 @@ set(DUSK_FILES
|
||||
src/dusk/logging.cpp
|
||||
src/dusk/settings.cpp
|
||||
src/dusk/speedrun.cpp
|
||||
src/dusk/string.cpp
|
||||
src/dusk/stubs.cpp
|
||||
include/dusk/texture_replacements.hpp
|
||||
src/dusk/texture_replacements.cpp
|
||||
src/dusk/touch_camera.cpp
|
||||
src/dusk/update_check.cpp
|
||||
src/dusk/update_check.hpp
|
||||
#src/dusk/m_Do_ext_dusk.cpp
|
||||
@@ -1469,6 +1481,7 @@ set(DUSK_FILES
|
||||
src/dusk/ui/button.hpp
|
||||
src/dusk/ui/component.cpp
|
||||
src/dusk/ui/component.hpp
|
||||
src/dusk/ui/controls.hpp
|
||||
src/dusk/ui/controller_config.cpp
|
||||
src/dusk/ui/controller_config.hpp
|
||||
src/dusk/ui/document.cpp
|
||||
@@ -1481,6 +1494,14 @@ set(DUSK_FILES
|
||||
src/dusk/ui/graphics_tuner.hpp
|
||||
src/dusk/ui/input.cpp
|
||||
src/dusk/ui/input.hpp
|
||||
src/dusk/ui/icon_provider.cpp
|
||||
src/dusk/ui/icon_provider.hpp
|
||||
src/dusk/ui/logs_window.cpp
|
||||
src/dusk/ui/logs_window.hpp
|
||||
src/dusk/ui/mod_texture_provider.cpp
|
||||
src/dusk/ui/mod_texture_provider.hpp
|
||||
src/dusk/ui/mod_window.cpp
|
||||
src/dusk/ui/mod_window.hpp
|
||||
src/dusk/ui/modal.cpp
|
||||
src/dusk/ui/modal.hpp
|
||||
src/dusk/ui/nav_types.hpp
|
||||
@@ -1492,6 +1513,8 @@ set(DUSK_FILES
|
||||
src/dusk/ui/pane.hpp
|
||||
src/dusk/ui/menu_bar.cpp
|
||||
src/dusk/ui/menu_bar.hpp
|
||||
src/dusk/ui/mods_window.cpp
|
||||
src/dusk/ui/mods_window.hpp
|
||||
src/dusk/ui/prelaunch.cpp
|
||||
src/dusk/ui/prelaunch.hpp
|
||||
src/dusk/ui/preset.cpp
|
||||
@@ -1506,6 +1529,12 @@ set(DUSK_FILES
|
||||
src/dusk/ui/string_button.hpp
|
||||
src/dusk/ui/tab_bar.cpp
|
||||
src/dusk/ui/tab_bar.hpp
|
||||
src/dusk/ui/touch_controls_common.cpp
|
||||
src/dusk/ui/touch_controls_common.hpp
|
||||
src/dusk/ui/touch_controls.cpp
|
||||
src/dusk/ui/touch_controls.hpp
|
||||
src/dusk/ui/touch_controls_editor.cpp
|
||||
src/dusk/ui/touch_controls_editor.hpp
|
||||
src/dusk/ui/ui.cpp
|
||||
src/dusk/ui/ui.hpp
|
||||
src/dusk/ui/warp.cpp
|
||||
@@ -1520,6 +1549,32 @@ set(DUSK_FILES
|
||||
src/dusk/OSReport.cpp
|
||||
src/dusk/OSThread.cpp
|
||||
src/dusk/OSMutex.cpp
|
||||
src/dusk/mods/log_buffer.cpp
|
||||
src/dusk/mods/log_buffer.hpp
|
||||
src/dusk/mods/manifest.cpp
|
||||
src/dusk/mods/manifest.hpp
|
||||
src/dusk/mods/loader/bundle_disk.cpp
|
||||
src/dusk/mods/loader/bundle_zip.cpp
|
||||
src/dusk/mods/loader/context.cpp
|
||||
src/dusk/mods/loader/depgraph.cpp
|
||||
src/dusk/mods/loader/depgraph.hpp
|
||||
src/dusk/mods/loader/loader.cpp
|
||||
src/dusk/mods/loader/loader.hpp
|
||||
src/dusk/mods/loader/native_module.cpp
|
||||
src/dusk/mods/loader/native_module.hpp
|
||||
src/dusk/mods/svc/config.cpp
|
||||
src/dusk/mods/svc/config.hpp
|
||||
src/dusk/mods/svc/game.cpp
|
||||
src/dusk/mods/svc/hook.cpp
|
||||
src/dusk/mods/svc/host.cpp
|
||||
src/dusk/mods/svc/log.cpp
|
||||
src/dusk/mods/svc/overlay.cpp
|
||||
src/dusk/mods/svc/resource.cpp
|
||||
src/dusk/mods/svc/texture.cpp
|
||||
src/dusk/mods/svc/ui.cpp
|
||||
src/dusk/mods/svc/ui.hpp
|
||||
src/dusk/mods/svc/registry.cpp
|
||||
src/dusk/mods/svc/registry.hpp
|
||||
src/dusk/discord.cpp
|
||||
src/dusk/discord.hpp
|
||||
src/dusk/discord_presence.cpp
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From f69d29614644f9963f5cb3f828b58575d60a1c5a Mon Sep 17 00:00:00 2001
|
||||
From: Joshua Trees <gh@jtrees.io>
|
||||
Date: Thu, 4 Jun 2026 01:04:04 +0100
|
||||
Subject: [PATCH] fix cmake paths
|
||||
|
||||
---
|
||||
cmake/nodConfig.cmake.in | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/cmake/nodConfig.cmake.in b/cmake/nodConfig.cmake.in
|
||||
index 0969382..2a24a88 100644
|
||||
--- a/cmake/nodConfig.cmake.in
|
||||
+++ b/cmake/nodConfig.cmake.in
|
||||
@@ -1,12 +1,12 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
-set(_nod_libdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
|
||||
-set(_nod_incdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
|
||||
+set(_nod_libdir "@CMAKE_INSTALL_FULL_LIBDIR@")
|
||||
+set(_nod_incdir "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
|
||||
if (NOT TARGET nod::nod_shared AND NOT TARGET nod::nod_static)
|
||||
# Shared library
|
||||
if (WIN32)
|
||||
- set(_nod_dll "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
+ set(_nod_dll "@CMAKE_INSTALL_FULL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
set(_nod_implib "${_nod_libdir}/${CMAKE_IMPORT_LIBRARY_PREFIX}nod${CMAKE_IMPORT_LIBRARY_SUFFIX}")
|
||||
if (EXISTS "${_nod_dll}")
|
||||
add_library(nod::nod_shared SHARED IMPORTED)
|
||||
--
|
||||
2.53.0
|
||||
|
||||
Generated
+3
-3
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1775710090,
|
||||
"narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
|
||||
"lastModified": 1778869304,
|
||||
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4c1018dae018162ec878d42fec712642d214fdfa",
|
||||
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -1,219 +1,392 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
outputs = { self, nixpkgs }:
|
||||
description = "Dusklight — native PC port of the Twilight Princess decompilation";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgsFor = system: import nixpkgs { inherit system; };
|
||||
forAllSystems = lib.genAttrs supportedSystems;
|
||||
|
||||
# Dependencies that are not packaged in nixpkgs (used by the Linux package build):
|
||||
buildSources = pkgs: {
|
||||
dawn-src = pkgs.fetchzip {
|
||||
url = "https://github.com/encounter/dawn-build/releases/download/v20260423.175430/dawn-linux-x86_64.tar.gz";
|
||||
hash = "sha256-HXfKTLHtMPwupnFnaflCARtXVPuS/0PoCePXidjE5xs=";
|
||||
stripRoot = false;
|
||||
dawnVersion = "v20260618.032059";
|
||||
nodVersion = "v2.0.0-alpha.10";
|
||||
versionSuffix = "nix-" + (self.shortRev or self.dirtyShortRev or "dirty");
|
||||
|
||||
dawnInfo = {
|
||||
"x86_64-linux" = {
|
||||
triple = "linux-x86_64";
|
||||
hash = "sha256-GFSd573b+VQx/VmFdNQgWDd0V9ayQlcw0Zuopke12ak=";
|
||||
};
|
||||
nod-src = pkgs.fetchzip {
|
||||
url = "https://github.com/encounter/nod/releases/download/v2.0.0-alpha.8/libnod-linux-x86_64.tar.gz";
|
||||
hash = "sha256-mUqvLsbsqaZ+HAjMmHYPYO+MgtanGRTw7Gzn5uXR5rE=";
|
||||
stripRoot = false;
|
||||
"aarch64-linux" = {
|
||||
triple = "linux-aarch64";
|
||||
hash = "sha256-ZaoP7BAjBMnfAv2/AMRi3FNH2ZtyqASCSFyU/oB2Mzg=";
|
||||
};
|
||||
# The version of imgui on nixpkgs does not map cleanly.
|
||||
imgui-src = pkgs.fetchFromGitHub {
|
||||
owner = "ocornut";
|
||||
repo = "imgui";
|
||||
rev = "v1.91.9b-docking";
|
||||
hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ=";
|
||||
"aarch64-darwin" = {
|
||||
triple = "darwin-arm64";
|
||||
hash = "sha256-HT+qtlLaSHyoXPrUcXgcTGa877X5YfzbxRD4bJb7i1Y=";
|
||||
};
|
||||
sqlite-src = pkgs.fetchzip {
|
||||
url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip";
|
||||
hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM=";
|
||||
};
|
||||
rmlui-src = pkgs.fetchzip {
|
||||
url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz";
|
||||
hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg=";
|
||||
"x86_64-darwin" = {
|
||||
triple = "darwin-x86_64";
|
||||
hash = "sha256-cUNaCbA7rlKSukDVKGaVEVw0Zt1+mSbaHbmUCMvMVWc=";
|
||||
};
|
||||
};
|
||||
|
||||
# Dusklight Actual (Linux x86_64 only — relies on prebuilt dawn/nod binaries)
|
||||
mkDusklight = pkgs:
|
||||
let srcs = buildSources pkgs;
|
||||
versionSuffix = if self ? shortRev && self.shortRev != null
|
||||
then "nix-${self.shortRev}"
|
||||
else "nix-dirty";
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "dusklight";
|
||||
src = ./.;
|
||||
postUnpack = ''
|
||||
sed -i '/add_subdirectory(tests)/d' $sourceRoot/extern/aurora/CMakeLists.txt
|
||||
'';
|
||||
# Remove last line to re-enable tests
|
||||
cmakeFlags = [
|
||||
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
|
||||
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_CXXOPTS=${pkgs.cxxopts.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT=${srcs.dawn-src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_XXHASH=${pkgs.xxHash.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_FMT=${pkgs.fmt.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_TRACY=${pkgs.tracy.src}"
|
||||
"-DAURORA_SDL3_PROVIDER=system"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_NOD_PREBUILT=${srcs.nod-src}"
|
||||
"-DAURORA_NOD_PROVIDER=package"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_FREETYPE=${pkgs.freetype.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_ZSTD=${pkgs.zstd.src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_SQLITE3=${srcs.sqlite-src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_IMGUI=${srcs.imgui-src}"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_RMLUI=${srcs.rmlui-src}"
|
||||
"-DCMAKE_CROSSCOMPILING=ON" # Tests are not working as I didn't want to work through getting google's test suite working as well. This is the only guard I could find to disable it.
|
||||
];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp dusklight $out/bin/dusklight
|
||||
cp -r ./res $out/bin/res
|
||||
nodPrebuiltInfo = {
|
||||
"x86_64-linux" = {
|
||||
triple = "linux-x86_64";
|
||||
hash = "sha256-FVQWECVA2gWdc+n5OQ/Tvwn8z0qdgjSd1WlFt5HKOec=";
|
||||
};
|
||||
"aarch64-darwin" = {
|
||||
triple = "macos-arm64";
|
||||
hash = "sha256-8ZEejxksVgShNKUVRCBYaLOp9x/qOC9pAeVrElQUGUk=";
|
||||
};
|
||||
};
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
cp $src/platforms/freedesktop/dusklight.desktop $out/share/applications/dusklight.desktop
|
||||
perSystem =
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
hasNodPrebuilt = nodPrebuiltInfo ? ${system};
|
||||
|
||||
for size in 16 32 48 64 128 256 512 1024; do
|
||||
install -Dm644 $src/platforms/freedesktop/''${size}x''${size}/apps/dusklight.png \
|
||||
$out/share/icons/hicolor/''${size}x''${size}/apps/dusklight.png
|
||||
done
|
||||
aurora = builtins.pathExists "${self}/extern/aurora/CMakeLists.txt";
|
||||
needSubmodules = ''
|
||||
dusklight: The aurora submodule is not vendored. Add submodules=1 to build.
|
||||
|
||||
As a flake input:
|
||||
|
||||
dusklight.url = "git+https://github.com/TwilitRealm/dusklight?ref=main&submodules=1";
|
||||
|
||||
nix command:
|
||||
|
||||
nix run 'git+https://github.com/TwilitRealm/dusklight?submodules=1'
|
||||
|
||||
Local checkout:
|
||||
|
||||
nix run '.?submodules=1#dusklight'
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
|
||||
dawn = pkgs.fetchzip {
|
||||
url = "https://github.com/encounter/dawn/releases/download/${dawnVersion}/dawn-${dawnInfo.${system}.triple}.tar.gz";
|
||||
hash = dawnInfo.${system}.hash;
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
corrosion = pkgs.fetchFromGitHub {
|
||||
owner = "corrosion-rs";
|
||||
repo = "corrosion";
|
||||
rev = "v0.6.1";
|
||||
hash = "sha256-ppuDNObfKhneD9AlnPAvyCRHKW3BidXKglD1j/LE9CM=";
|
||||
};
|
||||
|
||||
nodFromSource = pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "nod";
|
||||
version = nodVersion;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "encounter";
|
||||
repo = "nod";
|
||||
rev = nodVersion;
|
||||
hash = "sha256-r8qDlOVxv5iKiFjJQrcBuL9HVoOM3yEjRVnQIMqaICs=";
|
||||
};
|
||||
patches = [ ./fix-cmake-paths.patch ];
|
||||
cargoDeps = pkgs.rustPlatform.importCargoLock {
|
||||
lockFile = "${finalAttrs.src}/Cargo.lock";
|
||||
};
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-warn "add_subdirectory(nod-ffi/examples)" ""
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
pkgs.cmake
|
||||
pkgs.ninja
|
||||
pkgs.rustPlatform.cargoSetupHook
|
||||
pkgs.cargo
|
||||
pkgs.rustc
|
||||
];
|
||||
CARGO_NET_OFFLINE = "true";
|
||||
cmakeFlags = [
|
||||
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
|
||||
"-DFETCHCONTENT_SOURCE_DIR_CORROSION=${corrosion}"
|
||||
"-DNOD_ENABLE_INSTALL=ON"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
];
|
||||
doCheck = false;
|
||||
});
|
||||
|
||||
nod =
|
||||
if hasNodPrebuilt then
|
||||
pkgs.fetchzip {
|
||||
url = "https://github.com/encounter/nod/releases/download/${nodVersion}/libnod-${
|
||||
nodPrebuiltInfo.${system}.triple
|
||||
}.tar.gz";
|
||||
hash = nodPrebuiltInfo.${system}.hash;
|
||||
stripRoot = false;
|
||||
}
|
||||
else
|
||||
nodFromSource;
|
||||
|
||||
fetchContentDirs = {
|
||||
DAWN_PREBUILT = dawn;
|
||||
NOD_PREBUILT = nod;
|
||||
CXXOPTS = pkgs.cxxopts.src;
|
||||
JSON = pkgs.nlohmann_json.src;
|
||||
XXHASH = pkgs.xxhash.src;
|
||||
ZSTD = pkgs.zstd.src;
|
||||
FMT = pkgs.fetchzip {
|
||||
url = "https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz";
|
||||
hash = "sha256-ZmI1Dv0ZabPlxa02OpERI47jp7zFfjpeWCy1WyuPYZ0=";
|
||||
};
|
||||
TRACY = pkgs.fetchzip {
|
||||
url = "https://github.com/wolfpld/tracy/archive/6789e7d6f9a65ec98926b602097a33a9676d2606.tar.gz";
|
||||
hash = "sha256-Xxyd7G/mnXEPpN+ehmwl0AkAhS3CwObpJNDgcqbdUJg=";
|
||||
};
|
||||
IMGUI = pkgs.fetchFromGitHub {
|
||||
owner = "ocornut";
|
||||
repo = "imgui";
|
||||
rev = "v1.91.9b-docking";
|
||||
hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ=";
|
||||
};
|
||||
SQLITE3 = pkgs.fetchzip {
|
||||
url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip";
|
||||
hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM=";
|
||||
};
|
||||
RMLUI = pkgs.fetchzip {
|
||||
url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz";
|
||||
hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg=";
|
||||
};
|
||||
};
|
||||
|
||||
dusklight =
|
||||
if !aurora then
|
||||
throw needSubmodules
|
||||
else
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pname = "dusklight";
|
||||
version = versionSuffix;
|
||||
src = ./.;
|
||||
|
||||
postUnpack = ''
|
||||
chmod -R u+w "$sourceRoot"
|
||||
substituteInPlace "$sourceRoot/extern/aurora/CMakeLists.txt" \
|
||||
--replace-warn "add_subdirectory(tests)" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.cmake
|
||||
pkgs.ninja
|
||||
pkgs.pkg-config
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.markupsafe
|
||||
]
|
||||
++ lib.optionals (!isDarwin) [ pkgs.autoPatchelfHook ];
|
||||
|
||||
buildInputs = [
|
||||
pkgs.sdl3
|
||||
pkgs.freetype
|
||||
pkgs.zstd
|
||||
pkgs.cxxopts
|
||||
pkgs.nlohmann_json
|
||||
pkgs.xxhash
|
||||
pkgs.abseil-cpp
|
||||
pkgs.zlib
|
||||
pkgs.libpng
|
||||
pkgs.libjpeg_turbo
|
||||
pkgs.curl
|
||||
pkgs.openssl
|
||||
]
|
||||
++ lib.optionals isDarwin [
|
||||
pkgs.apple-sdk_15
|
||||
pkgs.libiconv
|
||||
]
|
||||
++ lib.optionals (!isDarwin) [
|
||||
pkgs.libGL
|
||||
pkgs.libGLU
|
||||
pkgs.libglvnd
|
||||
pkgs.vulkan-loader
|
||||
pkgs.libX11
|
||||
pkgs.libxcb
|
||||
pkgs.libXcursor
|
||||
pkgs.libxi
|
||||
pkgs.libxrandr
|
||||
pkgs.libxscrnsaver
|
||||
pkgs.libxtst
|
||||
pkgs.libxinerama
|
||||
pkgs.libxkbcommon
|
||||
pkgs.wayland
|
||||
pkgs.libdecor
|
||||
pkgs.alsa-lib
|
||||
pkgs.libpulseaudio
|
||||
pkgs.pipewire
|
||||
pkgs.dbus
|
||||
pkgs.udev
|
||||
pkgs.libusb1
|
||||
pkgs.libunwind
|
||||
pkgs.gtk3
|
||||
nod
|
||||
];
|
||||
|
||||
cmakeBuildType = "RelWithDebInfo";
|
||||
ninjaFlags = [ "dusklight" ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
|
||||
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
|
||||
"-DAURORA_DAWN_PROVIDER=package"
|
||||
"-DAURORA_DAWN_LINKAGE=static"
|
||||
"-DAURORA_NOD_PROVIDER=system"
|
||||
"-DAURORA_SDL3_PROVIDER=system"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
]
|
||||
++ lib.mapAttrsToList (key: src: "-DFETCHCONTENT_SOURCE_DIR_${key}=${src}") fetchContentDirs;
|
||||
|
||||
installPhase =
|
||||
if isDarwin then
|
||||
''
|
||||
runHook preInstall
|
||||
mkdir -p "$out/Applications"
|
||||
cp -r Dusklight.app "$out/Applications/Dusklight.app"
|
||||
runHook postInstall
|
||||
''
|
||||
else
|
||||
''
|
||||
runHook preInstall
|
||||
install -Dm755 dusklight "$out/bin/dusklight"
|
||||
cp -r "$src/res" "$out/bin/res"
|
||||
install -Dm644 "$src/platforms/freedesktop/dev.twilitrealm.dusk.desktop" \
|
||||
"$out/share/applications/dev.twilitrealm.dusk.desktop"
|
||||
for size in 16 32 48 64 128 256 512 1024; do
|
||||
install -Dm644 "$src/platforms/freedesktop/''${size}x''${size}/apps/dev.twilitrealm.dusk.png" \
|
||||
"$out/share/icons/hicolor/''${size}x''${size}/apps/dev.twilitrealm.dusk.png"
|
||||
done
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postFixup = lib.optionalString (!isDarwin) ''
|
||||
patchelf \
|
||||
--add-needed "${pkgs.vulkan-loader}/lib/libvulkan.so" \
|
||||
$out/bin/dusklight
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
description = "Dusklight — native PC port of the Twilight Princess decompilation";
|
||||
homepage = "https://github.com/zeldaret/tp";
|
||||
platforms = supportedSystems;
|
||||
mainProgram = "dusklight";
|
||||
};
|
||||
};
|
||||
|
||||
# Tooling common to every supported host (Linux and macOS).
|
||||
commonDevTools = [
|
||||
pkgs.cmake
|
||||
pkgs.ninja
|
||||
pkgs.pkg-config
|
||||
pkgs.wayland
|
||||
pkgs.git
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.markupsafe
|
||||
pkgs.rustc
|
||||
pkgs.cargo
|
||||
pkgs.sccache
|
||||
];
|
||||
buildInputs = [
|
||||
pkgs.libGL
|
||||
pkgs.libX11
|
||||
pkgs.libXcursor
|
||||
pkgs.libxi
|
||||
pkgs.libxcb
|
||||
pkgs.libxrandr
|
||||
pkgs.libxscrnsaver
|
||||
pkgs.libxtst
|
||||
pkgs.libjpeg8
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libglvnd
|
||||
|
||||
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml
|
||||
# so the cmake presets resolve the same set of headers as CI.
|
||||
linuxDevDeps = [
|
||||
# Compilers / linkers
|
||||
pkgs.clang
|
||||
pkgs.lld
|
||||
# C/C++ utilities
|
||||
pkgs.curl
|
||||
pkgs.openssl
|
||||
pkgs.zlib
|
||||
pkgs.libpng
|
||||
pkgs.libjpeg_turbo
|
||||
pkgs.freetype
|
||||
pkgs.zstd
|
||||
pkgs.fmt
|
||||
pkgs.tracy
|
||||
pkgs.cxxopts
|
||||
pkgs.abseil-cpp
|
||||
pkgs.sdl3
|
||||
pkgs.fmt
|
||||
pkgs.tracy
|
||||
pkgs.freetype
|
||||
pkgs.zstd
|
||||
pkgs.ncurses
|
||||
pkgs.libunwind
|
||||
pkgs.libusb1
|
||||
pkgs.fuse
|
||||
# Wayland / display server
|
||||
pkgs.wayland
|
||||
pkgs.wayland-protocols
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libdecor
|
||||
# OpenGL / Vulkan
|
||||
pkgs.libGL
|
||||
pkgs.libGLU
|
||||
pkgs.libglvnd
|
||||
pkgs.vulkan-headers
|
||||
pkgs.vulkan-loader
|
||||
# X11
|
||||
pkgs.libX11
|
||||
pkgs.libxcb
|
||||
pkgs.libXcursor
|
||||
pkgs.libxi
|
||||
pkgs.libxrandr
|
||||
pkgs.libxscrnsaver
|
||||
pkgs.libxtst
|
||||
pkgs.libxinerama
|
||||
# Audio
|
||||
pkgs.alsa-lib
|
||||
pkgs.libpulseaudio
|
||||
pkgs.pipewire
|
||||
# System integration
|
||||
pkgs.dbus
|
||||
pkgs.udev
|
||||
pkgs.gtk3
|
||||
];
|
||||
|
||||
# On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up
|
||||
# Apple Clang and the Xcode SDK directly, matching the macOS CI workflow.
|
||||
darwinShell = pkgs.mkShellNoCC {
|
||||
packages = commonDevTools;
|
||||
shellHook = ''
|
||||
echo "Dusklight dev shell (macOS)"
|
||||
echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK."
|
||||
echo "Configure: cmake --preset macos-default-relwithdebinfo"
|
||||
echo "Build: cmake --build --preset macos-default-relwithdebinfo"
|
||||
'';
|
||||
};
|
||||
|
||||
linuxShell = pkgs.mkShell {
|
||||
packages = commonDevTools ++ linuxDevDeps;
|
||||
shellHook = ''
|
||||
echo "Dusklight dev shell (Linux)"
|
||||
echo "Configure: cmake --preset linux-default-relwithdebinfo"
|
||||
echo " cmake --preset linux-clang-relwithdebinfo"
|
||||
echo "Build: cmake --build --preset <preset>"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = dusklight;
|
||||
dusklight = dusklight;
|
||||
}
|
||||
// lib.optionalAttrs (!hasNodPrebuilt) { nod = nodFromSource; };
|
||||
|
||||
devShells.default = if isDarwin then darwinShell else linuxShell;
|
||||
};
|
||||
|
||||
# Tooling common to every supported host (Linux and macOS).
|
||||
commonDevTools = pkgs: [
|
||||
pkgs.cmake
|
||||
pkgs.ninja
|
||||
pkgs.pkg-config
|
||||
pkgs.git
|
||||
pkgs.python3
|
||||
pkgs.python3Packages.markupsafe
|
||||
pkgs.rustc
|
||||
pkgs.cargo
|
||||
pkgs.sccache
|
||||
];
|
||||
|
||||
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml
|
||||
# so the cmake presets resolve the same set of headers as CI.
|
||||
linuxDevDeps = pkgs: [
|
||||
# Compilers / linkers
|
||||
pkgs.clang
|
||||
pkgs.lld
|
||||
# C/C++ utilities
|
||||
pkgs.curl
|
||||
pkgs.openssl
|
||||
pkgs.zlib
|
||||
pkgs.libpng
|
||||
pkgs.libjpeg_turbo
|
||||
pkgs.freetype
|
||||
pkgs.zstd
|
||||
pkgs.fmt
|
||||
pkgs.tracy
|
||||
pkgs.cxxopts
|
||||
pkgs.abseil-cpp
|
||||
pkgs.sdl3
|
||||
pkgs.ncurses
|
||||
pkgs.libunwind
|
||||
pkgs.libusb1
|
||||
pkgs.fuse
|
||||
# Wayland / display server
|
||||
pkgs.wayland
|
||||
pkgs.wayland-protocols
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libdecor
|
||||
# OpenGL / Vulkan
|
||||
pkgs.libGL
|
||||
pkgs.libGLU
|
||||
pkgs.libglvnd
|
||||
pkgs.vulkan-headers
|
||||
pkgs.vulkan-loader
|
||||
# X11
|
||||
pkgs.libX11
|
||||
pkgs.libxcb
|
||||
pkgs.libXcursor
|
||||
pkgs.libxi
|
||||
pkgs.libxrandr
|
||||
pkgs.libxscrnsaver
|
||||
pkgs.libxtst
|
||||
pkgs.libxinerama
|
||||
# Audio
|
||||
pkgs.alsa-lib
|
||||
pkgs.libpulseaudio
|
||||
pkgs.pipewire
|
||||
# System integration
|
||||
pkgs.dbus
|
||||
pkgs.udev
|
||||
pkgs.gtk3
|
||||
];
|
||||
|
||||
# On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up
|
||||
# Apple Clang and the Xcode SDK directly, matching the macOS CI workflow.
|
||||
mkDarwinShell = pkgs:
|
||||
pkgs.mkShellNoCC {
|
||||
packages = commonDevTools pkgs;
|
||||
shellHook = ''
|
||||
echo "Dusklight dev shell (macOS)"
|
||||
echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK."
|
||||
echo "Configure: cmake --preset macos-default-relwithdebinfo"
|
||||
echo "Build: cmake --build --preset macos-default-relwithdebinfo"
|
||||
'';
|
||||
};
|
||||
|
||||
mkLinuxShell = pkgs:
|
||||
pkgs.mkShell {
|
||||
packages = (commonDevTools pkgs) ++ (linuxDevDeps pkgs);
|
||||
shellHook = ''
|
||||
echo "Dusklight dev shell (Linux)"
|
||||
echo "Configure: cmake --preset linux-default-relwithdebinfo"
|
||||
echo " cmake --preset linux-clang-relwithdebinfo"
|
||||
echo "Build: cmake --build --preset <preset>"
|
||||
'';
|
||||
};
|
||||
|
||||
mkDevShell = pkgs:
|
||||
if pkgs.stdenv.isDarwin
|
||||
then mkDarwinShell pkgs
|
||||
else mkLinuxShell pkgs;
|
||||
in {
|
||||
packages.x86_64-linux.default = mkDusklight (pkgsFor "x86_64-linux");
|
||||
|
||||
devShells = forAllSystems (system: {
|
||||
default = mkDevShell (pkgsFor system);
|
||||
});
|
||||
systems = forAllSystems perSystem;
|
||||
in
|
||||
{
|
||||
packages = lib.mapAttrs (_: s: s.packages) systems;
|
||||
devShells = lib.mapAttrs (_: s: s.devShells) systems;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
/* 0x14 */ cM3dGAab mM3dGAab;
|
||||
/* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun;
|
||||
#if DEBUG
|
||||
#if PARTIAL_DEBUG || DEBUG
|
||||
/* 0x34 */ int field_0x34;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -98,7 +98,7 @@ T cLib_calcTimer(T* value) {
|
||||
void MtxInit(void);
|
||||
void MtxTrans(f32, f32, f32, u8);
|
||||
void MtxScale(f32, f32, f32, u8);
|
||||
void MtxPosition(cXyz*, cXyz*);
|
||||
void MtxPosition(cXyz DUSK_CONST*, cXyz*);
|
||||
void MtxPush(void);
|
||||
void MtxPull(void);
|
||||
|
||||
|
||||
@@ -45,17 +45,17 @@ struct cXyz : Vec {
|
||||
~cXyz() = default;
|
||||
cXyz(const cXyz& vec) = default;
|
||||
#endif
|
||||
cXyz(f32 x, f32 y, f32 z) {
|
||||
DUSK_CONSTEXPR cXyz(f32 x, f32 y, f32 z) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
cXyz(const Vec& vec) {
|
||||
DUSK_CONSTEXPR cXyz(const Vec& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
cXyz& operator=(const Vec& vec) {
|
||||
DUSK_CONSTEXPR cXyz& operator=(const Vec& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
/* 0x1370 */ Z2FxLineMgr mFxLineMgr;
|
||||
#if DEBUG
|
||||
/* 0x13BC */ Z2DebugSys mDebugSys;
|
||||
#elif PARTIAL_DEBUG
|
||||
alignas(Z2DebugSys) u8 mDebugSys[sizeof(Z2DebugSys)];
|
||||
#endif
|
||||
}; // Size: 0x138C
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
|
||||
JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; }
|
||||
|
||||
#if DEBUG
|
||||
#if PARTIAL_DEBUG || DEBUG
|
||||
f32 field_0x00_debug;
|
||||
u8 field_0x04_debug;
|
||||
#endif
|
||||
|
||||
@@ -100,13 +100,13 @@ public:
|
||||
bool isForceBattle() { return forceBattle_; }
|
||||
JSUList<Z2CreatureEnemy>* getEnemyList() { return &field_0x0; }
|
||||
|
||||
#if DEBUG
|
||||
#if PARTIAL_DEBUG || DEBUG
|
||||
JSUList<Z2SoundObjBase>* getAllList() { return &allList_; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
/* 0x00 */ JSUList<Z2CreatureEnemy> field_0x0;
|
||||
#if DEBUG
|
||||
#if PARTIAL_DEBUG || DEBUG
|
||||
/* 0x0C */ JSUList<Z2SoundObjBase> allList_;
|
||||
#endif
|
||||
/* 0x0C */ Z2EnemyArea enemyArea_;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
struct Z2SoundStarter;
|
||||
|
||||
class Z2SoundObjBase : public Z2SoundHandles
|
||||
#if DEBUG
|
||||
#if PARTIAL_DEBUG || DEBUG
|
||||
, public JSULink<Z2SoundObjBase>
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
|
||||
void menuIn();
|
||||
void menuOut();
|
||||
bool isMovieDemo();
|
||||
void setDemoName(char* demoName);
|
||||
void setDemoName(DUSK_CONST char* demoName);
|
||||
void processTime();
|
||||
bool checkDayTime();
|
||||
void setEventBit(void* eventBit);
|
||||
|
||||
@@ -88,6 +88,10 @@ public:
|
||||
/* 0x02C */ cXyz field_0x2c;
|
||||
/* 0x038 */ cXyz field_0x38[60];
|
||||
/* 0x308 */ cXyz field_0x308[60];
|
||||
#if TARGET_PC
|
||||
TGXTexObj mBlurTexObj;
|
||||
ResTIMG* mpCachedBlurTex = nullptr;
|
||||
#endif
|
||||
}; // Size = 0x5D8
|
||||
|
||||
class dAlink_bottleWaterPcallBack_c : public JPAParticleCallBack {
|
||||
@@ -4545,13 +4549,14 @@ public:
|
||||
/* 0x03840 */ cXyz* mIronBallChainPos;
|
||||
/* 0x03844 */ csXyz* mIronBallChainAngle;
|
||||
/* 0x03848 */ cXyz* field_0x3848;
|
||||
/* 0x0384C */ cXyz* field_0x384c;
|
||||
/* 0x0384C */ cXyz DUSK_CONST* field_0x384c;
|
||||
/* 0x03850 */ daAlink_procFunc mpProcFunc;
|
||||
|
||||
#if TARGET_PC
|
||||
void handleWolfHowl();
|
||||
void handleQuickTransform();
|
||||
bool checkGyroAimContext();
|
||||
bool checkAimContext();
|
||||
bool checkAimInputContext();
|
||||
|
||||
void onIronBallChainInterpCallback();
|
||||
|
||||
@@ -4564,6 +4569,19 @@ public:
|
||||
cXyz mIBChainInterpCurrHandRoot;
|
||||
bool mIBChainInterpPrevValid;
|
||||
bool mIBChainInterpCurrValid;
|
||||
|
||||
cXyz mHsChainInterpPrevTop;
|
||||
cXyz mHsChainInterpCurrTop;
|
||||
cXyz mHsChainInterpPrevRoot;
|
||||
cXyz mHsChainInterpCurrRoot;
|
||||
cXyz mHsChainInterpPrevSubRoot;
|
||||
cXyz mHsChainInterpCurrSubRoot;
|
||||
cXyz mHsChainInterpPrevSubTop;
|
||||
cXyz mHsChainInterpCurrSubTop;
|
||||
bool mHsChainInterpPrevValid;
|
||||
bool mHsChainInterpCurrValid;
|
||||
|
||||
bool mIsRollstab = false;
|
||||
#endif
|
||||
}; // Size: 0x385C
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ private:
|
||||
/* 0x0AAD */ bool mStayNo2Flag;
|
||||
/* 0x0AAE */ u8 mBlendStatus;
|
||||
/* 0x0AB0 */ f32 mBlend;
|
||||
/* 0x0AB4 */ char* mArcName;
|
||||
/* 0x0AB4 */ char DUSK_CONST* mArcName;
|
||||
/* 0x0AB8 */ dBgS_AcchCir mAcchCir;
|
||||
/* 0x0AF8 */ dBgS_ObjAcch mAcch;
|
||||
/* 0x0CD0 */ dBgS_AcchCir mAcchCirArr[16];
|
||||
|
||||
@@ -23,10 +23,10 @@ public:
|
||||
/* 3 */ ACT_END,
|
||||
};
|
||||
|
||||
char* getArcName();
|
||||
char* getBmd();
|
||||
char* getDzb();
|
||||
char* getBmd2();
|
||||
DUSK_CONST char* getArcName();
|
||||
DUSK_CONST char* getBmd();
|
||||
DUSK_CONST char* getDzb();
|
||||
DUSK_CONST char* getBmd2();
|
||||
J3DModelData* getDoorModelData();
|
||||
int CreateHeap();
|
||||
void calcMtx();
|
||||
|
||||
@@ -33,8 +33,8 @@ public:
|
||||
|
||||
typedef int (daBdoorL1_c::*actionFunc)();
|
||||
|
||||
char* getDoorEventName();
|
||||
char* getDoorEventName2();
|
||||
DUSK_CONST char* getDoorEventName();
|
||||
DUSK_CONST char* getDoorEventName2();
|
||||
const char* getArcName();
|
||||
const char* getAnmArcName();
|
||||
int getDoorType();
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
*/
|
||||
class daDbDoor00_c : public fopAc_ac_c {
|
||||
public:
|
||||
char* getAlwaysArcName();
|
||||
char* getDzb();
|
||||
char* getDummyBmdName();
|
||||
char* getBmdArcName();
|
||||
char* getBmdName();
|
||||
DUSK_CONST char* getAlwaysArcName();
|
||||
DUSK_CONST char* getDzb();
|
||||
DUSK_CONST char* getDummyBmdName();
|
||||
DUSK_CONST char* getBmdArcName();
|
||||
DUSK_CONST char* getBmdName();
|
||||
J3DModelData* getDoorModelData();
|
||||
int CreateHeap();
|
||||
void calcMtx();
|
||||
|
||||
@@ -29,11 +29,11 @@ public:
|
||||
|
||||
typedef int (daKnob20_c::*actionFunc)();
|
||||
|
||||
char* getAlwaysArcName();
|
||||
char* getEvArcName();
|
||||
char* getDzb();
|
||||
char* getDummyBmd();
|
||||
char* getBmd();
|
||||
DUSK_CONST char* getAlwaysArcName();
|
||||
DUSK_CONST char* getEvArcName();
|
||||
DUSK_CONST char* getDzb();
|
||||
DUSK_CONST char* getDummyBmd();
|
||||
DUSK_CONST char* getBmd();
|
||||
J3DModelData* getDoorModelData();
|
||||
int CreateHeap();
|
||||
void calcMtx();
|
||||
|
||||
@@ -54,15 +54,15 @@ public:
|
||||
|
||||
typedef int (daMBdoorL1_c::*actionFunc)();
|
||||
|
||||
char* getAnmArcName();
|
||||
char* getArcName();
|
||||
char* getAlwaysArcName();
|
||||
DUSK_CONST char* getAnmArcName();
|
||||
DUSK_CONST char* getArcName();
|
||||
DUSK_CONST char* getAlwaysArcName();
|
||||
int getDoorType();
|
||||
char* getOpenAnm();
|
||||
char* getCloseAnm();
|
||||
char* getBmd();
|
||||
char* getBtk();
|
||||
char* getDzb();
|
||||
DUSK_CONST char* getOpenAnm();
|
||||
DUSK_CONST char* getCloseAnm();
|
||||
DUSK_CONST char* getBmd();
|
||||
DUSK_CONST char* getBtk();
|
||||
DUSK_CONST char* getDzb();
|
||||
J3DModelData* getDoorModelData();
|
||||
int CreateHeap();
|
||||
void calcMtx();
|
||||
|
||||
@@ -45,12 +45,12 @@ public:
|
||||
ACTION_DEMO,
|
||||
};
|
||||
|
||||
char* getStopBmdName();
|
||||
char DUSK_CONST* getStopBmdName();
|
||||
J3DModelData* getStopModelData();
|
||||
char* getAlwaysArcName();
|
||||
char* getArcName();
|
||||
char* getBmdName();
|
||||
char* getBtk();
|
||||
char DUSK_CONST* getAlwaysArcName();
|
||||
char DUSK_CONST* getArcName();
|
||||
char DUSK_CONST* getBmdName();
|
||||
char DUSK_CONST* getBtk();
|
||||
J3DModelData* getModelData();
|
||||
f32 getSize2X();
|
||||
int CreateHeap();
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
int chkStopOpen();
|
||||
int chkMakeKey();
|
||||
|
||||
virtual char* getDzbName();
|
||||
virtual char DUSK_CONST* getDzbName();
|
||||
virtual int getDemoAction();
|
||||
|
||||
void onFlag(u16 flag) { field_0x68e |= flag; }
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
/* 0x5B4 */ J3DModel* mpModel;
|
||||
/* 0x5B8 */ u8 mArrowType;
|
||||
/* 0x5B9 */ u8 mFlags;
|
||||
/* 0x5BC */ char* mResName;
|
||||
/* 0x5BC */ char DUSK_CONST* mResName;
|
||||
/* 0x5C0 */ s16 field_0x5c0;
|
||||
/* 0x5C2 */ s16 mAction;
|
||||
/* 0x5C4 */ s16 mMode;
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
/* 0x5B5 */ u8 mDistanceParam;
|
||||
/* 0x5B6 */ u8 mType;
|
||||
/* 0x5B7 */ u8 mPathIndex;
|
||||
/* 0x5B8 */ char* mArcName;
|
||||
/* 0x5B8 */ DUSK_CONST char* mArcName;
|
||||
/* 0x5BC */ u8 field_0x5bc;
|
||||
/* 0x5BD */ s8 mPathPoint;
|
||||
/* 0x5BE */ s8 mPathStep;
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
/* 0x05CC */ s16 target_ya;
|
||||
/* 0x05D0 */ mDoExt_McaMorfSO* anm_p;
|
||||
/* 0x05D4 */ Z2CreatureEnemy sound;
|
||||
/* 0x0678 */ char* resName;
|
||||
/* 0x0678 */ DUSK_CONST char* resName;
|
||||
/* 0x067C */ int anm;
|
||||
/* 0x0680 */ int field_0x680;
|
||||
/* 0x0684 */ dJntCol_c mJntCol;
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
/* 0x05C8 */ s16 mTargetAngleY;
|
||||
/* 0x05CC */ mDoExt_McaMorfSO* mpMorf;
|
||||
/* 0x05D0 */ Z2CreatureEnemy mSound;
|
||||
/* 0x0674 */ char* mpArcName;
|
||||
/* 0x0674 */ char DUSK_CONST* mpArcName;
|
||||
/* 0x0678 */ int mAnm;
|
||||
/* 0x067C */ u8 field_0x67c[0x680 - 0x67c];
|
||||
/* 0x0680 */ dJntCol_c mJntCol;
|
||||
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
/* 0x6D4 */ f32 field_0x6d4;
|
||||
/* 0x6D8 */ s16 mFootJoints[4];
|
||||
/* 0x6E0 */ s16 field_0x6e0;
|
||||
/* 0x6E4 */ char* mpResName;
|
||||
/* 0x6E4 */ char DUSK_CONST* mpResName;
|
||||
/* 0x6E8 */ u16 mDamageCooldownTimer;
|
||||
/* 0x6EA */ u8 mGenericTimer;
|
||||
/* 0x6EC */ int mAttackTimer;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
/* 0x0000 */ fopEn_enemy_c enemy; ///< @brief Base enemy class instance.
|
||||
/* 0x05AC */ request_of_phase_process_class phase; ///< @brief Phase process request handler.
|
||||
/* 0x05B4 */ s16 ride_mode; ///< @brief Current sub-action mode within the run action.
|
||||
/* 0x05B8 */ char* resName; ///< @brief Resource name for loading models/animations.
|
||||
/* 0x05B8 */ char DUSK_CONST* resName; ///< @brief Resource name for loading models/animations.
|
||||
/* 0x05BC */ u8 arg0; ///< @brief Creation parameter 1.
|
||||
/* 0x05BD */ u8 arg1; ///< @brief Creation parameter 2.
|
||||
/* 0x05BE */ u8 field_0x5be;
|
||||
|
||||
@@ -213,8 +213,8 @@ private:
|
||||
/* 0x750 */ int field_0x750;
|
||||
/* 0x754 */ int field_0x754;
|
||||
/* 0x758 */ int field_0x758;
|
||||
/* 0x75C */ char* mArcName;
|
||||
/* 0x760 */ char* mDemoName;
|
||||
/* 0x75C */ DUSK_CONST char* mArcName;
|
||||
/* 0x760 */ DUSK_CONST char* mDemoName;
|
||||
/* 0x764 */ u32 mShadowId;
|
||||
/* 0x768 */ dPath* mpPath1;
|
||||
/* 0x76C */ dPath* mpPath2;
|
||||
|
||||
@@ -88,9 +88,14 @@ public:
|
||||
/* 0x396A */ u8 field_0x396A[0x399E - 0x396A];
|
||||
/* 0x399E */ s16 field_0x399e;
|
||||
/* 0x39A0 */ u8 field_0x39A0[0x39A4 - 0x39A0];
|
||||
|
||||
#if TARGET_PC
|
||||
/* 0x39A4 */ cM_rnd_c mMantRng;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
STATIC_ASSERT(sizeof(mant_class) == 0x39ac);
|
||||
#else
|
||||
STATIC_ASSERT(sizeof(mant_class) == 0x39a4);
|
||||
#endif
|
||||
|
||||
#endif /* D_A_MANT_H */
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
/* 0x5F4 */ s16 mYawToPlayer;
|
||||
/* 0x5F6 */ s16 field_0x5f6;
|
||||
/* 0x5F8 */ s16 field_0x5f8;
|
||||
/* 0x5FC */ char* mResName;
|
||||
/* 0x5FC */ DUSK_CONST char* mResName;
|
||||
/* 0x600 */ mDoExt_McaMorf* mpMorf;
|
||||
/* 0x604 */ J3DAnmTransform* mAnmTransform;
|
||||
/* 0x608 */ u32 mShadowId;
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
/* 0x0000 */ fopAc_ac_c actor;
|
||||
/* 0x0568 */ request_of_phase_process_class phase;
|
||||
/* 0x0570 */ char* arcname;
|
||||
/* 0x0570 */ DUSK_CONST char* arcname;
|
||||
/* 0x0574 */ u8 arg0;
|
||||
/* 0x0575 */ u8 arg1;
|
||||
/* 0x0576 */ u8 arg2;
|
||||
@@ -299,8 +299,13 @@ public:
|
||||
/* 0x168C */ u8 field_0x168c;
|
||||
/* 0x168D */ u8 field_0x168d;
|
||||
/* 0x168E */ u8 HIOInit;
|
||||
|
||||
#if TARGET_PC
|
||||
cXyz mLineInterpPrev[MG_ROD_LURE_LINE_LEN];
|
||||
cXyz mLineInterpCurr[MG_ROD_LURE_LINE_LEN];
|
||||
bool mLineInterpPrevValid;
|
||||
bool mLineInterpCurrValid;
|
||||
#endif
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(dmg_rod_class) == 0x1690);
|
||||
|
||||
#endif /* D_A_MG_ROD_H */
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <thp.h>
|
||||
#else
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#endif
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "d/d_drawlist.h"
|
||||
@@ -125,6 +126,7 @@ struct daMP_THPPlayer {
|
||||
/* 0x0D4 */ s32 curCount;
|
||||
#if TARGET_PC
|
||||
/* 0x0D8 */ std::atomic<s32> videoDecodeCount;
|
||||
std::chrono::steady_clock::time_point thpPlaybackClock;
|
||||
#else
|
||||
/* 0x0D8 */ s32 videoDecodeCount;
|
||||
#endif
|
||||
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
void animePlay();
|
||||
int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int);
|
||||
void setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int);
|
||||
J3DAnmTransformKey* getTrnsfrmKeyAnm(char*);
|
||||
J3DAnmTexPattern* getTexPtrnAnm(char*);
|
||||
J3DAnmTransformKey* getTrnsfrmKeyAnm(DUSK_CONST char*);
|
||||
J3DAnmTexPattern* getTexPtrnAnm(DUSK_CONST char*);
|
||||
int checkEndAnm(J3DFrameCtrl*);
|
||||
int checkEndAnm(f32);
|
||||
u8 getItemNumMax();
|
||||
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
/* 0x568 */ daNpcT_faceMotionAnmData_c const* mpFaceMotionAnmData;
|
||||
/* 0x56C */ daNpcT_motionAnmData_c const* mpMotionAnmData;
|
||||
/* 0x570 */ daNpcT_evtData_c const* mpEvtData;
|
||||
/* 0x574 */ char** mpArcNames;
|
||||
/* 0x574 */ DUSK_CONST char* DUSK_CONST* mpArcNames;
|
||||
/* 0x578 */ mDoExt_McaMorfSO* mpMorf[2];
|
||||
/* 0x580 */ Z2Creature mSound;
|
||||
/* 0x610 */ mDoExt_bckAnm mBckAnm;
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, DUSK_CONST char* DUSK_CONST* i_arcNames)
|
||||
:
|
||||
mpFaceMotionAnmData(i_faceMotionAnmData),
|
||||
mpMotionAnmData(i_motionAnmData),
|
||||
@@ -654,8 +654,8 @@ public:
|
||||
int setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int);
|
||||
int setBrkAnm(J3DAnmTevRegKey*, J3DModelData*, f32, int);
|
||||
int setBpkAnm(J3DAnmColor*, J3DModelData*, f32, int);
|
||||
int loadRes(s8 const*, char const**);
|
||||
void deleteRes(s8 const*, char const**);
|
||||
int loadRes(s8 const*, char const* DUSK_CONST*);
|
||||
void deleteRes(s8 const*, char const* DUSK_CONST*);
|
||||
int execute();
|
||||
int draw(BOOL, BOOL, f32, GXColorS10*, f32, BOOL, BOOL, BOOL);
|
||||
void setEnvTevColor();
|
||||
|
||||
@@ -86,12 +86,12 @@ public:
|
||||
class daBaseNpc_c : public fopAc_ac_c {
|
||||
public:
|
||||
daBaseNpc_c();
|
||||
J3DAnmTransform* getTrnsfrmKeyAnmP(char*, int);
|
||||
J3DAnmTransform* getTrnsfrmKeyAnmP(char DUSK_CONST*, int);
|
||||
int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int);
|
||||
int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool);
|
||||
J3DAnmTransform* getTexPtrnAnmP(char*, int);
|
||||
J3DAnmTransform* getTexPtrnAnmP(char DUSK_CONST*, int);
|
||||
int setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int);
|
||||
void orderEvent(int, char*);
|
||||
void orderEvent(int, char DUSK_CONST*);
|
||||
void setEnvTevColor();
|
||||
void setRoomNo();
|
||||
int checkEndAnm(f32);
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
/* 0x808 */ mDoExt_btpAnm mBtp;
|
||||
/* 0x820 */ mDoExt_btkAnm mBtk;
|
||||
/* 0x838 */ s16 field_0x838;
|
||||
/* 0x83C */ u16* field_0x83c;
|
||||
/* 0x83C */ u16 DUSK_CONST* field_0x83c;
|
||||
/* 0x840 */ u16 field_0x840;
|
||||
/* 0x842 */ u16 field_0x842;
|
||||
/* 0x844 */ u8 field_0x844;
|
||||
|
||||
@@ -311,10 +311,10 @@ public:
|
||||
static void* srchActor(void*, void*);
|
||||
|
||||
void initialize();
|
||||
J3DAnmTransformKey* getTrnsfrmKeyAnmP(char*, int);
|
||||
J3DAnmTexPattern* getTexPtrnAnmP(char*, int);
|
||||
J3DAnmTextureSRTKey* getTexSRTKeyAnmP(char*, int);
|
||||
J3DAnmTevRegKey* getTevRegKeyAnmP(char*, int);
|
||||
J3DAnmTransformKey* getTrnsfrmKeyAnmP(DUSK_CONST char*, int);
|
||||
J3DAnmTexPattern* getTexPtrnAnmP(DUSK_CONST char*, int);
|
||||
J3DAnmTextureSRTKey* getTexSRTKeyAnmP(DUSK_CONST char*, int);
|
||||
J3DAnmTevRegKey* getTevRegKeyAnmP(DUSK_CONST char*, int);
|
||||
BOOL setMcaMorfAnm(J3DAnmTransformKey* i_anm, f32 i_rate, f32 i_morf, int i_attr,
|
||||
int i_start, int i_end);
|
||||
BOOL setBckAnm(J3DAnmTransform* i_bck, f32 i_rate, int i_attr, int i_start,
|
||||
@@ -336,8 +336,8 @@ public:
|
||||
BOOL hitChk2(dCcD_Cyl*, BOOL, BOOL);
|
||||
void setDamage(int, int, int);
|
||||
int ctrlMsgAnm(int&, int&, fopAc_ac_c*, BOOL);
|
||||
void orderEvent(int, char*, u16, u16, u8, u16);
|
||||
void changeEvent(char*, char*, u16, u16);
|
||||
void orderEvent(int, DUSK_CONST char*, u16, u16, u8, u16);
|
||||
void changeEvent(DUSK_CONST char*, DUSK_CONST char*, u16, u16);
|
||||
BOOL chkActorInSight(fopAc_ac_c*, f32);
|
||||
BOOL chkActorInArea(fopAc_ac_c*, cXyz, cXyz, s16);
|
||||
BOOL chkActorInAttnArea(fopAc_ac_c*, fopAc_ac_c*, int);
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -171,8 +171,8 @@ public:
|
||||
u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
|
||||
void setLastIn() { mLastGoatIn = true; }
|
||||
|
||||
static char* mCutNameList[7];
|
||||
static cutFunc mCutList[7];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[7];
|
||||
static cutFunc DUSK_CONST mCutList[7];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_ARU_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
inline bool step(s16, int, f32);
|
||||
inline void playExpression();
|
||||
|
||||
static EventFn mEvtSeqList[2];
|
||||
static EventFn DUSK_CONST mEvtSeqList[2];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mCreatureSound;
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -117,8 +117,8 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static char* mCutNameList[4];
|
||||
static cutFunc mCutList[4];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[4];
|
||||
static cutFunc DUSK_CONST mCutList[4];
|
||||
|
||||
/* 0x0F7C */ mDoExt_McaMorfSO* mpScoopMorf;
|
||||
/* 0x0F80 */ NPC_BANS_HIO_CLASS* mHIO;
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -140,8 +140,8 @@ public:
|
||||
u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; }
|
||||
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; }
|
||||
|
||||
static char* mCutNameList[15];
|
||||
static cutFunc mCutList[15];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[15];
|
||||
static cutFunc DUSK_CONST mCutList[15];
|
||||
|
||||
private:
|
||||
/* 0x0E40 */ mDoExt_McaMorfSO* mpCupModelMorf;
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
return var_r30;
|
||||
}
|
||||
|
||||
static EventFn mEvtSeqList[];
|
||||
static EventFn DUSK_CONST mEvtSeqList[];
|
||||
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
/* 0xBD8 */ u8 field_0xBD8[0xBDC - 0xBD8];
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
daNpc_Bou_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
|
||||
daNpcT_evtData_c const* param_7, char** param_8)
|
||||
daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8)
|
||||
:
|
||||
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
|
||||
{}
|
||||
@@ -114,8 +114,8 @@ public:
|
||||
virtual int drawDbgInfo();
|
||||
virtual void changeAnm(int*, int*);
|
||||
|
||||
static char* mCutNameList[9];
|
||||
static cutFunc mCutList[9];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[9];
|
||||
static cutFunc DUSK_CONST mCutList[9];
|
||||
|
||||
int getFlowNodeNo() {
|
||||
u16 nodeNo = home.angle.x;
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
void setFear() { mFear = true; }
|
||||
void setTalkFlag() { mTalkFlag = true; }
|
||||
|
||||
static eventFunc mEvtSeqList[1];
|
||||
static eventFunc DUSK_CONST mEvtSeqList[1];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2CreatureCitizen mSound;
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -124,8 +124,8 @@ public:
|
||||
|
||||
u8 getMaxNumItem() { return (fopAcM_GetParam(this) & 0xF000000) >> 24; }
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0x0F7C */ NPC_CLERKA_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -137,8 +137,8 @@ public:
|
||||
|
||||
u8 getMaxNumItem() { return (fopAcM_GetParam(this) & 0xF000000) >> 24; }
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0x0F7C */ mDoExt_bpkAnm mBpkAnm2;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -125,8 +125,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0x0F7C */ NPC_CLERKT_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames)
|
||||
@@ -133,8 +133,8 @@ public:
|
||||
return (fopAcM_GetParam(this) & 0xFF00) >> 8;
|
||||
}
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_DOC_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
inline int getTimeHour();
|
||||
inline bool isDummyTalk();
|
||||
|
||||
static EventFn mEvtSeqList[1];
|
||||
static EventFn DUSK_CONST mEvtSeqList[1];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2CreatureCitizen mSound;
|
||||
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -294,8 +294,8 @@ public:
|
||||
u8 getSceneNo1() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
|
||||
u8 getSceneNo2() { return (fopAcM_GetParam(this) >> 16) & 0xFF; }
|
||||
|
||||
static char* mCutNameList[18];
|
||||
static cutFunc mCutList[18];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[18];
|
||||
static cutFunc DUSK_CONST mCutList[18];
|
||||
private:
|
||||
/* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO;
|
||||
/* 0x0E44 */ dCcD_Cyl mCyl;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3,
|
||||
int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5,
|
||||
int param_6, daNpcT_evtData_c const* param_7, char** param_8)
|
||||
int param_6, daNpcT_evtData_c const* param_7, DUSK_CONST char* DUSK_CONST* param_8)
|
||||
: daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {}
|
||||
|
||||
u8 getType() { return fopAcM_GetParam(this) & 0xFF; }
|
||||
@@ -90,8 +90,8 @@ public:
|
||||
|
||||
int getSeneNo() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static DUSK_CONST char* mCutNameList[1];
|
||||
static DUSK_CONST cutFunc mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_FAIRY_SEIREI_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -96,8 +96,8 @@ public:
|
||||
s32 getNeckJointNo() { return 3; }
|
||||
s32 getBackboneJointNo() { return 1; }
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_GND_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -138,9 +138,9 @@ public:
|
||||
void addCarryNum() { field_0x1692++; }
|
||||
u8 getPathNoFromParam() { return home.angle.z; }
|
||||
void setGateWalk() { field_0x14D0 = 1; }
|
||||
static char* mEvtCutNameList[12];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[12];
|
||||
typedef BOOL (daNpc_grA_c::*cut_type)(int);
|
||||
static cut_type mEvtCutList[];
|
||||
static cut_type DUSK_CONST mEvtCutList[];
|
||||
|
||||
private:
|
||||
typedef BOOL (daNpc_grA_c::*daNpc_grA_c_Action)(void*);
|
||||
|
||||
@@ -89,8 +89,8 @@ public:
|
||||
void setPrtcl();
|
||||
void adjustShapeAngle() {}
|
||||
|
||||
static char* mEvtCutNameList;
|
||||
static EventFn mEvtCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList;
|
||||
static EventFn DUSK_CONST mEvtCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -81,8 +81,8 @@ public:
|
||||
BOOL ECut_nodToGrz(int);
|
||||
void adjustShapeAngle() {}
|
||||
|
||||
static char* mEvtCutNameList[2];
|
||||
static cutFunc mEvtCutList[2];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[2];
|
||||
static cutFunc DUSK_CONST mEvtCutList[2];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -131,8 +131,8 @@ public:
|
||||
BOOL checkChangeJoint(int param_0) { return param_0 == JNT_HEAD; }
|
||||
BOOL checkRemoveJoint(int param_0) { return param_0 == JNT_MOUTH; }
|
||||
|
||||
static char* mCutNameList[2];
|
||||
static cutFunc mCutList[2];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[2];
|
||||
static cutFunc DUSK_CONST mCutList[2];
|
||||
|
||||
private:
|
||||
/* 0x0F7C */ NPC_GRM_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -124,8 +124,8 @@ public:
|
||||
BOOL checkRemoveJoint(int param_1) { return param_1 == JNT_MOUTH; }
|
||||
u16 getEyeballMaterialNo() { return 1; };
|
||||
|
||||
static char* mCutNameList;
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList;
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0x0F7C */ NPC_GRMC_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
int test(void*);
|
||||
void adjustShapeAngle() {}
|
||||
|
||||
static char* mEvtCutNameList[3];
|
||||
static cutFunc mEvtCutList[3];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[3];
|
||||
static cutFunc DUSK_CONST mEvtCutList[3];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -83,8 +83,8 @@ public:
|
||||
int test(void*);
|
||||
void adjustShapeAngle() {}
|
||||
|
||||
static char* mEvtCutNameList;
|
||||
static cutFunc mEvtCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList;
|
||||
static cutFunc DUSK_CONST mEvtCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -84,8 +84,8 @@ public:
|
||||
void setPrtcl();
|
||||
void adjustShapeAngle() {}
|
||||
|
||||
static char* mEvtCutNameList[2];
|
||||
static cutFunc mEvtCutList[2];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[2];
|
||||
static cutFunc DUSK_CONST mEvtCutList[2];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -116,8 +116,8 @@ public:
|
||||
|
||||
u8 getPathNoFromParam() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
|
||||
|
||||
static char* mEvtCutNameList[7];
|
||||
static cutFunc mEvtCutList[7];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[7];
|
||||
static cutFunc DUSK_CONST mEvtCutList[7];
|
||||
|
||||
private:
|
||||
/* 0x0B48 */ Z2Creature mSound;
|
||||
|
||||
@@ -104,8 +104,8 @@ public:
|
||||
void setHowlingEndFlag() { field_0xe1c = 2; }
|
||||
void setHowlingFlag() { field_0xe1c = 1; }
|
||||
|
||||
static char* mEvtCutNameList[5];
|
||||
static cutFunc mEvtCutList[5];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[5];
|
||||
static cutFunc DUSK_CONST mEvtCutList[5];
|
||||
|
||||
private:
|
||||
/* 0xB48 */ Z2Creature mSound;
|
||||
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
daNpc_Hanjo_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
|
||||
daNpcT_evtData_c const* param_7, char** param_8) :
|
||||
daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) :
|
||||
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
|
||||
{}
|
||||
u16 getEyeballMaterialNo() { return 2; }
|
||||
@@ -218,9 +218,9 @@ public:
|
||||
u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; }
|
||||
|
||||
static dCcD_SrcGObjInf const mStoneCcDObjInfo;
|
||||
static char* mCutNameList[6];
|
||||
static cutFunc mCutList[6];
|
||||
static dCcD_SrcSph mStoneCcDSph;
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[6];
|
||||
static cutFunc DUSK_CONST mCutList[6];
|
||||
static dCcD_SrcSph DUSK_CONST mStoneCcDSph;
|
||||
private:
|
||||
/* 0x0E40 */ NPC_HANJO_HIO_CLASS* mpHIO;
|
||||
/* 0x0E44 */ J3DModel* mModel1;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames)
|
||||
@@ -125,8 +125,8 @@ public:
|
||||
bool getGameStartFlag() { return mGameStartFlag; }
|
||||
void setPotBreakFlag() { mPotBreakFlag = true; }
|
||||
|
||||
static char* mCutNameList[8];
|
||||
static cutFunc mCutList[];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[8];
|
||||
static cutFunc DUSK_CONST mCutList[];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_HOZ_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
daNpc_Jagar_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
|
||||
daNpcT_evtData_c const* param_7, char** param_8) :
|
||||
daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) :
|
||||
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8)
|
||||
{}
|
||||
u16 getEyeballMaterialNo() { return MAT_JAGA_EYEBALL; }
|
||||
@@ -223,8 +223,8 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char* mCutNameList[7];
|
||||
static cutFunc mCutList[7];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[7];
|
||||
static cutFunc DUSK_CONST mCutList[7];
|
||||
private:
|
||||
/* 0x0E40 */ NPC_JAGAR_HIO_CLASS* mpHIO;
|
||||
/* 0x0E44 */ dCcD_Cyl mCyl1;
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames)
|
||||
@@ -113,8 +113,8 @@ public:
|
||||
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
|
||||
u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xFF0000) >> 16; }
|
||||
|
||||
static char* mCutNameList[4];
|
||||
static int (daNpc_Kakashi_c::*mCutList[])(int);
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[4];
|
||||
static int (daNpc_Kakashi_c::* DUSK_CONST mCutList[])(int);
|
||||
|
||||
private:
|
||||
/* 0x0E40 */ NPC_KAKASHI_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
void chgWeightLight() { mCcStts.SetWeight(0xD8); }
|
||||
BOOL pl_front_check() { return actor_front_check(daPy_getPlayerActorClass()); }
|
||||
|
||||
static EventFn mEvtSeqList[1];
|
||||
static EventFn DUSK_CONST mEvtSeqList[1];
|
||||
static daTagEscape_c* mTargetTag;
|
||||
static f32 mTargetTagDist;
|
||||
static s16 mWolfAngle;
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
void chgWeightLight() { mCcStts.SetWeight(0xD8); }
|
||||
BOOL pl_front_check() { return actor_front_check(daPy_getPlayerActorClass()); }
|
||||
|
||||
static EventFn mEvtSeqList[1];
|
||||
static EventFn DUSK_CONST mEvtSeqList[1];
|
||||
static daTagEscape_c* mTargetTag;
|
||||
static f32 mTargetTagDist;
|
||||
static s16 mWolfAngle;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames)
|
||||
@@ -118,8 +118,8 @@ public:
|
||||
return mpMorf[0]->getModel()->getAnmMtx(5);
|
||||
}
|
||||
|
||||
static char* mCutNameList[3];
|
||||
static int (daNpc_Kkri_c::*mCutList[])(int);
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[3];
|
||||
static int (daNpc_Kkri_c::* DUSK_CONST mCutList[])(int);
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_KKRI_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
/* 0x05AC */ const daNpcT_faceMotionAnmData_c* mpFaceMotionAnmData;
|
||||
/* 0x05B0 */ const daNpcT_motionAnmData_c* mpMotionAnmData;
|
||||
/* 0x05B4 */ const daNpcT_evtData_c* mpEventData;
|
||||
/* 0x05B8 */ char** mpArcNames;
|
||||
/* 0x05B8 */ char DUSK_CONST* DUSK_CONST* mpArcNames;
|
||||
/* 0x05BC */ mDoExt_McaMorfSO* mpModelMorf[2];
|
||||
/* 0x05C4 */ Z2Creature mSound;
|
||||
/* 0x0654 */ mDoExt_bckAnm mBckAnm;
|
||||
@@ -322,8 +322,8 @@ public:
|
||||
int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int);
|
||||
BOOL setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int);
|
||||
BOOL setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int);
|
||||
int loadRes(s8 const*, char const**);
|
||||
void deleteRes(s8 const*, char const**);
|
||||
int loadRes(s8 const*, char const* DUSK_CONST*);
|
||||
void deleteRes(s8 const*, char const* DUSK_CONST*);
|
||||
int execute();
|
||||
int draw(int, int, f32, GXColorS10*, f32, int, int, int);
|
||||
void setEnvTevColor();
|
||||
@@ -355,7 +355,7 @@ public:
|
||||
daNpcT_motionAnmData_c const* param_1,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_2, int param_3,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_4, int param_5,
|
||||
daNpcT_evtData_c const* param_6, char** param_7)
|
||||
daNpcT_evtData_c const* param_6, char DUSK_CONST* DUSK_CONST* param_7)
|
||||
: mpFaceMotionAnmData(param_0), mpMotionAnmData(param_1), mFaceMotionSeqMngr(param_2, param_3),
|
||||
mMotionSeqMngr(param_4, param_5), mpEventData(param_6), mpArcNames(param_7)
|
||||
{
|
||||
@@ -413,8 +413,8 @@ public:
|
||||
virtual bool afterSetMotionAnm(int, int, f32, int);
|
||||
|
||||
static const dCcD_SrcGObjInf mCcDObjData;
|
||||
static char* mCutNameList[21];
|
||||
static cutFunc mCutList[21];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[21];
|
||||
static cutFunc DUSK_CONST mCutList[21];
|
||||
static dCcD_SrcCyl mCcDCyl;
|
||||
static dCcD_SrcSph mCcDSph;
|
||||
static s16 mSrchName;
|
||||
|
||||
@@ -75,13 +75,13 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
|
||||
static char* mCutNameList[1];
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[1];
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_KNJ_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -120,8 +120,8 @@ public:
|
||||
virtual void changeAnm(int*, int*);
|
||||
virtual void changeBck(int*, int*);
|
||||
|
||||
static char* mCutNameList[11];
|
||||
static cutFunc mCutList[11];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[11];
|
||||
static cutFunc DUSK_CONST mCutList[11];
|
||||
|
||||
u32 getFlowNodeNo() {
|
||||
u16 nodeNo = home.angle.x;
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -150,8 +150,8 @@ public:
|
||||
s32 getBackboneJointNo() { return mType == 2 ? ZRCB_JNT_BACKBONE1 : KOLINB_JNT_BACKBONE1; }
|
||||
s32 getNeckJointNo() { return mType == 2 ? ZRCB_JNT_NECK : KOLINB_JNT_NECK; }
|
||||
|
||||
static char* mCutNameList[7];
|
||||
static cutFunc mCutList[7];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[7];
|
||||
static cutFunc DUSK_CONST mCutList[7];
|
||||
|
||||
u32 getFlowNodeNo() {
|
||||
u16 nodeNo = home.angle.x;
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3,
|
||||
int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5,
|
||||
int param_6, daNpcT_evtData_c const* param_7, char** param_8)
|
||||
int param_6, daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8)
|
||||
: daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {}
|
||||
u16 getEyeballMaterialNo() { return 2; }
|
||||
s32 getHeadJointNo() { return 4; }
|
||||
@@ -123,8 +123,8 @@ public:
|
||||
return nodeNo;
|
||||
}
|
||||
|
||||
static char* mCutNameList[2];
|
||||
static cutFunc mCutList[2];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[2];
|
||||
static cutFunc DUSK_CONST mCutList[2];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_KYURY_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -100,8 +100,8 @@ public:
|
||||
s32 getFootRJointNo() { return 32; }
|
||||
BOOL chkXYItems() { return TRUE; }
|
||||
|
||||
static char* mCutNameList[4];
|
||||
static cutFunc mCutList[4];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[4];
|
||||
static cutFunc DUSK_CONST mCutList[4];
|
||||
|
||||
int getFlowNodeNo() {
|
||||
u16 nodeNo = home.angle.x;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
}
|
||||
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; }
|
||||
|
||||
static char* mCutNameList[8];
|
||||
static cutFunc mCutList[8];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[8];
|
||||
static cutFunc DUSK_CONST mCutList[8];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ mDoExt_McaMorfSO* mpBowlMorf;
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -167,8 +167,8 @@ public:
|
||||
void startChoccai() { field_0x1134 = 1; }
|
||||
void endChoccai() { field_0x1134 = 0; }
|
||||
|
||||
static char* mCutNameList[17];
|
||||
static cutFunc mCutList[17];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[17];
|
||||
static cutFunc DUSK_CONST mCutList[17];
|
||||
|
||||
u8 getGroupId() {
|
||||
return (fopAcM_GetParam(this) & 0xF0000000) >> 28;
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
daNpc_midP_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
|
||||
daNpcT_evtData_c const* param_7, char** param_8) :
|
||||
daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) :
|
||||
daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {}
|
||||
u16 getEyeballRMaterialNo() { return 3; }
|
||||
u16 getEyeballLMaterialNo() { return 2; }
|
||||
@@ -148,8 +148,8 @@ public:
|
||||
return nodeNo;
|
||||
}
|
||||
|
||||
static char* mCutNameList;
|
||||
static cutFunc mCutList[1];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList;
|
||||
static cutFunc DUSK_CONST mCutList[1];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_MIDP_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
|
||||
int i_faceMotionStepNum,
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
|
||||
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -158,8 +158,8 @@ public:
|
||||
bool chkSFight() { return field_0x166b == 1; }
|
||||
u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; }
|
||||
|
||||
static char* mCutNameList[5];
|
||||
static cutFunc mCutList[5];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[5];
|
||||
static cutFunc DUSK_CONST mCutList[5];
|
||||
|
||||
private:
|
||||
/* 0x0E40 */ NPC_MOI_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -87,8 +87,8 @@ public:
|
||||
|
||||
int getType() { return mType; }
|
||||
|
||||
static char* mEvtCutNameList[5];
|
||||
static EventFn mEvtCutList[];
|
||||
static char DUSK_CONST* DUSK_CONST mEvtCutNameList[5];
|
||||
static EventFn DUSK_CONST mEvtCutList[];
|
||||
|
||||
/* 0xB48 */ u8 field_0xB48[0xB4C - 0xB48];
|
||||
/* 0xB4C */ daNpcF_Lookat_c mLookat;
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {}
|
||||
@@ -144,8 +144,8 @@ public:
|
||||
void setTagPos(cXyz const& i_pos) { mTagPos = i_pos; }
|
||||
void setLookPos(cXyz const& i_pos) { mLookPos = i_pos; }
|
||||
|
||||
static char* mCutNameList[11];
|
||||
static cutFunc mCutList[11];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[11];
|
||||
static cutFunc DUSK_CONST mCutList[11];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_PACHI_BESU_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -184,8 +184,8 @@ public:
|
||||
void setFMotion_Niramu_to_Besu() { mFMotion = 1; }
|
||||
void setFMotion_LookNone() { mFMotion = 2; }
|
||||
|
||||
static char* mCutNameList[11];
|
||||
static cutFunc mCutList[11];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[11];
|
||||
static cutFunc DUSK_CONST mCutList[11];
|
||||
|
||||
private:
|
||||
/* 0xE40 */ NPC_PACHI_MARO_HIO_CLASS* mpHIO;
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
|
||||
int i_motionStepNum,
|
||||
daNpcT_evtData_c const* i_evtData,
|
||||
char** i_arcNames)
|
||||
char DUSK_CONST* DUSK_CONST* i_arcNames)
|
||||
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
|
||||
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
|
||||
i_arcNames) {
|
||||
@@ -196,8 +196,8 @@ public:
|
||||
void setTagPos(cXyz const& i_pos) { mTagPos = i_pos; }
|
||||
void setLookPos(cXyz const& i_pos) { mLookPos = i_pos; }
|
||||
|
||||
static char* mCutNameList[11];
|
||||
static cutFunc mCutList[11];
|
||||
static char DUSK_CONST* DUSK_CONST mCutNameList[11];
|
||||
static cutFunc DUSK_CONST mCutList[11];
|
||||
|
||||
private:
|
||||
/* 0x0E40 */ NPC_PACHI_TARO_HIO_CLASS* mpHIO;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user