Exporting is working and rendering correctly in pcsx-redux

This commit is contained in:
2025-03-14 00:15:35 +01:00
parent 1e480f6c15
commit 8a6679dff6
10 changed files with 241 additions and 55 deletions

View File

@@ -5,6 +5,7 @@ namespace PSXSplash.RuntimeCode
public class PSXObjectExporter : MonoBehaviour
{
public PSXBPP BitDepth;
public bool MeshIsStatic = true;
[HideInInspector]
public PSXTexture2D Texture;
@@ -27,7 +28,12 @@ namespace PSXSplash.RuntimeCode
MeshFilter meshFilter = gameObject.GetComponent<MeshFilter>();
if (meshFilter != null)
{
Mesh = PSXMesh.CreateFromUnityMesh(meshFilter.mesh, Texture.Width, Texture.Height);
if(MeshIsStatic) {
Mesh = PSXMesh.CreateFromUnityMesh(meshFilter.sharedMesh, Texture.Width, Texture.Height, transform);
}
else {
Mesh = PSXMesh.CreateFromUnityMesh(meshFilter.sharedMesh, Texture.Width, Texture.Height);
}
}
}
}