mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-09 04:40:26 -04:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 131427e017 | |||
| 45c0880145 | |||
| 024c35c1fe | |||
| a9e280e116 | |||
| c64ef1fe15 | |||
| c19a7b1e11 | |||
| 3c050887d8 | |||
| 676c3f0ff4 | |||
| 3676c28114 | |||
| df5e48f528 | |||
| c07a754f4f | |||
| 8a80db141d | |||
| 48458cb903 | |||
| 1c225184a1 | |||
| 6ef7789b17 | |||
| 756d001d35 | |||
| 0866be0c3d | |||
| 4705ffddc2 | |||
| da5db2a05a | |||
| 985dbf3bc0 | |||
| 9fbd847d50 | |||
| 34a23d48db | |||
| 8915b06a95 | |||
| f9b5e52a8b | |||
| fd2fb745e0 | |||
| fe06134bb1 | |||
| 917dacf453 | |||
| 206145c44e | |||
| 9e744ffded | |||
| 881712999c | |||
| e5ddc85853 | |||
| d49c648f12 | |||
| e251f15afa | |||
| 2ee4a056e6 | |||
| 8d6847075a | |||
| 076732c4b5 | |||
| 716200e7df | |||
| 999fa2af61 | |||
| 821f5eba4b | |||
| 762dbe0419 | |||
| 0128377ad9 | |||
| 98daa27c14 | |||
| 0b16633ee1 | |||
| 388a86e866 | |||
| fef357062d | |||
| 03ef34ffe8 | |||
| c90d1fcb7b | |||
| ae3dfb12df | |||
| db76ffa5b3 | |||
| 7e51a00e3a | |||
| b3d5cdbe3b | |||
| 8ff365cbaa | |||
| d812c12d06 | |||
| 27d4af12ad | |||
| 82f81dc7f9 | |||
| 5f5517977a | |||
| b101e016cf | |||
| de7148772b | |||
| 4d4eba693f | |||
| 08c791f2cf | |||
| 07ad85b7bb | |||
| ba522c0e42 | |||
| 0afd01ff7e | |||
| 5ba4e927ab | |||
| f123ec7083 | |||
| b8ae355915 | |||
| 14faa17cd8 | |||
| 4aeee49561 | |||
| 49cc504ced | |||
| 91f874cbad | |||
| df8234ab3b | |||
| c68b5247c7 | |||
| 910d043f19 | |||
| beac8339c2 | |||
| 02c23384f3 | |||
| 868e0f922a | |||
| 95c044299e | |||
| b04d9e683c | |||
| 5e8d15e334 | |||
| 8f8b574e56 | |||
| c8feff3f8d | |||
| 414ccb3637 | |||
| 431a6d9841 | |||
| 7a5cfe55f5 | |||
| 4f3144472a | |||
| e9f510e8c9 | |||
| a54f850425 | |||
| ab382deb04 | |||
| 8df3e0e440 | |||
| fe083f0eed | |||
| a8e78c21d1 | |||
| 9ec6bd95e1 | |||
| 771c2626b8 | |||
| 54a63e857a | |||
| a13fdc136b | |||
| 86b346e037 | |||
| 3081aec7c1 | |||
| dd294a30d4 | |||
| 99d6cebf92 | |||
| e86922b2b2 | |||
| a07610fb7a | |||
| db4974a9ca | |||
| 4b09a22041 | |||
| 989bf85986 | |||
| 0194c372e9 | |||
| 854d7412fa | |||
| 0441845f2a | |||
| f6d820faae | |||
| a7063dc118 | |||
| fb55ac1087 | |||
| e76cbff3ea | |||
| d2a3818700 | |||
| 3285ad045f | |||
| c687d87126 | |||
| 4502a9efee | |||
| fc99db7c97 | |||
| 0b8b243404 | |||
| 8220f6772b | |||
| b7cee84bda | |||
| 073065c6a6 | |||
| ed6f8f082b | |||
| f23d8ae08e | |||
| f7e660b5d8 | |||
| 7c1aea4e24 | |||
| 138d9b616d | |||
| 7f108285fe | |||
| 97b20742a3 | |||
| fcd1673cfc | |||
| fff96a8528 | |||
| 2fdd32e889 | |||
| 54aacf9a1f | |||
| 39272b7975 |
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Report a bug in Unleashed Recompiled
|
||||
type: Bug
|
||||
---
|
||||
|
||||
### Validation
|
||||
- [ ] I have checked the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page to see if my problem has already been reported
|
||||
- [ ] I have confirmed that this bug does not occur in the original game running on original Xbox 360 hardware
|
||||
|
||||
#### If you have DLC installed, please specify which ones you have.
|
||||
- [ ] Apotos & Shamar Adventure Pack
|
||||
- [ ] Chun-nan Adventure Pack
|
||||
- [ ] Empire City & Adabat Adventure Pack
|
||||
- [ ] Holoska Adventure Pack
|
||||
- [ ] Mazuri Adventure Pack
|
||||
- [ ] Spagonia Adventure Pack
|
||||
|
||||
#### If you have mods enabled, please specify which ones you have.
|
||||
Provide a list of your enabled mods in Hedge Mod Manager here. You will not receive support for issues *caused* by mods.
|
||||
|
||||
#### If you have codes enabled, please specify which ones you have.
|
||||
Provide a list of your enabled codes in Hedge Mod Manager here.
|
||||
|
||||
### Describe the Bug
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
### Steps to Reproduce
|
||||
Steps to reproduce the bug:
|
||||
1. Go to '...'
|
||||
2. etc.
|
||||
|
||||
### Expected Behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
### Footage
|
||||
Attach a screenshot or video of the bug. If possible, please also provide footage of the expected behaviour on original Xbox 360 hardware.
|
||||
|
||||
### Specifications
|
||||
Fill out the following details:
|
||||
- CPU: (e.g. Intel Core [...], AMD Ryzen [...], etc.)
|
||||
- GPU: (e.g. NVIDIA GeForce [...], Radeon HD [...], Intel HD [...], etc.)
|
||||
- GPU Driver: (e.g NVIDIA driver 545.XX, AMD driver 24.X.X, etc.)
|
||||
- OS: (e.g. Windows 10, Windows 11, Linux distro)
|
||||
- Version: (e.g. 1.0.0)
|
||||
|
||||
### Additional Context
|
||||
Provide any other context about the problem here.
|
||||
@@ -1,73 +0,0 @@
|
||||
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
|
||||
@@ -1,94 +0,0 @@
|
||||
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
|
||||
@@ -0,0 +1,20 @@
|
||||
name: validate-external
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
jobs:
|
||||
authorize:
|
||||
if: github.repository != github.event.pull_request.head.repo.full_name
|
||||
environment:
|
||||
${{ github.event_name == 'pull_request_target' &&
|
||||
github.event.pull_request.head.repo.full_name != github.repository &&
|
||||
'external' || 'internal' }}
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- run: echo ✓
|
||||
build:
|
||||
needs: authorize
|
||||
uses: ./.github/workflows/validate.yml
|
||||
secrets:
|
||||
ASSET_REPO: ${{ secrets.ASSET_REPO }}
|
||||
ASSET_REPO_TOKEN: ${{ secrets.ASSET_REPO_TOKEN }}
|
||||
@@ -0,0 +1,12 @@
|
||||
name: validate-internal
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
jobs:
|
||||
build:
|
||||
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
|
||||
uses: ./.github/workflows/validate.yml
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,214 @@
|
||||
name: validate
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
ASSET_REPO:
|
||||
required: true
|
||||
ASSET_REPO_TOKEN:
|
||||
required: true
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Build Linux
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
preset: ["linux-debug", "linux-release", "linux-relwithdebinfo"]
|
||||
env:
|
||||
LLVM_VERSION: 18
|
||||
CMAKE_PRESET: ${{ matrix.preset }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- 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 }}-${{ matrix.preset }}
|
||||
|
||||
- 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 (Linux)
|
||||
run: |-
|
||||
sudo apt update
|
||||
sudo apt install -y ninja-build llvm-${{ env.LLVM_VERSION }}-dev libgtk-3-dev
|
||||
|
||||
- name: Cache ccache Directory
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ccache-${{ runner.os }}-${{ matrix.preset }}
|
||||
|
||||
- name: Prepare Project
|
||||
run: cp ./private/* ./UnleashedRecompLib/private
|
||||
|
||||
- name: Configure Project
|
||||
env:
|
||||
CCACHE_DIR: /tmp/ccache
|
||||
run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
|
||||
|
||||
- name: Build Project
|
||||
env:
|
||||
CCACHE_DIR: /tmp/ccache
|
||||
run: cmake --build ./out/build/${{ env.CMAKE_PRESET }} --target UnleashedRecomp
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnleashedRecomp-Linux-${{ env.CMAKE_PRESET }}
|
||||
path: ./out/build/${{ env.CMAKE_PRESET }}/UnleashedRecomp/UnleashedRecomp
|
||||
build-windows:
|
||||
name: Build Windows
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
preset: ["x64-Clang-Debug", "x64-Clang-Release", "x64-Clang-RelWithDebInfo"]
|
||||
env:
|
||||
CMAKE_PRESET: ${{ matrix.preset }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- 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 }}-${{ matrix.preset }}
|
||||
|
||||
- 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
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnleashedRecomp-Windows-${{ env.CMAKE_PRESET }}
|
||||
path: .\UnleashedRecomp-Windows.zip
|
||||
|
||||
- name: Upload PDB
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ matrix.preset != 'x64-Clang-Release' }}
|
||||
with:
|
||||
name: UnleashedRecomp-Windows-${{ env.CMAKE_PRESET }}-PDB
|
||||
path: .\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.pdb
|
||||
build-flatpak:
|
||||
name: Build Flatpak
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
|
||||
FREEDESKTOP_VERSION: 23.08
|
||||
LLVM_VERSION: 18
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout Private Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ secrets.ASSET_REPO }}
|
||||
token: ${{ secrets.ASSET_REPO_TOKEN }}
|
||||
path: ./private
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |-
|
||||
sudo apt update
|
||||
sudo apt install -y flatpak-builder ccache
|
||||
|
||||
- name: Setup ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/ccache
|
||||
key: ccache-${{ runner.os }}
|
||||
|
||||
- name: Prepare Project
|
||||
run: cp ./private/* ./UnleashedRecompLib/private
|
||||
|
||||
- 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
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: UnleashedRecomp-Flatpak
|
||||
path: ./${{ env.FLATPAK_ID }}.flatpak
|
||||
@@ -7,9 +7,6 @@
|
||||
[submodule "tools/XenosRecomp"]
|
||||
path = tools/XenosRecomp
|
||||
url = https://github.com/hedge-dev/XenosRecomp.git
|
||||
[submodule "thirdparty/libmspack"]
|
||||
path = thirdparty/libmspack
|
||||
url = https://github.com/kyz/libmspack
|
||||
[submodule "UnleashedRecompResources"]
|
||||
path = UnleashedRecompResources
|
||||
url = https://github.com/hedge-dev/UnleashedRecompResources.git
|
||||
@@ -40,9 +37,6 @@
|
||||
[submodule "thirdparty/concurrentqueue"]
|
||||
path = thirdparty/concurrentqueue
|
||||
url = https://github.com/cameron314/concurrentqueue.git
|
||||
[submodule "thirdparty/tiny-AES-c"]
|
||||
path = thirdparty/tiny-AES-c
|
||||
url = https://github.com/kokke/tiny-AES-c.git
|
||||
[submodule "thirdparty/magic_enum"]
|
||||
path = thirdparty/magic_enum
|
||||
url = https://github.com/Neargye/magic_enum.git
|
||||
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,13 +1,470 @@
|
||||
# UnleashedRecomp
|
||||
# Building
|
||||
1. Clone **UnleashedRecomp** with submodules (or run `update_submodules.bat` to ensure submodules are pulled).
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/hedge-dev/UnleashedRecomp.git
|
||||
```
|
||||
2. Decompress and decrypt `default.xex`, apply the title update patch (`default.xexp`), and place the resulting file in `./UnleashedRecompLib/private/`.
|
||||
3. Decompress `shader.ar` and place the resulting file in `./UnleashedRecompLib/private/`.
|
||||
4. Open the repository directory in Visual Studio 2022 and wait for CMake generation to complete. If you don't plan to debug, switch to the `x64-Clang-Release` configuration.
|
||||
5. Under Solution Explorer, right-click and choose "Switch to CMake Targets View".
|
||||
6. Right-click the **UnleashedRecomp** project and choose "Set as Startup Item", then choose "Add Debug Configuration".
|
||||
7. Add a `currentDir` property to the first element under `configurations` in the generated JSON and set its value to the path to your game directory (where root is the directory containing `dlc`, `game`, `save`, `update`, etc).
|
||||
8. Run or debug **UnleashedRecomp**. The initial compilation might take a while to complete due to code and shader recompilation.
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/hedge-dev/UnleashedRecompResources/refs/heads/main/images/logo/Logo.png" width="512"/>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
Unleashed Recompiled is an unofficial PC port of the Xbox 360 version of Sonic Unleashed created through the process of static recompilation. The port offers Windows and Linux support with numerous built-in enhancements such as high resolutions, ultrawide support, high frame rates, improved performance and modding.
|
||||
|
||||
**This project does not include any game assets. You must provide the files from your own legally acquired copy of the game to install or build Unleashed Recompiled.**
|
||||
|
||||
[Check out the latest release here](https://github.com/hedge-dev/UnleashedRecomp/releases/latest).
|
||||
|
||||
[XenonRecomp](https://github.com/hedge-dev/XenonRecomp) and [XenosRecomp](https://github.com/hedge-dev/XenosRecomp) are the main recompilers used for converting the game's original PowerPC code and Xenos shaders into compatible C++ and HLSL code respectively. The development of these recompilers was directly inspired by [N64: Recompiled](https://github.com/N64Recomp/N64Recomp), which was used to create [Zelda 64: Recompiled](https://github.com/Zelda64Recomp/Zelda64Recomp).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Minimum System Requirements](#minimum-system-requirements)
|
||||
- [How to Install](#how-to-install)
|
||||
- [Features](#features)
|
||||
- [Update Roadmap](#update-roadmap)
|
||||
- [Known Issues](#known-issues)
|
||||
- [FAQ](#faq)
|
||||
- [Building](#building)
|
||||
- [Credits](#credits)
|
||||
|
||||
## Minimum System Requirements
|
||||
|
||||
- CPU with support for the AVX instruction set:
|
||||
- Intel: Sandy Bridge (Intel Core 2nd Generation)
|
||||
- AMD: Bulldozer (AMD FX series)
|
||||
- GPU with support for Direct3D 12.0 (Shader Model 6) or Vulkan 1.2:
|
||||
- NVIDIA: GeForce GT 630 (Kepler)
|
||||
- AMD: Radeon HD 7750 (2012, not the RX 7000)
|
||||
- Intel: HD Graphics 510 (Skylake)
|
||||
- Memory:
|
||||
- 8 GB minimum
|
||||
- Operating System:
|
||||
- Windows 10 (version 1909)
|
||||
- A modern Linux distro such as Ubuntu 22.04 LTS
|
||||
- Storage:
|
||||
- With DLC: 10 GiB required
|
||||
- Without DLC: 6 GiB required
|
||||
|
||||
> [!NOTE]
|
||||
> More storage space may be required if uncompressed game files are provided during installation.
|
||||
|
||||
## How to Install
|
||||
|
||||
1) You must have access to the following:
|
||||
|
||||
- Xbox 360 (modifications not necessary)
|
||||
- Xbox 360 Hard Drive (20 GB minimum)
|
||||
- Xbox 360 Hard Drive Transfer Cable (or a compatible SATA to USB adapter)
|
||||
- Sonic Unleashed for Xbox 360 (US or EU, **JP is not supported**)
|
||||
- Retail Disc or Digital Copy (can be purchased and downloaded from the [Xbox Store](https://www.xbox.com/en-US/games/store/sonic-unleashed/c098fgnmts8f)).
|
||||
- Title Update required.
|
||||
- All available DLC (Adventure Packs) are optional, but **highly recommended**. **The DLC includes high quality lighting for the entire game**.
|
||||
|
||||
> [!TIP]
|
||||
> If you do not have the Xbox 360 Hard Drive Transfer Cable, please ensure that you purchase the correct revision of it for your console.
|
||||
>
|
||||
> The latest revision works with both original Xbox 360 and Xbox 360 S|E hard drives, but the first revision only works with original Xbox 360 hard drives.
|
||||
>
|
||||
> To know which is which, the first revision cable is gray, whereas the latest revision (which supports any Xbox 360 hard drive) is black.
|
||||
|
||||
2) **Before proceeding with the installation**, make sure to follow the guide on how to acquire the game files from your Xbox 360.
|
||||
|
||||
- [English Dumping Guide](/docs/DUMPING-en.md)
|
||||
|
||||
3) Download [the latest release](https://github.com/hedge-dev/UnleashedRecomp/releases/latest) of Unleashed Recompiled and extract it to where you'd like the game to be installed.
|
||||
|
||||
4) Run the executable and you will be guided through the installation process. You will be asked to provide the files you acquired in the previous step. When presented with options for how to do this:
|
||||
|
||||
- **Add Files** will only allow you to provide **containers or images dumped from an Xbox 360**. These often come in the form of very large files without associated extensions. Don't worry if you're not aware of what's inside of them, the installer will automatically detect what type of content is inside the container.
|
||||
|
||||
- **Add Folder** will only allow you to provide a **directory with the game's raw files** corresponding to the piece of content that is requested. **It will NOT scan your folder for compatible content!**
|
||||
|
||||
> [!NOTE]
|
||||
> Please note that it is **not possible** to complete the installation if your files have been **modified**. In case of other problems such as black screens or crashes, **do not try to reinstall the game** as it is not possible for the process to result in an invalid installation.
|
||||
|
||||
## Features
|
||||
|
||||
### Easy to Use Installer
|
||||
|
||||
A built-in installation wizard will guide you through the process of installing the game with many integrity checks to ensure the process goes as smoothly as possible. The installer can also be accessed from the title screen, if you wish to add the DLC at a later time.
|
||||
|
||||
### Options Menu
|
||||
|
||||
A completely new options menu accessible from the title screen or pause menu, with an unprecedented level of fidelity to the game's design language. Get access to many quality of life features and graphics options directly within the game with full controller navigation.
|
||||
|
||||
### Achievements
|
||||
|
||||
You will be rewarded with achievements as you progress through the game just like on its original platform. Achievements are recreated with integrated notifications and a new menu also very faithful to the game's design language. Get all of them and you will be rewarded with a gold trophy!
|
||||
|
||||
> [!NOTE]
|
||||
> Achievements cannot be used with platforms such as Steam or RetroAchievements.
|
||||
|
||||
### Custom Localization
|
||||
|
||||
All of the new menus in the port fully support localization for each of the game's originally supported languages; English, Japanese, German, French, Spanish and Italian. As a bonus, switching the game to Japanese also changes the title screen logo to its original Japanese counterpart.
|
||||
|
||||
### High Fidelity
|
||||
|
||||
Special care and attention was taken to recreate the game's visuals as accurately as possible and was always compared to the game running on the original hardware. The colors are as vibrant as those of the PlayStation 3 version, which did not use the color correction filter present in the Xbox 360 version, as was originally intended. Nevertheless, an option to recreate the original warm filter from the Xbox 360 version has been included as an option.
|
||||
|
||||
### High Resolution Enhancements
|
||||
|
||||
Many improvements have been provided to accompany support for higher resolutions:
|
||||
|
||||
- Multisample Anti-Aliasing (MSAA) levels beyond the 2x used by the original game.
|
||||
- Higher quality Depth of Field (DoF), an effect which commonly breaks in emulators when increasing the game's resolution. The original effect's formula was reverse-engineered and versions with 5x5, 7x7 and 9x9 taps were added based on the target resolution.
|
||||
- An "Enhanced" Motion Blur option which uses more samples than the original for a smoother blur.
|
||||
- Support for "Alpha to Coverage" Anti-Aliasing to enhance the visual result of transparent textures with hard edges.
|
||||
- A Bicubic Texture Filtering option which greatly enhances the visual result of Global Illumination textures.
|
||||
- A more precise implementation of the game's reverse Z technique, eliminating most Z-fighting issues and fixing the jittery motion blur in stages like Jungle Joyride.
|
||||
|
||||
### High Performance Renderer
|
||||
|
||||
A new renderer was written from scratch to translate the game's draw calls to modern APIs in a highly efficient way while also taking advantage of multi-threading.
|
||||
|
||||
As emulation of the Xbox 360's GPU is not required in a recompilation, many decisions were made to skip quirks of the original hardware that are not required in a PC port, resulting in great improvements to performance.
|
||||
|
||||
Modern rendering techniques such as bindless textures and shader specialization are also used to maximize the performance on systems with modern hardware whilst also supporting a wide range of lower end hardware.
|
||||
|
||||
Multiple optimizations were made to the game's shadow map rendering and special techniques were developed to automatically detect and skip unnecessary texture copies that are no longer needed in modern APIs.
|
||||
|
||||
Additionally, to support the game's extensive use of asset streaming, parallel transfer queues are leveraged, a feature only available in modern APIs that enable efficient use of available PCI-E bandwidth.
|
||||
|
||||
### High Frame Rate Support
|
||||
|
||||
The game's frame rate cap has been increased by default to 60 FPS, with support for higher targets and unlocked frame rate being available from the options menu. A vast amount of glitches that usually occur at higher frame rates have been fixed and are included as part of the recompilation.
|
||||
|
||||
> [!NOTE]
|
||||
> While the game is considered to be beatable at frame rates higher than 60 FPS, please note that [some issues](#high-frame-rate-glitches) can still occur. Some of these issues may be addressed in future updates.
|
||||
|
||||
### Ultrawide Support
|
||||
|
||||
Aspect ratios for ultrawide displays (such as 21:9 or even wider) are supported out of the box, with options to adjust the alignment of the UI to the edges or to the original 16:9 safe area, if desired. No external codes are required!
|
||||
|
||||
> [!NOTE]
|
||||
> By default, cutscenes are locked to their original aspect ratio to prevent [presentation issues](#ultrawide-visual-issues), as the game was not designed to present these scenes with wider aspect ratios. However, you can use the included option to unlock this feature if you don't mind these issues.
|
||||
|
||||
### Extended Controller Features
|
||||
|
||||
Support for the D-Pad has been added to various parts of the game, allowing the full game to be completed using it over the analog stick, if you so desire.
|
||||
|
||||
If you have a DualShock 4 or DualSense controller, the LED will dynamically change color depending on the game context and support for the touchpad has been added to the World Map, allowing you to spin the planet freely!
|
||||
|
||||
> [!NOTE]
|
||||
> LED and touchpad support for the DualShock 4 and DualSense controllers may be limited when using third-party input translation layers (such as DS4Windows or Steam Input).
|
||||
>
|
||||
> Support for both features may also be limited on Linux.
|
||||
|
||||
### Low Input Latency
|
||||
|
||||
Modern input latency reduction techniques are included to improve the game's responsiveness as much as possible, such as support for [Waitable Swap Chains](https://learn.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains) in both D3D12 and Vulkan. This methodology was applied directly before the game's input polling to minimize latency. Additionally, the D3D12 backend also supports [Flip Models](https://devblogs.microsoft.com/directx/dxgi-flip-model/), allowing the game to directly present to the screen as quickly as possible.
|
||||
|
||||
### Asynchronous Shader Compilation
|
||||
|
||||
One of the biggest improvements that the recompilation features over emulators is the fact that Pipeline Compilation (commonly known as "Shader Compilation") is directly integrated into the game as part of the asset loading process. This means there's **no stutters during gameplay the first time new objects or effects appear**.
|
||||
|
||||
The renderer will traverse the game's rendering structures and automatically determine what pipelines must be compiled before it considers the asset is loaded. As a result, pipeline compilation is performed in parallel as part of the game's background workers that take care of streaming in the assets, either during regular gameplay or as part of the game's loading screens. This is an improvement that'd never be possible with an emulator, as it requires direct modification of the game to implement this feature.
|
||||
|
||||
While this system is very extensive, some special shaders such as post-processing effects or 2D elements are not detected ahead of time, so a list of pre-determined pipelines are compiled during the game's boot sequence. However, the amount is so low that this is done completely in the background and it was determined that there was no need to show a shader compilation screen on most systems that were tested.
|
||||
|
||||
> [!NOTE]
|
||||
> While stutters from shader compilation are non-existent, please be aware that [some stutters](#unavoidable-stutters) may be encountered due to the way the game was programmed. If you encounter these, please keep in mind that **these are not related to shader compilation**. Some of these issues may be addressed in future updates.
|
||||
|
||||
### Support for Xbox and PlayStation Controller Icons
|
||||
|
||||
You can freely choose whether to use Xbox 360 or PlayStation 3 controller icons. By default, the game will automatically detect which to use based on your controller, but you can select a different option based on your personal preference from within the options menu.
|
||||
|
||||
Game objects that display controller icons such as Reaction Plates or Jump Selectors will automatically switch their textures to match the option in use. Even small details such as the Tornado Defense missions using different colors for the missiles have been accounted for.
|
||||
|
||||
### Quality of Life Options
|
||||
|
||||
Many options have been integrated to address some common quality of life improvements that were deemed to be essential to the port:
|
||||
|
||||
- Hint rings and other types of hints provided by the game during exploration or boss fights can be disabled.
|
||||
- Control tutorials (as referred to by current Sonic games) can be disabled to remove button prompts that show up during gameplay to teach the player how to use certain moves.
|
||||
- The Werehog's Battle Theme, commonly considered to be an annoyance in the original game due to its frequency and interruption of the stage's background music, can now be disabled.
|
||||
- The day/night transformation cutscene in towns can use either the Xbox 360 or PlayStation 3 version, with the Xbox version artificially extending loading times for the full video play out, whilst the PlayStation version ends as soon as it's done loading.
|
||||
- Music Attenuation is a feature that was originally present in the Xbox 360 version of the game, where it'd automatically mute the background music if the console's media player was in use. This feature has been implemented using information provided by the [Windows Media Control](https://learn.microsoft.com/en-us/uwp/api/windows.media.control?view=winrt-26100) APIs in [WinRT](https://en.wikipedia.org/wiki/Windows_Runtime). Applications that interface with Windows 10/11 to display media controls are supported.
|
||||
|
||||
> [!TIP]
|
||||
> You may refer to Music Presence's [list of supported media players](https://github.com/ungive/discord-music-presence/blob/master/documentation/supported-media-players.md) for players that work with Music Attenuation out of the box.
|
||||
|
||||
> [!NOTE]
|
||||
> Please note that Music Attenuation is not currently available on Linux. Support for this feature may be added in a future update.
|
||||
|
||||
### Steam Deck Support
|
||||
|
||||
Native Linux builds that work on the Steam Deck out of the box are available. The Flatpak version can be installed directly and added as a non-Steam game easily via Desktop Mode.
|
||||
|
||||
Be aware that installing the game on a Steam Deck can be a slow process and can easily consume the Deck's storage on the 64 GB model, so make sure you provide the game's files via external storage, such as a microSD card or a network share if possible.
|
||||
|
||||
Performance has been found to improve significantly when the Deck's GPU clock is manually set to its maximum value via Gamescope, even if the game appears to be primarily CPU bottlenecked. Be aware that maintaining the target frame rate may be difficult during demanding sections, such as Werehog combat or DLC stages. Overall, performance is considered to be noticeably better than on the original hardware while using the default settings.
|
||||
|
||||
> [!NOTE]
|
||||
> It is recommended to perform the installation process while in Desktop Mode, as the [file picker may not be available in Game Mode](#file-picker-unavailable-on-steam-deck-in-game-mode) at all times.
|
||||
|
||||
### Mod Support
|
||||
|
||||
The game includes a mod loader compatible with [Hedge Mod Manager](https://github.com/thesupersonic16/HedgeModManager). As an option, users looking for Linux support should try the development version of [HMM 8](https://github.com/hedge-dev/HedgeModManager), which should work out of the box on platforms such as the Steam Deck.
|
||||
|
||||
The mod format uses the same standard as the one used by Sonic Generations mods. Mods that were originally created for [Unleashed Mod Manager](https://github.com/hyperbx/Unleashed-Mod-Manager) are also supported for the sake of backwards compatibility. However, using this mod format is not recommended in the long term and should now be considered deprecated.
|
||||
|
||||
Modded files for the Xbox 360 version of the game are compatible with Unleashed Recompiled. However, some mods may have targeted a version of the game that doesn't contain the title update, so those may have issues and require updates from their authors in order to work with the recompilation. Mods that replace the game's executable file (`default.xex`) or shaders are not supported.
|
||||
|
||||
> [!NOTE]
|
||||
> Code modding is currently not possible and is [planned for a future update](#code-modding). As a workaround for the time being, some codes have been directly embedded into the game and can be accessed through Hedge Mod Manager's Codes tab.
|
||||
>
|
||||
> For information on the mod format, check out Hedge Mod Manager's [Basic Mod File Structure](https://github.com/thesupersonic16/HedgeModManager/wiki/Basic-Mod-File-Structure) wiki page.
|
||||
|
||||
## Update Roadmap
|
||||
|
||||
A number of different features are planned for future updates.
|
||||
|
||||
### Action Remapping
|
||||
|
||||
Options for changing the bindings of the player actions to the controller buttons, as well as support for keyboard bindings. In the meantime, refer to this [question in the FAQ](#what-are-the-keyboard-bindings) for the default keyboard bindings, as well as where to edit them if necessary.
|
||||
|
||||
### More Linux Builds
|
||||
|
||||
Linux builds that don't require Flatpak will be added in the future when a way to [create the shortcuts required for HedgeModManager](https://github.com/hedge-dev/UnleashedRecomp/issues/451) is implemented. In the meantime, you can access these builds through the [Actions](https://github.com/hedge-dev/UnleashedRecomp/actions) panel or [build them yourself](#building).
|
||||
|
||||
### High Frame Rate Fixes
|
||||
|
||||
A number of [gameplay issues](#high-frame-rate-glitches) are currently present that will gradually be fixed as more research into how the game works is done. At the moment, the game is considered to be beatable at high frame rates, but you may be required to limit the game to 60 FPS in order to clear some optional content.
|
||||
|
||||
### Code Modding
|
||||
|
||||
Modifying the code of a recompilation is a fundamentally different process than doing it for a game that only supports one platform on a single executable version. Everyone can build and fork Unleashed Recompiled on their own, which makes the method of targeting a single executable essentially impossible.
|
||||
|
||||
A convenient and maintainable method for code modding is under research and will come in a future update, which will work consistently across all the platforms that Unleashed Recompiled currently supports.
|
||||
|
||||
In the meantime, those interested in doing extensive code modding are recommended to fork the repository and introduce their changes in preparation for the code modding update.
|
||||
|
||||
### Stance on New Features
|
||||
|
||||
The team behind Unleashed Recompiled is committed to preserving the game's original design as best as possible. Additional features that don't fit the vision of the project will be left to mods or forks to cover. As such, requests for such features will not be considered. If you request a new feature, make sure it makes sense within the design of the original game and fits the goal of delivering a PC version of the game.
|
||||
|
||||
## Known Issues
|
||||
|
||||
### Unavoidable Stutters
|
||||
|
||||
While Unleashed Recompiled does its best effort on fixing any hitches and stutters that could originate from the translation process, some problems are not possible to fix due to the way the game was built.
|
||||
|
||||
Even if the recompilation process introduces a small overhead, the game does not perform some tasks in an asynchronous way. These stutters exist on original hardware, but are much more noticeable when targeting higher frame rates.
|
||||
|
||||
Most of the known stutters are related to the game loading in layers of new objects at certain points in stages, spawning in particle systems or playing multiple sound effects. These operations can produce pauses that can last almost 10 milliseconds, even on powerful hardware. These hitches are much easier to notice when targeting frame rates such as 120 FPS, where one frame only lasts around 8 milliseconds.
|
||||
|
||||
These problems are not possible to mitigate without further research into how the game works and will remain a goal for future updates to fix if possible. However, [as mentioned in the FAQ](#how-can-i-improve-performance), it's been found that these stutters can be significantly mitigated by playing on Linux, possibly due to the amount of synchronization primitives used by the game when these operations are performed.
|
||||
|
||||
### High Frame Rate Glitches
|
||||
|
||||
Sonic Unleashed is not a game that runs at a fixed rate on any of its target platforms. While it does target 30 FPS on Xbox 360 and is uncapped on PlayStation 3, it doesn't exactly hit these targets often depending on the area, and if it does, the time step itself is subject to large deviations. The game's programming simply follows the time step as closely as possible, which means inconsistencies in the time step are impossible to reproduce without targeting one exact piece of hardware.
|
||||
|
||||
A lot of the bugs present in the game can largely be explained by sudden spikes in frame times. To make matters worse, some bugs were found to be present only if the frame rate is too stable, such as this [infamous bug](https://github.com/hedge-dev/UnleashedRecomp/issues/100) that shows up in the Wii version of the game because the cutscene was recorded with a fixed time step.
|
||||
|
||||
Unleashed Recompiled features a vast amount of fixes for issues that present themselves when targeting high frame rates, but fixing *all of them* is too big of a task without more knowledge of how the game works. It is possible that these issues will be fixed in the future or that alternative solutions such as transform interpolation are implemented instead.
|
||||
|
||||
If you encounter game breaking bugs or unplayable sections, try temporarily limiting the frame rate to resolve them. Also, check the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page for any existing reports.
|
||||
|
||||
### Ultrawide Visual Issues
|
||||
|
||||
Visual oddities may occur when unlocking the aspect ratio during cutscenes, as the game was not designed for wider formats. Adjusting these scenes can be subjective, so it will be up to mods to address these issues, as they require modifying the game's animations and object placement within cutscene files.
|
||||
|
||||
### Original Game Bugs
|
||||
|
||||
Game bugs present on the original hardware are intentionally preserved and will not be fixed. Please do not report issues for these bugs and verify that the issue does not occur on original hardware before reporting. Bug reports for issues found in the original game will be rejected. Bugs that only happen in Unleashed Recompiled must be accompanied by footage captured on original Xbox 360 hardware showing that the bug does not happen there.
|
||||
|
||||
### File Picker Unavailable on Steam Deck in Game Mode
|
||||
|
||||
Due to some restrictions of how the desktop environment on the Steam Deck works whilst in Game Mode, please note that you may need to at least first boot into Desktop Mode to be able to use the file picker to provide the game files.
|
||||
|
||||
Simply booting at least once in Desktop Mode will enable the Deck to use the file picker when going back to Game Mode. You can complete the entire installation process while in Desktop Mode to save yourself the trouble of browsing through Game Mode if necessary.
|
||||
|
||||
## FAQ
|
||||
|
||||
### Do you have a Discord server?
|
||||
|
||||
Unleashed Recompiled is not associated with any Discord servers. Use the [Issues](https://github.com/hedge-dev/UnleashedRecomp/issues) page if you need support.
|
||||
|
||||
### Why does the installer say my files are invalid?
|
||||
|
||||
The installer may display this error for several reasons. Please check the following to ensure your files are valid:
|
||||
|
||||
- Please read the [How to Install](#how-to-install) section and make sure you've acquired all of the necessary files correctly.
|
||||
|
||||
- Verify that you're not trying to add compressed files such as `.zip`, `.7z`, `.rar` or other formats.
|
||||
|
||||
- Only use the **Add Folder** option if you're sure you have a directory with the content's files already extracted, which means it'll only contain files like `.xex`, `.ar.00`, `.arl` and others. **This option will not scan your folder for compatible content**.
|
||||
|
||||
- Ensure that the files you've acquired correspond to the same region. **Discs and Title Updates from different regions can't be used together** and will fail to generate a patch.
|
||||
|
||||
- The installer will only accept **original and unmodified files**. Do not attempt to provide modified files to the installer.
|
||||
|
||||
### What are the keyboard bindings?
|
||||
|
||||
Pad|Key
|
||||
-|-
|
||||
A (Cross)|S
|
||||
B (Circle)|D
|
||||
X (Square)|A
|
||||
Y (Triangle)|W
|
||||
D-Pad - Up|Unbound
|
||||
D-Pad - Down|Unbound
|
||||
D-Pad - Left|Unbound
|
||||
D-Pad - Right|Unbound
|
||||
Start|Return
|
||||
Back (Select)|Backspace
|
||||
Left Trigger (L2)|1
|
||||
Right Trigger (R2)|3
|
||||
Left Bumper (L1)|Q
|
||||
Right Bumper (R1)|E
|
||||
Left Stick - Up|Up Arrow
|
||||
Left Stick - Down|Down Arrow
|
||||
Left Stick - Left|Left Arrow
|
||||
Left Stick - Right|Right Arrow
|
||||
Right Stick - Up|Unbound
|
||||
Right Stick - Down|Unbound
|
||||
Right Stick - Left|Unbound
|
||||
Right Stick - Right|Unbound
|
||||
|
||||
---
|
||||
|
||||
You can change the keyboard bindings by editing `config.toml` located in the [configuration directory](#where-is-the-save-data-and-configuration-file-stored), although using a controller is highly recommended until [Action Remapping](#action-remapping) is added in a future update.
|
||||
|
||||
Refer to the left column of [this enum template](https://github.com/hedge-dev/UnleashedRecomp/blob/main/UnleashedRecomp/user/config.cpp#L40) for a list of valid keys.
|
||||
|
||||
*The default keyboard layout is based on Devil's Details' keyboard layout for Sonic Generations (2011)*.
|
||||
|
||||
### Where is the save data and configuration file stored?
|
||||
|
||||
The save data and configuration files are stored at the following locations:
|
||||
|
||||
- Windows: `%APPDATA%\UnleashedRecomp\`
|
||||
- Linux: `~/.config/UnleashedRecomp/`
|
||||
|
||||
You will find the save data under the `save` folder (or `mlsave`, if using Hedge Mod Manager's save file redirection). The configuration file is named `config.toml`.
|
||||
|
||||
### I want to update the game. How can I avoid losing my save data? Do I need to reinstall the game?
|
||||
|
||||
Updating the game can be done by simply copying and replacing the files from a [release](https://github.com/hedge-dev/UnleashedRecomp/releases) on top of your existing installation. **Your save data and configuration will not be lost.** You won't need to reinstall the game, as the game files will always remain the same across versions of Unleashed Recompiled.
|
||||
|
||||
### How can I force the game to store the save data and configuration in the installation folder?
|
||||
|
||||
You can make the game ignore the [default configuration paths](#where-is-the-save-data-and-configuration-file-stored) and force it to save everything in the installation directory by creating an empty `portable.txt` file. You are directly responsible for the safekeeping of your save data and configuration if you choose this option.
|
||||
|
||||
### How can I install mods?
|
||||
|
||||
**Do not install mods by modifying the game data**. Use [Hedge Mod Manager](https://github.com/thesupersonic16/HedgeModManager) instead. You will not get support for modifying your game files directly.
|
||||
|
||||
> [!WARNING]
|
||||
> Unleashed Mod Manager is not recommended for use with Unleashed Recompiled, as it can make permanent changes to your game files.
|
||||
|
||||
### How can I force the game to run the installation again?
|
||||
|
||||
While it's unlikely you'll need to do this unless you've modified your game files by accident, you can force the installer to run again by using the launch argument: `--install`.
|
||||
|
||||
### How can I force the game to run under X11 or Wayland?
|
||||
|
||||
Use either of the following arguments to force SDL to run under the video driver you want:
|
||||
|
||||
- X11: `--sdl-video-driver x11`
|
||||
- Wayland: `--sdl-video-driver wayland`
|
||||
|
||||
The second argument will be passed directly to SDL as a hint to try to initialize the game with your preferred option.
|
||||
|
||||
### Where is the game data for the Flatpak version installed?
|
||||
|
||||
Given it is not possible to run the game where the Flatpak is stored, the game data will be installed to `~/.var/app/io.github.hedge_dev.unleashedrecomp/data`. The Flatpak build will only recognize this directory as valid. Feel free to reuse this data directory with a native Linux build if you wish to switch in the future.
|
||||
|
||||
If you wish to move this data to another location, you can do so by creating a symlink from this directory to the one where you'll migrate your installation to.
|
||||
|
||||
### How can I improve performance?
|
||||
|
||||
You can lower the values of some of the following graphics options to improve performance. Other options may help, but these usually have the biggest impact:
|
||||
|
||||
- Resolution Scale
|
||||
- Anti-Aliasing
|
||||
- Shadow Resolution
|
||||
|
||||
If you want a detailed performance report along with relevant system information, press F1 to view multiple performance graphs. This will aid in the process of gathering as much information as possible in order to identify the problem.
|
||||
|
||||
When using a system with multiple GPUs (such as a gaming laptop), please make sure that the game has chosen your dedicated graphics adapter and not your integrated one. The F1 menu will display which device has been selected by its name along with other options that might be available. If you're unable to get the game to select the correct device, you can attempt to override this by changing the `GraphicsDevice` property in `config.toml`. The name of the device must be an exact match.
|
||||
|
||||
Some of the game's more demanding sections require strong CPU single-thread performance. While the recompilation process adds minimal CPU overhead, modern hardware is typically bottlenecked by this factor before the GPU.
|
||||
|
||||
Linux has an unexpected advantage when it comes to CPU performance, showing improvements in CPU-bound scenarios. It's currently speculated that this could be due to the heavy amount of thread synchronization the game performs, an operation that is likely to be more performant on Linux's CPU scheduler than on Windows' scheduler. If you wish to gain some additional performance, playing on Linux instead of Windows could yield better results.
|
||||
|
||||
> [!WARNING]
|
||||
> Using external frame rate limiters or performance overlays may degrade performance or have negative consequences.
|
||||
|
||||
### Can I install the game with a PlayStation 3 copy?
|
||||
|
||||
**You cannot use the files from the PlayStation 3 version of the game.** Supporting these files would require an entirely new recompilation, as they have proprietary formatting that only works on PS3 and the code for these formats is only present in that version. All significant differences present in the PS3 version of the game have been included in this project as options.
|
||||
|
||||
### Can I install the game with a Japanese copy?
|
||||
|
||||
The Japanese version of Sonic Unleashed has some minor differences in both file structure and content that make this version of the game incompatible with the international release. Furthermore, the US and EU versions of the game already support Japanese. Supporting this version would only cause mod compatibility issues in the future, so it is unlikely to be added to the update roadmap as it would also require its own recompilation.
|
||||
|
||||
### Why is the game detecting my PlayStation controller as an Xbox controller?
|
||||
|
||||
If you're using a third-party input translation layer (such as DS4Windows or Steam Input), it is recommended that you disable these for full controller support.
|
||||
|
||||
### Will macOS be supported?
|
||||
|
||||
While macOS is not currently on the roadmap, this project welcomes any effort to add support for this platform. Unleashed Recompiled relies on [plume](https://github.com/renderbag/plume), a rendering hardware abstraction layer that will be getting support for Metal in the near future. You can join the macOS discussion on [this issue](https://github.com/hedge-dev/UnleashedRecomp/issues/455).
|
||||
|
||||
### What other platforms will be supported?
|
||||
|
||||
This project does not plan to support any more platforms other than Windows, Linux and potentially macOS at the moment. Any contributors who wish to support more platforms should do so through a fork.
|
||||
|
||||
### Do you have plans to recompile other Xbox 360 games or Sonic games?
|
||||
|
||||
The team behind Unleashed Recompiled does not currently have any plans to port more Xbox 360 games or Sonic games. Anyone is free to look into [XenonRecomp](https://github.com/hedge-dev/XenonRecomp) if they wish to investigate these opportunities.
|
||||
|
||||
## Building
|
||||
|
||||
[Check out the building instructions here](/docs/BUILDING.md).
|
||||
|
||||
## Credits
|
||||
|
||||
### Unleashed Recompiled
|
||||
- [Skyth](https://github.com/blueskythlikesclouds): Creator and Lead Developer of the recompilation, as well as the developer of technologies created for it such as [XenonRecomp](https://github.com/hedge-dev/XenonRecomp) and [XenosRecomp](https://github.com/hedge-dev/XenosRecomp). Other responsibilities include the creation of the graphics and audio backends for the project, alongside custom menus, dynamic UI aspect ratio and various patches and new features added to the game.
|
||||
|
||||
- [Sajid](https://github.com/Sajidur78): Co-creator and Developer of the recompilation, as well as the developer of [XenonAnalyse](https://github.com/hedge-dev/XenonRecomp/?tab=readme-ov-file#XenonAnalyse). Other responsibilities include the implementation of core components for the project, like the Xbox 360 kernel translation layer used to make the game function.
|
||||
|
||||
- [Hyper](https://github.com/hyperbx): Developer of system level features, such as achievement support and the custom menus, alongside various other patches and features to make the game feel right at home on modern systems. Aided in the creation of concept art and the final options menu thumbnails.
|
||||
|
||||
- [Darío](https://github.com/DarioSamo): Creator of the graphics hardware abstraction layer [plume](https://github.com/renderbag/plume), used by the project's graphics backend. Alongside providing consultation for graphics and aiding with shader research and development, other responsibilities include the installer wizard and Linux support. Provided Spanish localization for the custom menus.
|
||||
|
||||
- [ĐeäTh](https://github.com/DeaTh-G): Supervisor of game accurate design philosophy regarding the custom menus. Aided in the implementation of annotation support for Japanese localization, whilst providing minor support for all localization.
|
||||
|
||||
- [RadiantDerg](https://github.com/RadiantDerg): Lead Artist behind the thumbnails used in the options menu. Other responsibilities include the creation of several debugging related codes for Hedge Mod Manager and providing aid with the research of the game's internals.
|
||||
|
||||
- [PTKay](https://github.com/PTKay): Lead Concept Artist for the custom menus. Aided in the development of the installer wizard's visuals.
|
||||
|
||||
- [SuperSonic16](https://github.com/thesupersonic16): Lead Developer of [Hedge Mod Manager](https://github.com/thesupersonic16/HedgeModManager), providing compatibility for modding with the recompilation. Aided in the creation of the deployment system for Linux builds.
|
||||
|
||||
- [NextinHKRY](https://github.com/NextinMono): Aided in researching the game's internals and creating concept art for some options menu thumbnails used in the final release. Provided Italian localization for the custom menus.
|
||||
|
||||
- [LadyLunanova](https://linktr.ee/ladylunanova): Artist behind the achievement trophy sprite and the keyboard and mouse icons used in the installer wizard.
|
||||
|
||||
- [LJSTAR](https://github.com/LJSTARbird): Artist behind the project logo, along with several thumbnail designs used in the options menu and created new icons for the button guide for opening the achievements menu. Provided French localization for the custom menus.
|
||||
|
||||
- [saguinee](https://twitter.com/saguinee): Artist behind thumbnail designs used in the options menu such as Hints and Battle Theme.
|
||||
|
||||
- [Goalringmod27](https://linktr.ee/goalringmod27): Concept Artist behind the achievements overlay shown during gameplay. Aided in the creation of the Transparency Anti-Aliasing thumbnail.
|
||||
|
||||
- [M&M](https://github.com/ActualMandM): Provisional support for dynamic UI aspect ratio.
|
||||
|
||||
- [DaGuAr](https://twitter.com/TheDaguar): Provided Spanish localization for the custom menus alongside Darío.
|
||||
|
||||
- [brianuuuSonic](https://github.com/brianuuu): Provided Japanese localization for the custom menus.
|
||||
|
||||
- [Kitzuku](https://github.com/Kitzuku): Provided German localization for the custom menus.
|
||||
|
||||
### Special Thanks
|
||||
- [Mr-Wiseguy](https://github.com/Mr-Wiseguy): Creator of [N64: Recompiled](https://github.com/N64Recomp/N64Recomp), which was the inspiration behind the creation of this project. Provided information and assistance at the beginning of development.
|
||||
|
||||
- [xenia-project](https://github.com/xenia-project/xenia): Extraordinary amounts of research regarding the inner workings of the Xbox 360, which sped up the development of the recompilation.
|
||||
|
||||
- [Katlin Daigler](https://katlindaigler.carbonmade.com): Provided consultation for logo design.
|
||||
|
||||
- [ocornut](https://github.com/ocornut): Creator of [Dear ImGui](https://github.com/ocornut/imgui), which is used as the backbone of the custom menus.
|
||||
|
||||
- Raymond Chen: Useful resources on Windows application development with his blog ["The Old New Thing"](https://devblogs.microsoft.com/oldnewthing/).
|
||||
|
||||
@@ -158,16 +158,15 @@ set(UNLEASHED_RECOMP_UI_CXX_SOURCES
|
||||
"ui/installer_wizard.cpp"
|
||||
"ui/message_window.cpp"
|
||||
"ui/options_menu.cpp"
|
||||
"ui/options_menu_thumbnails.cpp"
|
||||
"ui/options_menu_thumbnails.cpp"
|
||||
"ui/tv_static.cpp"
|
||||
)
|
||||
|
||||
set(UNLEASHED_RECOMP_INSTALL_CXX_SOURCES
|
||||
"install/installer.cpp"
|
||||
"install/iso_file_system.cpp"
|
||||
"install/memory_mapped_file.cpp"
|
||||
"install/update_checker.cpp"
|
||||
"install/xcontent_file_system.cpp"
|
||||
"install/xex_patcher.cpp"
|
||||
"install/hashes/apotos_shamar.cpp"
|
||||
"install/hashes/chunnan.cpp"
|
||||
"install/hashes/empire_city_adabat.cpp"
|
||||
@@ -200,8 +199,6 @@ set(UNLEASHED_RECOMP_THIRDPARTY_SOURCES
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot.cpp"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_items.cpp"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
|
||||
"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source/smolv.cpp"
|
||||
)
|
||||
|
||||
@@ -211,11 +208,8 @@ set(UNLEASHED_RECOMP_THIRDPARTY_INCLUDES
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/json/include"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/magic_enum/include"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/stb"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/TinySHA1"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/unordered_dense/include"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/volk"
|
||||
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/Vulkan-Headers/include"
|
||||
@@ -358,7 +352,7 @@ if (WIN32)
|
||||
Synchronization
|
||||
winmm
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(UnleashedRecomp PRIVATE
|
||||
fmt::fmt
|
||||
@@ -471,7 +465,8 @@ generate_aggregate_header(
|
||||
|
||||
set(RESOURCES_SOURCE_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources")
|
||||
set(RESOURCES_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/res")
|
||||
|
||||
|
||||
## Miscellaneous ##
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/bc_diff/button_bc_diff.bin" DEST_FILE "${RESOURCES_OUTPUT_PATH}/bc_diff/button_bc_diff.bin" ARRAY_NAME "g_button_bc_diff" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/font/im_font_atlas.bin" DEST_FILE "${RESOURCES_OUTPUT_PATH}/font/im_font_atlas.bin" ARRAY_NAME "g_im_font_atlas" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/font/im_font_atlas.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/font/im_font_atlas.dds" ARRAY_NAME "g_im_font_atlas_texture" COMPRESSION_TYPE "zstd")
|
||||
@@ -482,6 +477,8 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/co
|
||||
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.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/light.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/common/light.dds" ARRAY_NAME "g_light" COMPRESSION_TYPE "zstd")
|
||||
|
||||
## Installer ##
|
||||
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_002.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_002.dds" ARRAY_NAME "g_install_002" COMPRESSION_TYPE "zstd")
|
||||
@@ -492,14 +489,23 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/in
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_007.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_007.dds" ARRAY_NAME "g_install_007" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/install_008.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/install_008.dds" ARRAY_NAME "g_install_008" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/installer/miles_electric_icon.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/miles_electric_icon.dds" ARRAY_NAME "g_miles_electric_icon" 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/installer/pulse_install.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/installer/pulse_install.dds" ARRAY_NAME "g_pulse_install" COMPRESSION_TYPE "zstd")
|
||||
|
||||
## Options Menu ##
|
||||
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/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/allow_background_input_ps.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/allow_background_input_ps.dds" ARRAY_NAME "g_allow_background_input_ps" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/allow_background_input_xb.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/allow_background_input_xb.dds" ARRAY_NAME "g_allow_background_input_xb" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing_none.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing_none.dds" ARRAY_NAME "g_antialiasing_none" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing_2x.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing_2x.dds" ARRAY_NAME "g_antialiasing_2x" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing_4x.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing_4x.dds" ARRAY_NAME "g_antialiasing_4x" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/antialiasing_8x.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/antialiasing_8x.dds" ARRAY_NAME "g_antialiasing_8x" 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/brightness.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/brightness.dds" ARRAY_NAME "g_brightness" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/control_tutorial.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/control_tutorial.dds" ARRAY_NAME "g_control_tutorial" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/brightness.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/brightness.dds" ARRAY_NAME "g_brightness" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/channel_stereo.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/channel_stereo.dds" ARRAY_NAME "g_channel_stereo" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/channel_surround.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/channel_surround.dds" ARRAY_NAME "g_channel_surround" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/control_tutorial_ps.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/control_tutorial_ps.dds" ARRAY_NAME "g_control_tutorial_ps" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/control_tutorial_xb.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/control_tutorial_xb.dds" ARRAY_NAME "g_control_tutorial_xb" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/controller_icons.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/controller_icons.dds" ARRAY_NAME "g_controller_icons" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/default.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/default.dds" ARRAY_NAME "g_default" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/effects_volume.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/effects_volume.dds" ARRAY_NAME "g_effects_volume" COMPRESSION_TYPE "zstd")
|
||||
@@ -515,36 +521,43 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/op
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/motion_blur_off.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/motion_blur_off.dds" ARRAY_NAME "g_motion_blur_off" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/motion_blur_original.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/motion_blur_original.dds" ARRAY_NAME "g_motion_blur_original" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/motion_blur_enhanced.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/motion_blur_enhanced.dds" ARRAY_NAME "g_motion_blur_enhanced" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/movie_scale_mode.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/movie_scale_mode.dds" ARRAY_NAME "g_movie_scale_mode" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/movie_scale_fit.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/movie_scale_fit.dds" ARRAY_NAME "g_movie_scale_fit" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/movie_scale_fill.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/movie_scale_fill.dds" ARRAY_NAME "g_movie_scale_fill" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/music_attenuation.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/music_attenuation.dds" ARRAY_NAME "g_music_attenuation" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/music_volume.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/music_volume.dds" ARRAY_NAME "g_music_volume" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/resolution_scale.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/resolution_scale.dds" ARRAY_NAME "g_resolution_scale" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_original.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_original.dds" ARRAY_NAME "g_shadow_resolution_original" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_x512.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_x512.dds" ARRAY_NAME "g_shadow_resolution_x512" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_x1024.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_x1024.dds" ARRAY_NAME "g_shadow_resolution_x1024" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_x2048.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_x2048.dds" ARRAY_NAME "g_shadow_resolution_x2048" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_x4096.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_x4096.dds" ARRAY_NAME "g_shadow_resolution_x4096" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/shadow_resolution_x8192.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/shadow_resolution_x8192.dds" ARRAY_NAME "g_shadow_resolution_x8192" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/subtitles.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/subtitles.dds" ARRAY_NAME "g_subtitles" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/time_of_day_transition_xbox.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_of_day_transition_xbox.dds" ARRAY_NAME "g_time_of_day_transition_xbox" 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/time_transition_ps.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_transition_ps.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_transition_xb.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_transition_xb.dds" ARRAY_NAME "g_time_of_day_transition_xbox" 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/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/ui_alignment_centre.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_alignment_centre.dds" ARRAY_NAME "g_ui_alignment_centre" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/ui_alignment_edge.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_alignment_edge.dds" ARRAY_NAME "g_ui_alignment_edge" 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/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/vibration_ps.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vibration_ps.dds" ARRAY_NAME "g_vibration_ps" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vibration_xb.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vibration_xb.dds" ARRAY_NAME "g_vibration_xb" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vsync_on.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vsync_on.dds" ARRAY_NAME "g_vsync_on" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vsync_off.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vsync_off.dds" ARRAY_NAME "g_vsync_off" 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.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/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/options_menu/options_static.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/options_static.dds" ARRAY_NAME "g_options_static" COMPRESSION_TYPE "zstd")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/options_static_flash.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/options_static_flash.dds" ARRAY_NAME "g_options_static_flash" COMPRESSION_TYPE "zstd")
|
||||
|
||||
## 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")
|
||||
|
||||
## Audio ##
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/music/installer.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/music/installer.ogg" ARRAY_NAME "g_installer_music")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_cursor.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_cursor.ogg" ARRAY_NAME "g_sys_worldmap_cursor")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_finaldecide.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_finaldecide.ogg" ARRAY_NAME "g_sys_worldmap_finaldecide")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausecansel.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausecansel.ogg" ARRAY_NAME "g_sys_actstg_pausecansel")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausecursor.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausecursor.ogg" ARRAY_NAME "g_sys_actstg_pausecursor")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausedecide.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausedecide.ogg" ARRAY_NAME "g_sys_actstg_pausedecide")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausewinclose.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausewinclose.ogg" ARRAY_NAME "g_sys_actstg_pausewinclose")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausewinopen.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausewinopen.ogg" ARRAY_NAME "g_sys_actstg_pausewinopen")
|
||||
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausewinopen.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausewinopen.ogg" ARRAY_NAME "g_sys_actstg_pausewinopen")
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace Hedgehog::Math
|
||||
{
|
||||
class CMatrix
|
||||
{
|
||||
public:
|
||||
be<float> m_M00;
|
||||
be<float> m_M01;
|
||||
be<float> m_M02;
|
||||
be<float> m_M03;
|
||||
be<float> m_M10;
|
||||
be<float> m_M11;
|
||||
be<float> m_M12;
|
||||
be<float> m_M13;
|
||||
be<float> m_M20;
|
||||
be<float> m_M21;
|
||||
be<float> m_M22;
|
||||
be<float> m_M23;
|
||||
be<float> m_M30;
|
||||
be<float> m_M31;
|
||||
be<float> m_M32;
|
||||
be<float> m_M33;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace Hedgehog::Math
|
||||
{
|
||||
class CQuaternion
|
||||
{
|
||||
public:
|
||||
be<float> X;
|
||||
be<float> Y;
|
||||
be<float> Z;
|
||||
be<float> W;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace Hedgehog::Mirage
|
||||
{
|
||||
class CMatrixNodeListener;
|
||||
|
||||
class CMatrixNode : public Base::CObject
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x60);
|
||||
};
|
||||
|
||||
SWA_ASSERT_SIZEOF(CMatrixNode, 0x60);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace Hedgehog::Mirage
|
||||
{
|
||||
class CTransform
|
||||
{
|
||||
public:
|
||||
Math::CQuaternion m_Rotation;
|
||||
Math::CVector m_Position;
|
||||
Math::CMatrix m_Matrix;
|
||||
};
|
||||
|
||||
SWA_ASSERT_OFFSETOF(CTransform, m_Rotation, 0x00);
|
||||
SWA_ASSERT_OFFSETOF(CTransform, m_Position, 0x10);
|
||||
SWA_ASSERT_OFFSETOF(CTransform, m_Matrix, 0x20);
|
||||
SWA_ASSERT_SIZEOF(CTransform, 0x60);
|
||||
}
|
||||
@@ -27,7 +27,11 @@
|
||||
#include "Hedgehog/Base/Type/hhSharedString.h"
|
||||
#include "Hedgehog/Base/hhObject.h"
|
||||
#include "Hedgehog/Database/System/hhDatabaseData.h"
|
||||
#include "Hedgehog/Math/Matrix.h"
|
||||
#include "Hedgehog/Math/Quaternion.h"
|
||||
#include "Hedgehog/Math/Vector.h"
|
||||
#include "Hedgehog/MirageCore/MatrixNode/hhMatrixNode.h"
|
||||
#include "Hedgehog/MirageCore/Misc/hhTransform.h"
|
||||
#include "Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h"
|
||||
#include "Hedgehog/MirageCore/RenderData/hhMaterialData.h"
|
||||
#include "Hedgehog/MirageCore/RenderData/hhMeshData.h"
|
||||
@@ -55,6 +59,7 @@
|
||||
#include "SWA/Achievement/AchievementID.h"
|
||||
#include "SWA/Achievement/AchievementManager.h"
|
||||
#include "SWA/Achievement/AchievementTest.h"
|
||||
#include "SWA/Boss/EggDragoon/Object/BossEggDragoonDrillMissile.h"
|
||||
#include "SWA/CSD/CsdDatabaseWrapper.h"
|
||||
#include "SWA/CSD/CsdProject.h"
|
||||
#include "SWA/CSD/CsdTexListMirage.h"
|
||||
@@ -82,9 +87,11 @@
|
||||
#include "SWA/Inspire/InspireTextureOverlay.h"
|
||||
#include "SWA/Inspire/InspireTextureOverlayInfo.h"
|
||||
#include "SWA/Menu/MenuWindowBase.h"
|
||||
#include "SWA/Message/MsgRequestHelp.h"
|
||||
#include "SWA/Movie/MovieDisplayer.h"
|
||||
#include "SWA/Movie/MovieManager.h"
|
||||
#include "SWA/Object/Common/DashPanel/ObjDashPanel.h"
|
||||
#include "SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h"
|
||||
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
||||
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
||||
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
||||
@@ -115,6 +122,7 @@
|
||||
#include "SWA/System/GameParameter.h"
|
||||
#include "SWA/System/GammaController.h"
|
||||
#include "SWA/System/InputState.h"
|
||||
#include "SWA/System/MatrixNodeTransform.h"
|
||||
#include "SWA/System/PadState.h"
|
||||
#include "SWA/System/World.h"
|
||||
#include "boost/smart_ptr/make_shared_object.h"
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
#include "SWA/System/MatrixNodeTransform.h"
|
||||
|
||||
namespace SWA::Boss::EggDragoon::DrillMissile
|
||||
{
|
||||
class CMissile
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0xC4);
|
||||
xpointer<CMatrixNodeTransform> m_pMatrixNodeTransform;
|
||||
SWA_INSERT_PADDING(0x68);
|
||||
be<float> m_Speed;
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,9 @@ namespace SWA
|
||||
// ms_DrawLightFieldSamplingPoint: サンプリング点をデバッグ表示
|
||||
static inline bool* ms_DrawLightFieldSamplingPoint;
|
||||
|
||||
// N/A
|
||||
static inline bool* ms_IsAutoSaveWarningShown;
|
||||
|
||||
// ms_IgnoreLightFieldData: データを無視する
|
||||
static inline bool* ms_IgnoreLightFieldData;
|
||||
|
||||
@@ -39,6 +42,9 @@ namespace SWA
|
||||
// ms_IsRenderHudPause: ポーズメニュー 描画
|
||||
static inline bool* ms_IsRenderHudPause;
|
||||
|
||||
// N/A
|
||||
static inline bool* ms_IsTitleStateMenu;
|
||||
|
||||
// IsTriggerRender
|
||||
static inline bool* ms_IsTriggerRender;
|
||||
|
||||
@@ -52,6 +58,7 @@ namespace SWA
|
||||
{
|
||||
ms_DrawLightFieldSamplingPoint = (bool*)MmGetHostAddress(0x83367BCE);
|
||||
ms_IgnoreLightFieldData = (bool*)MmGetHostAddress(0x83367BCF);
|
||||
ms_IsAutoSaveWarningShown = (bool*)MmGetHostAddress(0x83367BC1);
|
||||
ms_IsCollisionRender = (bool*)MmGetHostAddress(0x833678A6);
|
||||
ms_IsLoading = (bool*)MmGetHostAddress(0x83367A4C);
|
||||
ms_IsObjectCollisionRender = (bool*)MmGetHostAddress(0x83367905);
|
||||
@@ -61,6 +68,7 @@ namespace SWA
|
||||
ms_IsRenderGameMainHud = (bool*)MmGetHostAddress(0x8328BB27);
|
||||
ms_IsRenderHud = (bool*)MmGetHostAddress(0x8328BB26);
|
||||
ms_IsRenderHudPause = (bool*)MmGetHostAddress(0x8328BB28);
|
||||
ms_IsTitleStateMenu = (bool*)MmGetHostAddress(0x83367BC0);
|
||||
ms_IsTriggerRender = (bool*)MmGetHostAddress(0x83367904);
|
||||
ms_LightFieldDebug = (bool*)MmGetHostAddress(0x83367BCD);
|
||||
ms_VisualizeLoadedLevel = (bool*)MmGetHostAddress(0x833678C1);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace SWA::Message
|
||||
{
|
||||
class MsgRequestHelp
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x1C);
|
||||
Hedgehog::Base::CSharedString m_Name;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace SWA
|
||||
{
|
||||
class CObjRollingBarrel
|
||||
{
|
||||
public:
|
||||
class CElement
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0xEC);
|
||||
xpointer<void> m_FieldEC;
|
||||
SWA_INSERT_PADDING(0x20);
|
||||
be<float> m_Roll;
|
||||
};
|
||||
|
||||
SWA_INSERT_PADDING(0xE8);
|
||||
be<float> m_GenerationTime;
|
||||
SWA_INSERT_PADDING(0x09);
|
||||
bool m_FieldF5;
|
||||
SWA_INSERT_PADDING(0x0A);
|
||||
be<float> m_RandomRange;
|
||||
be<float> m_Field104;
|
||||
};
|
||||
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_FieldEC, 0xEC);
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_Roll, 0x110);
|
||||
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_GenerationTime, 0xE8);
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_FieldF5, 0xF5);
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_RandomRange, 0x100);
|
||||
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_Field104, 0x104);
|
||||
}
|
||||
@@ -71,7 +71,8 @@ namespace SWA
|
||||
boost::shared_ptr<Hedgehog::Mirage::CMatrixNode> m_spMatrixNodeRoot;
|
||||
SWA_INSERT_PADDING(0x14);
|
||||
CGammaController m_GammaController;
|
||||
SWA_INSERT_PADDING(0x1C);
|
||||
boost::shared_ptr<CLoading> m_spLoading;
|
||||
SWA_INSERT_PADDING(0x14);
|
||||
boost::shared_ptr<Achievement::CManager> m_spAchievementManager;
|
||||
boost::shared_ptr<CDatabaseTree> m_spDatabaseTree;
|
||||
Hedgehog::Base::CSharedString m_Field10C;
|
||||
@@ -104,6 +105,7 @@ namespace SWA
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field74, 0x74);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spMatrixNodeRoot, 0x84);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_GammaController, 0xA0);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spLoading, 0xE0);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spAchievementManager, 0xFC);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_spDatabaseTree, 0x104);
|
||||
SWA_ASSERT_OFFSETOF(CApplicationDocument::CMember, m_Field10C, 0x10C);
|
||||
|
||||
@@ -4,14 +4,5 @@
|
||||
|
||||
namespace SWA
|
||||
{
|
||||
class CTitleStateBase : public Hedgehog::Universe::CStateMachineBase::CStateBase
|
||||
{
|
||||
public:
|
||||
class CTitleStateContext
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x1E8);
|
||||
xpointer<CTitleMenu> m_pTitleMenu;
|
||||
};
|
||||
};
|
||||
class CTitleStateBase : public Hedgehog::Universe::CStateMachineBase::CStateBase {};
|
||||
}
|
||||
|
||||
@@ -4,5 +4,14 @@
|
||||
|
||||
namespace SWA
|
||||
{
|
||||
class CTitleStateMenu : public CTitleStateBase {};
|
||||
class CTitleStateMenu : public CTitleStateBase
|
||||
{
|
||||
public:
|
||||
class CTitleStateMenuContext
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x1E8);
|
||||
xpointer<CTitleMenu> m_pTitleMenu;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace SWA
|
||||
{
|
||||
class CMatrixNodeTransform : public Hedgehog::Mirage::CMatrixNode
|
||||
{
|
||||
public:
|
||||
Hedgehog::Mirage::CTransform m_Transform;
|
||||
Hedgehog::Math::CMatrix m_WorldMatrix;
|
||||
};
|
||||
|
||||
SWA_ASSERT_OFFSETOF(CMatrixNodeTransform, m_Transform, 0x60);
|
||||
SWA_ASSERT_OFFSETOF(CMatrixNodeTransform, m_WorldMatrix, 0xC0);
|
||||
SWA_ASSERT_SIZEOF(CMatrixNodeTransform, 0x100);
|
||||
}
|
||||
+19
-2
@@ -28,7 +28,7 @@ void App::Exit()
|
||||
std::_Exit(0);
|
||||
}
|
||||
|
||||
// SWA::CApplication
|
||||
// SWA::CApplication::CApplication
|
||||
PPC_FUNC_IMPL(__imp__sub_824EB490);
|
||||
PPC_FUNC(sub_824EB490)
|
||||
{
|
||||
@@ -60,6 +60,7 @@ PPC_FUNC(sub_822C1130)
|
||||
}
|
||||
|
||||
App::s_deltaTime = ctx.f1.f64;
|
||||
App::s_time += App::s_deltaTime;
|
||||
|
||||
// This function can also be called by the loading thread,
|
||||
// which SDL does not like. To prevent the OS from thinking
|
||||
@@ -69,12 +70,28 @@ PPC_FUNC(sub_822C1130)
|
||||
{
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||
GameWindow::Update();
|
||||
}
|
||||
|
||||
GameWindow::Update();
|
||||
AudioPatches::Update(App::s_deltaTime);
|
||||
InspirePatches::Update();
|
||||
|
||||
// Apply subtitles option.
|
||||
if (auto pApplicationDocument = SWA::CApplicationDocument::GetInstance())
|
||||
pApplicationDocument->m_InspireSubtitles = Config::Subtitles;
|
||||
|
||||
if (Config::EnableEventCollisionDebugView)
|
||||
*SWA::SGlobals::ms_IsTriggerRender = true;
|
||||
|
||||
if (Config::EnableGIMipLevelDebugView)
|
||||
*SWA::SGlobals::ms_VisualizeLoadedLevel = true;
|
||||
|
||||
if (Config::EnableObjectCollisionDebugView)
|
||||
*SWA::SGlobals::ms_IsObjectCollisionRender = true;
|
||||
|
||||
if (Config::EnableStageCollisionDebugView)
|
||||
*SWA::SGlobals::ms_IsCollisionRender = true;
|
||||
|
||||
__imp__sub_822C1130(ctx, base);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@ public:
|
||||
static inline bool s_isInit;
|
||||
static inline bool s_isMissingDLC;
|
||||
static inline bool s_isLoading;
|
||||
static inline bool s_isSaving;
|
||||
static inline bool s_isWerehog;
|
||||
static inline bool s_isSaveDataCorrupt;
|
||||
|
||||
static inline ELanguage s_language;
|
||||
|
||||
static inline double s_deltaTime;
|
||||
static inline double s_time = 0.0; // How much time elapsed since the game started.
|
||||
|
||||
static void Restart(std::vector<std::string> restartArgs = {});
|
||||
static void Exit();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <apu/audio.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <kernel/heap.h>
|
||||
#include <os/logger.h>
|
||||
#include <user/config.h>
|
||||
|
||||
static PPCFunc* g_clientCallback{};
|
||||
@@ -29,14 +30,28 @@ static void CreateAudioDevice()
|
||||
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, 0);
|
||||
}
|
||||
|
||||
if (!g_audioDevice)
|
||||
LOGFN_ERROR("Failed to open audio device: {}", SDL_GetError());
|
||||
|
||||
g_downMixToStereo = (obtained.channels == 2);
|
||||
}
|
||||
|
||||
void XAudioInitializeSystem()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Force wasapi on Windows.
|
||||
SDL_setenv("SDL_AUDIODRIVER", "wasapi", true);
|
||||
#endif
|
||||
|
||||
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "playback");
|
||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "Unleashed Recompiled");
|
||||
SDL_InitSubSystem(SDL_INIT_AUDIO);
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
||||
{
|
||||
LOGFN_ERROR("Failed to init audio subsystem: {}", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
CreateAudioDevice();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <apu/embedded_player.h>
|
||||
#include <user/config.h>
|
||||
|
||||
#include <res/music/installer.ogg.h>
|
||||
#include <res/sounds/sys_worldmap_cursor.ogg.h>
|
||||
#include <res/sounds/sys_worldmap_finaldecide.ogg.h>
|
||||
#include <res/sounds/sys_actstg_pausecansel.ogg.h>
|
||||
@@ -87,13 +88,17 @@ static void PlayEmbeddedSound(EmbeddedSound s)
|
||||
data.chunk = Mix_LoadWAV_RW(SDL_RWFromConstMem(soundData, soundDataSize), 1);
|
||||
}
|
||||
|
||||
Mix_VolumeChunk(data.chunk, Config::MasterVolume * Config::EffectsVolume * MIX_MAX_VOLUME);
|
||||
Mix_PlayChannel(g_channelIndex % MIX_CHANNELS, data.chunk, 0);
|
||||
++g_channelIndex;
|
||||
}
|
||||
|
||||
static Mix_Music* g_installerMusic;
|
||||
|
||||
void EmbeddedPlayer::Init()
|
||||
{
|
||||
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, 2, 256);
|
||||
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, 2, 4096);
|
||||
g_installerMusic = Mix_LoadMUS_RW(SDL_RWFromConstMem(g_installer_music, sizeof(g_installer_music)), 1);
|
||||
|
||||
s_isActive = true;
|
||||
}
|
||||
@@ -111,6 +116,21 @@ void EmbeddedPlayer::Play(const char *name)
|
||||
PlayEmbeddedSound(it->second);
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::PlayMusic()
|
||||
{
|
||||
if (!Mix_PlayingMusic())
|
||||
{
|
||||
Mix_PlayMusic(g_installerMusic, INT_MAX);
|
||||
Mix_VolumeMusic(Config::MasterVolume * Config::MusicVolume * MUSIC_VOLUME * MIX_MAX_VOLUME);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::FadeOutMusic()
|
||||
{
|
||||
if (Mix_PlayingMusic())
|
||||
Mix_FadeOutMusic(1000);
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::Shutdown()
|
||||
{
|
||||
for (EmbeddedSoundData &data : g_embeddedSoundData)
|
||||
@@ -119,6 +139,9 @@ void EmbeddedPlayer::Shutdown()
|
||||
Mix_FreeChunk(data.chunk);
|
||||
}
|
||||
|
||||
Mix_HaltMusic();
|
||||
Mix_FreeMusic(g_installerMusic);
|
||||
|
||||
Mix_CloseAudio();
|
||||
Mix_Quit();
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
|
||||
struct EmbeddedPlayer
|
||||
{
|
||||
inline static bool s_isActive = false;
|
||||
// Arbitrarily picked volume to match the mixing in the original game.
|
||||
static constexpr float MUSIC_VOLUME = 0.25f;
|
||||
|
||||
static inline bool s_isActive = false;
|
||||
|
||||
static void Init();
|
||||
static void Play(const char *name);
|
||||
static void PlayMusic();
|
||||
static void FadeOutMusic();
|
||||
static void Shutdown();
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <kernel/heap.h>
|
||||
#include <kernel/memory.h>
|
||||
#include <ui/game_window.h>
|
||||
#include <patches/inspire_patches.h>
|
||||
|
||||
void Game_PlaySound(const char* pName)
|
||||
{
|
||||
@@ -14,8 +15,11 @@ void Game_PlaySound(const char* pName)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use EVENT category in cutscenes since SYSTEM gets muted by the game.
|
||||
uint32_t category = !InspirePatches::s_sceneName.empty() ? 10 : 7;
|
||||
|
||||
guest_stack_var<boost::anonymous_shared_ptr> soundPlayer;
|
||||
GuestToHostFunction<void>(sub_82B4DF50, soundPlayer.get(), ((be<uint32_t>*)g_memory.Translate(0x83367900))->get(), 7, 0, 0);
|
||||
GuestToHostFunction<void>(sub_82B4DF50, soundPlayer.get(), ((be<uint32_t>*)g_memory.Translate(0x83367900))->get(), category, 0, 0);
|
||||
|
||||
auto soundPlayerVtable = (be<uint32_t>*)g_memory.Translate(*(be<uint32_t>*)soundPlayer->get());
|
||||
uint32_t virtualFunction = *(soundPlayerVtable + 1);
|
||||
@@ -27,13 +31,3 @@ void Game_PlaySound(const char* pName)
|
||||
g_userHeap.Free(strAllocation);
|
||||
}
|
||||
}
|
||||
|
||||
void Window_SetDisplay(int displayIndex)
|
||||
{
|
||||
GameWindow::SetDisplay(displayIndex);
|
||||
}
|
||||
|
||||
void Window_SetFullscreen(bool isEnabled)
|
||||
{
|
||||
GameWindow::SetFullscreen(isEnabled);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void Game_PlaySound(const char* pName);
|
||||
void Window_SetDisplay(int displayIndex);
|
||||
void Window_SetFullscreen(bool isEnabled);
|
||||
|
||||
@@ -15,10 +15,13 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x36DB3B40FA419EF6),reinterpret_cast<GuestShader*>(0x4FDE8FFB7DC1D1CE),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0x36DB3B40FA419EF6),reinterpret_cast<GuestShader*>(0xD56D0D7219E51F1D),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x115813F8DBF6CCFF),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x3073F2C856F3333E),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x3382CD5552FAB33C),reinterpret_cast<GuestVertexDeclaration*>(0xB7BBCC93738C9DE4),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x47CDF40D1C605E0D),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x14 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x6563290A54293E7A),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x6563290A54293E7A),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x6563290A54293E7A),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x6563290A54293E7A),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x7A8F23548FF778),reinterpret_cast<GuestVertexDeclaration*>(0xC64D046063DE2F63),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x85E3EE1021089A76),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0x933E17818464BC39),reinterpret_cast<GuestVertexDeclaration*>(0xB7BBCC93738C9DE4),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
@@ -27,6 +30,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0xB8F71746F39A1166),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0xF9F82EC882CD3D08),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x3A4537B51DE9818),reinterpret_cast<GuestShader*>(0xF9F82EC882CD3D08),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x40E4064FE517DFD2),reinterpret_cast<GuestShader*>(0x11958CFF684E1F4B),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::LESS,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x4620B236DC38100C),reinterpret_cast<GuestShader*>(0xBBDB735BEACC8F41),reinterpret_cast<GuestVertexDeclaration*>(0x28FD2057B9BD5D1B),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0x4620B236DC38100C),reinterpret_cast<GuestShader*>(0xBBDB735BEACC8F41),reinterpret_cast<GuestVertexDeclaration*>(0x2A6D72391BFFFA3C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x4620B236DC38100C),reinterpret_cast<GuestShader*>(0xBBDB735BEACC8F41),reinterpret_cast<GuestVertexDeclaration*>(0x2A6D72391BFFFA3C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::ONE,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
@@ -53,11 +57,13 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x624F608ACB374E12),reinterpret_cast<GuestShader*>(0xA624AF834723B59),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x624F608ACB374E12),reinterpret_cast<GuestShader*>(0xA624AF834723B59),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x624F608ACB374E12),reinterpret_cast<GuestShader*>(0xA624AF834723B59),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x2CA0127E60EB4507),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x2E5AA3C0A9E32751),reinterpret_cast<GuestVertexDeclaration*>(0xB7BBCC93738C9DE4),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x326BB3169FF92317),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x3838E2D27966B21C),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x5A75A52C3F722625),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x86CD1B8641C60EE6),reinterpret_cast<GuestVertexDeclaration*>(0xC64D046063DE2F63),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0x874793F8CC9C7EB0),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xB0F7121362A63137),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xB0F7121362A63137),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xB23ACF01C99C2988),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
@@ -65,6 +71,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xC03A891201D4E9E7),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xCE7A73C836F03E6),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xD4D1534DD857403),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xD4D1534DD857403),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xD4D1534DD857403),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xE1748A1E1E38FC5F),reinterpret_cast<GuestVertexDeclaration*>(0x6538EB0019C3A29A),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0x666E7FB7FCAE0FB7),reinterpret_cast<GuestShader*>(0xE1748A1E1E38FC5F),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
@@ -94,6 +101,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x6DE86503F8AA38E2),reinterpret_cast<GuestShader*>(0x9FA5AACB5B14A226),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x6DE86503F8AA38E2),reinterpret_cast<GuestShader*>(0xC47F2F91BA2A5D86),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x6DE86503F8AA38E2),reinterpret_cast<GuestShader*>(0xFB79F59782376846),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x6DE86503F8AA38E2),reinterpret_cast<GuestShader*>(0xFF42BE2DBCE820C9),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R8G8B8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x720D6E5EDA78433B),reinterpret_cast<GuestShader*>(0x96EACBACDE1AAFAA),reinterpret_cast<GuestVertexDeclaration*>(0xA81F28FA43A9B511),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::ONE,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0x720D6E5EDA78433B),reinterpret_cast<GuestShader*>(0x96EACBACDE1AAFAA),reinterpret_cast<GuestVertexDeclaration*>(0xA81F28FA43A9B511),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::ONE,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x14 },
|
||||
{ reinterpret_cast<GuestShader*>(0x734799D14CC5177E),reinterpret_cast<GuestShader*>(0xC9978EB328E1066E),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
@@ -104,6 +112,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0x86FE3502D5EC24AA),reinterpret_cast<GuestShader*>(0x68FCC0B90EBC457B),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::LESS,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::B8G8R8A8_UNORM,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x86FE3502D5EC24AA),reinterpret_cast<GuestShader*>(0x94A71CC9B94E3101),reinterpret_cast<GuestVertexDeclaration*>(0xD452411D3FB80A0D),false,false,false,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16_FLOAT,RenderFormat::UNKNOWN,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x88F67387B88F932F),reinterpret_cast<GuestShader*>(0x49101E452DF2FE98),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0x8E4BB23465BD909E),reinterpret_cast<GuestShader*>(0x0),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::FRONT,RenderComparisonFunction::LESS_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0x0,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::UNKNOWN,RenderFormat::D32_FLOAT,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x8E4BB23465BD909E),reinterpret_cast<GuestShader*>(0x0),reinterpret_cast<GuestVertexDeclaration*>(0xFFFDDC62D86892F1),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS_EQUAL,false,RenderBlendOperation::ADD,1,33554,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0x0,RenderPrimitiveTopology::TRIANGLE_LIST,{ 32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::UNKNOWN,RenderFormat::D32_FLOAT,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x8E4BB23465BD909E),reinterpret_cast<GuestShader*>(0x0),reinterpret_cast<GuestVertexDeclaration*>(0xFFFDDC62D86892F1),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::LESS_EQUAL,false,RenderBlendOperation::ADD,1,33554,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0x0,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::UNKNOWN,RenderFormat::D32_FLOAT,1,false,0x0 },
|
||||
{ reinterpret_cast<GuestShader*>(0x8EA8F71BA3BE59E7),reinterpret_cast<GuestShader*>(0xA557DD8B24CD2B25),reinterpret_cast<GuestVertexDeclaration*>(0xEC0CD05EE1B1636),false,false,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::LESS,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_LIST,{ 28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::UNKNOWN,1,false,0x10 },
|
||||
@@ -145,6 +154,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0xA4CF0215A03D9571),reinterpret_cast<GuestShader*>(0xA3A659F1590CC180),reinterpret_cast<GuestVertexDeclaration*>(0x5A2395E29F93DA3C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_FAN,{ 32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0xA59B07C00039C660),reinterpret_cast<GuestShader*>(0x2E69CC2B4937A698),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xA59B07C00039C660),reinterpret_cast<GuestShader*>(0xF6FAD0CDA667264),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xA790E2F622DADAD8),reinterpret_cast<GuestShader*>(0xD56D0D7219E51F1D),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0xA7C9D01F7AD3B9D0),reinterpret_cast<GuestShader*>(0x481905CF40E1678D),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x14 },
|
||||
{ reinterpret_cast<GuestShader*>(0xA7C9D01F7AD3B9D0),reinterpret_cast<GuestShader*>(0x481905CF40E1678D),reinterpret_cast<GuestVertexDeclaration*>(0xC64D046063DE2F63),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xAC38B793E9C54AC5),reinterpret_cast<GuestShader*>(0x24CAF5A2F1B2AF40),reinterpret_cast<GuestVertexDeclaration*>(0x3CB3EF6B1C43B8C),true,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
@@ -163,6 +173,8 @@
|
||||
{ reinterpret_cast<GuestShader*>(0xBE3AD1D0FE788D2),reinterpret_cast<GuestShader*>(0x4CB3784D7108745F),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xBE3AD1D0FE788D2),reinterpret_cast<GuestShader*>(0xD57D71ED84D8F864),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xCF28F33974EC44F6),reinterpret_cast<GuestShader*>(0xD5EA32DB758EF0B8),reinterpret_cast<GuestVertexDeclaration*>(0x7F12180DC3A24B53),true,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 32,24,4,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x14 },
|
||||
{ reinterpret_cast<GuestShader*>(0xD738D79626374EBE),reinterpret_cast<GuestShader*>(0x47CDF40D1C605E0D),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0xD738D79626374EBE),reinterpret_cast<GuestShader*>(0x47CDF40D1C605E0D),reinterpret_cast<GuestVertexDeclaration*>(0xB7BBCC93738C9DE4),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0x0,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::UNKNOWN,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xD738D79626374EBE),reinterpret_cast<GuestShader*>(0x47CDF40D1C605E0D),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xD738D79626374EBE),reinterpret_cast<GuestShader*>(0x47CDF40D1C605E0D),reinterpret_cast<GuestVertexDeclaration*>(0xFB4544424558E4C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0xD738D79626374EBE),reinterpret_cast<GuestShader*>(0x96B8F9FDAAB9B658),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x14 },
|
||||
@@ -196,6 +208,7 @@
|
||||
{ reinterpret_cast<GuestShader*>(0xECC9C0BD668FE449),reinterpret_cast<GuestShader*>(0x4C4032F88196B450),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xECC9C0BD668FE449),reinterpret_cast<GuestShader*>(0xC7E2C782C058A625),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xECC9C0BD668FE449),reinterpret_cast<GuestShader*>(0xFB66DF5D27D3891D),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xF060DE53CF3B9BB8),reinterpret_cast<GuestShader*>(0xEAADA73091BF526C),reinterpret_cast<GuestVertexDeclaration*>(0xDEB308DCDDF979C7),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::NONE,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x15 },
|
||||
{ reinterpret_cast<GuestShader*>(0xF066433D33B62D54),reinterpret_cast<GuestShader*>(0xE5256B7D753C9D5F),reinterpret_cast<GuestVertexDeclaration*>(0x3CB3EF6B1C43B8C),true,true,false,RenderBlend::SRC_ALPHA,RenderBlend::INV_SRC_ALPHA,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,true,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
{ reinterpret_cast<GuestShader*>(0xF1D7C544D61D055C),reinterpret_cast<GuestShader*>(0x5A75A52C3F722625),reinterpret_cast<GuestVertexDeclaration*>(0xF10787EFFEEC0153),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x11 },
|
||||
{ reinterpret_cast<GuestShader*>(0xF58C10092C9EF1AF),reinterpret_cast<GuestShader*>(0x1DD6832FA7E79530),reinterpret_cast<GuestVertexDeclaration*>(0x84BACD816D86543C),false,true,true,RenderBlend::ONE,RenderBlend::ZERO,RenderCullMode::BACK,RenderComparisonFunction::GREATER_EQUAL,false,RenderBlendOperation::ADD,0,0,RenderBlend::ONE,RenderBlend::ZERO,RenderBlendOperation::ADD,0xF,RenderPrimitiveTopology::TRIANGLE_STRIP,{ 104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },RenderFormat::R16G16B16A16_FLOAT,RenderFormat::D32_FLOAT,1,false,0x10 },
|
||||
|
||||
@@ -11,7 +11,7 @@ ImGuiCallbackData* AddImGuiCallback(ImGuiCallback callback)
|
||||
auto& callbackData = g_callbackData[g_callbackDataIndex];
|
||||
++g_callbackDataIndex;
|
||||
|
||||
ImGui::GetForegroundDrawList()->AddCallback(reinterpret_cast<ImDrawCallback>(callback), callbackData.get());
|
||||
ImGui::GetBackgroundDrawList()->AddCallback(reinterpret_cast<ImDrawCallback>(callback), callbackData.get());
|
||||
|
||||
return callbackData.get();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define IMGUI_SHADER_MODIFIER_TITLE_BEVEL 8
|
||||
#define IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL 9
|
||||
#define IMGUI_SHADER_MODIFIER_RECTANGLE_BEVEL 10
|
||||
#define IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT 11
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
||||
@@ -220,6 +220,8 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
||||
|
||||
for (size_t i = 0; i < atlas->ConfigData.size(); i++)
|
||||
{
|
||||
double spaceAdvance = 0.0;
|
||||
|
||||
auto& config = atlas->ConfigData[i];
|
||||
bool increaseSpacing = strstr(config.Name, "Seurat") != nullptr;
|
||||
|
||||
@@ -232,8 +234,15 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
||||
glyph.getQuadAtlasBounds(u0, v0, u1, v1);
|
||||
|
||||
double advance = glyph.getAdvance();
|
||||
if (increaseSpacing && glyph.getCodepoint() == ' ')
|
||||
advance *= 1.5;
|
||||
if (glyph.getCodepoint() == ' ')
|
||||
{
|
||||
if (increaseSpacing)
|
||||
{
|
||||
advance *= 1.5;
|
||||
}
|
||||
|
||||
spaceAdvance = advance;
|
||||
}
|
||||
|
||||
config.DstFont->AddGlyph(
|
||||
&config,
|
||||
@@ -248,6 +257,39 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
|
||||
v0 / packer.height,
|
||||
advance);
|
||||
}
|
||||
|
||||
// Used as a zero-width helper for automatic line breaks.
|
||||
// This is useful for languages like Japanese to separate 'words'
|
||||
// so that they don't get split mid-kana by the automatic splitter.
|
||||
config.DstFont->AddGlyph(
|
||||
&config,
|
||||
0x200B,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f);
|
||||
|
||||
// A duplicate of the normal width space character.
|
||||
// Overrides the unicode Four-Per-Em Space character.
|
||||
// This can be used to add visual spacers that are ignored
|
||||
// by the automatic line splitting logic.
|
||||
config.DstFont->AddGlyph(
|
||||
&config,
|
||||
0x2005,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
0.0f,
|
||||
spaceAdvance);
|
||||
|
||||
config.DstFont->BuildLookupTable();
|
||||
}
|
||||
|
||||
@@ -1437,6 +1437,52 @@ namespace plume {
|
||||
return height;
|
||||
}
|
||||
|
||||
// D3D12QueryPool
|
||||
|
||||
D3D12QueryPool::D3D12QueryPool(D3D12Device *device, uint32_t queryCount) {
|
||||
assert(device != nullptr);
|
||||
assert(queryCount > 0);
|
||||
|
||||
this->device = device;
|
||||
|
||||
D3D12_QUERY_HEAP_DESC queryHeapDesc = {};
|
||||
queryHeapDesc.Type = D3D12_QUERY_HEAP_TYPE_TIMESTAMP;
|
||||
queryHeapDesc.Count = queryCount;
|
||||
|
||||
HRESULT res = device->d3d->CreateQueryHeap(&queryHeapDesc, IID_PPV_ARGS(&d3d));
|
||||
if (FAILED(res)) {
|
||||
fprintf(stderr, "CreateQueryHeap failed with error code 0x%lX.\n", res);
|
||||
return;
|
||||
}
|
||||
|
||||
readbackBuffer = device->createBuffer(RenderBufferDesc::ReadbackBuffer(sizeof(uint64_t) * queryCount));
|
||||
results.resize(queryCount);
|
||||
}
|
||||
|
||||
D3D12QueryPool::~D3D12QueryPool() {
|
||||
if (d3d != nullptr) {
|
||||
d3d->Release();
|
||||
}
|
||||
}
|
||||
|
||||
void D3D12QueryPool::queryResults() {
|
||||
void *readbackData = readbackBuffer->map();
|
||||
memcpy(results.data(), readbackData, sizeof(uint64_t) * results.size());
|
||||
readbackBuffer->unmap();
|
||||
|
||||
for (uint64_t &result : results) {
|
||||
result = result / double(device->timestampFrequency) * 1000000000.0;
|
||||
}
|
||||
}
|
||||
|
||||
const uint64_t *D3D12QueryPool::getResults() const {
|
||||
return results.data();
|
||||
}
|
||||
|
||||
uint32_t D3D12QueryPool::getCount() const {
|
||||
return uint32_t(results.size());
|
||||
}
|
||||
|
||||
// D3D12CommandList
|
||||
|
||||
D3D12CommandList::D3D12CommandList(D3D12Device *device, RenderCommandListType type) {
|
||||
@@ -2004,6 +2050,19 @@ namespace plume {
|
||||
d3d->DiscardResource(interfaceTexture->d3d, nullptr);
|
||||
}
|
||||
|
||||
void D3D12CommandList::resetQueryPool(const RenderQueryPool *queryPool, uint32_t queryFirstIndex, uint32_t queryCount) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
void D3D12CommandList::writeTimestamp(const RenderQueryPool *queryPool, uint32_t queryIndex) {
|
||||
assert(queryPool != nullptr);
|
||||
|
||||
const D3D12QueryPool *interfaceQueryPool = static_cast<const D3D12QueryPool *>(queryPool);
|
||||
const D3D12Buffer *readbackBuffer = static_cast<const D3D12Buffer *>(interfaceQueryPool->readbackBuffer.get());
|
||||
d3d->EndQuery(interfaceQueryPool->d3d, D3D12_QUERY_TYPE_TIMESTAMP, queryIndex);
|
||||
d3d->ResolveQueryData(interfaceQueryPool->d3d, D3D12_QUERY_TYPE_TIMESTAMP, queryIndex, 1, readbackBuffer->d3d, queryIndex * sizeof(uint64_t));
|
||||
}
|
||||
|
||||
void D3D12CommandList::checkDescriptorHeaps() {
|
||||
if (!descriptorHeapsSet) {
|
||||
ID3D12DescriptorHeap *descriptorHeaps[] = { device->viewHeapAllocator->heap, device->samplerHeapAllocator->heap };
|
||||
@@ -3259,7 +3318,7 @@ namespace plume {
|
||||
|
||||
// D3D12Device
|
||||
|
||||
D3D12Device::D3D12Device(D3D12Interface *renderInterface) {
|
||||
D3D12Device::D3D12Device(D3D12Interface *renderInterface, const std::string &preferredDeviceName) {
|
||||
assert(renderInterface != nullptr);
|
||||
|
||||
this->renderInterface = renderInterface;
|
||||
@@ -3349,9 +3408,10 @@ namespace plume {
|
||||
}
|
||||
|
||||
// Pick this adapter and device if it has better feature support than the current one.
|
||||
std::string deviceName = Utf16ToUtf8(adapterDesc.Description);
|
||||
bool preferOverNothing = (adapter == nullptr) || (d3d == nullptr);
|
||||
bool preferVideoMemory = adapterDesc.DedicatedVideoMemory > description.dedicatedVideoMemory;
|
||||
bool preferUserChoice = false;//wcsstr(adapterDesc.Description, L"AMD") != nullptr;
|
||||
bool preferUserChoice = preferredDeviceName == deviceName;
|
||||
bool preferOption = preferOverNothing || preferVideoMemory || preferUserChoice;
|
||||
if (preferOption) {
|
||||
if (d3d != nullptr) {
|
||||
@@ -3371,8 +3431,15 @@ namespace plume {
|
||||
capabilities.triangleFan = triangleFanSupportOption;
|
||||
capabilities.dynamicDepthBias = dynamicDepthBiasOption;
|
||||
capabilities.uma = uma;
|
||||
description.name = Utf16ToUtf8(adapterDesc.Description);
|
||||
description.name = deviceName;
|
||||
description.dedicatedVideoMemory = adapterDesc.DedicatedVideoMemory;
|
||||
description.vendor = RenderDeviceVendor(adapterDesc.VendorId);
|
||||
|
||||
LARGE_INTEGER adapterVersion = {};
|
||||
res = adapter->CheckInterfaceSupport(__uuidof(IDXGIDevice), &adapterVersion);
|
||||
if (SUCCEEDED(res)) {
|
||||
description.driverVersion = adapterVersion.QuadPart;
|
||||
}
|
||||
|
||||
if (preferUserChoice) {
|
||||
break;
|
||||
@@ -3460,6 +3527,13 @@ namespace plume {
|
||||
samplerHeapAllocator = std::make_unique<D3D12DescriptorHeapAllocator>(this, SamplerDescriptorHeapSize, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER);
|
||||
colorTargetHeapAllocator = std::make_unique<D3D12DescriptorHeapAllocator>(this, TargetDescriptorHeapSize, D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
||||
depthTargetHeapAllocator = std::make_unique<D3D12DescriptorHeapAllocator>(this, TargetDescriptorHeapSize, D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
|
||||
|
||||
// Create a command queue only for retrieving the timestamp frequency. Delete it immediately afterwards.
|
||||
std::unique_ptr<D3D12CommandQueue> timestampCommandQueue = std::make_unique<D3D12CommandQueue>(this, RenderCommandListType::DIRECT);
|
||||
res = timestampCommandQueue->d3d->GetTimestampFrequency(×tampFrequency);
|
||||
if (FAILED(res)) {
|
||||
fprintf(stderr, "GetTimestampFrequency failed with error code 0x%lX. Timestamps will be inaccurate.\n", res);
|
||||
}
|
||||
}
|
||||
|
||||
D3D12Device::~D3D12Device() {
|
||||
@@ -3534,6 +3608,10 @@ namespace plume {
|
||||
return std::make_unique<D3D12Framebuffer>(this, desc);
|
||||
}
|
||||
|
||||
std::unique_ptr<RenderQueryPool> D3D12Device::createQueryPool(uint32_t queryCount) {
|
||||
return std::make_unique<D3D12QueryPool>(this, queryCount);
|
||||
}
|
||||
|
||||
void D3D12Device::setBottomLevelASBuildInfo(RenderBottomLevelASBuildInfo &buildInfo, const RenderBottomLevelASMesh *meshes, uint32_t meshCount, bool preferFastBuild, bool preferFastTrace) {
|
||||
assert(meshes != nullptr);
|
||||
assert(meshCount > 0);
|
||||
@@ -3767,6 +3845,21 @@ namespace plume {
|
||||
|
||||
// Fill capabilities.
|
||||
capabilities.shaderFormat = RenderShaderFormat::DXIL;
|
||||
|
||||
// Fill device names.
|
||||
UINT adapterIndex = 0;
|
||||
IDXGIAdapter1 *adapterOption = nullptr;
|
||||
while (dxgiFactory->EnumAdapters1(adapterIndex++, &adapterOption) != DXGI_ERROR_NOT_FOUND) {
|
||||
DXGI_ADAPTER_DESC1 adapterDesc;
|
||||
adapterOption->GetDesc1(&adapterDesc);
|
||||
|
||||
// Ignore remote or software adapters.
|
||||
if ((adapterDesc.Flags & (DXGI_ADAPTER_FLAG_REMOTE | DXGI_ADAPTER_FLAG_SOFTWARE)) == 0) {
|
||||
deviceNames.emplace_back(Utf16ToUtf8(adapterDesc.Description));
|
||||
}
|
||||
|
||||
adapterOption->Release();
|
||||
}
|
||||
}
|
||||
|
||||
D3D12Interface::~D3D12Interface() {
|
||||
@@ -3775,8 +3868,8 @@ namespace plume {
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<RenderDevice> D3D12Interface::createDevice() {
|
||||
std::unique_ptr<D3D12Device> createdDevice = std::make_unique<D3D12Device>(this);
|
||||
std::unique_ptr<RenderDevice> D3D12Interface::createDevice(const std::string &preferredDeviceName) {
|
||||
std::unique_ptr<D3D12Device> createdDevice = std::make_unique<D3D12Device>(this, preferredDeviceName);
|
||||
return createdDevice->isValid() ? std::move(createdDevice) : nullptr;
|
||||
}
|
||||
|
||||
@@ -3784,6 +3877,10 @@ namespace plume {
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
const std::vector<std::string> &D3D12Interface::getDeviceNames() const {
|
||||
return deviceNames;
|
||||
}
|
||||
|
||||
bool D3D12Interface::isValid() const {
|
||||
return dxgiFactory != nullptr;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,19 @@ namespace plume {
|
||||
uint32_t getHeight() const override;
|
||||
};
|
||||
|
||||
struct D3D12QueryPool : RenderQueryPool {
|
||||
D3D12Device *device = nullptr;
|
||||
ID3D12QueryHeap *d3d = nullptr;
|
||||
std::vector<uint64_t> results;
|
||||
std::unique_ptr<RenderBuffer> readbackBuffer;
|
||||
|
||||
D3D12QueryPool(D3D12Device *device, uint32_t queryCount);
|
||||
virtual ~D3D12QueryPool() override;
|
||||
virtual void queryResults() override;
|
||||
virtual const uint64_t *getResults() const override;
|
||||
virtual uint32_t getCount() const override;
|
||||
};
|
||||
|
||||
struct D3D12CommandList : RenderCommandList {
|
||||
ID3D12GraphicsCommandList9 *d3d = nullptr;
|
||||
ID3D12CommandAllocator *commandAllocator = nullptr;
|
||||
@@ -196,6 +209,8 @@ namespace plume {
|
||||
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 discardTexture(const RenderTexture* texture) override;
|
||||
void resetQueryPool(const RenderQueryPool *queryPool, uint32_t queryFirstIndex, uint32_t queryCount) override;
|
||||
void writeTimestamp(const RenderQueryPool *queryPool, uint32_t queryIndex) override;
|
||||
void checkDescriptorHeaps();
|
||||
void notifyDescriptorHeapWasChangedExternally();
|
||||
void checkTopology();
|
||||
@@ -417,8 +432,9 @@ namespace plume {
|
||||
std::unique_ptr<D3D12DescriptorHeapAllocator> depthTargetHeapAllocator;
|
||||
RenderDeviceCapabilities capabilities;
|
||||
RenderDeviceDescription description;
|
||||
uint64_t timestampFrequency = 1;
|
||||
|
||||
D3D12Device(D3D12Interface *renderInterface);
|
||||
D3D12Device(D3D12Interface *renderInterface, const std::string &preferredDeviceName);
|
||||
~D3D12Device() override;
|
||||
std::unique_ptr<RenderCommandList> createCommandList(RenderCommandListType type) override;
|
||||
std::unique_ptr<RenderDescriptorSet> createDescriptorSet(const RenderDescriptorSetDesc &desc) override;
|
||||
@@ -436,6 +452,7 @@ namespace plume {
|
||||
std::unique_ptr<RenderCommandFence> createCommandFence() override;
|
||||
std::unique_ptr<RenderCommandSemaphore> createCommandSemaphore() override;
|
||||
std::unique_ptr<RenderFramebuffer> createFramebuffer(const RenderFramebufferDesc &desc) override;
|
||||
std::unique_ptr<RenderQueryPool> createQueryPool(uint32_t queryCount) override;
|
||||
void setBottomLevelASBuildInfo(RenderBottomLevelASBuildInfo &buildInfo, const RenderBottomLevelASMesh *meshes, uint32_t meshCount, bool preferFastBuild, bool preferFastTrace) override;
|
||||
void setTopLevelASBuildInfo(RenderTopLevelASBuildInfo &buildInfo, const RenderTopLevelASInstance *instances, uint32_t instanceCount, bool preferFastBuild, bool preferFastTrace) override;
|
||||
void setShaderBindingTableInfo(RenderShaderBindingTableInfo &tableInfo, const RenderShaderBindingGroups &groups, const RenderPipeline *pipeline, RenderDescriptorSet **descriptorSets, uint32_t descriptorSetCount) override;
|
||||
@@ -450,11 +467,13 @@ namespace plume {
|
||||
struct D3D12Interface : RenderInterface {
|
||||
IDXGIFactory4 *dxgiFactory = nullptr;
|
||||
RenderInterfaceCapabilities capabilities;
|
||||
std::vector<std::string> deviceNames;
|
||||
|
||||
D3D12Interface();
|
||||
~D3D12Interface() override;
|
||||
std::unique_ptr<RenderDevice> createDevice() override;
|
||||
std::unique_ptr<RenderDevice> createDevice(const std::string &preferredDeviceName) override;
|
||||
const RenderInterfaceCapabilities &getCapabilities() const override;
|
||||
const std::vector<std::string> &getDeviceNames() const override;
|
||||
bool isValid() const;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -147,6 +147,8 @@ namespace plume {
|
||||
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 discardTexture(const RenderTexture* texture) = 0; // D3D12 only.
|
||||
virtual void resetQueryPool(const RenderQueryPool *queryPool, uint32_t queryFirstIndex, uint32_t queryCount) = 0;
|
||||
virtual void writeTimestamp(const RenderQueryPool *queryPool, uint32_t queryIndex) = 0;
|
||||
|
||||
// Concrete implementation shortcuts.
|
||||
inline void barriers(RenderBarrierStages stages, const RenderBufferBarrier &barrier) {
|
||||
@@ -208,6 +210,13 @@ namespace plume {
|
||||
virtual std::unique_ptr<RenderTexture> createTexture(const RenderTextureDesc &desc) = 0;
|
||||
};
|
||||
|
||||
struct RenderQueryPool {
|
||||
virtual ~RenderQueryPool() { }
|
||||
virtual void queryResults() = 0;
|
||||
virtual const uint64_t *getResults() const = 0;
|
||||
virtual uint32_t getCount() const = 0;
|
||||
};
|
||||
|
||||
struct RenderDevice {
|
||||
virtual ~RenderDevice() { }
|
||||
virtual std::unique_ptr<RenderCommandList> createCommandList(RenderCommandListType type) = 0;
|
||||
@@ -226,6 +235,7 @@ namespace plume {
|
||||
virtual std::unique_ptr<RenderCommandFence> createCommandFence() = 0;
|
||||
virtual std::unique_ptr<RenderCommandSemaphore> createCommandSemaphore() = 0;
|
||||
virtual std::unique_ptr<RenderFramebuffer> createFramebuffer(const RenderFramebufferDesc &desc) = 0;
|
||||
virtual std::unique_ptr<RenderQueryPool> createQueryPool(uint32_t queryCount) = 0;
|
||||
virtual void setBottomLevelASBuildInfo(RenderBottomLevelASBuildInfo &buildInfo, const RenderBottomLevelASMesh *meshes, uint32_t meshCount, bool preferFastBuild = true, bool preferFastTrace = false) = 0;
|
||||
virtual void setTopLevelASBuildInfo(RenderTopLevelASBuildInfo &buildInfo, const RenderTopLevelASInstance *instances, uint32_t instanceCount, bool preferFastBuild = true, bool preferFastTrace = false) = 0;
|
||||
virtual void setShaderBindingTableInfo(RenderShaderBindingTableInfo &tableInfo, const RenderShaderBindingGroups &groups, const RenderPipeline *pipeline, RenderDescriptorSet **descriptorSets, uint32_t descriptorSetCount) = 0;
|
||||
@@ -237,7 +247,8 @@ namespace plume {
|
||||
|
||||
struct RenderInterface {
|
||||
virtual ~RenderInterface() { }
|
||||
virtual std::unique_ptr<RenderDevice> createDevice() = 0;
|
||||
virtual std::unique_ptr<RenderDevice> createDevice(const std::string &preferredDeviceName = "") = 0;
|
||||
virtual const std::vector<std::string> &getDeviceNames() const = 0;
|
||||
virtual const RenderInterfaceCapabilities &getCapabilities() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,9 +69,17 @@ namespace plume {
|
||||
struct RenderSampler;
|
||||
struct RenderShader;
|
||||
struct RenderTexture;
|
||||
struct RenderQueryPool;
|
||||
|
||||
// Enums.
|
||||
|
||||
enum class RenderDeviceVendor {
|
||||
UNKNOWN = 0x0,
|
||||
AMD = 0x1002,
|
||||
NVIDIA = 0x10DE,
|
||||
INTEL = 0x8086
|
||||
};
|
||||
|
||||
enum class RenderFormat {
|
||||
UNKNOWN,
|
||||
R32G32B32A32_TYPELESS,
|
||||
@@ -1769,7 +1777,8 @@ namespace plume {
|
||||
struct RenderDeviceDescription {
|
||||
std::string name = "Unknown";
|
||||
RenderDeviceType type = RenderDeviceType::UNKNOWN;
|
||||
uint32_t driverVersion = 0;
|
||||
RenderDeviceVendor vendor = RenderDeviceVendor::UNKNOWN;
|
||||
uint64_t driverVersion = 0;
|
||||
uint64_t dedicatedVideoMemory = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -2344,7 +2344,7 @@ namespace plume {
|
||||
dstWidth = rect.right - rect.left;
|
||||
dstHeight = rect.bottom - rect.top;
|
||||
# elif defined(SDL_VULKAN_ENABLED)
|
||||
SDL_GetWindowSize(renderWindow, (int *)(&dstWidth), (int *)(&dstHeight));
|
||||
SDL_GetWindowSizeInPixels(renderWindow, (int *)(&dstWidth), (int *)(&dstHeight));
|
||||
# elif defined(__ANDROID__)
|
||||
dstWidth = ANativeWindow_getWidth(renderWindow);
|
||||
dstHeight = ANativeWindow_getHeight(renderWindow);
|
||||
@@ -2522,6 +2522,80 @@ namespace plume {
|
||||
return (depthAttachment == attachment);
|
||||
}
|
||||
|
||||
// VulkanQueryPool
|
||||
|
||||
VulkanQueryPool::VulkanQueryPool(VulkanDevice *device, uint32_t queryCount) {
|
||||
assert(device != nullptr);
|
||||
assert(queryCount > 0);
|
||||
|
||||
this->device = device;
|
||||
|
||||
VkQueryPoolCreateInfo createInfo = {};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
|
||||
createInfo.queryType = VK_QUERY_TYPE_TIMESTAMP;
|
||||
createInfo.queryCount = queryCount;
|
||||
|
||||
VkResult res = vkCreateQueryPool(device->vk, &createInfo, nullptr, &vk);
|
||||
if (res != VK_SUCCESS) {
|
||||
fprintf(stderr, "vkCreateQueryPool failed with error code 0x%X.\n", res);
|
||||
return;
|
||||
}
|
||||
|
||||
results.resize(queryCount);
|
||||
}
|
||||
|
||||
VulkanQueryPool::~VulkanQueryPool() {
|
||||
vkDestroyQueryPool(device->vk, vk, nullptr);
|
||||
}
|
||||
|
||||
void VulkanQueryPool::queryResults() {
|
||||
VkResult res = vkGetQueryPoolResults(device->vk, vk, 0, uint32_t(results.size()), sizeof(uint64_t) * results.size(), results.data(), sizeof(uint64_t), VK_QUERY_RESULT_64_BIT);
|
||||
if (res != VK_SUCCESS) {
|
||||
fprintf(stderr, "vkGetQueryPoolResults failed with error code 0x%X.\n", res);
|
||||
return;
|
||||
}
|
||||
|
||||
// Conversion sourced from Godot Engine's Vulkan Rendering Driver.
|
||||
auto mult64to128 = [](uint64_t u, uint64_t v, uint64_t &h, uint64_t &l) {
|
||||
uint64_t u1 = (u & 0xffffffff);
|
||||
uint64_t v1 = (v & 0xffffffff);
|
||||
uint64_t t = (u1 * v1);
|
||||
uint64_t w3 = (t & 0xffffffff);
|
||||
uint64_t k = (t >> 32);
|
||||
|
||||
u >>= 32;
|
||||
t = (u * v1) + k;
|
||||
k = (t & 0xffffffff);
|
||||
uint64_t w1 = (t >> 32);
|
||||
|
||||
v >>= 32;
|
||||
t = (u1 * v) + k;
|
||||
k = (t >> 32);
|
||||
|
||||
h = (u * v) + w1 + k;
|
||||
l = (t << 32) + w3;
|
||||
};
|
||||
|
||||
// Convert results to timestamps.
|
||||
constexpr uint64_t shift_bits = 16;
|
||||
double timestampPeriod = double(device->physicalDeviceProperties.limits.timestampPeriod);
|
||||
uint64_t h = 0, l = 0;
|
||||
for (uint64_t &result : results) {
|
||||
mult64to128(result, uint64_t(timestampPeriod * double(1 << shift_bits)), h, l);
|
||||
result = l;
|
||||
result >>= shift_bits;
|
||||
result |= h << (64 - shift_bits);
|
||||
}
|
||||
}
|
||||
|
||||
const uint64_t *VulkanQueryPool::getResults() const {
|
||||
return results.data();
|
||||
}
|
||||
|
||||
uint32_t VulkanQueryPool::getCount() const {
|
||||
return uint32_t(results.size());
|
||||
}
|
||||
|
||||
// VulkanCommandList
|
||||
|
||||
VulkanCommandList::VulkanCommandList(VulkanDevice *device, RenderCommandListType type) {
|
||||
@@ -3210,6 +3284,20 @@ namespace plume {
|
||||
// Not required in Vulkan.
|
||||
}
|
||||
|
||||
void VulkanCommandList::resetQueryPool(const RenderQueryPool *queryPool, uint32_t queryFirstIndex, uint32_t queryCount) {
|
||||
assert(queryPool != nullptr);
|
||||
|
||||
const VulkanQueryPool *interfaceQueryPool = static_cast<const VulkanQueryPool *>(queryPool);
|
||||
vkCmdResetQueryPool(vk, interfaceQueryPool->vk, queryFirstIndex, queryCount);
|
||||
}
|
||||
|
||||
void VulkanCommandList::writeTimestamp(const RenderQueryPool *queryPool, uint32_t queryIndex) {
|
||||
assert(queryPool != nullptr);
|
||||
|
||||
const VulkanQueryPool *interfaceQueryPool = static_cast<const VulkanQueryPool *>(queryPool);
|
||||
vkCmdWriteTimestamp(vk, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, interfaceQueryPool->vk, queryIndex);
|
||||
}
|
||||
|
||||
void VulkanCommandList::checkActiveRenderPass() {
|
||||
assert(targetFramebuffer != nullptr);
|
||||
|
||||
@@ -3473,7 +3561,7 @@ namespace plume {
|
||||
|
||||
// VulkanDevice
|
||||
|
||||
VulkanDevice::VulkanDevice(VulkanInterface *renderInterface) {
|
||||
VulkanDevice::VulkanDevice(VulkanInterface *renderInterface, const std::string &preferredDeviceName) {
|
||||
assert(renderInterface != nullptr);
|
||||
|
||||
this->renderInterface = renderInterface;
|
||||
@@ -3506,15 +3594,22 @@ namespace plume {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string deviceName(deviceProperties.deviceName);
|
||||
uint32_t deviceTypeScore = deviceTypeScoreTable[deviceTypeIndex];
|
||||
bool preferDeviceTypeScore = (deviceTypeScore > currentDeviceTypeScore);
|
||||
bool preferOption = preferDeviceTypeScore;
|
||||
bool preferUserChoice = preferredDeviceName == deviceName;
|
||||
bool preferOption = preferDeviceTypeScore || preferUserChoice;
|
||||
if (preferOption) {
|
||||
physicalDevice = physicalDevices[i];
|
||||
description.name = std::string(deviceProperties.deviceName);
|
||||
description.name = deviceName;
|
||||
description.type = toDeviceType(deviceProperties.deviceType);
|
||||
description.driverVersion = deviceProperties.driverVersion;
|
||||
description.vendor = RenderDeviceVendor(deviceProperties.vendorID);
|
||||
currentDeviceTypeScore = deviceTypeScore;
|
||||
|
||||
if (preferUserChoice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3885,6 +3980,10 @@ namespace plume {
|
||||
return std::make_unique<VulkanFramebuffer>(this, desc);
|
||||
}
|
||||
|
||||
std::unique_ptr<RenderQueryPool> VulkanDevice::createQueryPool(uint32_t queryCount) {
|
||||
return std::make_unique<VulkanQueryPool>(this, queryCount);
|
||||
}
|
||||
|
||||
void VulkanDevice::setBottomLevelASBuildInfo(RenderBottomLevelASBuildInfo &buildInfo, const RenderBottomLevelASMesh *meshes, uint32_t meshCount, bool preferFastBuild, bool preferFastTrace) {
|
||||
assert(meshes != nullptr);
|
||||
assert(meshCount > 0);
|
||||
@@ -4233,6 +4332,23 @@ namespace plume {
|
||||
|
||||
// Fill capabilities.
|
||||
capabilities.shaderFormat = RenderShaderFormat::SPIRV;
|
||||
|
||||
// Fill device names.
|
||||
uint32_t deviceCount = 0;
|
||||
vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);
|
||||
if (deviceCount > 0) {
|
||||
std::vector<VkPhysicalDevice> physicalDevices(deviceCount);
|
||||
vkEnumeratePhysicalDevices(instance, &deviceCount, physicalDevices.data());
|
||||
|
||||
for (uint32_t i = 0; i < deviceCount; i++) {
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
vkGetPhysicalDeviceProperties(physicalDevices[i], &deviceProperties);
|
||||
uint32_t deviceTypeIndex = deviceProperties.deviceType;
|
||||
if (deviceTypeIndex <= 4) {
|
||||
deviceNames.emplace_back(deviceProperties.deviceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VulkanInterface::~VulkanInterface() {
|
||||
@@ -4241,8 +4357,8 @@ namespace plume {
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<RenderDevice> VulkanInterface::createDevice() {
|
||||
std::unique_ptr<VulkanDevice> createdDevice = std::make_unique<VulkanDevice>(this);
|
||||
std::unique_ptr<RenderDevice> VulkanInterface::createDevice(const std::string &preferredDeviceName) {
|
||||
std::unique_ptr<VulkanDevice> createdDevice = std::make_unique<VulkanDevice>(this, preferredDeviceName);
|
||||
return createdDevice->isValid() ? std::move(createdDevice) : nullptr;
|
||||
}
|
||||
|
||||
@@ -4250,6 +4366,10 @@ namespace plume {
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
const std::vector<std::string> &VulkanInterface::getDeviceNames() const {
|
||||
return deviceNames;
|
||||
}
|
||||
|
||||
bool VulkanInterface::isValid() const {
|
||||
return instance != nullptr;
|
||||
}
|
||||
|
||||
@@ -271,6 +271,18 @@ namespace plume {
|
||||
bool contains(const VulkanTexture *attachment) const;
|
||||
};
|
||||
|
||||
struct VulkanQueryPool : RenderQueryPool {
|
||||
VulkanDevice *device = nullptr;
|
||||
std::vector<uint64_t> results;
|
||||
VkQueryPool vk = VK_NULL_HANDLE;
|
||||
|
||||
VulkanQueryPool(VulkanDevice *device, uint32_t queryCount);
|
||||
virtual ~VulkanQueryPool() override;
|
||||
virtual void queryResults() override;
|
||||
virtual const uint64_t *getResults() const override;
|
||||
virtual uint32_t getCount() const override;
|
||||
};
|
||||
|
||||
struct VulkanCommandList : RenderCommandList {
|
||||
VkCommandBuffer vk = VK_NULL_HANDLE;
|
||||
VkCommandPool commandPool = VK_NULL_HANDLE;
|
||||
@@ -319,6 +331,8 @@ namespace plume {
|
||||
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 discardTexture(const RenderTexture* texture) override;
|
||||
void resetQueryPool(const RenderQueryPool *queryPool, uint32_t queryFirstIndex, uint32_t queryCount) override;
|
||||
void writeTimestamp(const RenderQueryPool *queryPool, uint32_t queryIndex) override;
|
||||
void checkActiveRenderPass();
|
||||
void endActiveRenderPass();
|
||||
void setDescriptorSet(VkPipelineBindPoint bindPoint, const VulkanPipelineLayout *pipelineLayout, const RenderDescriptorSet *descriptorSet, uint32_t setIndex);
|
||||
@@ -391,7 +405,7 @@ namespace plume {
|
||||
VkPhysicalDeviceSampleLocationsPropertiesEXT sampleLocationProperties = {};
|
||||
bool loadStoreOpNoneSupported = false;
|
||||
|
||||
VulkanDevice(VulkanInterface *renderInterface);
|
||||
VulkanDevice(VulkanInterface *renderInterface, const std::string &preferredDeviceName);
|
||||
~VulkanDevice() override;
|
||||
std::unique_ptr<RenderCommandList> createCommandList(RenderCommandListType type) override;
|
||||
std::unique_ptr<RenderDescriptorSet> createDescriptorSet(const RenderDescriptorSetDesc &desc) override;
|
||||
@@ -409,6 +423,7 @@ namespace plume {
|
||||
std::unique_ptr<RenderCommandFence> createCommandFence() override;
|
||||
std::unique_ptr<RenderCommandSemaphore> createCommandSemaphore() override;
|
||||
std::unique_ptr<RenderFramebuffer> createFramebuffer(const RenderFramebufferDesc &desc) override;
|
||||
std::unique_ptr<RenderQueryPool> createQueryPool(uint32_t queryCount) override;
|
||||
void setBottomLevelASBuildInfo(RenderBottomLevelASBuildInfo &buildInfo, const RenderBottomLevelASMesh *meshes, uint32_t meshCount, bool preferFastBuild, bool preferFastTrace) override;
|
||||
void setTopLevelASBuildInfo(RenderTopLevelASBuildInfo &buildInfo, const RenderTopLevelASInstance *instances, uint32_t instanceCount, bool preferFastBuild, bool preferFastTrace) override;
|
||||
void setShaderBindingTableInfo(RenderShaderBindingTableInfo &tableInfo, const RenderShaderBindingGroups &groups, const RenderPipeline *pipeline, RenderDescriptorSet **descriptorSets, uint32_t descriptorSetCount) override;
|
||||
@@ -424,6 +439,7 @@ namespace plume {
|
||||
VkInstance instance = VK_NULL_HANDLE;
|
||||
VkApplicationInfo appInfo = {};
|
||||
RenderInterfaceCapabilities capabilities;
|
||||
std::vector<std::string> deviceNames;
|
||||
|
||||
# if SDL_VULKAN_ENABLED
|
||||
VulkanInterface(RenderWindow sdlWindow);
|
||||
@@ -432,8 +448,9 @@ namespace plume {
|
||||
# endif
|
||||
|
||||
~VulkanInterface() override;
|
||||
std::unique_ptr<RenderDevice> createDevice() override;
|
||||
std::unique_ptr<RenderDevice> createDevice(const std::string &preferredDeviceName) override;
|
||||
const RenderInterfaceCapabilities &getCapabilities() const override;
|
||||
const std::vector<std::string> &getDeviceNames() const override;
|
||||
bool isValid() const;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ struct PushConstants
|
||||
uint GradientBottomLeft;
|
||||
uint ShaderModifier;
|
||||
uint Texture2DDescriptorIndex;
|
||||
float2 DisplaySize;
|
||||
float2 InverseDisplaySize;
|
||||
float2 Origin;
|
||||
float2 Scale;
|
||||
|
||||
@@ -61,10 +61,10 @@ float4 SampleLinear(float2 uvTexspace)
|
||||
|
||||
float4 PixelAntialiasing(float2 uvTexspace)
|
||||
{
|
||||
if ((g_PushConstants.InverseDisplaySize.y / g_PushConstants.InverseDisplaySize.x) >= (4.0 / 3.0))
|
||||
uvTexspace *= g_PushConstants.InverseDisplaySize.y * 720.0f;
|
||||
if ((g_PushConstants.DisplaySize.x * g_PushConstants.InverseDisplaySize.y) >= (4.0 / 3.0))
|
||||
uvTexspace *= g_PushConstants.InverseDisplaySize.y * 720.0;
|
||||
else
|
||||
uvTexspace *= g_PushConstants.InverseDisplaySize.x * 960.0f;
|
||||
uvTexspace *= g_PushConstants.InverseDisplaySize.x * 960.0;
|
||||
|
||||
float2 seam = floor(uvTexspace + 0.5);
|
||||
uvTexspace = (uvTexspace - seam) / fwidth(uvTexspace) + seam;
|
||||
@@ -78,6 +78,51 @@ float median(float r, float g, float b)
|
||||
return max(min(r, g), min(max(r, g), b));
|
||||
}
|
||||
|
||||
float4 SampleSdfFont(float4 color, Texture2D<float4> texture, float2 uv, float2 screenTexSize)
|
||||
{
|
||||
float4 textureColor = texture.Sample(g_SamplerDescriptorHeap[0], uv);
|
||||
|
||||
uint width, height;
|
||||
texture.GetDimensions(width, height);
|
||||
|
||||
float pxRange = 8.0;
|
||||
float2 unitRange = pxRange / float2(width, height);
|
||||
float screenPxRange = max(0.5 * dot(unitRange, screenTexSize), 1.0);
|
||||
|
||||
float sd = median(textureColor.r, textureColor.g, textureColor.b) - 0.5;
|
||||
float screenPxDistance = screenPxRange * (sd + g_PushConstants.Outline / (pxRange * 1.5));
|
||||
|
||||
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_TITLE_BEVEL)
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.01)).xy;
|
||||
float3 rimColor = float3(1, 0.8, 0.29);
|
||||
float3 shadowColor = float3(0.84, 0.57, 0);
|
||||
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float3 gradient = lerp(color.rgb, cosTheta >= 0.0 ? rimColor : shadowColor, abs(cosTheta));
|
||||
color.rgb = lerp(gradient, color.rgb, pow(saturate(sd + 0.77), 32.0));
|
||||
}
|
||||
else if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL)
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.25)).xy;
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float gradient = 1.0 + cosTheta * 0.5;
|
||||
color.rgb = saturate(color.rgb * gradient);
|
||||
}
|
||||
else if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_TEXT_SKEW)
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.5)).xy;
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float gradient = saturate(1.0 + cosTheta);
|
||||
color.rgb = lerp(color.rgb * gradient, color.rgb, pow(saturate(sd + 0.77), 32.0));
|
||||
}
|
||||
|
||||
color.a *= saturate(screenPxDistance + 0.5);
|
||||
color.a *= textureColor.a;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
float4 main(in Interpolators interpolators) : SV_Target
|
||||
{
|
||||
float4 color = interpolators.Color;
|
||||
@@ -86,52 +131,50 @@ float4 main(in Interpolators interpolators) : SV_Target
|
||||
if (g_PushConstants.Texture2DDescriptorIndex != 0)
|
||||
{
|
||||
Texture2D<float4> texture = g_Texture2DDescriptorHeap[g_PushConstants.Texture2DDescriptorIndex & 0x7FFFFFFF];
|
||||
float4 textureColor = texture.Sample(g_SamplerDescriptorHeap[0], interpolators.UV);
|
||||
|
||||
if ((g_PushConstants.Texture2DDescriptorIndex & 0x80000000) != 0)
|
||||
{
|
||||
uint width, height;
|
||||
texture.GetDimensions(width, height);
|
||||
|
||||
float pxRange = 8.0;
|
||||
float2 unitRange = pxRange / float2(width, height);
|
||||
float2 screenTexSize = 1.0 / fwidth(interpolators.UV);
|
||||
float screenPxRange = max(0.5 * dot(unitRange, screenTexSize), 1.0);
|
||||
|
||||
float sd = median(textureColor.r, textureColor.g, textureColor.b) - 0.5;
|
||||
float screenPxDistance = screenPxRange * (sd + g_PushConstants.Outline / (pxRange * 2.0));
|
||||
|
||||
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_TITLE_BEVEL)
|
||||
if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT)
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.01)).xy;
|
||||
float3 rimColor = float3(1, 0.8, 0.29);
|
||||
float3 shadowColor = float3(0.84, 0.57, 0);
|
||||
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float3 gradient = lerp(color.rgb, cosTheta >= 0.0 ? rimColor : shadowColor, abs(cosTheta));
|
||||
color.rgb = lerp(gradient, color.rgb, pow(saturate(sd + 0.8), 32.0));
|
||||
float scale;
|
||||
float invScale;
|
||||
|
||||
if ((g_PushConstants.DisplaySize.x * g_PushConstants.InverseDisplaySize.y) >= (4.0 / 3.0))
|
||||
{
|
||||
scale = g_PushConstants.InverseDisplaySize.y * 720.0;
|
||||
invScale = g_PushConstants.DisplaySize.y / 720.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
scale = g_PushConstants.InverseDisplaySize.x * 960.0;
|
||||
invScale = g_PushConstants.DisplaySize.x / 960.0;
|
||||
}
|
||||
|
||||
float2 lowQualityPosition = (interpolators.Position.xy - 0.5) * scale;
|
||||
float2 fracPart = frac(lowQualityPosition);
|
||||
|
||||
float2 uvStep = fwidth(interpolators.UV) * invScale;
|
||||
float2 lowQualityUV = interpolators.UV - fracPart * uvStep;
|
||||
float2 screenTexSize = 1.0 / uvStep;
|
||||
|
||||
float4 topLeft = SampleSdfFont(color, texture, lowQualityUV + float2(0, 0), screenTexSize);
|
||||
float4 topRight = SampleSdfFont(color, texture, lowQualityUV + float2(uvStep.x, 0), screenTexSize);
|
||||
float4 bottomLeft = SampleSdfFont(color, texture, lowQualityUV + float2(0, uvStep.y), screenTexSize);
|
||||
float4 bottomRight = SampleSdfFont(color, texture, lowQualityUV + uvStep.xy, screenTexSize);
|
||||
|
||||
float4 top = lerp(topLeft, topRight, fracPart.x);
|
||||
float4 bottom = lerp(bottomLeft, bottomRight, fracPart.x);
|
||||
|
||||
color = lerp(top, bottom, fracPart.y);
|
||||
}
|
||||
else if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL)
|
||||
else
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.25)).xy;
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float gradient = 1.0 + cosTheta * 0.5;
|
||||
color.rgb = saturate(color.rgb * gradient);
|
||||
color = SampleSdfFont(color, texture, interpolators.UV, 1.0 / fwidth(interpolators.UV));
|
||||
}
|
||||
else if (g_PushConstants.ShaderModifier == IMGUI_SHADER_MODIFIER_TEXT_SKEW)
|
||||
{
|
||||
float2 normal = normalize(float3(ddx(sd), ddy(sd), 0.5)).xy;
|
||||
float cosTheta = dot(normal, normalize(float2(1, 1)));
|
||||
float gradient = saturate(1.0 + cosTheta);
|
||||
color.rgb = lerp(color.rgb * gradient, color.rgb, pow(saturate(sd + 0.77), 32.0));
|
||||
}
|
||||
|
||||
color.a *= saturate(screenPxDistance + 0.5);
|
||||
color.a *= textureColor.a;
|
||||
}
|
||||
else
|
||||
{
|
||||
color *= textureColor;
|
||||
color *= texture.Sample(g_SamplerDescriptorHeap[0], interpolators.UV);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+495
-71
@@ -230,14 +230,65 @@ static void SetDirtyValue(bool& dirtyState, T& dest, const T& src)
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr size_t PROFILER_VALUE_COUNT = 256;
|
||||
static size_t g_profilerValueIndex;
|
||||
|
||||
struct Profiler
|
||||
{
|
||||
std::atomic<double> value;
|
||||
double values[PROFILER_VALUE_COUNT];
|
||||
std::chrono::steady_clock::time_point start;
|
||||
|
||||
void Begin()
|
||||
{
|
||||
start = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
void End()
|
||||
{
|
||||
value = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - start).count();
|
||||
}
|
||||
|
||||
void Set(double v)
|
||||
{
|
||||
value = v;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
End();
|
||||
Begin();
|
||||
}
|
||||
|
||||
double UpdateAndReturnAverage()
|
||||
{
|
||||
values[g_profilerValueIndex] = value;
|
||||
return std::accumulate(values, values + PROFILER_VALUE_COUNT, 0.0) / PROFILER_VALUE_COUNT;
|
||||
}
|
||||
};
|
||||
|
||||
static double g_applicationValues[PROFILER_VALUE_COUNT];
|
||||
static Profiler g_gpuFrameProfiler;
|
||||
static Profiler g_presentProfiler;
|
||||
static Profiler g_updateDirectorProfiler;
|
||||
static Profiler g_renderDirectorProfiler;
|
||||
static Profiler g_frameFenceProfiler;
|
||||
static Profiler g_presentWaitProfiler;
|
||||
static Profiler g_swapChainAcquireProfiler;
|
||||
|
||||
static bool g_profilerVisible;
|
||||
static bool g_profilerWasToggled;
|
||||
|
||||
#ifdef UNLEASHED_RECOMP_D3D12
|
||||
static bool g_vulkan = false;
|
||||
#else
|
||||
static constexpr bool g_vulkan = true;
|
||||
#endif
|
||||
|
||||
static constexpr bool g_hardwareResolve = true;
|
||||
static constexpr bool g_hardwareDepthResolve = true;
|
||||
static bool g_triangleStripWorkaround = false;
|
||||
|
||||
static bool g_hardwareResolve = true;
|
||||
static bool g_hardwareDepthResolve = true;
|
||||
|
||||
static std::unique_ptr<RenderInterface> g_interface;
|
||||
static std::unique_ptr<RenderDevice> g_device;
|
||||
@@ -245,6 +296,7 @@ static std::unique_ptr<RenderDevice> g_device;
|
||||
static RenderDeviceCapabilities g_capabilities;
|
||||
|
||||
static constexpr size_t NUM_FRAMES = 2;
|
||||
static constexpr size_t NUM_QUERIES = 2;
|
||||
|
||||
static uint32_t g_frame = 0;
|
||||
static uint32_t g_nextFrame = 1;
|
||||
@@ -252,6 +304,7 @@ static uint32_t g_nextFrame = 1;
|
||||
static std::unique_ptr<RenderCommandQueue> g_queue;
|
||||
static std::unique_ptr<RenderCommandList> g_commandLists[NUM_FRAMES];
|
||||
static std::unique_ptr<RenderCommandFence> g_commandFences[NUM_FRAMES];
|
||||
static std::unique_ptr<RenderQueryPool> g_queryPools[NUM_FRAMES];
|
||||
static bool g_commandListStates[NUM_FRAMES];
|
||||
|
||||
static Mutex g_copyMutex;
|
||||
@@ -1287,6 +1340,7 @@ struct ImGuiPushConstants
|
||||
ImU32 gradientBottomLeft{};
|
||||
uint32_t shaderModifier{};
|
||||
uint32_t texture2DDescriptorIndex{};
|
||||
ImVec2 displaySize{};
|
||||
ImVec2 inverseDisplaySize{};
|
||||
ImVec2 origin{ 0.0f, 0.0f };
|
||||
ImVec2 scale{ 1.0f, 1.0f };
|
||||
@@ -1476,7 +1530,11 @@ static void CheckSwapChain()
|
||||
}
|
||||
|
||||
if (g_swapChainValid)
|
||||
{
|
||||
g_swapChainAcquireProfiler.Begin();
|
||||
g_swapChainValid = g_swapChain->acquireTexture(g_acquireSemaphores[g_frame].get(), &g_backBufferIndex);
|
||||
g_swapChainAcquireProfiler.End();
|
||||
}
|
||||
|
||||
if (g_needsResize)
|
||||
Video::ComputeViewportDimensions();
|
||||
@@ -1552,6 +1610,8 @@ static void BeginCommandList()
|
||||
auto& commandList = g_commandLists[g_frame];
|
||||
|
||||
commandList->begin();
|
||||
commandList->resetQueryPool(g_queryPools[g_frame].get(), 0, NUM_QUERIES);
|
||||
commandList->writeTimestamp(g_queryPools[g_frame].get(), 0);
|
||||
commandList->setGraphicsPipelineLayout(g_pipelineLayout.get());
|
||||
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 0);
|
||||
commandList->setGraphicsDescriptorSet(g_textureDescriptorSet.get(), 1);
|
||||
@@ -1567,6 +1627,8 @@ static void ApplyLowEndDefault(ConfigDef<T> &configDef, T newDefault, bool &chan
|
||||
configDef = newDefault;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
configDef.DefaultValue = newDefault;
|
||||
}
|
||||
|
||||
static void ApplyLowEndDefaults()
|
||||
@@ -1615,12 +1677,39 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver)
|
||||
g_interface = interfaceFunction();
|
||||
if (g_interface != nullptr)
|
||||
{
|
||||
g_device = g_interface->createDevice();
|
||||
g_device = g_interface->createDevice(Config::GraphicsDevice);
|
||||
if (g_device != nullptr)
|
||||
{
|
||||
const RenderDeviceDescription &deviceDescription = g_device->getDescription();
|
||||
|
||||
#ifdef UNLEASHED_RECOMP_D3D12
|
||||
if (interfaceFunction == CreateD3D12Interface)
|
||||
{
|
||||
if (deviceDescription.vendor == RenderDeviceVendor::AMD)
|
||||
{
|
||||
// AMD Drivers before this version have a known issue where MSAA resolve targets will fail to work correctly.
|
||||
// If no specific graphics API was selected, we silently destroy this one and move to the next option as it'll
|
||||
// just work incorrectly otherwise and result in visual glitches and 3D rendering not working in general.
|
||||
constexpr uint64_t MinimumAMDDriverVersion = 0x1F00005DC2005CULL; // 31.0.24002.92
|
||||
if ((Config::GraphicsAPI == EGraphicsAPI::Auto) && (deviceDescription.driverVersion < MinimumAMDDriverVersion))
|
||||
{
|
||||
g_device.reset();
|
||||
g_interface.reset();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Hardware resolve seems to be completely bugged on Intel D3D12 drivers.
|
||||
g_hardwareResolve = (deviceDescription.vendor != RenderDeviceVendor::INTEL);
|
||||
g_hardwareDepthResolve = (deviceDescription.vendor != RenderDeviceVendor::INTEL);
|
||||
}
|
||||
|
||||
g_vulkan = (interfaceFunction == CreateVulkanInterfaceWrapper);
|
||||
#endif
|
||||
// Enable triangle strip workaround if we are on AMD, as there is a bug where
|
||||
// restart indices cause triangles to be culled incorrectly. Converting them to degenerate triangles fixes it.
|
||||
g_triangleStripWorkaround = (deviceDescription.vendor == RenderDeviceVendor::AMD);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1655,6 +1744,9 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver)
|
||||
for (auto& commandFence : g_commandFences)
|
||||
commandFence = g_device->createCommandFence();
|
||||
|
||||
for (auto& queryPool : g_queryPools)
|
||||
queryPool = g_device->createQueryPool(NUM_QUERIES);
|
||||
|
||||
g_copyQueue = g_device->createCommandQueue(RenderCommandListType::COPY);
|
||||
g_copyCommandList = g_device->createCommandList(RenderCommandListType::COPY);
|
||||
g_copyCommandFence = g_device->createCommandFence();
|
||||
@@ -1875,8 +1967,12 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver)
|
||||
return true;
|
||||
}
|
||||
|
||||
static uint32_t g_waitForGPUCount = 0;
|
||||
|
||||
void Video::WaitForGPU()
|
||||
{
|
||||
g_waitForGPUCount++;
|
||||
|
||||
if (g_vulkan)
|
||||
{
|
||||
g_device->waitIdle();
|
||||
@@ -2125,45 +2221,6 @@ static uint32_t HashVertexDeclaration(uint32_t vertexDeclaration)
|
||||
return vertexDeclaration;
|
||||
}
|
||||
|
||||
static constexpr size_t PROFILER_VALUE_COUNT = 256;
|
||||
static size_t g_profilerValueIndex;
|
||||
|
||||
struct Profiler
|
||||
{
|
||||
std::atomic<double> value;
|
||||
double values[PROFILER_VALUE_COUNT];
|
||||
std::chrono::steady_clock::time_point start;
|
||||
|
||||
void Begin()
|
||||
{
|
||||
start = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
void End()
|
||||
{
|
||||
value = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - start).count();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
End();
|
||||
Begin();
|
||||
}
|
||||
|
||||
double UpdateAndReturnAverage()
|
||||
{
|
||||
values[g_profilerValueIndex] = value;
|
||||
return std::accumulate(values, values + PROFILER_VALUE_COUNT, 0.0) / PROFILER_VALUE_COUNT;
|
||||
}
|
||||
};
|
||||
|
||||
static double g_applicationValues[PROFILER_VALUE_COUNT];
|
||||
static Profiler g_presentProfiler;
|
||||
static Profiler g_renderDirectorProfiler;
|
||||
|
||||
static bool g_profilerVisible;
|
||||
static bool g_profilerWasToggled;
|
||||
|
||||
static const char *DeviceTypeName(RenderDeviceType type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -2186,8 +2243,12 @@ static void DrawProfiler()
|
||||
bool toggleProfiler = SDL_GetKeyboardState(nullptr)[SDL_SCANCODE_F1] != 0;
|
||||
|
||||
if (!g_profilerWasToggled && toggleProfiler)
|
||||
{
|
||||
g_profilerVisible = !g_profilerVisible;
|
||||
|
||||
GameWindow::SetFullscreenCursorVisibility(App::s_isInit ? g_profilerVisible : true);
|
||||
}
|
||||
|
||||
g_profilerWasToggled = toggleProfiler;
|
||||
|
||||
if (!g_profilerVisible)
|
||||
@@ -2203,29 +2264,51 @@ static void DrawProfiler()
|
||||
g_applicationValues[g_profilerValueIndex] = App::s_deltaTime * 1000.0;
|
||||
|
||||
const double applicationAvg = std::accumulate(g_applicationValues, g_applicationValues + PROFILER_VALUE_COUNT, 0.0) / PROFILER_VALUE_COUNT;
|
||||
double gpuFrameAvg = g_gpuFrameProfiler.UpdateAndReturnAverage();
|
||||
double presentAvg = g_presentProfiler.UpdateAndReturnAverage();
|
||||
double updateDirectorAvg = g_updateDirectorProfiler.UpdateAndReturnAverage();
|
||||
double renderDirectorAvg = g_renderDirectorProfiler.UpdateAndReturnAverage();
|
||||
double frameFenceAvg = g_frameFenceProfiler.UpdateAndReturnAverage();
|
||||
double presentWaitAvg = g_presentWaitProfiler.UpdateAndReturnAverage();
|
||||
double swapChainAcquireAvg = g_swapChainAcquireProfiler.UpdateAndReturnAverage();
|
||||
|
||||
if (ImPlot::BeginPlot("Frame Time"))
|
||||
{
|
||||
ImPlot::SetupAxisLimits(ImAxis_Y1, 0.0, 20.0);
|
||||
ImPlot::SetupAxis(ImAxis_Y1, "ms", ImPlotAxisFlags_None);
|
||||
ImPlot::PlotLine<double>("Application", g_applicationValues, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("GPU Frame", g_gpuFrameProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Present", g_presentProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Update Director", g_updateDirectorProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Render Director", g_renderDirectorProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Frame Fence", g_frameFenceProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Present Wait", g_presentWaitProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::PlotLine<double>("Swap Chain Acquire", g_swapChainAcquireProfiler.values, PROFILER_VALUE_COUNT, 1.0, 0.0, ImPlotLineFlags_None, g_profilerValueIndex);
|
||||
ImPlot::EndPlot();
|
||||
}
|
||||
|
||||
g_profilerValueIndex = (g_profilerValueIndex + 1) % PROFILER_VALUE_COUNT;
|
||||
|
||||
ImGui::Text("Current Application: %g ms (%g FPS)", App::s_deltaTime * 1000.0, 1.0 / App::s_deltaTime);
|
||||
ImGui::Text("Current GPU Frame: %g ms (%g FPS)", g_gpuFrameProfiler.value.load(), 1000.0 / g_gpuFrameProfiler.value.load());
|
||||
ImGui::Text("Current Present: %g ms (%g FPS)", g_presentProfiler.value.load(), 1000.0 / g_presentProfiler.value.load());
|
||||
ImGui::Text("Current Update Director: %g ms (%g FPS)", g_updateDirectorProfiler.value.load(), 1000.0 / g_updateDirectorProfiler.value.load());
|
||||
ImGui::Text("Current Render Director: %g ms (%g FPS)", g_renderDirectorProfiler.value.load(), 1000.0 / g_renderDirectorProfiler.value.load());
|
||||
ImGui::Text("Current Frame Fence: %g ms", g_frameFenceProfiler.value.load());
|
||||
ImGui::Text("Current Present Wait: %g ms", g_presentWaitProfiler.value.load());
|
||||
ImGui::Text("Current Swap Chain Acquire: %g ms", g_swapChainAcquireProfiler.value.load());
|
||||
|
||||
ImGui::NewLine();
|
||||
|
||||
ImGui::Text("Average Application: %g ms (%g FPS)", applicationAvg, 1000.0 / applicationAvg);
|
||||
ImGui::Text("Average GPU Frame: %g ms (%g FPS)", gpuFrameAvg, 1000.0 / gpuFrameAvg);
|
||||
ImGui::Text("Average Present: %g ms (%g FPS)", presentAvg, 1000.0 / presentAvg);
|
||||
ImGui::Text("Average Update Director: %g ms (%g FPS)", updateDirectorAvg, 1000.0 / updateDirectorAvg);
|
||||
ImGui::Text("Average Render Director: %g ms (%g FPS)", renderDirectorAvg, 1000.0 / renderDirectorAvg);
|
||||
ImGui::Text("Average Frame Fence: %g ms", frameFenceAvg);
|
||||
ImGui::Text("Average Present Wait: %g ms", presentWaitAvg);
|
||||
ImGui::Text("Average Swap Chain Acquire: %g ms", swapChainAcquireAvg);
|
||||
|
||||
ImGui::NewLine();
|
||||
|
||||
O1HeapDiagnostics diagnostics, physicalDiagnostics;
|
||||
@@ -2240,11 +2323,15 @@ static void DrawProfiler()
|
||||
|
||||
ImGui::Text("Heap Allocated: %d MB", int32_t(diagnostics.allocated / (1024 * 1024)));
|
||||
ImGui::Text("Physical Heap Allocated: %d MB", int32_t(physicalDiagnostics.allocated / (1024 * 1024)));
|
||||
ImGui::Text("GPU Waits: %d", int32_t(g_waitForGPUCount));
|
||||
ImGui::NewLine();
|
||||
|
||||
ImGui::Text("Present Wait: %s", g_capabilities.presentWait ? "Supported" : "Unsupported");
|
||||
ImGui::Text("Triangle Fan: %s", g_capabilities.triangleFan ? "Supported" : "Unsupported");
|
||||
ImGui::Text("Dynamic Depth Bias: %s", g_capabilities.dynamicDepthBias ? "Supported" : "Unsupported");
|
||||
ImGui::Text("Triangle Strip Workaround: %s", g_triangleStripWorkaround ? "Enabled" : "Disabled");
|
||||
ImGui::Text("Hardware Resolve: %s", g_hardwareResolve ? "Enabled" : "Disabled");
|
||||
ImGui::Text("Hardware Depth Resolve: %s", g_hardwareDepthResolve ? "Enabled" : "Disabled");
|
||||
ImGui::NewLine();
|
||||
|
||||
ImGui::Text("API: %s", g_vulkan ? "Vulkan" : "D3D12");
|
||||
@@ -2256,6 +2343,24 @@ static void DrawProfiler()
|
||||
const char* sdlVideoDriver = SDL_GetCurrentVideoDriver();
|
||||
if (sdlVideoDriver != nullptr)
|
||||
ImGui::Text("SDL Video Driver: %s", sdlVideoDriver);
|
||||
|
||||
ImGui::NewLine();
|
||||
ImGui::Checkbox("Show FPS", &Config::ShowFPS.Value);
|
||||
ImGui::NewLine();
|
||||
|
||||
if (ImGui::TreeNode("Device Names"))
|
||||
{
|
||||
ImGui::Indent();
|
||||
|
||||
uint32_t deviceIndex = 0;
|
||||
for (const std::string &deviceName : g_interface->getDeviceNames())
|
||||
{
|
||||
ImGui::Text("Option #%d: %s", deviceIndex++, deviceName.c_str());
|
||||
}
|
||||
|
||||
ImGui::Unindent();
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
@@ -2263,6 +2368,43 @@ static void DrawProfiler()
|
||||
font->Scale = defaultScale;
|
||||
}
|
||||
|
||||
static void DrawFPS()
|
||||
{
|
||||
if (!Config::ShowFPS)
|
||||
return;
|
||||
|
||||
double time = ImGui::GetTime();
|
||||
static double updateTime = time;
|
||||
static double fps = 0;
|
||||
static double totalDeltaTime = 0.0;
|
||||
static uint32_t totalDeltaCount = 0;
|
||||
|
||||
totalDeltaTime += g_presentProfiler.value.load();
|
||||
totalDeltaCount++;
|
||||
|
||||
if (time - updateTime >= 1.0f)
|
||||
{
|
||||
fps = 1000.0 / std::max(totalDeltaTime / double(totalDeltaCount), 1.0);
|
||||
updateTime = time;
|
||||
totalDeltaTime = 0.0;
|
||||
totalDeltaCount = 0;
|
||||
}
|
||||
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
auto fmt = fmt::format("FPS: {:.2f}", fps);
|
||||
auto font = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf");
|
||||
auto fontSize = Scale(10);
|
||||
auto textSize = font->CalcTextSizeA(fontSize, FLT_MAX, 0, fmt.c_str());
|
||||
|
||||
ImVec2 min = { Scale(40), Scale(30) };
|
||||
ImVec2 max = { min.x + std::max(Scale(75), textSize.x + Scale(10)), min.y + Scale(15) };
|
||||
ImVec2 textPos = { min.x + Scale(2), CENTRE_TEXT_VERT(min, max, textSize) + Scale(0.2f) };
|
||||
|
||||
drawList->AddRectFilled(min, max, IM_COL32(0, 0, 0, 200));
|
||||
drawList->AddText(font, fontSize, textPos, IM_COL32_WHITE, fmt.c_str());
|
||||
}
|
||||
|
||||
static void DrawImGui()
|
||||
{
|
||||
ImGui_ImplSDL2_NewFrame();
|
||||
@@ -2275,19 +2417,25 @@ static void DrawImGui()
|
||||
// we can adjust the mouse events before ImGui processes them.
|
||||
uint32_t width = g_swapChain->getWidth();
|
||||
uint32_t height = g_swapChain->getHeight();
|
||||
|
||||
if (width != Video::s_viewportWidth || height != Video::s_viewportHeight)
|
||||
float mousePosScaleX = float(width) / float(GameWindow::s_width);
|
||||
float mousePosScaleY = float(height) / float(GameWindow::s_height);
|
||||
float mousePosOffsetX = (width - Video::s_viewportWidth) / 2.0f;
|
||||
float mousePosOffsetY = (height - Video::s_viewportHeight) / 2.0f;
|
||||
for (int i = 0; i < io.Ctx->InputEventsQueue.Size; i++)
|
||||
{
|
||||
float mousePosOffsetX = (width - Video::s_viewportWidth) / 2.0f;
|
||||
float mousePosOffsetY = (height - Video::s_viewportHeight) / 2.0f;
|
||||
|
||||
for (int i = 0; i < io.Ctx->InputEventsQueue.Size; i++)
|
||||
auto& e = io.Ctx->InputEventsQueue[i];
|
||||
if (e.Type == ImGuiInputEventType_MousePos)
|
||||
{
|
||||
auto& e = io.Ctx->InputEventsQueue[i];
|
||||
if (e.Type == ImGuiInputEventType_MousePos)
|
||||
if (e.MousePos.PosX != -FLT_MAX)
|
||||
{
|
||||
if (e.MousePos.PosX != -FLT_MAX) e.MousePos.PosX -= mousePosOffsetX;
|
||||
if (e.MousePos.PosY != -FLT_MAX) e.MousePos.PosY -= mousePosOffsetY;
|
||||
e.MousePos.PosX *= mousePosScaleX;
|
||||
e.MousePos.PosX -= mousePosOffsetX;
|
||||
}
|
||||
|
||||
if (e.MousePos.PosY != -FLT_MAX)
|
||||
{
|
||||
e.MousePos.PosY *= mousePosScaleY;
|
||||
e.MousePos.PosY -= mousePosOffsetY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2321,8 +2469,9 @@ static void DrawImGui()
|
||||
Fader::Draw();
|
||||
BlackBar::Draw();
|
||||
|
||||
assert(ImGui::GetForegroundDrawList()->_ClipRectStack.Size == 1 && "Some clip rects were not removed from the stack!");
|
||||
assert(ImGui::GetBackgroundDrawList()->_ClipRectStack.Size == 1 && "Some clip rects were not removed from the stack!");
|
||||
|
||||
DrawFPS();
|
||||
DrawProfiler();
|
||||
ImGui::Render();
|
||||
|
||||
@@ -2356,6 +2505,7 @@ static void ProcDrawImGui(const RenderCommand& cmd)
|
||||
commandList->setViewports(RenderViewport(drawData.DisplayPos.x, drawData.DisplayPos.y, drawData.DisplaySize.x, drawData.DisplaySize.y));
|
||||
|
||||
ImGuiPushConstants pushConstants{};
|
||||
pushConstants.displaySize = drawData.DisplaySize;
|
||||
pushConstants.inverseDisplaySize = { 1.0f / drawData.DisplaySize.x, 1.0f / drawData.DisplaySize.y };
|
||||
commandList->setGraphicsPushConstants(0, &pushConstants);
|
||||
|
||||
@@ -2494,7 +2644,11 @@ void Video::WaitOnSwapChain()
|
||||
if (g_pendingWaitOnSwapChain)
|
||||
{
|
||||
if (g_swapChainValid)
|
||||
{
|
||||
g_presentWaitProfiler.Begin();
|
||||
g_swapChain->wait();
|
||||
g_presentWaitProfiler.End();
|
||||
}
|
||||
|
||||
g_pendingWaitOnSwapChain = false;
|
||||
}
|
||||
@@ -2527,7 +2681,11 @@ void Video::Present()
|
||||
if (g_swapChainValid)
|
||||
{
|
||||
if (g_pendingWaitOnSwapChain)
|
||||
{
|
||||
g_presentWaitProfiler.Begin();
|
||||
g_swapChain->wait(); // Never gonna happen outside loading threads as explained above.
|
||||
g_presentWaitProfiler.End();
|
||||
}
|
||||
|
||||
RenderCommandSemaphore* signalSemaphores[] = { g_renderSemaphores[g_frame].get() };
|
||||
g_swapChainValid = g_swapChain->present(g_backBufferIndex, signalSemaphores, std::size(signalSemaphores));
|
||||
@@ -2540,8 +2698,15 @@ void Video::Present()
|
||||
|
||||
if (g_commandListStates[g_frame])
|
||||
{
|
||||
g_frameFenceProfiler.Begin();
|
||||
g_queue->waitForCommandFence(g_commandFences[g_frame].get());
|
||||
g_frameFenceProfiler.End();
|
||||
g_commandListStates[g_frame] = false;
|
||||
|
||||
// Update the GPU profiler with the results from the timestamps of the frame.
|
||||
g_queryPools[g_frame]->queryResults();
|
||||
const uint64_t *frameTimestamps = g_queryPools[g_frame]->getResults();
|
||||
g_gpuFrameProfiler.Set(double(frameTimestamps[1] - frameTimestamps[0]) / 1000000.0);
|
||||
}
|
||||
|
||||
g_dirtyStates = DirtyStates(true);
|
||||
@@ -2676,6 +2841,7 @@ static void ProcExecuteCommandList(const RenderCommand& cmd)
|
||||
}
|
||||
|
||||
auto &commandList = g_commandLists[g_frame];
|
||||
commandList->writeTimestamp(g_queryPools[g_frame].get(), 1);
|
||||
commandList->end();
|
||||
|
||||
if (g_swapChainValid)
|
||||
@@ -5622,13 +5788,10 @@ PPC_FUNC(sub_8258C8A0)
|
||||
PPC_FUNC_IMPL(__imp__sub_8258CAE0);
|
||||
PPC_FUNC(sub_8258CAE0)
|
||||
{
|
||||
g_renderDirectorProfiler.Begin();
|
||||
|
||||
if (g_needsResize)
|
||||
{
|
||||
// Backup fade values. These get modified by cutscenes,
|
||||
// Backup job values. These get modified by cutscenes,
|
||||
// and resizing will cause the values to be forgotten.
|
||||
// NOTE: Intentionally ignoring the shared pointers here.
|
||||
auto traverseFxJobs = [&]<typename TCallback>(const TCallback& callback)
|
||||
{
|
||||
uint32_t scheduler = PPC_LOAD_U32(ctx.r3.u32 + 0xE0);
|
||||
@@ -5640,28 +5803,63 @@ PPC_FUNC(sub_8258CAE0)
|
||||
for (uint32_t it = PPC_LOAD_U32(member + 0x24); it != PPC_LOAD_U32(member + 0x28); it += 8)
|
||||
{
|
||||
uint32_t job = PPC_LOAD_U32(it);
|
||||
if (job != NULL && PPC_LOAD_U32(job) == 0x820CA6F8) // SWA::CFxFade
|
||||
if (job != NULL)
|
||||
callback(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct FadeValues
|
||||
union JobValues
|
||||
{
|
||||
uint8_t field50[0x18];
|
||||
uint8_t field88;
|
||||
struct
|
||||
{
|
||||
uint8_t field50[0x18];
|
||||
uint8_t field88;
|
||||
} fade;
|
||||
|
||||
struct
|
||||
{
|
||||
uint8_t camera[0x120];
|
||||
uint8_t field44;
|
||||
uint8_t fieldA0;
|
||||
} shadowMap;
|
||||
};
|
||||
|
||||
std::map<uint32_t, FadeValues> fadeValuesMap;
|
||||
std::map<uint32_t, JobValues> jobValuesMap;
|
||||
traverseFxJobs([&](uint32_t job)
|
||||
{
|
||||
FadeValues fadeValues{};
|
||||
uint32_t vfTable = PPC_LOAD_U32(job);
|
||||
|
||||
memcpy(fadeValues.field50, base + job + 0x50, sizeof(fadeValues.field50));
|
||||
fadeValues.field88 = PPC_LOAD_U8(job + 0x88);
|
||||
if (vfTable == 0x820CA6F8) // SWA::CFxFade
|
||||
{
|
||||
// NOTE: Intentionally not storing shared pointers here.
|
||||
// Game sends messages that assign these every frame already.
|
||||
JobValues jobValues{};
|
||||
|
||||
fadeValuesMap.emplace(PPC_LOAD_U32(job + 0x48), fadeValues);
|
||||
memcpy(jobValues.fade.field50, base + job + 0x50, sizeof(jobValues.fade.field50));
|
||||
jobValues.fade.field88 = PPC_LOAD_U8(job + 0x88);
|
||||
|
||||
jobValuesMap.emplace(PPC_LOAD_U32(job + 0x48), jobValues);
|
||||
}
|
||||
else if (vfTable == 0x820CAC5C) // SWA::CFxShadowMap
|
||||
{
|
||||
for (uint32_t it = PPC_LOAD_U32(job + 0x88); it != PPC_LOAD_U32(job + 0x8C); it += 8)
|
||||
{
|
||||
uint32_t camera = PPC_LOAD_U32(it);
|
||||
if (camera != NULL && PPC_LOAD_U32(camera) == 0x820BF83C) // SWA::CShadowMapCameraLiSPSM
|
||||
{
|
||||
JobValues jobValues{};
|
||||
|
||||
memcpy(jobValues.shadowMap.camera, base + camera, sizeof(jobValues.shadowMap.camera));
|
||||
jobValues.shadowMap.field44 = PPC_LOAD_U8(job + 0x44);
|
||||
jobValues.shadowMap.fieldA0 = PPC_LOAD_U8(job + 0xA0);
|
||||
|
||||
jobValuesMap.emplace(vfTable, jobValues);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
auto r3 = ctx.r3;
|
||||
@@ -5670,14 +5868,38 @@ PPC_FUNC(sub_8258CAE0)
|
||||
__imp__sub_8258C8A0(ctx, base);
|
||||
ctx.r3 = r3;
|
||||
|
||||
// Restore fade values.
|
||||
// Restore job values.
|
||||
traverseFxJobs([&](uint32_t job)
|
||||
{
|
||||
auto findResult = fadeValuesMap.find(PPC_LOAD_U32(job + 0x48));
|
||||
if (findResult != fadeValuesMap.end()) // May NOT actually be found.
|
||||
uint32_t vfTable = PPC_LOAD_U32(job);
|
||||
|
||||
if (vfTable == 0x820CA6F8) // SWA::CFxFade
|
||||
{
|
||||
memcpy(base + job + 0x50, findResult->second.field50, sizeof(findResult->second.field50));
|
||||
PPC_STORE_U8(job + 0x88, findResult->second.field88);
|
||||
auto findResult = jobValuesMap.find(PPC_LOAD_U32(job + 0x48));
|
||||
if (findResult != jobValuesMap.end()) // May NOT actually be found.
|
||||
{
|
||||
memcpy(base + job + 0x50, findResult->second.fade.field50, sizeof(findResult->second.fade.field50));
|
||||
PPC_STORE_U8(job + 0x88, findResult->second.fade.field88);
|
||||
}
|
||||
}
|
||||
else if (vfTable == 0x820CAC5C) // SWA::CFxShadowMap
|
||||
{
|
||||
auto findResult = jobValuesMap.find(vfTable);
|
||||
if (findResult != jobValuesMap.end()) // Would be weird if this one wasn't found.
|
||||
{
|
||||
for (uint32_t it = PPC_LOAD_U32(job + 0x88); it != PPC_LOAD_U32(job + 0x8C); it += 8)
|
||||
{
|
||||
uint32_t camera = PPC_LOAD_U32(it);
|
||||
if (camera != NULL && PPC_LOAD_U32(camera) == 0x820BF83C) // SWA::CShadowMapCameraLiSPSM
|
||||
{
|
||||
memcpy(base + camera, findResult->second.shadowMap.camera, sizeof(findResult->second.shadowMap.camera));
|
||||
PPC_STORE_U32(job + 0x80, camera);
|
||||
PPC_STORE_U8(job + 0x44, findResult->second.shadowMap.field44);
|
||||
PPC_STORE_U8(job + 0xA0, findResult->second.shadowMap.fieldA0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5685,7 +5907,21 @@ PPC_FUNC(sub_8258CAE0)
|
||||
}
|
||||
|
||||
__imp__sub_8258CAE0(ctx, base);
|
||||
}
|
||||
|
||||
PPC_FUNC_IMPL(__imp__sub_824EB5B0);
|
||||
PPC_FUNC(sub_824EB5B0)
|
||||
{
|
||||
g_updateDirectorProfiler.Begin();
|
||||
__imp__sub_824EB5B0(ctx, base);
|
||||
g_updateDirectorProfiler.End();
|
||||
}
|
||||
|
||||
PPC_FUNC_IMPL(__imp__sub_824EB290);
|
||||
PPC_FUNC(sub_824EB290)
|
||||
{
|
||||
g_renderDirectorProfiler.Begin();
|
||||
__imp__sub_824EB290(ctx, base);
|
||||
g_renderDirectorProfiler.End();
|
||||
}
|
||||
|
||||
@@ -6599,6 +6835,13 @@ void GetDatabaseDataMidAsmHook(PPCRegister& r1, PPCRegister& r4)
|
||||
|
||||
if (isParticleModel)
|
||||
return;
|
||||
|
||||
// Adabat water is broken in original game, which they tried to fix by partially including the files in the update,
|
||||
// which then finally fixed for real in the DLC. This confuses the async PSO compiler and causes a hang if the DLC is missing.
|
||||
// We'll just ignore it.
|
||||
bool isAdabatWater = strcmp(databaseData->m_TypeAndName.c_str() + 2, "evl_sea_obj_st_waterCircle") == 0;
|
||||
if (isAdabatWater)
|
||||
return;
|
||||
}
|
||||
|
||||
databaseData->m_Flags |= eDatabaseDataFlags_CompilingPipelines;
|
||||
@@ -7187,6 +7430,187 @@ bool FxShadowMapMidAsmHook(PPCRegister& r4, PPCRegister& r5, PPCRegister& r6, PP
|
||||
}
|
||||
}
|
||||
|
||||
// There is a bug on AMD where restart indices cause incorrect culling and prevent some triangles from being rendered.
|
||||
// This seems to happen on both Windows AMD drivers and Mesa. Converting restart indices to degenerate triangles fixes it.
|
||||
static void ConvertToDegenerateTriangles(uint16_t* indices, uint32_t indexCount, uint16_t*& newIndices, uint32_t& newIndexCount)
|
||||
{
|
||||
newIndices = reinterpret_cast<uint16_t*>(g_userHeap.Alloc(indexCount * sizeof(uint16_t) * 3));
|
||||
newIndexCount = 0;
|
||||
|
||||
bool stripStart = true;
|
||||
uint32_t stripSize = 0;
|
||||
uint16_t lastIndex = 0;
|
||||
|
||||
for (uint32_t i = 0; i < indexCount; i++)
|
||||
{
|
||||
uint16_t index = indices[i];
|
||||
if (index == 0xFFFF)
|
||||
{
|
||||
if ((stripSize % 2) != 0)
|
||||
newIndices[newIndexCount++] = lastIndex;
|
||||
|
||||
stripStart = true;
|
||||
stripSize = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stripStart && newIndexCount != 0)
|
||||
{
|
||||
newIndices[newIndexCount++] = lastIndex;
|
||||
newIndices[newIndexCount++] = index;
|
||||
}
|
||||
|
||||
newIndices[newIndexCount++] = index;
|
||||
stripStart = false;
|
||||
++stripSize;
|
||||
lastIndex = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MeshResource
|
||||
{
|
||||
SWA_INSERT_PADDING(0x4);
|
||||
be<uint32_t> indexCount;
|
||||
be<uint32_t> indices;
|
||||
};
|
||||
|
||||
static std::vector<uint16_t*> g_newIndicesToFree;
|
||||
|
||||
// Hedgehog::Mirage::CMeshData::Make
|
||||
PPC_FUNC_IMPL(__imp__sub_82E44AF8);
|
||||
PPC_FUNC(sub_82E44AF8)
|
||||
{
|
||||
uint16_t* newIndicesToFree = nullptr;
|
||||
|
||||
auto databaseData = reinterpret_cast<Hedgehog::Database::CDatabaseData*>(base + ctx.r3.u32);
|
||||
if (g_triangleStripWorkaround && !databaseData->IsMadeOne())
|
||||
{
|
||||
auto meshResource = reinterpret_cast<MeshResource*>(base + ctx.r4.u32);
|
||||
|
||||
if (meshResource->indexCount != 0)
|
||||
{
|
||||
uint16_t* newIndices;
|
||||
uint32_t newIndexCount;
|
||||
|
||||
ConvertToDegenerateTriangles(
|
||||
reinterpret_cast<uint16_t*>(base + meshResource->indices),
|
||||
meshResource->indexCount,
|
||||
newIndices,
|
||||
newIndexCount);
|
||||
|
||||
meshResource->indexCount = newIndexCount;
|
||||
meshResource->indices = static_cast<uint32_t>(reinterpret_cast<uint8_t*>(newIndices) - base);
|
||||
|
||||
if (PPC_LOAD_U32(0x83396E98) != NULL)
|
||||
{
|
||||
// If index buffers are getting merged, new indices need to survive until the merge happens.
|
||||
g_newIndicesToFree.push_back(newIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, we can free it immediately.
|
||||
newIndicesToFree = newIndices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__imp__sub_82E44AF8(ctx, base);
|
||||
|
||||
if (newIndicesToFree != nullptr)
|
||||
g_userHeap.Free(newIndicesToFree);
|
||||
}
|
||||
|
||||
// Hedgehog::Mirage::CShareVertexBuffer::Reset
|
||||
PPC_FUNC_IMPL(__imp__sub_82E250D0);
|
||||
PPC_FUNC(sub_82E250D0)
|
||||
{
|
||||
__imp__sub_82E250D0(ctx, base);
|
||||
|
||||
for (auto newIndicesToFree : g_newIndicesToFree)
|
||||
g_userHeap.Free(newIndicesToFree);
|
||||
|
||||
g_newIndicesToFree.clear();
|
||||
}
|
||||
|
||||
struct LightAndIndexBufferResourceV1
|
||||
{
|
||||
SWA_INSERT_PADDING(0x4);
|
||||
be<uint32_t> indexCount;
|
||||
be<uint32_t> indices;
|
||||
};
|
||||
|
||||
// Hedgehog::Mirage::CLightAndIndexBufferData::MakeV1
|
||||
PPC_FUNC_IMPL(__imp__sub_82E3AFC8);
|
||||
PPC_FUNC(sub_82E3AFC8)
|
||||
{
|
||||
uint16_t* newIndices = nullptr;
|
||||
|
||||
auto databaseData = reinterpret_cast<Hedgehog::Database::CDatabaseData*>(base + ctx.r3.u32);
|
||||
if (g_triangleStripWorkaround && !databaseData->IsMadeOne())
|
||||
{
|
||||
auto lightAndIndexBufferResource = reinterpret_cast<LightAndIndexBufferResourceV1*>(base + ctx.r4.u32);
|
||||
|
||||
if (lightAndIndexBufferResource->indexCount != 0)
|
||||
{
|
||||
uint32_t newIndexCount;
|
||||
|
||||
ConvertToDegenerateTriangles(
|
||||
reinterpret_cast<uint16_t*>(base + lightAndIndexBufferResource->indices),
|
||||
lightAndIndexBufferResource->indexCount,
|
||||
newIndices,
|
||||
newIndexCount);
|
||||
|
||||
lightAndIndexBufferResource->indexCount = newIndexCount;
|
||||
lightAndIndexBufferResource->indices = static_cast<uint32_t>(reinterpret_cast<uint8_t*>(newIndices) - base);
|
||||
}
|
||||
}
|
||||
|
||||
__imp__sub_82E3AFC8(ctx, base);
|
||||
|
||||
if (newIndices != nullptr)
|
||||
g_userHeap.Free(newIndices);
|
||||
}
|
||||
|
||||
struct LightAndIndexBufferResourceV5
|
||||
{
|
||||
SWA_INSERT_PADDING(0x8);
|
||||
be<uint32_t> indexCount;
|
||||
be<uint32_t> indices;
|
||||
};
|
||||
|
||||
// Hedgehog::Mirage::CLightAndIndexBufferData::MakeV5
|
||||
PPC_FUNC_IMPL(__imp__sub_82E3B1C0);
|
||||
PPC_FUNC(sub_82E3B1C0)
|
||||
{
|
||||
uint16_t* newIndices = nullptr;
|
||||
|
||||
auto databaseData = reinterpret_cast<Hedgehog::Database::CDatabaseData*>(base + ctx.r3.u32);
|
||||
if (g_triangleStripWorkaround && !databaseData->IsMadeOne())
|
||||
{
|
||||
auto lightAndIndexBufferResource = reinterpret_cast<LightAndIndexBufferResourceV5*>(base + ctx.r4.u32);
|
||||
|
||||
if (lightAndIndexBufferResource->indexCount != 0)
|
||||
{
|
||||
uint32_t newIndexCount;
|
||||
|
||||
ConvertToDegenerateTriangles(
|
||||
reinterpret_cast<uint16_t*>(base + lightAndIndexBufferResource->indices),
|
||||
lightAndIndexBufferResource->indexCount,
|
||||
newIndices,
|
||||
newIndexCount);
|
||||
|
||||
lightAndIndexBufferResource->indexCount = newIndexCount;
|
||||
lightAndIndexBufferResource->indices = static_cast<uint32_t>(reinterpret_cast<uint8_t*>(newIndices) - base);
|
||||
}
|
||||
}
|
||||
|
||||
__imp__sub_82E3B1C0(ctx, base);
|
||||
|
||||
if (newIndices != nullptr)
|
||||
g_userHeap.Free(newIndices);
|
||||
}
|
||||
|
||||
GUEST_FUNCTION_HOOK(sub_82BD99B0, CreateDevice);
|
||||
|
||||
GUEST_FUNCTION_HOOK(sub_82BE6230, DestructResource);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
//#define ASYNC_PSO_DEBUG
|
||||
#define PSO_CACHING
|
||||
/////////////////////////////////////////////////////////////////////#define PSO_CACHING
|
||||
//#define PSO_CACHING_CLEANUP
|
||||
|
||||
#include "rhi/plume_render_interface.h"
|
||||
|
||||
@@ -7,10 +7,14 @@ hid::EInputDevice hid::g_inputDeviceController;
|
||||
hid::EInputDeviceExplicit hid::g_inputDeviceExplicit;
|
||||
|
||||
uint16_t hid::g_prohibitedButtons;
|
||||
bool hid::g_isLeftStickProhibited;
|
||||
bool hid::g_isRightStickProhibited;
|
||||
|
||||
void hid::SetProhibitedButtons(uint16_t wButtons)
|
||||
void hid::SetProhibitedInputs(uint16_t wButtons, bool leftStick, bool rightStick)
|
||||
{
|
||||
hid::g_prohibitedButtons = wButtons;
|
||||
hid::g_isLeftStickProhibited = leftStick;
|
||||
hid::g_isRightStickProhibited = rightStick;
|
||||
}
|
||||
|
||||
bool hid::IsInputAllowed()
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace hid
|
||||
extern EInputDeviceExplicit g_inputDeviceExplicit;
|
||||
|
||||
extern uint16_t g_prohibitedButtons;
|
||||
extern bool g_isLeftStickProhibited;
|
||||
extern bool g_isRightStickProhibited;
|
||||
|
||||
void Init();
|
||||
|
||||
@@ -40,7 +42,7 @@ namespace hid
|
||||
uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration);
|
||||
uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps);
|
||||
|
||||
void SetProhibitedButtons(uint16_t wButtons);
|
||||
void SetProhibitedInputs(uint16_t wButtons = 0, bool leftStick = false, bool rightStick = false);
|
||||
bool IsInputAllowed();
|
||||
bool IsInputDeviceController();
|
||||
std::string GetInputDeviceName();
|
||||
|
||||
@@ -5321,6 +5321,7 @@ const uint64_t GameHashes[] = {
|
||||
10073206724900292034ULL,
|
||||
13849076872517480735ULL,
|
||||
18429668117940514005ULL,
|
||||
14872142036681345494ULL,
|
||||
7440489770734063325ULL,
|
||||
1423900708842059394ULL,
|
||||
7094898889553293067ULL,
|
||||
@@ -8340,7 +8341,7 @@ const std::pair<const char *, uint32_t> GameFiles[] = {
|
||||
{ "Town_SouthEastAsia_Night.arl", 2 },
|
||||
{ "WorldMap.ar.00", 2 },
|
||||
{ "WorldMap.arl", 2 },
|
||||
{ "default.xex", 3 },
|
||||
{ "default.xex", 4 },
|
||||
{ "movie/CHN.sfd", 1 },
|
||||
{ "movie/HedgehogEngine_logo.sfd", 1 },
|
||||
{ "movie/Inspire/ex00_movie.sfd", 1 },
|
||||
|
||||
@@ -10,6 +10,7 @@ const uint64_t UpdateHashes[] = {
|
||||
6914273463875662709ULL,
|
||||
15542186142639918255ULL,
|
||||
17773094197787397017ULL,
|
||||
4145621795357905881ULL,
|
||||
5694064368761413534ULL,
|
||||
10660633045276223515ULL,
|
||||
6259845327508088719ULL,
|
||||
@@ -48,7 +49,7 @@ const uint64_t UpdateHashes[] = {
|
||||
};
|
||||
|
||||
const std::pair<const char *, uint32_t> UpdateFiles[] = {
|
||||
{ "default.xexp", 3 },
|
||||
{ "default.xexp", 4 },
|
||||
{ "work/ActD_MykonosAct1/Base.set.xml", 1 },
|
||||
{ "work/ActD_NY/Mission_NYCity_S20_10.set.xml", 1 },
|
||||
{ "work/ActD_SubEU_01/Set2.set.xml", 1 },
|
||||
|
||||
@@ -598,5 +598,5 @@ XexPatcher::Result Installer::checkGameUpdateCompatibility(const std::filesystem
|
||||
}
|
||||
|
||||
std::vector<uint8_t> patchedBytes;
|
||||
return XexPatcher::apply(xexBytes, patchBytes, patchedBytes, true);
|
||||
return XexPatcher::apply(xexBytes.data(), xexBytes.size(), patchBytes.data(), patchBytes.size(), patchedBytes, true);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <set>
|
||||
|
||||
#include "virtual_file_system.h"
|
||||
#include "xex_patcher.h"
|
||||
#include <xex_patcher.h>
|
||||
|
||||
enum class DLC {
|
||||
Unknown,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "virtual_file_system.h"
|
||||
|
||||
#include "memory_mapped_file.h"
|
||||
#include <memory_mapped_file.h>
|
||||
|
||||
struct ISOFileSystem : VirtualFileSystem
|
||||
{
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
#include "memory_mapped_file.h"
|
||||
|
||||
#if !defined(_WIN32)
|
||||
# include <cstring>
|
||||
# include <cstdio>
|
||||
# include <fcntl.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
MemoryMappedFile::MemoryMappedFile()
|
||||
{
|
||||
// Default constructor.
|
||||
}
|
||||
|
||||
MemoryMappedFile::MemoryMappedFile(const std::filesystem::path &path)
|
||||
{
|
||||
open(path);
|
||||
}
|
||||
|
||||
MemoryMappedFile::~MemoryMappedFile()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
MemoryMappedFile::MemoryMappedFile(MemoryMappedFile &&other)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
fileHandle = other.fileHandle;
|
||||
fileMappingHandle = other.fileMappingHandle;
|
||||
fileView = other.fileView;
|
||||
fileSize = other.fileSize;
|
||||
|
||||
other.fileHandle = nullptr;
|
||||
other.fileMappingHandle = nullptr;
|
||||
other.fileView = nullptr;
|
||||
other.fileSize.QuadPart = 0;
|
||||
#else
|
||||
fileHandle = other.fileHandle;
|
||||
fileView = other.fileView;
|
||||
fileSize = other.fileSize;
|
||||
|
||||
other.fileHandle = -1;
|
||||
other.fileView = MAP_FAILED;
|
||||
other.fileSize = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool MemoryMappedFile::open(const std::filesystem::path &path)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
fileHandle = CreateFileW(path.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (fileHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
fprintf(stderr, "CreateFileW failed with error %lu.\n", GetLastError());
|
||||
fileHandle = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetFileSizeEx(fileHandle, &fileSize))
|
||||
{
|
||||
fprintf(stderr, "GetFileSizeEx failed with error %lu.\n", GetLastError());
|
||||
CloseHandle(fileHandle);
|
||||
fileHandle = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
fileMappingHandle = CreateFileMappingW(fileHandle, nullptr, PAGE_READONLY, 0, 0, nullptr);
|
||||
if (fileMappingHandle == nullptr)
|
||||
{
|
||||
fprintf(stderr, "CreateFileMappingW failed with error %lu.\n", GetLastError());
|
||||
CloseHandle(fileHandle);
|
||||
fileHandle = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
fileView = MapViewOfFile(fileMappingHandle, FILE_MAP_READ, 0, 0, 0);
|
||||
if (fileView == nullptr)
|
||||
{
|
||||
fprintf(stderr, "MapViewOfFile failed with error %lu.\n", GetLastError());
|
||||
CloseHandle(fileMappingHandle);
|
||||
CloseHandle(fileHandle);
|
||||
fileMappingHandle = nullptr;
|
||||
fileHandle = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
fileHandle = ::open(path.c_str(), O_RDONLY);
|
||||
if (fileHandle == -1)
|
||||
{
|
||||
fprintf(stderr, "open for %s failed with error %s.\n", path.c_str(), strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
fileSize = lseek(fileHandle, 0, SEEK_END);
|
||||
if (fileSize == (off_t)(-1))
|
||||
{
|
||||
fprintf(stderr, "lseek failed with error %s.\n", strerror(errno));
|
||||
::close(fileHandle);
|
||||
fileHandle = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
fileView = mmap(nullptr, fileSize, PROT_READ, MAP_PRIVATE, fileHandle, 0);
|
||||
if (fileView == MAP_FAILED)
|
||||
{
|
||||
fprintf(stderr, "mmap failed with error %s.\n", strerror(errno));
|
||||
::close(fileHandle);
|
||||
fileHandle = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MemoryMappedFile::close()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if (fileView != nullptr)
|
||||
{
|
||||
UnmapViewOfFile(fileView);
|
||||
}
|
||||
|
||||
if (fileMappingHandle != nullptr)
|
||||
{
|
||||
CloseHandle(fileMappingHandle);
|
||||
}
|
||||
|
||||
if (fileHandle != nullptr)
|
||||
{
|
||||
CloseHandle(fileHandle);
|
||||
}
|
||||
#else
|
||||
if (fileView != MAP_FAILED)
|
||||
{
|
||||
munmap(fileView, fileSize);
|
||||
}
|
||||
|
||||
if (fileHandle != -1)
|
||||
{
|
||||
::close(fileHandle);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool MemoryMappedFile::isOpen() const
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return (fileView != nullptr);
|
||||
#else
|
||||
return (fileView != MAP_FAILED);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t *MemoryMappedFile::data() const
|
||||
{
|
||||
return reinterpret_cast<uint8_t *>(fileView);
|
||||
}
|
||||
|
||||
size_t MemoryMappedFile::size() const
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return fileSize.QuadPart;
|
||||
#else
|
||||
return static_cast<size_t>(fileSize);
|
||||
#endif
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <Windows.h>
|
||||
#else
|
||||
# include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
struct MemoryMappedFile {
|
||||
#if defined(_WIN32)
|
||||
HANDLE fileHandle = nullptr;
|
||||
HANDLE fileMappingHandle = nullptr;
|
||||
LPVOID fileView = nullptr;
|
||||
LARGE_INTEGER fileSize = {};
|
||||
#else
|
||||
int fileHandle = -1;
|
||||
void *fileView = MAP_FAILED;
|
||||
off_t fileSize = 0;
|
||||
#endif
|
||||
|
||||
MemoryMappedFile();
|
||||
MemoryMappedFile(const std::filesystem::path &path);
|
||||
MemoryMappedFile(MemoryMappedFile &&other);
|
||||
~MemoryMappedFile();
|
||||
bool open(const std::filesystem::path &path);
|
||||
void close();
|
||||
bool isOpen() const;
|
||||
uint8_t *data() const;
|
||||
size_t size() const;
|
||||
};
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#include <os/logger.h>
|
||||
|
||||
// UpdateChecker
|
||||
|
||||
using json = nlohmann::json;
|
||||
@@ -52,7 +54,7 @@ static bool parseVersion(const std::string &versionStr, int &major, int &minor,
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
fmt::println("Error while parsing version: {}.", e.what());
|
||||
LOGF_ERROR("Error while parsing version: {}.", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,25 +95,25 @@ void updateCheckerThread()
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt::println("Error while parsing response: tag_name does not contain a valid version string.");
|
||||
LOG_ERROR("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.");
|
||||
LOG_ERROR("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());
|
||||
LOGF_ERROR("Error while parsing response: {}", e.what());
|
||||
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt::println("Error while performing request: {}", curl_easy_strerror(res));
|
||||
LOGF_ERROR("Error while performing request: {}", curl_easy_strerror(res));
|
||||
g_updateCheckerResult = UpdateChecker::Result::Failed;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "virtual_file_system.h"
|
||||
|
||||
#include "memory_mapped_file.h"
|
||||
#include <memory_mapped_file.h>
|
||||
|
||||
enum class XContentVolumeType
|
||||
{
|
||||
|
||||
@@ -1,693 +0,0 @@
|
||||
// Referenced from: https://github.com/xenia-canary/xenia-canary/blob/canary_experimental/src/xenia/cpu/xex_module.cc
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2023 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "xex_patcher.h"
|
||||
|
||||
#include <bit>
|
||||
#include <cassert>
|
||||
|
||||
#include <aes.hpp>
|
||||
#include <lzx.h>
|
||||
#include <mspack.h>
|
||||
#include <TinySHA1.hpp>
|
||||
|
||||
#include "memory_mapped_file.h"
|
||||
|
||||
enum Xex2ModuleFlags
|
||||
{
|
||||
XEX_MODULE_MODULE_PATCH = 0x10,
|
||||
XEX_MODULE_PATCH_FULL = 0x20,
|
||||
XEX_MODULE_PATCH_DELTA = 0x40,
|
||||
};
|
||||
|
||||
enum Xex2HeaderKeys
|
||||
{
|
||||
XEX_HEADER_FILE_FORMAT_INFO = 0x3FF,
|
||||
XEX_HEADER_DELTA_PATCH_DESCRIPTOR = 0x5FF,
|
||||
};
|
||||
|
||||
enum Xex2EncryptionType
|
||||
{
|
||||
XEX_ENCRYPTION_NONE = 0,
|
||||
XEX_ENCRYPTION_NORMAL = 1,
|
||||
};
|
||||
|
||||
enum Xex2CompressionType
|
||||
{
|
||||
XEX_COMPRESSION_NONE = 0,
|
||||
XEX_COMPRESSION_BASIC = 1,
|
||||
XEX_COMPRESSION_NORMAL = 2,
|
||||
XEX_COMPRESSION_DELTA = 3,
|
||||
};
|
||||
|
||||
enum Xex2SectionType
|
||||
{
|
||||
XEX_SECTION_CODE = 1,
|
||||
XEX_SECTION_DATA = 2,
|
||||
XEX_SECTION_READONLY_DATA = 3,
|
||||
};
|
||||
|
||||
struct Xex2OptHeader
|
||||
{
|
||||
be<uint32_t> key;
|
||||
|
||||
union
|
||||
{
|
||||
be<uint32_t> value;
|
||||
be<uint32_t> offset;
|
||||
};
|
||||
};
|
||||
|
||||
struct Xex2Header
|
||||
{
|
||||
be<uint32_t> magic;
|
||||
be<uint32_t> moduleFlags;
|
||||
be<uint32_t> headerSize;
|
||||
be<uint32_t> reserved;
|
||||
be<uint32_t> securityOffset;
|
||||
be<uint32_t> headerCount;
|
||||
Xex2OptHeader headers[1];
|
||||
};
|
||||
|
||||
struct Xex2PageDescriptor
|
||||
{
|
||||
union
|
||||
{
|
||||
// Must be endian-swapped before reading the bitfield.
|
||||
uint32_t beValue;
|
||||
struct
|
||||
{
|
||||
uint32_t info : 4;
|
||||
uint32_t pageCount : 28;
|
||||
};
|
||||
};
|
||||
|
||||
char dataDigest[0x14];
|
||||
};
|
||||
|
||||
struct Xex2SecurityInfo
|
||||
{
|
||||
be<uint32_t> headerSize;
|
||||
be<uint32_t> imageSize;
|
||||
char rsaSignature[0x100];
|
||||
be<uint32_t> unknown;
|
||||
be<uint32_t> imageFlags;
|
||||
be<uint32_t> loadAddress;
|
||||
char sectionDigest[0x14];
|
||||
be<uint32_t> importTableCount;
|
||||
char importTableDigest[0x14];
|
||||
char xgd2MediaId[0x10];
|
||||
char aesKey[0x10];
|
||||
be<uint32_t> exportTable;
|
||||
char headerDigest[0x14];
|
||||
be<uint32_t> region;
|
||||
be<uint32_t> allowedMediaTypes;
|
||||
be<uint32_t> pageDescriptorCount;
|
||||
Xex2PageDescriptor pageDescriptors[1];
|
||||
};
|
||||
|
||||
struct Xex2DeltaPatch
|
||||
{
|
||||
be<uint32_t> oldAddress;
|
||||
be<uint32_t> newAddress;
|
||||
be<uint16_t> uncompressedLength;
|
||||
be<uint16_t> compressedLength;
|
||||
char patchData[1];
|
||||
};
|
||||
|
||||
struct Xex2OptDeltaPatchDescriptor
|
||||
{
|
||||
be<uint32_t> size;
|
||||
be<uint32_t> targetVersionValue;
|
||||
be<uint32_t> sourceVersionValue;
|
||||
uint8_t digestSource[0x14];
|
||||
uint8_t imageKeySource[0x10];
|
||||
be<uint32_t> sizeOfTargetHeaders;
|
||||
be<uint32_t> deltaHeadersSourceOffset;
|
||||
be<uint32_t> deltaHeadersSourceSize;
|
||||
be<uint32_t> deltaHeadersTargetOffset;
|
||||
be<uint32_t> deltaImageSourceOffset;
|
||||
be<uint32_t> deltaImageSourceSize;
|
||||
be<uint32_t> deltaImageTargetOffset;
|
||||
Xex2DeltaPatch info;
|
||||
};
|
||||
|
||||
struct Xex2FileBasicCompressionBlock
|
||||
{
|
||||
be<uint32_t> dataSize;
|
||||
be<uint32_t> zeroSize;
|
||||
};
|
||||
|
||||
struct Xex2FileBasicCompressionInfo
|
||||
{
|
||||
Xex2FileBasicCompressionBlock firstBlock;
|
||||
};
|
||||
|
||||
struct Xex2CompressedBlockInfo
|
||||
{
|
||||
be<uint32_t> blockSize;
|
||||
uint8_t blockHash[20];
|
||||
};
|
||||
|
||||
struct Xex2FileNormalCompressionInfo
|
||||
{
|
||||
be<uint32_t> windowSize;
|
||||
Xex2CompressedBlockInfo firstBlock;
|
||||
};
|
||||
|
||||
struct Xex2OptFileFormatInfo
|
||||
{
|
||||
be<uint32_t> infoSize;
|
||||
be<uint16_t> encryptionType;
|
||||
be<uint16_t> compressionType;
|
||||
union
|
||||
{
|
||||
Xex2FileBasicCompressionInfo basic;
|
||||
Xex2FileNormalCompressionInfo normal;
|
||||
} compressionInfo;
|
||||
};
|
||||
|
||||
static const void *getOptHeaderPtr(std::span<const uint8_t> moduleBytes, uint32_t headerKey)
|
||||
{
|
||||
if ((headerKey & 0xFF) == 0)
|
||||
{
|
||||
assert(false && "Wrong type of method for this key. Expected return value is a number.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const Xex2Header *xex2Header = (const Xex2Header *)(moduleBytes.data());
|
||||
for (uint32_t i = 0; i < xex2Header->headerCount; i++)
|
||||
{
|
||||
const Xex2OptHeader &optHeader = xex2Header->headers[i];
|
||||
if (optHeader.key == headerKey)
|
||||
{
|
||||
if ((headerKey & 0xFF) == 1)
|
||||
{
|
||||
return &optHeader.value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return &moduleBytes.data()[optHeader.offset];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
struct mspack_memory_file
|
||||
{
|
||||
mspack_system sys;
|
||||
void *buffer;
|
||||
size_t bufferSize;
|
||||
size_t offset;
|
||||
};
|
||||
|
||||
static mspack_memory_file *mspack_memory_open(mspack_system *sys, void *buffer, size_t bufferSize)
|
||||
{
|
||||
assert(bufferSize < INT_MAX);
|
||||
|
||||
if (bufferSize >= INT_MAX)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
mspack_memory_file *memoryFile = (mspack_memory_file *)(std::calloc(1, sizeof(mspack_memory_file)));
|
||||
if (memoryFile == nullptr)
|
||||
{
|
||||
return memoryFile;
|
||||
}
|
||||
|
||||
memoryFile->buffer = buffer;
|
||||
memoryFile->bufferSize = bufferSize;
|
||||
memoryFile->offset = 0;
|
||||
return memoryFile;
|
||||
}
|
||||
|
||||
static void mspack_memory_close(mspack_memory_file *file)
|
||||
{
|
||||
std::free(file);
|
||||
}
|
||||
|
||||
static int mspack_memory_read(mspack_file *file, void *buffer, int chars)
|
||||
{
|
||||
mspack_memory_file *memoryFile = (mspack_memory_file *)(file);
|
||||
const size_t remaining = memoryFile->bufferSize - memoryFile->offset;
|
||||
const size_t total = std::min(size_t(chars), remaining);
|
||||
std::memcpy(buffer, (uint8_t *)(memoryFile->buffer) + memoryFile->offset, total);
|
||||
memoryFile->offset += total;
|
||||
return int(total);
|
||||
}
|
||||
|
||||
static int mspack_memory_write(mspack_file *file, void *buffer, int chars)
|
||||
{
|
||||
mspack_memory_file *memoryFile = (mspack_memory_file *)(file);
|
||||
const size_t remaining = memoryFile->bufferSize - memoryFile->offset;
|
||||
const size_t total = std::min(size_t(chars), remaining);
|
||||
std::memcpy((uint8_t *)(memoryFile->buffer) + memoryFile->offset, buffer, total);
|
||||
memoryFile->offset += total;
|
||||
return int(total);
|
||||
}
|
||||
|
||||
static void *mspack_memory_alloc(mspack_system *sys, size_t chars)
|
||||
{
|
||||
return std::calloc(chars, 1);
|
||||
}
|
||||
|
||||
static void mspack_memory_free(void *ptr)
|
||||
{
|
||||
std::free(ptr);
|
||||
}
|
||||
|
||||
static void mspack_memory_copy(void *src, void *dest, size_t chars)
|
||||
{
|
||||
std::memcpy(dest, src, chars);
|
||||
}
|
||||
|
||||
static mspack_system *mspack_memory_sys_create()
|
||||
{
|
||||
auto sys = (mspack_system *)(std::calloc(1, sizeof(mspack_system)));
|
||||
if (!sys)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sys->read = mspack_memory_read;
|
||||
sys->write = mspack_memory_write;
|
||||
sys->alloc = mspack_memory_alloc;
|
||||
sys->free = mspack_memory_free;
|
||||
sys->copy = mspack_memory_copy;
|
||||
return sys;
|
||||
}
|
||||
|
||||
static void mspack_memory_sys_destroy(struct mspack_system *sys)
|
||||
{
|
||||
free(sys);
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
inline bool bitScanForward(uint32_t v, uint32_t *outFirstSetIndex)
|
||||
{
|
||||
return _BitScanForward((unsigned long *)(outFirstSetIndex), v) != 0;
|
||||
}
|
||||
|
||||
inline bool bitScanForward(uint64_t v, uint32_t *outFirstSetIndex)
|
||||
{
|
||||
return _BitScanForward64((unsigned long *)(outFirstSetIndex), v) != 0;
|
||||
}
|
||||
|
||||
#else
|
||||
inline bool bitScanForward(uint32_t v, uint32_t *outFirstSetIndex)
|
||||
{
|
||||
int i = ffs(v);
|
||||
*outFirstSetIndex = i - 1;
|
||||
return i != 0;
|
||||
}
|
||||
|
||||
inline bool bitScanForward(uint64_t v, uint32_t *outFirstSetIndex)
|
||||
{
|
||||
int i = __builtin_ffsll(v);
|
||||
*outFirstSetIndex = i - 1;
|
||||
return i != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int lzxDecompress(const void *lzxData, size_t lzxLength, void *dst, size_t dstLength, uint32_t windowSize, void *windowData, size_t windowDataLength)
|
||||
{
|
||||
int resultCode = 1;
|
||||
uint32_t windowBits;
|
||||
if (!bitScanForward(windowSize, &windowBits)) {
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
mspack_system *sys = mspack_memory_sys_create();
|
||||
mspack_memory_file *lzxSrc = mspack_memory_open(sys, (void *)(lzxData), lzxLength);
|
||||
mspack_memory_file *lzxDst = mspack_memory_open(sys, dst, dstLength);
|
||||
lzxd_stream *lzxd = lzxd_init(sys, (mspack_file *)(lzxSrc), (mspack_file *)(lzxDst), windowBits, 0, 0x8000, dstLength, 0);
|
||||
if (lzxd != nullptr) {
|
||||
if (windowData != nullptr) {
|
||||
size_t paddingLength = windowSize - windowDataLength;
|
||||
std::memset(&lzxd->window[0], 0, paddingLength);
|
||||
std::memcpy(&lzxd->window[paddingLength], windowData, windowDataLength);
|
||||
lzxd->ref_data_size = windowSize;
|
||||
}
|
||||
|
||||
resultCode = lzxd_decompress(lzxd, dstLength);
|
||||
lzxd_free(lzxd);
|
||||
}
|
||||
|
||||
if (lzxSrc) {
|
||||
mspack_memory_close(lzxSrc);
|
||||
}
|
||||
|
||||
if (lzxDst) {
|
||||
mspack_memory_close(lzxDst);
|
||||
}
|
||||
|
||||
if (sys) {
|
||||
mspack_memory_sys_destroy(sys);
|
||||
}
|
||||
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
static int lzxDeltaApplyPatch(const Xex2DeltaPatch *deltaPatch, uint32_t patchLength, uint32_t windowSize, uint8_t *dstData)
|
||||
{
|
||||
const void *patchEnd = (const uint8_t *)(deltaPatch) + patchLength;
|
||||
const Xex2DeltaPatch *curPatch = deltaPatch;
|
||||
while (patchEnd > curPatch)
|
||||
{
|
||||
int patchSize = -4;
|
||||
if (curPatch->compressedLength == 0 && curPatch->uncompressedLength == 0 && curPatch->newAddress == 0 && curPatch->oldAddress == 0)
|
||||
{
|
||||
// End of patch.
|
||||
break;
|
||||
}
|
||||
|
||||
switch (curPatch->compressedLength)
|
||||
{
|
||||
case 0:
|
||||
// Set the data to zeroes.
|
||||
std::memset(&dstData[curPatch->newAddress], 0, curPatch->uncompressedLength);
|
||||
break;
|
||||
case 1:
|
||||
// Move the data.
|
||||
std::memcpy(&dstData[curPatch->newAddress], &dstData[curPatch->oldAddress], curPatch->uncompressedLength);
|
||||
break;
|
||||
default:
|
||||
// Decompress the data into the destination.
|
||||
patchSize = curPatch->compressedLength - 4;
|
||||
int result = lzxDecompress(curPatch->patchData, curPatch->compressedLength, &dstData[curPatch->newAddress], curPatch->uncompressedLength, windowSize, &dstData[curPatch->oldAddress], curPatch->uncompressedLength);
|
||||
if (result != 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
curPatch++;
|
||||
curPatch = (const Xex2DeltaPatch *)((const uint8_t *)(curPatch) + patchSize);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
XexPatcher::Result XexPatcher::apply(std::span<const uint8_t> xexBytes, std::span<const uint8_t> patchBytes, std::vector<uint8_t> &outBytes, bool skipData)
|
||||
{
|
||||
// Validate headers.
|
||||
static const char Xex2Magic[] = "XEX2";
|
||||
const Xex2Header *xexHeader = (const Xex2Header *)(xexBytes.data());
|
||||
if (memcmp(xexBytes.data(), Xex2Magic, 4) != 0)
|
||||
{
|
||||
return Result::XexFileInvalid;
|
||||
}
|
||||
|
||||
const Xex2Header *patchHeader = (const Xex2Header *)(patchBytes.data());
|
||||
if (memcmp(patchBytes.data(), Xex2Magic, 4) != 0)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
if ((patchHeader->moduleFlags & (XEX_MODULE_MODULE_PATCH | XEX_MODULE_PATCH_DELTA | XEX_MODULE_PATCH_FULL)) == 0)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
// Validate patch.
|
||||
const Xex2OptDeltaPatchDescriptor *patchDescriptor = (const Xex2OptDeltaPatchDescriptor *)(getOptHeaderPtr(patchBytes, XEX_HEADER_DELTA_PATCH_DESCRIPTOR));
|
||||
if (patchDescriptor == nullptr)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
const Xex2OptFileFormatInfo *patchFileFormatInfo = (const Xex2OptFileFormatInfo *)(getOptHeaderPtr(patchBytes, XEX_HEADER_FILE_FORMAT_INFO));
|
||||
if (patchFileFormatInfo == nullptr)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
if (patchFileFormatInfo->compressionType != XEX_COMPRESSION_DELTA)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
if (patchDescriptor->deltaHeadersSourceOffset > xexHeader->headerSize)
|
||||
{
|
||||
return Result::PatchIncompatible;
|
||||
}
|
||||
|
||||
if (patchDescriptor->deltaHeadersSourceSize > (xexHeader->headerSize - patchDescriptor->deltaHeadersSourceOffset))
|
||||
{
|
||||
return Result::PatchIncompatible;
|
||||
}
|
||||
|
||||
if (patchDescriptor->deltaHeadersTargetOffset > patchDescriptor->sizeOfTargetHeaders)
|
||||
{
|
||||
return Result::PatchIncompatible;
|
||||
}
|
||||
|
||||
uint32_t deltaTargetSize = patchDescriptor->sizeOfTargetHeaders - patchDescriptor->deltaHeadersTargetOffset;
|
||||
if (patchDescriptor->deltaHeadersSourceSize > deltaTargetSize)
|
||||
{
|
||||
return Result::PatchIncompatible;
|
||||
}
|
||||
|
||||
// Apply patch.
|
||||
uint32_t headerTargetSize = patchDescriptor->sizeOfTargetHeaders;
|
||||
if (headerTargetSize == 0)
|
||||
{
|
||||
headerTargetSize = patchDescriptor->deltaHeadersTargetOffset + patchDescriptor->deltaHeadersSourceSize;
|
||||
}
|
||||
|
||||
// Create the bytes for the new XEX header. Copy over the existing data.
|
||||
uint32_t newXexHeaderSize = std::max(headerTargetSize, xexHeader->headerSize.get());
|
||||
outBytes.resize(newXexHeaderSize);
|
||||
memset(outBytes.data(), 0, newXexHeaderSize);
|
||||
memcpy(outBytes.data(), xexBytes.data(), headerTargetSize);
|
||||
|
||||
Xex2Header *newXexHeader = (Xex2Header *)(outBytes.data());
|
||||
if (patchDescriptor->deltaHeadersSourceOffset > 0)
|
||||
{
|
||||
memcpy(&outBytes[patchDescriptor->deltaHeadersTargetOffset], &outBytes[patchDescriptor->deltaHeadersSourceOffset], patchDescriptor->deltaHeadersSourceSize);
|
||||
}
|
||||
|
||||
int resultCode = lzxDeltaApplyPatch(&patchDescriptor->info, patchDescriptor->size, patchFileFormatInfo->compressionInfo.normal.windowSize, outBytes.data());
|
||||
if (resultCode != 0)
|
||||
{
|
||||
return Result::PatchFailed;
|
||||
}
|
||||
|
||||
// Make the header the specified size by the patch.
|
||||
outBytes.resize(headerTargetSize);
|
||||
newXexHeader = (Xex2Header *)(outBytes.data());
|
||||
|
||||
// Copy the rest of the data.
|
||||
const Xex2SecurityInfo *newSecurityInfo = (const Xex2SecurityInfo *)(&outBytes[newXexHeader->securityOffset]);
|
||||
outBytes.resize(outBytes.size() + newSecurityInfo->imageSize);
|
||||
memset(&outBytes[headerTargetSize], 0, outBytes.size() - headerTargetSize);
|
||||
memcpy(&outBytes[headerTargetSize], &xexBytes[xexHeader->headerSize], xexBytes.size() - xexHeader->headerSize);
|
||||
newXexHeader = (Xex2Header *)(outBytes.data());
|
||||
newSecurityInfo = (const Xex2SecurityInfo *)(&outBytes[newXexHeader->securityOffset]);
|
||||
|
||||
// Decrypt the keys and validate that the patch is compatible with the base file.
|
||||
static const uint32_t KeySize = 16;
|
||||
static const uint8_t Xex2RetailKey[16] = { 0x20, 0xB1, 0x85, 0xA5, 0x9D, 0x28, 0xFD, 0xC3, 0x40, 0x58, 0x3F, 0xBB, 0x08, 0x96, 0xBF, 0x91 };
|
||||
static const uint8_t AESBlankIV[AES_BLOCKLEN] = {};
|
||||
const Xex2SecurityInfo *originalSecurityInfo = (const Xex2SecurityInfo *)(&xexBytes[xexHeader->securityOffset]);
|
||||
const Xex2SecurityInfo *patchSecurityInfo = (const Xex2SecurityInfo *)(&patchBytes[patchHeader->securityOffset]);
|
||||
uint8_t decryptedOriginalKey[KeySize];
|
||||
uint8_t decryptedNewKey[KeySize];
|
||||
uint8_t decryptedPatchKey[KeySize];
|
||||
uint8_t decrpytedImageKeySource[KeySize];
|
||||
memcpy(decryptedOriginalKey, originalSecurityInfo->aesKey, KeySize);
|
||||
memcpy(decryptedNewKey, newSecurityInfo->aesKey, KeySize);
|
||||
memcpy(decryptedPatchKey, patchSecurityInfo->aesKey, KeySize);
|
||||
memcpy(decrpytedImageKeySource, patchDescriptor->imageKeySource, KeySize);
|
||||
|
||||
AES_ctx aesContext;
|
||||
AES_init_ctx_iv(&aesContext, Xex2RetailKey, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, decryptedOriginalKey, KeySize);
|
||||
|
||||
AES_ctx_set_iv(&aesContext, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, decryptedNewKey, KeySize);
|
||||
|
||||
AES_init_ctx_iv(&aesContext, decryptedNewKey, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, decryptedPatchKey, KeySize);
|
||||
|
||||
AES_ctx_set_iv(&aesContext, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, decrpytedImageKeySource, KeySize);
|
||||
|
||||
// Validate the patch's key matches the one from the original XEX.
|
||||
if (memcmp(decrpytedImageKeySource, decryptedOriginalKey, KeySize) != 0)
|
||||
{
|
||||
return Result::PatchIncompatible;
|
||||
}
|
||||
|
||||
// Don't process the rest of the patch.
|
||||
if (skipData)
|
||||
{
|
||||
return Result::Success;
|
||||
}
|
||||
|
||||
// Decrypt base XEX if necessary.
|
||||
const Xex2OptFileFormatInfo *fileFormatInfo = (const Xex2OptFileFormatInfo *)(getOptHeaderPtr(xexBytes, XEX_HEADER_FILE_FORMAT_INFO));
|
||||
if (fileFormatInfo == nullptr)
|
||||
{
|
||||
return Result::XexFileInvalid;
|
||||
}
|
||||
|
||||
if (fileFormatInfo->encryptionType == XEX_ENCRYPTION_NORMAL)
|
||||
{
|
||||
AES_init_ctx_iv(&aesContext, decryptedOriginalKey, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, &outBytes[headerTargetSize], xexBytes.size() - xexHeader->headerSize);
|
||||
}
|
||||
else if (fileFormatInfo->encryptionType != XEX_ENCRYPTION_NONE)
|
||||
{
|
||||
return Result::XexFileInvalid;
|
||||
}
|
||||
|
||||
// Decompress base XEX if necessary.
|
||||
if (fileFormatInfo->compressionType == XEX_COMPRESSION_BASIC)
|
||||
{
|
||||
const Xex2FileBasicCompressionBlock *blocks = &fileFormatInfo->compressionInfo.basic.firstBlock;
|
||||
int32_t numBlocks = (fileFormatInfo->infoSize / sizeof(Xex2FileBasicCompressionBlock)) - 1;
|
||||
int32_t baseCompressedSize = 0;
|
||||
int32_t baseImageSize = 0;
|
||||
for (int32_t i = 0; i < numBlocks; i++) {
|
||||
baseCompressedSize += blocks[i].dataSize;
|
||||
baseImageSize += blocks[i].dataSize + blocks[i].zeroSize;
|
||||
}
|
||||
|
||||
if (outBytes.size() < (headerTargetSize + baseImageSize))
|
||||
{
|
||||
return Result::XexFileInvalid;
|
||||
}
|
||||
|
||||
// Reverse iteration allows to perform this decompression in place.
|
||||
uint8_t *srcDataCursor = outBytes.data() + headerTargetSize + baseCompressedSize;
|
||||
uint8_t *outDataCursor = outBytes.data() + headerTargetSize + baseImageSize;
|
||||
for (int32_t i = numBlocks - 1; i >= 0; i--)
|
||||
{
|
||||
outDataCursor -= blocks[i].zeroSize;
|
||||
memset(outDataCursor, 0, blocks[i].zeroSize);
|
||||
outDataCursor -= blocks[i].dataSize;
|
||||
srcDataCursor -= blocks[i].dataSize;
|
||||
memmove(outDataCursor, srcDataCursor, blocks[i].dataSize);
|
||||
}
|
||||
}
|
||||
else if (fileFormatInfo->compressionType == XEX_COMPRESSION_NORMAL || fileFormatInfo->compressionType == XEX_COMPRESSION_DELTA)
|
||||
{
|
||||
return Result::XexFileUnsupported;
|
||||
}
|
||||
else if (fileFormatInfo->compressionType != XEX_COMPRESSION_NONE)
|
||||
{
|
||||
return Result::XexFileInvalid;
|
||||
}
|
||||
|
||||
Xex2OptFileFormatInfo *newFileFormatInfo = (Xex2OptFileFormatInfo *)(getOptHeaderPtr(outBytes, XEX_HEADER_FILE_FORMAT_INFO));
|
||||
if (newFileFormatInfo == nullptr)
|
||||
{
|
||||
return Result::PatchFailed;
|
||||
}
|
||||
|
||||
// Update the header to indicate no encryption or compression is used.
|
||||
newFileFormatInfo->encryptionType = XEX_ENCRYPTION_NONE;
|
||||
newFileFormatInfo->compressionType = XEX_COMPRESSION_NONE;
|
||||
|
||||
// Copy and decrypt patch data if necessary.
|
||||
std::vector<uint8_t> patchData;
|
||||
patchData.resize(patchBytes.size() - patchHeader->headerSize);
|
||||
memcpy(patchData.data(), &patchBytes[patchHeader->headerSize], patchData.size());
|
||||
|
||||
if (patchFileFormatInfo->encryptionType == XEX_ENCRYPTION_NORMAL)
|
||||
{
|
||||
AES_init_ctx_iv(&aesContext, decryptedPatchKey, AESBlankIV);
|
||||
AES_CBC_decrypt_buffer(&aesContext, patchData.data(), patchData.size());
|
||||
}
|
||||
else if (patchFileFormatInfo->encryptionType != XEX_ENCRYPTION_NONE)
|
||||
{
|
||||
return Result::PatchFileInvalid;
|
||||
}
|
||||
|
||||
const Xex2CompressedBlockInfo *currentBlock = &patchFileFormatInfo->compressionInfo.normal.firstBlock;
|
||||
uint8_t *outExe = &outBytes[newXexHeader->headerSize];
|
||||
if (patchDescriptor->deltaImageSourceOffset > 0)
|
||||
{
|
||||
memcpy(&outExe[patchDescriptor->deltaImageTargetOffset], &outExe[patchDescriptor->deltaImageSourceOffset], patchDescriptor->deltaImageSourceSize);
|
||||
}
|
||||
|
||||
static const uint32_t DigestSize = 20;
|
||||
uint8_t sha1Digest[DigestSize];
|
||||
sha1::SHA1 sha1Context;
|
||||
uint8_t *patchDataCursor = patchData.data();
|
||||
while (currentBlock->blockSize > 0)
|
||||
{
|
||||
const Xex2CompressedBlockInfo *nextBlock = (const Xex2CompressedBlockInfo *)(patchDataCursor);
|
||||
|
||||
// Hash and validate the block.
|
||||
sha1Context.reset();
|
||||
sha1Context.processBytes(patchDataCursor, currentBlock->blockSize);
|
||||
sha1Context.finalize(sha1Digest);
|
||||
if (memcmp(sha1Digest, currentBlock->blockHash, DigestSize) != 0)
|
||||
{
|
||||
return Result::PatchFailed;
|
||||
}
|
||||
|
||||
patchDataCursor += 24;
|
||||
|
||||
// Apply the block's patch data.
|
||||
uint32_t blockDataSize = currentBlock->blockSize - 24;
|
||||
if (lzxDeltaApplyPatch((const Xex2DeltaPatch *)(patchDataCursor), blockDataSize, patchFileFormatInfo->compressionInfo.normal.windowSize, outExe) != 0)
|
||||
{
|
||||
return Result::PatchFailed;
|
||||
}
|
||||
|
||||
patchDataCursor += blockDataSize;
|
||||
currentBlock = nextBlock;
|
||||
}
|
||||
|
||||
return Result::Success;
|
||||
}
|
||||
|
||||
XexPatcher::Result XexPatcher::apply(const std::filesystem::path &baseXexPath, const std::filesystem::path &patchXexPath, const std::filesystem::path &newXexPath)
|
||||
{
|
||||
MemoryMappedFile baseXexFile(baseXexPath);
|
||||
MemoryMappedFile patchFile(patchXexPath);
|
||||
if (!baseXexFile.isOpen() || !patchFile.isOpen())
|
||||
{
|
||||
return Result::FileOpenFailed;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> newXexBytes;
|
||||
Result result = apply({ baseXexFile.data(), baseXexFile.size() }, { patchFile.data(), patchFile.size() }, newXexBytes, false);
|
||||
if (result != Result::Success)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
std::ofstream newXexFile(newXexPath, std::ios::binary);
|
||||
if (!newXexFile.is_open())
|
||||
{
|
||||
return Result::FileOpenFailed;
|
||||
}
|
||||
|
||||
newXexFile.write((const char *)(newXexBytes.data()), newXexBytes.size());
|
||||
newXexFile.close();
|
||||
|
||||
if (newXexFile.bad())
|
||||
{
|
||||
std::filesystem::remove(newXexPath);
|
||||
return Result::FileWriteFailed;
|
||||
}
|
||||
|
||||
return Result::Success;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// Referenced from: https://github.com/xenia-canary/xenia-canary/blob/canary_experimental/src/xenia/cpu/xex_module.cc
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2023 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
struct XexPatcher
|
||||
{
|
||||
enum class Result {
|
||||
Success,
|
||||
FileOpenFailed,
|
||||
FileWriteFailed,
|
||||
XexFileUnsupported,
|
||||
XexFileInvalid,
|
||||
PatchFileInvalid,
|
||||
PatchIncompatible,
|
||||
PatchFailed,
|
||||
PatchUnsupported
|
||||
};
|
||||
|
||||
static Result apply(std::span<const uint8_t> xexBytes, std::span<const uint8_t> patchBytes, std::vector<uint8_t> &outBytes, bool skipData);
|
||||
static Result apply(const std::filesystem::path &baseXexPath, const std::filesystem::path &patchXexPath, const std::filesystem::path &newXexPath);
|
||||
};
|
||||
@@ -1,11 +1,12 @@
|
||||
#include <stdafx.h>
|
||||
#include "file_system.h"
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <kernel/xam.h>
|
||||
#include <kernel/xdm.h>
|
||||
#include <kernel/function.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <os/logger.h>
|
||||
#include <mod/mod_loader.h>
|
||||
#include <os/logger.h>
|
||||
#include <user/config.h>
|
||||
#include <stdafx.h>
|
||||
|
||||
struct FileHandle : KernelObject
|
||||
{
|
||||
@@ -365,8 +366,14 @@ std::filesystem::path FileSystem::ResolvePath(const std::string_view& path, bool
|
||||
if (checkForMods)
|
||||
{
|
||||
std::filesystem::path resolvedPath = ModLoader::ResolvePath(path);
|
||||
|
||||
if (!resolvedPath.empty())
|
||||
{
|
||||
if (ModLoader::s_isLogTypeConsole)
|
||||
LOGF_IMPL(Utility, "Mod Loader", "Loading file: \"{}\"", reinterpret_cast<const char*>(resolvedPath.u8string().c_str()));
|
||||
|
||||
return resolvedPath;
|
||||
}
|
||||
}
|
||||
|
||||
thread_local std::string builtPath;
|
||||
|
||||
@@ -466,6 +466,18 @@ uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_STATE* st
|
||||
|
||||
state->Gamepad.wButtons &= ~hid::g_prohibitedButtons;
|
||||
|
||||
if (hid::g_isLeftStickProhibited)
|
||||
{
|
||||
state->Gamepad.sThumbLX = 0;
|
||||
state->Gamepad.sThumbLY = 0;
|
||||
}
|
||||
|
||||
if (hid::g_isRightStickProhibited)
|
||||
{
|
||||
state->Gamepad.sThumbRX = 0;
|
||||
state->Gamepad.sThumbRY = 0;
|
||||
}
|
||||
|
||||
ByteSwapInplace(state->Gamepad.wButtons);
|
||||
ByteSwapInplace(state->Gamepad.sThumbLX);
|
||||
ByteSwapInplace(state->Gamepad.sThumbLY);
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace xdbf
|
||||
{
|
||||
inline std::string& FixInvalidSequences(std::string& str)
|
||||
{
|
||||
static std::vector<std::string> invalidSequences =
|
||||
static std::array<std::string_view, 1> invalidSequences =
|
||||
{
|
||||
"\xE2\x80\x99"
|
||||
};
|
||||
|
||||
static std::vector<std::string> replaceSequences =
|
||||
static std::array<std::string_view, 1> replaceSequences =
|
||||
{
|
||||
"'"
|
||||
};
|
||||
|
||||
@@ -15,6 +15,34 @@
|
||||
360, which is one of the few consoles to have a port of Sonic
|
||||
Unleashed.
|
||||
|
||||
- Ensure your locale is added in the correct order following the language enum.
|
||||
|
||||
Correct:
|
||||
{
|
||||
{ ELanguage::English, "Example" },
|
||||
{ ELanguage::Japanese, "Example" },
|
||||
{ ELanguage::German, "Example" },
|
||||
{ ELanguage::French, "Example" },
|
||||
{ ELanguage::Spanish, "Example" },
|
||||
{ ELanguage::Italian, "Example" }
|
||||
}
|
||||
|
||||
Incorrect:
|
||||
{
|
||||
{ ELanguage::English, "Example" },
|
||||
{ ELanguage::French, "Example" },
|
||||
{ ELanguage::Spanish, "Example" },
|
||||
{ ELanguage::German, "Example" },
|
||||
{ ELanguage::Italian, "Example" },
|
||||
{ ELanguage::Japanese, "Example" }
|
||||
}
|
||||
|
||||
- Japanese localization should use furigana for message windows, options items,
|
||||
options descriptions and installer text.
|
||||
|
||||
Furigana should be included in the text as such:
|
||||
"[私:わたし]はジョージです。"
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
|
||||
@@ -24,16 +52,18 @@
|
||||
#define CONFIG_DEFINE_ENUM_LOCALE(type) \
|
||||
CONFIG_ENUM_LOCALE(type) g_##type##_locale =
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Language)
|
||||
{
|
||||
{ ELanguage::English, { "Language", "Change the language used for text and logos." } },
|
||||
{ ELanguage::Japanese, { "言語", "" } },
|
||||
{ ELanguage::German, { "Sprache", "" } },
|
||||
{ ELanguage::French, { "Langue", "" } },
|
||||
{ ELanguage::Spanish, { "Idioma", "" } },
|
||||
{ ELanguage::Italian, { "Lingua", "" } }
|
||||
{ ELanguage::Japanese, { "[言語:げんご]", "ゲーム[内:ない]の\u200B[表示言語:ひょうじげんご]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Sprache", "Ändere die Sprache für Text und Logos." } },
|
||||
{ ELanguage::French, { "Langue", "Modifie la langue utilisée pour le texte et logos." } },
|
||||
{ ELanguage::Spanish, { "Idioma", "Cambia el idioma utilizado para el texto y los logos." } },
|
||||
{ ELanguage::Italian, { "Lingua", "Cambia la lingua utilizzata per i testi e i logo." } }
|
||||
};
|
||||
|
||||
// Notes: do not localise this.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(ELanguage)
|
||||
{
|
||||
{
|
||||
@@ -95,26 +125,51 @@ CONFIG_DEFINE_ENUM_LOCALE(EVoiceLanguage)
|
||||
},
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Hints)
|
||||
{
|
||||
{ ELanguage::English, { "Hints", "Show hint rings in stages." } }
|
||||
{ ELanguage::English, { "Hints", "Show hints during gameplay." } },
|
||||
{ ELanguage::Japanese, { "ヒントリング", "ゲーム[内:ない]に\u200Bヒントリングを\u200B[表示:ひょうじ]するか\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Hinweise", "Zeige Hinweise während des Spiels." } },
|
||||
{ ELanguage::French, { "Indices", "Affiche les indices pendant le jeu." } },
|
||||
{ ELanguage::Spanish, { "Pistas", "Muestra pistas durante el juego." } },
|
||||
{ ELanguage::Italian, { "Indizi", "Mostra degli indizzi durante il gioco." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(ControlTutorial)
|
||||
{
|
||||
{ ELanguage::English, { "Control Tutorial", "Show controller hints in stages." } }
|
||||
{ ELanguage::English, { "Control Tutorial", "Show controller hints during gameplay.\n\nThe Werehog Critical Attack prompt will be unaffected." } },
|
||||
{ ELanguage::Japanese, { "アクションナビ", "ゲーム[内:ない]に\u200Bアクションナビを\u200B[表示:ひょうじ]するか\u200B[選択:せんたく]できます\n\n「チャンスアタック」の\u200B[表示:ひょうじ]は\u200B[影響:えいきょう]されません" } },
|
||||
{ ELanguage::German, { "Steuerungsanleitung", "Zeige Steuerungshinweise während des Spiels.\n\nKritische Angriffe des Werehogs werden hiervon nicht beeinflusst." } },
|
||||
{ ELanguage::French, { "Indication des commandes", "Affiche les indications des commandes pendant le jeu.\n\nCeci n'affecte pas les Coup critiques du Werehog." } },
|
||||
{ ELanguage::Spanish, { "Tutorial de controles", "Muestra pistas de controles durante el juego.\n\nEl indicador de ataque crítico del Werehog no se verá afectado." } },
|
||||
{ ELanguage::Italian, { "Tutorial dei comandi", "Mostra i tutorial dei comandi durante il gioco.\n\nIl tutorial per l'attacco critico del Werehog non verrà influenzato da questa opzione." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(AchievementNotifications)
|
||||
{
|
||||
{ ELanguage::English, { "Achievement Notifications", "Show notifications for unlocking achievements.\n\nAchievements will still be rewarded with notifications disabled." } }
|
||||
{ ELanguage::English, { "Achievement Notifications", "Show notifications for unlocking achievements.\n\nAchievements will still be rewarded with notifications disabled." } },
|
||||
{ ELanguage::Japanese, { "[実績通知:じっせきつうち]", "[実績通知:じっせきつうち]の\u200B[有無:うむ]を\u200B[選択:せんたく]できます\n\nオフにしても\u200B[実績:じっせき]は\u200B[付与:ふよ]されます" } },
|
||||
{ ELanguage::German, { "Erfolgsbenachrichtigungen", "Zeige Benachrichtigungen für das Freischalten von Erfolgen.\n\nErfolge werden weiterhin freigeschaltet, auch wenn die Benachrichtigungen ausgeschaltet sind." } },
|
||||
{ ELanguage::French, { "Notification des succès", "Affiche les notifications pour le déverrouillage des succès.\n\nLes succès seront toujours obtenus même si les notifications sont désactivées." } },
|
||||
{ ELanguage::Spanish, { "Notificaciones de logros", "Muestra notificaciones al desbloquear logros.\n\nLos logros se seguirán obteniendo aunque las notificaciones estén desactivadas." } },
|
||||
{ ELanguage::Italian, { "Notifiche obiettivi", "Mostra delle notifiche quando sblocchi degli obiettivi.\n\nGli obiettivi verranno comunque assegnati anche con le notifiche disattivate." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(TimeOfDayTransition)
|
||||
{
|
||||
{ ELanguage::English, { "Time of Day Transition", "Change how the loading screen appears when switching time of day in the hub areas." } }
|
||||
{ ELanguage::English, { "Time of Day Transition", "Change how the loading screen appears when switching time of day in the hub areas." } },
|
||||
{ ELanguage::Japanese, { "[昼夜:ちゅうや]きりかえのシーン", "[昼夜:ちゅうや]きりかえの\u200Bシーンを\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Tageszeit Übergang", "Verändere den Ladebildschirm beim Verändern der Tageszeit in Städten und Eingangslevel." } },
|
||||
{ ELanguage::French, { "Transition jour/nuit", "Change l'écran de chargement lors de la transition dans le hub." } },
|
||||
{ ELanguage::Spanish, { "Transición de hora del día", "Cambia cómo aparece la pantalla de carga al cambiar la hora del día en las áreas principales." } },
|
||||
{ ELanguage::Italian, { "Transizione giorno/notte", "Modifica l'aspetto della schermata di caricamento quando fai scorrere il tempo." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(ETimeOfDayTransition)
|
||||
{
|
||||
{
|
||||
@@ -123,14 +178,56 @@ CONFIG_DEFINE_ENUM_LOCALE(ETimeOfDayTransition)
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: the transformation cutscene will play with artificial loading times." } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: a spinning medal loading screen will be used instead." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: [変身:へんしん]シーンは\u200B[人工的:じんこうてき]な\u200B[読:よ]み[込:こ]み[時間:じかん]で\u200B[再生:さいせい]されます" } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: [回転:かいてん]するメダル\u200B[読:よ]み[込:こ]み[画面:がめん]が\u200B[使用:しよう]されます" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: Eine Transformationszwischensequenz mit künstlicher Ladezeit wird abgespielt." } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: Eine sich drehende Medallie wird stattdessen als Ladebildschirm verwendet." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: la scène de transformation sera jouée avec des temps de chargement artificiel." } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: un écran de chargement avec une médaille tournoyante sera utilisé à la place." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: la cinemática de transformación se reproducirá con tiempos de carga artificiales." } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: se usará una pantalla de carga con una medalla giratoria." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: la scena di trasformazione verrà riprodotta con tempi di caricamento artificiali." } },
|
||||
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: verrà utilizzata una schermata di caricamento con una medaglia che gira." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(ControllerIcons)
|
||||
{
|
||||
{ ELanguage::English, { "Controller Icons", "Change the icons to match your controller." } }
|
||||
{ ELanguage::English, { "Controller Icons", "Change the icons to match your controller." } },
|
||||
{ ELanguage::Japanese, { "コントローライコン", "ゲーム[内:ない]の\u200Bコントローライコンを\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Controllersymbole", "Ändere die Controllersymbole, um sie auf dein Modell anzupassen." } },
|
||||
{ ELanguage::French, { "Icône des boutons", "Modifie les icônes pour les faire correspondre à votre manette." } },
|
||||
{ ELanguage::Spanish, { "Iconos del mando", "Cambia los iconos para que coincidan con tu mando." } },
|
||||
{ ELanguage::Italian, { "Icone dei tasti", "Modifica le icone per farle corrispondere con il tuo controller." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EControllerIcons)
|
||||
{
|
||||
{
|
||||
@@ -140,17 +237,69 @@ CONFIG_DEFINE_ENUM_LOCALE(EControllerIcons)
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EControllerIcons::Auto, { "自動検出", "[自動検出:じどうけんしゅつ]: ゲーム[内:ない]の\u200Bコントローライコンを\u200B[自動検出:じどうけんしゅつ]されます" } },
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EControllerIcons::Auto, { "AUTO", "Auto: Das Spiel erkennt automatisch deinen Controller um die Symbole dementsprechend anzupassen." } },
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EControllerIcons::Auto, { "AUTO", "Auto: le jeu déterminera automatiquement quelles icônes utiliser en fonction du périphérique d'entrée." } },
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EControllerIcons::Auto, { "AUTO", "Auto: el juego determinará de forma automática qué iconos utilizar dependiendo del dispositivo de entrada actual." } },
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EControllerIcons::Auto, { "AUTO", "Auto: il gioco determinerà quali icone da utilizzare in base al dispositivo di input attuale." } },
|
||||
{ EControllerIcons::Xbox, { "XBOX", "" } },
|
||||
{ EControllerIcons::PlayStation, { "PLAYSTATION", "" } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(HorizontalCamera)
|
||||
{
|
||||
{ ELanguage::English, { "Horizontal Camera", "Change how the camera moves left and right." } }
|
||||
{ ELanguage::English, { "Horizontal Camera", "Change how the camera moves left and right." } },
|
||||
{ ELanguage::Japanese, { "カメラの[左右:さゆう]", "カメラ[左右:さゆう]の\u200B[動:うご]く[方向:ほうこう]を\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Horizontale Kamera", "Ändere wie sich die Kamera nach links und rechts bewegt." } },
|
||||
{ ELanguage::French, { "Caméra horizontale", "Modifie la rotation horizontale de la caméra." } },
|
||||
{ ELanguage::Spanish, { "Cámara horizontal", "Cambia cómo se mueve la camara hacia la izquierda y la derecha." } },
|
||||
{ ELanguage::Italian, { "Telecamera orizzontale", "Modifica come la telecamera si muove da sinistra a destra." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(VerticalCamera)
|
||||
{
|
||||
{ ELanguage::English, { "Vertical Camera", "Change how the camera moves up and down." } }
|
||||
{ ELanguage::English, { "Vertical Camera", "Change how the camera moves up and down." } },
|
||||
{ ELanguage::Japanese, { "カメラの[上下:じょうげ]", "カメラ[上下:じょうげ]の\u200B[動:うご]く[方向:ほうこう]を\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Vertikale Kamera", "Ändere wie sich die Kamera nach oben und unten bewegt." } },
|
||||
{ ELanguage::French, { "Caméra verticale", "Modifie la rotation verticale de la caméra." } },
|
||||
{ ELanguage::Spanish, { "Cámara vertical", "Cambia cómo se mueve la camara hacia arriba y abajo." } },
|
||||
{ ELanguage::Italian, { "Telecamera verticale", "Modifica come la telecamera si muove su e giù." } }
|
||||
};
|
||||
|
||||
CONFIG_DEFINE_ENUM_LOCALE(ECameraRotationMode)
|
||||
@@ -161,42 +310,119 @@ CONFIG_DEFINE_ENUM_LOCALE(ECameraRotationMode)
|
||||
{ ECameraRotationMode::Normal, { "NORMAL", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "REVERSE", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ ECameraRotationMode::Normal, { "ノーマル", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "リバース", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ ECameraRotationMode::Normal, { "NORMAL", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "INVERTIERT", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ ECameraRotationMode::Normal, { "NORMALE", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "INVERSÉE", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ ECameraRotationMode::Normal, { "NORMAL", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "INVERTIDO", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ ECameraRotationMode::Normal, { "NORMALE", "" } },
|
||||
{ ECameraRotationMode::Reverse, { "INVERTITA", "" } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Vibration)
|
||||
{
|
||||
{ ELanguage::English, { "Vibration", "Toggle controller vibration." } }
|
||||
{ ELanguage::English, { "Vibration", "Toggle controller vibration." } },
|
||||
{ ELanguage::Japanese, { "[振動:しんどう]", "[振動:しんどう]の\u200B[有無:うむ]を\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Vibration", "Schalte die Controllervibration an oder aus." } },
|
||||
{ ELanguage::French, { "Vibration", "Active les vibrations manette." } },
|
||||
{ ELanguage::Spanish, { "Vibración", "Activa o desactiva la vibración del mando." } },
|
||||
{ ELanguage::Italian, { "Vibrazione", "Attiva/disattiva la vibrazione del controller." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
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." } },
|
||||
{ ELanguage::Japanese, { "バックグラウンド[入力:にゅうりょく]", "フォーカスされていない\u200Bゲームに\u200B[入力:にゅうりょく]できるか\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Erlaube Hintergrundeingaben", "Erlaube Eingaben deines Controllers auch wenn das Spielfenster nicht fokussiert ist." } },
|
||||
{ ELanguage::French, { "Manette en arrière plan", "Permet d'utiliser la manette dans le jeu lorsque qu'il n'est pas au premier plan." } },
|
||||
{ ELanguage::Spanish, { "Control en segundo plano", "Permite controlar el juego con un mando mientras la ventana esté en segundo plano." } },
|
||||
{ ELanguage::Italian, { "Input con la finestra inattiva", "Attiva/disattiva i tasti del controller mentre la finestra è inattiva." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(MasterVolume)
|
||||
{
|
||||
{ ELanguage::English, { "Master Volume", "Adjust the overall volume." } }
|
||||
{ ELanguage::English, { "Master Volume", "Adjust the overall volume." } },
|
||||
{ ELanguage::Japanese, { "マスターボリューム", "[全体:ぜんたい]ボリュームの\u200B[大:おお]きさを\u200B[調整:ちょうせい]できます" } },
|
||||
{ ELanguage::German, { "Gesamtlautstärke", "Passe die Gesamtlautstärke an." } },
|
||||
{ ELanguage::French, { "Volume général", "Réglage du volume général." } },
|
||||
{ ELanguage::Spanish, { "Volumen maestro", "Ajusta el volumen general." } },
|
||||
{ ELanguage::Italian, { "Volume principale", "Regola il volume principale" } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(MusicVolume)
|
||||
{
|
||||
{ ELanguage::English, { "Music Volume", "Adjust the volume for the music." } }
|
||||
{ ELanguage::English, { "Music Volume", "Adjust the volume for the music." } },
|
||||
{ ELanguage::Japanese, { "BGMボリューム", "BGMボリュームの\u200B[大:おお]きさを\u200B[調整:ちょうせい]できます" } },
|
||||
{ ELanguage::German, { "Musiklautstärke", "Passe die Lautstärke der Musik an." } },
|
||||
{ ELanguage::French, { "Volume de la musique", "Réglage du volume de la musique." } },
|
||||
{ ELanguage::Spanish, { "Volumen de la música", "Ajusta el volumen de la música." } },
|
||||
{ ELanguage::Italian, { "Volume musica di sottofondo", "Regola il volume della musica di sottofondo." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(EffectsVolume)
|
||||
{
|
||||
{ ELanguage::English, { "Effects Volume", "Adjust the volume for sound effects." } }
|
||||
{ ELanguage::English, { "Effects Volume", "Adjust the volume for sound effects." } },
|
||||
{ ELanguage::Japanese, { "SEボリューム", "SEボリュームの\u200B[大:おお]きさを\u200B[調整:ちょうせい]できます" } },
|
||||
{ ELanguage::German, { "Soundeffektlautstärke", "Passe die Lautstärke der Soundeffekte an." } },
|
||||
{ ELanguage::French, { "Volume des effets sonores", "Réglage du volume des effets sonores." } },
|
||||
{ ELanguage::Spanish, { "Volumen de efectos", "Ajusta el volumen de los efectos de sonido." } },
|
||||
{ ELanguage::Italian, { "Volume effetti sonori", "Regola il volume degli effetti sonori." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
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." } },
|
||||
{ ELanguage::Japanese, { "BGM[減衰:げんすい]", "[外部:がいぶ]メディアを\u200B[再生:さいせい]すると\u200Bゲームの\u200B[音楽:おんがく]を\u200Bフェードアウトされます" } },
|
||||
{ ELanguage::German, { "Musikdämpfung", "Stelle die Musik des Spiels stumm während externe Medien abgespielt werden." } },
|
||||
{ ELanguage::French, { "Atténuation audio", "Abaisse le volume des musiques du jeu lorsqu'un média externe est en cours de lecture." } },
|
||||
{ ELanguage::Spanish, { "Atenuación de música", "Atenúa la música del juego cuando un reproductor multimedia se encuentra activo." } },
|
||||
{ ELanguage::Italian, { "Attenuazione musica", "Abbassa il volume della musica di sottofondo quando un'altra applicazione riproduce dei suoni." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(ChannelConfiguration)
|
||||
{
|
||||
{ ELanguage::English, { "Channel Configuration", "Change the output mode for your playback device." } }
|
||||
{ ELanguage::English, { "Channel Configuration", "Change the output mode for your audio device." } },
|
||||
{ ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\u200B[\u2005出\u2005力\u2005:しゅつりょく]モード\u200Bを[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Kanalkonfiguration", "Ändere den Ausgabemodus für dein Audioausgabegerät." } },
|
||||
{ ELanguage::French, { "Configuration sortie audio", "Modifie le mode de sortie pour votre périphérique audio." } },
|
||||
{ ELanguage::Spanish, { "Configuración de canales", "Cambia el modo de salida para tu dispositivo de audio." } },
|
||||
{ ELanguage::Italian, { "Configurazione canali audio", "Modifica la modalità di output per il tuo dispositivo audio." } }
|
||||
};
|
||||
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EChannelConfiguration)
|
||||
@@ -207,39 +433,111 @@ CONFIG_DEFINE_ENUM_LOCALE(EChannelConfiguration)
|
||||
{ EChannelConfiguration::Stereo, { "STEREO", "" } },
|
||||
{ EChannelConfiguration::Surround, { "SURROUND", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EChannelConfiguration::Stereo, { "ステレオ", "" } },
|
||||
{ EChannelConfiguration::Surround, { "サラウンド", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EChannelConfiguration::Stereo, { "STEREO", "" } },
|
||||
{ EChannelConfiguration::Surround, { "SURROUND", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EChannelConfiguration::Stereo, { "STÉRÉO", "" } },
|
||||
{ EChannelConfiguration::Surround, { "SURROUND", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EChannelConfiguration::Stereo, { "ESTÉREO", "" } },
|
||||
{ EChannelConfiguration::Surround, { "ENVOLVENTE", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EChannelConfiguration::Stereo, { "STEREO", "" } },
|
||||
{ EChannelConfiguration::Surround, { "SURROUND", "" } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(VoiceLanguage)
|
||||
{
|
||||
{ ELanguage::English, { "Voice Language", "Change the language used for character voices." } }
|
||||
{ ELanguage::English, { "Voice Language", "Change the language used for character voices." } },
|
||||
{ ELanguage::Japanese, { "[音声言語:おんせいげんご]", "ゲーム[内:ない]の\u200B[音声言語:おんせいげんご]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Stimmeinstellung", "Ändere die Sprache, die für Charakterstimmen benutzt wird." } },
|
||||
{ ELanguage::French, { "Langue de doublage", "Modifie la langue utilisée pour la voix des personnages." } },
|
||||
{ ELanguage::Spanish, { "Idioma de voz", "Cambia el idioma utilizado para las voces de los personajes." } },
|
||||
{ ELanguage::Italian, { "Lingua delle voci", "Modifica la lingua utilizzata per le voci dei personaggi." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Subtitles)
|
||||
{
|
||||
{ ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } }
|
||||
{ ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } },
|
||||
{ ELanguage::Japanese, { "[字幕:じまく]", "[字幕:じまく]の[表示:ひょうじ]を\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Untertitel", "Zeige Untertitel bei Dialogen." } },
|
||||
{ ELanguage::French, { "Sous-titres", "Affiche les sous-titres pendant les dialogues." } },
|
||||
{ ELanguage::Spanish, { "Subtítulos", "Muestra subtítulos durante los diálogos." } },
|
||||
{ ELanguage::Italian, { "Sottotitoli", "Mostra i sottotitoli durante i dialoghi." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(BattleTheme)
|
||||
{
|
||||
{ ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat." } }
|
||||
{ ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat.\n\nExorcism missions and miniboss themes will be unaffected." } },
|
||||
{ ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[\u2005除\u2005霊\u2005:エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } },
|
||||
{ ELanguage::German, { "Kampfmusik", "Spiele die Kampfmusik des Werehogs während dem Kämpfen ab.\n\nDiese Option tritt das nächste Mal, wenn du in einen Kampf gerätst, in Kraft.\n\nExorzismen und Mini-Bosse werden hiervon nicht beeinflusst." } },
|
||||
{ ELanguage::French, { "Thème de combat", "Joue le thème de combat du Werehog pendant les combat.\n\nCette option s'appliquera la prochaine fois que vous serez en combat.\n\nLes missions d'exorcisme et les thèmes des miniboss ne seront pas affectés." } },
|
||||
{ ELanguage::Spanish, { "Tema de batalla", "Reproduce el tema de batalla del Werehog durante el combate.\n\nEsta opción se aplicará la próxima vez que entres en combate.\n\nLas misiones de exorcismo y los temas de los minijefes no se verán afectados." } },
|
||||
{ ELanguage::Italian, { "Musica di combattimento", "Riproduci la musica di combattimento del Werehog quando inizi una battaglia.\n\nQuesta opzione verrà applicata la prossima volta che sei in battaglia.\n\nLa traccia musicale verrà riprodotta ugualmente nelle missioni di Esorcismo e i miniboss." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(WindowSize)
|
||||
{
|
||||
{ ELanguage::English, { "Window Size", "Adjust the size of the game window in windowed mode." } }
|
||||
{ ELanguage::English, { "Window Size", "Adjust the size of the game window in windowed mode." } },
|
||||
{ ELanguage::Japanese, { "ウィンドウサイズ", "ウィンドウモードで\u200Bゲームの\u200Bウィンドウサイズを\u200B[調整:ちょうせい]できます" } },
|
||||
{ ELanguage::German, { "Fenstergröße", "Ändere die Größe des Spielfensters im Fenstermodus." } },
|
||||
{ ELanguage::French, { "Taille de la fenêtre", "Modifie la taille de la fenêtre de jeu en mode fenêtré." } },
|
||||
{ ELanguage::Spanish, { "Tamaño de ventana", "Ajusta el tamaño de la ventana de juego." } },
|
||||
{ ELanguage::Italian, { "Dimensioni finestra", "Regola le dimensioni della finestra del gioco in modalità finestra." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Monitor)
|
||||
{
|
||||
{ ELanguage::English, { "Monitor", "Change which monitor to display the game on." } }
|
||||
{ ELanguage::English, { "Monitor", "Change which monitor to display the game on." } },
|
||||
{ ELanguage::Japanese, { "モニター[選択:せんたく]", "ゲームを[表示:ひょうじ]する\u200Bモニターを\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Monitor", "Ändere auf welchem Monitor das Spiel angezeigt wird." } },
|
||||
{ ELanguage::French, { "Moniteur", "Change le moniteur sur lequel le jeu sera affiché." } },
|
||||
{ ELanguage::Spanish, { "Pantalla", "Cambia la pantalla en la cuál se muestra el juego." } },
|
||||
{ ELanguage::Italian, { "Schermo", "Cambia lo schermo su cui visualizzare il gioco." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(AspectRatio)
|
||||
{
|
||||
{ ELanguage::English, { "Aspect Ratio", "Change the aspect ratio." } }
|
||||
{ ELanguage::English, { "Aspect Ratio", "Change the aspect ratio." } },
|
||||
{ ELanguage::Japanese, { "アスペクト[比:ひ]", "アスペクト[比:ひ]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Seitenverhältnis", "Verändere das Seitenverhältnis." } },
|
||||
{ ELanguage::French, { "Format d'image", "Modifie le format d'image." } },
|
||||
{ ELanguage::Spanish, { "Relación de aspecto", "Cambia la relación de aspecto." } },
|
||||
{ ELanguage::Italian, { "Rapporto d'aspetto", "Modifica il rapporto d'aspetto." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio)
|
||||
{
|
||||
{
|
||||
@@ -250,37 +548,118 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio)
|
||||
{ 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." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EAspectRatio::Auto, { "自動検出", "[自動検出:じどうけんしゅつ]: ゲーム[内:ない]の\u200Bコントローライコンを\u200B[自動検出:じどうけんしゅつ]されます" } },
|
||||
{ EAspectRatio::Wide, { "16:9", "16:9: ワイドスクリーンの\u200Bアスペクト[比:ひ]に\u200B[固定:こてい]されます" } },
|
||||
{ EAspectRatio::Narrow, { "4:3", "4:3: ナローの\u200Bアスペクト[比:ひ]に\u200B[固定:こてい]されます" } },
|
||||
{ EAspectRatio::OriginalNarrow, { "オリジナル 4:3", "オリジナル 4:3: オリジナルの\u200Bアスペクト[比:ひ]に\u200B[固定:こてい]されます" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EAspectRatio::Auto, { "AUTO", "Auto: Das Seitenverhältnis passt sich automatisch der Fenstergröße an." } },
|
||||
{ EAspectRatio::Wide, { "16:9", "16:9: Stellt das Spiel in einem Breitbildschirm-Format dar." } },
|
||||
{ EAspectRatio::Narrow, { "4:3", "4:3: Stellt das Spiel in einem Mittel-Format dar." } },
|
||||
{ EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: Stellt das Spiel in einem Mittel-Format dar, was der ursprünglichen Implementation originalgetreut bleibt." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EAspectRatio::Auto, { "AUTO", "Auto: le format d'image s'adapte automatiquement à la taille de la fenêtre." } },
|
||||
{ EAspectRatio::Wide, { "16:9", "16:9: force le jeu sur un format d'image large." } },
|
||||
{ EAspectRatio::Narrow, { "4:3", "4:3: force le jeu sur un format d'image carré." } },
|
||||
{ EAspectRatio::OriginalNarrow, { "4:3 ORIGINAL", "4:3 Original: force le jeu à un format d'image carré et conserve la parité avec l'implémentation d'origine du jeu." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EAspectRatio::Auto, { "AUTO", "Auto: la relación de aspecto se ajusta de forma dinámica al tamaño de la ventana." } },
|
||||
{ EAspectRatio::Wide, { "16:9", "16:9: muestra el juego en relación de aspecto de pantalla ancha." } },
|
||||
{ EAspectRatio::Narrow, { "4:3", "4:3: muestra el juego en relación de aspecto de pantalla estrecha." } },
|
||||
{ EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: muestra el juego en relación de aspecto de pantalla estrecha y mantiene paridad con la implementación original del juego." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EAspectRatio::Auto, { "AUTO", "Auto: il rapporto d'aspetto verra cambiato automaticamente in base alle dimensioni della finestra." } },
|
||||
{ EAspectRatio::Wide, { "16:9", "16:9: blocca il gioco a un rapporto d'aspetto widescreen." } },
|
||||
{ EAspectRatio::Narrow, { "4:3", "4:3: blocca il gioco a un rapporto d'aspetto stretto." } },
|
||||
{ EAspectRatio::OriginalNarrow, { "4:3 ORIGINALE", "4:3 Originale: blocca il gioco a un rapporto d'aspetto stretto e mantiene la parità con l'implementazione originale del gioco." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(ResolutionScale)
|
||||
{
|
||||
{ ELanguage::English, { "Resolution Scale", "Adjust the internal resolution of the game.\n\n%dx%d" } }
|
||||
{ ELanguage::English, { "Resolution Scale", "Adjust the internal resolution of the game.\n\n%dx%d" } },
|
||||
{ ELanguage::Japanese, { "[解像度:かいぞうど]スケール", "ゲームの\u200B[内部解像度:ないぶかいぞうど]を\u200B[調整:ちょうせい]できます\n\n%dx%d" } },
|
||||
{ ELanguage::German, { "Rendering-Auflösung", "Passe die Auflösung der internen Darstellung an.\n\n%dx%d" } },
|
||||
{ ELanguage::French, { "Échelle de rendu", "Modifie la résolution interne du jeu.\n\n%dx%d" } },
|
||||
{ ELanguage::Spanish, { "Escala de resolución", "Ajusta la resolución interna del juego.\n\n%dx%d" } },
|
||||
{ ELanguage::Italian, { "Scala risoluzione", "Regola la risoluzione interna del gioco.\n\n%dx%d" } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Fullscreen)
|
||||
{
|
||||
{ ELanguage::English, { "Fullscreen", "Toggle between borderless fullscreen or windowed mode." } }
|
||||
{ ELanguage::English, { "Fullscreen", "Toggle between borderless fullscreen or windowed mode." } },
|
||||
{ ELanguage::Japanese, { "フルスクリーン", "ボーダーレス\u200Bフルスクリーンか\u200Bウィンドウモードを\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Vollbild", "Wechsle zwischen dem randlosen Vollbildmodus und dem Fenstermodus." } },
|
||||
{ ELanguage::French, { "Plein écran", "Alterne entre le mode plein écran sans bordure et le mode fenêtré." } },
|
||||
{ ELanguage::Spanish, { "Pantalla completa", "Cambia entre modo de pantalla completa o ventana." } },
|
||||
{ ELanguage::Italian, { "Schermo pieno", "Attiva/disattiva tra modalità finestra senza cornice e modalità finestra." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(VSync)
|
||||
{
|
||||
{ ELanguage::English, { "V-Sync", "Synchronize the game to the refresh rate of the display to prevent screen tearing." } }
|
||||
{ ELanguage::English, { "V-Sync", "Synchronize the game to the refresh rate of the display to prevent screen tearing." } },
|
||||
{ ELanguage::Japanese, { "[垂直同期:すいちょくどうき]", "[垂直同期:すいちょくどうき]の\u200B[設定:せってい]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "V-Sync", "Synchronisiere das Spiel mit der Bildwiederholrate deines Bildschirms um Bildverzerrungen zu vermeiden." } },
|
||||
{ ELanguage::French, { "V-Sync", "Synchronise le jeu avec la fréquence de rafraîchissement de l'écran pour éviter le screen tearing." } },
|
||||
{ ELanguage::Spanish, { "V-Sync", "Sincroniza el juego a la tasa de refresco de la pantalla para prevenir el rasgado de la imagen." } },
|
||||
{ ELanguage::Italian, { "V-Sync", "Sincronizza il gioco con la frequenza d'aggiornamento del display per evitare lo screen tearing." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(FPS)
|
||||
{
|
||||
{ ELanguage::English, { "FPS", "Set the max frame rate the game can run at.\n\nWARNING: this may introduce glitches at frame rates higher than 60 FPS." } }
|
||||
{ ELanguage::English, { "FPS", "Set the max frame rate the game can run at.\n\nWARNING: this may introduce glitches at frame rates higher than 60 FPS." } },
|
||||
{ ELanguage::Japanese, { "フレームレート[上限:じょうげん]", "ゲームの\u200B[最大:さいだい]フレームレートを\u200B[設定:せってい]できます\n\n[警告:けいこく]: 60 FPSを\u200B[超:こ]えるフレームレートで\u200B[不具合:ふぐあい]が\u200B[発生:はっせい]する\u200B[可能性:かのうせい]が\u200Bあります" } },
|
||||
{ ELanguage::German, { "FPS", "Setze die maximale Anzahl der Bilder pro Sekunde, die das Spiel darstellen kann.\n\nWARNUNG: Das Spiel kann bei höheren FPS als 60 ungewolltes Verhalten aufweisen." } },
|
||||
{ ELanguage::French, { "FPS", "Détermine la fréquence d'images maximale du jeu.\n\nATTENTION: cela peut entraîner des problèmes à des taux de rafraîchissement supérieurs à 60 FPS." } },
|
||||
{ ELanguage::Spanish, { "FPS", "Establece la tasa de fotogramas máxima a la que puede correr el juego.\n\nADVERTENCIA: esto puede introducir fallos en tasas mayores a 60 FPS." } },
|
||||
{ ELanguage::Italian, { "FPS", "Imposta il frame rate massimo del gioco.\n\nATTENZIONE: questa opzione può causare dei glitch a frame rate più alti di 60 FPS." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(Brightness)
|
||||
{
|
||||
{ ELanguage::English, { "Brightness", "Adjust the brightness level until the symbol on the left is barely visible." } }
|
||||
{ ELanguage::English, { "Brightness", "Adjust the brightness level until the symbol on the left is barely visible." } },
|
||||
{ ELanguage::Japanese, { "[明:おか]るさの[設定:せってい]", "[画面:がめん]の\u200B[明:おか]るさを\u200B[調整:ちょうせい]できます" } },
|
||||
{ ELanguage::German, { "Helligkeit", "Passe die Helligkeit des Spiels an bis das linke Symbol noch gerade so sichtbar ist." } },
|
||||
{ ELanguage::French, { "Luminosité", "Règle le niveau de luminosité jusqu'à ce que le symbole à gauche soit à peine visible." } },
|
||||
{ ELanguage::Spanish, { "Brillo", "Ajusta el nivel de brillo hasta que el símbolo a la izquierda sea apenas visible." } },
|
||||
{ ELanguage::Italian, { "Luminosità", "Regola la luminosità dello schermo fino a quando il simbolo a sinistra diventa leggermente visibile." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(AntiAliasing)
|
||||
{
|
||||
{ ELanguage::English, { "Anti-Aliasing", "Adjust the amount of smoothing applied to jagged edges." } }
|
||||
{ ELanguage::English, { "Anti-Aliasing", "Adjust the amount of smoothing applied to jagged edges." } },
|
||||
{ ELanguage::Japanese, { "アンチエイリアス", "アンチエイリアスの\u200B[種類:しゅるい]を\u200B[選択:せんたく]できます" } },
|
||||
{ ELanguage::German, { "Kantenglättung", "Passe die Menge an Kantenglättung an." } },
|
||||
{ ELanguage::French, { "Anticrénelage", "Ajuste le niveau d'anticrénelage appliqué aux bords des objets." } },
|
||||
{ ELanguage::Spanish, { "Anti-Aliasing", "Ajusta el nivel de suavizado aplicado a los dientes de sierra." } },
|
||||
{ ELanguage::Italian, { "Anti-Aliasing", "Regola la quantità di smussamento applicata ai bordi." } }
|
||||
};
|
||||
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EAntiAliasing)
|
||||
@@ -288,21 +667,64 @@ CONFIG_DEFINE_ENUM_LOCALE(EAntiAliasing)
|
||||
{
|
||||
ELanguage::English,
|
||||
{
|
||||
{ EAntiAliasing::None, { "NONE", "" } },
|
||||
{ EAntiAliasing::None, { "NONE", "" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EAntiAliasing::None, { "オフ", "" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EAntiAliasing::None, { "KEINE", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EAntiAliasing::None, { "SANS", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EAntiAliasing::None, { "NO", "" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EAntiAliasing::None, { "NULLO", "" } }
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(TransparencyAntiAliasing)
|
||||
{
|
||||
{ ELanguage::English, { "Transparency Anti-Aliasing", "Apply anti-aliasing to alpha transparent textures." } }
|
||||
{ ELanguage::English, { "Transparency Anti-Aliasing", "Apply anti-aliasing to alpha transparent textures." } },
|
||||
{ ELanguage::Japanese, { "アンチエイリアスのトランスペアレンシー", "アルファ[透明:とうめい]\u200Bテクスチャに\u200Bアンチエイリアシングを\u200B[適用:てきよう]されます" } },
|
||||
{ ELanguage::German, { "Transparenz-Kantenglättung", "Wende Kantenglättung auf Alpha-Transparenz-Texturen an." } },
|
||||
{ ELanguage::French, { "Anticrénelage de transparence", "Applique l'anticrénelage sur les textures transparentes." } },
|
||||
{ ELanguage::Spanish, { "Anti-Aliasing de transparencias", "Aplica antialiasing a las texturas transparentes." } },
|
||||
{ ELanguage::Italian, { "Anti-Aliasing su texture trasparenti", "Applica l'anti-aliasing alle texture trasparenti." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(ShadowResolution)
|
||||
{
|
||||
{ ELanguage::English, { "Shadow Resolution", "Set the resolution of real-time shadows." } }
|
||||
{ ELanguage::English, { "Shadow Resolution", "Set the resolution of real-time shadows." } },
|
||||
{ ELanguage::Japanese, { "[影:かげ]の[解像度:かいぞうど]", "[影:かげ]の[解像度:かいぞうど]を\u200B[設定:せってい]できます" } },
|
||||
{ ELanguage::German, { "Schattenauflösung", "Stelle die Auflösung der Echtzeit-Schatten ein." } },
|
||||
{ ELanguage::French, { "Résolution des ombres", "Défini la résolution des ombres en temps réel." } },
|
||||
{ ELanguage::Spanish, { "Resolución de sombras", "Establece la resolución de las sombras de tiempo real." } },
|
||||
{ ELanguage::Italian, { "Risoluzione ombre", "Imposta la risoluzioni delle ombre in tempo reale." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EShadowResolution)
|
||||
{
|
||||
{
|
||||
@@ -310,12 +732,48 @@ CONFIG_DEFINE_ENUM_LOCALE(EShadowResolution)
|
||||
{
|
||||
{ EShadowResolution::Original, { "ORIGINAL", "Original: the game will automatically determine the resolution of the shadows." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EShadowResolution::Original, { "オリジナル", "オリジナル: [影:かげ]の[解像度:かいぞうど]を\u200B[自動検出:じどうけんしゅつ]されます" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EShadowResolution::Original, { "ORIGINAL", "Original: Das Spiel bestimmt die Auflösung der Schatten automatisch." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EShadowResolution::Original, { "ORIGINALE", "Originale: le jeu déterminera automatiquement la résolution des ombres." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EShadowResolution::Original, { "ORIGINAL", "Original: el juego determinará de forma automática la resolución de las sombras." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EShadowResolution::Original, { "ORIGINALE", "Originale: il gioco determinerà automaticamente la risoluzione delle ombre." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(GITextureFiltering)
|
||||
{
|
||||
{ ELanguage::English, { "GI Texture Filtering", "Change the quality of the filtering used for global illumination textures." } }
|
||||
{ ELanguage::English, { "GI Texture Filtering", "Change the quality of the filtering used for global illumination textures." } },
|
||||
{ ELanguage::Japanese, { "GIテクスチャフィルタリング", "GIテクスチャに\u200B[使用:しよう]する\u200Bフィルタリングの\u200B[品質:ひんしつ]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "GI Texturfilterung", "Ändere die Qualität der Filterung für Global-Illumination-Texturen." } },
|
||||
{ ELanguage::French, { "Filtre des textures IG", "Modifie la qualité du filtre utilisé pour les textures d'illumination globale." } },
|
||||
{ ELanguage::Spanish, { "Filtrado de texturas de GI", "Cambia la calidad del filtrado utilizado en las texturas de iluminación global." } },
|
||||
{ ELanguage::Italian, { "Filtraggio delle texture GI", "Regola la qualità del sistema di filtraggio utilizzato per le texture dell'illuminazione." } }
|
||||
};
|
||||
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EGITextureFiltering)
|
||||
@@ -324,16 +782,58 @@ CONFIG_DEFINE_ENUM_LOCALE(EGITextureFiltering)
|
||||
ELanguage::English,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "BILINEAR", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICUBIC", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICUBIC", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "バイリニア", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "バイキュービック", "" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "BILINEAR", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICUBIC", "" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "BILINÉAIRE", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICUBIQUE", "" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "BILINEAR", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICÚBICO", "" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EGITextureFiltering::Bilinear, { "BILINEARE", "" } },
|
||||
{ EGITextureFiltering::Bicubic, { "BICUBICO", "" } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(MotionBlur)
|
||||
{
|
||||
{ ELanguage::English, { "Motion Blur", "Change the quality of the motion blur." } }
|
||||
{ ELanguage::English, { "Motion Blur", "Change the quality of the motion blur." } },
|
||||
{ ELanguage::Japanese, { "モーションブラー", "モーションブラーの\u200B[品質:ひんしつ]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Bewegungsunschärfe", "Verändere die Qualität der Bewegungsunschärfe." } },
|
||||
{ ELanguage::French, { "Flou de mouvement", "Modifie la qualité du flou de mouvement." } },
|
||||
{ ELanguage::Spanish, { "Desenfoque de movimiento", "Cambia la calidad del desenfoque de movimiento." } },
|
||||
{ ELanguage::Italian, { "Sfocatura di movimento", "Regola la qualità della sfocatura di movimento." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EMotionBlur)
|
||||
{
|
||||
{
|
||||
@@ -343,42 +843,172 @@ CONFIG_DEFINE_ENUM_LOCALE(EMotionBlur)
|
||||
{ EMotionBlur::Original, { "ORIGINAL", "" } },
|
||||
{ EMotionBlur::Enhanced, { "ENHANCED", "Enhanced: uses more samples for smoother motion blur at the cost of performance." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EMotionBlur::Off, { "オフ", "" } },
|
||||
{ EMotionBlur::Original, { "オリジナル", "" } },
|
||||
{ EMotionBlur::Enhanced, { "エンハンスド", "エンハンスド: パフォーマンスを\u200B[犠牲:ぎせい]にして\u200Bより[多:おお]くの\u200Bサンプルを\u200B[使用:しよう]してより\u200B[滑:なめ]らかな\u200Bモーションブラーを\u200B[実現:じつげん]されます" } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EMotionBlur::Off, { "AUS", "" } },
|
||||
{ EMotionBlur::Original, { "ORIGINAL", "" } },
|
||||
{ EMotionBlur::Enhanced, { "VERBESSERT", "Verbessert: Benutzt mehr Samples um eine weichere Bewegungsunschärfe auf Kosten von Performanz zu erzeugen." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EMotionBlur::Off, { "AUCUN", "" } },
|
||||
{ EMotionBlur::Original, { "ORIGINAL", "" } },
|
||||
{ EMotionBlur::Enhanced, { "AMÉLIORÉ", "Amélioré: utilise plus d'échantillons pour un flou de mouvement plus lisse au détriment des performances." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EMotionBlur::Off, { "APAGADO", "" } },
|
||||
{ EMotionBlur::Original, { "ORIGINAL", "" } },
|
||||
{ EMotionBlur::Enhanced, { "MEJORADO", "Mejorado: utiliza más muestras para suavizar el desenfoque de movimiento a costa del rendimiento." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EMotionBlur::Off, { "DISATTIVATO", "" } },
|
||||
{ EMotionBlur::Original, { "ORIGINALE", "" } },
|
||||
{ EMotionBlur::Enhanced, { "AUMENTATO", "Aumentato: usa più passaggi per una sfocatura più fluida, con un impatto sulle prestazioni." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(XboxColorCorrection)
|
||||
{
|
||||
{ ELanguage::English, { "Xbox Color Correction", "Use the warm tint from the Xbox version of the game." } }
|
||||
{ ELanguage::English, { "Xbox Color Correction", "Use the warm tint from the Xbox version of the game." } },
|
||||
{ ELanguage::Japanese, { "Xboxの[色補正:いろほせい]", "Xbox[版:ばん]のゲームの\u200B[暖色系:だんしょくけい]の[色合:いろあ]いを\u200B[使用:しよう]されます" } },
|
||||
{ ELanguage::German, { "Xbox Farbkorrektur", "Benutzt den warmen Farbstich aus der Xbox-Version des Spiels." } },
|
||||
{ ELanguage::French, { "Correction couleurs Xbox", "Utilise le filtre de couleur provenant de la version Xbox du jeu." } },
|
||||
{ ELanguage::Spanish, { "Corrección de color de Xbox", "Utiliza el tono cálido de la versión Xbox del juego." } },
|
||||
{ ELanguage::Italian, { "Correzione dei colori Xbox", "Applica il filtro di colori più caldi utilizzato dalla versione Xbox del gioco." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(CutsceneAspectRatio)
|
||||
{
|
||||
{ ELanguage::English, { "Cutscene Aspect Ratio", "Change the aspect ratio of the real-time cutscenes." } }
|
||||
{ ELanguage::English, { "Cutscene Aspect Ratio", "Change the aspect ratio of the real-time cutscenes." } },
|
||||
{ ELanguage::Japanese, { "アスペクト[比:ひ]のカットシーン", "リアルタイム\u200Bカットシーンの\u200Bアスペクト[比:ひ]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Zwischensequenz-Seitenverhältnis", "Verändere das Seitenverhältnis der Echtzeit-Zwischensequenzen." } },
|
||||
{ ELanguage::French, { "Format des cinématiques", "Modifie le format d'image des cinématiques en temps réel." } },
|
||||
{ ELanguage::Spanish, { "Relación de aspecto de cinemáticas", "Cambia la relación de aspecto de las cinemáticas de tiempo real." } },
|
||||
{ ELanguage::Italian, { "Rapporto d'aspetto dei filmati", "Cambia il rapporto d'aspetto dei filmati in tempo reale." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio)
|
||||
{
|
||||
{
|
||||
ELanguage::English,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "Original: locks cutscenes to their original 16:9 aspect ratio." } },
|
||||
{ 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." } },
|
||||
{ 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." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "オリジナル", "オリジナル: カットシーンを\u200B[元:もと]の\u200B16:9の\u200Bアスペクト[比:ひ]に\u200B[固定:こてい]されます" } },
|
||||
{ ECutsceneAspectRatio::Unlocked, { "解除", "[解除:かいじょ]: カットシーンの\u200Bアスペクト[比:ひ]を\u200Bウィンドウサイズに\u200B[合:あ]わせて\u200B[調整:ちょうせい]されます\n\n[警告:けいこく]: [元:もと]の\u200B16:9の\u200Bアスペクト[比:ひ]を\u200B[超:こ]えると\u200B[視覚的:しかくてき]な\u200B[異常:いじょう]が\u200B[発生:はっせい]します" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "Original: Behält die Zwischensequenzen in ihrem originalen 16:9 Seitenverhältnis." } },
|
||||
{ ECutsceneAspectRatio::Unlocked, { "ENTSPERRT", "Entsperrt: Erlaubt Zwischensequenzen ihr Seitenverhältnis der Fenstergröße anzupassen.\n\nWARNUNG: Diese Option kann zu visuellen Fehlern außerhalb der Grenzen des ursprünglichen Seitenverhältnisses führen." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "Original: force les cinématiques dans leur format 16:9 d'origine." } },
|
||||
{ ECutsceneAspectRatio::Unlocked, { "LIBRE", "Libre: permet aux cinématiques d'adapter leur format d'image à la taille de la fenêtre.\n\nAttention: au dela du format 16:9 d'origine, des bugs visuels apparaitront." } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "ORIGINAL", "Original: muestra las cinemáticas en su relación de aspecto original de 16:9." } },
|
||||
{ ECutsceneAspectRatio::Unlocked, { "DESBLOQUEADO", "Desbloqueado: permite que las cinemáticas ajusten su relación de aspecto al tamaño de la ventana.\n\nADVERTENCIA: esto introducirá rarezas visuales más allá de la relación de aspecto original de 16:9." } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ ECutsceneAspectRatio::Original, { "ORIGINALE", "Originale: blocca il rapporto d'aspetto dei filmati a 16:9." } },
|
||||
{ ECutsceneAspectRatio::Unlocked, { "SBLOCCATO", "Sbloccato: il rapporto d'aspetto verrà regolato in base alle dimensioni della finestra.\n\nATTENZIONE: questa opzione potrebbe causare dei problemi visivi se il rapporto d'aspetto è oltre 16:9." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
CONFIG_DEFINE_LOCALE(UIAlignmentMode)
|
||||
{
|
||||
{ ELanguage::English, { "UI Alignment Mode", "Change how the UI aligns with the display." } }
|
||||
{ ELanguage::English, { "UI Alignment Mode", "Change how the UI aligns with the display." } },
|
||||
{ ELanguage::Japanese, { "UIアライメントモード", "UIとディスプレイの\u200B[配置:はいち]を\u200B[変更:へんこう]できます" } },
|
||||
{ ELanguage::German, { "Benutzeroberflächenausrichtung", "Verändere wie die Benutzeroberfläche sich mit dem Bildschirm ausrichtet." } },
|
||||
{ ELanguage::French, { "Alignement de l'IU", "Modifie l'alignement de l'interface utilisateur sur l'écran." } },
|
||||
{ ELanguage::Spanish, { "Modo de alineamiento de UI", "Cambia la alineación de la interfaz de usuario con la pantalla." } },
|
||||
{ ELanguage::Italian, { "Modalità allineamento interfaccia", "Modifica come l'interfaccia si allinea con lo schermo." } }
|
||||
};
|
||||
|
||||
// Japanese Notes: This localization should include furigana in its description.
|
||||
CONFIG_DEFINE_ENUM_LOCALE(EUIAlignmentMode)
|
||||
{
|
||||
{
|
||||
ELanguage::English,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "EDGE", "Edge: the UI will align with the edges of the display." } },
|
||||
{ EUIAlignmentMode::Centre, { "CENTER", "Center: the UI will align with the center of the display." } },
|
||||
{ EUIAlignmentMode::Centre, { "CENTER", "Center: the UI will align with the center of the display." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Japanese,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "エッジ", "エッジ: UIはディスプレイの\u200B[端:はし]に\u200B[揃:そろ]います" } },
|
||||
{ EUIAlignmentMode::Centre, { "センター", "センター: UIはディスプレイの\u200B[中央:ちゅうおう]に\u200B[揃:そろ]います" } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::German,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "RAND", "Rand: Die Benutzeroberfläche richtet sich zum Rand des Bildschirms aus." } },
|
||||
{ EUIAlignmentMode::Centre, { "MITTE", "Mitte: Die Benutzeroberfläche richtet sich zur Mitte des Bildschirms aus." } }
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::French,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "BORD", "Bord: l'interface utilisateur sera alignée sur les bords de l'écran." } },
|
||||
{ EUIAlignmentMode::Centre, { "CENTRÉE", "Centrée: l'interface utilisateur sera alignée sur le centre de l'écran." } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Spanish,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "BORDE", "Borde: la interfaz de usuario se alineará con los bordes de la pantalla." } },
|
||||
{ EUIAlignmentMode::Centre, { "CENTRO", "Centro: la interfaz de usuario se alineará con el centro de la pantalla." } },
|
||||
}
|
||||
},
|
||||
{
|
||||
ELanguage::Italian,
|
||||
{
|
||||
{ EUIAlignmentMode::Edge, { "BORDI", "Bordi: l'interfaccia si allineerà con i bordi dello schermo." } },
|
||||
{ EUIAlignmentMode::Centre, { "CENTRO", "Centro: l'interfaccia si allineerà con il centro dello schermo." } }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+452
-124
@@ -16,355 +16,615 @@
|
||||
360, which is one of the few consoles to have a port of Sonic
|
||||
Unleashed.
|
||||
|
||||
- Ensure your locale is added in the correct order following the language enum.
|
||||
|
||||
Correct:
|
||||
{
|
||||
{ ELanguage::English, "Example" },
|
||||
{ ELanguage::Japanese, "Example" },
|
||||
{ ELanguage::German, "Example" },
|
||||
{ ELanguage::French, "Example" },
|
||||
{ ELanguage::Spanish, "Example" },
|
||||
{ ELanguage::Italian, "Example" }
|
||||
}
|
||||
|
||||
Incorrect:
|
||||
{
|
||||
{ ELanguage::English, "Example" },
|
||||
{ ELanguage::French, "Example" },
|
||||
{ ELanguage::Spanish, "Example" },
|
||||
{ ELanguage::German, "Example" },
|
||||
{ ELanguage::Italian, "Example" },
|
||||
{ ELanguage::Japanese, "Example" }
|
||||
}
|
||||
|
||||
- Japanese localization should use furigana for message windows, options items,
|
||||
options descriptions and installer text.
|
||||
|
||||
Furigana should be included in the text as such:
|
||||
"[私:わたし]はジョージです。"
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
|
||||
std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_locale =
|
||||
std::unordered_map<std::string_view, std::unordered_map<ELanguage, std::string>> g_locale =
|
||||
{
|
||||
{
|
||||
"Options_Header_Name",
|
||||
{
|
||||
{ ELanguage::English, "OPTIONS" },
|
||||
{ ELanguage::English, "OPTIONS" },
|
||||
{ ELanguage::Japanese, "OPTION" },
|
||||
{ ELanguage::German, "OPTIONEN" },
|
||||
{ ELanguage::French, "OPTIONS" },
|
||||
{ ELanguage::Spanish, "OPCIONES" },
|
||||
{ ELanguage::Italian, "OPZIONI" }
|
||||
{ ELanguage::German, "OPTIONEN" },
|
||||
{ ELanguage::French, "OPTIONS" },
|
||||
{ ELanguage::Spanish, "OPCIONES" },
|
||||
{ ELanguage::Italian, "OPZIONI" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Options_Category_System",
|
||||
{
|
||||
{ ELanguage::English, "SYSTEM" }
|
||||
{ ELanguage::English, "SYSTEM" },
|
||||
{ ELanguage::Japanese, "SYSTEM" },
|
||||
{ ELanguage::German, "SYSTEM" },
|
||||
{ ELanguage::French, "SYSTÈME" },
|
||||
{ ELanguage::Spanish, "SISTEMA" },
|
||||
{ ELanguage::Italian, "SISTEMA" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Options_Category_Input",
|
||||
{
|
||||
{ ELanguage::English, "INPUT" }
|
||||
{ ELanguage::English, "INPUT" },
|
||||
{ ELanguage::Japanese, "INPUT" },
|
||||
{ ELanguage::German, "EINGABE" },
|
||||
{ ELanguage::French, "COMMANDES" },
|
||||
{ ELanguage::Spanish, "CONTROLES" },
|
||||
{ ELanguage::Italian, "COMANDI" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Options_Category_Audio",
|
||||
{
|
||||
{ ELanguage::English, "AUDIO" }
|
||||
{ ELanguage::English, "AUDIO" },
|
||||
{ ELanguage::Japanese, "AUDIO" },
|
||||
{ ELanguage::German, "AUDIO" },
|
||||
{ ELanguage::French, "SON" },
|
||||
{ ELanguage::Spanish, "AUDIO" },
|
||||
{ ELanguage::Italian, "AUDIO" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Options_Category_Video",
|
||||
{
|
||||
{ ELanguage::English, "VIDEO" }
|
||||
{ ELanguage::English, "VIDEO" },
|
||||
{ ELanguage::Japanese, "VIDEO" },
|
||||
{ ELanguage::German, "VIDEO" },
|
||||
{ ELanguage::French, "AFFICHAGE" },
|
||||
{ ELanguage::Spanish, "VÍDEO" },
|
||||
{ ELanguage::Italian, "VIDEO" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: integer values in the options menu (e.g. FPS) when at their maximum value.
|
||||
"Options_Value_Max",
|
||||
{
|
||||
{ ELanguage::English, "MAX" }
|
||||
{ ELanguage::English, "MAX" },
|
||||
{ ELanguage::Japanese, "MAX" },
|
||||
{ ELanguage::German, "MAX" },
|
||||
{ ELanguage::French, "MAX" },
|
||||
{ ELanguage::Spanish, "MÁX" },
|
||||
{ ELanguage::Italian, "MAX" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Options_Name_WindowSize",
|
||||
{
|
||||
{ ELanguage::English, "Window Size" }
|
||||
{ ELanguage::English, "Window Size" },
|
||||
{ ELanguage::Japanese, "ウィンドウサイズ" },
|
||||
{ ELanguage::German, "Fenstergröße" },
|
||||
{ ELanguage::French, "Taille de la fenêtre" },
|
||||
{ ELanguage::Spanish, "Tamaño de ventana" },
|
||||
{ ELanguage::Italian, "Dimensioni della finestra" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_WindowSize",
|
||||
{
|
||||
{ ELanguage::English, "Adjust the size of the game window in windowed mode." }
|
||||
{ ELanguage::English, "Adjust the size of the game window in windowed mode." },
|
||||
{ ELanguage::Japanese, "ゲームの\u200Bウィンドウサイズを\u200B[設定:せってい]できます" },
|
||||
{ ELanguage::German, "Passe die Fenstergröße des Spiels im Fenstermodus an." },
|
||||
{ ELanguage::French, "Définir la résolution de jeu en mode fenêtré." },
|
||||
{ ELanguage::Spanish, "Ajusta el tamaño de la ventana de juego en modo ventana." },
|
||||
{ ELanguage::Italian, "Regola la dimensione della finestra del gioco in modalità finestra." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: description for options that cannot be accessed anywhere but the title screen or world map (e.g. Language).
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_NotAvailable",
|
||||
{
|
||||
{ ELanguage::English, "This option is not available at this location." }
|
||||
{ ELanguage::English, "This option is not available at this location." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200B[現在:げんざい]の\u200B[画面:がめん]で\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option ist an dieser Stelle nicht verfügbar." },
|
||||
{ ELanguage::French, "Cette option n'est pas disponible pour l'instant." },
|
||||
{ ELanguage::Spanish, "Esta opción no está disponible en este momento." },
|
||||
{ ELanguage::Italian, "Questa opzione non può essere modificata in questo momento." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: currently the description for Window Size when in fullscreen.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_NotAvailableFullscreen",
|
||||
{
|
||||
{ ELanguage::English, "This option is not available in fullscreen mode." }
|
||||
{ ELanguage::English, "This option is not available in fullscreen mode." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200Bフルスクリーンモードで\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option ist im Vollbildmodus nicht verfügbar." },
|
||||
{ ELanguage::French, "Cette option n'est pas disponible en mode plein écran." },
|
||||
{ ELanguage::Spanish, "Esta opción no está disponible en modo pantalla completa." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile in modalità schermo pieno." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: currently the description for Monitor when in fullscreen.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_NotAvailableWindowed",
|
||||
{
|
||||
{ ELanguage::English, "This option is not available in windowed mode." }
|
||||
{ ELanguage::English, "This option is not available in windowed mode." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200Bウィンドウモードで\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option ist im Fenstermodus nicht verfügbar." },
|
||||
{ ELanguage::French, "Cette option n'est pas disponible en mode fenêtré." },
|
||||
{ ELanguage::Spanish, "Esta opción no está disponible en modo ventana." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile in modalità finestra." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: currently the description for Monitor when the user only has one display connected.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_NotAvailableHardware",
|
||||
{
|
||||
{ ELanguage::English, "This option is not available with your current hardware configuration." }
|
||||
{ ELanguage::English, "This option is not available with your current hardware configuration." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200B[現在:げんざい]の\u200Bハードウェア[構成:こうせい]で\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option ist mit der momentanen Hardwarekonfiguration nicht verfügbar." },
|
||||
{ ELanguage::French, "Cette option n'est pas disponible avec votre configuration matérielle actuelle." },
|
||||
{ ELanguage::Spanish, "Esta opción no está disponible con tu configuración actual de hardware." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile con l'hardware in tuo possesso." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: description for Transparency Anti-Aliasing when MSAA is disabled.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_NotAvailableMSAA",
|
||||
{
|
||||
{ ELanguage::English, "This option is not available without MSAA." }
|
||||
{ ELanguage::English, "This option is not available without MSAA." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200BMSAAなしで\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option ist ohne MSAA nicht verfügbar." },
|
||||
{ ELanguage::French, "Cette option n'est pas disponible sans MSAA." },
|
||||
{ ELanguage::Spanish, "Esta opción no está disponible sin MSAA." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile senza MSAA." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: description for Music Attenuation when the user is not running a supported OS.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Desc_OSNotSupported",
|
||||
{
|
||||
{ ELanguage::English, "This option is not supported by your operating system." }
|
||||
{ ELanguage::English, "This option is not supported by your operating system." },
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200B[現在:げんざい]の\u200BOSで\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option wird von diesem Betriebssystem nicht unterstützt." },
|
||||
{ ELanguage::French, "Cette option n'est pas prise en charge par votre système d'exploitation." },
|
||||
{ ELanguage::Spanish, "Esta opción no está soportada por tu sistema operativo." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile con il tuo sistema operativo." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when changing the Language option and backing out of the options menu.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Options_Message_Restart",
|
||||
{
|
||||
{ ELanguage::English, "The game will now restart." }
|
||||
{ ELanguage::English, "The game will now restart." },
|
||||
{ ELanguage::Japanese, "ゲームが[再起動:さいきどう]されます" },
|
||||
{ ELanguage::German, "Das Spiel wird jetzt neu starten." },
|
||||
{ ELanguage::French, "Le jeu va maintenant redémarrer." },
|
||||
{ ELanguage::Spanish, "El juego se va a reiniciar." },
|
||||
{ ELanguage::Italian, "Il gioco verrà riavviato." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: used for the button guide at the pause menu.
|
||||
"Achievements_Name",
|
||||
{
|
||||
{ ELanguage::English, "Achievements" }
|
||||
{ ELanguage::English, "Achievements" },
|
||||
{ ELanguage::Japanese, "実績" },
|
||||
{ ELanguage::German, "Erfolge" },
|
||||
{ ELanguage::French, "Succès" },
|
||||
{ ELanguage::Spanish, "Logros" },
|
||||
{ ELanguage::Italian, "Obiettivi" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: used for the header in the achievements menu.
|
||||
"Achievements_Name_Uppercase",
|
||||
{
|
||||
{ ELanguage::English, "ACHIEVEMENTS" }
|
||||
{ ELanguage::English, "ACHIEVEMENTS" },
|
||||
{ ELanguage::Japanese, "実績" },
|
||||
{ ELanguage::German, "ERFOLGE" },
|
||||
{ ELanguage::French, "SUCCÈS" },
|
||||
{ ELanguage::Spanish, "LOGROS" },
|
||||
{ ELanguage::Italian, "OBIETTIVI" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Achievements_Unlock",
|
||||
{
|
||||
{ ELanguage::English, "Achievement Unlocked!" }
|
||||
{ ELanguage::English, "Achievement Unlocked!" },
|
||||
{ ELanguage::Japanese, "実績のロックが解除されました" },
|
||||
{ ELanguage::German, "Erfolg Freigeschaltet!" },
|
||||
{ ELanguage::French, "Succès déverrouillé !" },
|
||||
{ ELanguage::Spanish, "¡Logro desbloqueado!" },
|
||||
{ ELanguage::Italian, "Obiettivo sbloccato!" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Header_Installer",
|
||||
{
|
||||
{ ELanguage::English, "INSTALLER" },
|
||||
{ ELanguage::Spanish, "INSTALADOR" },
|
||||
{ ELanguage::Italian, "INSTALLATORE" },
|
||||
{ ELanguage::English, "INSTALLER" },
|
||||
{ ELanguage::Japanese, "INSTALL" },
|
||||
{ ELanguage::German, "INSTALLATION" },
|
||||
{ ELanguage::French, "INSTALLATEUR" },
|
||||
{ ELanguage::Spanish, "INSTALADOR" },
|
||||
{ ELanguage::Italian, "INSTALLATORE" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"Installer_Header_Installing",
|
||||
{
|
||||
{ ELanguage::English, "INSTALLING" },
|
||||
{ ELanguage::Spanish, "INSTALANDO" },
|
||||
{ ELanguage::Italian, "INSTALLANDO" },
|
||||
{ ELanguage::English, "INSTALLING" },
|
||||
{ ELanguage::Japanese, "INSTALL" },
|
||||
{ ELanguage::German, "INSTALLATION" },
|
||||
{ ELanguage::French, "INSTALLATION" },
|
||||
{ ELanguage::Spanish, "INSTALANDO" },
|
||||
{ ELanguage::Italian, "INSTALLANDO" },
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_SelectLanguage",
|
||||
{
|
||||
{ ELanguage::English, "Please select a language." },
|
||||
{ ELanguage::Italian, "Seleziona una lingua." }
|
||||
{ ELanguage::English, "Please select a language." },
|
||||
{ ELanguage::Japanese, "[言語:げんご]を[選択:せんたく]してください" },
|
||||
{ ELanguage::German, "Bitte eine Sprache auswählen." },
|
||||
{ ELanguage::French, "Choisissez une langue." },
|
||||
{ ELanguage::Spanish, "Selecciona un idioma." },
|
||||
{ ELanguage::Italian, "Seleziona una lingua." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_Introduction",
|
||||
{
|
||||
{ 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\nUnleashed Recompiled!\n\nDovrai avere una copia di\nSonic Unleashed per la Xbox 360\nper proseguire con l'installazione." }
|
||||
{ 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::Japanese, "Unleashed Recompiledへようこそ!\nインストールにはXbox 360[版:ばん]の\n「ソニック ワールドアドベンチャー」\nが必要です" },
|
||||
{ ELanguage::German, "Willkommen zu\nUnleashed Recompiled!\nEs wird eine Xbox 360 Kopie von Sonic Unleashed benötigt um mit der Installation fortfahren zu können." },
|
||||
{ ELanguage::French, "Bienvenue sur\nUnleashed Recompiled !\n\nVous aurez besoin d'une copie de Sonic Unleashed pour Xbox\n360 pour procéder à l'installation." },
|
||||
{ ELanguage::Spanish, "¡Bienvenido a\nUnleashed Recompiled!\n\nNecesitas una copia de\nSonic Unleashed de Xbox 360\npara continuar con la instalación." },
|
||||
{ ELanguage::Italian, "Benvenuto a\nUnleashed Recompiled!\n\nDovrai avere una copia di\nSonic Unleashed per la Xbox 360\nper proseguire con l'installazione." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_SelectGameAndUpdate",
|
||||
{
|
||||
{ ELanguage::English, "Add the sources for the game and its title update." }
|
||||
{ ELanguage::English, "Add the sources for the game and its title update." },
|
||||
{ ELanguage::Japanese, "ゲームのソースとタイトルアップデート\nを[追加:ついか]" },
|
||||
{ ELanguage::German, "Füge die Quellen für das Spiel und dessen Update hinzu." },
|
||||
{ ELanguage::French, "Ajouter les fichiers du jeu ainsi que ses mises à jour." },
|
||||
{ ELanguage::Spanish, "Añade las fuentes para el juego y su actualización." },
|
||||
{ ELanguage::Italian, "Aggiungi le fonti per il gioco e per il suo file d'aggiornamento." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_SelectDLC",
|
||||
{
|
||||
{ ELanguage::English, "Add the sources for the DLC." }
|
||||
{ ELanguage::English, "Add the sources for the DLC." },
|
||||
{ ELanguage::Japanese, "DLCのソースを[追加:ついか]" },
|
||||
{ ELanguage::German, "Füge die Quellen für die Erweiterungen des Spiels hinzu." },
|
||||
{ ELanguage::French, "Ajouter les fichiers pour les DLCs." },
|
||||
{ ELanguage::Spanish, "Añade las fuentes para el DLC." },
|
||||
{ ELanguage::Italian, "Aggiungi le fonti per i DLC." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_CheckSpace",
|
||||
{
|
||||
{ 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.\n\n" }
|
||||
{ ELanguage::English, "The content will be installed to the program's folder.\n\n" },
|
||||
{ ELanguage::Japanese, "コンテンツはプログラムのフォルダに\nインストールされます\n" },
|
||||
{ ELanguage::German, "Der Inhalt wird in dem Ordner des Programms installiert.\n" },
|
||||
{ ELanguage::French, "Le contenu sera installé dans le même dossier que le programme.\n" },
|
||||
{ ELanguage::Spanish, "El contenido será instalado a la carpeta del programa.\n\n" },
|
||||
{ ELanguage::Italian, "Il contenuto verrà installato nella cartella di questo programma.\n\n" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_Installing",
|
||||
{
|
||||
{ ELanguage::English, "Please wait while the content is being installed..." },
|
||||
{ ELanguage::Italian, "Attendi mentre il contenuto viene installato... " }
|
||||
{ ELanguage::English, "Please wait while the content is being installed..." },
|
||||
{ ELanguage::Japanese, "コンテンツのインストール[中:ちゅう]はお[待:ま]ち\nください" },
|
||||
{ ELanguage::German, "Bitte warten. Der Inhalt wird installiert..." },
|
||||
{ ELanguage::French, "Veuillez patienter pendant l'installation du contenu..." },
|
||||
{ ELanguage::Spanish, "Por favor, espera mientras el contenido se instala... " },
|
||||
{ ELanguage::Italian, "Attendi mentre il contenuto viene installato... " }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_InstallSucceeded",
|
||||
{
|
||||
{ ELanguage::English, "Installation complete!\nThis project is brought to you by:" }
|
||||
{ ELanguage::English, "Installation complete!\nThis project is brought to you by:" },
|
||||
{ ELanguage::Japanese, "インストール[完了:かんりょう]!\nプロジェクト[制作:せいさく]:" },
|
||||
{ ELanguage::German, "Installation abgeschlossen!\nDieses Projekt wird präsentiert von:" },
|
||||
{ ELanguage::French, "Installation terminée !\nCe projet vous est présenté par:" },
|
||||
{ ELanguage::Spanish, "¡Instalación completada!\nEste proyecto ha sido posible gracias a:" },
|
||||
{ ELanguage::Italian, "Installazione completata!\nQuesto progetto è stato creato da:" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Page_InstallFailed",
|
||||
{
|
||||
{ ELanguage::English, "Installation failed.\n\nError:\n\n" },
|
||||
{ ELanguage::Italian, "Installazione fallita.\n\nErrore:\n\n" }
|
||||
{ ELanguage::English, "Installation failed.\n\nError: " },
|
||||
{ ELanguage::Japanese, "インストールに[失敗:しっぱい]しました\n\nエラー: " },
|
||||
{ ELanguage::German, "Installation fehlgeschlagen.\n\nFehler: " },
|
||||
{ ELanguage::French, "L'installation a échoué.\n\nErreur : " },
|
||||
{ ELanguage::Spanish, "La instalación falló.\n\nError: " },
|
||||
{ ELanguage::Italian, "Installazione fallita.\n\nErrore: " }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Step_Game",
|
||||
{
|
||||
{ ELanguage::English, "GAME" },
|
||||
{ ELanguage::Italian, "GIOCO" }
|
||||
{ ELanguage::English, "GAME" },
|
||||
{ ELanguage::Japanese, "ゲーム" },
|
||||
{ ELanguage::German, "SPIEL" },
|
||||
{ ELanguage::French, "JEU" },
|
||||
{ ELanguage::Spanish, "JUEGO" },
|
||||
{ ELanguage::Italian, "GIOCO" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Step_Update",
|
||||
{
|
||||
{ ELanguage::English, "UPDATE" },
|
||||
{ ELanguage::Italian, "AGGIORNAMENTO" }
|
||||
{ ELanguage::English, "UPDATE" },
|
||||
{ ELanguage::Japanese, "アップデート" },
|
||||
{ ELanguage::German, "UPDATE" },
|
||||
{ ELanguage::French, "MISE À JOUR" },
|
||||
{ ELanguage::Spanish, "ACTUALIZACIÓN" },
|
||||
{ ELanguage::Italian, "AGGIORNAMENTO" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Step_RequiredSpace",
|
||||
{
|
||||
{ ELanguage::English, "Required space: %2.2f GiB" },
|
||||
{ ELanguage::Italian, "Spazio necessario: %2.2f GiB" }
|
||||
{ ELanguage::English, "Required space: %2.2f GiB" },
|
||||
{ ELanguage::Japanese, "[必要:ひつよう]な[容量:ようりょう]: %2.2f GiB" },
|
||||
{ ELanguage::German, "Benötigter Speicherplatz:\n%2.2f GiB" },
|
||||
{ ELanguage::French, "Espace nécessaire :\n%2.2f Gio" },
|
||||
{ ELanguage::Spanish, "Espacio necesario: %2.2f GiB" },
|
||||
{ ELanguage::Italian, "Spazio necessario: %2.2f GiB" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Step_AvailableSpace",
|
||||
{
|
||||
{ ELanguage::English, "Available space: %2.2f GiB" },
|
||||
{ ELanguage::Italian, "Spazio disponibile: %2.2f GiB" }
|
||||
{ ELanguage::English, "Available space: %2.2f GiB" },
|
||||
{ ELanguage::Japanese, "[使用:しよう][可能:かのう]な[容量:ようりょう]: %2.2f GiB" },
|
||||
{ ELanguage::German, "Verfügbarer Speicherplatz:\n%2.2f GiB" },
|
||||
{ ELanguage::French, "Espace disponible :\n%2.2f Gio" },
|
||||
{ ELanguage::Spanish, "Espacio disponible: %2.2f GiB" },
|
||||
{ ELanguage::Italian, "Spazio disponibile: %2.2f GiB" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Button_Next",
|
||||
{
|
||||
{ ELanguage::English, "NEXT" },
|
||||
{ ELanguage::Spanish, "SIGUIENTE" },
|
||||
{ ELanguage::German, "WEITER" },
|
||||
{ ELanguage::Italian, "CONTINUA" }
|
||||
{ ELanguage::English, "NEXT" },
|
||||
{ ELanguage::Japanese, "次へ" },
|
||||
{ ELanguage::German, "WEITER" },
|
||||
{ ELanguage::French, "SUIVANT" },
|
||||
{ ELanguage::Spanish, "SIGUIENTE" },
|
||||
{ ELanguage::Italian, "CONTINUA" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Button_Skip",
|
||||
{
|
||||
{ ELanguage::English, "SKIP" },
|
||||
{ ELanguage::Spanish, "SALTAR" },
|
||||
{ ELanguage::German, "ÜBERSPRINGEN" },
|
||||
{ ELanguage::Italian, "SALTA" }
|
||||
{ ELanguage::English, "SKIP" },
|
||||
{ ELanguage::Japanese, "スキップ" },
|
||||
{ ELanguage::German, "ÜBERSPRINGEN" },
|
||||
{ ELanguage::French, "IGNORER" },
|
||||
{ ELanguage::Spanish, "SALTAR" },
|
||||
{ ELanguage::Italian, "SALTA" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Button_Retry",
|
||||
{
|
||||
{ ELanguage::English, "RETRY" }
|
||||
{ ELanguage::English, "RETRY" },
|
||||
{ ELanguage::Japanese, "リトライ" },
|
||||
{ ELanguage::German, "ERNEUT VERSUCHEN" },
|
||||
{ ELanguage::French, "RÉESSAYER" },
|
||||
{ ELanguage::Spanish, "REINTENTAR" },
|
||||
{ ELanguage::Italian, "RIPROVA" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Button_AddFiles",
|
||||
{
|
||||
{ ELanguage::English, "ADD FILES" },
|
||||
{ ELanguage::Spanish, "AÑADIR ARCHIVOS" },
|
||||
{ ELanguage::German, "DATEIEN HINZUFÜGEN" },
|
||||
{ ELanguage::Italian, "AGGIUNGI FILE" }
|
||||
{ ELanguage::English, "ADD FILES" },
|
||||
{ ELanguage::Japanese, "ファイルを追加" },
|
||||
{ ELanguage::German, "DATEIEN HINZUFÜGEN" },
|
||||
{ ELanguage::French, "AJOUTER DES FICHIERS" },
|
||||
{ ELanguage::Spanish, "AÑADIR ARCHIVOS" },
|
||||
{ ELanguage::Italian, "AGGIUNGI FILE" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Installer_Button_AddFolder",
|
||||
{
|
||||
{ ELanguage::English, "ADD FOLDER" },
|
||||
{ ELanguage::Spanish, "AÑADIR CARPETA" },
|
||||
{ ELanguage::German, "ORDNER HINZUFÜGEN" },
|
||||
{ ELanguage::Italian, "AGGIUNGI CARTELLA" }
|
||||
{ ELanguage::English, "ADD FOLDER" },
|
||||
{ ELanguage::Japanese, "フォルダを追加" },
|
||||
{ ELanguage::German, "ORDNER HINZUFÜGEN" },
|
||||
{ ELanguage::French, "AJOUTER UN DOSSIER" },
|
||||
{ ELanguage::Spanish, "AÑADIR CARPETA" },
|
||||
{ ELanguage::Italian, "AGGIUNGI CARTELLA" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when using the "Add Files" option and choosing any file that is not an Xbox 360 game dump.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_InvalidFilesList",
|
||||
{
|
||||
{ ELanguage::English, "The following selected files are invalid:" },
|
||||
{ ELanguage::Italian, "I seguenti file non sono validi:" }
|
||||
{ ELanguage::English, "The following selected files are invalid:" },
|
||||
{ ELanguage::Japanese, "[選択:せんたく]した[次:つぎ]のファイルは[無効:むこう]です:" },
|
||||
{ ELanguage::German, "Die folgenden Dateien sind ungültig:" },
|
||||
{ ELanguage::French, "Les fichiers suivants ne sont pas valides :" },
|
||||
{ ELanguage::Spanish, "Los siguientes archivos no son válidos:" },
|
||||
{ ELanguage::Italian, "I seguenti file non sono validi:" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears in the event there are some invalid files after adding the DLC and moving onto the next step.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_InvalidFiles",
|
||||
{
|
||||
{ ELanguage::English, "Some of the files that have\nbeen provided are not valid.\n\nPlease make sure all the\nspecified files are correct\nand try again." },
|
||||
{ ELanguage::Italian, "Alcuni dei file che sono stati\nselezionati non sono validi.\n\nAssicurati che tutti\ni file sono quelli corretti\ne riprova." }
|
||||
{ ELanguage::English, "Some of the files that have\nbeen provided are not valid.\n\nPlease make sure all the\nspecified files are correct\nand try again." },
|
||||
{ ELanguage::Japanese, "[提供:ていきょう]されたファイルの[一部:いちぶ]が[有効:ゆうこう]ではありません\n[指定:してい]されたファイルがすべて[正:ただ]しいことを[確認:かくにん]して\nもう[一度:いちど]お[試:ため]しください" },
|
||||
{ ELanguage::German, "Einige Dateien, die bereitgestellt\nwurden sind ungültig.\n\nBitte stelle sicher, dass\ndie angegebenen Dateien korrekt\nsind und versuche es erneut." },
|
||||
{ ELanguage::French, "Certains fichiers fournis ne\nsont pas valides.\n\nVeuillez vous assurer que tous\nles fichiers spécifiés sont\ncorrects et réessayez." },
|
||||
{ ELanguage::Spanish, "Algunos de los archivos\nseleccionados no son válidos.\n\nPor favor, asegúrate de que\ntodos los archivos son correctos\ne inténtalo de nuevo.\n" },
|
||||
{ ELanguage::Italian, "Alcuni dei file che sono stati\nselezionati non sono validi.\n\nAssicurati che tutti\ni file sono quelli corretti\ne riprova." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when clicking the "Add Files" option for the first time.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_FilePickerTutorial",
|
||||
{
|
||||
{ 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." },
|
||||
{ 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." },
|
||||
{ ELanguage::Japanese, "ゲームのコンテンツを[含:ふく]む デジタルダンプを[選択:せんたく]してください\n\nこれらのファイルは GitHubページの[指示:しじ]に[従:したが]って\nXbox 360ハードドライブから[取得:しゅとく]できます\n\n[抽出:ちゅうしゅつ]された[変更:へんこう]されていない\nゲームファイルを[含:ふく]むフォルダーを[選択:せんたく]するには\n[代:か]わりに「フォルダの[追加:ついか]」オプションを[使用:しよう]してください" },
|
||||
{ ELanguage::German, "Wähle einen digitalen Dump von dem Spiel.\n\nDie Dateien können über die Festplatte deiner\nXbox 360 erlangt werden.\nFolge hierfür den Anweisungen auf der GitHub Seite.\n\nUm einen Ordner mit unmodifizierten Spieldateien auszuwählen, benutze die \"Ordner Hinzufügen\" Option stattdessen." },
|
||||
{ ELanguage::French, "Sélectionnez une copie\ndématérialisée avec le contenu du\njeu de base.\n\nCes fichiers peuvent être obtenus\nà partir du disque dur de votre\nXbox 360 en suivant les\ninstructions de la page GitHub.\n\nPour choisir un dossier contenant\nles fichiers de jeu extraits et\nnon modifiés, utilisez plutôt\nl'option \"Ajouter un dossier\"." },
|
||||
{ ELanguage::Spanish, "Selecciona una copia digital\ncon contenido del juego.\n\nPuedes obtener los archivos\nde tu disco duro de Xbox 360\nsiguiendo las instrucciones de\nla página de GitHub.\n\nPara elegir una carpeta con\narchivos extraídos sin modificar,\nutiliza la opción \"Añadir Carpeta\"." },
|
||||
{ ELanguage::Italian, "Seleziona una copia digitale\ncon i contenuti del gioco.\n\nQuesti file possono essere ottenuti\ndall'hard drive della tua Xbox 360\nseguendo le istruzioni\nsulla pagina GitHub.\n\nPer selezionare una cartella\ncon file estratti e non modificati\nusa l'opzione \"Aggiungi cartella\"." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when clicking the "Add Folder" option for the first time.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_FolderPickerTutorial",
|
||||
{
|
||||
{ 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." },
|
||||
{ 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." },
|
||||
{ ELanguage::Japanese, "ゲームから[抽出:ちゅうしゅつ]された[変更:へんこう]されていない\nファイルを含むフォルダを[選択:せんたく]してください\n\nこれらのファイルは GitHubページの[指示:しじ]に[従:したが]って\nXbox 360ハードドライブから[取得:しゅとく]できます\n\nデジタルダンプを[選択:せんたく]するには\n[代:か]わりに「ファイルの[追加:ついか]」オプションを[使用:しよう]してください" },
|
||||
{ ELanguage::German, "Wähle einen Ordner, der unmodifizierte Dateien, die vom Spiel extrahiert wurden enthält.\n\nDie Dateien können über die Festplatte deiner\nXbox 360 erlangt werden.\nFolge hierfür den Anweisungen auf der GitHub Seite.\n\nUm einen digitalen Dump auszuwählen, benutze die \"Datei Hinzufügen\" Option stattdessen." },
|
||||
{ ELanguage::French, "Sélectionnez un dossier contenant\nles fichiers extraits du jeu de\nbase.\n\nCes fichiers peuvent être obtenus\nà partir du disque dur de votre\nXbox 360 en suivant les\ninstructions de la page GitHub.\n\nPour choisir une copie\ndématérialisée, utilisez plutôt\nl'option \"Ajouter des fichiers\"." },
|
||||
{ ELanguage::Spanish, "Selecciona una carpeta que\ncontenga los archivos sin\nmodificar extraídos del juego.\n\nPuedes obtener los archivos\nde tu disco duro de Xbox 360\nsiguiendo las instrucciones de\nla página de GitHub.\n\nPara elegir una copia digital,\nutiliza la opción \"Añadir Archivos\"." },
|
||||
{ ELanguage::Italian, "Seleziona una cartella che contiene\ni file non modificati che sono stati\nestratti dal gioco.\n\nQuesti file possono essere ottenuti\ndall'hard drive della tua Xbox 360\nseguendo le istruzioni\nsulla pagina GitHub.\n\nPer selezionare una copia digitale\nusa l'opzione \"Aggiungi file\"." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when providing a title update that does not match the region or version of the game dump.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_IncompatibleGameData",
|
||||
{
|
||||
{ ELanguage::English, "The specified game and\ntitle update are incompatible.\n\nPlease ensure the files are\nfor the same version and\nregion and try again." },
|
||||
{ ELanguage::Italian, "I file del gioco\ne dell'aggiornamento sono incompatibili.\n\nAssicurati che i file sono\ndella stessa versione\ne regione e riprova." }
|
||||
{ ELanguage::English, "The specified game and\ntitle update are incompatible.\n\nPlease ensure the files are\nfor the same version and\nregion and try again." },
|
||||
{ ELanguage::Japanese, "[指定:してい]されたゲームとタイトルアップデートは[互換性:ごかんせい]がありません\n\nファイルのバージョンと[地域:ちいき]が\n[同:おな]じであることを[確認:かくにん]して\nもう[一度:いちど]お[試:ため]しください" },
|
||||
{ ELanguage::German, "Die ausgewählten Spiel- und\nUpdatedateien sind inkompatibel.\n\nBitte stelle sicher, dass\ndie Dateien für die selbe\nVersion und Region vorgesehen sind\nund versuche es erneut." },
|
||||
{ ELanguage::French, "Les fichiers du jeu et la mise à\njour sont incompatibles.\n\nVeuillez vous assurer que les\nfichiers sont pour la même\nversion/région puis réessayez." },
|
||||
{ ELanguage::Spanish, "El juego seleccionado\ny su actualización son incompatibles.\n\nPor favor, asegúrate de que que los archivos\nson de la misma versión y\nregión e inténtalo de nuevo." },
|
||||
{ ELanguage::Italian, "I file del gioco\ne dell'aggiornamento sono incompatibili.\n\nAssicurati che i file sono\ndella stessa versione\ne regione e riprova." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when clicking Skip at the DLC step.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_DLCWarning",
|
||||
{
|
||||
{ ELanguage::English, "It is highly recommended\nthat you install all of the\nDLC, as it includes high\nquality lighting textures\nfor the base game.\n\nAre you sure you want to\nskip this step?" },
|
||||
{ ELanguage::Italian, "Si consiglia di installare\ntutti i DLC, poichè includono\ntexture di illuminazione di qualità migliore.\n\nSei sicuro di voler saltare?" }
|
||||
{ ELanguage::English, "It is highly recommended\nthat you install all of the\nDLC, as it includes high\nquality lighting textures\nfor the base game.\n\nAre you sure you want to\nskip this step?" },
|
||||
{ ELanguage::Japanese, "ベースゲーム[用:よう]の[高品質:こうひんしつ]の\n[照明:しょうめい]テクスチャが[含:ふく]まれているため\nすべてのDLCをインストールすることを\n[強:つよ]くお[勧:すす]めします\n\nこの[手順:てじゅん]をスキップしてもよろしいですか?" },
|
||||
{ ELanguage::German, "Es wird empgohlen alle Erweiterungen zu installieren, da sie Beleuchtungs-Texturen in einer höheren Qualität für das Basisspiel beinhalten.\n\nBist du dir sicher, dass du diesen Schritt überspringen möchtest?" },
|
||||
{ ELanguage::French, "Il est fortement recommandé\nd'installer l'ensemble du\nDLC car elle inclut des\ntextures de lumière de\nhaute qualité pour le jeu\nde base.\n\nÊtes-vous sûr de vouloir\nignorer cette étape ?" },
|
||||
{ ELanguage::Spanish, "Se recomienda encarecidamente\ninstalar todo el DLC, ya que\ncontiene texturas de iluminación\nde alta calidad para el juego base.\n\n¿Seguro que quieres saltar este paso?" },
|
||||
{ ELanguage::Italian, "Si consiglia di installare\ntutti i DLC, poichè includono\ntexture di illuminazione di qualità migliore.\n\nSei sicuro di voler saltare?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when choosing the Install option at the title screen when the user is missing DLC content.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_TitleMissingDLC",
|
||||
{
|
||||
{ ELanguage::English, "This will restart the game to\nallow you to install any DLC\nthat you are missing.\n\nInstalling DLC will improve the\nlighting quality across the game.\n\nWould you like to install missing\ncontent?" },
|
||||
{ ELanguage::Italian, "Questa opzione riavviera il gioco\nper farti installare qualsiasi DLC\nche non hai installato.\n\nL'installazione dei DLC migliorerà la qualità\ndell'illuminazione del gioco.\n\nVuoi installare i DLC mancanti?" }
|
||||
{ ELanguage::English, "This will restart the game to\nallow you to install any DLC\nthat you are missing.\n\nInstalling DLC will improve the\nlighting quality across the game.\n\nWould you like to install missing\ncontent?" },
|
||||
{ ELanguage::Japanese, "これによりゲームが[再起動:さいきどう]し[不足:ふそく]しているDLCを\nインストールできるようになります\n\nDLCをインストールすると\nゲーム[全体:ぜんたい]の [照明品質:しょうめいひんしつ] が[向上:こうじょう]します\n\n[不足:ふそく]しているコンテンツを\nインストールしますか?" },
|
||||
{ ELanguage::German, "Das Spiel wird neu gestartet\num die Installation einer fehlenden\nErweiterung zu ermöglichen.\n\nDie Installation einer\nErweiterung erhöht die Qualität\nder Beleuchtung im gesamten Spiel.\n\nMöchtest du den fehlenden\nInhalt installieren?" },
|
||||
{ ELanguage::French, "Cela redémarrera le jeu pour vous\npermettre d'installer les DLC\nmanquants.\n\nL'installation du DLC améliorera\nla qualité de l'éclairage dans le\njeu.\n\nSouhaitez-vous installer le\ncontenu manquant ?" },
|
||||
{ ELanguage::Spanish, "Esta opción reiniciará el juego\npara permitirte instalar los DLC\nque falten.\n\nInstalar el DLC mejorará la calidad\nde iluminación en todo el juego.\n\n¿Quieres instalar el contenido\nque falta?" },
|
||||
{ ELanguage::Italian, "Questa opzione riavviera il gioco\nper farti installare qualsiasi DLC\nche non hai installato.\n\nL'installazione dei DLC migliorerà la qualità\ndell'illuminazione del gioco.\n\nVuoi installare i DLC mancanti?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when choosing the Install option at the title screen when the user is not missing any content.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_Title",
|
||||
{
|
||||
{ ELanguage::English, "This restarts the game to\nallow you to install any DLC\nthat you may be missing.\n\nYou are not currently\nmissing any DLC.\n\nWould you like to proceed\nanyway?" },
|
||||
{ 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::English, "This restarts the game to\nallow you to install any DLC\nthat you may be missing.\n\nYou are not currently\nmissing any DLC.\n\nWould you like to proceed\nanyway?" },
|
||||
{ ELanguage::Japanese, "これによりゲームが[再起動:さいきどう]され\n[不足:ふそく]しているDLCを\nインストールできるようになります\n\n[現在:げんざい] [不足:ふそく]しているDLCはありません\n\nそれでも[続行:ぞっこう]しますか?" },
|
||||
{ ELanguage::German, "Das Spiel wird neu gestartet\num die Installation einer fehlenden\nErweiterung zu ermöglichen.\n\nEs kann keine weitere Erweiterung\ninstalliert werden.\n\nMöchtest du trotzdem fortfahren?" },
|
||||
{ ELanguage::French, "Cela redémarrera le jeu pour vous\npermettre d'installer les DLC\nmanquants.\n\nIl ne vous manque aucun DLC.\n\nVoulez-vous quand même continuer ?" },
|
||||
{ ELanguage::Spanish, "Esto reiniciará el juego\npara permitirte instalar\nlos DLC que falten.\n\nActualmente, no falta ningún\nDLC por instalarse.\n\n¿Quieres continuar de todos\nmodos?" },
|
||||
{ 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.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_Quit",
|
||||
{
|
||||
{ ELanguage::English, "Are you sure you want to quit?" },
|
||||
{ ELanguage::English, "Are you sure you want to quit?" },
|
||||
{ ELanguage::Japanese, "[終了:しゅうりょう]してもよろしいですか?" },
|
||||
{ ELanguage::German, "Installation verlassen?" },
|
||||
{ ELanguage::French, "Êtes-vous sûr de vouloir quitter ?" },
|
||||
{ ELanguage::Spanish, "¿Estás seguro de que quieres\nsalir?" },
|
||||
{ ELanguage::Italian, "Sicuro di voler uscire?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when user chooses "Cancel" during installation.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Installer_Message_Cancel",
|
||||
{
|
||||
{ ELanguage::English, "Are you sure you want to cancel the installation?" },
|
||||
{ ELanguage::English, "Are you sure you want to cancel the installation?" },
|
||||
{ ELanguage::Japanese, "インストールをキャンセルしてもよろしいですか?" },
|
||||
{ ELanguage::German, "Bist du dir sicher, dass du die Installation abbrechen möchtest?" },
|
||||
{ ELanguage::French, "Êtes-vous sûr de vouloir annuler l'installation ?" },
|
||||
{ ELanguage::Spanish, "¿Estás seguro de que quieres cancelar la instalación?" },
|
||||
{ ELanguage::Italian, "Sicuro di voler annullare l'installazione?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Notes: message appears when pressing B at the title screen.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Title_Message_Quit",
|
||||
{
|
||||
{ ELanguage::English, "Are you sure you want to quit?" },
|
||||
{ ELanguage::Italian, "Sei sicuro di voler uscire?" }
|
||||
{ ELanguage::English, "Are you sure you want to quit?" },
|
||||
{ ELanguage::Japanese, "[終了:しゅうりょう]してもよろしいですか?" },
|
||||
{ ELanguage::German, "Spiel verlassen?" },
|
||||
{ ELanguage::French, "Êtes-vous sûr de vouloir quitter ?" },
|
||||
{ ELanguage::Spanish, "¿Estás seguro de que quieres\nsalir?" },
|
||||
{ ELanguage::Italian, "Sicuro di voler uscire ?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -373,40 +633,74 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
||||
// 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::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." }
|
||||
{ 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.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"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." }
|
||||
{ ELanguage::English, "The achievement data appears to be\ncorrupted and cannot be loaded.\n\nProceeding from this point will\nclear your achievement data." },
|
||||
{ ELanguage::Japanese, "[実績:じっせき]データが[破損:はそん]しているため\n[読:よ]み[込:こ]むことができません\n\nこの[先:さき]に[進:すす]むと[実績:じっせき]データが\n[消去:しょうきょ]されます" },
|
||||
{ ELanguage::German, "Die Erfolgsdaten sind möglicherweise\nfehlerhaft und können nicht\ngeladen werden.\n\nDurch das Fortfahren werden\ndeine bisherigen Erfolgsdaten gelöscht." },
|
||||
{ ELanguage::French, "Les données des succès semblent être\nendommagées et ne peuvent être\nchargées.\n\nSi vous continuez, vos données\nseront écrasées." },
|
||||
{ ELanguage::Spanish, "Los datos de logros parecen estar\ncorruptos y no pueden cargarse.\n\nContinuar a partir de este punto\neliminará los datos de logros." },
|
||||
{ ELanguage::Italian, "I file degli obiettivi sembrano danneggiati\ne non possono essere caricati.\n\nSe prosegui da questo punto\ni tuoi obiettivi verranno cancellati." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// 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.
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Title_Message_AchievementDataIOError",
|
||||
{
|
||||
{ ELanguage::English, "The achievement data could not be loaded.\nYour achievements will not be saved." }
|
||||
{ ELanguage::English, "The achievement data could not be loaded.\nYour achievements will not be saved." },
|
||||
{ ELanguage::Japanese, "[実績:じっせき]データを[読:よ]み[込:こ]めませんでした\n[実績:じっせき]は[保存:ほぞん]されません。" },
|
||||
{ ELanguage::German, "Die Erfolgsdaten konnten nicht geladen werden.\nDeine Erfolge werden nicht gespeichert." },
|
||||
{ ELanguage::French, "Les données des succès ne\npeuvent être chargées.\nVos succès ne seront pas\nsauvegardés." },
|
||||
{ ELanguage::Spanish, "Los datos de logros no pueden cargarse.\nTus logros no serán guardados." },
|
||||
{ ELanguage::Italian, "I file degli obiettivi non possono essere caricati.\nI tuoi obiettivi non verranno salvati." }
|
||||
}
|
||||
},
|
||||
{
|
||||
// Japanese Notes: This localization should include furigana.
|
||||
"Title_Message_UpdateAvailable",
|
||||
{
|
||||
{ ELanguage::English, "An update is available!\n\nWould you like to visit the\nreleases page to download it?" }
|
||||
{ ELanguage::English, "An update is available!\n\nWould you like to visit the\nreleases page to download it?" },
|
||||
{ ELanguage::Japanese, "アップデートが[利用:りよう][可能:かのう]です\n\nリリースページにアクセスして\nダウンロードしますか?" },
|
||||
{ ELanguage::German, "Ein Update ist verfügbar!\n\nMöchtest du die Release-Seite\nbesuchen um es herunterzuladen?" },
|
||||
{ ELanguage::French, "Une mise à jour est disponible !\n\nVoulez-vous visiter la page\ndes mises à jour pour la\ntélécharger ?" },
|
||||
{ ELanguage::Spanish, "¡Hay una actualización disponible!\n\n¿Quieres ir a la página\npara descargarla?" },
|
||||
{ ELanguage::Italian, "È disponibile un aggiornamento!\n\nVuoi visitare la pagina releases\nper scaricarlo?" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"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." }
|
||||
{ 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." },
|
||||
{ ELanguage::Japanese, "D3D12 (Windows)または\nVulkanバックエンドを作成できません\n\n次の点を確認してください:\n\n※システムが最小要件を満たしている\n※GPUドライバーが最新である\n※オペレーティングシステムが最新バージョンである" },
|
||||
{ ELanguage::German, "Es ist nicht möglich, ein D3D12 (Windows) oder Vulkan-Backend zu erstellen.\n\nBitte stelle sicher, dass:\n\n- Dein System die Mindestanforderungen erfüllt.\n- Deine GPU-Treiber auf dem neuesten Stand sind.\n- Dein Betriebssystem auf der neuesten verfügbaren Version ist." },
|
||||
{ ELanguage::French, "Impossible de créer un backend D3D12 (Windows) ou Vulkan.\n\nVeuillez vous assurer que :\n\n- Votre système répond aux critères minimums requis.\n- Les pilotes de votre processeur graphique sont à jour.\n- Votre système d'exploitation est à jour." },
|
||||
{ ELanguage::Spanish, "No se puede crear un entorno de D3D12 (Windows) o de Vulkan.\n\nPor favor, asegúrate de que:\n\n- Tu equipo cumple con los requisitos mínimos.\n- Los drivers de tu tarjeta gráfica están actualizados.\n- Tu sistema operativo está actualizado a la última versión.\n" },
|
||||
{ ELanguage::Italian, "Impossibile creare un backend D3D12 (Windows) o Vulkan.\n\nAssicurati che:\n\n- Il tuo sistema soddisfi i requisiti minimi.\n- I driver della scheda grafica siano aggiornati.\n- Il tuo sistema operativo sia aggiornato." }
|
||||
}
|
||||
},
|
||||
{
|
||||
"System_Win32_MissingDLLs",
|
||||
{
|
||||
{ ELanguage::English, "The module \"%s\" could not be found.\n\nPlease make sure that:\n\n- You extracted this copy of Unleashed Recompiled fully and not just the *.exe file.\n- You are not running Unleashed Recompiled from a *.zip file." },
|
||||
{ ELanguage::Japanese, "モジュール\"%s\"が見つかりませんでした\n\n次の点を確認してください:\n\n※Unleashed Recompiledの*.exeファイルだけを抽出していなく、 コピーを完全に抽出してること\n※Unleashed Recompiledを*.zipファイルから実行していないこと" },
|
||||
{ ELanguage::German, "Das Modul \"%s\" konnte nicht gefunden werden.\n\nBitte stelle sicher, dass:\n\n- Diese Kopie von Unleashed Recompiled vollständig entpackt wurde und nicht nur die *.exe-Datei.\n- Unleashed Recompiled nicht direkt aus einer *.zip-Datei ausgeführt wird." },
|
||||
{ ELanguage::French, "Le module \"%s\" n'a pas pu être trouvé.\n\nVeuillez vous assurer que :\n\n- Vous avez extrait Unleashed Recompiled dans son entièreté et pas seulement le fichier *.exe.\n- Vous n'exécutez pas Unleashed Recompiled à partir d'un fichier *.zip." },
|
||||
{ ELanguage::Spanish, "No se pudo encontrar el módulo \"%s\".\n\nAsegúrese de que:\n\n- Ha extraido esta copia de Unleashed Recompiled por completo y no solo el archivo *.exe.\n- No está ejecutando Unleashed Recompiled desde un archivo *.zip." },
|
||||
{ ELanguage::Italian, "Impossibile trovare il modulo \"%s\".\n\nAssicurati che:\n\n- Hai estratto questa copia di Unleashed Recompiled correttamente e non solo il file *.exe.\n- Non stai eseguendo Unleashed Recompiled da un file *.zip." }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -434,82 +728,116 @@ std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_lo
|
||||
{
|
||||
"Common_Yes",
|
||||
{
|
||||
{ ELanguage::English, "Yes" },
|
||||
{ ELanguage::Italian, "Sì" }
|
||||
{ ELanguage::English, "Yes" },
|
||||
{ ELanguage::Japanese, "はい" },
|
||||
{ ELanguage::German, "Ja" },
|
||||
{ ELanguage::French, "Oui" },
|
||||
{ ELanguage::Spanish, "Sí" },
|
||||
{ ELanguage::Italian, "Sì" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_No",
|
||||
{
|
||||
{ ELanguage::English, "No" },
|
||||
{ ELanguage::Italian, "No" }
|
||||
{ ELanguage::English, "No" },
|
||||
{ ELanguage::Japanese, "いいえ" },
|
||||
{ ELanguage::German, "Nein" },
|
||||
{ ELanguage::French, "Non" },
|
||||
{ ELanguage::Spanish, "No" },
|
||||
{ ELanguage::Italian, "No" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Next",
|
||||
{
|
||||
{ ELanguage::English, "Next" },
|
||||
{ ELanguage::Italian, "Continua" }
|
||||
{ ELanguage::English, "Next" },
|
||||
{ ELanguage::Japanese, "次へ" },
|
||||
{ ELanguage::German, "Weiter" },
|
||||
{ ELanguage::French, "Suivant" },
|
||||
{ ELanguage::Spanish, "Siguiente" },
|
||||
{ ELanguage::Italian, "Avanti" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Select",
|
||||
{
|
||||
{ ELanguage::English, "Select" },
|
||||
{ ELanguage::Italian, "Seleziona" }
|
||||
{ ELanguage::English, "Select" },
|
||||
{ ELanguage::Japanese, "決定" },
|
||||
{ ELanguage::German, "Auswählen" },
|
||||
{ ELanguage::French, "Choisir" },
|
||||
{ ELanguage::Spanish, "Seleccionar" },
|
||||
{ ELanguage::Italian, "Seleziona" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Back",
|
||||
{
|
||||
{ ELanguage::English, "Back" },
|
||||
{ ELanguage::Italian, "Indietro" }
|
||||
{ ELanguage::English, "Back" },
|
||||
{ ELanguage::Japanese, "もどる" },
|
||||
{ ELanguage::German, "Zurück" },
|
||||
{ ELanguage::French, "Retour" },
|
||||
{ ELanguage::Spanish, "Atrás" },
|
||||
{ ELanguage::Italian, "Indietro" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Quit",
|
||||
{
|
||||
{ ELanguage::English, "Quit" },
|
||||
{ ELanguage::English, "Quit" },
|
||||
{ ELanguage::Japanese, "終了" },
|
||||
{ ELanguage::German, "Verlassen" },
|
||||
{ ELanguage::French, "Quitter" },
|
||||
{ ELanguage::Spanish, "Salir" },
|
||||
{ ELanguage::Italian, "Esci" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Cancel",
|
||||
{
|
||||
{ ELanguage::English, "Cancel" }
|
||||
{ ELanguage::English, "Cancel" },
|
||||
{ ELanguage::Japanese, "キャンセル" },
|
||||
{ ELanguage::German, "Abbrechen" },
|
||||
{ ELanguage::French, "Annuler" },
|
||||
{ ELanguage::Spanish, "Cancelar" },
|
||||
{ ELanguage::Italian, "Annulla" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Reset",
|
||||
{
|
||||
{ ELanguage::English, "Reset" },
|
||||
{ ELanguage::Italian, "Ripristina" }
|
||||
{ ELanguage::English, "Reset" },
|
||||
{ ELanguage::Japanese, "リセット" },
|
||||
{ ELanguage::German, "Zurücksetzen" },
|
||||
{ ELanguage::French, "Par défaut" },
|
||||
{ ELanguage::Spanish, "Reiniciar" },
|
||||
{ ELanguage::Italian, "Ripristina" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"Common_Switch",
|
||||
{
|
||||
{ ELanguage::English, "Switch" },
|
||||
{ ELanguage::Italian, "Cambia" }
|
||||
{ ELanguage::English, "Switch" },
|
||||
{ ELanguage::Japanese, "きりかえ" },
|
||||
{ ELanguage::German, "Wechseln" },
|
||||
{ ELanguage::French, "Changer" },
|
||||
{ ELanguage::Spanish, "Cambiar" },
|
||||
{ ELanguage::Italian, "Cambia" }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
std::string& Localise(const char* key)
|
||||
std::string& Localise(const std::string_view& key)
|
||||
{
|
||||
if (!g_locale.count(key))
|
||||
return g_localeMissing;
|
||||
|
||||
if (!g_locale[key].count(Config::Language))
|
||||
auto localeFindResult = g_locale.find(key);
|
||||
if (localeFindResult != g_locale.end())
|
||||
{
|
||||
if (g_locale[key].count(ELanguage::English))
|
||||
{
|
||||
return g_locale[key][ELanguage::English];
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_localeMissing;
|
||||
}
|
||||
auto languageFindResult = localeFindResult->second.find(Config::Language);
|
||||
if (languageFindResult == localeFindResult->second.end())
|
||||
languageFindResult = localeFindResult->second.find(ELanguage::English);
|
||||
|
||||
if (languageFindResult != localeFindResult->second.end())
|
||||
return languageFindResult->second;
|
||||
}
|
||||
|
||||
return g_locale[key][Config::Language];
|
||||
return g_localeMissing;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ enum class ELanguage : uint32_t
|
||||
|
||||
inline std::string g_localeMissing = "<missing string>";
|
||||
|
||||
extern std::unordered_map<std::string, std::unordered_map<ELanguage, std::string>> g_locale;
|
||||
extern std::unordered_map<std::string_view, std::unordered_map<ELanguage, std::string>> g_locale;
|
||||
|
||||
std::string& Localise(const char* key);
|
||||
std::string& Localise(const std::string_view& key);
|
||||
|
||||
+68
-20
@@ -1,4 +1,5 @@
|
||||
#include <stdafx.h>
|
||||
#include <cpuid.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <gpu/video.h>
|
||||
#include <kernel/function.h>
|
||||
@@ -27,6 +28,15 @@
|
||||
#include <timeapi.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
|
||||
static std::array<std::string_view, 3> g_D3D12RequiredModules =
|
||||
{
|
||||
"D3D12/D3D12Core.dll",
|
||||
"dxcompiler.dll",
|
||||
"dxil.dll"
|
||||
};
|
||||
#endif
|
||||
|
||||
const size_t XMAIOBegin = 0x7FEA0000;
|
||||
const size_t XMAIOEnd = XMAIOBegin + 0x0000FFFF;
|
||||
|
||||
@@ -106,33 +116,33 @@ uint32_t LdrLoadModule(const std::filesystem::path &path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto* xex = reinterpret_cast<XEX_HEADER*>(loadResult.data());
|
||||
auto security = reinterpret_cast<XEX2_SECURITY_INFO*>((char*)xex + xex->AddressOfSecurityInfo);
|
||||
|
||||
auto format = Xex2FindOptionalHeader<XEX_FILE_FORMAT_INFO>(xex, XEX_HEADER_FILE_FORMAT_INFO);
|
||||
auto entry = *Xex2FindOptionalHeader<uint32_t>(xex, XEX_HEADER_ENTRY_POINT);
|
||||
auto* header = reinterpret_cast<const Xex2Header*>(loadResult.data());
|
||||
auto* security = reinterpret_cast<const Xex2SecurityInfo*>(loadResult.data() + header->securityOffset);
|
||||
const auto* fileFormatInfo = reinterpret_cast<const Xex2OptFileFormatInfo*>(getOptHeaderPtr(loadResult.data(), XEX_HEADER_FILE_FORMAT_INFO));
|
||||
auto entry = *reinterpret_cast<const uint32_t*>(getOptHeaderPtr(loadResult.data(), XEX_HEADER_ENTRY_POINT));
|
||||
ByteSwapInplace(entry);
|
||||
|
||||
auto srcData = (char *)xex + xex->SizeOfHeader;
|
||||
auto destData = (char *)g_memory.Translate(security->ImageBase);
|
||||
if (format->CompressionType == 0)
|
||||
auto srcData = loadResult.data() + header->headerSize;
|
||||
auto destData = reinterpret_cast<uint8_t*>(g_memory.Translate(security->loadAddress));
|
||||
|
||||
if (fileFormatInfo->compressionType == XEX_COMPRESSION_NONE)
|
||||
{
|
||||
memcpy(destData, srcData, security->SizeOfImage);
|
||||
memcpy(destData, srcData, security->imageSize);
|
||||
}
|
||||
else if (format->CompressionType == 1)
|
||||
else if (fileFormatInfo->compressionType == XEX_COMPRESSION_BASIC)
|
||||
{
|
||||
auto numBlocks = (format->SizeOfHeader / sizeof(XEX_BASIC_FILE_COMPRESSION_INFO)) - 1;
|
||||
auto blocks = reinterpret_cast<const XEX_BASIC_FILE_COMPRESSION_INFO*>(format + 1);
|
||||
auto* blocks = reinterpret_cast<const Xex2FileBasicCompressionBlock*>(fileFormatInfo + 1);
|
||||
const size_t numBlocks = (fileFormatInfo->infoSize / sizeof(Xex2FileBasicCompressionInfo)) - 1;
|
||||
|
||||
for (size_t i = 0; i < numBlocks; i++)
|
||||
{
|
||||
memcpy(destData, srcData, blocks[i].SizeOfData);
|
||||
memcpy(destData, srcData, blocks[i].dataSize);
|
||||
|
||||
srcData += blocks[i].SizeOfData;
|
||||
destData += blocks[i].SizeOfData;
|
||||
memset(destData, 0, blocks[i].SizeOfPadding);
|
||||
srcData += blocks[i].dataSize;
|
||||
destData += blocks[i].dataSize;
|
||||
|
||||
destData += blocks[i].SizeOfPadding;
|
||||
memset(destData, 0, blocks[i].zeroSize);
|
||||
destData += blocks[i].zeroSize;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -140,21 +150,46 @@ uint32_t LdrLoadModule(const std::filesystem::path &path)
|
||||
assert(false && "Unknown compression type.");
|
||||
}
|
||||
|
||||
auto res = Xex2FindOptionalHeader<XEX_RESOURCE_INFO>(xex, XEX_HEADER_RESOURCE_INFO);
|
||||
auto res = reinterpret_cast<const Xex2ResourceInfo*>(getOptHeaderPtr(loadResult.data(), XEX_HEADER_RESOURCE_INFO));
|
||||
|
||||
g_xdbfWrapper = XDBFWrapper((uint8_t*)g_memory.Translate(res->Offset.get()), res->SizeOfData);
|
||||
g_xdbfWrapper = XDBFWrapper((uint8_t*)g_memory.Translate(res->offset.get()), res->sizeOfData);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
__attribute__((constructor(101), target("no-avx,no-avx2"), noinline))
|
||||
void init()
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
uint32_t eax, ebx, ecx, edx;
|
||||
|
||||
// Execute CPUID for processor info and feature bits.
|
||||
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
// Check for AVX support.
|
||||
if ((ecx & (1 << 28)) == 0)
|
||||
{
|
||||
printf("[*] CPU does not support the AVX instruction set.\n");
|
||||
|
||||
#ifdef _WIN32
|
||||
MessageBoxA(nullptr, "Your CPU does not meet the minimum system requirements.", "Unleashed Recompiled", MB_ICONERROR);
|
||||
#endif
|
||||
|
||||
std::_Exit(1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
timeBeginPeriod(1);
|
||||
#endif
|
||||
|
||||
os::process::CheckConsole();
|
||||
|
||||
if (!os::registry::Init())
|
||||
LOGN_WARNING("OS doesn't support registry");
|
||||
LOGN_WARNING("OS does not support registry.");
|
||||
|
||||
os::logger::Init();
|
||||
|
||||
@@ -178,6 +213,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
Config::Load();
|
||||
|
||||
#if defined(_WIN32) && defined(UNLEASHED_RECOMP_D3D12)
|
||||
for (auto& dll : g_D3D12RequiredModules)
|
||||
{
|
||||
if (!std::filesystem::exists(g_executableRoot / dll))
|
||||
{
|
||||
char text[512];
|
||||
snprintf(text, sizeof(text), Localise("System_Win32_MissingDLLs").c_str(), dll.data());
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, GameWindow::GetTitle(), text, GameWindow::s_pWindow);
|
||||
std::_Exit(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#include <cpu/guest_stack_var.h>
|
||||
#include <kernel/function.h>
|
||||
#include <kernel/heap.h>
|
||||
#include <user/config.h>
|
||||
#include <user/paths.h>
|
||||
#include <os/logger.h>
|
||||
#include <os/process.h>
|
||||
#include <xxHashMap.h>
|
||||
|
||||
@@ -117,7 +119,10 @@ void ModLoader::Init()
|
||||
}
|
||||
|
||||
if (configIni.getString("CPKREDIR", "LogType", std::string()) == "console")
|
||||
{
|
||||
os::process::ShowConsole();
|
||||
s_isLogTypeConsole = true;
|
||||
}
|
||||
|
||||
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
||||
if (modsDbIniFilePathU8.empty())
|
||||
@@ -208,6 +213,42 @@ void ModLoader::Init()
|
||||
if (!mod.includeDirs.empty())
|
||||
g_mods.emplace_back(std::move(mod));
|
||||
}
|
||||
|
||||
auto codeCount = modsDbIni.get<size_t>("Codes", "CodeCount", 0);
|
||||
|
||||
if (codeCount)
|
||||
{
|
||||
std::vector<std::string> codes{};
|
||||
|
||||
for (size_t i = 0; i < codeCount; i++)
|
||||
{
|
||||
auto name = modsDbIni.getString("Codes", fmt::format("Code{}", i), "");
|
||||
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
codes.push_back(name);
|
||||
}
|
||||
|
||||
for (auto& def : g_configDefinitions)
|
||||
{
|
||||
if (!def->IsHidden() || def->GetSection() != "Codes")
|
||||
continue;
|
||||
|
||||
/* NOTE: this is inefficient, but it happens
|
||||
once on boot for a handful of codes at release
|
||||
and is temporary until we support real code mods. */
|
||||
for (size_t i = 0; i < codes.size(); i++)
|
||||
{
|
||||
if (def->GetName() == codes[i])
|
||||
{
|
||||
LOGF_IMPL(Utility, "Mod Loader", "Loading code: \"{}\"", codes[i]);
|
||||
*(bool*)def->GetValue() = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr uint32_t LZX_SIGNATURE = 0xFF512EE;
|
||||
@@ -337,6 +378,9 @@ PPC_FUNC(sub_82E0D3E8)
|
||||
std::ifstream stream(filePath, std::ios::binary);
|
||||
if (stream.good())
|
||||
{
|
||||
if (ModLoader::s_isLogTypeConsole)
|
||||
LOGF_IMPL(Utility, "Mod Loader", "Loading file: \"{}\"", reinterpret_cast<const char*>(filePath.u8string().c_str()));
|
||||
|
||||
be<uint32_t> signature{};
|
||||
stream.read(reinterpret_cast<char*>(&signature), sizeof(signature));
|
||||
|
||||
@@ -518,14 +562,68 @@ PPC_FUNC(sub_82E0D3E8)
|
||||
g_userHeap.Free(newArlFileData);
|
||||
}
|
||||
|
||||
// Load elements have an unused "pretty name" field. We will use this field to store the archive file path,
|
||||
// prefixed with a magic string. When the first load detects this string, it will load append archives
|
||||
// and then clear the field to prevent remaining splits from loading the append archives again.
|
||||
// We cannot rely on .ar.00 being the first split to be loaded, so this approach is necessary.
|
||||
static thread_local uint32_t g_prefixedArFilePath = NULL;
|
||||
|
||||
// Hedgehog::Database::CDatabaseLoader::LoadArchives
|
||||
PPC_FUNC_IMPL(__imp__sub_82E0CC38);
|
||||
PPC_FUNC(sub_82E0CC38)
|
||||
{
|
||||
if (g_mods.empty())
|
||||
{
|
||||
__imp__sub_82E0CC38(ctx, base);
|
||||
return;
|
||||
}
|
||||
|
||||
auto r3 = ctx.r3;
|
||||
auto r4 = ctx.r4;
|
||||
auto r5 = ctx.r5;
|
||||
auto r6 = ctx.r6;
|
||||
auto r7 = ctx.r7;
|
||||
auto r8 = ctx.r8;
|
||||
|
||||
const char* arFilePath = reinterpret_cast<const char*>(base + PPC_LOAD_U32(r5.u32));
|
||||
|
||||
// __HH_ALLOC
|
||||
ctx.r3.u32 = 22 + strlen(arFilePath);
|
||||
sub_822C0988(ctx, base);
|
||||
char* prefixedArFilePath = reinterpret_cast<char*>(base + ctx.r3.u32);
|
||||
|
||||
*reinterpret_cast<be<uint32_t>*>(prefixedArFilePath) = 1;
|
||||
strcpy(prefixedArFilePath + 0x4, "/UnleashedRecomp/");
|
||||
strcpy(prefixedArFilePath + 0x15, arFilePath);
|
||||
|
||||
ctx.r1.u32 -= 0x10;
|
||||
uint32_t stackSpace = ctx.r1.u32;
|
||||
PPC_STORE_U32(stackSpace, static_cast<uint32_t>(reinterpret_cast<uint8_t*>(prefixedArFilePath) - base) + 0x4);
|
||||
g_prefixedArFilePath = stackSpace;
|
||||
|
||||
ctx.r3 = r3;
|
||||
ctx.r4 = r4;
|
||||
ctx.r5 = r5;
|
||||
ctx.r6 = r6;
|
||||
ctx.r7 = r7;
|
||||
ctx.r8 = r8;
|
||||
__imp__sub_82E0CC38(ctx, base);
|
||||
|
||||
// Hedgehog::Base::CSharedString::~CSharedString
|
||||
ctx.r3.u32 = stackSpace;
|
||||
sub_82DFB148(ctx, base);
|
||||
|
||||
g_prefixedArFilePath = NULL;
|
||||
ctx.r1.u32 += 0x10;
|
||||
}
|
||||
|
||||
// Hedgehog::Database::SLoadElement::SLoadElement
|
||||
PPC_FUNC_IMPL(__imp__sub_82E140D8);
|
||||
PPC_FUNC(sub_82E140D8)
|
||||
{
|
||||
// Store archive name as the pretty name to use it later for append archive loading.
|
||||
// This is always set to an empty string for archives, so it should be safe to replace.
|
||||
if (!g_mods.empty() && PPC_LOAD_U32(ctx.r5.u32) == 0x8200A621)
|
||||
ctx.r5.u32 = ctx.r6.u32;
|
||||
// Store the prefixed archive file path as the pretty name. It's unused for archives we want to append to.
|
||||
if (!g_mods.empty() && PPC_LOAD_U32(ctx.r5.u32) == 0x8200A621 && g_prefixedArFilePath != NULL)
|
||||
ctx.r5.u32 = g_prefixedArFilePath;
|
||||
|
||||
__imp__sub_82E140D8(ctx, base);
|
||||
}
|
||||
@@ -540,25 +638,17 @@ PPC_FUNC(sub_82E0B500)
|
||||
return;
|
||||
}
|
||||
|
||||
std::u8string_view arFilePathU8(reinterpret_cast<const char8_t*>(base + PPC_LOAD_U32(ctx.r5.u32)));
|
||||
size_t index = arFilePathU8.find(u8".ar.00");
|
||||
if (index == (arFilePathU8.size() - 6))
|
||||
uint32_t prefixedArFilePath = PPC_LOAD_U32(ctx.r5.u32);
|
||||
std::u8string_view arFilePathU8(reinterpret_cast<const char8_t*>(base + prefixedArFilePath));
|
||||
if (!arFilePathU8.starts_with(u8"/UnleashedRecomp/"))
|
||||
{
|
||||
arFilePathU8.remove_suffix(3);
|
||||
__imp__sub_82E0B500(ctx, base);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = arFilePathU8.find(u8".ar");
|
||||
|
||||
if (index != (arFilePathU8.size() - 3) ||
|
||||
arFilePathU8.starts_with(u8"tg-") ||
|
||||
arFilePathU8.starts_with(u8"gia-") ||
|
||||
arFilePathU8.starts_with(u8"gi-texture-"))
|
||||
{
|
||||
__imp__sub_82E0B500(ctx, base);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Immediately clear the string, so the remaining splits don't load append archives again.
|
||||
PPC_STORE_U8(prefixedArFilePath, 0x00);
|
||||
arFilePathU8.remove_prefix(0x11);
|
||||
|
||||
auto r3 = ctx.r3; // Callback
|
||||
auto r4 = ctx.r4; // Database
|
||||
@@ -572,6 +662,9 @@ PPC_FUNC(sub_82E0B500)
|
||||
std::ifstream stream(arFilePath, std::ios::binary);
|
||||
if (stream.good())
|
||||
{
|
||||
if (ModLoader::s_isLogTypeConsole)
|
||||
LOGF_IMPL(Utility, "Mod Loader", "Loading file: \"{}\"", reinterpret_cast<const char*>(arFilePath.u8string().c_str()));
|
||||
|
||||
stream.seekg(0, std::ios::end);
|
||||
size_t arFileSize = stream.tellg();
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
struct ModLoader
|
||||
{
|
||||
static inline bool s_isLogTypeConsole;
|
||||
|
||||
static inline std::filesystem::path s_saveFilePath;
|
||||
|
||||
static std::filesystem::path ResolvePath(std::string_view path);
|
||||
|
||||
@@ -61,6 +61,12 @@ bool os::process::StartProcess(const std::filesystem::path& path, const std::vec
|
||||
return true;
|
||||
}
|
||||
|
||||
void os::process::CheckConsole()
|
||||
{
|
||||
// Always visible on Linux.
|
||||
g_consoleVisible = true;
|
||||
}
|
||||
|
||||
void os::process::ShowConsole()
|
||||
{
|
||||
// Unnecessary on Linux.
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace os::process
|
||||
{
|
||||
inline bool g_consoleVisible;
|
||||
|
||||
std::filesystem::path GetExecutablePath();
|
||||
std::filesystem::path GetWorkingDirectory();
|
||||
bool SetWorkingDirectory(const std::filesystem::path& path);
|
||||
bool StartProcess(const std::filesystem::path& path, const std::vector<std::string>& args, std::filesystem::path work = {});
|
||||
void CheckConsole();
|
||||
void ShowConsole();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include <os/logger.h>
|
||||
#include <os/process.h>
|
||||
|
||||
#define FOREGROUND_WHITE (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)
|
||||
#define FOREGROUND_YELLOW (FOREGROUND_RED | FOREGROUND_GREEN)
|
||||
|
||||
HANDLE g_hStandardOutput;
|
||||
static HANDLE g_hStandardOutput;
|
||||
|
||||
void os::logger::Init()
|
||||
{
|
||||
@@ -12,6 +13,9 @@ void os::logger::Init()
|
||||
|
||||
void os::logger::Log(const std::string_view str, ELogType type, const char* func)
|
||||
{
|
||||
if (!os::process::g_consoleVisible)
|
||||
return;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ELogType::Utility:
|
||||
|
||||
@@ -52,6 +52,11 @@ bool os::process::StartProcess(const std::filesystem::path& path, const std::vec
|
||||
return true;
|
||||
}
|
||||
|
||||
void os::process::CheckConsole()
|
||||
{
|
||||
g_consoleVisible = (GetConsoleWindow() != nullptr);
|
||||
}
|
||||
|
||||
void os::process::ShowConsole()
|
||||
{
|
||||
if (GetConsoleWindow() == nullptr)
|
||||
@@ -60,5 +65,7 @@ void os::process::ShowConsole()
|
||||
freopen("CONIN$", "r", stdin);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
|
||||
g_consoleVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <os/registry.h>
|
||||
#include <unordered_map>
|
||||
|
||||
inline const wchar_t* g_registryRoot = L"Software\\UnleashedRecomp";
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@ void CHudPauseAddOptionsItemMidAsmHook(PPCRegister& pThis)
|
||||
|
||||
bool InjectMenuBehaviour(uint32_t pThis, uint32_t count)
|
||||
{
|
||||
if (App::s_isLoading)
|
||||
return true;
|
||||
|
||||
auto pHudPause = (SWA::CHudPause*)g_memory.Translate(pThis);
|
||||
auto cursorIndex = *(be<uint32_t>*)g_memory.Translate(4 * (*(be<uint32_t>*)g_memory.Translate(pThis + 0x19C) + 0x68) + pThis);
|
||||
|
||||
@@ -116,6 +119,12 @@ bool CHudPauseMiscInjectOptionsMidAsmHook(PPCRegister& pThis)
|
||||
PPC_FUNC_IMPL(__imp__sub_824B0930);
|
||||
PPC_FUNC(sub_824B0930)
|
||||
{
|
||||
if (App::s_isLoading)
|
||||
{
|
||||
__imp__sub_824B0930(ctx, base);
|
||||
return;
|
||||
}
|
||||
|
||||
auto pHudPause = (SWA::CHudPause*)g_memory.Translate(ctx.r3.u32);
|
||||
auto pInputState = SWA::CInputState::GetInstance();
|
||||
|
||||
@@ -163,7 +172,7 @@ PPC_FUNC(sub_824B0930)
|
||||
|
||||
if (*SWA::SGlobals::ms_IsRenderHud && pHudPause->m_IsShown && !pHudPause->m_Submenu && pHudPause->m_Transition == SWA::eTransitionType_Undefined)
|
||||
{
|
||||
ButtonGuide::Open(Button(Localise("Achievements_Name"), EButtonIcon::Back, EButtonAlignment::Left, EFontQuality::Low));
|
||||
ButtonGuide::Open(Button("Achievements_Name", FLT_MAX, EButtonIcon::Back, EButtonAlignment::Left, EFontQuality::Low));
|
||||
g_isClosed = false;
|
||||
}
|
||||
else if (!g_isClosed)
|
||||
|
||||
@@ -148,9 +148,10 @@ void PressStartSaveLoadThreadMidAsmHook()
|
||||
PPC_FUNC_IMPL(__imp__sub_82587E50);
|
||||
PPC_FUNC(sub_82587E50)
|
||||
{
|
||||
auto isAutoSaveWarningShown = *(bool*)g_memory.Translate(0x83367BC1);
|
||||
auto pTitleStateIntro = (SWA::CTitleStateIntro*)g_memory.Translate(ctx.r3.u32);
|
||||
auto pTime = (be<float>*)((uint8_t*)pTitleStateIntro->GetContextBase() + 0x10C);
|
||||
|
||||
if (isAutoSaveWarningShown)
|
||||
if (*SWA::SGlobals::ms_IsAutoSaveWarningShown)
|
||||
{
|
||||
__imp__sub_82587E50(ctx, base);
|
||||
}
|
||||
@@ -158,7 +159,7 @@ PPC_FUNC(sub_82587E50)
|
||||
{
|
||||
if (auto pInputState = SWA::CInputState::GetInstance())
|
||||
{
|
||||
if (pInputState->GetPadState().IsTapped(SWA::eKeyState_B))
|
||||
if (pInputState->GetPadState().IsTapped(SWA::eKeyState_B) && *pTime > 0.5f)
|
||||
g_quitMessageOpen = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,14 +52,14 @@ static bool ProcessInstallMessage()
|
||||
PPC_FUNC_IMPL(__imp__sub_825882B8);
|
||||
PPC_FUNC(sub_825882B8)
|
||||
{
|
||||
auto pTitleState = (SWA::CTitleStateBase*)g_memory.Translate(ctx.r3.u32);
|
||||
auto pTitleStateMenu = (SWA::CTitleStateMenu*)g_memory.Translate(ctx.r3.u32);
|
||||
auto pGameDocument = SWA::CGameDocument::GetInstance();
|
||||
|
||||
auto pInputState = SWA::CInputState::GetInstance();
|
||||
auto& pPadState = pInputState->GetPadState();
|
||||
auto isAccepted = pPadState.IsTapped(SWA::eKeyState_A) || pPadState.IsTapped(SWA::eKeyState_Start);
|
||||
|
||||
auto pContext = pTitleState->GetContextBase<SWA::CTitleStateBase::CTitleStateContext>();
|
||||
auto pContext = pTitleStateMenu->GetContextBase<SWA::CTitleStateMenu::CTitleStateMenuContext>();
|
||||
auto isNewGameIndex = pContext->m_pTitleMenu->m_CursorIndex == 0;
|
||||
auto isOptionsIndex = pContext->m_pTitleMenu->m_CursorIndex == 2;
|
||||
auto isInstallIndex = pContext->m_pTitleMenu->m_CursorIndex == 3;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "aspect_ratio_patches.h"
|
||||
#include "camera_patches.h"
|
||||
#include "inspire_patches.h"
|
||||
|
||||
// These are here for now to not recompile basically all of the project.
|
||||
namespace Chao::CSD
|
||||
@@ -344,6 +345,16 @@ enum
|
||||
|
||||
LOADING_BLACK_BAR_MIN = 1 << 17,
|
||||
LOADING_BLACK_BAR_MAX = 1 << 18,
|
||||
|
||||
UNSTRETCH_HORIZONTAL = 1 << 19,
|
||||
|
||||
CORNER_EXTRACT = 1 << 20,
|
||||
|
||||
SKIP_INSPIRE = 1 << 21,
|
||||
|
||||
CONTROL_TUTORIAL = 1 << 22,
|
||||
|
||||
LOADING_ARROW = 1 << 23,
|
||||
};
|
||||
|
||||
struct CsdModifier
|
||||
@@ -360,10 +371,14 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
{ HashStr("ui_balloon/window/footer"), { ALIGN_BOTTOM } },
|
||||
|
||||
// ui_boss_gauge
|
||||
{ HashStr("ui_boss_gauge/gauge_bg"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_boss_gauge/gauge_2"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_boss_gauge/gauge_1"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_boss_gauge/gauge_breakpoint"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_boss_gauge/gauge_bg"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} },
|
||||
{ HashStr("ui_boss_gauge/gauge_2"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} },
|
||||
{ HashStr("ui_boss_gauge/gauge_1"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} },
|
||||
{ HashStr("ui_boss_gauge/gauge_breakpoint"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} },
|
||||
|
||||
// ui_boss_name
|
||||
{ HashStr("ui_boss_name/name_so/bg"), { UNSTRETCH_HORIZONTAL } },
|
||||
{ HashStr("ui_boss_name/name_so/pale"), { UNSTRETCH_HORIZONTAL } },
|
||||
|
||||
// ui_exstage
|
||||
{ HashStr("ui_exstage/shield/L_gauge"), { ALIGN_BOTTOM_LEFT | SCALE } },
|
||||
@@ -372,10 +387,10 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
{ HashStr("ui_exstage/energy/R_gauge"), { ALIGN_BOTTOM_RIGHT | SCALE } },
|
||||
{ HashStr("ui_exstage/energy/R_gauge_effect"), { ALIGN_BOTTOM_RIGHT | SCALE } },
|
||||
{ HashStr("ui_exstage/energy/R_gauge_effect_2"), { ALIGN_BOTTOM_RIGHT | SCALE } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg"), { ALIGN_RIGHT | SCALE } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg"), { ALIGN_RIGHT | SCALE | OFFSET_SCALE_RIGHT, 986.0f } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg/C"), { ALIGN_RIGHT | SCALE | EXTEND_RIGHT } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg/C/L"), { ALIGN_RIGHT | SCALE } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg/C/R"), { SKIP } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg/C/L"), { SKIP } }, // L/R are mixed up
|
||||
{ HashStr("ui_exstage/hit/hit_counter_bg/C/R"), { ALIGN_RIGHT | SCALE | STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_exstage/hit/hit_counter_num"), { ALIGN_RIGHT | SCALE } },
|
||||
|
||||
// ui_gate
|
||||
@@ -392,15 +407,19 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
|
||||
// ui_itemresult
|
||||
{ HashStr("ui_itemresult/footer/result_footer"), { ALIGN_BOTTOM } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title"), { ALIGN_TOP } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title"), { ALIGN_TOP | OFFSET_SCALE_LEFT, 688.0f } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_bg/center"), { ALIGN_TOP | EXTEND_LEFT } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_bg/center/h_light"), { ALIGN_TOP | EXTEND_LEFT } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_bg/right"), { ALIGN_TOP | STORE_RIGHT_CORNER } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_brilliance1"), { ALIGN_TOP | STORE_RIGHT_CORNER | OFFSET_SCALE_LEFT, 632.25775f, 1 } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_brilliance2"), { ALIGN_TOP | STORE_RIGHT_CORNER | OFFSET_SCALE_LEFT, 830.0f, 2 } },
|
||||
{ HashStr("ui_itemresult/main/iresult_title/title_brilliance3"), { ALIGN_TOP | STORE_RIGHT_CORNER | OFFSET_SCALE_LEFT, 640.0f, 3 } },
|
||||
|
||||
// ui_loading
|
||||
{ HashStr("ui_loading/bg_1"), { STRETCH } },
|
||||
{ HashStr("ui_loading/bg_1/arrow"), { STRETCH | LOADING_ARROW } },
|
||||
{ HashStr("ui_loading/bg_2"), { STRETCH } },
|
||||
{ HashStr("ui_loading/bg_2/arrow"), { STRETCH | LOADING_ARROW } },
|
||||
{ HashStr("ui_loading/n_2_d/bg/sky"), { STRETCH } },
|
||||
{ HashStr("ui_loading/n_2_d/bg/under"), { STRETCH } },
|
||||
{ HashStr("ui_loading/n_2_d/letterbox/letterbox_under"), { STRETCH } },
|
||||
@@ -575,9 +594,11 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
{ HashStr("ui_playscreen_ev_hit/chance_attack"), { ALIGN_RIGHT | SCALE } },
|
||||
|
||||
// ui_playscreen_su
|
||||
{ HashStr("ui_playscreen_su/su_sonic_gauge"), { ALIGN_BOTTOM_LEFT | SCALE } },
|
||||
{ HashStr("ui_playscreen_su/gaia_gauge"), { ALIGN_BOTTOM_LEFT | SCALE } },
|
||||
{ HashStr("ui_playscreen_su/footer"), { ALIGN_BOTTOM_RIGHT | SCALE } },
|
||||
{ HashStr("ui_playscreen_su/su_sonic_gauge"), { ALIGN_BOTTOM_LEFT | SCALE | OFFSET_SCALE_LEFT, 632.0f } },
|
||||
{ HashStr("ui_playscreen_su/su_sonic_gauge/position/C/R"), { ALIGN_BOTTOM_LEFT | SCALE | STORE_RIGHT_CORNER } },
|
||||
{ HashStr("ui_playscreen_su/gaia_gauge"), { ALIGN_BOTTOM_LEFT | SCALE | OFFSET_SCALE_LEFT, 632.0f } },
|
||||
{ HashStr("ui_playscreen_su/gaia_gauge/position/C/R"), { ALIGN_BOTTOM_LEFT | SCALE | STORE_RIGHT_CORNER } },
|
||||
{ HashStr("ui_playscreen_su/footer"), { ALIGN_BOTTOM_RIGHT | SCALE | CONTROL_TUTORIAL } },
|
||||
|
||||
// ui_prov_playscreen
|
||||
{ HashStr("ui_prov_playscreen/so_speed_gauge"), { ALIGN_BOTTOM_LEFT | SCALE | TORNADO_DEFENSE } },
|
||||
@@ -601,37 +622,43 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
{ HashStr("ui_result/main/result_title/title_bg/center"), { ALIGN_TOP | EXTEND_LEFT } },
|
||||
{ HashStr("ui_result/main/result_title/title_bg/center/h_light"), { ALIGN_TOP | EXTEND_LEFT} },
|
||||
{ HashStr("ui_result/main/result_title/title_bg/right"), { ALIGN_TOP | STORE_RIGHT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_1"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_1"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg/position_1/center_1"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg/position_1/center_1/h_light"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg/position_1/center_1/left"), { STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg/position_1/center_1/right"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_1/num_bg/position_1/center_1/right/h_light"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_2"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_2"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg/position_2/center_1"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg/position_2/center_1/h_light"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg/position_2/center_1/left"), { STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg/position_2/center_1/right"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_2/num_bg/position_2/center_1/right/h_light"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_3"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_3"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg/position_3/center_1"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg/position_3/center_1/h_light"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg/position_3/center_1/left"), { STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg/position_3/center_1/right"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_3/num_bg/position_3/center_1/right/h_light"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_4"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_4"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg/position_4/center_1"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg/position_4/center_1/h_light"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg/position_4/center_1/left"), { STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg/position_4/center_1/right"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_4/num_bg/position_4/center_1/right/h_light"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_5"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_5"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg"), { OFFSET_SCALE_RIGHT, 669.0f } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg/position_5/center_1"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg/position_5/center_1/h_light"), { EXTEND_RIGHT } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg/position_5/center_1/left"), { STORE_LEFT_CORNER } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg/position_5/center_1/right"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_5/num_bg/position_5/center_1/right/h_light"), { SKIP } },
|
||||
{ HashStr("ui_result/main/result_num_6"), { OFFSET_SCALE_LEFT, 1094.0f } },
|
||||
{ HashStr("ui_result/main/result_num_6"), { CORNER_EXTRACT } },
|
||||
{ HashStr("ui_result/main/result_num_6/num_bg"), { OFFSET_SCALE_LEFT, 1094.0f } },
|
||||
{ HashStr("ui_result/main/result_num_6/num_bg/position_6/center"), { EXTEND_LEFT } },
|
||||
{ HashStr("ui_result/main/result_num_6/num_bg/position_6/center/h_light"), { EXTEND_LEFT } },
|
||||
{ HashStr("ui_result/main/result_num_6/num_bg/position_6/center/right"), { STORE_RIGHT_CORNER } },
|
||||
@@ -728,7 +755,7 @@ static const xxHashMap<CsdModifier> g_modifiers =
|
||||
{ HashStr("ui_townscreen/time_effect"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_townscreen/info"), { ALIGN_TOP_LEFT | SCALE } },
|
||||
{ HashStr("ui_townscreen/cam"), { ALIGN_TOP_RIGHT | SCALE } },
|
||||
{ HashStr("ui_townscreen/footer"), { ALIGN_BOTTOM } },
|
||||
{ HashStr("ui_townscreen/footer"), { ALIGN_BOTTOM_RIGHT | SCALE } },
|
||||
|
||||
// ui_worldmap
|
||||
{ HashStr("ui_worldmap/contents/choices/cts_choices_bg"), { STRETCH } },
|
||||
@@ -828,6 +855,11 @@ PPC_FUNC(sub_830C6A00)
|
||||
|
||||
if (g_sceneModifier.has_value())
|
||||
{
|
||||
if (!Config::ControlTutorial && (g_sceneModifier->flags & CONTROL_TUTORIAL) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Tornado Defense bugs out when applying gameplay UI scaling.
|
||||
// This seems consistent with base game behavior, because the UI
|
||||
// is normally squashed, which was probably done to work around this.
|
||||
@@ -837,7 +869,7 @@ PPC_FUNC(sub_830C6A00)
|
||||
g_scenePositionY = 0.0f;
|
||||
}
|
||||
|
||||
if ((g_sceneModifier->flags & (OFFSET_SCALE_LEFT | OFFSET_SCALE_RIGHT)) != 0)
|
||||
if (g_aspectRatio > WIDE_ASPECT_RATIO && (g_sceneModifier->flags & (OFFSET_SCALE_LEFT | OFFSET_SCALE_RIGHT | CORNER_EXTRACT)) != 0)
|
||||
{
|
||||
auto r3 = ctx.r3;
|
||||
auto r4 = ctx.r4;
|
||||
@@ -906,6 +938,12 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str
|
||||
return;
|
||||
}
|
||||
|
||||
// That goddamn boss gauge doesn't disappear in the cutscene where Dark Gaia and Chip hug each other
|
||||
if ((modifier.flags & SKIP_INSPIRE) != 0 && !InspirePatches::s_sceneName.empty() && *reinterpret_cast<be<float>*>(base + ctx.r4.u32) >= 1280.0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_cornerExtract)
|
||||
{
|
||||
if ((modifier.flags & (STORE_LEFT_CORNER | STORE_RIGHT_CORNER)) != 0)
|
||||
@@ -937,6 +975,22 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str
|
||||
return reinterpret_cast<be<float>*>(stack + index * stride);
|
||||
};
|
||||
|
||||
// Subtract half a pixel from loading arrows to prevent transparent pixels surrounding them from leaking into the texture filtering.
|
||||
if (Video::s_viewportHeight > 720 && (modifier.flags & LOADING_ARROW) != 0 && stride == 0x14)
|
||||
{
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
{
|
||||
auto texCoord = getPosition(i) + 4;
|
||||
|
||||
constexpr float OFFSET = 0.5f / 720.0f;
|
||||
|
||||
if (i == 0 || i == 2) // Top
|
||||
*texCoord = (*texCoord + OFFSET);
|
||||
else // Bottom
|
||||
*texCoord = (*texCoord - OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
float offsetX = 0.0f;
|
||||
float offsetY = 0.0f;
|
||||
float pivotX = 0.0f;
|
||||
@@ -944,7 +998,9 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str
|
||||
float scaleX = 1.0f;
|
||||
float scaleY = 1.0f;
|
||||
|
||||
if (squash || ((modifier.flags & STRETCH_HORIZONTAL) != 0 && g_aspectRatio >= WIDE_ASPECT_RATIO))
|
||||
bool needsStretch = g_aspectRatio >= WIDE_ASPECT_RATIO;
|
||||
|
||||
if (squash || (needsStretch && (modifier.flags & STRETCH_HORIZONTAL) != 0))
|
||||
{
|
||||
scaleX = Video::s_viewportWidth / 1280.0f;
|
||||
}
|
||||
@@ -952,28 +1008,36 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str
|
||||
{
|
||||
scaleX = g_aspectRatioScale;
|
||||
|
||||
if ((modifier.flags & ALIGN_RIGHT) != 0)
|
||||
offsetX = g_aspectRatioOffsetX * 2.0f;
|
||||
else if ((modifier.flags & ALIGN_LEFT) == 0)
|
||||
offsetX = g_aspectRatioOffsetX;
|
||||
|
||||
if ((modifier.flags & SCALE) != 0)
|
||||
if (needsStretch && (modifier.flags & UNSTRETCH_HORIZONTAL) != 0)
|
||||
{
|
||||
scaleX *= g_aspectRatioGameplayScale;
|
||||
pivotX = g_scenePositionX;
|
||||
|
||||
if ((modifier.flags & ALIGN_RIGHT) != 0)
|
||||
offsetX += 1280.0f * (1.0f - g_aspectRatioGameplayScale) * g_aspectRatioScale;
|
||||
else if ((modifier.flags & ALIGN_LEFT) == 0)
|
||||
offsetX += 640.0f * (1.0f - g_aspectRatioGameplayScale) * g_aspectRatioScale;
|
||||
|
||||
offsetX += pivotX * g_aspectRatioScale;
|
||||
pivotX = *getPosition(0);
|
||||
offsetX = pivotX * Video::s_viewportWidth / 1280.0f;
|
||||
}
|
||||
|
||||
if ((modifier.flags & WORLD_MAP) != 0)
|
||||
else
|
||||
{
|
||||
if ((modifier.flags & ALIGN_LEFT) != 0)
|
||||
offsetX += (1.0f - g_aspectRatioNarrowScale) * g_aspectRatioScale * -20.0f;
|
||||
if ((modifier.flags & ALIGN_RIGHT) != 0)
|
||||
offsetX = g_aspectRatioOffsetX * 2.0f;
|
||||
else if ((modifier.flags & ALIGN_LEFT) == 0)
|
||||
offsetX = g_aspectRatioOffsetX;
|
||||
|
||||
if ((modifier.flags & SCALE) != 0)
|
||||
{
|
||||
scaleX *= g_aspectRatioGameplayScale;
|
||||
pivotX = g_scenePositionX;
|
||||
|
||||
if ((modifier.flags & ALIGN_RIGHT) != 0)
|
||||
offsetX += 1280.0f * (1.0f - g_aspectRatioGameplayScale) * g_aspectRatioScale;
|
||||
else if ((modifier.flags & ALIGN_LEFT) == 0)
|
||||
offsetX += 640.0f * (1.0f - g_aspectRatioGameplayScale) * g_aspectRatioScale;
|
||||
|
||||
offsetX += pivotX * g_aspectRatioScale;
|
||||
}
|
||||
|
||||
if ((modifier.flags & WORLD_MAP) != 0)
|
||||
{
|
||||
if ((modifier.flags & ALIGN_LEFT) != 0)
|
||||
offsetX += (1.0f - g_aspectRatioNarrowScale) * g_aspectRatioScale * -20.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1198,8 +1262,8 @@ PPC_FUNC(sub_830D1EF0)
|
||||
y = g_aspectRatioOffsetY + (y + 0.5f) * g_aspectRatioScale;
|
||||
}
|
||||
|
||||
vertex[i].x = ((round(x) - 0.5f) / Video::s_viewportWidth) * 2.0f - 1.0f;
|
||||
vertex[i].y = ((round(y) - 0.5f) / Video::s_viewportHeight) * -2.0f + 1.0f;
|
||||
vertex[i].x = ((x - 0.5f) / Video::s_viewportWidth) * 2.0f - 1.0f;
|
||||
vertex[i].y = ((y - 0.5f) / Video::s_viewportHeight) * -2.0f + 1.0f;
|
||||
}
|
||||
|
||||
bool letterboxTop = PPC_LOAD_U8(r3.u32 + PRIMITIVE_2D_PADDING_OFFSET + 0x1);
|
||||
@@ -1553,3 +1617,38 @@ PPC_FUNC(sub_82449088)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The shadow offseting is buggy for FCO text just like Werehog button guide,
|
||||
// making them appear thicker than they actually are.
|
||||
PPC_FUNC_IMPL(__imp__sub_82E54950);
|
||||
PPC_FUNC(sub_82E54950)
|
||||
{
|
||||
if (Config::AspectRatio == EAspectRatio::OriginalNarrow)
|
||||
{
|
||||
// Luckily, they have shadow offset scale values that are only used in this function.
|
||||
uint32_t x = PPC_LOAD_U32(0x8332B7B8);
|
||||
uint32_t y = PPC_LOAD_U32(0x8332B7BC);
|
||||
|
||||
PPCRegister scaled;
|
||||
|
||||
// X
|
||||
scaled.u32 = x;
|
||||
scaled.f32 *= 1.5f;
|
||||
PPC_STORE_U32(0x8332B7B8, scaled.u32);
|
||||
|
||||
// Y
|
||||
scaled.u32 = y;
|
||||
scaled.f32 *= 1.5f;
|
||||
PPC_STORE_U32(0x8332B7BC, scaled.u32);
|
||||
|
||||
__imp__sub_82E54950(ctx, base);
|
||||
|
||||
// Restore old values.
|
||||
PPC_STORE_U32(0x8332B7B8, x);
|
||||
PPC_STORE_U32(0x8332B7BC, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
__imp__sub_82E54950(ctx, base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,17 @@ void HighFrameRateDeltaTimeFixMidAsmHook(PPCRegister& f1)
|
||||
f1.f64 = threshold;
|
||||
}
|
||||
|
||||
// This hook expects the vector register to store delta time at the first index.
|
||||
void HighFrameRateDeltaTimeFixVectorMidAsmHook(PPCVRegister& v62)
|
||||
{
|
||||
// Having 60 FPS threshold ensures we still retain
|
||||
// the original game behavior when locked to 30/60 FPS.
|
||||
constexpr double threshold = 1.0 / 60.0;
|
||||
|
||||
if (v62.f32[3] < threshold)
|
||||
v62.f32[3] = threshold;
|
||||
}
|
||||
|
||||
void CameraDeltaTimeFixMidAsmHook(PPCRegister& dest, PPCRegister& src)
|
||||
{
|
||||
dest.f64 = src.f64 / 30.0;
|
||||
@@ -159,3 +170,28 @@ PPC_FUNC(sub_82B00D00)
|
||||
|
||||
*pElapsedTime = std::max(*pElapsedTime, 0.0f);
|
||||
}
|
||||
|
||||
// Fix for Egg Dragoon's drill missile attack rotating 90 degrees at HFR.
|
||||
void BossEggDragoonDrillMissileCMissileSetRotationMidAsmHook(PPCRegister& r4)
|
||||
{
|
||||
auto pRotation = (Hedgehog::Math::CQuaternion*)g_memory.Translate(r4.u32);
|
||||
auto magnitude = std::sqrt(pRotation->X * pRotation->X + pRotation->Y * pRotation->Y + pRotation->Z * pRotation->Z + pRotation->W * pRotation->W);
|
||||
|
||||
if (magnitude < 0.0f)
|
||||
return;
|
||||
|
||||
auto magnitudeNrm = 1.0f / magnitude;
|
||||
|
||||
pRotation->X = pRotation->X * magnitudeNrm;
|
||||
pRotation->Y = pRotation->Y * magnitudeNrm;
|
||||
pRotation->Z = pRotation->Z * magnitudeNrm;
|
||||
pRotation->W = pRotation->W * magnitudeNrm;
|
||||
}
|
||||
|
||||
bool SparkleLocusMidAsmHook()
|
||||
{
|
||||
// There is an epsilon check in sparkle locus particle code that seems to never pass at high frame rates, which causes vertex corruption.
|
||||
// Checking for equality doesn't fix it either, so we can fix it by forcing it to always execute instead.
|
||||
// This has the side effect of the locus particle eventually snapping to the rest position during pause, but it's better than vertices exploding.
|
||||
return App::s_deltaTime < (1.0 / 60.0);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ static class FrontendListener : public SDLEventListener
|
||||
public:
|
||||
bool OnSDLEvent(SDL_Event* event) override
|
||||
{
|
||||
if (!Config::HUDToggleHotkey || OptionsMenu::s_isVisible)
|
||||
if (!Config::HUDToggleKey || OptionsMenu::s_isVisible)
|
||||
return false;
|
||||
|
||||
switch (event->type)
|
||||
|
||||
@@ -212,6 +212,9 @@ g_sdlEventListenerForInputPatches;
|
||||
|
||||
static bool IsDPadThreshold(const SWA::SPadState* pPadState)
|
||||
{
|
||||
if (Config::DisableDPadMovement)
|
||||
return false;
|
||||
|
||||
return pPadState->IsDown(SWA::eKeyState_DpadUp) ||
|
||||
pPadState->IsDown(SWA::eKeyState_DpadDown) ||
|
||||
pPadState->IsDown(SWA::eKeyState_DpadLeft) ||
|
||||
@@ -237,6 +240,9 @@ static bool IsCursorThreshold(double deadzone = 0, bool isBelowThreshold = false
|
||||
|
||||
static void SetDPadAnalogDirectionX(PPCRegister& pPadState, PPCRegister& x, bool invert, float max = 1.0f)
|
||||
{
|
||||
if (Config::DisableDPadMovement)
|
||||
return;
|
||||
|
||||
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
|
||||
|
||||
if (pGuestPadState->IsDown(SWA::eKeyState_DpadLeft))
|
||||
@@ -248,6 +254,9 @@ static void SetDPadAnalogDirectionX(PPCRegister& pPadState, PPCRegister& x, bool
|
||||
|
||||
static void SetDPadAnalogDirectionY(PPCRegister& pPadState, PPCRegister& y, bool invert, float max = 1.0f)
|
||||
{
|
||||
if (Config::DisableDPadMovement)
|
||||
return;
|
||||
|
||||
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
|
||||
|
||||
if (pGuestPadState->IsDown(SWA::eKeyState_DpadUp))
|
||||
@@ -283,6 +292,9 @@ void PostureDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCRegister& y)
|
||||
|
||||
void PostureSpaceHurrierDPadSupportXMidAsmHook(PPCRegister& pPadState, PPCVRegister& vector)
|
||||
{
|
||||
if (Config::DisableDPadMovement)
|
||||
return;
|
||||
|
||||
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
|
||||
|
||||
if (pGuestPadState->IsDown(SWA::eKeyState_DpadLeft))
|
||||
@@ -294,6 +306,9 @@ void PostureSpaceHurrierDPadSupportXMidAsmHook(PPCRegister& pPadState, PPCVRegis
|
||||
|
||||
void PostureSpaceHurrierDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCVRegister& vector)
|
||||
{
|
||||
if (Config::DisableDPadMovement)
|
||||
return;
|
||||
|
||||
auto pGuestPadState = (SWA::SPadState*)g_memory.Translate(pPadState.u32);
|
||||
|
||||
if (pGuestPadState->IsDown(SWA::eKeyState_DpadUp))
|
||||
@@ -303,6 +318,18 @@ void PostureSpaceHurrierDPadSupportYMidAsmHook(PPCRegister& pPadState, PPCVRegis
|
||||
vector.f32[3] = -1.0f;
|
||||
}
|
||||
|
||||
void SetXButtonHomingMidAsmHook(PPCRegister& r1)
|
||||
{
|
||||
auto pXButtonHoming = (bool*)(g_memory.base + r1.u32 + 0x63);
|
||||
|
||||
*pXButtonHoming = !Config::HomingAttackOnJump;
|
||||
}
|
||||
|
||||
bool IsHomingAttackOnJump()
|
||||
{
|
||||
return Config::HomingAttackOnJump;
|
||||
}
|
||||
|
||||
// ------------- WORLD MAP ------------- //
|
||||
|
||||
bool WorldMapDeadzoneMidAsmHook(PPCRegister& pPadState)
|
||||
@@ -403,17 +430,20 @@ PPC_FUNC(sub_8256C938)
|
||||
pWorldMapCursor->m_LeftStickVertical = rPadState.LeftStickVertical;
|
||||
pWorldMapCursor->m_LeftStickHorizontal = rPadState.LeftStickHorizontal;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadUp))
|
||||
pWorldMapCursor->m_LeftStickVertical = 1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadDown))
|
||||
pWorldMapCursor->m_LeftStickVertical = -1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadLeft))
|
||||
pWorldMapCursor->m_LeftStickHorizontal = -1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadRight))
|
||||
pWorldMapCursor->m_LeftStickHorizontal = 1.0f;
|
||||
if (!Config::DisableDPadMovement)
|
||||
{
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadUp))
|
||||
pWorldMapCursor->m_LeftStickVertical = 1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadDown))
|
||||
pWorldMapCursor->m_LeftStickVertical = -1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadLeft))
|
||||
pWorldMapCursor->m_LeftStickHorizontal = -1.0f;
|
||||
|
||||
if (rPadState.IsDown(SWA::eKeyState_DpadRight))
|
||||
pWorldMapCursor->m_LeftStickHorizontal = 1.0f;
|
||||
}
|
||||
|
||||
if (sqrtl((pWorldMapCursor->m_LeftStickHorizontal * pWorldMapCursor->m_LeftStickHorizontal) +
|
||||
(pWorldMapCursor->m_LeftStickVertical * pWorldMapCursor->m_LeftStickVertical)) > WORLD_MAP_ROTATE_DEADZONE)
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
#include <app.h>
|
||||
#include <sdl_events.h>
|
||||
|
||||
std::string InspirePatches::s_sceneName;
|
||||
|
||||
static SWA::Inspire::CScene* g_pScene;
|
||||
static std::string g_sceneName;
|
||||
static bool g_isFirstFrameChecked;
|
||||
static uint32_t g_eventDispatchCount;
|
||||
|
||||
@@ -31,6 +32,11 @@ static std::unordered_map<std::string_view, std::pair<float, float>> g_evilSonic
|
||||
{ "evrt_m8_04", { 0, 2314 } } // Dark Gaia Appears
|
||||
};
|
||||
|
||||
// Sonic's mouth EXPLODES for a single frame in Temple Entrance cutscene.
|
||||
// Looks very nasty. Let's hide morph models inbetween certain frames to solve it.
|
||||
static bool g_loadedMouthExplosionAnimation;
|
||||
static bool g_hideMorphModels;
|
||||
|
||||
// SWA::Inspire::CScene
|
||||
PPC_FUNC_IMPL(__imp__sub_82B98D80);
|
||||
PPC_FUNC(sub_82B98D80)
|
||||
@@ -49,9 +55,12 @@ PPC_FUNC(sub_82B98D30)
|
||||
__imp__sub_82B98D30(ctx, base);
|
||||
|
||||
g_pScene = nullptr;
|
||||
g_sceneName.clear();
|
||||
InspirePatches::s_sceneName.clear();
|
||||
|
||||
SDL_User_EvilSonic(App::s_isWerehog);
|
||||
|
||||
g_loadedMouthExplosionAnimation = false;
|
||||
g_hideMorphModels = false;
|
||||
}
|
||||
|
||||
PPC_FUNC_IMPL(__imp__sub_82B9BA98);
|
||||
@@ -59,11 +68,31 @@ PPC_FUNC(sub_82B9BA98)
|
||||
{
|
||||
auto sceneName = (Hedgehog::Base::CSharedString*)g_memory.Translate(ctx.r5.u32);
|
||||
|
||||
g_sceneName = sceneName->c_str();
|
||||
InspirePatches::s_sceneName = sceneName->c_str();
|
||||
|
||||
__imp__sub_82B9BA98(ctx, base);
|
||||
}
|
||||
|
||||
void AnimationDataMakeMidAsmHook(PPCRegister& r31, PPCRegister& r29, PPCRegister& r28)
|
||||
{
|
||||
uint8_t* base = g_memory.base;
|
||||
|
||||
if (r28.u32 == 0x222E0 &&
|
||||
strcmp(reinterpret_cast<const char*>(base + PPC_LOAD_U32(r31.u32)), "t0_04_SN") == 0 &&
|
||||
XXH3_64bits(base + r29.u32, r28.u32) == 0xEC634F0F379F478A)
|
||||
{
|
||||
g_loadedMouthExplosionAnimation = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Hedgehog::Mirage::CSingleMorphElement::Render
|
||||
PPC_FUNC_IMPL(__imp__sub_82E32048);
|
||||
PPC_FUNC(sub_82E32048)
|
||||
{
|
||||
if (!g_hideMorphModels)
|
||||
__imp__sub_82E32048(ctx, base);
|
||||
}
|
||||
|
||||
void InspirePatches::DrawDebug()
|
||||
{
|
||||
if (!g_pScene)
|
||||
@@ -72,7 +101,7 @@ void InspirePatches::DrawDebug()
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::Text("Name: %s", g_sceneName.c_str());
|
||||
ImGui::Text("Name: %s", InspirePatches::s_sceneName.c_str());
|
||||
ImGui::Text("Frame: %f", g_pScene->m_pData->Frame.get());
|
||||
ImGui::Text("Cut: %d", g_pScene->m_pData->Cut.get());
|
||||
|
||||
@@ -97,17 +126,20 @@ void InspirePatches::DrawDebug()
|
||||
|
||||
void InspirePatches::Update()
|
||||
{
|
||||
if (!g_pScene || !g_sceneName.size())
|
||||
if (!g_pScene || !InspirePatches::s_sceneName.size())
|
||||
return;
|
||||
|
||||
if (!g_isFirstFrameChecked && std::find(g_alwaysEvilSonic.begin(), g_alwaysEvilSonic.end(), g_sceneName) != g_alwaysEvilSonic.end())
|
||||
g_hideMorphModels = g_loadedMouthExplosionAnimation && g_pScene->m_pData->Frame >= 185.0f &&
|
||||
g_pScene->m_pData->Frame < 195.0f && InspirePatches::s_sceneName == "evrt_t0_04";
|
||||
|
||||
if (!g_isFirstFrameChecked && std::find(g_alwaysEvilSonic.begin(), g_alwaysEvilSonic.end(), InspirePatches::s_sceneName) != g_alwaysEvilSonic.end())
|
||||
{
|
||||
SDL_User_EvilSonic(true);
|
||||
g_isFirstFrameChecked = true;
|
||||
return;
|
||||
}
|
||||
|
||||
auto findResult = g_evilSonicTimings.find(g_sceneName);
|
||||
auto findResult = g_evilSonicTimings.find(InspirePatches::s_sceneName);
|
||||
|
||||
if (findResult != g_evilSonicTimings.end())
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
class InspirePatches
|
||||
{
|
||||
public:
|
||||
static std::string s_sceneName;
|
||||
|
||||
static void DrawDebug();
|
||||
static void Update();
|
||||
};
|
||||
|
||||
@@ -13,6 +13,17 @@ bool DisableHintsMidAsmHook()
|
||||
return !Config::Hints;
|
||||
}
|
||||
|
||||
// Disable Perfect Dark Gaia hints.
|
||||
PPC_FUNC_IMPL(__imp__sub_82AC36E0);
|
||||
PPC_FUNC(sub_82AC36E0)
|
||||
{
|
||||
auto pPerfectDarkGaiaChipHintName = (xpointer<char>*)g_memory.Translate(0x8338EF10);
|
||||
|
||||
strcpy(pPerfectDarkGaiaChipHintName->get(), Config::Hints ? "V_CHP_067\0" : "end\0");
|
||||
|
||||
__imp__sub_82AC36E0(ctx, base);
|
||||
}
|
||||
|
||||
bool DisableControlTutorialMidAsmHook()
|
||||
{
|
||||
return !Config::ControlTutorial;
|
||||
@@ -32,13 +43,6 @@ bool DisableDLCIconMidAsmHook()
|
||||
return Config::DisableDLCIcon;
|
||||
}
|
||||
|
||||
void ToggleSubtitlesMidAsmHook(PPCRegister& r27)
|
||||
{
|
||||
auto pApplicationDocument = (SWA::CApplicationDocument*)g_memory.Translate(r27.u32);
|
||||
|
||||
pApplicationDocument->m_InspireSubtitles = Config::Subtitles;
|
||||
}
|
||||
|
||||
void WerehogBattleMusicMidAsmHook(PPCRegister& r11)
|
||||
{
|
||||
if (Config::BattleTheme)
|
||||
@@ -104,3 +108,51 @@ PPC_FUNC(sub_82586698)
|
||||
|
||||
__imp__sub_82586698(ctx, base);
|
||||
}
|
||||
|
||||
// SWA::CObjHint::MsgNotifyObjectEvent::Impl
|
||||
// Disable only certain hints from hint volumes.
|
||||
// This hook should be used to allow hint volumes specifically to also prevent them from affecting the player.
|
||||
PPC_FUNC_IMPL(__imp__sub_82736E80);
|
||||
PPC_FUNC(sub_82736E80)
|
||||
{
|
||||
// GroupID parameter text
|
||||
auto* groupId = (const char*)(base + PPC_LOAD_U32(ctx.r3.u32 + 0x100));
|
||||
|
||||
if (!Config::Hints)
|
||||
{
|
||||
// WhiteIsland_ACT1_001: "Your friend went off that way, Sonic. Quick, let's go after him!"
|
||||
// s20n_mykETF_c_navi_2: "Huh? Weird! We can't get through here anymore. We were able to earlier!"
|
||||
if (strcmp(groupId, "WhiteIsland_ACT1_001") != 0 && strcmp(groupId, "s20n_mykETF_c_navi_2") != 0)
|
||||
return;
|
||||
}
|
||||
|
||||
__imp__sub_82736E80(ctx, base);
|
||||
}
|
||||
|
||||
// SWA::CHelpWindow::MsgRequestHelp::Impl
|
||||
// Disable only certain hints from other sequences.
|
||||
// This hook should be used to block hint messages from unknown sources.
|
||||
PPC_FUNC_IMPL(__imp__sub_824C1E60);
|
||||
PPC_FUNC(sub_824C1E60)
|
||||
{
|
||||
auto pMsgRequestHelp = (SWA::Message::MsgRequestHelp*)(base + ctx.r4.u32);
|
||||
|
||||
if (!Config::Hints)
|
||||
{
|
||||
// s10d_mykETF_c_navi: "Looks like we can get to a bunch of places in the village from here!"
|
||||
if (strcmp(pMsgRequestHelp->m_Name.c_str(), "s10d_mykETF_c_navi") == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
__imp__sub_824C1E60(ctx, base);
|
||||
}
|
||||
|
||||
// Remove boost filter
|
||||
void DisableBoostFilterMidAsmHook(PPCRegister& r11)
|
||||
{
|
||||
if (Config::DisableBoostFilter)
|
||||
{
|
||||
if (r11.u32 == 1)
|
||||
r11.u32 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include <api/SWA.h>
|
||||
#include <user/config.h>
|
||||
#include <SWA/CharacterUtility/CharacterProxy.h>
|
||||
#include <hid/hid.h>
|
||||
#include <app.h>
|
||||
|
||||
// CObjFlame::CObjFlame
|
||||
// SWA::CObjFlame::CObjFlame
|
||||
// A field is not zero initialized,
|
||||
// causing collisions to constantly get created
|
||||
// and slow down the game.
|
||||
@@ -28,7 +29,7 @@ void ObjBigBarrelAllocMidAsmHook(PPCRegister& r3)
|
||||
r3.u32 += sizeof(ObjBigBarrelEx);
|
||||
}
|
||||
|
||||
// CObjBigBarrel::CObjBigBarrel
|
||||
// SWA::CObjBigBarrel::CObjBigBarrel
|
||||
PPC_FUNC_IMPL(__imp__sub_8271AC08);
|
||||
PPC_FUNC(sub_8271AC08)
|
||||
{
|
||||
@@ -69,10 +70,9 @@ void ObjBigBarrelSetPositionMidAsmHook(PPCRegister& r3, PPCRegister& r4)
|
||||
}
|
||||
}
|
||||
|
||||
// SWA::CExBullet::AddCallback
|
||||
// Tornado Defense bullet particles are colored by the button prompt, which differs on PlayStation 3.
|
||||
// Luckily, the PS3 particles are left in the files, and they get spawned by name when a bullet gets created.
|
||||
|
||||
// SWA::CExBullet::AddCallback
|
||||
PPC_FUNC_IMPL(__imp__sub_82B14CC0);
|
||||
PPC_FUNC(sub_82B14CC0)
|
||||
{
|
||||
@@ -98,3 +98,38 @@ PPC_FUNC(sub_82B14CC0)
|
||||
|
||||
__imp__sub_82B14CC0(ctx, base);
|
||||
}
|
||||
|
||||
// CObjGrindDashPanel is particularly egregious when it comes to overlapping sounds at HFR
|
||||
// due to the character proxy sending the hit message multiple times in a frame. This is a
|
||||
// quick workaround to limit the message process function to occur at a 30 FPS time step.
|
||||
static constexpr size_t OBJ_GRIND_DASH_PANEL_SIZE = 0x160;
|
||||
|
||||
void ObjGrindDashPanelAllocMidAsmHook(PPCRegister& r3)
|
||||
{
|
||||
r3.u32 += sizeof(double);
|
||||
}
|
||||
|
||||
// SWA::CObjGrindDashPanel::CObjGrindDashPanel
|
||||
PPC_FUNC_IMPL(__imp__sub_82614228);
|
||||
PPC_FUNC(sub_82614228)
|
||||
{
|
||||
*reinterpret_cast<double*>(base + ctx.r3.u32 + OBJ_GRIND_DASH_PANEL_SIZE) = 0.0;
|
||||
__imp__sub_82614228(ctx, base);
|
||||
}
|
||||
|
||||
// SWA::CObjGrindDashPanel::MsgHitEventCollision::Impl
|
||||
PPC_FUNC_IMPL(__imp__sub_826145D8);
|
||||
PPC_FUNC(sub_826145D8)
|
||||
{
|
||||
constexpr double REFERENCE_DELTA_TIME = 1.0 / 30.0;
|
||||
constexpr double DELTA_TIME_TOLERANCE = 0.0001;
|
||||
|
||||
auto lastHitTime = reinterpret_cast<double*>(base + ctx.r3.u32 + OBJ_GRIND_DASH_PANEL_SIZE);
|
||||
auto deltaTime = App::s_time - *lastHitTime;
|
||||
|
||||
if ((deltaTime + DELTA_TIME_TOLERANCE) > REFERENCE_DELTA_TIME)
|
||||
{
|
||||
__imp__sub_826145D8(ctx, base);
|
||||
*lastHitTime = App::s_time;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,11 +95,6 @@ void PostUnleashMidAsmHook(PPCRegister& r30)
|
||||
g_isUnleashCancelled = false;
|
||||
}
|
||||
|
||||
void SetXButtonHomingMidAsmHook(PPCRegister& r30)
|
||||
{
|
||||
r30.u32 = Config::HomingAttackOnBoost;
|
||||
}
|
||||
|
||||
// SWA::Player::CEvilSonicContext
|
||||
PPC_FUNC_IMPL(__imp__sub_823B49D8);
|
||||
PPC_FUNC(sub_823B49D8)
|
||||
|
||||
@@ -15,25 +15,31 @@ PPC_FUNC(sub_824DCF38)
|
||||
|
||||
App::s_isLoading = true;
|
||||
|
||||
if (Config::TimeOfDayTransition == ETimeOfDayTransition::PlayStation)
|
||||
if (ctx.r4.u32 == SWA::eLoadingDisplayType_WerehogMovie)
|
||||
{
|
||||
if (ctx.r4.u32 == SWA::eLoadingDisplayType_WerehogMovie)
|
||||
if (Config::TimeOfDayTransition == ETimeOfDayTransition::PlayStation)
|
||||
{
|
||||
ctx.r4.u32 = SWA::eLoadingDisplayType_ChangeTimeOfDay;
|
||||
pLoading->m_IsNightToDay = App::s_isWerehog;
|
||||
}
|
||||
|
||||
if (Config::UseArrowsForTimeOfDayTransition)
|
||||
ctx.r4.u32 = SWA::eLoadingDisplayType_Arrows;
|
||||
}
|
||||
|
||||
if (auto pGameDocument = SWA::CGameDocument::GetInstance())
|
||||
if (Config::FixEggmanlandUsingEventGalleryTransition)
|
||||
{
|
||||
auto stageName = pGameDocument->m_pMember->m_StageName.c_str();
|
||||
|
||||
if (stageName && strlen(stageName))
|
||||
if (auto pGameDocument = SWA::CGameDocument::GetInstance())
|
||||
{
|
||||
/* Fix restarting Eggmanland as the Werehog
|
||||
erroneously using the Event Gallery transition. */
|
||||
if (ctx.r4.u32 == SWA::eLoadingDisplayType_EventGallery && !strcmp(stageName, "Act_EggmanLand"))
|
||||
ctx.r4.u32 = SWA::eLoadingDisplayType_NowLoading;
|
||||
auto stageName = pGameDocument->m_pMember->m_StageName.c_str();
|
||||
|
||||
if (stageName && strlen(stageName))
|
||||
{
|
||||
/* Fix restarting Eggmanland as the Werehog
|
||||
erroneously using the Event Gallery transition. */
|
||||
if (ctx.r4.u32 == SWA::eLoadingDisplayType_EventGallery && !strcmp(stageName, "Act_EggmanLand"))
|
||||
ctx.r4.u32 = SWA::eLoadingDisplayType_NowLoading;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +97,8 @@ PPC_FUNC(sub_824E5170)
|
||||
|
||||
__imp__sub_824E5170(ctx, base);
|
||||
|
||||
App::s_isSaving = pSaveIcon->m_IsVisible;
|
||||
|
||||
if (pSaveIcon->m_IsVisible)
|
||||
{
|
||||
App::s_isSaveDataCorrupt = false;
|
||||
|
||||
@@ -76,8 +76,12 @@ PPC_FUNC(sub_830D25D8)
|
||||
auto device = reinterpret_cast<GuestDevice*>(base + PPC_LOAD_U32(ctx.r4.u32));
|
||||
|
||||
// Set first sampler to use linear filtering.
|
||||
device->samplerStates[0].data[3] = (device->samplerStates[0].data[3].get() & ~0x1f80000) | 0x1280000;
|
||||
device->dirtyFlags[3] = device->dirtyFlags[3].get() | 0x80000000ull;
|
||||
// NOTE: We only check for height here since all 2D primitives get centered.
|
||||
if (Video::s_viewportHeight > 720)
|
||||
{
|
||||
device->samplerStates[0].data[3] = (device->samplerStates[0].data[3].get() & ~0x1f80000) | 0x1280000;
|
||||
device->dirtyFlags[3] = device->dirtyFlags[3].get() | 0x80000000ull;
|
||||
}
|
||||
|
||||
__imp__sub_830D25D8(ctx, base);
|
||||
}
|
||||
@@ -113,3 +117,27 @@ PPC_FUNC(sub_8260BBF8)
|
||||
SetDefaultMaterialParameters(reinterpret_cast<GuestDevice*>(base + PPC_LOAD_U32(PPC_LOAD_U32(ctx.r4.u32))));
|
||||
__imp__sub_8260BBF8(ctx, base);
|
||||
}
|
||||
|
||||
// The pedestal in Gaia Temple is placed on an opaque mesh slot, despite using additive blending.
|
||||
// This somehow works. Except when the delta time is too stable, it flashes black for one frame.
|
||||
// We can fix it by detecting the asset runtime, and swapping the mesh slots to transparent by hand.
|
||||
|
||||
// Hedgehog::Mirage::CModelData::Make
|
||||
PPC_FUNC_IMPL(__imp__sub_82E38650);
|
||||
PPC_FUNC(sub_82E38650)
|
||||
{
|
||||
if (ctx.r5.u32 == 0xBB90 && XXH3_64bits(base + ctx.r4.u32, ctx.r5.u32) == 0xB524C8C3B80C3F54)
|
||||
{
|
||||
// Mesh Count
|
||||
std::swap(
|
||||
*reinterpret_cast<uint32_t*>(base + ctx.r4.u32 + 0x18),
|
||||
*reinterpret_cast<uint32_t*>(base + ctx.r4.u32 + 0x20));
|
||||
|
||||
// Mesh Offset
|
||||
std::swap(
|
||||
*reinterpret_cast<uint32_t*>(base + ctx.r4.u32 + 0x1C),
|
||||
*reinterpret_cast<uint32_t*>(base + ctx.r4.u32 + 0x24));
|
||||
}
|
||||
|
||||
__imp__sub_82E38650(ctx, base);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
inline std::array<const char*, 14> g_credits =
|
||||
inline std::array<const char*, 17> g_credits =
|
||||
{
|
||||
"Skyth",
|
||||
"Sajid",
|
||||
"Hyper",
|
||||
"Darío",
|
||||
"Sajid",
|
||||
"DeaThProj",
|
||||
"RadiantDerg",
|
||||
"PTKay",
|
||||
"SuperSonic16",
|
||||
"NextinHKRY",
|
||||
"saguinee",
|
||||
"LadyLunanova",
|
||||
"LJSTAR",
|
||||
"saguinee",
|
||||
"Goalringmod27",
|
||||
"M&M"
|
||||
"M&M",
|
||||
"DaGuAr",
|
||||
"brianuuuSonic",
|
||||
"Kitzuku"
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_MILESTONE="Beta 2"
|
||||
VERSION_MILESTONE=""
|
||||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=0
|
||||
VERSION_REVISION=0
|
||||
VERSION_REVISION=2
|
||||
|
||||
@@ -48,13 +48,11 @@ static std::unique_ptr<GuestTexture> g_upTrophyIcon;
|
||||
static int g_firstVisibleRowIndex;
|
||||
static int g_selectedRowIndex;
|
||||
static double g_rowSelectionTime;
|
||||
static double g_lastTappedTime;
|
||||
static double g_lastIncrementTime;
|
||||
|
||||
static bool g_upWasHeld;
|
||||
static bool g_downWasHeld;
|
||||
static bool g_leftWasHeld;
|
||||
static bool g_rightWasHeld;
|
||||
static bool g_upRSWasHeld;
|
||||
static bool g_downRSWasHeld;
|
||||
|
||||
static void ResetSelection()
|
||||
{
|
||||
@@ -67,7 +65,7 @@ static void ResetSelection()
|
||||
|
||||
static void DrawContainer(ImVec2 min, ImVec2 max, ImU32 gradientTop, ImU32 gradientBottom, float alpha = 1, float cornerRadius = 25)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
DrawPauseContainer(min, max, alpha);
|
||||
|
||||
@@ -76,8 +74,9 @@ static void DrawContainer(ImVec2 min, ImVec2 max, ImU32 gradientTop, ImU32 gradi
|
||||
|
||||
static void DrawHeaderContainer(const char* text)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto fontSize = Scale(24);
|
||||
auto minTextSize = Scale(294.575989);
|
||||
auto textSize = g_fntNewRodinUB->CalcTextSizeA(fontSize, FLT_MAX, 0, text);
|
||||
auto cornerRadius = 23;
|
||||
auto textMarginX = Scale(16) + (Scale(cornerRadius) / 2);
|
||||
@@ -101,13 +100,12 @@ static void DrawHeaderContainer(const char* text)
|
||||
: Lerp(0, 1, colourMotion);
|
||||
|
||||
ImVec2 min = { g_aspectRatioOffsetX + Scale(containerMarginX), g_aspectRatioOffsetY + Scale(136) };
|
||||
ImVec2 max = { min.x + textMarginX * 2 + textSize.x + Scale(5), g_aspectRatioOffsetY + Scale(196) };
|
||||
ImVec2 max = { std::max(min.x + minTextSize, min.x + textMarginX * 2 + textSize.x + Scale(5)), g_aspectRatioOffsetY + Scale(196) };
|
||||
|
||||
DrawPauseHeaderContainer(min, max, alpha);
|
||||
|
||||
SetTextSkew((min.y + max.y) / 2.0f, Scale(3.0f));
|
||||
|
||||
// TODO: Apply bevel.
|
||||
DrawTextWithOutline
|
||||
(
|
||||
g_fntNewRodinUB,
|
||||
@@ -124,7 +122,7 @@ static void DrawHeaderContainer(const char* text)
|
||||
|
||||
static void DrawAchievement(int rowIndex, float yOffset, Achievement& achievement, bool isUnlocked)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
auto clipRectMin = drawList->GetClipRectMin();
|
||||
auto clipRectMax = drawList->GetClipRectMax();
|
||||
@@ -339,7 +337,7 @@ static void DrawAchievement(int rowIndex, float yOffset, Achievement& achievemen
|
||||
|
||||
static void DrawTrophySparkles(ImVec2 min, ImVec2 max, int recordCount, int trophyFrameIndex)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
constexpr auto recordsHalfTotal = ACH_RECORDS / 2;
|
||||
|
||||
@@ -427,7 +425,7 @@ static void DrawTrophySparkles(ImVec2 min, ImVec2 max, int recordCount, int trop
|
||||
|
||||
static void DrawAchievementTotal(ImVec2 min, ImVec2 max)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
// Transparency fade animation.
|
||||
auto alpha = Cubic(0, 1, ComputeMotion(g_appearTime, COUNTER_INTRO_FADE_START, COUNTER_INTRO_FADE_END));
|
||||
@@ -511,7 +509,7 @@ static void DrawAchievementTotal(ImVec2 min, ImVec2 max)
|
||||
|
||||
static void DrawContentContainer()
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
// Expand/retract animation.
|
||||
auto motion = g_isClosing
|
||||
@@ -566,15 +564,12 @@ static void DrawContentContainer()
|
||||
// Draw separators.
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
auto lineMarginLeft = Scale(35);
|
||||
auto lineMarginRight = Scale(55);
|
||||
auto lineMarginY = Scale(2);
|
||||
ImVec2 lineMin = { clipRectMin.x + Scale(35), clipRectMin.y + itemHeight * i + Scale(2) };
|
||||
ImVec2 lineMax = { clipRectMax.x - Scale(55), lineMin.y + Scale(1.3f) };
|
||||
|
||||
ImVec2 lineMin = { clipRectMin.x + lineMarginLeft, clipRectMin.y + itemHeight * i + lineMarginY };
|
||||
ImVec2 lineMax = { clipRectMax.x - lineMarginRight, clipRectMin.y + itemHeight * i + lineMarginY };
|
||||
|
||||
drawList->AddLine(lineMin, lineMax, IM_COL32(163, 163, 163, 255));
|
||||
drawList->AddLine({ lineMin.x, lineMin.y + Scale(1) }, { lineMax.x, lineMax.y + Scale(1) }, IM_COL32(143, 148, 143, 255));
|
||||
SetAdditive(true);
|
||||
drawList->AddRectFilled(lineMin, lineMax, IM_COL32(160, 160, 160, 60));
|
||||
SetAdditive(false);
|
||||
}
|
||||
|
||||
for (auto& tpl : g_achievements)
|
||||
@@ -601,26 +596,41 @@ static void DrawContentContainer()
|
||||
bool downIsHeld = inputState->GetPadState().IsDown(SWA::eKeyState_DpadDown) ||
|
||||
inputState->GetPadState().LeftStickVertical < -0.5f;
|
||||
|
||||
bool leftIsHeld = inputState->GetPadState().IsDown(SWA::eKeyState_DpadLeft) ||
|
||||
inputState->GetPadState().LeftStickHorizontal < -0.5f;
|
||||
|
||||
bool rightIsHeld = inputState->GetPadState().IsDown(SWA::eKeyState_DpadRight) ||
|
||||
inputState->GetPadState().LeftStickHorizontal > 0.5f;
|
||||
|
||||
bool upRSIsHeld = inputState->GetPadState().RightStickVertical > 0.5f;
|
||||
bool downRSIsHeld = inputState->GetPadState().RightStickVertical < -0.5f;
|
||||
|
||||
bool isReachedTop = g_selectedRowIndex == 0;
|
||||
bool isReachedBottom = g_selectedRowIndex == rowCount - 1;
|
||||
|
||||
bool scrollUp = !g_upWasHeld && upIsHeld;
|
||||
bool scrollDown = !g_downWasHeld && downIsHeld;
|
||||
bool scrollPageUp = !g_leftWasHeld && leftIsHeld && !isReachedTop;
|
||||
bool scrollPageDown = !g_rightWasHeld && rightIsHeld && !isReachedBottom;
|
||||
bool jumpToTop = !g_upRSWasHeld && upRSIsHeld && !isReachedTop;
|
||||
bool jumpToBottom = !g_downRSWasHeld && downRSIsHeld && !isReachedBottom;
|
||||
|
||||
int prevSelectedRowIndex = g_selectedRowIndex;
|
||||
auto time = ImGui::GetTime();
|
||||
auto fastScroll = (time - g_lastTappedTime) > 0.6;
|
||||
auto fastScrollSpeed = 1.0 / 3.5;
|
||||
static auto fastScrollSpeedUp = false;
|
||||
|
||||
if (scrollUp || scrollDown)
|
||||
g_lastTappedTime = time;
|
||||
|
||||
if (!upIsHeld && !downIsHeld)
|
||||
fastScrollSpeedUp = false;
|
||||
|
||||
if (fastScrollSpeedUp)
|
||||
fastScrollSpeed /= 2;
|
||||
|
||||
if (fastScroll)
|
||||
{
|
||||
if ((time - g_lastIncrementTime) < fastScrollSpeed)
|
||||
{
|
||||
fastScroll = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_lastIncrementTime = time;
|
||||
|
||||
scrollUp = upIsHeld;
|
||||
scrollDown = downIsHeld;
|
||||
fastScrollSpeedUp = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (scrollUp)
|
||||
{
|
||||
@@ -634,40 +644,15 @@ static void DrawContentContainer()
|
||||
if (g_selectedRowIndex >= rowCount)
|
||||
g_selectedRowIndex = 0;
|
||||
}
|
||||
else if (scrollPageUp)
|
||||
{
|
||||
g_selectedRowIndex -= 3;
|
||||
if (g_selectedRowIndex < 0)
|
||||
g_selectedRowIndex = 0;
|
||||
}
|
||||
else if (scrollPageDown)
|
||||
{
|
||||
g_selectedRowIndex += 3;
|
||||
if (g_selectedRowIndex >= rowCount)
|
||||
g_selectedRowIndex = rowCount - 1;
|
||||
}
|
||||
else if (jumpToTop)
|
||||
{
|
||||
g_selectedRowIndex = 0;
|
||||
}
|
||||
else if (jumpToBottom)
|
||||
{
|
||||
g_selectedRowIndex = rowCount - 1;
|
||||
}
|
||||
|
||||
// lol
|
||||
if (scrollUp || scrollDown || scrollPageUp || scrollPageDown || jumpToTop || jumpToBottom)
|
||||
if (scrollUp || scrollDown)
|
||||
{
|
||||
g_rowSelectionTime = ImGui::GetTime();
|
||||
g_rowSelectionTime = time;
|
||||
Game_PlaySound("sys_actstg_pausecursor");
|
||||
}
|
||||
|
||||
g_upWasHeld = upIsHeld;
|
||||
g_downWasHeld = downIsHeld;
|
||||
g_leftWasHeld = leftIsHeld;
|
||||
g_rightWasHeld = rightIsHeld;
|
||||
g_upRSWasHeld = upRSIsHeld;
|
||||
g_downRSWasHeld = downRSIsHeld;
|
||||
|
||||
int visibleRowCount = int(floor((clipRectMax.y - clipRectMin.y) / itemHeight));
|
||||
|
||||
@@ -778,12 +763,12 @@ void AchievementMenu::Open()
|
||||
return std::get<1>(a) > std::get<1>(b);
|
||||
});
|
||||
|
||||
ButtonGuide::Open(Button(Localise("Common_Back"), EButtonIcon::B));
|
||||
ButtonGuide::Open(Button("Common_Back", FLT_MAX, EButtonIcon::B, EFontQuality::Low));
|
||||
|
||||
ResetSelection();
|
||||
Game_PlaySound("sys_actstg_pausewinopen");
|
||||
|
||||
hid::SetProhibitedButtons(XAMINPUT_GAMEPAD_START);
|
||||
hid::SetProhibitedInputs(XAMINPUT_GAMEPAD_START);
|
||||
}
|
||||
|
||||
void AchievementMenu::Close()
|
||||
@@ -793,7 +778,7 @@ void AchievementMenu::Close()
|
||||
g_appearTime = ImGui::GetTime();
|
||||
g_isClosing = true;
|
||||
|
||||
hid::SetProhibitedButtons(0);
|
||||
hid::SetProhibitedInputs();
|
||||
}
|
||||
|
||||
ButtonGuide::Close();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <app.h>
|
||||
#include <exports.h>
|
||||
#include <decompressor.h>
|
||||
#include <patches/inspire_patches.h>
|
||||
|
||||
constexpr double OVERLAY_CONTAINER_COMMON_MOTION_START = 0;
|
||||
constexpr double OVERLAY_CONTAINER_COMMON_MOTION_END = 11;
|
||||
@@ -30,7 +31,7 @@ static ImFont* g_fntSeurat;
|
||||
|
||||
static bool DrawContainer(ImVec2 min, ImVec2 max, float cornerRadius = 25)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
// Expand/retract animation.
|
||||
auto containerMotion = ComputeMotion(g_appearTime, OVERLAY_CONTAINER_COMMON_MOTION_START, OVERLAY_CONTAINER_COMMON_MOTION_END);
|
||||
@@ -80,15 +81,68 @@ void AchievementOverlay::Init()
|
||||
g_fntSeurat = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf");
|
||||
}
|
||||
|
||||
// Dequeue achievements only when we can actually play sounds.
|
||||
// Loading thread does not update this object.
|
||||
static bool g_soundAdministratorUpdated;
|
||||
|
||||
PPC_FUNC_IMPL(__imp__sub_82B43480);
|
||||
PPC_FUNC(sub_82B43480)
|
||||
{
|
||||
g_soundAdministratorUpdated = true;
|
||||
__imp__sub_82B43480(ctx, base);
|
||||
}
|
||||
|
||||
// Dequeue achievements only in the main thread. This is also extra thread safety.
|
||||
static std::thread::id g_mainThreadId = std::this_thread::get_id();
|
||||
|
||||
static bool CanDequeueAchievement()
|
||||
{
|
||||
if (g_soundAdministratorUpdated && std::this_thread::get_id() == g_mainThreadId && !AchievementOverlay::s_queue.empty())
|
||||
{
|
||||
// Check if we can actually play any audio right now. If not, we'll wait until we can.
|
||||
uint32_t audioCenter = *reinterpret_cast<be<uint32_t>*>(g_memory.Translate(0x83362FFC));
|
||||
if (audioCenter != NULL)
|
||||
{
|
||||
uint32_t member = *reinterpret_cast<be<uint32_t>*>(g_memory.Translate(audioCenter + 0x4));
|
||||
uint32_t category = !InspirePatches::s_sceneName.empty() ? 10 : 7; // EVENT category is used during Inspire cutscenes.
|
||||
|
||||
// Check if the volume is non zero.
|
||||
return *reinterpret_cast<uint32_t*>(g_memory.Translate(member + 0x7C + category * 0x10 + 0x8)) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void AchievementOverlay::Draw()
|
||||
{
|
||||
if (!AchievementOverlay::s_isVisible && CanDequeueAchievement())
|
||||
{
|
||||
s_isVisible = true;
|
||||
g_isClosing = false;
|
||||
g_appearTime = ImGui::GetTime();
|
||||
g_achievement = g_xdbfWrapper.GetAchievement((EXDBFLanguage)Config::Language.Value, s_queue.front());
|
||||
s_queue.pop();
|
||||
|
||||
if (Config::Language == ELanguage::English)
|
||||
g_achievement.Name = xdbf::FixInvalidSequences(g_achievement.Name);
|
||||
|
||||
Game_PlaySound("obj_navi_appear");
|
||||
}
|
||||
|
||||
if (!s_isVisible)
|
||||
{
|
||||
g_soundAdministratorUpdated = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (ImGui::GetTime() - g_appearTime >= OVERLAY_DURATION)
|
||||
AchievementOverlay::Close();
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
// Close function can use this bool so reset it after.
|
||||
g_soundAdministratorUpdated = false;
|
||||
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
auto strAchievementUnlocked = Localise("Achievements_Unlock").c_str();
|
||||
@@ -129,6 +183,9 @@ void AchievementOverlay::Draw()
|
||||
IM_COL32(255, 255, 255, 255) // col
|
||||
);
|
||||
|
||||
// Use low quality text.
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT);
|
||||
|
||||
// Draw header text.
|
||||
DrawTextWithShadow
|
||||
(
|
||||
@@ -154,6 +211,9 @@ void AchievementOverlay::Draw()
|
||||
1.0f, // radius
|
||||
IM_COL32(0, 0, 0, 255) // shadowColour
|
||||
);
|
||||
|
||||
// Reset low quality text shader modifier.
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,21 +227,7 @@ void AchievementOverlay::Draw()
|
||||
|
||||
void AchievementOverlay::Open(int id)
|
||||
{
|
||||
if (s_isVisible && !g_isClosing)
|
||||
{
|
||||
s_queue.emplace(id);
|
||||
return;
|
||||
}
|
||||
|
||||
s_isVisible = true;
|
||||
g_isClosing = false;
|
||||
g_appearTime = ImGui::GetTime();
|
||||
g_achievement = g_xdbfWrapper.GetAchievement((EXDBFLanguage)Config::Language.Value, id);
|
||||
|
||||
if (Config::Language == ELanguage::English)
|
||||
g_achievement.Name = xdbf::FixInvalidSequences(g_achievement.Name);
|
||||
|
||||
Game_PlaySound("obj_navi_appear");
|
||||
s_queue.push(id);
|
||||
}
|
||||
|
||||
void AchievementOverlay::Close()
|
||||
@@ -192,10 +238,6 @@ void AchievementOverlay::Close()
|
||||
g_isClosing = true;
|
||||
}
|
||||
|
||||
if (s_queue.size())
|
||||
{
|
||||
if (CanDequeueAchievement())
|
||||
s_isVisible = false;
|
||||
AchievementOverlay::Open(s_queue.front());
|
||||
s_queue.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
constexpr float DEFAULT_SIDE_MARGINS = 379;
|
||||
|
||||
ImFont* g_fntNewRodin;
|
||||
ImFont* g_fntNewRodinLQ;
|
||||
|
||||
std::unique_ptr<GuestTexture> g_upControllerIcons;
|
||||
std::unique_ptr<GuestTexture> g_upKBMIcons;
|
||||
@@ -144,79 +143,74 @@ std::tuple<std::tuple<ImVec2, ImVec2>, GuestTexture*> GetButtonIcon(EButtonIcon
|
||||
return std::make_tuple(btn, texture);
|
||||
}
|
||||
|
||||
ImFont* GetFont(EFontQuality fontQuality)
|
||||
{
|
||||
return fontQuality == EFontQuality::Low
|
||||
? g_fntNewRodinLQ
|
||||
: g_fntNewRodin;
|
||||
}
|
||||
|
||||
static void DrawGuide(float* offset, ImVec2 regionMin, ImVec2 regionMax, EButtonIcon icon,
|
||||
EButtonAlignment alignment, ImVec2 iconMin, ImVec2 iconMax, EFontQuality fontQuality,
|
||||
ImVec2 textSize, float fontSize, const char* text)
|
||||
float textWidth, float maxTextWidth, float textScale, float fontSize, const char* text)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto _icon = icon;
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto iconWidth = Scale(g_iconWidths[icon]);
|
||||
auto dualIconMarginX = Scale(25);
|
||||
auto textMarginY = regionMin.y + Scale(9.0f);
|
||||
|
||||
if (icon == EButtonIcon::LBRB)
|
||||
{
|
||||
_icon = EButtonIcon::LB;
|
||||
}
|
||||
else if (icon == EButtonIcon::LTRT)
|
||||
{
|
||||
_icon = EButtonIcon::LT;
|
||||
}
|
||||
else
|
||||
{
|
||||
dualIconMarginX = 0;
|
||||
}
|
||||
ImVec2 textPos;
|
||||
|
||||
if (icon == EButtonIcon::LBRB || icon == EButtonIcon::LTRT)
|
||||
{
|
||||
iconMin = alignment == EButtonAlignment::Left
|
||||
? ImVec2(/* X */ regionMin.x + *offset - dualIconMarginX * 3, /* Y */ iconMin.y)
|
||||
: ImVec2(/* X */ regionMax.x - *offset - textSize.x - iconWidth, /* Y */ iconMin.y);
|
||||
auto iconMarginX = Scale(16);
|
||||
|
||||
iconMax = alignment == EButtonAlignment::Left
|
||||
? ImVec2(iconMin.x + iconWidth, iconMax.y)
|
||||
: ImVec2(iconMin.x, iconMax.y);
|
||||
}
|
||||
iconMin.x = alignment == EButtonAlignment::Left
|
||||
? regionMin.x + *offset - maxTextWidth + (iconWidth / 2)
|
||||
: regionMax.x - *offset - maxTextWidth - (iconWidth / 2) - iconMarginX;
|
||||
|
||||
auto btnIcon = GetButtonIcon(_icon);
|
||||
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
||||
iconMax.x = iconMin.x + iconWidth;
|
||||
|
||||
auto font = GetFont(fontQuality);
|
||||
|
||||
auto textMarginX = alignment == EButtonAlignment::Left
|
||||
? regionMin.x + *offset + dualIconMarginX
|
||||
: regionMax.x - *offset - dualIconMarginX * 2;
|
||||
|
||||
auto textMarginY = regionMin.y + Scale(8);
|
||||
|
||||
ImVec2 textPosition = { textMarginX, textMarginY };
|
||||
|
||||
DrawTextWithOutline(font, fontSize, textPosition, IM_COL32_WHITE, text, 4, IM_COL32_BLACK);
|
||||
|
||||
// Add extra luminance to low quality text.
|
||||
if (fontQuality == EFontQuality::Low)
|
||||
drawList->AddText(font, fontSize, textPosition, IM_COL32(255, 255, 255, 127), text);
|
||||
|
||||
if (icon == EButtonIcon::LBRB || icon == EButtonIcon::LTRT)
|
||||
{
|
||||
auto btnIcon = GetButtonIcon(icon == EButtonIcon::LBRB ? EButtonIcon::RB : EButtonIcon::RT);
|
||||
// Left button.
|
||||
auto btnIcon = GetButtonIcon(icon == EButtonIcon::LBRB ? EButtonIcon::LB : EButtonIcon::LT);
|
||||
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
||||
|
||||
auto dualIconMin = alignment == EButtonAlignment::Left
|
||||
? ImVec2(/* X */ regionMin.x + *offset + textSize.x + dualIconMarginX * 2, /* Y */ iconMin.y)
|
||||
: ImVec2(/* X */ regionMax.x - *offset + textSize.x - dualIconMarginX, /* Y */ iconMin.y);
|
||||
? ImVec2(iconMax.x + maxTextWidth + iconMarginX, iconMin.y)
|
||||
: ImVec2(regionMax.x - *offset + maxTextWidth - iconWidth, iconMin.y);
|
||||
|
||||
auto dualIconMax = ImVec2(dualIconMin.x + iconWidth, iconMax.y);
|
||||
|
||||
// Right button.
|
||||
btnIcon = GetButtonIcon(icon == EButtonIcon::LBRB ? EButtonIcon::RB : EButtonIcon::RT);
|
||||
drawList->AddImage(std::get<1>(btnIcon), dualIconMin, dualIconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
||||
|
||||
*offset += dualIconMarginX + iconWidth;
|
||||
textPos = { (iconMax.x + ((dualIconMin.x - iconMax.x) - maxTextWidth + std::max(0.0f, maxTextWidth - textWidth)) / 2) + Scale(2), textMarginY};
|
||||
|
||||
*offset += iconWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto btnIcon = GetButtonIcon(icon);
|
||||
|
||||
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
||||
|
||||
auto textMarginX = alignment == EButtonAlignment::Left
|
||||
? regionMin.x + *offset
|
||||
: regionMax.x - *offset;
|
||||
|
||||
textPos = { textMarginX, textMarginY };
|
||||
}
|
||||
|
||||
SetScale({ textScale, 1.0f });
|
||||
SetOrigin(textPos);
|
||||
|
||||
if (fontQuality == EFontQuality::Low)
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT);
|
||||
|
||||
DrawTextWithOutline(g_fntNewRodin, fontSize, textPos, IM_COL32_WHITE, text, 4, IM_COL32_BLACK);
|
||||
|
||||
if (fontQuality == EFontQuality::Low)
|
||||
{
|
||||
// Add extra luminance to low quality text.
|
||||
drawList->AddText(g_fntNewRodin, fontSize, textPos, IM_COL32(255, 255, 255, 127), text);
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE);
|
||||
}
|
||||
|
||||
SetScale({ 1.0f, 1.0f });
|
||||
SetOrigin({ 0.0f, 0.0f });
|
||||
}
|
||||
|
||||
void ButtonGuide::Init()
|
||||
@@ -224,8 +218,6 @@ void ButtonGuide::Init()
|
||||
auto& io = ImGui::GetIO();
|
||||
|
||||
g_fntNewRodin = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-M.otf");
|
||||
g_fntNewRodinLQ = ImFontAtlasSnapshot::GetFont("FOT-NewRodinPro-M.otf");
|
||||
|
||||
g_upControllerIcons = LOAD_ZSTD_TEXTURE(g_controller);
|
||||
g_upKBMIcons = LOAD_ZSTD_TEXTURE(g_kbm);
|
||||
}
|
||||
@@ -235,16 +227,15 @@ void ButtonGuide::Draw()
|
||||
if (!s_isVisible)
|
||||
return;
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
ImVec2 regionMin = { g_aspectRatioOffsetX + Scale(g_sideMargins), g_aspectRatioOffsetY * 2.0f + Scale(720.0f - 102.0f) };
|
||||
ImVec2 regionMax = { g_aspectRatioOffsetX + Scale(1280.0f - g_sideMargins), g_aspectRatioOffsetY * 2.0f + Scale(720.0f) };
|
||||
|
||||
auto textMarginX = Scale(57);
|
||||
auto textMarginY = Scale(8);
|
||||
auto textMarginX = Scale(21.25f);
|
||||
auto iconMarginX = Scale(4);
|
||||
auto fontSize = Scale(22.5f);
|
||||
auto fontSize = Scale(21.8f);
|
||||
|
||||
auto offsetLeft = 0.0f;
|
||||
auto offsetRight = 0.0f;
|
||||
@@ -260,17 +251,20 @@ void ButtonGuide::Draw()
|
||||
if (btn.Visibility && !*btn.Visibility)
|
||||
continue;
|
||||
|
||||
auto str = Localise(btn.Name).c_str();
|
||||
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
||||
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
||||
auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, btn.Name.c_str());
|
||||
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
||||
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : Scale(btn.MaxWidth);
|
||||
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
||||
|
||||
if (i > 0)
|
||||
offsetLeft += textSize.x + iconWidth + textMarginX;
|
||||
offsetLeft += maxWidth + iconWidth + textMarginX;
|
||||
|
||||
ImVec2 iconMin = { regionMin.x + offsetLeft - iconWidth - iconMarginX, regionMin.y };
|
||||
ImVec2 iconMax = { regionMin.x + offsetLeft - iconMarginX, regionMin.y + iconHeight };
|
||||
|
||||
DrawGuide(&offsetLeft, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, btn.Name.c_str());
|
||||
DrawGuide(&offsetLeft, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textWidth, maxWidth, textScale, fontSize, str);
|
||||
}
|
||||
|
||||
// Draw right aligned icons.
|
||||
@@ -284,17 +278,20 @@ void ButtonGuide::Draw()
|
||||
if (btn.Visibility && !*btn.Visibility)
|
||||
continue;
|
||||
|
||||
auto str = Localise(btn.Name).c_str();
|
||||
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
||||
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
||||
auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, btn.Name.c_str());
|
||||
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
||||
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : Scale(btn.MaxWidth);
|
||||
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
||||
|
||||
if (i < g_buttons.size() - 1)
|
||||
offsetRight += textSize.x + iconWidth + textMarginX;
|
||||
offsetRight += maxWidth + iconWidth + textMarginX;
|
||||
|
||||
ImVec2 iconMin = { regionMax.x - offsetRight - iconWidth - iconMarginX, regionMin.y };
|
||||
ImVec2 iconMax = { regionMax.x - offsetRight - iconMarginX, regionMin.y + iconHeight };
|
||||
|
||||
DrawGuide(&offsetRight, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, btn.Name.c_str());
|
||||
DrawGuide(&offsetRight, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textWidth, maxWidth, textScale, fontSize, str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,19 +40,23 @@ class Button
|
||||
{
|
||||
public:
|
||||
std::string Name{};
|
||||
float MaxWidth{ FLT_MAX };
|
||||
EButtonIcon Icon{};
|
||||
EButtonAlignment Alignment{ EButtonAlignment::Right };
|
||||
EFontQuality FontQuality{ EFontQuality::High };
|
||||
bool* Visibility{ nullptr };
|
||||
|
||||
Button(std::string name, EButtonIcon icon, EButtonAlignment alignment, EFontQuality fontQuality = EFontQuality::High, bool* visibility = nullptr)
|
||||
: Name(name), Icon(icon), Alignment(alignment), FontQuality(fontQuality), Visibility(visibility) {}
|
||||
Button(std::string name, float maxWidth, EButtonIcon icon, EButtonAlignment alignment, EFontQuality fontQuality = EFontQuality::High, bool* visibility = nullptr)
|
||||
: Name(name), MaxWidth(maxWidth), Icon(icon), Alignment(alignment), FontQuality(fontQuality), Visibility(visibility) {}
|
||||
|
||||
Button(std::string name, EButtonIcon icon, EButtonAlignment alignment, bool* visibility) : Name(name), Icon(icon), Alignment(alignment), Visibility(visibility) {}
|
||||
Button(std::string name, float maxWidth, EButtonIcon icon, EButtonAlignment alignment, bool* visibility)
|
||||
: Name(name), MaxWidth(maxWidth), Icon(icon), Alignment(alignment), Visibility(visibility) {}
|
||||
|
||||
Button(std::string name, EButtonIcon icon, bool* visibility) : Name(name), Icon(icon), Visibility(visibility) {}
|
||||
Button(std::string name, float maxWidth, EButtonIcon icon, bool* visibility)
|
||||
: Name(name), MaxWidth(maxWidth), Icon(icon), Visibility(visibility) {}
|
||||
|
||||
Button(std::string name, EButtonIcon icon) : Name(name), Icon(icon) {}
|
||||
Button(std::string name, float maxWidth, EButtonIcon icon, EFontQuality fontQuality = EFontQuality::High)
|
||||
: Name(name), MaxWidth(maxWidth), Icon(icon), FontQuality(fontQuality) {}
|
||||
};
|
||||
|
||||
class ButtonGuide
|
||||
|
||||
@@ -45,7 +45,7 @@ void Fader::Draw()
|
||||
|
||||
auto colour = IM_COL32(g_colour & 0xFF, (g_colour >> 8) & 0xFF, (g_colour >> 16) & 0xFF, 255 * alpha);
|
||||
|
||||
ImGui::GetForegroundDrawList()->AddRectFilled({ 0, 0 }, ImGui::GetIO().DisplaySize, colour);
|
||||
ImGui::GetBackgroundDrawList()->AddRectFilled({ 0, 0 }, ImGui::GetIO().DisplaySize, colour);
|
||||
}
|
||||
|
||||
static void DoFade(bool isFadeIn, float duration, std::function<void()> endCallback, float endCallbackDelay)
|
||||
|
||||
@@ -34,8 +34,14 @@ int Window_OnSDLEvent(void*, SDL_Event* event)
|
||||
switch (event->type)
|
||||
{
|
||||
case SDL_QUIT:
|
||||
{
|
||||
if (App::s_isSaving)
|
||||
break;
|
||||
|
||||
App::Exit();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
@@ -173,27 +179,6 @@ void GameWindow::Init(const char* sdlVideoDriver)
|
||||
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
|
||||
#endif
|
||||
|
||||
Config::WindowSize.LockCallback = [](ConfigDef<int32_t>* def)
|
||||
{
|
||||
// Try matching the current window size with a known configuration.
|
||||
if (def->Value < 0)
|
||||
def->Value = FindNearestDisplayMode();
|
||||
};
|
||||
|
||||
Config::WindowSize.ApplyCallback = [](ConfigDef<int32_t>* def)
|
||||
{
|
||||
auto displayModes = GetDisplayModes();
|
||||
|
||||
// Use largest supported resolution if overflowed.
|
||||
if (def->Value >= displayModes.size())
|
||||
def->Value = displayModes.size() - 1;
|
||||
|
||||
auto& mode = displayModes[def->Value];
|
||||
auto centre = SDL_WINDOWPOS_CENTERED_DISPLAY(GetDisplay());
|
||||
|
||||
SetDimensions(mode.w, mode.h, centre, centre);
|
||||
};
|
||||
|
||||
s_x = Config::WindowX;
|
||||
s_y = Config::WindowY;
|
||||
s_width = Config::WindowWidth;
|
||||
@@ -399,6 +384,11 @@ SDL_Rect GameWindow::GetDimensions()
|
||||
return rect;
|
||||
}
|
||||
|
||||
void GameWindow::GetSizeInPixels(int *w, int *h)
|
||||
{
|
||||
SDL_GetWindowSizeInPixels(s_pWindow, w, h);
|
||||
}
|
||||
|
||||
void GameWindow::SetDimensions(int w, int h, int x, int y)
|
||||
{
|
||||
s_width = w;
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
static bool IsMaximised();
|
||||
static EWindowState SetMaximised(bool isEnabled);
|
||||
static SDL_Rect GetDimensions();
|
||||
static void GetSizeInPixels(int *w, int *h);
|
||||
static void SetDimensions(int w, int h, int x = SDL_WINDOWPOS_CENTERED, int y = SDL_WINDOWPOS_CENTERED);
|
||||
static void ResetDimensions();
|
||||
static uint32_t GetWindowFlags();
|
||||
|
||||
@@ -45,6 +45,9 @@ void ResetGradient()
|
||||
|
||||
void SetShaderModifier(uint32_t shaderModifier)
|
||||
{
|
||||
if (shaderModifier == IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT && Config::DisableLowResolutionFontOnCustomUI)
|
||||
shaderModifier = IMGUI_SHADER_MODIFIER_NONE;
|
||||
|
||||
auto callbackData = AddImGuiCallback(ImGuiCallback::SetShaderModifier);
|
||||
callbackData->setShaderModifier.shaderModifier = shaderModifier;
|
||||
}
|
||||
@@ -169,7 +172,7 @@ double ComputeMotion(double duration, double offset, double total)
|
||||
|
||||
void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
auto commonWidth = Scale(35);
|
||||
auto commonHeight = Scale(35);
|
||||
@@ -200,7 +203,7 @@ void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha)
|
||||
|
||||
void DrawPauseHeaderContainer(ImVec2 min, ImVec2 max, float alpha)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
auto commonWidth = Scale(35);
|
||||
|
||||
@@ -217,14 +220,14 @@ void DrawPauseHeaderContainer(ImVec2 min, ImVec2 max, float alpha)
|
||||
|
||||
void DrawTextBasic(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
drawList->AddText(font, fontSize, pos, colour, text, nullptr);
|
||||
}
|
||||
|
||||
void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& position, const ImVec2& min, const ImVec2& max, ImU32 color, const char* text, double time, double delay, double speed)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto rectWidth = max.x - min.x;
|
||||
auto textSize = font->CalcTextSizeA(fontSize, FLT_MAX, 0, text);
|
||||
auto textX = position.x - fmodf(std::max(0.0, ImGui::GetTime() - (time + delay)) * speed, textSize.x + rectWidth);
|
||||
@@ -278,7 +281,7 @@ void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& posit
|
||||
|
||||
void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2& pos, const ImVec2& min, const ImVec2& max, ImU32 colour, const char* text, double time, double delay, double speed, float offset, float radius, ImU32 shadowColour)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto rectWidth = max.x - min.x;
|
||||
auto textSize = font->CalcTextSizeA(fontSize, FLT_MAX, 0, text);
|
||||
auto textX = pos.x - fmodf(std::max(0.0, ImGui::GetTime() - (time + delay)) * speed, textSize.x + rectWidth);
|
||||
@@ -296,7 +299,7 @@ void DrawTextWithMarqueeShadow(const ImFont* font, float fontSize, const ImVec2&
|
||||
|
||||
void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 color, const char* text, float outlineSize, ImU32 outlineColor, uint32_t shaderModifier)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
SetOutline(outlineSize);
|
||||
drawList->AddText(font, fontSize, pos, outlineColor, text);
|
||||
@@ -313,10 +316,16 @@ void DrawTextWithOutline(const ImFont* font, float fontSize, const ImVec2& pos,
|
||||
|
||||
void DrawTextWithShadow(const ImFont* font, float fontSize, const ImVec2& pos, ImU32 colour, const char* text, float offset, float radius, ImU32 shadowColour)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
offset = Scale(offset);
|
||||
|
||||
// Original 4:3 has thicker text shadows.
|
||||
if (Config::AspectRatio == EAspectRatio::OriginalNarrow)
|
||||
{
|
||||
radius *= 1.5f;
|
||||
}
|
||||
|
||||
SetOutline(radius);
|
||||
drawList->AddText(font, fontSize, { pos.x + offset, pos.y + offset }, shadowColour, text);
|
||||
ResetOutline();
|
||||
@@ -455,17 +464,39 @@ std::vector<std::string> Split(const char* strStart, const ImFont* font, float f
|
||||
const bool wordWrapEnabled = (maxWidth > 0.0f);
|
||||
const char *wordWrapEOL = nullptr;
|
||||
|
||||
auto IsKanji = [](const char* str, const char* strEnd)
|
||||
{
|
||||
const char* tempStr = str;
|
||||
unsigned int c = (unsigned int)*tempStr;
|
||||
if (c < 0x80)
|
||||
tempStr += 1;
|
||||
else
|
||||
tempStr += ImTextCharFromUtf8(&c, tempStr, strEnd);
|
||||
|
||||
// Basic CJK and CJK Extension A
|
||||
return (c >= 0x4E00 && c <= 0x9FBF) || (c >= 0x3400 && c <= 0x4DBF);
|
||||
};
|
||||
|
||||
while (*str != 0)
|
||||
{
|
||||
if (wordWrapEnabled)
|
||||
{
|
||||
if (wordWrapEOL == nullptr)
|
||||
{
|
||||
wordWrapEOL = font->CalcWordWrapPositionA(scale, str, strEnd, maxWidth - lineWidth);
|
||||
wordWrapEOL = CalcWordWrapPositionA(font, scale, str, strEnd, maxWidth - lineWidth);
|
||||
}
|
||||
|
||||
if (str >= wordWrapEOL)
|
||||
{
|
||||
if (IsKanji(str, strEnd))
|
||||
{
|
||||
// If the current character is Kanji, move back to prevent splitting Kanji
|
||||
while (str > lineStart && IsKanji(str - 3, strEnd))
|
||||
{
|
||||
str -= 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (textWidth < lineWidth)
|
||||
textWidth = lineWidth;
|
||||
|
||||
@@ -639,7 +670,7 @@ ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float maxWidt
|
||||
return MeasureCentredParagraph(font, fontSize, lineMargin, lines);
|
||||
}
|
||||
|
||||
void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, const ImVec2& pos, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod, std::function<void(const char*, float, ImVec2)> annotationDrawMethod, bool isCentred)
|
||||
void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, const ImVec2& pos, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod, std::function<void(const char*, float, ImVec2)> annotationDrawMethod, bool isCentred, bool leadingSpace)
|
||||
{
|
||||
auto annotationFontSize = fontSize * ANNOTATION_FONT_SIZE_MODIFIER;
|
||||
|
||||
@@ -647,8 +678,14 @@ void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, c
|
||||
auto lines = Split(input.first.c_str(), font, fontSize, maxWidth);
|
||||
|
||||
for (auto& line : lines)
|
||||
{
|
||||
line = ReAddRubyAnnotations(line, input.second);
|
||||
|
||||
if (!line.empty() && line.substr(0, 3) != "「" && leadingSpace)
|
||||
{
|
||||
line.insert(0, " ");
|
||||
}
|
||||
}
|
||||
|
||||
auto paragraphSize = MeasureCentredParagraph(font, fontSize, lineMargin, lines);
|
||||
auto offsetY = 0.0f;
|
||||
|
||||
@@ -732,7 +769,7 @@ ImU32 ColourLerp(ImU32 c0, ImU32 c1, float t)
|
||||
|
||||
void DrawVersionString(const ImFont* font, const ImU32 col)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
auto fontSize = Scale(12);
|
||||
auto textMargin = Scale(2);
|
||||
@@ -743,7 +780,7 @@ void DrawVersionString(const ImFont* font, const ImU32 col)
|
||||
|
||||
void DrawSelectionContainer(ImVec2 min, ImVec2 max, bool fadeTop)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
static auto breatheStart = ImGui::GetTime();
|
||||
auto alpha = BREATHE_MOTION(1.0f, 0.55f, breatheStart, 0.92f);
|
||||
@@ -787,7 +824,7 @@ void DrawSelectionContainer(ImVec2 min, ImVec2 max, bool fadeTop)
|
||||
|
||||
void DrawToggleLight(ImVec2 pos, bool isEnabled, float alpha)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto lightSize = Scale(14);
|
||||
auto lightCol = IM_COL32(255, 255, 255, 255 * alpha);
|
||||
|
||||
@@ -817,3 +854,105 @@ void DrawToggleLight(ImVec2 pos, bool isEnabled, float alpha)
|
||||
drawList->AddImage(g_texLight.get(), min, max, GET_UV_COORDS(lightOffUVs), lightCol);
|
||||
}
|
||||
}
|
||||
|
||||
// Taken from ImGui because we need to modify to break for '\u200B\ too
|
||||
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
||||
// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
|
||||
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
||||
const char* CalcWordWrapPositionA(const ImFont* font, float scale, const char* text, const char* text_end, float wrap_width)
|
||||
{
|
||||
// For references, possible wrap point marked with ^
|
||||
// "aaa bbb, ccc,ddd. eee fff. ggg!"
|
||||
// ^ ^ ^ ^ ^__ ^ ^
|
||||
|
||||
// List of hardcoded separators: .,;!?'"
|
||||
|
||||
// Skip extra blanks after a line returns (that includes not counting them in width computation)
|
||||
// e.g. "Hello world" --> "Hello" "World"
|
||||
|
||||
// Cut words that cannot possibly fit within one line.
|
||||
// e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
|
||||
float line_width = 0.0f;
|
||||
float word_width = 0.0f;
|
||||
float blank_width = 0.0f;
|
||||
wrap_width /= scale; // We work with unscaled widths to avoid scaling every characters
|
||||
|
||||
const char* word_end = text;
|
||||
const char* prev_word_end = NULL;
|
||||
bool inside_word = true;
|
||||
|
||||
const char* s = text;
|
||||
IM_ASSERT(text_end != NULL);
|
||||
while (s < text_end)
|
||||
{
|
||||
unsigned int c = (unsigned int)*s;
|
||||
const char* next_s;
|
||||
if (c < 0x80)
|
||||
next_s = s + 1;
|
||||
else
|
||||
next_s = s + ImTextCharFromUtf8(&c, s, text_end);
|
||||
|
||||
if (c < 32)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
line_width = word_width = blank_width = 0.0f;
|
||||
inside_word = true;
|
||||
s = next_s;
|
||||
continue;
|
||||
}
|
||||
if (c == '\r')
|
||||
{
|
||||
s = next_s;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const float char_width = ((int)c < font->IndexAdvanceX.Size ? font->IndexAdvanceX.Data[c] : font->FallbackAdvanceX);
|
||||
if (ImCharIsBlankW(c) || c == 0x200B)
|
||||
{
|
||||
if (inside_word)
|
||||
{
|
||||
line_width += blank_width;
|
||||
blank_width = 0.0f;
|
||||
word_end = s;
|
||||
}
|
||||
blank_width += char_width;
|
||||
inside_word = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
word_width += char_width;
|
||||
if (inside_word)
|
||||
{
|
||||
word_end = next_s;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev_word_end = word_end;
|
||||
line_width += word_width + blank_width;
|
||||
word_width = blank_width = 0.0f;
|
||||
}
|
||||
|
||||
// Allow wrapping after punctuation.
|
||||
inside_word = (c != '.' && c != ',' && c != ';' && c != '!' && c != '?' && c != '\"');
|
||||
}
|
||||
|
||||
// We ignore blank width at the end of the line (they can be skipped)
|
||||
if (line_width + word_width > wrap_width)
|
||||
{
|
||||
// Words that cannot possibly fit within an entire line will be cut anywhere.
|
||||
if (word_width < wrap_width)
|
||||
s = prev_word_end ? prev_word_end : word_end;
|
||||
break;
|
||||
}
|
||||
|
||||
s = next_s;
|
||||
}
|
||||
|
||||
// Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
||||
// +1 may not be a character start point in UTF-8 but it's ok because caller loops use (text >= word_wrap_eol).
|
||||
if (s == text && text < text_end)
|
||||
return s + 1;
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ std::vector<std::string> RemoveAnnotationFromParagraph(const std::vector<std::st
|
||||
std::string RemoveAnnotationFromParagraphLine(const std::vector<TextSegment>& annotatedLine);
|
||||
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float lineMargin, const std::vector<std::string>& lines);
|
||||
ImVec2 MeasureCentredParagraph(const ImFont* font, float fontSize, float maxWidth, float lineMargin, const char* text);
|
||||
void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, const ImVec2& pos, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod, std::function<void(const char*, float, ImVec2)> annotationDrawMethod, bool isCentred = false);
|
||||
void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, const ImVec2& pos, float lineMargin, const char* text, std::function<void(const char*, ImVec2)> drawMethod, std::function<void(const char*, float, ImVec2)> annotationDrawMethod, bool isCentred = false, bool leadingSpace = false);
|
||||
float Lerp(float a, float b, float t);
|
||||
float Cubic(float a, float b, float t);
|
||||
float Hermite(float a, float b, float t);
|
||||
@@ -81,3 +81,4 @@ ImU32 ColourLerp(ImU32 c0, ImU32 c1, float t);
|
||||
void DrawVersionString(const ImFont* font, const ImU32 col = IM_COL32(255, 255, 255, 70));
|
||||
void DrawSelectionContainer(ImVec2 min, ImVec2 max, bool fadeTop = false);
|
||||
void DrawToggleLight(ImVec2 pos, bool isEnabled, float alpha = 1.0f);
|
||||
const char* CalcWordWrapPositionA(const ImFont* font, float scale, const char* text, const char* text_end, float wrap_width);
|
||||
|
||||
@@ -464,7 +464,7 @@ static void ResetCursorRects()
|
||||
static void DrawBackground()
|
||||
{
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
drawList->AddRectFilled({ 0.0, 0.0 }, res, IM_COL32_BLACK);
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ static void DrawLeftImage()
|
||||
int a = std::lround(255.0 * imageAlpha);
|
||||
GuestTexture *guestTexture = g_installTextures[installTextureIndex % g_installTextures.size()].get();
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
ImVec2 min = { g_aspectRatioOffsetX + Scale(IMAGE_X), g_aspectRatioOffsetY + Scale(IMAGE_Y) };
|
||||
ImVec2 max = { min.x + Scale(IMAGE_WIDTH), min.y + Scale(IMAGE_HEIGHT) };
|
||||
drawList->AddImage(guestTexture, min, max, ImVec2(0, 0), ImVec2(1, 1), IM_COL32(255, 255, 255, a));
|
||||
@@ -491,7 +491,7 @@ static void DrawLeftImage()
|
||||
|
||||
static void DrawHeaderIconsForInstallPhase(double iconsPosX, double iconsPosY, double iconsScale)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
// Arrow Circle Icon
|
||||
ImVec2 arrowCircleMin = { g_aspectRatioOffsetX + Scale(iconsPosX - iconsScale / 2), Scale(iconsPosY - iconsScale / 2) };
|
||||
@@ -546,7 +546,7 @@ static void DrawHeaderIconsForInstallPhase(double iconsPosX, double iconsPosY, d
|
||||
|
||||
static void DrawHeaderIcons()
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
float iconsPosX = 256.0f;
|
||||
float iconsPosY = 80.0f;
|
||||
@@ -582,7 +582,7 @@ static void DrawScanlineBars()
|
||||
}
|
||||
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_SCANLINE);
|
||||
|
||||
@@ -680,7 +680,7 @@ static void DrawScanlineBars()
|
||||
static void DrawContainer(ImVec2 min, ImVec2 max, bool isTextArea)
|
||||
{
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
double gridAlpha = ComputeMotionInstaller(g_appearTime, g_disappearTime,
|
||||
isTextArea ? CONTAINER_INNER_TIME : CONTAINER_OUTER_TIME,
|
||||
@@ -711,7 +711,7 @@ static void DrawContainer(ImVec2 min, ImVec2 max, bool isTextArea)
|
||||
static void DrawDescriptionContainer()
|
||||
{
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto fontSize = Scale(28.0f);
|
||||
auto annotationFontSize = fontSize * ANNOTATION_FONT_SIZE_MODIFIER;
|
||||
|
||||
@@ -736,6 +736,14 @@ static void DrawDescriptionContainer()
|
||||
}
|
||||
else if (g_currentPage == WizardPage::InstallFailed)
|
||||
{
|
||||
// Japanese needs text to be brought in by a normal width space
|
||||
// as it allows for text to begin further than others for
|
||||
// special characters.
|
||||
if (Config::Language == ELanguage::Japanese)
|
||||
{
|
||||
strncat(descriptionText, " ", 1);
|
||||
}
|
||||
|
||||
strncat(descriptionText, g_installerErrorMessage.c_str(), sizeof(descriptionText) - 1);
|
||||
}
|
||||
|
||||
@@ -769,6 +777,8 @@ static void DrawDescriptionContainer()
|
||||
|
||||
textX += annotationFontSize;
|
||||
textY += annotationFontSize;
|
||||
|
||||
lineWidth += annotationFontSize;
|
||||
}
|
||||
|
||||
drawList->PushClipRect(clipRectMin, clipRectMax, false);
|
||||
@@ -788,28 +798,47 @@ static void DrawDescriptionContainer()
|
||||
[=](const char* str, float size, ImVec2 pos)
|
||||
{
|
||||
DrawTextBasic(g_seuratFont, size, pos, IM_COL32(255, 255, 255, 255 * textAlpha), str);
|
||||
}
|
||||
},
|
||||
false,
|
||||
Config::Language == ELanguage::Japanese
|
||||
);
|
||||
|
||||
drawList->PopClipRect();
|
||||
|
||||
drawList->PopClipRect();
|
||||
|
||||
if (g_currentPage == WizardPage::InstallSucceeded)
|
||||
{
|
||||
auto descTextSize = MeasureCentredParagraph(g_seuratFont, fontSize, lineWidth, lineMargin, descriptionText);
|
||||
|
||||
auto hedgeDevStr = "hedge-dev";
|
||||
auto hedgeDevTextSize = g_seuratFont->CalcTextSizeA(fontSize, FLT_MAX, 0, hedgeDevStr);
|
||||
auto hedgeDevTextMarginX = Scale(15);
|
||||
|
||||
auto imageScale = hedgeDevTextSize.x / 3;
|
||||
auto imageMarginY = Scale(15);
|
||||
|
||||
auto colWhite = IM_COL32(255, 255, 255, 255 * textAlpha);
|
||||
|
||||
auto containerLeft = g_aspectRatioOffsetX + Scale(CONTAINER_X);
|
||||
auto containerTop = g_aspectRatioOffsetY + Scale(CONTAINER_Y);
|
||||
auto containerRight = containerLeft + Scale(CONTAINER_WIDTH);
|
||||
auto containerBottom = containerTop + Scale(CONTAINER_HEIGHT);
|
||||
|
||||
auto marqueeTextSize = g_seuratFont->CalcTextSizeA(fontSize, FLT_MAX, 0, g_creditsStr.c_str());
|
||||
auto marqueeTextMarginX = Scale(5);
|
||||
auto marqueeTextMarginY = Scale(15);
|
||||
|
||||
ImVec2 marqueeTextPos = { descriptionMax.x, containerBottom - marqueeTextSize.y - marqueeTextMarginY };
|
||||
ImVec2 marqueeTextMin = { containerLeft, marqueeTextPos.y };
|
||||
ImVec2 marqueeTextMax = { containerRight, containerBottom };
|
||||
|
||||
auto imageScale = hedgeDevTextSize.x / 3;
|
||||
auto imageMarginY = Scale(2);
|
||||
|
||||
ImVec2 imageRegionMin = { containerLeft, textY + descTextSize.y };
|
||||
ImVec2 imageRegionMax = { containerRight, containerBottom - (marqueeTextMax.y - marqueeTextMin.y) };
|
||||
|
||||
ImVec2 imageMin =
|
||||
{
|
||||
/* X */ g_aspectRatioOffsetX + Scale(CONTAINER_X) + (Scale(CONTAINER_WIDTH) / 2) - (imageScale / 2) - (hedgeDevTextSize.x / 2) - hedgeDevTextMarginX,
|
||||
/* Y */ g_aspectRatioOffsetY + Scale(CONTAINER_Y) + (Scale(CONTAINER_HEIGHT) / 2) - (imageScale / 2) + imageMarginY
|
||||
/* X */ imageRegionMin.x + ((imageRegionMax.x - imageRegionMin.x) / 2) - (imageScale / 2) - (hedgeDevTextSize.x / 2) - hedgeDevTextMarginX,
|
||||
/* Y */ imageRegionMin.y + ((imageRegionMax.y - imageRegionMin.y) / 2) - (imageScale / 2) - imageMarginY
|
||||
};
|
||||
|
||||
ImVec2 imageMax = { imageMin.x + imageScale, imageMin.y + imageScale };
|
||||
@@ -825,16 +854,8 @@ static void DrawDescriptionContainer()
|
||||
hedgeDevStr
|
||||
);
|
||||
|
||||
auto marqueeTextSize = g_seuratFont->CalcTextSizeA(fontSize, FLT_MAX, 0, g_creditsStr.c_str());
|
||||
auto marqueeTextMarginX = Scale(5);
|
||||
auto marqueeTextMarginY = Scale(15);
|
||||
|
||||
ImVec2 textPos = { descriptionMax.x, g_aspectRatioOffsetY + Scale(CONTAINER_Y) + Scale(CONTAINER_HEIGHT) - marqueeTextSize.y - marqueeTextMarginY };
|
||||
ImVec2 textMin = { g_aspectRatioOffsetX + Scale(CONTAINER_X), textPos.y };
|
||||
ImVec2 textMax = { g_aspectRatioOffsetX + Scale(CONTAINER_X) + Scale(CONTAINER_WIDTH), g_aspectRatioOffsetY + Scale(CONTAINER_Y) + Scale(CONTAINER_HEIGHT) };
|
||||
|
||||
SetHorizontalMarqueeFade(textMin, textMax, Scale(32));
|
||||
DrawTextWithMarquee(g_seuratFont, fontSize, textPos, textMin, textMax, colWhite, g_creditsStr.c_str(), g_installerEndTime, 0.9, Scale(200));
|
||||
SetHorizontalMarqueeFade(marqueeTextMin, marqueeTextMax, Scale(32));
|
||||
DrawTextWithMarquee(g_seuratFont, fontSize, marqueeTextPos, marqueeTextMin, marqueeTextMax, colWhite, g_creditsStr.c_str(), g_installerEndTime, 0.9, Scale(200));
|
||||
ResetMarqueeFade();
|
||||
}
|
||||
|
||||
@@ -863,7 +884,7 @@ static void DrawDescriptionContainer()
|
||||
|
||||
if (g_currentPage == WizardPage::InstallSucceeded && textAlpha >= 1.0)
|
||||
{
|
||||
ButtonGuide::Open(Button(Localise("Common_Select"), selectIcon));
|
||||
ButtonGuide::Open(Button("Common_Select", 115.0f, selectIcon));
|
||||
}
|
||||
else if (g_currentPage != WizardPage::Installing && textAlpha >= 1.0)
|
||||
{
|
||||
@@ -875,15 +896,15 @@ static void DrawDescriptionContainer()
|
||||
|
||||
std::array<Button, 2> buttons =
|
||||
{
|
||||
Button(Localise("Common_Select"), selectIcon),
|
||||
Button(Localise(backKey), backIcon)
|
||||
Button("Common_Select", 115.0f, selectIcon),
|
||||
Button(backKey, FLT_MAX, backIcon)
|
||||
};
|
||||
|
||||
ButtonGuide::Open(buttons);
|
||||
}
|
||||
else if (g_currentPage == WizardPage::Installing)
|
||||
{
|
||||
ButtonGuide::Open(Button(Localise("Common_Cancel"), backIcon));
|
||||
ButtonGuide::Open(Button("Common_Cancel", FLT_MAX, backIcon));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -896,7 +917,7 @@ static void DrawDescriptionContainer()
|
||||
static void DrawButtonContainer(ImVec2 min, ImVec2 max, int baser, int baseg, float alpha)
|
||||
{
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_SCANLINE_BUTTON);
|
||||
drawList->AddRectFilledMultiColor(min, max, IM_COL32(baser, baseg + 130, 0, 223 * alpha), IM_COL32(baser, baseg + 130, 0, 178 * alpha), IM_COL32(baser, baseg + 130, 0, 223 * alpha), IM_COL32(baser, baseg + 130, 0, 178 * alpha));
|
||||
drawList->AddRectFilledMultiColor(min, max, IM_COL32(baser, baseg, 0, 13 * alpha), IM_COL32(baser, baseg, 0, 0), IM_COL32(baser, baseg, 0, 55 * alpha), IM_COL32(baser, baseg, 0, 6 * alpha));
|
||||
@@ -924,7 +945,7 @@ static void DrawButton(ImVec2 min, ImVec2 max, const char *buttonText, bool sour
|
||||
buttonPressed = false;
|
||||
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
float alpha = ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_INNER_TIME, CONTAINER_INNER_DURATION);
|
||||
if (!buttonEnabled)
|
||||
{
|
||||
@@ -1030,7 +1051,7 @@ static void DrawSourceButton(ButtonColumn buttonColumn, float yRatio, const char
|
||||
static void DrawProgressBar(float progressRatio)
|
||||
{
|
||||
auto &res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
float alpha = 1.0;
|
||||
const uint32_t innerColor0 = IM_COL32(0, 65, 0, 255 * alpha);
|
||||
const uint32_t innerColor1 = IM_COL32(0, 32, 0, 255 * alpha);
|
||||
@@ -1390,7 +1411,7 @@ static void DrawNavigationButton()
|
||||
|
||||
float squashRatio;
|
||||
constexpr float NAV_BUTTON_MAX_TEXT_WIDTH = 90.0f;
|
||||
const char *nextButtonKey = "Installer_Button_Next";
|
||||
std::string_view nextButtonKey = "Installer_Button_Next";
|
||||
if (skipButton)
|
||||
{
|
||||
nextButtonKey = "Installer_Button_Skip";
|
||||
@@ -1532,7 +1553,7 @@ static void DrawHorizontalBorder(bool bottomBorder)
|
||||
const uint32_t FADE_COLOR_LEFT = IM_COL32(155, 155, 155, 0);
|
||||
const uint32_t SOLID_COLOR = IM_COL32(155, 200, 155, 255);
|
||||
const uint32_t FADE_COLOR_RIGHT = IM_COL32(155, 225, 155, 0);
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
double borderScale = 1.0 - ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_LINE_ANIMATION_TIME, CONTAINER_LINE_ANIMATION_DURATION);
|
||||
float midX = g_aspectRatioOffsetX + Scale(CONTAINER_X + CONTAINER_WIDTH / 5);
|
||||
float minX = std::lerp(g_aspectRatioOffsetX + Scale(CONTAINER_X - BORDER_SIZE - BORDER_OVERSHOOT), midX, borderScale);
|
||||
@@ -1564,7 +1585,7 @@ static void DrawVerticalBorder(bool rightBorder)
|
||||
{
|
||||
const uint32_t SOLID_COLOR = IM_COL32(155, rightBorder ? 225 : 155, 155, 255);
|
||||
const uint32_t FADE_COLOR = IM_COL32(155, rightBorder ? 225 : 155, 155, 0);
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
double borderScale = 1.0 - ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_LINE_ANIMATION_TIME, CONTAINER_LINE_ANIMATION_DURATION);
|
||||
float minX = g_aspectRatioOffsetX + (rightBorder ? Scale(CONTAINER_X + CONTAINER_WIDTH) : Scale(CONTAINER_X - BORDER_SIZE));
|
||||
float maxX = minX + Scale(BORDER_SIZE);
|
||||
@@ -1661,7 +1682,7 @@ static void PickerDrawForeground()
|
||||
{
|
||||
if (g_currentPickerVisible)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
drawList->AddRectFilled({ 0.0f, 0.0f }, ImGui::GetIO().DisplaySize, IM_COL32(0, 0, 0, 190));
|
||||
}
|
||||
}
|
||||
@@ -1700,6 +1721,24 @@ static void PickerCheckResults()
|
||||
g_currentPickerVisible = false;
|
||||
}
|
||||
|
||||
static bool g_fadingOutMusic;
|
||||
|
||||
static void ProcessMusic()
|
||||
{
|
||||
if (g_isDisappearing)
|
||||
{
|
||||
if (!g_fadingOutMusic)
|
||||
{
|
||||
EmbeddedPlayer::FadeOutMusic();
|
||||
g_fadingOutMusic = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EmbeddedPlayer::PlayMusic();
|
||||
}
|
||||
}
|
||||
|
||||
void InstallerWizard::Init()
|
||||
{
|
||||
auto &io = ImGui::GetIO();
|
||||
@@ -1829,6 +1868,7 @@ bool InstallerWizard::Run(std::filesystem::path installPath, bool skipGame)
|
||||
while (s_isVisible)
|
||||
{
|
||||
Video::WaitOnSwapChain();
|
||||
ProcessMusic();
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||
GameWindow::Update();
|
||||
|
||||
@@ -150,7 +150,7 @@ g_sdlEventListenerForMessageWindow;
|
||||
|
||||
bool DrawContainer(float appearTime, ImVec2 centre, ImVec2 max, bool isForeground = true)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
ImVec2 _min = { centre.x - max.x, centre.y - max.y };
|
||||
ImVec2 _max = { centre.x + max.x, centre.y + max.y };
|
||||
@@ -201,7 +201,7 @@ bool DrawContainer(float appearTime, ImVec2 centre, ImVec2 max, bool isForegroun
|
||||
|
||||
void DrawButton(int rowIndex, float yOffset, float width, float height, std::string& text)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
auto clipRectMin = drawList->GetClipRectMin();
|
||||
auto clipRectMax = drawList->GetClipRectMax();
|
||||
@@ -223,6 +223,10 @@ void DrawButton(int rowIndex, float yOffset, float width, float height, std::str
|
||||
auto fontSize = Scale(28);
|
||||
auto textSize = g_fntSeurat->CalcTextSizeA(fontSize, FLT_MAX, 0, text.c_str());
|
||||
|
||||
// Show low quality text in-game.
|
||||
if (App::s_isInit)
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT);
|
||||
|
||||
DrawTextWithShadow
|
||||
(
|
||||
g_fntSeurat,
|
||||
@@ -231,6 +235,10 @@ void DrawButton(int rowIndex, float yOffset, float width, float height, std::str
|
||||
isSelected ? IM_COL32(255, 128, 0, 255) : IM_COL32(255, 255, 255, 255),
|
||||
text.c_str()
|
||||
);
|
||||
|
||||
// Reset the shader modifier.
|
||||
if (App::s_isInit)
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE);
|
||||
}
|
||||
|
||||
void DrawNextButtonGuide(bool isController, bool isKeyboard)
|
||||
@@ -241,11 +249,16 @@ void DrawNextButtonGuide(bool isController, bool isKeyboard)
|
||||
? EButtonIcon::Enter
|
||||
: EButtonIcon::LMB;
|
||||
|
||||
// Always show controller prompt in-game.
|
||||
if (App::s_isInit)
|
||||
icon = EButtonIcon::A;
|
||||
auto fontQuality = EFontQuality::High;
|
||||
|
||||
ButtonGuide::Open(Button(Localise("Common_Next"), icon));
|
||||
// Always show controller prompt and low quality text in-game.
|
||||
if (App::s_isInit)
|
||||
{
|
||||
icon = EButtonIcon::A;
|
||||
fontQuality = EFontQuality::Low;
|
||||
}
|
||||
|
||||
ButtonGuide::Open(Button("Common_Next", FLT_MAX, icon, fontQuality));
|
||||
}
|
||||
|
||||
static void ResetSelection()
|
||||
@@ -275,7 +288,7 @@ void MessageWindow::Draw()
|
||||
if (!s_isVisible)
|
||||
return;
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
ImVec2 centre = { res.x / 2, res.y / 2 };
|
||||
@@ -338,6 +351,10 @@ void MessageWindow::Draw()
|
||||
|
||||
if (DrawContainer(g_appearTime, centre, { textSize.x / 2 + textMarginX, textSize.y / 2 + textMarginY }, !g_isControlsVisible))
|
||||
{
|
||||
// Use low quality text when the game is booted to not clash with existing UI.
|
||||
if (App::s_isInit)
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT);
|
||||
|
||||
DrawRubyAnnotatedText
|
||||
(
|
||||
g_fntSeurat,
|
||||
@@ -353,12 +370,16 @@ void MessageWindow::Draw()
|
||||
},
|
||||
[=](const char* str, float size, ImVec2 pos)
|
||||
{
|
||||
DrawTextWithShadow(g_fntSeurat, size, pos, IM_COL32(255, 255, 255, 255), str, 1.0f);
|
||||
DrawTextWithShadow(g_fntSeurat, size, pos, IM_COL32(255, 255, 255, 255), str, 1.5f, 1.5f);
|
||||
},
|
||||
|
||||
true
|
||||
);
|
||||
|
||||
// Reset the shader modifier.
|
||||
if (App::s_isInit)
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_LOW_QUALITY_TEXT);
|
||||
|
||||
drawList->PopClipRect();
|
||||
|
||||
if (g_buttons.size())
|
||||
@@ -423,10 +444,17 @@ void MessageWindow::Draw()
|
||||
backIcon = EButtonIcon::Escape;
|
||||
}
|
||||
|
||||
auto fontQuality = EFontQuality::High;
|
||||
if (App::s_isInit)
|
||||
{
|
||||
// Show low quality text in-game.
|
||||
fontQuality = EFontQuality::Low;
|
||||
}
|
||||
|
||||
std::array<Button, 2> buttons =
|
||||
{
|
||||
Button(Localise("Common_Select"), selectIcon),
|
||||
Button(Localise("Common_Back"), backIcon),
|
||||
Button("Common_Select", 115.0f, selectIcon, fontQuality),
|
||||
Button("Common_Back", FLT_MAX, backIcon, fontQuality),
|
||||
};
|
||||
|
||||
ButtonGuide::Open(buttons);
|
||||
@@ -470,8 +498,8 @@ void MessageWindow::Draw()
|
||||
|
||||
std::array<Button, 2> buttons =
|
||||
{
|
||||
Button(Localise("Common_Select"), EButtonIcon::LMB),
|
||||
Button(Localise("Common_Back"), EButtonIcon::Escape),
|
||||
Button("Common_Select", 115.0f, EButtonIcon::LMB),
|
||||
Button("Common_Back", FLT_MAX, EButtonIcon::Escape),
|
||||
};
|
||||
|
||||
ButtonGuide::Open(buttons);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "options_menu.h"
|
||||
#include "options_menu_thumbnails.h"
|
||||
#include "tv_static.h"
|
||||
|
||||
#include <api/SWA.h>
|
||||
#include <apu/audio.h>
|
||||
@@ -18,6 +19,7 @@
|
||||
#include <app.h>
|
||||
#include <decompressor.h>
|
||||
#include <exports.h>
|
||||
#include <sdl_listener.h>
|
||||
|
||||
#include <res/images/options_menu/miles_electric.dds.h>
|
||||
|
||||
@@ -101,6 +103,24 @@ static double g_appearTime = 0.0;
|
||||
|
||||
static std::unique_ptr<GuestTexture> g_upMilesElectric;
|
||||
|
||||
static float g_rightStickY;
|
||||
|
||||
class SDLEventListenerForOptionsMenu : public SDLEventListener
|
||||
{
|
||||
public:
|
||||
bool OnSDLEvent(SDL_Event* event) override
|
||||
{
|
||||
if (!OptionsMenu::s_isVisible || !hid::IsInputAllowed())
|
||||
return false;
|
||||
|
||||
if (event->type == SDL_CONTROLLERAXISMOTION && event->caxis.axis == SDL_CONTROLLER_AXIS_RIGHTY)
|
||||
g_rightStickY = event->caxis.value / 32767.0f;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
g_sdlEventListenerForOptionsMenu;
|
||||
|
||||
static void DrawTitle()
|
||||
{
|
||||
static constexpr double fadeOffset = 3.0;
|
||||
@@ -127,7 +147,7 @@ static void DrawTitle()
|
||||
g_titleAnimBegin = false;
|
||||
}
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto x = Scale(122);
|
||||
auto y = Scale(56);
|
||||
|
||||
@@ -238,7 +258,7 @@ static void DrawScanlineBars()
|
||||
float height = Scale(105.0f);
|
||||
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
if (OptionsMenu::s_pauseMenuType != SWA::eMenuType_WorldMap)
|
||||
{
|
||||
@@ -350,7 +370,7 @@ static void DrawContainer(ImVec2 min, ImVec2 max, bool drawRightOutline)
|
||||
max.y = Lerp(center, max.y, containerHeight);
|
||||
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
double outerAlpha = g_isStage ? 1.0 : ComputeMotion(g_appearTime, CONTAINER_OUTER_TIME, CONTAINER_OUTER_DURATION);
|
||||
double innerAlpha = g_isStage ? 1.0 : ComputeMotion(g_appearTime, CONTAINER_INNER_TIME, CONTAINER_INNER_DURATION);
|
||||
@@ -429,11 +449,8 @@ static bool DrawCategories()
|
||||
|
||||
auto inputState = SWA::CInputState::GetInstance();
|
||||
|
||||
bool moveLeft = !g_lockedOnOption && (inputState->GetPadState().IsTapped(SWA::eKeyState_LeftBumper) ||
|
||||
inputState->GetPadState().IsTapped(SWA::eKeyState_LeftTrigger));
|
||||
|
||||
bool moveRight = !g_lockedOnOption && (inputState->GetPadState().IsTapped(SWA::eKeyState_RightBumper) ||
|
||||
inputState->GetPadState().IsTapped(SWA::eKeyState_RightTrigger));
|
||||
bool moveLeft = !g_lockedOnOption && inputState->GetPadState().IsTapped(SWA::eKeyState_LeftBumper);
|
||||
bool moveRight = !g_lockedOnOption && inputState->GetPadState().IsTapped(SWA::eKeyState_RightBumper);
|
||||
|
||||
if (moveLeft)
|
||||
{
|
||||
@@ -454,40 +471,47 @@ static bool DrawCategories()
|
||||
Game_PlaySound("sys_actstg_score");
|
||||
}
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto clipRectMin = drawList->GetClipRectMin();
|
||||
auto clipRectMax = drawList->GetClipRectMax();
|
||||
|
||||
constexpr float NARROW_PADDING_GRID_COUNT = 1.5f;
|
||||
constexpr float WIDE_PADDING_GRID_COUNT = 3.0f;
|
||||
|
||||
float gridSize = Scale(GRID_SIZE);
|
||||
float textPadding = gridSize * Lerp(NARROW_PADDING_GRID_COUNT, WIDE_PADDING_GRID_COUNT, g_aspectRatioNarrowScale);
|
||||
float tabPadding = gridSize;
|
||||
|
||||
float size = Scale(32.0f);
|
||||
ImVec2 textSizes[g_categoryCount];
|
||||
float tabWidthSum = 0.0f;
|
||||
float clipRectWidth = clipRectMax.x - clipRectMin.x;
|
||||
|
||||
float textWidthSum = 0.0f;
|
||||
for (size_t i = 0; i < g_categoryCount; i++)
|
||||
{
|
||||
textSizes[i] = g_dfsogeistdFont->CalcTextSizeA(size, FLT_MAX, 0.0f, GetCategory(i).c_str());
|
||||
tabWidthSum += textSizes[i].x + textPadding * 2.0f;
|
||||
textWidthSum += textSizes[i].x;
|
||||
}
|
||||
|
||||
float textSquashRatio = 1.0f;
|
||||
float maxTextWidthSum = clipRectWidth - (gridSize * 4.0f * (g_categoryCount - 1));
|
||||
if (textWidthSum > maxTextWidthSum)
|
||||
{
|
||||
textSquashRatio = maxTextWidthSum / textWidthSum;
|
||||
for (auto& textSize : textSizes)
|
||||
textSize.x *= textSquashRatio;
|
||||
|
||||
textWidthSum = maxTextWidthSum;
|
||||
}
|
||||
tabWidthSum += (g_categoryCount - 1) * tabPadding;
|
||||
|
||||
float tabHeight = gridSize * 4.0f;
|
||||
float xOffset = ((clipRectMax.x - clipRectMin.x) - tabWidthSum) / 2.0f;
|
||||
float textPadding = (clipRectWidth - textWidthSum) / (g_categoryCount + 1.0f);
|
||||
float xOffset = textPadding;
|
||||
xOffset -= (1.0 - motion) * gridSize * 4.0;
|
||||
|
||||
ImVec2 minVec[g_categoryCount];
|
||||
ImVec2 textPositions[g_categoryCount];
|
||||
|
||||
for (size_t i = 0; i < g_categoryCount; i++)
|
||||
{
|
||||
ImVec2 min = { clipRectMin.x + xOffset, clipRectMin.y };
|
||||
float tabPadding = std::min(textPadding / 2.0f, gridSize * 3.0f);
|
||||
|
||||
xOffset += textSizes[i].x + textPadding * 2.0f;
|
||||
ImVec2 max = { clipRectMin.x + xOffset, clipRectMin.y + tabHeight };
|
||||
xOffset += tabPadding;
|
||||
ImVec2 min = { clipRectMin.x + xOffset - tabPadding, clipRectMin.y };
|
||||
ImVec2 max = { min.x + textSizes[i].x + tabPadding * 2.0f, min.y + tabHeight};
|
||||
|
||||
if (g_categoryIndex == i)
|
||||
{
|
||||
@@ -551,21 +575,23 @@ static bool DrawCategories()
|
||||
SetShaderModifier(IMGUI_SHADER_MODIFIER_NONE);
|
||||
}
|
||||
|
||||
min.x += textPadding;
|
||||
|
||||
// Store to draw again later, otherwise the tab background gets drawn on top of text during the animation.
|
||||
minVec[i] = min;
|
||||
textPositions[i] = { clipRectMin.x + xOffset, clipRectMin.y };
|
||||
xOffset += textSizes[i].x + textPadding;
|
||||
}
|
||||
|
||||
SetScale({ textSquashRatio, 1.0f });
|
||||
|
||||
for (size_t i = 0; i < g_categoryCount; i++)
|
||||
{
|
||||
auto& min = minVec[i];
|
||||
auto& pos = textPositions[i];
|
||||
uint8_t alpha = (i == g_categoryIndex ? 235 : 128) * motion;
|
||||
|
||||
|
||||
SetOrigin({ pos.x, pos.y });
|
||||
SetGradient
|
||||
(
|
||||
min,
|
||||
{ min.x + textSizes[i].x, min.y + textSizes[i].y },
|
||||
pos,
|
||||
{ pos.x + textSizes[i].x, pos.y + textSizes[i].y },
|
||||
IM_COL32(128, 255, 0, alpha),
|
||||
IM_COL32(255, 192, 0, alpha)
|
||||
);
|
||||
@@ -574,17 +600,19 @@ static bool DrawCategories()
|
||||
(
|
||||
g_dfsogeistdFont,
|
||||
size,
|
||||
min,
|
||||
pos,
|
||||
IM_COL32_WHITE,
|
||||
GetCategory(i).c_str(),
|
||||
4,
|
||||
IM_COL32_BLACK,
|
||||
IMGUI_SHADER_MODIFIER_CATEGORY_BEVEL
|
||||
);
|
||||
|
||||
ResetGradient();
|
||||
}
|
||||
|
||||
SetScale({ 1.0f, 1.0f });
|
||||
SetOrigin({ 0.0f, 0.0f });
|
||||
ResetGradient();
|
||||
|
||||
if (g_isStage || (ImGui::GetTime() - g_appearTime) >= (CONTAINER_FULL_DURATION / 60.0))
|
||||
{
|
||||
drawList->PushClipRect({ clipRectMin.x, clipRectMin.y + gridSize * 6.0f }, { clipRectMax.x - gridSize, clipRectMax.y - gridSize });
|
||||
@@ -601,7 +629,7 @@ static void DrawSelectionArrows(ImVec2 min, ImVec2 max, bool isLeftTapped, bool
|
||||
static bool isLeftArrowMotion = false;
|
||||
static bool isRightArrowMotion = false;
|
||||
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto gridSize = Scale(GRID_SIZE);
|
||||
auto width = gridSize * 2.5f;
|
||||
auto padding = gridSize;
|
||||
@@ -725,7 +753,7 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||
bool isAccessible, std::string* inaccessibleReason = nullptr,
|
||||
T valueMin = T(0), T valueCenter = T(0.5), T valueMax = T(1), bool isSlider = true)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto clipRectMin = drawList->GetClipRectMin();
|
||||
auto clipRectMax = drawList->GetClipRectMax();
|
||||
auto& padState = SWA::CInputState::GetInstance()->GetPadState();
|
||||
@@ -831,16 +859,19 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||
|
||||
if (g_canReset && padState.IsTapped(SWA::eKeyState_X))
|
||||
{
|
||||
config->MakeDefault();
|
||||
if (!config->IsDefaultValue())
|
||||
{
|
||||
config->MakeDefault();
|
||||
|
||||
VideoConfigValueChangedCallback(config);
|
||||
XAudioConfigValueChangedCallback(config);
|
||||
VideoConfigValueChangedCallback(config);
|
||||
XAudioConfigValueChangedCallback(config);
|
||||
|
||||
if (config->Callback)
|
||||
config->Callback(config);
|
||||
if (config->Callback)
|
||||
config->Callback(config);
|
||||
|
||||
if (config->ApplyCallback)
|
||||
config->ApplyCallback(config);
|
||||
if (config->ApplyCallback)
|
||||
config->ApplyCallback(config);
|
||||
}
|
||||
|
||||
Game_PlaySound("sys_worldmap_decide");
|
||||
}
|
||||
@@ -1093,17 +1124,25 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||
{
|
||||
if (config == &Config::WindowSize)
|
||||
{
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
if (Config::Fullscreen)
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
int displayW, displayH;
|
||||
GameWindow::GetSizeInPixels(&displayW, &displayH);
|
||||
valueText = fmt::format("{}x{}", displayW, displayH);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (config == &Config::Monitor)
|
||||
@@ -1126,37 +1165,50 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||
size = Scale(20.0f);
|
||||
textSize = g_newRodinFont->CalcTextSizeA(size, FLT_MAX, 0.0f, valueText.data());
|
||||
|
||||
min.x += ((max.x - min.x) - textSize.x) / 2.0f;
|
||||
min.y += ((max.y - min.y) - textSize.y) / 2.0f;
|
||||
auto textSquashRatio = 1.0f;
|
||||
|
||||
if (textSize.x > max.x - min.x)
|
||||
textSquashRatio = (max.x - min.x) / textSize.x - 0.1f;
|
||||
|
||||
auto textX = min.x + ((max.x - min.x) - (textSize.x * textSquashRatio)) / 2.0f;
|
||||
auto textY = min.y + ((max.y - min.y) - textSize.y) / 2.0f;
|
||||
|
||||
SetGradient
|
||||
(
|
||||
min,
|
||||
{ min.x + textSize.x, min.y + textSize.y },
|
||||
{ textX, textY },
|
||||
{ textX + textSize.x, textY + textSize.y },
|
||||
IM_COL32(192, 255, 0, 255),
|
||||
IM_COL32(128, 170, 0, 255)
|
||||
);
|
||||
|
||||
SetScale({ textSquashRatio, 1.0f });
|
||||
SetOrigin({ textX, textY });
|
||||
|
||||
DrawTextWithOutline
|
||||
(
|
||||
g_newRodinFont,
|
||||
size,
|
||||
min,
|
||||
{ textX, textY },
|
||||
IM_COL32(255, 255, 255, 255 * alpha),
|
||||
valueText.data(),
|
||||
4,
|
||||
IM_COL32(0, 0, 0, 255 * alpha)
|
||||
);
|
||||
|
||||
SetScale({ 1.0f, 1.0f });
|
||||
SetOrigin({ 0.0f, 0.0f });
|
||||
|
||||
ResetGradient();
|
||||
}
|
||||
|
||||
static void DrawConfigOptions()
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto clipRectMin = drawList->GetClipRectMin();
|
||||
auto clipRectMax = drawList->GetClipRectMax();
|
||||
|
||||
drawList->PushClipRect({ clipRectMin.x, clipRectMin.y }, { clipRectMax.x, clipRectMax.y - Scale(5.0f) });
|
||||
|
||||
g_selectedItem = nullptr;
|
||||
|
||||
float gridSize = Scale(GRID_SIZE);
|
||||
@@ -1178,7 +1230,7 @@ static void DrawConfigOptions()
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::Hints, !isStage, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::ControlTutorial, !isStage, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::AchievementNotifications, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::TimeOfDayTransition, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::TimeOfDayTransition, !Config::UseArrowsForTimeOfDayTransition);
|
||||
break;
|
||||
|
||||
case 1: // INPUT
|
||||
@@ -1333,13 +1385,15 @@ static void DrawConfigOptions()
|
||||
if (disableMoveAnimation)
|
||||
g_prevSelectedRowIndex = g_selectedRowIndex;
|
||||
|
||||
drawList->PopClipRect();
|
||||
|
||||
// Pop clip rect from DrawCategories
|
||||
drawList->PopClipRect();
|
||||
|
||||
// Draw scroll bar
|
||||
if (rowCount > visibleRowCount)
|
||||
{
|
||||
float totalHeight = (clipRectMax.y - clipRectMin.y);
|
||||
float totalHeight = (clipRectMax.y - clipRectMin.y) - Scale(2.0f);
|
||||
float heightRatio = float(visibleRowCount) / float(rowCount);
|
||||
|
||||
float offsetRatio = float(g_firstVisibleRowIndex) / float(rowCount);
|
||||
@@ -1351,7 +1405,7 @@ static void DrawConfigOptions()
|
||||
drawList->AddRectFilled
|
||||
(
|
||||
{ clipRectMax.x, minY },
|
||||
{ clipRectMax.x + gridSize, minY + totalHeight * heightRatio },
|
||||
{ clipRectMax.x + gridSize - Scale(1.0f), minY + totalHeight * heightRatio},
|
||||
IM_COL32(0, 128, 0, 255)
|
||||
);
|
||||
}
|
||||
@@ -1359,7 +1413,7 @@ static void DrawConfigOptions()
|
||||
|
||||
static void DrawSettingsPanel(ImVec2 settingsMin, ImVec2 settingsMax)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
SetProceduralOrigin(settingsMin);
|
||||
DrawContainer(settingsMin, settingsMax, true);
|
||||
@@ -1383,7 +1437,7 @@ static void DrawSettingsPanel(ImVec2 settingsMin, ImVec2 settingsMax)
|
||||
|
||||
static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
|
||||
SetProceduralOrigin(infoMin);
|
||||
DrawContainer(infoMin, infoMax, false);
|
||||
@@ -1402,11 +1456,31 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
ImVec2 thumbnailMin = { clipRectMin.x, clipRectMin.y + Scale(GRID_SIZE / 2.0f) };
|
||||
ImVec2 thumbnailMax = { clipRectMax.x, thumbnailMin.y + thumbnailHeight };
|
||||
|
||||
drawList->AddImage(thumbnail, thumbnailMin, thumbnailMax);
|
||||
if (g_isStage)
|
||||
{
|
||||
drawList->AddImage(thumbnail, thumbnailMin, thumbnailMax);
|
||||
}
|
||||
else
|
||||
{
|
||||
float time = g_appearTime + CONTAINER_FULL_DURATION / 60.0;
|
||||
|
||||
drawList->AddImage(
|
||||
thumbnail,
|
||||
thumbnailMin,
|
||||
thumbnailMax,
|
||||
{ 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f },
|
||||
IM_COL32(255, 255, 255, 255 * TVStatic::ComputeThumbnailAlpha(time)));
|
||||
|
||||
TVStatic::Draw(
|
||||
{ (thumbnailMin.x + thumbnailMax.x) / 2.0f, (thumbnailMin.y + thumbnailMax.y) / 2.0f },
|
||||
{ (thumbnailMax.x - thumbnailMin.x), (thumbnailMax.y - thumbnailMin.y) },
|
||||
time);
|
||||
}
|
||||
|
||||
if (g_inaccessibleReason)
|
||||
{
|
||||
desc = *g_inaccessibleReason;
|
||||
desc += "\n\n" + *g_inaccessibleReason;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1424,10 +1498,9 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
}
|
||||
|
||||
const auto& valueDescription = g_selectedItem->GetValueDescription(Config::Language);
|
||||
|
||||
if (!valueDescription.empty())
|
||||
{
|
||||
desc += "\n\n" + valueDescription;
|
||||
}
|
||||
}
|
||||
|
||||
clipRectMin = { clipRectMin.x, thumbnailMax.y };
|
||||
@@ -1442,6 +1515,7 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
|
||||
auto textX = clipRectMin.x - Scale(0.5f);
|
||||
auto textY = thumbnailMax.y + offsetY;
|
||||
float lineWidth = clipRectMax.x - clipRectMin.x;
|
||||
|
||||
if (Config::Language == ELanguage::Japanese)
|
||||
{
|
||||
@@ -1456,9 +1530,13 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
clipRectMax.x += annotationFontSize;
|
||||
|
||||
textY += annotationFontSize;
|
||||
|
||||
// Dirty hack to disallow clipping on Japanese text
|
||||
// whilst allowing annotations to go over the border
|
||||
lineWidth -= annotationFontSize;
|
||||
}
|
||||
|
||||
auto textSize = MeasureCentredParagraph(g_seuratFont, fontSize, clipRectMax.x - clipRectMin.x, 5.0f, desc.c_str());
|
||||
auto textSize = MeasureCentredParagraph(g_seuratFont, fontSize, lineWidth, 5.0f, desc.c_str());
|
||||
|
||||
drawList->PushClipRect(clipRectMin, clipRectMax, false);
|
||||
|
||||
@@ -1472,23 +1550,19 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
|
||||
if (scrollMax > 0.0f)
|
||||
{
|
||||
if (auto pInputState = SWA::CInputState::GetInstance())
|
||||
{
|
||||
auto& rPadState = pInputState->GetPadState();
|
||||
auto& vert = rPadState.RightStickVertical;
|
||||
auto vert = -g_rightStickY;
|
||||
|
||||
if (fabs(vert) > 0.25f)
|
||||
{
|
||||
isManualScrolling = true;
|
||||
scrollOffset += vert * scrollSpeed * App::s_deltaTime;
|
||||
}
|
||||
else if (isManualScrolling && fabs(vert) <= 0.25f)
|
||||
{
|
||||
isScrolling = false;
|
||||
isManualScrolling = false;
|
||||
scrollTimer = 0.0f;
|
||||
scrollDirection = vert > 0.0f ? 1.0f : -1.0f;
|
||||
}
|
||||
if (fabs(vert) > 0.25f)
|
||||
{
|
||||
isManualScrolling = true;
|
||||
scrollOffset += vert * scrollSpeed * App::s_deltaTime;
|
||||
}
|
||||
else if (isManualScrolling && fabs(vert) <= 0.25f)
|
||||
{
|
||||
isScrolling = false;
|
||||
isManualScrolling = false;
|
||||
scrollTimer = 0.0f;
|
||||
scrollDirection = vert > 0.0f ? 1.0f : -1.0f;
|
||||
}
|
||||
|
||||
if (!isManualScrolling)
|
||||
@@ -1532,13 +1606,13 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
scrollDirection = 1.0f;
|
||||
}
|
||||
|
||||
SetVerticalMarqueeFade(clipRectMin, clipRectMax, Scale(24), Lerp(Scale(24), 0.0f, scrollOffset / scrollMax));
|
||||
SetVerticalMarqueeFade({ clipRectMin.x, clipRectMin.y + Scale(5.5f) }, clipRectMax, Scale(10), Scale(10));
|
||||
|
||||
DrawRubyAnnotatedText
|
||||
(
|
||||
g_seuratFont,
|
||||
fontSize,
|
||||
clipRectMax.x - clipRectMin.x,
|
||||
lineWidth,
|
||||
{ textX, textY - scrollOffset },
|
||||
5.0f,
|
||||
desc.c_str(),
|
||||
@@ -1580,7 +1654,7 @@ static void SetOptionsMenuVisible(bool isVisible)
|
||||
|
||||
static bool DrawMilesElectric()
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
// Compensate for the lack of CSD UI dimming the background.
|
||||
@@ -1633,7 +1707,7 @@ static bool DrawMilesElectric()
|
||||
|
||||
static bool DrawFadeTransition()
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
auto scaleMotion = ComputeMotion(g_appearTime, 0, MILES_ELECTRIC_SCALE_DURATION);
|
||||
@@ -1658,6 +1732,8 @@ void OptionsMenu::Init()
|
||||
LoadThumbnails();
|
||||
|
||||
g_upMilesElectric = LOAD_ZSTD_TEXTURE(g_miles_electric);
|
||||
|
||||
TVStatic::Init();
|
||||
}
|
||||
|
||||
void OptionsMenu::Draw()
|
||||
@@ -1678,7 +1754,7 @@ void OptionsMenu::Draw()
|
||||
|
||||
if (!g_isClosing)
|
||||
{
|
||||
auto drawList = ImGui::GetForegroundDrawList();
|
||||
auto drawList = ImGui::GetBackgroundDrawList();
|
||||
auto& res = ImGui::GetIO().DisplaySize;
|
||||
|
||||
if (g_isStage)
|
||||
@@ -1737,16 +1813,16 @@ void OptionsMenu::Open(bool isPause, SWA::EMenuType pauseMenuType)
|
||||
|
||||
std::array<Button, 4> buttons =
|
||||
{
|
||||
Button(Localise("Common_Switch"), EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible),
|
||||
Button(Localise("Common_Reset"), EButtonIcon::X, &g_canReset),
|
||||
Button(Localise("Common_Select"), EButtonIcon::A, &g_isControlsVisible),
|
||||
Button(Localise("Common_Back"), EButtonIcon::B, &g_isControlsVisible)
|
||||
Button("Common_Switch", 115.0f, EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible),
|
||||
Button("Common_Reset", 110.0f, EButtonIcon::X, &g_canReset),
|
||||
Button("Common_Select", 115.0f, EButtonIcon::A, &g_isControlsVisible),
|
||||
Button("Common_Back", 65.0f, EButtonIcon::B, &g_isControlsVisible)
|
||||
};
|
||||
|
||||
ButtonGuide::Open(buttons);
|
||||
ButtonGuide::SetSideMargins(250);
|
||||
|
||||
hid::SetProhibitedButtons(XAMINPUT_GAMEPAD_START);
|
||||
hid::SetProhibitedInputs(XAMINPUT_GAMEPAD_START, false, true);
|
||||
}
|
||||
|
||||
void OptionsMenu::Close()
|
||||
@@ -1760,7 +1836,7 @@ void OptionsMenu::Close()
|
||||
ButtonGuide::Close();
|
||||
Config::Save();
|
||||
|
||||
hid::SetProhibitedButtons(0);
|
||||
hid::SetProhibitedInputs();
|
||||
}
|
||||
|
||||
// Skip Miles Electric animation at main menu.
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
#include <ui/options_menu_thumbnails.h>
|
||||
#include <decompressor.h>
|
||||
#include <hid/hid.h>
|
||||
|
||||
// TODO (Hyper): lower the resolution of these textures once final.
|
||||
#include <res/images/options_menu/thumbnails/achievement_notifications.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/allow_background_input.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/allow_background_input_xb.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/allow_background_input_ps.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing_none.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing_2x.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing_4x.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/antialiasing_8x.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/aspect_ratio.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/battle_theme.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/brightness.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/control_tutorial.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/channel_stereo.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/channel_surround.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/control_tutorial_ps.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/control_tutorial_xb.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/controller_icons.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/default.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/effects_volume.dds.h>
|
||||
@@ -24,51 +31,69 @@
|
||||
#include <res/images/options_menu/thumbnails/motion_blur_off.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/motion_blur_original.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/motion_blur_enhanced.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/movie_scale_mode.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/movie_scale_fit.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/movie_scale_fill.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/music_attenuation.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/music_volume.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/resolution_scale.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_original.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_x512.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_x1024.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_x2048.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_x4096.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/shadow_resolution_x8192.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/subtitles.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/time_of_day_transition_xbox.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/time_of_day_transition_playstation.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/time_transition_ps.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/time_transition_xb.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/transparency_antialiasing_false.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/transparency_antialiasing_true.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/ui_alignment_mode.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/ui_alignment_centre.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/ui_alignment_edge.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vertical_camera.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/voice_language.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vibration.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vsync.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vibration_ps.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vibration_xb.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vsync_on.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/vsync_off.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/window_size.dds.h>
|
||||
#include <res/images/options_menu/thumbnails/xbox_color_correction.dds.h>
|
||||
|
||||
#define VALUE_THUMBNAIL_MAP(type) std::unordered_map<type, std::unique_ptr<GuestTexture>>
|
||||
|
||||
static std::unordered_map<std::string_view, std::unique_ptr<GuestTexture>> g_namedThumbnails;
|
||||
static std::unique_ptr<GuestTexture> g_defaultThumbnail;
|
||||
|
||||
static std::unique_ptr<GuestTexture> g_controlTutorialXBThumbnail;
|
||||
static std::unique_ptr<GuestTexture> g_controlTutorialPSThumbnail;
|
||||
static std::unique_ptr<GuestTexture> g_vibrationXBThumbnail;
|
||||
static std::unique_ptr<GuestTexture> g_vibrationPSThumbnail;
|
||||
static std::unique_ptr<GuestTexture> g_backgroundInputXBThumbnail;
|
||||
static std::unique_ptr<GuestTexture> g_backgroundInputPSThumbnail;
|
||||
|
||||
static std::unordered_map<const IConfigDef*, std::unique_ptr<GuestTexture>> g_configThumbnails;
|
||||
|
||||
static VALUE_THUMBNAIL_MAP(ETimeOfDayTransition) g_timeOfDayTransitionThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EChannelConfiguration) g_channelConfigurationThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EAntiAliasing) g_msaaAntiAliasingThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(bool) g_vsyncThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(bool) g_transparencyAntiAliasingThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EShadowResolution) g_shadowResolutionThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EGITextureFiltering) g_giTextureFilteringThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EMotionBlur) g_motionBlurThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(bool) g_xboxColorCorrectionThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(ECutsceneAspectRatio) g_cutsceneAspectRatioThumbnails;
|
||||
static VALUE_THUMBNAIL_MAP(EUIAlignmentMode) g_uiAlignmentThumbnails;
|
||||
|
||||
void LoadThumbnails()
|
||||
{
|
||||
g_namedThumbnails["Default"] = LOAD_ZSTD_TEXTURE(g_default);
|
||||
g_namedThumbnails["WindowSize"] = LOAD_ZSTD_TEXTURE(g_window_size);
|
||||
g_defaultThumbnail = LOAD_ZSTD_TEXTURE(g_default);
|
||||
|
||||
g_controlTutorialXBThumbnail = LOAD_ZSTD_TEXTURE(g_control_tutorial_xb);
|
||||
g_controlTutorialPSThumbnail = LOAD_ZSTD_TEXTURE(g_control_tutorial_ps);
|
||||
g_vibrationXBThumbnail = LOAD_ZSTD_TEXTURE(g_vibration_xb);
|
||||
g_vibrationPSThumbnail = LOAD_ZSTD_TEXTURE(g_vibration_ps);
|
||||
g_backgroundInputXBThumbnail = LOAD_ZSTD_TEXTURE(g_allow_background_input_xb);
|
||||
g_backgroundInputPSThumbnail = LOAD_ZSTD_TEXTURE(g_allow_background_input_ps);
|
||||
|
||||
g_configThumbnails[&Config::Language] = LOAD_ZSTD_TEXTURE(g_language);
|
||||
g_configThumbnails[&Config::VoiceLanguage] = LOAD_ZSTD_TEXTURE(g_voice_language);
|
||||
g_configThumbnails[&Config::Subtitles] = LOAD_ZSTD_TEXTURE(g_subtitles);
|
||||
g_configThumbnails[&Config::Hints] = LOAD_ZSTD_TEXTURE(g_hints);
|
||||
g_configThumbnails[&Config::ControlTutorial] = LOAD_ZSTD_TEXTURE(g_control_tutorial);
|
||||
g_configThumbnails[&Config::AchievementNotifications] = LOAD_ZSTD_TEXTURE(g_achievement_notifications);
|
||||
|
||||
g_timeOfDayTransitionThumbnails[ETimeOfDayTransition::Xbox] = LOAD_ZSTD_TEXTURE(g_time_of_day_transition_xbox);
|
||||
@@ -76,28 +101,36 @@ void LoadThumbnails()
|
||||
|
||||
g_configThumbnails[&Config::HorizontalCamera] = LOAD_ZSTD_TEXTURE(g_horizontal_camera);
|
||||
g_configThumbnails[&Config::VerticalCamera] = LOAD_ZSTD_TEXTURE(g_vertical_camera);
|
||||
g_configThumbnails[&Config::Vibration] = LOAD_ZSTD_TEXTURE(g_vibration);
|
||||
g_configThumbnails[&Config::AllowBackgroundInput] = LOAD_ZSTD_TEXTURE(g_allow_background_input);
|
||||
g_configThumbnails[&Config::ControllerIcons] = LOAD_ZSTD_TEXTURE(g_controller_icons);
|
||||
g_configThumbnails[&Config::MasterVolume] = LOAD_ZSTD_TEXTURE(g_master_volume);
|
||||
g_configThumbnails[&Config::MusicVolume] = LOAD_ZSTD_TEXTURE(g_music_volume);
|
||||
g_configThumbnails[&Config::EffectsVolume] = LOAD_ZSTD_TEXTURE(g_effects_volume);
|
||||
|
||||
g_channelConfigurationThumbnails[EChannelConfiguration::Stereo] = LOAD_ZSTD_TEXTURE(g_channel_stereo);
|
||||
g_channelConfigurationThumbnails[EChannelConfiguration::Surround] = LOAD_ZSTD_TEXTURE(g_channel_surround);
|
||||
|
||||
g_configThumbnails[&Config::MusicAttenuation] = LOAD_ZSTD_TEXTURE(g_music_attenuation);
|
||||
g_configThumbnails[&Config::BattleTheme] = LOAD_ZSTD_TEXTURE(g_battle_theme);
|
||||
g_configThumbnails[&Config::WindowSize] = LOAD_ZSTD_TEXTURE(g_window_size);
|
||||
g_configThumbnails[&Config::Monitor] = LOAD_ZSTD_TEXTURE(g_monitor);
|
||||
g_configThumbnails[&Config::AspectRatio] = LOAD_ZSTD_TEXTURE(g_aspect_ratio);
|
||||
g_configThumbnails[&Config::ResolutionScale] = LOAD_ZSTD_TEXTURE(g_resolution_scale);
|
||||
g_configThumbnails[&Config::Fullscreen] = LOAD_ZSTD_TEXTURE(g_fullscreen);
|
||||
g_configThumbnails[&Config::VSync] = LOAD_ZSTD_TEXTURE(g_vsync);
|
||||
g_configThumbnails[&Config::XboxColorCorrection] = LOAD_ZSTD_TEXTURE(g_xbox_color_correction);
|
||||
|
||||
g_vsyncThumbnails[false] = LOAD_ZSTD_TEXTURE(g_vsync_off);
|
||||
g_vsyncThumbnails[true] = LOAD_ZSTD_TEXTURE(g_vsync_on);
|
||||
|
||||
g_configThumbnails[&Config::FPS] = LOAD_ZSTD_TEXTURE(g_fps);
|
||||
g_configThumbnails[&Config::Brightness] = LOAD_ZSTD_TEXTURE(g_brightness);
|
||||
g_configThumbnails[&Config::AntiAliasing] = LOAD_ZSTD_TEXTURE(g_antialiasing);
|
||||
|
||||
g_msaaAntiAliasingThumbnails[EAntiAliasing::None] = LOAD_ZSTD_TEXTURE(g_antialiasing_none);
|
||||
g_msaaAntiAliasingThumbnails[EAntiAliasing::MSAA2x] = LOAD_ZSTD_TEXTURE(g_antialiasing_2x);
|
||||
g_msaaAntiAliasingThumbnails[EAntiAliasing::MSAA4x] = LOAD_ZSTD_TEXTURE(g_antialiasing_4x);
|
||||
g_msaaAntiAliasingThumbnails[EAntiAliasing::MSAA8x] = LOAD_ZSTD_TEXTURE(g_antialiasing_8x);
|
||||
|
||||
g_transparencyAntiAliasingThumbnails[false] = LOAD_ZSTD_TEXTURE(g_transparency_antialiasing_false);
|
||||
g_transparencyAntiAliasingThumbnails[true] = LOAD_ZSTD_TEXTURE(g_transparency_antialiasing_true);
|
||||
|
||||
g_shadowResolutionThumbnails[EShadowResolution::Original] = LOAD_ZSTD_TEXTURE(g_shadow_resolution_original);
|
||||
g_shadowResolutionThumbnails[EShadowResolution::x512] = LOAD_ZSTD_TEXTURE(g_shadow_resolution_x512);
|
||||
g_shadowResolutionThumbnails[EShadowResolution::x1024] = LOAD_ZSTD_TEXTURE(g_shadow_resolution_x1024);
|
||||
g_shadowResolutionThumbnails[EShadowResolution::x2048] = LOAD_ZSTD_TEXTURE(g_shadow_resolution_x2048);
|
||||
@@ -111,8 +144,11 @@ void LoadThumbnails()
|
||||
g_motionBlurThumbnails[EMotionBlur::Original] = LOAD_ZSTD_TEXTURE(g_motion_blur_original);
|
||||
g_motionBlurThumbnails[EMotionBlur::Enhanced] = LOAD_ZSTD_TEXTURE(g_motion_blur_enhanced);
|
||||
|
||||
g_configThumbnails[&Config::XboxColorCorrection] = LOAD_ZSTD_TEXTURE(g_xbox_color_correction);
|
||||
g_configThumbnails[&Config::UIAlignmentMode] = LOAD_ZSTD_TEXTURE(g_ui_alignment_mode);
|
||||
g_cutsceneAspectRatioThumbnails[ECutsceneAspectRatio::Original] = LOAD_ZSTD_TEXTURE(g_movie_scale_fit);
|
||||
g_cutsceneAspectRatioThumbnails[ECutsceneAspectRatio::Unlocked] = LOAD_ZSTD_TEXTURE(g_movie_scale_fill);
|
||||
|
||||
g_uiAlignmentThumbnails[EUIAlignmentMode::Centre] = LOAD_ZSTD_TEXTURE(g_ui_alignment_centre);
|
||||
g_uiAlignmentThumbnails[EUIAlignmentMode::Edge] = LOAD_ZSTD_TEXTURE(g_ui_alignment_edge);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -124,34 +160,57 @@ bool TryGetValueThumbnail(const IConfigDef* cfg, VALUE_THUMBNAIL_MAP(T)* thumbna
|
||||
if (!cfg->GetValue())
|
||||
return false;
|
||||
|
||||
auto result = thumbnails->at(*(T*)cfg->GetValue()).get();
|
||||
T value = *(T*)cfg->GetValue();
|
||||
|
||||
if (!result)
|
||||
return false;
|
||||
if constexpr (std::is_same_v<T, EShadowResolution>)
|
||||
{
|
||||
if (value == EShadowResolution::Original)
|
||||
value = EShadowResolution::x1024;
|
||||
}
|
||||
|
||||
*texture = result;
|
||||
auto findResult = thumbnails->find(value);
|
||||
|
||||
return true;
|
||||
}
|
||||
if (findResult != thumbnails->end())
|
||||
{
|
||||
*texture = findResult->second.get();
|
||||
return true;
|
||||
}
|
||||
|
||||
GuestTexture* GetThumbnail(const std::string_view name)
|
||||
{
|
||||
if (!g_namedThumbnails.count(name))
|
||||
return g_namedThumbnails["Default"].get();
|
||||
|
||||
return g_namedThumbnails[name].get();
|
||||
return false;
|
||||
}
|
||||
|
||||
GuestTexture* GetThumbnail(const IConfigDef* cfg)
|
||||
{
|
||||
if (!g_configThumbnails.count(cfg))
|
||||
auto findResult = g_configThumbnails.find(cfg);
|
||||
if (findResult == g_configThumbnails.end())
|
||||
{
|
||||
auto texture = g_namedThumbnails["Default"].get();
|
||||
auto texture = g_defaultThumbnail.get();
|
||||
|
||||
if (cfg == &Config::TimeOfDayTransition)
|
||||
bool isPlayStation = Config::ControllerIcons == EControllerIcons::PlayStation;
|
||||
|
||||
if (Config::ControllerIcons == EControllerIcons::Auto)
|
||||
isPlayStation = hid::g_inputDeviceController == hid::EInputDevice::PlayStation;
|
||||
|
||||
if (cfg == &Config::ControlTutorial)
|
||||
{
|
||||
texture = isPlayStation ? g_controlTutorialPSThumbnail.get() : g_controlTutorialXBThumbnail.get();
|
||||
}
|
||||
else if (cfg == &Config::Vibration)
|
||||
{
|
||||
texture = isPlayStation ? g_vibrationPSThumbnail.get() : g_vibrationXBThumbnail.get();
|
||||
}
|
||||
else if (cfg == &Config::AllowBackgroundInput)
|
||||
{
|
||||
texture = isPlayStation ? g_backgroundInputPSThumbnail.get() : g_backgroundInputXBThumbnail.get();
|
||||
}
|
||||
else if (cfg == &Config::TimeOfDayTransition)
|
||||
{
|
||||
TryGetValueThumbnail<ETimeOfDayTransition>(cfg, &g_timeOfDayTransitionThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::AntiAliasing)
|
||||
{
|
||||
TryGetValueThumbnail<EAntiAliasing>(cfg, &g_msaaAntiAliasingThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::TransparencyAntiAliasing)
|
||||
{
|
||||
TryGetValueThumbnail<bool>(cfg, &g_transparencyAntiAliasingThumbnails, &texture);
|
||||
@@ -168,9 +227,29 @@ GuestTexture* GetThumbnail(const IConfigDef* cfg)
|
||||
{
|
||||
TryGetValueThumbnail<EMotionBlur>(cfg, &g_motionBlurThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::XboxColorCorrection)
|
||||
{
|
||||
TryGetValueThumbnail<bool>(cfg, &g_xboxColorCorrectionThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::CutsceneAspectRatio)
|
||||
{
|
||||
TryGetValueThumbnail<ECutsceneAspectRatio>(cfg, &g_cutsceneAspectRatioThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::VSync)
|
||||
{
|
||||
TryGetValueThumbnail<bool>(cfg, &g_vsyncThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::ChannelConfiguration)
|
||||
{
|
||||
TryGetValueThumbnail<EChannelConfiguration>(cfg, &g_channelConfigurationThumbnails, &texture);
|
||||
}
|
||||
else if (cfg == &Config::UIAlignmentMode)
|
||||
{
|
||||
TryGetValueThumbnail<EUIAlignmentMode>(cfg, &g_uiAlignmentThumbnails, &texture);
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
return g_configThumbnails[cfg].get();
|
||||
return findResult->second.get();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user