Remove libwii sharp as it's not used anymore

This commit is contained in:
KillzXGaming 2019-08-04 19:57:38 -04:00
parent 0e65b17e48
commit 4eeb05e3d2
8 changed files with 25 additions and 2766 deletions

View file

@ -40,24 +40,22 @@ namespace FirstPlugin
public Dictionary<uint, FormatInfo> Formats = new Dictionary<uint, FormatInfo>() public Dictionary<uint, FormatInfo> Formats = new Dictionary<uint, FormatInfo>()
{ {
{ 0xDE, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) }, /* { 0xDE, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) },
{ 0x08, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) }, { 0x08, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) },
{ 0x46, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) }, { 0x46, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) },
{ 0x99, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) }, { 0x99, new FormatInfo(TEX_FORMAT.R8G8B8A8_UNORM) },
{ 0xCD, new FormatInfo(TEX_FORMAT.BC1_UNORM) }, // { 0xCD, new FormatInfo(TEX_FORMAT.BC1_UNORM) },
{ 0x06, new FormatInfo(TEX_FORMAT.BC1_UNORM) }, { 0x06, new FormatInfo(TEX_FORMAT.BC1_UNORM) },
{ 0x3B, new FormatInfo(TEX_FORMAT.BC1_UNORM) }, { 0x3B, new FormatInfo(TEX_FORMAT.BC1_UNORM) },
{ 0x9D, new FormatInfo(TEX_FORMAT.BC1_UNORM) }, { 0x9D, new FormatInfo(TEX_FORMAT.BC1_UNORM) },
{ 0x51, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) }, { 0x51, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x28, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) }, { 0x28, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x28, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x1B, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) }, { 0x1B, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x39, new FormatInfo(TEX_FORMAT.BC3_UNORM) }, { 0x39, new FormatInfo(TEX_FORMAT.BC3_UNORM) },
{ 0x88, new FormatInfo(TEX_FORMAT.BC3_UNORM) }, { 0x88, new FormatInfo(TEX_FORMAT.BC3_UNORM) },
{ 0x88, new FormatInfo(TEX_FORMAT.BC3_UNORM) },
{ 0xDA, new FormatInfo(TEX_FORMAT.BC3_UNORM) }, { 0xDA, new FormatInfo(TEX_FORMAT.BC3_UNORM) },
{ 0xCD, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Switch) }, { 0xCD, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Switch) },
@ -69,6 +67,20 @@ namespace FirstPlugin
{ 0x47, new FormatInfo(TEX_FORMAT.BC5_UNORM) }, { 0x47, new FormatInfo(TEX_FORMAT.BC5_UNORM) },
{ 0xB9, new FormatInfo(TEX_FORMAT.BC5_UNORM) }, { 0xB9, new FormatInfo(TEX_FORMAT.BC5_UNORM) },
{ 0x78, new FormatInfo(TEX_FORMAT.BC5_UNORM) }, { 0x78, new FormatInfo(TEX_FORMAT.BC5_UNORM) },
*/
{ 0x9D3B06CD, new FormatInfo(TEX_FORMAT.BC1_UNORM) },
{ 0xDA888839, new FormatInfo(TEX_FORMAT.BC3_UNORM) }, //PC
{ 0x78B94718, new FormatInfo(TEX_FORMAT.BC5_UNORM) }, //PC
{ 0x994608DE, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT) }, //PC
{ 0x1B282851, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x37456ECD, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0xD0124568, new FormatInfo(TEX_FORMAT.BC5_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x8EBE8CF2, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT, PlatformSwizzle.Platform_Switch) },
{ 0xF8313483, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Ps4) },
{ 0xF0B976CF, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Ps4) },
{ 0x7D081E6A, new FormatInfo(TEX_FORMAT.BC5_UNORM, PlatformSwizzle.Platform_Ps4) },
{ 0x9B54FB48, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT, PlatformSwizzle.Platform_Ps4) },
{ 0xEDF22608, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT, PlatformSwizzle.Platform_Ps4) }, //Todo BGR32
}; };
public class FormatInfo public class FormatInfo
@ -118,11 +130,13 @@ namespace FirstPlugin
uint sectioSize = reader.ReadUInt32(); uint sectioSize = reader.ReadUInt32();
uint dataOffset = reader.ReadUInt32(); //0x10. Relative to start of section uint dataOffset = reader.ReadUInt32(); //0x10. Relative to start of section
Console.WriteLine($"{signature} {count} {sectioSize} {dataOffset}");
uint textureCount = 0; uint textureCount = 0;
List<string> TextureNames = new List<string>(); List<string> TextureNames = new List<string>();
FormatInfo TextureFormat; FormatInfo TextureFormat;
reader.Seek(dataOffset); reader.Seek(pos + dataOffset);
switch (signature) switch (signature)
{ {
case "TSTR": case "TSTR":
@ -135,7 +149,7 @@ namespace FirstPlugin
case "MTSZ": case "MTSZ":
break; break;
case "EXID": //Texture Formats and maybe other formats case "EXID": //Texture Formats and maybe other formats
reader.ReadUInt32(); //padding? // reader.ReadUInt32(); //padding?
//Seems only one code is used but why? //Seems only one code is used but why?
uint FormatCode = reader.ReadUInt32(); uint FormatCode = reader.ReadUInt32();

View file

@ -303,109 +303,5 @@ namespace FirstPlugin
MemoryStream mem = new MemoryStream(); MemoryStream mem = new MemoryStream();
return mem.ToArray(); return mem.ToArray();
} }
public class TPL_Texture : STGenericTexture
{
private libWiiSharp.TPL ParentTPL;
private int TextureIndex { get; set; }
private TextureProperties properties;
public class TextureProperties
{
private libWiiSharp.TPL ParentTPL;
private int TextureIndex { get; set; }
public libWiiSharp.TPL_TextureFormat TextureFormat
{
get { return ParentTPL.GetTextureFormat(TextureIndex); }
}
public libWiiSharp.TPL_PaletteFormat PaletteFormat
{
get { return ParentTPL.GetPaletteFormat(TextureIndex); }
}
public int Width
{
get { return ParentTPL.GetImageWidth(TextureIndex); }
}
public int Height
{
get { return ParentTPL.GetImageHeight(TextureIndex); }
}
public TextureProperties(libWiiSharp.TPL tpl, int index)
{
ParentTPL = tpl;
TextureIndex = index;
}
}
public TPL_Texture(libWiiSharp.TPL tpl, int index)
{
ParentTPL = tpl;
TextureIndex = index;
Width = tpl.GetImageWidth(index);
Height = tpl.GetImageHeight(index);
MipCount = 1;
Text = $"Image {index}";
Format = TEX_FORMAT.R8G8B8A8_UNORM;
SelectedImageKey = "texture";
ImageKey = "texture";
properties = new TextureProperties(tpl, index);
}
public override bool CanEdit { get; set; } = false;
public override TEX_FORMAT[] SupportedFormats
{
get
{
return new TEX_FORMAT[]
{
TEX_FORMAT.R8G8B8A8_UNORM,
};
}
}
public override void SetImageData(System.Drawing.Bitmap bitmap, int ArrayLevel)
{
}
public override byte[] GetImageData(int ArrayLevel = 0, int MipLevel = 0)
{
return ImageUtilty.ConvertBgraToRgba(ParentTPL.ExtractTextureByteArray(TextureIndex));
}
public override void OnClick(TreeView treeView)
{
UpdateEditor();
}
public void UpdateEditor()
{
ImageEditorBase editor = (ImageEditorBase)LibraryGUI.GetActiveContent(typeof(ImageEditorBase));
if (editor == null)
{
editor = new ImageEditorBase();
editor.Dock = DockStyle.Fill;
LibraryGUI.LoadEditor(editor);
}
editor.Text = Text;
editor.LoadProperties(properties);
editor.LoadImage(this);
}
}
} }
} }

