Merge remote-tracking branch 'origin/master' into hsh

This commit is contained in:
Luke Street 2021-04-19 01:10:28 -04:00
commit c675607d06
1495 changed files with 102495 additions and 4719 deletions

View File

@ -1,85 +0,0 @@
############################################################################
# URDE appveyor build configuration
############################################################################
clone_depth: 1
platform:
- x64
build_cloud: AXIODL-BUILDBOT
image: Windows
build:
verbosity: detailed
configuration:
- Release
cache:
- C:\projects\deps
install:
############################################################################
# All external dependencies are installed in C:\projects\deps
############################################################################
- if not exist C:\projects\deps mkdir C:\projects\deps
- cd C:\projects\deps
############################################################################
# Install Ninja
############################################################################
- set NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip
- if not exist ninja.zip appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
- if not exist ninja 7z x ninja.zip -oC:\projects\deps\ninja > nul
############################################################################
# Install a recent CMake
############################################################################
- set CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v3.16.4/cmake-3.16.4-win64-x64.zip
- if not exist cmake.zip appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
- if not exist cmake 7z x cmake.zip -oC:\projects\deps\cmake > nul
############################################################################
# Install custom LLVM
############################################################################
- set LLVM_URL=https://axiodl.com/files/LLVM-10.0.1-win64.exe
- if not exist LLVM-10.0.1-win64.exe appveyor DownloadFile %LLVM_URL% -FileName LLVM-10.0.1-win64.exe
- if not exist llvm-10.0.1 LLVM-10.0.1-win64.exe /S /D=C:\projects\deps\llvm-10.0.1
before_build:
# Configure ninja
- set PATH=C:\projects\deps\ninja;%PATH%
- ninja --version
# Configure cmake
- set PATH=C:\projects\deps\cmake\cmake-3.16.4-win64-x64\bin;%PATH%
- cmake --version
# Configure LLVM
- set PATH=C:\projects\deps\llvm-10.0.1\bin;%PATH%
- llvm-config --version
- clang-cl -v
# Configure VS
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" amd64
# Fetch submodules
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init --recursive
build_script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DLLVM_ROOT_DIR=C:\projects\deps\llvm-10.0.1 -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_LINKER=lld-link -DCMAKE_AR=llvm-ar -DCMAKE_RANLIB=llvm-ranlib -GNinja ..
- ninja urde
#notifications:
# - provider: Slack
# incoming_webhook:
# secure: uoO0I0PWyCx0KLjBOG6d17aSVuEEvYztB/UiF8J0LmTb2O735mAdWcuZHTImDFUGZxeI34/qzOB2JKqF+h8dZA5yiprSTkWIookqQjUokAM=
# - provider: Webhook
# url: https://skyhook.glitch.me/api/webhooks/345359672326356993/M8kBYpqr1JyVNhnAHBwNN5TnZmtWy9_msxAQoeOlaa73UhPn8gLU5uYZCjU1qsAi3sGN/appveyor
# method: POST
# on_build_success: true
# on_build_failure: true
# on_build_status_changed: false
# Uncomment this to debug AppVeyor failures.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

