1
0
mirror of synced 2025-02-21 04:58:41 +01:00

PTCL : fix some material assignments for primitives.

This commit is contained in:
KillzXGaming 2020-09-04 16:29:23 -04:00
parent 33801bc48c
commit 968ac33d09
2 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,9 @@ namespace FirstPlugin
}
}
//Determines if the binary is in a PTCL binary file.
public bool IsParticlePrimitive = false;
public bool DisplayIcons => false;
public List<STGenericTexture> TextureList
@ -914,7 +917,7 @@ namespace FirstPlugin
public void Save(System.IO.Stream stream)
{
var Models = GetModels();
if (Models != null)
if (Models != null && !IsParticlePrimitive)
{
foreach (FMDL mdl in Models)
{

View File

@ -611,6 +611,7 @@ namespace FirstPlugin
reader.Seek(section.BinaryDataOffset + section.Position, SeekOrigin.Begin);
BinaryData = new BFRES();
((BFRES)BinaryData).IsParticlePrimitive = true;
((BFRES)BinaryData).FileName = "model.bfres";
((BFRES)BinaryData).Load(new MemoryStream(reader.ReadBytes((int)section.SectionSize)));
((BFRES)BinaryData).IFileInfo = new IFileInfo();
@ -654,7 +655,7 @@ namespace FirstPlugin
case "G3PR":
{
var mem = new System.IO.MemoryStream();
if (BinaryData != null)
if (BinaryData != null && ((BFRES)BinaryData).CanSave)
{
((BFRES)BinaryData).Save(mem);
SaveHeader(writer, header, mem.ToArray(), 4096);