mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-16 22:08:26 +00:00
BXLYT : Auto generate tex gens if none created.
This commit is contained in:
parent
e39e6f7d03
commit
b7a7f871dc
5 changed files with 35 additions and 0 deletions
|
@ -261,6 +261,13 @@ namespace LayoutBXLYT.Cafe
|
|||
writer.Write(flags);
|
||||
}
|
||||
|
||||
if (TextureMaps?.Length > 0 && TexCoordGens?.Length == 0)
|
||||
{
|
||||
TexCoordGens = new BxlytTexCoordGen[TextureMaps.Length];
|
||||
for (int i = 0; i < TextureMaps?.Length; i++)
|
||||
TexCoordGens[i] = new TexCoordGen();
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
for (int i = 0; i < TextureMaps.Length; i++)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,13 @@ namespace LayoutBXLYT.Cafe
|
|||
{
|
||||
byte[] unkData;
|
||||
|
||||
public TexCoordGen()
|
||||
{
|
||||
Matrix = TexGenMatrixType.Matrix2x4;
|
||||
Source = TexGenType.TextureCoord0;
|
||||
unkData = new byte[6];
|
||||
}
|
||||
|
||||
public TexCoordGen(FileReader reader, BxlytHeader header)
|
||||
{
|
||||
Matrix = reader.ReadEnum<TexGenMatrixType>(false);
|
||||
|
|
|
@ -212,6 +212,13 @@ namespace LayoutBXLYT.CTR
|
|||
long flagPos = writer.Position;
|
||||
writer.Write(flags);
|
||||
|
||||
if (TextureMaps?.Length > 0 && TexCoordGens?.Length == 0)
|
||||
{
|
||||
TexCoordGens = new BxlytTexCoordGen[TextureMaps.Length];
|
||||
for (int i = 0; i < TextureMaps?.Length; i++)
|
||||
TexCoordGens[i] = new TexCoordGen();
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
for (int i = 0; i < TextureMaps?.Length; i++)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,13 @@ namespace LayoutBXLYT.CTR
|
|||
{
|
||||
ushort Unknown { get; set; }
|
||||
|
||||
public TexCoordGen()
|
||||
{
|
||||
Matrix = TexGenMatrixType.Matrix2x4;
|
||||
Source = TexGenType.TextureCoord0;
|
||||
Unknown = 0;
|
||||
}
|
||||
|
||||
public TexCoordGen(FileReader reader, BxlytHeader header)
|
||||
{
|
||||
Matrix = (TexGenMatrixType)reader.ReadByte();
|
||||
|
|
|
@ -247,6 +247,13 @@ namespace LayoutBXLYT.Revolution
|
|||
if (!((AlphaCompare)AlphaCompare).HasDefaults())
|
||||
HasAlphaCompare = true;
|
||||
|
||||
if (TextureMaps?.Length > 0 && TexCoordGens?.Count == 0)
|
||||
{
|
||||
TexCoordGens = new List<TexCoordGenEntry>(TextureMaps.Length);
|
||||
for (int i = 0; i < TextureMaps?.Length; i++)
|
||||
TexCoordGens[i] = new TexCoordGenEntry();
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
if (HasMaterialColor)
|
||||
flags |= (1 << 27);
|
||||
|
|
Loading…
Add table
Reference in a new issue