201
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,201 @@
name: Build
on:
push:
branches-ignore:
- master
paths-ignore:
- '*.json'
- '*.md'
- '*LICENSE'
pull_request:
jobs:
build-linux:
name: Build Linux (${{matrix.name}} x86_64)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC
cc: gcc
cxx: g++
- name: Clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \
libcurl4-openssl-dev
# free up disk space
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
echo Before
df -h .
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo After
df -h .
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}}
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-macos:
name: Build macOS (AppleClang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew update
brew install ninja qt@5 graphicsmagick imagemagick
brew link qt@5
yarn global add create-dmg
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-windows-msvc:
name: Build Windows (MSVC x86_64)
if: 'false' # disabled due to memory constraints
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
-DLLVM_ROOT_DIR="$workspace/LLVM"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
build-windows-clang:
name: Build Windows (Clang x86_64)
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_LINKER=lld-link `
-DLLVM_ROOT_DIR="$workspace/LLVM"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .

337
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,337 @@
name: Release
on:
push:
branches:
- master
paths-ignore:
- '*.json'
- '*.md'
- '*LICENSE'
jobs:
build-linux:
name: Build Linux (${{matrix.name}} x86_64)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- name: GCC
cc: gcc
cxx: g++
- name: Clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \
libcurl4-openssl-dev intel-oneapi-ipp-devel
yarn global add @sentry/cli
echo "$(yarn global bin)" >> $GITHUB_PATH
# free up disk space
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
echo Before
df -h .
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo After
df -h .
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Split debug information
run: ci/split-debug-linux.sh
- name: Upload debug information
if: ${{matrix.name == 'Clang'}}
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: ci/upload-debug-linux.sh
- name: Generate AppImage
run: ci/build-appimage.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-linux-${{matrix.cc}}-x86_64
path: |
Metaforce-*.AppImage
debug.tar.*
build-macos:
name: Build macOS (AppleClang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
brew update
brew install ninja qt@5 graphicsmagick imagemagick getsentry/tools/sentry-cli
brew link qt@5
yarn global add create-dmg
- name: Install Intel IPP
env:
IPP_VERSION: 2021.2.0.192
run: |
NAME="m_ipp_oneapi_p_${IPP_VERSION}_offline"
curl -LSfs https://registrationcenter-download.intel.com/akdlm/irc_nas/17606/$NAME.dmg -o /tmp/$NAME.dmg
sudo hdiutil attach /tmp/$NAME.dmg -quiet
sudo /Volumes/$NAME/bootstrapper.app/Contents/MacOS/install.sh -c --action install --eula accept
sudo hdiutil detach /Volumes/$NAME -quiet
rm /tmp/$NAME.dmg
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Upload debug information
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: ci/upload-debug-macos.sh
- name: Import signing certificate
uses: devbotsxyz/xcode-import-certificate@master
with:
certificate-data: ${{ secrets.MACOS_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
- name: Deploy & codesign application
env:
ASC_USERNAME: ${{secrets.MACOS_ASC_USERNAME}}
ASC_PASSWORD: ${{secrets.MACOS_ASC_PASSWORD}}
ASC_TEAM_ID: ${{secrets.MACOS_ASC_TEAM_ID}}
CODESIGN_IDENT: ${{secrets.MACOS_CODESIGN_IDENT}}
run: ci/build-dmg.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-macos-appleclang-x86_64
path: |
Metaforce *.dmg
debug.tar.*
build-windows-msvc:
name: Build Windows (MSVC x86_64)
runs-on: [ self-hosted, windows, x64 ]
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
# IPP_VERSION: 2021.2.0.210
SENTRY_CLI_VERSION: 1.63.2
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Download sentry-cli
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://github.com/getsentry/sentry-cli/releases/download/$env:SENTRY_CLI_VERSION/sentry-cli-Windows-x86_64.exe", "$TempDir\sentry-cli.exe")
# - name: Install Intel IPP
# run: |
# $TempDir = "$env:RUNNER_WORKSPACE\temp"
# $Filename = "w_ipp_oneapi_p_${env:IPP_VERSION}_offline.exe"
# New-Item -Path "$TempDir" -ItemType Directory -ea 0
# (New-Object Net.WebClient).DownloadFile("https://registrationcenter-download.intel.com/akdlm/irc_nas/$Filename", "$TempDir\$Filename")
# Start-Process "$TempDir\$Filename" -ArgumentList "--x --s --f $TempDir\ipp" -Wait
# Start-Process "$TempDir\ipp\bootstrapper.exe" -ArgumentList "--eula accept -c --action install" -Wait
# - name: Install dependencies
# run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
-DLLVM_ROOT_DIR="$workspace/LLVM" `
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Upload debug information
working-directory: ${{github.workspace}}/build/Binaries
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_URL: ${{secrets.SENTRY_URL}}
run: |
& "$env:RUNNER_WORKSPACE\temp\sentry-cli.exe" upload-dif --org axiodl --project metaforce --include-sources `
metaforce.exe metaforce.pdb hecl.exe hecl.pdb metaforce-gui.exe metaforce-gui.pdb visigen.exe visigen.pdb
- name: Compress PDBs
working-directory: ${{github.workspace}}/build/Binaries
run: 7z a -t7z debug.7z metaforce.pdb hecl.pdb metaforce-gui.pdb visigen.pdb
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-win32-msvc-x86_64
path: |
build/Binaries/metaforce.exe
build/Binaries/metaforce-gui.exe
build/Binaries/hecl.exe
build/Binaries/visigen.exe
build/Binaries/crashpad_handler.exe
build/Binaries/debug.7z
build-windows-clang:
name: Build Windows (Clang x86_64)
runs-on: windows-2019
env:
LLVM_VERSION: 10.0.1
Qt_VERSION: 5.15.2
IPP_VERSION: 2021.2.0.210
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Install LLVM
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
# - name: Install Intel IPP
# run: |
# $TempDir = "$env:RUNNER_WORKSPACE\temp"
# $Filename = "w_ipp_oneapi_p_${env:IPP_VERSION}_offline.exe"
# New-Item -Path "$TempDir" -ItemType Directory -ea 0
# (New-Object Net.WebClient).DownloadFile("https://registrationcenter-download.intel.com/akdlm/irc_nas/17739/$Filename", "$TempDir\$Filename")
# Start-Process "$TempDir\$Filename" -ArgumentList "--x --s --f $TempDir\ipp" -Wait
# Start-Process "$TempDir\ipp\bootstrapper.exe" -ArgumentList "--eula accept -c --action install" -Wait
- name: Install dependencies
run: choco install ninja vulkan-sdk
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_C_COMPILER=clang-cl `
-DCMAKE_CXX_COMPILER=clang-cl `
-DCMAKE_LINKER=lld-link `
-DLLVM_ROOT_DIR="$workspace/LLVM" `
-DSENTRY_DSN="${{secrets.SENTRY_DSN}}"
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Compress PDBs
working-directory: ${{github.workspace}}/build/Binaries
run: 7z a -t7z debug.7z metaforce.pdb hecl.pdb metaforce-gui.pdb visigen.pdb
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: metaforce-${{env.METAFORCE_VERSION}}-win32-clang-x86_64
path: |
build/Binaries/metaforce.exe
build/Binaries/metaforce-gui.exe
build/Binaries/hecl.exe
build/Binaries/visigen.exe
build/Binaries/crashpad_handler.exe
build/Binaries/debug.7z

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ version.h
*.autosave
docs/*
.idea/
Editor/platforms/win/urde.rc
Editor/platforms/win/metaforce.rc
.vs/
out/
cmake-build-*/

View File

@ -1,198 +0,0 @@
.build:variables:
variables: &build_variables
GIT_SUBMODULE_STRATEGY: recursive
.build:macos: &macos_definition
stage: build
tags:
- macos
script:
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DURDE_DLPACKAGE=urde-$CI_PIPELINE_ID-macos-x86_64-$URDE_VECTOR_ISA
-DURDE_VECTOR_ISA=$URDE_VECTOR_ISA
..
- ninja urde hecl visigen
- cd Binaries
- cp -R urde.app $CI_PROJECT_DIR/URDE.app
- cd $CI_PROJECT_DIR
- strip -S -o URDE.app/Contents/MacOS/urde URDE.app/Contents/MacOS/urde
- strip -S -o URDE.app/Contents/MacOS/hecl URDE.app/Contents/MacOS/hecl
- strip -S -o URDE.app/Contents/MacOS/visigen URDE.app/Contents/MacOS/visigen
- (if [ "${URDE_MACOS_CODESIGN_UID}" != "" ]; then codesign -s $URDE_MACOS_CODESIGN_UID --deep URDE.app; else echo "Unable to sign app bundle :("; fi);
only:
- release
- dev
artifacts:
name: "urde-$CI_PIPELINE_ID-macos-x86_64-$URDE_VECTOR_ISA"
paths:
- URDE.app/
expire_in: 1 week
build:macos:sse3:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse3
build:macos:sse41:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:macos:avx:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:macos:avx2:
<<: *macos_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
.build:linux: &linux_definition
stage: build
tags:
- linux
script:
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DURDE_DLPACKAGE=urde-$CI_PIPELINE_ID-linux-x86_64-$URDE_VECTOR_ISA
-DURDE_VECTOR_ISA=$URDE_VECTOR_ISA
..
- nice -n19 ninja -j8 urde hecl visigen
- cp Binaries/urde $CI_PROJECT_DIR
- strip --strip-debug -o $CI_PROJECT_DIR/urde Binaries/urde
- rm -r $CI_PROJECT_DIR/hecl
- strip --strip-debug -o $CI_PROJECT_DIR/hecl Binaries/hecl
- rm -r $CI_PROJECT_DIR/visigen
- strip --strip-debug -o $CI_PROJECT_DIR/visigen Binaries/visigen
only:
- release
- dev
artifacts:
name: "urde-$CI_PIPELINE_ID-linux-x86_64-$URDE_VECTOR_ISA"
paths:
- urde
- hecl
- visigen
expire_in: 1 week
build:linux:sse3:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse3
build:linux:sse41:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:linux:avx:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:linux:avx2:
<<: *linux_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
.build:win32: &win32_definition
stage: build
tags:
- win32
script:
- cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
- >
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
- mkdir build
- cd build
- >
cmake
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DURDE_DLPACKAGE="urde-$env:CI_PIPELINE_ID-win32-x86_64-$env:URDE_VECTOR_ISA"
-DURDE_VECTOR_ISA="$env:URDE_VECTOR_ISA"
-DLLVM_ROOT_DIR=C:\projects\deps\llvm
-DCMAKE_C_FLAGS=
-DCMAKE_CXX_FLAGS=
..
- ninja urde hecl visigen
- 'copy Binaries\urde.exe "$env:CI_PROJECT_DIR\urde.exe"'
- 'pdbcopy Binaries\urde.pdb "$env:CI_PROJECT_DIR\urde.pdb" -p'
- 'copy Binaries\hecl.exe "$env:CI_PROJECT_DIR\hecl.exe"'
- 'pdbcopy Binaries\hecl.pdb "$env:CI_PROJECT_DIR\hecl.pdb" -p'
- 'copy Binaries\visigen.exe "$env:CI_PROJECT_DIR\visigen.exe"'
- 'pdbcopy Binaries\visigen.pdb "$env:CI_PROJECT_DIR\visigen.pdb" -p'
only:
- release
- dev
artifacts:
name: "urde-$env:CI_PIPELINE_ID-win32-x86_64-$env:URDE_VECTOR_ISA"
paths:
- urde.exe
- urde.pdb
- hecl.exe
- hecl.pdb
- visigen.exe
- visigen.pdb
expire_in: 1 week
build:win32:sse2:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse2
build:win32:sse41:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: sse41
build:win32:avx:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx
build:win32:avx2:
<<: *win32_definition
variables:
<<: *build_variables
URDE_VECTOR_ISA: avx2
deploy:
stage: deploy
only:
- release
- dev
dependencies: []
tags:
- server
variables:
GIT_STRATEGY: none
script:
- python3 /var/lib/gitlab-runner/deploy_urde.py $CI_PIPELINE_ID $CI_COMMIT_REF_NAME

56
.gitmodules vendored
View File

@ -1,42 +1,56 @@
[submodule "hecl"]
path = hecl
url = ../hecl.git
[submodule "nod"]
path = nod
path = extern/nod
url = ../nod.git
branch = master
[submodule "amuse"]
path = amuse
path = extern/amuse
url = ../amuse.git
branch = master
[submodule "kabufuda"]
path = kabufuda
path = extern/kabufuda
url = ../kabufuda.git
branch = master
[submodule "jbus"]
path = jbus
path = extern/jbus
url = ../jbus.git
branch = master
[submodule "assetnameparser/tinyxml2"]
path = assetnameparser/tinyxml2
path = extern/tinyxml2
url = ../tinyxml2.git
[submodule "hecl-gui"]
path = hecl-gui
url = ../hecl-gui.git
branch = master
[submodule "sanitizers-cmake"]
path = sanitizers-cmake
path = extern/sanitizers-cmake
url = https://github.com/arsenm/sanitizers-cmake.git
branch = master
[submodule "discord-rpc"]
path = discord-rpc
path = extern/discord-rpc
url = https://github.com/discordapp/discord-rpc.git
branch = master
[submodule "rapidjson"]
path = rapidjson
path = extern/rapidjson
url = https://github.com/Tencent/rapidjson.git
branch = master
[submodule "NESEmulator/fixNES"]
path = NESEmulator/fixNES
path = extern/fixNES
url = https://github.com/FIX94/fixNES.git
[submodule "Editor/locale"]
path = Editor/locale
url = ../urde-translations.git
[submodule "boo2"]
path = boo2
branch = master
[submodule "extern/libSquish"]
path = extern/libSquish
url = ../libSquish.git
branch = master
[submodule "extern/athena"]
path = extern/athena
url = ../../libAthena/athena.git
branch = master
[submodule "extern/boo2"]
path = extern/boo2
url = ../boo2.git
branch = master
[submodule "extern/libjpeg-turbo"]
path = extern/libjpeg-turbo
url = ../libjpeg-turbo.git
branch = thp
[submodule "zeus"]
path = zeus
path = extern/zeus
url = ../zeus.git
branch = master

View File

@ -1,26 +1,80 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
# Allow target_link_libraries with targets in other directories
cmake_policy(SET CMP0079 NEW)
# Set MSVC runtime library flags from CMAKE_MSVC_RUNTIME_LIBRARY
cmake_policy(SET CMP0091 NEW)
cmake_policy(VERSION 3.15...3.20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
endif ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE metaforce_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${metaforce_git_head_filename}")
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE metaforce_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${metaforce_git_head_symbolic}
OUTPUT_VARIABLE metaforce_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${metaforce_git_head_symbolic_filename}")
# defines METAFORCE_WC_REVISION
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE METAFORCE_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines METAFORCE_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tag --long --dirty
OUTPUT_VARIABLE METAFORCE_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove hash (and trailing "-0" if needed) from description
string(REGEX REPLACE "(-0)?-[^-]+((-dirty)?)$" "\\2" METAFORCE_WC_DESCRIBE "${METAFORCE_WC_DESCRIBE}")
# defines METAFORCE_WC_BRANCH
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE METAFORCE_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines METAFORCE_WC_DATE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE METAFORCE_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (METAFORCE_WC_DESCRIBE)
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+)\-([0-9]+).*" "\\1.\\2.\\3.\\4" METAFORCE_VERSION_STRING "${METAFORCE_WC_DESCRIBE}")
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+).*" "\\1.\\2.\\3" METAFORCE_VERSION_STRING "${METAFORCE_VERSION_STRING}")
else ()
set(METAFORCE_WC_DESCRIBE "UNKNOWN-VERSION")
set(METAFORCE_VERSION_STRING "0.0.0")
endif ()
string(TIMESTAMP CURRENT_YEAR "%Y")
# Add version information to CI environment variables
if(DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "METAFORCE_VERSION=${METAFORCE_WC_DESCRIBE}")
endif()
message(STATUS "Metaforce version set to ${METAFORCE_WC_DESCRIBE}")
project(metaforce LANGUAGES C CXX ASM VERSION ${METAFORCE_VERSION_STRING})
if (APPLE)
# Shaddup Xcode
function(add_executable TARGET)
_add_executable(${TARGET} ${ARGN})
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
endfunction()
function(add_library TARGET)
_add_library(${TARGET} ${ARGN})
list(GET ARGV 1 ARG1)
if(NOT ${ARG1} STREQUAL INTERFACE AND NOT ${ARG1} STREQUAL ALIAS)
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
endif()
endfunction()
set(PLATFORM_NAME macos)
elseif (WIN32)
set(PLATFORM_NAME win32)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(PLATFORM_NAME linux)
endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if(APPLE AND NOT CMAKE_OSX_SYSROOT)
# If the Xcode SDK is lagging behind system version, CMake needs this done first
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
@ -28,8 +82,8 @@ if(APPLE AND NOT CMAKE_OSX_SYSROOT)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
option(URDE_CROSSCOMPILING "Don't build tools; attempt package import" OFF)
if (URDE_CROSSCOMPILING)
option(METAFORCE_CROSSCOMPILING "Don't build tools; attempt package import" OFF)
if (METAFORCE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING On)
endif()
@ -37,8 +91,6 @@ if(CMAKE_CROSSCOMPILING)
set(HAVE_WORDS_BIGENDIAN_EXITCODE 0 CACHE INTEGER "Makes soxr happy" FORCE)
endif()
project(urde VERSION 0.1.0)
# MSVC has a "latest" flag, which always uses the newest standard
# when available. GCC and Clang posess no such flag, and must be
# manually enforced. CMake, curiously, also doesn't have a "latest"
@ -51,26 +103,28 @@ endif()
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Force shared libs off" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/extern/sanitizers-cmake/cmake")
find_package(Sanitizers)
if (NX)
set(URDE_VECTOR_ISA "neon")
else()
set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
set(METAFORCE_VECTOR_ISA "sse41" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
endif ()
if(MSVC)
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
if(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(/arch:AVX2)
add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx")
add_compile_options(/arch:AVX)
add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse41")
add_compile_definitions(__SSE4_1__=1)
# clang-cl 10 requires -msse4.1, may be fixed in newer versions?
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL Clang)
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-msse4.1>)
endif()
message(STATUS "Building with SSE4.1 Vector ISA")
else()
message(STATUS "Building with SSE2 Vector ISA")
@ -78,7 +132,7 @@ if(MSVC)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio*")
set(VS_OPTIONS "/MP")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT urde)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT metaforce)
endif()
# Shaddup MSVC
@ -86,9 +140,24 @@ if(MSVC)
_CRT_SECURE_NO_WARNINGS=1 D_SCL_SECURE_NO_WARNINGS=1
_SCL_SECURE_NO_DEPRECATE=1 _CRT_NONSTDC_NO_WARNINGS=1
_ENABLE_EXTENDED_ALIGNED_STORAGE=1 NOMINMAX=1)
add_compile_options(/IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 /wd4068
/wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 /wd4309 /wd4805 ${VS_OPTIONS})
add_compile_options(/IGNORE:4221
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4018>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4800>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4005>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4311>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4068>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4267>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4244>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4200>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4305>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4067>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4146>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4309>
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4805>
${VS_OPTIONS})
string(REPLACE "/GR " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " /EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_compile_options(
# Disable exceptions
$<$<COMPILE_LANGUAGE:CXX>:/EHsc->
@ -108,7 +177,6 @@ if(MSVC)
# Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
)
add_compile_definitions(FMT_EXCEPTIONS=0 _HAS_EXCEPTIONS=0)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl)
@ -120,40 +188,39 @@ if(MSVC)
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
# Link-time Code Generation for Release builds
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:/GL>
$<$<CONFIG:Release>:/GL>
)
# Link-time Code Generation for Release builds
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
endif()
else()
if(${URDE_VECTOR_ISA} STREQUAL "native")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL x86_64)
if(${METAFORCE_VECTOR_ISA} STREQUAL "native")
add_compile_options(-march=native)
message(STATUS "Building with native ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx2")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(-mavx2)
message(STATUS "Building with AVX2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx")
add_compile_options(-mavx)
message(STATUS "Building with AVX Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse41")
add_compile_options(-msse4.1)
message(STATUS "Building with SSE4.1 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse3")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse3")
add_compile_options(-msse3)
message(STATUS "Building with SSE3 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse2")
elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse2")
add_compile_options(-msse2)
message(STATUS "Building with SSE2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "neon")
message(STATUS "Building with NEON Vector ISA")
else()
message(STATUS "Building with x87 Vector ISA")
endif()
endif()
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fno-plt HAS_NO_PLT)
@ -161,12 +228,12 @@ else()
add_compile_options(-fno-plt)
endif()
check_cxx_compiler_flag(-fno-asynchronous-unwind-tables HAS_NO_ASYNC_UNWIND_TABLES)
if (HAS_NO_ASYNC_UNWIND_TABLES)
if (HAS_NO_ASYNC_UNWIND_TABLES AND ${CMAKE_BUILD_TYPE} STREQUAL Release)
# Binary size reduction
add_compile_options(-fno-asynchronous-unwind-tables)
endif()
if(URDE_MSAN)
if(METAFORCE_MSAN)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=memory
-fsanitize-memory-track-origins -fsanitize-recover=all)
endif()
@ -179,13 +246,16 @@ else()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
add_compile_options(-Wno-unknown-warning-option -Wno-unused-private-field)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wno-lto-type-mismatch)
add_compile_options(-Wno-lto-type-mismatch -Wno-maybe-uninitialized)
endif()
add_compile_definitions(FMT_EXCEPTIONS=0)
if(APPLE)
add_compile_options(-Wno-error=deprecated-declarations
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:-flto=thin>)
$<$<CONFIG:Release>:-flto=thin>)
if (METAFORCE_ASAN)
add_compile_options(-fsanitize=address -fsanitize-address-use-after-scope)
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope)
endif ()
endif()
endif()
@ -197,9 +267,9 @@ endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
if(${CMAKE_BUILD_TYPE} STREQUAL Debug OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
# This is required to summarize std::string
add_compile_options(-fno-limit-debug-info)
add_compile_options(-fno-limit-debug-info -fno-omit-frame-pointer)
endif()
option(USE_LD_LLD "Link with LLD" ON)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@ -241,7 +311,11 @@ if(USE_LD_GOLD)
if("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
if(USE_LTO)
if (USE_SPLIT_DWARF)
add_compile_options(-gsplit-dwarf -Wl,--gdb-index)
add_link_options(-gsplit-dwarf -Wl,--gdb-index)
message(STATUS "GNU gold linker enabled with split DWARF.")
elseif (USE_LTO)
add_compile_options(-flto)
add_link_options(-flto)
message(STATUS "GNU gold linker enabled with LTO.")
@ -257,17 +331,15 @@ endif()
# Add discord-rpc here
if(NOT GEKKO AND NOT NX)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/discord-rpc)
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/discord-rpc)
if (NOT CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix)
endif()
add_subdirectory(discord-rpc/src)
target_include_directories(discord-rpc PRIVATE rapidjson/include PUBLIC discord-rpc/include)
add_subdirectory(extern/discord-rpc/src)
target_include_directories(discord-rpc PRIVATE extern/rapidjson/include PUBLIC extern/discord-rpc/include)
endif()
add_subdirectory(nod)
set(HECL_DLPACKAGE ${URDE_DLPACKAGE})
add_subdirectory(extern/nod)
set(DATA_SPEC_LIBS RetroDataSpec AssetNameMap)
set(HECL_DATASPEC_DECLS
@ -300,7 +372,9 @@ set(HECL_DATASPEC_PUSHES
# TODO: Fix weirdness
find_package(hsh REQUIRED)
add_subdirectory(boo2)
add_subdirectory(extern/xxhash)
add_subdirectory(hecl)
add_subdirectory(extern/zeus)
target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR})
target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(hecl-full PRIVATE zeus nod)
@ -315,19 +389,18 @@ if(NOT TARGET atdna)
# Import native atdna if cross-compiling
find_package(atdna REQUIRED)
if(NOT TARGET atdna)
message(FATAL_ERROR "atdna required for building URDE; please verify LLVM installation")
message(FATAL_ERROR "atdna required for building Metaforce; please verify LLVM installation")
endif()
endif()
add_subdirectory(amuse)
add_subdirectory(zeus)
add_subdirectory(extern/amuse)
add_subdirectory(assetnameparser)
add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known
add_subdirectory(DataSpec)
add_subdirectory(kabufuda)
add_subdirectory(extern/kabufuda)
add_subdirectory(jbus)
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jbus/include)
add_subdirectory(extern/jbus)
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/jbus/include)
set(CLIENT_SOURCES
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.hpp
@ -343,35 +416,25 @@ add_subdirectory(visigen)
add_dependencies(hecl visigen)
if (NOT WINDOWS_STORE AND NOT NX)
find_package(Qt5Widgets PATHS /usr/local/opt/qt)
if (Qt5Widgets_FOUND)
message(STATUS "Qt5 found, hecl-gui will be built")
add_subdirectory(hecl-gui)
if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(QT_HOMEBREW_PATH /usr/local/opt/qt)
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(QT_HOMEBREW_PATH /opt/homebrew/opt/qt)
else()
message(STATUS "Qt5 not found, hecl-gui will not be built")
endif()
set(QT_HOMEBREW_PATH "")
endif()
unset(GIT_EXECUTABLE CACHE)
find_package(Git)
if(GIT_FOUND)
# Get the current working branch
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE )
# Get the latest abbreviated commit hash of the working branch
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_HASH_FULL OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE
GIT_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
find_package(Qt6Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
find_package(Qt5Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
if (Qt6Widgets_FOUND)
message(STATUS "Qt6 found, metaforce-gui will be built")
add_subdirectory(metaforce-gui)
elseif(Qt5Widgets_FOUND)
message(STATUS "Qt5 found, metaforce-gui will be built")
add_subdirectory(metaforce-gui)
else()
message(STATUS "Unable to find GIT, commit information will not be available")
set(GIT_BRANCH "")
set(GIT_COMMIT_HASH "")
set(GIT_COMMIT_HASH_FULL "")
set(GIT_COMMIT_DATE "")
message(STATUS "Qt5-6 not found, metaforce-gui will not be built")
endif()
endif()
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)

View File

@ -13,7 +13,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug",
"value": "MultiThreadedDebugDLL",
"type": "STRING"
},
{
@ -30,16 +30,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -56,7 +46,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded",
"value": "MultiThreadedDLL",
"type": "STRING"
},
{
@ -73,16 +63,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -126,16 +106,6 @@
"name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_AR",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ar.exe",
"type": "FILEPATH"
},
{
"name": "CMAKE_RANLIB",
"value": "C:\\Program Files\\LLVM\\bin\\llvm-ranlib.exe",
"type": "FILEPATH"
}
]
},
@ -152,7 +122,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug",
"value": "MultiThreadedDebugDLL",
"type": "STRING"
},
{
@ -180,7 +150,7 @@
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded",
"value": "MultiThreadedDLL",
"type": "STRING"
},
{

View File

@ -1002,7 +1002,10 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
FinishBlenderMesh(os, matSetCount, meshIdx);
if (rp.first.second) {
if (entry.id != 0xB333E1D7) {
// This is the beta phazon suit, we want the (incorrect) weight information, but we don't want to keep the CSKR id
os.format(FMT_STRING("mesh.cskr_id = '{}'\n"), rp.first.first);
}
rp.second.second->sendVertexGroupsToBlender(os);
}
@ -1014,7 +1017,7 @@ ReadGeomSectionsToBlender<PAKRouter<DNAMP1::PAKBridge>, DNAMP1::MaterialSet,
std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>,
DNACMDL::SurfaceHeader_1>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP1::PAKBridge>& pakRouter,
const typename PAKRouter<DNAMP1::PAKBridge>::EntryType& entry,
const PAKRouter<DNAMP1::PAKBridge>::EntryType& entry,
const std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>& rp, bool shortNormals,
bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount);
@ -1024,7 +1027,7 @@ ReadGeomSectionsToBlender<PAKRouter<DNAMP2::PAKBridge>, DNAMP2::MaterialSet,
std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>,
DNACMDL::SurfaceHeader_2>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP2::PAKBridge>& pakRouter,
const typename PAKRouter<DNAMP2::PAKBridge>::EntryType& entry,
const PAKRouter<DNAMP2::PAKBridge>::EntryType& entry,
const std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>& rp, bool shortNormals,
bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount);
@ -1034,7 +1037,7 @@ ReadGeomSectionsToBlender<PAKRouter<DNAMP3::PAKBridge>, DNAMP3::MaterialSet,
std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>,
DNACMDL::SurfaceHeader_3>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP3::PAKBridge>& pakRouter,
const typename PAKRouter<DNAMP3::PAKBridge>::EntryType& entry,
const PAKRouter<DNAMP3::PAKBridge>::EntryType& entry,
const std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>& rp, bool shortNormals,
bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount);

View File

@ -9,7 +9,7 @@ make_dnalist(CMDL
EGMC
SAVWCommon
ParticleCommon
URDEVersionInfo
MetaforceVersionInfo
Tweaks/ITweakPlayerGun)
set(DNACOMMON_SOURCES
@ -41,7 +41,7 @@ set(DNACOMMON_SOURCES
RigInverter.hpp RigInverter.cpp
AROTBuilder.hpp AROTBuilder.cpp
OBBTreeBuilder.hpp OBBTreeBuilder.cpp
URDEVersionInfo.hpp
MetaforceVersionInfo.hpp
Tweaks/ITweak.hpp
Tweaks/TweakWriter.hpp
Tweaks/ITweakGame.hpp

View File

@ -11,12 +11,12 @@ AT_SUBSPECIALIZE_DNA_YAML(PPImpl<_CRSM<UniqueID64>>)
template <>
std::string_view PPImpl<_CRSM<UniqueID32>>::DNAType() {
return "urde::CRSM<UniqueID32>"sv;
return "CRSM<UniqueID32>"sv;
}
template <>
std::string_view PPImpl<_CRSM<UniqueID64>>::DNAType() {
return "urde::CRSM<UniqueID64>"sv;
return "CRSM<UniqueID64>"sv;
}
template <class IDType>

View File

@ -3,7 +3,7 @@
namespace DataSpec {
logvisor::Module LogDNACommon("urde::DNACommon");
logvisor::Module LogDNACommon("DataSpec::DNACommon");
thread_local SpecBase* g_curSpec;
thread_local PAKRouterBase* g_PakRouter;
thread_local hecl::blender::Token* g_ThreadBlenderToken;

View File

@ -11,12 +11,12 @@ AT_SUBSPECIALIZE_DNA_YAML(PPImpl<_ELSM<UniqueID64>>)
template <>
std::string_view ELSM<UniqueID32>::DNAType() {
return "urde::ELSM<UniqueID32>"sv;
return "ELSM<UniqueID32>"sv;
}
template <>
std::string_view ELSM<UniqueID64>::DNAType() {
return "urde::ELSM<UniqueID64>"sv;
return "ELSM<UniqueID64>"sv;
}
template <class IDType>

View File

@ -5,7 +5,7 @@
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAFont {
logvisor::Module LogModule("urde::DNAFont");
logvisor::Module LogModule("DataSpec::DNAFont");
template <class IDType>
void FONT<IDType>::_read(athena::io::IStreamReader& __dna_reader) {

View File

@ -9,7 +9,7 @@
#include <logvisor/logvisor.hpp>
namespace DataSpec::DNAFSM2 {
logvisor::Module LogDNAFSM2("urde::DNAFSM2");
logvisor::Module LogDNAFSM2("DataSpec::DNAFSM2");
template <class IDType>
template <class Op>
@ -39,12 +39,12 @@ AT_SPECIALIZE_DNA(FSM2<UniqueID64>)
template <>
std::string_view FSM2<UniqueID32>::DNAType() {
return "urde::FSM2<UniqueID32>"sv;
return "FSM2<UniqueID32>"sv;
}
template <>
std::string_view FSM2<UniqueID64>::DNAType() {
return "urde::FSM2<UniqueID64>"sv;
return "FSM2<UniqueID64>"sv;
}
template struct FSM2<UniqueID32>;

View File

@ -13,7 +13,7 @@ enum class EGame {
MetroidPrime3,
};
struct URDEVersionInfo : BigDNA {
struct MetaforceVersionInfo : BigDNA {
AT_DECL_DNA_YAML
String<-1> version;

View File

@ -1,7 +1,7 @@
#include "ParticleCommon.hpp"
namespace DataSpec::DNAParticle {
logvisor::Module LogModule("urde::DNAParticle");
logvisor::Module LogModule("DataSpec::DNAParticle");
template struct PEImpl<_RealElementFactory>;
template struct PEImpl<_IntElementFactory>;

View File

@ -846,7 +846,7 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) {
png_infop info = png_create_info_struct(png);
png_text textStruct = {};
textStruct.key = png_charp("urde_nomip");
textStruct.key = png_charp("metaforce_nomip");
if (numMips == 1)
png_set_text(png, info, &textStruct, 1);
@ -1088,13 +1088,13 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
return false;
}
/* Disable mipmapping if urde_nomip embedded */
/* Disable mipmapping if metaforce_nomip embedded */
bool mipmap = true;
png_text* textStruct;
int numText;
png_get_text(pngRead, info, &textStruct, &numText);
for (int i = 0; i < numText; ++i) {
if (std::strcmp(textStruct[i].key, "urde_nomip") == 0) {
if (std::strcmp(textStruct[i].key, "metaforce_nomip") == 0) {
mipmap = false;
}
}
@ -1401,13 +1401,13 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
const png_byte colorType = png_get_color_type(pngRead, info);
const png_byte bitDepth = png_get_bit_depth(pngRead, info);
/* Disable mipmapping if urde_nomip embedded */
/* Disable mipmapping if metaforce_nomip embedded */
bool mipmap = true;
png_text* textStruct;
int numText;
png_get_text(pngRead, info, &textStruct, &numText);
for (int i = 0; i < numText; ++i) {
if (std::strcmp(textStruct[i].key, "urde_nomip") == 0) {
if (std::strcmp(textStruct[i].key, "metaforce_nomip") == 0) {
mipmap = false;
}
}

View File

@ -9,8 +9,8 @@
namespace DataSpec {
struct ITweakGunRes : ITweak {
using ResId = urde::CAssetId;
using EBeamId = urde::CPlayerState::EBeamId;
using ResId = metaforce::CAssetId;
using EBeamId = metaforce::CPlayerState::EBeamId;
ResId x4_gunMotion;
ResId x8_grappleArm;
@ -68,7 +68,7 @@ struct ITweakGunRes : ITweak {
return x34_weapons[b];
}
void ResolveResources(const urde::IFactory& factory) {
void ResolveResources(const metaforce::IFactory& factory) {
x4_gunMotion = factory.GetResourceIdByName(GetGunMotion())->id;
x8_grappleArm = factory.GetResourceIdByName(GetGrappleArm())->id;
xc_rightHand = factory.GetResourceIdByName(GetRightHand())->id;

View File

@ -9,8 +9,8 @@
namespace DataSpec {
struct ITweakPlayerRes : ITweak {
using ResId = urde::CAssetId;
using EBeamId = urde::CPlayerState::EBeamId;
using ResId = metaforce::CAssetId;
using EBeamId = metaforce::CPlayerState::EBeamId;
ResId x4_saveStationIcon;
ResId x8_missileStationIcon;
@ -85,7 +85,7 @@ struct ITweakPlayerRes : ITweak {
}
}
void ResolveResources(const urde::IFactory& factory) {
void ResolveResources(const metaforce::IFactory& factory) {
x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon())->id;
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon())->id;
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon())->id;

View File

@ -43,7 +43,7 @@ void AFSM::State::Transition::Enumerate<BigDNA::BinarySize>(typename BinarySize:
trig.binarySize(s);
}
std::string_view AFSM::State::Transition::DNAType() { return "urde::DNAMP1::AFSM::Transition"sv; }
std::string_view AFSM::State::Transition::DNAType() { return "DNAMP1::AFSM::Transition"sv; }
template <>
void AFSM::State::Transition::Trigger::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) {
@ -100,7 +100,7 @@ void AFSM::State::Transition::Trigger::Enumerate<BigDNA::BinarySize>(size_t& __i
}
std::string_view AFSM::State::Transition::Trigger::DNAType() {
return "urde::DNAMP1::AFSM::State::Transition::Trigger"sv;
return "DNAMP1::AFSM::State::Transition::Trigger"sv;
}
} // namespace DataSpec::DNAMP1

View File

@ -139,7 +139,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::Enumer
}
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::DNAType() {
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"sv;
return "DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo"sv;
}
template <>
@ -315,7 +315,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::Enumerate<BigDNA
}
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::DNAType() {
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"sv;
return "DNAMP1::ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState"sv;
}
template <>
@ -606,7 +606,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(athena::io:
}
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
return "DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
}
template <>
@ -688,7 +688,7 @@ void ANCS::AnimationSet::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::i
}
std::string_view ANCS::AnimationSet::MetaAnimFactory::DNAType() {
return "urde::DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv;
return "DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv;
}
template <>
@ -761,7 +761,7 @@ void ANCS::AnimationSet::MetaTransFactory::Enumerate<BigDNA::WriteYaml>(athena::
}
std::string_view ANCS::AnimationSet::MetaTransFactory::DNAType() {
return "urde::DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv;
return "DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv;
}
template <>
@ -955,7 +955,7 @@ void ANCS::AnimationSet::MetaAnimPrimitive::gatherPrimitives(
out[animIdx] = {animName, animId, ANIM::GetEVNTId(rs), false};
}
std::string_view ANCS::AnimationSet::DNAType() { return "urde::DNAMP1::ANCS::AnimationSet"sv; }
std::string_view ANCS::AnimationSet::DNAType() { return "DNAMP1::ANCS::AnimationSet"sv; }
bool ANCS::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl::ProjectPath& outPath,
PAKRouter<PAKBridge>& pakRouter, const PAK::Entry& entry, bool force, hecl::blender::Token& btok,
@ -994,7 +994,7 @@ bool ANCS::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
if (!athena::io::ValidateFromYAMLStream<ANCS>(reader)) {
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not urde::DNAMP1::ANCS type")), yamlPath.getRelativePath());
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not DNAMP1::ANCS type")), yamlPath.getRelativePath());
}
athena::io::YAMLDocReader yamlReader;

View File

@ -30,7 +30,7 @@
#include "PATH.hpp"
#include "DataSpec/DNACommon/Tweaks/TweakWriter.hpp"
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
#include "Tweaks/CTweakPlayerRes.hpp"
#include "Tweaks/CTweakGunRes.hpp"
#include "Tweaks/CTweakPlayer.hpp"
@ -49,7 +49,7 @@
#include "SnowForces.hpp"
namespace DataSpec::DNAMP1 {
logvisor::Module Log("urde::DNAMP1");
logvisor::Module Log("DataSpec::DNAMP1");
static bool GetNoShare(std::string_view name) {
std::string lowerName(name);

View File

@ -23,6 +23,6 @@ void EVNT::Enumerate(typename Op::StreamT& s) {
AT_SPECIALIZE_DNA_YAML(EVNT)
std::string_view EVNT::DNAType() { return "urde::DNAMP1::EVNT"sv; }
std::string_view EVNT::DNAType() { return "DNAMP1::EVNT"sv; }
} // namespace DataSpec::DNAMP1

View File

@ -269,7 +269,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
std::vector<hecl::ProjectPath> depPaths;
std::vector<hecl::ProjectPath> lazyPaths;
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
if (obj->type == int(urde::EScriptObjectType::MemoryRelay)) {
if (obj->type == int(metaforce::EScriptObjectType::MemoryRelay)) {
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
for (IScriptObject::Connection& conn : memRelay.connections) {
MemRelayLink linkOut;
@ -319,7 +319,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
areaOut.depLayers.push_back(areaOut.deps.size());
for (const std::pair<hecl::ProjectPath, bool>& path : layer) {
if (path.first) {
urde::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
metaforce::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
if (tag.id.IsValid()) {
if (path.second)
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
@ -348,7 +348,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
layerResources.addSharedPath(path, false);
for (const std::pair<hecl::ProjectPath, bool>& path : layerResources.sharedPaths) {
urde::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
metaforce::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
if (tag.id.IsValid()) {
if (path.second)
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type);
@ -359,7 +359,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
}
hecl::ProjectPath pathPath = GetPathBeginsWith(areaDEnum, area.path, _SYS_STR("!path_"));
urde::SObjectTag pathTag = g_curSpec->buildTagFromPath(pathPath);
metaforce::SObjectTag pathTag = g_curSpec->buildTagFromPath(pathPath);
if (pathTag.id.IsValid()) {
areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type);
areaOut.lazyDeps.emplace_back(0, FOURCC('NONE'));
@ -392,7 +392,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
}
bool MLVL::CookMAPW(const hecl::ProjectPath& outPath, const World& wld) {
std::vector<urde::SObjectTag> mapaTags;
std::vector<metaforce::SObjectTag> mapaTags;
mapaTags.reserve(wld.areas.size());
for (const World::Area& area : wld.areas) {
@ -411,7 +411,7 @@ bool MLVL::CookMAPW(const hecl::ProjectPath& outPath, const World& wld) {
fo.writeUint32Big(0xDEADF00D);
fo.writeUint32Big(1);
fo.writeUint32Big(mapaTags.size());
for (const urde::SObjectTag& mapa : mapaTags)
for (const metaforce::SObjectTag& mapa : mapaTags)
fo.writeUint32Big(u32(mapa.id.Value()));
int64_t rem = fo.position() % 32;
if (rem)
@ -479,7 +479,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
{
std::vector<Scan> scans;
for (std::unique_ptr<IScriptObject>& obj : layer.objects) {
if (obj->type == int(urde::EScriptObjectType::MemoryRelay)) {
if (obj->type == int(metaforce::EScriptObjectType::MemoryRelay)) {
MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
auto iter = std::find(memRelays.begin(), memRelays.end(), memRelay.id);
if (iter == memRelays.end()) {
@ -487,7 +487,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
savw.relays.push_back(memRelay.id);
memRelays.push_back(memRelay.id);
}
} else if (obj->type == int(urde::EScriptObjectType::SpecialFunction)) {
} else if (obj->type == int(metaforce::EScriptObjectType::SpecialFunction)) {
SpecialFunction& specialFunc = static_cast<SpecialFunction&>(*obj);
if (specialFunc.function == ESpecialFunctionType::CinematicSkip)
savw.skippableCutscenes.push_back(specialFunc.id);
@ -497,7 +497,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
layer.areaId = specialFunc.layerSwitch.area;
layer.layer = specialFunc.layerSwitch.layerIdx;
}
} else if (obj->type == int(urde::EScriptObjectType::Door)) {
} else if (obj->type == int(metaforce::EScriptObjectType::Door)) {
DoorArea& doorArea = static_cast<DoorArea&>(*obj);
savw.doors.push_back(doorArea.id);
}

View File

@ -66,7 +66,7 @@ void SCAN::Texture::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::StreamT& w)
w.writeFloat("fadeDuration", fadeDuration);
}
std::string_view SCAN::Texture::DNAType() { return "urde::DNAMP1::SCAN::Texture"sv; }
std::string_view SCAN::Texture::DNAType() { return "DNAMP1::SCAN::Texture"sv; }
template <>
void SCAN::Texture::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) {

View File

@ -91,7 +91,7 @@ void SCLY::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& docout) {
docout.enumerate("layers", layers);
}
std::string_view SCLY::DNAType() { return "urde::DNAMP1::SCLY"sv; }
std::string_view SCLY::DNAType() { return "DNAMP1::SCLY"sv; }
template <>
void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
@ -191,6 +191,6 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter&
}
}
std::string_view SCLY::ScriptLayer::DNAType() { return "urde::DNAMP1::SCLY::ScriptLayer"sv; }
std::string_view SCLY::ScriptLayer::DNAType() { return "DNAMP1::SCLY::ScriptLayer"sv; }
} // namespace DataSpec::DNAMP1

View File

@ -458,5 +458,5 @@ void STRG::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::StreamT& writer) {
}
}
std::string_view STRG::DNAType() { return "urde::DNAMP1::STRG"sv; }
std::string_view STRG::DNAType() { return "DNAMP1::STRG"sv; }
} // namespace DataSpec::DNAMP1

View File

@ -26,7 +26,7 @@ void Oculus::Enumerate(typename Op::StreamT& s) {
unknown8 = 0.f;
}
std::string_view Oculus::DNAType() { return "urde::DNAMP1::Oculus"sv; }
std::string_view Oculus::DNAType() { return "DNAMP1::Oculus"sv; }
AT_SPECIALIZE_DNA_YAML(Oculus)

View File

@ -61,7 +61,7 @@ void Ridley::Enumerate(typename Op::StreamT& s) {
Do<Op>(athena::io::PropId{"damageInfo9"}, damageInfo9, s);
}
std::string_view Ridley::DNAType() { return "urde::DNAMP1::Ridley"sv; }
std::string_view Ridley::DNAType() { return "DNAMP1::Ridley"sv; }
AT_SPECIALIZE_DNA_YAML(Ridley)

View File

@ -41,7 +41,7 @@ void WorldTeleporter::Enumerate(typename Op::StreamT& s) {
}
}
std::string_view WorldTeleporter::DNAType() { return "urde::DNAMP1::WorldTeleporter"sv; }
std::string_view WorldTeleporter::DNAType() { return "DNAMP1::WorldTeleporter"sv; }
AT_SPECIALIZE_DNA_YAML(WorldTeleporter)

View File

@ -3,56 +3,95 @@
#include <hecl/CVar.hpp>
#include <hecl/CVarManager.hpp>
namespace DataSpec::DNAMP1 {
hecl::CVar* tw_fov = nullptr;
hecl::CVar* tw_hardmodeDMult = nullptr;
hecl::CVar* tw_hardmodeWMult = nullptr;
hecl::CVar* tw_splashScreensDisabled = nullptr;
namespace {
constexpr std::string_view skFov = "tweak.game.FieldOfView"sv;
constexpr std::string_view skHardModeDamageMultName = "tweak.game.HardModeDamageMult"sv;
constexpr std::string_view skHardModeWeaponMultName = "tweak.game.HardModeWeaponMult"sv;
constexpr std::string_view skSplashScreensDisabled = "tweak.game.SplashScreensDisabled"sv;
} // anonymous namespace
#define DEFINE_CVAR_GLOBAL(name) \
constexpr std::string_view sk##name = std::string_view("tweak.game." #name); \
hecl::CVar* tw_##name = nullptr;
void CTweakGame::_tweakGameListener(hecl::CVar* cv) {
if (cv == tw_fov) {
x24_fov = cv->toReal();
} else if (cv == tw_hardmodeDMult) {
x60_hardmodeDamageMult = cv->toReal();
} else if (cv == tw_hardmodeWMult) {
x64_hardmodeWeaponMult = cv->toReal();
} else if (cv == tw_splashScreensDisabled) {
x2b_splashScreensDisabled = cv->toBoolean();
#define CREATE_CVAR(name, help, value, flags) \
tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \
if (tw_##name->wasDeserialized()) { \
tw_##name->toValue(value); \
} \
tw_##name->addListener([this](hecl::CVar* cv) { _tweakListener(cv); });
#define CREATE_CVAR_BITFIELD(name, help, value, flags) \
{ \
bool tmp = value; \
CREATE_CVAR(name, help, tmp, flags) \
}
#define UPDATE_CVAR(name, cv, value) \
if ((cv) == tw_##name) { \
(cv)->toValue(value); \
return; \
}
#define UPDATE_CVAR_BITFIELD(name, cv, value) \
{ \
bool tmp = value; \
UPDATE_CVAR(name, cv, tmp) \
(value) = tmp; \
}
namespace DataSpec::DNAMP1 {
DEFINE_CVAR_GLOBAL(WorldPrefix);
DEFINE_CVAR_GLOBAL(FieldOfView);
DEFINE_CVAR_GLOBAL(SplashScreensDisabled);
DEFINE_CVAR_GLOBAL(PressStartDelay);
DEFINE_CVAR_GLOBAL(WavecapIntensityNormal);
DEFINE_CVAR_GLOBAL(WavecapIntensityPoison);
DEFINE_CVAR_GLOBAL(WavecapIntensityLava);
DEFINE_CVAR_GLOBAL(RippleIntensityNormal);
DEFINE_CVAR_GLOBAL(RippleIntensityPoison);
DEFINE_CVAR_GLOBAL(RippleIntensityLava);
DEFINE_CVAR_GLOBAL(FluidEnvBumpScale);
DEFINE_CVAR_GLOBAL(WaterFogDistanceBase);
DEFINE_CVAR_GLOBAL(WaterFogDistanceRange);
DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceBase);
DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceRange);
DEFINE_CVAR_GLOBAL(HardModeDamageMult);
DEFINE_CVAR_GLOBAL(HardModeWeaponMult);
void CTweakGame::_tweakListener(hecl::CVar* cv) {
UPDATE_CVAR(WorldPrefix, cv, x4_worldPrefix);
UPDATE_CVAR(FieldOfView, cv, x24_fov);
UPDATE_CVAR(SplashScreensDisabled, cv, x2b_splashScreensDisabled);
UPDATE_CVAR(PressStartDelay, cv, x30_pressStartDelay);
UPDATE_CVAR(WavecapIntensityNormal, cv, x34_wavecapIntensityNormal);
UPDATE_CVAR(WavecapIntensityPoison, cv, x38_wavecapIntensityPoison);
UPDATE_CVAR(WavecapIntensityLava, cv, x3c_wavecapIntensityLava);
UPDATE_CVAR(RippleIntensityNormal, cv, x40_rippleIntensityNormal);
UPDATE_CVAR(RippleIntensityPoison, cv, x44_rippleIntensityPoison);
UPDATE_CVAR(RippleIntensityLava, cv, x48_rippleIntensityLava);
UPDATE_CVAR(FluidEnvBumpScale, cv, x4c_fluidEnvBumpScale);
UPDATE_CVAR(WaterFogDistanceBase, cv, x50_waterFogDistanceBase);
UPDATE_CVAR(WaterFogDistanceRange, cv, x54_waterFogDistanceRange);
UPDATE_CVAR(GravityWaterFogDistanceBase, cv, x58_gravityWaterFogDistanceBase);
UPDATE_CVAR(GravityWaterFogDistanceRange, cv, x5c_gravityWaterFogDistanceRange);
UPDATE_CVAR(HardModeDamageMult, cv, x60_hardmodeDamageMult);
UPDATE_CVAR(HardModeWeaponMult, cv, x64_hardmodeWeaponMult);
}
void CTweakGame::initCVars(hecl::CVarManager* mgr) {
auto assignRealValue = [this, mgr](std::string_view name, std::string_view desc, float& v, hecl::CVar::EFlags flags) {
hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags);
// Check if the CVar was deserialized, this avoid an unnecessary conversion
if (cv->wasDeserialized())
v = static_cast<float>(cv->toReal());
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
return cv;
};
auto assignBoolValue = [this, mgr](std::string_view name, std::string_view desc, bool& v, hecl::CVar::EFlags flags) {
hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags);
// Check if the CVar was deserialized, this avoid an unnecessary conversion
if (cv->wasDeserialized())
v = cv->toBoolean();
cv->addListener([this](hecl::CVar* cv) { _tweakGameListener(cv); });
return cv;
};
tw_fov = assignRealValue(skFov, "", x24_fov, hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
tw_hardmodeDMult =
assignRealValue(skHardModeDamageMultName, "", x60_hardmodeDamageMult,
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
tw_hardmodeWMult =
assignRealValue(skHardModeWeaponMultName, "", x64_hardmodeWeaponMult,
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::Cheat);
tw_splashScreensDisabled = assignBoolValue(skSplashScreensDisabled, "", x2b_splashScreensDisabled,
constexpr hecl::CVar::EFlags skDefaultFlags = hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive;
CREATE_CVAR(WorldPrefix, "", x4_worldPrefix, skDefaultFlags);
CREATE_CVAR(FieldOfView, "", x24_fov, skDefaultFlags);
CREATE_CVAR(SplashScreensDisabled, "", x2b_splashScreensDisabled,
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
CREATE_CVAR(PressStartDelay, "", x30_pressStartDelay, skDefaultFlags);
CREATE_CVAR(WavecapIntensityNormal, "", x34_wavecapIntensityNormal, skDefaultFlags);
CREATE_CVAR(WavecapIntensityPoison, "", x38_wavecapIntensityPoison, skDefaultFlags);
CREATE_CVAR(WavecapIntensityLava, "", x3c_wavecapIntensityLava, skDefaultFlags);
CREATE_CVAR(RippleIntensityNormal, "", x40_rippleIntensityNormal, skDefaultFlags);
CREATE_CVAR(RippleIntensityPoison, "", x44_rippleIntensityPoison, skDefaultFlags);
CREATE_CVAR(RippleIntensityLava, "", x48_rippleIntensityLava, skDefaultFlags);
CREATE_CVAR(FluidEnvBumpScale, "", x4c_fluidEnvBumpScale, skDefaultFlags);
CREATE_CVAR(WaterFogDistanceBase, "", x50_waterFogDistanceBase, skDefaultFlags);
CREATE_CVAR(WaterFogDistanceRange, "", x54_waterFogDistanceRange, skDefaultFlags);
CREATE_CVAR(GravityWaterFogDistanceBase, "", x58_gravityWaterFogDistanceBase, skDefaultFlags);
CREATE_CVAR(GravityWaterFogDistanceRange, "", x5c_gravityWaterFogDistanceRange, skDefaultFlags);
CREATE_CVAR(HardModeDamageMult, "", x60_hardmodeDamageMult, skDefaultFlags);
CREATE_CVAR(HardModeWeaponMult, "", x64_hardmodeWeaponMult, skDefaultFlags);
}
} // namespace DataSpec::DNAMP1

View File

@ -4,10 +4,33 @@
namespace hecl {
class CVar;
}
} // namespace hecl
namespace DataSpec::DNAMP1 {
#define DEFINE_CVAR_GLOBAL(name) \
extern hecl::CVar* tw_##name;
DEFINE_CVAR_GLOBAL(WorldPrefix);
DEFINE_CVAR_GLOBAL(FieldOfView);
DEFINE_CVAR_GLOBAL(SplashScreensDisabled);
DEFINE_CVAR_GLOBAL(PressStartDelay);
DEFINE_CVAR_GLOBAL(WavecapIntensityNormal);
DEFINE_CVAR_GLOBAL(WavecapIntensityPoison);
DEFINE_CVAR_GLOBAL(WavecapIntensityLava);
DEFINE_CVAR_GLOBAL(RippleIntensityNormal);
DEFINE_CVAR_GLOBAL(RippleIntensityPoison);
DEFINE_CVAR_GLOBAL(RippleIntensityLava);
DEFINE_CVAR_GLOBAL(FluidEnvBumpScale);
DEFINE_CVAR_GLOBAL(WaterFogDistanceBase);
DEFINE_CVAR_GLOBAL(WaterFogDistanceRange);
DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceBase);
DEFINE_CVAR_GLOBAL(GravityWaterFogDistanceRange);
DEFINE_CVAR_GLOBAL(HardModeDamageMult);
DEFINE_CVAR_GLOBAL(HardModeWeaponMult);
#undef DEFINE_CVAR_GLOBAL
struct CTweakGame final : ITweakGame {
AT_DECL_DNA_YAML
String<-1> x4_worldPrefix;
@ -23,7 +46,7 @@ struct CTweakGame final : ITweakGame {
Value<float> x38_wavecapIntensityPoison;
Value<float> x3c_wavecapIntensityLava;
Value<float> x40_rippleIntensityNormal;
Value<float> x44_rippleIntentityPoison;
Value<float> x44_rippleIntensityPoison;
Value<float> x48_rippleIntensityLava;
Value<float> x4c_fluidEnvBumpScale;
Value<float> x50_waterFogDistanceBase;
@ -42,7 +65,7 @@ struct CTweakGame final : ITweakGame {
float GetWavecapIntensityPoison() const override { return x38_wavecapIntensityPoison; }
float GetWavecapIntensityLava() const override { return x3c_wavecapIntensityLava; }
float GetRippleIntensityNormal() const override { return x40_rippleIntensityNormal; }
float GetRippleIntensityPoison() const override { return x44_rippleIntentityPoison; }
float GetRippleIntensityPoison() const override { return x44_rippleIntensityPoison; }
float GetRippleIntensityLava() const override { return x48_rippleIntensityLava; }
float GetFluidEnvBumpScale() const override { return x4c_fluidEnvBumpScale; }
float GetWaterFogDistanceBase() const override { return x50_waterFogDistanceBase; }
@ -60,7 +83,8 @@ struct CTweakGame final : ITweakGame {
}
void initCVars(hecl::CVarManager* mgr) override;
private:
void _tweakGameListener(hecl::CVar* cv);
void _tweakListener(hecl::CVar* cv);
};
} // namespace DataSpec::DNAMP1

View File

@ -1,8 +1,261 @@
#include "CTweakPlayer.hpp"
#include "zeus/Math.hpp"
namespace DataSpec::DNAMP1 {
#include <hecl/CVar.hpp>
#include <hecl/CVarManager.hpp>
#define DEFINE_CVAR_GLOBAL(name) \
constexpr std::string_view sk##name = std::string_view("tweak.player." #name); \
hecl::CVar* tw_##name = nullptr;
#define CREATE_CVAR(name, help, value, flags) \
tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \
if (tw_##name->wasDeserialized()) { \
tw_##name->toValue(value); \
} \
tw_##name->addListener([this](hecl::CVar* cv) { _tweakListener(cv); });
#define CREATE_CVAR_BITFIELD(name, help, value, flags) \
{ \
bool tmp = value; \
CREATE_CVAR(name, help, tmp, flags) \
}
#define UPDATE_CVAR(name, cv, value) \
if ((cv) == tw_##name) { \
(cv)->toValue(value); \
return; \
}
#define UPDATE_CVAR_BITFIELD(name, cv, value) \
{ \
bool tmp = value; \
UPDATE_CVAR(name, cv, tmp) \
(value) = tmp; \
}
namespace DataSpec::DNAMP1 {
namespace {
static constexpr hecl::CVar::EFlags skDefaultFlags =
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Cheat | hecl::CVar::EFlags::Archive;
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationNormal);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationAir);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationIce);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationOrganic);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationWater);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationLava);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationPhazon);
DEFINE_CVAR_GLOBAL(MaxTranslationAccelerationShrubbery);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationNormal);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationAir);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationIce);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationOrganic);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationWater);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationLava);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationPhazon);
DEFINE_CVAR_GLOBAL(MaxRotationAccelerationShrubbery);
DEFINE_CVAR_GLOBAL(TranslationFrictionNormal);
DEFINE_CVAR_GLOBAL(TranslationFrictionAir);
DEFINE_CVAR_GLOBAL(TranslationFrictionIce);
DEFINE_CVAR_GLOBAL(TranslationFrictionOrganic);
DEFINE_CVAR_GLOBAL(TranslationFrictionWater);
DEFINE_CVAR_GLOBAL(TranslationFrictionLava);
DEFINE_CVAR_GLOBAL(TranslationFrictionPhazon);
DEFINE_CVAR_GLOBAL(TranslationFrictionShrubbery);
DEFINE_CVAR_GLOBAL(RotationFrictionNormal);
DEFINE_CVAR_GLOBAL(RotationFrictionAir);
DEFINE_CVAR_GLOBAL(RotationFrictionIce);
DEFINE_CVAR_GLOBAL(RotationFrictionOrganic);
DEFINE_CVAR_GLOBAL(RotationFrictionWater);
DEFINE_CVAR_GLOBAL(RotationFrictionLava);
DEFINE_CVAR_GLOBAL(RotationFrictionPhazon);
DEFINE_CVAR_GLOBAL(RotationFrictionShrubbery);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedNormal);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedAir);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedIce);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedOrganic);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedWater);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedLava);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedPhazon);
DEFINE_CVAR_GLOBAL(RotationMaxSpeedShrubbery);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedNormal);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedAir);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedIce);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedOrganic);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedWater);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedLava);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedPhazon);
DEFINE_CVAR_GLOBAL(TranslationMaxSpeedShrubbery);
DEFINE_CVAR_GLOBAL(NormalGravityAcceleration);
DEFINE_CVAR_GLOBAL(FluidGravityAcceleration);
DEFINE_CVAR_GLOBAL(VerticalJumpAcceleration);
DEFINE_CVAR_GLOBAL(HorizontalJumpAcceleration);
DEFINE_CVAR_GLOBAL(VerticalDoubleJumpAcceleration);
DEFINE_CVAR_GLOBAL(HorizontalDoubleJumpAcceleration);
DEFINE_CVAR_GLOBAL(WaterJumpFactor);
DEFINE_CVAR_GLOBAL(WaterBallJumpFactor);
DEFINE_CVAR_GLOBAL(LavaJumpFactor);
DEFINE_CVAR_GLOBAL(LavaBallJumpFactor);
DEFINE_CVAR_GLOBAL(PhazonJumpFactor);
DEFINE_CVAR_GLOBAL(PhazonBallJumpFactor);
DEFINE_CVAR_GLOBAL(AllowedJumpTime);
DEFINE_CVAR_GLOBAL(AllowedDoubleJumpTime);
DEFINE_CVAR_GLOBAL(MinDoubleJumpWindow);
DEFINE_CVAR_GLOBAL(MaxDoubleJumpWindow)
// DEFINE_CVAR_GLOBAL(); // x104_
DEFINE_CVAR_GLOBAL(MinJumpTime);
DEFINE_CVAR_GLOBAL(MinDoubleJumpTime);
DEFINE_CVAR_GLOBAL(AllowedLedgeTime);
DEFINE_CVAR_GLOBAL(DoubleJumpImpulse);
DEFINE_CVAR_GLOBAL(BackwardsForceMultiplier);
DEFINE_CVAR_GLOBAL(BombJumpRadius);
DEFINE_CVAR_GLOBAL(BombJumpHeight);
DEFINE_CVAR_GLOBAL(EyeOffset);
DEFINE_CVAR_GLOBAL(TurnSpeedMultiplier);
DEFINE_CVAR_GLOBAL(FreeLookTurnSpeedMultiplier);
DEFINE_CVAR_GLOBAL(HorizontalFreeLookAngleVelocity);
DEFINE_CVAR_GLOBAL(VerticalFreeLookAngleVelocity);
DEFINE_CVAR_GLOBAL(FreeLookSpeed);
DEFINE_CVAR_GLOBAL(FreeLookSnapSpeed);
// DEFINE_CVAR_GLOBAL(); // x140_
DEFINE_CVAR_GLOBAL(FreeLookCenteredThresholdAngle);
DEFINE_CVAR_GLOBAL(FreeLookCenteredTime);
DEFINE_CVAR_GLOBAL(FreeLookDampenFactor);
DEFINE_CVAR_GLOBAL(LeftDivisor);
DEFINE_CVAR_GLOBAL(RightDivisor);
DEFINE_CVAR_GLOBAL(OrbitMinDistanceClose);
DEFINE_CVAR_GLOBAL(OrbitMinDistanceFar);
DEFINE_CVAR_GLOBAL(OrbitMinDistanceDefault);
DEFINE_CVAR_GLOBAL(OrbitNormalDistanceClose);
DEFINE_CVAR_GLOBAL(OrbitNormalDistanceFar);
DEFINE_CVAR_GLOBAL(OrbitNormalDistanceDefault);
DEFINE_CVAR_GLOBAL(OrbitMaxDistanceClose);
DEFINE_CVAR_GLOBAL(OrbitMaxDistanceFar);
DEFINE_CVAR_GLOBAL(OrbitMaxDistanceDefault);
// DEFINE_CVAR_GLOBAL(); // x17c_
DEFINE_CVAR_GLOBAL(OrbitmodeTimer);
DEFINE_CVAR_GLOBAL(OrbitCameraSpeed);
DEFINE_CVAR_GLOBAL(OrbitUpperAngle);
DEFINE_CVAR_GLOBAL(OrbitLowerAngle);
DEFINE_CVAR_GLOBAL(OrbitHorizontalAngle);
// DEFINE_CVAR_GLOBAL(); // x194_
// DEFINE_CVAR_GLOBAL(); // x198_
DEFINE_CVAR_GLOBAL(OrbitMaxTargetDistance);
DEFINE_CVAR_GLOBAL(OrbitMaxLockDistance);
DEFINE_CVAR_GLOBAL(OrbitDistanceThreshold);
DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentX);
DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentX);
DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxHalfExtentY);
DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxHalfExtentY);
DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterX);
DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterX);
DEFINE_CVAR_GLOBAL(OrbitScreenTargetingBoxCenterY);
DEFINE_CVAR_GLOBAL(OrbitScreenScanBoxCenterY);
DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealX);
DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealX);
DEFINE_CVAR_GLOBAL(OrbitZoneTargetingIdealY);
DEFINE_CVAR_GLOBAL(OrbitZoneScanIdealY);
DEFINE_CVAR_GLOBAL(OrbitNearX);
DEFINE_CVAR_GLOBAL(OrbitNearZ);
// DEFINE_CVAR_GLOBAL(); // x1e0_
// DEFINE_CVAR_GLOBAL(); // x1e4_
DEFINE_CVAR_GLOBAL(OrbitFixedOffsetZDiff);
DEFINE_CVAR_GLOBAL(OrbitZRange);
// DEFINE_CVAR_GLOBAL(); // x1f0_
// DEFINE_CVAR_GLOBAL(); // x1f4_
// DEFINE_CVAR_GLOBAL(); // x1f8_
DEFINE_CVAR_GLOBAL(OrbitPreventionTime);
DEFINE_CVAR_GLOBAL(DashEnabled);
DEFINE_CVAR_GLOBAL(DashOnButtonRelease);
DEFINE_CVAR_GLOBAL(DashButtonHoldCancelTime);
DEFINE_CVAR_GLOBAL(DashStrafeInputThreshold);
DEFINE_CVAR_GLOBAL(SidewaysDoubleJumpImpulse);
DEFINE_CVAR_GLOBAL(SidewaysVerticalDoubleJumpAccel);
DEFINE_CVAR_GLOBAL(SidewaysHorizontalDoubleJumpAccel);
DEFINE_CVAR_GLOBAL(ScanningRange);
DEFINE_CVAR_GLOBAL(ScanRetention);
DEFINE_CVAR_GLOBAL(ScanFreezesGame);
DEFINE_CVAR_GLOBAL(OrbitWhileScanning);
DEFINE_CVAR_GLOBAL(ScanMaxTargetDistance);
DEFINE_CVAR_GLOBAL(ScanMaxLockDistance)
DEFINE_CVAR_GLOBAL(FreeLookTurnsPlayer);
// DEFINE_CVAR_GLOBAL(); // x228_25_
// DEFINE_CVAR_GLOBAL(); // x228_26_
DEFINE_CVAR_GLOBAL(MoveDuringFreelook);
DEFINE_CVAR_GLOBAL(HoldButtonsForFreeLook);
// DEFINE_CVAR_GLOBAL(); // x228_30_
// DEFINE_CVAR_GLOBAL(); // x228_31_
// DEFINE_CVAR_GLOBAL(); // x229_24_
DEFINE_CVAR_GLOBAL(AimWhenOrbitingPoint);
DEFINE_CVAR_GLOBAL(StayInFreeLookWhileFiring);
// DEFINE_CVAR_GLOBAL(); // x229_27_
// DEFINE_CVAR_GLOBAL(); // x229_28_
DEFINE_CVAR_GLOBAL(OrbitFixedOffset);
DEFINE_CVAR_GLOBAL(GunButtonTogglesHolster);
DEFINE_CVAR_GLOBAL(GunNotFiringHolstersGun);
DEFINE_CVAR_GLOBAL(FallingDoubleJump);
DEFINE_CVAR_GLOBAL(ImpulseDoubleJump);
DEFINE_CVAR_GLOBAL(FiringCancelsCameraPitch);
DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreHorizontal);
DEFINE_CVAR_GLOBAL(AssistedAimingIgnoreVertical);
// DEFINE_CVAR_GLOBAL(); // x22c
// DEFINE_CVAR_GLOBAL(); // x230_
DEFINE_CVAR_GLOBAL(AimMaxDistance);
// DEFINE_CVAR_GLOBAL(); // x238_
// DEFINE_CVAR_GLOBAL(); // x23c_
// DEFINE_CVAR_GLOBAL(); // x240_
// DEFINE_CVAR_GLOBAL(); // x244_
// DEFINE_CVAR_GLOBAL(); // x248_
DEFINE_CVAR_GLOBAL(AimThresholdDistance);
// DEFINE_CVAR_GLOBAL(); // x250_
// DEFINE_CVAR_GLOBAL(); // x254_
DEFINE_CVAR_GLOBAL(AimBoxWidth);
DEFINE_CVAR_GLOBAL(AimBoxHeight);
DEFINE_CVAR_GLOBAL(AimTargetTimer);
DEFINE_CVAR_GLOBAL(AimAssistHorizontalAngle);
DEFINE_CVAR_GLOBAL(AimAssistVerticalAngle);
DEFINE_CVAR_GLOBAL(PlayerHeight);
DEFINE_CVAR_GLOBAL(PlayerXYHalfExtent);
DEFINE_CVAR_GLOBAL(StepUpHeight);
DEFINE_CVAR_GLOBAL(StepDownHeight);
DEFINE_CVAR_GLOBAL(PlayerBallHalfExtent);
DEFINE_CVAR_GLOBAL(FirstPersonCameraSpeed);
// DEFINE_CVAR_GLOBAL(); // x284_
DEFINE_CVAR_GLOBAL(JumpCameraPitchDownStart);
DEFINE_CVAR_GLOBAL(JumpCameraPitchDownFull);
DEFINE_CVAR_GLOBAL(JumpCameraPitchDownAngle);
DEFINE_CVAR_GLOBAL(FallCameraPitchDownStart);
DEFINE_CVAR_GLOBAL(FallCameraPitchDownFull);
DEFINE_CVAR_GLOBAL(FallCameraPitchDownAngle);
DEFINE_CVAR_GLOBAL(OrbitDistanceMax);
DEFINE_CVAR_GLOBAL(GrappleSwingLength);
DEFINE_CVAR_GLOBAL(GrappleSwingPeriod);
DEFINE_CVAR_GLOBAL(GrapplePullSpeedMin);
DEFINE_CVAR_GLOBAL(GrappleCameraSpeed);
DEFINE_CVAR_GLOBAL(MaxGrappleLockedTurnAlignDistance);
DEFINE_CVAR_GLOBAL(GrapplePullSpeedProportion);
DEFINE_CVAR_GLOBAL(GrapplePullSpeedMax);
DEFINE_CVAR_GLOBAL(GrappleLookCenterSpeed);
DEFINE_CVAR_GLOBAL(MaxGrappleTurnSpeed);
DEFINE_CVAR_GLOBAL(GrappleJumpForce);
DEFINE_CVAR_GLOBAL(GrappleReleaseTime);
DEFINE_CVAR_GLOBAL(GrappleJumpMode);
DEFINE_CVAR_GLOBAL(OrbitReleaseBreaksGrapple);
DEFINE_CVAR_GLOBAL(InvertGrappleTurn);
DEFINE_CVAR_GLOBAL(GrappleBeamSpeed);
DEFINE_CVAR_GLOBAL(GrappleBeamXWaveAmplitude);
DEFINE_CVAR_GLOBAL(GrappleBeamZWaveAmplitude);
DEFINE_CVAR_GLOBAL(GrappleBeamAnglePhaseDelta);
// DEFINE_CVAR_GLOBAL(); // x2e8_
// DEFINE_CVAR_GLOBAL(); // x2ec_
// DEFINE_CVAR_GLOBAL(); // x2f0_
// DEFINE_CVAR_GLOBAL(); // x2f4_
DEFINE_CVAR_GLOBAL(FrozenTimeout);
DEFINE_CVAR_GLOBAL(IceBreakJumpCount);
DEFINE_CVAR_GLOBAL(VariaDamageReduction);
DEFINE_CVAR_GLOBAL(GravityDamageReduction);
DEFINE_CVAR_GLOBAL(PhazonDamageReduction);
} // namespace
template <>
void CTweakPlayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) {
/* x4_maxTranslationalAcceleration[0] */
@ -1900,9 +2153,504 @@ void CTweakPlayer::FixupValues() {
}
std::string_view CTweakPlayer::DNAType() { return "DataSpec::DNAMP1::CTweakPlayer"sv; }
template <>
void CTweakPlayer::Enumerate<BigDNA::BinarySize>(size_t& __isz) {
__isz += 785;
}
void CTweakPlayer::_tweakListener(hecl::CVar* cv) {
UPDATE_CVAR(MaxTranslationAccelerationNormal, cv, x4_maxTranslationalAcceleration[0]);
UPDATE_CVAR(MaxTranslationAccelerationAir, cv, x4_maxTranslationalAcceleration[1]);
UPDATE_CVAR(MaxTranslationAccelerationIce, cv, x4_maxTranslationalAcceleration[2]);
UPDATE_CVAR(MaxTranslationAccelerationOrganic, cv, x4_maxTranslationalAcceleration[3]);
UPDATE_CVAR(MaxTranslationAccelerationWater, cv, x4_maxTranslationalAcceleration[4]);
UPDATE_CVAR(MaxTranslationAccelerationLava, cv, x4_maxTranslationalAcceleration[5]);
UPDATE_CVAR(MaxTranslationAccelerationPhazon, cv, x4_maxTranslationalAcceleration[6]);
UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]);
UPDATE_CVAR(MaxRotationAccelerationNormal, cv, x24_maxRotationalAcceleration[0]);
UPDATE_CVAR(MaxRotationAccelerationAir, cv, x24_maxRotationalAcceleration[1]);
UPDATE_CVAR(MaxRotationAccelerationIce, cv, x24_maxRotationalAcceleration[2]);
UPDATE_CVAR(MaxRotationAccelerationOrganic, cv, x24_maxRotationalAcceleration[3]);
UPDATE_CVAR(MaxRotationAccelerationWater, cv, x24_maxRotationalAcceleration[4]);
UPDATE_CVAR(MaxRotationAccelerationLava, cv, x24_maxRotationalAcceleration[5]);
UPDATE_CVAR(MaxRotationAccelerationPhazon, cv, x24_maxRotationalAcceleration[6]);
UPDATE_CVAR(MaxRotationAccelerationShrubbery, cv, x24_maxRotationalAcceleration[7]);
UPDATE_CVAR(TranslationFrictionNormal, cv, x44_translationFriction[0]);
UPDATE_CVAR(TranslationFrictionAir, cv, x44_translationFriction[1]);
UPDATE_CVAR(TranslationFrictionIce, cv, x44_translationFriction[2]);
UPDATE_CVAR(TranslationFrictionOrganic, cv, x44_translationFriction[3]);
UPDATE_CVAR(TranslationFrictionWater, cv, x44_translationFriction[4]);
UPDATE_CVAR(TranslationFrictionLava, cv, x44_translationFriction[5]);
UPDATE_CVAR(TranslationFrictionPhazon, cv, x44_translationFriction[6]);
UPDATE_CVAR(TranslationFrictionShrubbery, cv, x44_translationFriction[7]);
UPDATE_CVAR(RotationFrictionNormal, cv, x44_translationFriction[2]);
UPDATE_CVAR(RotationFrictionIce, cv, x44_translationFriction[2]);
UPDATE_CVAR(RotationFrictionOrganic, cv, x44_translationFriction[3]);
UPDATE_CVAR(RotationFrictionWater, cv, x44_translationFriction[4]);
UPDATE_CVAR(RotationFrictionLava, cv, x44_translationFriction[5]);
UPDATE_CVAR(RotationFrictionPhazon, cv, x44_translationFriction[6]);
UPDATE_CVAR(RotationFrictionShrubbery, cv, x44_translationFriction[7]);
UPDATE_CVAR(RotationMaxSpeedNormal, cv, x84_rotationMaxSpeed[2]);
UPDATE_CVAR(RotationMaxSpeedIce, cv, x84_rotationMaxSpeed[2]);
UPDATE_CVAR(RotationMaxSpeedOrganic, cv, x84_rotationMaxSpeed[3]);
UPDATE_CVAR(RotationMaxSpeedWater, cv, x84_rotationMaxSpeed[4]);
UPDATE_CVAR(RotationMaxSpeedLava, cv, x84_rotationMaxSpeed[5]);
UPDATE_CVAR(RotationMaxSpeedPhazon, cv, x84_rotationMaxSpeed[6]);
UPDATE_CVAR(RotationMaxSpeedShrubbery, cv, x84_rotationMaxSpeed[7]);
UPDATE_CVAR(TranslationMaxSpeedNormal, cv, xa4_translationMaxSpeed[2]);
UPDATE_CVAR(TranslationMaxSpeedIce, cv, xa4_translationMaxSpeed[2]);
UPDATE_CVAR(TranslationMaxSpeedOrganic, cv, xa4_translationMaxSpeed[3]);
UPDATE_CVAR(TranslationMaxSpeedWater, cv, xa4_translationMaxSpeed[4]);
UPDATE_CVAR(TranslationMaxSpeedLava, cv, xa4_translationMaxSpeed[5]);
UPDATE_CVAR(TranslationMaxSpeedPhazon, cv, xa4_translationMaxSpeed[6]);
UPDATE_CVAR(TranslationMaxSpeedShrubbery, cv, xa4_translationMaxSpeed[7]);
UPDATE_CVAR(NormalGravityAcceleration, cv, xc4_normalGravAccel);
UPDATE_CVAR(FluidGravityAcceleration, cv, xc8_fluidGravAccel);
UPDATE_CVAR(VerticalJumpAcceleration, cv, xcc_verticalJumpAccel);
UPDATE_CVAR(HorizontalJumpAcceleration, cv, xd0_horizontalJumpAccel);
UPDATE_CVAR(VerticalDoubleJumpAcceleration, cv, xd4_verticalDoubleJumpAccel);
UPDATE_CVAR(HorizontalDoubleJumpAcceleration, cv, xd8_horizontalDoubleJumpAccel);
UPDATE_CVAR(WaterJumpFactor, cv, xdc_waterJumpFactor);
UPDATE_CVAR(WaterBallJumpFactor, cv, xe0_waterBallJumpFactor);
UPDATE_CVAR(LavaJumpFactor, cv, xe4_lavaJumpFactor);
UPDATE_CVAR(LavaBallJumpFactor, cv, xe8_lavaBallJumpFactor);
UPDATE_CVAR(PhazonJumpFactor, cv, xec_phazonJumpFactor);
UPDATE_CVAR(PhazonBallJumpFactor, cv, xf0_phazonBallJumpFactor);
UPDATE_CVAR(AllowedJumpTime, cv, xf4_allowedJumpTime);
UPDATE_CVAR(AllowedDoubleJumpTime, cv, xf8_allowedDoubleJumpTime);
UPDATE_CVAR(MinDoubleJumpWindow, cv, xfc_minDoubleJumpWindow);
UPDATE_CVAR(MaxDoubleJumpWindow, cv, x100_maxDoubleJumpWindow);
// UPDATE_CVAR(); // x104_
UPDATE_CVAR(MinJumpTime, cv, x108_minJumpTime);
UPDATE_CVAR(MinDoubleJumpTime, cv, x10c_minDoubleJumpTime);
UPDATE_CVAR(AllowedLedgeTime, cv, x110_allowedLedgeTime);
UPDATE_CVAR(DoubleJumpImpulse, cv, x114_doubleJumpImpulse);
UPDATE_CVAR(BackwardsForceMultiplier, cv, x118_backwardsForceMultiplier);
UPDATE_CVAR(BombJumpRadius, cv, x11c_bombJumpRadius);
UPDATE_CVAR(BombJumpHeight, cv, x120_bombJumpHeight);
UPDATE_CVAR(EyeOffset, cv, x124_eyeOffset);
UPDATE_CVAR(TurnSpeedMultiplier, cv, x128_turnSpeedMultiplier);
UPDATE_CVAR(FreeLookTurnSpeedMultiplier, cv, x12c_freeLookTurnSpeedMultiplier);
UPDATE_CVAR(HorizontalFreeLookAngleVelocity, cv, x130_horizontalFreeLookAngleVel);
UPDATE_CVAR(VerticalFreeLookAngleVelocity, cv, x134_verticalFreeLookAngleVel);
UPDATE_CVAR(FreeLookSpeed, cv, x138_freeLookSpeed);
UPDATE_CVAR(FreeLookSnapSpeed, cv, x13c_freeLookSnapSpeed);
// UPDATE_CVAR(); // x140_
UPDATE_CVAR(FreeLookCenteredThresholdAngle, cv, x144_freeLookCenteredThresholdAngle);
UPDATE_CVAR(FreeLookCenteredTime, cv, x148_freeLookCenteredTime);
UPDATE_CVAR(FreeLookDampenFactor, cv, x14c_freeLookDampenFactor);
UPDATE_CVAR(LeftDivisor, cv, x150_leftDiv);
UPDATE_CVAR(RightDivisor, cv, x154_rightDiv);
UPDATE_CVAR(OrbitMinDistanceClose, cv, x158_orbitMinDistance[0]);
UPDATE_CVAR(OrbitMinDistanceFar, cv, x158_orbitMinDistance[1]);
UPDATE_CVAR(OrbitMinDistanceDefault, cv, x158_orbitMinDistance[2]);
UPDATE_CVAR(OrbitNormalDistanceClose, cv, x164_orbitNormalDistance[0]);
UPDATE_CVAR(OrbitNormalDistanceFar, cv, x164_orbitNormalDistance[1]);
UPDATE_CVAR(OrbitNormalDistanceDefault, cv, x164_orbitNormalDistance[2]);
UPDATE_CVAR(OrbitMaxDistanceClose, cv, x170_orbitMaxDistance[0]);
UPDATE_CVAR(OrbitMaxDistanceFar, cv, x170_orbitMaxDistance[1]);
UPDATE_CVAR(OrbitMaxDistanceDefault, cv, x170_orbitMaxDistance[2]);
// UPDATE_CVAR(); // x17c_
UPDATE_CVAR(OrbitmodeTimer, cv, x180_orbitModeTimer);
UPDATE_CVAR(OrbitCameraSpeed, cv, x184_orbitCameraSpeed);
UPDATE_CVAR(OrbitUpperAngle, cv, x188_orbitUpperAngle);
UPDATE_CVAR(OrbitLowerAngle, cv, x18c_orbitLowerAngle);
UPDATE_CVAR(OrbitHorizontalAngle, cv, x190_orbitHorizAngle);
// UPDATE_CVAR(); // x194_
// UPDATE_CVAR(); // x198_
UPDATE_CVAR(OrbitMaxTargetDistance, cv, x19c_orbitMaxTargetDistance);
UPDATE_CVAR(OrbitMaxLockDistance, cv, x1a0_orbitMaxLockDistance);
UPDATE_CVAR(OrbitDistanceThreshold, cv, x1a4_orbitDistanceThreshold);
UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[0]);
UPDATE_CVAR(OrbitScreenScanBoxHalfExtentX, cv, x1a8_orbitScreenBoxHalfExtentX[1]);
UPDATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[0]);
UPDATE_CVAR(OrbitScreenScanBoxHalfExtentY, cv, x1b0_orbitScreenBoxHalfExtentY[1]);
UPDATE_CVAR(OrbitScreenTargetingBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[0]);
UPDATE_CVAR(OrbitScreenScanBoxCenterX, cv, x1b8_orbitScreenBoxCenterX[1]);
UPDATE_CVAR(OrbitScreenTargetingBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[0]);
UPDATE_CVAR(OrbitScreenScanBoxCenterY, cv, x1c0_orbitScreenBoxCenterY[1]);
UPDATE_CVAR(OrbitZoneTargetingIdealX, cv, x1c8_orbitZoneIdealX[0]);
UPDATE_CVAR(OrbitZoneScanIdealX, cv, x1c8_orbitZoneIdealX[1]);
UPDATE_CVAR(OrbitZoneTargetingIdealY, cv, x1d0_orbitZoneIdealY[0]);
UPDATE_CVAR(OrbitZoneScanIdealY, cv, x1d0_orbitZoneIdealY[1]);
UPDATE_CVAR(OrbitNearX, cv, x1d8_orbitNearX);
UPDATE_CVAR(OrbitNearZ, cv, x1dc_orbitNearZ);
// UPDATE_CVAR(); // x1e0_
// UPDATE_CVAR(); // x1e4_
UPDATE_CVAR(OrbitFixedOffsetZDiff, cv, x1e8_orbitFixedOffsetZDiff);
UPDATE_CVAR(OrbitZRange, cv, x1ec_orbitZRange);
// UPDATE_CVAR(); // x1f0_
// UPDATE_CVAR(); // x1f4_
// UPDATE_CVAR(); // x1f8_
UPDATE_CVAR(OrbitPreventionTime, cv, x1fc_orbitPreventionTime);
UPDATE_CVAR_BITFIELD(DashEnabled, cv, x200_24_dashEnabled);
UPDATE_CVAR_BITFIELD(DashOnButtonRelease, cv, x200_25_dashOnButtonRelease);
UPDATE_CVAR(DashButtonHoldCancelTime, cv, x204_dashButtonHoldCancelTime);
UPDATE_CVAR(DashStrafeInputThreshold, cv, x208_dashStrafeInputThreshold);
UPDATE_CVAR(SidewaysDoubleJumpImpulse, cv, x20c_sidewaysDoubleJumpImpulse);
UPDATE_CVAR(SidewaysVerticalDoubleJumpAccel, cv, x210_sidewaysVerticalDoubleJumpAccel);
UPDATE_CVAR(SidewaysHorizontalDoubleJumpAccel, cv, x214_sidewaysHorizontalDoubleJumpAccel);
UPDATE_CVAR(ScanningRange, cv, x218_scanningRange);
UPDATE_CVAR_BITFIELD(ScanRetention, cv, x21c_24_scanRetention);
UPDATE_CVAR_BITFIELD(ScanFreezesGame, cv, x21c_25_scanFreezesGame);
UPDATE_CVAR_BITFIELD(OrbitWhileScanning, cv, x21c_26_orbitWhileScanning);
UPDATE_CVAR(ScanMaxTargetDistance, cv, x220_scanMaxTargetDistance);
UPDATE_CVAR(ScanMaxLockDistance, cv, x224_scanMaxLockDistance);
UPDATE_CVAR_BITFIELD(FreeLookTurnsPlayer, cv, x228_24_freelookTurnsPlayer);
// UPDATE_CVAR_BITFIELD(); // x228_25_
// UPDATE_CVAR_BITFIELD(); // x228_26_
UPDATE_CVAR_BITFIELD(MoveDuringFreelook, cv, x228_27_moveDuringFreeLook);
UPDATE_CVAR_BITFIELD(HoldButtonsForFreeLook, cv, x228_28_holdButtonsForFreeLook);
// UPDATE_CVAR_BITFIELD(); // x228_30_
// UPDATE_CVAR_BITFIELD(); // x228_31_
// UPDATE_CVAR_BITFIELD(); // x229_24_
UPDATE_CVAR_BITFIELD(AimWhenOrbitingPoint, cv, x229_25_aimWhenOrbitingPoint);
UPDATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, cv, x229_26_stayInFreeLookWhileFiring);
// UPDATE_CVAR_BITFIELD(); // x229_27_
// UPDATE_CVAR_BITFIELD(); // x229_28_
UPDATE_CVAR_BITFIELD(OrbitFixedOffset, cv, x229_29_orbitFixedOffset);
UPDATE_CVAR_BITFIELD(GunButtonTogglesHolster, cv, x229_30_gunButtonTogglesHolster);
UPDATE_CVAR_BITFIELD(GunNotFiringHolstersGun, cv, x229_31_gunNotFiringHolstersGun);
UPDATE_CVAR_BITFIELD(FallingDoubleJump, cv, x22a_24_fallingDoubleJump);
UPDATE_CVAR_BITFIELD(ImpulseDoubleJump, cv, x22a_25_impulseDoubleJump);
UPDATE_CVAR_BITFIELD(FiringCancelsCameraPitch, cv, x22a_26_firingCancelsCameraPitch);
UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, cv, x22a_27_assistedAimingIgnoreHorizontal);
UPDATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, cv, x22a_28_assistedAimingIgnoreVertical);
// UPDATE_CVAR(); // x22c
// UPDATE_CVAR(); // x230_
UPDATE_CVAR(AimMaxDistance, cv, x234_aimMaxDistance);
// UPDATE_CVAR(); // x238_
// UPDATE_CVAR(); // x23c_
// UPDATE_CVAR(); // x240_
// UPDATE_CVAR(); // x244_
// UPDATE_CVAR(); // x248_
UPDATE_CVAR(AimThresholdDistance, cv, x24c_aimThresholdDistance);
// UPDATE_CVAR(); // x250_
// UPDATE_CVAR(); // x254_
UPDATE_CVAR(AimBoxWidth, cv, x258_aimBoxWidth);
UPDATE_CVAR(AimBoxHeight, cv, x25c_aimBoxHeight);
UPDATE_CVAR(AimTargetTimer, cv, x260_aimTargetTimer);
UPDATE_CVAR(AimAssistHorizontalAngle, cv, x264_aimAssistHorizontalAngle);
UPDATE_CVAR(AimAssistVerticalAngle, cv, x268_aimAssistVerticalAngle);
UPDATE_CVAR(PlayerHeight, cv, x26c_playerHeight);
UPDATE_CVAR(PlayerXYHalfExtent, cv, x270_playerXYHalfExtent);
UPDATE_CVAR(StepUpHeight, cv, x274_stepUpHeight);
UPDATE_CVAR(StepDownHeight, cv, x278_stepDownHeight);
UPDATE_CVAR(PlayerBallHalfExtent, cv, x27c_playerBallHalfExtent);
UPDATE_CVAR(FirstPersonCameraSpeed, cv, x280_firstPersonCameraSpeed);
// UPDATE_CVAR(); // x284_
UPDATE_CVAR(JumpCameraPitchDownStart, cv, x288_jumpCameraPitchDownStart);
UPDATE_CVAR(JumpCameraPitchDownFull, cv, x28c_jumpCameraPitchDownFull);
UPDATE_CVAR(JumpCameraPitchDownAngle, cv, x290_jumpCameraPitchDownAngle);
UPDATE_CVAR(FallCameraPitchDownStart, cv, x294_fallCameraPitchDownStart);
UPDATE_CVAR(FallCameraPitchDownFull, cv, x298_fallCameraPitchDownFull);
UPDATE_CVAR(FallCameraPitchDownAngle, cv, x29c_fallCameraPitchDownAngle);
UPDATE_CVAR(OrbitDistanceMax, cv, x2a0_orbitDistanceMax);
UPDATE_CVAR(GrappleSwingLength, cv, x2a4_grappleSwingLength);
UPDATE_CVAR(GrappleSwingPeriod, cv, x2a8_grappleSwingPeriod);
UPDATE_CVAR(GrapplePullSpeedMin, cv, x2ac_grapplePullSpeedMin);
UPDATE_CVAR(GrappleCameraSpeed, cv, x2b0_grappleCameraSpeed);
UPDATE_CVAR(MaxGrappleLockedTurnAlignDistance, cv, x2b4_maxGrappleLockedTurnAlignDistance);
UPDATE_CVAR(GrapplePullSpeedProportion, cv, x2b8_grapplePullSpeedProportion);
UPDATE_CVAR(GrapplePullSpeedMax, cv, x2bc_grapplePullSpeedMax);
UPDATE_CVAR(GrappleLookCenterSpeed, cv, x2c0_grappleLookCenterSpeed);
UPDATE_CVAR(MaxGrappleTurnSpeed, cv, x2c4_maxGrappleTurnSpeed);
UPDATE_CVAR(GrappleJumpForce, cv, x2c8_grappleJumpForce);
UPDATE_CVAR(GrappleReleaseTime, cv, x2cc_grappleReleaseTime);
UPDATE_CVAR(GrappleJumpMode, cv, x2d0_grappleJumpMode);
UPDATE_CVAR(OrbitReleaseBreaksGrapple, cv, x2d4_orbitReleaseBreaksGrapple);
UPDATE_CVAR(InvertGrappleTurn, cv, x2d5_invertGrappleTurn);
UPDATE_CVAR(GrappleBeamSpeed, cv, x2d8_grappleBeamSpeed);
UPDATE_CVAR(GrappleBeamXWaveAmplitude, cv, x2dc_grappleBeamXWaveAmplitude);
UPDATE_CVAR(GrappleBeamZWaveAmplitude, cv, x2e0_grappleBeamZWaveAmplitude);
UPDATE_CVAR(GrappleBeamAnglePhaseDelta, cv, x2e4_grappleBeamAnglePhaseDelta);
// UPDATE_CVAR(); // x2e8_
// UPDATE_CVAR(); // x2ec_
// UPDATE_CVAR(); // x2f0_
// UPDATE_CVAR(); // x2f4_
UPDATE_CVAR(FrozenTimeout, cv, x2f8_frozenTimeout);
UPDATE_CVAR(IceBreakJumpCount, cv, x2fc_iceBreakJumpCount);
UPDATE_CVAR(VariaDamageReduction, cv, x300_variaDamageReduction);
UPDATE_CVAR(GravityDamageReduction, cv, x304_gravityDamageReduction);
UPDATE_CVAR(PhazonDamageReduction, cv, x308_phazonDamageReduction);
}
void CTweakPlayer::initCVars(hecl::CVarManager* mgr) {
CREATE_CVAR(MaxTranslationAccelerationNormal,
"Max translation acceleration allowed to the player under normal circumstances",
x4_maxTranslationalAcceleration[0], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationAir, "Max translation acceleration allowed to the player while in air",
x4_maxTranslationalAcceleration[1], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationIce, "Max translation acceleration allowed to the player while on ice surfaces",
x4_maxTranslationalAcceleration[2], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationOrganic,
"Max translation acceleration allowed to the player while on organic surfaces",
x4_maxTranslationalAcceleration[3], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationWater, "Max translation acceleration allowed to the player while in water",
x4_maxTranslationalAcceleration[4], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationLava, "Max translation acceleration allowed to the player while in lava",
x4_maxTranslationalAcceleration[5], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationPhazon, "Max translation acceleration allowed to the player while in phazon",
x4_maxTranslationalAcceleration[6], skDefaultFlags);
CREATE_CVAR(MaxTranslationAccelerationShrubbery,
"Max translation acceleration allowed to the player while in shrubbery",
x4_maxTranslationalAcceleration[7], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationNormal,
"Max rotation acceleration allowed to the player under normal circumstances",
x24_maxRotationalAcceleration[0], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationAir, "Max rotation acceleration allowed to the player while in air",
x24_maxRotationalAcceleration[1], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationIce, "Max rotation acceleration allowed to the player while on ice surfaces",
x24_maxRotationalAcceleration[2], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationOrganic,
"Max rotation acceleration allowed to the player while on organic surfaces",
x24_maxRotationalAcceleration[3], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationWater, "Max rotation acceleration allowed to the player while in water",
x24_maxRotationalAcceleration[4], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationLava, "Max rotation acceleration allowed to the player while in lava",
x24_maxRotationalAcceleration[5], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationPhazon, "Max rotation acceleration allowed to the player while in phazon",
x24_maxRotationalAcceleration[6], skDefaultFlags);
CREATE_CVAR(MaxRotationAccelerationShrubbery, "Max rotation acceleration allowed to the player while in shrubbery",
x24_maxRotationalAcceleration[7], skDefaultFlags);
CREATE_CVAR(TranslationFrictionNormal, "Translation friction allowed to the player under normal circumstances",
x44_translationFriction[0], skDefaultFlags);
CREATE_CVAR(TranslationFrictionAir, "Translation friction allowed to the player while in air",
x44_translationFriction[1], skDefaultFlags);
CREATE_CVAR(TranslationFrictionIce, "Translation friction allowed to the player while on ice surfaces",
x44_translationFriction[2], skDefaultFlags);
CREATE_CVAR(TranslationFrictionOrganic, "Translation friction allowed to the player while on organic surfaces",
x44_translationFriction[3], skDefaultFlags);
CREATE_CVAR(TranslationFrictionWater, "Translation friction allowed to the player while in water",
x44_translationFriction[4], skDefaultFlags);
CREATE_CVAR(TranslationFrictionLava, "Translation friction allowed to the player while in lava",
x44_translationFriction[5], skDefaultFlags);
CREATE_CVAR(TranslationFrictionPhazon, "Translation friction allowed to the player while in phazon",
x44_translationFriction[6], skDefaultFlags);
CREATE_CVAR(TranslationFrictionShrubbery, "Translation friction allowed to the player while in shrubbery",
x44_translationFriction[7], skDefaultFlags);
CREATE_CVAR(RotationFrictionNormal, "Rotation friction allowed to the player under normal circumstances",
x44_translationFriction[0], skDefaultFlags);
CREATE_CVAR(RotationFrictionAir, "Rotation friction allowed to the player while in air", x44_translationFriction[1],
skDefaultFlags);
CREATE_CVAR(RotationFrictionIce, "Rotation friction allowed to the player while on ice surfaces",
x44_translationFriction[2], skDefaultFlags);
CREATE_CVAR(RotationFrictionOrganic, "Rotation friction allowed to the player while on organic surfaces",
x44_translationFriction[3], skDefaultFlags);
CREATE_CVAR(RotationFrictionWater, "Rotation friction allowed to the player while in water",
x44_translationFriction[4], skDefaultFlags);
CREATE_CVAR(RotationFrictionLava, "Rotation friction allowed to the player while in lava", x44_translationFriction[5],
skDefaultFlags);
CREATE_CVAR(RotationFrictionPhazon, "Rotation friction allowed to the player while in phazon",
x44_translationFriction[6], skDefaultFlags);
CREATE_CVAR(RotationFrictionShrubbery, "Rotation friction allowed to the player while in shrubbery",
x44_translationFriction[7], skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedNormal, "Rotation max speed allowed to the player under normal circumstances",
x84_rotationMaxSpeed[0], skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedAir, "Rotation max speed allowed to the player while in air", x84_rotationMaxSpeed[1],
skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedIce, "Rotation max speed allowed to the player while on ice surfaces",
x84_rotationMaxSpeed[2], skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedOrganic, "Rotation max speed allowed to the player while on organic surfaces",
x84_rotationMaxSpeed[3], skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedWater, "Rotation max speed allowed to the player while in water", x84_rotationMaxSpeed[4],
skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedLava, "Rotation max speed allowed to the player while in lava", x84_rotationMaxSpeed[5],
skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedPhazon, "Rotation max speed allowed to the player while in phazon",
x84_rotationMaxSpeed[6], skDefaultFlags);
CREATE_CVAR(RotationMaxSpeedShrubbery, "Rotation max speed allowed to the player while in shrubbery",
x84_rotationMaxSpeed[7], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances",
xa4_translationMaxSpeed[0], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedNormal, "Translation max speed allowed to the player under normal circumstances",
xa4_translationMaxSpeed[1], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedIce, "Translation max speed allowed to the player while on ice surfaces",
xa4_translationMaxSpeed[2], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedOrganic, "Translation max speed allowed to the player while on organic surfaces",
xa4_translationMaxSpeed[3], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedWater, "Translation max speed allowed to the player while in water",
xa4_translationMaxSpeed[4], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedLava, "Translation max speed allowed to the player while in lava",
xa4_translationMaxSpeed[5], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedPhazon, "Translation max speed allowed to the player while in phazon",
xa4_translationMaxSpeed[6], skDefaultFlags);
CREATE_CVAR(TranslationMaxSpeedShrubbery, "Translation max speed allowed to the player while in shrubbery",
xa4_translationMaxSpeed[7], skDefaultFlags);
CREATE_CVAR(NormalGravityAcceleration, "Gravity applied to the player under normal circumstances",
xc4_normalGravAccel, skDefaultFlags);
CREATE_CVAR(FluidGravityAcceleration, "Gravity applied to the player while in water", xc8_fluidGravAccel,
skDefaultFlags);
CREATE_CVAR(VerticalJumpAcceleration, "Vertical acceleration applied while jumping", xcc_verticalJumpAccel,
skDefaultFlags);
CREATE_CVAR(HorizontalJumpAcceleration, "Horizontal acceleration while jumping", xd0_horizontalJumpAccel,
skDefaultFlags);
CREATE_CVAR(VerticalDoubleJumpAcceleration, "Vertical acceleration while double jumping", xd4_verticalDoubleJumpAccel,
skDefaultFlags);
CREATE_CVAR(HorizontalDoubleJumpAcceleration, "Horizontal acceleration while double jumping",
xd8_horizontalDoubleJumpAccel, skDefaultFlags);
CREATE_CVAR(WaterJumpFactor, "Jump Factor while in water", xdc_waterJumpFactor, skDefaultFlags);
CREATE_CVAR(WaterBallJumpFactor, "Jump Factor while morphed in water", xe0_waterBallJumpFactor, skDefaultFlags);
CREATE_CVAR(LavaJumpFactor, "Jump Factor while in lava", xe4_lavaJumpFactor, skDefaultFlags);
CREATE_CVAR(LavaBallJumpFactor, "Jump Factor while morphed in lava", xe8_lavaBallJumpFactor, skDefaultFlags);
CREATE_CVAR(PhazonJumpFactor, "Jump Factor while in phazon", xec_phazonJumpFactor, skDefaultFlags);
CREATE_CVAR(PhazonBallJumpFactor, "Jump Factor while morphed in phazon", xf0_phazonBallJumpFactor, skDefaultFlags);
CREATE_CVAR(AllowedJumpTime, "", xf4_allowedJumpTime, skDefaultFlags);
CREATE_CVAR(AllowedDoubleJumpTime, "", xf8_allowedDoubleJumpTime, skDefaultFlags);
CREATE_CVAR(MinDoubleJumpWindow, "", xfc_minDoubleJumpWindow, skDefaultFlags);
CREATE_CVAR(MaxDoubleJumpWindow, "", x100_maxDoubleJumpWindow, skDefaultFlags);
// CREATE_CVAR(); // x104_
CREATE_CVAR(MinJumpTime, "", x108_minJumpTime, skDefaultFlags);
CREATE_CVAR(MinDoubleJumpTime, "", x10c_minDoubleJumpTime, skDefaultFlags);
CREATE_CVAR(AllowedLedgeTime, "", x110_allowedLedgeTime, skDefaultFlags);
CREATE_CVAR(DoubleJumpImpulse, "", x114_doubleJumpImpulse, skDefaultFlags);
CREATE_CVAR(BackwardsForceMultiplier, "", x118_backwardsForceMultiplier, skDefaultFlags);
CREATE_CVAR(BombJumpRadius, "", x11c_bombJumpRadius, skDefaultFlags);
CREATE_CVAR(BombJumpHeight, "", x120_bombJumpHeight, skDefaultFlags);
CREATE_CVAR(EyeOffset, "", x124_eyeOffset, skDefaultFlags);
CREATE_CVAR(TurnSpeedMultiplier, "", x128_turnSpeedMultiplier, skDefaultFlags);
CREATE_CVAR(FreeLookTurnSpeedMultiplier, "", x12c_freeLookTurnSpeedMultiplier, skDefaultFlags);
CREATE_CVAR(HorizontalFreeLookAngleVelocity, "", x130_horizontalFreeLookAngleVel, skDefaultFlags);
CREATE_CVAR(VerticalFreeLookAngleVelocity, "", x134_verticalFreeLookAngleVel, skDefaultFlags);
CREATE_CVAR(FreeLookSpeed, "", x138_freeLookSpeed, skDefaultFlags);
CREATE_CVAR(FreeLookSnapSpeed, "", x13c_freeLookSnapSpeed, skDefaultFlags);
// CREATE_CVAR(); // x140_
CREATE_CVAR(FreeLookCenteredThresholdAngle, "", x144_freeLookCenteredThresholdAngle, skDefaultFlags);
CREATE_CVAR(FreeLookCenteredTime, "", x148_freeLookCenteredTime, skDefaultFlags);
CREATE_CVAR(FreeLookDampenFactor, "", x14c_freeLookDampenFactor, skDefaultFlags);
CREATE_CVAR(LeftDivisor, "", x150_leftDiv, skDefaultFlags);
CREATE_CVAR(RightDivisor, "", x154_rightDiv, skDefaultFlags);
CREATE_CVAR(OrbitMinDistanceClose, "", x158_orbitMinDistance[0], skDefaultFlags);
CREATE_CVAR(OrbitMinDistanceFar, "", x158_orbitMinDistance[1], skDefaultFlags);
CREATE_CVAR(OrbitMinDistanceDefault, "", x158_orbitMinDistance[2], skDefaultFlags);
CREATE_CVAR(OrbitNormalDistanceClose, "", x164_orbitNormalDistance[0], skDefaultFlags);
CREATE_CVAR(OrbitNormalDistanceFar, "", x164_orbitNormalDistance[1], skDefaultFlags);
CREATE_CVAR(OrbitNormalDistanceDefault, "", x164_orbitNormalDistance[2], skDefaultFlags);
CREATE_CVAR(OrbitMaxDistanceClose, "", x170_orbitMaxDistance[0], skDefaultFlags);
CREATE_CVAR(OrbitMaxDistanceFar, "", x170_orbitMaxDistance[1], skDefaultFlags);
CREATE_CVAR(OrbitMaxDistanceDefault, "", x170_orbitMaxDistance[2], skDefaultFlags);
// CREATE_CVAR(); // x17c_
CREATE_CVAR(OrbitmodeTimer, "", x180_orbitModeTimer, skDefaultFlags);
CREATE_CVAR(OrbitCameraSpeed, "", x184_orbitCameraSpeed, skDefaultFlags);
CREATE_CVAR(OrbitUpperAngle, "", x184_orbitCameraSpeed, skDefaultFlags);
CREATE_CVAR(OrbitLowerAngle, "", x184_orbitCameraSpeed, skDefaultFlags);
CREATE_CVAR(OrbitHorizontalAngle, "", x184_orbitCameraSpeed, skDefaultFlags);
// CREATE_CVAR(); // x194_
// CREATE_CVAR(); // x198_
CREATE_CVAR(OrbitMaxTargetDistance, "", x19c_orbitMaxTargetDistance, skDefaultFlags);
CREATE_CVAR(OrbitMaxLockDistance, "", x1a0_orbitMaxLockDistance, skDefaultFlags);
CREATE_CVAR(OrbitDistanceThreshold, "", x1a4_orbitDistanceThreshold, skDefaultFlags);
CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[0], skDefaultFlags);
CREATE_CVAR(OrbitScreenScanBoxHalfExtentX, "", x1a8_orbitScreenBoxHalfExtentX[1], skDefaultFlags);
CREATE_CVAR(OrbitScreenTargetingBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[0], skDefaultFlags);
CREATE_CVAR(OrbitScreenScanBoxHalfExtentY, "", x1b0_orbitScreenBoxHalfExtentY[1], skDefaultFlags);
CREATE_CVAR(OrbitScreenTargetingBoxCenterX, "", x1b8_orbitScreenBoxCenterX[0], skDefaultFlags);
CREATE_CVAR(OrbitScreenScanBoxCenterX, "", x1b8_orbitScreenBoxCenterX[1], skDefaultFlags);
CREATE_CVAR(OrbitScreenTargetingBoxCenterY, "", x1c0_orbitScreenBoxCenterY[0], skDefaultFlags);
CREATE_CVAR(OrbitScreenScanBoxCenterY, "", x1c0_orbitScreenBoxCenterY[1], skDefaultFlags);
CREATE_CVAR(OrbitZoneTargetingIdealX, "", x1c8_orbitZoneIdealX[0], skDefaultFlags);
CREATE_CVAR(OrbitZoneScanIdealX, "", x1c8_orbitZoneIdealX[1], skDefaultFlags);
CREATE_CVAR(OrbitZoneTargetingIdealY, "", x1d0_orbitZoneIdealY[0], skDefaultFlags);
CREATE_CVAR(OrbitZoneScanIdealY, "", x1d0_orbitZoneIdealY[1], skDefaultFlags);
CREATE_CVAR(OrbitNearX, "", x1d8_orbitNearX, skDefaultFlags);
CREATE_CVAR(OrbitNearZ, "", x1dc_orbitNearZ, skDefaultFlags);
// CREATE_CVAR(); // x1e0_
// CREATE_CVAR(); // x1e4_
CREATE_CVAR(OrbitFixedOffsetZDiff, "", x1e8_orbitFixedOffsetZDiff, skDefaultFlags);
CREATE_CVAR(OrbitZRange, "", x1ec_orbitZRange, skDefaultFlags);
// CREATE_CVAR(); // x1f0_
// CREATE_CVAR(); // x1f4_
// CREATE_CVAR(); // x1f8_
CREATE_CVAR(OrbitPreventionTime, "", x1fc_orbitPreventionTime, skDefaultFlags);
CREATE_CVAR_BITFIELD(DashEnabled, "", x200_24_dashEnabled, skDefaultFlags);
CREATE_CVAR_BITFIELD(DashOnButtonRelease, "", x200_25_dashOnButtonRelease, skDefaultFlags);
CREATE_CVAR(DashButtonHoldCancelTime, "", x204_dashButtonHoldCancelTime, skDefaultFlags);
CREATE_CVAR(DashStrafeInputThreshold, "", x208_dashStrafeInputThreshold, skDefaultFlags);
CREATE_CVAR(SidewaysDoubleJumpImpulse, "", x20c_sidewaysDoubleJumpImpulse, skDefaultFlags);
CREATE_CVAR(SidewaysVerticalDoubleJumpAccel, "", x210_sidewaysVerticalDoubleJumpAccel, skDefaultFlags);
CREATE_CVAR(SidewaysHorizontalDoubleJumpAccel, "", x214_sidewaysHorizontalDoubleJumpAccel, skDefaultFlags);
CREATE_CVAR(ScanningRange, "", x218_scanningRange, skDefaultFlags);
CREATE_CVAR_BITFIELD(ScanRetention, "", x21c_24_scanRetention, skDefaultFlags);
CREATE_CVAR_BITFIELD(ScanFreezesGame, "", x21c_25_scanFreezesGame, skDefaultFlags);
CREATE_CVAR_BITFIELD(OrbitWhileScanning, "", x21c_26_orbitWhileScanning, skDefaultFlags);
CREATE_CVAR(ScanMaxTargetDistance, "", x220_scanMaxTargetDistance, skDefaultFlags);
CREATE_CVAR(ScanMaxLockDistance, "", x224_scanMaxLockDistance, skDefaultFlags);
CREATE_CVAR_BITFIELD(FreeLookTurnsPlayer, "", x228_24_freelookTurnsPlayer, skDefaultFlags);
// CREATE_CVAR_BITFIELD(); // x228_25_
// CREATE_CVAR_BITFIELD(); // x228_26_
CREATE_CVAR_BITFIELD(MoveDuringFreelook, "", x228_27_moveDuringFreeLook, skDefaultFlags);
CREATE_CVAR_BITFIELD(HoldButtonsForFreeLook, "", x228_28_holdButtonsForFreeLook, skDefaultFlags);
// CREATE_CVAR_BITFIELD(); // x228_30_
// CREATE_CVAR_BITFIELD(); // x228_31_
// CREATE_CVAR(); // x229_24_
CREATE_CVAR_BITFIELD(AimWhenOrbitingPoint, "", x229_25_aimWhenOrbitingPoint, skDefaultFlags);
CREATE_CVAR_BITFIELD(StayInFreeLookWhileFiring, "", x229_26_stayInFreeLookWhileFiring, skDefaultFlags);
// CREATE_CVAR_BITFIELD(); // x229_27_
// CREATE_CVAR_BITFIELD(); // x229_28_
CREATE_CVAR_BITFIELD(OrbitFixedOffset, "", x229_29_orbitFixedOffset, skDefaultFlags);
CREATE_CVAR_BITFIELD(GunButtonTogglesHolster, "", x229_30_gunButtonTogglesHolster, skDefaultFlags);
CREATE_CVAR_BITFIELD(GunNotFiringHolstersGun, "", x229_31_gunNotFiringHolstersGun, skDefaultFlags);
CREATE_CVAR_BITFIELD(FallingDoubleJump, "", x22a_24_fallingDoubleJump, skDefaultFlags);
CREATE_CVAR_BITFIELD(ImpulseDoubleJump, "", x22a_25_impulseDoubleJump, skDefaultFlags);
CREATE_CVAR_BITFIELD(FiringCancelsCameraPitch, "", x22a_26_firingCancelsCameraPitch, skDefaultFlags);
CREATE_CVAR_BITFIELD(AssistedAimingIgnoreHorizontal, "", x22a_27_assistedAimingIgnoreHorizontal, skDefaultFlags);
CREATE_CVAR_BITFIELD(AssistedAimingIgnoreVertical, "", x22a_28_assistedAimingIgnoreVertical, skDefaultFlags);
// CREATE_CVAR(); // x22c
// CREATE_CVAR(); // x230_
CREATE_CVAR(AimMaxDistance, "", x234_aimMaxDistance, skDefaultFlags);
// CREATE_CVAR(); // x238_
// CREATE_CVAR(); // x23c_
// CREATE_CVAR(); // x240_
// CREATE_CVAR(); // x244_
// CREATE_CVAR(); // x248_
CREATE_CVAR(AimThresholdDistance, "", x24c_aimThresholdDistance, skDefaultFlags);
// CREATE_CVAR(); // x250_
// CREATE_CVAR(); // x254_
CREATE_CVAR(AimBoxWidth, "", x258_aimBoxWidth, skDefaultFlags);
CREATE_CVAR(AimBoxHeight, "", x25c_aimBoxHeight, skDefaultFlags);
CREATE_CVAR(AimTargetTimer, "", x260_aimTargetTimer, skDefaultFlags);
CREATE_CVAR(AimAssistHorizontalAngle, "", x264_aimAssistHorizontalAngle, skDefaultFlags);
CREATE_CVAR(AimAssistVerticalAngle, "", x268_aimAssistVerticalAngle, skDefaultFlags);
CREATE_CVAR(PlayerHeight, "", x26c_playerHeight, skDefaultFlags);
CREATE_CVAR(PlayerXYHalfExtent, "", x270_playerXYHalfExtent, skDefaultFlags);
CREATE_CVAR(StepUpHeight, "", x274_stepUpHeight, skDefaultFlags);
CREATE_CVAR(StepDownHeight, "", x278_stepDownHeight, skDefaultFlags);
CREATE_CVAR(PlayerBallHalfExtent, "", x27c_playerBallHalfExtent, skDefaultFlags);
CREATE_CVAR(FirstPersonCameraSpeed, "", x280_firstPersonCameraSpeed, skDefaultFlags);
// CREATE_CVAR(); // x284_
CREATE_CVAR(JumpCameraPitchDownStart, "", x288_jumpCameraPitchDownStart, skDefaultFlags);
CREATE_CVAR(JumpCameraPitchDownFull, "", x28c_jumpCameraPitchDownFull, skDefaultFlags);
CREATE_CVAR(JumpCameraPitchDownAngle, "", x290_jumpCameraPitchDownAngle, skDefaultFlags);
CREATE_CVAR(FallCameraPitchDownStart, "", x294_fallCameraPitchDownStart, skDefaultFlags);
CREATE_CVAR(FallCameraPitchDownFull, "", x298_fallCameraPitchDownFull, skDefaultFlags);
CREATE_CVAR(FallCameraPitchDownAngle, "", x29c_fallCameraPitchDownAngle, skDefaultFlags);
CREATE_CVAR(OrbitDistanceMax, "", x2a0_orbitDistanceMax, skDefaultFlags);
CREATE_CVAR(GrappleSwingLength, "", x2a4_grappleSwingLength, skDefaultFlags);
CREATE_CVAR(GrappleSwingPeriod, "", x2a8_grappleSwingPeriod, skDefaultFlags);
CREATE_CVAR(GrapplePullSpeedMin, "", x2ac_grapplePullSpeedMin, skDefaultFlags);
CREATE_CVAR(GrappleCameraSpeed, "", x2b0_grappleCameraSpeed, skDefaultFlags);
CREATE_CVAR(MaxGrappleLockedTurnAlignDistance, "", x2b4_maxGrappleLockedTurnAlignDistance, skDefaultFlags);
CREATE_CVAR(GrapplePullSpeedProportion, "", x2b8_grapplePullSpeedProportion, skDefaultFlags);
CREATE_CVAR(GrapplePullSpeedMax, "", x2bc_grapplePullSpeedMax, skDefaultFlags);
CREATE_CVAR(GrappleLookCenterSpeed, "", x2c0_grappleLookCenterSpeed, skDefaultFlags);
CREATE_CVAR(MaxGrappleTurnSpeed, "", x2c4_maxGrappleTurnSpeed, skDefaultFlags);
CREATE_CVAR(GrappleJumpForce, "", x2c8_grappleJumpForce, skDefaultFlags);
CREATE_CVAR(GrappleReleaseTime, "", x2cc_grappleReleaseTime, skDefaultFlags);
CREATE_CVAR(GrappleJumpMode, "", x2d0_grappleJumpMode, skDefaultFlags);
CREATE_CVAR(OrbitReleaseBreaksGrapple, "", x2d4_orbitReleaseBreaksGrapple, skDefaultFlags);
CREATE_CVAR(InvertGrappleTurn, "", x2d5_invertGrappleTurn, skDefaultFlags);
CREATE_CVAR(GrappleBeamSpeed, "", x2d8_grappleBeamSpeed, skDefaultFlags);
CREATE_CVAR(GrappleBeamXWaveAmplitude, "", x2dc_grappleBeamXWaveAmplitude, skDefaultFlags);
CREATE_CVAR(GrappleBeamZWaveAmplitude, "", x2e0_grappleBeamZWaveAmplitude, skDefaultFlags);
CREATE_CVAR(GrappleBeamAnglePhaseDelta, "", x2e4_grappleBeamAnglePhaseDelta, skDefaultFlags);
// CREATE_CVAR(); // x2e8_
// CREATE_CVAR(); // x2ec_
// CREATE_CVAR(); // x2f0_
// CREATE_CVAR(); // x2f4_
CREATE_CVAR(FrozenTimeout, "", x2f8_frozenTimeout, skDefaultFlags);
CREATE_CVAR(IceBreakJumpCount, "", x2fc_iceBreakJumpCount, skDefaultFlags);
CREATE_CVAR(VariaDamageReduction, "", x300_variaDamageReduction, skDefaultFlags);
CREATE_CVAR(GravityDamageReduction, "", x304_gravityDamageReduction, skDefaultFlags);
CREATE_CVAR(PhazonDamageReduction, "", x308_phazonDamageReduction, skDefaultFlags);
}
} // namespace DataSpec::DNAMP1

View File

@ -1,6 +1,10 @@
#pragma once
#include "../../DNACommon/Tweaks/ITweakPlayer.hpp"
#include "DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp"
namespace hecl {
class CVar;
}
namespace DataSpec::DNAMP1 {
@ -310,6 +314,8 @@ struct CTweakPlayer final : ITweakPlayer {
}
void FixupValues();
void initCVars(hecl::CVarManager* mgr) override;
void _tweakListener(hecl::CVar* cv);
};
} // namespace DataSpec::DNAMP1

View File

@ -347,7 +347,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(typename Wr
}
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
return "urde::DNAMP2::ANCS::CharacterSet::CharacterInfo"sv;
return "DNAMP2::ANCS::CharacterSet::CharacterInfo"sv;
}
template <>
@ -523,7 +523,7 @@ void ANCS::AnimationSet::Enumerate<BigDNA::WriteYaml>(typename WriteYaml::Stream
}
}
std::string_view ANCS::AnimationSet::DNAType() { return "urde::DNAMP2::ANCS::AnimationSet"sv; }
std::string_view ANCS::AnimationSet::DNAType() { return "DNAMP2::ANCS::AnimationSet"sv; }
template <class Op>
void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) {
@ -542,6 +542,6 @@ void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) {
AT_SPECIALIZE_DNA(ANCS::AnimationSet::EVNT)
std::string_view ANCS::AnimationSet::EVNT::DNAType() { return "urde::DNAMP2::ANCS::AnimationSet::EVNT"sv; }
std::string_view ANCS::AnimationSet::EVNT::DNAType() { return "DNAMP2::ANCS::AnimationSet::EVNT"sv; }
} // namespace DataSpec::DNAMP2

View File

@ -22,7 +22,7 @@
#include "Runtime/GCNTypes.hpp"
namespace DataSpec::DNAMP2 {
logvisor::Module Log("urde::DNAMP2");
logvisor::Module Log("DataSpec::DNAMP2");
static bool GetNoShare(std::string_view name) {
std::string lowerName(name);

View File

@ -213,6 +213,6 @@ void STRG::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
}
}
std::string_view STRG::DNAType() { return "urde::DNAMP2::STRG"sv; }
std::string_view STRG::DNAType() { return "DNAMP2::STRG"sv; }
} // namespace DataSpec::DNAMP2

View File

@ -69,7 +69,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::Enumerate<BigDNA::WriteYaml>(athena::i
}
std::string_view CHAR::AnimationInfo::EVNT::SFXEvent::DNAType() {
return "urde::DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv;
return "DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv;
}
template <>
@ -151,7 +151,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::
}
std::string_view CHAR::AnimationInfo::MetaAnimFactory::DNAType() {
return "urde::DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv;
return "DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv;
}
} // namespace DataSpec::DNAMP3

View File

@ -19,7 +19,7 @@
#include "Runtime/GCNTypes.hpp"
namespace DataSpec::DNAMP3 {
logvisor::Module Log("urde::DNAMP3");
logvisor::Module Log("DataSpec::DNAMP3");
static bool GetNoShare(std::string_view name) {
std::string lowerName(name);

View File

@ -220,6 +220,6 @@ void STRG::Enumerate<BigDNA::WriteYaml>(athena::io::YAMLDocWriter& writer) {
}
}
std::string_view STRG::DNAType() { return "urde::DNAMP3::STRG"sv; }
std::string_view STRG::DNAType() { return "DNAMP3::STRG"sv; }
} // namespace DataSpec::DNAMP3

View File

@ -8,7 +8,7 @@
#include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/TXTR.hpp"
#include "DataSpec/AssetNameMap.hpp"
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
#include "hecl/ClientProcess.hpp"
#include "nod/DiscBase.hpp"
#include "nod/nod.hpp"
@ -22,7 +22,7 @@
namespace DataSpec {
static logvisor::Module Log("urde::SpecBase");
static logvisor::Module Log("DataSpec::SpecBase");
static const hecl::SystemChar* MomErr[] = {_SYS_STR("Your metroid is in another castle"),
_SYS_STR("HECL is experiencing a PTSD attack"),
@ -441,8 +441,8 @@ bool SpecBase::canPackage(const hecl::ProjectPath& path) {
return path.isFile() || path.isDirectory();
}
void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut,
std::unordered_set<urde::SObjectTag>& addedTags,
void SpecBase::recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
std::unordered_set<metaforce::SObjectTag>& addedTags,
const hecl::ProjectPath& path, hecl::blender::Token& btok) {
hecl::DirectoryEnumerator dEnum(path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, false,
false, true);
@ -452,7 +452,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
if (hecl::ProjectPath(childPath, _SYS_STR("!project.yaml")).isFile() &&
hecl::ProjectPath(childPath, _SYS_STR("!pool.yaml")).isFile()) {
/* Handle AudioGroup case */
if (urde::SObjectTag tag = tagFromPath(childPath)) {
if (metaforce::SObjectTag tag = tagFromPath(childPath)) {
if (addedTags.find(tag) != addedTags.end())
continue;
addedTags.insert(tag);
@ -466,7 +466,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
std::vector<hecl::ProjectPath> subPaths;
flattenDependencies(childPath, subPaths, btok);
for (const auto& subPath : subPaths) {
if (urde::SObjectTag tag = tagFromPath(subPath)) {
if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
if (addedTags.find(tag) != addedTags.end())
continue;
addedTags.insert(tag);
@ -478,10 +478,10 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
}
void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
const std::vector<urde::SObjectTag>& buildList,
const std::vector<metaforce::SObjectTag>& buildList,
const hecl::Database::DataSpecEntry* entry, bool fast,
const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
const std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) {
const std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) {
fileIndex.reserve(buildList.size());
int loadIdx = 0;
for (const auto& tag : buildList) {
@ -564,9 +564,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Output file */
athena::io::FileWriter pakOut(outPath.getAbsolutePath());
std::vector<urde::SObjectTag> buildList;
std::vector<metaforce::SObjectTag> buildList;
atUint64 resTableOffset = 0;
std::unordered_map<urde::CAssetId, std::vector<uint8_t>> mlvlData;
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>> mlvlData;
if (IsWorldBlend(path)) /* World PAK */
{
@ -583,9 +583,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
} else if (path.getPathType() == hecl::ProjectPath::Type::Directory) /* General PAK */
{
/* Build resource list */
std::unordered_set<urde::SObjectTag> addedTags;
std::unordered_set<metaforce::SObjectTag> addedTags;
recursiveBuildResourceList(buildList, addedTags, path, btok);
std::vector<std::pair<urde::SObjectTag, std::string>> nameList;
std::vector<std::pair<metaforce::SObjectTag, std::string>> nameList;
/* Build name list */
for (const auto& item : buildList) {
@ -605,10 +605,10 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Build resource list */
std::vector<hecl::ProjectPath> subPaths;
flattenDependencies(path, subPaths, btok);
std::unordered_set<urde::SObjectTag> addedTags;
std::vector<std::pair<urde::SObjectTag, std::string>> nameList;
std::unordered_set<metaforce::SObjectTag> addedTags;
std::vector<std::pair<metaforce::SObjectTag, std::string>> nameList;
for (const auto& subPath : subPaths) {
if (urde::SObjectTag tag = tagFromPath(subPath)) {
if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
if (addedTags.find(tag) != addedTags.end())
continue;
addedTags.insert(tag);
@ -635,12 +635,12 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
if (cp) {
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources")));
progress.setMainIndeterminate(true);
std::vector<urde::SObjectTag> cookTags;
std::vector<metaforce::SObjectTag> cookTags;
cookTags.reserve(buildList.size());
/* Ensure CMDLs are enqueued first to minimize synchronous dependency cooking */
for (int i = 0; i < 2; ++i) {
std::unordered_set<urde::SObjectTag> addedTags;
std::unordered_set<metaforce::SObjectTag> addedTags;
addedTags.reserve(buildList.size());
for (auto& tag : buildList) {
if ((i == 0 && tag.type == FOURCC('CMDL')) || (i == 1 && tag.type != FOURCC('CMDL'))) {
@ -732,7 +732,7 @@ void SpecBase::extractRandomStaticEntropy(const uint8_t* buf, const hecl::Projec
png_infop info = png_create_info_struct(png);
png_text textStruct = {};
textStruct.key = png_charp("urde_nomip");
textStruct.key = png_charp("meta_nomip");
png_set_text(png, info, &textStruct, 1);
png_set_IHDR(png, info, 1024, 512, 8, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
@ -761,7 +761,7 @@ void SpecBase::clearTagCache() {
m_catalogTagToNames.clear();
}
hecl::ProjectPath SpecBase::pathFromTag(const urde::SObjectTag& tag) const {
hecl::ProjectPath SpecBase::pathFromTag(const metaforce::SObjectTag& tag) const {
std::unique_lock lk(m_backgroundIndexMutex);
auto search = m_tagToPath.find(tag);
if (search != m_tagToPath.cend())
@ -769,14 +769,14 @@ hecl::ProjectPath SpecBase::pathFromTag(const urde::SObjectTag& tag) const {
return {};
}
urde::SObjectTag SpecBase::tagFromPath(const hecl::ProjectPath& path) const {
metaforce::SObjectTag SpecBase::tagFromPath(const hecl::ProjectPath& path) const {
auto search = m_pathToTag.find(path.hash());
if (search != m_pathToTag.cend())
return search->second;
return buildTagFromPath(path);
}
bool SpecBase::waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
bool SpecBase::waitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
std::unique_lock lk(m_backgroundIndexMutex);
auto search = m_tagToPath.find(tag);
if (search == m_tagToPath.end()) {
@ -799,7 +799,7 @@ bool SpecBase::waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectP
return true;
}
const urde::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) const {
const metaforce::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) const {
std::string lower(name);
std::transform(lower.cbegin(), lower.cend(), lower.begin(), tolower);
@ -823,12 +823,12 @@ const urde::SObjectTag* SpecBase::getResourceIdByName(std::string_view name) con
return &search->second;
}
FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const {
FourCC SpecBase::getResourceTypeById(metaforce::CAssetId id) const {
if (!id.IsValid())
return {};
std::unique_lock lk(m_backgroundIndexMutex);
urde::SObjectTag searchTag = {FourCC(), id};
metaforce::SObjectTag searchTag = {FourCC(), id};
auto search = m_tagToPath.find(searchTag);
if (search == m_tagToPath.end()) {
if (m_backgroundRunning) {
@ -849,7 +849,7 @@ FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const {
return search->first.type;
}
void SpecBase::enumerateResources(const std::function<bool(const urde::SObjectTag&)>& lambda) const {
void SpecBase::enumerateResources(const std::function<bool(const metaforce::SObjectTag&)>& lambda) const {
waitForIndexComplete();
for (const auto& pair : m_tagToPath) {
if (!lambda(pair.first))
@ -858,7 +858,7 @@ void SpecBase::enumerateResources(const std::function<bool(const urde::SObjectTa
}
void SpecBase::enumerateNamedResources(
const std::function<bool(std::string_view, const urde::SObjectTag&)>& lambda) const {
const std::function<bool(std::string_view, const metaforce::SObjectTag&)>& lambda) const {
waitForIndexComplete();
for (const auto& pair : m_catalogNameToTag) {
if (!lambda(pair.first, pair.second))
@ -866,7 +866,7 @@ void SpecBase::enumerateNamedResources(
}
}
static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& pathTag,
static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& pathTag,
const hecl::ProjectPath& path) {
auto key = fmt::format(FMT_STRING("{}"), pathTag.id);
if (auto* existing = cacheWriter.getCurNode()->findMapChild(key)) {
@ -877,7 +877,7 @@ static void WriteTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObject
}
}
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter, const urde::SObjectTag& pathTag,
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter, const metaforce::SObjectTag& pathTag,
std::string_view name) {
nameWriter.writeString(name.data(), fmt::format(FMT_STRING("{}"), pathTag.id));
}
@ -915,7 +915,7 @@ void SpecBase::readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAM
}
if (path.isNone())
continue;
urde::SObjectTag pathTag = tagFromPath(path);
metaforce::SObjectTag pathTag = tagFromPath(path);
if (pathTag) {
std::unique_lock lk(m_backgroundIndexMutex);
m_catalogNameToTag[pLower] = pathTag;
@ -956,7 +956,7 @@ void SpecBase::backgroundIndexRecursiveCatalogs(const hecl::ProjectPath& dir, at
}
}
void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& tag,
void SpecBase::insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& tag,
const hecl::ProjectPath& path, bool dump) {
#if 0
auto search = m_tagToPath.find(tag);
@ -989,7 +989,7 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
return true;
/* Classify intermediate into tag */
urde::SObjectTag pathTag = buildTagFromPath(path);
metaforce::SObjectTag pathTag = buildTagFromPath(path);
if (pathTag) {
std::unique_lock lk{m_backgroundIndexMutex};
bool useGlob = false;
@ -1085,7 +1085,7 @@ void SpecBase::backgroundIndexRecursiveProc(const hecl::ProjectPath& dir, athena
if (hecl::ProjectPath(path, "!project.yaml").isFile() && hecl::ProjectPath(path, "!pool.yaml").isFile()) {
/* Avoid redundant filesystem access for re-caches */
if (m_pathToTag.find(path.hash()) == m_pathToTag.cend()) {
urde::SObjectTag pathTag(SBIG('AGSC'), path.parsedHash32());
metaforce::SObjectTag pathTag(SBIG('AGSC'), path.parsedHash32());
insertPathTag(cacheWriter, pathTag, path);
}
} else {
@ -1138,7 +1138,7 @@ void SpecBase::backgroundIndexProc() {
if (node.m_seqChildren.size() >= 2) {
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
hecl::FourCC type(node.m_seqChildren[0]->m_scalarString.c_str());
urde::SObjectTag pathTag(type, id);
metaforce::SObjectTag pathTag(type, id);
for (auto I = node.m_seqChildren.begin() + 1, E = node.m_seqChildren.end(); I != E; ++I) {
hecl::ProjectPath path(m_project.getProjectWorkingPath(), (*I)->m_scalarString);
if (!path.isNone())
@ -1166,7 +1166,7 @@ void SpecBase::backgroundIndexProc() {
m_catalogTagToNames.reserve(nameReader.getRootNode()->m_mapChildren.size());
for (const auto& child : nameReader.getRootNode()->m_mapChildren) {
unsigned long id = strtoul(child.second->m_scalarString.c_str(), nullptr, 16);
auto search = m_tagToPath.find(urde::SObjectTag(FourCC(), uint32_t(id)));
auto search = m_tagToPath.find(metaforce::SObjectTag(FourCC(), uint32_t(id)));
if (search != m_tagToPath.cend()) {
std::string chLower = child.first;
std::transform(chLower.cbegin(), chLower.cend(), chLower.begin(), tolower);
@ -1224,7 +1224,7 @@ void SpecBase::WriteVersionInfo(hecl::Database::Project& project, const hecl::Pr
hecl::ProjectPath versionPath(pakPath, _SYS_STR("version.yaml"));
versionPath.makeDirChain(false);
URDEVersionInfo info;
MetaforceVersionInfo info;
info.version = m_version;
info.region = m_region;
info.game = m_game;

View File

@ -57,7 +57,7 @@ struct SpecBase : hecl::Database::IDataSpec {
virtual bool extractFromDisc(nod::DiscBase& disc, bool force, const hecl::MultiProgressPrinter& progress) = 0;
/* Convert path to object tag */
virtual urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const = 0;
virtual metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const = 0;
/* Even if PC spec is being cooked, this will return the vanilla GCN spec */
virtual const hecl::Database::DataSpecEntry& getOriginalSpec() const = 0;
@ -121,15 +121,15 @@ struct SpecBase : hecl::Database::IDataSpec {
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
hecl::blender::Token& btok, athena::io::FileWriter& w,
std::vector<urde::SObjectTag>& listOut, atUint64& resTableOffset,
std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) {}
std::vector<metaforce::SObjectTag>& listOut, atUint64& resTableOffset,
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) {}
virtual void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w,
const std::vector<urde::SObjectTag>& list,
const std::vector<std::pair<urde::SObjectTag, std::string>>& nameList,
const std::vector<metaforce::SObjectTag>& list,
const std::vector<std::pair<metaforce::SObjectTag, std::string>>& nameList,
atUint64& resTableOffset) {}
virtual void writePakFileIndex(athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& tags,
virtual void writePakFileIndex(athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& tags,
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) {}
virtual std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const urde::SObjectTag& tag,
virtual std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const metaforce::SObjectTag& tag,
const uint8_t* data, size_t len) {
return {};
}
@ -149,19 +149,19 @@ struct SpecBase : hecl::Database::IDataSpec {
void extractRandomStaticEntropy(const uint8_t* buf, const hecl::ProjectPath& pakPath);
/* Tag cache functions */
urde::SObjectTag tagFromPath(const hecl::ProjectPath& path) const;
hecl::ProjectPath pathFromTag(const urde::SObjectTag& tag) const;
bool waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut);
const urde::SObjectTag* getResourceIdByName(std::string_view name) const;
hecl::FourCC getResourceTypeById(urde::CAssetId id) const;
void enumerateResources(const std::function<bool(const urde::SObjectTag&)>& lambda) const;
void enumerateNamedResources(const std::function<bool(std::string_view, const urde::SObjectTag&)>& lambda) const;
metaforce::SObjectTag tagFromPath(const hecl::ProjectPath& path) const;
hecl::ProjectPath pathFromTag(const metaforce::SObjectTag& tag) const;
bool waitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut);
const metaforce::SObjectTag* getResourceIdByName(std::string_view name) const;
hecl::FourCC getResourceTypeById(metaforce::CAssetId id) const;
void enumerateResources(const std::function<bool(const metaforce::SObjectTag&)>& lambda) const;
void enumerateNamedResources(const std::function<bool(std::string_view, const metaforce::SObjectTag&)>& lambda) const;
void cancelBackgroundIndex();
void beginBackgroundIndex();
bool backgroundIndexRunning() const { return m_backgroundRunning; }
void waitForIndexComplete() const;
virtual void getTagListForFile(const char* pakName, std::vector<urde::SObjectTag>& out) const {}
virtual void getTagListForFile(const char* pakName, std::vector<metaforce::SObjectTag>& out) const {}
SpecBase(const hecl::Database::DataSpecEntry* specEntry, hecl::Database::Project& project, bool pc);
~SpecBase();
@ -171,10 +171,10 @@ protected:
bool m_pc;
hecl::ProjectPath m_masterShader;
std::unordered_multimap<urde::SObjectTag, hecl::ProjectPath> m_tagToPath;
std::unordered_map<hecl::Hash, urde::SObjectTag> m_pathToTag;
std::unordered_map<std::string, urde::SObjectTag> m_catalogNameToTag;
std::unordered_map<urde::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames;
std::unordered_multimap<metaforce::SObjectTag, hecl::ProjectPath> m_tagToPath;
std::unordered_map<hecl::Hash, metaforce::SObjectTag> m_pathToTag;
std::unordered_map<std::string, metaforce::SObjectTag> m_catalogNameToTag;
std::unordered_map<metaforce::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames;
void clearTagCache();
hecl::blender::Token m_backgroundBlender;
@ -183,7 +183,7 @@ protected:
bool m_backgroundRunning = false;
void readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAMLDocWriter& nameWriter);
void insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const urde::SObjectTag& tag, const hecl::ProjectPath& path,
void insertPathTag(athena::io::YAMLDocWriter& cacheWriter, const metaforce::SObjectTag& tag, const hecl::ProjectPath& path,
bool dump = true);
bool addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter);
void backgroundIndexRecursiveProc(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter,
@ -192,13 +192,13 @@ protected:
int level);
void backgroundIndexProc();
void recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut,
std::unordered_set<urde::SObjectTag>& addedTags, const hecl::ProjectPath& path,
void recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
std::unordered_set<metaforce::SObjectTag>& addedTags, const hecl::ProjectPath& path,
hecl::blender::Token& btok);
void copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
const std::vector<urde::SObjectTag>& buildList, const hecl::Database::DataSpecEntry* entry,
const std::vector<metaforce::SObjectTag>& buildList, const hecl::Database::DataSpecEntry* entry,
bool fast, const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut,
const std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData);
const std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData);
std::unique_ptr<nod::DiscBase> m_disc;
bool m_isWii{};

View File

@ -29,7 +29,7 @@
#include "DNACommon/DPSC.hpp"
#include "DNACommon/DGRP.hpp"
#include "DNACommon/MAPU.hpp"
#include "DNACommon/URDEVersionInfo.hpp"
#include "DNACommon/MetaforceVersionInfo.hpp"
#include "DNACommon/Tweaks/TweakWriter.hpp"
#include "DNAMP1/Tweaks/CTweakPlayerRes.hpp"
#include "DNAMP1/Tweaks/CTweakGunRes.hpp"
@ -57,7 +57,7 @@ namespace DataSpec {
using namespace std::literals;
static logvisor::Module Log("urde::SpecMP1");
static logvisor::Module Log("DataSpec::SpecMP1");
extern hecl::Database::DataSpecEntry SpecEntMP1;
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
extern hecl::Database::DataSpecEntry SpecEntMP1ORIG;
@ -322,7 +322,7 @@ struct SpecMP1 : SpecBase {
hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _SYS_STR("out"));
outPath.makeDir();
disc.getDataPartition()->extractSysFiles(outPath.getAbsolutePath(), ctx);
hecl::ProjectPath mp1OutPath(outPath, m_standalone ? _SYS_STR("files") : _SYS_STR("files/MP1"));
hecl::ProjectPath mp1OutPath(outPath, _SYS_STR("files/MP1"));
mp1OutPath.makeDirChain(true);
/* Extract non-pak files */
@ -386,12 +386,7 @@ struct SpecMP1 : SpecBase {
TextureCache::Generate(m_pakRouter, m_project, noAramPath);
/* Write version data */
hecl::ProjectPath versionPath;
if (m_standalone) {
versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files"));
} else {
versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files/MP1"));
}
hecl::ProjectPath versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files/MP1"));
WriteVersionInfo(m_project, versionPath);
return true;
}
@ -482,7 +477,7 @@ struct SpecMP1 : SpecBase {
});
}
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override {
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override {
if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".CSKR")))
return {SBIG('CSKR'), path.parsedHash32()};
else if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _SYS_STR(".ANIM")))
@ -551,7 +546,7 @@ struct SpecMP1 : SpecBase {
athena::io::YAMLDocReader reader;
yaml_parser_set_input_file(reader.getParser(), fp.get());
urde::SObjectTag resTag;
metaforce::SObjectTag resTag;
if (reader.ClassTypeOperation([&](std::string_view className) {
if (className == DNAParticle::GPSM<UniqueID32>::DNAType()) {
resTag.type = SBIG('PART');
@ -643,7 +638,7 @@ struct SpecMP1 : SpecBase {
return {};
}
void getTagListForFile(const char* pakName, std::vector<urde::SObjectTag>& out) const override {
void getTagListForFile(const char* pakName, std::vector<metaforce::SObjectTag>& out) const override {
std::string pathPrefix("MP1/");
pathPrefix += pakName;
pathPrefix += '/';
@ -1001,9 +996,9 @@ struct SpecMP1 : SpecBase {
}
void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
hecl::blender::Token& btok, athena::io::FileWriter& w, std::vector<urde::SObjectTag>& listOut,
hecl::blender::Token& btok, athena::io::FileWriter& w, std::vector<metaforce::SObjectTag>& listOut,
atUint64& resTableOffset,
std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) override {
std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) override {
DNAMP1::MLVL mlvl;
{
athena::io::FileReader r(worldPathCooked.getAbsolutePath());
@ -1025,7 +1020,7 @@ struct SpecMP1 : SpecBase {
}
listOut.reserve(count);
urde::SObjectTag worldTag = tagFromPath(worldPath.getWithExtension(_SYS_STR(".*"), true));
metaforce::SObjectTag worldTag = tagFromPath(worldPath.getWithExtension(_SYS_STR(".*"), true));
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
w.writeUint32Big(0);
@ -1039,19 +1034,19 @@ struct SpecMP1 : SpecBase {
nameEnt.name = parentDir.getLastComponentUTF8();
nameEnt.write(w);
std::unordered_set<urde::CAssetId> addedTags;
std::unordered_set<metaforce::CAssetId> addedTags;
for (auto& area : mlvl.areas) {
urde::SObjectTag areaTag(FOURCC('MREA'), area.areaMREAId.toUint64());
metaforce::SObjectTag areaTag(FOURCC('MREA'), area.areaMREAId.toUint64());
bool dupeRes = false;
if (hecl::ProjectPath areaDir = pathFromTag(areaTag).getParentPath())
dupeRes = hecl::ProjectPath(areaDir, _SYS_STR("!duperes")).isFile();
urde::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint64());
metaforce::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint64());
if (nameTag)
listOut.push_back(nameTag);
for (const auto& dep : area.deps) {
urde::CAssetId newId = dep.id.toUint64();
metaforce::CAssetId newId = dep.id.toUint64();
if (dupeRes || addedTags.find(newId) == addedTags.end()) {
listOut.emplace_back(dep.type, newId);
addedTags.insert(newId);
@ -1086,18 +1081,18 @@ struct SpecMP1 : SpecBase {
area.depLayers = std::move(strippedDepLayers);
}
urde::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint64());
metaforce::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint64());
if (nameTag)
listOut.push_back(nameTag);
urde::SObjectTag savwTag(FOURCC('SAVW'), mlvl.saveWorldId.toUint64());
metaforce::SObjectTag savwTag(FOURCC('SAVW'), mlvl.saveWorldId.toUint64());
if (savwTag) {
if (hecl::ProjectPath savwPath = pathFromTag(savwTag))
m_project.cookPath(savwPath, {}, false, true);
listOut.push_back(savwTag);
}
urde::SObjectTag mapTag(FOURCC('MAPW'), mlvl.worldMap.toUint64());
metaforce::SObjectTag mapTag(FOURCC('MAPW'), mlvl.worldMap.toUint64());
if (mapTag) {
if (hecl::ProjectPath mapPath = pathFromTag(mapTag)) {
m_project.cookPath(mapPath, {}, false, true);
@ -1120,7 +1115,7 @@ struct SpecMP1 : SpecBase {
listOut.push_back(mapTag);
}
urde::SObjectTag skyboxTag(FOURCC('CMDL'), mlvl.worldSkyboxId.toUint64());
metaforce::SObjectTag skyboxTag(FOURCC('CMDL'), mlvl.worldSkyboxId.toUint64());
if (skyboxTag) {
listOut.push_back(skyboxTag);
hecl::ProjectPath skyboxPath = pathFromTag(skyboxTag);
@ -1128,7 +1123,7 @@ struct SpecMP1 : SpecBase {
auto data = btok.getBlenderConnection().beginData();
std::vector<hecl::ProjectPath> textures = data.getTextures();
for (const auto& tex : textures) {
urde::SObjectTag texTag = tagFromPath(tex);
metaforce::SObjectTag texTag = tagFromPath(tex);
if (!texTag)
Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("Unable to resolve {}")), tex.getRelativePath());
listOut.push_back(texTag);
@ -1160,8 +1155,8 @@ struct SpecMP1 : SpecBase {
}
}
void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& list,
const std::vector<std::pair<urde::SObjectTag, std::string>>& nameList,
void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& list,
const std::vector<std::pair<metaforce::SObjectTag, std::string>>& nameList,
atUint64& resTableOffset) override {
w.writeUint32Big(m_pc ? 0x80030005 : 0x00030005);
w.writeUint32Big(0);
@ -1189,13 +1184,13 @@ struct SpecMP1 : SpecBase {
}
}
void writePakFileIndex(athena::io::FileWriter& w, const std::vector<urde::SObjectTag>& tags,
void writePakFileIndex(athena::io::FileWriter& w, const std::vector<metaforce::SObjectTag>& tags,
const std::vector<std::tuple<size_t, size_t, bool>>& index, atUint64 resTableOffset) override {
w.seek(resTableOffset, athena::SeekOrigin::Begin);
auto it = tags.begin();
for (const auto& item : index) {
const urde::SObjectTag& tag = *it++;
const metaforce::SObjectTag& tag = *it++;
DNAMP1::PAK::Entry ent;
ent.compressed = atUint32(std::get<2>(item));
ent.type = tag.type;
@ -1206,7 +1201,7 @@ struct SpecMP1 : SpecBase {
}
}
std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const urde::SObjectTag& tag, const uint8_t* data,
std::pair<std::unique_ptr<uint8_t[]>, size_t> compressPakData(const metaforce::SObjectTag& tag, const uint8_t* data,
size_t len) override {
bool doCompress = false;
switch (tag.type.toUint32()) {

View File

@ -12,7 +12,7 @@
#include "DNACommon/MAPU.hpp"
#include "DNACommon/PATH.hpp"
#include "DNACommon/TXTR.hpp"
#include "DNACommon/URDEVersionInfo.hpp"
#include "DNACommon/MetaforceVersionInfo.hpp"
#include "hecl/ClientProcess.hpp"
#include "hecl/Blender/Connection.hpp"
@ -25,7 +25,7 @@ namespace DataSpec {
using namespace std::literals;
static logvisor::Module Log("urde::SpecMP2");
static logvisor::Module Log("DataSpec::SpecMP2");
extern hecl::Database::DataSpecEntry SpecEntMP2;
extern hecl::Database::DataSpecEntry SpecEntMP2ORIG;
@ -284,7 +284,7 @@ struct SpecMP2 : SpecBase {
hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _SYS_STR("out"));
outPath.makeDir();
disc.getDataPartition()->extractSysFiles(outPath.getAbsolutePath(), ctx);
hecl::ProjectPath mp2OutPath(outPath, m_standalone ? _SYS_STR("files") : _SYS_STR("files/MP2"));
hecl::ProjectPath mp2OutPath(outPath, _SYS_STR("files/MP2"));
mp2OutPath.makeDirChain(true);
progress.startNewLine();
@ -327,12 +327,7 @@ struct SpecMP2 : SpecBase {
TextureCache::Generate(m_pakRouter, m_project, noAramPath);
/* Write version data */
hecl::ProjectPath versionPath;
if (m_standalone) {
versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files"));
} else {
versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files/MP2"));
}
hecl::ProjectPath versionPath = hecl::ProjectPath(m_project.getProjectWorkingPath(), _SYS_STR("out/files/MP2"));
WriteVersionInfo(m_project, versionPath);
return true;
}
@ -361,7 +356,7 @@ struct SpecMP2 : SpecBase {
});
}
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress) override {}

View File

@ -9,7 +9,7 @@
#include "DataSpec/DNAMP3/MAPA.hpp"
#include "DataSpec/DNAMP2/STRG.hpp"
#include "DataSpec/DNACommon/TXTR.hpp"
#include "DataSpec/DNACommon/URDEVersionInfo.hpp"
#include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
#include "hecl/ClientProcess.hpp"
#include "hecl/Blender/Connection.hpp"
@ -22,7 +22,7 @@ namespace DataSpec {
using namespace std::literals;
static logvisor::Module Log("urde::SpecMP3");
static logvisor::Module Log("DataSpec::SpecMP3");
extern hecl::Database::DataSpecEntry SpecEntMP3;
extern hecl::Database::DataSpecEntry SpecEntMP3ORIG;
@ -396,7 +396,7 @@ struct SpecMP3 : SpecBase {
hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _SYS_STR("out"));
outPath.makeDir();
disc.getDataPartition()->extractSysFiles(outPath.getAbsolutePath(), ctx);
m_outPath = {outPath, m_standalone ? _SYS_STR("files") : _SYS_STR("files/MP3")};
m_outPath = {outPath, _SYS_STR("files/MP3")};
m_outPath.makeDirChain(true);
currentTarget = _SYS_STR("MP3 Root");
@ -524,7 +524,7 @@ struct SpecMP3 : SpecBase {
return false;
}
urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
metaforce::SObjectTag buildTagFromPath(const hecl::ProjectPath& path) const override { return {}; }
void cookMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress) override {}

View File

@ -2,17 +2,11 @@ add_subdirectory(locale)
add_subdirectory(icons)
add_subdirectory(badging)
if(URDE_DLPACKAGE)
set(METADATA_VERSION_STRING ${URDE_DLPACKAGE})
else()
set(METADATA_VERSION_STRING "BETA")
endif()
unset(URDE_PLAT_LIBS)
if(WIN32)
configure_file(platforms/win/urde.rc.in "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/urde.rc" @ONLY)
set(PLAT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/urde.rc" platforms/win/urde.manifest)
configure_file(platforms/win/metaforce.rc.in "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/metaforce.rc" @ONLY)
set(PLAT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/metaforce.rc" platforms/win/metaforce.manifest)
if(WINDOWS_STORE)
set(UWP_ASSETS
platforms/win/Assets/LargeTile.scale-100.png
@ -45,11 +39,11 @@ if(WIN32)
platforms/win/Assets/Square150x150Logo.scale-150.png
platforms/win/Assets/Square150x150Logo.scale-200.png
platforms/win/Assets/Square150x150Logo.scale-400.png
platforms/win/Assets/urde.scale-100.png
platforms/win/Assets/urde.scale-125.png
platforms/win/Assets/urde.scale-150.png
platforms/win/Assets/urde.scale-200.png
platforms/win/Assets/urde.scale-400.png
platforms/win/Assets/metaforce.scale-100.png
platforms/win/Assets/metaforce.scale-125.png
platforms/win/Assets/metaforce.scale-150.png
platforms/win/Assets/metaforce.scale-200.png
platforms/win/Assets/metaforce.scale-400.png
platforms/win/Assets/WideTile.scale-100.png
platforms/win/Assets/WideTile.scale-125.png
platforms/win/Assets/WideTile.scale-150.png
@ -61,10 +55,7 @@ if(WIN32)
list(APPEND PLAT_SRCS ${UWP_ASSETS} platforms/win/Package.appxmanifest)
endif()
elseif(APPLE)
set(PLAT_SRCS platforms/mac/mainicon.icns)
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
configure_file(platforms/mac/Info.plist.in "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" @ONLY)
# nothing
elseif(UNIX)
add_subdirectory(platforms/freedesktop)
declare_wmicon_target()
@ -72,7 +63,7 @@ elseif(UNIX)
set(URDE_PLAT_LIBS rt)
endif()
add_executable(urde-old WIN32 MACOSX_BUNDLE
add_executable(metaforce-old WIN32
main.cpp ${PLAT_SRCS}
Space.hpp Space.cpp
SplashScreen.hpp SplashScreen.cpp
@ -85,40 +76,37 @@ add_executable(urde-old WIN32 MACOSX_BUNDLE
Resource.hpp Resource.cpp
Camera.hpp Camera.cpp
GameMode.hpp GameMode.cpp)
target_atdna(urde-old atdna_Space.cpp Space.hpp)
target_atdna(urde-old atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
target_atdna(urde-old atdna_ModelViewer.cpp ModelViewer.hpp)
target_atdna(urde-old atdna_ParticleEditor.cpp ParticleEditor.hpp)
target_atdna(urde-old atdna_InformationCenter.cpp InformationCenter.hpp)
target_atdna(urde-old atdna_GameMode.cpp GameMode.hpp)
target_compile_definitions(urde-old PUBLIC URDE_DLPACKAGE="${URDE_DLPACKAGE}")
target_include_directories(metaforce-old PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/Runtime # FIXME atdna cmake issue
${CMAKE_BINARY_DIR})
target_include_directories(urde-old PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR})
target_link_libraries(urde-old
UrdeIcons
UrdeBadging
target_link_libraries(metaforce-old
MetaforceIcons
MetaforceBadging
RuntimeCommon
amuse
RetroDataSpec
kabufuda
${URDE_PLAT_LIBS})
if(COMMAND add_sanitizers)
add_sanitizers(urde-old)
endif()
set_target_properties(urde-old PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"
MACOSX_BUNDLE_BUNDLE_NAME "urde")
target_atdna(metaforce-old atdna_Space.cpp Space.hpp)
target_atdna(metaforce-old atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
target_atdna(metaforce-old atdna_ModelViewer.cpp ModelViewer.hpp)
target_atdna(metaforce-old atdna_ParticleEditor.cpp ParticleEditor.hpp)
target_atdna(metaforce-old atdna_InformationCenter.cpp InformationCenter.hpp)
target_atdna(metaforce-old atdna_GameMode.cpp GameMode.hpp)
if(COMMAND add_sanitizers)
add_sanitizers(metaforce-old)
endif()
if (NOT WINDOWS_STORE)
if(APPLE)
add_custom_command(TARGET urde-old POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:visigen> $<TARGET_FILE_DIR:urde>)
add_custom_command(TARGET urde-old POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hecl> $<TARGET_FILE_DIR:urde>)
endif()
add_dependencies(urde-old visigen hecl)
add_dependencies(metaforce-old visigen hecl)
else()
set_property(TARGET urde-old PROPERTY VS_WINRT_COMPONENT TRUE)
set_property(TARGET metaforce-old PROPERTY VS_WINRT_COMPONENT TRUE)
# This should match the Package.appxmanifest
set_property(TARGET urde-old PROPERTY VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION "10.0.14393.0")
set_property(TARGET metaforce-old PROPERTY VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION "10.0.14393.0")
endif()

View File

@ -6,7 +6,7 @@
#include "zeus/CVector3f.hpp"
#include "zeus/Math.hpp"
namespace urde {
namespace metaforce {
class Camera {
zeus::CFrustum m_frustum;
zeus::CProjection m_projection;
@ -22,4 +22,4 @@ public:
virtual void think() {}
};
} // namespace urde
} // namespace metaforce

View File

@ -1,6 +1,6 @@
#include "GameMode.hpp"
namespace urde {
namespace metaforce {
void GameMode::think() { ViewerSpace::think(); }
void GameMode::View::draw(boo::IGraphicsCommandQueue* gfxQ) {
@ -8,4 +8,4 @@ void GameMode::View::draw(boo::IGraphicsCommandQueue* gfxQ) {
m_gMode.m_main->Draw();
}
} // namespace urde
} // namespace metaforce

View File

@ -4,7 +4,7 @@
#include "ViewManager.hpp"
#include "Runtime/IMain.hpp"
namespace urde {
namespace metaforce {
class GameMode : public ViewerSpace {
std::shared_ptr<IMain> m_main;
@ -51,4 +51,4 @@ public:
bool usesToolbar() const override { return m_state.showToolbar; }
};
} // namespace urde
} // namespace metaforce

View File

@ -1,3 +1,3 @@
#include "InformationCenter.hpp"
namespace urde {}
namespace metaforce {}

View File

@ -3,7 +3,7 @@
#include "Space.hpp"
#include "ViewManager.hpp"
namespace urde {
namespace metaforce {
class InformationCenter : public ViewerSpace {
struct State : Space::State {
AT_DECL_DNA_YAMLV
@ -47,4 +47,4 @@ public:
bool usesToolbar() const override { return true; }
};
} // namespace urde
} // namespace metaforce

View File

@ -1,10 +1,10 @@
#include "ModelViewer.hpp"
namespace urde {
namespace metaforce {
void ModelViewer::View::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
specter::View::resized(root, sub);
m_scissorRect = sub;
}
} // namespace urde
} // namespace metaforce

View File

@ -4,7 +4,7 @@
#include "ViewManager.hpp"
#include "Camera.hpp"
namespace urde {
namespace metaforce {
class ModelViewer : public ViewerSpace {
struct State : Space::State {
AT_DECL_DNA_YAMLV
@ -17,7 +17,7 @@ class ModelViewer : public ViewerSpace {
} m_state;
const Space::State& spaceState() const override { return m_state; }
std::unique_ptr<urde::CLineRenderer> m_lineRenderer;
std::unique_ptr<metaforce::CLineRenderer> m_lineRenderer;
struct View : specter::View {
ModelViewer& m_mv;
boo::SWindowRect m_scissorRect;
@ -33,7 +33,7 @@ class ModelViewer : public ViewerSpace {
public:
ModelViewer(ViewManager& vm, Space* parent) : ViewerSpace(vm, Class::ModelViewer, parent) {
reloadState();
m_lineRenderer.reset(new urde::CLineRenderer(urde::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true));
m_lineRenderer.reset(new metaforce::CLineRenderer(metaforce::CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true));
}
ModelViewer(ViewManager& vm, Space* parent, const ModelViewer& other) : ModelViewer(vm, parent) {
@ -61,4 +61,4 @@ public:
bool usesToolbar() const override { return true; }
};
} // namespace urde
} // namespace metaforce

View File

@ -1,3 +1,3 @@
#include "ParticleEditor.hpp"
namespace urde {}
namespace metaforce {}

View File

@ -2,7 +2,7 @@
#include "Space.hpp"
namespace urde {
namespace metaforce {
class EffectEditor : public EditorSpace {
struct State : Space::State {
@ -29,4 +29,4 @@ public:
bool usesToolbar() const override { return true; }
};
} // namespace urde
} // namespace metaforce

View File

@ -2,8 +2,9 @@
#include "ViewManager.hpp"
#include "DataSpecRegistry.hpp"
#include "hecl/Blender/Connection.hpp"
#include "version.h"
namespace urde {
namespace metaforce {
static logvisor::Module Log("URDE::ProjectManager");
ProjectManager* ProjectManager::g_SharedManager = nullptr;
@ -63,8 +64,8 @@ bool ProjectManager::newProject(hecl::SystemStringView path) {
m_vm.SetupEditorView();
saveProject();
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - URDE [{}]")),
m_proj->getProjectRootPath().getLastComponent(), m_vm.platformName()));
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - Metaforce {} [{}]")),
m_proj->getProjectRootPath().getLastComponent(), METAFORCE_WC_DESCRIBE_SYS, m_vm.platformName()));
m_vm.DismissSplash();
m_vm.FadeInEditors();
@ -72,6 +73,7 @@ bool ProjectManager::newProject(hecl::SystemStringView path) {
}
bool ProjectManager::openProject(hecl::SystemStringView path) {
OPTICK_EVENT();
hecl::SystemString subPath;
hecl::ProjectRootPath projPath = hecl::SearchForProject(path, subPath);
if (!projPath) {
@ -103,16 +105,17 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
if (needsSave)
saveProject();
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - URDE [{}]")),
m_proj->getProjectRootPath().getLastComponent(), m_vm.platformName()));
m_vm.m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("{} - Metaforce {} [{}]")),
m_proj->getProjectRootPath().getLastComponent(), METAFORCE_WC_DESCRIBE_SYS,
m_vm.platformName()));
m_vm.DismissSplash();
m_vm.FadeInEditors();
m_vm.pushRecentProject(m_proj->getProjectRootPath().getAbsolutePath());
return true;
};
const hecl::ProjectPath urdeSpacesPath(*m_proj, _SYS_STR(".hecl/urde_spaces.yaml"));
athena::io::FileReader reader(urdeSpacesPath.getAbsolutePath());
const hecl::ProjectPath metaforceSpacesPath(*m_proj, _SYS_STR(".hecl/metaforce_spaces.yaml"));
athena::io::FileReader reader(metaforceSpacesPath.getAbsolutePath());
if (!reader.isOpen()) {
return makeProj(true);
@ -124,7 +127,7 @@ bool ProjectManager::openProject(hecl::SystemStringView path) {
};
yaml_parser_set_input(r.getParser(), readHandler, &reader);
if (!r.ValidateClassType("UrdeSpacesState")) {
if (!r.ValidateClassType("MetaforceSpacesState")) {
return makeProj(true);
}
@ -143,7 +146,7 @@ bool ProjectManager::saveProject() {
if (!m_proj)
return false;
hecl::ProjectPath oldSpacesPath(*m_proj, _SYS_STR(".hecl/~urde_spaces.yaml"));
hecl::ProjectPath oldSpacesPath(*m_proj, _SYS_STR(".hecl/~metaforce_spaces.yaml"));
athena::io::FileWriter writer(oldSpacesPath.getAbsolutePath());
if (!writer.isOpen())
return false;
@ -153,7 +156,7 @@ bool ProjectManager::saveProject() {
if (!w.finish(&writer))
return false;
hecl::ProjectPath newSpacesPath(*m_proj, _SYS_STR(".hecl/urde_spaces.yaml"));
hecl::ProjectPath newSpacesPath(*m_proj, _SYS_STR(".hecl/metaforce_spaces.yaml"));
hecl::Unlink(newSpacesPath.getAbsolutePath().data());
hecl::Rename(oldSpacesPath.getAbsolutePath().data(), newSpacesPath.getAbsolutePath().data());
@ -164,6 +167,7 @@ bool ProjectManager::saveProject() {
}
void ProjectManager::mainUpdate() {
OPTICK_EVENT();
if (m_precooking) {
if (!m_factoryMP1.IsBusy())
m_precooking = false;
@ -195,4 +199,4 @@ void ProjectManager::shutdown() {
hecl::blender::Connection::Shutdown();
}
} // namespace urde
} // namespace metaforce

View File

@ -7,7 +7,7 @@
#include "hecl/Runtime.hpp"
#include "MP1/MP1.hpp"
namespace urde {
namespace metaforce {
class ViewManager;
using ConfigReader = athena::io::YAMLDocReader;
@ -55,4 +55,4 @@ public:
void shutdown();
};
} // namespace urde
} // namespace metaforce

View File

@ -7,8 +7,8 @@
#undef min
#undef max
namespace urde {
static logvisor::Module Log("urde::ProjectResourceFactoryBase");
namespace metaforce {
static logvisor::Module Log("metaforce::ProjectResourceFactoryBase");
void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& proj,
const hecl::Database::DataSpecEntry& origSpec,
@ -47,7 +47,7 @@ CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, co
return ret;
}
void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& tag, const hecl::ProjectPath& path) {
void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const metaforce::SObjectTag& tag, const hecl::ProjectPath& path) {
if (!m_workingPath) {
m_workingPath = path;
@ -64,7 +64,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
m_cookedPath = path.getCookedPath(*m_parent.m_origSpec);
if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) {
/* Last chance type validation */
urde::SObjectTag verifyTag = m_parent.TagFromPath(path);
metaforce::SObjectTag verifyTag = m_parent.TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type);
@ -181,7 +181,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
cooked = path.getCookedPath(*m_origSpec);
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
/* Last chance type validation */
urde::SObjectTag verifyTag = TagFromPath(path);
metaforce::SObjectTag verifyTag = TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type);
@ -211,8 +211,8 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
return true;
}
std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjectTag& tag,
const urde::CVParamTransfer& paramXfer,
std::unique_ptr<metaforce::IObj> ProjectResourceFactoryBase::Build(const metaforce::SObjectTag& tag,
const metaforce::CVParamTransfer& paramXfer,
CObjectReference* selfRef) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
@ -261,17 +261,17 @@ std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjec
return BuildSync(tag, *resPath, paramXfer, selfRef);
}
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const urde::SObjectTag& tag,
const urde::CVParamTransfer& paramXfer,
std::unique_ptr<urde::IObj>* objOut,
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const metaforce::SObjectTag& tag,
const metaforce::CVParamTransfer& paramXfer,
std::unique_ptr<metaforce::IObj>* objOut,
CObjectReference* selfRef) {
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return _AddTask(std::make_unique<AsyncTask>(*this, tag, objOut, paramXfer, selfRef));
}
void ProjectResourceFactoryBase::BuildAsync(const urde::SObjectTag& tag, const urde::CVParamTransfer& paramXfer,
std::unique_ptr<urde::IObj>* objOut, CObjectReference* selfRef) {
void ProjectResourceFactoryBase::BuildAsync(const metaforce::SObjectTag& tag, const metaforce::CVParamTransfer& paramXfer,
std::unique_ptr<metaforce::IObj>* objOut, CObjectReference* selfRef) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type);
@ -295,27 +295,27 @@ u32 ProjectResourceFactoryBase::ResourceSize(const SObjectTag& tag) {
return fr->length();
}
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync(const urde::SObjectTag& tag,
std::shared_ptr<metaforce::IDvdRequest> ProjectResourceFactoryBase::LoadResourceAsync(const metaforce::SObjectTag& tag,
void* target) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return std::static_pointer_cast<urde::IDvdRequest>(
return std::static_pointer_cast<metaforce::IDvdRequest>(
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target))));
}
std::shared_ptr<urde::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartAsync(const urde::SObjectTag& tag,
std::shared_ptr<metaforce::IDvdRequest> ProjectResourceFactoryBase::LoadResourcePartAsync(const metaforce::SObjectTag& tag,
u32 off, u32 size, void* target) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {};
return std::static_pointer_cast<urde::IDvdRequest>(
return std::static_pointer_cast<metaforce::IDvdRequest>(
_AddTask(std::make_shared<AsyncTask>(*this, tag, reinterpret_cast<u8*>(target), size, off)));
}
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::SObjectTag& tag) {
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const metaforce::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
@ -332,7 +332,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadResourceSync(const urde::S
return fr->readUBytes(fr->length());
}
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off,
std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const metaforce::SObjectTag& tag, u32 off,
u32 size) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
@ -352,7 +352,7 @@ std::unique_ptr<u8[]> ProjectResourceFactoryBase::LoadNewResourcePartSync(const
return fr->readUBytes(sz);
}
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const urde::SObjectTag& tag) {
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const metaforce::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
@ -360,9 +360,9 @@ std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::CookResourceAsync(const u
return _AddTask(std::make_shared<AsyncTask>(*this, tag));
}
void ProjectResourceFactoryBase::CancelBuild(const urde::SObjectTag& tag) { _RemoveTask(tag); }
void ProjectResourceFactoryBase::CancelBuild(const metaforce::SObjectTag& tag) { _RemoveTask(tag); }
bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
bool ProjectResourceFactoryBase::CanBuild(const metaforce::SObjectTag& tag) {
if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
@ -376,7 +376,7 @@ bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
return false;
}
const urde::SObjectTag* ProjectResourceFactoryBase::GetResourceIdByName(std::string_view name) const {
const metaforce::SObjectTag* ProjectResourceFactoryBase::GetResourceIdByName(std::string_view name) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getResourceIdByName(name);
}
@ -464,4 +464,4 @@ void ProjectResourceFactoryBase::AsyncIdle() {
}
}
} // namespace urde
} // namespace metaforce

View File

@ -16,14 +16,14 @@
#include <hecl/ClientProcess.hpp>
#include <hecl/Database.hpp>
namespace urde {
namespace metaforce {
class ProjectResourceFactoryBase : public IFactory {
friend class ProjectResourcePool;
hecl::ClientProcess& m_clientProc;
public:
struct AsyncTask : urde::IDvdRequest {
struct AsyncTask : metaforce::IDvdRequest {
ProjectResourceFactoryBase& m_parent;
SObjectTag x0_tag;
@ -63,7 +63,7 @@ public:
/* Cook only */
AsyncTask(ProjectResourceFactoryBase& parent, const SObjectTag& tag) : m_parent(parent), x0_tag(tag) {}
void EnsurePath(const urde::SObjectTag& tag, const hecl::ProjectPath& path);
void EnsurePath(const metaforce::SObjectTag& tag, const hecl::ProjectPath& path);
void CookComplete();
bool AsyncPump();
void WaitUntilComplete() override;
@ -78,7 +78,7 @@ protected:
const hecl::Database::DataSpecEntry* m_pcSpec = nullptr;
/* Used to resolve cooked paths */
std::unique_ptr<hecl::Database::IDataSpec> m_cookSpec;
urde::CFactoryMgr m_factoryMgr;
metaforce::CFactoryMgr m_factoryMgr;
std::list<std::shared_ptr<AsyncTask>> m_asyncLoadList;
std::unordered_map<SObjectTag, std::list<std::shared_ptr<AsyncTask>>::iterator> m_asyncLoadMap;
@ -98,7 +98,7 @@ protected:
bool PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
std::optional<athena::io::FileReader>& fr);
bool WaitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
bool WaitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);
}
SObjectTag TagFromPath(const hecl::ProjectPath& path) const {
@ -120,18 +120,18 @@ protected:
bool SyncCook(const hecl::ProjectPath& working);
CFactoryFnReturn BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path, const CVParamTransfer& paramXfer,
CObjectReference* selfRef);
std::shared_ptr<AsyncTask> BuildAsyncInternal(const urde::SObjectTag&, const urde::CVParamTransfer&,
std::unique_ptr<urde::IObj>*, CObjectReference* selfRef);
std::shared_ptr<AsyncTask> BuildAsyncInternal(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&,
std::unique_ptr<metaforce::IObj>*, CObjectReference* selfRef);
public:
ProjectResourceFactoryBase(hecl::ClientProcess& clientProc) : m_clientProc(clientProc) {}
std::unique_ptr<urde::IObj> Build(const urde::SObjectTag&, const urde::CVParamTransfer&,
std::unique_ptr<metaforce::IObj> Build(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&,
CObjectReference* selfRef) override;
void BuildAsync(const urde::SObjectTag&, const urde::CVParamTransfer&, std::unique_ptr<urde::IObj>*,
void BuildAsync(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&, std::unique_ptr<metaforce::IObj>*,
CObjectReference* selfRef) override;
void CancelBuild(const urde::SObjectTag&) override;
bool CanBuild(const urde::SObjectTag&) override;
const urde::SObjectTag* GetResourceIdByName(std::string_view) const override;
void CancelBuild(const metaforce::SObjectTag&) override;
bool CanBuild(const metaforce::SObjectTag&) override;
const metaforce::SObjectTag* GetResourceIdByName(std::string_view) const override;
FourCC GetResourceTypeById(CAssetId id) const override;
hecl::ProjectPath GetCookedPath(const hecl::ProjectPath& working, bool pcTarget) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getCookedPath(working, pcTarget);
@ -141,13 +141,13 @@ public:
void EnumerateNamedResources(const std::function<bool(std::string_view, const SObjectTag&)>& lambda) const override;
u32 ResourceSize(const SObjectTag& tag) override;
std::shared_ptr<urde::IDvdRequest> LoadResourceAsync(const urde::SObjectTag& tag, void* target) override;
std::shared_ptr<urde::IDvdRequest> LoadResourcePartAsync(const urde::SObjectTag& tag, u32 off, u32 size,
std::shared_ptr<metaforce::IDvdRequest> LoadResourceAsync(const metaforce::SObjectTag& tag, void* target) override;
std::shared_ptr<metaforce::IDvdRequest> LoadResourcePartAsync(const metaforce::SObjectTag& tag, u32 off, u32 size,
void* target) override;
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag) override;
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size) override;
std::unique_ptr<u8[]> LoadResourceSync(const metaforce::SObjectTag& tag) override;
std::unique_ptr<u8[]> LoadNewResourcePartSync(const metaforce::SObjectTag& tag, u32 off, u32 size) override;
std::shared_ptr<AsyncTask> CookResourceAsync(const urde::SObjectTag& tag);
std::shared_ptr<AsyncTask> CookResourceAsync(const metaforce::SObjectTag& tag);
template <typename ItType>
bool AsyncPumpTask(ItType& it);
@ -160,4 +160,4 @@ public:
~ProjectResourceFactoryBase() override { Shutdown(); }
};
} // namespace urde
} // namespace metaforce

View File

@ -43,7 +43,7 @@ extern hecl::Database::DataSpecEntry SpecEntMP1;
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
} // namespace DataSpec
namespace urde {
namespace metaforce {
ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& clientProc)
: ProjectResourceFactoryBase(clientProc) {
@ -81,4 +81,4 @@ void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj,
BeginBackgroundIndex(proj, DataSpec::SpecEntMP1, DataSpec::SpecEntMP1PC);
}
} // namespace urde
} // namespace metaforce

View File

@ -3,7 +3,7 @@
#include "Editor/ProjectResourceFactoryBase.hpp"
#include "Runtime/CToken.hpp"
namespace urde {
namespace metaforce {
class MP1OriginalIDs;
class CSimplePool;
@ -13,4 +13,4 @@ public:
void IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp);
};
} // namespace urde
} // namespace metaforce

View File

@ -1,6 +1,6 @@
#include "Resource.hpp"
namespace urde {
namespace metaforce {
Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) {
athena::io::FileReader r(path.getAbsolutePath(), 32 * 1024, false);
@ -9,4 +9,4 @@ Space::Class Resource::DeduceDefaultSpaceClass(const hecl::ProjectPath& path) {
return Space::Class::None;
}
} // namespace urde
} // namespace metaforce

View File

@ -3,7 +3,7 @@
#include "hecl/Database.hpp"
#include "Space.hpp"
namespace urde {
namespace metaforce {
/** Combines a ProjectPath with actively used Space references
*
@ -43,4 +43,4 @@ private:
std::unique_ptr<Node> m_rootNode;
};
} // namespace urde
} // namespace metaforce

View File

@ -1,6 +1,6 @@
#include "ResourceBrowser.hpp"
namespace urde {
namespace metaforce {
#define BROWSER_MARGIN 8
bool ResourceBrowser::navigateToPath(const hecl::ProjectPath& pathIn) {
@ -67,4 +67,4 @@ void ResourceBrowser::View::resized(const boo::SWindowRect& root, const boo::SWi
}
void ResourceBrowser::View::draw(boo::IGraphicsCommandQueue* gfxQ) { m_resListing.m_view->draw(gfxQ); }
} // namespace urde
} // namespace metaforce

View File

@ -5,7 +5,7 @@
#include "specter/PathButtons.hpp"
#include "specter/Table.hpp"
namespace urde {
namespace metaforce {
class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
struct State : Space::State {
@ -202,4 +202,4 @@ public:
unsigned toolbarUnits() const override { return 2; }
};
} // namespace urde
} // namespace metaforce

View File

@ -8,7 +8,7 @@
#include "icons/icons.hpp"
#include "specter/Menu.hpp"
namespace urde {
namespace metaforce {
static logvisor::Module Log("URDE::Space");
Space::Space(ViewManager& vm, Class cls, Space* parent)
@ -259,4 +259,4 @@ void Space::SpaceMenuNode::SubNode::activated(const boo::SWindowCoord& coord) {
}
}
} // namespace urde
} // namespace metaforce

View File

@ -16,7 +16,7 @@ class ViewResources;
class Toolbar;
struct Icon;
} // namespace specter
namespace urde {
namespace metaforce {
class ViewManager;
class RootSpace;
class SplitSpace;
@ -172,6 +172,7 @@ public:
}
void think() override {
OPTICK_EVENT();
if (m_spaceTree)
m_spaceTree->think();
}
@ -374,4 +375,4 @@ public:
}
};
} // namespace urde
} // namespace metaforce

View File

@ -2,7 +2,7 @@
#include "version.h"
#include "badging/Badging.hpp"
namespace urde {
namespace metaforce {
#define SPLASH_WIDTH 555
#define SPLASH_HEIGHT 300
@ -33,19 +33,13 @@ SplashScreen::SplashScreen(ViewManager& vm, specter::ViewResources& res)
, m_newProjBind(*this)
, m_openProjBind(*this)
, m_extractProjBind(*this) {
if (GIT_COMMIT_DATE[0] != '\0' && GIT_COMMIT_HASH[0] != '\0' && GIT_BRANCH[0] != '\0') {
#ifdef URDE_DLPACKAGE
if ((URDE_DLPACKAGE)[0])
m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::release>(),
URDE_DLPACKAGE, vm.translate<locale::commit>(), GIT_COMMIT_HASH,
vm.translate<locale::date>(), GIT_COMMIT_DATE);
else
#endif
m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"), vm.translate<locale::branch>(), GIT_BRANCH,
vm.translate<locale::commit>(), GIT_COMMIT_HASH,
vm.translate<locale::date>(), GIT_COMMIT_DATE);
if (METAFORCE_WC_DATE[0] != '\0' && METAFORCE_WC_REVISION[0] != '\0' && METAFORCE_WC_BRANCH[0] != '\0') {
m_buildInfoStr = fmt::format(FMT_STRING("{}: {}\n{}: {}\n{}: {}"),
vm.translate<locale::version>(), METAFORCE_WC_DESCRIBE,
vm.translate<locale::branch>(), METAFORCE_WC_BRANCH,
vm.translate<locale::commit>(), METAFORCE_WC_REVISION/*,
vm.translate<locale::date>(), METAFORCE_WC_DATE*/);
}
m_openProjBind.m_openRecentMenuRoot.m_text = vm.translate<locale::recent_projects>();
m_textColorClear[3] = 0.0;
}
@ -56,6 +50,7 @@ void SplashScreen::think() {
m_fileBrowser.m_view.reset();
return;
}
OPTICK_EVENT();
ModalWindow::think();
if (m_fileBrowser.m_view)
@ -274,4 +269,4 @@ void SplashScreen::draw(boo::IGraphicsCommandQueue* gfxQ) {
m_fileBrowser.m_view->draw(gfxQ);
}
} // namespace urde
} // namespace metaforce

View File

@ -9,7 +9,7 @@
#include "ViewManager.hpp"
namespace urde {
namespace metaforce {
static logvisor::Module Log("specter::SplashScreen");
class SplashScreen : public specter::ModalWindow {
@ -161,4 +161,4 @@ public:
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
};
} // namespace urde
} // namespace metaforce

View File

@ -16,13 +16,15 @@
#include "Runtime/CStateManager.hpp"
#include "Runtime/World/CPlayer.hpp"
#include "hecl/Pipeline.hpp"
#include "version.h"
#include <cstdio>
#include "optick.h"
using YAMLNode = athena::io::YAMLNode;
extern hecl::SystemString ExeDir;
namespace urde {
namespace metaforce {
void ViewManager::InitMP1(MP1::CMain& main) {
main.Init(m_fileStoreManager, &m_cvarManager, m_mainWindow.get(), m_voiceEngine.get(), *m_amuseAllocWrapper);
@ -38,7 +40,7 @@ void ViewManager::InitMP1(MP1::CMain& main) {
void ViewManager::TestGameView::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) {
specter::View::resized(root, sub);
urde::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]});
metaforce::CGraphics::SetViewportResolution({sub.size[0], sub.size[1]});
if (m_debugText) {
boo::SWindowRect newSub = sub;
newSub.location[1] = 5 * m_vm.m_viewResources.pixelFactor();
@ -53,6 +55,7 @@ void ViewManager::TestGameView::draw(boo::IGraphicsCommandQueue* gfxQ) {
}
void ViewManager::TestGameView::think() {
OPTICK_EVENT();
if (!m_debugText) {
m_debugText.reset(new specter::MultiLineTextView(m_vm.m_viewResources, *this, m_vm.m_viewResources.m_monoFont18));
boo::SWindowRect sub = subRect();
@ -63,10 +66,13 @@ void ViewManager::TestGameView::think() {
if (m_debugText) {
std::string overlayText;
if (g_StateManager) {
if (m_cvarCommons.m_debugOverlayShowFrameCounter->toBoolean())
if (m_vm.m_cvarCommons.m_debugOverlayShowFrameCounter->toBoolean())
overlayText += fmt::format(FMT_STRING("Frame: {}\n"), g_StateManager->GetUpdateFrameIndex());
if (m_cvarCommons.m_debugOverlayShowInGameTime->toBoolean()) {
if (m_vm.m_cvarCommons.m_debugOverlayShowFramerate->toBoolean())
overlayText += fmt::format(FMT_STRING("FPS: {}\n"), metaforce::CGraphics::GetFPS());
if (m_vm.m_cvarCommons.m_debugOverlayShowInGameTime->toBoolean()) {
double igt = g_GameState->GetTotalPlayTime();
u32 ms = u64(igt * 1000) % 1000;
auto pt = std::div(igt, 3600);
@ -74,7 +80,21 @@ void ViewManager::TestGameView::think() {
fmt::format(FMT_STRING("PlayTime: {:02d}:{:02d}:{:02d}.{:03d}\n"), pt.quot, pt.rem / 60, pt.rem % 60, ms);
}
if (g_StateManager->Player() && m_cvarCommons.m_debugOverlayPlayerInfo->toBoolean()) {
if (g_StateManager->GetCurrentArea() != nullptr && m_vm.m_cvarCommons.m_debugOverlayShowRoomTimer->toBoolean()) {
double igt = g_GameState->GetTotalPlayTime();
if (m_currentRoom != g_StateManager->GetCurrentArea()) {
m_currentRoom = static_cast<const void*>(g_StateManager->GetCurrentArea());
m_lastRoomTime = igt - m_currentRoomStart;
m_currentRoomStart = igt;
}
double currentRoomTime = igt - m_currentRoomStart;
u32 curFrames = std::round(u32(currentRoomTime * 60));
u32 lastFrames = std::round(u32(m_lastRoomTime * 60));
overlayText += fmt::format(FMT_STRING("Room Time:{:8.3f}/{:6d}| Last Room:{:8.3f}/{:6d}\n"), currentRoomTime,
curFrames, m_lastRoomTime, lastFrames);
}
if (g_StateManager->Player() && m_vm.m_cvarCommons.m_debugOverlayPlayerInfo->toBoolean()) {
const CPlayer& pl = g_StateManager->GetPlayer();
const zeus::CQuaternion plQ = zeus::CQuaternion(pl.GetTransform().getRotation().buildMatrix3f());
const zeus::CTransform camXf = g_StateManager->GetCameraManager()->GetCurrentCameraTransform(*g_StateManager);
@ -92,16 +112,16 @@ void ViewManager::TestGameView::think() {
camXf.origin.y(), camXf.origin.z(), zeus::radToDeg(camQ.roll()),
zeus::radToDeg(camQ.pitch()), zeus::radToDeg(camQ.yaw()));
}
if (m_cvarCommons.m_debugOverlayWorldInfo->toBoolean()) {
if (m_vm.m_cvarCommons.m_debugOverlayWorldInfo->toBoolean()) {
TLockedToken<CStringTable> tbl =
g_SimplePool->GetObj({FOURCC('STRG'), g_StateManager->GetWorld()->IGetStringTableAssetId()});
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
const metaforce::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
overlayText += fmt::format(FMT_STRING("World: 0x{}{}, Area: {}\n"), g_GameState->CurrentWorldAssetId(),
(tbl.IsLoaded() ? (" " + hecl::Char16ToUTF8(tbl->GetString(0))).c_str() : ""), aId);
}
const urde::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
if (m_cvarCommons.m_debugOverlayAreaInfo->toBoolean() && g_StateManager->GetWorld() &&
const metaforce::TAreaId aId = g_GameState->CurrentWorldState().GetCurrentAreaId();
if (m_vm.m_cvarCommons.m_debugOverlayAreaInfo->toBoolean() && g_StateManager->GetWorld() &&
g_StateManager->GetWorld()->DoesAreaExist(aId)) {
const auto& layerStates = g_GameState->CurrentWorldState().GetLayerState();
std::string layerBits;
@ -120,11 +140,11 @@ void ViewManager::TestGameView::think() {
}
}
if (m_cvarCommons.m_debugOverlayShowRandomStats->toBoolean()) {
overlayText += fmt::format(FMT_STRING("CRandom16::Next calls: {}\n"), urde::CRandom16::GetNumNextCalls());
if (m_vm.m_cvarCommons.m_debugOverlayShowRandomStats->toBoolean()) {
overlayText += fmt::format(FMT_STRING("CRandom16::Next calls: {}\n"), metaforce::CRandom16::GetNumNextCalls());
}
if (m_cvarCommons.m_debugOverlayShowResourceStats->toBoolean())
if (m_vm.m_cvarCommons.m_debugOverlayShowResourceStats->toBoolean())
overlayText += fmt::format(FMT_STRING("Resource Objects: {}\n"), g_SimplePool->GetLiveObjects());
if (!overlayText.empty())
@ -200,6 +220,7 @@ void ViewManager::DismissSplash() {
ViewManager::ViewManager(hecl::Runtime::FileStoreManager& fileMgr, hecl::CVarManager& cvarMgr)
: m_fileStoreManager(fileMgr)
, m_cvarManager(cvarMgr)
, m_cvarCommons(cvarMgr)
, m_projManager(*this)
, m_fontCache(fileMgr)
, m_locale(locale::SystemLocaleOrEnglish())
@ -274,6 +295,9 @@ void ViewManager::init(boo::IApplication* app) {
m_mainWindow = app->newWindow(_SYS_STR("URDE"));
m_mainWindow->showWindow();
m_mainWindow->setWaitCursor(true);
if (m_cvarCommons.getFullscreen()) {
m_mainWindow->setFullscreen(true);
}
float pixelFactor = m_mainWindow->getVirtualPixelFactor();
@ -281,7 +305,8 @@ void ViewManager::init(boo::IApplication* app) {
m_pipelineConv = hecl::NewPipelineConverter(m_mainBooFactory);
hecl::conv = m_pipelineConv.get();
m_mainPlatformName = m_mainBooFactory->platformName();
m_mainWindow->setTitle(fmt::format(FMT_STRING(_SYS_STR("URDE [{}]")), m_mainPlatformName));
m_mainWindow->setTitle(
fmt::format(FMT_STRING(_SYS_STR("Metaforce {} [{}]")), METAFORCE_WC_DESCRIBE_SYS, m_mainPlatformName));
m_mainCommandQueue = m_mainWindow->getCommandQueue();
m_viewResources.init(m_mainBooFactory, &m_fontCache, &m_themeData, pixelFactor);
InitializeIcons(m_viewResources);
@ -298,8 +323,13 @@ void ViewManager::init(boo::IApplication* app) {
m_amuseAllocWrapper.emplace(*m_voiceEngine);
for (const auto& arg : app->getArgs()) {
hecl::Sstat theStat;
if (!hecl::Stat((arg + _SYS_STR("/out")).c_str(), &theStat) && S_ISDIR(theStat.st_mode)) {
hecl::ProjectRootPath rootPath(arg);
hecl::Database::Project tmp(rootPath); // Force project creation
}
if (m_deferedProject.empty() && hecl::SearchForProject(arg))
m_deferedProject = arg;
m_deferedProject = arg + _SYS_STR("/out");
if (arg == _SYS_STR("--no-shader-warmup"))
m_noShaderWarmup = true;
else if (arg == _SYS_STR("--no-sound"))
@ -328,6 +358,7 @@ bool ViewManager::proc() {
return false;
if (m_updatePf) {
OPTICK_EVENT("m_updatePf");
m_viewResources.resetPixelFactor(m_reqPf);
specter::RootView* root = SetupRootView();
if (m_rootSpace)
@ -340,8 +371,14 @@ bool ViewManager::proc() {
m_updatePf = false;
}
{
OPTICK_EVENT("m_rootView->DispatchEvents");
m_rootView->dispatchEvents();
}
{
OPTICK_EVENT("m_rootView->internalThink");
m_rootView->internalThink();
}
if (m_rootSpace)
m_rootSpace->think();
if (m_splash)
@ -363,19 +400,24 @@ bool ViewManager::proc() {
if (m_testGameView)
m_testGameView->think();
{
OPTICK_EVENT("Draw");
if (g_Renderer)
g_Renderer->BeginScene();
m_rootView->draw(gfxQ);
if (g_Renderer)
g_Renderer->EndScene();
gfxQ->execute();
}
if (g_ResFactory)
g_ResFactory->AsyncIdle();
#ifndef URDE_MSAN
m_voiceEngine->pumpAndMixVoices();
#endif
if (!m_skipWait || !hecl::com_developer->toBoolean())
if (!m_skipWait || !hecl::com_developer->toBoolean()) {
OPTICK_EVENT("waitForRetrace");
m_mainWindow->waitForRetrace();
}
CBooModel::ClearModelUniformCounters();
CGraphics::TickRenderTimings();
++logvisor::FrameIndex;
@ -392,4 +434,4 @@ void ViewManager::stop() {
m_fontCache.destroyAtlases();
}
} // namespace urde
} // namespace metaforce

View File

@ -26,7 +26,7 @@ namespace hecl {
class PipelineConverterBase;
}
namespace urde {
namespace metaforce {
class SplashScreen;
class ViewManager final : public specter::IViewManager {
@ -38,6 +38,7 @@ class ViewManager final : public specter::IViewManager {
std::shared_ptr<boo::IWindow> m_mainWindow;
hecl::Runtime::FileStoreManager& m_fileStoreManager;
hecl::CVarManager& m_cvarManager;
hecl::CVarCommons m_cvarCommons;
ProjectManager m_projManager;
specter::FontCache m_fontCache;
specter::DefaultThemeData m_themeData;
@ -58,11 +59,13 @@ class ViewManager final : public specter::IViewManager {
class TestGameView : public specter::View {
ViewManager& m_vm;
std::unique_ptr<specter::MultiLineTextView> m_debugText;
hecl::CVarCommons m_cvarCommons;
const void* m_currentRoom = nullptr;
double m_lastRoomTime = 0.f;
double m_currentRoomStart = 0.f;
public:
TestGameView(ViewManager& vm, specter::ViewResources& res, specter::View& parent, hecl::CVarManager& cvarMgr)
: View(res, parent), m_vm(vm), m_cvarCommons(cvarMgr) {}
: View(res, parent), m_vm(vm) {}
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void think() override;
@ -193,4 +196,4 @@ public:
void deferOpenProject(const hecl::SystemString& path) { m_deferedProject = path; }
};
} // namespace urde
} // namespace metaforce

View File

@ -7,7 +7,7 @@
extern "C" uint8_t URDE_BADGE[];
extern "C" size_t URDE_BADGE_SZ;
namespace urde {
namespace metaforce {
static logvisor::Module Log("URDE::badging");
static specter::Icon g_BadgeIcon;
@ -42,4 +42,4 @@ void DestroyBadging() { g_BadgeIcon.m_tex.reset(); }
specter::Icon& GetBadge() { return g_BadgeIcon; }
} // namespace urde
} // namespace metaforce

View File

@ -2,12 +2,12 @@
#include "specter/ViewResources.hpp"
namespace urde {
namespace metaforce {
void InitializeBadging(specter::ViewResources& viewRes);
void DestroyBadging();
specter::Icon& GetBadge();
} // namespace urde
} // namespace metaforce
#ifndef BADGE_PHRASE
#define BADGE_PHRASE "Prototype"

View File

@ -13,22 +13,22 @@ target_include_directories(packbadge PRIVATE ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_D
##################
# Add all targets to the build-tree export set
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeTargets.cmake")
export(TARGETS packbadge FILE "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE urde-packbadge)
export(PACKAGE metaforce-packbadge)
# Create the atdnaConfig.cmake
# ... for the build tree
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfig.cmake" @ONLY)
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfig.cmake" @ONLY)
# ... for the install tree
configure_file(urde-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/urde-packbadgeConfig.cmake" @ONLY)
configure_file(metaforce-packbadgeConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/metaforce-packbadgeConfig.cmake" @ONLY)
# ... for both
configure_file(urde-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packbadgeConfigVersion.cmake" @ONLY)
configure_file(metaforce-packbadgeConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packbadgeConfigVersion.cmake" @ONLY)
else()
find_package(urde-packbadge REQUIRED)
find_package(metaforce-packbadge REQUIRED)
endif()
add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
@ -37,6 +37,6 @@ add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge>
MAIN_DEPENDENCY badge.png COMMENT "Generating badge.bin")
bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
add_library(UrdeBadging
add_library(MetaforceBadging
badge.cpp badge.bin
Badging.hpp Badging.cpp)

View File

@ -5,5 +5,5 @@ get_filename_component(PACKBADGE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET packbadge AND NOT packbadge_BINARY_DIR)
include("${PACKBADGE_CMAKE_DIR}/urde-packbadgeTargets.cmake")
include("${PACKBADGE_CMAKE_DIR}/metaforce-packbadgeTargets.cmake")
endif()

View File

@ -12,22 +12,22 @@ target_include_directories(packicons PRIVATE ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_D
##################
# Add all targets to the build-tree export set
export(TARGETS packicons FILE "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsTargets.cmake")
export(TARGETS packicons FILE "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE urde-packicons)
export(PACKAGE metaforce-packicons)
# Create the atdnaConfig.cmake
# ... for the build tree
configure_file(urde-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsConfig.cmake" @ONLY)
configure_file(metaforce-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsConfig.cmake" @ONLY)
# ... for the install tree
configure_file(urde-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/urde-packiconsConfig.cmake" @ONLY)
configure_file(metaforce-packiconsConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/metaforce-packiconsConfig.cmake" @ONLY)
# ... for both
configure_file(urde-packiconsConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/urde-packiconsConfigVersion.cmake" @ONLY)
configure_file(metaforce-packiconsConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/metaforce-packiconsConfigVersion.cmake" @ONLY)
else()
find_package(urde-packicons REQUIRED)
find_package(metaforce-packicons REQUIRED)
endif()
unset(INKSCAPE_BIN CACHE)
@ -59,4 +59,4 @@ else()
endif()
bintoc(icons_dat.cpp ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS)
add_library(UrdeIcons icons.cpp icons.hpp icons.bin icons_dat.cpp)
add_library(MetaforceIcons icons.cpp icons.hpp icons.bin icons_dat.cpp)

View File

@ -5,7 +5,7 @@
extern "C" uint8_t URDE_ICONS[];
extern "C" size_t URDE_ICONS_SZ;
namespace urde {
namespace metaforce {
static logvisor::Module Log("URDE::icons");
specter::IconAtlas<8, 8> g_IconAtlas;
@ -91,4 +91,4 @@ specter::Icon& GetIcon(MonoIcon icon) {
}
}
} // namespace urde
} // namespace metaforce

View File

@ -3,7 +3,7 @@
#include "specter/Icon.hpp"
#include "specter/ViewResources.hpp"
namespace urde {
namespace metaforce {
void InitializeIcons(specter::ViewResources& viewRes);
void DestroyIcons();
@ -30,4 +30,4 @@ enum class MonoIcon {
};
specter::Icon& GetIcon(MonoIcon icon);
} // namespace urde
} // namespace metaforce

View File

@ -5,5 +5,5 @@ get_filename_component(PACKICONS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET packicons AND NOT packicons_BINARY_DIR)
include("${PACKICONS_CMAKE_DIR}/urde-packiconsTargets.cmake")
include("${PACKICONS_CMAKE_DIR}/metaforce-packiconsTargets.cmake")
endif()

@ -1 +0,0 @@
Subproject commit 2b16c090215130336b401bb5db9831dbc8db78fa

View File

@ -0,0 +1,15 @@
#add_executable(genlocales genlocales.cpp)
#target_link_libraries(genlocales fmt athena-core)
#
#set(LOCALES_IN en_US.yaml en_GB.yaml ja_JP.yaml)
#set(LOCALES_OUT ${CMAKE_CURRENT_BINARY_DIR}/locales-inl.hpp)
#add_custom_command(OUTPUT ${LOCALES_OUT} COMMAND $<TARGET_FILE:genlocales>
# ARGS ${LOCALES_OUT} ${LOCALES_IN}
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# DEPENDS genlocales ${LOCALES_IN})
add_library(UrdeLocales locales-inl.hpp locale.hpp locale.cpp)
target_link_libraries(UrdeLocales fmt)
target_include_directories(UrdeLocales PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(specter PUBLIC UrdeLocales)

3
Editor/locale/en_GB.yaml Normal file
View File

@ -0,0 +1,3 @@
name: "British English"
en_GB:
color: "Colour"

42
Editor/locale/en_US.yaml Normal file
View File

@ -0,0 +1,42 @@
name: "US English"
en_US:
color: "Color"
branch: "Branch"
commit: "Commit"
release: "Release"
date: "Date"
new_project: "New Project"
open_project: "Open Project"
extract_game: "Extract Game"
name: "Name"
type: "Type"
size: "Size"
directory: "Directory"
file: "File"
file_name: "File Name"
cancel: "Cancel"
system_locations: "System Locations"
recent_projects: "Recent Projects"
recent_files: "Recent Files"
scroll_left: "Scroll Left"
scroll_right: "Scroll Right"
ok: "OK"
cancel: "Cancel"
boundary_action: "Boundary Action"
split: "Split"
join: "Join"
hecl_project: "HECL Project"
no_access_as_dir: "Unable to access '{}' as directory"
file_field_empty: "Unable to save empty file"
overwrite_confirm: "Overwrite '{}'?"
directory_field_empty: "Unable to make empty-named directory"
no_overwrite_file: "Unable to make directory over file"
no_overwrite_project: "Unable to make project within existing project"
no_access_as_file: "Unable to access '{}' as file"
space_types: "Space Types"
resource_browser: "Resource Browser"
effect_editor: "Effect Editor"
model_viewer: "Model Viewer"
information_center: "Information Center"
game_mode: "Game Mode"
version: "Version"

View File

@ -0,0 +1,113 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <unordered_set>
#include "athena/FileReader.hpp"
#include "athena/YAMLDocReader.hpp"
#include <fmt/format.h>
#include <fmt/ostream.h>
int main(int argc, char** argv) {
if (argc < 3) {
fmt::print(FMT_STRING("{} <out-header> <in-yamls>...\n"), argv[0]);
return 1;
}
std::ofstream out(argv[1]);
if (!out.is_open()) {
fmt::print(FMT_STRING("Unable to open {} for writing\n"), argv[1]);
return 1;
}
std::unordered_set<std::string> seenLocales;
std::stringstream enumLocales;
std::stringstream declLocales;
std::unordered_set<std::string> seenKeys;
std::stringstream keys;
std::stringstream lookups;
std::stringstream dos;
for (int i = 2; i < argc; ++i) {
athena::io::FileReader fr(argv[i]);
if (!fr.isOpen()) {
fmt::print(FMT_STRING("Unable to open {} for reading\n"), argv[i]);
return 1;
}
athena::io::YAMLDocReader r;
if (!r.parse(&fr)) {
fmt::print(FMT_STRING("Unable to parse {}\n"), argv[i]);
return 1;
}
std::string name;
std::string fullName;
athena::io::YAMLNode* listNode = nullptr;
for (const auto& c : r.getRootNode()->m_mapChildren) {
if (c.first == "name") {
fullName = c.second->m_scalarString;
} else {
name = c.first;
listNode = c.second.get();
}
}
if (fullName.empty()) {
fmt::print(FMT_STRING("Unable to find 'name' node in {}\n"), argv[i]);
return 1;
}
if (!listNode) {
fmt::print(FMT_STRING("Unable to find list node in {}\n"), argv[i]);
return 1;
}
if (seenLocales.find(name) == seenLocales.end()) {
seenLocales.insert(name);
fmt::print(enumLocales, FMT_STRING(" {},\n"), name);
fmt::print(declLocales,
FMT_STRING("struct {0} {{ static constexpr auto Name = \"{0}\"sv; static constexpr auto FullName = \"{1}\"sv; }};\n"),
name, fullName);
fmt::print(dos,
FMT_STRING(" case ELocale::{0}:\n"
" return act.template Do<{0}>(std::forward<Args>(args)...);\n"), name);
fmt::print(lookups, FMT_STRING("/* {} */\n"), name);
for (const auto& k : listNode->m_mapChildren) {
if (seenKeys.find(k.first) == seenKeys.end()) {
seenKeys.insert(k.first);
fmt::print(keys, FMT_STRING("struct {} {{}};\n"), k.first);
}
fmt::print(lookups,
FMT_STRING("template<> struct Lookup<{}, {}> {{ static constexpr auto Value() {{ return FMT_STRING(\"{}\"); }} }};\n"),
name, k.first, k.second->m_scalarString);
}
}
lookups << '\n';
}
out << "/* Locales */\n"
"enum class ELocale {\n"
" Invalid = -1,\n";
out << enumLocales.str();
out << " MAXLocale\n"
"};\n";
out << declLocales.str();
out << "\n"
"using DefaultLocale = en_US;\n"
"template<typename L, typename K> struct Lookup {\n"
" static_assert(!std::is_same_v<L, DefaultLocale>, \"The default locale must translate all keys\");\n"
" static constexpr auto Value() { return Lookup<DefaultLocale, K>::Value(); }\n"
"};\n"
"\n"
"/* Keys */\n";
out << keys.str();
out << "\n";
out << lookups.str();
out << "template <typename Action, typename... Args>\n"
"constexpr auto Do(ELocale l, Action act, Args&&... args) {\n"
" switch (l) {\n"
" default:\n";
out << dos.str();
out << " }\n"
"}\n";
return 0;
}

19
Editor/locale/ja_JP.yaml Normal file
View File

@ -0,0 +1,19 @@
name: "日本語"
ja_JP:
color: "色"
branch: "分派"
commit: "預ける"
date: "年月日"
new_project: "新しいプロジェクト"
open_project: "プロジェクトを開きます"
extract_game: "ビデオゲームを抽出"
name: "名"
type: "タイプ"
size: "サイズ"
directory: "ディレクトリ"
file: "ファイル"
file_name: "ファイル名"
cancel: "キャンセル"
system_locations: "システムの場所"
recent_projects: "最近使ったプロジェクト"
recent_files: "最近使用したファイル"

37
Editor/locale/locale.cpp Normal file
View File

@ -0,0 +1,37 @@
#include "locale.hpp"
#include <cstring>
#include <clocale>
#include <algorithm>
#undef min
#undef max
namespace locale {
std::vector<std::pair<std::string_view, std::string_view>> ListLocales() {
std::vector<std::pair<std::string_view, std::string_view>> ret;
ret.reserve(std::size_t(ELocale::MAXLocale));
for (ELocale l = ELocale(0); l < ELocale::MAXLocale; l = ELocale(int(l) + 1))
ret.emplace_back(GetName(l), GetFullName(l));
return ret;
}
ELocale LookupLocale(std::string_view name) {
for (ELocale l = ELocale(0); l < ELocale::MAXLocale; l = ELocale(int(l) + 1))
if (name == GetName(l))
return l;
return ELocale::Invalid;
}
ELocale SystemLocaleOrEnglish() {
const char* sysLocale = std::setlocale(LC_ALL, nullptr);
size_t sysLocaleLen = std::strlen(sysLocale);
for (ELocale l = ELocale(0); l < ELocale::MAXLocale; l = ELocale(int(l) + 1)) {
auto name = GetName(l);
if (!name.compare(0, std::min(name.size(), sysLocaleLen), sysLocale))
return l;
}
return ELocale::en_US;
}
} // namespace locale

42
Editor/locale/locale.hpp Normal file
View File

@ -0,0 +1,42 @@
#pragma once
#include <type_traits>
#include <string_view>
#include <vector>
#include <fmt/format.h>
namespace locale {
using namespace std::literals;
#include <locales-inl.hpp>
struct DoGetName {
template <typename L>
constexpr auto Do() { return L::Name; }
};
constexpr auto GetName(ELocale l) {
return Do(l, DoGetName());
}
struct DoGetFullName {
template <typename L>
constexpr auto Do() { return L::FullName; }
};
constexpr auto GetFullName(ELocale l) {
return Do(l, DoGetFullName());
}
template <typename Key>
struct DoTranslate {
template <typename L, typename... Args>
constexpr auto Do(Args&&... args) { return fmt::format(Lookup<L, Key>::Value(), std::forward<Args>(args)...); }
};
template <typename Key, typename... Args>
constexpr auto Translate(ELocale l, Args&&... args) {
return Do(l, DoTranslate<Key>(), std::forward<Args>(args)...);
}
std::vector<std::pair<std::string_view, std::string_view>> ListLocales();
ELocale LookupLocale(std::string_view name);
ELocale SystemLocaleOrEnglish();
} // namespace locale

View File

@ -0,0 +1,134 @@
/* Locales */
enum class ELocale {
Invalid = -1,
en_US,
en_GB,
ja_JP,
MAXLocale
};
struct en_US { static constexpr auto Name = "en_US"sv; static constexpr auto FullName = "US English"sv; };
struct en_GB { static constexpr auto Name = "en_GB"sv; static constexpr auto FullName = "British English"sv; };
struct ja_JP { static constexpr auto Name = "ja_JP"sv; static constexpr auto FullName = "日本語"sv; };
using DefaultLocale = en_US;
template<typename L, typename K> struct Lookup {
static_assert(!std::is_same_v<L, DefaultLocale>, "The default locale must translate all keys");
static constexpr auto Value() { return Lookup<DefaultLocale, K>::Value(); }
};
/* Keys */
struct color {};
struct branch {};
struct commit {};
struct release {};
struct date {};
struct new_project {};
struct open_project {};
struct extract_game {};
struct name {};
struct type {};
struct size {};
struct directory {};
struct file {};
struct file_name {};
struct cancel {};
struct system_locations {};
struct recent_projects {};
struct recent_files {};
struct scroll_left {};
struct scroll_right {};
struct ok {};
struct boundary_action {};
struct split {};
struct join {};
struct hecl_project {};
struct no_access_as_dir {};
struct file_field_empty {};
struct overwrite_confirm {};
struct directory_field_empty {};
struct no_overwrite_file {};
struct no_overwrite_project {};
struct no_access_as_file {};
struct space_types {};
struct resource_browser {};
struct effect_editor {};
struct model_viewer {};
struct information_center {};
struct game_mode {};
struct version {};
/* en_US */
template<> struct Lookup<en_US, color> { static constexpr auto Value() { return FMT_STRING("Color"); } };
template<> struct Lookup<en_US, branch> { static constexpr auto Value() { return FMT_STRING("Branch"); } };
template<> struct Lookup<en_US, commit> { static constexpr auto Value() { return FMT_STRING("Commit"); } };
template<> struct Lookup<en_US, release> { static constexpr auto Value() { return FMT_STRING("Release"); } };
template<> struct Lookup<en_US, date> { static constexpr auto Value() { return FMT_STRING("Date"); } };
template<> struct Lookup<en_US, new_project> { static constexpr auto Value() { return FMT_STRING("New Project"); } };
template<> struct Lookup<en_US, open_project> { static constexpr auto Value() { return FMT_STRING("Open Project"); } };
template<> struct Lookup<en_US, extract_game> { static constexpr auto Value() { return FMT_STRING("Extract Game"); } };
template<> struct Lookup<en_US, name> { static constexpr auto Value() { return FMT_STRING("Name"); } };
template<> struct Lookup<en_US, type> { static constexpr auto Value() { return FMT_STRING("Type"); } };
template<> struct Lookup<en_US, size> { static constexpr auto Value() { return FMT_STRING("Size"); } };
template<> struct Lookup<en_US, directory> { static constexpr auto Value() { return FMT_STRING("Directory"); } };
template<> struct Lookup<en_US, file> { static constexpr auto Value() { return FMT_STRING("File"); } };
template<> struct Lookup<en_US, file_name> { static constexpr auto Value() { return FMT_STRING("File Name"); } };
template<> struct Lookup<en_US, cancel> { static constexpr auto Value() { return FMT_STRING("Cancel"); } };
template<> struct Lookup<en_US, system_locations> { static constexpr auto Value() { return FMT_STRING("System Locations"); } };
template<> struct Lookup<en_US, recent_projects> { static constexpr auto Value() { return FMT_STRING("Recent Projects"); } };
template<> struct Lookup<en_US, recent_files> { static constexpr auto Value() { return FMT_STRING("Recent Files"); } };
template<> struct Lookup<en_US, scroll_left> { static constexpr auto Value() { return FMT_STRING("Scroll Left"); } };
template<> struct Lookup<en_US, scroll_right> { static constexpr auto Value() { return FMT_STRING("Scroll Right"); } };
template<> struct Lookup<en_US, ok> { static constexpr auto Value() { return FMT_STRING("OK"); } };
template<> struct Lookup<en_US, boundary_action> { static constexpr auto Value() { return FMT_STRING("Boundary Action"); } };
template<> struct Lookup<en_US, split> { static constexpr auto Value() { return FMT_STRING("Split"); } };
template<> struct Lookup<en_US, join> { static constexpr auto Value() { return FMT_STRING("Join"); } };
template<> struct Lookup<en_US, hecl_project> { static constexpr auto Value() { return FMT_STRING("HECL Project"); } };
template<> struct Lookup<en_US, no_access_as_dir> { static constexpr auto Value() { return FMT_STRING("Unable to access '{}' as directory"); } };
template<> struct Lookup<en_US, file_field_empty> { static constexpr auto Value() { return FMT_STRING("Unable to save empty file"); } };
template<> struct Lookup<en_US, overwrite_confirm> { static constexpr auto Value() { return FMT_STRING("Overwrite '{}'?"); } };
template<> struct Lookup<en_US, directory_field_empty> { static constexpr auto Value() { return FMT_STRING("Unable to make empty-named directory"); } };
template<> struct Lookup<en_US, no_overwrite_file> { static constexpr auto Value() { return FMT_STRING("Unable to make directory over file"); } };
template<> struct Lookup<en_US, no_overwrite_project> { static constexpr auto Value() { return FMT_STRING("Unable to make project within existing project"); } };
template<> struct Lookup<en_US, no_access_as_file> { static constexpr auto Value() { return FMT_STRING("Unable to access '{}' as file"); } };
template<> struct Lookup<en_US, space_types> { static constexpr auto Value() { return FMT_STRING("Space Types"); } };
template<> struct Lookup<en_US, resource_browser> { static constexpr auto Value() { return FMT_STRING("Resource Browser"); } };
template<> struct Lookup<en_US, effect_editor> { static constexpr auto Value() { return FMT_STRING("Effect Editor"); } };
template<> struct Lookup<en_US, model_viewer> { static constexpr auto Value() { return FMT_STRING("Model Viewer"); } };
template<> struct Lookup<en_US, information_center> { static constexpr auto Value() { return FMT_STRING("Information Center"); } };
template<> struct Lookup<en_US, game_mode> { static constexpr auto Value() { return FMT_STRING("Game Mode"); } };
template<> struct Lookup<en_US, version> { static constexpr auto Value() { return FMT_STRING("Version"); } };
/* en_GB */
template<> struct Lookup<en_GB, color> { static constexpr auto Value() { return FMT_STRING("Colour"); } };
/* ja_JP */
template<> struct Lookup<ja_JP, color> { static constexpr auto Value() { return FMT_STRING(""); } };
template<> struct Lookup<ja_JP, branch> { static constexpr auto Value() { return FMT_STRING("分派"); } };
template<> struct Lookup<ja_JP, commit> { static constexpr auto Value() { return FMT_STRING("預ける"); } };
template<> struct Lookup<ja_JP, date> { static constexpr auto Value() { return FMT_STRING("年月日"); } };
template<> struct Lookup<ja_JP, new_project> { static constexpr auto Value() { return FMT_STRING("新しいプロジェクト"); } };
template<> struct Lookup<ja_JP, open_project> { static constexpr auto Value() { return FMT_STRING("プロジェクトを開きます"); } };
template<> struct Lookup<ja_JP, extract_game> { static constexpr auto Value() { return FMT_STRING("ビデオゲームを抽出"); } };
template<> struct Lookup<ja_JP, name> { static constexpr auto Value() { return FMT_STRING(""); } };
template<> struct Lookup<ja_JP, type> { static constexpr auto Value() { return FMT_STRING("タイプ"); } };
template<> struct Lookup<ja_JP, size> { static constexpr auto Value() { return FMT_STRING("サイズ"); } };
template<> struct Lookup<ja_JP, directory> { static constexpr auto Value() { return FMT_STRING("ディレクトリ"); } };
template<> struct Lookup<ja_JP, file> { static constexpr auto Value() { return FMT_STRING("ファイル"); } };
template<> struct Lookup<ja_JP, file_name> { static constexpr auto Value() { return FMT_STRING("ファイル名"); } };
template<> struct Lookup<ja_JP, cancel> { static constexpr auto Value() { return FMT_STRING("キャンセル"); } };
template<> struct Lookup<ja_JP, system_locations> { static constexpr auto Value() { return FMT_STRING("システムの場所"); } };
template<> struct Lookup<ja_JP, recent_projects> { static constexpr auto Value() { return FMT_STRING("最近使ったプロジェクト"); } };
template<> struct Lookup<ja_JP, recent_files> { static constexpr auto Value() { return FMT_STRING("最近使用したファイル"); } };
template <typename Action, typename... Args>
constexpr auto Do(ELocale l, Action act, Args&&... args) {
switch (l) {
default:
case ELocale::en_US:
return act.template Do<en_US>(std::forward<Args>(args)...);
case ELocale::en_GB:
return act.template Do<en_GB>(std::forward<Args>(args)...);
case ELocale::ja_JP:
return act.template Do<ja_JP>(std::forward<Args>(args)...);
}
}

View File

@ -8,6 +8,8 @@
#include "hecl/CVarCommons.hpp"
#include "hecl/Console.hpp"
#include "fmt/chrono.h"
#include "version.h"
#include "optick.h"
static logvisor::Module AthenaLog("Athena");
static void AthenaExc(athena::error::Level level, const char* file, const char*, int line, fmt::string_view fmt,
@ -15,11 +17,12 @@ static void AthenaExc(athena::error::Level level, const char* file, const char*,
AthenaLog.vreport(logvisor::Level(level), fmt, args);
}
namespace urde {
static logvisor::Module Log{"URDE"};
namespace metaforce {
static logvisor::Module Log{"Metaforce"};
static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
hecl::SystemString features;
#if defined(__x86_64__) || defined(_M_X64)
auto AddFeature = [&features](const hecl::SystemChar* str) {
if (!features.empty())
features += _SYS_STR(", ");
@ -45,6 +48,7 @@ static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
AddFeature(_SYS_STR("AVX"));
if (cpuInf.AVX2)
AddFeature(_SYS_STR("AVX2"));
#endif
return features;
}
@ -68,6 +72,7 @@ struct Application : boo::IApplicationCallback {
initialize(app);
m_viewManager->init(app);
while (m_running.load()) {
OPTICK_FRAME("MainThread");
if (!m_viewManager->proc())
break;
}
@ -116,7 +121,7 @@ struct Application : boo::IApplicationCallback {
int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; }
};
} // namespace urde
} // namespace metaforce
static hecl::SystemChar CwdBuf[1024];
hecl::SystemString ExeDir;
@ -125,12 +130,12 @@ static void SetupBasics(bool logging) {
auto result = zeus::validateCPU();
if (!result.first) {
#if _WIN32 && !WINDOWS_STORE
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
metaforce::CPUFeatureString(result.second));
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
#else
fmt::print(stderr, FMT_STRING("ERROR: This build of URDE requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second));
fmt::print(stderr, FMT_STRING("ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
metaforce::CPUFeatureString(result.second));
#endif
exit(1);
}
@ -139,6 +144,12 @@ static void SetupBasics(bool logging) {
if (logging)
logvisor::RegisterConsoleLogger();
atSetExceptionHandler(AthenaExc);
#if SENTRY_ENABLED
hecl::Runtime::FileStoreManager fileMgr{_SYS_STR("sentry-native-metaforce")};
hecl::SystemUTF8Conv cacheDir{fileMgr.getStoreRoot()};
logvisor::RegisterSentry("metaforce", METAFORCE_WC_DESCRIBE, cacheDir.c_str());
#endif
}
static bool IsClientLoggingEnabled(int argc, const boo::SystemChar** argv) {
@ -156,12 +167,12 @@ int main(int argc, const boo::SystemChar** argv)
#endif
{
if (argc > 1 && !hecl::StrCmp(argv[1], _SYS_STR("--dlpackage"))) {
fmt::print(FMT_STRING("{}\n"), URDE_DLPACKAGE);
fmt::print(FMT_STRING("{}\n"), METAFORCE_DLPACKAGE);
return 100;
}
SetupBasics(IsClientLoggingEnabled(argc, argv));
hecl::Runtime::FileStoreManager fileMgr{_SYS_STR("urde")};
hecl::Runtime::FileStoreManager fileMgr{_SYS_STR("metaforce")};
hecl::CVarManager cvarMgr{fileMgr};
hecl::CVarCommons cvarCmns{cvarMgr};
@ -170,7 +181,7 @@ int main(int argc, const boo::SystemChar** argv)
args.push_back(argv[i]);
cvarMgr.parseCommandLine(args);
hecl::SystemStringView logFile = hecl::SystemStringConv(cvarCmns.getLogFile()).sys_str();
hecl::SystemString logFile{hecl::SystemStringConv(cvarCmns.getLogFile()).c_str()};
hecl::SystemString logFilePath;
if (!logFile.empty()) {
std::time_t time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
@ -193,10 +204,10 @@ int main(int argc, const boo::SystemChar** argv)
/* Handle -j argument */
hecl::SetCpuCountOverride(argc, argv);
urde::Application appCb(fileMgr, cvarMgr, cvarCmns);
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("urde"), _SYS_STR("URDE"), argc,
argv, appCb.getGraphicsApi(), appCb.getSamples(), appCb.getAnisotropy(),
appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
metaforce::Application appCb(fileMgr, cvarMgr, cvarCmns);
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("metaforce"),
_SYS_STR("Metaforce"), argc, argv, appCb.getGraphicsApi(), appCb.getSamples(),
appCb.getAnisotropy(), appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
// printf("IM DYING!!\n");
return ret;
}
@ -208,9 +219,9 @@ using namespace Windows::ApplicationModel::Core;
[Platform::MTAThread] int WINAPIV main(Platform::Array<Platform::String ^> ^ params) {
SetupBasics(false);
urde::Application appCb;
metaforce::Application appCb;
auto viewProvider =
ref new boo::ViewProvider(appCb, _SYS_STR("urde"), _SYS_STR("URDE"), _SYS_STR("urde"), params, false);
ref new boo::ViewProvider(appCb, _SYS_STR("metaforce"), _SYS_STR("Metaforce"), _SYS_STR("metaforce"), params, false);
CoreApplication::Run(viewProvider);
return 0;
}

View File

Before

Width:  |  Height:  |  Size: 637 KiB

After

Width:  |  Height:  |  Size: 637 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 203 KiB

After

Width:  |  Height:  |  Size: 203 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Some files were not shown because too many files have changed in this diff Show More