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 *.autosave
docs/* docs/*
.idea/ .idea/
Editor/platforms/win/urde.rc Editor/platforms/win/metaforce.rc
.vs/ .vs/
out/ out/
cmake-build-*/ 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"] [submodule "nod"]
path = nod path = extern/nod
url = ../nod.git url = ../nod.git
branch = master
[submodule "amuse"] [submodule "amuse"]
path = amuse path = extern/amuse
url = ../amuse.git url = ../amuse.git
branch = master
[submodule "kabufuda"] [submodule "kabufuda"]
path = kabufuda path = extern/kabufuda
url = ../kabufuda.git url = ../kabufuda.git
branch = master
[submodule "jbus"] [submodule "jbus"]
path = jbus path = extern/jbus
url = ../jbus.git url = ../jbus.git
branch = master
[submodule "assetnameparser/tinyxml2"] [submodule "assetnameparser/tinyxml2"]
path = assetnameparser/tinyxml2 path = extern/tinyxml2
url = ../tinyxml2.git url = ../tinyxml2.git
[submodule "hecl-gui"] branch = master
path = hecl-gui
url = ../hecl-gui.git
[submodule "sanitizers-cmake"] [submodule "sanitizers-cmake"]
path = sanitizers-cmake path = extern/sanitizers-cmake
url = https://github.com/arsenm/sanitizers-cmake.git url = https://github.com/arsenm/sanitizers-cmake.git
branch = master
[submodule "discord-rpc"] [submodule "discord-rpc"]
path = discord-rpc path = extern/discord-rpc
url = https://github.com/discordapp/discord-rpc.git url = https://github.com/discordapp/discord-rpc.git
branch = master
[submodule "rapidjson"] [submodule "rapidjson"]
path = rapidjson path = extern/rapidjson
url = https://github.com/Tencent/rapidjson.git url = https://github.com/Tencent/rapidjson.git
branch = master
[submodule "NESEmulator/fixNES"] [submodule "NESEmulator/fixNES"]
path = NESEmulator/fixNES path = extern/fixNES
url = https://github.com/FIX94/fixNES.git url = https://github.com/FIX94/fixNES.git
[submodule "Editor/locale"] branch = master
path = Editor/locale [submodule "extern/libSquish"]
url = ../urde-translations.git path = extern/libSquish
[submodule "boo2"] url = ../libSquish.git
path = boo2 branch = master
[submodule "extern/athena"]
path = extern/athena
url = ../../libAthena/athena.git
branch = master
[submodule "extern/boo2"]
path = extern/boo2
url = ../boo2.git url = ../boo2.git
branch = master
[submodule "extern/libjpeg-turbo"]
path = extern/libjpeg-turbo
url = ../libjpeg-turbo.git
branch = thp
[submodule "zeus"] [submodule "zeus"]
path = zeus path = extern/zeus
url = ../zeus.git url = ../zeus.git
branch = master

View File

@ -1,26 +1,80 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR) cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
# Allow target_link_libraries with targets in other directories cmake_policy(VERSION 3.15...3.20)
cmake_policy(SET CMP0079 NEW)
# Set MSVC runtime library flags from CMAKE_MSVC_RUNTIME_LIBRARY
cmake_policy(SET CMP0091 NEW)
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) if (APPLE)
# Shaddup Xcode set(PLATFORM_NAME macos)
function(add_executable TARGET) elseif (WIN32)
_add_executable(${TARGET} ${ARGN}) set(PLATFORM_NAME win32)
set_target_properties(${TARGET} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "") elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
endfunction() set(PLATFORM_NAME linux)
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()
endif () endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if(APPLE AND NOT CMAKE_OSX_SYSROOT) if(APPLE AND NOT CMAKE_OSX_SYSROOT)
# If the Xcode SDK is lagging behind system version, CMake needs this done first # If the Xcode SDK is lagging behind system version, CMake needs this done first
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
@ -28,8 +82,8 @@ if(APPLE AND NOT CMAKE_OSX_SYSROOT)
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
endif() endif()
option(URDE_CROSSCOMPILING "Don't build tools; attempt package import" OFF) option(METAFORCE_CROSSCOMPILING "Don't build tools; attempt package import" OFF)
if (URDE_CROSSCOMPILING) if (METAFORCE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING On) set(CMAKE_CROSSCOMPILING On)
endif() endif()
@ -37,8 +91,6 @@ if(CMAKE_CROSSCOMPILING)
set(HAVE_WORDS_BIGENDIAN_EXITCODE 0 CACHE INTEGER "Makes soxr happy" FORCE) set(HAVE_WORDS_BIGENDIAN_EXITCODE 0 CACHE INTEGER "Makes soxr happy" FORCE)
endif() endif()
project(urde VERSION 0.1.0)
# MSVC has a "latest" flag, which always uses the newest standard # MSVC has a "latest" flag, which always uses the newest standard
# when available. GCC and Clang posess no such flag, and must be # when available. GCC and Clang posess no such flag, and must be
# manually enforced. CMake, curiously, also doesn't have a "latest" # 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_SHARED_LIBS OFF CACHE BOOL "Force shared libs off" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" 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) find_package(Sanitizers)
if (NX) if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
set(URDE_VECTOR_ISA "neon") set(METAFORCE_VECTOR_ISA "sse41" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
else()
set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
endif () endif ()
if(MSVC) if(MSVC)
if(${URDE_VECTOR_ISA} STREQUAL "avx2") if(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(/arch:AVX2) add_compile_options(/arch:AVX2)
add_compile_definitions(__SSE4_1__=1) add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX2 Vector ISA") 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_options(/arch:AVX)
add_compile_definitions(__SSE4_1__=1) add_compile_definitions(__SSE4_1__=1)
message(STATUS "Building with AVX Vector ISA") 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) 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") message(STATUS "Building with SSE4.1 Vector ISA")
else() else()
message(STATUS "Building with SSE2 Vector ISA") message(STATUS "Building with SSE2 Vector ISA")
@ -78,7 +132,7 @@ if(MSVC)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio*") if(${CMAKE_GENERATOR} MATCHES "Visual Studio*")
set(VS_OPTIONS "/MP") 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() endif()
# Shaddup MSVC # Shaddup MSVC
@ -86,9 +140,24 @@ if(MSVC)
_CRT_SECURE_NO_WARNINGS=1 D_SCL_SECURE_NO_WARNINGS=1 _CRT_SECURE_NO_WARNINGS=1 D_SCL_SECURE_NO_WARNINGS=1
_SCL_SECURE_NO_DEPRECATE=1 _CRT_NONSTDC_NO_WARNINGS=1 _SCL_SECURE_NO_DEPRECATE=1 _CRT_NONSTDC_NO_WARNINGS=1
_ENABLE_EXTENDED_ALIGNED_STORAGE=1 NOMINMAX=1) _ENABLE_EXTENDED_ALIGNED_STORAGE=1 NOMINMAX=1)
add_compile_options(/IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 /wd4068 add_compile_options(/IGNORE:4221
/wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 /wd4309 /wd4805 ${VS_OPTIONS}) $<$<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( add_compile_options(
# Disable exceptions # Disable exceptions
$<$<COMPILE_LANGUAGE:CXX>:/EHsc-> $<$<COMPILE_LANGUAGE:CXX>:/EHsc->
@ -108,7 +177,6 @@ if(MSVC)
# Use latest C++ standard. # Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest> $<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
) )
add_compile_definitions(FMT_EXCEPTIONS=0 _HAS_EXCEPTIONS=0)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl) # Flags for MSVC (not clang-cl)
@ -120,40 +188,39 @@ if(MSVC)
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew> $<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
# Link-time Code Generation for Release builds # Link-time Code Generation for Release builds
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:/GL> $<$<CONFIG:Release>:/GL>
) )
# Link-time Code Generation for Release builds # Link-time Code Generation for Release builds
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") 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_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() endif()
else() 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) add_compile_options(-march=native)
message(STATUS "Building with native ISA") message(STATUS "Building with native ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx2") elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx2")
add_compile_options(-mavx2) add_compile_options(-mavx2)
message(STATUS "Building with AVX2 Vector ISA") message(STATUS "Building with AVX2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "avx") elseif(${METAFORCE_VECTOR_ISA} STREQUAL "avx")
add_compile_options(-mavx) add_compile_options(-mavx)
message(STATUS "Building with AVX Vector ISA") message(STATUS "Building with AVX Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse41") elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse41")
add_compile_options(-msse4.1) add_compile_options(-msse4.1)
message(STATUS "Building with SSE4.1 Vector ISA") message(STATUS "Building with SSE4.1 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse3") elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse3")
add_compile_options(-msse3) add_compile_options(-msse3)
message(STATUS "Building with SSE3 Vector ISA") message(STATUS "Building with SSE3 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "sse2") elseif(${METAFORCE_VECTOR_ISA} STREQUAL "sse2")
add_compile_options(-msse2) add_compile_options(-msse2)
message(STATUS "Building with SSE2 Vector ISA") message(STATUS "Building with SSE2 Vector ISA")
elseif(${URDE_VECTOR_ISA} STREQUAL "neon")
message(STATUS "Building with NEON Vector ISA")
else() else()
message(STATUS "Building with x87 Vector ISA") message(STATUS "Building with x87 Vector ISA")
endif() endif()
endif()
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fno-plt HAS_NO_PLT) check_cxx_compiler_flag(-fno-plt HAS_NO_PLT)
@ -161,12 +228,12 @@ else()
add_compile_options(-fno-plt) add_compile_options(-fno-plt)
endif() endif()
check_cxx_compiler_flag(-fno-asynchronous-unwind-tables HAS_NO_ASYNC_UNWIND_TABLES) 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 # Binary size reduction
add_compile_options(-fno-asynchronous-unwind-tables) add_compile_options(-fno-asynchronous-unwind-tables)
endif() endif()
if(URDE_MSAN) if(METAFORCE_MSAN)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=memory add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++> -fsanitize=memory
-fsanitize-memory-track-origins -fsanitize-recover=all) -fsanitize-memory-track-origins -fsanitize-recover=all)
endif() endif()
@ -179,13 +246,16 @@ else()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") 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) add_compile_options(-Wno-unknown-warning-option -Wno-unused-private-field)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 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() endif()
add_compile_definitions(FMT_EXCEPTIONS=0)
if(APPLE) if(APPLE)
add_compile_options(-Wno-error=deprecated-declarations 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()
endif() endif()
@ -197,9 +267,9 @@ endif()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 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 # 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() endif()
option(USE_LD_LLD "Link with LLD" ON) option(USE_LD_LLD "Link with LLD" ON)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@ -241,7 +311,11 @@ if(USE_LD_GOLD)
if("${LD_VERSION}" MATCHES "GNU 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_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") 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_compile_options(-flto)
add_link_options(-flto) add_link_options(-flto)
message(STATUS "GNU gold linker enabled with LTO.") message(STATUS "GNU gold linker enabled with LTO.")
@ -257,17 +331,15 @@ endif()
# Add discord-rpc here # Add discord-rpc here
if(NOT GEKKO AND NOT NX) 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) if (NOT CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix) set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix)
endif() endif()
add_subdirectory(discord-rpc/src) add_subdirectory(extern/discord-rpc/src)
target_include_directories(discord-rpc PRIVATE rapidjson/include PUBLIC discord-rpc/include) target_include_directories(discord-rpc PRIVATE extern/rapidjson/include PUBLIC extern/discord-rpc/include)
endif() endif()
add_subdirectory(nod) add_subdirectory(extern/nod)
set(HECL_DLPACKAGE ${URDE_DLPACKAGE})
set(DATA_SPEC_LIBS RetroDataSpec AssetNameMap) set(DATA_SPEC_LIBS RetroDataSpec AssetNameMap)
set(HECL_DATASPEC_DECLS set(HECL_DATASPEC_DECLS
@ -300,7 +372,9 @@ set(HECL_DATASPEC_PUSHES
# TODO: Fix weirdness # TODO: Fix weirdness
find_package(hsh REQUIRED) find_package(hsh REQUIRED)
add_subdirectory(boo2) add_subdirectory(boo2)
add_subdirectory(extern/xxhash)
add_subdirectory(hecl) add_subdirectory(hecl)
add_subdirectory(extern/zeus)
target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR})
target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(hecl-full PRIVATE zeus nod) target_link_libraries(hecl-full PRIVATE zeus nod)
@ -315,19 +389,18 @@ if(NOT TARGET atdna)
# Import native atdna if cross-compiling # Import native atdna if cross-compiling
find_package(atdna REQUIRED) find_package(atdna REQUIRED)
if(NOT TARGET atdna) 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()
endif() endif()
add_subdirectory(amuse) add_subdirectory(extern/amuse)
add_subdirectory(zeus)
add_subdirectory(assetnameparser) add_subdirectory(assetnameparser)
add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known
add_subdirectory(DataSpec) add_subdirectory(DataSpec)
add_subdirectory(kabufuda) add_subdirectory(extern/kabufuda)
add_subdirectory(jbus) add_subdirectory(extern/jbus)
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jbus/include) set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/jbus/include)
set(CLIENT_SOURCES set(CLIENT_SOURCES
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.hpp ${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.hpp
@ -343,35 +416,25 @@ add_subdirectory(visigen)
add_dependencies(hecl visigen) add_dependencies(hecl visigen)
if (NOT WINDOWS_STORE AND NOT NX) if (NOT WINDOWS_STORE AND NOT NX)
find_package(Qt5Widgets PATHS /usr/local/opt/qt) if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
if (Qt5Widgets_FOUND) set(QT_HOMEBREW_PATH /usr/local/opt/qt)
message(STATUS "Qt5 found, hecl-gui will be built") elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
add_subdirectory(hecl-gui) set(QT_HOMEBREW_PATH /opt/homebrew/opt/qt)
else() else()
message(STATUS "Qt5 not found, hecl-gui will not be built") set(QT_HOMEBREW_PATH "")
endif()
endif() endif()
unset(GIT_EXECUTABLE CACHE) find_package(Qt6Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
find_package(Git) find_package(Qt5Widgets QUIET PATHS ${QT_HOMEBREW_PATH})
if(GIT_FOUND) if (Qt6Widgets_FOUND)
# Get the current working branch message(STATUS "Qt6 found, metaforce-gui will be built")
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" add_subdirectory(metaforce-gui)
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) elseif(Qt5Widgets_FOUND)
message(STATUS "Qt5 found, metaforce-gui will be built")
# Get the latest abbreviated commit hash of the working branch add_subdirectory(metaforce-gui)
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)
else() else()
message(STATUS "Unable to find GIT, commit information will not be available") message(STATUS "Qt5-6 not found, metaforce-gui will not be built")
set(GIT_BRANCH "") endif()
set(GIT_COMMIT_HASH "")
set(GIT_COMMIT_HASH_FULL "")
set(GIT_COMMIT_DATE "")
endif() endif()
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h) configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)

