Added IsActive flag and scene lua files
This commit is contained in:
@@ -10,6 +10,8 @@ namespace SplashEdit.RuntimeCode
|
|||||||
{
|
{
|
||||||
public LuaFile LuaFile => luaFile;
|
public LuaFile LuaFile => luaFile;
|
||||||
|
|
||||||
|
public bool IsActive = true;
|
||||||
|
|
||||||
public List<PSXTexture2D> Textures { get; set; } = new List<PSXTexture2D>(); // Stores the converted PlayStation-style texture
|
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
|
public PSXMesh Mesh { get; protected set; } // Stores the converted PlayStation-style mesh
|
||||||
[Header("Export Settings")]
|
[Header("Export Settings")]
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace SplashEdit.RuntimeCode
|
|||||||
{
|
{
|
||||||
|
|
||||||
public float GTEScaling = 100.0f;
|
public float GTEScaling = 100.0f;
|
||||||
|
public LuaFile SceneLuaFile;
|
||||||
|
|
||||||
private PSXObjectExporter[] _exporters;
|
private PSXObjectExporter[] _exporters;
|
||||||
private TextureAtlas[] _atlases;
|
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)))
|
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)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);
|
writer.Write((ushort)0);
|
||||||
|
|
||||||
// Lua file section
|
// Lua file section
|
||||||
@@ -199,6 +215,10 @@ namespace SplashEdit.RuntimeCode
|
|||||||
{
|
{
|
||||||
writer.Write((short)-1);
|
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
|
// Navmesh metadata section
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user