BFLYT : Fixes to mat1 when creating new

This commit is contained in:
KillzXGaming 2022-02-28 19:04:59 -05:00
parent e0aab4c0f9
commit 6ce7e5c8ba

View file

@ -104,7 +104,7 @@ namespace LayoutBXLYT.Cafe
}
private uint flags;
private int unknown;
private int unknown = 134480384;
public string GetTexture(int index)
{
@ -268,6 +268,7 @@ namespace LayoutBXLYT.Cafe
writer.Write(flags);
}
//TODO. I don't know why but many cases there needs to be 2 tex coords to match up
if (TextureMaps?.Length > 0 && TexCoordGens?.Length == 0)
{
TexCoordGens = new BxlytTexCoordGen[TextureMaps.Length];
@ -282,6 +283,15 @@ namespace LayoutBXLYT.Cafe
((TextureRef)TextureMaps[i]).Write(writer);
}
if (TextureTransforms.Length == 1)
{
TextureTransforms = new BxlytTextureTransform[2]
{
TextureTransforms[0],
new BxlytTextureTransform(),
};
}
for (int i = 0; i < TextureTransforms.Length; i++)
{
flags += Bit.BitInsert(1, 1, 2, 28);