summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-03-23 02:40:17 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-03-23 02:40:17 -0300
commit94553db6c146d01aa7bcf8ed24069acaac0de3db (patch)
tree339c4ad2714d444548b8ea05eceb45556dd2266a
parent984e290d162372b5347daf3b1bcb13753a7c7877 (diff)
parent1793c7a0ad12c41800b95152279009ad8843323d (diff)
Merge branch 'main' of https://github.com/HarbourMasters/Starship
-rw-r--r--CMakeLists.txt2
-rw-r--r--docs/BUILDING.md9
m---------libultraship0
-rw-r--r--port/assets/fonts/Fipps-Regular.otfbin34220 -> 0 bytes
-rw-r--r--port/assets/fonts/PressStart2P-Regular.ttfbin116008 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/ABtn.pngbin10967 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/BBtn.pngbin1300 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/CDown.pngbin11241 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/CLeft.pngbin11232 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/CRight.pngbin11284 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/CUp.pngbin11219 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/LBtn.pngbin355 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/RBtn.pngbin379 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/StartBtn.pngbin11868 -> 0 bytes
-rw-r--r--port/assets/textures/buttons/ZBtn.pngbin1241 -> 0 bytes
-rw-r--r--port/assets/textures/icons/gIcon.pngbin114822 -> 0 bytes
-rw-r--r--port/assets/textures/virtual/gEmptyTexture.rgba32.pngbin194 -> 0 bytes
-rw-r--r--port/shaders/directx/default.shader.hlsl332
-rw-r--r--port/shaders/metal/default.shader.metal295
-rw-r--r--port/shaders/opengl/default.shader.fs210
-rw-r--r--port/shaders/opengl/default.shader.vs79
-rw-r--r--src/overlays/ovl_ending/fox_end2.c6
-rw-r--r--src/port/resource/importers/AnimFactory.cpp5
-rw-r--r--src/port/resource/importers/AnimFactory.h3
-rw-r--r--src/port/resource/importers/ColPolyFactory.cpp5
-rw-r--r--src/port/resource/importers/ColPolyFactory.h3
-rw-r--r--src/port/resource/importers/EnvSettingsFactory.cpp5
-rw-r--r--src/port/resource/importers/EnvSettingsFactory.h3
-rw-r--r--src/port/resource/importers/GenericArrayFactory.cpp5
-rw-r--r--src/port/resource/importers/GenericArrayFactory.h3
-rw-r--r--src/port/resource/importers/HitboxFactory.cpp5
-rw-r--r--src/port/resource/importers/HitboxFactory.h3
-rw-r--r--src/port/resource/importers/LimbFactory.cpp5
-rw-r--r--src/port/resource/importers/LimbFactory.h3
-rw-r--r--src/port/resource/importers/MessageFactory.cpp5
-rw-r--r--src/port/resource/importers/MessageFactory.h3
-rw-r--r--src/port/resource/importers/MessageLookupFactory.cpp5
-rw-r--r--src/port/resource/importers/MessageLookupFactory.h3
-rw-r--r--src/port/resource/importers/ObjectInitFactory.cpp5
-rw-r--r--src/port/resource/importers/ObjectInitFactory.h3
-rw-r--r--src/port/resource/importers/ScriptCommandFactory.cpp5
-rw-r--r--src/port/resource/importers/ScriptCommandFactory.h3
-rw-r--r--src/port/resource/importers/ScriptFactory.cpp5
-rw-r--r--src/port/resource/importers/ScriptFactory.h3
-rw-r--r--src/port/resource/importers/SkeletonFactory.cpp5
-rw-r--r--src/port/resource/importers/SkeletonFactory.h3
-rw-r--r--src/port/resource/importers/Vec3fFactory.cpp5
-rw-r--r--src/port/resource/importers/Vec3fFactory.h3
-rw-r--r--src/port/resource/importers/Vec3sFactory.cpp5
-rw-r--r--src/port/resource/importers/Vec3sFactory.h3
-rw-r--r--src/port/resource/importers/audio/AudioTableFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/AudioTableFactory.h3
-rw-r--r--src/port/resource/importers/audio/BookFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/BookFactory.h3
-rw-r--r--src/port/resource/importers/audio/DrumFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/DrumFactory.h3
-rw-r--r--src/port/resource/importers/audio/EnvelopeFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/EnvelopeFactory.h3
-rw-r--r--src/port/resource/importers/audio/InstrumentFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/InstrumentFactory.h3
-rw-r--r--src/port/resource/importers/audio/LoopFactory.cpp5
-rw-r--r--src/port/resource/importers/audio/LoopFactory.h3
-rw-r--r--src/port/resource/importers/audio/SampleFactory.cpp16
-rw-r--r--src/port/resource/importers/audio/SampleFactory.h6
-rw-r--r--src/port/resource/importers/audio/SoundFontFactory.cpp10
-rw-r--r--src/port/resource/importers/audio/SoundFontFactory.h6
m---------tools/Torch0
67 files changed, 1050 insertions, 81 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c07f4bb..7ee76816 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -607,7 +607,7 @@ add_custom_target(
)
add_custom_target(
- GeneratePortOTR
+ GeneratePortO2R
DEPENDS TorchExternal
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${TORCH_EXECUTABLE} pack port starship.o2r o2r
diff --git a/docs/BUILDING.md b/docs/BUILDING.md
index aac581e6..e6922301 100644
--- a/docs/BUILDING.md
+++ b/docs/BUILDING.md
@@ -36,6 +36,9 @@ cd starship
# Generate sf64.o2r
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets
+# Generate starship.o2r
+& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target GeneratePortO2R
+
# Compile project
# Add `--config Release` if you're packaging
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64
@@ -133,6 +136,9 @@ cmake -H. -Bbuild-cmake -GNinja
# Generate sf64.o2r
cmake --build build-cmake --target ExtractAssets
+# Generate starship.o2r
+cmake --build build-cmake --target GeneratePortO2R
+
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
@@ -180,6 +186,9 @@ cmake -H. -Bbuild-cmake -GNinja
# Generate sf64.o2r
cmake --build build-cmake --target ExtractAssets
+# Generate starship.o2r
+cmake --build build-cmake --target GeneratePortO2R
+
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
diff --git a/libultraship b/libultraship
-Subproject 02bb77ef253e2de0969fd2cb36ad2e870677d18
+Subproject c6bd64c5da0e55a1c00e969bc01046f9335cda4
diff --git a/port/assets/fonts/Fipps-Regular.otf b/port/assets/fonts/Fipps-Regular.otf
deleted file mode 100644
index 9334dad5..00000000
--- a/port/assets/fonts/Fipps-Regular.otf
+++ /dev/null
Binary files differ
diff --git a/port/assets/fonts/PressStart2P-Regular.ttf b/port/assets/fonts/PressStart2P-Regular.ttf
deleted file mode 100644
index 2442affb..00000000
--- a/port/assets/fonts/PressStart2P-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/ABtn.png b/port/assets/textures/buttons/ABtn.png
deleted file mode 100644
index c1b06571..00000000
--- a/port/assets/textures/buttons/ABtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/BBtn.png b/port/assets/textures/buttons/BBtn.png
deleted file mode 100644
index 99b1197c..00000000
--- a/port/assets/textures/buttons/BBtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/CDown.png b/port/assets/textures/buttons/CDown.png
deleted file mode 100644
index 741188ea..00000000
--- a/port/assets/textures/buttons/CDown.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/CLeft.png b/port/assets/textures/buttons/CLeft.png
deleted file mode 100644
index 5e26a206..00000000
--- a/port/assets/textures/buttons/CLeft.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/CRight.png b/port/assets/textures/buttons/CRight.png
deleted file mode 100644
index 9e618063..00000000
--- a/port/assets/textures/buttons/CRight.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/CUp.png b/port/assets/textures/buttons/CUp.png
deleted file mode 100644
index 6c0e29d2..00000000
--- a/port/assets/textures/buttons/CUp.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/LBtn.png b/port/assets/textures/buttons/LBtn.png
deleted file mode 100644
index 2e0a8f00..00000000
--- a/port/assets/textures/buttons/LBtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/RBtn.png b/port/assets/textures/buttons/RBtn.png
deleted file mode 100644
index c255643c..00000000
--- a/port/assets/textures/buttons/RBtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/StartBtn.png b/port/assets/textures/buttons/StartBtn.png
deleted file mode 100644
index c3e08dc3..00000000
--- a/port/assets/textures/buttons/StartBtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/buttons/ZBtn.png b/port/assets/textures/buttons/ZBtn.png
deleted file mode 100644
index def8d9a6..00000000
--- a/port/assets/textures/buttons/ZBtn.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/icons/gIcon.png b/port/assets/textures/icons/gIcon.png
deleted file mode 100644
index 69764591..00000000
--- a/port/assets/textures/icons/gIcon.png
+++ /dev/null
Binary files differ
diff --git a/port/assets/textures/virtual/gEmptyTexture.rgba32.png b/port/assets/textures/virtual/gEmptyTexture.rgba32.png
deleted file mode 100644
index eaf806b7..00000000
--- a/port/assets/textures/virtual/gEmptyTexture.rgba32.png
+++ /dev/null
Binary files differ
diff --git a/port/shaders/directx/default.shader.hlsl b/port/shaders/directx/default.shader.hlsl
new file mode 100644
index 00000000..f36c2dae
--- /dev/null
+++ b/port/shaders/directx/default.shader.hlsl
@@ -0,0 +1,332 @@
+@prism(type='hlsl', name='Fast3D HLSL Shader', version='1.0.0', description='Ported shader to prism', author='Emill & Prism Team')
+
+@if(o_root_signature)
+ @if(o_textures[0])
+ #define RS "RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_VERTEX_SHADER_ROOT_ACCESS), CBV(b0, visibility = SHADER_VISIBILITY_PIXEL), DescriptorTable(SRV(t0), visibility = SHADER_VISIBILITY_PIXEL), DescriptorTable(Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL)"
+ @end
+ @if(o_textures[1])
+ #define RS "RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_VERTEX_SHADER_ROOT_ACCESS), CBV(b0, visibility = SHADER_VISIBILITY_PIXEL), DescriptorTable(SRV(t1), visibility = SHADER_VISIBILITY_PIXEL), DescriptorTable(Sampler(s1), visibility = SHADER_VISIBILITY_PIXEL)"
+ @end
+@end
+
+struct PSInput {
+ float4 position : SV_POSITION;
+@for(i in 0..2)
+ @if(o_textures[i])
+ float2 uv@{i} : TEXCOORD@{i};
+ @{update_floats(2)}
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ float texClampS@{i} : TEXCLAMPS@{i};
+ @else
+ float texClampT@{i} : TEXCLAMPT@{i};
+ @end
+ @{update_floats(1)}
+ @end
+ @end
+ @end
+@end
+
+@if(o_fog)
+float4 fog : FOG;
+@{update_floats(4)}
+@end
+@if(o_grayscale)
+float4 grayscale : GRAYSCALE;
+@{update_floats(4)}
+@end
+
+@for(i in 0..o_inputs)
+ @if(o_alpha)
+ float4 input@{i + 1} : INPUT@{i};
+ @{update_floats(4)}
+ @else
+ float3 input@{i + 1} : INPUT@{i};
+ @{update_floats(3)}
+ @end
+@end
+};
+
+@if(o_textures[0])
+ Texture2D g_texture0 : register(t0);
+ SamplerState g_sampler0 : register(s0);
+@end
+@if(o_textures[1])
+ Texture2D g_texture1 : register(t1);
+ SamplerState g_sampler1 : register(s1);
+@end
+
+@if(o_masks[0]) Texture2D g_textureMask0 : register(t2);
+@if(o_masks[1]) Texture2D g_textureMask1 : register(t3);
+
+@if(o_blend[0]) Texture2D g_textureBlend0 : register(t4);
+@if(o_blend[1]) Texture2D g_textureBlend1 : register(t5);
+
+cbuffer PerFrameCB : register(b0) {
+ uint noise_frame;
+ float noise_scale;
+}
+
+float random(in float3 value) {
+ float random = dot(value, float3(12.9898, 78.233, 37.719));
+ return frac(sin(random) * 143758.5453);
+}
+
+// 3 point texture filtering
+// Original author: ArthurCarvalho
+// Based on GLSL implementation by twinaphex, mupen64plus-libretro project.
+
+@if(o_three_point_filtering && o_textures[0] || o_textures[1])
+cbuffer PerDrawCB : register(b1) {
+ struct {
+ uint width;
+ uint height;
+ bool linear_filtering;
+ } textures[2];
+}
+
+#define TEX_OFFSET(tex, tSampler, texCoord, off, texSize) tex.Sample(tSampler, texCoord - off / texSize)
+
+float4 tex2D3PointFilter(in Texture2D tex, in SamplerState tSampler, in float2 texCoord, in float2 texSize) {
+ float2 offset = frac(texCoord * texSize - float2(0.5, 0.5));
+ offset -= step(1.0, offset.x + offset.y);
+ float4 c0 = TEX_OFFSET(tex, tSampler, texCoord, offset, texSize);
+ float4 c1 = TEX_OFFSET(tex, tSampler, texCoord, float2(offset.x - sign(offset.x), offset.y), texSize);
+ float4 c2 = TEX_OFFSET(tex, tSampler, texCoord, float2(offset.x, offset.y - sign(offset.y)), texSize);
+ return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0);
+}
+@end
+
+PSInput VSMain(
+ float4 position : POSITION
+@for(i in 0..2)
+ @if(o_textures[i])
+ , float2 uv@{i} : TEXCOORD@{i}
+ @end
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ , float texClampS@{i} : TEXCLAMPS@{i}
+ @else
+ , float texClampT@{i} : TEXCLAMPT@{i}
+ @end
+ @end
+ @end
+@end
+@if(o_fog)
+ , float4 fog : FOG
+@end
+@if(o_grayscale)
+ , float4 grayscale : GRAYSCALE
+@end
+@for(i in 0..o_inputs)
+ @if(o_alpha)
+ , float4 input@{i + 1} : INPUT@{i}
+ @else
+ , float3 input@{i + 1} : INPUT@{i}
+ @end
+@end
+) {
+ PSInput result;
+ result.position = position;
+ @for(i in 0..2)
+ @if(o_textures[i])
+ result.uv@{i} = uv@{i};
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ result.texClampS@{i} = texClampS@{i};
+ @else
+ result.texClampT@{i} = texClampT@{i};
+ @end
+ @end
+ @end
+ @end
+ @end
+
+ @if(o_fog)
+ result.fog = fog;
+ @end
+
+ @if(o_grayscale)
+ result.grayscale = grayscale;
+ @end
+
+ @for(i in 0..o_inputs)
+ @if(o_alpha)
+ result.input@{i + 1} = input@{i + 1};
+ @else
+ result.input@{i + 1} = float4(input@{i + 1}, 1.0);
+ @end
+ @end
+
+ return result;
+}
+
+@if(o_root_signature)
+ [RootSignature(RS)]
+@end
+
+@if(srgb_mode)
+ float4 fromLinear(float4 linearRGB){
+ bool3 cutoff = linearRGB.rgb < float3(0.0031308, 0.0031308, 0.0031308);
+ float3 higher = 1.055 * pow(linearRGB.rgb, float3(1.0 / 2.4, 1.0 / 2.4, 1.0 / 2.4)) - float3(0.055, 0.055, 0.055);
+ float3 lower = linearRGB.rgb * float3(12.92, 12.92, 12.92);
+ return float4(lerp(higher, lower, cutoff), linearRGB.a);
+ }
+@end
+
+#define MOD(x, y) ((x) - (y) * floor((x)/(y)))
+#define WRAP(x, low, high) MOD((x)-(low), (high)-(low)) + (low)
+
+float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {
+ @for(i in 0..2)
+ @if(o_textures[i])
+ float2 tc@{i} = input.uv@{i};
+ @{s = o_clamp[i][0]}
+ @{t = o_clamp[i][1]}
+ @if(s && t)
+ int2 texSize@{i};
+ g_texture@{i}.GetDimensions(texSize@{i}.x, texSize@{i}.y);
+ @if(s && t)
+ tc@{i} = clamp(tc@{i}, 0.5 / texSize@{i}, float2(input.texClampS@{i}, input.texClampT@{i}));
+ @elseif(s)
+ tc@{i} = float2(clamp(tc@{i}.x, 0.5 / texSize@{i}.x, input.texClampS@{i}), tc@{i}.y);
+ @else
+ tc@{i} = float2(tc@{i}.x, clamp(tc@{i}.y, 0.5 / texSize@{i}.y, input.texClampT@{i}));
+ @end
+ @end
+
+ @if(o_three_point_filtering)
+ float4 texVal@{i};
+ if (textures[@{i}].linear_filtering) {
+ @if(o_masks[i])
+ texVal@{i} = tex2D3PointFilter(g_texture@{i}, g_sampler@{i}, tc@{i}, float2(textures[@{i}].width, textures[@{i}].height));
+ float2 maskSize@{i};
+ g_textureMask@{i}.GetDimensions(maskSize@{i}.x, maskSize@{i}.y);
+ float4 maskVal@{i} = tex2D3PointFilter(g_textureMask@{i}, g_sampler@{i}, tc@{i}, maskSize@{i});
+ @if(o_blend[i])
+ float4 blendVal@{i} = tex2D3PointFilter(g_textureBlend@{i}, g_sampler@{i}, tc@{i}, float2(textures[@{i}].width, textures[@{i}].height));
+ @else
+ float4 blendVal@{i} = float4(0, 0, 0, 0);
+ @end
+
+ texVal@{i} = lerp(texVal@{i}, blendVal@{i}, maskVal@{i}.a);
+ @else
+ texVal@{i} = tex2D3PointFilter(g_texture@{i}, g_sampler@{i}, tc@{i}, float2(textures[@{i}].width, textures[@{i}].height));
+ @end
+ } else {
+ texVal@{i} = g_texture@{i}.Sample(g_sampler@{i}, tc@{i});
+ @if(o_masks[i])
+ @if(o_blend[i])
+ float4 blendVal@{i} = g_textureBlend@{i}.Sample(g_sampler@{i}, tc@{i});
+ @else
+ float4 blendVal@{i} = float4(0, 0, 0, 0);
+ @end
+ texval@{i} = lerp(texVal@{i}, blendVal@{i}, g_textureMask@{i}.Sample(g_sampler@{i}, tc@{i}).a);
+ @end
+ }
+ @else
+ float4 texVal@{i} = g_texture@{i}.Sample(g_sampler@{i}, tc@{i});
+ @if(o_masks[i])
+ @if(o_blend[i])
+ float4 blendVal@{i} = g_textureBlend@{i}.Sample(g_sampler@{i}, tc@{i});
+ @else
+ float4 blendVal@{i} = float4(0, 0, 0, 0);
+ @end
+ texVal@{i} = lerp(texVal@{i}, blendVal@{i}, g_textureMask@{i}.Sample(g_sampler@{i}, tc@{i}).a);
+ @end
+ @end
+ @end
+ @end
+
+ @if(o_alpha)
+ float4 texel;
+ @else
+ float3 texel;
+ @end
+
+ @if(o_2cyc)
+ @{f_range = 2}
+ @else
+ @{f_range = 1}
+ @end
+
+ @for(c in 0..f_range)
+ @if(c == 1)
+ @if(o_alpha)
+ @if(o_c[c][1][2] == SHADER_COMBINED)
+ texel.a = WRAP(texel.a, -1.01, 1.01);
+ @else
+ texel.a = WRAP(texel.a, -0.51, 1.51);
+ @end
+ @end
+
+ @if(o_c[c][0][2] == SHADER_COMBINED)
+ texel.rgb = WRAP(texel.rgb, -1.01, 1.01);
+ @else
+ texel.rgb = WRAP(texel.rgb, -0.51, 1.51);
+ @end
+ @end
+
+ @if(!o_color_alpha_same[c] && o_alpha)
+ texel = float4(@{
+ append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], false, false, true, c == 0)
+ }, @{append_formula(o_c[c], o_do_single[c][1],
+ o_do_multiply[c][1], o_do_mix[c][1], true, true, true, c == 0)
+ });
+ @else
+ texel = @{append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], o_alpha, false,
+ o_alpha, c == 0)};
+ @end
+ @end
+
+ @if(o_texture_edge && o_alpha)
+ if (texel.a > 0.19) texel.a = 1.0; else discard;
+ @end
+
+ texel = WRAP(texel, -0.51, 1.51);
+ texel = clamp(texel, 0.0, 1.0);
+ // TODO discard if alpha is 0?
+ @if(o_fog)
+ @if(o_alpha)
+ texel = float4(lerp(texel.rgb, input.fog.rgb, input.fog.a), texel.a);
+ @else
+ texel = lerp(texel, input.fog.rgb, input.fog.a);
+ @end
+ @end
+
+ @if(o_grayscale)
+ float intensity = (texel.r + texel.g + texel.b) / 3.0;
+ float3 new_texel = input.grayscale.rgb * intensity;
+ texel.rgb = lerp(texel.rgb, new_texel, input.grayscale.a);
+ @end
+
+ @if(o_alpha && o_noise)
+ float2 coords = screenSpace.xy * noise_scale;
+ texel.a *= round(saturate(random(float3(floor(coords), noise_frame)) + texel.a - 0.5));
+ @end
+
+ @if(o_alpha)
+ @if(o_alpha_threshold)
+ if (texel.a < 8.0 / 256.0) discard;
+ @end
+ @if(o_invisible)
+ texel.a = 0.0;
+ @end
+ @if(srgb_mode)
+ return fromLinear(texel);
+ @else
+ return texel;
+ @end
+ @else
+ @if(srgb_mode)
+ return fromLinear(float4(texel, 1.0));
+ @else
+ return float4(texel, 1.0);
+ @end
+ @end
+} \ No newline at end of file
diff --git a/port/shaders/metal/default.shader.metal b/port/shaders/metal/default.shader.metal
new file mode 100644
index 00000000..63d89fd3
--- /dev/null
+++ b/port/shaders/metal/default.shader.metal
@@ -0,0 +1,295 @@
+@prism(type='metal', name='Fast3D Metal Shader', version='1.0.0', description='Ported shader to prism', author='Emill & Prism Team')
+
+#include <metal_stdlib>
+using namespace metal;
+
+// BEGIN VERTEX SHADER
+struct FrameUniforms {
+ int frameCount;
+ float noiseScale;
+};
+
+struct Vertex {
+ float4 position [[attribute(@{get_vertex_index()})]];
+ @{update_floats(4)}
+ @for(i in 0..2)
+ @if(o_textures[i])
+ float2 texCoord@{i} [[attribute(@{get_vertex_index()})]];
+ @{update_floats(2)}
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ float texClampS@{i} [[attribute(@{get_vertex_index()})]];
+ @else
+ float texClampT@{i} [[attribute(@{get_vertex_index()})]];
+ @end
+ @{update_floats(1)}
+ @end
+ @end
+ @end
+ @end
+ @if(o_fog)
+ float4 fog [[attribute(@{get_vertex_index()})]];
+ @{update_floats(4)}
+ @end
+ @if(o_grayscale)
+ float4 grayscale [[attribute(@{get_vertex_index()})]];
+ @{update_floats(4)}
+ @end
+ @for(i in 0..o_inputs)
+ @if(o_alpha)
+ float4 input@{i + 1} [[attribute(@{get_vertex_index()})]];
+ @{update_floats(4)}
+ @else
+ float3 input@{i + 1} [[attribute(@{get_vertex_index()})]];
+ @{update_floats(3)}
+ @end
+ @end
+};
+
+struct ProjectedVertex {
+ @for(i in 0..2)
+ @if(o_textures[i])
+ float2 texCoord@{i};
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ float texClampS@{i};
+ @else
+ float texClampT@{i};
+ @end
+ @end
+ @end
+ @end
+ @end
+ @if(o_fog)
+ float4 fog;
+ @end
+ @if(o_grayscale)
+ float4 grayscale;
+ @end
+ @for(i in 0..o_inputs)
+ @if(o_alpha)
+ float4 input@{i + 1};
+ @else
+ float3 input@{i + 1};
+ @end
+ @end
+ float4 position [[position]];
+};
+
+vertex ProjectedVertex vertexShader(Vertex in [[stage_in]]) {
+ ProjectedVertex out;
+ @for(i in 0..2)
+ @if(o_textures[i])
+ out.texCoord@{i} = in.texCoord@{i};
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ out.texClampS@{i} = in.texClampS@{i};
+ @else
+ out.texClampT@{i} = in.texClampT@{i};
+ @end
+ @end
+ @end
+ @end
+ @end
+ @if(o_fog)
+ out.fog = in.fog;
+ @end
+ @if(o_grayscale)
+ out.grayscale = in.grayscale;
+ @end
+ @for(i in 0..o_inputs)
+ out.input@{i + 1} = in.input@{i + 1};
+ @end
+ out.position = in.position;
+ return out;
+}
+// END - BEGIN FRAGMENT SHADER
+
+float mod(float x, float y) {
+ return float(x - y * floor(x / y));
+}
+
+float3 mod(float3 a, float3 b) {
+ return float3(a.x - b.x * floor(a.x / b.x), a.y - b.y * floor(a.y / b.y), a.z - b.z * floor(a.z / b.z));
+}
+
+float4 mod(float4 a, float4 b) {
+ return float4(a.x - b.x * floor(a.x / b.x), a.y - b.y * floor(a.y / b.y), a.z - b.z * floor(a.z / b.z), a.w - b.w * floor(a.w / b.w));
+}
+
+#define WRAP(x, low, high) mod((x)-(low), (high)-(low)) + (low)
+#define TEX_OFFSET(tex, texSmplr, texCoord, off, texSize) tex.sample(texSmplr, texCoord - off / texSize)
+
+@if(o_three_point_filtering)
+ float4 filter3point(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& texCoord, thread const float2& texSize) {
+ float2 offset = fract((texCoord * texSize) - float2(0.5));
+ offset -= float2(step(1.0, offset.x + offset.y));
+ float4 c0 = TEX_OFFSET(tex, texSmplr, texCoord, offset, texSize);
+ float4 c1 = TEX_OFFSET(tex, texSmplr, texCoord, float2(offset.x - sign(offset.x), offset.y), texSize);
+ float4 c2 = TEX_OFFSET(tex, texSmplr, texCoord, float2(offset.x, offset.y - sign(offset.y)), texSize);
+ return c0 + abs(offset.x) * (c1 - c0) + abs(offset.y) * (c2 - c0);
+ }
+
+ float4 hookTexture2D(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv, thread const float2& texSize) {
+ return filter3point(tex, texSmplr, uv, texSize);
+ }
+@else
+ float4 hookTexture2D(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv, thread const float2& texSize) {
+ return tex.sample(texSmplr, uv);
+ }
+@end
+
+float random(float3 value) {
+ float random = dot(sin(value), float3(12.9898, 78.233, 37.719));
+ return fract(sin(random) * 143758.5453);
+}
+
+float4 fromLinear(float4 linearRGB) {
+ float3 threshold = float3(0.0031308);
+ float3 gamma = float3(1.0 / 2.4);
+ float3 scale = float3(12.92);
+ float3 offset = float3(1.055);
+ float3 subtract = float3(0.055);
+ float3 higher = offset * fast::pow(linearRGB.xyz, gamma) - subtract;
+ float3 lower = linearRGB.xyz * scale;
+ return float4(select(higher, lower, linearRGB.xyz < threshold), linearRGB.w);
+}
+
+fragment float4 fragmentShader(ProjectedVertex in [[stage_in]], constant FrameUniforms &frameUniforms [[buffer(0)]]
+@if(o_textures[0])
+ , texture2d<float> uTex0 [[texture(0)]], sampler uTex0Smplr [[sampler(0)]]
+@end
+@if(o_textures[1])
+ , texture2d<float> uTex1 [[texture(1)]], sampler uTex1Smplr [[sampler(1)]]
+@end
+@if(o_masks[0])
+ , texture2d<float> uTexMask0 [[texture(2)]]
+@end
+@if(o_masks[1])
+ , texture2d<float> uTexMask1 [[texture(3)]]
+@end
+@if(o_blend[0])
+ , texture2d<float> uTexBlend0 [[texture(4)]]
+@end
+@if(o_blend[1])
+ , texture2d<float> uTexBlend1 [[texture(5)]]
+@end
+) {
+ @for(i in 0..2)
+ @if(o_textures[i])
+ @{s = o_clamp[i][0]}
+ @{t = o_clamp[i][1]}
+ float2 texSize@{i} = float2(uTex@{i}.get_width(), uTex@{i}.get_height());
+ @if(!s && !t)
+ float2 vTexCoordAdj@{i} = in.texCoord@{i};
+ @else
+ @if(s && t)
+ float2 vTexCoordAdj@{i} = fast::clamp(in.texCoord@{i}, float2(0.5) / texSize@{i}, float2(in.texClampS@{i}, in.texClampT@{i}));
+ @elseif(s)
+ float2 vTexCoordAdj@{i} = float2(fast::clamp(in.texCoord@{i}.x, 0.5 / texSize@{i}.x, in.texClampS@{i}), in.texCoord@{i}.y);
+ @else
+ float2 vTexCoordAdj@{i} = float2(in.texCoord@{i}.x, fast::clamp(in.texCoord@{i}.y, 0.5 / texSize@{i}.y, in.texClampT@{i}));
+ @end
+ @end
+
+ float4 texVal@{i} = hookTexture2D(uTex@{i}, uTex@{i}Smplr, vTexCoordAdj@{i}, texSize@{i});
+
+ @if(o_masks[i])
+ float2 maskSize@{i} = float2(uTexMask@{i}.get_width(), uTexMask@{i}.get_height());
+ float4 maskVal@{i} = hookTexture2D(uTexMask@{i}, uTex@{i}Smplr, vTexCoordAdj@{i}, maskSize@{i});
+ @if(o_blend[i])
+ float4 blendVal@{i} = hookTexture2D(uTexBlend@{i}, uTex@{i}Smplr, vTexCoordAdj@{i}, texSize@{i});
+ @else
+ float4 blendVal@{i} = float4(0, 0, 0, 0);
+ @end
+
+ texVal@{i} = mix(texVal@{i}, blendVal@{i}, maskVal@{i}.w);
+ @end
+ @end
+ @end
+
+ @if(o_alpha)
+ float4 texel;
+ @else
+ float3 texel;
+ @end
+
+ @if(o_2cyc)
+ @{f_range = 2}
+ @else
+ @{f_range = 1}
+ @end
+
+ @for(c in 0..f_range)
+ @if(c == 1)
+ @if(o_alpha)
+ @if(o_c[c][1][2] == SHADER_COMBINED)
+ texel.w = WRAP(texel.w, -1.01, 1.01);
+ @else
+ texel.w = WRAP(texel.w, -0.51, 1.51);
+ @end
+ @end
+
+ @if(o_c[c][0][2] == SHADER_COMBINED)
+ texel.xyz = WRAP(texel.xyz, -1.01, 1.01);
+ @else
+ texel.xyz = WRAP(texel.xyz, -0.51, 1.51);
+ @end
+ @end
+
+ @if(!o_color_alpha_same[c] && o_alpha)
+ texel = float4(@{
+ append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], false, false, true, c == 0)
+ }, @{append_formula(o_c[c], o_do_single[c][1],
+ o_do_multiply[c][1], o_do_mix[c][1], true, true, true, c == 0)
+ });
+ @else
+ texel = @{append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], o_alpha, false,
+ o_alpha, c == 0)};
+ @end
+ @end
+
+ @if(o_texture_edge && o_alpha)
+ if (texel.w > 0.19) texel.w = 1.0; else discard_fragment();
+ @end
+
+ texel = WRAP(texel, -0.51, 1.51);
+ texel = clamp(texel, 0.0, 1.0);
+ // TODO discard if alpha is 0?
+
+ @if(o_fog)
+ @if(o_alpha)
+ texel = float4(mix(texel.xyz, in.fog.xyz, in.fog.w), texel.w);
+ @else
+ texel = mix(texel, in.fog.xyz, in.fog.w);
+ @end
+ @end
+
+ @if(o_grayscale)
+ float intensity = (texel.x + texel.y + texel.z) / 3.0;
+ float3 new_texel = in.grayscale.xyz * intensity;
+ texel.xyz = mix(texel.xyz, new_texel, in.grayscale.w);
+ @end
+
+ @if(o_alpha && o_noise)
+ float2 coords = screenSpace.xy * noise_scale;
+ texel.w *= round(saturate(random(float3(floor(coords), noise_frame)) + texel.w - 0.5));
+ @end
+
+ @if(o_alpha)
+ @if(o_alpha_threshold)
+ if (texel.w < 8.0 / 256.0) discard_fragment();
+ @end
+ @if(o_invisible)
+ texel.w = 0.0;
+ @end
+ return fromLinear(texel);
+ @else
+ return fromLinear(float4(texel, 1.0));
+ @end
+} \ No newline at end of file
diff --git a/port/shaders/opengl/default.shader.fs b/port/shaders/opengl/default.shader.fs
new file mode 100644
index 00000000..b15e1598
--- /dev/null
+++ b/port/shaders/opengl/default.shader.fs
@@ -0,0 +1,210 @@
+@prism(type='fragment', name='Fast3D Fragment Shader', version='1.0.0', description='Ported shader to prism', author='Emill & Prism Team')
+
+@{GLSL_VERSION}
+
+@if(core_opengl || opengles)
+out vec4 vOutColor;
+@end
+
+@for(i in 0..2)
+ @if(o_textures[i])
+ @{attr} vec2 vTexCoord@{i};
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ @{attr} float vTexClampS@{i};
+ @else
+ @{attr} float vTexClampT@{i};
+ @end
+ @end
+ @end
+ @end
+@end
+
+@if(o_fog) @{attr} vec4 vFog;
+@if(o_grayscale) @{attr} vec4 vGrayscaleColor;
+
+@for(i in 0..o_inputs)
+ @if(o_alpha)
+ @{attr} vec4 vInput@{i + 1};
+ @else
+ @{attr} vec3 vInput@{i + 1};
+ @end
+@end
+
+@if(o_textures[0]) uniform sampler2D uTex0;
+@if(o_textures[1]) uniform sampler2D uTex1;
+
+@if(o_masks[0]) uniform sampler2D uTexMask0;
+@if(o_masks[1]) uniform sampler2D uTexMask1;
+
+@if(o_blend[0]) uniform sampler2D uTexBlend0;
+@if(o_blend[1]) uniform sampler2D uTexBlend1;
+
+uniform int frame_count;
+uniform float noise_scale;
+
+#define TEX_OFFSET(off) @{texture}(tex, texCoord - off / texSize)
+#define WRAP(x, low, high) mod((x)-(low), (high)-(low)) + (low)
+
+float random(in vec3 value) {
+ float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));
+ return fract(sin(random) * 143758.5453);
+}
+
+vec4 fromLinear(vec4 linearRGB){
+ bvec3 cutoff = lessThan(linearRGB.rgb, vec3(0.0031308));
+ vec3 higher = vec3(1.055)*pow(linearRGB.rgb, vec3(1.0/2.4)) - vec3(0.055);
+ vec3 lower = linearRGB.rgb * vec3(12.92);
+ return vec4(mix(higher, lower, cutoff), linearRGB.a);
+}
+
+@if(o_current_filter == FILTER_THREE_POINT)
+vec4 filter3point(in sampler2D tex, in vec2 texCoord, in vec2 texSize) {
+ vec2 offset = fract(texCoord*texSize - vec2(0.5));
+ offset -= step(1.0, offset.x + offset.y);
+ vec4 c0 = TEX_OFFSET(offset);
+ vec4 c1 = TEX_OFFSET(vec2(offset.x - sign(offset.x), offset.y));
+ vec4 c2 = TEX_OFFSET(vec2(offset.x, offset.y - sign(offset.y)));
+ return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0);
+}
+
+vec4 hookTexture2D(in sampler2D tex, in vec2 uv, in vec2 texSize) {
+ return filter3point(tex, uv, texSize);
+}
+@else
+vec4 hookTexture2D(in sampler2D tex, in vec2 uv, in vec2 texSize) {
+ return @{texture}(tex, uv);
+}
+@end
+
+void main() {
+ @for(i in 0..2)
+ @if(o_textures[i])
+ @{s = o_clamp[i][0]}
+ @{t = o_clamp[i][1]}
+
+ @if(opengles)
+ vec2 texSize@{i} = vec2(textureSize(uTex@{i}, 0));
+ @else
+ vec2 texSize@{i} = textureSize(uTex@{i}, 0);
+ @end
+
+ @if(!s && !t)
+ vec2 vTexCoordAdj@{i} = vTexCoord@{i};
+ @else
+ @if(s && t)
+ vec2 vTexCoordAdj@{i} = clamp(vTexCoord@{i}, 0.5 / texSize@{i}, vec2(vTexClampS@{i}, vTexClampT@{i}));
+ @elseif(s)
+ vec2 vTexCoordAdj@{i} = vec2(clamp(vTexCoord@{i}.s, 0.5 / texSize@{i}.s, vTexClampS@{i}), vTexCoord@{i}.t);
+ @else
+ vec2 vTexCoordAdj@{i} = vec2(vTexCoord@{i}.s, clamp(vTexCoord@{i}.t, 0.5 / texSize@{i}.t, vTexClampT@{i}));
+ @end
+ @end
+
+ vec4 texVal@{i} = hookTexture2D(uTex@{i}, vTexCoordAdj@{i}, texSize@{i});
+
+ @if(o_masks[i])
+ @if(opengles)
+ vec2 maskSize@{i} = vec2(textureSize(uTexMask@{i}, 0));
+ @else
+ vec2 maskSize@{i} = textureSize(uTexMask@{i}, 0);
+ @end
+
+ vec4 maskVal@{i} = hookTexture2D(uTexMask@{i}, vTexCoordAdj@{i}, maskSize@{i});
+
+ @if(o_blend[i])
+ vec4 blendVal@{i} = hookTexture2D(uTexBlend@{i}, vTexCoordAdj@{i}, texSize@{i});
+ @else
+ vec4 blendVal@{i} = vec4(0, 0, 0, 0);
+ @end
+
+ texVal@{i} = mix(texVal@{i}, blendVal@{i}, maskVal@{i}.a);
+ @end
+ @end
+ @end
+
+ @if(o_alpha)
+ vec4 texel;
+ @else
+ vec3 texel;
+ @end
+
+ @if(o_2cyc)
+ @{f_range = 2}
+ @else
+ @{f_range = 1}
+ @end
+
+ @for(c in 0..f_range)
+ @if(c == 1)
+ @if(o_alpha)
+ @if(o_c[c][1][2] == SHADER_COMBINED)
+ texel.a = WRAP(texel.a, -1.01, 1.01);
+ @else
+ texel.a = WRAP(texel.a, -0.51, 1.51);
+ @end
+ @end
+
+ @if(o_c[c][0][2] == SHADER_COMBINED)
+ texel.rgb = WRAP(texel.rgb, -1.01, 1.01);
+ @else
+ texel.rgb = WRAP(texel.rgb, -0.51, 1.51);
+ @end
+ @end
+
+ @if(!o_color_alpha_same[c] && o_alpha)
+ texel = vec4(@{
+ append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], false, false, true, c == 0)
+ }, @{append_formula(o_c[c], o_do_single[c][1],
+ o_do_multiply[c][1], o_do_mix[c][1], true, true, true, c == 0)
+ });
+ @else
+ texel = @{append_formula(o_c[c], o_do_single[c][0],
+ o_do_multiply[c][0], o_do_mix[c][0], o_alpha, false,
+ o_alpha, c == 0)};
+ @end
+ @end
+
+ texel = WRAP(texel, -0.51, 1.51);
+ texel = clamp(texel, 0.0, 1.0);
+ // TODO discard if alpha is 0?
+ @if(o_fog)
+ @if(o_alpha)
+ texel = vec4(mix(texel.rgb, vFog.rgb, vFog.a), texel.a);
+ @else
+ texel = mix(texel, vFog.rgb, vFog.a);
+ @end
+ @end
+
+ @if(o_texture_edge && o_alpha)
+ if (texel.a > 0.19) texel.a = 1.0; else discard;
+ @end
+
+ @if(o_alpha && o_noise)
+ texel.a *= floor(clamp(random(vec3(floor(gl_FragCoord.xy * noise_scale), float(frame_count))) + texel.a, 0.0, 1.0));
+ @end
+
+ @if(o_grayscale)
+ float intensity = (texel.r + texel.g + texel.b) / 3.0;
+ vec3 new_texel = vGrayscaleColor.rgb * intensity;
+ texel.rgb = mix(texel.rgb, new_texel, vGrayscaleColor.a);
+ @end
+
+ @if(o_alpha)
+ @if(o_alpha_threshold)
+ if (texel.a < 8.0 / 256.0) discard;
+ @end
+ @if(o_invisible)
+ texel.a = 0.0;
+ @end
+ @{vOutColor} = texel;
+ @else
+ @{vOutColor} = vec4(texel, 1.0);
+ @end
+
+ @if(srgb_mode)
+ @{vOutColor} = fromLinear(@{vOutColor});
+ @end
+} \ No newline at end of file
diff --git a/port/shaders/opengl/default.shader.vs b/port/shaders/opengl/default.shader.vs
new file mode 100644
index 00000000..cf0f6276
--- /dev/null
+++ b/port/shaders/opengl/default.shader.vs
@@ -0,0 +1,79 @@
+@prism(type='fragment', name='Fast3D Fragment Shader', version='1.0.0', description='Ported shader to prism', author='Emill & Prism Team')
+
+@{GLSL_VERSION}
+
+@{attr} vec4 aVtxPos;
+
+@for(i in 0..2)
+ @if(o_textures[i])
+ @{attr} vec2 aTexCoord@{i};
+ @{out} vec2 vTexCoord@{i};
+ @{update_floats(2)}
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ @{attr} float aTexClampS@{i};
+ @{out} float vTexClampS@{i};
+ @else
+ @{attr} float aTexClampT@{i};
+ @{out} float vTexClampT@{i};
+ @end
+ @{update_floats(1)}
+ @end
+ @end
+ @end
+@end
+
+@if(o_fog)
+ @{attr} vec4 aFog;
+ @{out} vec4 vFog;
+ @{update_floats(4)}
+@end
+
+@if(o_grayscale)
+ @{attr} vec4 aGrayscaleColor;
+ @{out} vec4 vGrayscaleColor;
+ @{update_floats(4)}
+@end
+
+@for(i in 0..o_inputs)
+ @if(o_alpha)
+ @{attr} vec4 aInput@{i + 1};
+ @{out} vec4 vInput@{i + 1};
+ @{update_floats(4)}
+ @else
+ @{attr} vec3 aInput@{i + 1};
+ @{out} vec3 vInput@{i + 1};
+ @{update_floats(3)}
+ @end
+@end
+
+void main() {
+ @for(i in 0..2)
+ @if(o_textures[i])
+ vTexCoord@{i} = aTexCoord@{i};
+ @for(j in 0..2)
+ @if(o_clamp[i][j])
+ @if(j == 0)
+ vTexClampS@{i} = aTexClampS@{i};
+ @else
+ vTexClampT@{i} = aTexClampT@{i};
+ @end
+ @end
+ @end
+ @end
+ @end
+ @if(o_fog)
+ vFog = aFog;
+ @end
+ @if(o_grayscale)
+ vGrayscaleColor = aGrayscaleColor;
+ @end
+ @for(i in 0..o_inputs)
+ vInput@{i + 1} = aInput@{i + 1};
+ @end
+ gl_Position = aVtxPos;
+ @if(opengles)
+ gl_Position.z *= 0.3f;
+ @end
+} \ No newline at end of file
diff --git a/src/overlays/ovl_ending/fox_end2.c b/src/overlays/ovl_ending/fox_end2.c
index 41b8f5f4..bd32bfde 100644
--- a/src/overlays/ovl_ending/fox_end2.c
+++ b/src/overlays/ovl_ending/fox_end2.c
@@ -37,14 +37,14 @@ void Ending_8018CE20(u32 arg0) {
if ((D_ending_80192E74[i].unk_11 == 0) || (gVenomHardClear == 1)) {
if (D_ending_80192E74[i].unk_10 == 1) {
xPos = (SCREEN_WIDTH - Graphics_GetLargeTextWidth(D_ending_80192E74[i].unk_00)) / 2;
- RCP_SetupDL(&gMasterDisp, SETUPDL_83);
+ RCP_SetupDL(&gMasterDisp, SETUPDL_83_OPTIONAL);
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha);
Graphics_DisplayLargeText(xPos, D_ending_80192E74[i].unk_0E, 1.0f, 1.0f,
D_ending_80192E74[i].unk_00);
} else if (D_ending_80192E74[i].unk_10 == 2) {
- RCP_SetupDL(&gMasterDisp, SETUPDL_83);
+ RCP_SetupDL(&gMasterDisp, SETUPDL_83_OPTIONAL);
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha);
Lib_TextureRect_IA8(&gMasterDisp, D_ending_80192E74[i].unk_00, 192, 30, 64.0f, 105.0f, 1.0f,
@@ -144,7 +144,7 @@ void Ending_8018D638(u32 arg0, AssetInfo* asset) {
gFillScreenAlpha = gFillScreenAlphaTarget = alpha;
gFillScreenAlphaStep = 0;
- RCP_SetupDL(&gMasterDisp, SETUPDL_83);
+ RCP_SetupDL(&gMasterDisp, SETUPDL_83_OPTIONAL);
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
diff --git a/src/port/resource/importers/AnimFactory.cpp b/src/port/resource/importers/AnimFactory.cpp
index c532401d..f4682b4d 100644
--- a/src/port/resource/importers/AnimFactory.cpp
+++ b/src/port/resource/importers/AnimFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAnimV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAnimV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/AnimFactory.h b/src/port/resource/importers/AnimFactory.h
index 80f07932..b6eae299 100644
--- a/src/port/resource/importers/AnimFactory.h
+++ b/src/port/resource/importers/AnimFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryAnimV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/ColPolyFactory.cpp b/src/port/resource/importers/ColPolyFactory.cpp
index 91ec4602..fe00078e 100644
--- a/src/port/resource/importers/ColPolyFactory.cpp
+++ b/src/port/resource/importers/ColPolyFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryColPolyV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryColPolyV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/ColPolyFactory.h b/src/port/resource/importers/ColPolyFactory.h
index 817be9c5..625356df 100644
--- a/src/port/resource/importers/ColPolyFactory.h
+++ b/src/port/resource/importers/ColPolyFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryColPolyV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/EnvSettingsFactory.cpp b/src/port/resource/importers/EnvSettingsFactory.cpp
index 9959aec0..6e7da09c 100644
--- a/src/port/resource/importers/EnvSettingsFactory.cpp
+++ b/src/port/resource/importers/EnvSettingsFactory.cpp
@@ -6,8 +6,9 @@
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryEnvSettingsV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryEnvSettingsV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/EnvSettingsFactory.h b/src/port/resource/importers/EnvSettingsFactory.h
index cd269558..2a040c62 100644
--- a/src/port/resource/importers/EnvSettingsFactory.h
+++ b/src/port/resource/importers/EnvSettingsFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryEnvSettingsV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/GenericArrayFactory.cpp b/src/port/resource/importers/GenericArrayFactory.cpp
index 7fd6e50c..4e6bec07 100644
--- a/src/port/resource/importers/GenericArrayFactory.cpp
+++ b/src/port/resource/importers/GenericArrayFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryGenericArrayV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryGenericArrayV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/GenericArrayFactory.h b/src/port/resource/importers/GenericArrayFactory.h
index 78f9087f..e545e031 100644
--- a/src/port/resource/importers/GenericArrayFactory.h
+++ b/src/port/resource/importers/GenericArrayFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryGenericArrayV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/HitboxFactory.cpp b/src/port/resource/importers/HitboxFactory.cpp
index 40d4e3b4..fcf7763d 100644
--- a/src/port/resource/importers/HitboxFactory.cpp
+++ b/src/port/resource/importers/HitboxFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryHitboxV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryHitboxV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/HitboxFactory.h b/src/port/resource/importers/HitboxFactory.h
index 5be626ca..9da9f894 100644
--- a/src/port/resource/importers/HitboxFactory.h
+++ b/src/port/resource/importers/HitboxFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryHitboxV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/LimbFactory.cpp b/src/port/resource/importers/LimbFactory.cpp
index e1ffc191..8f35cbc7 100644
--- a/src/port/resource/importers/LimbFactory.cpp
+++ b/src/port/resource/importers/LimbFactory.cpp
@@ -7,8 +7,9 @@
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryLimbV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryLimbV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/LimbFactory.h b/src/port/resource/importers/LimbFactory.h
index f229733e..7a874982 100644
--- a/src/port/resource/importers/LimbFactory.h
+++ b/src/port/resource/importers/LimbFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryLimbV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/MessageFactory.cpp b/src/port/resource/importers/MessageFactory.cpp
index fcd4e943..3f04d046 100644
--- a/src/port/resource/importers/MessageFactory.cpp
+++ b/src/port/resource/importers/MessageFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryMessageV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryMessageV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/MessageFactory.h b/src/port/resource/importers/MessageFactory.h
index 74e37136..0a89395e 100644
--- a/src/port/resource/importers/MessageFactory.h
+++ b/src/port/resource/importers/MessageFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryMessageV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/MessageLookupFactory.cpp b/src/port/resource/importers/MessageLookupFactory.cpp
index 2ef3beeb..6d6e1f0f 100644
--- a/src/port/resource/importers/MessageLookupFactory.cpp
+++ b/src/port/resource/importers/MessageLookupFactory.cpp
@@ -5,8 +5,9 @@
#include "ResourceUtil.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryMessageLookupV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryMessageLookupV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/MessageLookupFactory.h b/src/port/resource/importers/MessageLookupFactory.h
index ab94e3a5..fd17c22c 100644
--- a/src/port/resource/importers/MessageLookupFactory.h
+++ b/src/port/resource/importers/MessageLookupFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryMessageLookupV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/ObjectInitFactory.cpp b/src/port/resource/importers/ObjectInitFactory.cpp
index 04822034..db7df4ad 100644
--- a/src/port/resource/importers/ObjectInitFactory.cpp
+++ b/src/port/resource/importers/ObjectInitFactory.cpp
@@ -6,8 +6,9 @@
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryObjectInitV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryObjectInitV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/ObjectInitFactory.h b/src/port/resource/importers/ObjectInitFactory.h
index 9e8ab64b..583c5615 100644
--- a/src/port/resource/importers/ObjectInitFactory.h
+++ b/src/port/resource/importers/ObjectInitFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryObjectInitV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/ScriptCommandFactory.cpp b/src/port/resource/importers/ScriptCommandFactory.cpp
index e5489c92..1b70e79b 100644
--- a/src/port/resource/importers/ScriptCommandFactory.cpp
+++ b/src/port/resource/importers/ScriptCommandFactory.cpp
@@ -4,8 +4,9 @@
#include "ResourceUtil.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryScriptCMDV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryScriptCMDV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/ScriptCommandFactory.h b/src/port/resource/importers/ScriptCommandFactory.h
index a2e8432c..0b38712c 100644
--- a/src/port/resource/importers/ScriptCommandFactory.h
+++ b/src/port/resource/importers/ScriptCommandFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryScriptCMDV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/ScriptFactory.cpp b/src/port/resource/importers/ScriptFactory.cpp
index 12f837fe..ed661efd 100644
--- a/src/port/resource/importers/ScriptFactory.cpp
+++ b/src/port/resource/importers/ScriptFactory.cpp
@@ -4,8 +4,9 @@
#include "ResourceUtil.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryScriptV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryScriptV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/ScriptFactory.h b/src/port/resource/importers/ScriptFactory.h
index 5c373787..deef1fb2 100644
--- a/src/port/resource/importers/ScriptFactory.h
+++ b/src/port/resource/importers/ScriptFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryScriptV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/SkeletonFactory.cpp b/src/port/resource/importers/SkeletonFactory.cpp
index 8cac1f79..2c3fd204 100644
--- a/src/port/resource/importers/SkeletonFactory.cpp
+++ b/src/port/resource/importers/SkeletonFactory.cpp
@@ -5,8 +5,9 @@
#include "ResourceUtil.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/SkeletonFactory.h b/src/port/resource/importers/SkeletonFactory.h
index 767ffffb..b0a460d0 100644
--- a/src/port/resource/importers/SkeletonFactory.h
+++ b/src/port/resource/importers/SkeletonFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinarySkeletonV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/Vec3fFactory.cpp b/src/port/resource/importers/Vec3fFactory.cpp
index 6781c5b7..4076860e 100644
--- a/src/port/resource/importers/Vec3fFactory.cpp
+++ b/src/port/resource/importers/Vec3fFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryVec3fV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryVec3fV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/Vec3fFactory.h b/src/port/resource/importers/Vec3fFactory.h
index bb9da1ad..1116aa55 100644
--- a/src/port/resource/importers/Vec3fFactory.h
+++ b/src/port/resource/importers/Vec3fFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryVec3fV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/Vec3sFactory.cpp b/src/port/resource/importers/Vec3sFactory.cpp
index 810dc95d..9a43deb2 100644
--- a/src/port/resource/importers/Vec3sFactory.cpp
+++ b/src/port/resource/importers/Vec3sFactory.cpp
@@ -3,8 +3,9 @@
#include "spdlog/spdlog.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryVec3sV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryVec3sV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/Vec3sFactory.h b/src/port/resource/importers/Vec3sFactory.h
index 85162dda..2182e498 100644
--- a/src/port/resource/importers/Vec3sFactory.h
+++ b/src/port/resource/importers/Vec3sFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryVec3sV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/AudioTableFactory.cpp b/src/port/resource/importers/audio/AudioTableFactory.cpp
index a2798a2e..80b02f56 100644
--- a/src/port/resource/importers/audio/AudioTableFactory.cpp
+++ b/src/port/resource/importers/audio/AudioTableFactory.cpp
@@ -3,8 +3,9 @@
#include "../ResourceUtil.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioTableV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioTableV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/AudioTableFactory.h b/src/port/resource/importers/audio/AudioTableFactory.h
index e27cbd79..a046131c 100644
--- a/src/port/resource/importers/audio/AudioTableFactory.h
+++ b/src/port/resource/importers/audio/AudioTableFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryAudioTableV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/BookFactory.cpp b/src/port/resource/importers/audio/BookFactory.cpp
index 88d05548..6643d13e 100644
--- a/src/port/resource/importers/audio/BookFactory.cpp
+++ b/src/port/resource/importers/audio/BookFactory.cpp
@@ -2,8 +2,9 @@
#include "port/resource/type/audio/AdpcmBook.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAdpcmBookV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAdpcmBookV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/BookFactory.h b/src/port/resource/importers/audio/BookFactory.h
index 0207cd81..d7de8c99 100644
--- a/src/port/resource/importers/audio/BookFactory.h
+++ b/src/port/resource/importers/audio/BookFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryAdpcmBookV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/DrumFactory.cpp b/src/port/resource/importers/audio/DrumFactory.cpp
index c6047983..b850dee3 100644
--- a/src/port/resource/importers/audio/DrumFactory.cpp
+++ b/src/port/resource/importers/audio/DrumFactory.cpp
@@ -3,8 +3,9 @@
#include "port/resource/type/audio/Drum.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryDrumV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryDrumV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/DrumFactory.h b/src/port/resource/importers/audio/DrumFactory.h
index 8b63febb..c618bb08 100644
--- a/src/port/resource/importers/audio/DrumFactory.h
+++ b/src/port/resource/importers/audio/DrumFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryDrumV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/EnvelopeFactory.cpp b/src/port/resource/importers/audio/EnvelopeFactory.cpp
index 1a3dfc60..ab789cb2 100644
--- a/src/port/resource/importers/audio/EnvelopeFactory.cpp
+++ b/src/port/resource/importers/audio/EnvelopeFactory.cpp
@@ -2,8 +2,9 @@
#include "port/resource/type/audio/Envelope.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryEnvelopeV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryEnvelopeV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/EnvelopeFactory.h b/src/port/resource/importers/audio/EnvelopeFactory.h
index 41107a4c..af2ac262 100644
--- a/src/port/resource/importers/audio/EnvelopeFactory.h
+++ b/src/port/resource/importers/audio/EnvelopeFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryEnvelopeV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/InstrumentFactory.cpp b/src/port/resource/importers/audio/InstrumentFactory.cpp
index 0a79e305..442ccff0 100644
--- a/src/port/resource/importers/audio/InstrumentFactory.cpp
+++ b/src/port/resource/importers/audio/InstrumentFactory.cpp
@@ -3,8 +3,9 @@
#include "port/resource/type/audio/Instrument.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryInstrumentV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryInstrumentV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/InstrumentFactory.h b/src/port/resource/importers/audio/InstrumentFactory.h
index ed99a5f2..64301594 100644
--- a/src/port/resource/importers/audio/InstrumentFactory.h
+++ b/src/port/resource/importers/audio/InstrumentFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryInstrumentV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/LoopFactory.cpp b/src/port/resource/importers/audio/LoopFactory.cpp
index f2dfca35..485c800a 100644
--- a/src/port/resource/importers/audio/LoopFactory.cpp
+++ b/src/port/resource/importers/audio/LoopFactory.cpp
@@ -2,8 +2,9 @@
#include "port/resource/type/audio/AdpcmLoop.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAdpcmLoopV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAdpcmLoopV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
diff --git a/src/port/resource/importers/audio/LoopFactory.h b/src/port/resource/importers/audio/LoopFactory.h
index b244249e..d2e78b10 100644
--- a/src/port/resource/importers/audio/LoopFactory.h
+++ b/src/port/resource/importers/audio/LoopFactory.h
@@ -6,6 +6,7 @@
namespace SF64 {
class ResourceFactoryBinaryAdpcmLoopV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
}; // namespace LUS
diff --git a/src/port/resource/importers/audio/SampleFactory.cpp b/src/port/resource/importers/audio/SampleFactory.cpp
index 890641a3..c83e49c8 100644
--- a/src/port/resource/importers/audio/SampleFactory.cpp
+++ b/src/port/resource/importers/audio/SampleFactory.cpp
@@ -11,8 +11,9 @@
#include "vorbis/vorbisfile.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySampleV1::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySampleV1::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
@@ -142,14 +143,14 @@ static void OggDecoderWorker(std::shared_ptr<Sample> sample, std::shared_ptr<Shi
ov_clear(&vf);
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLSampleV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLSampleV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
auto sample = std::make_shared<Sample>(file->InitData);
auto child = std::get<std::shared_ptr<tinyxml2::XMLDocument>>(file->Reader)->FirstChildElement();
- std::shared_ptr<Ship::ResourceInitData> initData = std::make_shared<Ship::ResourceInitData>();
const char* customFormatStr = child->Attribute("CustomFormat");
memset(&sample->mSample, 0, sizeof(sample->mSample));
sample->mSample.isRelocated = 0;
@@ -190,10 +191,7 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLSampleV0::ReadResource(std::s
sample->mSample.size = size;
const char* path = child->Attribute("Path");
- initData->Path = path;
- initData->IsCustom = false;
- initData->ByteOrder = Ship::Endianness::Native;
- auto sampleFile = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFile(path, initData);
+ auto sampleFile = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->LoadFile(path);
if (customFormatStr != nullptr) {
// Compressed files can take a really long time to decode (~250ms per).
// This worked when we tested it (09/04/2024) (Works on my machine)
diff --git a/src/port/resource/importers/audio/SampleFactory.h b/src/port/resource/importers/audio/SampleFactory.h
index 01fbf97e..b3e0b0c0 100644
--- a/src/port/resource/importers/audio/SampleFactory.h
+++ b/src/port/resource/importers/audio/SampleFactory.h
@@ -13,12 +13,14 @@ struct OggFileData {
class ResourceFactoryBinarySampleV1 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
class ResourceFactoryXMLSampleV0 : public Ship::ResourceFactoryXML {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
private:
static uint8_t CodecStrToInt(const char* str, const char* file);
static uint32_t MediumStrToInt(const char* str);
diff --git a/src/port/resource/importers/audio/SoundFontFactory.cpp b/src/port/resource/importers/audio/SoundFontFactory.cpp
index 1fda2854..c0730360 100644
--- a/src/port/resource/importers/audio/SoundFontFactory.cpp
+++ b/src/port/resource/importers/audio/SoundFontFactory.cpp
@@ -5,8 +5,9 @@
#include "port/resource/type/audio/SoundFont.h"
namespace SF64 {
-std::shared_ptr<Ship::IResource> ResourceFactoryBinarySoundFontV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryBinarySoundFontV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
@@ -210,8 +211,9 @@ std::vector<EnvelopePointData> ResourceFactoryXMLSoundFontV0::ParseEnvelopes(Sou
return envelopes;
}
-std::shared_ptr<Ship::IResource> ResourceFactoryXMLSoundFontV0::ReadResource(std::shared_ptr<Ship::File> file) {
- if (!FileHasValidFormatAndReader(file)) {
+std::shared_ptr<Ship::IResource> ResourceFactoryXMLSoundFontV0::ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) {
+ if (!FileHasValidFormatAndReader(file, initData)) {
return nullptr;
}
auto audioSoundFont = std::make_shared<SoundFont>(file->InitData);
diff --git a/src/port/resource/importers/audio/SoundFontFactory.h b/src/port/resource/importers/audio/SoundFontFactory.h
index b5afda9a..69796b1d 100644
--- a/src/port/resource/importers/audio/SoundFontFactory.h
+++ b/src/port/resource/importers/audio/SoundFontFactory.h
@@ -8,12 +8,14 @@
namespace SF64 {
class ResourceFactoryBinarySoundFontV0 : public Ship::ResourceFactoryBinary {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
};
class ResourceFactoryXMLSoundFontV0 : public Ship::ResourceFactoryXML {
public:
- std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
+ std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
+ std::shared_ptr<Ship::ResourceInitData> initData) override;
static int8_t MediumStrToInt(const char* str);
static int8_t CachePolicyToInt(const char* str);
diff --git a/tools/Torch b/tools/Torch
-Subproject 7598e2932c3b8e0c08cddd2ac52ab735dbeefdf
+Subproject 228a17c68282092b6c3937c46b943229388931f