diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index f15569c..92e28a7 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -25,7 +25,29 @@ env: BUILD_VERSION: ${{ (startsWith(github.ref, 'refs/tags/v') && github.ref_name) || inputs.version || (github.event_name == 'pull_request' && format('pr-{0}', github.event.number)) || (github.ref == 'refs/heads/main' && format('v0.1.0-preview.main.{0}', github.run_number)) || github.ref_name }} jobs: + gameplay: + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-2022, macos-15] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + sparse-checkout-cone-mode: false + sparse-checkout: | + /global.json + /gameplay/ + /tests/gameplay/ + /addons/wol_engine/portable/ + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.403' + - name: Check gameplay with only the portable core and no Godot backend + run: dotnet run --project tests/gameplay/GameplayContracts.csproj -c Release player: + needs: gameplay strategy: fail-fast: false matrix: diff --git a/AGENTS.md b/AGENTS.md index 3f859bb..e029a0d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,7 @@ # Project scope - Project Vagrant is a C# game consumer of `RakuenSoftware/wol-engine`, whose binary release is vendored at `addons/wol_engine`. Runtime code is C# on Godot 4.7.2 .NET; no GDScript. Reusable engine behaviour belongs in wol-engine with one owner; game rules, content adapters and scenes belong here. +- Extracted game rules belong in `gameplay/Vagrant.Gameplay.csproj`, an ordinary .NET library with no Godot or backend references; it may reference the plain .NET `WolEngine.Core` contracts. Host scenes compose it through .NET-typed boundaries; reusable device and presentation operations belong in wol-engine. Keep Vagrant-specific rules here and remove displaced host calls as each boundary is extracted. - Only players with their own US Vagrant Story disc (SLUS-01040) can play. There is one installation: the disc's files, verified against the retail digest and kept byte for byte (`disc/`, with `install.json` recording where each starts on the disc). It is never versioned or converted. The game decodes what it needs from those files at runtime; what is slow to decode may be kept in `cache/`, which can always be made again. - Every behaviour is implemented exactly once: one decoder per disc format, one handler per script opcode, one owner for each piece of logic. Reuse and move existing code to its owner rather than writing a second copy. Never commit, ship, download or bundle anything from the disc, and never add fallback content that lets the game run without a verified disc. - This is not a decompilation project. ser-pounce/rood-reverse is reference material for formats and behaviour only: do not copy its code, tooling, data, tables or text. Write independent implementations. diff --git a/Vagrant.csproj b/Vagrant.csproj index f670300..803aac2 100644 --- a/Vagrant.csproj +++ b/Vagrant.csproj @@ -10,6 +10,7 @@ macos-universal linux-x64 $(MSBuildProjectDirectory)/addons/wol_engine/platforms/$(WolEngineTarget) + $(MSBuildProjectDirectory)/addons/wol_engine/portable Release @@ -18,6 +19,10 @@ + + + + diff --git a/addons/wol_engine/VENDOR.json b/addons/wol_engine/VENDOR.json index a2479cf..0fe06dd 100644 --- a/addons/wol_engine/VENDOR.json +++ b/addons/wol_engine/VENDOR.json @@ -3,21 +3,21 @@ "godot": "4.7.2", "targets": { "linux-x64": { - "asset": "wol-engine-8fd3e8780c985721730855396de987e59e268fcf-linux-x64.zip", - "sha256": "8f3fc008ff99bb42619e4a81471ab7cbc6cc760df697bc8968e62bdda5a21dce" - }, - "windows-x64": { - "asset": "wol-engine-8fd3e8780c985721730855396de987e59e268fcf-windows-x64.zip", - "sha256": "7214538bf8d872eb21f090aa8f61db8141de2eba808538d2ed6ea48ceea6c86e" + "asset": "wol-engine-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950-linux-x64.zip", + "sha256": "74d38daded15e0c6052a26920b675c1d462a5afe46f3dbac401cf65970ef4131" }, "macos-universal": { - "asset": "wol-engine-8fd3e8780c985721730855396de987e59e268fcf-macos-universal.zip", - "sha256": "a9f12e074301212052701b152bf69169c8cd89216cca8099efec74851b556e9d" + "asset": "wol-engine-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950-macos-universal.zip", + "sha256": "f22b31351ef50dd4d53f8fb7c9d494c2b1cf80f6041a09745942a504e7f8b7ef" + }, + "windows-x64": { + "asset": "wol-engine-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950-windows-x64.zip", + "sha256": "51c0c3df7e779eb33c9f04b522fcb96b126af5d273749b830cf7ad500f03b255" } }, - "commit": "8fd3e8780c985721730855396de987e59e268fcf", - "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-8fd3e8780c985721730855396de987e59e268fcf", - "binary_commit": "8fd3e8780c985721730855396de987e59e268fcf", + "commit": "dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", + "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", + "binary_commit": "dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", "files": { "licenses/GODOT-COPYRIGHT.txt": "cb1980c88089573bcacd7221d777c689bb8bbd778799f24c27fca0fe5f774d6d", "licenses/GODOT-LICENSE.txt": "b0435e3b3e4e55238f05f4b306f30524a1b2e20147810d436eaa554fa6855c80", @@ -25,35 +25,38 @@ "licenses/WOL-THIRD-PARTY-NOTICES.txt": "455b8936eea75163edad0ad1f34df43e7868655de7b4a55053d9f99ca818c120", "native/bin/libspatial.linux.template_release.x86_64.so": "de8a5565cd550f28e63362a9f70bd62d7464f7de3b4d105b402675d8a2757ecc", "native/bin/libspatial.macos.template_release.universal.dylib": "43e797872fdbe2920a012064a716718f3e1d67ed33704369487dcb4ae4b9012b", - "native/bin/libspatial.windows.template_release.x86_64.dll": "7cf63b0cf4201239d899523b7b45f5cffd74eb464761d769ac36d3c4426df293", + "native/bin/libspatial.windows.template_release.x86_64.dll": "1398f36de2d98462938edb8d17631b265496b2e16c0d541c5000bae298d4d1ce", "native/spatial.gdextension": "21794fe9349bc8e47bcfb0b4553e5c775108c8d93e88bac45512ea8d2ffb55ed", - "platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll": "de7465d1244b1995bd5ba28efabdccc610bd5ad034b0509ce858f31fb16d3e65", - "platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "b063ce86a2d313e3c36c7592901b90f85da73f6dfe0797541af965b20db7e4bc", - "platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll": "38e6b983b579eb41a9a5d195ef552010c31a31de6cb666bb74932c72723cbd1f", - "platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "cbee4bf55966c8eabf39aa2c180d5caac74dc1ae79a5e5ae00dd7747419da8c3", + "platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll": "cf0263425e6feec983ef694c93f199b9ba21498c3b6baa0d7f955c68c6090500", + "platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "a265f2dd5f4516bda6f0aff9f4add00ee7113bbce6b1914aa901021bff2ca7f9", + "platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll": "dbb93c4032bea865a4c4a720b323e7a48433dfcc5ec44836eaa54ddaece1e5b0", + "platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "04dbb41ee6d14a69c25289be72820a179c54629f09cb27c544422aa8fd745b82", "platforms/linux-x64/GodotApi.props": "eea79f97503bfb690456ba5cbb41e3153869eae11c50ba6512cbe4781ce8b2e9", - "platforms/linux-x64/RUNTIME.json": "0879045e03d62021488b217d3b1ea22ac80ee1d5a09ac5e96b5978f921b30d2b", - "platforms/linux-x64/WolEngine.props": "f654a34d1d9c44026fbcca08df462f53e0ff13486ce0d77e43f9fe4723a7ef41", - "platforms/linux-x64/managed/Debug/WolEngine.dll": "0594be82d3660350ca97780ab287bb84050d80dd2d55d6e86e96a4a1136cfc5d", - "platforms/linux-x64/managed/Release/WolEngine.dll": "7c44682d80ccb99dede00d82bf67921f3a43b65fe289bd5d5836a02b85d8b226", - "platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll": "810f9865b1c0b3e07395c45aca0e46fec6ec88863e627cec8500caedaa51ce77", - "platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "604d50aa319c1047361c4b144f97653054a0251d79bd9831f7cea648a0b0b698", - "platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll": "6f26db5b06f946829d10c0b258804471bd39d0531a22258e23e7334613df7853", - "platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "c0f6d08c02ab994fb0d107a6800ffde1e6e043bca45920321bc06cc3a232fee4", + "platforms/linux-x64/RUNTIME.json": "8d598360a18f567df2e9a72c750afa50c0ad07359c51fe351ee737aed78d35a2", + "platforms/linux-x64/WolEngine.props": "fbd62933cb36f38c8f9219b643b330fde2e2d9729ba82c4c0e38c339b733417e", + "platforms/linux-x64/managed/Debug/WolEngine.dll": "6e8f2a3c0bce05e199a50b634695c20f6711d4b24060ccb1b6243db7976c96cb", + "platforms/linux-x64/managed/Release/WolEngine.dll": "e0a84ade4f24479457651a41573177abcfcf05978be6ea39a557653364e3030f", + "platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll": "ae3d824f035c0a2b85c137ed69f262251d50b6d64928825bf8bddafabd62d9ce", + "platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "259359a0376a2fd2e9f4722e758a256e5cdafe335be7367e23da2b0c58a52ab1", + "platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll": "58639b1a0b6f6b0d8a6c47d368c9ab4cd3630383634bd0b64a2981e3d762a6fb", + "platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "cc85407578e4dc4a84b3801ad9a88263e4184b25de35a677e2729abcd35fb1f9", "platforms/macos-universal/GodotApi.props": "eea79f97503bfb690456ba5cbb41e3153869eae11c50ba6512cbe4781ce8b2e9", - "platforms/macos-universal/RUNTIME.json": "dc6d8f9a2beabd04fd6132786e404e1f69297388a89db6611342fa24e3a288ff", - "platforms/macos-universal/WolEngine.props": "f654a34d1d9c44026fbcca08df462f53e0ff13486ce0d77e43f9fe4723a7ef41", - "platforms/macos-universal/managed/Debug/WolEngine.dll": "8bc58c850c8f9841d62bec81bdbb221aebb0b0881df56b5de28275031c19650e", - "platforms/macos-universal/managed/Release/WolEngine.dll": "983362a9e9d153374a5cfed3c717301e1abb8c1a9a42dfb4d588b1b704e61732", - "platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll": "8dab9a656a21426b1e8cf197cf64c02a182380b9b911fdeee742895c05946865", - "platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "3a1a561e32d6547b00eec89e786650fb1606d42f3706fc98fe6939874496b490", - "platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll": "d348daca7357ef20fbcdecc779fef4c021d0c37167d34889f3680471d8bb1fb3", - "platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "e6c863a5bf3d395e96bfe1ff69dc100acdf90bc246cc0c4e6d6063a1d4c8327c", + "platforms/macos-universal/RUNTIME.json": "d8868064d4f3bc9a35ecdb870944ead10ba2c1ecd24cb90dbede763a043a0047", + "platforms/macos-universal/WolEngine.props": "fbd62933cb36f38c8f9219b643b330fde2e2d9729ba82c4c0e38c339b733417e", + "platforms/macos-universal/managed/Debug/WolEngine.dll": "526f3929484c0b6d96d46eab0c4438e736c9f2318016ae5959fe95f22e7e5708", + "platforms/macos-universal/managed/Release/WolEngine.dll": "4377ea80589838c6d7fe925c9a3a528d97f2e6b88cb1b1485655fcb6daee2633", + "platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll": "3e097fa19c3b89f277613fcf65ba778e5d307d3a0dc065fecbe25eeb7e3f9c0e", + "platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "cc72b11a4c5b29dd7c14fc264d0be61305cb5f0fd7c21bf8b6125927b47c5353", + "platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll": "34d4ee8ae3719c4ec9d965b22017ce34d3dd559c1dc13274c4410d9aab625a0a", + "platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll": "c955a30ca1a9d53e349aa757d6049f61f09ccb467d223fd934f21018e78928e4", "platforms/windows-x64/GodotApi.props": "eea79f97503bfb690456ba5cbb41e3153869eae11c50ba6512cbe4781ce8b2e9", - "platforms/windows-x64/RUNTIME.json": "5d7c65f4cd4353d4176aac2fdd9fade5a2ea0bc67bcd2dec332aef928f2b95df", - "platforms/windows-x64/WolEngine.props": "f654a34d1d9c44026fbcca08df462f53e0ff13486ce0d77e43f9fe4723a7ef41", - "platforms/windows-x64/managed/Debug/WolEngine.dll": "a582136eaee104e07f1cc4e999d6343cc022c67ff07a756a8623051e98d7c183", - "platforms/windows-x64/managed/Release/WolEngine.dll": "2053373b967a1fefe6174a0096740ecb5693c462095df02e0049652bc3d9baea", + "platforms/windows-x64/RUNTIME.json": "91807d43193132792c8eec4ce4aa6419bd30081ab67a2cac52c2d23f2d01c0d6", + "platforms/windows-x64/WolEngine.props": "fbd62933cb36f38c8f9219b643b330fde2e2d9729ba82c4c0e38c339b733417e", + "platforms/windows-x64/managed/Debug/WolEngine.dll": "1205060c950376e582d781c2eb1a6d37ed2c3c18e0bd6ffd8f7905b89cd52423", + "platforms/windows-x64/managed/Release/WolEngine.dll": "9c400dc621f2fe22fa93a01422ecc8309f8dd4d21a0345ea1ed9a8672550dacb", + "portable/Debug/WolEngine.Core.dll": "76785f5ffd3e17ee9bf47534fe59db159e0cf21efd1355851c40ddb654589d47", + "portable/Release/WolEngine.Core.dll": "7b592bbcd47d26676ad1ea7ebcce84a89ee861a64b76e36251dd43dff3f445d0", + "portable/WolEngine.Core.props": "c0cd70829a95f5b0346e5d03b4809b0ed13585183cc533d09e4873c97f434d9f", "runtime/HumanoidRig.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/HumanoidRig.cs.uid": "bac13d33aadbebc049e4bab96b463766c0484c1a53b380f9c63a69fb432ffd8a", "runtime/PaintedCharacter3D.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", diff --git a/addons/wol_engine/native/bin/libspatial.windows.template_release.x86_64.dll b/addons/wol_engine/native/bin/libspatial.windows.template_release.x86_64.dll index 866d63b..fb536c1 100644 Binary files a/addons/wol_engine/native/bin/libspatial.windows.template_release.x86_64.dll and b/addons/wol_engine/native/bin/libspatial.windows.template_release.x86_64.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll index aced5d5..31d5c37 100644 Binary files a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll and b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll index 1369111..7eed53b 100644 Binary files a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll and b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll index a587735..fab4acb 100644 Binary files a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll and b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll index f9e1266..df76980 100644 Binary files a/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll and b/addons/wol_engine/platforms/linux-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/RUNTIME.json b/addons/wol_engine/platforms/linux-x64/RUNTIME.json index 475be3f..89298aa 100644 --- a/addons/wol_engine/platforms/linux-x64/RUNTIME.json +++ b/addons/wol_engine/platforms/linux-x64/RUNTIME.json @@ -2,10 +2,10 @@ "schema": 1, "target": "linux-x64", "godot": "4.7.2", - "commit": "8fd3e8780c985721730855396de987e59e268fcf", + "commit": "dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", "editor": "editor/Godot_v4.7.2-stable_mono_linux.x86_64", "files": { - "WolEngine.props": "f654a34d1d9c44026fbcca08df462f53e0ff13486ce0d77e43f9fe4723a7ef41", + "WolEngine.props": "fbd62933cb36f38c8f9219b643b330fde2e2d9729ba82c4c0e38c339b733417e", "GodotApi.props": "eea79f97503bfb690456ba5cbb41e3153869eae11c50ba6512cbe4781ce8b2e9", "runtime/PaintedFrameCharacter3D.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/PaintedCloth3D.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", @@ -24,11 +24,12 @@ "licenses/GODOT-COPYRIGHT.txt": "cb1980c88089573bcacd7221d777c689bb8bbd778799f24c27fca0fe5f774d6d", "licenses/GODOT-LICENSE.txt": "b0435e3b3e4e55238f05f4b306f30524a1b2e20147810d436eaa554fa6855c80", "licenses/PS1-SPU-LICENSE.txt": "591fdcae9335df2f1093b9ff03b61f80c4873e4ea60a06d258bfef6db49d8331", + "portable/WolEngine.Core.props": "c0cd70829a95f5b0346e5d03b4809b0ed13585183cc533d09e4873c97f434d9f", "native/spatial.gdextension": "21794fe9349bc8e47bcfb0b4553e5c775108c8d93e88bac45512ea8d2ffb55ed", - ".dependencies/godot-api/api/Release/GodotSharp.dll": "38e6b983b579eb41a9a5d195ef552010c31a31de6cb666bb74932c72723cbd1f", - ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "cbee4bf55966c8eabf39aa2c180d5caac74dc1ae79a5e5ae00dd7747419da8c3", - ".dependencies/godot-api/api/Debug/GodotSharp.dll": "de7465d1244b1995bd5ba28efabdccc610bd5ad034b0509ce858f31fb16d3e65", - ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "b063ce86a2d313e3c36c7592901b90f85da73f6dfe0797541af965b20db7e4bc", + ".dependencies/godot-api/api/Release/GodotSharp.dll": "dbb93c4032bea865a4c4a720b323e7a48433dfcc5ec44836eaa54ddaece1e5b0", + ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "04dbb41ee6d14a69c25289be72820a179c54629f09cb27c544422aa8fd745b82", + ".dependencies/godot-api/api/Debug/GodotSharp.dll": "cf0263425e6feec983ef694c93f199b9ba21498c3b6baa0d7f955c68c6090500", + ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "a265f2dd5f4516bda6f0aff9f4add00ee7113bbce6b1914aa901021bff2ca7f9", "runtime/party/Roster.cs.uid": "e077ab586b6cc286b6c1ab9fb96b8bf9e7a347b788e631d5b153c69a153ff1c1", "runtime/party/Roster.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/audio/AudioDirector.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", @@ -303,17 +304,19 @@ "editor/GodotSharp/Tools/nupkgs/Godot.SourceGenerators.4.7.2.nupkg": "4170a0666ce2d1137a8b2c9f7aab72a6782256c8c824a35e8a249f72b4445a42", "editor/GodotSharp/Tools/it/Microsoft.CodeAnalysis.resources.dll": "c7d7366236036bb7d44a4950d58915b9dff48235ecf17b38f7d9564743fd4ede", "editor/GodotSharp/Tools/it/Microsoft.CodeAnalysis.CSharp.resources.dll": "90e447f763e50bfed0936e10f6c1f079446e982a9079e26095e91aca479421fa", - "editor/GodotSharp/Api/Release/GodotSharp.dll": "38e6b983b579eb41a9a5d195ef552010c31a31de6cb666bb74932c72723cbd1f", + "editor/GodotSharp/Api/Release/GodotSharp.dll": "dbb93c4032bea865a4c4a720b323e7a48433dfcc5ec44836eaa54ddaece1e5b0", "editor/GodotSharp/Api/Release/GodotPlugins.runtimeconfig.json": "163a87196bb2c5607973cbf99e6215bf4b2623dadedeb86e65bc465ce309b988", "editor/GodotSharp/Api/Release/GodotPlugins.dll": "ab5b94d35ac88c98a62e0b680c7af0b98f85741da93235031abc6c90184201c9", - "editor/GodotSharp/Api/Release/GodotSharpEditor.dll": "cbee4bf55966c8eabf39aa2c180d5caac74dc1ae79a5e5ae00dd7747419da8c3", - "editor/GodotSharp/Api/Debug/GodotSharp.dll": "de7465d1244b1995bd5ba28efabdccc610bd5ad034b0509ce858f31fb16d3e65", + "editor/GodotSharp/Api/Release/GodotSharpEditor.dll": "04dbb41ee6d14a69c25289be72820a179c54629f09cb27c544422aa8fd745b82", + "editor/GodotSharp/Api/Debug/GodotSharp.dll": "cf0263425e6feec983ef694c93f199b9ba21498c3b6baa0d7f955c68c6090500", "editor/GodotSharp/Api/Debug/GodotPlugins.runtimeconfig.json": "f7ecefae96040c2437e1c98914954b211546391ed2bf6dfb8fa8836600ec1491", "editor/GodotSharp/Api/Debug/GodotPlugins.dll": "1d94e9624cb0f1c2e196f296d131fce2934ec850e0ca3d78e0fa3ebd71a70e90", - "editor/GodotSharp/Api/Debug/GodotSharpEditor.dll": "b063ce86a2d313e3c36c7592901b90f85da73f6dfe0797541af965b20db7e4bc", + "editor/GodotSharp/Api/Debug/GodotSharpEditor.dll": "a265f2dd5f4516bda6f0aff9f4add00ee7113bbce6b1914aa901021bff2ca7f9", + "portable/Release/WolEngine.Core.dll": "7b592bbcd47d26676ad1ea7ebcce84a89ee861a64b76e36251dd43dff3f445d0", + "portable/Debug/WolEngine.Core.dll": "76785f5ffd3e17ee9bf47534fe59db159e0cf21efd1355851c40ddb654589d47", "native/bin/libspatial.linux.template_release.x86_64.so": "de8a5565cd550f28e63362a9f70bd62d7464f7de3b4d105b402675d8a2757ecc", - "managed/Release/WolEngine.dll": "7c44682d80ccb99dede00d82bf67921f3a43b65fe289bd5d5836a02b85d8b226", - "managed/Debug/WolEngine.dll": "0594be82d3660350ca97780ab287bb84050d80dd2d55d6e86e96a4a1136cfc5d" + "managed/Release/WolEngine.dll": "e0a84ade4f24479457651a41573177abcfcf05978be6ea39a557653364e3030f", + "managed/Debug/WolEngine.dll": "6e8f2a3c0bce05e199a50b634695c20f6711d4b24060ccb1b6243db7976c96cb" }, - "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-8fd3e8780c985721730855396de987e59e268fcf" + "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950" } diff --git a/addons/wol_engine/platforms/linux-x64/WolEngine.props b/addons/wol_engine/platforms/linux-x64/WolEngine.props index c43db5c..bcee727 100644 --- a/addons/wol_engine/platforms/linux-x64/WolEngine.props +++ b/addons/wol_engine/platforms/linux-x64/WolEngine.props @@ -2,6 +2,7 @@ Debug Release + $(MSBuildThisFileDirectory)portable @@ -10,4 +11,5 @@ true + diff --git a/addons/wol_engine/platforms/linux-x64/managed/Debug/WolEngine.dll b/addons/wol_engine/platforms/linux-x64/managed/Debug/WolEngine.dll index 0179fb6..75d0d27 100644 Binary files a/addons/wol_engine/platforms/linux-x64/managed/Debug/WolEngine.dll and b/addons/wol_engine/platforms/linux-x64/managed/Debug/WolEngine.dll differ diff --git a/addons/wol_engine/platforms/linux-x64/managed/Release/WolEngine.dll b/addons/wol_engine/platforms/linux-x64/managed/Release/WolEngine.dll index 2ecb478..6c707ec 100644 Binary files a/addons/wol_engine/platforms/linux-x64/managed/Release/WolEngine.dll and b/addons/wol_engine/platforms/linux-x64/managed/Release/WolEngine.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll index 14e268a..ea8526a 100644 Binary files a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll and b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll index 76be9b9..a62949e 100644 Binary files a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll and b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll index 12fd97b..a9a8d5b 100644 Binary files a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll and b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll index 60d25f4..e06dde7 100644 Binary files a/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll and b/addons/wol_engine/platforms/macos-universal/.dependencies/godot-api/api/Release/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/RUNTIME.json b/addons/wol_engine/platforms/macos-universal/RUNTIME.json index 257c73d..f2732b3 100644 --- a/addons/wol_engine/platforms/macos-universal/RUNTIME.json +++ b/addons/wol_engine/platforms/macos-universal/RUNTIME.json @@ -2,16 +2,17 @@ "schema": 1, "target": "macos-universal", "godot": "4.7.2", - "commit": "8fd3e8780c985721730855396de987e59e268fcf", + "commit": "dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", "editor": "editor/Godot.app/Contents/MacOS/Godot", "files": { - "WolEngine.props": "f654a34d1d9c44026fbcca08df462f53e0ff13486ce0d77e43f9fe4723a7ef41", + "WolEngine.props": "fbd62933cb36f38c8f9219b643b330fde2e2d9729ba82c4c0e38c339b733417e", "GodotApi.props": "eea79f97503bfb690456ba5cbb41e3153869eae11c50ba6512cbe4781ce8b2e9", "native/spatial.gdextension": "21794fe9349bc8e47bcfb0b4553e5c775108c8d93e88bac45512ea8d2ffb55ed", "licenses/PS1-SPU-LICENSE.txt": "591fdcae9335df2f1093b9ff03b61f80c4873e4ea60a06d258bfef6db49d8331", "licenses/WOL-THIRD-PARTY-NOTICES.txt": "455b8936eea75163edad0ad1f34df43e7868655de7b4a55053d9f99ca818c120", "licenses/GODOT-COPYRIGHT.txt": "cb1980c88089573bcacd7221d777c689bb8bbd778799f24c27fca0fe5f774d6d", "licenses/GODOT-LICENSE.txt": "b0435e3b3e4e55238f05f4b306f30524a1b2e20147810d436eaa554fa6855c80", + "portable/WolEngine.Core.props": "c0cd70829a95f5b0346e5d03b4809b0ed13585183cc533d09e4873c97f434d9f", "runtime/PaintedCharacter3D.cs.uid": "c5822cbe12087d5776c1c89e8d1c1d18c75e24f46091bb7440df185bd342d7bc", "runtime/PaintedFrameCharacter3D.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/SceneManager.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", @@ -24,9 +25,11 @@ "runtime/HumanoidRig.cs.uid": "bac13d33aadbebc049e4bab96b463766c0484c1a53b380f9c63a69fb432ffd8a", "runtime/SceneManagerInterpolation.cs.uid": "b3184c763a7535ce4f5d5d3217f136cd94deb28906c4b7276ea514aa9e30eed8", "runtime/PaintedCloth3D.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "managed/Release/WolEngine.dll": "983362a9e9d153374a5cfed3c717301e1abb8c1a9a42dfb4d588b1b704e61732", - "managed/Debug/WolEngine.dll": "8bc58c850c8f9841d62bec81bdbb221aebb0b0881df56b5de28275031c19650e", + "managed/Release/WolEngine.dll": "4377ea80589838c6d7fe925c9a3a528d97f2e6b88cb1b1485655fcb6daee2633", + "managed/Debug/WolEngine.dll": "526f3929484c0b6d96d46eab0c4438e736c9f2318016ae5959fe95f22e7e5708", "native/bin/libspatial.macos.template_release.universal.dylib": "43e797872fdbe2920a012064a716718f3e1d67ed33704369487dcb4ae4b9012b", + "portable/Release/WolEngine.Core.dll": "7b592bbcd47d26676ad1ea7ebcce84a89ee861a64b76e36251dd43dff3f445d0", + "portable/Debug/WolEngine.Core.dll": "76785f5ffd3e17ee9bf47534fe59db159e0cf21efd1355851c40ddb654589d47", "runtime/ui/TextPresentation.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/ui/ScreenPolygonCanvas.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/ui/ScreenGlyphAtlas.cs.uid": "41d59301650e5b20394b4a03a63e55b0e17468b98b81d6c2e4fa45b340b4e10b", @@ -254,15 +257,15 @@ "runtime/flow/FlowAuthoring.cs.uid": "4c60be787c9d98405f7678b01691efed04723759618d2ce10b3029567bded3f6", "runtime/flow/ThresholdCondition.cs": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", "runtime/flow/FlowLifecycle.cs.uid": "ae7f9c64bea3b66386700527b73c84dcbe103c5b88edb41c22897b5e4df0ee42", - ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "c0f6d08c02ab994fb0d107a6800ffde1e6e043bca45920321bc06cc3a232fee4", - ".dependencies/godot-api/api/Release/GodotSharp.dll": "6f26db5b06f946829d10c0b258804471bd39d0531a22258e23e7334613df7853", - ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "604d50aa319c1047361c4b144f97653054a0251d79bd9831f7cea648a0b0b698", - ".dependencies/godot-api/api/Debug/GodotSharp.dll": "810f9865b1c0b3e07395c45aca0e46fec6ec88863e627cec8500caedaa51ce77", + ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "cc85407578e4dc4a84b3801ad9a88263e4184b25de35a677e2729abcd35fb1f9", + ".dependencies/godot-api/api/Release/GodotSharp.dll": "58639b1a0b6f6b0d8a6c47d368c9ab4cd3630383634bd0b64a2981e3d762a6fb", + ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "259359a0376a2fd2e9f4722e758a256e5cdafe335be7367e23da2b0c58a52ab1", + ".dependencies/godot-api/api/Debug/GodotSharp.dll": "ae3d824f035c0a2b85c137ed69f262251d50b6d64928825bf8bddafabd62d9ce", "editor/Godot.app/Contents/CodeResources": "ba599658c0884c22e162be127602b5a010e557b1dae1943de5e95c48d16b907b", "editor/Godot.app/Contents/Info.plist": "1e345d4fcac1d46a1d04339d03a44e42a6644e9c8b9807ee5524f5d55b28942d", "editor/Godot.app/Contents/PkgInfo": "7e50a30efad50208a173203ced60818d693bb61266b75aa10927d1a2adce80cb", - "editor/Godot.app/Contents/_CodeSignature/CodeResources": "c85a3481e2afdda07d09a87aca7773d700dff8d9d9ed51e70acd2cb2d0c5e2e2", - "editor/Godot.app/Contents/MacOS/Godot": "1fb2470fcae05df5eff4e24772d4b7cc249d6434f1e11d8e7cfc77f5f00f3f21", + "editor/Godot.app/Contents/_CodeSignature/CodeResources": "895a2eab8b0633f91f7de29e7e32f9c8a2d6d62cd7109d2c4de8baf1d653cd80", + "editor/Godot.app/Contents/MacOS/Godot": "8790b1eadc27bcbb6288234836fd8b54830d298f1da90aaec3c7de188950e0d4", "editor/Godot.app/Contents/Resources/Resource.icns": "653f73eb9436a2fa7334b8a53356b3e8fd0f6c8fec151ed1969647b10b7c879a", "editor/Godot.app/Contents/Resources/Shader.icns": "2a6963d8f8259779610d459dd4d335a1f6b8a339e13dcb74a028811b60ac01ef", "editor/Godot.app/Contents/Resources/GodotLG.icns": "d77068bc7cd23397883412b6083092889b207ea1cf403697853a1c5d0ea96fd5", @@ -386,13 +389,13 @@ "editor/Godot.app/Contents/Resources/GodotSharp/Tools/tr/Microsoft.CodeAnalysis.resources.dll": "660fa2661a524dd05402991750509edb72c5cce4ddec9cdc56126c1e1c50bcdc", "editor/Godot.app/Contents/Resources/GodotSharp/Tools/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": "76c1f8a8bd7d748170cf0e9b93039fb2bc2ee074ba19eedc10f9a9bc026ec197", "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotPlugins.runtimeconfig.json": "163a87196bb2c5607973cbf99e6215bf4b2623dadedeb86e65bc465ce309b988", - "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotSharpEditor.dll": "c0f6d08c02ab994fb0d107a6800ffde1e6e043bca45920321bc06cc3a232fee4", - "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotSharp.dll": "6f26db5b06f946829d10c0b258804471bd39d0531a22258e23e7334613df7853", + "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotSharpEditor.dll": "cc85407578e4dc4a84b3801ad9a88263e4184b25de35a677e2729abcd35fb1f9", + "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotSharp.dll": "58639b1a0b6f6b0d8a6c47d368c9ab4cd3630383634bd0b64a2981e3d762a6fb", "editor/Godot.app/Contents/Resources/GodotSharp/Api/Release/GodotPlugins.dll": "ab5b94d35ac88c98a62e0b680c7af0b98f85741da93235031abc6c90184201c9", "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotPlugins.runtimeconfig.json": "f7ecefae96040c2437e1c98914954b211546391ed2bf6dfb8fa8836600ec1491", - "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotSharpEditor.dll": "604d50aa319c1047361c4b144f97653054a0251d79bd9831f7cea648a0b0b698", - "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotSharp.dll": "810f9865b1c0b3e07395c45aca0e46fec6ec88863e627cec8500caedaa51ce77", + "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotSharpEditor.dll": "259359a0376a2fd2e9f4722e758a256e5cdafe335be7367e23da2b0c58a52ab1", + "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotSharp.dll": "ae3d824f035c0a2b85c137ed69f262251d50b6d64928825bf8bddafabd62d9ce", "editor/Godot.app/Contents/Resources/GodotSharp/Api/Debug/GodotPlugins.dll": "1d94e9624cb0f1c2e196f296d131fce2934ec850e0ca3d78e0fa3ebd71a70e90" }, - "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-8fd3e8780c985721730855396de987e59e268fcf" + "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950" } diff --git a/addons/wol_engine/platforms/macos-universal/WolEngine.props b/addons/wol_engine/platforms/macos-universal/WolEngine.props index c43db5c..bcee727 100644 --- a/addons/wol_engine/platforms/macos-universal/WolEngine.props +++ b/addons/wol_engine/platforms/macos-universal/WolEngine.props @@ -2,6 +2,7 @@ Debug Release + $(MSBuildThisFileDirectory)portable @@ -10,4 +11,5 @@ true + diff --git a/addons/wol_engine/platforms/macos-universal/managed/Debug/WolEngine.dll b/addons/wol_engine/platforms/macos-universal/managed/Debug/WolEngine.dll index 825d7df..0bcc3eb 100644 Binary files a/addons/wol_engine/platforms/macos-universal/managed/Debug/WolEngine.dll and b/addons/wol_engine/platforms/macos-universal/managed/Debug/WolEngine.dll differ diff --git a/addons/wol_engine/platforms/macos-universal/managed/Release/WolEngine.dll b/addons/wol_engine/platforms/macos-universal/managed/Release/WolEngine.dll index 8d7957a..a900031 100644 Binary files a/addons/wol_engine/platforms/macos-universal/managed/Release/WolEngine.dll and b/addons/wol_engine/platforms/macos-universal/managed/Release/WolEngine.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll index ac87f0c..18f77c1 100644 Binary files a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll and b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll index a683fc5..392be7b 100644 Binary files a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll and b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Debug/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll index 7481c09..db36c1a 100644 Binary files a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll and b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharp.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll index 1cea4cf..be80889 100644 Binary files a/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll and b/addons/wol_engine/platforms/windows-x64/.dependencies/godot-api/api/Release/GodotSharpEditor.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/RUNTIME.json b/addons/wol_engine/platforms/windows-x64/RUNTIME.json index dac2eaf..0a0158b 100644 --- a/addons/wol_engine/platforms/windows-x64/RUNTIME.json +++ b/addons/wol_engine/platforms/windows-x64/RUNTIME.json @@ -2,11 +2,11 @@ "schema": 1, "target": "windows-x64", "godot": "4.7.2", - "commit": "8fd3e8780c985721730855396de987e59e268fcf", + "commit": "dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950", "editor": "editor/Godot_v4.7.2-stable_mono_win64.exe", "files": { "GodotApi.props": "4b64e3c7edd81561a220b075e263415cd0f0028380564f6a50708726022a7308", - "WolEngine.props": "286a754d5230a738bbef4f4bada90ea6678b4bd3f3965bb4b9e0ae1be4557396", + "WolEngine.props": "923a352e12641d57d061df0db5110253cd849104d18e60c907fcd86734fd2f11", "editor/Godot_v4.7.2-stable_mono_win64.exe": "45336315eb6f1a52a8923bc4f2ce8079a03dc4939dcb7d531047890f1f7cdfab", "editor/Godot_v4.7.2-stable_mono_win64_console.exe": "2445d009a5e0474fc7064b9767100e9d2c09521890ac5625476bfb81cf03f2d4", "licenses/GODOT-COPYRIGHT.txt": "cb1980c88089573bcacd7221d777c689bb8bbd778799f24c27fca0fe5f774d6d", @@ -14,6 +14,7 @@ "licenses/PS1-SPU-LICENSE.txt": "5fcd6d88d0fe4e8ee9ade28714e837de2010d0f21bb0b90d905c3a4e65e33562", "licenses/WOL-THIRD-PARTY-NOTICES.txt": "fa47b6f5dcc75c63a7d97b9548a3bfc9ef426ed88647706206c7113065bd7860", "native/spatial.gdextension": "844de9ce72255c8315a3a54c5cee8bc4167639562dd5ada42a2de1148b11cf98", + "portable/WolEngine.Core.props": "2467d434b54ec917b6c204900d13c80c3bb13d651182d4e220cb4aff20310719", "runtime/HumanoidRig.cs": "7eb70257593da06f682a3ddda54a9d260d4fc514f645237f5ca74b08f8da61a6", "runtime/HumanoidRig.cs.uid": "0de0bd3d46acf92365efc2172e51146816c8e2b47d5cff28c4ecfdfa2cc9aaa6", "runtime/PaintedCharacter3D.cs": "7eb70257593da06f682a3ddda54a9d260d4fc514f645237f5ca74b08f8da61a6", @@ -26,10 +27,10 @@ "runtime/SceneManager.cs.uid": "8af2d19ad6e1f0c505b8301f162a08da5aaaabebd1b3ed005fc2bc63284f2cec", "runtime/SceneManagerInterpolation.cs": "7eb70257593da06f682a3ddda54a9d260d4fc514f645237f5ca74b08f8da61a6", "runtime/SceneManagerInterpolation.cs.uid": "56789ab1b3077b028f2afd05841e1f1e5310ccc4dea13a6b604150d8f1c75f39", - ".dependencies/godot-api/api/Debug/GodotSharp.dll": "8dab9a656a21426b1e8cf197cf64c02a182380b9b911fdeee742895c05946865", - ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "3a1a561e32d6547b00eec89e786650fb1606d42f3706fc98fe6939874496b490", - ".dependencies/godot-api/api/Release/GodotSharp.dll": "d348daca7357ef20fbcdecc779fef4c021d0c37167d34889f3680471d8bb1fb3", - ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "e6c863a5bf3d395e96bfe1ff69dc100acdf90bc246cc0c4e6d6063a1d4c8327c", + ".dependencies/godot-api/api/Debug/GodotSharp.dll": "3e097fa19c3b89f277613fcf65ba778e5d307d3a0dc065fecbe25eeb7e3f9c0e", + ".dependencies/godot-api/api/Debug/GodotSharpEditor.dll": "cc72b11a4c5b29dd7c14fc264d0be61305cb5f0fd7c21bf8b6125927b47c5353", + ".dependencies/godot-api/api/Release/GodotSharp.dll": "34d4ee8ae3719c4ec9d965b22017ce34d3dd559c1dc13274c4410d9aab625a0a", + ".dependencies/godot-api/api/Release/GodotSharpEditor.dll": "c955a30ca1a9d53e349aa757d6049f61f09ccb467d223fd934f21018e78928e4", "editor/GodotSharp/Tools/envdte.dll": "7cae2269c6dc59edb16a1fd16672f184a4690c6d720c1faae9616fe0c8d5cb46", "editor/GodotSharp/Tools/GodotTools.BuildLogger.dll": "6e795ad754946522b35210186acdfb6b5cd89d05694fdefbc906aa16f5eae7c8", "editor/GodotSharp/Tools/GodotTools.Core.dll": "1f19d5adf53034caef7fc1efb8fa405809122cad81b02acc975707ef69e1689d", @@ -55,12 +56,12 @@ "editor/GodotSharp/Tools/NuGet.Frameworks.dll": "42972564d5632852fddf484c6badb1f91cd5167b4f540b23e30663aa84f795f0", "editor/GodotSharp/Api/Debug/GodotPlugins.dll": "1d94e9624cb0f1c2e196f296d131fce2934ec850e0ca3d78e0fa3ebd71a70e90", "editor/GodotSharp/Api/Debug/GodotPlugins.runtimeconfig.json": "f7ecefae96040c2437e1c98914954b211546391ed2bf6dfb8fa8836600ec1491", - "editor/GodotSharp/Api/Debug/GodotSharp.dll": "8dab9a656a21426b1e8cf197cf64c02a182380b9b911fdeee742895c05946865", - "editor/GodotSharp/Api/Debug/GodotSharpEditor.dll": "3a1a561e32d6547b00eec89e786650fb1606d42f3706fc98fe6939874496b490", + "editor/GodotSharp/Api/Debug/GodotSharp.dll": "3e097fa19c3b89f277613fcf65ba778e5d307d3a0dc065fecbe25eeb7e3f9c0e", + "editor/GodotSharp/Api/Debug/GodotSharpEditor.dll": "cc72b11a4c5b29dd7c14fc264d0be61305cb5f0fd7c21bf8b6125927b47c5353", "editor/GodotSharp/Api/Release/GodotPlugins.dll": "ab5b94d35ac88c98a62e0b680c7af0b98f85741da93235031abc6c90184201c9", "editor/GodotSharp/Api/Release/GodotPlugins.runtimeconfig.json": "163a87196bb2c5607973cbf99e6215bf4b2623dadedeb86e65bc465ce309b988", - "editor/GodotSharp/Api/Release/GodotSharp.dll": "d348daca7357ef20fbcdecc779fef4c021d0c37167d34889f3680471d8bb1fb3", - "editor/GodotSharp/Api/Release/GodotSharpEditor.dll": "e6c863a5bf3d395e96bfe1ff69dc100acdf90bc246cc0c4e6d6063a1d4c8327c", + "editor/GodotSharp/Api/Release/GodotSharp.dll": "34d4ee8ae3719c4ec9d965b22017ce34d3dd559c1dc13274c4410d9aab625a0a", + "editor/GodotSharp/Api/Release/GodotSharpEditor.dll": "c955a30ca1a9d53e349aa757d6049f61f09ccb467d223fd934f21018e78928e4", "editor/GodotSharp/Tools/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": "b770a8c39ded76ee883149128c0b343a23c4930e8c0599a61ea4a189d468a52c", "editor/GodotSharp/Tools/cs/Microsoft.CodeAnalysis.resources.dll": "4dd085aa3824c42e69d24b45ddbca9cf7f9fcad7dc3ee956be79922fa60a4e51", "editor/GodotSharp/Tools/de/Microsoft.CodeAnalysis.CSharp.resources.dll": "0f3bae26e249638ca2c9204cbbbbce2b1ccfeaf784f6bd77b7121d148f671f29", @@ -91,9 +92,11 @@ "editor/GodotSharp/Tools/zh-Hans/Microsoft.CodeAnalysis.resources.dll": "966487734ddbd371ccfadd6521a8a7e36ba74a5ad777c749df90ea26118212bb", "editor/GodotSharp/Tools/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": "1f4bcaed17f6b189a0a68813a8cf5f3d8d31b6269fd10bcc824b9dd45c2b9a8d", "editor/GodotSharp/Tools/zh-Hant/Microsoft.CodeAnalysis.resources.dll": "537fd03e590ca4502980dfe08d5163a4a115d7b33040cd495a795818dbde315f", - "managed/Debug/WolEngine.dll": "a582136eaee104e07f1cc4e999d6343cc022c67ff07a756a8623051e98d7c183", - "managed/Release/WolEngine.dll": "2053373b967a1fefe6174a0096740ecb5693c462095df02e0049652bc3d9baea", - "native/bin/libspatial.windows.template_release.x86_64.dll": "7cf63b0cf4201239d899523b7b45f5cffd74eb464761d769ac36d3c4426df293", + "managed/Debug/WolEngine.dll": "1205060c950376e582d781c2eb1a6d37ed2c3c18e0bd6ffd8f7905b89cd52423", + "managed/Release/WolEngine.dll": "9c400dc621f2fe22fa93a01422ecc8309f8dd4d21a0345ea1ed9a8672550dacb", + "native/bin/libspatial.windows.template_release.x86_64.dll": "1398f36de2d98462938edb8d17631b265496b2e16c0d541c5000bae298d4d1ce", + "portable/Debug/WolEngine.Core.dll": "76785f5ffd3e17ee9bf47534fe59db159e0cf21efd1355851c40ddb654589d47", + "portable/Release/WolEngine.Core.dll": "7b592bbcd47d26676ad1ea7ebcce84a89ee861a64b76e36251dd43dff3f445d0", "runtime/audio/AudioDirector.cs": "7eb70257593da06f682a3ddda54a9d260d4fc514f645237f5ca74b08f8da61a6", "runtime/audio/AudioDirector.cs.uid": "38b98e1364123b6b3727526f34eacbbcee84f83b2efeef337fdfb903b6aecc5d", "runtime/branding/README.md": "ed2b58bffd76d470aff2b8d66f84832d8cbd85c3732353a7bdc55c2f42493ad1", @@ -322,5 +325,5 @@ "runtime/world/WalkSurface.cs": "7eb70257593da06f682a3ddda54a9d260d4fc514f645237f5ca74b08f8da61a6", "runtime/world/WalkSurface.cs.uid": "d6b5f4a3ecae305570f135cbfce951c822c3bdc78a91f15fffebaea480e20ac9" }, - "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-8fd3e8780c985721730855396de987e59e268fcf" + "release": "https://github.com/RakuenSoftware/wol-engine-release/releases/tag/runtime-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950" } diff --git a/addons/wol_engine/platforms/windows-x64/WolEngine.props b/addons/wol_engine/platforms/windows-x64/WolEngine.props index c43db5c..bcee727 100644 --- a/addons/wol_engine/platforms/windows-x64/WolEngine.props +++ b/addons/wol_engine/platforms/windows-x64/WolEngine.props @@ -2,6 +2,7 @@ Debug Release + $(MSBuildThisFileDirectory)portable @@ -10,4 +11,5 @@ true + diff --git a/addons/wol_engine/platforms/windows-x64/managed/Debug/WolEngine.dll b/addons/wol_engine/platforms/windows-x64/managed/Debug/WolEngine.dll index 180f24b..e339722 100644 Binary files a/addons/wol_engine/platforms/windows-x64/managed/Debug/WolEngine.dll and b/addons/wol_engine/platforms/windows-x64/managed/Debug/WolEngine.dll differ diff --git a/addons/wol_engine/platforms/windows-x64/managed/Release/WolEngine.dll b/addons/wol_engine/platforms/windows-x64/managed/Release/WolEngine.dll index f9b04d0..96404b9 100644 Binary files a/addons/wol_engine/platforms/windows-x64/managed/Release/WolEngine.dll and b/addons/wol_engine/platforms/windows-x64/managed/Release/WolEngine.dll differ diff --git a/addons/wol_engine/portable/Debug/WolEngine.Core.dll b/addons/wol_engine/portable/Debug/WolEngine.Core.dll new file mode 100644 index 0000000..feecdd7 Binary files /dev/null and b/addons/wol_engine/portable/Debug/WolEngine.Core.dll differ diff --git a/addons/wol_engine/portable/Release/WolEngine.Core.dll b/addons/wol_engine/portable/Release/WolEngine.Core.dll new file mode 100644 index 0000000..c0f1ff0 Binary files /dev/null and b/addons/wol_engine/portable/Release/WolEngine.Core.dll differ diff --git a/addons/wol_engine/portable/WolEngine.Core.props b/addons/wol_engine/portable/WolEngine.Core.props new file mode 100644 index 0000000..239a5e9 --- /dev/null +++ b/addons/wol_engine/portable/WolEngine.Core.props @@ -0,0 +1,12 @@ + + + Debug + Release + + + + $(MSBuildThisFileDirectory)$(WolEngineCoreConfiguration)/WolEngine.Core.dll + true + + + diff --git a/docs/DISTRIBUTION.md b/docs/DISTRIBUTION.md index b6b35d9..d18607f 100644 --- a/docs/DISTRIBUTION.md +++ b/docs/DISTRIBUTION.md @@ -24,15 +24,18 @@ binary bytes are copied unchanged. Vendored text file line endings are normalized to LF, and C# resource stubs contain one newline. The current SDK is the public `RakuenSoftware/wol-engine-release` release -`runtime-8fd3e8780c985721730855396de987e59e268fcf`. Native Linux, Windows and +`runtime-dcb5145dfeb3906830c0c6dc6b6d1f22ad1b4950`. Native Linux, Windows and universal macOS CI compiled and qualified each SDK from that exact private engine tag. A separate job independently audited all three SDKs before publication. Each archive and every member file has a verified SHA-256 record. The game vendors the downloaded release assets; its CI never fetches or builds private engine source. -This SDK includes the reused-dialogue sizing fix and moves four painted shader -programs into their existing compiled C# owners. There are no loose shader +This SDK adds the host-neutral `WolEngine.Core` pixel contracts and the backend +image/PNG codec API used by the portable content decoders. Its portable DLLs are +byte-identical across the three platform archives. It retains controller motor +output, the reused-dialogue sizing fix and the four painted shader programs +in their existing compiled C# owners. There are no loose shader implementations or owned debug symbols in the dependency update. Earlier versions distributed those four shader files; removing them here does not revoke existing downloads. Compiled assemblies, including their shader strings, @@ -58,6 +61,40 @@ Dependency updates reject loose shader programs as implementation source. It refuses to overwrite an existing addon. Review and commit that directory and VENDOR.json together. CI never runs this maintainer operation. +## Engine-independent gameplay + +`gameplay/Vagrant.Gameplay.csproj` is an ordinary .NET 10 library. It references +only .NET and the host-neutral `WolEngine.Core` contracts. It does not reference +Godot or the `WolEngine` backend assembly. The application composes these rules +and decoded pixel planes with the host at its presentation boundary. + +Vagrant owns the controller's two-channel envelopes and timing, and the retail +content decoders under `gameplay/installation`: title/loading art, fonts, HUD, +manuals, overlays, effects, map geometry/textures/skies, inventory, save pictures, +results, event-script translation and ending decompression. Images are decoded into byte-defined raster +planes. wol-engine owns hardware controller output, native image creation and +PNG cache encoding/decoding. There is one decoder per format and one owned image +buffer; no parallel Godot decoder or second image cache remains. + +Run the deliberate-input contracts with the .NET SDK and vendored portable DLLs: + +```sh +dotnet run --project tests/gameplay/GameplayContracts.csproj -c Release +``` + +CI runs these checks on Linux, Windows and macOS in sparse checkouts containing +only this library, its tests, the pinned .NET version and `portable` binaries. +Godot, the backend SDK, native libraries and a disc installation are absent. +The checks reject backend dependencies both in gameplay and transitively in the +portable core, and exercise palette keys, transparency passes, indexed/direct +art, save-picture palette columns, glyph metrics and controller envelopes. +Native player builds wait for these checks and retain the published core DLL +byte for byte. Vendoring rejects differing portable bytes across target SDKs. + +Other game systems, including character rendering, audio playback and scenes, +still contain Godot dependencies and remain to be extracted. This is an +incremental boundary, not a claim that the whole application is portable yet. + ## Build and CI Use Python 3.12+ and .NET SDK 10.0.403. No engine credentials, SCons or C++ diff --git a/gameplay/.gdignore b/gameplay/.gdignore new file mode 100644 index 0000000..e69de29 diff --git a/gameplay/Vagrant.Gameplay.csproj b/gameplay/Vagrant.Gameplay.csproj new file mode 100644 index 0000000..a2e22fa --- /dev/null +++ b/gameplay/Vagrant.Gameplay.csproj @@ -0,0 +1,18 @@ + + + + net10.0 + enable + true + true + Wol.Games.Vagrant + Vagrant.Gameplay + $(MSBuildThisFileDirectory)../addons/wol_engine/portable + + + none + false + false + + + diff --git a/runtime/VibrationDriver.cs b/gameplay/VibrationDriver.cs similarity index 93% rename from runtime/VibrationDriver.cs rename to gameplay/VibrationDriver.cs index c0fcb8a..88e54fa 100644 --- a/runtime/VibrationDriver.cs +++ b/gameplay/VibrationDriver.cs @@ -1,6 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only using System; -using Godot; namespace Wol.Games.Vagrant.Runtime; @@ -45,6 +44,11 @@ private sealed class Channel public readonly Motor[] Motors = { new(), new() }; } + private readonly Action _writeMotors; + + /// The host supplies device output; envelope decoding and gameplay timing use only .NET types. + public VibrationDriver(Action writeMotors) => _writeMotors = writeMotors ?? throw new ArgumentNullException(nameof(writeMotors)); + private readonly Channel[] _channels = { new(), new() }; private float _small, _large; @@ -123,10 +127,6 @@ private void Send(int small, int large) float weak = Enabled && small > 0 ? 1 : 0, strong = Enabled ? large / 255f : 0; if (weak == _small && strong == _large) return; (_small, _large) = (weak, strong); - foreach (int pad in Input.GetConnectedJoypads()) - { - if (weak == 0 && strong == 0) Input.StopJoyVibration(pad); - else Input.StartJoyVibration(pad, weak, strong, 0); - } + _writeMotors(weak, strong); } } diff --git a/installation/AreaMapConversion.cs b/gameplay/installation/AreaMapConversion.cs similarity index 97% rename from installation/AreaMapConversion.cs rename to gameplay/installation/AreaMapConversion.cs index 731c0bb..263a715 100644 --- a/installation/AreaMapConversion.cs +++ b/gameplay/installation/AreaMapConversion.cs @@ -3,6 +3,8 @@ using System.IO; using System.Text.Json.Nodes; +using Wol.Engine.Imaging; + namespace Wol.Games.Vagrant.Installation; /// @@ -93,10 +95,10 @@ string Ascii(int at) } /// The map screen's backdrop, MENU/MAPBG.BIN: a 256-colour palette (15-bit, 512 bytes), then the 8-bit picture, 320 by 240. - public static Godot.Image Backdrop(byte[] file) + public static RasterImage Backdrop(byte[] file) { if (file.Length < 0x200 + 320 * 240) throw new InvalidDataException("MAPBG.BIN is truncated."); - var image = Godot.Image.CreateEmpty(320, 240, false, Godot.Image.Format.Rgba8); + var image = new RasterImage(320, 240); for (int i = 0; i < 320 * 240; i++) { ushort colour = BitConverter.ToUInt16(file, file[0x200 + i] * 2); diff --git a/installation/DialogueConversion.cs b/gameplay/installation/DialogueConversion.cs similarity index 96% rename from installation/DialogueConversion.cs rename to gameplay/installation/DialogueConversion.cs index 26e8ac3..6c207bf 100644 --- a/installation/DialogueConversion.cs +++ b/gameplay/installation/DialogueConversion.cs @@ -4,7 +4,7 @@ using System.IO; using System.Text; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; @@ -62,7 +62,7 @@ public DialogueConversion(byte[] system, byte[] battle) } /// Writes the font image and returns its definition, in the shape the field presentation builds a bitmap font from. - public JsonObject Export(IDictionary images) => + public JsonObject Export(IDictionary images) => // The sheet holds two sets of the glyphs, 9 rows of 12 apart: an upright one, and below it the hand-lettered // italic capitals the field's balloons and its HUD print in. Sheet(images, "dialogue_font", LetteredRow, _palette, _widths); @@ -73,23 +73,23 @@ public JsonObject Export(IDictionary images) => /// to their core (14 and 15), as the second ramp of the font table's next row (VRAM (848, 223)) runs from dark to /// white. The advances are the fixed-width set's (all 6; BATTLE.PRG 0x83010). Returns its definition. /// - public JsonObject ExportPlain(IDictionary images) + public JsonObject ExportPlain(IDictionary images) { int fontOffset = (int)BitConverter.ToUInt32(_system, 28), palette = fontOffset + (223 * 64 + 16) * 2; return Sheet(images, "system_font", 0, _system[palette..(palette + 32)], _battle[(WidthTableOffset - Glyphs)..WidthTableOffset]); } - private JsonObject Sheet(IDictionary images, string name, int row, byte[] palette, byte[] widths) + private JsonObject Sheet(IDictionary images, string name, int row, byte[] palette, byte[] widths) { int rows = (Glyphs + Columns - 1) / Columns; - var image = Image.CreateEmpty(Columns * Cell, rows * Cell, false, Image.Format.Rgba8); + var image = new RasterImage(Columns * Cell, rows * Cell); for (int y = 0; y < rows * Cell; y++) for (int x = 0; x < Columns * Cell; x++) { int packed = _font[(y + row) * 128 + x / 2], index = (x & 1) == 0 ? packed & 15 : packed >> 4; int colour = BitConverter.ToUInt16(palette, index * 2), level = colour & 31; byte value = (byte)((level << 3) | (level >> 2)); - image.SetPixel(x, y, Color.Color8(value, value, value, index == 0 ? (byte)0 : (byte)255)); + image.SetPixel(x, y, new Rgba32(value, value, value, index == 0 ? (byte)0 : (byte)255)); } images[name + "_image"] = image; var glyphs = new JsonObject(); @@ -201,12 +201,12 @@ public static JsonObject Balloon(byte[] data, int at) } /// The speech balloons' shapes, and the paper they are drawn on among the images. - public JsonObject Balloons(IDictionary images) + public JsonObject Balloons(IDictionary images) { int page = (int)BitConverter.ToUInt32(_system, 4), fontOffset = (int)BitConverter.ToUInt32(_system, 28); int pageWidth = BitConverter.ToInt16(_system, page + 4) * 4; int clut = fontOffset + 0xE000 + ((220 - 66) * 64 + (992 - 960)) * 2; - var tile = Image.CreateEmpty(64, 64, false, Image.Format.Rgba8); + var tile = new RasterImage(64, 64); for (int y = 0; y < 64; y++) for (int x = 0; x < 64; x++) { diff --git a/installation/EffectConversion.cs b/gameplay/installation/EffectConversion.cs similarity index 98% rename from installation/EffectConversion.cs rename to gameplay/installation/EffectConversion.cs index d22dba1..5a1bc96 100644 --- a/installation/EffectConversion.cs +++ b/gameplay/installation/EffectConversion.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; @@ -133,12 +133,12 @@ public static JsonArray Renderers(int id, byte[] purge, byte[]? plg) private static void Put(byte[] data, int at, ushort colour) { var shown = TitleConversion.ToColor(colour, false); - (data[at], data[at + 1], data[at + 2]) = ((byte)shown.R8, (byte)shown.G8, (byte)shown.B8); + (data[at], data[at + 1], data[at + 2]) = ((byte)shown.Red, (byte)shown.Green, (byte)shown.Blue); data[at + 3] = colour == 0 ? (byte)0 : (colour & 0x8000) != 0 ? (byte)255 : (byte)254; } /// Converts effect ; the files are read through (null if absent). - public static JsonObject? Export(int id, Func read, string name, IDictionary output) + public static JsonObject? Export(int id, Func read, string name, IDictionary output) { byte[]? p = read($"EFFECT/E{id:d3}.P"); if (p == null) return null; @@ -277,7 +277,7 @@ void Palette(byte[]? data, int row) for (int row = 0; row < ih; row++) Array.Copy(pixels, row * iw * 4, atlas, ((places[i].Y + row) * width + places[i].X) * 4, iw * 4); records[i]!["rect"] = new JsonArray { places[i].X, places[i].Y, iw, ih }; } - output[name + "_atlas"] = Image.CreateFromData(width, height, false, Image.Format.Rgba8, atlas); + output[name + "_atlas"] = new RasterImage(width, height, RasterFormat.Rgba8, atlas); effect["atlas"] = name + "_atlas"; effect["atlas_size"] = new JsonArray { width, height }; } @@ -460,7 +460,7 @@ void Palette(byte[]? data, int row) Put(image, (y * width + x) * 4, clut[Math.Min(clut.Length - 1, row * 256 + index)]); } string asset = $"{name}_page_{key}"; - output[asset] = Image.CreateFromData(width, 256, false, Image.Format.Rgba8, image); + output[asset] = new RasterImage(width, 256, RasterFormat.Rgba8, image); pages[key] = asset; } } diff --git a/installation/EndingConversion.cs b/gameplay/installation/EndingConversion.cs similarity index 100% rename from installation/EndingConversion.cs rename to gameplay/installation/EndingConversion.cs diff --git a/installation/EventConversion.cs b/gameplay/installation/EventConversion.cs similarity index 99% rename from installation/EventConversion.cs rename to gameplay/installation/EventConversion.cs index 29ef05c..cc528b3 100644 --- a/installation/EventConversion.cs +++ b/gameplay/installation/EventConversion.cs @@ -17,6 +17,17 @@ namespace Wol.Games.Vagrant.Installation; /// public sealed class EventConversion { + /// + /// Retail animation frames per second: the animation interpreter (BATTLE.PRG 0x800AD714) steps a SEQ frame on each + /// tick of the 30 Hz event clock (at the 15 Hz frame step, f1 4, two). So the clips' strides match their glides: + /// the opening's knight walks 32 frames, a stride each half, in a second at his 130 units a second, and Ashley + /// runs her 10-frame cycle at 18 units a tick. + /// + public const float FramesPerSecond = 30f; + /// Event-clock ticks (30 Hz) per SEQ frame. + public const int TicksPerFrame = 1; + + private const int LengthTableOffset = 0x81430; // BATTLE.PRG: bytes per script opcode. private const int CameraPitches = 0x81400; // BATTLE.PRG 0x800E9C00: halfword pitch presets for b7 0a. private const int FamilySounds = 0x80890; // BATTLE.PRG 0x800E9090: the first resident sound of each animation set's family. @@ -524,7 +535,7 @@ private void Motion(string type, int pc, int x, int y, int z, bool relative, int private JsonObject Clip(int pc, int bank, int number, int blend, int skip = 0) { var args = new JsonObject { ["actor"] = Actor(pc + 1), ["clip"] = $"{AnimationSet(pc, bank)}_{number}", ["blend_seconds"] = blend >= 2 ? blend / (float)EventRate : 0 }; - if (skip > 0) args["start_seconds"] = skip / CharacterConversion.FramesPerSecond; + if (skip > 0) args["start_seconds"] = skip / FramesPerSecond; return args; } diff --git a/installation/HudConversion.cs b/gameplay/installation/HudConversion.cs similarity index 90% rename from installation/HudConversion.cs rename to gameplay/installation/HudConversion.cs index 84e5029..571bc9e 100644 --- a/installation/HudConversion.cs +++ b/gameplay/installation/HudConversion.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; @@ -48,11 +48,11 @@ private ushort Clut(int x, int index) } /// The HUD page (256 by 224 texels) through the palette at (, 223). - public Image Page(int clut) + public RasterImage Page(int clut) { int page = (int)BitConverter.ToUInt32(_system, 0) + 8; if (page + 64 * 224 * 2 > _system.Length || clut < 832 || clut > 1008) throw new InvalidDataException("SYSTEM.DAT's HUD page is truncated."); - var image = Image.CreateEmpty(256, 224, false, Image.Format.Rgba8); + var image = new RasterImage(256, 224); for (int y = 0; y < 224; y++) for (int u = 0; u < 256; u++) { @@ -68,13 +68,13 @@ public Image Page(int clut) /// (, ) in section 7's third block (x 960 to 1023, rows 66 to 223). /// The map screen's compass is drawn from it. /// - public Image SecondPage(int clutX, int clutY) + public RasterImage SecondPage(int clutX, int clutY) { int second = (int)BitConverter.ToUInt32(_system, 4) + 8; int fonts = (int)BitConverter.ToUInt32(_system, 28), third = fonts + 2 * 64 * 224 * 2; if (second + 64 * 240 * 2 > _system.Length || third + 64 * 158 * 2 > _system.Length) throw new InvalidDataException("SYSTEM.DAT's second HUD page is truncated."); if (clutX < 960 || clutX > 1008 || clutY < 66 || clutY > 223) throw new InvalidDataException("No palette of the second HUD page is there."); - var image = Image.CreateEmpty(256, 240, false, Image.Format.Rgba8); + var image = new RasterImage(256, 240); for (int y = 0; y < 240; y++) for (int x = 0; x < 256; x++) { @@ -86,7 +86,7 @@ public Image SecondPage(int clutX, int clutY) } /// Makes the HUD page through each palette, among the images, and returns the asset names by palette. - public JsonObject Export(IDictionary images) + public JsonObject Export(IDictionary images) { var assets = new JsonObject(); foreach (var (name, x) in new[] { ("digits", 832), ("labels", 864), ("cursor", 896) }) @@ -95,13 +95,13 @@ public JsonObject Export(IDictionary images) assets[name] = "hud_" + name; } // BATTLE MODE: 73 by 10 at (64, 0) of section 1's page, through the palette at (976, 220). - images["hud_battle_mode"] = SecondPage(976, 220).GetRegion(new Rect2I(64, 0, 73, 10)); + images["hud_battle_mode"] = SecondPage(976, 220).Region(64, 0, 73, 10); // The chain timing's "!" (BATTLE.PRG 0x800970BC): 22 by 32 at (0xC0, 0) of the same page, through the palette at // (960, 221). - images["hud_chain_cue"] = SecondPage(960, 221).GetRegion(new Rect2I(0xC0, 0, 22, 32)); + images["hud_chain_cue"] = SecondPage(960, 221).Region(0xC0, 0, 22, 32); // The enemies' balloons (BATTLE.PRG 0x80095C18): the page's top 64 rows through the palette at (992, 220), the // rounded and jagged balloons, the small one, their dots and marks. - images["hud_emotes"] = SecondPage(992, 220).GetRegion(new Rect2I(0, 0, 256, 64)); + images["hud_emotes"] = SecondPage(992, 220).Region(0, 0, 256, 64); assets["emotes"] = "hud_emotes"; assets["battle_mode"] = "hud_battle_mode"; assets["chain_cue"] = "hud_chain_cue"; diff --git a/installation/InventoryConversion.cs b/gameplay/installation/InventoryConversion.cs similarity index 99% rename from installation/InventoryConversion.cs rename to gameplay/installation/InventoryConversion.cs index 4922ef8..e57fc21 100644 --- a/installation/InventoryConversion.cs +++ b/gameplay/installation/InventoryConversion.cs @@ -3,6 +3,8 @@ using System.IO; using System.Text.Json.Nodes; +using Wol.Engine.Imaging; + namespace Wol.Games.Vagrant.Installation; /// @@ -466,7 +468,7 @@ public static JsonArray MenuStrings(byte[] overlay, int table) /// 192 by 240, packed as words: each control word writes its low half's count of zero words, then copies its high /// half's count of words that follow, for 0x1780 words of input. /// - public static Godot.Image Backdrop(byte[] file) + public static RasterImage Backdrop(byte[] file) { if (file.Length < 0x200) throw new InvalidDataException("MENUBG.BIN is truncated."); var pixels = new byte[192 * 240]; @@ -484,7 +486,7 @@ public static Godot.Image Backdrop(byte[] file) at += literal; read += literal / 4; } - var image = Godot.Image.CreateEmpty(192, 240, false, Godot.Image.Format.Rgba8); + var image = new RasterImage(192, 240); for (int i = 0; i < pixels.Length; i++) { ushort colour = BitConverter.ToUInt16(file, pixels[i] * 2); diff --git a/installation/ManualConversion.cs b/gameplay/installation/ManualConversion.cs similarity index 97% rename from installation/ManualConversion.cs rename to gameplay/installation/ManualConversion.cs index dbfe8c3..2c96e87 100644 --- a/installation/ManualConversion.cs +++ b/gameplay/installation/ManualConversion.cs @@ -3,7 +3,7 @@ using System.IO; using System.Collections.Generic; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; @@ -29,7 +29,7 @@ public static class ManualConversion /// Records with a nonzero first halfword blink (0x80104c30: a 16-bit mask at 2, stepped every halfword-4 frames); /// they are drawn still. /// - public static JsonObject Export(byte[] help, byte[] pictures, string name, IDictionary images) + public static JsonObject Export(byte[] help, byte[] pictures, string name, IDictionary images) { var topic = Export(help); var list = new JsonArray(); @@ -51,7 +51,7 @@ public static JsonObject Export(byte[] help, byte[] pictures, string name, IDict int palette = BitConverter.ToInt16(help, record + 0x1C), tile = deep ? 8 : 16; if (width <= 0 || height <= 0 || width > 512 || height > 512) continue; int columns = (width + tile - 1) / tile, rows = (height + 15) / 16; - var image = Image.CreateEmpty(width, height, false, Image.Format.Rgba8); + var image = new RasterImage(width, height); for (int r = 0; r < rows; r++) for (int c = 0; c < columns; c++) { diff --git a/installation/MapConversion.cs b/gameplay/installation/MapConversion.cs similarity index 98% rename from installation/MapConversion.cs rename to gameplay/installation/MapConversion.cs index bc22ca6..d8a19ec 100644 --- a/installation/MapConversion.cs +++ b/gameplay/installation/MapConversion.cs @@ -3,7 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; +using System.Numerics; namespace Wol.Games.Vagrant.Installation; @@ -70,7 +71,7 @@ public void AddSky(byte[] image, byte[] layout) _skyLayout = layout; } - private Image Sky(out int width, out int height) + private RasterImage Sky(out int width, out int height) { byte[] tim = _sky!, far = _skyLayout!; // TIM files start with id 0x10; some carry a version byte above it. @@ -82,7 +83,7 @@ private Image Sky(out int width, out int height) const int Cell = 32; width = Math.Max(1, columns * Cell); height = Math.Max(1, rows * Cell); - // Pixels are written to a buffer and handed to Godot whole: one call, not one per pixel. + // The decoded sky keeps its original byte-defined pixels until the host creates an image. var data = new byte[width * height * 4]; for (int cell = 0; cell < columns * rows; cell++) { @@ -99,7 +100,8 @@ private Image Sky(out int width, out int height) int index = tim[pixels + 12 + sy * imageWidth + sx]; ushort colour = index < colours ? BitConverter.ToUInt16(tim, 20 + index * 2) : (ushort)0; float fx = u / (float)(Cell - 1), fy = v / (float)(Cell - 1); - float shade = Mathf.Lerp(Mathf.Lerp(corners[0], corners[1], fx), Mathf.Lerp(corners[2], corners[3], fx), fy); + float top = corners[0] + (corners[1] - corners[0]) * fx, bottom = corners[2] + (corners[3] - corners[2]) * fx; + float shade = top + (bottom - top) * fy; int r = colour & 31, g = (colour >> 5) & 31, b = (colour >> 10) & 31; int at4 = ((row * Cell + v) * width + column * Cell + u) * 4; data[at4] = (byte)Math.Clamp(Math.Round(r / 31f * shade * 255), 0, 255); @@ -108,11 +110,11 @@ private Image Sky(out int width, out int height) data[at4 + 3] = 255; } } - return Image.CreateFromData(width, height, false, Image.Format.Rgba8, data); + return new RasterImage(width, height, RasterFormat.Rgba8, data); } /// Returns the room's field document, putting its textures into by the names the document gives them. - public JsonObject Export(IDictionary images) + public JsonObject Export(IDictionary images) { int room = (int)BitConverter.ToUInt32(_map, 0), roomLength = (int)BitConverter.ToUInt32(_map, 4); if (room + roomLength > _map.Length || roomLength < RoomHeaderSize + 4) throw new InvalidDataException("The room section is malformed."); @@ -732,7 +734,7 @@ private JsonArray Locks(int room) /// down each time and wrapping round. For every room texture whose page the copies touch, the frames of the /// touched area are rendered into one image, a frame a row, for the field to show in turn. /// - private JsonArray TextureFrames(int room, SortedDictionary textures, IDictionary images) + private JsonArray TextureFrames(int room, SortedDictionary textures, IDictionary images) { var result = new JsonArray(); int at = SubSection(room, 11, out int length); @@ -793,7 +795,7 @@ void AddFrames(int record, int index) if (maxU < 0) continue; int width = maxU - minU, height = maxV - minV; var vram = (ushort[])_vram.Clone(); - var strip = Image.CreateEmpty(width, height * steps.Count, false, Image.Format.Rgba8); + var strip = new RasterImage(width, height * steps.Count); for (int i = 0; i < steps.Count; i++) { foreach (var (sx, sy, cw, ch, dx, dy) in steps[i]) @@ -803,7 +805,7 @@ void AddFrames(int record, int index) for (int r = 0; r < ch; r++) for (int c = 0; c < cw; c++) source[r * cw + c] = vram[((sy + r) & 511) * 1024 + ((sx + c) & 1023)]; for (int r = 0; r < ch; r++) for (int c = 0; c < cw; c++) vram[((dy + r) & 511) * 1024 + ((dx + c) & 1023)] = source[r * cw + c]; } - strip.BlitRect(Page(vram, page, clut, mask), new Rect2I(minU, minV, width, height), new Vector2I(0, height * i)); + strip.CopyFrom(Page(vram, page, clut, mask), minU, minV, width, height, 0, height * i); } string name = $"{_name}_{key}_frames{index}"; images[name] = strip; @@ -1343,12 +1345,12 @@ private void ReadFace(int at, bool quad, int scale, (int X, int Y, int Z) origin var (ax, ay, az) = position[0]; var u = new Vector3(position[1].X - ax, position[1].Y - ay, position[1].Z - az); var v = new Vector3(position[2].X - ax, position[2].Y - ay, position[2].Z - az); - var normal = u.Cross(v); + var normal = new Vector3(u.Y * v.Z - u.Z * v.Y, u.Z * v.X - u.X * v.Z, u.X * v.Y - u.Y * v.X); var placed = new (int, int, int)[corners]; for (int corner = 0; corner < corners; corner++) placed[corner] = (origin.X + position[corner].X, origin.Y + position[corner].Y, origin.Z + position[corner].Z); Array.Sort(placed); string face = $"{string.Join(';', placed)}/{Math.Sign(normal.X)}{Math.Sign(normal.Y)}{Math.Sign(normal.Z)}"; - if ((_map[at + 15] & 0x02) == 0 && !_opaqueFaces.Add(face) && normal != Vector3.Zero) behind = normal.Normalized() * 0.5f; + if ((_map[at + 15] & 0x02) == 0 && !_opaqueFaces.Add(face) && normal != Vector3.Zero) behind = normal / MathF.Sqrt(normal.X * normal.X + normal.Y * normal.Y + normal.Z * normal.Z) * 0.5f; } int[] colourOffsets = { 12, 16, 20, 36 }; // Texture coordinates are stored rotated by one corner relative to positions: p1 uses the second pair. @@ -1489,9 +1491,9 @@ int Height(int layer, int x, int z, out bool flag) /// alpha (exactly the hardware's half-and-half mode) and leaves the rest opaque; 2 keeps only the unmasked texels /// and 3 only the masked ones, for the two draws of an additive or subtractive polygon; 0 ignores the bit. /// - private Image Page(int page, int clut, int mask) => Page(_vram, page, clut, mask); + private RasterImage Page(int page, int clut, int mask) => Page(_vram, page, clut, mask); - private static Image Page(ushort[] vram, int page, int clut, int mask) + private static RasterImage Page(ushort[] vram, int page, int clut, int mask) { int pageX = (page & 15) * 64, pageY = ((page >> 4) & 1) * 256, depth = (page >> 7) & 3; int clutX = (clut & 63) * 16, clutY = (clut >> 6) & 0x1FF; @@ -1504,8 +1506,8 @@ private static Image Page(ushort[] vram, int page, int clut, int mask) ? (vram[(pageY + v) * 1024 + Math.Min(1023, pageX + u / 4)] >> ((u & 3) * 4)) & 15 : (vram[(pageY + v) * 1024 + Math.Min(1023, pageX + u / 2)] >> ((u & 1) * 8)) & 255; ushort colour = vram[clutY * 1024 + Math.Min(1023, clutX + index)]; - CharacterConversion.Put(data, (v * 256 + u) * 4, colour, mask, 1); + TitleConversion.WriteTexel(data, (v * 256 + u) * 4, colour, mask, 1); } - return Image.CreateFromData(256, 256, false, Image.Format.Rgba8, data); + return new RasterImage(256, 256, RasterFormat.Rgba8, data); } } diff --git a/installation/MemoryCardConversion.cs b/gameplay/installation/MemoryCardConversion.cs similarity index 94% rename from installation/MemoryCardConversion.cs rename to gameplay/installation/MemoryCardConversion.cs index 6f35636..42fce4d 100644 --- a/installation/MemoryCardConversion.cs +++ b/gameplay/installation/MemoryCardConversion.cs @@ -3,6 +3,8 @@ using System.IO; using System.Text.Json.Nodes; +using Wol.Engine.Imaging; + namespace Wol.Games.Vagrant.Installation; /// @@ -44,7 +46,7 @@ public static JsonObject Export(byte[] mcman, byte[] executable, byte[] battle, /// palette and the rest in its second. Column 0 holds NEW DATA, USED, the container's chest, ERROR and NO DATA; /// location n - 1 (0 to 47) is the 64 by 32 cell at column 1 + (n & 8) / 8 + (n & 0x30) / 8, row n & 7. /// - public static Godot.Image Pictures(byte[] pictures, byte[] palettes) + public static RasterImage Pictures(byte[] pictures, byte[] palettes) { if (pictures.Length < 448 * 256 || palettes.Length < 1024) throw new InvalidDataException("The save pictures are truncated."); var rgba = new byte[448 * 256 * 4]; @@ -54,8 +56,8 @@ public static Godot.Image Pictures(byte[] pictures, byte[] palettes) int palette = x / 64 is >= 1 and <= 4 ? 0 : 512; int colour = BitConverter.ToUInt16(palettes, palette + pictures[y * 448 + x] * 2), at = (y * 448 + x) * 4; var shown = TitleConversion.ToColor((ushort)colour, false); - (rgba[at], rgba[at + 1], rgba[at + 2], rgba[at + 3]) = ((byte)shown.R8, (byte)shown.G8, (byte)shown.B8, 255); + (rgba[at], rgba[at + 1], rgba[at + 2], rgba[at + 3]) = ((byte)shown.Red, (byte)shown.Green, (byte)shown.Blue, 255); } - return Godot.Image.CreateFromData(448, 256, false, Godot.Image.Format.Rgba8, rgba); + return new RasterImage(448, 256, RasterFormat.Rgba8, rgba); } } diff --git a/installation/OverlayConversion.cs b/gameplay/installation/OverlayConversion.cs similarity index 94% rename from installation/OverlayConversion.cs rename to gameplay/installation/OverlayConversion.cs index df1fbe2..fd80ab3 100644 --- a/installation/OverlayConversion.cs +++ b/gameplay/installation/OverlayConversion.cs @@ -3,8 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; -using Godot; -using Wol.Engine.Install; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; @@ -36,7 +35,7 @@ public static string PathFor(Func pathAt, byte[] battle, int id) = pathAt(BitConverter.ToUInt32(battle, FileTableOffset + id * 4) >> 8); /// Puts each layer's image into and returns their definitions. - public JsonObject Export(IDictionary images) + public JsonObject Export(IDictionary images) { var layers = new List<(int Columns, int Rows, int Type, int Tiles)>(); int at = 0, extra = _words[3]; @@ -94,10 +93,10 @@ public JsonObject Export(IDictionary images) ushort value = clut + colour < _words.Length ? _words[clut + colour] : (ushort)0; int pixel = ((row * TileHeight + y) * imageWidth + column * TileWidth + x) * 4; var shown = TitleConversion.ToColor(value, true); - (data[pixel], data[pixel + 1], data[pixel + 2], data[pixel + 3]) = ((byte)shown.R8, (byte)shown.G8, (byte)shown.B8, (byte)shown.A8); + (data[pixel], data[pixel + 1], data[pixel + 2], data[pixel + 3]) = ((byte)shown.Red, (byte)shown.Green, (byte)shown.Blue, (byte)shown.Alpha); } } - images[$"{_name}.{index}"] = Image.CreateFromData(imageWidth, rows * TileHeight, false, Image.Format.Rgba8, data); + images[$"{_name}.{index}"] = new RasterImage(imageWidth, rows * TileHeight, RasterFormat.Rgba8, data); // Colour 0 of the layer's palette fills the cells without a tile in the credits' wipe (BATTLE.PRG 0x800C8060). ushort fill = clut < _words.Length ? _words[clut] : (ushort)0; definitions.Add(new JsonObject { ["image"] = $"{_name}.{index}", ["width"] = columns * TileWidth, ["height"] = rows * TileHeight, ["fill"] = fill }); diff --git a/installation/ResultsConversion.cs b/gameplay/installation/ResultsConversion.cs similarity index 100% rename from installation/ResultsConversion.cs rename to gameplay/installation/ResultsConversion.cs diff --git a/installation/TitleConversion.cs b/gameplay/installation/TitleConversion.cs similarity index 78% rename from installation/TitleConversion.cs rename to gameplay/installation/TitleConversion.cs index bf02149..25f9fa9 100644 --- a/installation/TitleConversion.cs +++ b/gameplay/installation/TitleConversion.cs @@ -3,13 +3,13 @@ using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; -using Godot; +using Wol.Engine.Imaging; namespace Wol.Games.Vagrant.Installation; /// /// Converts the retail title overlay (TITLE/TITLE.PRG) into ordinary images and a layout description. -/// The overlay's offsets are only meaningful for the verified retail file, which catalogues. +/// The overlay's offsets are only meaningful for the verified retail file, which the retail-disc catalog catalogues. /// No PlayStation rendering runs in the game; the presentation draws these images natively. /// public sealed class TitleConversion @@ -61,25 +61,41 @@ public TitleConversion(byte[] overlay) /// Converts a 15-bit PlayStation colour. Colour 0x0000 is the hardware's transparent texel. - public static Color ToColor(ushort value, bool transparentBlack) + public static Rgba32 ToColor(ushort value, bool transparentBlack) { int r = value & 31, g = (value >> 5) & 31, b = (value >> 10) & 31; - float alpha = transparentBlack && value == 0 ? 0f : 1f; - return Color.Color8((byte)((r << 3) | (r >> 2)), (byte)((g << 3) | (g >> 2)), (byte)((b << 3) | (b >> 2)), (byte)(alpha * 255)); + byte alpha = transparentBlack && value == 0 ? (byte)0 : (byte)255; + return new Rgba32((byte)((r << 3) | (r >> 2)), (byte)((g << 3) | (g >> 2)), (byte)((b << 3) | (b >> 2)), alpha); } - private Image DirectImage(int x, int y, int width, int height) + /// + /// Writes a PS1 colour (0 transparent) as four bytes of RGBA, scaled by . On semi-transparent + /// faces only texels with the mask bit (0x8000) blend, as on the rooms' polygons: 1 gives those + /// half alpha and leaves the rest opaque, 2 keeps only the unmasked texels and 3 only the masked ones (the two draws + /// of an additive or subtractive face); 0 ignores the bit. + /// + public static void WriteTexel(byte[] data, int at, ushort colour, int mask, float gain) + { + bool masked = (colour & 0x8000) != 0; + var shown = ToColor(colour, false); + data[at] = (byte)(shown.Red * gain); + data[at + 1] = (byte)(shown.Green * gain); + data[at + 2] = (byte)(shown.Blue * gain); + data[at + 3] = colour == 0 ? (byte)0 : mask switch { 1 => masked ? (byte)128 : (byte)255, 2 => masked ? (byte)0 : (byte)255, 3 => masked ? (byte)255 : (byte)0, _ => (byte)255 }; + } + + private RasterImage DirectImage(int x, int y, int width, int height) { - var image = Image.CreateEmpty(width, height, false, Image.Format.Rgba8); + var image = new RasterImage(width, height); for (int row = 0; row < height; row++) for (int column = 0; column < width; column++) image.SetPixel(column, row, ToColor(_vram[(y + row) * 1024 + x + column], false)); return image; } - private Image IndexedImage(int offset, int width, int height, int paletteOffset) + private RasterImage IndexedImage(int offset, int width, int height, int paletteOffset) { - var image = Image.CreateEmpty(width, height, false, Image.Format.Rgba8); + var image = new RasterImage(width, height); for (int row = 0; row < height; row++) for (int column = 0; column < width; column++) { @@ -111,30 +127,30 @@ private static (int U, int V, int ClutX, int ClutY) Uv(uint word) => /// E, T, I and N, are the disc's own glyphs. The title has no small S or G, so these two are the disc's /// capital S and G reduced to small-capital height. Columns are those of the verified retail words. /// - private static Image ComposeSettings(List words) + private static RasterImage ComposeSettings(List words) { - Image newGame = words[0], continueWord = words[1], sound = words[3]; + RasterImage newGame = words[0], continueWord = words[1], sound = words[3]; // Small capitals in CONTINUE: T, I, N, E. Capitals: S in SOUND, G in NEW GAME. - (Image Source, int Start, int End) capitalS = (sound, 38, 50), capitalG = (newGame, 60, 72); - (Image Source, int Start, int End) t = (continueWord, 60, 68), i = (continueWord, 68, 73), n = (continueWord, 73, 83), e = (continueWord, 93, 103); - (int Top, int Bottom) Rows(Image source, int start, int end) + (RasterImage Source, int Start, int End) capitalS = (sound, 38, 50), capitalG = (newGame, 60, 72); + (RasterImage Source, int Start, int End) t = (continueWord, 60, 68), i = (continueWord, 68, 73), n = (continueWord, 73, 83), e = (continueWord, 93, 103); + (int Top, int Bottom) Rows(RasterImage source, int start, int end) { int top = MenuWordHeight, bottom = -1; for (int y = 0; y < MenuWordHeight; y++) for (int x = start; x < end; x++) - if (source.GetPixel(x, y).R > 0) { top = Math.Min(top, y); bottom = Math.Max(bottom, y); } + if (source.Pixel(x, y).Red > 0) { top = Math.Min(top, y); bottom = Math.Max(bottom, y); } return (top, bottom); } - int[,] Crop((Image Source, int Start, int End) glyph) + int[,] Crop((RasterImage Source, int Start, int End) glyph) { var result = new int[glyph.End - glyph.Start, MenuWordHeight]; for (int x = glyph.Start; x < glyph.End; x++) for (int y = 0; y < MenuWordHeight; y++) - result[x - glyph.Start, y] = (int)Math.Round(glyph.Source.GetPixel(x, y).R * 255f); + result[x - glyph.Start, y] = glyph.Source.Pixel(x, y).Red; return result; } var small = Rows(continueWord, e.Start, e.End); - int[,] Reduce((Image Source, int Start, int End) glyph) + int[,] Reduce((RasterImage Source, int Start, int End) glyph) { // Area-average the capital's palette indices (which rise with brightness) onto small-capital height, // bottom-aligned to the small capitals' baseline. @@ -153,7 +169,7 @@ private static Image ComposeSettings(List words) { double overlap = (Math.Min(sx + 1, x1) - Math.Max(sx, x0)) * (Math.Min(sy + 1, y1) - Math.Max(sy, y0)); if (overlap <= 0 || sx >= glyph.End || sy >= MenuWordHeight) continue; - sum += glyph.Source.GetPixel(sx, sy).R * 255f * overlap; + sum += glyph.Source.Pixel(sx, sy).Red * overlap; area += overlap; } result[x, y] = area > 0 ? Math.Clamp((int)Math.Round(sum / area), 0, 15) : 0; @@ -164,7 +180,7 @@ private static Image ComposeSettings(List words) var letters = new[] { (Crop(capitalS), 0), (Crop(e), 0), (Crop(t), 0), (Crop(t), 0), (Crop(i), 0), (Crop(n), 0), (Reduce(capitalG), 1), (Reduce(capitalS), 1) }; int total = 0; foreach (var (letter, spacing) in letters) total += letter.GetLength(0) + spacing; - var word = Image.CreateEmpty(MenuWordWidth, MenuWordHeight, false, Image.Format.L8); + var word = new RasterImage(MenuWordWidth, MenuWordHeight, RasterFormat.Luminance8); int column = (MenuWordWidth - total) / 2; foreach (var (letter, spacing) in letters) { @@ -173,8 +189,8 @@ private static Image ComposeSettings(List words) for (int y = 0; y < MenuWordHeight; y++) { if (letter[x, y] == 0) continue; - int existing = (int)Math.Round(word.GetPixel(column + x, y).R * 255f); - word.SetPixel(column + x, y, new Color(Math.Max(existing, letter[x, y]) / 255f, 0, 0)); + int existing = word.Pixel(column + x, y).Red; + word.SetPixel(column + x, y, new Rgba32((byte)Math.Max(existing, letter[x, y]), 0, 0)); } column += letter.GetLength(0); } @@ -188,11 +204,11 @@ private static Image ComposeSettings(List words) /// The picture retail shows while it loads, "NOW LOADING..." in glowing blue on black, from the verified /// executable (SLUS_010.40 at 0x39950: 126 by 20); it stands in the middle of the 320 by 240 screen. /// - public static Image Loading(byte[] executable) + public static RasterImage Loading(byte[] executable) { int width = BitConverter.ToUInt16(executable, LoadingOffset), height = BitConverter.ToUInt16(executable, LoadingOffset + 2); if (width == 0 || height == 0 || LoadingOffset + 4 + width * height * 2 > executable.Length) throw new InvalidDataException("The loading picture is missing from the executable."); - var image = Image.CreateEmpty(width, height, false, Image.Format.Rgba8); + var image = new RasterImage(width, height); for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) image.SetPixel(x, y, ToColor(BitConverter.ToUInt16(executable, LoadingOffset + 4 + (y * width + x) * 2), true)); @@ -200,20 +216,20 @@ public static Image Loading(byte[] executable) } /// Makes every title image, among , and returns the layout document. - public JsonObject Export(IDictionary images) + public JsonObject Export(IDictionary images) { - void Save(Image image, string name) => images[name.Replace(".png", "")] = image; + void Save(RasterImage image, string name) => images[name.Replace(".png", "")] = image; Save(IndexedImage(PublisherOffset + 32, 256, 48, PublisherOffset), "publisher.png"); Save(IndexedImage(DeveloperOffset, 128, 13, DeveloperOffset + 128 * 13 / 2), "developer.png"); // The visible title is the interlaced 512x448 display area starting at VRAM (512,16). Save(DirectImage(512, 16, 512, 448), "title_background.png"); // The menu panel is two 160x64 direct-colour pages that the title redraws behind the words. - var panel = Image.CreateEmpty(160, 128, false, Image.Format.Rgba8); - panel.BlitRect(DirectImage(192, 448, 160, 64), new Rect2I(0, 0, 160, 64), Vector2I.Zero); - panel.BlitRect(DirectImage(352, 448, 160, 64), new Rect2I(0, 0, 160, 64), new Vector2I(0, 64)); + var panel = new RasterImage(160, 128); + panel.CopyFrom(DirectImage(192, 448, 160, 64), 0, 0, 160, 64); + panel.CopyFrom(DirectImage(352, 448, 160, 64), 0, 0, 160, 64, 0, 64); Save(panel, "title_panel.png"); - var copyright = Image.CreateEmpty(180, 24, false, Image.Format.Rgba8); + var copyright = new RasterImage(180, 24); for (int i = 0; i < 180 * 24; i++) copyright.SetPixel(i % 180, i / 180, ToColor(BitConverter.ToUInt16(_overlay, CopyrightOffset + i * 2), false)); Save(copyright, "title_copyright.png"); @@ -227,17 +243,17 @@ public JsonObject Export(IDictionary images) var words = new JsonArray(); var glows = new JsonArray(); - var wordImages = new List(); + var wordImages = new List(); for (int entry = 0; entry < MenuEntries; entry++) { var (pageX, pageY) = Page(BitConverter.ToUInt32(_overlay, TextPageOffset + entry * 4)); var (u, v, clutX, clutY) = Uv(BitConverter.ToUInt32(_overlay, TextUvOffset + entry * 4)); if (clutX != 480 || clutY != 384 + entry) throw new InvalidDataException("A menu word does not use its own CLUT row."); // Menu words keep their 4-bit indices; the presentation recolours them as the retail CLUT blends do. - var indices = Image.CreateEmpty(MenuWordWidth, MenuWordHeight, false, Image.Format.L8); + var indices = new RasterImage(MenuWordWidth, MenuWordHeight, RasterFormat.Luminance8); for (int row = 0; row < MenuWordHeight; row++) for (int column = 0; column < MenuWordWidth; column++) - indices.SetPixel(column, row, new Color(Texel(pageX, pageY, u + column, v + row) / 255f, 0, 0)); + indices.SetPixel(column, row, new Rgba32((byte)Texel(pageX, pageY, u + column, v + row), 0, 0)); Save(indices, $"title_word_{entry}.png"); wordImages.Add(indices); words.Add(new JsonObject { ["file"] = $"title_word_{entry}.png" }); @@ -247,7 +263,7 @@ public JsonObject Export(IDictionary images) if (clutX != 480 || clutY != 394) throw new InvalidDataException("A menu glow does not use the glow CLUT row."); uint size = BitConverter.ToUInt32(_overlay, GlowSizeOffset + entry * 4), origin = BitConverter.ToUInt32(_overlay, GlowOriginOffset + entry * 4); int width = (int)(size & 0xFFFF), height = (int)(size >> 16); - var glow = Image.CreateEmpty(width, height, false, Image.Format.Rgba8); + var glow = new RasterImage(width, height); for (int row = 0; row < height; row++) for (int column = 0; column < width; column++) glow.SetPixel(column, row, ToColor(BitConverter.ToUInt16(_overlay, PaletteTableOffset + 32 * 2 + Texel(pageX, pageY, u + column, v + row) * 2), true)); diff --git a/installation/AreaMapConversion.cs.uid b/installation/AreaMapConversion.cs.uid deleted file mode 100644 index 3215f89..0000000 --- a/installation/AreaMapConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cu12h3kjx8kwo diff --git a/installation/CharacterConversion.cs b/installation/CharacterConversion.cs index 4c6bae3..88cfd22 100644 --- a/installation/CharacterConversion.cs +++ b/installation/CharacterConversion.cs @@ -16,16 +16,6 @@ namespace Wol.Games.Vagrant.Installation; /// public sealed class CharacterConversion { - /// - /// Retail animation frames per second: the animation interpreter (BATTLE.PRG 0x800AD714) steps a SEQ frame on each - /// tick of the 30 Hz event clock (at the 15 Hz frame step, f1 4, two). So the clips' strides match their glides: - /// the opening's knight walks 32 frames, a stride each half, in a second at his 130 units a second, and Ashley - /// runs her 10-frame cycle at 18 units a tick. - /// - public const float FramesPerSecond = 30f; - /// Event-clock ticks (30 Hz) per SEQ frame. - public const int TicksPerFrame = 1; - private readonly string _name; private readonly byte[] _model; private readonly List<(string Set, byte[] Data, int Offset)> _sequences; @@ -124,22 +114,6 @@ int Frame() return scripts; } - /// - /// Writes a PS1 colour (0 transparent) as four bytes of RGBA, scaled by . On semi-transparent - /// faces only texels with the mask bit (0x8000) blend, as on the rooms' polygons: 1 gives those - /// half alpha and leaves the rest opaque, 2 keeps only the unmasked texels and 3 only the masked ones (the two draws - /// of an additive or subtractive face); 0 ignores the bit. - /// - public static void Put(byte[] data, int at, ushort colour, int mask, float gain) - { - bool masked = (colour & 0x8000) != 0; - var shown = TitleConversion.ToColor(colour, false); - data[at] = (byte)(shown.R8 * gain); - data[at + 1] = (byte)(shown.G8 * gain); - data[at + 2] = (byte)(shown.B8 * gain); - data[at + 3] = colour == 0 ? (byte)0 : mask switch { 1 => masked ? (byte)128 : (byte)255, 2 => masked ? (byte)0 : (byte)255, 3 => masked ? (byte)255 : (byte)0, _ => (byte)255 }; - } - private static short BigSigned(byte[] data, int offset) => (short)((data[offset] << 8) | data[offset + 1]); /// @@ -197,7 +171,7 @@ public JsonObject Export() if (names.Count == 0) { // glTF drops animations without tracks, so the rest pose holds the root bone explicitly. - var rest = new Animation { Length = 1 / FramesPerSecond, LoopMode = Animation.LoopModeEnum.Linear }; + var rest = new Animation { Length = 1 / EventConversion.FramesPerSecond, LoopMode = Animation.LoopModeEnum.Linear }; int track = rest.AddTrack(Animation.TrackType.Rotation3D); rest.TrackSetPath(track, "Space/Skeleton:b0"); rest.RotationTrackInsertKey(track, 0, Quaternion.Identity); @@ -547,7 +521,7 @@ private bool Layered(Vector3[] positions, int[] owners, int facePointer, int fac { int index = packed ? (_model[pixels + y * rowBytes + x / 2] >> (x & 1) * 4) & 15 : _model[pixels + y * rowBytes + x]; ushort colour = index < colours ? BitConverter.ToUInt16(_model, at + 8 + index * 2) : (ushort)0; - Put(data, (y * width + x) * 4, colour, mask, gain); + TitleConversion.WriteTexel(data, (y * width + x) * 4, colour, mask, gain); } return ImageTexture.CreateFromImage(Image.CreateFromData(width, height, false, Image.Format.Rgba8, data)); } @@ -565,7 +539,7 @@ ushort Colour(int index) => (ushort)(index < shared ? BitConverter.ToUInt16(_mod : index < shared + own ? BitConverter.ToUInt16(_model, palettes + shared * 2 + (_weaponPalette * own + index - shared) * 2) : 0); var data = new byte[width * height * 4]; for (int y = 0; y < height; y++) - for (int x = 0; x < width; x++) Put(data, (y * width + x) * 4, Colour(_model[image + y * width + x]), mask, gain); + for (int x = 0; x < width; x++) TitleConversion.WriteTexel(data, (y * width + x) * 4, Colour(_model[image + y * width + x]), mask, gain); return ImageTexture.CreateFromImage(Image.CreateFromData(width, height, false, Image.Format.Rgba8, data)); } @@ -584,7 +558,7 @@ private IEnumerable Animations(byte[] seq) int header = 16 + index * stride; int frames = BitConverter.ToUInt16(seq, header); int other = (sbyte)seq[header + 2]; - var animation = new Animation { Length = Math.Max(1, frames) / FramesPerSecond, LoopMode = Animation.LoopModeEnum.None }; + var animation = new Animation { Length = Math.Max(1, frames) / EventConversion.FramesPerSecond, LoopMode = Animation.LoopModeEnum.None }; // The translation stream places the root bone above the actor's floor position: its first value in map // units, and its keyed deltas in half units. An animation built on a base animation starts from the base's // first value, as its rotations do. @@ -601,7 +575,7 @@ private IEnumerable Animations(byte[] seq) { position += velocity * span / 2; frame += span; - animation.PositionTrackInsertKey(track, frame / FramesPerSecond, position); + animation.PositionTrackInsertKey(track, frame / EventConversion.FramesPerSecond, position); } } // The movement stream (header +8, the clip's own; BATTLE.PRG 0x800AFA28) moves the actor itself: it opens with a @@ -639,7 +613,7 @@ private IEnumerable Animations(byte[] seq) { rotation += velocity * span; frame += span; - animation.RotationTrackInsertKey(track, frame / FramesPerSecond, Rotation(rotation)); + animation.RotationTrackInsertKey(track, frame / EventConversion.FramesPerSecond, Rotation(rotation)); } } // Each bone's scale (64 is whole), after its rotation streams (BATTLE.PRG 0x800ACFA0 sets it as the clip @@ -670,7 +644,7 @@ private IEnumerable Animations(byte[] seq) { scale += velocity * span; frame += span; - animation.ScaleTrackInsertKey(track, frame / FramesPerSecond, (scale / 64).Max(Vector3.One / 4096)); + animation.ScaleTrackInsertKey(track, frame / EventConversion.FramesPerSecond, (scale / 64).Max(Vector3.One / 4096)); } } // glTF derives duration from the last key, discarding a trailing held frame. Keep the diff --git a/installation/DialogueConversion.cs.uid b/installation/DialogueConversion.cs.uid deleted file mode 100644 index 28ce0d7..0000000 --- a/installation/DialogueConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://0bwjfliuivdh diff --git a/installation/EffectConversion.cs.uid b/installation/EffectConversion.cs.uid deleted file mode 100644 index 047e433..0000000 --- a/installation/EffectConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c1btksyqc8ywl diff --git a/installation/EndingConversion.cs.uid b/installation/EndingConversion.cs.uid deleted file mode 100644 index f42cb4b..0000000 --- a/installation/EndingConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://btml4cfgajyq6 diff --git a/installation/EventConversion.cs.uid b/installation/EventConversion.cs.uid deleted file mode 100644 index e5951ff..0000000 --- a/installation/EventConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c8gpxfxk6p01u diff --git a/installation/HudConversion.cs.uid b/installation/HudConversion.cs.uid deleted file mode 100644 index 61f7795..0000000 --- a/installation/HudConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c50gudrwi8876 diff --git a/installation/InventoryConversion.cs.uid b/installation/InventoryConversion.cs.uid deleted file mode 100644 index 4e72416..0000000 --- a/installation/InventoryConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bwfacgawt4pd7 diff --git a/installation/ManualConversion.cs.uid b/installation/ManualConversion.cs.uid deleted file mode 100644 index 01723da..0000000 --- a/installation/ManualConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dt344kso3qdfy diff --git a/installation/MapConversion.cs.uid b/installation/MapConversion.cs.uid deleted file mode 100644 index 500a06c..0000000 --- a/installation/MapConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c5yb4vtmna8rm diff --git a/installation/MemoryCardConversion.cs.uid b/installation/MemoryCardConversion.cs.uid deleted file mode 100644 index 6d0403d..0000000 --- a/installation/MemoryCardConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dqu2pxrp0t8uj diff --git a/installation/OverlayConversion.cs.uid b/installation/OverlayConversion.cs.uid deleted file mode 100644 index dc84c21..0000000 --- a/installation/OverlayConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://yuj2x0aut6wm diff --git a/installation/ResultsConversion.cs.uid b/installation/ResultsConversion.cs.uid deleted file mode 100644 index 705d0af..0000000 --- a/installation/ResultsConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cgl5our6ekixr diff --git a/installation/TitleConversion.cs.uid b/installation/TitleConversion.cs.uid deleted file mode 100644 index d99a0af..0000000 --- a/installation/TitleConversion.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cuhsfbt8nm82s diff --git a/runtime/FieldContent.cs b/runtime/FieldContent.cs index 9e9a5fe..246a28d 100644 --- a/runtime/FieldContent.cs +++ b/runtime/FieldContent.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Text.Json.Nodes; using Godot; +using Wol.Engine.Imaging; +using Wol.Engine.Display; using Wol.Games.Vagrant.Installation; namespace Wol.Games.Vagrant.Runtime; @@ -53,7 +55,7 @@ public sealed class FieldContent private readonly string _disc; private readonly byte[] _battle, _executable; private readonly Dictionary _data = new(StringComparer.Ordinal); - private readonly Dictionary _images = new(StringComparer.Ordinal); + private readonly Dictionary _images = new(StringComparer.Ordinal); private readonly Dictionary _characters = new(StringComparer.Ordinal); private readonly Dictionary _weapons = new(StringComparer.Ordinal); /// The zone unit file (ZUD) that carries a room character's model and animations, by model id. @@ -96,7 +98,9 @@ public FieldContent(string root) { try { - string build = typeof(FieldContent).Assembly.ManifestModule.ModuleVersionId.ToString("N"); + string build = typeof(FieldContent).Assembly.ManifestModule.ModuleVersionId.ToString("N") + + typeof(TitleConversion).Assembly.ManifestModule.ModuleVersionId.ToString("N") + + typeof(RasterImage).Assembly.ManifestModule.ModuleVersionId.ToString("N"); Directory.CreateDirectory(Path.Combine(root, build)); foreach (string old in Directory.GetDirectories(root)) if (Path.GetFileName(old) != build) Directory.Delete(old, true); return Path.Combine(root, build); @@ -216,16 +220,14 @@ _ when name.StartsWith("area_", StringComparison.Ordinal) && name != "area_names } /// An image a document names (room textures, effect atlases, manual pictures, illustrations, overlay layers). - public Image? Image(string name) + public RasterImage? Image(string name) { if (_images.TryGetValue(name, out var image)) return image; // Images come with the document that names them. // A room's are "field_zzzz_mmm.key", "field_zzzz_mmm.sky" and "field_zzzz_mmm_key_framesn". if (name.StartsWith("field_", StringComparison.Ordinal) && Cached(name + ".png") is { } png && System.IO.File.Exists(png)) { - var picture = new Image(); - if (picture.LoadPngFromBuffer(System.IO.File.ReadAllBytes(png)) != Error.Ok) throw new InvalidDataException($"The cached {name} could not be read."); - return _images[name] = picture; + return _images[name] = PixelArtScaler.DecodePng(System.IO.File.ReadAllBytes(png)); } if (name.StartsWith("field_", StringComparison.Ordinal) && name.Length >= 14) Data(name[..14]); else if (name.StartsWith("effect_", StringComparison.Ordinal)) Data(name[..10]); @@ -443,7 +445,7 @@ public bool HasRoom(int zone, int map) if (Cached($"field_{name}.json") is { } cache) { foreach (var (key, image) in _images) - if (key.StartsWith("field_" + name, StringComparison.Ordinal)) Keep(Cached(key + ".png")!, partial => image.SavePng(partial)); + if (key.StartsWith("field_" + name, StringComparison.Ordinal)) Keep(Cached(key + ".png")!, partial => System.IO.File.WriteAllBytes(partial, PixelArtScaler.EncodePng(image))); Keep(cache, partial => System.IO.File.WriteAllText(partial, document.ToJsonString())); } return document; diff --git a/runtime/RetailContent.cs b/runtime/RetailContent.cs index 0fd9f0b..801d7cd 100644 --- a/runtime/RetailContent.cs +++ b/runtime/RetailContent.cs @@ -80,7 +80,7 @@ public override void _ExitTree() /// An image decoded from the disc, by the name the document that has it gives. public Image LoadImage(string name) => - Field.Image(name)?.Duplicate() as Image ?? throw new InvalidDataException($"The disc has no image {name}."); + Field.Image(name) is { } pixels ? PixelArtScaler.FromRaster(pixels) : throw new InvalidDataException($"The disc has no image {name}."); private Texture2D LoadTexture(string name) => ImageTexture.CreateFromImage(LoadImage(name)); @@ -172,7 +172,7 @@ public Godot.Collections.Dictionary Data(string name) var layer = layers[i].AsGodotDictionary(); // The layer's fill: colour 0 of its palette, none when that is 0 (as the GPU leaves such texels out). int fill = layer.GetValueOrDefault("fill", 0).AsInt32(); - result[i] = (ScreenTexture(layer["image"].AsString()), fill == 0 ? null : TitleConversion.ToColor((ushort)fill, false) with { A = 1 }); + result[i] = (ScreenTexture(layer["image"].AsString()), fill == 0 ? null : DisplaySpace.FromRgba32(TitleConversion.ToColor((ushort)fill, false))); } return result; } diff --git a/runtime/VibrationDriver.cs.uid b/runtime/VibrationDriver.cs.uid deleted file mode 100644 index 5675be1..0000000 --- a/runtime/VibrationDriver.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d1da1tivvs5y6 diff --git a/scenes/field/EventActor.cs b/scenes/field/EventActor.cs index 0fd8d42..e439c72 100644 --- a/scenes/field/EventActor.cs +++ b/scenes/field/EventActor.cs @@ -457,7 +457,7 @@ public bool Animate(string clip, int blendFrames, int skipFrames = 0, bool once /// A clip for the engine, now or queued: its loop as made, or none played once; the blend in 30ths of a second; its start in animation frames. private Wol.Engine.World.ActorClip Clip(string clip, int blendFrames, int skipFrames, bool once, bool queue) => - new(Id, clip, queue, once ? false : null, blendFrames >= 2 ? blendFrames / 30f : 0, skipFrames > 0 ? skipFrames / Installation.CharacterConversion.FramesPerSecond : 0); + new(Id, clip, queue, once ? false : null, blendFrames >= 2 ? blendFrames / 30f : 0, skipFrames > 0 ? skipFrames / Installation.EventConversion.FramesPerSecond : 0); /// The clip's frame now (in the rig's animation frames); a clip played once and ended is no longer current, and stands at its end. public int ClipFrame(string clip) @@ -467,7 +467,7 @@ public int ClipFrame(string clip) double position = !ended ? Player.CurrentAnimationPosition : Player.HasAnimation(clip) ? Player.GetAnimation(clip).Length : 0; // Animation.Length is a float: 31/30 comes back as 30.999999 SEQ frames. // An ended clip has reached its declared integer frame, including commands on that tick. - double frame = position * Installation.CharacterConversion.FramesPerSecond; + double frame = position * Installation.EventConversion.FramesPerSecond; return ended ? (int)Math.Round(frame) : (int)frame; } diff --git a/scenes/field/FieldBattle.cs b/scenes/field/FieldBattle.cs index fd07751..d812893 100644 --- a/scenes/field/FieldBattle.cs +++ b/scenes/field/FieldBattle.cs @@ -3570,8 +3570,8 @@ private void Strike(Combatant attacker, Combatant target, int limb) // The attack is counted on the 30 Hz event clock, a tick to a SEQ frame. Its script says in which frame the // blow lands (operation 2) and its sounds play (4 and 5; 88 is the weapon's swing); without one, the blow // lands halfway through. - const int Ticks = Installation.CharacterConversion.TicksPerFrame; - _frames = Math.Max(2, (int)Math.Ceiling((attacker.Actor.Player?.CurrentAnimationLength ?? 1) * Installation.CharacterConversion.FramesPerSecond * Ticks)); + const int Ticks = Installation.EventConversion.TicksPerFrame; + _frames = Math.Max(2, (int)Math.Ceiling((attacker.Actor.Player?.CurrentAnimationLength ?? 1) * Installation.EventConversion.FramesPerSecond * Ticks)); _landAt = _frames / 2; _cues.Clear(); foreach (var value in Events(attacker, $"{set}_{animation}")) diff --git a/scenes/field/FieldView.cs b/scenes/field/FieldView.cs index febefac..c0bc256 100644 --- a/scenes/field/FieldView.cs +++ b/scenes/field/FieldView.cs @@ -132,7 +132,7 @@ private void ResetEventCamera() private SoundDriver _driver = null!; /// The pad's vibration, stepped each frame of play. - public readonly VibrationDriver Vibration = new(); + public readonly VibrationDriver Vibration = new(Wol.Engine.Controls.InputBindings.SetVibration); /// The sounds playing by name (without their pan), each with its full key. private readonly Dictionary _sounds = new(); /// The music's volume (0 to 1) as fades move it. diff --git a/scenes/startup/Startup.cs b/scenes/startup/Startup.cs index 8f83900..6800d30 100644 --- a/scenes/startup/Startup.cs +++ b/scenes/startup/Startup.cs @@ -39,6 +39,15 @@ public override void _Ready() if (!ClassDB.ClassExists("NativePs1AudioSandbox")) throw new InvalidOperationException("The compiled engine audio runtime is missing."); if (typeof(Wol.Engine.World.FieldScene).Assembly == typeof(Startup).Assembly) throw new InvalidOperationException("The engine must be a separately compiled binary dependency."); + var gameplay = typeof(Wol.Games.Vagrant.Runtime.VibrationDriver).Assembly; + if (gameplay == typeof(Startup).Assembly) + throw new InvalidOperationException("Gameplay must be a separately compiled engine-independent assembly."); + foreach (var reference in gameplay.GetReferencedAssemblies()) + if (reference.Name is not { } name || !name.StartsWith("System", StringComparison.Ordinal) && name != "WolEngine.Core") + throw new InvalidOperationException("The gameplay assembly depends on a host engine."); + foreach (var reference in typeof(Wol.Engine.Imaging.RasterImage).Assembly.GetReferencedAssemblies()) + if (reference.Name is not { } name || !name.StartsWith("System", StringComparison.Ordinal)) + throw new InvalidOperationException("The portable engine core depends on a host backend."); foreach (var type in typeof(Startup).Assembly.GetTypes()) if (type.Namespace == "Wol.Games.Vagrant.Tests") throw new InvalidOperationException("Test code was compiled into the player."); var retailHashes = new System.Collections.Generic.HashSet(RetailDisc.Catalog.FileDigests.Values, StringComparer.OrdinalIgnoreCase); diff --git a/scenes/title/TitleMenu.cs b/scenes/title/TitleMenu.cs index 097eb19..c19753e 100644 --- a/scenes/title/TitleMenu.cs +++ b/scenes/title/TitleMenu.cs @@ -172,7 +172,7 @@ private ImageTexture Texture(int index) { int texel = (int)Math.Round(indices.GetPixel(x, y).R * 255f); ushort colour = word.Palette[texel]; - image.SetPixel(x, y, texel == 0 || colour == 0 ? new Color(0, 0, 0, 0) : Installation.TitleConversion.ToColor(colour, false)); + image.SetPixel(x, y, texel == 0 || colour == 0 ? new Color(0, 0, 0, 0) : Wol.Engine.Display.DisplaySpace.FromRgba32(Installation.TitleConversion.ToColor(colour, false))); } if (word.Texture == null) word.Texture = ImageTexture.CreateFromImage(image); else word.Texture.Update(image); diff --git a/tests/EffectContracts.cs b/tests/EffectContracts.cs index a2487ae..bb21c45 100644 --- a/tests/EffectContracts.cs +++ b/tests/EffectContracts.cs @@ -29,7 +29,7 @@ public override void _Ready() if (disc.Length == 0 || scratch.Length == 0) throw new InvalidOperationException("pass --disc= and --scratch="); Directory.CreateDirectory(scratch); using var image = PlayStationDisc.Open(disc, RetailDisc.Catalog); - var images = new Dictionary(); + var images = new Dictionary(); int converted = 0, textured = 0, records = 0; for (int id = 0; id < 320; id++) { diff --git a/tests/FieldContracts.cs b/tests/FieldContracts.cs index 03b3dfc..3b2b0d1 100644 --- a/tests/FieldContracts.cs +++ b/tests/FieldContracts.cs @@ -5659,7 +5659,7 @@ private string CheckCombatRules() // The second channel clips their combined level; stopping event tag 2 leaves effect tag 1 running. bool vibrationEnabled = VibrationDriver.Enabled; VibrationDriver.Enabled = false; - var vibration = new VibrationDriver(); + var vibration = new VibrationDriver((_, _) => { }); try { byte[] source = { 5, 2, 1, 0, 0, 2, 100, 2, 200, 0, 0, 99 }; diff --git a/tests/gameplay/.gdignore b/tests/gameplay/.gdignore new file mode 100644 index 0000000..e69de29 diff --git a/tests/gameplay/ContentContracts.cs b/tests/gameplay/ContentContracts.cs new file mode 100644 index 0000000..2b3b2f0 --- /dev/null +++ b/tests/gameplay/ContentContracts.cs @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: AGPL-3.0-only +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json.Nodes; +using Wol.Engine.Imaging; +using Wol.Games.Vagrant.Installation; + +internal static class ContentContracts +{ + public static void Check() + { + if (typeof(TitleConversion).Assembly != typeof(Wol.Games.Vagrant.Runtime.VibrationDriver).Assembly) + throw new InvalidOperationException("The decoder was compiled into a host assembly."); + for (int word = 0; word <= ushort.MaxValue; word++) + { + // Independent expectations: five-bit channels expand across the full eight-bit range. + byte r = (byte)((word & 31) * 8 + (word & 31) / 4); + byte g = (byte)(((word >> 5) & 31) * 8 + ((word >> 5) & 31) / 4); + byte b = (byte)(((word >> 10) & 31) * 8 + ((word >> 10) & 31) / 4); + if (TitleConversion.ToColor((ushort)word, true) != new Rgba32(r, g, b, word == 0 ? (byte)0 : (byte)255)) + throw new InvalidOperationException("A retail palette channel or transparency key changed."); + } + foreach (int mask in new[] { 0, 1, 2, 3 }) + { + var bytes = new byte[12]; + TitleConversion.WriteTexel(bytes, 0, 0, mask, 1); + TitleConversion.WriteTexel(bytes, 4, 0x001f, mask, 1); + TitleConversion.WriteTexel(bytes, 8, 0x801f, mask, 1); + byte plain = mask == 3 ? (byte)0 : (byte)255; + byte masked = mask switch { 1 => 128, 2 => 0, _ => 255 }; + if (!bytes.AsSpan().SequenceEqual(new byte[] { 0, 0, 0, 0, 255, 0, 0, plain, 255, 0, 0, masked })) + throw new InvalidOperationException("A split transparency pass changed."); + } + var loading = new byte[0x39954 + 8]; + BinaryPrimitives.WriteUInt16LittleEndian(loading.AsSpan(0x39950), 2); + BinaryPrimitives.WriteUInt16LittleEndian(loading.AsSpan(0x39952), 2); + BinaryPrimitives.WriteUInt16LittleEndian(loading.AsSpan(0x39954), 0x001f); + BinaryPrimitives.WriteUInt16LittleEndian(loading.AsSpan(0x39956), 0x03e0); + BinaryPrimitives.WriteUInt16LittleEndian(loading.AsSpan(0x39958), 0x7c00); + var picture = TitleConversion.Loading(loading); + if (picture.Width != 2 || picture.Height != 2 || !picture.Pixels.AsSpan().SequenceEqual(new byte[] { 255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 0, 0, 0 })) + throw new InvalidOperationException("Direct-color loading art changed."); + var backdrop = new byte[512 + 320 * 240]; + BinaryPrimitives.WriteUInt16LittleEndian(backdrop.AsSpan(2), 0x03e0); + backdrop[512] = 1; backdrop[^1] = 1; + var map = AreaMapConversion.Backdrop(backdrop); + if (map.Width != 320 || map.Height != 240 || map.Pixel(0, 0) != new Rgba32(0, 255, 0) || map.Pixel(319, 239) != new Rgba32(0, 255, 0) || map.Pixel(1, 0) != new Rgba32(0, 0, 0)) + throw new InvalidOperationException("Indexed map art changed."); + // Distinct palettes on either side of the save-picture column boundaries. + var palettes = new byte[1024]; + BinaryPrimitives.WriteUInt16LittleEndian(palettes, 0x001f); + BinaryPrimitives.WriteUInt16LittleEndian(palettes.AsSpan(512), 0x7c00); + var saves = MemoryCardConversion.Pictures(new byte[448 * 256], palettes); + foreach (int x in new[] { 0, 63, 64, 319, 320, 447 }) + if (saves.Pixel(x, 255) != (x >= 64 && x < 320 ? new Rgba32(255, 0, 0) : new Rgba32(0, 0, 255))) + throw new InvalidOperationException("Save-picture palette columns changed."); + // Four-bit font cells retain index-zero transparency and independent glyph advances. + var system = new byte[0xe000 + 158 * 128]; + var battle = new byte[0x83010 + DialogueConversion.Glyphs * 2]; + system[108 * 128] = 0x10; + BinaryPrimitives.WriteUInt16LittleEndian(system.AsSpan(222 * 128 + 2), 31); + battle[0x83010 + DialogueConversion.Glyphs] = 7; + var images = new Dictionary(); + var definition = new DialogueConversion(system, battle).Export(images); + if (images["dialogue_font_image"].Pixel(0, 0).Alpha != 0 || images["dialogue_font_image"].Pixel(1, 0) != new Rgba32(255, 255, 255) + || (int)definition["glyphs"]!["48"]!["advance"]! != 7) + throw new InvalidOperationException("Font indices, transparency or layout metrics changed."); + foreach (byte[] truncated in new[] { Array.Empty(), new byte[512] }) + { + bool rejected = false; + try { _ = AreaMapConversion.Backdrop(truncated); } catch (InvalidDataException) { rejected = true; } + if (!rejected) throw new InvalidOperationException("Truncated indexed art was accepted."); + } + var eventTables = new byte[0x81530]; + eventTables[0x81430 + 0x23] = 5; + eventTables[0x81430 + 0xf6] = 1; + foreach (var (reference, expected) in new[] { (0x2003, "side:4"), (0x2001, "all"), (0, "id:0") }) + { + var script = new byte[0x16]; + BinaryPrimitives.WriteUInt16LittleEndian(script.AsSpan(2), (ushort)script.Length); + script[0x10] = 0x23; + BinaryPrimitives.WriteUInt16LittleEndian(script.AsSpan(0x11), (ushort)reference); + script[0x13] = 1; script[0x14] = 10; script[0x15] = 0xf6; + var converted = new EventConversion("portable_selector", script, 0, eventTables).Export(); + var commands = converted["events"]!.AsArray()[0]!["nodes"]!.AsObject() + .SelectMany(n => n.Value!["transitions"]!.AsArray()) + .SelectMany(t => t!["commands"]?.AsArray() ?? new JsonArray()); + if (!commands.Any(c => (string)c!["type"]! == "actor.flags" && (string)c["args"]!["actor"]! == expected)) + throw new InvalidOperationException("A retail event actor selector changed."); + } + if (EventConversion.FramesPerSecond != 30 || EventConversion.TicksPerFrame != 1 || Math.Abs(EventConversion.Heading(1024) + Math.PI / 2) > 0.000001) + throw new InvalidOperationException("The event clock or heading units changed."); + Console.WriteLine("CONTENT_CONTRACTS_OK: full palette space, transparency passes, direct/indexed art, save-picture columns, font metrics and event selectors without a renderer"); + } +} diff --git a/tests/gameplay/GameplayContracts.csproj b/tests/gameplay/GameplayContracts.csproj new file mode 100644 index 0000000..ce1d457 --- /dev/null +++ b/tests/gameplay/GameplayContracts.csproj @@ -0,0 +1,14 @@ + + + + Exe + net10.0 + enable + true + $(MSBuildThisFileDirectory)../../addons/wol_engine/portable + + + + + + diff --git a/tests/gameplay/Program.cs b/tests/gameplay/Program.cs new file mode 100644 index 0000000..49ba31c --- /dev/null +++ b/tests/gameplay/Program.cs @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: AGPL-3.0-only +using System; +using System.Collections.Generic; +using System.IO; +using Wol.Games.Vagrant.Runtime; + +var assembly = typeof(VibrationDriver).Assembly; +if (assembly == typeof(Program).Assembly) throw new InvalidOperationException("Gameplay was compiled into the test host."); +foreach (var dependency in assembly.GetReferencedAssemblies()) + if (dependency.Name is not { } name || !name.StartsWith("System", StringComparison.Ordinal) && name != "WolEngine.Core") + throw new InvalidOperationException("Gameplay depends on a host backend: " + dependency.FullName); + +foreach (var dependency in typeof(Wol.Engine.Imaging.RasterImage).Assembly.GetReferencedAssemblies()) + if (dependency.Name is not { } name || !name.StartsWith("System", StringComparison.Ordinal)) + throw new InvalidOperationException("The portable core depends on a backend: " + dependency.FullName); +ContentContracts.Check(); + +bool wasEnabled = VibrationDriver.Enabled; +try +{ + VibrationDriver.Enabled = true; + var sent = new List<(float Weak, float Strong)>(); + var driver = new VibrationDriver((weak, strong) => sent.Add((weak, strong))); + byte[] input = { 5, 2, 1, 0, 0, 2, 100, 2, 200, 0, 0, 99 }; + var envelope = VibrationDriver.Decode(input); + if (envelope.Length != 11 || input.Length != 12) throw new InvalidOperationException("Track extent or source ownership changed."); + driver.Start(envelope, 1); + driver.Start(envelope, 2); + driver.Start(envelope, 3); + driver.Step(); + if (driver.Levels != (2, 255) || sent.Count != 1 || sent[0] != (1f, 1f)) + throw new InvalidOperationException("Two channels did not saturate or an occupied channel was replaced."); + driver.Stop(2); + if (sent.Count != 1) throw new InvalidOperationException("Tagged stop changed output before the next gameplay tick."); + driver.Step(); + if (driver.Levels != (1, 200) || sent[^1] != (1f, 200 / 255f)) + throw new InvalidOperationException("Tagged stop removed the wrong channel or changed large-motor interpolation."); + driver.Step(); + if (driver.Levels != (0, 100) || sent[^1] != (0f, 100 / 255f)) + throw new InvalidOperationException("The small motor did not stop independently of the large-motor ramp."); + driver.Step(); + if (driver.Levels != (0, 0) || sent[^1] != (0f, 0f)) throw new InvalidOperationException("The motors did not finish at zero."); + int endedCount = sent.Count; + driver.Step(); driver.Stop(); + if (sent.Count != endedCount) throw new InvalidOperationException("Unchanged zero output was sent again."); + + sent.Clear(); + byte[] hold = { 5, 8, 1, 0, 0, 8, 255, 8, 255, 0, 0 }; + driver.Start(hold, 7); driver.Step(); + VibrationDriver.Enabled = false; driver.Step(); + if (driver.Levels != (1, 255) || sent.Count != 2 || sent[^1] != (0f, 0f)) + throw new InvalidOperationException("Disabling output changed the envelope state or failed to stop motors."); + driver.Step(); + if (sent.Count != 2) throw new InvalidOperationException("Disabled output was resent without a strength change."); + VibrationDriver.Enabled = true; driver.Step(); + if (sent.Count != 3 || sent[^1] != (1f, 1f)) throw new InvalidOperationException("Re-enabling output did not resume the current envelope."); + driver.Stop(); + if (sent.Count != 4 || sent[^1] != (0f, 0f)) throw new InvalidOperationException("Stop-all did not stop immediately."); + + foreach (byte[] truncated in new[] { Array.Empty(), new byte[] { 0 }, new byte[] { 5, 2, 1 } }) + { + bool rejected = false; + try { _ = VibrationDriver.Decode(truncated); } + catch (InvalidDataException) { rejected = true; } + if (!rejected) throw new InvalidOperationException("A truncated envelope was accepted."); + } + Console.WriteLine("GAMEPLAY_CONTRACTS_OK: no Godot/backend references; two channels, saturation, independent tracks, tagged stops, output suppression and enable/resume"); +} +finally { VibrationDriver.Enabled = wasEnabled; } diff --git a/tools/release.py b/tools/release.py index 940ac3b..60b094b 100644 --- a/tools/release.py +++ b/tools/release.py @@ -42,10 +42,10 @@ def verify_projection(self): with tempfile.TemporaryDirectory(prefix="vagrant-projection-", dir=self.cache) as temporary: stage = Path(temporary) for name in ("project.godot", "Vagrant.csproj", "Vagrant.sln", "global.json", "export_presets.cfg", - "installation", "runtime", "scenes", "tests"): + "installation", "runtime", "gameplay", "scenes", "tests"): source = self.root / name if source.is_dir(): - shutil.copytree(source, stage / name) + shutil.copytree(source, stage / name, ignore=shutil.ignore_patterns("bin", "obj")) else: shutil.copy2(source, stage / name) shutil.copytree(self.engine, stage / "addons/wol_engine") @@ -308,6 +308,11 @@ def audit(self, output): if not libraries or any(hashlib.sha256(p.read_bytes()).hexdigest() != expected for p in libraries): raise RuntimeError("The player did not retain the pinned Release library: " + name) + expected_core = hashlib.sha256((self.engine / "portable/Release/WolEngine.Core.dll").read_bytes()).hexdigest() + libraries = list(output.rglob("WolEngine.Core.dll")) + if not libraries or any(hashlib.sha256(p.read_bytes()).hexdigest() != expected_core for p in libraries): + raise RuntimeError("The player did not retain the pinned portable core library") + def build(self): editor, api = self.prepare() output = Path(self.args.output or self.root / "dist" / self.args.target).resolve() @@ -320,14 +325,15 @@ def build(self): # A whitelist prevents local discs, caches, test assets and unrelated engine content entering the exporter. with tempfile.TemporaryDirectory(prefix="vagrant-export-", dir=self.cache) as temp: stage = Path(temp) - for name in ("project.godot", "Vagrant.csproj", "Vagrant.sln", "global.json", "export_presets.cfg", "installation", "runtime", "scenes"): + for name in ("project.godot", "Vagrant.csproj", "Vagrant.sln", "global.json", "export_presets.cfg", "installation", "runtime", "gameplay", "scenes"): source = self.root / name if source.is_dir(): - shutil.copytree(source, stage / name) + shutil.copytree(source, stage / name, ignore=shutil.ignore_patterns("bin", "obj")) else: shutil.copy2(source, stage / name) addon = stage / "addons/wol_engine" shutil.copytree(self.engine / "runtime", addon / "runtime") + shutil.copytree(self.engine / "portable", addon / "portable") sdk = addon / "platforms" / self.args.target sdk.mkdir(parents=True) shutil.copy2(self.sdk / "GodotApi.props", sdk / "GodotApi.props")