View File

@ -13,7 +13,7 @@
"variables": [ "variables": [
{ {
"name": "CMAKE_MSVC_RUNTIME_LIBRARY", "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug", "value": "MultiThreadedDebugDLL",
"type": "STRING" "type": "STRING"
}, },
{ {
@ -30,16 +30,6 @@
"name": "CMAKE_LINKER", "name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe", "value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH" "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": [ "variables": [
{ {
"name": "CMAKE_MSVC_RUNTIME_LIBRARY", "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded", "value": "MultiThreadedDLL",
"type": "STRING" "type": "STRING"
}, },
{ {
@ -73,16 +63,6 @@
"name": "CMAKE_LINKER", "name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe", "value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH" "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", "name": "CMAKE_LINKER",
"value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe", "value": "C:\\Program Files\\LLVM\\bin\\lld-link.exe",
"type": "FILEPATH" "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": [ "variables": [
{ {
"name": "CMAKE_MSVC_RUNTIME_LIBRARY", "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebug", "value": "MultiThreadedDebugDLL",
"type": "STRING" "type": "STRING"
}, },
{ {
@ -180,7 +150,7 @@
"variables": [ "variables": [
{ {
"name": "CMAKE_MSVC_RUNTIME_LIBRARY", "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded", "value": "MultiThreadedDLL",
"type": "STRING" "type": "STRING"
}, },
{ {

View File

@ -1002,7 +1002,10 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
FinishBlenderMesh(os, matSetCount, meshIdx); FinishBlenderMesh(os, matSetCount, meshIdx);
if (rp.first.second) { 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); os.format(FMT_STRING("mesh.cskr_id = '{}'\n"), rp.first.first);
}
rp.second.second->sendVertexGroupsToBlender(os); 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*>>, std::pair<std::pair<UniqueID32, DNAMP1::CSKR*>, std::pair<UniqueID32, DNAMP1::CINF*>>,
DNACMDL::SurfaceHeader_1>( DNACMDL::SurfaceHeader_1>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP1::PAKBridge>& pakRouter, 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, 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, bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount); 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*>>, std::pair<std::pair<UniqueID32, DNAMP2::CSKR*>, std::pair<UniqueID32, DNAMP2::CINF*>>,
DNACMDL::SurfaceHeader_2>( DNACMDL::SurfaceHeader_2>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP2::PAKBridge>& pakRouter, 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, 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, bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount); 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*>>, std::pair<std::pair<UniqueID64, DNAMP3::CSKR*>, std::pair<UniqueID64, DNAMP3::CINF*>>,
DNACMDL::SurfaceHeader_3>( DNACMDL::SurfaceHeader_3>(
hecl::blender::PyOutStream& os, athena::io::IStreamReader& reader, PAKRouter<DNAMP3::PAKBridge>& pakRouter, 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, 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, bool shortUVs, std::vector<VertexAttributes>& vertAttribs, int meshIdx, atUint32 secCount, atUint32 matSetCount,
const atUint32* secSizes, atUint32 surfaceCount); const atUint32* secSizes, atUint32 surfaceCount);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#include "ParticleCommon.hpp" #include "ParticleCommon.hpp"
namespace DataSpec::DNAParticle { namespace DataSpec::DNAParticle {
logvisor::Module LogModule("urde::DNAParticle"); logvisor::Module LogModule("DataSpec::DNAParticle");
template struct PEImpl<_RealElementFactory>; template struct PEImpl<_RealElementFactory>;
template struct PEImpl<_IntElementFactory>; 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_infop info = png_create_info_struct(png);
png_text textStruct = {}; png_text textStruct = {};
textStruct.key = png_charp("urde_nomip"); textStruct.key = png_charp("metaforce_nomip");
if (numMips == 1) if (numMips == 1)
png_set_text(png, info, &textStruct, 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; return false;
} }
/* Disable mipmapping if urde_nomip embedded */ /* Disable mipmapping if metaforce_nomip embedded */
bool mipmap = true; bool mipmap = true;
png_text* textStruct; png_text* textStruct;
int numText; int numText;
png_get_text(pngRead, info, &textStruct, &numText); png_get_text(pngRead, info, &textStruct, &numText);
for (int i = 0; i < numText; ++i) { 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; 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 colorType = png_get_color_type(pngRead, info);
const png_byte bitDepth = png_get_bit_depth(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; bool mipmap = true;
png_text* textStruct; png_text* textStruct;
int numText; int numText;
png_get_text(pngRead, info, &textStruct, &numText); png_get_text(pngRead, info, &textStruct, &numText);
for (int i = 0; i < numText; ++i) { 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; mipmap = false;
} }
} }

View File

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

View File

@ -9,8 +9,8 @@
namespace DataSpec { namespace DataSpec {
struct ITweakPlayerRes : ITweak { struct ITweakPlayerRes : ITweak {
using ResId = urde::CAssetId; using ResId = metaforce::CAssetId;
using EBeamId = urde::CPlayerState::EBeamId; using EBeamId = metaforce::CPlayerState::EBeamId;
ResId x4_saveStationIcon; ResId x4_saveStationIcon;
ResId x8_missileStationIcon; 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; x4_saveStationIcon = factory.GetResourceIdByName(_GetSaveStationIcon())->id;
x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon())->id; x8_missileStationIcon = factory.GetResourceIdByName(_GetMissileStationIcon())->id;
xc_elevatorIcon = factory.GetResourceIdByName(_GetElevatorIcon())->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); 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 <> template <>
void AFSM::State::Transition::Trigger::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) { 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() { 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 } // 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() { 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 <> template <>
@ -315,7 +315,7 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::Enumerate<BigDNA
} }
std::string_view ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::DNAType() { 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 <> template <>
@ -606,7 +606,7 @@ void ANCS::CharacterSet::CharacterInfo::Enumerate<BigDNA::WriteYaml>(athena::io:
} }
std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() { std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
return "urde::DNAMP1::ANCS::CharacterSet::CharacterInfo"sv; return "DNAMP1::ANCS::CharacterSet::CharacterInfo"sv;
} }
template <> template <>
@ -688,7 +688,7 @@ void ANCS::AnimationSet::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::i
} }
std::string_view ANCS::AnimationSet::MetaAnimFactory::DNAType() { std::string_view ANCS::AnimationSet::MetaAnimFactory::DNAType() {
return "urde::DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv; return "DNAMP1::ANCS::AnimationSet::MetaAnimFactory"sv;
} }
template <> template <>
@ -761,7 +761,7 @@ void ANCS::AnimationSet::MetaTransFactory::Enumerate<BigDNA::WriteYaml>(athena::
} }
std::string_view ANCS::AnimationSet::MetaTransFactory::DNAType() { std::string_view ANCS::AnimationSet::MetaTransFactory::DNAType() {
return "urde::DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv; return "DNAMP1::ANCS::AnimationSet::MetaTransFactory"sv;
} }
template <> template <>
@ -955,7 +955,7 @@ void ANCS::AnimationSet::MetaAnimPrimitive::gatherPrimitives(
out[animIdx] = {animName, animId, ANIM::GetEVNTId(rs), false}; 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, 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, 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()); Log.report(logvisor::Fatal, FMT_STRING(_SYS_STR("can't open '{}' for reading")), yamlPath.getRelativePath());
if (!athena::io::ValidateFromYAMLStream<ANCS>(reader)) { 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; athena::io::YAMLDocReader yamlReader;

View File

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

View File

@ -23,6 +23,6 @@ void EVNT::Enumerate(typename Op::StreamT& s) {
AT_SPECIALIZE_DNA_YAML(EVNT) 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 } // 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> depPaths;
std::vector<hecl::ProjectPath> lazyPaths; std::vector<hecl::ProjectPath> lazyPaths;
for (std::unique_ptr<IScriptObject>& obj : layer.objects) { 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); MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
for (IScriptObject::Connection& conn : memRelay.connections) { for (IScriptObject::Connection& conn : memRelay.connections) {
MemRelayLink linkOut; MemRelayLink linkOut;
@ -319,7 +319,7 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
areaOut.depLayers.push_back(areaOut.deps.size()); areaOut.depLayers.push_back(areaOut.deps.size());
for (const std::pair<hecl::ProjectPath, bool>& path : layer) { for (const std::pair<hecl::ProjectPath, bool>& path : layer) {
if (path.first) { if (path.first) {
urde::SObjectTag tag = g_curSpec->buildTagFromPath(path.first); metaforce::SObjectTag tag = g_curSpec->buildTagFromPath(path.first);
if (tag.id.IsValid()) { if (tag.id.IsValid()) {
if (path.second) if (path.second)
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type); 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); layerResources.addSharedPath(path, false);
for (const std::pair<hecl::ProjectPath, bool>& path : layerResources.sharedPaths) { 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 (tag.id.IsValid()) {
if (path.second) if (path.second)
areaOut.lazyDeps.emplace_back(tag.id.Value(), tag.type); 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_")); 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()) { if (pathTag.id.IsValid()) {
areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type); areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type);
areaOut.lazyDeps.emplace_back(0, FOURCC('NONE')); 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) { 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()); mapaTags.reserve(wld.areas.size());
for (const World::Area& area : wld.areas) { 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(0xDEADF00D);
fo.writeUint32Big(1); fo.writeUint32Big(1);
fo.writeUint32Big(mapaTags.size()); fo.writeUint32Big(mapaTags.size());
for (const urde::SObjectTag& mapa : mapaTags) for (const metaforce::SObjectTag& mapa : mapaTags)
fo.writeUint32Big(u32(mapa.id.Value())); fo.writeUint32Big(u32(mapa.id.Value()));
int64_t rem = fo.position() % 32; int64_t rem = fo.position() % 32;
if (rem) if (rem)
@ -479,7 +479,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
{ {
std::vector<Scan> scans; std::vector<Scan> scans;
for (std::unique_ptr<IScriptObject>& obj : layer.objects) { 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); MemoryRelay& memRelay = static_cast<MemoryRelay&>(*obj);
auto iter = std::find(memRelays.begin(), memRelays.end(), memRelay.id); auto iter = std::find(memRelays.begin(), memRelays.end(), memRelay.id);
if (iter == memRelays.end()) { if (iter == memRelays.end()) {
@ -487,7 +487,7 @@ bool MLVL::CookSAVW(const hecl::ProjectPath& outPath, const World& wld) {
savw.relays.push_back(memRelay.id); savw.relays.push_back(memRelay.id);
memRelays.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); SpecialFunction& specialFunc = static_cast<SpecialFunction&>(*obj);
if (specialFunc.function == ESpecialFunctionType::CinematicSkip) if (specialFunc.function == ESpecialFunctionType::CinematicSkip)
savw.skippableCutscenes.push_back(specialFunc.id); 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.areaId = specialFunc.layerSwitch.area;
layer.layer = specialFunc.layerSwitch.layerIdx; 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); DoorArea& doorArea = static_cast<DoorArea&>(*obj);
savw.doors.push_back(doorArea.id); 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); 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 <> template <>
void SCAN::Texture::Enumerate<BigDNA::BinarySize>(typename BinarySize::StreamT& s) { 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); docout.enumerate("layers", layers);
} }
std::string_view SCLY::DNAType() { return "urde::DNAMP1::SCLY"sv; } std::string_view SCLY::DNAType() { return "DNAMP1::SCLY"sv; }
template <> template <>
void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) { 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 } // 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 } // namespace DataSpec::DNAMP1

View File

@ -26,7 +26,7 @@ void Oculus::Enumerate(typename Op::StreamT& s) {
unknown8 = 0.f; 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) 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); 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) 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) AT_SPECIALIZE_DNA_YAML(WorldTeleporter)

View File

@ -3,56 +3,95 @@
#include <hecl/CVar.hpp> #include <hecl/CVar.hpp>
#include <hecl/CVarManager.hpp> #include <hecl/CVarManager.hpp>
namespace DataSpec::DNAMP1 { #define DEFINE_CVAR_GLOBAL(name) \
hecl::CVar* tw_fov = nullptr; constexpr std::string_view sk##name = std::string_view("tweak.game." #name); \
hecl::CVar* tw_hardmodeDMult = nullptr; hecl::CVar* tw_##name = 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
void CTweakGame::_tweakGameListener(hecl::CVar* cv) { #define CREATE_CVAR(name, help, value, flags) \
if (cv == tw_fov) { tw_##name = mgr->findOrMakeCVar(sk##name, help, value, flags); \
x24_fov = cv->toReal(); if (tw_##name->wasDeserialized()) { \
} else if (cv == tw_hardmodeDMult) { tw_##name->toValue(value); \
x60_hardmodeDamageMult = cv->toReal(); } \
} else if (cv == tw_hardmodeWMult) { tw_##name->addListener([this](hecl::CVar* cv) { _tweakListener(cv); });
x64_hardmodeWeaponMult = cv->toReal();
} else if (cv == tw_splashScreensDisabled) { #define CREATE_CVAR_BITFIELD(name, help, value, flags) \
x2b_splashScreensDisabled = cv->toBoolean(); { \
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) { void CTweakGame::initCVars(hecl::CVarManager* mgr) {
auto assignRealValue = [this, mgr](std::string_view name, std::string_view desc, float& v, hecl::CVar::EFlags flags) { constexpr hecl::CVar::EFlags skDefaultFlags = hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive;
hecl::CVar* cv = mgr->findOrMakeCVar(name, desc, v, flags); CREATE_CVAR(WorldPrefix, "", x4_worldPrefix, skDefaultFlags);
// Check if the CVar was deserialized, this avoid an unnecessary conversion CREATE_CVAR(FieldOfView, "", x24_fov, skDefaultFlags);
if (cv->wasDeserialized()) CREATE_CVAR(SplashScreensDisabled, "", x2b_splashScreensDisabled,
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,
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive); 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 } // namespace DataSpec::DNAMP1

View File

@ -4,10 +4,33 @@
namespace hecl { namespace hecl {
class CVar; class CVar;
} } // namespace hecl
namespace DataSpec::DNAMP1 { 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 { struct CTweakGame final : ITweakGame {
AT_DECL_DNA_YAML AT_DECL_DNA_YAML
String<-1> x4_worldPrefix; String<-1> x4_worldPrefix;
@ -23,7 +46,7 @@ struct CTweakGame final : ITweakGame {
Value<float> x38_wavecapIntensityPoison; Value<float> x38_wavecapIntensityPoison;
Value<float> x3c_wavecapIntensityLava; Value<float> x3c_wavecapIntensityLava;
Value<float> x40_rippleIntensityNormal; Value<float> x40_rippleIntensityNormal;
Value<float> x44_rippleIntentityPoison; Value<float> x44_rippleIntensityPoison;
Value<float> x48_rippleIntensityLava; Value<float> x48_rippleIntensityLava;
Value<float> x4c_fluidEnvBumpScale; Value<float> x4c_fluidEnvBumpScale;
Value<float> x50_waterFogDistanceBase; Value<float> x50_waterFogDistanceBase;
@ -42,7 +65,7 @@ struct CTweakGame final : ITweakGame {
float GetWavecapIntensityPoison() const override { return x38_wavecapIntensityPoison; } float GetWavecapIntensityPoison() const override { return x38_wavecapIntensityPoison; }
float GetWavecapIntensityLava() const override { return x3c_wavecapIntensityLava; } float GetWavecapIntensityLava() const override { return x3c_wavecapIntensityLava; }
float GetRippleIntensityNormal() const override { return x40_rippleIntensityNormal; } 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 GetRippleIntensityLava() const override { return x48_rippleIntensityLava; }
float GetFluidEnvBumpScale() const override { return x4c_fluidEnvBumpScale; } float GetFluidEnvBumpScale() const override { return x4c_fluidEnvBumpScale; }
float GetWaterFogDistanceBase() const override { return x50_waterFogDistanceBase; } float GetWaterFogDistanceBase() const override { return x50_waterFogDistanceBase; }
@ -60,7 +83,8 @@ struct CTweakGame final : ITweakGame {
} }
void initCVars(hecl::CVarManager* mgr) override; void initCVars(hecl::CVarManager* mgr) override;
private: private:
void _tweakGameListener(hecl::CVar* cv); void _tweakListener(hecl::CVar* cv);
}; };
} // namespace DataSpec::DNAMP1 } // namespace DataSpec::DNAMP1

View File

@ -1,8 +1,261 @@
#include "CTweakPlayer.hpp" #include "CTweakPlayer.hpp"
#include "zeus/Math.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 <> template <>
void CTweakPlayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) { void CTweakPlayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& __dna_reader) {
/* x4_maxTranslationalAcceleration[0] */ /* x4_maxTranslationalAcceleration[0] */
@ -1900,9 +2153,504 @@ void CTweakPlayer::FixupValues() {
} }
std::string_view CTweakPlayer::DNAType() { return "DataSpec::DNAMP1::CTweakPlayer"sv; } std::string_view CTweakPlayer::DNAType() { return "DataSpec::DNAMP1::CTweakPlayer"sv; }
template <> template <>
void CTweakPlayer::Enumerate<BigDNA::BinarySize>(size_t& __isz) { void CTweakPlayer::Enumerate<BigDNA::BinarySize>(size_t& __isz) {
__isz += 785; __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 } // namespace DataSpec::DNAMP1

View File

@ -1,6 +1,10 @@
#pragma once #pragma once
#include "../../DNACommon/Tweaks/ITweakPlayer.hpp" #include "DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp"
namespace hecl {
class CVar;
}
namespace DataSpec::DNAMP1 { namespace DataSpec::DNAMP1 {
@ -310,6 +314,8 @@ struct CTweakPlayer final : ITweakPlayer {
} }
void FixupValues(); void FixupValues();
void initCVars(hecl::CVarManager* mgr) override;
void _tweakListener(hecl::CVar* cv);
}; };
} // namespace DataSpec::DNAMP1 } // 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() { std::string_view ANCS::CharacterSet::CharacterInfo::DNAType() {
return "urde::DNAMP2::ANCS::CharacterSet::CharacterInfo"sv; return "DNAMP2::ANCS::CharacterSet::CharacterInfo"sv;
} }
template <> 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> template <class Op>
void ANCS::AnimationSet::EVNT::Enumerate(typename Op::StreamT& s) { 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) 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 } // namespace DataSpec::DNAMP2

View File

@ -22,7 +22,7 @@
#include "Runtime/GCNTypes.hpp" #include "Runtime/GCNTypes.hpp"
namespace DataSpec::DNAMP2 { namespace DataSpec::DNAMP2 {
logvisor::Module Log("urde::DNAMP2"); logvisor::Module Log("DataSpec::DNAMP2");
static bool GetNoShare(std::string_view name) { static bool GetNoShare(std::string_view name) {
std::string lowerName(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 } // 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() { std::string_view CHAR::AnimationInfo::EVNT::SFXEvent::DNAType() {
return "urde::DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv; return "DNAMP3::CHAR::AnimationInfo::EVNT::SFXEvent"sv;
} }
template <> template <>
@ -151,7 +151,7 @@ void CHAR::AnimationInfo::MetaAnimFactory::Enumerate<BigDNA::WriteYaml>(athena::
} }
std::string_view CHAR::AnimationInfo::MetaAnimFactory::DNAType() { std::string_view CHAR::AnimationInfo::MetaAnimFactory::DNAType() {
return "urde::DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv; return "DNAMP3::CHAR::AnimationInfo::MetaAnimFactory"sv;
} }
} // namespace DataSpec::DNAMP3 } // namespace DataSpec::DNAMP3

View File

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

View File

@ -8,7 +8,7 @@
#include "DataSpec/DNACommon/DNACommon.hpp" #include "DataSpec/DNACommon/DNACommon.hpp"
#include "DataSpec/DNACommon/TXTR.hpp" #include "DataSpec/DNACommon/TXTR.hpp"
#include "DataSpec/AssetNameMap.hpp" #include "DataSpec/AssetNameMap.hpp"
#include "DataSpec/DNACommon/URDEVersionInfo.hpp" #include "DataSpec/DNACommon/MetaforceVersionInfo.hpp"
#include "hecl/ClientProcess.hpp" #include "hecl/ClientProcess.hpp"
#include "nod/DiscBase.hpp" #include "nod/DiscBase.hpp"
#include "nod/nod.hpp" #include "nod/nod.hpp"
@ -22,7 +22,7 @@
namespace DataSpec { 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"), static const hecl::SystemChar* MomErr[] = {_SYS_STR("Your metroid is in another castle"),
_SYS_STR("HECL is experiencing a PTSD attack"), _SYS_STR("HECL is experiencing a PTSD attack"),
@ -441,8 +441,8 @@ bool SpecBase::canPackage(const hecl::ProjectPath& path) {
return path.isFile() || path.isDirectory(); return path.isFile() || path.isDirectory();
} }
void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut, void SpecBase::recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
std::unordered_set<urde::SObjectTag>& addedTags, std::unordered_set<metaforce::SObjectTag>& addedTags,
const hecl::ProjectPath& path, hecl::blender::Token& btok) { const hecl::ProjectPath& path, hecl::blender::Token& btok) {
hecl::DirectoryEnumerator dEnum(path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, false, hecl::DirectoryEnumerator dEnum(path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted, false,
false, true); false, true);
@ -452,7 +452,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
if (hecl::ProjectPath(childPath, _SYS_STR("!project.yaml")).isFile() && if (hecl::ProjectPath(childPath, _SYS_STR("!project.yaml")).isFile() &&
hecl::ProjectPath(childPath, _SYS_STR("!pool.yaml")).isFile()) { hecl::ProjectPath(childPath, _SYS_STR("!pool.yaml")).isFile()) {
/* Handle AudioGroup case */ /* Handle AudioGroup case */
if (urde::SObjectTag tag = tagFromPath(childPath)) { if (metaforce::SObjectTag tag = tagFromPath(childPath)) {
if (addedTags.find(tag) != addedTags.end()) if (addedTags.find(tag) != addedTags.end())
continue; continue;
addedTags.insert(tag); addedTags.insert(tag);
@ -466,7 +466,7 @@ void SpecBase::recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut
std::vector<hecl::ProjectPath> subPaths; std::vector<hecl::ProjectPath> subPaths;
flattenDependencies(childPath, subPaths, btok); flattenDependencies(childPath, subPaths, btok);
for (const auto& subPath : subPaths) { for (const auto& subPath : subPaths) {
if (urde::SObjectTag tag = tagFromPath(subPath)) { if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
if (addedTags.find(tag) != addedTags.end()) if (addedTags.find(tag) != addedTags.end())
continue; continue;
addedTags.insert(tag); 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, 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::Database::DataSpecEntry* entry, bool fast,
const hecl::MultiProgressPrinter& progress, athena::io::FileWriter& pakOut, 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()); fileIndex.reserve(buildList.size());
int loadIdx = 0; int loadIdx = 0;
for (const auto& tag : buildList) { for (const auto& tag : buildList) {
@ -564,9 +564,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Output file */ /* Output file */
athena::io::FileWriter pakOut(outPath.getAbsolutePath()); athena::io::FileWriter pakOut(outPath.getAbsolutePath());
std::vector<urde::SObjectTag> buildList; std::vector<metaforce::SObjectTag> buildList;
atUint64 resTableOffset = 0; 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 */ 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 */ } else if (path.getPathType() == hecl::ProjectPath::Type::Directory) /* General PAK */
{ {
/* Build resource list */ /* Build resource list */
std::unordered_set<urde::SObjectTag> addedTags; std::unordered_set<metaforce::SObjectTag> addedTags;
recursiveBuildResourceList(buildList, addedTags, path, btok); 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 */ /* Build name list */
for (const auto& item : buildList) { for (const auto& item : buildList) {
@ -605,10 +605,10 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
/* Build resource list */ /* Build resource list */
std::vector<hecl::ProjectPath> subPaths; std::vector<hecl::ProjectPath> subPaths;
flattenDependencies(path, subPaths, btok); flattenDependencies(path, subPaths, btok);
std::unordered_set<urde::SObjectTag> addedTags; std::unordered_set<metaforce::SObjectTag> addedTags;
std::vector<std::pair<urde::SObjectTag, std::string>> nameList; std::vector<std::pair<metaforce::SObjectTag, std::string>> nameList;
for (const auto& subPath : subPaths) { for (const auto& subPath : subPaths) {
if (urde::SObjectTag tag = tagFromPath(subPath)) { if (metaforce::SObjectTag tag = tagFromPath(subPath)) {
if (addedTags.find(tag) != addedTags.end()) if (addedTags.find(tag) != addedTags.end())
continue; continue;
addedTags.insert(tag); addedTags.insert(tag);
@ -635,12 +635,12 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
if (cp) { if (cp) {
Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources"))); Log.report(logvisor::Info, FMT_STRING(_SYS_STR("Validating resources")));
progress.setMainIndeterminate(true); progress.setMainIndeterminate(true);
std::vector<urde::SObjectTag> cookTags; std::vector<metaforce::SObjectTag> cookTags;
cookTags.reserve(buildList.size()); cookTags.reserve(buildList.size());
/* Ensure CMDLs are enqueued first to minimize synchronous dependency cooking */ /* Ensure CMDLs are enqueued first to minimize synchronous dependency cooking */
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
std::unordered_set<urde::SObjectTag> addedTags; std::unordered_set<metaforce::SObjectTag> addedTags;
addedTags.reserve(buildList.size()); addedTags.reserve(buildList.size());
for (auto& tag : buildList) { for (auto& tag : buildList) {
if ((i == 0 && tag.type == FOURCC('CMDL')) || (i == 1 && tag.type != FOURCC('CMDL'))) { 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_infop info = png_create_info_struct(png);
png_text textStruct = {}; png_text textStruct = {};
textStruct.key = png_charp("urde_nomip"); textStruct.key = png_charp("meta_nomip");
png_set_text(png, info, &textStruct, 1); 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, 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(); 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); std::unique_lock lk(m_backgroundIndexMutex);
auto search = m_tagToPath.find(tag); auto search = m_tagToPath.find(tag);
if (search != m_tagToPath.cend()) if (search != m_tagToPath.cend())
@ -769,14 +769,14 @@ hecl::ProjectPath SpecBase::pathFromTag(const urde::SObjectTag& tag) const {
return {}; 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()); auto search = m_pathToTag.find(path.hash());
if (search != m_pathToTag.cend()) if (search != m_pathToTag.cend())
return search->second; return search->second;
return buildTagFromPath(path); 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); std::unique_lock lk(m_backgroundIndexMutex);
auto search = m_tagToPath.find(tag); auto search = m_tagToPath.find(tag);
if (search == m_tagToPath.end()) { if (search == m_tagToPath.end()) {
@ -799,7 +799,7 @@ bool SpecBase::waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectP
return true; 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::string lower(name);
std::transform(lower.cbegin(), lower.cend(), lower.begin(), tolower); 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; return &search->second;
} }
FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const { FourCC SpecBase::getResourceTypeById(metaforce::CAssetId id) const {
if (!id.IsValid()) if (!id.IsValid())
return {}; return {};
std::unique_lock lk(m_backgroundIndexMutex); std::unique_lock lk(m_backgroundIndexMutex);
urde::SObjectTag searchTag = {FourCC(), id}; metaforce::SObjectTag searchTag = {FourCC(), id};
auto search = m_tagToPath.find(searchTag); auto search = m_tagToPath.find(searchTag);
if (search == m_tagToPath.end()) { if (search == m_tagToPath.end()) {
if (m_backgroundRunning) { if (m_backgroundRunning) {
@ -849,7 +849,7 @@ FourCC SpecBase::getResourceTypeById(urde::CAssetId id) const {
return search->first.type; 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(); waitForIndexComplete();
for (const auto& pair : m_tagToPath) { for (const auto& pair : m_tagToPath) {
if (!lambda(pair.first)) if (!lambda(pair.first))
@ -858,7 +858,7 @@ void SpecBase::enumerateResources(const std::function<bool(const urde::SObjectTa
} }
void SpecBase::enumerateNamedResources( 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(); waitForIndexComplete();
for (const auto& pair : m_catalogNameToTag) { for (const auto& pair : m_catalogNameToTag) {
if (!lambda(pair.first, pair.second)) 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) { const hecl::ProjectPath& path) {
auto key = fmt::format(FMT_STRING("{}"), pathTag.id); auto key = fmt::format(FMT_STRING("{}"), pathTag.id);
if (auto* existing = cacheWriter.getCurNode()->findMapChild(key)) { 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) { std::string_view name) {
nameWriter.writeString(name.data(), fmt::format(FMT_STRING("{}"), pathTag.id)); 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()) if (path.isNone())
continue; continue;
urde::SObjectTag pathTag = tagFromPath(path); metaforce::SObjectTag pathTag = tagFromPath(path);
if (pathTag) { if (pathTag) {
std::unique_lock lk(m_backgroundIndexMutex); std::unique_lock lk(m_backgroundIndexMutex);
m_catalogNameToTag[pLower] = pathTag; 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) { const hecl::ProjectPath& path, bool dump) {
#if 0 #if 0
auto search = m_tagToPath.find(tag); auto search = m_tagToPath.find(tag);
@ -989,7 +989,7 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDoc
return true; return true;
/* Classify intermediate into tag */ /* Classify intermediate into tag */
urde::SObjectTag pathTag = buildTagFromPath(path); metaforce::SObjectTag pathTag = buildTagFromPath(path);
if (pathTag) { if (pathTag) {
std::unique_lock lk{m_backgroundIndexMutex}; std::unique_lock lk{m_backgroundIndexMutex};
bool useGlob = false; 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()) { if (hecl::ProjectPath(path, "!project.yaml").isFile() && hecl::ProjectPath(path, "!pool.yaml").isFile()) {
/* Avoid redundant filesystem access for re-caches */ /* Avoid redundant filesystem access for re-caches */
if (m_pathToTag.find(path.hash()) == m_pathToTag.cend()) { 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); insertPathTag(cacheWriter, pathTag, path);
} }
} else { } else {
@ -1138,7 +1138,7 @@ void SpecBase::backgroundIndexProc() {
if (node.m_seqChildren.size() >= 2) { if (node.m_seqChildren.size() >= 2) {
unsigned long id = strtoul(child.first.c_str(), nullptr, 16); unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
hecl::FourCC type(node.m_seqChildren[0]->m_scalarString.c_str()); 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) { 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); hecl::ProjectPath path(m_project.getProjectWorkingPath(), (*I)->m_scalarString);
if (!path.isNone()) if (!path.isNone())
@ -1166,7 +1166,7 @@ void SpecBase::backgroundIndexProc() {
m_catalogTagToNames.reserve(nameReader.getRootNode()->m_mapChildren.size()); m_catalogTagToNames.reserve(nameReader.getRootNode()->m_mapChildren.size());
for (const auto& child : nameReader.getRootNode()->m_mapChildren) { for (const auto& child : nameReader.getRootNode()->m_mapChildren) {
unsigned long id = strtoul(child.second->m_scalarString.c_str(), nullptr, 16); 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()) { if (search != m_tagToPath.cend()) {
std::string chLower = child.first; std::string chLower = child.first;
std::transform(chLower.cbegin(), chLower.cend(), chLower.begin(), tolower); 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")); hecl::ProjectPath versionPath(pakPath, _SYS_STR("version.yaml"));
versionPath.makeDirChain(false); versionPath.makeDirChain(false);
URDEVersionInfo info; MetaforceVersionInfo info;
info.version = m_version; info.version = m_version;
info.region = m_region; info.region = m_region;
info.game = m_game; 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; virtual bool extractFromDisc(nod::DiscBase& disc, bool force, const hecl::MultiProgressPrinter& progress) = 0;
/* Convert path to object tag */ /* 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 */ /* Even if PC spec is being cooked, this will return the vanilla GCN spec */
virtual const hecl::Database::DataSpecEntry& getOriginalSpec() const = 0; 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, virtual void buildWorldPakList(const hecl::ProjectPath& worldPath, const hecl::ProjectPath& worldPathCooked,
hecl::blender::Token& btok, athena::io::FileWriter& w, hecl::blender::Token& btok, athena::io::FileWriter& w,
std::vector<urde::SObjectTag>& listOut, atUint64& resTableOffset, std::vector<metaforce::SObjectTag>& listOut, atUint64& resTableOffset,
std::unordered_map<urde::CAssetId, std::vector<uint8_t>>& mlvlData) {} std::unordered_map<metaforce::CAssetId, std::vector<uint8_t>>& mlvlData) {}
virtual void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w, virtual void buildPakList(hecl::blender::Token& btok, athena::io::FileWriter& w,
const std::vector<urde::SObjectTag>& list, const std::vector<metaforce::SObjectTag>& list,
const std::vector<std::pair<urde::SObjectTag, std::string>>& nameList, const std::vector<std::pair<metaforce::SObjectTag, std::string>>& nameList,
atUint64& resTableOffset) {} 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) {} 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) { const uint8_t* data, size_t len) {
return {}; return {};
} }
@ -149,19 +149,19 @@ struct SpecBase : hecl::Database::IDataSpec {
void extractRandomStaticEntropy(const uint8_t* buf, const hecl::ProjectPath& pakPath); void extractRandomStaticEntropy(const uint8_t* buf, const hecl::ProjectPath& pakPath);
/* Tag cache functions */ /* Tag cache functions */
urde::SObjectTag tagFromPath(const hecl::ProjectPath& path) const; metaforce::SObjectTag tagFromPath(const hecl::ProjectPath& path) const;
hecl::ProjectPath pathFromTag(const urde::SObjectTag& tag) const; hecl::ProjectPath pathFromTag(const metaforce::SObjectTag& tag) const;
bool waitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut); bool waitForTagReady(const metaforce::SObjectTag& tag, const hecl::ProjectPath*& pathOut);
const urde::SObjectTag* getResourceIdByName(std::string_view name) const; const metaforce::SObjectTag* getResourceIdByName(std::string_view name) const;
hecl::FourCC getResourceTypeById(urde::CAssetId id) const; hecl::FourCC getResourceTypeById(metaforce::CAssetId id) const;
void enumerateResources(const std::function<bool(const urde::SObjectTag&)>& lambda) const; void enumerateResources(const std::function<bool(const metaforce::SObjectTag&)>& lambda) const;
void enumerateNamedResources(const std::function<bool(std::string_view, const urde::SObjectTag&)>& lambda) const; void enumerateNamedResources(const std::function<bool(std::string_view, const metaforce::SObjectTag&)>& lambda) const;
void cancelBackgroundIndex(); void cancelBackgroundIndex();
void beginBackgroundIndex(); void beginBackgroundIndex();
bool backgroundIndexRunning() const { return m_backgroundRunning; } bool backgroundIndexRunning() const { return m_backgroundRunning; }
void waitForIndexComplete() const; 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(const hecl::Database::DataSpecEntry* specEntry, hecl::Database::Project& project, bool pc);
~SpecBase(); ~SpecBase();
@ -171,10 +171,10 @@ protected:
bool m_pc; bool m_pc;
hecl::ProjectPath m_masterShader; hecl::ProjectPath m_masterShader;
std::unordered_multimap<urde::SObjectTag, hecl::ProjectPath> m_tagToPath; std::unordered_multimap<metaforce::SObjectTag, hecl::ProjectPath> m_tagToPath;
std::unordered_map<hecl::Hash, urde::SObjectTag> m_pathToTag; std::unordered_map<hecl::Hash, metaforce::SObjectTag> m_pathToTag;
std::unordered_map<std::string, urde::SObjectTag> m_catalogNameToTag; std::unordered_map<std::string, metaforce::SObjectTag> m_catalogNameToTag;
std::unordered_map<urde::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames; std::unordered_map<metaforce::SObjectTag, std::unordered_set<std::string>> m_catalogTagToNames;
void clearTagCache(); void clearTagCache();
hecl::blender::Token m_backgroundBlender; hecl::blender::Token m_backgroundBlender;
@ -183,7 +183,7 @@ protected:
bool m_backgroundRunning = false; bool m_backgroundRunning = false;
void readCatalog(const hecl::ProjectPath& catalogPath, athena::io::YAMLDocWriter& nameWriter); 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 dump = true);
bool addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter); bool addFileToIndex(const hecl::ProjectPath& path, athena::io::YAMLDocWriter& cacheWriter);
void backgroundIndexRecursiveProc(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); int level);
void backgroundIndexProc(); void backgroundIndexProc();
void recursiveBuildResourceList(std::vector<urde::SObjectTag>& listOut, void recursiveBuildResourceList(std::vector<metaforce::SObjectTag>& listOut,
std::unordered_set<urde::SObjectTag>& addedTags, const hecl::ProjectPath& path, std::unordered_set<metaforce::SObjectTag>& addedTags, const hecl::ProjectPath& path,
hecl::blender::Token& btok); hecl::blender::Token& btok);
void copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex, 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, 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; std::unique_ptr<nod::DiscBase> m_disc;
bool m_isWii{}; bool m_isWii{};

View File

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

View File

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

View File

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

View File

@ -2,17 +2,11 @@ add_subdirectory(locale)
add_subdirectory(icons) add_subdirectory(icons)
add_subdirectory(badging) add_subdirectory(badging)
if(URDE_DLPACKAGE)
set(METADATA_VERSION_STRING ${URDE_DLPACKAGE})
else()
set(METADATA_VERSION_STRING "BETA")
endif()
unset(URDE_PLAT_LIBS) unset(URDE_PLAT_LIBS)
if(WIN32) if(WIN32)
configure_file(platforms/win/urde.rc.in "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/urde.rc" @ONLY) 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/urde.rc" platforms/win/urde.manifest) set(PLAT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/platforms/win/metaforce.rc" platforms/win/metaforce.manifest)
if(WINDOWS_STORE) if(WINDOWS_STORE)
set(UWP_ASSETS set(UWP_ASSETS
platforms/win/Assets/LargeTile.scale-100.png 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-150.png
platforms/win/Assets/Square150x150Logo.scale-200.png platforms/win/Assets/Square150x150Logo.scale-200.png
platforms/win/Assets/Square150x150Logo.scale-400.png platforms/win/Assets/Square150x150Logo.scale-400.png
platforms/win/Assets/urde.scale-100.png platforms/win/Assets/metaforce.scale-100.png
platforms/win/Assets/urde.scale-125.png platforms/win/Assets/metaforce.scale-125.png
platforms/win/Assets/urde.scale-150.png platforms/win/Assets/metaforce.scale-150.png
platforms/win/Assets/urde.scale-200.png platforms/win/Assets/metaforce.scale-200.png
platforms/win/Assets/urde.scale-400.png platforms/win/Assets/metaforce.scale-400.png
platforms/win/Assets/WideTile.scale-100.png platforms/win/Assets/WideTile.scale-100.png
platforms/win/Assets/WideTile.scale-125.png platforms/win/Assets/WideTile.scale-125.png
platforms/win/Assets/WideTile.scale-150.png platforms/win/Assets/WideTile.scale-150.png
@ -61,10 +55,7 @@ if(WIN32)
list(APPEND PLAT_SRCS ${UWP_ASSETS} platforms/win/Package.appxmanifest) list(APPEND PLAT_SRCS ${UWP_ASSETS} platforms/win/Package.appxmanifest)
endif() endif()
elseif(APPLE) elseif(APPLE)
set(PLAT_SRCS platforms/mac/mainicon.icns) # nothing
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)
elseif(UNIX) elseif(UNIX)
add_subdirectory(platforms/freedesktop) add_subdirectory(platforms/freedesktop)
declare_wmicon_target() declare_wmicon_target()
@ -72,7 +63,7 @@ elseif(UNIX)
set(URDE_PLAT_LIBS rt) set(URDE_PLAT_LIBS rt)
endif() endif()
add_executable(urde-old WIN32 MACOSX_BUNDLE add_executable(metaforce-old WIN32
main.cpp ${PLAT_SRCS} main.cpp ${PLAT_SRCS}
Space.hpp Space.cpp Space.hpp Space.cpp
SplashScreen.hpp SplashScreen.cpp SplashScreen.hpp SplashScreen.cpp
@ -85,40 +76,37 @@ add_executable(urde-old WIN32 MACOSX_BUNDLE
Resource.hpp Resource.cpp Resource.hpp Resource.cpp
Camera.hpp Camera.cpp Camera.hpp Camera.cpp
GameMode.hpp GameMode.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(metaforce-old
MetaforceIcons
target_link_libraries(urde-old MetaforceBadging
UrdeIcons
UrdeBadging
RuntimeCommon RuntimeCommon
amuse
RetroDataSpec
kabufuda
${URDE_PLAT_LIBS}) ${URDE_PLAT_LIBS})
if(COMMAND add_sanitizers)
add_sanitizers(urde-old)
endif()
set_target_properties(urde-old PROPERTIES target_atdna(metaforce-old atdna_Space.cpp Space.hpp)
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" target_atdna(metaforce-old atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
MACOSX_BUNDLE_BUNDLE_NAME "urde") 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 (NOT WINDOWS_STORE)
if(APPLE) add_dependencies(metaforce-old visigen hecl)
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)
else() 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 # 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() endif()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,8 +7,8 @@
#undef min #undef min
#undef max #undef max
namespace urde { namespace metaforce {
static logvisor::Module Log("urde::ProjectResourceFactoryBase"); static logvisor::Module Log("metaforce::ProjectResourceFactoryBase");
void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& proj, void ProjectResourceFactoryBase::BeginBackgroundIndex(hecl::Database::Project& proj,
const hecl::Database::DataSpecEntry& origSpec, const hecl::Database::DataSpecEntry& origSpec,
@ -47,7 +47,7 @@ CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, co
return ret; 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) { if (!m_workingPath) {
m_workingPath = path; m_workingPath = path;
@ -64,7 +64,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
m_cookedPath = path.getCookedPath(*m_parent.m_origSpec); m_cookedPath = path.getCookedPath(*m_parent.m_origSpec);
if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) { if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) {
/* Last chance type validation */ /* Last chance type validation */
urde::SObjectTag verifyTag = m_parent.TagFromPath(path); metaforce::SObjectTag verifyTag = m_parent.TagFromPath(path);
if (verifyTag.type != tag.type) { if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(), Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type); tag.type, verifyTag.type);
@ -181,7 +181,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
cooked = path.getCookedPath(*m_origSpec); cooked = path.getCookedPath(*m_origSpec);
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) { if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
/* Last chance type validation */ /* Last chance type validation */
urde::SObjectTag verifyTag = TagFromPath(path); metaforce::SObjectTag verifyTag = TagFromPath(path);
if (verifyTag.type != tag.type) { if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(), Log.report(logvisor::Error, FMT_STRING(_SYS_STR("{}: expected type '{}', found '{}'")), path.getRelativePath(),
tag.type, verifyTag.type); tag.type, verifyTag.type);
@ -211,8 +211,8 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
return true; return true;
} }
std::unique_ptr<urde::IObj> ProjectResourceFactoryBase::Build(const urde::SObjectTag& tag, std::unique_ptr<metaforce::IObj> ProjectResourceFactoryBase::Build(const metaforce::SObjectTag& tag,
const urde::CVParamTransfer& paramXfer, const metaforce::CVParamTransfer& paramXfer,
CObjectReference* selfRef) { CObjectReference* selfRef) {
if (!tag.id.IsValid()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type); 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); return BuildSync(tag, *resPath, paramXfer, selfRef);
} }
std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const urde::SObjectTag& tag, std::shared_ptr<AsyncTask> ProjectResourceFactoryBase::BuildAsyncInternal(const metaforce::SObjectTag& tag,
const urde::CVParamTransfer& paramXfer, const metaforce::CVParamTransfer& paramXfer,
std::unique_ptr<urde::IObj>* objOut, std::unique_ptr<metaforce::IObj>* objOut,
CObjectReference* selfRef) { CObjectReference* selfRef) {
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end()) if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {}; return {};
return _AddTask(std::make_unique<AsyncTask>(*this, tag, objOut, paramXfer, selfRef)); return _AddTask(std::make_unique<AsyncTask>(*this, tag, objOut, paramXfer, selfRef));
} }
void ProjectResourceFactoryBase::BuildAsync(const urde::SObjectTag& tag, const urde::CVParamTransfer& paramXfer, void ProjectResourceFactoryBase::BuildAsync(const metaforce::SObjectTag& tag, const metaforce::CVParamTransfer& paramXfer,
std::unique_ptr<urde::IObj>* objOut, CObjectReference* selfRef) { std::unique_ptr<metaforce::IObj>* objOut, CObjectReference* selfRef) {
if (!tag.id.IsValid()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id on type '{}'"), tag.type); 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(); 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) { void* target) {
if (!tag.id.IsValid()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end()) if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {}; 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)))); _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) { u32 off, u32 size, void* target) {
if (!tag.id.IsValid()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end()) if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end())
return {}; 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))); _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()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); 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()); 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) { u32 size) {
if (!tag.id.IsValid()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); 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); 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()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
if (m_asyncLoadMap.find(tag) != m_asyncLoadMap.end()) 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)); 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()) if (!tag.id.IsValid())
Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id")); Log.report(logvisor::Fatal, FMT_STRING("attempted to access null id"));
@ -376,7 +376,7 @@ bool ProjectResourceFactoryBase::CanBuild(const urde::SObjectTag& tag) {
return false; 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); 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/ClientProcess.hpp>
#include <hecl/Database.hpp> #include <hecl/Database.hpp>
namespace urde { namespace metaforce {
class ProjectResourceFactoryBase : public IFactory { class ProjectResourceFactoryBase : public IFactory {
friend class ProjectResourcePool; friend class ProjectResourcePool;
hecl::ClientProcess& m_clientProc; hecl::ClientProcess& m_clientProc;
public: public:
struct AsyncTask : urde::IDvdRequest { struct AsyncTask : metaforce::IDvdRequest {
ProjectResourceFactoryBase& m_parent; ProjectResourceFactoryBase& m_parent;
SObjectTag x0_tag; SObjectTag x0_tag;
@ -63,7 +63,7 @@ public:
/* Cook only */ /* Cook only */
AsyncTask(ProjectResourceFactoryBase& parent, const SObjectTag& tag) : m_parent(parent), x0_tag(tag) {} 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(); void CookComplete();
bool AsyncPump(); bool AsyncPump();
void WaitUntilComplete() override; void WaitUntilComplete() override;
@ -78,7 +78,7 @@ protected:
const hecl::Database::DataSpecEntry* m_pcSpec = nullptr; const hecl::Database::DataSpecEntry* m_pcSpec = nullptr;
/* Used to resolve cooked paths */ /* Used to resolve cooked paths */
std::unique_ptr<hecl::Database::IDataSpec> m_cookSpec; 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::list<std::shared_ptr<AsyncTask>> m_asyncLoadList;
std::unordered_map<SObjectTag, std::list<std::shared_ptr<AsyncTask>>::iterator> m_asyncLoadMap; 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, bool PrepForReadSync(const SObjectTag& tag, const hecl::ProjectPath& path,
std::optional<athena::io::FileReader>& fr); 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); return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);
} }
SObjectTag TagFromPath(const hecl::ProjectPath& path) const { SObjectTag TagFromPath(const hecl::ProjectPath& path) const {
@ -120,18 +120,18 @@ protected:
bool SyncCook(const hecl::ProjectPath& working); bool SyncCook(const hecl::ProjectPath& working);
CFactoryFnReturn BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path, const CVParamTransfer& paramXfer, CFactoryFnReturn BuildSync(const SObjectTag& tag, const hecl::ProjectPath& path, const CVParamTransfer& paramXfer,
CObjectReference* selfRef); CObjectReference* selfRef);
std::shared_ptr<AsyncTask> BuildAsyncInternal(const urde::SObjectTag&, const urde::CVParamTransfer&, std::shared_ptr<AsyncTask> BuildAsyncInternal(const metaforce::SObjectTag&, const metaforce::CVParamTransfer&,
std::unique_ptr<urde::IObj>*, CObjectReference* selfRef); std::unique_ptr<metaforce::IObj>*, CObjectReference* selfRef);
public: public:
ProjectResourceFactoryBase(hecl::ClientProcess& clientProc) : m_clientProc(clientProc) {} 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; 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; CObjectReference* selfRef) override;
void CancelBuild(const urde::SObjectTag&) override; void CancelBuild(const metaforce::SObjectTag&) override;
bool CanBuild(const urde::SObjectTag&) override; bool CanBuild(const metaforce::SObjectTag&) override;
const urde::SObjectTag* GetResourceIdByName(std::string_view) const override; const metaforce::SObjectTag* GetResourceIdByName(std::string_view) const override;
FourCC GetResourceTypeById(CAssetId id) const override; FourCC GetResourceTypeById(CAssetId id) const override;
hecl::ProjectPath GetCookedPath(const hecl::ProjectPath& working, bool pcTarget) const { hecl::ProjectPath GetCookedPath(const hecl::ProjectPath& working, bool pcTarget) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getCookedPath(working, pcTarget); 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; void EnumerateNamedResources(const std::function<bool(std::string_view, const SObjectTag&)>& lambda) const override;
u32 ResourceSize(const SObjectTag& tag) override; u32 ResourceSize(const SObjectTag& tag) override;
std::shared_ptr<urde::IDvdRequest> LoadResourceAsync(const urde::SObjectTag& tag, void* target) override; std::shared_ptr<metaforce::IDvdRequest> LoadResourceAsync(const metaforce::SObjectTag& tag, void* target) override;
std::shared_ptr<urde::IDvdRequest> LoadResourcePartAsync(const urde::SObjectTag& tag, u32 off, u32 size, std::shared_ptr<metaforce::IDvdRequest> LoadResourcePartAsync(const metaforce::SObjectTag& tag, u32 off, u32 size,
void* target) override; void* target) override;
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag) override; std::unique_ptr<u8[]> LoadResourceSync(const metaforce::SObjectTag& tag) override;
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size) 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> template <typename ItType>
bool AsyncPumpTask(ItType& it); bool AsyncPumpTask(ItType& it);
@ -160,4 +160,4 @@ public:
~ProjectResourceFactoryBase() override { Shutdown(); } ~ProjectResourceFactoryBase() override { Shutdown(); }
}; };
} // namespace urde } // namespace metaforce

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
#include "ResourceBrowser.hpp" #include "ResourceBrowser.hpp"
namespace urde { namespace metaforce {
#define BROWSER_MARGIN 8 #define BROWSER_MARGIN 8
bool ResourceBrowser::navigateToPath(const hecl::ProjectPath& pathIn) { 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); } 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/PathButtons.hpp"
#include "specter/Table.hpp" #include "specter/Table.hpp"
namespace urde { namespace metaforce {
class ResourceBrowser : public Space, public specter::IPathButtonsBinding { class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
struct State : Space::State { struct State : Space::State {
@ -202,4 +202,4 @@ public:
unsigned toolbarUnits() const override { return 2; } unsigned toolbarUnits() const override { return 2; }
}; };
} // namespace urde } // namespace metaforce

View File

@ -8,7 +8,7 @@
#include "icons/icons.hpp" #include "icons/icons.hpp"
#include "specter/Menu.hpp" #include "specter/Menu.hpp"
namespace urde { namespace metaforce {
static logvisor::Module Log("URDE::Space"); static logvisor::Module Log("URDE::Space");
Space::Space(ViewManager& vm, Class cls, Space* parent) 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; class Toolbar;
struct Icon; struct Icon;
} // namespace specter } // namespace specter
namespace urde { namespace metaforce {
class ViewManager; class ViewManager;
class RootSpace; class RootSpace;
class SplitSpace; class SplitSpace;
@ -172,6 +172,7 @@ public:
} }
void think() override { void think() override {
OPTICK_EVENT();
if (m_spaceTree) if (m_spaceTree)
m_spaceTree->think(); m_spaceTree->think();
} }
@ -374,4 +375,4 @@ public:
} }
}; };
} // namespace urde } // namespace metaforce

View File

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

View File

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

View File

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

View File

@ -26,7 +26,7 @@ namespace hecl {
class PipelineConverterBase; class PipelineConverterBase;
} }
namespace urde { namespace metaforce {
class SplashScreen; class SplashScreen;
class ViewManager final : public specter::IViewManager { class ViewManager final : public specter::IViewManager {
@ -38,6 +38,7 @@ class ViewManager final : public specter::IViewManager {
std::shared_ptr<boo::IWindow> m_mainWindow; std::shared_ptr<boo::IWindow> m_mainWindow;
hecl::Runtime::FileStoreManager& m_fileStoreManager; hecl::Runtime::FileStoreManager& m_fileStoreManager;
hecl::CVarManager& m_cvarManager; hecl::CVarManager& m_cvarManager;
hecl::CVarCommons m_cvarCommons;
ProjectManager m_projManager; ProjectManager m_projManager;
specter::FontCache m_fontCache; specter::FontCache m_fontCache;
specter::DefaultThemeData m_themeData; specter::DefaultThemeData m_themeData;
@ -58,11 +59,13 @@ class ViewManager final : public specter::IViewManager {
class TestGameView : public specter::View { class TestGameView : public specter::View {
ViewManager& m_vm; ViewManager& m_vm;
std::unique_ptr<specter::MultiLineTextView> m_debugText; 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: public:
TestGameView(ViewManager& vm, specter::ViewResources& res, specter::View& parent, hecl::CVarManager& cvarMgr) 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 resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
void draw(boo::IGraphicsCommandQueue* gfxQ) override; void draw(boo::IGraphicsCommandQueue* gfxQ) override;
void think() override; void think() override;
@ -193,4 +196,4 @@ public:
void deferOpenProject(const hecl::SystemString& path) { m_deferedProject = path; } 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" uint8_t URDE_BADGE[];
extern "C" size_t URDE_BADGE_SZ; extern "C" size_t URDE_BADGE_SZ;
namespace urde { namespace metaforce {
static logvisor::Module Log("URDE::badging"); static logvisor::Module Log("URDE::badging");
static specter::Icon g_BadgeIcon; static specter::Icon g_BadgeIcon;
@ -42,4 +42,4 @@ void DestroyBadging() { g_BadgeIcon.m_tex.reset(); }
specter::Icon& GetBadge() { return g_BadgeIcon; } specter::Icon& GetBadge() { return g_BadgeIcon; }
} // namespace urde } // namespace metaforce

View File

@ -2,12 +2,12 @@
#include "specter/ViewResources.hpp" #include "specter/ViewResources.hpp"
namespace urde { namespace metaforce {
void InitializeBadging(specter::ViewResources& viewRes); void InitializeBadging(specter::ViewResources& viewRes);
void DestroyBadging(); void DestroyBadging();
specter::Icon& GetBadge(); specter::Icon& GetBadge();
} // namespace urde } // namespace metaforce
#ifndef BADGE_PHRASE #ifndef BADGE_PHRASE
#define BADGE_PHRASE "Prototype" #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 # 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 # Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry) # (this registers the build-tree with a global CMake-registry)
export(PACKAGE urde-packbadge) export(PACKAGE metaforce-packbadge)
# Create the atdnaConfig.cmake # Create the atdnaConfig.cmake
# ... for the build tree # ... 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 # ... 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 # ... 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() else()
find_package(urde-packbadge REQUIRED) find_package(metaforce-packbadge REQUIRED)
endif() endif()
add_custom_command(OUTPUT badge.bin COMMAND $<TARGET_FILE:packbadge> 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") MAIN_DEPENDENCY badge.png COMMENT "Generating badge.bin")
bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE) bintoc(badge.cpp ${CMAKE_CURRENT_BINARY_DIR}/badge.bin URDE_BADGE)
add_library(UrdeBadging add_library(MetaforceBadging
badge.cpp badge.bin badge.cpp badge.bin
Badging.hpp Badging.cpp) 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) # Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET packbadge AND NOT packbadge_BINARY_DIR) if(NOT TARGET packbadge AND NOT packbadge_BINARY_DIR)
include("${PACKBADGE_CMAKE_DIR}/urde-packbadgeTargets.cmake") include("${PACKBADGE_CMAKE_DIR}/metaforce-packbadgeTargets.cmake")
endif() 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 # 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 # Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry) # (this registers the build-tree with a global CMake-registry)
export(PACKAGE urde-packicons) export(PACKAGE metaforce-packicons)
# Create the atdnaConfig.cmake # Create the atdnaConfig.cmake
# ... for the build tree # ... 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 # ... 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 # ... 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() else()
find_package(urde-packicons REQUIRED) find_package(metaforce-packicons REQUIRED)
endif() endif()
unset(INKSCAPE_BIN CACHE) unset(INKSCAPE_BIN CACHE)
@ -59,4 +59,4 @@ else()
endif() endif()
bintoc(icons_dat.cpp ${CMAKE_CURRENT_BINARY_DIR}/icons.bin URDE_ICONS) 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" uint8_t URDE_ICONS[];
extern "C" size_t URDE_ICONS_SZ; extern "C" size_t URDE_ICONS_SZ;
namespace urde { namespace metaforce {
static logvisor::Module Log("URDE::icons"); static logvisor::Module Log("URDE::icons");
specter::IconAtlas<8, 8> g_IconAtlas; 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/Icon.hpp"
#include "specter/ViewResources.hpp" #include "specter/ViewResources.hpp"
namespace urde { namespace metaforce {
void InitializeIcons(specter::ViewResources& viewRes); void InitializeIcons(specter::ViewResources& viewRes);
void DestroyIcons(); void DestroyIcons();
@ -30,4 +30,4 @@ enum class MonoIcon {
}; };
specter::Icon& GetIcon(MonoIcon icon); 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) # Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET packicons AND NOT packicons_BINARY_DIR) if(NOT TARGET packicons AND NOT packicons_BINARY_DIR)
include("${PACKICONS_CMAKE_DIR}/urde-packiconsTargets.cmake") include("${PACKICONS_CMAKE_DIR}/metaforce-packiconsTargets.cmake")
endif() 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/CVarCommons.hpp"
#include "hecl/Console.hpp" #include "hecl/Console.hpp"
#include "fmt/chrono.h" #include "fmt/chrono.h"
#include "version.h"
#include "optick.h"
static logvisor::Module AthenaLog("Athena"); static logvisor::Module AthenaLog("Athena");
static void AthenaExc(athena::error::Level level, const char* file, const char*, int line, fmt::string_view fmt, 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); AthenaLog.vreport(logvisor::Level(level), fmt, args);
} }
namespace urde { namespace metaforce {
static logvisor::Module Log{"URDE"}; static logvisor::Module Log{"Metaforce"};
static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) { static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
hecl::SystemString features; hecl::SystemString features;
#if defined(__x86_64__) || defined(_M_X64)
auto AddFeature = [&features](const hecl::SystemChar* str) { auto AddFeature = [&features](const hecl::SystemChar* str) {
if (!features.empty()) if (!features.empty())
features += _SYS_STR(", "); features += _SYS_STR(", ");
@ -45,6 +48,7 @@ static hecl::SystemString CPUFeatureString(const zeus::CPUInfo& cpuInf) {
AddFeature(_SYS_STR("AVX")); AddFeature(_SYS_STR("AVX"));
if (cpuInf.AVX2) if (cpuInf.AVX2)
AddFeature(_SYS_STR("AVX2")); AddFeature(_SYS_STR("AVX2"));
#endif
return features; return features;
} }
@ -68,6 +72,7 @@ struct Application : boo::IApplicationCallback {
initialize(app); initialize(app);
m_viewManager->init(app); m_viewManager->init(app);
while (m_running.load()) { while (m_running.load()) {
OPTICK_FRAME("MainThread");
if (!m_viewManager->proc()) if (!m_viewManager->proc())
break; break;
} }
@ -116,7 +121,7 @@ struct Application : boo::IApplicationCallback {
int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; } int64_t getTargetFrameTime() { return m_cvarCommons.getVariableFrameTime() ? 0 : 1000000000L / 60; }
}; };
} // namespace urde } // namespace metaforce
static hecl::SystemChar CwdBuf[1024]; static hecl::SystemChar CwdBuf[1024];
hecl::SystemString ExeDir; hecl::SystemString ExeDir;
@ -125,12 +130,12 @@ static void SetupBasics(bool logging) {
auto result = zeus::validateCPU(); auto result = zeus::validateCPU();
if (!result.first) { if (!result.first) {
#if _WIN32 && !WINDOWS_STORE #if _WIN32 && !WINDOWS_STORE
std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of URDE requires the following CPU features:\n{}\n"), std::wstring msg = fmt::format(FMT_STRING(L"ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second)); metaforce::CPUFeatureString(result.second));
MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR); MessageBoxW(nullptr, msg.c_str(), L"CPU error", MB_OK | MB_ICONERROR);
#else #else
fmt::print(stderr, FMT_STRING("ERROR: This build of URDE requires the following CPU features:\n{}\n"), fmt::print(stderr, FMT_STRING("ERROR: This build of Metaforce requires the following CPU features:\n{}\n"),
urde::CPUFeatureString(result.second)); metaforce::CPUFeatureString(result.second));
#endif #endif
exit(1); exit(1);
} }
@ -139,6 +144,12 @@ static void SetupBasics(bool logging) {
if (logging) if (logging)
logvisor::RegisterConsoleLogger(); logvisor::RegisterConsoleLogger();
atSetExceptionHandler(AthenaExc); 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) { static bool IsClientLoggingEnabled(int argc, const boo::SystemChar** argv) {
@ -156,12 +167,12 @@ int main(int argc, const boo::SystemChar** argv)
#endif #endif
{ {
if (argc > 1 && !hecl::StrCmp(argv[1], _SYS_STR("--dlpackage"))) { 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; return 100;
} }
SetupBasics(IsClientLoggingEnabled(argc, argv)); SetupBasics(IsClientLoggingEnabled(argc, argv));
hecl::Runtime::FileStoreManager fileMgr{_SYS_STR("urde")}; hecl::Runtime::FileStoreManager fileMgr{_SYS_STR("metaforce")};
hecl::CVarManager cvarMgr{fileMgr}; hecl::CVarManager cvarMgr{fileMgr};
hecl::CVarCommons cvarCmns{cvarMgr}; hecl::CVarCommons cvarCmns{cvarMgr};
@ -170,7 +181,7 @@ int main(int argc, const boo::SystemChar** argv)
args.push_back(argv[i]); args.push_back(argv[i]);
cvarMgr.parseCommandLine(args); cvarMgr.parseCommandLine(args);
hecl::SystemStringView logFile = hecl::SystemStringConv(cvarCmns.getLogFile()).sys_str(); hecl::SystemString logFile{hecl::SystemStringConv(cvarCmns.getLogFile()).c_str()};
hecl::SystemString logFilePath; hecl::SystemString logFilePath;
if (!logFile.empty()) { if (!logFile.empty()) {
std::time_t time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); 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 */ /* Handle -j argument */
hecl::SetCpuCountOverride(argc, argv); hecl::SetCpuCountOverride(argc, argv);
urde::Application appCb(fileMgr, cvarMgr, cvarCmns); metaforce::Application appCb(fileMgr, cvarMgr, cvarCmns);
int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("urde"), _SYS_STR("URDE"), argc, int ret = boo::ApplicationRun(boo::IApplication::EPlatformType::Auto, appCb, _SYS_STR("metaforce"),
argv, appCb.getGraphicsApi(), appCb.getSamples(), appCb.getAnisotropy(), _SYS_STR("Metaforce"), argc, argv, appCb.getGraphicsApi(), appCb.getSamples(),
appCb.getDeepColor(), appCb.getTargetFrameTime(), false); appCb.getAnisotropy(), appCb.getDeepColor(), appCb.getTargetFrameTime(), false);
// printf("IM DYING!!\n"); // printf("IM DYING!!\n");
return ret; return ret;
} }
@ -208,9 +219,9 @@ using namespace Windows::ApplicationModel::Core;
[Platform::MTAThread] int WINAPIV main(Platform::Array<Platform::String ^> ^ params) { [Platform::MTAThread] int WINAPIV main(Platform::Array<Platform::String ^> ^ params) {
SetupBasics(false); SetupBasics(false);
urde::Application appCb; metaforce::Application appCb;
auto viewProvider = 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); CoreApplication::Run(viewProvider);
return 0; 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