View file

@ -310,7 +310,6 @@
<Compile Include="GUI\BMD\BMDModelImportSettings.Designer.cs"> <Compile Include="GUI\BMD\BMDModelImportSettings.Designer.cs">
<DependentUpon>BMDModelImportSettings.cs</DependentUpon> <DependentUpon>BMDModelImportSettings.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="libWiiSharp\TPL.cs" />
<Compile Include="FileFormats\GFBMDL\GFBMDL.cs" /> <Compile Include="FileFormats\GFBMDL\GFBMDL.cs" />
<Compile Include="FileFormats\GFBMDL\GFBMDL_Wrappers.cs" /> <Compile Include="FileFormats\GFBMDL\GFBMDL_Wrappers.cs" />
<Compile Include="FileFormats\GMX\GMX.cs" /> <Compile Include="FileFormats\GMX\GMX.cs" />

View file

@ -361,7 +361,7 @@ namespace FirstPlugin
Formats.Add(typeof(G1T)); Formats.Add(typeof(G1T));
Formats.Add(typeof(BFLYT)); Formats.Add(typeof(BFLYT));
Formats.Add(typeof(ZSI)); Formats.Add(typeof(ZSI));
// Formats.Add(typeof(IGZ)); Formats.Add(typeof(IGZ));
//Unfinished wip formats not ready for use //Unfinished wip formats not ready for use
if (Runtime.DEVELOPER_DEBUG_MODE) if (Runtime.DEVELOPER_DEBUG_MODE)

File diff suppressed because it is too large Load diff

View file

@ -38,6 +38,10 @@ namespace Toolbox.Library
Platform_Gamecube = 3, Platform_Gamecube = 3,
Platform_WiiU = 4, Platform_WiiU = 4,
Platform_Switch = 5, Platform_Switch = 5,
Platform_Ps4 = 6,
Platform_Ps3 = 7,
Platform_Ps2 = 8,
Platform_Ps1 = 9,
} }
public class EditedBitmap public class EditedBitmap