mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-11 05:08:59 -04:00
Compare commits
146 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d696524dbf | |||
| e3ac47a797 | |||
| 72640c8749 | |||
| 1687c65be9 | |||
| 6dac017d00 | |||
| 2150faed2e | |||
| 2f1b98c570 | |||
| 70ebdaa685 | |||
| e1edd5f35d | |||
| 88df0e08b7 | |||
| 511c670def | |||
| 16c35b45c2 | |||
| b291bdba91 | |||
| 727be2b47c | |||
| 62ad3a1a13 | |||
| 6c8dbdb6bc | |||
| 71bb081645 | |||
| 871515b3be | |||
| 266d436c28 | |||
| e7cc5a858e | |||
| 9549ba54aa | |||
| 47b1f20679 | |||
| ef51f04d4f | |||
| b68dbec612 | |||
| 96108e1759 | |||
| d3589979e4 | |||
| 2db4a9c78c | |||
| 2d56566924 | |||
| 553e011dad | |||
| 900ba7c916 | |||
| 66648d550a | |||
| c40ffbc70d | |||
| ee97736d58 | |||
| bbb3ebc25d | |||
| 52558a674e | |||
| 11d0fd2f9c | |||
| aaad10d797 | |||
| 342d696f99 | |||
| 0426b79094 | |||
| 3497d9b34b | |||
| 9d98d507b0 | |||
| cd38776576 | |||
| 54d5588d79 | |||
| ddd8ce77db | |||
| 8cba851212 | |||
| 87d2ab5af1 | |||
| f2e01bbe79 | |||
| ed0aeb3b7d | |||
| 21c1d36836 | |||
| 70f042d11f | |||
| fefb08cc4b | |||
| 9fea5f9e4c | |||
| c78c2010a3 | |||
| e89ecf8d68 | |||
| 3171dc8266 | |||
| 1ef5b86036 | |||
| e761c9f4d6 | |||
| 4816d4aa9d | |||
| 091b4ef089 | |||
| 692542fb85 | |||
| b26baea13c | |||
| a19e434e9b | |||
| 92e3cbea45 | |||
| 93f120ae83 | |||
| aa6118b448 | |||
| 863e1602ff | |||
| d5d2e83a10 | |||
| cb57e337b8 | |||
| 4fd08efa6d | |||
| f6e43761b7 | |||
| 293f873229 | |||
| 4691fe2e5a | |||
| 9289ee5e02 | |||
| 50529a95fc | |||
| 87d9e0dac7 | |||
| 996f23cc54 | |||
| 8b345d2cbd | |||
| 7b9b4245de | |||
| ff29b3e786 | |||
| 37d7e49d93 | |||
| 64a927615d | |||
| 9521cb3ee9 | |||
| 948e2f271f | |||
| f7ce4f179a | |||
| fc7918772b | |||
| a9677084ea | |||
| a5db997e5d | |||
| 4d41d8eaae | |||
| 7c989af42c | |||
| dee2a36d0f | |||
| d2d8c541e1 | |||
| 81d4390076 | |||
| 57e888658a | |||
| 0d4b66fe98 | |||
| 76ec5f032d | |||
| a9573584cd | |||
| 8e58cbcbf2 | |||
| c1988e9323 | |||
| 5321ee0fba | |||
| 1ee312442c | |||
| 5441075c5e | |||
| 470d8f797b | |||
| d041e2ba30 | |||
| e88ed2502c | |||
| e13b0ea009 | |||
| 5d437f8de6 | |||
| c6a25f21c2 | |||
| d443693d78 | |||
| dfa2a31286 | |||
| fb5d0cd94e | |||
| cf5c3423d1 | |||
| f9440e2076 | |||
| 17d7b97dd6 | |||
| 79b966586d | |||
| 686ef22c4d | |||
| ca6b42e20e | |||
| 372c04fedd | |||
| b4de79720c | |||
| e10eb80e38 | |||
| 4e149b0640 | |||
| 85b5ebf9a7 | |||
| bdbdd42bd0 | |||
| fbc4bfa4d6 | |||
| 010c0a9fdf | |||
| e6251bdbc3 | |||
| fefd177b3a | |||
| e8d36998a5 | |||
| 1efb4943b3 | |||
| 312f913a92 | |||
| d10f4bac3c | |||
| 535bca7d9f | |||
| 614106c868 | |||
| fde108178d | |||
| b56c0b8209 | |||
| cdd801dcec | |||
| e7919da1bd | |||
| 513a66657f | |||
| b9f0742ff9 | |||
| 7c72146705 | |||
| 40a8bf557b | |||
| 1cf12fa97f | |||
| aacb9d259c | |||
| c53df15578 | |||
| 53331d5760 | |||
| 0b675628ea | |||
| d3edee1945 |
@@ -0,0 +1,73 @@
|
|||||||
|
name: Build Project (Flatpak)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
|
||||||
|
FREEDESKTOP_VERSION: 23.08
|
||||||
|
LLVM_VERSION: 18
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-flatpak:
|
||||||
|
name: Build Flatpak
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
token: ${{ secrets.ORG_TOKEN }}
|
||||||
|
|
||||||
|
- name: Checkout private repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ secrets.ASSET_REPO }}
|
||||||
|
token: ${{ secrets.ASSET_REPO_TOKEN }}
|
||||||
|
path: flatpak/private
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |-
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y flatpak-builder ccache
|
||||||
|
|
||||||
|
- name: Cache ccache directory
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /tmp/ccache
|
||||||
|
key: ccache-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Prepare Flatpak
|
||||||
|
run: |
|
||||||
|
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
flatpak --user install -y flathub org.freedesktop.Sdk//${{ env.FREEDESKTOP_VERSION }}
|
||||||
|
flatpak --user install -y flathub org.freedesktop.Sdk.Extension.llvm${{ env.LLVM_VERSION }}//${{ env.FREEDESKTOP_VERSION }}
|
||||||
|
|
||||||
|
- name: Build Flatpak
|
||||||
|
run: |
|
||||||
|
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
|
||||||
|
export CCACHE_DIR=/tmp/ccache
|
||||||
|
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
|
||||||
|
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
# Uploads the built flatpak bundle to GitHub
|
||||||
|
# - name: Upload artifact
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: UnleashedRecomp-flatpak
|
||||||
|
# path: ./${{ env.FLATPAK_ID }}.flatpak
|
||||||
|
|
||||||
|
- name: Upload artifact to Discord
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
if: ${{ env.DISCORD_WEBHOOK != '' }}
|
||||||
|
uses: tsickert/discord-webhook@v6.0.0
|
||||||
|
with:
|
||||||
|
webhook-url: ${{ env.DISCORD_WEBHOOK }}
|
||||||
|
content: |
|
||||||
|
OS: Linux
|
||||||
|
Summary: ${{ env.commit_message }}
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
|
Branch: ${{ github.ref_name }}
|
||||||
|
filename: ./${{ env.FLATPAK_ID }}.flatpak
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
name: Build Project (Windows)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CMAKE_PRESET: x64-Clang-Release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build Windows
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
token: ${{ secrets.ORG_TOKEN }}
|
||||||
|
|
||||||
|
- name: Checkout private repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ secrets.ASSET_REPO }}
|
||||||
|
token: ${{ secrets.ASSET_REPO_TOKEN }}
|
||||||
|
path: .\private
|
||||||
|
|
||||||
|
- name: Setup ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ccache-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Cache vcpkg
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./thirdparty/vcpkg/downloads
|
||||||
|
./thirdparty/vcpkg/packages
|
||||||
|
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
vcpkg-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
choco install ninja
|
||||||
|
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
- name: Configure Developer Command Prompt
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Prepare Project
|
||||||
|
run: |
|
||||||
|
$commitMessage = git log -1 --pretty=%s
|
||||||
|
Add-Content -Path $env:GITHUB_ENV -Value "commit_message=$commitMessage"
|
||||||
|
copy .\private\* .\UnleashedRecompLib\private
|
||||||
|
|
||||||
|
- name: Configure Project
|
||||||
|
run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: cmake --build .\out\build\${{ env.CMAKE_PRESET }} --target UnleashedRecomp
|
||||||
|
|
||||||
|
- name: Pack Release
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Path .\release
|
||||||
|
New-Item -ItemType Directory -Path .\release\D3D12
|
||||||
|
|
||||||
|
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\D3D12\D3D12Core.dll" -Destination ".\release\D3D12\D3D12Core.dll"
|
||||||
|
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxcompiler.dll" -Destination ".\release\dxcompiler.dll"
|
||||||
|
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxil.dll" -Destination ".\release\dxil.dll"
|
||||||
|
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.exe" -Destination ".\release\UnleashedRecomp.exe"
|
||||||
|
|
||||||
|
Compress-Archive -Path .\release\* -DestinationPath .\UnleashedRecomp-Windows.zip
|
||||||
|
|
||||||
|
# Uploads the packed zip file to GitHub
|
||||||
|
# - name: Upload artifact
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: UnleashedRecomp-Windows
|
||||||
|
# path: .\UnleashedRecomp-Windows.zip
|
||||||
|
|
||||||
|
- name: Upload artifact to Discord
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
if: ${{ env.DISCORD_WEBHOOK != '' }}
|
||||||
|
uses: tsickert/discord-webhook@v6.0.0
|
||||||
|
with:
|
||||||
|
webhook-url: ${{ env.DISCORD_WEBHOOK }}
|
||||||
|
content: |
|
||||||
|
OS: Windows
|
||||||
|
Summary: ${{ env.commit_message }}
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
|
Branch: ${{ github.ref_name }}
|
||||||
|
filename: .\UnleashedRecomp-Windows.zip
|
||||||
+9
-6
@@ -1,12 +1,12 @@
|
|||||||
[submodule "thirdparty/PowerRecomp"]
|
[submodule "tools/XenonRecomp"]
|
||||||
path = tools/PowerRecomp
|
path = tools/XenonRecomp
|
||||||
url = https://github.com/hedge-dev/PowerRecomp
|
url = https://github.com/hedge-dev/XenonRecomp.git
|
||||||
[submodule "thirdparty/ddspp"]
|
[submodule "thirdparty/ddspp"]
|
||||||
path = thirdparty/ddspp
|
path = thirdparty/ddspp
|
||||||
url = https://github.com/redorav/ddspp.git
|
url = https://github.com/redorav/ddspp.git
|
||||||
[submodule "thirdparty/ShaderRecomp"]
|
[submodule "tools/XenosRecomp"]
|
||||||
path = tools/ShaderRecomp
|
path = tools/XenosRecomp
|
||||||
url = https://github.com/hedge-dev/ShaderRecomp.git
|
url = https://github.com/hedge-dev/XenosRecomp.git
|
||||||
[submodule "thirdparty/libmspack"]
|
[submodule "thirdparty/libmspack"]
|
||||||
path = thirdparty/libmspack
|
path = thirdparty/libmspack
|
||||||
url = https://github.com/kyz/libmspack
|
url = https://github.com/kyz/libmspack
|
||||||
@@ -61,3 +61,6 @@
|
|||||||
[submodule "thirdparty/implot"]
|
[submodule "thirdparty/implot"]
|
||||||
path = thirdparty/implot
|
path = thirdparty/implot
|
||||||
url = https://github.com/epezent/implot.git
|
url = https://github.com/epezent/implot.git
|
||||||
|
[submodule "thirdparty/json"]
|
||||||
|
path = thirdparty/json
|
||||||
|
url = https://github.com/nlohmann/json
|
||||||
|
|||||||
+9
-4
@@ -5,8 +5,8 @@ if(NOT DEFINED ENV{VCPKG_ROOT})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
||||||
set(SWA_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty)
|
set(UNLEASHED_RECOMP_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty)
|
||||||
set(SWA_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools)
|
set(UNLEASHED_RECOMP_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
@@ -18,8 +18,13 @@ endif()
|
|||||||
|
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
|
||||||
add_subdirectory(${SWA_THIRDPARTY_ROOT})
|
# Target Sandy Bridge for all projects
|
||||||
add_subdirectory(${SWA_TOOLS_ROOT})
|
add_compile_options(
|
||||||
|
-march=sandybridge
|
||||||
|
)
|
||||||
|
|
||||||
|
add_subdirectory(${UNLEASHED_RECOMP_THIRDPARTY_ROOT})
|
||||||
|
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT})
|
||||||
|
|
||||||
project("UnleashedRecomp-ALL")
|
project("UnleashedRecomp-ALL")
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -23,8 +23,7 @@
|
|||||||
"type": "equals",
|
"type": "equals",
|
||||||
"lhs": "${hostSystemName}",
|
"lhs": "${hostSystemName}",
|
||||||
"rhs": "Windows"
|
"rhs": "Windows"
|
||||||
},
|
}
|
||||||
"toolset": "ClangCL"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-Clang-Debug",
|
"name": "x64-Clang-Debug",
|
||||||
|
|||||||
+159
-135
@@ -1,16 +1,13 @@
|
|||||||
project("UnleashedRecomp")
|
project("UnleashedRecomp")
|
||||||
set(TARGET_NAME "SWA")
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
option(SWA_D3D12 "Add D3D12 support for rendering" ON)
|
option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
option(SWA_FLATPAK "Configure the build for Flatpak compatibility." OFF)
|
option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(SWA_XAUDIO2 "Use XAudio2 for audio playback" OFF)
|
|
||||||
|
|
||||||
function(BIN2C)
|
function(BIN2C)
|
||||||
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
|
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
|
||||||
|
|
||||||
@@ -42,9 +39,7 @@ function(BIN2C)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-march=sandybridge
|
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
|
|
||||||
-Wno-switch
|
-Wno-switch
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
-Wno-unused-variable
|
-Wno-unused-variable
|
||||||
@@ -64,16 +59,15 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
SWA_IMPL
|
|
||||||
SDL_MAIN_HANDLED
|
SDL_MAIN_HANDLED
|
||||||
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf?
|
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf?
|
||||||
_CRT_SECURE_NO_WARNINGS)
|
_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|
||||||
set(SWA_PRECOMPILED_HEADERS
|
set(UNLEASHED_RECOMP_PRECOMPILED_HEADERS
|
||||||
"stdafx.h"
|
"stdafx.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_KERNEL_CXX_SOURCES
|
set(UNLEASHED_RECOMP_KERNEL_CXX_SOURCES
|
||||||
"kernel/imports.cpp"
|
"kernel/imports.cpp"
|
||||||
"kernel/xdm.cpp"
|
"kernel/xdm.cpp"
|
||||||
"kernel/heap.cpp"
|
"kernel/heap.cpp"
|
||||||
@@ -82,21 +76,13 @@ set(SWA_KERNEL_CXX_SOURCES
|
|||||||
"kernel/io/file_system.cpp"
|
"kernel/io/file_system.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_LOCALE_CXX_SOURCES
|
set(UNLEASHED_RECOMP_LOCALE_CXX_SOURCES
|
||||||
"locale/config_locale.cpp"
|
"locale/config_locale.cpp"
|
||||||
"locale/locale.cpp"
|
"locale/locale.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_OS_CXX_SOURCES
|
|
||||||
"os/logger.cpp"
|
|
||||||
"os/media.cpp"
|
|
||||||
"os/process.cpp"
|
|
||||||
"os/user.cpp"
|
|
||||||
"os/version.cpp"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND SWA_OS_CXX_SOURCES
|
set(UNLEASHED_RECOMP_OS_CXX_SOURCES
|
||||||
"os/win32/logger_win32.cpp"
|
"os/win32/logger_win32.cpp"
|
||||||
"os/win32/media_win32.cpp"
|
"os/win32/media_win32.cpp"
|
||||||
"os/win32/process_win32.cpp"
|
"os/win32/process_win32.cpp"
|
||||||
@@ -104,7 +90,7 @@ if (WIN32)
|
|||||||
"os/win32/version_win32.cpp"
|
"os/win32/version_win32.cpp"
|
||||||
)
|
)
|
||||||
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
list(APPEND SWA_OS_CXX_SOURCES
|
set(UNLEASHED_RECOMP_OS_CXX_SOURCES
|
||||||
"os/linux/logger_linux.cpp"
|
"os/linux/logger_linux.cpp"
|
||||||
"os/linux/media_linux.cpp"
|
"os/linux/media_linux.cpp"
|
||||||
"os/linux/process_linux.cpp"
|
"os/linux/process_linux.cpp"
|
||||||
@@ -113,11 +99,11 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SWA_CPU_CXX_SOURCES
|
set(UNLEASHED_RECOMP_CPU_CXX_SOURCES
|
||||||
"cpu/guest_thread.cpp"
|
"cpu/guest_thread.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_GPU_CXX_SOURCES
|
set(UNLEASHED_RECOMP_GPU_CXX_SOURCES
|
||||||
"gpu/video.cpp"
|
"gpu/video.cpp"
|
||||||
"gpu/imgui/imgui_common.cpp"
|
"gpu/imgui/imgui_common.cpp"
|
||||||
"gpu/imgui/imgui_font_builder.cpp"
|
"gpu/imgui/imgui_font_builder.cpp"
|
||||||
@@ -125,37 +111,34 @@ set(SWA_GPU_CXX_SOURCES
|
|||||||
"gpu/rhi/plume_vulkan.cpp"
|
"gpu/rhi/plume_vulkan.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SWA_D3D12)
|
if (UNLEASHED_RECOMP_D3D12)
|
||||||
list(APPEND SWA_GPU_CXX_SOURCES
|
list(APPEND UNLEASHED_RECOMP_GPU_CXX_SOURCES
|
||||||
"gpu/rhi/plume_d3d12.cpp"
|
"gpu/rhi/plume_d3d12.cpp"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SWA_APU_CXX_SOURCES
|
set(UNLEASHED_RECOMP_APU_CXX_SOURCES
|
||||||
"apu/audio.cpp"
|
"apu/audio.cpp"
|
||||||
"apu/embedded_player.cpp"
|
"apu/embedded_player.cpp"
|
||||||
|
"apu/driver/sdl2_driver.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SWA_XAUDIO2)
|
set(UNLEASHED_RECOMP_HID_CXX_SOURCES
|
||||||
list(APPEND SWA_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp")
|
|
||||||
else()
|
|
||||||
list(APPEND SWA_APU_CXX_SOURCES "apu/driver/sdl2_driver.cpp")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SWA_HID_CXX_SOURCES
|
|
||||||
"hid/hid.cpp"
|
"hid/hid.cpp"
|
||||||
"hid/driver/sdl_hid.cpp"
|
"hid/driver/sdl_hid.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_PATCHES_CXX_SOURCES
|
set(UNLEASHED_RECOMP_PATCHES_CXX_SOURCES
|
||||||
"patches/ui/CHudPause_patches.cpp"
|
|
||||||
"patches/ui/CTitleStateIntro_patches.cpp"
|
|
||||||
"patches/ui/CTitleStateMenu_patches.cpp"
|
|
||||||
"patches/ui/frontend_listener.cpp"
|
|
||||||
"patches/aspect_ratio_patches.cpp"
|
"patches/aspect_ratio_patches.cpp"
|
||||||
"patches/audio_patches.cpp"
|
"patches/audio_patches.cpp"
|
||||||
"patches/camera_patches.cpp"
|
"patches/camera_patches.cpp"
|
||||||
|
"patches/CGameModeStageTitle_patches.cpp"
|
||||||
|
"patches/CHudPause_patches.cpp"
|
||||||
|
"patches/CTitleStateIntro_patches.cpp"
|
||||||
|
"patches/CTitleStateMenu_patches.cpp"
|
||||||
"patches/fps_patches.cpp"
|
"patches/fps_patches.cpp"
|
||||||
|
"patches/frontend_listener.cpp"
|
||||||
|
"patches/input_patches.cpp"
|
||||||
"patches/inspire_patches.cpp"
|
"patches/inspire_patches.cpp"
|
||||||
"patches/misc_patches.cpp"
|
"patches/misc_patches.cpp"
|
||||||
"patches/object_patches.cpp"
|
"patches/object_patches.cpp"
|
||||||
@@ -164,23 +147,25 @@ set(SWA_PATCHES_CXX_SOURCES
|
|||||||
"patches/video_patches.cpp"
|
"patches/video_patches.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_UI_CXX_SOURCES
|
set(UNLEASHED_RECOMP_UI_CXX_SOURCES
|
||||||
"ui/achievement_menu.cpp"
|
"ui/achievement_menu.cpp"
|
||||||
"ui/achievement_overlay.cpp"
|
"ui/achievement_overlay.cpp"
|
||||||
"ui/installer_wizard.cpp"
|
"ui/black_bar.cpp"
|
||||||
"ui/button_guide.cpp"
|
"ui/button_guide.cpp"
|
||||||
"ui/fader.cpp"
|
"ui/fader.cpp"
|
||||||
"ui/message_window.cpp"
|
|
||||||
"ui/options_menu_thumbnails.cpp"
|
|
||||||
"ui/options_menu.cpp"
|
|
||||||
"ui/sdl_listener.cpp"
|
|
||||||
"ui/game_window.cpp"
|
"ui/game_window.cpp"
|
||||||
|
"ui/imgui_utils.cpp"
|
||||||
|
"ui/installer_wizard.cpp"
|
||||||
|
"ui/message_window.cpp"
|
||||||
|
"ui/options_menu.cpp"
|
||||||
|
"ui/options_menu_thumbnails.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_INSTALL_CXX_SOURCES
|
set(UNLEASHED_RECOMP_INSTALL_CXX_SOURCES
|
||||||
"install/installer.cpp"
|
"install/installer.cpp"
|
||||||
"install/iso_file_system.cpp"
|
"install/iso_file_system.cpp"
|
||||||
"install/memory_mapped_file.cpp"
|
"install/memory_mapped_file.cpp"
|
||||||
|
"install/update_checker.cpp"
|
||||||
"install/xcontent_file_system.cpp"
|
"install/xcontent_file_system.cpp"
|
||||||
"install/xex_patcher.cpp"
|
"install/xex_patcher.cpp"
|
||||||
"install/hashes/apotos_shamar.cpp"
|
"install/hashes/apotos_shamar.cpp"
|
||||||
@@ -193,97 +178,145 @@ set(SWA_INSTALL_CXX_SOURCES
|
|||||||
"install/hashes/update.cpp"
|
"install/hashes/update.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_USER_CXX_SOURCES
|
set(UNLEASHED_RECOMP_USER_CXX_SOURCES
|
||||||
"user/achievement_data.cpp"
|
"user/achievement_data.cpp"
|
||||||
|
"user/achievement_manager.cpp"
|
||||||
"user/config.cpp"
|
"user/config.cpp"
|
||||||
|
"user/registry.cpp"
|
||||||
|
"user/paths.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_MOD_CXX_SOURCES
|
set(UNLEASHED_RECOMP_MOD_CXX_SOURCES
|
||||||
"mod/mod_loader.cpp"
|
"mod/mod_loader.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_THIRDPARTY_SOURCES
|
set(UNLEASHED_RECOMP_THIRDPARTY_SOURCES
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/imgui.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/implot/implot.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/implot/implot_items.cpp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_items.cpp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
|
||||||
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
|
||||||
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source/smolv.cpp"
|
"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source/smolv.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SWA_THIRDPARTY_INCLUDES
|
set(UNLEASHED_RECOMP_THIRDPARTY_INCLUDES
|
||||||
"${SWA_THIRDPARTY_ROOT}/concurrentqueue"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/concurrentqueue"
|
||||||
"${SWA_THIRDPARTY_ROOT}/ddspp"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/ddspp"
|
||||||
"${SWA_THIRDPARTY_ROOT}/imgui"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui"
|
||||||
"${SWA_THIRDPARTY_ROOT}/implot"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot"
|
||||||
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/json/include"
|
||||||
"${SWA_THIRDPARTY_ROOT}/magic_enum/include"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
|
||||||
"${SWA_THIRDPARTY_ROOT}/stb"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/magic_enum/include"
|
||||||
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/stb"
|
||||||
"${SWA_THIRDPARTY_ROOT}/TinySHA1"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c"
|
||||||
"${SWA_THIRDPARTY_ROOT}/unordered_dense/include"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/TinySHA1"
|
||||||
"${SWA_THIRDPARTY_ROOT}/volk"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/unordered_dense/include"
|
||||||
"${SWA_THIRDPARTY_ROOT}/Vulkan-Headers/include"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/volk"
|
||||||
"${SWA_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/Vulkan-Headers/include"
|
||||||
"${SWA_TOOLS_ROOT}/bc_diff"
|
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
|
||||||
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source"
|
"${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff"
|
||||||
|
"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SWA_D3D12)
|
if (UNLEASHED_RECOMP_D3D12)
|
||||||
list(APPEND SWA_THIRDPARTY_INCLUDES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
|
list(APPEND UNLEASHED_RECOMP_THIRDPARTY_INCLUDES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
|
||||||
list(APPEND SWA_THIRDPARTY_SOURCES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
|
list(APPEND UNLEASHED_RECOMP_THIRDPARTY_SOURCES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_source_files_properties(${SWA_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
set_source_files_properties(${UNLEASHED_RECOMP_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||||
|
|
||||||
set(SWA_CXX_SOURCES
|
set(UNLEASHED_RECOMP_CXX_SOURCES
|
||||||
"app.cpp"
|
"app.cpp"
|
||||||
"exports.cpp"
|
"exports.cpp"
|
||||||
"main.cpp"
|
"main.cpp"
|
||||||
"misc_impl.cpp"
|
"misc_impl.cpp"
|
||||||
|
"sdl_listener.cpp"
|
||||||
"stdafx.cpp"
|
"stdafx.cpp"
|
||||||
"version.cpp"
|
"version.cpp"
|
||||||
|
|
||||||
${SWA_KERNEL_CXX_SOURCES}
|
${UNLEASHED_RECOMP_KERNEL_CXX_SOURCES}
|
||||||
${SWA_LOCALE_CXX_SOURCES}
|
${UNLEASHED_RECOMP_LOCALE_CXX_SOURCES}
|
||||||
${SWA_OS_CXX_SOURCES}
|
${UNLEASHED_RECOMP_OS_CXX_SOURCES}
|
||||||
${SWA_CPU_CXX_SOURCES}
|
${UNLEASHED_RECOMP_CPU_CXX_SOURCES}
|
||||||
${SWA_GPU_CXX_SOURCES}
|
${UNLEASHED_RECOMP_GPU_CXX_SOURCES}
|
||||||
${SWA_APU_CXX_SOURCES}
|
${UNLEASHED_RECOMP_APU_CXX_SOURCES}
|
||||||
${SWA_HID_CXX_SOURCES}
|
${UNLEASHED_RECOMP_HID_CXX_SOURCES}
|
||||||
${SWA_PATCHES_CXX_SOURCES}
|
${UNLEASHED_RECOMP_PATCHES_CXX_SOURCES}
|
||||||
${SWA_UI_CXX_SOURCES}
|
${UNLEASHED_RECOMP_UI_CXX_SOURCES}
|
||||||
${SWA_INSTALL_CXX_SOURCES}
|
${UNLEASHED_RECOMP_INSTALL_CXX_SOURCES}
|
||||||
${SWA_USER_CXX_SOURCES}
|
${UNLEASHED_RECOMP_USER_CXX_SOURCES}
|
||||||
${SWA_MOD_CXX_SOURCES}
|
${UNLEASHED_RECOMP_MOD_CXX_SOURCES}
|
||||||
${SWA_THIRDPARTY_SOURCES}
|
${UNLEASHED_RECOMP_THIRDPARTY_SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
include("version.cmake")
|
||||||
|
|
||||||
|
set(VERSION_TXT "${PROJECT_SOURCE_DIR}/res/version.txt")
|
||||||
|
|
||||||
|
# Only show Git info and build type if not Release.
|
||||||
|
set(SHOW_GIT_INFO_AND_BUILD_TYPE 0)
|
||||||
|
if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||||
|
set(SHOW_GIT_INFO_AND_BUILD_TYPE 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
GenerateVersionSources(
|
||||||
|
OUTPUT_DIR ${PROJECT_SOURCE_DIR}
|
||||||
|
VERSION_TXT ${VERSION_TXT}
|
||||||
|
H_TEMPLATE "${PROJECT_SOURCE_DIR}/res/version.h.template"
|
||||||
|
CXX_TEMPLATE "${PROJECT_SOURCE_DIR}/res/version.cpp.template"
|
||||||
|
BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||||
|
SHOW_GIT_INFO ${SHOW_GIT_INFO_AND_BUILD_TYPE}
|
||||||
|
SHOW_BUILD_TYPE ${SHOW_GIT_INFO_AND_BUILD_TYPE}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# Set up Win32 resources for application icon.
|
# Create binary version number for Win32 integer attributes.
|
||||||
set(ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico")
|
CreateVersionString(
|
||||||
|
VERSION_TXT ${VERSION_TXT}
|
||||||
|
OUTPUT_CSV 1
|
||||||
|
OUTPUT_VAR WIN32_VERSION_BINARY
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create string version number for Win32 detailed attributes.
|
||||||
|
CreateVersionString(
|
||||||
|
VERSION_TXT ${VERSION_TXT}
|
||||||
|
BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||||
|
SHOW_GIT_INFO ${SHOW_GIT_INFO_AND_BUILD_TYPE}
|
||||||
|
SHOW_BUILD_TYPE ${SHOW_GIT_INFO_AND_BUILD_TYPE}
|
||||||
|
OUTPUT_VAR WIN32_VERSION_STRING
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set Win32 icon path.
|
||||||
|
set(WIN32_ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico")
|
||||||
|
|
||||||
configure_file("res/win32/res.rc.template" "${CMAKE_BINARY_DIR}/res.rc" @ONLY)
|
configure_file("res/win32/res.rc.template" "${CMAKE_BINARY_DIR}/res.rc" @ONLY)
|
||||||
add_executable(UnleashedRecomp ${SWA_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc")
|
add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc")
|
||||||
|
|
||||||
|
# Hide console for release configurations.
|
||||||
|
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||||
|
target_link_options(UnleashedRecomp PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_executable(UnleashedRecomp ${SWA_CXX_SOURCES})
|
add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME})
|
if (UNLEASHED_RECOMP_FLATPAK)
|
||||||
|
target_compile_definitions(UnleashedRecomp PRIVATE
|
||||||
if (SWA_FLATPAK)
|
"UNLEASHED_RECOMP_FLATPAK"
|
||||||
target_compile_definitions(UnleashedRecomp PRIVATE "GAME_INSTALL_DIRECTORY=\"/var/data\"")
|
"GAME_INSTALL_DIRECTORY=\"/var/data\""
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (SWA_D3D12)
|
if (UNLEASHED_RECOMP_D3D12)
|
||||||
find_package(directx-headers CONFIG REQUIRED)
|
find_package(directx-headers CONFIG REQUIRED)
|
||||||
find_package(directx12-agility CONFIG REQUIRED)
|
find_package(directx12-agility CONFIG REQUIRED)
|
||||||
target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12)
|
target_compile_definitions(UnleashedRecomp PRIVATE UNLEASHED_RECOMP_D3D12)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
@@ -291,8 +324,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(directx-dxc REQUIRED)
|
find_package(directx-dxc REQUIRED)
|
||||||
|
find_package(CURL REQUIRED)
|
||||||
|
|
||||||
if (SWA_D3D12)
|
if (UNLEASHED_RECOMP_D3D12)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
||||||
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
||||||
@@ -318,9 +352,11 @@ file(CHMOD ${DIRECTX_DXC_TOOL} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
|
|||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(UnleashedRecomp PRIVATE
|
target_link_libraries(UnleashedRecomp PRIVATE
|
||||||
comctl32
|
comctl32
|
||||||
|
dwmapi
|
||||||
ntdll
|
ntdll
|
||||||
winmm
|
Shcore
|
||||||
Synchronization
|
Synchronization
|
||||||
|
winmm
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -330,18 +366,19 @@ target_link_libraries(UnleashedRecomp PRIVATE
|
|||||||
msdf-atlas-gen::msdf-atlas-gen
|
msdf-atlas-gen::msdf-atlas-gen
|
||||||
nfd::nfd
|
nfd::nfd
|
||||||
o1heap
|
o1heap
|
||||||
PowerUtils
|
XenonUtils
|
||||||
SDL2::SDL2-static
|
SDL2::SDL2-static
|
||||||
SDL2_mixer
|
SDL2_mixer
|
||||||
tomlplusplus::tomlplusplus
|
tomlplusplus::tomlplusplus
|
||||||
UnleashedRecompLib
|
UnleashedRecompLib
|
||||||
xxHash::xxhash
|
xxHash::xxhash
|
||||||
|
CURL::libcurl
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(UnleashedRecomp PRIVATE
|
target_include_directories(UnleashedRecomp PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/api"
|
"${CMAKE_CURRENT_SOURCE_DIR}/api"
|
||||||
${SWA_THIRDPARTY_INCLUDES}
|
${UNLEASHED_RECOMP_THIRDPARTY_INCLUDES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
@@ -350,12 +387,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES})
|
target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})
|
target_precompile_headers(UnleashedRecomp PUBLIC ${UNLEASHED_RECOMP_PRECOMPILED_HEADERS})
|
||||||
|
|
||||||
function(compile_shader FILE_PATH TARGET_NAME)
|
function(compile_shader FILE_PATH TARGET_NAME)
|
||||||
set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl)
|
set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl)
|
||||||
cmake_path(GET FILE_PATH STEM VARIABLE_NAME)
|
cmake_path(GET FILE_PATH STEM VARIABLE_NAME)
|
||||||
if (SWA_D3D12)
|
if (UNLEASHED_RECOMP_D3D12)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${FILE_PATH}.dxil.h
|
OUTPUT ${FILE_PATH}.dxil.h
|
||||||
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil
|
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil
|
||||||
@@ -379,7 +416,10 @@ function(compile_pixel_shader FILE_PATH)
|
|||||||
compile_shader(${FILE_PATH} ps_6_0)
|
compile_shader(${FILE_PATH} ps_6_0)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
compile_pixel_shader(blend_color_alpha_ps)
|
||||||
compile_vertex_shader(copy_vs)
|
compile_vertex_shader(copy_vs)
|
||||||
|
compile_pixel_shader(copy_color_ps)
|
||||||
|
compile_pixel_shader(copy_depth_ps)
|
||||||
compile_pixel_shader(csd_filter_ps)
|
compile_pixel_shader(csd_filter_ps)
|
||||||
compile_vertex_shader(csd_no_tex_vs)
|
compile_vertex_shader(csd_no_tex_vs)
|
||||||
compile_vertex_shader(csd_vs)
|
compile_vertex_shader(csd_vs)
|
||||||
@@ -393,6 +433,9 @@ compile_pixel_shader(imgui_ps)
|
|||||||
compile_vertex_shader(imgui_vs)
|
compile_vertex_shader(imgui_vs)
|
||||||
compile_pixel_shader(movie_ps)
|
compile_pixel_shader(movie_ps)
|
||||||
compile_vertex_shader(movie_vs)
|
compile_vertex_shader(movie_vs)
|
||||||
|
compile_pixel_shader(resolve_msaa_color_2x)
|
||||||
|
compile_pixel_shader(resolve_msaa_color_4x)
|
||||||
|
compile_pixel_shader(resolve_msaa_color_8x)
|
||||||
compile_pixel_shader(resolve_msaa_depth_2x)
|
compile_pixel_shader(resolve_msaa_depth_2x)
|
||||||
compile_pixel_shader(resolve_msaa_depth_4x)
|
compile_pixel_shader(resolve_msaa_depth_4x)
|
||||||
compile_pixel_shader(resolve_msaa_depth_8x)
|
compile_pixel_shader(resolve_msaa_depth_8x)
|
||||||
@@ -426,23 +469,6 @@ generate_aggregate_header(
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/SWA.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/api/SWA.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Only show build type if not Release.
|
|
||||||
set(IS_BUILD_TYPE_IN_VER_STRING 0)
|
|
||||||
if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Release")
|
|
||||||
set(IS_BUILD_TYPE_IN_VER_STRING 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include("version.cmake")
|
|
||||||
GenerateVersionSources(
|
|
||||||
OUTPUT_DIR "${PROJECT_SOURCE_DIR}"
|
|
||||||
VERSION_TXT "${PROJECT_SOURCE_DIR}/res/version.txt"
|
|
||||||
H_TEMPLATE "${PROJECT_SOURCE_DIR}/res/version.h.template"
|
|
||||||
CXX_TEMPLATE "${PROJECT_SOURCE_DIR}/res/version.cpp.template"
|
|
||||||
BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
|
||||||
IS_BUILD_TYPE_IN_VER_STRING ${IS_BUILD_TYPE_IN_VER_STRING}
|
|
||||||
IS_GIT_REPO 1
|
|
||||||
)
|
|
||||||
|
|
||||||
set(RESOURCES_SOURCE_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources")
|
set(RESOURCES_SOURCE_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources")
|
||||||
set(RESOURCES_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/res")
|
set(RESOURCES_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/res")
|
||||||
|
|
||||||
@@ -454,8 +480,8 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/co
|
|||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/general_window.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/general_window.dds" ARRAY_NAME "g_general_window" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/general_window.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/general_window.dds" ARRAY_NAME "g_general_window" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/hedge-dev.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/hedge-dev.dds" ARRAY_NAME "g_hedgedev" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/hedge-dev.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/hedge-dev.dds" ARRAY_NAME "g_hedgedev" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/kbm.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/kbm.dds" ARRAY_NAME "g_kbm" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/kbm.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/kbm.dds" ARRAY_NAME "g_kbm" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/select_fade.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/select_fade.dds" ARRAY_NAME "g_select_fade" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/select.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/select.dds" ARRAY_NAME "g_select" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/select_fill.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/select_fill.dds" ARRAY_NAME "g_select_fill" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/common/light.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/light.dds" ARRAY_NAME "g_light" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/arrow_circle.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/arrow_circle.dds" ARRAY_NAME "g_arrow_circle" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/arrow_circle.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/arrow_circle.dds" ARRAY_NAME "g_arrow_circle" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_001.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_001.dds" ARRAY_NAME "g_install_001" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_001.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_001.dds" ARRAY_NAME "g_install_001" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_002.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_002.dds" ARRAY_NAME "g_install_002" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_002.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_002.dds" ARRAY_NAME "g_install_002" COMPRESSION_TYPE "zstd")
|
||||||
@@ -469,7 +495,6 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/in
|
|||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/pulse_install.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/pulse_install.dds" ARRAY_NAME "g_pulse_install" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/pulse_install.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/pulse_install.dds" ARRAY_NAME "g_pulse_install" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/achievement_notifications.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/achievement_notifications.dds" ARRAY_NAME "g_achievement_notifications" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/achievement_notifications.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/achievement_notifications.dds" ARRAY_NAME "g_achievement_notifications" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/allow_background_input.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/allow_background_input.dds" ARRAY_NAME "g_allow_background_input" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/allow_background_input.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/allow_background_input.dds" ARRAY_NAME "g_allow_background_input" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/allow_dpad_movement.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/allow_dpad_movement.dds" ARRAY_NAME "g_allow_dpad_movement" COMPRESSION_TYPE "zstd")
|
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing.dds" ARRAY_NAME "g_antialiasing" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing.dds" ARRAY_NAME "g_antialiasing" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/aspect_ratio.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/aspect_ratio.dds" ARRAY_NAME "g_aspect_ratio" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/aspect_ratio.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/aspect_ratio.dds" ARRAY_NAME "g_aspect_ratio" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/battle_theme.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/battle_theme.dds" ARRAY_NAME "g_battle_theme" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/battle_theme.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/battle_theme.dds" ARRAY_NAME "g_battle_theme" COMPRESSION_TYPE "zstd")
|
||||||
@@ -483,8 +508,7 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/op
|
|||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bilinear.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bilinear.dds" ARRAY_NAME "g_gi_texture_filtering_bilinear" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bilinear.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bilinear.dds" ARRAY_NAME "g_gi_texture_filtering_bilinear" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bicubic.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bicubic.dds" ARRAY_NAME "g_gi_texture_filtering_bicubic" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bicubic.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/gi_texture_filtering_bicubic.dds" ARRAY_NAME "g_gi_texture_filtering_bicubic" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/hints.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/hints.dds" ARRAY_NAME "g_hints" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/hints.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/hints.dds" ARRAY_NAME "g_hints" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/invert_camera_x.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/invert_camera_x.dds" ARRAY_NAME "g_invert_camera_x" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/horizontal_camera.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/horizontal_camera.dds" ARRAY_NAME "g_horizontal_camera" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/invert_camera_y.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/invert_camera_y.dds" ARRAY_NAME "g_invert_camera_y" COMPRESSION_TYPE "zstd")
|
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/language.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/language.dds" ARRAY_NAME "g_language" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/language.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/language.dds" ARRAY_NAME "g_language" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/master_volume.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/master_volume.dds" ARRAY_NAME "g_master_volume" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/master_volume.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/master_volume.dds" ARRAY_NAME "g_master_volume" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/monitor.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/monitor.dds" ARRAY_NAME "g_monitor" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/monitor.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/monitor.dds" ARRAY_NAME "g_monitor" COMPRESSION_TYPE "zstd")
|
||||||
@@ -506,13 +530,13 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/op
|
|||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" ARRAY_NAME "g_time_of_day_transition_playstation" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" ARRAY_NAME "g_time_of_day_transition_playstation" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" ARRAY_NAME "g_transparency_antialiasing_false" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" ARRAY_NAME "g_transparency_antialiasing_false" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" ARRAY_NAME "g_transparency_antialiasing_true" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" ARRAY_NAME "g_transparency_antialiasing_true" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/ui_scale_mode.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_scale_mode.dds" ARRAY_NAME "g_ui_scale_mode" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/ui_alignment_mode.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_alignment_mode.dds" ARRAY_NAME "g_ui_alignment_mode" COMPRESSION_TYPE "zstd")
|
||||||
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vertical_camera.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vertical_camera.dds" ARRAY_NAME "g_vertical_camera" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/voice_language.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/voice_language.dds" ARRAY_NAME "g_voice_language" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/voice_language.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/voice_language.dds" ARRAY_NAME "g_voice_language" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vibration.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vibration.dds" ARRAY_NAME "g_vibration" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vibration.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vibration.dds" ARRAY_NAME "g_vibration" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vsync.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vsync.dds" ARRAY_NAME "g_vsync" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vsync.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vsync.dds" ARRAY_NAME "g_vsync" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/window_size.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/window_size.dds" ARRAY_NAME "g_window_size" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/window_size.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/window_size.dds" ARRAY_NAME "g_window_size" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/xbox_color_correction_false.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/xbox_color_correction_false.dds" ARRAY_NAME "g_xbox_color_correction_false" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/xbox_color_correction.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/xbox_color_correction.dds" ARRAY_NAME "g_xbox_color_correction" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/xbox_color_correction_true.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/xbox_color_correction_true.dds" ARRAY_NAME "g_xbox_color_correction_true" COMPRESSION_TYPE "zstd")
|
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/miles_electric.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/miles_electric.dds" ARRAY_NAME "g_miles_electric" COMPRESSION_TYPE "zstd")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/miles_electric.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/miles_electric.dds" ARRAY_NAME "g_miles_electric" COMPRESSION_TYPE "zstd")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon.bmp" ARRAY_NAME "g_game_icon")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon.bmp" ARRAY_NAME "g_game_icon")
|
||||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon_night.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon_night.bmp" ARRAY_NAME "g_game_icon_night")
|
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon_night.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon_night.bmp" ARRAY_NAME "g_game_icon_night")
|
||||||
|
|||||||
@@ -9,41 +9,41 @@ namespace Chao::CSD
|
|||||||
|
|
||||||
inline void CNode::SetText(const char* in_pText)
|
inline void CNode::SetText(const char* in_pText)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF640, this, in_pText);
|
GuestToHostFunction<int>(sub_830BF640, this, in_pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetText(const wchar_t* in_pText)
|
inline void CNode::SetText(const wchar_t* in_pText)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF640, this, in_pText);
|
GuestToHostFunction<int>(sub_830BF640, this, in_pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::GetPosition(Hedgehog::Math::CVector2& out_rResult) const
|
inline void CNode::GetPosition(Hedgehog::Math::CVector2& out_rResult) const
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BF008, &out_rResult, this);
|
GuestToHostFunction<void>(sub_830BF008, &out_rResult, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetPosition(float in_X, float in_Y)
|
inline void CNode::SetPosition(float in_X, float in_Y)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF078, this, in_X, in_Y);
|
GuestToHostFunction<int>(sub_830BF078, this, in_X, in_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetHideFlag(uint32_t in_HideFlag)
|
inline void CNode::SetHideFlag(uint32_t in_HideFlag)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF080, this, in_HideFlag);
|
GuestToHostFunction<int>(sub_830BF080, this, in_HideFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetRotation(float in_Rotation)
|
inline void CNode::SetRotation(float in_Rotation)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF088, this, in_Rotation);
|
GuestToHostFunction<int>(sub_830BF088, this, in_Rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetScale(float in_X, float in_Y)
|
inline void CNode::SetScale(float in_X, float in_Y)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF090, this, in_X, in_Y);
|
GuestToHostFunction<int>(sub_830BF090, this, in_X, in_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CNode::SetPatternIndex(uint32_t in_PatternIndex)
|
inline void CNode::SetPatternIndex(uint32_t in_PatternIndex)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<int>(0x830BF300, this, in_PatternIndex);
|
GuestToHostFunction<int>(sub_830BF300, this, in_PatternIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,20 +5,20 @@ namespace Chao::CSD
|
|||||||
inline RCPtr<CScene> CProject::CreateScene(const char* in_pName) const
|
inline RCPtr<CScene> CProject::CreateScene(const char* in_pName) const
|
||||||
{
|
{
|
||||||
RCPtr<CScene> rcScene;
|
RCPtr<CScene> rcScene;
|
||||||
GuestToHostFunction<void>(0x830BEE00, this, rcScene, in_pName, nullptr);
|
GuestToHostFunction<void>(sub_830BEE00, this, rcScene, in_pName, nullptr);
|
||||||
return rcScene;
|
return rcScene;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline RCPtr<CScene> CProject::CreateScene(const char* in_pName, const char* in_pMotionName) const
|
inline RCPtr<CScene> CProject::CreateScene(const char* in_pName, const char* in_pMotionName) const
|
||||||
{
|
{
|
||||||
RCPtr<CScene> rcScene;
|
RCPtr<CScene> rcScene;
|
||||||
GuestToHostFunction<void>(0x830BECE0, this, rcScene, in_pName, in_pMotionName, nullptr);
|
GuestToHostFunction<void>(sub_830BECE0, this, rcScene, in_pName, in_pMotionName, nullptr);
|
||||||
return rcScene;
|
return rcScene;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CProject::DestroyScene(CScene* in_pScene)
|
inline void CProject::DestroyScene(CScene* in_pScene)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BE298, this, in_pScene);
|
GuestToHostFunction<void>(sub_830BE298, this, in_pScene);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CProject::DestroyScene(RCPtr<CScene>& inout_rcScene)
|
inline void CProject::DestroyScene(RCPtr<CScene>& inout_rcScene)
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ namespace Chao::CSD
|
|||||||
|
|
||||||
inline void RCPtrAbs::RCObject::Release()
|
inline void RCPtrAbs::RCObject::Release()
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BA068, this);
|
GuestToHostFunction<void>(sub_830BA068, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ namespace Chao::CSD
|
|||||||
|
|
||||||
inline void RCPtrAbs::AttachAbs(void* in_pMemory)
|
inline void RCPtrAbs::AttachAbs(void* in_pMemory)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BA298, this, in_pMemory);
|
GuestToHostFunction<void>(sub_830BA298, this, in_pMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void RCPtrAbs::SetAbs(const RCPtrAbs& in_rPtr)
|
inline void RCPtrAbs::SetAbs(const RCPtrAbs& in_rPtr)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BA328, this, in_rPtr);
|
GuestToHostFunction<void>(sub_830BA328, this, in_rPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void* RCPtrAbs::operator*() const
|
inline void* RCPtrAbs::operator*() const
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Chao::CSD
|
|||||||
|
|
||||||
inline bool CScene::SetMotion(const char* in_pName)
|
inline bool CScene::SetMotion(const char* in_pName)
|
||||||
{
|
{
|
||||||
return GuestToHostFunction<bool>(0x830BA760, this, in_pName);
|
return GuestToHostFunction<bool>(sub_830BA760, this, in_pName);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CScene::SetMotionFrame(float in_MotionFrame)
|
inline void CScene::SetMotionFrame(float in_MotionFrame)
|
||||||
@@ -33,21 +33,21 @@ namespace Chao::CSD
|
|||||||
|
|
||||||
inline void CScene::SetPosition(float in_X, float in_Y)
|
inline void CScene::SetPosition(float in_X, float in_Y)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BB550, this, in_X, in_Y);
|
GuestToHostFunction<void>(sub_830BB550, this, in_X, in_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CScene::SetHideFlag(uint32_t in_HideFlag)
|
inline void CScene::SetHideFlag(uint32_t in_HideFlag)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BB378, this, in_HideFlag);
|
GuestToHostFunction<void>(sub_830BB378, this, in_HideFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CScene::SetRotation(float in_Angle)
|
inline void CScene::SetRotation(float in_Angle)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BB5F8, this, in_Angle);
|
GuestToHostFunction<void>(sub_830BB5F8, this, in_Angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CScene::SetScale(float in_X, float in_Y)
|
inline void CScene::SetScale(float in_X, float in_Y)
|
||||||
{
|
{
|
||||||
GuestToHostFunction<void>(0x830BB650, this, in_X, in_Y);
|
GuestToHostFunction<void>(sub_830BB650, this, in_X, in_Y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Hedgehog::Math
|
|||||||
be<float> X;
|
be<float> X;
|
||||||
be<float> Y;
|
be<float> Y;
|
||||||
be<float> Z;
|
be<float> Z;
|
||||||
|
be<float> W;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CVector4
|
class CVector4
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
#include <Hedgehog/Base/hhObject.h>
|
||||||
|
#include <Hedgehog/Universe/Engine/hhMessageProcess.h>
|
||||||
|
#include <Hedgehog/Universe/Engine/hhStateMachineMessageReceiver.h>
|
||||||
|
|
||||||
|
namespace Hedgehog::Universe
|
||||||
|
{
|
||||||
|
class CStateMachineBase : public IStateMachineMessageReceiver, public Base::CObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class CStateBase : public IMessageProcess
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x08);
|
||||||
|
xpointer<void> m_pContext;
|
||||||
|
xpointer<CStateMachineBase> m_pStateMachine;
|
||||||
|
be<float> m_Time;
|
||||||
|
SWA_INSERT_PADDING(0x4C);
|
||||||
|
|
||||||
|
void* GetContextBase() const;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T* GetContextBase() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_INSERT_PADDING(0x60);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <Hedgehog/Universe/Engine/hhStateMachineBase.inl>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
namespace Hedgehog::Universe
|
||||||
|
{
|
||||||
|
inline void* CStateMachineBase::CStateBase::GetContextBase() const
|
||||||
|
{
|
||||||
|
return m_pContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline T* CStateMachineBase::CStateBase::GetContextBase() const
|
||||||
|
{
|
||||||
|
return (T*)m_pContext.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace Hedgehog::Universe
|
||||||
|
{
|
||||||
|
class IStateMachineMessageReceiver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IStateMachineMessageReceiver(const swa_null_ctor&) {}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -47,9 +47,12 @@
|
|||||||
#include "Hedgehog/Sparkle/hhParticleMaterial.h"
|
#include "Hedgehog/Sparkle/hhParticleMaterial.h"
|
||||||
#include "Hedgehog/Universe/Engine/hhMessageActor.h"
|
#include "Hedgehog/Universe/Engine/hhMessageActor.h"
|
||||||
#include "Hedgehog/Universe/Engine/hhMessageProcess.h"
|
#include "Hedgehog/Universe/Engine/hhMessageProcess.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhStateMachineBase.h"
|
||||||
|
#include "Hedgehog/Universe/Engine/hhStateMachineMessageReceiver.h"
|
||||||
#include "Hedgehog/Universe/Engine/hhUpdateInfo.h"
|
#include "Hedgehog/Universe/Engine/hhUpdateInfo.h"
|
||||||
#include "Hedgehog/Universe/Engine/hhUpdateUnit.h"
|
#include "Hedgehog/Universe/Engine/hhUpdateUnit.h"
|
||||||
#include "Hedgehog/Universe/Thread/hhParallelJob.h"
|
#include "Hedgehog/Universe/Thread/hhParallelJob.h"
|
||||||
|
#include "SWA/Achievement/AchievementID.h"
|
||||||
#include "SWA/Achievement/AchievementManager.h"
|
#include "SWA/Achievement/AchievementManager.h"
|
||||||
#include "SWA/Achievement/AchievementTest.h"
|
#include "SWA/Achievement/AchievementTest.h"
|
||||||
#include "SWA/CSD/CsdDatabaseWrapper.h"
|
#include "SWA/CSD/CsdDatabaseWrapper.h"
|
||||||
@@ -57,6 +60,13 @@
|
|||||||
#include "SWA/CSD/CsdTexListMirage.h"
|
#include "SWA/CSD/CsdTexListMirage.h"
|
||||||
#include "SWA/CSD/GameObjectCSD.h"
|
#include "SWA/CSD/GameObjectCSD.h"
|
||||||
#include "SWA/Camera/Camera.h"
|
#include "SWA/Camera/Camera.h"
|
||||||
|
#include "SWA/Camera/CameraController.h"
|
||||||
|
#include "SWA/CharacterUtility/CharacterProxy.h"
|
||||||
|
#include "SWA/ExtraStage/Tails/Enemy/Boss/ExStageBoss.h"
|
||||||
|
#include "SWA/ExtraStage/Tails/Enemy/Boss/State/StateBase.h"
|
||||||
|
#include "SWA/ExtraStage/Tails/Enemy/Boss/State/StateBattle.h"
|
||||||
|
#include "SWA/ExtraStage/Tails/Player/ExPlayerTails.h"
|
||||||
|
#include "SWA/Globals.h"
|
||||||
#include "SWA/HUD/GeneralWindow/GeneralWindow.h"
|
#include "SWA/HUD/GeneralWindow/GeneralWindow.h"
|
||||||
#include "SWA/HUD/Loading/Loading.h"
|
#include "SWA/HUD/Loading/Loading.h"
|
||||||
#include "SWA/HUD/Pause/HudPause.h"
|
#include "SWA/HUD/Pause/HudPause.h"
|
||||||
@@ -71,8 +81,10 @@
|
|||||||
#include "SWA/Inspire/InspireTextureAnimationInfo.h"
|
#include "SWA/Inspire/InspireTextureAnimationInfo.h"
|
||||||
#include "SWA/Inspire/InspireTextureOverlay.h"
|
#include "SWA/Inspire/InspireTextureOverlay.h"
|
||||||
#include "SWA/Inspire/InspireTextureOverlayInfo.h"
|
#include "SWA/Inspire/InspireTextureOverlayInfo.h"
|
||||||
|
#include "SWA/Menu/MenuWindowBase.h"
|
||||||
#include "SWA/Movie/MovieDisplayer.h"
|
#include "SWA/Movie/MovieDisplayer.h"
|
||||||
#include "SWA/Movie/MovieManager.h"
|
#include "SWA/Movie/MovieManager.h"
|
||||||
|
#include "SWA/Object/Common/DashPanel/ObjDashPanel.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
||||||
@@ -91,8 +103,14 @@
|
|||||||
#include "SWA/System/GameMode/GameMode.h"
|
#include "SWA/System/GameMode/GameMode.h"
|
||||||
#include "SWA/System/GameMode/GameModeStage.h"
|
#include "SWA/System/GameMode/GameModeStage.h"
|
||||||
#include "SWA/System/GameMode/GameModeStageMovie.h"
|
#include "SWA/System/GameMode/GameModeStageMovie.h"
|
||||||
|
#include "SWA/System/GameMode/GameModeStageTitle.h"
|
||||||
#include "SWA/System/GameMode/Title/TitleMenu.h"
|
#include "SWA/System/GameMode/Title/TitleMenu.h"
|
||||||
#include "SWA/System/GameMode/Title/TitleStateBase.h"
|
#include "SWA/System/GameMode/Title/TitleStateBase.h"
|
||||||
|
#include "SWA/System/GameMode/Title/TitleStateIntro.h"
|
||||||
|
#include "SWA/System/GameMode/Title/TitleStateMenu.h"
|
||||||
|
#include "SWA/System/GameMode/Title/TitleStateWorldMap.h"
|
||||||
|
#include "SWA/System/GameMode/WorldMap/WorldMapCamera.h"
|
||||||
|
#include "SWA/System/GameMode/WorldMap/WorldMapCursor.h"
|
||||||
#include "SWA/System/GameObject.h"
|
#include "SWA/System/GameObject.h"
|
||||||
#include "SWA/System/GameParameter.h"
|
#include "SWA/System/GameParameter.h"
|
||||||
#include "SWA/System/GammaController.h"
|
#include "SWA/System/GammaController.h"
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
enum EAchievementID : uint32_t
|
||||||
|
{
|
||||||
|
eAchievementID_StillBroken = 24,
|
||||||
|
eAchievementID_LookingBetter,
|
||||||
|
eAchievementID_StillAJigsawPuzzle,
|
||||||
|
eAchievementID_PickingUpThePieces,
|
||||||
|
eAchievementID_AlmostThere,
|
||||||
|
eAchievementID_OneMoreToGo,
|
||||||
|
eAchievementID_WorldSavior = 31,
|
||||||
|
eAchievementID_PartlyCloudy,
|
||||||
|
eAchievementID_Sunny,
|
||||||
|
eAchievementID_HalfMoon,
|
||||||
|
eAchievementID_FullMoon,
|
||||||
|
eAchievementID_BlueStreak,
|
||||||
|
eAchievementID_PowerOverwhelming,
|
||||||
|
eAchievementID_GettingTheHangOfThings,
|
||||||
|
eAchievementID_CreatureOfTheNight,
|
||||||
|
eAchievementID_HelpingHand,
|
||||||
|
eAchievementID_LayTheSmackdown,
|
||||||
|
eAchievementID_WallCrawler,
|
||||||
|
eAchievementID_Airdevil,
|
||||||
|
eAchievementID_Hyperdrive,
|
||||||
|
eAchievementID_Basher,
|
||||||
|
eAchievementID_Smasher,
|
||||||
|
eAchievementID_Crasher,
|
||||||
|
eAchievementID_Thrasher,
|
||||||
|
eAchievementID_SocialButterfly,
|
||||||
|
eAchievementID_HungryHungryHedgehog,
|
||||||
|
eAchievementID_AcePilot,
|
||||||
|
eAchievementID_DayTripper,
|
||||||
|
eAchievementID_HardDaysNight,
|
||||||
|
eAchievementID_GetOnTheExorciseBandwagon,
|
||||||
|
eAchievementID_GyroWithRelish = 64,
|
||||||
|
eAchievementID_PigInABlanket,
|
||||||
|
eAchievementID_ExoticToppings,
|
||||||
|
eAchievementID_SausageFriedRice,
|
||||||
|
eAchievementID_IcedHotdog,
|
||||||
|
eAchievementID_KebabOnABun,
|
||||||
|
eAchievementID_KetchupAndMustard,
|
||||||
|
eAchievementID_HardBoiled,
|
||||||
|
eAchievementID_FriedClamRoll,
|
||||||
|
eAchievementID_FirstTimeCustomer,
|
||||||
|
eAchievementID_OhYouShouldntHave,
|
||||||
|
eAchievementID_ThatsEnoughSeriously,
|
||||||
|
eAchievementID_Hedgehunk,
|
||||||
|
eAchievementID_IAintAfraidOfNoGhost,
|
||||||
|
eAchievementID_BFFs,
|
||||||
|
eAchievementID_SpeedingTicket,
|
||||||
|
eAchievementID_ComboKing,
|
||||||
|
eAchievementID_RingLeader,
|
||||||
|
eAchievementID_KnockoutBrawler,
|
||||||
|
eAchievementID_BlueMeteor
|
||||||
|
};
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <SWA.inl>
|
#include <SWA.inl>
|
||||||
|
#include <SWA/Achievement/AchievementID.h>
|
||||||
|
|
||||||
namespace SWA::Achievement
|
namespace SWA::Achievement
|
||||||
{
|
{
|
||||||
@@ -11,7 +12,7 @@ namespace SWA::Achievement
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x08);
|
SWA_INSERT_PADDING(0x08);
|
||||||
be<uint32_t> m_AchievementID;
|
be<EAchievementID> m_AchievementID;
|
||||||
};
|
};
|
||||||
|
|
||||||
SWA_INSERT_PADDING(0x98);
|
SWA_INSERT_PADDING(0x98);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <SWA.inl>
|
#include <SWA.inl>
|
||||||
|
#include <SWA/Achievement/AchievementID.h>
|
||||||
|
|
||||||
namespace SWA
|
namespace SWA
|
||||||
{
|
{
|
||||||
@@ -9,7 +10,7 @@ namespace SWA
|
|||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x38);
|
SWA_INSERT_PADDING(0x38);
|
||||||
be<uint32_t> m_Unk1;
|
be<uint32_t> m_Unk1;
|
||||||
be<uint32_t> m_AchievementID;
|
be<EAchievementID> m_AchievementID;
|
||||||
uint8_t m_Unk2;
|
uint8_t m_Unk2;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace SWA
|
|||||||
inline boost::shared_ptr<CCsdProject> CCsdDatabaseWrapper::GetCsdProject(const Hedgehog::Base::CSharedString& in_rName)
|
inline boost::shared_ptr<CCsdProject> CCsdDatabaseWrapper::GetCsdProject(const Hedgehog::Base::CSharedString& in_rName)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<CCsdProject> spCsdProject;
|
boost::shared_ptr<CCsdProject> spCsdProject;
|
||||||
GuestToHostFunction<void>(0x825E2B40, &in_rName, this, &spCsdProject, 0);
|
GuestToHostFunction<void>(sub_825E2B40, &in_rName, this, &spCsdProject, 0);
|
||||||
return spCsdProject;
|
return spCsdProject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CCameraController : public Hedgehog::Universe::CStateMachineBase::CStateBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x04);
|
||||||
|
be<float> m_FieldOfView;
|
||||||
|
SWA_INSERT_PADDING(0x68);
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CCameraController, m_FieldOfView, 0x64);
|
||||||
|
SWA_ASSERT_SIZEOF(CCameraController, 0xD0);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Hedgehog/Math/Vector.h>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CCharacterProxy
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x120);
|
||||||
|
Hedgehog::Math::CVector m_Position;
|
||||||
|
Hedgehog::Math::CVector m_Velocity;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CExStageBoss
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class CStateBase;
|
||||||
|
class CStateBattle;
|
||||||
|
|
||||||
|
class CExStageBossStateContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x14C);
|
||||||
|
be<float> m_SplineProgress;
|
||||||
|
SWA_INSERT_PADDING(0x0C);
|
||||||
|
be<float> m_SplineSpeed;
|
||||||
|
SWA_INSERT_PADDING(0x28);
|
||||||
|
be<float> m_Field188;
|
||||||
|
be<float> m_Field18C;
|
||||||
|
SWA_INSERT_PADDING(0x21);
|
||||||
|
bool m_IsBattleStart;
|
||||||
|
SWA_INSERT_PADDING(0x36E);
|
||||||
|
be<float> m_Field520;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_SplineProgress, 0x14C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_SplineSpeed, 0x15C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_Field188, 0x188);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_Field18C, 0x18C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_IsBattleStart, 0x1B1);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CExStageBossStateContext, m_Field520, 0x520);
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
#include "SWA/ExtraStage/Tails/Enemy/Boss/ExStageBoss.h"
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CExStageBoss::CStateBase : public Hedgehog::Universe::CStateMachineBase::CStateBase {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
#include "SWA/ExtraStage/Tails/Enemy/Boss/ExStageBoss.h"
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CExStageBoss::CStateBattle : public CExStageBoss::CStateBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x08);
|
||||||
|
be<float> m_Field68;
|
||||||
|
be<float> m_FramesSinceLastMissile;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CStateBattle, m_Field68, 0x68);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExStageBoss::CStateBattle, m_FramesSinceLastMissile, 0x6C);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CExPlayerTails
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class CExPlayerTailsStateContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x1F8);
|
||||||
|
be<float> m_SplineBossStart;
|
||||||
|
be<float> m_SplineEnd;
|
||||||
|
SWA_INSERT_PADDING(0x30);
|
||||||
|
be<float> m_SplineProgress;
|
||||||
|
SWA_INSERT_PADDING(0x10);
|
||||||
|
xpointer<void> m_Field244;
|
||||||
|
SWA_INSERT_PADDING(0x18);
|
||||||
|
be<float> m_SplineSpeed;
|
||||||
|
SWA_INSERT_PADDING(0x0C);
|
||||||
|
be<uint32_t> m_State; // 0 - Intro; 1 - Boss Intro; 3 - Boss
|
||||||
|
};
|
||||||
|
|
||||||
|
class CStateBase : public Hedgehog::Universe::CStateMachineBase::CStateBase {};
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_SplineBossStart, 0x1F8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_SplineEnd, 0x1FC);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_SplineProgress, 0x230);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_Field244, 0x244);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_SplineSpeed, 0x260);
|
||||||
|
SWA_ASSERT_OFFSETOF(CExPlayerTails::CExPlayerTailsStateContext, m_State, 0x270);
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
struct SGlobals
|
||||||
|
{
|
||||||
|
// ms_DrawLightFieldSamplingPoint: サンプリング点をデバッグ表示
|
||||||
|
static inline bool* ms_DrawLightFieldSamplingPoint;
|
||||||
|
|
||||||
|
// ms_IgnoreLightFieldData: データを無視する
|
||||||
|
static inline bool* ms_IgnoreLightFieldData;
|
||||||
|
|
||||||
|
// IsCollisionRender
|
||||||
|
static inline bool* ms_IsCollisionRender;
|
||||||
|
|
||||||
|
// N/A
|
||||||
|
static inline bool* ms_IsLoading;
|
||||||
|
|
||||||
|
// IsObjectCollisionRender
|
||||||
|
static inline bool* ms_IsObjectCollisionRender;
|
||||||
|
|
||||||
|
// ms_IsRenderDebugDraw: デバッグ描画
|
||||||
|
static inline bool* ms_IsRenderDebugDraw;
|
||||||
|
|
||||||
|
// ms_IsRenderDebugDrawText: デバッグ文字描画
|
||||||
|
static inline bool* ms_IsRenderDebugDrawText;
|
||||||
|
|
||||||
|
// ms_IsRenderDebugPositionDraw: デバッグ位置描画
|
||||||
|
static inline bool* ms_IsRenderDebugPositionDraw;
|
||||||
|
|
||||||
|
// ms_IsRenderGameMainHud: ゲームメインHUD 描画
|
||||||
|
static inline bool* ms_IsRenderGameMainHud;
|
||||||
|
|
||||||
|
// ms_IsRenderHud: 全 HUD 描画
|
||||||
|
static inline bool* ms_IsRenderHud;
|
||||||
|
|
||||||
|
// ms_IsRenderHudPause: ポーズメニュー 描画
|
||||||
|
static inline bool* ms_IsRenderHudPause;
|
||||||
|
|
||||||
|
// IsTriggerRender
|
||||||
|
static inline bool* ms_IsTriggerRender;
|
||||||
|
|
||||||
|
// ms_LightFieldDebug: 値をデバッグ表示
|
||||||
|
static inline bool* ms_LightFieldDebug;
|
||||||
|
|
||||||
|
// VisualizeLoadedLevel: ミップレベルを視覚化 赤=0, 緑=1, 青=2, 黄=未ロード
|
||||||
|
static inline bool* ms_VisualizeLoadedLevel;
|
||||||
|
|
||||||
|
static void Init()
|
||||||
|
{
|
||||||
|
ms_DrawLightFieldSamplingPoint = (bool*)MmGetHostAddress(0x83367BCE);
|
||||||
|
ms_IgnoreLightFieldData = (bool*)MmGetHostAddress(0x83367BCF);
|
||||||
|
ms_IsCollisionRender = (bool*)MmGetHostAddress(0x833678A6);
|
||||||
|
ms_IsLoading = (bool*)MmGetHostAddress(0x83367A4C);
|
||||||
|
ms_IsObjectCollisionRender = (bool*)MmGetHostAddress(0x83367905);
|
||||||
|
ms_IsRenderDebugDraw = (bool*)MmGetHostAddress(0x8328BB23);
|
||||||
|
ms_IsRenderDebugDrawText = (bool*)MmGetHostAddress(0x8328BB25);
|
||||||
|
ms_IsRenderDebugPositionDraw = (bool*)MmGetHostAddress(0x8328BB24);
|
||||||
|
ms_IsRenderGameMainHud = (bool*)MmGetHostAddress(0x8328BB27);
|
||||||
|
ms_IsRenderHud = (bool*)MmGetHostAddress(0x8328BB26);
|
||||||
|
ms_IsRenderHudPause = (bool*)MmGetHostAddress(0x8328BB28);
|
||||||
|
ms_IsTriggerRender = (bool*)MmGetHostAddress(0x83367904);
|
||||||
|
ms_LightFieldDebug = (bool*)MmGetHostAddress(0x83367BCD);
|
||||||
|
ms_VisualizeLoadedLevel = (bool*)MmGetHostAddress(0x833678C1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,6 +4,15 @@
|
|||||||
|
|
||||||
namespace SWA
|
namespace SWA
|
||||||
{
|
{
|
||||||
|
enum EWindowStatus : uint32_t
|
||||||
|
{
|
||||||
|
eWindowStatus_Closed,
|
||||||
|
eWindowStatus_OpeningMessage = 2,
|
||||||
|
eWindowStatus_DisplayingMessage,
|
||||||
|
eWindowStatus_OpeningControls,
|
||||||
|
eWindowStatus_DisplayingControls
|
||||||
|
};
|
||||||
|
|
||||||
class CGeneralWindow
|
class CGeneralWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -14,5 +23,20 @@ namespace SWA
|
|||||||
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcWindow_2;
|
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcWindow_2;
|
||||||
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcWindowSelect;
|
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcWindowSelect;
|
||||||
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcFooter;
|
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcFooter;
|
||||||
|
SWA_INSERT_PADDING(0x58);
|
||||||
|
be<EWindowStatus> m_Status;
|
||||||
|
be<uint32_t> m_CursorIndex;
|
||||||
|
SWA_INSERT_PADDING(0x04);
|
||||||
|
be<uint32_t> m_SelectedIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcGeneral, 0xD0);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcBg, 0xD8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcWindow, 0xE0);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcWindow_2, 0xE8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcWindowSelect, 0xF0);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_rcFooter, 0xF8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_Status, 0x158);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_CursorIndex, 0x15C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGeneralWindow, m_SelectedIndex, 0x164);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,20 @@ namespace SWA
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0xD8);
|
SWA_INSERT_PADDING(0xD8);
|
||||||
be<uint32_t> m_pUnk;
|
be<uint32_t> m_FieldD8;
|
||||||
SWA_INSERT_PADDING(0x3C);
|
SWA_INSERT_PADDING(0x3C);
|
||||||
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcNightToDay;
|
Chao::CSD::RCPtr<Chao::CSD::CScene> m_rcNightToDay;
|
||||||
SWA_INSERT_PADDING(0x0C);
|
SWA_INSERT_PADDING(0x0C);
|
||||||
be<uint32_t> m_IsVisible;
|
be<uint32_t> m_IsVisible;
|
||||||
SWA_INSERT_PADDING(0x0C);
|
SWA_INSERT_PADDING(0x0C);
|
||||||
be<ELoadingDisplayType> m_LoadingDisplayType;
|
be<ELoadingDisplayType> m_LoadingDisplayType;
|
||||||
SWA_INSERT_PADDING(0x65);
|
SWA_INSERT_PADDING(0x61);
|
||||||
bool m_IsNightToDay;
|
bool m_IsNightToDay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CLoading, m_FieldD8, 0xD8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CLoading, m_rcNightToDay, 0x118);
|
||||||
|
SWA_ASSERT_OFFSETOF(CLoading, m_IsVisible, 0x12C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CLoading, m_LoadingDisplayType, 0x13C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CLoading, m_IsNightToDay, 0x1A1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ namespace SWA
|
|||||||
class CHudPause : public CGameObject
|
class CHudPause : public CGameObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
xpointer<void> m_pVftable;
|
SWA_INSERT_PADDING(0x30);
|
||||||
SWA_INSERT_PADDING(0x2C);
|
|
||||||
RCPtr<CProject> m_rcPause;
|
RCPtr<CProject> m_rcPause;
|
||||||
RCPtr<CScene> m_rcBg;
|
RCPtr<CScene> m_rcBg;
|
||||||
RCPtr<CScene> m_rcBg1;
|
RCPtr<CScene> m_rcBg1;
|
||||||
@@ -58,12 +57,32 @@ namespace SWA
|
|||||||
RCPtr<CScene> m_rcBg1Select_2;
|
RCPtr<CScene> m_rcBg1Select_2;
|
||||||
RCPtr<CScene> m_rcStatusTitle;
|
RCPtr<CScene> m_rcStatusTitle;
|
||||||
RCPtr<CScene> m_rcFooterA;
|
RCPtr<CScene> m_rcFooterA;
|
||||||
SWA_INSERT_PADDING(0x5C);
|
SWA_INSERT_PADDING(0x59);
|
||||||
|
bool m_IsVisible;
|
||||||
|
SWA_INSERT_PADDING(0x02);
|
||||||
be<EActionType> m_Action;
|
be<EActionType> m_Action;
|
||||||
be<EMenuType> m_Menu;
|
be<EMenuType> m_Menu;
|
||||||
be<EStatusType> m_Status;
|
be<EStatusType> m_Status;
|
||||||
be<ETransitionType> m_Transition;
|
be<ETransitionType> m_Transition;
|
||||||
SWA_INSERT_PADDING(0x20);
|
SWA_INSERT_PADDING(0x04);
|
||||||
|
be<uint32_t> m_Submenu;
|
||||||
|
SWA_INSERT_PADDING(0x18);
|
||||||
bool m_IsShown;
|
bool m_IsShown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcPause, 0xEC);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcBg, 0xF4);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcBg1, 0xFC);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcBg1_2, 0x104);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcBg1Select, 0x10C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcBg1Select_2, 0x114);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcStatusTitle, 0x11C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_rcFooterA, 0x124);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_IsVisible, 0x185);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_Action, 0x188);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_Menu, 0x18C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_Status, 0x190);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_Transition, 0x194);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_Submenu, 0x19C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CHudPause, m_IsShown, 0x1B8);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CMenuWindowBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x10);
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CObjDashPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0xE8);
|
||||||
|
be<float> m_FieldE8;
|
||||||
|
be<float> m_Speed;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -34,7 +34,9 @@ namespace SWA
|
|||||||
SWA_INSERT_PADDING(0x88);
|
SWA_INSERT_PADDING(0x88);
|
||||||
Hedgehog::Base::CSharedString m_StageName;
|
Hedgehog::Base::CSharedString m_StageName;
|
||||||
xpointer<CSoundAdministrator> m_pSoundAdministrator;
|
xpointer<CSoundAdministrator> m_pSoundAdministrator;
|
||||||
SWA_INSERT_PADDING(0x124);
|
SWA_INSERT_PADDING(0x48);
|
||||||
|
xpointer<CGeneralWindow> m_pGeneralWindow;
|
||||||
|
SWA_INSERT_PADDING(0xD8);
|
||||||
SScoreInfo m_ScoreInfo;
|
SScoreInfo m_ScoreInfo;
|
||||||
SWA_INSERT_PADDING(0x0C);
|
SWA_INSERT_PADDING(0x0C);
|
||||||
};
|
};
|
||||||
@@ -60,6 +62,7 @@ namespace SWA
|
|||||||
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_spDatabase, 0x1C);
|
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_spDatabase, 0x1C);
|
||||||
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_StageName, 0xAC);
|
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_StageName, 0xAC);
|
||||||
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_pSoundAdministrator, 0xB0);
|
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_pSoundAdministrator, 0xB0);
|
||||||
|
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_pGeneralWindow, 0xFC);
|
||||||
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_ScoreInfo, 0x1D8);
|
SWA_ASSERT_OFFSETOF(CGameDocument::CMember, m_ScoreInfo, 0x1D8);
|
||||||
SWA_ASSERT_SIZEOF(CGameDocument::CMember, 0x230);
|
SWA_ASSERT_SIZEOF(CGameDocument::CMember, 0x230);
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
|
|
||||||
namespace SWA
|
namespace SWA
|
||||||
{
|
{
|
||||||
class CGameMode // : Hedgehog::Universe::TStateMachine<SWA::CGame>::TState
|
class CGameMode : public Hedgehog::Universe::CStateMachineBase::CStateBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x60); // base
|
|
||||||
SWA_INSERT_PADDING(0x08);
|
SWA_INSERT_PADDING(0x08);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CGameModeStageTitle : public CGameModeStage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x0E);
|
||||||
|
bool m_IsPlayingAdvertiseMovie;
|
||||||
|
be<float> m_AdvertiseMovieWaitTime;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,10 +4,36 @@
|
|||||||
|
|
||||||
namespace SWA
|
namespace SWA
|
||||||
{
|
{
|
||||||
class CTitleMenu
|
class CTitleMenu : public CMenuWindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x44);
|
SWA_INSERT_PADDING(0x28);
|
||||||
|
be<uint32_t> m_Field38;
|
||||||
|
bool m_Field3C; // Seems to be related to exit transition.
|
||||||
|
SWA_INSERT_PADDING(0x04);
|
||||||
be<uint32_t> m_CursorIndex;
|
be<uint32_t> m_CursorIndex;
|
||||||
|
SWA_INSERT_PADDING(0x0C);
|
||||||
|
bool m_Field54; // Seems to be related to exit transition.
|
||||||
|
SWA_INSERT_PADDING(0x0B);
|
||||||
|
be<float> m_Field60;
|
||||||
|
SWA_INSERT_PADDING(0x34);
|
||||||
|
bool m_Field98;
|
||||||
|
bool m_IsDeleteCheckMessageOpen;
|
||||||
|
bool m_Field9A; // Seems to be related to cursor selection.
|
||||||
|
SWA_INSERT_PADDING(0x04);
|
||||||
|
bool m_Field9F;
|
||||||
|
SWA_INSERT_PADDING(0x02);
|
||||||
|
bool m_IsDLCInfoMessageOpen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field38, 0x38);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field3C, 0x3C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_CursorIndex, 0x44);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field54, 0x54);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field60, 0x60);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field98, 0x98);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_IsDeleteCheckMessageOpen, 0x99);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field9A, 0x9A);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_Field9F, 0x9F);
|
||||||
|
SWA_ASSERT_OFFSETOF(CTitleMenu, m_IsDLCInfoMessageOpen, 0xA2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,19 +4,14 @@
|
|||||||
|
|
||||||
namespace SWA
|
namespace SWA
|
||||||
{
|
{
|
||||||
class CTitleStateBase // : Hedgehog::Universe::TStateMachine<SWA::CTitleManager>::TState
|
class CTitleStateBase : public Hedgehog::Universe::CStateMachineBase::CStateBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class CMember
|
class CTitleStateContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SWA_INSERT_PADDING(0x1E8);
|
SWA_INSERT_PADDING(0x1E8);
|
||||||
xpointer<CTitleMenu> m_pTitleMenu;
|
xpointer<CTitleMenu> m_pTitleMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
SWA_INSERT_PADDING(0x08);
|
|
||||||
xpointer<CMember> m_pMember;
|
|
||||||
SWA_INSERT_PADDING(0x5C);
|
|
||||||
be<uint32_t> m_State;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CTitleStateIntro : public CTitleStateBase {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CTitleStateMenu : public CTitleStateBase {};
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
#include <SWA/System/GameMode/WorldMap/WorldMapCursor.h>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CTitleStateWorldMap : public CTitleStateBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x08);
|
||||||
|
xpointer<CWorldMapCursor> m_pWorldMapCursor;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CWorldMapCamera : public CCameraController
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
be<float> m_Pitch;
|
||||||
|
be<float> m_Yaw;
|
||||||
|
be<float> m_Distance;
|
||||||
|
be<float> m_RotationSpeed;
|
||||||
|
SWA_INSERT_PADDING(0x08);
|
||||||
|
bool m_CanMove;
|
||||||
|
SWA_INSERT_PADDING(0x34);
|
||||||
|
be<float> m_TiltToEarthTransitionSpeed;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_Pitch, 0xD0);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_Yaw, 0xD4);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_Distance, 0xD8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_RotationSpeed, 0xDC);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_CanMove, 0xE8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCamera, m_TiltToEarthTransitionSpeed, 0x120);
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CWorldMapCursor : public CMenuWindowBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0x24);
|
||||||
|
be<float> m_LeftStickVertical;
|
||||||
|
be<float> m_LeftStickHorizontal;
|
||||||
|
bool m_IsCursorMoving;
|
||||||
|
SWA_INSERT_PADDING(0x07);
|
||||||
|
be<float> m_CursorY;
|
||||||
|
be<float> m_CursorX;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCursor, m_LeftStickVertical, 0x34);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCursor, m_LeftStickHorizontal, 0x38);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCursor, m_IsCursorMoving, 0x3C);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCursor, m_CursorY, 0x44);
|
||||||
|
SWA_ASSERT_OFFSETOF(CWorldMapCursor, m_CursorX, 0x48);
|
||||||
|
}
|
||||||
@@ -115,7 +115,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
shared_ptr() : px(nullptr), pn(nullptr) {}
|
shared_ptr() : px(), pn() {}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
explicit shared_ptr(T* p) = delete;
|
explicit shared_ptr(T* p) = delete;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <app.h>
|
#include "app.h"
|
||||||
|
#include <api/SWA.h>
|
||||||
#include <gpu/video.h>
|
#include <gpu/video.h>
|
||||||
#include <install/installer.h>
|
#include <install/installer.h>
|
||||||
#include <kernel/function.h>
|
#include <kernel/function.h>
|
||||||
@@ -7,6 +8,8 @@
|
|||||||
#include <patches/inspire_patches.h>
|
#include <patches/inspire_patches.h>
|
||||||
#include <ui/game_window.h>
|
#include <ui/game_window.h>
|
||||||
#include <user/config.h>
|
#include <user/config.h>
|
||||||
|
#include <user/paths.h>
|
||||||
|
#include <user/registry.h>
|
||||||
|
|
||||||
void App::Restart(std::vector<std::string> restartArgs)
|
void App::Restart(std::vector<std::string> restartArgs)
|
||||||
{
|
{
|
||||||
@@ -33,6 +36,9 @@ PPC_FUNC(sub_824EB490)
|
|||||||
App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath());
|
App::s_isMissingDLC = !Installer::checkAllDLC(GetGamePath());
|
||||||
App::s_language = Config::Language;
|
App::s_language = Config::Language;
|
||||||
|
|
||||||
|
SWA::SGlobals::Init();
|
||||||
|
Registry::Save();
|
||||||
|
|
||||||
__imp__sub_824EB490(ctx, base);
|
__imp__sub_824EB490(ctx, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public:
|
|||||||
static inline bool s_isMissingDLC;
|
static inline bool s_isMissingDLC;
|
||||||
static inline bool s_isLoading;
|
static inline bool s_isLoading;
|
||||||
static inline bool s_isWerehog;
|
static inline bool s_isWerehog;
|
||||||
|
static inline bool s_isSaveDataCorrupt;
|
||||||
|
|
||||||
static inline ELanguage s_language;
|
static inline ELanguage s_language;
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,10 @@
|
|||||||
// Number of samples in a frame
|
// Number of samples in a frame
|
||||||
#define XAUDIO_NUM_SAMPLES 256
|
#define XAUDIO_NUM_SAMPLES 256
|
||||||
|
|
||||||
#ifdef SWA_IMPL
|
|
||||||
void XAudioInitializeSystem();
|
void XAudioInitializeSystem();
|
||||||
void XAudioRegisterClient(PPCFunc* callback, uint32_t param);
|
void XAudioRegisterClient(PPCFunc* callback, uint32_t param);
|
||||||
void XAudioSubmitFrame(void* samples);
|
void XAudioSubmitFrame(void* samples);
|
||||||
#endif
|
void XAudioConfigValueChangedCallback(class IConfigDef* configDef);
|
||||||
|
|
||||||
uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>* driver);
|
uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>* driver);
|
||||||
uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver);
|
uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver);
|
||||||
|
|||||||
@@ -1,26 +1,29 @@
|
|||||||
#include "sdl2_driver.h"
|
#include <apu/audio.h>
|
||||||
#include <cpu/guest_thread.h>
|
#include <cpu/guest_thread.h>
|
||||||
#include <kernel/heap.h>
|
#include <kernel/heap.h>
|
||||||
|
#include <user/config.h>
|
||||||
|
|
||||||
static PPCFunc* g_clientCallback{};
|
static PPCFunc* g_clientCallback{};
|
||||||
static uint32_t g_clientCallbackParam{}; // pointer in guest memory
|
static uint32_t g_clientCallbackParam{}; // pointer in guest memory
|
||||||
static SDL_AudioDeviceID g_audioDevice{};
|
static SDL_AudioDeviceID g_audioDevice{};
|
||||||
static bool g_downMixToStereo;
|
static bool g_downMixToStereo;
|
||||||
|
|
||||||
void XAudioInitializeSystem()
|
static void CreateAudioDevice()
|
||||||
{
|
{
|
||||||
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "playback");
|
if (g_audioDevice != NULL)
|
||||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "Unleashed Recompiled");
|
SDL_CloseAudioDevice(g_audioDevice);
|
||||||
SDL_InitSubSystem(SDL_INIT_AUDIO);
|
|
||||||
|
bool surround = Config::ChannelConfiguration == EChannelConfiguration::Surround;
|
||||||
|
int allowedChanges = surround ? SDL_AUDIO_ALLOW_CHANNELS_CHANGE : 0;
|
||||||
|
|
||||||
SDL_AudioSpec desired{}, obtained{};
|
SDL_AudioSpec desired{}, obtained{};
|
||||||
desired.freq = XAUDIO_SAMPLES_HZ;
|
desired.freq = XAUDIO_SAMPLES_HZ;
|
||||||
desired.format = AUDIO_F32SYS;
|
desired.format = AUDIO_F32SYS;
|
||||||
desired.channels = XAUDIO_NUM_CHANNELS;
|
desired.channels = surround ? XAUDIO_NUM_CHANNELS : 2;
|
||||||
desired.samples = XAUDIO_NUM_SAMPLES;
|
desired.samples = XAUDIO_NUM_SAMPLES;
|
||||||
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, SDL_AUDIO_ALLOW_CHANNELS_CHANGE);
|
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, allowedChanges);
|
||||||
|
|
||||||
if (obtained.channels != 2 && obtained.channels != XAUDIO_NUM_CHANNELS)
|
if (obtained.channels != 2 && obtained.channels != XAUDIO_NUM_CHANNELS) // This check may fail only when surround sound is enabled.
|
||||||
{
|
{
|
||||||
SDL_CloseAudioDevice(g_audioDevice);
|
SDL_CloseAudioDevice(g_audioDevice);
|
||||||
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, 0);
|
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, 0);
|
||||||
@@ -29,7 +32,16 @@ void XAudioInitializeSystem()
|
|||||||
g_downMixToStereo = (obtained.channels == 2);
|
g_downMixToStereo = (obtained.channels == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XAudioInitializeSystem()
|
||||||
|
{
|
||||||
|
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "playback");
|
||||||
|
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "Unleashed Recompiled");
|
||||||
|
SDL_InitSubSystem(SDL_INIT_AUDIO);
|
||||||
|
CreateAudioDevice();
|
||||||
|
}
|
||||||
|
|
||||||
static std::unique_ptr<std::thread> g_audioThread;
|
static std::unique_ptr<std::thread> g_audioThread;
|
||||||
|
static volatile bool g_audioThreadShouldExit;
|
||||||
|
|
||||||
static void AudioThread()
|
static void AudioThread()
|
||||||
{
|
{
|
||||||
@@ -39,7 +51,7 @@ static void AudioThread()
|
|||||||
|
|
||||||
size_t channels = g_downMixToStereo ? 2 : XAUDIO_NUM_CHANNELS;
|
size_t channels = g_downMixToStereo ? 2 : XAUDIO_NUM_CHANNELS;
|
||||||
|
|
||||||
while (true)
|
while (!g_audioThreadShouldExit)
|
||||||
{
|
{
|
||||||
uint32_t queuedAudioSize = SDL_GetQueuedAudioSize(g_audioDevice);
|
uint32_t queuedAudioSize = SDL_GetQueuedAudioSize(g_audioDevice);
|
||||||
constexpr size_t MAX_LATENCY = 10;
|
constexpr size_t MAX_LATENCY = 10;
|
||||||
@@ -62,6 +74,13 @@ static void AudioThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CreateAudioThread()
|
||||||
|
{
|
||||||
|
SDL_PauseAudioDevice(g_audioDevice, 0);
|
||||||
|
g_audioThreadShouldExit = false;
|
||||||
|
g_audioThread = std::make_unique<std::thread>(AudioThread);
|
||||||
|
}
|
||||||
|
|
||||||
void XAudioRegisterClient(PPCFunc* callback, uint32_t param)
|
void XAudioRegisterClient(PPCFunc* callback, uint32_t param)
|
||||||
{
|
{
|
||||||
auto* pClientParam = static_cast<uint32_t*>(g_userHeap.Alloc(sizeof(param)));
|
auto* pClientParam = static_cast<uint32_t*>(g_userHeap.Alloc(sizeof(param)));
|
||||||
@@ -70,12 +89,13 @@ void XAudioRegisterClient(PPCFunc* callback, uint32_t param)
|
|||||||
g_clientCallbackParam = g_memory.MapVirtual(pClientParam);
|
g_clientCallbackParam = g_memory.MapVirtual(pClientParam);
|
||||||
g_clientCallback = callback;
|
g_clientCallback = callback;
|
||||||
|
|
||||||
SDL_PauseAudioDevice(g_audioDevice, 0);
|
CreateAudioThread();
|
||||||
g_audioThread = std::make_unique<std::thread>(AudioThread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSubmitFrame(void* samples)
|
void XAudioSubmitFrame(void* samples)
|
||||||
{
|
{
|
||||||
|
auto floatSamples = reinterpret_cast<be<float>*>(samples);
|
||||||
|
|
||||||
if (g_downMixToStereo)
|
if (g_downMixToStereo)
|
||||||
{
|
{
|
||||||
// 0: left 1.0f, right 0.0f
|
// 0: left 1.0f, right 0.0f
|
||||||
@@ -85,8 +105,6 @@ void XAudioSubmitFrame(void* samples)
|
|||||||
// 4: left 1.0f, right 0.0f
|
// 4: left 1.0f, right 0.0f
|
||||||
// 5: left 0.0f, right 1.0f
|
// 5: left 0.0f, right 1.0f
|
||||||
|
|
||||||
auto floatSamples = reinterpret_cast<be<float>*>(samples);
|
|
||||||
|
|
||||||
std::array<float, 2 * XAUDIO_NUM_SAMPLES> audioFrames;
|
std::array<float, 2 * XAUDIO_NUM_SAMPLES> audioFrames;
|
||||||
|
|
||||||
for (size_t i = 0; i < XAUDIO_NUM_SAMPLES; i++)
|
for (size_t i = 0; i < XAUDIO_NUM_SAMPLES; i++)
|
||||||
@@ -98,24 +116,37 @@ void XAudioSubmitFrame(void* samples)
|
|||||||
float ch4 = floatSamples[4 * XAUDIO_NUM_SAMPLES + i];
|
float ch4 = floatSamples[4 * XAUDIO_NUM_SAMPLES + i];
|
||||||
float ch5 = floatSamples[5 * XAUDIO_NUM_SAMPLES + i];
|
float ch5 = floatSamples[5 * XAUDIO_NUM_SAMPLES + i];
|
||||||
|
|
||||||
audioFrames[i * 2 + 0] = ch0 + ch2 * 0.75f + ch4;
|
audioFrames[i * 2 + 0] = (ch0 + ch2 * 0.75f + ch4) * Config::MasterVolume;
|
||||||
audioFrames[i * 2 + 1] = ch1 + ch2 * 0.75f + ch5;
|
audioFrames[i * 2 + 1] = (ch1 + ch2 * 0.75f + ch5) * Config::MasterVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_QueueAudio(g_audioDevice, &audioFrames, sizeof(audioFrames));
|
SDL_QueueAudio(g_audioDevice, &audioFrames, sizeof(audioFrames));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto rawSamples = reinterpret_cast<be<uint32_t>*>(samples);
|
std::array<float, XAUDIO_NUM_CHANNELS * XAUDIO_NUM_SAMPLES> audioFrames;
|
||||||
|
|
||||||
std::array<uint32_t, XAUDIO_NUM_CHANNELS * XAUDIO_NUM_SAMPLES> audioFrames;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < XAUDIO_NUM_SAMPLES; i++)
|
for (size_t i = 0; i < XAUDIO_NUM_SAMPLES; i++)
|
||||||
{
|
{
|
||||||
for (size_t j = 0; j < XAUDIO_NUM_CHANNELS; j++)
|
for (size_t j = 0; j < XAUDIO_NUM_CHANNELS; j++)
|
||||||
audioFrames[i * XAUDIO_NUM_CHANNELS + j] = rawSamples[j * XAUDIO_NUM_SAMPLES + i];
|
audioFrames[i * XAUDIO_NUM_CHANNELS + j] = floatSamples[j * XAUDIO_NUM_SAMPLES + i] * Config::MasterVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_QueueAudio(g_audioDevice, &audioFrames, sizeof(audioFrames));
|
SDL_QueueAudio(g_audioDevice, &audioFrames, sizeof(audioFrames));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XAudioConfigValueChangedCallback(IConfigDef* configDef)
|
||||||
|
{
|
||||||
|
if (configDef == &Config::ChannelConfiguration)
|
||||||
|
{
|
||||||
|
if (g_audioThread->joinable())
|
||||||
|
{
|
||||||
|
g_audioThreadShouldExit = true;
|
||||||
|
g_audioThread->join();
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateAudioDevice();
|
||||||
|
CreateAudioThread();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <apu/audio.h>
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
#include <stdafx.h>
|
|
||||||
#include "xaudio_driver.h"
|
|
||||||
#include <xaudio2.h>
|
|
||||||
#include <cpu/guest_thread.h>
|
|
||||||
#include <cpu/ppc_context.h>
|
|
||||||
#include <kernel/heap.h>
|
|
||||||
|
|
||||||
#define XAUDIO_DRIVER_KEY (uint32_t)('XAUD')
|
|
||||||
|
|
||||||
PPCFunc* volatile g_clientCallback{};
|
|
||||||
DWORD g_clientCallbackParam{}; // pointer in guest memory
|
|
||||||
DWORD g_driverThread{};
|
|
||||||
|
|
||||||
// TODO: Should use a counted ptr
|
|
||||||
IXAudio2* g_audio{};
|
|
||||||
IXAudio2MasteringVoice* g_masteringVoice{};
|
|
||||||
IXAudio2SourceVoice* g_sourceVoice{};
|
|
||||||
|
|
||||||
constexpr uint32_t g_semaphoreCount = 16;
|
|
||||||
constexpr uint32_t g_audioFrameSize = 256 * 6;
|
|
||||||
HANDLE g_audioSemaphore{ CreateSemaphoreA(nullptr, g_semaphoreCount, g_semaphoreCount, nullptr) };
|
|
||||||
uint32_t g_audioFrames[g_audioFrameSize * g_semaphoreCount];
|
|
||||||
uint32_t g_audioFrameIndex = 0;
|
|
||||||
|
|
||||||
class VoiceCallback : public IXAudio2VoiceCallback
|
|
||||||
{
|
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32 BytesRequired) override {}
|
|
||||||
STDMETHOD_(void, OnVoiceProcessingPassEnd)() override {}
|
|
||||||
|
|
||||||
STDMETHOD_(void, OnBufferStart)(void* pBufferContext) override {}
|
|
||||||
STDMETHOD_(void, OnBufferEnd)(void* pBufferContext) override
|
|
||||||
{
|
|
||||||
ReleaseSemaphore(g_audioSemaphore, 1, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
STDMETHOD_(void, OnStreamEnd)() override {}
|
|
||||||
|
|
||||||
STDMETHOD_(void, OnLoopEnd)(void* pBufferContext) override {}
|
|
||||||
STDMETHOD_(void, OnVoiceError)(void* pBufferContext, HRESULT Error) override {}
|
|
||||||
} gVoiceCallback;
|
|
||||||
|
|
||||||
PPC_FUNC(DriverLoop)
|
|
||||||
{
|
|
||||||
GuestThread::SetThreadName(GetCurrentThreadId(), "Audio Driver");
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
if (!g_clientCallback)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
WaitForSingleObject(g_audioSemaphore, INFINITE);
|
|
||||||
|
|
||||||
ctx.r3.u64 = g_clientCallbackParam;
|
|
||||||
g_clientCallback(ctx, g_memory.base);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAudioInitializeSystem()
|
|
||||||
{
|
|
||||||
if (g_audio)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//reinterpret_cast<decltype(&XAudio2Create)>(
|
|
||||||
// GetProcAddress(LoadLibraryA("XAudio2_8.dll"), "XAudio2Create"))(&gAudio, 0, 1);
|
|
||||||
|
|
||||||
XAudio2Create(&g_audio);
|
|
||||||
g_audio->CreateMasteringVoice(&g_masteringVoice);
|
|
||||||
|
|
||||||
WAVEFORMATIEEEFLOATEX format{};
|
|
||||||
format.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
|
||||||
format.Format.cbSize = sizeof(format) - sizeof(format.Format);
|
|
||||||
format.Format.nChannels = XAUDIO_NUM_CHANNELS;
|
|
||||||
format.Format.nSamplesPerSec = XAUDIO_SAMPLES_HZ;
|
|
||||||
format.Format.wBitsPerSample = XAUDIO_SAMPLE_BITS;
|
|
||||||
format.Format.nBlockAlign = (format.Format.nChannels * format.Format.wBitsPerSample) / 8;
|
|
||||||
format.Format.nAvgBytesPerSec = format.Format.nSamplesPerSec * format.Format.nBlockAlign;
|
|
||||||
|
|
||||||
format.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
|
|
||||||
format.Samples.wValidBitsPerSample = format.Format.wBitsPerSample;
|
|
||||||
format.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_CENTER | SPEAKER_FRONT_RIGHT |
|
|
||||||
SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT;
|
|
||||||
|
|
||||||
g_audio->CreateSourceVoice(&g_sourceVoice, &format.Format, 0, 1024, &gVoiceCallback);
|
|
||||||
g_sourceVoice->Start();
|
|
||||||
|
|
||||||
KeInsertHostFunction(XAUDIO_DRIVER_KEY, DriverLoop);
|
|
||||||
GuestThread::Start({ XAUDIO_DRIVER_KEY, 0, 0 }, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAudioRegisterClient(PPCFunc* callback, uint32_t param)
|
|
||||||
{
|
|
||||||
auto* pClientParam = static_cast<uint32_t*>(g_userHeap.Alloc(sizeof(param)));
|
|
||||||
ByteSwapInplace(param);
|
|
||||||
*pClientParam = param;
|
|
||||||
g_clientCallbackParam = g_memory.MapVirtual(pClientParam);
|
|
||||||
|
|
||||||
g_clientCallback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAudioSubmitFrame(void* samples)
|
|
||||||
{
|
|
||||||
uint32_t* audioFrame = &g_audioFrames[g_audioFrameSize * g_audioFrameIndex];
|
|
||||||
g_audioFrameIndex = (g_audioFrameIndex + 1) % g_semaphoreCount;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < XAUDIO_NUM_SAMPLES; i++)
|
|
||||||
{
|
|
||||||
for (size_t j = 0; j < 6; j++)
|
|
||||||
audioFrame[i * XAUDIO_NUM_CHANNELS + j] = ByteSwap(((uint32_t*)samples)[j * XAUDIO_NUM_SAMPLES + i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
XAUDIO2_BUFFER buffer{};
|
|
||||||
buffer.pAudioData = (BYTE*)audioFrame;
|
|
||||||
buffer.AudioBytes = XAUDIO_NUM_SAMPLES * XAUDIO_NUM_CHANNELS * sizeof(float);
|
|
||||||
buffer.PlayLength = XAUDIO_NUM_SAMPLES;
|
|
||||||
|
|
||||||
g_sourceVoice->SubmitSourceBuffer(&buffer);
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <apu/audio.h>
|
|
||||||
@@ -93,7 +93,7 @@ static void PlayEmbeddedSound(EmbeddedSound s)
|
|||||||
|
|
||||||
void EmbeddedPlayer::Init()
|
void EmbeddedPlayer::Init()
|
||||||
{
|
{
|
||||||
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, XAUDIO_NUM_CHANNELS, 256);
|
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, 2, 256);
|
||||||
|
|
||||||
s_isActive = true;
|
s_isActive = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,11 +165,7 @@ int GetThreadPriorityImpl(GuestThreadHandle* hThread)
|
|||||||
|
|
||||||
uint32_t SetThreadIdealProcessorImpl(GuestThreadHandle* hThread, uint32_t dwIdealProcessor)
|
uint32_t SetThreadIdealProcessorImpl(GuestThreadHandle* hThread, uint32_t dwIdealProcessor)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
return SetThreadIdealProcessor(hThread == GetKernelObject(CURRENT_THREAD_HANDLE) ? GetCurrentThread() : hThread->thread.native_handle(), dwIdealProcessor);
|
|
||||||
#else
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GUEST_FUNCTION_HOOK(sub_82DFA2E8, SetThreadNameImpl);
|
GUEST_FUNCTION_HOOK(sub_82DFA2E8, SetThreadNameImpl);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
typedef returnType _##procName(__VA_ARGS__); \
|
typedef returnType _##procName(__VA_ARGS__); \
|
||||||
_##procName* procName = (_##procName*)PROC_ADDRESS(libraryName, #procName);
|
_##procName* procName = (_##procName*)PROC_ADDRESS(libraryName, #procName);
|
||||||
|
|
||||||
|
#define STR(x) #x
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T RoundUp(const T& in_rValue, uint32_t in_round)
|
inline T RoundUp(const T& in_rValue, uint32_t in_round)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
#define IMGUI_SHADER_MODIFIER_CHECKERBOARD 2
|
#define IMGUI_SHADER_MODIFIER_CHECKERBOARD 2
|
||||||
#define IMGUI_SHADER_MODIFIER_SCANLINE_BUTTON 3
|
#define IMGUI_SHADER_MODIFIER_SCANLINE_BUTTON 3
|
||||||
#define IMGUI_SHADER_MODIFIER_TEXT_SKEW 4
|
#define IMGUI_SHADER_MODIFIER_TEXT_SKEW 4
|
||||||
#define IMGUI_SHADER_MODIFIER_MARQUEE_FADE 5
|
#define IMGUI_SHADER_MODIFIER_HORIZONTAL_MARQUEE_FADE 5
|
||||||
#define IMGUI_SHADER_MODIFIER_GRAYSCALE 6
|
#define IMGUI_SHADER_MODIFIER_VERTICAL_MARQUEE_FADE 6
|
||||||
#define IMGUI_SHADER_MODIFIER_TITLE_BEVEL 7
|
#define IMGUI_SHADER_MODIFIER_GRAYSCALE 7
|
||||||
#define IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL 8
|
#define IMGUI_SHADER_MODIFIER_TITLE_BEVEL 8
|
||||||
|
#define IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL 9
|
||||||
|
#define IMGUI_SHADER_MODIFIER_RECTANGLE_BEVEL 10
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
@@ -22,6 +24,7 @@ enum class ImGuiCallback : int32_t
|
|||||||
SetOutline = -6,
|
SetOutline = -6,
|
||||||
SetProceduralOrigin = -7,
|
SetProceduralOrigin = -7,
|
||||||
// -8 is ImDrawCallback_ResetRenderState, don't use!
|
// -8 is ImDrawCallback_ResetRenderState, don't use!
|
||||||
|
SetAdditive = -9
|
||||||
};
|
};
|
||||||
|
|
||||||
union ImGuiCallbackData
|
union ImGuiCallbackData
|
||||||
@@ -30,8 +33,10 @@ union ImGuiCallbackData
|
|||||||
{
|
{
|
||||||
float boundsMin[2];
|
float boundsMin[2];
|
||||||
float boundsMax[2];
|
float boundsMax[2];
|
||||||
uint32_t gradientTop;
|
uint32_t gradientTopLeft;
|
||||||
uint32_t gradientBottom;
|
uint32_t gradientTopRight;
|
||||||
|
uint32_t gradientBottomRight;
|
||||||
|
uint32_t gradientBottomLeft;
|
||||||
} setGradient;
|
} setGradient;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@@ -64,6 +69,11 @@ union ImGuiCallbackData
|
|||||||
{
|
{
|
||||||
float proceduralOrigin[2];
|
float proceduralOrigin[2];
|
||||||
} setProceduralOrigin;
|
} setProceduralOrigin;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool enabled;
|
||||||
|
} setAdditive;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ImGuiCallbackData* AddImGuiCallback(ImGuiCallback callback);
|
extern ImGuiCallbackData* AddImGuiCallback(ImGuiCallback callback);
|
||||||
|
|||||||
@@ -221,6 +221,8 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
|||||||
for (size_t i = 0; i < atlas->ConfigData.size(); i++)
|
for (size_t i = 0; i < atlas->ConfigData.size(); i++)
|
||||||
{
|
{
|
||||||
auto& config = atlas->ConfigData[i];
|
auto& config = atlas->ConfigData[i];
|
||||||
|
bool increaseSpacing = strstr(config.Name, "Seurat") != nullptr;
|
||||||
|
|
||||||
auto& [index, count] = ranges[i];
|
auto& [index, count] = ranges[i];
|
||||||
for (size_t j = 0; j < count; j++)
|
for (size_t j = 0; j < count; j++)
|
||||||
{
|
{
|
||||||
@@ -228,6 +230,11 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
|||||||
double x0, y0, x1, y1, u0, v0, u1, v1;
|
double x0, y0, x1, y1, u0, v0, u1, v1;
|
||||||
glyph.getQuadPlaneBounds(x0, y0, x1, y1);
|
glyph.getQuadPlaneBounds(x0, y0, x1, y1);
|
||||||
glyph.getQuadAtlasBounds(u0, v0, u1, v1);
|
glyph.getQuadAtlasBounds(u0, v0, u1, v1);
|
||||||
|
|
||||||
|
double advance = glyph.getAdvance();
|
||||||
|
if (increaseSpacing && glyph.getCodepoint() == ' ')
|
||||||
|
advance *= 1.5;
|
||||||
|
|
||||||
config.DstFont->AddGlyph(
|
config.DstFont->AddGlyph(
|
||||||
&config,
|
&config,
|
||||||
glyph.getCodepoint(),
|
glyph.getCodepoint(),
|
||||||
@@ -239,7 +246,7 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
|||||||
v1 / packer.height,
|
v1 / packer.height,
|
||||||
u1 / packer.width,
|
u1 / packer.width,
|
||||||
v0 / packer.height,
|
v0 / packer.height,
|
||||||
glyph.getAdvance());
|
advance);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.DstFont->BuildLookupTable();
|
config.DstFont->BuildLookupTable();
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
//# define D3D12_DEBUG_LAYER_GPU_BASED_VALIDATION_ENABLED
|
//# define D3D12_DEBUG_LAYER_GPU_BASED_VALIDATION_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//#define D3D12_DEBUG_SET_STABLE_POWER_STATE
|
||||||
|
|
||||||
// Old Windows SDK versions don't provide this macro, so we workaround it by making sure it is defined.
|
// Old Windows SDK versions don't provide this macro, so we workaround it by making sure it is defined.
|
||||||
#ifndef D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE
|
#ifndef D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE
|
||||||
#define D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE (D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)
|
#define D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE (D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE)
|
||||||
@@ -692,6 +694,20 @@ namespace plume {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static D3D12_RESOLVE_MODE toD3D12(RenderResolveMode resolveMode) {
|
||||||
|
switch (resolveMode) {
|
||||||
|
case RenderResolveMode::MIN:
|
||||||
|
return D3D12_RESOLVE_MODE_MIN;
|
||||||
|
case RenderResolveMode::MAX:
|
||||||
|
return D3D12_RESOLVE_MODE_MAX;
|
||||||
|
case RenderResolveMode::AVERAGE:
|
||||||
|
return D3D12_RESOLVE_MODE_AVERAGE;
|
||||||
|
default:
|
||||||
|
assert(false && "Unknown resolve mode.");
|
||||||
|
return D3D12_RESOLVE_MODE_AVERAGE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void setObjectName(ID3D12Object *object, const std::string &name) {
|
static void setObjectName(ID3D12Object *object, const std::string &name) {
|
||||||
const std::wstring wideCharName = Utf8ToUtf16(name);
|
const std::wstring wideCharName = Utf8ToUtf16(name);
|
||||||
object->SetName(wideCharName.c_str());
|
object->SetName(wideCharName.c_str());
|
||||||
@@ -1916,7 +1932,7 @@ namespace plume {
|
|||||||
resetSamplePositions();
|
resetSamplePositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12CommandList::resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect) {
|
void D3D12CommandList::resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect, RenderResolveMode resolveMode) {
|
||||||
assert(dstTexture != nullptr);
|
assert(dstTexture != nullptr);
|
||||||
assert(srcTexture != nullptr);
|
assert(srcTexture != nullptr);
|
||||||
|
|
||||||
@@ -1931,7 +1947,7 @@ namespace plume {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSamplePositions(interfaceDstTexture);
|
setSamplePositions(interfaceDstTexture);
|
||||||
d3d->ResolveSubresourceRegion(interfaceDstTexture->d3d, 0, dstX, dstY, interfaceSrcTexture->d3d, 0, (srcRect != nullptr) ? &rect : nullptr, toDXGI(interfaceDstTexture->desc.format), D3D12_RESOLVE_MODE_AVERAGE);
|
d3d->ResolveSubresourceRegion(interfaceDstTexture->d3d, 0, dstX, dstY, interfaceSrcTexture->d3d, 0, (srcRect != nullptr) ? &rect : nullptr, toDXGI(interfaceDstTexture->desc.format), toD3D12(resolveMode));
|
||||||
resetSamplePositions();
|
resetSamplePositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3324,6 +3340,14 @@ namespace plume {
|
|||||||
dynamicDepthBiasOption = d3d12Options16.DynamicDepthBiasSupported;
|
dynamicDepthBiasOption = d3d12Options16.DynamicDepthBiasSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the architecture has UMA.
|
||||||
|
bool uma = false;
|
||||||
|
D3D12_FEATURE_DATA_ARCHITECTURE1 architecture1 = {};
|
||||||
|
res = deviceOption->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1, &architecture1, sizeof(architecture1));
|
||||||
|
if (SUCCEEDED(res)) {
|
||||||
|
uma = architecture1.UMA;
|
||||||
|
}
|
||||||
|
|
||||||
// Pick this adapter and device if it has better feature support than the current one.
|
// Pick this adapter and device if it has better feature support than the current one.
|
||||||
bool preferOverNothing = (adapter == nullptr) || (d3d == nullptr);
|
bool preferOverNothing = (adapter == nullptr) || (d3d == nullptr);
|
||||||
bool preferVideoMemory = adapterDesc.DedicatedVideoMemory > description.dedicatedVideoMemory;
|
bool preferVideoMemory = adapterDesc.DedicatedVideoMemory > description.dedicatedVideoMemory;
|
||||||
@@ -3346,6 +3370,7 @@ namespace plume {
|
|||||||
capabilities.sampleLocations = samplePositionsOption;
|
capabilities.sampleLocations = samplePositionsOption;
|
||||||
capabilities.triangleFan = triangleFanSupportOption;
|
capabilities.triangleFan = triangleFanSupportOption;
|
||||||
capabilities.dynamicDepthBias = dynamicDepthBiasOption;
|
capabilities.dynamicDepthBias = dynamicDepthBiasOption;
|
||||||
|
capabilities.uma = uma;
|
||||||
description.name = Utf16ToUtf8(adapterDesc.Description);
|
description.name = Utf16ToUtf8(adapterDesc.Description);
|
||||||
description.dedicatedVideoMemory = adapterDesc.DedicatedVideoMemory;
|
description.dedicatedVideoMemory = adapterDesc.DedicatedVideoMemory;
|
||||||
|
|
||||||
@@ -3364,6 +3389,10 @@ namespace plume {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef D3D12_DEBUG_SET_STABLE_POWER_STATE
|
||||||
|
d3d->SetStablePowerState(TRUE);
|
||||||
|
#endif
|
||||||
|
|
||||||
D3D12MA::ALLOCATOR_DESC allocatorDesc = {};
|
D3D12MA::ALLOCATOR_DESC allocatorDesc = {};
|
||||||
allocatorDesc.pDevice = d3d;
|
allocatorDesc.pDevice = d3d;
|
||||||
allocatorDesc.pAdapter = adapter;
|
allocatorDesc.pAdapter = adapter;
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ namespace plume {
|
|||||||
void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) override;
|
void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) override;
|
||||||
void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
||||||
void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
||||||
void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect) override;
|
void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect, RenderResolveMode resolveMode) override;
|
||||||
void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) override;
|
void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) override;
|
||||||
void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) override;
|
void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) override;
|
||||||
void discardTexture(const RenderTexture* texture) override;
|
void discardTexture(const RenderTexture* texture) override;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace plume {
|
|||||||
virtual void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) = 0;
|
virtual void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) = 0;
|
||||||
virtual void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) = 0;
|
virtual void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) = 0;
|
||||||
virtual void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) = 0;
|
virtual void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) = 0;
|
||||||
virtual void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect = nullptr) = 0;
|
virtual void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect = nullptr, RenderResolveMode resolveMode = RenderResolveMode::AVERAGE) = 0;
|
||||||
virtual void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) = 0;
|
virtual void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) = 0;
|
||||||
virtual void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) = 0;
|
virtual void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) = 0;
|
||||||
virtual void discardTexture(const RenderTexture* texture) = 0; // D3D12 only.
|
virtual void discardTexture(const RenderTexture* texture) = 0; // D3D12 only.
|
||||||
|
|||||||
@@ -475,6 +475,20 @@ namespace plume {
|
|||||||
|
|
||||||
typedef uint32_t RenderSampleCounts;
|
typedef uint32_t RenderSampleCounts;
|
||||||
|
|
||||||
|
enum class RenderDeviceType {
|
||||||
|
UNKNOWN,
|
||||||
|
INTEGRATED,
|
||||||
|
DISCRETE,
|
||||||
|
VIRTUAL,
|
||||||
|
CPU
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class RenderResolveMode {
|
||||||
|
MIN,
|
||||||
|
MAX,
|
||||||
|
AVERAGE
|
||||||
|
};
|
||||||
|
|
||||||
// Global functions.
|
// Global functions.
|
||||||
|
|
||||||
constexpr uint32_t RenderFormatSize(RenderFormat format) {
|
constexpr uint32_t RenderFormatSize(RenderFormat format) {
|
||||||
@@ -1127,7 +1141,7 @@ namespace plume {
|
|||||||
desc.srcBlend = RenderBlend::SRC_ALPHA;
|
desc.srcBlend = RenderBlend::SRC_ALPHA;
|
||||||
desc.dstBlend = RenderBlend::INV_SRC_ALPHA;
|
desc.dstBlend = RenderBlend::INV_SRC_ALPHA;
|
||||||
desc.blendOp = RenderBlendOperation::ADD;
|
desc.blendOp = RenderBlendOperation::ADD;
|
||||||
desc.srcBlendAlpha = RenderBlend::ONE;
|
desc.srcBlendAlpha = RenderBlend::SRC_ALPHA;
|
||||||
desc.dstBlendAlpha = RenderBlend::INV_SRC_ALPHA;
|
desc.dstBlendAlpha = RenderBlend::INV_SRC_ALPHA;
|
||||||
desc.blendOpAlpha = RenderBlendOperation::ADD;
|
desc.blendOpAlpha = RenderBlendOperation::ADD;
|
||||||
return desc;
|
return desc;
|
||||||
@@ -1269,9 +1283,9 @@ namespace plume {
|
|||||||
RenderFilter minFilter = RenderFilter::LINEAR;
|
RenderFilter minFilter = RenderFilter::LINEAR;
|
||||||
RenderFilter magFilter = RenderFilter::LINEAR;
|
RenderFilter magFilter = RenderFilter::LINEAR;
|
||||||
RenderMipmapMode mipmapMode = RenderMipmapMode::LINEAR;
|
RenderMipmapMode mipmapMode = RenderMipmapMode::LINEAR;
|
||||||
RenderTextureAddressMode addressU = RenderTextureAddressMode::WRAP;
|
RenderTextureAddressMode addressU = RenderTextureAddressMode::CLAMP;
|
||||||
RenderTextureAddressMode addressV = RenderTextureAddressMode::WRAP;
|
RenderTextureAddressMode addressV = RenderTextureAddressMode::CLAMP;
|
||||||
RenderTextureAddressMode addressW = RenderTextureAddressMode::WRAP;
|
RenderTextureAddressMode addressW = RenderTextureAddressMode::CLAMP;
|
||||||
float mipLODBias = 0.0f;
|
float mipLODBias = 0.0f;
|
||||||
uint32_t maxAnisotropy = 16;
|
uint32_t maxAnisotropy = 16;
|
||||||
bool anisotropyEnabled = false;
|
bool anisotropyEnabled = false;
|
||||||
@@ -1754,6 +1768,7 @@ namespace plume {
|
|||||||
|
|
||||||
struct RenderDeviceDescription {
|
struct RenderDeviceDescription {
|
||||||
std::string name = "Unknown";
|
std::string name = "Unknown";
|
||||||
|
RenderDeviceType type = RenderDeviceType::UNKNOWN;
|
||||||
uint32_t driverVersion = 0;
|
uint32_t driverVersion = 0;
|
||||||
uint64_t dedicatedVideoMemory = 0;
|
uint64_t dedicatedVideoMemory = 0;
|
||||||
};
|
};
|
||||||
@@ -1780,6 +1795,9 @@ namespace plume {
|
|||||||
// Draw.
|
// Draw.
|
||||||
bool triangleFan = false;
|
bool triangleFan = false;
|
||||||
bool dynamicDepthBias = false;
|
bool dynamicDepthBias = false;
|
||||||
|
|
||||||
|
// UMA.
|
||||||
|
bool uma = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RenderInterfaceCapabilities {
|
struct RenderInterfaceCapabilities {
|
||||||
|
|||||||
@@ -705,6 +705,21 @@ namespace plume {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static RenderDeviceType toDeviceType(VkPhysicalDeviceType type) {
|
||||||
|
switch (type) {
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
|
||||||
|
return RenderDeviceType::INTEGRATED;
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
|
||||||
|
return RenderDeviceType::DISCRETE;
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
|
||||||
|
return RenderDeviceType::VIRTUAL;
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_CPU:
|
||||||
|
return RenderDeviceType::CPU;
|
||||||
|
default:
|
||||||
|
return RenderDeviceType::UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void setObjectName(VkDevice device, VkDebugReportObjectTypeEXT objectType, uint64_t object, const std::string &name) {
|
static void setObjectName(VkDevice device, VkDebugReportObjectTypeEXT objectType, uint64_t object, const std::string &name) {
|
||||||
# ifdef VULKAN_OBJECT_NAMES_ENABLED
|
# ifdef VULKAN_OBJECT_NAMES_ENABLED
|
||||||
VkDebugMarkerObjectNameInfoEXT nameInfo = {};
|
VkDebugMarkerObjectNameInfoEXT nameInfo = {};
|
||||||
@@ -3059,12 +3074,13 @@ namespace plume {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VulkanCommandList::resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) {
|
void VulkanCommandList::resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) {
|
||||||
resolveTextureRegion(dstTexture, 0, 0, srcTexture, nullptr);
|
resolveTextureRegion(dstTexture, 0, 0, srcTexture, nullptr, RenderResolveMode::AVERAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanCommandList::resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect) {
|
void VulkanCommandList::resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect, RenderResolveMode resolveMode) {
|
||||||
assert(dstTexture != nullptr);
|
assert(dstTexture != nullptr);
|
||||||
assert(srcTexture != nullptr);
|
assert(srcTexture != nullptr);
|
||||||
|
assert(resolveMode == RenderResolveMode::AVERAGE && "Vulkan only supports AVERAGE resolve mode.");
|
||||||
|
|
||||||
thread_local std::vector<VkImageResolve> imageResolves;
|
thread_local std::vector<VkImageResolve> imageResolves;
|
||||||
imageResolves.clear();
|
imageResolves.clear();
|
||||||
@@ -3496,6 +3512,7 @@ namespace plume {
|
|||||||
if (preferOption) {
|
if (preferOption) {
|
||||||
physicalDevice = physicalDevices[i];
|
physicalDevice = physicalDevices[i];
|
||||||
description.name = std::string(deviceProperties.deviceName);
|
description.name = std::string(deviceProperties.deviceName);
|
||||||
|
description.type = toDeviceType(deviceProperties.deviceType);
|
||||||
description.driverVersion = deviceProperties.driverVersion;
|
description.driverVersion = deviceProperties.driverVersion;
|
||||||
currentDeviceTypeScore = deviceTypeScore;
|
currentDeviceTypeScore = deviceTypeScore;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ namespace plume {
|
|||||||
void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) override;
|
void copyBuffer(const RenderBuffer *dstBuffer, const RenderBuffer *srcBuffer) override;
|
||||||
void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
void copyTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
||||||
void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
void resolveTexture(const RenderTexture *dstTexture, const RenderTexture *srcTexture) override;
|
||||||
void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect) override;
|
void resolveTextureRegion(const RenderTexture *dstTexture, uint32_t dstX, uint32_t dstY, const RenderTexture *srcTexture, const RenderRect *srcRect, RenderResolveMode resolveMode) override;
|
||||||
void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) override;
|
void buildBottomLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, const RenderBottomLevelASBuildInfo &buildInfo) override;
|
||||||
void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) override;
|
void buildTopLevelAS(const RenderAccelerationStructure *dstAccelerationStructure, RenderBufferReference scratchBuffer, RenderBufferReference instancesBuffer, const RenderTopLevelASBuildInfo &buildInfo) override;
|
||||||
void discardTexture(const RenderTexture* texture) override;
|
void discardTexture(const RenderTexture* texture) override;
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
#define g_SrcAlpha_DestAlpha vk::RawBufferLoad<float4>(g_PushConstants.PixelShaderConstants + 2400, 0x10)
|
||||||
|
#define s0_Texture2DDescriptorIndex vk::RawBufferLoad<uint>(g_PushConstants.SharedConstants + 0)
|
||||||
|
#define s0_SamplerDescriptorIndex vk::RawBufferLoad<uint>(g_PushConstants.SharedConstants + 192)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
cbuffer PixelShaderConstants : register(b1, space4)
|
||||||
|
{
|
||||||
|
float4 g_SrcAlpha_DestAlpha : packoffset(c150);
|
||||||
|
};
|
||||||
|
|
||||||
|
cbuffer SharedConstants : register(b2, space4)
|
||||||
|
{
|
||||||
|
uint s0_Texture2DDescriptorIndex : packoffset(c0.x);
|
||||||
|
uint s0_SamplerDescriptorIndex : packoffset(c12.x);
|
||||||
|
DEFINE_SHARED_CONSTANTS();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
float4 main(
|
||||||
|
in float4 iPos : SV_Position,
|
||||||
|
in float4 iTexCoord0 : TEXCOORD0) : SV_Target0
|
||||||
|
{
|
||||||
|
Texture2D<float4> texture = g_Texture2DDescriptorHeap[s0_Texture2DDescriptorIndex];
|
||||||
|
SamplerState samplerState = g_SamplerDescriptorHeap[s0_SamplerDescriptorIndex];
|
||||||
|
|
||||||
|
float4 color = texture.Sample(samplerState, iTexCoord0.xy);
|
||||||
|
|
||||||
|
if (any(or(iTexCoord0.xy < 0.0, iTexCoord0.xy > 1.0)))
|
||||||
|
color = float4(0.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
color.rgb *= color.a * g_SrcAlpha_DestAlpha.x;
|
||||||
|
color.a = g_SrcAlpha_DestAlpha.y + (1.0 - color.a) * g_SrcAlpha_DestAlpha.x;
|
||||||
|
|
||||||
|
return color;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#include "copy_common.hlsli"
|
||||||
|
|
||||||
|
Texture2D<float4> g_Texture2DDescriptorHeap[] : register(t0, space0);
|
||||||
|
|
||||||
|
float4 main(in float4 position : SV_Position) : SV_Target
|
||||||
|
{
|
||||||
|
return g_Texture2DDescriptorHeap[g_PushConstants.ResourceDescriptorIndex].Load(int3(position.xy, 0));
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct PushConstants
|
||||||
|
{
|
||||||
|
uint ResourceDescriptorIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
[[vk::push_constant]] ConstantBuffer<PushConstants> g_PushConstants : register(b3, space4);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#include "copy_common.hlsli"
|
||||||
|
|
||||||
|
Texture2D<float> g_Texture2DDescriptorHeap[] : register(t0, space0);
|
||||||
|
|
||||||
|
float main(in float4 position : SV_Position) : SV_Depth
|
||||||
|
{
|
||||||
|
return g_Texture2DDescriptorHeap[g_PushConstants.ResourceDescriptorIndex].Load(int3(position.xy, 0));
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ cbuffer SharedConstants : register(b2, space4)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float4 main(in float4 position : SV_Position, in float2 texCoord : TEXCOORD0) : SV_Target
|
float4 main(in float4 position : SV_Position, in float4 texCoord : TEXCOORD0) : SV_Target
|
||||||
{
|
{
|
||||||
Texture2D<float4> sampColor = g_Texture2DDescriptorHeap[sampColor_Texture2DDescriptorIndex];
|
Texture2D<float4> sampColor = g_Texture2DDescriptorHeap[sampColor_Texture2DDescriptorIndex];
|
||||||
Texture2D<float4> sampVelocityMap = g_Texture2DDescriptorHeap[sampVelocityMap_Texture2DDescriptorIndex];
|
Texture2D<float4> sampVelocityMap = g_Texture2DDescriptorHeap[sampVelocityMap_Texture2DDescriptorIndex];
|
||||||
@@ -48,19 +48,19 @@ float4 main(in float4 position : SV_Position, in float2 texCoord : TEXCOORD0) :
|
|||||||
SamplerState sampVelocityMap_s = g_SamplerDescriptorHeap[sampVelocityMap_SamplerDescriptorIndex];
|
SamplerState sampVelocityMap_s = g_SamplerDescriptorHeap[sampVelocityMap_SamplerDescriptorIndex];
|
||||||
SamplerState sampZBuffer_s = g_SamplerDescriptorHeap[sampZBuffer_SamplerDescriptorIndex];
|
SamplerState sampZBuffer_s = g_SamplerDescriptorHeap[sampZBuffer_SamplerDescriptorIndex];
|
||||||
|
|
||||||
float depth = sampZBuffer.SampleLevel(sampZBuffer_s, texCoord, 0).x;
|
float depth = sampZBuffer.SampleLevel(sampZBuffer_s, texCoord.xy, 0).x;
|
||||||
float4 velocityMap = sampVelocityMap.SampleLevel(sampVelocityMap_s, texCoord, 0);
|
float4 velocityMap = sampVelocityMap.SampleLevel(sampVelocityMap_s, texCoord.xy, 0);
|
||||||
float2 velocity = (velocityMap.xz + velocityMap.yw / 255.0) * 2.0 - 1.0;
|
float2 velocity = (velocityMap.xz + velocityMap.yw / 255.0) * 2.0 - 1.0;
|
||||||
|
|
||||||
int sampleCount = min(64, round(length(velocity * g_ViewportSize.xy)));
|
int sampleCount = min(64, round(length(velocity * g_ViewportSize.xy)));
|
||||||
float2 sampleOffset = velocity / (float) sampleCount;
|
float2 sampleOffset = velocity / (float) sampleCount;
|
||||||
|
|
||||||
float3 color = sampColor.SampleLevel(sampColor_s, texCoord, 0).rgb;
|
float3 color = sampColor.SampleLevel(sampColor_s, texCoord.xy, 0).rgb;
|
||||||
int count = 1;
|
int count = 1;
|
||||||
|
|
||||||
for (int i = 1; i <= sampleCount; i++)
|
for (int i = 1; i <= sampleCount; i++)
|
||||||
{
|
{
|
||||||
float2 sampleCoord = texCoord + sampleOffset * i;
|
float2 sampleCoord = texCoord.xy + sampleOffset * i;
|
||||||
float3 sampleColor = sampColor.SampleLevel(sampColor_s, sampleCoord, 0).rgb;
|
float3 sampleColor = sampColor.SampleLevel(sampColor_s, sampleCoord, 0).rgb;
|
||||||
float sampleDepth = sampZBuffer.SampleLevel(sampZBuffer_s, sampleCoord, 0).x;
|
float sampleDepth = sampZBuffer.SampleLevel(sampZBuffer_s, sampleCoord, 0).x;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ struct PushConstants
|
|||||||
{
|
{
|
||||||
float2 BoundsMin;
|
float2 BoundsMin;
|
||||||
float2 BoundsMax;
|
float2 BoundsMax;
|
||||||
uint GradientTop;
|
uint GradientTopLeft;
|
||||||
uint GradientBottom;
|
uint GradientTopRight;
|
||||||
|
uint GradientBottomRight;
|
||||||
|
uint GradientBottomLeft;
|
||||||
uint ShaderModifier;
|
uint ShaderModifier;
|
||||||
uint Texture2DDescriptorIndex;
|
uint Texture2DDescriptorIndex;
|
||||||
float2 InverseDisplaySize;
|
float2 InverseDisplaySize;
|
||||||
|
|||||||
@@ -61,16 +61,16 @@ float4 SampleLinear(float2 uvTexspace)
|
|||||||
|
|
||||||
float4 PixelAntialiasing(float2 uvTexspace)
|
float4 PixelAntialiasing(float2 uvTexspace)
|
||||||
{
|
{
|
||||||
float2 seam = floor(uvTexspace + 0.5);
|
|
||||||
uvTexspace = (uvTexspace - seam) / fwidth(uvTexspace) + seam;
|
|
||||||
uvTexspace = clamp(uvTexspace, seam - 0.5, seam + 0.5);
|
|
||||||
|
|
||||||
if ((g_PushConstants.InverseDisplaySize.y / g_PushConstants.InverseDisplaySize.x) >= (4.0 / 3.0))
|
if ((g_PushConstants.InverseDisplaySize.y / g_PushConstants.InverseDisplaySize.x) >= (4.0 / 3.0))
|
||||||
uvTexspace *= g_PushConstants.InverseDisplaySize.y * 720.0f;
|
uvTexspace *= g_PushConstants.InverseDisplaySize.y * 720.0f;
|
||||||
else
|
else
|
||||||
uvTexspace *= g_PushConstants.InverseDisplaySize.x * 960.0f;
|
uvTexspace *= g_PushConstants.InverseDisplaySize.x * 960.0f;
|
||||||
|
|
||||||
return SampleLinear(uvTexspace);
|
float2 seam = floor(uvTexspace + 0.5);
|
||||||
|
uvTexspace = (uvTexspace - seam) / fwidth(uvTexspace) + seam;
|
||||||
|
uvTexspace = clamp(uvTexspace, seam - 0.5, seam + 0.5);
|
||||||
|
|
||||||
|
return SampleLinear(uvTexspace - 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
float median(float r, float g, float b)
|
float median(float r, float g, float b)
|
||||||
@@ -81,7 +81,7 @@ float median(float r, float g, float b)
|
|||||||
float4 main(in Interpolators interpolators) : SV_Target
|
float4 main(in Interpolators interpolators) : SV_Target
|
||||||
{
|
{
|
||||||
float4 color = interpolators.Color;
|
float4 color = interpolators.Color;
|
||||||
color *= PixelAntialiasing(interpolators.Position.xy - (g_PushConstants.ProceduralOrigin + 0.5));
|
color *= PixelAntialiasing(interpolators.Position.xy - g_PushConstants.ProceduralOrigin);
|
||||||
|
|
||||||
if (g_PushConstants.Texture2DDescriptorIndex != 0)
|
if (g_PushConstants.Texture2DDescriptorIndex != 0)
|
||||||
{
|
{
|
||||||
@@ -135,10 +135,18 @@ float4 main(in Interpolators interpolators) : SV_Target
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_MARQUEE_FADE)
|
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_HORIZONTAL_MARQUEE_FADE)
|
||||||
{
|
{
|
||||||
float minAlpha = saturate((interpolators.Position.x - g_PushConstants.BoundsMin.x) / g_PushConstants.Scale.x);
|
float minAlpha = saturate((interpolators.Position.x - g_PushConstants.BoundsMin.x) / g_PushConstants.Scale.x);
|
||||||
float maxAlpha = saturate((g_PushConstants.BoundsMax.x - interpolators.Position.x) / g_PushConstants.Scale.x);
|
float maxAlpha = saturate((g_PushConstants.BoundsMax.x - interpolators.Position.x) / g_PushConstants.Scale.y);
|
||||||
|
|
||||||
|
color.a *= minAlpha;
|
||||||
|
color.a *= maxAlpha;
|
||||||
|
}
|
||||||
|
else if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_VERTICAL_MARQUEE_FADE)
|
||||||
|
{
|
||||||
|
float minAlpha = saturate((interpolators.Position.y - g_PushConstants.BoundsMin.y) / g_PushConstants.Scale.x);
|
||||||
|
float maxAlpha = saturate((g_PushConstants.BoundsMax.y - interpolators.Position.y) / g_PushConstants.Scale.y);
|
||||||
|
|
||||||
color.a *= minAlpha;
|
color.a *= minAlpha;
|
||||||
color.a *= maxAlpha;
|
color.a *= maxAlpha;
|
||||||
@@ -146,7 +154,29 @@ float4 main(in Interpolators interpolators) : SV_Target
|
|||||||
else if (any(g_PushConstants.BoundsMin != g_PushConstants.BoundsMax))
|
else if (any(g_PushConstants.BoundsMin != g_PushConstants.BoundsMax))
|
||||||
{
|
{
|
||||||
float2 factor = saturate((interpolators.Position.xy - g_PushConstants.BoundsMin) / (g_PushConstants.BoundsMax - g_PushConstants.BoundsMin));
|
float2 factor = saturate((interpolators.Position.xy - g_PushConstants.BoundsMin) / (g_PushConstants.BoundsMax - g_PushConstants.BoundsMin));
|
||||||
color *= lerp(DecodeColor(g_PushConstants.GradientTop), DecodeColor(g_PushConstants.GradientBottom), smoothstep(0.0, 1.0, factor.y));
|
|
||||||
|
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_RECTANGLE_BEVEL)
|
||||||
|
{
|
||||||
|
float bevelSize = 0.9;
|
||||||
|
|
||||||
|
float shadow = saturate((factor.x - bevelSize) / (1.0 - bevelSize));
|
||||||
|
shadow = max(shadow, saturate((factor.y - bevelSize) / (1.0 - bevelSize)));
|
||||||
|
|
||||||
|
float rim = saturate((1.0 - factor.x - bevelSize) / (1.0 - bevelSize));
|
||||||
|
rim = max(rim, saturate((1.0 - factor.y - bevelSize) / (1.0 - bevelSize)));
|
||||||
|
|
||||||
|
float3 rimColor = float3(1, 0.8, 0.29);
|
||||||
|
float3 shadowColor = float3(0.84, 0.57, 0);
|
||||||
|
|
||||||
|
color.rgb = lerp(color.rgb, rimColor, smoothstep(0.0, 1.0, rim));
|
||||||
|
color.rgb = lerp(color.rgb, shadowColor, smoothstep(0.0, 1.0, shadow));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float4 top = lerp(DecodeColor(g_PushConstants.GradientTopLeft), DecodeColor(g_PushConstants.GradientTopRight), smoothstep(0.0, 1.0, factor.x));
|
||||||
|
float4 bottom = lerp(DecodeColor(g_PushConstants.GradientBottomLeft), DecodeColor(g_PushConstants.GradientBottomRight), smoothstep(0.0, 1.0, factor.x));
|
||||||
|
color *= lerp(top, bottom, smoothstep(0.0, 1.0, factor.y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_GRAYSCALE)
|
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_GRAYSCALE)
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ void main(in float2 position : POSITION, in float2 uv : TEXCOORD, in float4 colo
|
|||||||
if (position.y < g_PushConstants.Origin.y)
|
if (position.y < g_PushConstants.Origin.y)
|
||||||
position.x += g_PushConstants.Scale.x;
|
position.x += g_PushConstants.Scale.x;
|
||||||
}
|
}
|
||||||
else if (g_PushConstants.ShaderModifier != IMGUI_SHADER_MODIFIER_MARQUEE_FADE)
|
else if (g_PushConstants.ShaderModifier != IMGUI_SHADER_MODIFIER_HORIZONTAL_MARQUEE_FADE &&
|
||||||
|
g_PushConstants.ShaderModifier != IMGUI_SHADER_MODIFIER_VERTICAL_MARQUEE_FADE)
|
||||||
{
|
{
|
||||||
position.xy = g_PushConstants.Origin + (position.xy - g_PushConstants.Origin) * g_PushConstants.Scale;
|
position.xy = g_PushConstants.Origin + (position.xy - g_PushConstants.Origin) * g_PushConstants.Scale;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
|
||||||
|
|
||||||
#ifdef __spirv__
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "copy_common.hlsli"
|
||||||
|
|
||||||
|
Texture2DMS<float4, SAMPLE_COUNT> g_Texture2DMSDescriptorHeap[] : register(t0, space0);
|
||||||
|
|
||||||
|
float4 main(in float4 position : SV_Position) : SV_Target
|
||||||
|
{
|
||||||
|
float4 result = g_Texture2DMSDescriptorHeap[g_PushConstants.ResourceDescriptorIndex].Load(int2(position.xy), 0);
|
||||||
|
|
||||||
|
[unroll] for (int i = 1; i < SAMPLE_COUNT; i++)
|
||||||
|
result += g_Texture2DMSDescriptorHeap[g_PushConstants.ResourceDescriptorIndex].Load(int2(position.xy), i);
|
||||||
|
|
||||||
|
return result / SAMPLE_COUNT;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#define SAMPLE_COUNT 2
|
||||||
|
#include "resolve_msaa_color.hlsli"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#define SAMPLE_COUNT 4
|
||||||
|
#include "resolve_msaa_color.hlsli"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#define SAMPLE_COUNT 8
|
||||||
|
#include "resolve_msaa_color.hlsli"
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
struct PushConstants
|
#include "copy_common.hlsli"
|
||||||
{
|
|
||||||
uint ResourceDescriptorIndex;
|
|
||||||
};
|
|
||||||
|
|
||||||
[[vk::push_constant]] ConstantBuffer<PushConstants> g_PushConstants : register(b3, space4);
|
|
||||||
|
|
||||||
Texture2DMS<float, SAMPLE_COUNT> g_Texture2DMSDescriptorHeap[] : register(t0, space0);
|
Texture2DMS<float, SAMPLE_COUNT> g_Texture2DMSDescriptorHeap[] : register(t0, space0);
|
||||||
|
|
||||||
|
|||||||
+1009
-373
File diff suppressed because it is too large
Load Diff
@@ -18,12 +18,11 @@ struct Video
|
|||||||
static inline uint32_t s_viewportWidth;
|
static inline uint32_t s_viewportWidth;
|
||||||
static inline uint32_t s_viewportHeight;
|
static inline uint32_t s_viewportHeight;
|
||||||
|
|
||||||
static void CreateHostDevice(const char *sdlVideoDriver);
|
static bool CreateHostDevice(const char *sdlVideoDriver);
|
||||||
static void WaitOnSwapChain();
|
static void WaitOnSwapChain();
|
||||||
static void Present();
|
static void Present();
|
||||||
static void StartPipelinePrecompilation();
|
static void StartPipelinePrecompilation();
|
||||||
static void WaitForGPU();
|
static void WaitForGPU();
|
||||||
static struct GuestSurface* GetBackBuffer();
|
|
||||||
static void ComputeViewportDimensions();
|
static void ComputeViewportDimensions();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,6 +158,7 @@ struct GuestTexture : GuestBaseTexture
|
|||||||
void* mappedMemory = nullptr;
|
void* mappedMemory = nullptr;
|
||||||
std::unique_ptr<RenderFramebuffer> framebuffer;
|
std::unique_ptr<RenderFramebuffer> framebuffer;
|
||||||
std::unique_ptr<GuestTexture> patchedTexture;
|
std::unique_ptr<GuestTexture> patchedTexture;
|
||||||
|
struct GuestSurface* sourceSurface = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GuestLockedRect
|
struct GuestLockedRect
|
||||||
@@ -206,6 +206,7 @@ struct GuestSurface : GuestBaseTexture
|
|||||||
uint32_t guestFormat = 0;
|
uint32_t guestFormat = 0;
|
||||||
ankerl::unordered_dense::map<const RenderTexture*, std::unique_ptr<RenderFramebuffer>> framebuffers;
|
ankerl::unordered_dense::map<const RenderTexture*, std::unique_ptr<RenderFramebuffer>> framebuffers;
|
||||||
RenderSampleCounts sampleCount = RenderSampleCount::COUNT_1;
|
RenderSampleCounts sampleCount = RenderSampleCount::COUNT_1;
|
||||||
|
ankerl::unordered_dense::set<GuestTexture*> destinationTextures;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GuestDeclType
|
enum GuestDeclType
|
||||||
@@ -286,7 +287,7 @@ struct GuestShader : GuestResource
|
|||||||
std::unique_ptr<RenderShader> shader;
|
std::unique_ptr<RenderShader> shader;
|
||||||
struct ShaderCacheEntry* shaderCacheEntry = nullptr;
|
struct ShaderCacheEntry* shaderCacheEntry = nullptr;
|
||||||
ankerl::unordered_dense::map<uint32_t, std::unique_ptr<RenderShader>> linkedShaders;
|
ankerl::unordered_dense::map<uint32_t, std::unique_ptr<RenderShader>> linkedShaders;
|
||||||
#ifdef SWA_D3D12
|
#ifdef UNLEASHED_RECOMP_D3D12
|
||||||
std::vector<ComPtr<IDxcBlob>> shaderBlobs;
|
std::vector<ComPtr<IDxcBlob>> shaderBlobs;
|
||||||
ComPtr<IDxcBlobEncoding> libraryBlob;
|
ComPtr<IDxcBlobEncoding> libraryBlob;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#include <stdafx.h>
|
#include <stdafx.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <user/config.h>
|
#include <user/config.h>
|
||||||
#include <hid/hid_detail.h>
|
#include <hid/hid.h>
|
||||||
|
#include <os/logger.h>
|
||||||
#include <ui/game_window.h>
|
#include <ui/game_window.h>
|
||||||
#include <kernel/xdm.h>
|
#include <kernel/xdm.h>
|
||||||
#include <app.h>
|
#include <app.h>
|
||||||
@@ -40,17 +41,17 @@ public:
|
|||||||
return SDL_GameControllerTypeForIndex(index);
|
return SDL_GameControllerTypeForIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
hid::detail::EInputDevice GetInputDevice() const
|
hid::EInputDevice GetInputDevice() const
|
||||||
{
|
{
|
||||||
switch (GetControllerType())
|
switch (GetControllerType())
|
||||||
{
|
{
|
||||||
case SDL_CONTROLLER_TYPE_PS3:
|
case SDL_CONTROLLER_TYPE_PS3:
|
||||||
case SDL_CONTROLLER_TYPE_PS4:
|
case SDL_CONTROLLER_TYPE_PS4:
|
||||||
case SDL_CONTROLLER_TYPE_PS5:
|
case SDL_CONTROLLER_TYPE_PS5:
|
||||||
return hid::detail::EInputDevice::PlayStation;
|
return hid::EInputDevice::PlayStation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hid::detail::EInputDevice::Xbox;
|
return hid::EInputDevice::Xbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close()
|
void Close()
|
||||||
@@ -67,7 +68,7 @@ public:
|
|||||||
|
|
||||||
bool CanPoll()
|
bool CanPoll()
|
||||||
{
|
{
|
||||||
return controller && (GameWindow::s_isFocused || Config::AllowBackgroundInput);
|
return controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PollAxis()
|
void PollAxis()
|
||||||
@@ -126,6 +127,11 @@ public:
|
|||||||
|
|
||||||
SDL_GameControllerRumble(controller, vibration.wLeftMotorSpeed * 256, vibration.wRightMotorSpeed * 256, VIBRATION_TIMEOUT_MS);
|
SDL_GameControllerRumble(controller, vibration.wLeftMotorSpeed * 256, vibration.wRightMotorSpeed * 256, VIBRATION_TIMEOUT_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetLED(const uint8_t r, const uint8_t g, const uint8_t b) const
|
||||||
|
{
|
||||||
|
SDL_GameControllerSetLED(controller, r, g, b);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::array<Controller, 4> g_controllers;
|
std::array<Controller, 4> g_controllers;
|
||||||
@@ -168,8 +174,26 @@ static void SetControllerInputDevice(Controller* controller)
|
|||||||
if (App::s_isLoading)
|
if (App::s_isLoading)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hid::detail::g_inputDevice = controller->GetInputDevice();
|
hid::g_inputDevice = controller->GetInputDevice();
|
||||||
hid::detail::g_inputDeviceController = hid::detail::g_inputDevice;
|
hid::g_inputDeviceController = hid::g_inputDevice;
|
||||||
|
|
||||||
|
auto controllerType = (hid::EInputDeviceExplicit)controller->GetControllerType();
|
||||||
|
|
||||||
|
if (hid::g_inputDeviceExplicit != controllerType)
|
||||||
|
{
|
||||||
|
hid::g_inputDeviceExplicit = controllerType;
|
||||||
|
|
||||||
|
LOGFN("Detected controller: {}", hid::GetInputDeviceName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetControllerTimeOfDayLED(Controller& controller, bool isNight)
|
||||||
|
{
|
||||||
|
auto r = isNight ? 22 : 0;
|
||||||
|
auto g = isNight ? 0 : 37;
|
||||||
|
auto b = isNight ? 101 : 184;
|
||||||
|
|
||||||
|
controller.SetLED(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
int HID_OnSDLEvent(void*, SDL_Event* event)
|
int HID_OnSDLEvent(void*, SDL_Event* event)
|
||||||
@@ -181,7 +205,13 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
const auto freeIndex = FindFreeController();
|
const auto freeIndex = FindFreeController();
|
||||||
|
|
||||||
if (freeIndex != -1)
|
if (freeIndex != -1)
|
||||||
g_controllers[freeIndex] = Controller(event->cdevice.which);
|
{
|
||||||
|
auto controller = Controller(event->cdevice.which);
|
||||||
|
|
||||||
|
g_controllers[freeIndex] = controller;
|
||||||
|
|
||||||
|
SetControllerTimeOfDayLED(controller, App::s_isWerehog);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -199,6 +229,7 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
case SDL_CONTROLLERBUTTONDOWN:
|
case SDL_CONTROLLERBUTTONDOWN:
|
||||||
case SDL_CONTROLLERBUTTONUP:
|
case SDL_CONTROLLERBUTTONUP:
|
||||||
case SDL_CONTROLLERAXISMOTION:
|
case SDL_CONTROLLERAXISMOTION:
|
||||||
|
case SDL_CONTROLLERTOUCHPADDOWN:
|
||||||
{
|
{
|
||||||
auto* controller = FindController(event->cdevice.which);
|
auto* controller = FindController(event->cdevice.which);
|
||||||
|
|
||||||
@@ -208,12 +239,16 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
if (event->type == SDL_CONTROLLERAXISMOTION)
|
if (event->type == SDL_CONTROLLERAXISMOTION)
|
||||||
{
|
{
|
||||||
if (abs(event->caxis.value) > 8000)
|
if (abs(event->caxis.value) > 8000)
|
||||||
|
{
|
||||||
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
SetControllerInputDevice(controller);
|
SetControllerInputDevice(controller);
|
||||||
|
}
|
||||||
|
|
||||||
controller->PollAxis();
|
controller->PollAxis();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
SetControllerInputDevice(controller);
|
SetControllerInputDevice(controller);
|
||||||
|
|
||||||
controller->Poll();
|
controller->Poll();
|
||||||
@@ -224,14 +259,20 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
|
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
hid::detail::g_inputDevice = hid::detail::EInputDevice::Keyboard;
|
hid::g_inputDevice = hid::EInputDevice::Keyboard;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP:
|
||||||
hid::detail::g_inputDevice = hid::detail::EInputDevice::Mouse;
|
{
|
||||||
|
if (!GameWindow::IsFullscreen() || GameWindow::s_isFullscreenCursorVisible)
|
||||||
|
SDL_ShowCursor(SDL_ENABLE);
|
||||||
|
|
||||||
|
hid::g_inputDevice = hid::EInputDevice::Mouse;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
{
|
{
|
||||||
@@ -247,17 +288,8 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
|
|
||||||
case SDL_USER_EVILSONIC:
|
case SDL_USER_EVILSONIC:
|
||||||
{
|
{
|
||||||
auto* controller = FindController(event->cdevice.which);
|
for (auto& controller : g_controllers)
|
||||||
|
SetControllerTimeOfDayLED(controller, event->user.code);
|
||||||
if (!controller)
|
|
||||||
break;
|
|
||||||
|
|
||||||
auto isNight = event->user.code;
|
|
||||||
auto r = isNight ? 22 : 0;
|
|
||||||
auto g = isNight ? 0 : 37;
|
|
||||||
auto b = isNight ? 101 : 184;
|
|
||||||
|
|
||||||
SDL_GameControllerSetLED(controller->controller, r, g, b);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -266,14 +298,17 @@ int HID_OnSDLEvent(void*, SDL_Event* event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hid::detail::Init()
|
void hid::Init()
|
||||||
{
|
{
|
||||||
|
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
||||||
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS3, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS3, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");
|
||||||
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, "1");
|
||||||
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_WII, "1");
|
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_WII, "1");
|
||||||
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
|
||||||
SDL_SetHint(SDL_HINT_XINPUT_ENABLED, "1");
|
SDL_SetHint(SDL_HINT_XINPUT_ENABLED, "1");
|
||||||
|
|
||||||
SDL_InitSubSystem(SDL_INIT_EVENTS);
|
SDL_InitSubSystem(SDL_INIT_EVENTS);
|
||||||
@@ -282,7 +317,7 @@ void hid::detail::Init()
|
|||||||
SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER);
|
SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::detail::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState)
|
uint32_t hid::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState)
|
||||||
{
|
{
|
||||||
static uint32_t packet;
|
static uint32_t packet;
|
||||||
|
|
||||||
@@ -301,7 +336,7 @@ uint32_t hid::detail::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState)
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::detail::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration)
|
uint32_t hid::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration)
|
||||||
{
|
{
|
||||||
if (!pVibration)
|
if (!pVibration)
|
||||||
return ERROR_BAD_ARGUMENTS;
|
return ERROR_BAD_ARGUMENTS;
|
||||||
@@ -314,7 +349,7 @@ uint32_t hid::detail::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibrat
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::detail::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps)
|
uint32_t hid::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps)
|
||||||
{
|
{
|
||||||
if (!pCaps)
|
if (!pCaps)
|
||||||
return ERROR_BAD_ARGUMENTS;
|
return ERROR_BAD_ARGUMENTS;
|
||||||
|
|||||||
+62
-20
@@ -1,39 +1,81 @@
|
|||||||
#include <stdafx.h>
|
|
||||||
#include "hid.h"
|
#include "hid.h"
|
||||||
#include "hid_detail.h"
|
#include <ui/game_window.h>
|
||||||
|
#include <user/config.h>
|
||||||
|
|
||||||
hid::detail::EInputDevice hid::detail::g_inputDevice;
|
hid::EInputDevice hid::g_inputDevice;
|
||||||
hid::detail::EInputDevice hid::detail::g_inputDeviceController;
|
hid::EInputDevice hid::g_inputDeviceController;
|
||||||
|
hid::EInputDeviceExplicit hid::g_inputDeviceExplicit;
|
||||||
|
|
||||||
uint16_t hid::detail::g_prohibitedButtons;
|
uint16_t hid::g_prohibitedButtons;
|
||||||
|
|
||||||
void hid::Init()
|
|
||||||
{
|
|
||||||
detail::Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void hid::SetProhibitedButtons(uint16_t wButtons)
|
void hid::SetProhibitedButtons(uint16_t wButtons)
|
||||||
{
|
{
|
||||||
hid::detail::g_prohibitedButtons = wButtons;
|
hid::g_prohibitedButtons = wButtons;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState)
|
bool hid::IsInputAllowed()
|
||||||
{
|
{
|
||||||
return detail::GetState(dwUserIndex, pState);
|
return GameWindow::s_isFocused || Config::AllowBackgroundInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration)
|
bool hid::IsInputDeviceController()
|
||||||
{
|
{
|
||||||
return detail::SetState(dwUserIndex, pVibration);
|
return hid::g_inputDevice != hid::EInputDevice::Keyboard &&
|
||||||
|
hid::g_inputDevice != hid::EInputDevice::Mouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t hid::GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps)
|
std::string hid::GetInputDeviceName()
|
||||||
{
|
{
|
||||||
return detail::GetCapabilities(dwUserIndex, pCaps);
|
switch (g_inputDevice)
|
||||||
|
{
|
||||||
|
case EInputDevice::Keyboard:
|
||||||
|
return "Keyboard";
|
||||||
|
|
||||||
|
case EInputDevice::Mouse:
|
||||||
|
return "Mouse";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hid::detail::IsInputDeviceController()
|
switch (g_inputDeviceExplicit)
|
||||||
{
|
{
|
||||||
return hid::detail::g_inputDevice != hid::detail::EInputDevice::Keyboard &&
|
case EInputDeviceExplicit::Xbox360:
|
||||||
hid::detail::g_inputDevice != hid::detail::EInputDevice::Mouse;
|
return "Xbox 360";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::XboxOne:
|
||||||
|
return "Xbox One";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::DualShock3:
|
||||||
|
return "DualShock 3";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::DualShock4:
|
||||||
|
return "DualShock 4";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::SwitchPro:
|
||||||
|
return "Nintendo Switch Pro";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::Virtual:
|
||||||
|
return "Virtual";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::DualSense:
|
||||||
|
return "DualSense";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::Luna:
|
||||||
|
return "Amazon Luna";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::Stadia:
|
||||||
|
return "Google Stadia";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::NvShield:
|
||||||
|
return "NVIDIA Shield";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::SwitchJCLeft:
|
||||||
|
return "Nintendo Switch Joy-Con (Left)";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::SwitchJCRight:
|
||||||
|
return "Nintendo Switch Joy-Con (Right)";
|
||||||
|
|
||||||
|
case EInputDeviceExplicit::SwitchJCPair:
|
||||||
|
return "Nintendo Switch Joy-Con (Pair)";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,47 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
union SDL_Event;
|
|
||||||
|
|
||||||
namespace hid
|
namespace hid
|
||||||
{
|
{
|
||||||
|
enum class EInputDevice
|
||||||
|
{
|
||||||
|
Keyboard,
|
||||||
|
Mouse,
|
||||||
|
Xbox,
|
||||||
|
PlayStation
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class EInputDeviceExplicit
|
||||||
|
{
|
||||||
|
Unknown,
|
||||||
|
Xbox360,
|
||||||
|
XboxOne,
|
||||||
|
DualShock3,
|
||||||
|
DualShock4,
|
||||||
|
SwitchPro,
|
||||||
|
Virtual,
|
||||||
|
DualSense,
|
||||||
|
Luna,
|
||||||
|
Stadia,
|
||||||
|
NvShield,
|
||||||
|
SwitchJCLeft,
|
||||||
|
SwitchJCRight,
|
||||||
|
SwitchJCPair
|
||||||
|
};
|
||||||
|
|
||||||
|
extern EInputDevice g_inputDevice;
|
||||||
|
extern EInputDevice g_inputDeviceController;
|
||||||
|
extern EInputDeviceExplicit g_inputDeviceExplicit;
|
||||||
|
|
||||||
|
extern uint16_t g_prohibitedButtons;
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
void SetProhibitedButtons(uint16_t wButtons);
|
|
||||||
|
|
||||||
uint32_t GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState);
|
uint32_t GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState);
|
||||||
uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration);
|
uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration);
|
||||||
uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps);
|
uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps);
|
||||||
|
|
||||||
|
void SetProhibitedButtons(uint16_t wButtons);
|
||||||
|
bool IsInputAllowed();
|
||||||
|
bool IsInputDeviceController();
|
||||||
|
std::string GetInputDeviceName();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace hid::detail
|
|
||||||
{
|
|
||||||
enum class EInputDevice
|
|
||||||
{
|
|
||||||
Keyboard,
|
|
||||||
Mouse,
|
|
||||||
Xbox,
|
|
||||||
PlayStation
|
|
||||||
};
|
|
||||||
|
|
||||||
extern EInputDevice g_inputDevice;
|
|
||||||
extern EInputDevice g_inputDeviceController;
|
|
||||||
|
|
||||||
extern uint16_t g_prohibitedButtons;
|
|
||||||
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
uint32_t GetState(uint32_t dwUserIndex, XAMINPUT_STATE* pState);
|
|
||||||
uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration);
|
|
||||||
uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps);
|
|
||||||
|
|
||||||
bool IsInputDeviceController();
|
|
||||||
}
|
|
||||||
@@ -67,7 +67,7 @@ static std::unique_ptr<VirtualFileSystem> createFileSystemFromPath(const std::fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, bool skipHashChecks, std::vector<uint8_t> &fileData, Journal &journal, const std::function<void()> &progressCallback) {
|
static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, bool skipHashChecks, std::vector<uint8_t> &fileData, Journal &journal, const std::function<bool()> &progressCallback) {
|
||||||
const std::string filename(pair.first);
|
const std::string filename(pair.first);
|
||||||
const uint32_t hashCount = pair.second;
|
const uint32_t hashCount = pair.second;
|
||||||
if (!sourceVfs.exists(filename))
|
if (!sourceVfs.exists(filename))
|
||||||
@@ -139,7 +139,13 @@ static bool copyFile(const FilePair &pair, const uint64_t *fileHashes, VirtualFi
|
|||||||
}
|
}
|
||||||
|
|
||||||
journal.progressCounter += fileData.size();
|
journal.progressCounter += fileData.size();
|
||||||
progressCallback();
|
|
||||||
|
if (!progressCallback())
|
||||||
|
{
|
||||||
|
journal.lastResult = Journal::Result::Cancelled;
|
||||||
|
journal.lastErrorMessage = "Installation was cancelled.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -201,7 +207,17 @@ static DLC detectDLC(const std::filesystem::path &sourcePath, VirtualFileSystem
|
|||||||
bool Installer::checkGameInstall(const std::filesystem::path &baseDirectory, std::filesystem::path &modulePath)
|
bool Installer::checkGameInstall(const std::filesystem::path &baseDirectory, std::filesystem::path &modulePath)
|
||||||
{
|
{
|
||||||
modulePath = baseDirectory / PatchedDirectory / GameExecutableFile;
|
modulePath = baseDirectory / PatchedDirectory / GameExecutableFile;
|
||||||
return std::filesystem::exists(modulePath);
|
|
||||||
|
if (!std::filesystem::exists(modulePath))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!std::filesystem::exists(baseDirectory / UpdateDirectory / UpdateExecutablePatchFile))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!std::filesystem::exists(baseDirectory / GameDirectory / GameExecutableFile))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Installer::checkDLCInstall(const std::filesystem::path &baseDirectory, DLC dlc)
|
bool Installer::checkDLCInstall(const std::filesystem::path &baseDirectory, DLC dlc)
|
||||||
@@ -256,7 +272,7 @@ bool Installer::computeTotalSize(std::span<const FilePair> filePairs, const uint
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Installer::copyFiles(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, const std::string &validationFile, bool skipHashChecks, Journal &journal, const std::function<void()> &progressCallback)
|
bool Installer::copyFiles(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, const std::string &validationFile, bool skipHashChecks, Journal &journal, const std::function<bool()> &progressCallback)
|
||||||
{
|
{
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
if (!std::filesystem::exists(targetDirectory) && !std::filesystem::create_directories(targetDirectory, ec))
|
if (!std::filesystem::exists(targetDirectory) && !std::filesystem::create_directories(targetDirectory, ec))
|
||||||
@@ -419,7 +435,7 @@ bool Installer::parseSources(const Input &input, Journal &journal, Sources &sour
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Installer::install(const Sources &sources, const std::filesystem::path &targetDirectory, bool skipHashChecks, Journal &journal, const std::function<void()> &progressCallback)
|
bool Installer::install(const Sources &sources, const std::filesystem::path &targetDirectory, bool skipHashChecks, Journal &journal, std::chrono::seconds endWaitTime, const std::function<bool()> &progressCallback)
|
||||||
{
|
{
|
||||||
// Install files in reverse order of importance. In case of a process crash or power outage, this will increase the likelihood of the installation
|
// Install files in reverse order of importance. In case of a process crash or power outage, this will increase the likelihood of the installation
|
||||||
// missing critical files required for the game to run. These files are used as the way to detect if the game is installed.
|
// missing critical files required for the game to run. These files are used as the way to detect if the game is installed.
|
||||||
@@ -487,7 +503,22 @@ bool Installer::install(const Sources &sources, const std::filesystem::path &tar
|
|||||||
|
|
||||||
// Update the progress with the artificial amount attributed to the patching.
|
// Update the progress with the artificial amount attributed to the patching.
|
||||||
journal.progressCounter += PatcherContribution;
|
journal.progressCounter += PatcherContribution;
|
||||||
progressCallback();
|
|
||||||
|
for (uint32_t i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
if (!progressCallback())
|
||||||
|
{
|
||||||
|
journal.lastResult = Journal::Result::Cancelled;
|
||||||
|
journal.lastErrorMessage = "Installation was cancelled.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
// Wait the specified amount of time to allow the consumer of the callbacks to animate, halt or cancel the installation for a while after it's finished.
|
||||||
|
std::this_thread::sleep_for(endWaitTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ struct Journal
|
|||||||
enum class Result
|
enum class Result
|
||||||
{
|
{
|
||||||
Success,
|
Success,
|
||||||
|
Cancelled,
|
||||||
VirtualFileSystemFailed,
|
VirtualFileSystemFailed,
|
||||||
DirectoryCreationFailed,
|
DirectoryCreationFailed,
|
||||||
FileMissing,
|
FileMissing,
|
||||||
@@ -75,10 +76,10 @@ struct Installer
|
|||||||
static bool checkDLCInstall(const std::filesystem::path &baseDirectory, DLC dlc);
|
static bool checkDLCInstall(const std::filesystem::path &baseDirectory, DLC dlc);
|
||||||
static bool checkAllDLC(const std::filesystem::path &baseDirectory);
|
static bool checkAllDLC(const std::filesystem::path &baseDirectory);
|
||||||
static bool computeTotalSize(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, Journal &journal, uint64_t &totalSize);
|
static bool computeTotalSize(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, Journal &journal, uint64_t &totalSize);
|
||||||
static bool copyFiles(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, const std::string &validationFile, bool skipHashChecks, Journal &journal, const std::function<void()> &progressCallback);
|
static bool copyFiles(std::span<const FilePair> filePairs, const uint64_t *fileHashes, VirtualFileSystem &sourceVfs, const std::filesystem::path &targetDirectory, const std::string &validationFile, bool skipHashChecks, Journal &journal, const std::function<bool()> &progressCallback);
|
||||||
static bool parseContent(const std::filesystem::path &sourcePath, std::unique_ptr<VirtualFileSystem> &targetVfs, Journal &journal);
|
static bool parseContent(const std::filesystem::path &sourcePath, std::unique_ptr<VirtualFileSystem> &targetVfs, Journal &journal);
|
||||||
static bool parseSources(const Input &input, Journal &journal, Sources &sources);
|
static bool parseSources(const Input &input, Journal &journal, Sources &sources);
|
||||||
static bool install(const Sources &sources, const std::filesystem::path &targetDirectory, bool skipHashChecks, Journal &journal, const std::function<void()> &progressCallback);
|
static bool install(const Sources &sources, const std::filesystem::path &targetDirectory, bool skipHashChecks, Journal &journal, std::chrono::seconds endWaitTime, const std::function<bool()> &progressCallback);
|
||||||
static void rollback(Journal &journal);
|
static void rollback(Journal &journal);
|
||||||
|
|
||||||
// Convenience method for checking if the specified file contains the game. This should be used when the user selects the file.
|
// Convenience method for checking if the specified file contains the game. This should be used when the user selects the file.
|
||||||
|
|||||||
@@ -0,0 +1,170 @@
|
|||||||
|
#include "update_checker.h"
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <shellapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// UpdateChecker
|
||||||
|
|
||||||
|
using json = nlohmann::json;
|
||||||
|
|
||||||
|
static const char *CHECK_URL = "https://api.github.com/repos/hedge-dev/UnleashedRecomp/releases/latest";
|
||||||
|
static const char *VISIT_URL = "https://github.com/hedge-dev/UnleashedRecomp/releases/latest";
|
||||||
|
static const char *USER_AGENT = "UnleashedRecomp-Agent";
|
||||||
|
|
||||||
|
static std::atomic<bool> g_updateCheckerInProgress = false;
|
||||||
|
static std::atomic<bool> g_updateCheckerFinished = false;
|
||||||
|
static UpdateChecker::Result g_updateCheckerResult = UpdateChecker::Result::NotStarted;
|
||||||
|
|
||||||
|
size_t updateCheckerWriteCallback(void *contents, size_t size, size_t nmemb, std::string *output)
|
||||||
|
{
|
||||||
|
size_t totalSize = size * nmemb;
|
||||||
|
output->append((char *)contents, totalSize);
|
||||||
|
return totalSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool parseVersion(const std::string &versionStr, int &major, int &minor, int &revision)
|
||||||
|
{
|
||||||
|
size_t start = 0;
|
||||||
|
if (versionStr[0] == 'v')
|
||||||
|
{
|
||||||
|
start = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t firstDot = versionStr.find('.', start);
|
||||||
|
size_t secondDot = versionStr.find('.', firstDot + 1);
|
||||||
|
|
||||||
|
if (firstDot == std::string::npos || secondDot == std::string::npos)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
major = std::stoi(versionStr.substr(start, firstDot - start));
|
||||||
|
minor = std::stoi(versionStr.substr(firstDot + 1, secondDot - firstDot - 1));
|
||||||
|
revision = std::stoi(versionStr.substr(secondDot + 1));
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
fmt::println("Error while parsing version: {}.", e.what());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateCheckerThread()
|
||||||
|
{
|
||||||
|
CURL *curl = curl_easy_init();
|
||||||
|
CURLcode res;
|
||||||
|
int major, minor, revision;
|
||||||
|
std::string response;
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, CHECK_URL);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, updateCheckerWriteCallback);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||||
|
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
if (res == CURLE_OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
json root = json::parse(response);
|
||||||
|
auto tag_name_element = root.find("tag_name");
|
||||||
|
if (tag_name_element != root.end() && tag_name_element->is_string())
|
||||||
|
{
|
||||||
|
if (parseVersion(*tag_name_element, major, minor, revision))
|
||||||
|
{
|
||||||
|
if ((g_versionMajor < major) || (g_versionMajor == major && g_versionMinor < minor) || (g_versionMajor == major && g_versionMinor == minor && g_versionRevision < revision))
|
||||||
|
{
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::UpdateAvailable;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::AlreadyUpToDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmt::println("Error while parsing response: tag_name does not contain a valid version string.");
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmt::println("Error while parsing response: tag_name not found or not the right type.");
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const json::exception &e)
|
||||||
|
{
|
||||||
|
fmt::println("Error while parsing response: {}", e.what());
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmt::println("Error while performing request: {}", curl_easy_strerror(res));
|
||||||
|
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
|
g_updateCheckerFinished = true;
|
||||||
|
g_updateCheckerInProgress = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateChecker::initialize()
|
||||||
|
{
|
||||||
|
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UpdateChecker::start()
|
||||||
|
{
|
||||||
|
if (g_updateCheckerInProgress)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_updateCheckerInProgress = true;
|
||||||
|
g_updateCheckerFinished = false;
|
||||||
|
std::thread thread(&updateCheckerThread);
|
||||||
|
thread.detach();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateChecker::Result UpdateChecker::check()
|
||||||
|
{
|
||||||
|
if (g_updateCheckerFinished)
|
||||||
|
{
|
||||||
|
return g_updateCheckerResult;
|
||||||
|
}
|
||||||
|
else if (g_updateCheckerInProgress)
|
||||||
|
{
|
||||||
|
return UpdateChecker::Result::InProgress;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return UpdateChecker::Result::NotStarted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateChecker::visitWebsite()
|
||||||
|
{
|
||||||
|
#if defined(WIN32)
|
||||||
|
ShellExecuteA(0, 0, VISIT_URL, 0, 0, SW_SHOW);
|
||||||
|
#elif defined(__linux__)
|
||||||
|
std::string command = "xdg-open " + std::string(VISIT_URL) + " &";
|
||||||
|
std::system(command.c_str());
|
||||||
|
#else
|
||||||
|
static_assert(false, "Visit website not implemented for this platform.");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct UpdateChecker
|
||||||
|
{
|
||||||
|
enum class Result
|
||||||
|
{
|
||||||
|
NotStarted,
|
||||||
|
InProgress,
|
||||||
|
AlreadyUpToDate,
|
||||||
|
UpdateAvailable,
|
||||||
|
Failed
|
||||||
|
};
|
||||||
|
|
||||||
|
static void initialize();
|
||||||
|
static bool start();
|
||||||
|
static Result check();
|
||||||
|
static void visitWebsite();
|
||||||
|
};
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "xam.h"
|
#include "xam.h"
|
||||||
#include "xdm.h"
|
#include "xdm.h"
|
||||||
#include <hid/hid.h>
|
#include <hid/hid.h>
|
||||||
#include <hid/hid_detail.h>
|
|
||||||
#include <ui/game_window.h>
|
#include <ui/game_window.h>
|
||||||
#include <cpu/guest_thread.h>
|
#include <cpu/guest_thread.h>
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
@@ -11,12 +10,6 @@
|
|||||||
#include <user/paths.h>
|
#include <user/paths.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <CommCtrl.h>
|
|
||||||
// Needed for commctrl
|
|
||||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct XamListener : KernelObject
|
struct XamListener : KernelObject
|
||||||
{
|
{
|
||||||
uint32_t id{};
|
uint32_t id{};
|
||||||
@@ -208,11 +201,15 @@ bool XNotifyGetNext(uint32_t hNotification, uint32_t dwMsgFilter, be<uint32_t>*
|
|||||||
uint32_t XamShowMessageBoxUI(uint32_t dwUserIndex, be<uint16_t>* wszTitle, be<uint16_t>* wszText, uint32_t cButtons,
|
uint32_t XamShowMessageBoxUI(uint32_t dwUserIndex, be<uint16_t>* wszTitle, be<uint16_t>* wszText, uint32_t cButtons,
|
||||||
xpointer<be<uint16_t>>* pwszButtons, uint32_t dwFocusButton, uint32_t dwFlags, be<uint32_t>* pResult, XXOVERLAPPED* pOverlapped)
|
xpointer<be<uint16_t>>* pwszButtons, uint32_t dwFocusButton, uint32_t dwFlags, be<uint32_t>* pResult, XXOVERLAPPED* pOverlapped)
|
||||||
{
|
{
|
||||||
int button{};
|
*pResult = cButtons ? cButtons - 1 : 0;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if _DEBUG
|
||||||
|
assert("XamShowMessageBoxUI encountered!" && false);
|
||||||
|
#elif _WIN32
|
||||||
|
// This code is Win32-only as it'll most likely crash, misbehave or
|
||||||
|
// cause corruption due to using a different type of memory than what
|
||||||
|
// wchar_t is on Linux. Windows uses 2 bytes while Linux uses 4 bytes.
|
||||||
std::vector<std::wstring> texts{};
|
std::vector<std::wstring> texts{};
|
||||||
std::vector<TASKDIALOG_BUTTON> buttons{};
|
|
||||||
|
|
||||||
texts.emplace_back(reinterpret_cast<wchar_t*>(wszTitle));
|
texts.emplace_back(reinterpret_cast<wchar_t*>(wszTitle));
|
||||||
texts.emplace_back(reinterpret_cast<wchar_t*>(wszText));
|
texts.emplace_back(reinterpret_cast<wchar_t*>(wszText));
|
||||||
@@ -226,23 +223,27 @@ uint32_t XamShowMessageBoxUI(uint32_t dwUserIndex, be<uint16_t>* wszTitle, be<ui
|
|||||||
ByteSwapInplace(text[i]);
|
ByteSwapInplace(text[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] If you are encountering this message and the game has ceased functioning,\n");
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] please create an issue at https://github.com/hedge-dev/UnleashedRecomp/issues.\n");
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] %ls\n", texts[0].c_str());
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] %ls\n", texts[1].c_str());
|
||||||
|
wprintf(L"[XamShowMessageBoxUI] ");
|
||||||
|
|
||||||
for (size_t i = 0; i < cButtons; i++)
|
for (size_t i = 0; i < cButtons; i++)
|
||||||
buttons.emplace_back(i, texts[2 + i].c_str());
|
{
|
||||||
|
wprintf(L"%ls", texts[2 + i].c_str());
|
||||||
|
|
||||||
XamNotifyEnqueueEvent(9, 1);
|
if (i != cButtons - 1)
|
||||||
|
wprintf(L" | ");
|
||||||
|
}
|
||||||
|
|
||||||
TASKDIALOGCONFIG config{};
|
wprintf(L"\n");
|
||||||
config.cbSize = sizeof(config);
|
wprintf(L"[XamShowMessageBoxUI] Defaulted to button: %d\n", pResult->get());
|
||||||
config.pszWindowTitle = texts[0].c_str();
|
wprintf(L"[XamShowMessageBoxUI] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
|
||||||
config.pszContent = texts[1].c_str();
|
|
||||||
config.cButtons = cButtons;
|
|
||||||
config.pButtons = buttons.data();
|
|
||||||
|
|
||||||
TaskDialogIndirect(&config, &button, nullptr, nullptr);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*pResult = button;
|
|
||||||
|
|
||||||
if (pOverlapped)
|
if (pOverlapped)
|
||||||
{
|
{
|
||||||
pOverlapped->dwCompletionContext = GuestThread::GetCurrentThreadId();
|
pOverlapped->dwCompletionContext = GuestThread::GetCurrentThreadId();
|
||||||
@@ -404,56 +405,66 @@ uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_STATE* st
|
|||||||
{
|
{
|
||||||
memset(state, 0, sizeof(*state));
|
memset(state, 0, sizeof(*state));
|
||||||
|
|
||||||
uint32_t result = hid::GetState(userIndex, state);
|
if (hid::IsInputAllowed())
|
||||||
|
hid::GetState(userIndex, state);
|
||||||
|
|
||||||
if (GameWindow::s_isFocused)
|
|
||||||
{
|
|
||||||
auto keyboardState = SDL_GetKeyboardState(NULL);
|
auto keyboardState = SDL_GetKeyboardState(NULL);
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_UP])
|
if (GameWindow::s_isFocused && !keyboardState[SDL_SCANCODE_LALT])
|
||||||
|
{
|
||||||
|
if (keyboardState[Config::Key_LeftStickUp])
|
||||||
state->Gamepad.sThumbLY = 32767;
|
state->Gamepad.sThumbLY = 32767;
|
||||||
if (keyboardState[SDL_SCANCODE_DOWN])
|
if (keyboardState[Config::Key_LeftStickDown])
|
||||||
state->Gamepad.sThumbLY = -32768;
|
state->Gamepad.sThumbLY = -32768;
|
||||||
if (keyboardState[SDL_SCANCODE_LEFT])
|
if (keyboardState[Config::Key_LeftStickLeft])
|
||||||
state->Gamepad.sThumbLX = -32768;
|
state->Gamepad.sThumbLX = -32768;
|
||||||
if (keyboardState[SDL_SCANCODE_RIGHT])
|
if (keyboardState[Config::Key_LeftStickRight])
|
||||||
state->Gamepad.sThumbLX = 32767;
|
state->Gamepad.sThumbLX = 32767;
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_1])
|
if (keyboardState[Config::Key_RightStickUp])
|
||||||
|
state->Gamepad.sThumbRY = 32767;
|
||||||
|
if (keyboardState[Config::Key_RightStickDown])
|
||||||
|
state->Gamepad.sThumbRY = -32768;
|
||||||
|
if (keyboardState[Config::Key_RightStickLeft])
|
||||||
|
state->Gamepad.sThumbRX = -32768;
|
||||||
|
if (keyboardState[Config::Key_RightStickRight])
|
||||||
|
state->Gamepad.sThumbRX = 32767;
|
||||||
|
|
||||||
|
if (keyboardState[Config::Key_LeftTrigger])
|
||||||
state->Gamepad.bLeftTrigger = 0xFF;
|
state->Gamepad.bLeftTrigger = 0xFF;
|
||||||
if (keyboardState[SDL_SCANCODE_3])
|
if (keyboardState[Config::Key_RightTrigger])
|
||||||
state->Gamepad.bRightTrigger = 0xFF;
|
state->Gamepad.bRightTrigger = 0xFF;
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_I])
|
if (keyboardState[Config::Key_DPadUp])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_UP;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_UP;
|
||||||
if (keyboardState[SDL_SCANCODE_K])
|
if (keyboardState[Config::Key_DPadDown])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_DOWN;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_DOWN;
|
||||||
if (keyboardState[SDL_SCANCODE_J])
|
if (keyboardState[Config::Key_DPadLeft])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_LEFT;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_LEFT;
|
||||||
if (keyboardState[SDL_SCANCODE_L])
|
if (keyboardState[Config::Key_DPadRight])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_RIGHT;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_DPAD_RIGHT;
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_RETURN] && !keyboardState[SDL_SCANCODE_LALT])
|
if (keyboardState[Config::Key_Start])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_START;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_START;
|
||||||
if (keyboardState[SDL_SCANCODE_BACKSPACE])
|
if (keyboardState[Config::Key_Back])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_BACK;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_BACK;
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_Q])
|
if (keyboardState[Config::Key_LeftBumper])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_LEFT_SHOULDER;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_LEFT_SHOULDER;
|
||||||
if (keyboardState[SDL_SCANCODE_E])
|
if (keyboardState[Config::Key_RightBumper])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_RIGHT_SHOULDER;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_RIGHT_SHOULDER;
|
||||||
|
|
||||||
if (keyboardState[SDL_SCANCODE_S])
|
if (keyboardState[Config::Key_A])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_A;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_A;
|
||||||
if (keyboardState[SDL_SCANCODE_D])
|
if (keyboardState[Config::Key_B])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_B;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_B;
|
||||||
if (keyboardState[SDL_SCANCODE_A])
|
if (keyboardState[Config::Key_X])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_X;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_X;
|
||||||
if (keyboardState[SDL_SCANCODE_W])
|
if (keyboardState[Config::Key_Y])
|
||||||
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_Y;
|
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
state->Gamepad.wButtons &= ~hid::detail::g_prohibitedButtons;
|
state->Gamepad.wButtons &= ~hid::g_prohibitedButtons;
|
||||||
|
|
||||||
ByteSwapInplace(state->Gamepad.wButtons);
|
ByteSwapInplace(state->Gamepad.wButtons);
|
||||||
ByteSwapInplace(state->Gamepad.sThumbLX);
|
ByteSwapInplace(state->Gamepad.sThumbLX);
|
||||||
@@ -466,7 +477,7 @@ uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_STATE* st
|
|||||||
|
|
||||||
uint32_t XamInputSetState(uint32_t userIndex, uint32_t flags, XAMINPUT_VIBRATION* vibration)
|
uint32_t XamInputSetState(uint32_t userIndex, uint32_t flags, XAMINPUT_VIBRATION* vibration)
|
||||||
{
|
{
|
||||||
if (!hid::detail::IsInputDeviceController() || !Config::Vibration)
|
if (!hid::IsInputDeviceController() || !Config::Vibration)
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
ByteSwapInplace(vibration->wLeftMotorSpeed);
|
ByteSwapInplace(vibration->wLeftMotorSpeed);
|
||||||
|
|||||||
@@ -19,19 +19,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define CONFIG_DEFINE_LOCALE(name) \
|
#define CONFIG_DEFINE_LOCALE(name) \
|
||||||
CONFIG_LOCALE Config::g_##name##_locale =
|
CONFIG_LOCALE g_##name##_locale =
|
||||||
|
|
||||||
#define CONFIG_DEFINE_ENUM_LOCALE(type) \
|
#define CONFIG_DEFINE_ENUM_LOCALE(type) \
|
||||||
CONFIG_ENUM_LOCALE(type) Config::g_##type##_locale =
|
CONFIG_ENUM_LOCALE(type) g_##type##_locale =
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(Language)
|
CONFIG_DEFINE_LOCALE(Language)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Language", "Change the language used for text and logos." } },
|
{ ELanguage::English, { "Language", "Change the language used for text and logos." } },
|
||||||
{ ELanguage::Japanese, { "言語", "[PLACEHOLDER]" } },
|
{ ELanguage::Japanese, { "言語", "" } },
|
||||||
{ ELanguage::German, { "Sprache", "[PLACEHOLDER]" } },
|
{ ELanguage::German, { "Sprache", "" } },
|
||||||
{ ELanguage::French, { "Langue", "[PLACEHOLDER]" } },
|
{ ELanguage::French, { "Langue", "" } },
|
||||||
{ ELanguage::Spanish, { "Idioma", "[PLACEHOLDER]" } },
|
{ ELanguage::Spanish, { "Idioma", "" } },
|
||||||
{ ELanguage::Italian, { "Lingua", "[PLACEHOLDER]" } }
|
{ ELanguage::Italian, { "Lingua", "" } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_ENUM_LOCALE(ELanguage)
|
CONFIG_DEFINE_ENUM_LOCALE(ELanguage)
|
||||||
@@ -49,6 +49,52 @@ CONFIG_DEFINE_ENUM_LOCALE(ELanguage)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CONFIG_DEFINE_ENUM_LOCALE(EVoiceLanguage)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
ELanguage::English,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "ENGLISH", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "JAPANESE", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELanguage::Japanese,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "英語", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "日本語", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELanguage::German,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "ENGLISCH", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "JAPANISCH", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELanguage::French,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "ANGLAIS", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "JAPONAIS", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELanguage::Spanish,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "INGLÉS", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "JAPONÉS", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELanguage::Italian,
|
||||||
|
{
|
||||||
|
{ EVoiceLanguage::English, { "INGLESE", "" } },
|
||||||
|
{ EVoiceLanguage::Japanese, { "GIAPPONESE", "" } }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(Hints)
|
CONFIG_DEFINE_LOCALE(Hints)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Hints", "Show hint rings in stages." } }
|
{ ELanguage::English, { "Hints", "Show hint rings in stages." } }
|
||||||
@@ -97,14 +143,25 @@ CONFIG_DEFINE_ENUM_LOCALE(EControllerIcons)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(InvertCameraX)
|
CONFIG_DEFINE_LOCALE(HorizontalCamera)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Invert Camera X", "Toggle between inverted left and right camera movement." } }
|
{ ELanguage::English, { "Horizontal Camera", "Change how the camera moves left and right." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(InvertCameraY)
|
CONFIG_DEFINE_LOCALE(VerticalCamera)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Invert Camera Y", "Toggle between inverted up and down camera movement." } }
|
{ ELanguage::English, { "Vertical Camera", "Change how the camera moves up and down." } }
|
||||||
|
};
|
||||||
|
|
||||||
|
CONFIG_DEFINE_ENUM_LOCALE(ECameraRotationMode)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
ELanguage::English,
|
||||||
|
{
|
||||||
|
{ ECameraRotationMode::Normal, { "NORMAL", "" } },
|
||||||
|
{ ECameraRotationMode::Reverse, { "REVERSE", "" } }
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(Vibration)
|
CONFIG_DEFINE_LOCALE(Vibration)
|
||||||
@@ -117,11 +174,6 @@ CONFIG_DEFINE_LOCALE(AllowBackgroundInput)
|
|||||||
{ ELanguage::English, { "Allow Background Input", "Allow controller input whilst the game window is unfocused." } }
|
{ ELanguage::English, { "Allow Background Input", "Allow controller input whilst the game window is unfocused." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(AllowDPadMovement)
|
|
||||||
{
|
|
||||||
{ ELanguage::English, { "Allow D-Pad Movement", "Allow the player to also be controlled using the directional pad." } }
|
|
||||||
};
|
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(MasterVolume)
|
CONFIG_DEFINE_LOCALE(MasterVolume)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Master Volume", "Adjust the overall volume." } }
|
{ ELanguage::English, { "Master Volume", "Adjust the overall volume." } }
|
||||||
@@ -142,22 +194,27 @@ CONFIG_DEFINE_LOCALE(MusicAttenuation)
|
|||||||
{ ELanguage::English, { "Music Attenuation", "Fade out the game's music when external media is playing." } }
|
{ ELanguage::English, { "Music Attenuation", "Fade out the game's music when external media is playing." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(VoiceLanguage)
|
CONFIG_DEFINE_LOCALE(ChannelConfiguration)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Voice Language", "Change the language used for character voices." } }
|
{ ELanguage::English, { "Channel Configuration", "Change the output mode for your playback device." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_ENUM_LOCALE(EVoiceLanguage)
|
CONFIG_DEFINE_ENUM_LOCALE(EChannelConfiguration)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
ELanguage::English,
|
ELanguage::English,
|
||||||
{
|
{
|
||||||
{ EVoiceLanguage::English, { "ENGLISH", "" } },
|
{ EChannelConfiguration::Stereo, { "STEREO", "" } },
|
||||||
{ EVoiceLanguage::Japanese, { "日本語", "" } }
|
{ EChannelConfiguration::Surround, { "SURROUND", "" } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CONFIG_DEFINE_LOCALE(VoiceLanguage)
|
||||||
|
{
|
||||||
|
{ ELanguage::English, { "Voice Language", "Change the language used for character voices." } }
|
||||||
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(Subtitles)
|
CONFIG_DEFINE_LOCALE(Subtitles)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } }
|
{ ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } }
|
||||||
@@ -189,7 +246,9 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio)
|
|||||||
ELanguage::English,
|
ELanguage::English,
|
||||||
{
|
{
|
||||||
{ EAspectRatio::Auto, { "AUTO", "Auto: the aspect ratio will dynamically adjust to the window size." } },
|
{ EAspectRatio::Auto, { "AUTO", "Auto: the aspect ratio will dynamically adjust to the window size." } },
|
||||||
{ EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "" } }
|
{ EAspectRatio::Wide, { "16:9", "16:9: locks the game to a widescreen aspect ratio." } },
|
||||||
|
{ EAspectRatio::Narrow, { "4:3", "4:3: locks the game to a narrow aspect ratio." } },
|
||||||
|
{ EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: locks the game to a narrow aspect ratio and retains parity with the game's original implementation." } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -216,7 +275,7 @@ CONFIG_DEFINE_LOCALE(FPS)
|
|||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(Brightness)
|
CONFIG_DEFINE_LOCALE(Brightness)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Brightness", "Adjust the brightness level of the game." } }
|
{ ELanguage::English, { "Brightness", "Adjust the brightness level until the symbol on the left is barely visible." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(AntiAliasing)
|
CONFIG_DEFINE_LOCALE(AntiAliasing)
|
||||||
@@ -249,9 +308,7 @@ CONFIG_DEFINE_ENUM_LOCALE(EShadowResolution)
|
|||||||
{
|
{
|
||||||
ELanguage::English,
|
ELanguage::English,
|
||||||
{
|
{
|
||||||
{ EShadowResolution::Original, { "ORIGINAL", "Original: the game will automatically determine the resolution of the shadows." } },
|
{ EShadowResolution::Original, { "ORIGINAL", "Original: the game will automatically determine the resolution of the shadows." } }
|
||||||
{ EShadowResolution::x4096, { "4096", "High resolutions can degrade performance significantly on lower end hardware." } },
|
|
||||||
{ EShadowResolution::x8192, { "8192", "High resolutions can degrade performance significantly on lower end hardware." } },
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -296,7 +353,7 @@ CONFIG_DEFINE_LOCALE(XboxColorCorrection)
|
|||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(CutsceneAspectRatio)
|
CONFIG_DEFINE_LOCALE(CutsceneAspectRatio)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "Cutscene Aspect Ratio", "" } }
|
{ ELanguage::English, { "Cutscene Aspect Ratio", "Change the aspect ratio of the real-time cutscenes." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio)
|
CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio)
|
||||||
@@ -304,24 +361,24 @@ CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio)
|
|||||||
{
|
{
|
||||||
ELanguage::English,
|
ELanguage::English,
|
||||||
{
|
{
|
||||||
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "" } },
|
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "Original: locks cutscenes to their original 16:9 aspect ratio." } },
|
||||||
{ ECutsceneAspectRatio::Unlocked, { "UNLOCKED", "" } },
|
{ ECutsceneAspectRatio::Unlocked, { "UNLOCKED", "Unlocked: allows cutscenes to adjust their aspect ratio to the window size.\n\nWARNING: this will introduce visual oddities past the original 16:9 aspect ratio." } },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_LOCALE(UIScaleMode)
|
CONFIG_DEFINE_LOCALE(UIAlignmentMode)
|
||||||
{
|
{
|
||||||
{ ELanguage::English, { "UI Scale Mode", "Change how the UI scales to the display." } }
|
{ ELanguage::English, { "UI Alignment Mode", "Change how the UI aligns with the display." } }
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_DEFINE_ENUM_LOCALE(EUIScaleMode)
|
CONFIG_DEFINE_ENUM_LOCALE(EUIAlignmentMode)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
ELanguage::English,
|
ELanguage::English,
|
||||||
{
|
{
|
||||||
{ EUIScaleMode::Edge, { "EDGE", "Edge: the UI will anchor to the edges of the display." } },
|
{ EUIAlignmentMode::Edge, { "EDGE", "Edge: the UI will align with the edges of the display." } },
|
||||||
{ EUIScaleMode::Centre, { "CENTER", "Center: the UI will anchor to the center of the display." } },
|
{ EUIAlignmentMode::Centre, { "CENTER", "Center: the UI will align with the center of the display." } },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,12 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{
|
{
|
||||||
"Options_Header_Name",
|
"Options_Header_Name",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "OPTIONS" }
|
{ ELanguage::English, "OPTIONS" },
|
||||||
|
{ ELanguage::Japanese, "OPTION" },
|
||||||
|
{ ELanguage::German, "OPTIONEN" },
|
||||||
|
{ ELanguage::French, "OPTIONS" },
|
||||||
|
{ ELanguage::Spanish, "OPCIONES" },
|
||||||
|
{ ELanguage::Italian, "OPZIONI" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -165,27 +170,27 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{
|
{
|
||||||
"Installer_Page_Introduction",
|
"Installer_Page_Introduction",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "Welcome to Unleashed Recompiled!\n\nYou'll need an Xbox 360 copy\nof Sonic Unleashed in order to proceed with the installation." },
|
{ ELanguage::English, "Welcome to\nUnleashed Recompiled!\n\nYou'll need an Xbox 360 copy\nof Sonic Unleashed in order to proceed with the installation." },
|
||||||
{ ELanguage::Italian, "Benvenuto a Unleashed Recompiled!\n\nDovrai avere una copia di\nSonic Unleashed per la Xbox 360\nper proseguire con l'installazione." }
|
{ ELanguage::Italian, "Benvenuto a\nUnleashed Recompiled!\n\nDovrai avere una copia di\nSonic Unleashed per la Xbox 360\nper proseguire con l'installazione." }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Installer_Page_SelectGameAndUpdate",
|
"Installer_Page_SelectGameAndUpdate",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "Add the files for the game and its title update. You can use digital dumps or an extracted folder containing the unmodified files." }
|
{ ELanguage::English, "Add the sources for the game and its title update." }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Installer_Page_SelectDLC",
|
"Installer_Page_SelectDLC",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "Add the files for the DLC. You can use digital dumps or an extracted folder containing the unmodified files." }
|
{ ELanguage::English, "Add the sources for the DLC." }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Installer_Page_CheckSpace",
|
"Installer_Page_CheckSpace",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "The content will be installed to the program's folder. Please confirm you have enough free space.\n\n" },
|
{ ELanguage::English, "The content will be installed to the program's folder.\n\n" },
|
||||||
{ ELanguage::Italian, "Il contenuto verrà installato nella cartella di questo programma. Assicurati di avere abbastanza spazio libero sul tuo hard disk.\n\n" }
|
{ ELanguage::Italian, "Il contenuto verrà installato nella cartella di questo programma.\n\n" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -254,6 +259,12 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{ ELanguage::Italian, "SALTA" }
|
{ ELanguage::Italian, "SALTA" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Installer_Button_Retry",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "RETRY" }
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Installer_Button_AddFiles",
|
"Installer_Button_AddFiles",
|
||||||
{
|
{
|
||||||
@@ -292,14 +303,14 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
// Notes: message appears when clicking the "Add Files" option for the first time.
|
// Notes: message appears when clicking the "Add Files" option for the first time.
|
||||||
"Installer_Message_FilePickerTutorial",
|
"Installer_Message_FilePickerTutorial",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "Select a digital dump.\n\nFor choosing a folder with\nextracted and unmodified\ngame files, use the\n\"Add Folder\" option instead." },
|
{ ELanguage::English, "Select a digital dump with\ncontent from the game.\n\nThese files can be obtained from\nyour Xbox 360 hard drive by\nfollowing the instructions on\nthe GitHub page.\n\nFor choosing a folder with extracted\nand unmodified game files, use\nthe \"Add Folder\" option instead." },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Notes: message appears when clicking the "Add Folder" option for the first time.
|
// Notes: message appears when clicking the "Add Folder" option for the first time.
|
||||||
"Installer_Message_FolderPickerTutorial",
|
"Installer_Message_FolderPickerTutorial",
|
||||||
{
|
{
|
||||||
{ ELanguage::English, "Select a folder that contains\nthe unmodified files that have\nbeen extracted from the game.\n\nFor choosing a digital dump,\nuse the\"Add Files\" option instead." },
|
{ ELanguage::English, "Select a folder that contains the\nunmodified files that have been\nextracted from the game.\n\nThese files can be obtained from\nyour Xbox 360 hard drive by\nfollowing the instructions on\nthe GitHub page.\n\nFor choosing a digital dump,\nuse the\"Add Files\" option instead." },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -334,6 +345,20 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{ ELanguage::Italian, "Questa opzione riavviera il gioco\nper farti installare qualsiasi DLC\nche non hai installato.\n\nHai già installato tutti i DLC.\n\nVuoi procedere comunque?" }
|
{ ELanguage::Italian, "Questa opzione riavviera il gioco\nper farti installare qualsiasi DLC\nche non hai installato.\n\nHai già installato tutti i DLC.\n\nVuoi procedere comunque?" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Notes: message appears when user chooses "Quit" on the first available installation screen.
|
||||||
|
"Installer_Message_Quit",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "Are you sure you want to quit?" },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Notes: message appears when user chooses "Cancel" during installation.
|
||||||
|
"Installer_Message_Cancel",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "Are you sure you want to cancel the installation?" },
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// Notes: message appears when pressing B at the title screen.
|
// Notes: message appears when pressing B at the title screen.
|
||||||
"Title_Message_Quit",
|
"Title_Message_Quit",
|
||||||
@@ -342,6 +367,48 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{ ELanguage::Italian, "Sei sicuro di voler uscire?" }
|
{ ELanguage::Italian, "Sei sicuro di voler uscire?" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Notes: message appears when SYS-DATA is corrupted (mismatching file size) upon pressing start at the title screen.
|
||||||
|
// To make this occur, open the file in any editor and just remove a large chunk of data.
|
||||||
|
// Do not localise this unless absolutely necessary, these strings are from the XEX.
|
||||||
|
"Title_Message_SaveDataCorrupt",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "The save file appears to be\ncorrupted and cannot be loaded." },
|
||||||
|
{ ELanguage::Japanese, "ゲームデータの読み込みに失敗しました。\nこのまま続けるとゲームデータをセーブすることはできません" },
|
||||||
|
{ ELanguage::German, "Diese Speicherdatei ist beschädigt\nund kann nicht geladen werden." },
|
||||||
|
{ ELanguage::French, "Le fichier de sauvegarde semble être\nendommagé et ne peut être chargé." },
|
||||||
|
{ ELanguage::Spanish, "El archivo parece estar dañado\ny no se puede cargar." },
|
||||||
|
{ ELanguage::Italian, "I file di salvataggio sembrano danneggiati\ne non possono essere caricati." }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Notes: message appears when ACH-DATA is corrupted (mismatching file size, bad signature, incorrect version or invalid checksum) upon pressing start at the title screen.
|
||||||
|
// To make this occur, open the file in any editor and just remove a large chunk of data.
|
||||||
|
"Title_Message_AchievementDataCorrupt",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "The achievement data appears to be\ncorrupted and cannot be loaded.\n\nProceeding from this point will\nclear your achievement data." }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Notes: message appears when ACH-DATA cannot be loaded upon pressing start at the title screen.
|
||||||
|
// To make this occur, lock the ACH-DATA file using an external program so that it cannot be accessed by the game.
|
||||||
|
"Title_Message_AchievementDataIOError",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "The achievement data could not be loaded.\nYour achievements will not be saved." }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Title_Message_UpdateAvailable",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "An update is available!\n\nWould you like to visit the\nreleases page to download it?" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Video_BackendError",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "Unable to create a D3D12 (Windows) or Vulkan backend.\n\nPlease make sure that:\n\n- Your system meets the minimum requirements.\n- Your GPU drivers are up to date.\n- Your operating system is on the latest version available." }
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Common_On",
|
"Common_On",
|
||||||
{
|
{
|
||||||
@@ -399,6 +466,18 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
|||||||
{ ELanguage::Italian, "Indietro" }
|
{ ELanguage::Italian, "Indietro" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Common_Quit",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "Quit" },
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Common_Cancel",
|
||||||
|
{
|
||||||
|
{ ELanguage::English, "Cancel" }
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Common_Reset",
|
"Common_Reset",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,15 +10,23 @@
|
|||||||
#include <xex.h>
|
#include <xex.h>
|
||||||
#include <apu/audio.h>
|
#include <apu/audio.h>
|
||||||
#include <hid/hid.h>
|
#include <hid/hid.h>
|
||||||
#include <user/achievement_data.h>
|
|
||||||
#include <user/config.h>
|
#include <user/config.h>
|
||||||
#include <user/paths.h>
|
#include <user/paths.h>
|
||||||
|
#include <user/registry.h>
|
||||||
#include <kernel/xdbf.h>
|
#include <kernel/xdbf.h>
|
||||||
#include <install/installer.h>
|
#include <install/installer.h>
|
||||||
|
#include <install/update_checker.h>
|
||||||
#include <os/logger.h>
|
#include <os/logger.h>
|
||||||
|
#include <os/process.h>
|
||||||
|
#include <os/registry.h>
|
||||||
|
#include <ui/game_window.h>
|
||||||
#include <ui/installer_wizard.h>
|
#include <ui/installer_wizard.h>
|
||||||
#include <mod/mod_loader.h>
|
#include <mod/mod_loader.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <timeapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
const size_t XMAIOBegin = 0x7FEA0000;
|
const size_t XMAIOBegin = 0x7FEA0000;
|
||||||
const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF;
|
const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF;
|
||||||
|
|
||||||
@@ -145,6 +153,9 @@ int main(int argc, char *argv[])
|
|||||||
timeBeginPeriod(1);
|
timeBeginPeriod(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!os::registry::Init())
|
||||||
|
LOGN_WARNING("OS doesn't support registry");
|
||||||
|
|
||||||
os::logger::Init();
|
os::logger::Init();
|
||||||
|
|
||||||
bool forceInstaller = false;
|
bool forceInstaller = false;
|
||||||
@@ -167,6 +178,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Config::Load();
|
Config::Load();
|
||||||
|
|
||||||
|
// Check the time since the last time an update was checked. Store the new time if the difference is more than six hours.
|
||||||
|
constexpr double TimeBetweenUpdateChecksInSeconds = 6 * 60 * 60;
|
||||||
|
time_t timeNow = std::time(nullptr);
|
||||||
|
double timeDifferenceSeconds = difftime(timeNow, Config::LastChecked);
|
||||||
|
if (timeDifferenceSeconds > TimeBetweenUpdateChecksInSeconds)
|
||||||
|
{
|
||||||
|
UpdateChecker::initialize();
|
||||||
|
UpdateChecker::start();
|
||||||
|
Config::LastChecked = timeNow;
|
||||||
|
Config::Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config::ShowConsole)
|
||||||
|
os::process::ShowConsole();
|
||||||
|
|
||||||
HostStartup();
|
HostStartup();
|
||||||
|
|
||||||
std::filesystem::path modulePath;
|
std::filesystem::path modulePath;
|
||||||
@@ -174,24 +200,32 @@ int main(int argc, char *argv[])
|
|||||||
bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled;
|
bool runInstallerWizard = forceInstaller || forceDLCInstaller || !isGameInstalled;
|
||||||
if (runInstallerWizard)
|
if (runInstallerWizard)
|
||||||
{
|
{
|
||||||
Video::CreateHostDevice(sdlVideoDriver);
|
if (!Video::CreateHostDevice(sdlVideoDriver))
|
||||||
|
{
|
||||||
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, GameWindow::GetTitle(), Localise("Video_BackendError").c_str(), GameWindow::s_pWindow);
|
||||||
|
std::_Exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!InstallerWizard::Run(GAME_INSTALL_DIRECTORY, isGameInstalled && forceDLCInstaller))
|
if (!InstallerWizard::Run(GAME_INSTALL_DIRECTORY, isGameInstalled && forceDLCInstaller))
|
||||||
{
|
{
|
||||||
return 1;
|
std::_Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ModLoader::Init();
|
ModLoader::Init();
|
||||||
|
|
||||||
AchievementData::Load();
|
|
||||||
|
|
||||||
KiSystemStartup();
|
KiSystemStartup();
|
||||||
|
|
||||||
uint32_t entry = LdrLoadModule(modulePath);
|
uint32_t entry = LdrLoadModule(modulePath);
|
||||||
|
|
||||||
if (!runInstallerWizard)
|
if (!runInstallerWizard)
|
||||||
Video::CreateHostDevice(sdlVideoDriver);
|
{
|
||||||
|
if (!Video::CreateHostDevice(sdlVideoDriver))
|
||||||
|
{
|
||||||
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, GameWindow::GetTitle(), Localise("Video_BackendError").c_str(), GameWindow::s_pWindow);
|
||||||
|
std::_Exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Video::StartPipelinePrecompilation();
|
Video::StartPipelinePrecompilation();
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <kernel/function.h>
|
#include <kernel/function.h>
|
||||||
#include <kernel/heap.h>
|
#include <kernel/heap.h>
|
||||||
#include <user/paths.h>
|
#include <user/paths.h>
|
||||||
|
#include <os/process.h>
|
||||||
#include <xxHashMap.h>
|
#include <xxHashMap.h>
|
||||||
|
|
||||||
enum class ModType
|
enum class ModType
|
||||||
@@ -26,9 +27,6 @@ static std::vector<Mod> g_mods;
|
|||||||
|
|
||||||
std::filesystem::path ModLoader::ResolvePath(std::string_view path)
|
std::filesystem::path ModLoader::ResolvePath(std::string_view path)
|
||||||
{
|
{
|
||||||
if (g_mods.empty())
|
|
||||||
return {};
|
|
||||||
|
|
||||||
std::string_view root;
|
std::string_view root;
|
||||||
|
|
||||||
size_t sepIndex = path.find(":\\");
|
size_t sepIndex = path.find(":\\");
|
||||||
@@ -51,6 +49,9 @@ std::filesystem::path ModLoader::ResolvePath(std::string_view path)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_mods.empty())
|
||||||
|
return {};
|
||||||
|
|
||||||
thread_local xxHashMap<std::filesystem::path> s_cache;
|
thread_local xxHashMap<std::filesystem::path> s_cache;
|
||||||
|
|
||||||
XXH64_hash_t hash = XXH3_64bits(path.data(), path.size());
|
XXH64_hash_t hash = XXH3_64bits(path.data(), path.size());
|
||||||
@@ -90,7 +91,7 @@ std::vector<std::filesystem::path>* ModLoader::GetIncludeDirectories(size_t modI
|
|||||||
|
|
||||||
void ModLoader::Init()
|
void ModLoader::Init()
|
||||||
{
|
{
|
||||||
std::filesystem::path userPath = GetUserPath();
|
const std::filesystem::path& userPath = GetUserPath();
|
||||||
|
|
||||||
IniFile configIni;
|
IniFile configIni;
|
||||||
if (!configIni.read(userPath / "cpkredir.ini"))
|
if (!configIni.read(userPath / "cpkredir.ini"))
|
||||||
@@ -110,9 +111,14 @@ void ModLoader::Init()
|
|||||||
if (!saveFilePathU8.empty())
|
if (!saveFilePathU8.empty())
|
||||||
ModLoader::s_saveFilePath = std::u8string_view((const char8_t*)saveFilePathU8.c_str());
|
ModLoader::s_saveFilePath = std::u8string_view((const char8_t*)saveFilePathU8.c_str());
|
||||||
else
|
else
|
||||||
ModLoader::s_saveFilePath = userPath / "mlsave/SYS-DATA";
|
ModLoader::s_saveFilePath = userPath / "mlsave";
|
||||||
|
|
||||||
|
ModLoader::s_saveFilePath /= "SYS-DATA";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configIni.getString("CPKREDIR", "LogType", std::string()) == "console")
|
||||||
|
os::process::ShowConsole();
|
||||||
|
|
||||||
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
||||||
if (modsDbIniFilePathU8.empty())
|
if (modsDbIniFilePathU8.empty())
|
||||||
return;
|
return;
|
||||||
@@ -187,15 +193,20 @@ void ModLoader::Init()
|
|||||||
modSaveFilePathU8 = modIni.getString("Main", "SaveFile", std::string());
|
modSaveFilePathU8 = modIni.getString("Main", "SaveFile", std::string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mod.includeDirs.empty())
|
|
||||||
g_mods.emplace_back(std::move(mod));
|
|
||||||
|
|
||||||
if (!modSaveFilePathU8.empty())
|
if (!modSaveFilePathU8.empty())
|
||||||
{
|
{
|
||||||
std::replace(modSaveFilePathU8.begin(), modSaveFilePathU8.end(), '\\', '/');
|
std::replace(modSaveFilePathU8.begin(), modSaveFilePathU8.end(), '\\', '/');
|
||||||
ModLoader::s_saveFilePath = modDirectoryPath / std::u8string_view((const char8_t*)modSaveFilePathU8.c_str());
|
ModLoader::s_saveFilePath = modDirectoryPath / std::u8string_view((const char8_t*)modSaveFilePathU8.c_str());
|
||||||
|
|
||||||
|
// Save file paths in HMM mods are treated as folders.
|
||||||
|
if (mod.type == ModType::HMM)
|
||||||
|
ModLoader::s_saveFilePath /= "SYS-DATA";
|
||||||
|
|
||||||
foundModSaveFilePath = true;
|
foundModSaveFilePath = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mod.includeDirs.empty())
|
||||||
|
g_mods.emplace_back(std::move(mod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include <os/logger_detail.h>
|
#include <os/logger.h>
|
||||||
|
|
||||||
void os::logger::detail::Init()
|
void os::logger::Init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::logger::detail::Log(const std::string_view str, detail::ELogType type, const char* func)
|
void os::logger::Log(const std::string_view str, ELogType type, const char* func)
|
||||||
{
|
{
|
||||||
if (func)
|
if (func)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <os/media_detail.h>
|
#include <os/media.h>
|
||||||
|
|
||||||
bool os::media::detail::IsExternalMediaPlaying()
|
bool os::media::IsExternalMediaPlaying()
|
||||||
{
|
{
|
||||||
// This functionality is not supported in Linux.
|
// This functionality is not supported in Linux.
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <os/process_detail.h>
|
#include <os/process.h>
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
std::filesystem::path os::process::detail::GetExecutablePath()
|
std::filesystem::path os::process::GetExecutablePath()
|
||||||
{
|
{
|
||||||
char exePath[PATH_MAX] = {};
|
char exePath[PATH_MAX] = {};
|
||||||
if (readlink("/proc/self/exe", exePath, PATH_MAX) > 0)
|
if (readlink("/proc/self/exe", exePath, PATH_MAX) > 0)
|
||||||
@@ -15,7 +15,7 @@ std::filesystem::path os::process::detail::GetExecutablePath()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::filesystem::path os::process::detail::GetWorkingDirectory()
|
std::filesystem::path os::process::GetWorkingDirectory()
|
||||||
{
|
{
|
||||||
char cwd[PATH_MAX] = {};
|
char cwd[PATH_MAX] = {};
|
||||||
char *res = getcwd(cwd, sizeof(cwd));
|
char *res = getcwd(cwd, sizeof(cwd));
|
||||||
@@ -29,7 +29,12 @@ std::filesystem::path os::process::detail::GetWorkingDirectory()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::process::detail::StartProcess(const std::filesystem::path path, const std::vector<std::string> args, std::filesystem::path work)
|
bool os::process::SetWorkingDirectory(const std::filesystem::path& path)
|
||||||
|
{
|
||||||
|
return chdir(path.c_str()) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool os::process::StartProcess(const std::filesystem::path& path, const std::vector<std::string>& args, std::filesystem::path work)
|
||||||
{
|
{
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
@@ -55,3 +60,8 @@ bool os::process::detail::StartProcess(const std::filesystem::path path, const s
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void os::process::ShowConsole()
|
||||||
|
{
|
||||||
|
// Unnecessary on Linux.
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#include <os/registry.h>
|
||||||
|
|
||||||
|
// TODO: Implement
|
||||||
|
inline bool os::registry::Init()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: read from file?
|
||||||
|
template<typename T>
|
||||||
|
bool os::registry::ReadValue(const std::string_view& name, T& data)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: write to file?
|
||||||
|
template<typename T>
|
||||||
|
bool os::registry::WriteValue(const std::string_view& name, const T& data)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <os/user_detail.h>
|
#include <os/user.h>
|
||||||
|
|
||||||
bool os::user::detail::IsDarkTheme()
|
bool os::user::IsDarkTheme()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user