Render original lab and Jimmy with native Vulkan and SDL3 on .NET 10
This commit is contained in:
1 parent
3df20ac19a
commit
008c0e16da
41 files changed
+2125
-68
No files matched your search
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
# Optional local tool/dependency setup for Linux x64, tested on Ubuntu 24.04.
|
||||
# Downloads dependencies only. Does not install system packages or modify originals.
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
mkdir -p .tools/downloads .tools/dotnet .tools/native .tools/sdl-win
|
||||
fetch() { [[ -f "$2" ]] || curl --fail --location --retry 2 "$1" --output "$2"; }
|
||||
fetch https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.402/dotnet-sdk-10.0.402-linux-x64.tar.gz .tools/downloads/dotnet-sdk-10.0.402-linux-x64.tar.gz
|
||||
fetch https://www.libsdl.org/release/SDL3-3.4.2.tar.gz .tools/downloads/SDL3-3.4.2.tar.gz
|
||||
fetch https://www.libsdl.org/release/SDL3-3.4.2-win32-x64.zip .tools/downloads/SDL3-3.4.2-win32-x64.zip
|
||||
python3 - <<'PY'
|
||||
import hashlib,tarfile,zipfile
|
||||
from pathlib import Path
|
||||
hashes={
|
||||
'dotnet-sdk-10.0.402-linux-x64.tar.gz':'a131496fe7dac21dceea13354e50a3636126fac05d6e5ccf5fb250829c6e9b6a',
|
||||
'SDL3-3.4.2.tar.gz':'ef39a2e3f9a8a78296c40da701967dd1b0d0d6e267e483863ce70f8a03b4050c',
|
||||
'SDL3-3.4.2-win32-x64.zip':'7ae98570a42cfe964dbc44f7a26f1f19f8075599e32ef849eb11464bf624b8d3'}
|
||||
for name,expected in hashes.items():
|
||||
p=Path('.tools/downloads')/name
|
||||
if hashlib.sha256(p.read_bytes()).hexdigest()!=expected:raise SystemExit(f'Checksum mismatch: {p}')
|
||||
if not Path('.tools/dotnet/dotnet').exists():tarfile.open('.tools/downloads/dotnet-sdk-10.0.402-linux-x64.tar.gz').extractall('.tools/dotnet',filter='data')
|
||||
if not Path('.tools/SDL3-3.4.2').exists():tarfile.open('.tools/downloads/SDL3-3.4.2.tar.gz').extractall('.tools',filter='data')
|
||||
zipfile.ZipFile('.tools/downloads/SDL3-3.4.2-win32-x64.zip').extractall('.tools/sdl-win')
|
||||
PY
|
||||
if command -v apt-get >/dev/null && command -v dpkg-deb >/dev/null; then
|
||||
(
|
||||
cd .tools/downloads
|
||||
apt-get download glslang-tools spirv-tools vulkan-validationlayers xvfb \
|
||||
libx11-dev libxext-dev libxau-dev libxdmcp-dev x11proto-dev xtrans-dev \
|
||||
libxcb1-dev libxrender-dev libxcursor-dev libxi-dev libxrandr-dev \
|
||||
libxfixes-dev libxss-dev libasound2-dev
|
||||
)
|
||||
for package in .tools/downloads/*.deb; do dpkg-deb -x "$package" .tools/native; done
|
||||
python3 - <<'PY'
|
||||
from pathlib import Path
|
||||
for p in Path('.tools/native/usr/lib/x86_64-linux-gnu').glob('*.so'):
|
||||
if p.is_symlink() and not p.exists():
|
||||
system=Path('/lib/x86_64-linux-gnu')/p.readlink().name
|
||||
if system.exists():p.unlink();p.symlink_to(system)
|
||||
PY
|
||||
fi
|
||||
cmake -U '*_LIB' -S .tools/SDL3-3.4.2 -B .tools/sdl-build \
|
||||
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$NEUTRON_ROOT/.tools/sdl" \
|
||||
-DCMAKE_PREFIX_PATH="$NEUTRON_ROOT/.tools/native/usr" \
|
||||
-DSDL_X11_XTEST=OFF -DSDL_SHARED=ON -DSDL_STATIC=OFF \
|
||||
-DSDL_TEST_LIBRARY=OFF -DSDL_TESTS=OFF -DSDL_EXAMPLES=OFF
|
||||
cmake --build .tools/sdl-build -j "${NEUTRON_BUILD_JOBS:-4}"
|
||||
cmake --install .tools/sdl-build
|
||||
source scripts/env.sh
|
||||
dotnet restore GamePort.csproj
|
||||
scripts/compile-shaders.sh
|
||||
printf '%s\n' 'Local SDK, SDL3 and shader tools ready. Source scripts/env.sh to use the local dotnet command.'
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
if [[ ! -f .tools/sdl/lib/libSDL3.so.0 ]]; then
|
||||
printf '%s\n' 'SDL3 missing: run scripts/bootstrap.sh or provide .tools/sdl/lib/libSDL3.so.0.' >&2
|
||||
exit 1
|
||||
fi
|
||||
dotnet publish GamePort.csproj -c Release -r linux-x64 --self-contained true -o dist/linux-x64 "$@"
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
if [[ ! -f .tools/sdl-win/SDL3.dll ]]; then
|
||||
printf '%s\n' 'SDL3.dll missing: run scripts/bootstrap.sh or provide .tools/sdl-win/SDL3.dll.' >&2
|
||||
exit 1
|
||||
fi
|
||||
dotnet publish GamePort.csproj -c Release -r win-x64 --self-contained true -o dist/win-x64 "$@"
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
for shader in src/GamePort/Rendering/Shaders/mesh.vert src/GamePort/Rendering/Shaders/mesh.frag; do
|
||||
glslangValidator -V --target-env vulkan1.3 "$shader" -o "$shader.spv"
|
||||
spirv-val --target-env vulkan1.3 "$shader.spv"
|
||||
done
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Source from a project script; keeps SDK caches and downloaded tools local.
|
||||
NEUTRON_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
export DOTNET_CLI_HOME="$NEUTRON_ROOT/.dotnet-home"
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
export NUGET_PACKAGES="$NEUTRON_ROOT/.nuget/packages"
|
||||
if [[ -x "$NEUTRON_ROOT/.tools/dotnet/dotnet" ]]; then
|
||||
export DOTNET_ROOT="$NEUTRON_ROOT/.tools/dotnet"
|
||||
export PATH="$DOTNET_ROOT:$PATH"
|
||||
fi
|
||||
if [[ -d "$NEUTRON_ROOT/.tools/native/usr/bin" ]]; then
|
||||
export PATH="$NEUTRON_ROOT/.tools/native/usr/bin:$PATH"
|
||||
export LD_LIBRARY_PATH="$NEUTRON_ROOT/.tools/native/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export VK_LAYER_PATH="$NEUTRON_ROOT/.tools/native/usr/share/vulkan/explicit_layer.d${VK_LAYER_PATH:+:$VK_LAYER_PATH}"
|
||||
fi
|
||||
cd "$NEUTRON_ROOT"
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
scripts/build-linux.sh
|
||||
scripts/build-windows.sh
|
||||
python3 tools/extractors/prepare.py --audio sounds musicsecretlab
|
||||
for rid in linux-x64 win-x64; do
|
||||
out="dist/$rid"
|
||||
mkdir -p "$out/assets" "$out/scenes/level1b" "$out/scenes/animations" "$out/audio/sounds" "$out/licenses" "$out/docs"
|
||||
for directory in ASE png gam omt; do cp -a "../Original/$directory" "$out/assets/"; done
|
||||
cp ../Original/fontsmall.png ../Original/green_font.png ../Original/NewGame.tsk ../Original/readme.txt "$out/assets/"
|
||||
cp -a artifacts/extracted/level1b/. "$out/scenes/level1b/"
|
||||
cp -a artifacts/extracted/animations/. "$out/scenes/animations/"
|
||||
cp -a artifacts/extracted/musicsecretlab/. "$out/audio/"
|
||||
cp -a artifacts/extracted/sounds/. "$out/audio/sounds/"
|
||||
cp .tools/sdl-win/LICENSE.txt "$out/licenses/SDL3.txt"
|
||||
cp docs/infrastructure.md "$out/BUILD-AND-LIMITATIONS.md"
|
||||
cp docs/compatibility.md "$out/COMPATIBILITY.md"
|
||||
cp docs/dependencies.md "$out/licenses/DEPENDENCIES.md"
|
||||
cp -a docs/. "$out/docs/"
|
||||
cp README.md "$out/SOURCE-README.md"
|
||||
cat > "$out/README.md" <<'NOTES'
|
||||
# Neutron original-scene investigation package
|
||||
|
||||
Linux: run ./launch-scene.sh. Windows: run launch-scene.cmd.
|
||||
Append --headless --frames 2 to render without a window, or --screenshot lab.ppm
|
||||
to save GPU readback. A Vulkan 1.3 graphics driver/loader is required.
|
||||
|
||||
This package includes the .NET runtime, SDL3, shaders and local asset copies.
|
||||
The default shows the original lab and an animated Jimmy preview at its recorded
|
||||
startpoint. C switches stored/orbit camera; arrows/WASD orbit, +/- zoom, F11
|
||||
fullscreen, Escape quit. These are investigation controls.
|
||||
|
||||
This is not the finished playable game. Original collision, controller, intro,
|
||||
interactions, progression, AI and saves remain incomplete. Animation loop/speed
|
||||
are preview policies. Native Windows execution has not been verified.
|
||||
|
||||
See BUILD-AND-LIMITATIONS.md, COMPATIBILITY.md and docs/ for evidence and remaining
|
||||
work. SOURCE-README.md describes development from the separate source repository.
|
||||
NOTES
|
||||
done
|
||||
cat > dist/linux-x64/launch-scene.sh <<'LAUNCH'
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
here="$(cd "$(dirname "$0")" && pwd)"
|
||||
exec "$here/GamePort" --assets "$here/assets" --scene "$here/scenes/level1b/scene.json" --level gam/level1b.gam --original-camera --with-player "$@"
|
||||
LAUNCH
|
||||
chmod +x dist/linux-x64/launch-scene.sh
|
||||
cat > dist/win-x64/launch-scene.cmd <<'LAUNCH'
|
||||
@echo off
|
||||
"%~dp0GamePort.exe" --assets "%~dp0assets" --scene "%~dp0scenes\level1b\scene.json" --level gam/level1b.gam --original-camera --with-player %*
|
||||
LAUNCH
|
||||
printf '%s\n' 'Local Linux and Windows investigation packages prepared in dist/.'
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
source "$(dirname "$0")/env.sh"
|
||||
python3 -m unittest discover -s tests -p 'test_*.py' -v
|
||||
python3 tools/extractors/prepare.py --audio sounds musicsecretlab
|
||||
dotnet run --project tests/GamePort.DataTests -- ../Original
|
||||
dotnet build GamePort.csproj
|
||||
dotnet run --no-build -- --verify-assets --assets ../Original
|
||||
python3 tools/extractors/omt.py ../Original/omt/level1b.omt --scene --output artifacts/extracted/level1b
|
||||
dotnet run --no-build -- --headless --assets ../Original --scene artifacts/extracted/level1b/scene.json --level gam/level1b.gam --original-camera --screenshot artifacts/test-level1b.ppm
|
||||
dotnet run --no-build -- --headless --with-player --time 0.05 --screenshot artifacts/test-player.ppm
|
||||
SDL_AUDIODRIVER=dummy dotnet run --no-build -- --audio-smoke artifacts/extracted/sounds/Wave_00000001_save.wav
|
||||
python3 tools/recon/inventory.py ../Original --verify docs/original-manifest.json
|
||||
if [[ "${NEUTRON_WINDOW_TEST:-0}" == 1 ]]; then
|
||||
dotnet run --no-build -- --scene artifacts/extracted/level1b/scene.json --smoke-window --frames 6 --screenshot artifacts/test-window.ppm
|
||||
fi
|
||||
Reference in new issue
Block a user