1
0
mirror of synced 2025-02-20 20:51:35 +01:00

BMD : Add little endian support.

This commit is contained in:
KillzXGaming 2020-09-20 10:36:51 -04:00
parent 303aa55215
commit 3126bef310
3 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,8 @@ namespace FirstPlugin
using (var reader = new Toolbox.Library.IO.FileReader(stream, true))
{
reader.SetByteOrder(true);
bool IsBMD = reader.ReadUInt32() == 0x4A334432;
uint magic = reader.ReadUInt32();
bool IsBMD = magic == 0x4A334432 || magic == 0x3244334A;
reader.Position = 0;
return IsBMD;
@ -381,8 +382,8 @@ namespace FirstPlugin
arguments.texheaders_path = settings.TexturePath;
arguments.materials_path = settings.MaterialPath;
var model = Model.Load(arguments);
LoadBMD(model);
//var model = Model.Load(arguments);
//LoadBMD(model);
}
}
}
@ -406,7 +407,7 @@ namespace FirstPlugin
public void Save(System.IO.Stream stream)
{
BMDFile.ExportBMD(stream);
BMDFile.Save(stream, FileName.EndsWith(".bdl"));
}
}
}

View File

@ -40,7 +40,7 @@ namespace FirstPlugin
Width = TextureImage.Width;
Height = TextureImage.Height;
MipCount = TextureImage.MipMapCount;
MipCount = TextureImage.MipMap;
ImageKey = "texture";
SelectedImageKey = ImageKey;

Binary file not shown.