Added IsActive flag and scene lua files

This commit is contained in:
2025-04-17 15:36:34 +02:00
parent 9af5d7dd1a
commit ac0e4d8420
3 changed files with 23 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ namespace SplashEdit.RuntimeCode
{
public LuaFile LuaFile => luaFile;
public bool IsActive = true;
public List<PSXTexture2D> Textures { get; set; } = new List<PSXTexture2D>(); // Stores the converted PlayStation-style texture
public PSXMesh Mesh { get; protected set; } // Stores the converted PlayStation-style mesh
[Header("Export Settings")]

View File

@@ -15,6 +15,7 @@ namespace SplashEdit.RuntimeCode
{
public float GTEScaling = 100.0f;
public LuaFile SceneLuaFile;
private PSXObjectExporter[] _exporters;
private TextureAtlas[] _atlases;
@@ -132,6 +133,13 @@ namespace SplashEdit.RuntimeCode
}
}
}
if (SceneLuaFile != null)
{
if (!luaFiles.Contains(SceneLuaFile))
{
luaFiles.Add(SceneLuaFile);
}
}
using (BinaryWriter writer = new BinaryWriter(File.Open(path, FileMode.Create)))
{
@@ -154,7 +162,15 @@ namespace SplashEdit.RuntimeCode
writer.Write((ushort)PSXTrig.ConvertCoordinateToPSX(_playerHeight, GTEScaling)); // 26
writer.Write((ushort)0);
if (SceneLuaFile != null)
{
int index = luaFiles.IndexOf(SceneLuaFile);
writer.Write((short)index);
}
else
{
writer.Write((short)-1);
}
writer.Write((ushort)0);
// Lua file section
@@ -199,6 +215,10 @@ namespace SplashEdit.RuntimeCode
{
writer.Write((short)-1);
}
// Write 4-byte bitfield with LSB as exporter.isActive
int bitfield = exporter.IsActive ? 0b1 : 0b0;
writer.Write(bitfield);
}
// Navmesh metadata section

Binary file not shown.