Combine texture methods and functions into one main class.

This commit is contained in:
KillzXGaming 2018-12-12 21:28:57 -05:00
parent e82d065255
commit 2c8f5d2c6c
87 changed files with 1447 additions and 15721 deletions

View file

@ -173,6 +173,9 @@ namespace FirstPlugin
public override void OnClick(TreeView treeView)
{
if (Viewport.Instance.gL_ControlModern1 == null)
return;
//If has models
if (Nodes.ContainsKey("FMDL"))
{

View file

@ -1,313 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Syroot.NintenTools.NSW.Bfres;
using Syroot.NintenTools.NSW.Bfres.Helpers;
using OpenTK;
using System.Windows.Forms;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.Rendering;
using WeifenLuo.WinFormsUI.Docking;
using Switch_Toolbox.Library.IO;
using Switch_Toolbox.Library.Forms;
using ResU = Syroot.NintenTools.Bfres;
using ResUGX2 = Syroot.NintenTools.Bfres.GX2;
using ResGFX = Syroot.NintenTools.NSW.Bfres.GFX;
using FirstPlugin;
namespace Bfres.Structs
{
public class Misc
{
public static List<string> HackyTextureList = new List<string>(new string[] {
"Alb", "alb", "Base", "base", "bonbon.167300917","Eye.00","EyeIce.00", "FaceDummy", "Eye01.17", "Dee.00",
"rainbow.758540574", "Mucus._1700670200", "Eye.11", "CapTail00","eye.0","pallet_texture","Mark.930799313","InEye.1767598300","Face.00",
"ThunderHair_Thunder_BaseColor.1751853236","FireHair_Thunder_BaseColor._162539711","IceHair_Thunder_BaseColor.674061150","BodyEnemy.1866226988",
"Common_Scroll01._13827715"
});
}
public class ResourceFile : TreeNodeFile
{
public BFRESRender BFRESRender;
public TreeNode TextureFolder = new TreeNode("Textures");
public ResourceFile(IFileFormat handler)
{
ImageKey = "bfres";
SelectedImageKey = "bfres";
FileHandler = handler;
ContextMenu = new ContextMenu();
MenuItem save = new MenuItem("Save");
ContextMenu.MenuItems.Add(save);
save.Click += Save;
MenuItem newMenu = new MenuItem("New");
MenuItem import = new MenuItem("Import");
// ContextMenu.MenuItems.Add(newMenu);
// ContextMenu.MenuItems.Add(import);
MenuItem rename = new MenuItem("Rename");
ContextMenu.MenuItems.Add(rename);
rename.Click += Rename;
MenuItem remove = new MenuItem("Remove");
ContextMenu.MenuItems.Add(remove);
remove.Click += Remove;
if (Parent == null)
remove.Enabled = false;
if (BFRES.IsWiiU)
{
}
else
{
MenuItem model = new MenuItem("Model");
MenuItem fska = new MenuItem("Skeletal Animation");
MenuItem fmaa = new MenuItem("Material Animation");
MenuItem bonevis = new MenuItem("Bone Visual Animation");
MenuItem shape = new MenuItem("Shape Animation");
MenuItem scene = new MenuItem("Scene Animation");
MenuItem embedded = new MenuItem("Embedded File");
MenuItem texture = new MenuItem("Texture File");
texture.Click += NewTextureFile;
newMenu.MenuItems.Add(model);
newMenu .MenuItems.Add(fska);
newMenu.MenuItems.Add(fmaa);
newMenu.MenuItems.Add(bonevis);
newMenu.MenuItems.Add(shape);
newMenu.MenuItems.Add(scene);
newMenu.MenuItems.Add(embedded);
newMenu.MenuItems.Add(texture);
MenuItem importmodel = new MenuItem("Model");
MenuItem importfska = new MenuItem("Skeletal Animation");
MenuItem importfmaa = new MenuItem("Material Animation");
MenuItem importbonevis = new MenuItem("Bone Visual Animation");
MenuItem importshape = new MenuItem("Shape Animation");
MenuItem importscene = new MenuItem("Scene Animation");
MenuItem importembedded = new MenuItem("Embedded File");
MenuItem importtexture = new MenuItem("Texture File");
import.MenuItems.Add(importmodel);
import.MenuItems.Add(importfska);
import.MenuItems.Add(importfmaa);
import.MenuItems.Add(importbonevis);
import.MenuItems.Add(importshape);
import.MenuItems.Add(importscene);
import.MenuItems.Add(importembedded);
import.MenuItems.Add(importtexture);
}
}
public override void OnClick(TreeView treeView)
{
//If has models
if (Nodes.ContainsKey("FMDLFolder"))
{
if (Nodes["FMDLFolder"].Nodes.ContainsKey("FshpFolder"))
{
}
LibraryGUI.Instance.LoadViewport(Viewport.Instance);
Viewport.Instance.gL_ControlModern1.MainDrawable = BFRESRender;
BFRESRender.UpdateVertexData();
}
}
public void Load(ResU.ResFile resFile)
{
Text = resFile.Name;
if (resFile.Models.Count > 0)
Nodes.Add(new FmdlFolder());
if (resFile.Textures.Count > 0)
AddFTEXTextures(resFile);
if (resFile.SkeletalAnims.Count > 0)
AddSkeletonAnims(resFile);
if (resFile.ShaderParamAnims.Count > 0)
Nodes.Add(new FshaFolder());
if (resFile.ColorAnims.Count > 0)
Nodes.Add(new FshaColorFolder());
if (resFile.TexSrtAnims.Count > 0)
Nodes.Add(new TexSrtFolder());
if (resFile.TexPatternAnims.Count > 0)
Nodes.Add(new TexPatFolder());
if (resFile.ShapeAnims.Count > 0)
Nodes.Add(new FshpaFolder());
if (resFile.BoneVisibilityAnims.Count > 0)
Nodes.Add(new FbnvFolder());
if (resFile.SceneAnims.Count > 0)
Nodes.Add(new FscnFolder());
if (resFile.ExternalFiles.Count > 0)
Nodes.Add(new EmbeddedFilesFolder());
foreach (var anim in resFile.ShaderParamAnims)
Nodes["FSHA"].Nodes.Add(anim.Key);
foreach (var anim in resFile.ColorAnims)
Nodes["FSHAColor"].Nodes.Add(anim.Key);
foreach (var anim in resFile.TexSrtAnims)
Nodes["TEXSRT"].Nodes.Add(anim.Key);
foreach (var anim in resFile.TexPatternAnims)
Nodes["TEXPAT"].Nodes.Add(anim.Key);
int ext = 0;
foreach (var extfile in resFile.ExternalFiles)
{
string Name = extfile.Key;
FileReader f = new FileReader(extfile.Value.Data);
string Magic = f.ReadMagic(0, 4);
if (Magic == "FSHA")
{
Nodes["EXT"].Nodes.Add(new BfshaFileData(extfile.Value.Data, Name));
}
else
Nodes["EXT"].Nodes.Add(new ExternalFileData(extfile.Value.Data, Name));
f.Dispose();
f.Close();
ext++;
}
}
public void Load(ResFile resFile)
{
Text = resFile.Name;
UpdateTree(resFile);
foreach (MaterialAnim anim in resFile.MaterialAnims)
Nodes["FMAA"].Nodes.Add(anim.Name);
foreach (ShapeAnim anim in resFile.ShapeAnims)
Nodes["FSHPA"].Nodes.Add(anim.Name);
foreach (VisibilityAnim anim in resFile.BoneVisibilityAnims)
Nodes["FBNV"].Nodes.Add(anim.Name);
foreach (SceneAnim anim in resFile.SceneAnims)
Nodes["FSCN"].Nodes.Add(anim.Name);
int ext = 0;
foreach (ExternalFile extfile in resFile.ExternalFiles)
{
string Name = resFile.ExternalFileDict.GetKey(ext);
FileReader f = new FileReader(extfile.Data);
string Magic = f.ReadMagic(0, 4);
if (Magic == "BNTX")
{
BNTX bntx = new BNTX();
bntx.Data = extfile.Data;
bntx.FileName = Name;
bntx.Load();
bntx.IFileInfo.InArchive = true;
Nodes["EXT"].Nodes.Add(bntx.EditorRoot);
}
else if (Magic == "FSHA")
{
Nodes["EXT"].Nodes.Add(new BfshaFileData(extfile.Data, Name));
}
else
Nodes["EXT"].Nodes.Add(new ExternalFileData(extfile.Data, Name));
f.Dispose();
f.Close();
ext++;
}
}
private void NewTextureFile(object sender, EventArgs args)
{
string Name = "textures";
for (int i = 0; i < BFRESRender.resFile.ExternalFiles.Count; i++)
{
if (BFRESRender.resFile.ExternalFileDict.GetKey(i) == Name)
Name = Name + i;
}
if (!Nodes.ContainsKey("EXT"))
{
Nodes.Add(new EmbeddedFilesFolder());
}
BNTX bntx = new BNTX();
bntx.Data = new byte[0];
BinaryTextureContainer bntxTreeNode = new BinaryTextureContainer(new byte[0], "textures", BFRESRender.resFile.Name);
Nodes["EXT"].Nodes.Add(bntxTreeNode);
}
private void NewEmbeddedFile(object sender, EventArgs args)
{
}
private void Save(object sender, EventArgs args)
{
((BFRES)FileHandler).SaveFile();
}
private void Rename(object sender, EventArgs args)
{
RenameDialog dialog = new RenameDialog();
dialog.SetString(Text);
if (dialog.ShowDialog() == DialogResult.OK)
{
Text = dialog.textBox1.Text;
}
}
private void Remove(object sender, EventArgs args)
{
BFRESRender.DisposeFile();
}
private void UpdateTree(ResFile resFile)
{
if (resFile.Models.Count > 0)
Nodes.Add(new FmdlFolder());
if (resFile.SkeletalAnims.Count > 0)
AddSkeletonAnims(resFile);
if (resFile.MaterialAnims.Count > 0)
Nodes.Add(new FmmaFolder());
if (resFile.ShapeAnims.Count > 0)
Nodes.Add(new FshpaFolder());
if (resFile.BoneVisibilityAnims.Count > 0)
Nodes.Add(new FbnvFolder());
if (resFile.SceneAnims.Count > 0)
Nodes.Add(new FscnFolder());
if (resFile.ExternalFiles.Count > 0)
Nodes.Add(new EmbeddedFilesFolder());
}
private void AddFTEXTextures(ResU.ResFile resFile)
{
FTEXContainer ftexContainer = new FTEXContainer();
foreach (ResU.Texture tex in resFile.Textures.Values)
{
string TextureName = tex.Name;
FTEX texture = new FTEX();
texture.Read(tex);
ftexContainer.Nodes.Add(texture);
ftexContainer.Textures.Add(texture.Text, texture);
}
PluginRuntime.ftexContainers.Add(ftexContainer);
Nodes.Add(ftexContainer);
}
private void AddSkeletonAnims(ResU.ResFile resFile)
{
FskaFolder FSKA = new FskaFolder();
FSKA.LoadAnimations(resFile, BFRESRender);
Nodes.Add(FSKA);
}
private void AddSkeletonAnims(ResFile resFile)
{
FskaFolder FSKA = new FskaFolder();
FSKA.LoadAnimations(resFile, BFRESRender);
Nodes.Add(FSKA);
}
}
public class FshpaFolder : TreeNodeCustom
{
public FshpaFolder()
{
Text = "Shape Animations";
Name = "FSHPA";
}
public override void OnClick(TreeView treeView)
{
FormLoader.LoadEditor(this, Text);
}
}
}

View file

@ -342,7 +342,7 @@ namespace Bfres.Structs
System.IO.File.WriteAllBytes(sfd.FileName, csv.Save());
break;
default:
List<STGenericTexture> surfaces = new List<STGenericTexture>();
List<STGenericTexture> Surfaces = new List<STGenericTexture>();
foreach (FSHP fshp in shapes)
{
foreach (var bntx in PluginRuntime.bntxContainers)
@ -351,7 +351,7 @@ namespace Bfres.Structs
{
if (bntx.Textures.ContainsKey(tex.Name))
{
surfaces.Add(bntx.Textures[tex.Name]);
Surfaces.Add(bntx.Textures[tex.Name]);
}
}
}
@ -361,15 +361,15 @@ namespace Bfres.Structs
{
if (ftex.Textures.ContainsKey(tex.Name))
{
surfaces.Add(ftex.Textures[tex.Name]);
Surfaces.Add(ftex.Textures[tex.Name]);
}
}
}
}
Console.WriteLine("tex count " + surfaces.Count);
Console.WriteLine("tex count " + Surfaces.Count);
AssimpData assimp = new AssimpData();
assimp.SaveFromModel(this, sfd.FileName, surfaces);
assimp.SaveFromModel(this, sfd.FileName, Surfaces);
break;
}
}

View file

@ -236,7 +236,6 @@ namespace Bfres.Structs
FrameCount = ska.FrameCount;
SkeletalAnim = ska;
foreach (BoneAnim bn in ska.BoneAnims)
{
FSKANode bonean = new FSKANode(bn);

View file

@ -1,43 +0,0 @@
using Switch_Toolbox.Library;
using System.Windows.Forms;
using FirstPlugin;
namespace Bfres.Structs
{
public class TexSrtFolder : TreeNodeCustom
{
public TexSrtFolder()
{
Text = "Texture SRT Animations";
Name = "TEXSRT";
}
public override void OnClick(TreeView treeView)
{
FormLoader.LoadEditor(this, Text);
}
}
public class FshaFolder : TreeNodeCustom
{
public FshaFolder()
{
Text = "Shader Parameter Animations";
Name = "FSHA";
}
public override void OnClick(TreeView treeView)
{
FormLoader.LoadEditor(this, Text);
}
}
public class FshaColorFolder : TreeNodeCustom
{
public FshaColorFolder()
{
Text = "Color Animations";
Name = "FSHAColor";
}
public override void OnClick(TreeView treeView)
{
FormLoader.LoadEditor(this, Text);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -243,7 +243,7 @@ namespace FirstPlugin
{
get
{
if (Textures.Any(item => item.Value.GLInitialized == false))
if (Textures.Any(item => item.Value.RenderableTex.GLInitialized == false))
return false;
else
return true;
@ -291,8 +291,7 @@ namespace FirstPlugin
{
foreach (TextureData tex in Textures.Values)
{
tex.surfaces.Clear();
tex.renderedGLTex = null;
tex.Surfaces.Clear();
}
Textures.Clear();
@ -362,6 +361,7 @@ namespace FirstPlugin
}
BinaryTexFile.Textures.Clear(); //We don't need these in memeory anymore
BinaryTexFile.TextureDict.Clear();
}
private void ImportTexture(object sender, EventArgs args)
{
@ -392,64 +392,6 @@ namespace FirstPlugin
{
TextureImporterSettings setting = new TextureImporterSettings();
string ext = Path.GetExtension(name);
ext = ext.ToLower();
if (ext == ".dds" || ext == ".bftex")
{
AddTexture(name);
}
else if (ext == ".tga")
{
setting.LoadTGA(name, BinaryTexFile);
importer.LoadSetting(setting, this);
UseDialog = true;
}
else
{
setting.LoadBitMap(name, BinaryTexFile);
importer.LoadSetting(setting, this);
UseDialog = true;
}
}
if (UseDialog && importer.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
foreach (var setting in importer.settings)
{
if (setting.GenerateMipmaps)
{
setting.DataBlockOutput.Clear();
setting.DataBlockOutput.Add(setting.GenerateMips());
}
if (setting.DataBlockOutput != null)
{
Texture tex = setting.FromBitMap(setting.DataBlockOutput[0], setting);
if (setting.textureData != null)
{
setting.textureData.LoadTexture(tex, 1);
}
else
{
setting.textureData = new TextureData(tex, setting.bntx);
}
int i = 0;
if (Textures.ContainsKey(setting.textureData.Text))
{
setting.textureData.Text = setting.textureData.Text + i++;
}
Nodes.Add(setting.textureData);
Textures.Add(setting.textureData.Text, setting.textureData);
setting.textureData.LoadOpenGLTexture();
}
else
{
MessageBox.Show("Something went wrong???");
}
}
}
GC.Collect();
Cursor.Current = Cursors.Default;
@ -581,7 +523,6 @@ namespace FirstPlugin
Nodes.Add(texData);
Textures.Add(texData.Text, texData);
texData.LoadOpenGLTexture();
}
return texData;
}
@ -734,7 +675,6 @@ namespace FirstPlugin
{
public Texture Texture;
public BntxFile bntxFile;
public BRTI_Texture renderedGLTex = new BRTI_Texture();
public bool GLInitialized = false;
public TextureData()
@ -751,26 +691,56 @@ namespace FirstPlugin
bntxFile = bntx;
Text = tex.Name;
Width = tex.Width;
Height = tex.Height;
MipmapCount = tex.MipCount;
var formats = ConvertFormat(tex.Format, tex.FormatType);
Format = formats.Item1;
FormatType = formats.Item2;
ContextMenu = new ContextMenu();
MenuItem export = new MenuItem("Export");
ContextMenu.MenuItems.Add(export);
export.Click += Export;
MenuItem replace = new MenuItem("Replace");
ContextMenu.MenuItems.Add(replace);
replace.Click += Replace;
MenuItem remove = new MenuItem("Remove");
ContextMenu.MenuItems.Add(remove);
remove.Click += Remove;
MenuItem rename = new MenuItem("Rename");
ContextMenu.MenuItems.Add(rename);
rename.Click += Rename;
ContextMenu.MenuItems.Add(export);
ContextMenu.MenuItems.Add(replace);
ContextMenu.MenuItems.Add(remove);
ContextMenu.MenuItems.Add(rename);
export.Click += Export;
replace.Click += Replace;
remove.Click += Remove;
rename.Click += Rename;
string TargetString = new string(bntx.Target);
int target = 0;
if (TargetString == "NX ")
target = 1;
LoadTexture(Texture);
}
public static Tuple<SurfaceFormat, SurfaceFormatType> GetSurfaceFormat(TEX_FORMAT format, TEX_FORMAT_TYPE type)
{
var surfaceFormat = SurfaceFormat.Invalid;
var surfaceType = SurfaceFormatType.UNORM;
Enum.TryParse(format.ToString(), out surfaceFormat);
Enum.TryParse(type.ToString(), out surfaceType);
return Tuple.Create(surfaceFormat, surfaceType);
}
public static Tuple<TEX_FORMAT, TEX_FORMAT_TYPE> ConvertFormat(SurfaceFormat surfaceFormat, SurfaceFormatType surfaceType)
{
var format = TEX_FORMAT.UNKNOWN;
var type = TEX_FORMAT_TYPE.UNORM;
Enum.TryParse(surfaceFormat.ToString(), out format);
Enum.TryParse(surfaceType.ToString(), out type);
return Tuple.Create(format, type);
}
public override void OnClick(TreeView treeView)
{
@ -778,7 +748,7 @@ namespace FirstPlugin
}
public void UpdateBNTXEditor()
{
if (Viewport.Instance.gL_ControlModern1.Visible == false)
if (Viewport.Instance.gL_ControlModern1 == null || Viewport.Instance.gL_ControlModern1.Visible == false)
PluginRuntime.FSHPDockState = WeifenLuo.WinFormsUI.Docking.DockState.Document;
BNTXEditor docked = (BNTXEditor)LibraryGUI.Instance.GetContentDocked(new BNTXEditor());
@ -791,321 +761,6 @@ namespace FirstPlugin
docked.Dock = DockStyle.Fill;
docked.LoadProperty(this);
}
public BRTI_Texture LoadOpenGLTexture()
{
if (OpenTKSharedResources.SetupStatus == OpenTKSharedResources.SharedResourceStatus.Unitialized)
return null;
LoadTexture(Texture);
if (surfaces.Count <= 0)
{
throw new Exception("No texture data found");
}
renderedGLTex.data = surfaces[0].mipmaps[0];
renderedGLTex.width = (int)Texture.Width;
renderedGLTex.height = (int)Texture.Height;
switch (Texture.Format)
{
case SurfaceFormat.BC1_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
break;
case SurfaceFormat.BC1_SRGB:
renderedGLTex.type = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
break;
case SurfaceFormat.BC2_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
break;
case SurfaceFormat.BC2_SRGB:
renderedGLTex.type = PixelInternalFormat.CompressedSrgbAlphaS3tcDxt3Ext;
break;
case SurfaceFormat.BC3_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
break;
case SurfaceFormat.BC3_SRGB:
renderedGLTex.type = PixelInternalFormat.CompressedSrgbAlphaS3tcDxt5Ext;
break;
case SurfaceFormat.BC4_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRedRgtc1;
break;
case SurfaceFormat.BC4_SNORM:
renderedGLTex.type = PixelInternalFormat.CompressedSignedRedRgtc1;
break;
case SurfaceFormat.BC5_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRgRgtc2;
break;
case SurfaceFormat.BC5_SNORM:
renderedGLTex.data = DDSCompressor.DecompressBC5(surfaces[0].mipmaps[0], (int)Texture.Width, (int)Texture.Height, true, true);
renderedGLTex.type = PixelInternalFormat.Rgba;
renderedGLTex.utype = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
case SurfaceFormat.BC6_FLOAT:
renderedGLTex.type = PixelInternalFormat.CompressedRgbBptcSignedFloat;
break;
case SurfaceFormat.BC6_UFLOAT:
renderedGLTex.type = PixelInternalFormat.CompressedRgbBptcUnsignedFloat;
break;
case SurfaceFormat.BC7_SRGB:
renderedGLTex.type = PixelInternalFormat.CompressedSrgbAlphaBptcUnorm;
break;
case SurfaceFormat.BC7_UNORM:
renderedGLTex.type = PixelInternalFormat.CompressedRgbaBptcUnorm;
break;
case SurfaceFormat.R8_G8_B8_A8_SRGB:
renderedGLTex.type = PixelInternalFormat.Rgba;
renderedGLTex.utype = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
}
renderedGLTex.display = loadImage(renderedGLTex);
GLInitialized = true;
return renderedGLTex;
}
//Gets the decompressed byte[]
public static Bitmap DecodeBlock(byte[] data, uint Width, uint Height, SurfaceFormat Format)
{
Bitmap decomp;
if (Format == SurfaceFormat.BC5_SNORM)
return DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true);
byte[] d = null;
try
{
if (IsCompressedFormat(Format))
d = DDSCompressor.DecompressBlock(data, (int)Width, (int)Height, GetCompressedDXGI_FORMAT(Format));
else if (IsAtscFormat(Format))
d = null;
else
d = DDSCompressor.DecodePixelBlock(data, (int)Width, (int)Height, GetUncompressedDXGI_FORMAT(Format));
}
catch
{
if (Format == SurfaceFormat.BC1_UNORM)
return DDSCompressor.DecompressBC1(data, (int)Width, (int)Height, false);
else if (Format == SurfaceFormat.BC1_SRGB)
return DDSCompressor.DecompressBC1(data, (int)Width, (int)Height, true);
else if (Format == SurfaceFormat.BC3_SRGB)
return DDSCompressor.DecompressBC3(data, (int)Width, (int)Height, false);
else if (Format == SurfaceFormat.BC3_UNORM)
return DDSCompressor.DecompressBC3(data, (int)Width, (int)Height, true);
else if (Format == SurfaceFormat.BC4_UNORM)
return DDSCompressor.DecompressBC4(data, (int)Width, (int)Height, false);
else if (Format == SurfaceFormat.BC4_SNORM)
return DDSCompressor.DecompressBC4(data, (int)Width, (int)Height, true);
else if (Format == SurfaceFormat.BC5_UNORM)
return DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, false);
else
return null;
}
if (d != null)
{
decomp = BitmapExtension.GetBitmap(d, (int)Width, (int)Height);
return SwapBlueRedChannels(decomp);
}
return null;
}
private static DDS.DXGI_FORMAT GetUncompressedDXGI_FORMAT(SurfaceFormat Format)
{
switch (Format)
{
case SurfaceFormat.A1_B5_G5_R5_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM;
case SurfaceFormat.A4_B4_G4_R4_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM;
case SurfaceFormat.B5_G5_R5_A1_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM;
case SurfaceFormat.B5_G6_R5_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM;
case SurfaceFormat.B8_G8_R8_A8_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
case SurfaceFormat.B8_G8_R8_A8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM;
case SurfaceFormat.R10_G10_B10_A2_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM;
case SurfaceFormat.R11_G11_B10_FLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_R11G11B10_FLOAT;
case SurfaceFormat.R16_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM;
case SurfaceFormat.R32_FLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT;
case SurfaceFormat.R4_G4_B4_A4_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM;
case SurfaceFormat.R4_G4_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM;
case SurfaceFormat.R5_G5_B5_A1_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM;
case SurfaceFormat.R5_G6_B5_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM;
case SurfaceFormat.R8_G8_B8_A8_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
case SurfaceFormat.R8_G8_B8_A8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
case SurfaceFormat.R8_G8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM;
case SurfaceFormat.R8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM;
case SurfaceFormat.Invalid: throw new Exception("Invalid Format");
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static DDS.DXGI_FORMAT GetCompressedDXGI_FORMAT(SurfaceFormat Format)
{
switch (Format)
{
case SurfaceFormat.BC1_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM;
case SurfaceFormat.BC1_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM;
case SurfaceFormat.BC2_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM;
case SurfaceFormat.BC2_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM;
case SurfaceFormat.BC3_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM;
case SurfaceFormat.BC3_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM;
case SurfaceFormat.BC4_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_UNORM;
case SurfaceFormat.BC4_SNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_SNORM;
case SurfaceFormat.BC5_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_UNORM;
case SurfaceFormat.BC5_SNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_SNORM;
case SurfaceFormat.BC6_UFLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC6H_UF16;
case SurfaceFormat.BC6_FLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC6H_SF16;
case SurfaceFormat.BC7_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM;
case SurfaceFormat.BC7_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM;
case SurfaceFormat.Invalid: throw new Exception("Invalid Format");
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static bool IsCompressedFormat(SurfaceFormat Format)
{
switch (Format)
{
case SurfaceFormat.BC1_UNORM:
case SurfaceFormat.BC1_SRGB:
case SurfaceFormat.BC2_UNORM:
case SurfaceFormat.BC2_SRGB:
case SurfaceFormat.BC3_UNORM:
case SurfaceFormat.BC3_SRGB:
case SurfaceFormat.BC4_UNORM:
case SurfaceFormat.BC4_SNORM:
case SurfaceFormat.BC5_UNORM:
case SurfaceFormat.BC5_SNORM:
case SurfaceFormat.BC6_UFLOAT:
case SurfaceFormat.BC6_FLOAT:
case SurfaceFormat.BC7_UNORM:
case SurfaceFormat.BC7_SRGB:
return true;
default:
return false;
}
}
private static bool IsAtscFormat(SurfaceFormat Format)
{
switch (Format)
{
case SurfaceFormat.ASTC_10x10_SRGB:
case SurfaceFormat.ASTC_10x10_UNORM:
case SurfaceFormat.ASTC_10x5_SRGB:
case SurfaceFormat.ASTC_10x5_UNORM:
case SurfaceFormat.ASTC_10x6_SRGB:
case SurfaceFormat.ASTC_10x6_UNORM:
case SurfaceFormat.ASTC_10x8_SRGB:
case SurfaceFormat.ASTC_10x8_UNORM:
case SurfaceFormat.ASTC_12x10_SRGB:
case SurfaceFormat.ASTC_12x10_UNORM:
case SurfaceFormat.ASTC_12x12_SRGB:
case SurfaceFormat.ASTC_12x12_UNORM:
case SurfaceFormat.ASTC_4x4_SRGB:
case SurfaceFormat.ASTC_5x4_SRGB:
case SurfaceFormat.ASTC_5x4_UNORM:
case SurfaceFormat.ASTC_5x5_SRGB:
case SurfaceFormat.ASTC_5x5_UNORM:
case SurfaceFormat.ASTC_6x5_SRGB:
case SurfaceFormat.ASTC_6x5_UNORM:
case SurfaceFormat.ASTC_6x6_SRGB:
case SurfaceFormat.ASTC_6x6_UNORM:
case SurfaceFormat.ASTC_8x5_SRGB:
case SurfaceFormat.ASTC_8x5_UNORM:
case SurfaceFormat.ASTC_8x6_SRGB:
case SurfaceFormat.ASTC_8x6_UNORM:
case SurfaceFormat.ASTC_8x8_SRGB:
case SurfaceFormat.ASTC_8x8_UNORM:
return true;
default:
return false;
}
}
public static Bitmap SwapBlueRedChannels(Bitmap bitmap)
{
return ColorComponentSelector(bitmap, ChannelType.Blue, ChannelType.Green, ChannelType.Red, ChannelType.Alpha);
}
public static byte[] CompressBlock(byte[] data, int width, int height, SurfaceFormat format, float alphaRef)
{
if (IsCompressedFormat(format))
return DDSCompressor.CompressBlock(data, width, height, GetCompressedDXGI_FORMAT(format), alphaRef);
else if (IsAtscFormat(format))
return null;
else
return DDSCompressor.EncodePixelBlock(data, width, height, GetUncompressedDXGI_FORMAT(format));
}
public unsafe Bitmap GLTextureToBitmap(BRTI_Texture t, int id)
{
Bitmap bitmap = new Bitmap(t.width, t.height);
System.Drawing.Imaging.BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, t.width, t.height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.BindTexture(TextureTarget.Texture2D, id);
GL.GetTexImage(TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0);
bitmap.UnlockBits(bitmapData);
return bitmap;
}
public unsafe void ExportAsImage(BRTI_Texture t, int id, string path)
{
Bitmap bitmap = new Bitmap(t.width, t.height);
System.Drawing.Imaging.BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, t.width, t.height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.BindTexture(TextureTarget.Texture2D, id);
GL.GetTexImage(TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0);
bitmap.UnlockBits(bitmapData);
bitmap.Save(path);
}
public class BRTI_Texture
{
public List<byte[]> mipmaps = new List<byte[]>();
public byte[] data;
public int width, height;
public int display = 0;
public PixelInternalFormat type;
public OpenTK.Graphics.OpenGL.PixelFormat utype;
}
public static int getImageSize(BRTI_Texture t)
{
switch (t.type)
{
case PixelInternalFormat.CompressedRgbaS3tcDxt1Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt1Ext:
case PixelInternalFormat.CompressedRedRgtc1:
case PixelInternalFormat.CompressedSignedRedRgtc1:
return (t.width * t.height / 2);
case PixelInternalFormat.CompressedRgbaS3tcDxt3Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt3Ext:
case PixelInternalFormat.CompressedRgbaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSignedRgRgtc2:
case PixelInternalFormat.CompressedRgRgtc2:
return (t.width * t.height);
case PixelInternalFormat.Rgba:
return t.data.Length;
default:
return t.data.Length;
}
}
public static int loadImage(BRTI_Texture t)
{
int texID = GL.GenTexture();
GL.BindTexture(TextureTarget.Texture2D, texID);
if (t.type != PixelInternalFormat.Rgba)
{
GL.CompressedTexImage2D<byte>(TextureTarget.Texture2D, 0, (InternalFormat)t.type,
t.width, t.height, 0, getImageSize(t), t.data);
//Debug.WriteLine(GL.GetError());
}
else
{
GL.TexImage2D<byte>(TextureTarget.Texture2D, 0, t.type, t.width, t.height, 0,
t.utype, PixelType.UnsignedByte, t.data);
}
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
return texID;
}
private void Remove(object sender, EventArgs args)
{
((BNTX)Parent).RemoveTexture(this);
@ -1154,7 +809,6 @@ namespace FirstPlugin
{
case ".bftex":
Texture.Import(FileName);
ApplyImportSettings(setting);
break;
case ".dds":
setting.LoadDDS(FileName, bntxFile, null, this);
@ -1162,7 +816,7 @@ namespace FirstPlugin
break;
default:
setting.LoadBitMap(FileName, bntxFile);
importer.LoadSetting(setting, (BNTX)Parent);
importer.LoadSetting(setting);
if (importer.ShowDialog() == DialogResult.OK)
{
@ -1205,7 +859,7 @@ namespace FirstPlugin
}
}
}
private void Export(object sender, EventArgs args)
private void Export(object sender, EventArgs args)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.FileName = Texture.Name;
@ -1246,14 +900,9 @@ namespace FirstPlugin
break;
}
}
internal void SaveBinaryTexture(string FileName)
{
Console.WriteLine("Test");
Texture.Export(FileName, bntxFile);
}
public void LoadTexture(Texture tex, int target = 1)
{
surfaces.Clear();
Surfaces.Clear();
try
{
@ -1285,7 +934,7 @@ namespace FirstPlugin
mips.Add(result_);
}
surfaces.Add(new Surface() { mipmaps = mips });
Surfaces.Add(new Surface() { mipmaps = mips });
}
Texture = tex;
@ -1296,128 +945,10 @@ namespace FirstPlugin
MessageBox.Show($"Failed to swizzle texture {Text}! Exception: {e}");
}
}
public Bitmap DisplayTexture(int DisplayMipIndex = 0, int ArrayIndex = 0)
internal void SaveBinaryTexture(string FileName)
{
LoadTexture(Texture);
if (surfaces.Count <= 0)
{
throw new Exception("No texture data found");
}
uint width = (uint)Math.Max(1, Texture.Width >> DisplayMipIndex);
uint height = (uint)Math.Max(1, Texture.Height >> DisplayMipIndex);
byte[] data = surfaces[ArrayIndex].mipmaps[DisplayMipIndex];
return DecodeBlock(data, width, height, Texture.Format);
}
public Bitmap ToBitmap()
{
return new Bitmap("");
}
public Bitmap UpdateBitmap(Bitmap image)
{
return ColorComponentSelector(image, Texture.ChannelRed, Texture.ChannelGreen, Texture.ChannelBlue, Texture.ChannelAlpha);
}
public static ChannelType[] SetChannelsByFormat(SurfaceFormat Format)
{
ChannelType[] channels = new ChannelType[4];
switch (Format)
{
case SurfaceFormat.BC5_UNORM:
case SurfaceFormat.BC5_SNORM:
channels[0] = ChannelType.Red;
channels[1] = ChannelType.Green;
channels[2] = ChannelType.Zero;
channels[3] = ChannelType.One;
break;
case SurfaceFormat.BC4_SNORM:
case SurfaceFormat.BC4_UNORM:
channels[0] = ChannelType.Red;
channels[1] = ChannelType.Red;
channels[2] = ChannelType.Red;
channels[3] = ChannelType.Red;
break;
default:
channels[0] = ChannelType.Red;
channels[1] = ChannelType.Green;
channels[2] = ChannelType.Blue;
channels[3] = ChannelType.Alpha;
break;
}
return channels;
}
public static Bitmap ColorComponentSelector(Bitmap image, ChannelType R, ChannelType G, ChannelType B, ChannelType A)
{
BitmapExtension.ColorSwapFilter color = new BitmapExtension.ColorSwapFilter();
if (R == ChannelType.Red)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Red;
if (R == ChannelType.Green)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Green;
if (R == ChannelType.Blue)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Blue;
if (R == ChannelType.Alpha)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Alpha;
if (R == ChannelType.One)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.One;
if (R == ChannelType.Zero)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Zero;
if (G == ChannelType.Red)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Red;
if (G == ChannelType.Green)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Green;
if (G == ChannelType.Blue)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Blue;
if (G == ChannelType.Alpha)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Alpha;
if (G == ChannelType.One)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.One;
if (G == ChannelType.Zero)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Zero;
if (B == ChannelType.Red)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Red;
if (B == ChannelType.Green)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Green;
if (B == ChannelType.Blue)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Blue;
if (B == ChannelType.Alpha)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Alpha;
if (B == ChannelType.One)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.One;
if (B == ChannelType.Zero)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Zero;
if (A == ChannelType.Red)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Red;
if (A == ChannelType.Green)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Green;
if (A == ChannelType.Blue)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Blue;
if (A == ChannelType.Alpha)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Alpha;
if (A == ChannelType.One)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.One;
if (A == ChannelType.Zero)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Zero;
return BitmapExtension.SwapRGB(image, color);
}
private void SwapChannels(Bitmap bitmap)
{
for (int x = 0; x < bitmap.Width; x++)
{
for (int y = 0; y < bitmap.Height; y++)
{
bitmap.GetPixel(x, y);
}
}
Console.WriteLine("Test");
Texture.Export(FileName, bntxFile);
}
}
}

View file

@ -69,74 +69,11 @@ namespace FirstPlugin
ofd.Multiselect = true;
if (ofd.ShowDialog() == DialogResult.OK)
{
GTXTextureImporter importer = new GTXTextureImporter();
List<GTXImporterSettings> settings = new List<GTXImporterSettings>();
BinaryTextureImporterList importer = new BinaryTextureImporterList();
List<TextureImporterSettings> settings = new List<TextureImporterSettings>();
foreach (string name in ofd.FileNames)
{
string ext = System.IO.Path.GetExtension(name);
ext = ext.ToLower();
if (ext == ".dds")
{
settings.Add(LoadSettings(name));
if (settings.Count == 0)
{
importer.Dispose();
return;
}
importer.LoadSettings(settings);
foreach (var setting in settings)
{
if (setting.DataBlockOutput != null)
{
GTX.GX2Surface tex = setting.CreateGx2Texture(setting.DataBlockOutput[0]);
FTEX ftex = new FTEX();
ftex.texture = ftex.FromGx2Surface(tex, setting);
Nodes.Add(ftex);
ftex.Read(ftex.texture);
Textures.Add(ftex.Text, ftex);
ftex.LoadOpenGLTexture();
}
}
}
else
{
settings.Add(LoadSettings(name));
if (settings.Count == 0)
{
importer.Dispose();
return;
}
importer.LoadSettings(settings);
if (importer.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
foreach (var setting in settings)
{
if (setting.GenerateMipmaps)
{
setting.DataBlockOutput.Clear();
setting.DataBlockOutput.Add(setting.GenerateMips());
}
if (setting.DataBlockOutput != null)
{
GTX.GX2Surface tex = setting.CreateGx2Texture(setting.DataBlockOutput[0]);
FTEX ftex = new FTEX();
ftex.texture = ftex.FromGx2Surface(tex, setting);
Nodes.Add(ftex);
ftex.Read(ftex.texture);
Textures.Add(ftex.Text, ftex);
ftex.LoadOpenGLTexture();
}
else
{
MessageBox.Show("Something went wrong???");
}
}
}
}
settings.Clear();
GC.Collect();
@ -144,24 +81,6 @@ namespace FirstPlugin
}
}
}
public GTXImporterSettings LoadSettings(string name)
{
var importer = new GTXImporterSettings();
string ext = System.IO.Path.GetExtension(name);
ext = ext.ToLower();
switch (ext)
{
case ".dds":
importer.LoadDDS(name);
break;
default:
importer.LoadBitMap(name);
break;
}
return importer;
}
private void ExportAll(object sender, EventArgs args)
{
List<string> Formats = new List<string>();
@ -204,7 +123,6 @@ namespace FirstPlugin
public class FTEX : STGenericTexture
{
public int format;
public RenderableTex renderedTex = new RenderableTex();
public Texture texture;
public FTEX()
@ -254,45 +172,11 @@ namespace FirstPlugin
string ext = System.IO.Path.GetExtension(FileName);
ext = ext.ToLower();
GTXImporterSettings setting = new GTXImporterSettings();
GTXTextureImporter importer = new GTXTextureImporter();
switch (ext)
{
case ".dds":
setting.LoadDDS(FileName, null);
break;
default:
setting.LoadBitMap(FileName);
importer.LoadSetting(setting);
break;
}
if (importer.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
if (setting.GenerateMipmaps)
{
setting.DataBlockOutput.Clear();
setting.DataBlockOutput.Add(setting.GenerateMips());
}
if (setting.DataBlockOutput != null)
{
var surface = setting.CreateGx2Texture(setting.DataBlockOutput[0]);
texture = FromGx2Surface(surface, setting);
LoadOpenGLTexture();
}
else
{
MessageBox.Show("Something went wrong???");
}
UpdateEditor();
}
TextureImporterSettings setting = new TextureImporterSettings();
BinaryTextureImporterList importer = new BinaryTextureImporterList();
}
//We reuse GX2 data as it's the same thing
public Texture FromGx2Surface(GTX.GX2Surface surf, GTXImporterSettings settings)
public Texture FromGx2Surface(GTX.GX2Surface surf, TextureImporterSettings settings)
{
Texture tex = new Texture();
tex.Name = settings.TexName;
@ -373,12 +257,9 @@ namespace FirstPlugin
texture = tex;
renderedTex = new RenderableTex();
Width = tex.Width;
Height = tex.Height;
renderedTex.width = (int)Width;
renderedTex.height = (int)Height;
Format = ConvertFormat(tex.Format);
format = (int)tex.Format;
int swizzle = (int)tex.Swizzle;
int pitch = (int)tex.Pitch;
@ -402,13 +283,7 @@ namespace FirstPlugin
surf.tileMode = (uint)tex.TileMode;
surf.swizzle = tex.Swizzle;
if (IsCompressedFormat(tex.Format))
Format = GetCompressedDXGI_FORMAT(tex.Format);
else
Format = GetUncompressedDXGI_FORMAT(tex.Format);
//Determine tex2 botw files to get mip maps
string Tex1 = GetFilePath();
if (Tex1.Contains(".Tex1"))
{
@ -433,12 +308,13 @@ namespace FirstPlugin
surf.numMips = 1;
List<byte[]> mips = GTX.Decode(surf);
renderedTex.mipmaps.Add(mips);
surfaces.Add(new Surface() { mipmaps = mips });
Surfaces.Add(new Surface() { mipmaps = mips });
renderedTex.data = renderedTex.mipmaps[0][0];
LoadOpenGLTexture();
RenderableTex.LoadOpenGLTexture(this);
}
private TEX_FORMAT ConvertFormat(GX2SurfaceFormat Format)
{
return TEX_FORMAT.UNKNOWN;
}
public static GX2CompSel[] SetChannelsByFormat(GX2SurfaceFormat Format)
{
@ -489,367 +365,14 @@ namespace FirstPlugin
break;
}
}
internal void SaveBitMap(string FileName, int SurfaceLevel = 0, int MipLevel = 0)
{
Bitmap bitMap = DisplayTexture(MipLevel, SurfaceLevel);
bitMap.Save(FileName);
}
internal void SaveBinaryTexture(string FileName)
{
Console.WriteLine("Test");
// Texture.Export(FileName, bntxFile);
}
internal void SaveDDS(string FileName)
{
DDS dds = new DDS();
dds.header = new DDS.Header();
dds.header.width = Width;
dds.header.height = Height;
dds.header.mipmapCount = (uint)surfaces[0].mipmaps.Count;
dds.header.pitchOrLinearSize = (uint)surfaces[0].mipmaps[0].Length;
if (IsCompressedFormat((GX2SurfaceFormat)format))
dds.SetFlags((DDS.DXGI_FORMAT)GetCompressedDXGI_FORMAT((GX2SurfaceFormat)format));
else
dds.SetFlags((DDS.DXGI_FORMAT)GetUncompressedDXGI_FORMAT((GX2SurfaceFormat)format));
dds.Save(dds, FileName, surfaces);
}
public void LoadOpenGLTexture()
{
if (OpenTKSharedResources.SetupStatus == OpenTKSharedResources.SharedResourceStatus.Unitialized)
return;
switch (format)
{
case ((int)GTX.GX2SurfaceFormat.T_BC1_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC1_SRGB):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC2_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC2_SRGB):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedSrgbAlphaS3tcDxt3Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC3_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC3_SRGB):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedSrgbAlphaS3tcDxt5Ext;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC4_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRedRgtc1;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC4_SNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedSignedRedRgtc1;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC5_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.CompressedRgRgtc2;
break;
case ((int)GTX.GX2SurfaceFormat.T_BC5_SNORM):
//OpenTK doesn't load BC5 SNORM textures right so I'll use the same decompress method bntx has
renderedTex.data = DDSCompressor.DecompressBC5(renderedTex.mipmaps[0][0], (int)renderedTex.width, (int)renderedTex.height, true, true);
renderedTex.pixelInternalFormat = PixelInternalFormat.Rgba;
renderedTex.pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
case ((int)GTX.GX2SurfaceFormat.TCS_R8_G8_B8_A8_UNORM):
renderedTex.pixelInternalFormat = PixelInternalFormat.Rgba;
renderedTex.pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
case ((int)GTX.GX2SurfaceFormat.TCS_R8_G8_B8_A8_SRGB):
renderedTex.pixelInternalFormat = PixelInternalFormat.Rgba;
renderedTex.pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
default:
renderedTex.data = BitmapExtension.ImageToByte(DecodeBlock(renderedTex.data, (uint)renderedTex.width, (uint)renderedTex.height, (GX2SurfaceFormat)format));
renderedTex.pixelInternalFormat = PixelInternalFormat.Rgba;
renderedTex.pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
}
renderedTex.display = loadImage(renderedTex);
}
public static int loadImage(RenderableTex t)
{
int texID = GL.GenTexture();
GL.BindTexture(TextureTarget.Texture2D, texID);
if (t.pixelInternalFormat != PixelInternalFormat.Rgba)
{
GL.CompressedTexImage2D<byte>(TextureTarget.Texture2D, 0, (InternalFormat)t.pixelInternalFormat,
t.width, t.height, 0, getImageSize(t), t.data);
//Debug.WriteLine(GL.GetError());
}
else
{
GL.TexImage2D<byte>(TextureTarget.Texture2D, 0, t.pixelInternalFormat, t.width, t.height, 0,
t.pixelFormat, PixelType.UnsignedByte, t.data);
}
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
return texID;
}
public static int getImageSize(RenderableTex t)
{
switch (t.pixelInternalFormat)
{
case PixelInternalFormat.CompressedRgbaS3tcDxt1Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt1Ext:
case PixelInternalFormat.CompressedRedRgtc1:
case PixelInternalFormat.CompressedSignedRedRgtc1:
return (t.width * t.height / 2);
case PixelInternalFormat.CompressedRgbaS3tcDxt3Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt3Ext:
case PixelInternalFormat.CompressedRgbaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSignedRgRgtc2:
case PixelInternalFormat.CompressedRgRgtc2:
return (t.width * t.height);
case PixelInternalFormat.Rgba:
return t.data.Length;
default:
return t.data.Length;
}
}
public unsafe Bitmap GLTextureToBitmap(RenderableTex t, int id)
{
Bitmap bitmap = new Bitmap(t.width, t.height);
System.Drawing.Imaging.BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, t.width, t.height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.BindTexture(TextureTarget.Texture2D, id);
GL.GetTexImage(TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0);
bitmap.UnlockBits(bitmapData);
return bitmap;
}
public override void OnClick(TreeView treeView)
{
UpdateEditor();
}
public void UpdateEditor()
{
if (Viewport.Instance.gL_ControlModern1.Visible == false)
PluginRuntime.FSHPDockState = WeifenLuo.WinFormsUI.Docking.DockState.Document;
FTEXEditor docked = (FTEXEditor)LibraryGUI.Instance.GetContentDocked(new FTEXEditor());
if (docked == null)
{
docked = new FTEXEditor();
LibraryGUI.Instance.LoadDockContent(docked, PluginRuntime.FSHPDockState);
}
docked.Text = Text;
docked.Dock = DockStyle.Fill;
docked.LoadPicture(DisplayTexture());
docked.LoadProperty(this);
}
public class RenderableTex
{
public int width, height;
public int display;
public PixelInternalFormat pixelInternalFormat;
public PixelFormat pixelFormat;
public PixelType pixelType = PixelType.UnsignedByte;
public int mipMapCount;
public List<List<byte[]>> mipmaps = new List<List<byte[]>>();
public byte[] data;
public class Surface
{
}
}
public Bitmap DisplayTexture(int DisplayMipIndex = 0, int ArrayIndex = 0)
{
if (renderedTex.mipmaps.Count <= 0)
{
throw new Exception("No texture data found");
}
uint width = (uint)Math.Max(1, renderedTex.width >> DisplayMipIndex);
uint height = (uint)Math.Max(1, renderedTex.height >> DisplayMipIndex);
byte[] data = renderedTex.mipmaps[ArrayIndex][DisplayMipIndex];
return DecodeBlock(data, width, height, (GX2SurfaceFormat)format);
}
public static Bitmap DecodeBlock(byte[] data, uint Width, uint Height, GX2SurfaceFormat Format)
{
Bitmap decomp;
try
{
if (Format == GX2SurfaceFormat.T_BC5_SNorm)
return DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true);
if (Format == GX2SurfaceFormat.TC_R8_UNorm)
System.IO.File.WriteAllBytes("TC_R8_UNorm2.bin", data);
byte[] d = null;
if (IsCompressedFormat(Format))
d = DDSCompressor.DecompressBlock(data, (int)Width, (int)Height, (DDS.DXGI_FORMAT)GetCompressedDXGI_FORMAT(Format));
else
d = DDSCompressor.DecodePixelBlock(data, (int)Width, (int)Height, (DDS.DXGI_FORMAT)GetUncompressedDXGI_FORMAT(Format));
if (d != null)
{
decomp = BitmapExtension.GetBitmap(d, (int)Width, (int)Height);
if (Format == GX2SurfaceFormat.TCS_R5_G6_B5_UNorm)
return decomp;
else
return SwapBlueRedChannels(decomp);
}
return BitmapExtension.GetBitmap(d, (int)Width, (int)Height);;
}
catch
{
throw new Exception($"Bad size from format {Format}");
}
}
public static byte[] CompressBlock(byte[] data, int width, int height, GTX.GX2SurfaceFormat format, float alphaRef)
{
if (IsCompressedFormat((GX2SurfaceFormat)format))
return DDSCompressor.CompressBlock(data, width, height, (DDS.DXGI_FORMAT)GetCompressedDXGI_FORMAT((GX2SurfaceFormat)format), alphaRef);
else
return DDSCompressor.EncodePixelBlock(data, width, height, (DDS.DXGI_FORMAT)GetUncompressedDXGI_FORMAT((GX2SurfaceFormat)format));
}
private static TEX_FORMAT GetUncompressedDXGI_FORMAT(GX2SurfaceFormat Format)
{
switch (Format)
{
case GX2SurfaceFormat.TC_R5_G5_B5_A1_UNorm: return TEX_FORMAT.B5G5R5A1_UNORM;
case GX2SurfaceFormat.TC_A1_B5_G5_R5_UNorm: return TEX_FORMAT.B5G5R5A1_UNORM;
case GX2SurfaceFormat.TC_R4_G4_B4_A4_UNorm: return TEX_FORMAT.B4G4R4A4_UNORM;
case GX2SurfaceFormat.TCS_R5_G6_B5_UNorm: return TEX_FORMAT.B5G6R5_UNORM;
case GX2SurfaceFormat.TCS_R8_G8_B8_A8_SRGB: return TEX_FORMAT.R8G8B8A8_UNORM;
case GX2SurfaceFormat.TCS_R8_G8_B8_A8_UNorm: return TEX_FORMAT.R8G8B8A8_UNORM;
case GX2SurfaceFormat.TCS_R10_G10_B10_A2_UNorm: return TEX_FORMAT.R10G10B10A2_UNORM;
case GX2SurfaceFormat.TC_R11_G11_B10_Float: return TEX_FORMAT.R11G11B10_FLOAT;
case GX2SurfaceFormat.TCD_R16_UNorm: return TEX_FORMAT.R16_UNORM;
case GX2SurfaceFormat.TCD_R32_Float: return TEX_FORMAT.R32_FLOAT;
case GX2SurfaceFormat.T_R4_G4_UNorm: return TEX_FORMAT.B4G4R4A4_UNORM;
case GX2SurfaceFormat.TC_R8_G8_UNorm: return TEX_FORMAT.R8G8_UNORM;
case GX2SurfaceFormat.TC_R8_UNorm: return TEX_FORMAT.R8_UNORM;
case GX2SurfaceFormat.Invalid: throw new Exception("Invalid Format");
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static bool IsCompressedFormat(GX2SurfaceFormat Format)
{
switch (Format)
{
case GX2SurfaceFormat.T_BC1_UNorm:
case GX2SurfaceFormat.T_BC1_SRGB:
case GX2SurfaceFormat.T_BC2_UNorm:
case GX2SurfaceFormat.T_BC2_SRGB:
case GX2SurfaceFormat.T_BC3_UNorm:
case GX2SurfaceFormat.T_BC3_SRGB:
case GX2SurfaceFormat.T_BC4_UNorm:
case GX2SurfaceFormat.T_BC4_SNorm:
case GX2SurfaceFormat.T_BC5_UNorm:
case GX2SurfaceFormat.T_BC5_SNorm:
return true;
default:
return false;
}
}
private static TEX_FORMAT GetCompressedDXGI_FORMAT(GX2SurfaceFormat Format)
{
switch (Format)
{
case GX2SurfaceFormat.T_BC1_UNorm: return TEX_FORMAT.BC1_UNORM;
case GX2SurfaceFormat.T_BC1_SRGB: return TEX_FORMAT.BC1_UNORM;
case GX2SurfaceFormat.T_BC2_UNorm: return TEX_FORMAT.BC2_UNORM;
case GX2SurfaceFormat.T_BC2_SRGB: return TEX_FORMAT.BC2_UNORM;
case GX2SurfaceFormat.T_BC3_UNorm: return TEX_FORMAT.BC3_UNORM;
case GX2SurfaceFormat.T_BC3_SRGB: return TEX_FORMAT.BC3_UNORM;
case GX2SurfaceFormat.T_BC4_UNorm: return TEX_FORMAT.BC4_UNORM;
case GX2SurfaceFormat.T_BC4_SNorm: return TEX_FORMAT.BC4_SNORM;
case GX2SurfaceFormat.T_BC5_UNorm: return TEX_FORMAT.BC5_UNORM;
case GX2SurfaceFormat.T_BC5_SNorm: return TEX_FORMAT.BC5_SNORM;
default:
throw new Exception($"Cannot convert format {Format}");
}
}
public static Bitmap SwapBlueRedChannels(Bitmap bitmap)
{
return ColorComponentSelector(bitmap, GX2CompSel.ChannelB, GX2CompSel.ChannelG, GX2CompSel.ChannelR, GX2CompSel.ChannelA);
}
public Bitmap UpdateBitmap(Bitmap image)
{
return ColorComponentSelector(image, texture.CompSelR,
texture.CompSelG, texture.CompSelB, texture.CompSelA);
}
public static Bitmap ColorComponentSelector(Bitmap image, GX2CompSel R, GX2CompSel G, GX2CompSel B, GX2CompSel A)
{
BitmapExtension.ColorSwapFilter color = new BitmapExtension.ColorSwapFilter();
if (R == GX2CompSel.ChannelR)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Red;
if (R == GX2CompSel.ChannelG)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Green;
if (R == GX2CompSel.ChannelB)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Blue;
if (R == GX2CompSel.ChannelA)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Alpha;
if (R == GX2CompSel.Always0)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Zero;
if (R == GX2CompSel.Always1)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.One;
if (G == GX2CompSel.ChannelR)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Red;
if (G == GX2CompSel.ChannelG)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Green;
if (G == GX2CompSel.ChannelB)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Blue;
if (G == GX2CompSel.ChannelA)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Alpha;
if (G == GX2CompSel.Always0)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Zero;
if (G == GX2CompSel.Always1)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.One;
if (B == GX2CompSel.ChannelR)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Red;
if (B == GX2CompSel.ChannelG)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Green;
if (B == GX2CompSel.ChannelB)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Blue;
if (B == GX2CompSel.ChannelA)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Alpha;
if (B == GX2CompSel.Always0)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Zero;
if (B == GX2CompSel.Always1)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.One;
if (A == GX2CompSel.ChannelR)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Red;
if (A == GX2CompSel.ChannelG)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Green;
if (A == GX2CompSel.ChannelB)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Blue;
if (A == GX2CompSel.ChannelA)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Alpha;
if (A == GX2CompSel.Always0)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Zero;
if (A == GX2CompSel.Always1)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.One;
return BitmapExtension.SwapRGB(image, color);
}
}
}

View file

@ -252,10 +252,8 @@ namespace FirstPlugin
Console.WriteLine(" realSize = " + tex.surface.imageSize);
List<byte[]> mips = GTX.Decode(tex.surface);
tex.renderedTex.mipmaps.Add(mips);
tex.renderedTex.width = (int)tex.surface.width;
tex.renderedTex.height = (int)tex.surface.height;
tex.Surfaces.Add(new STGenericTexture.Surface() { mipmaps = mips });
tex.RenderableTex.LoadOpenGLTexture(tex);
curTex++;
}
}
@ -341,7 +339,6 @@ namespace FirstPlugin
public class TextureData : STGenericTexture
{
public SurfaceInfoParse surface;
public RenderableTex renderedTex = new RenderableTex();
public TextureData()
{
@ -398,26 +395,6 @@ namespace FirstPlugin
break;
}
}
internal void SaveBitMap(string FileName, int SurfaceLevel = 0, int MipLevel = 0)
{
Bitmap bitMap = DisplayTexture(MipLevel, SurfaceLevel);
bitMap.Save(FileName);
}
internal void SaveDDS(string FileName)
{
DDS dds = new DDS();
dds.header = new DDS.Header();
dds.header.width = (uint)renderedTex.width;
dds.header.height = (uint)renderedTex.width;
dds.header.mipmapCount = (uint)renderedTex.mipmaps[0].Count;
dds.header.pitchOrLinearSize = (uint)renderedTex.mipmaps[0][0].Length;
dds.Save(dds, FileName, surfaces);
}
private void Replace(object sender, EventArgs args)
{
OpenFileDialog ofd = new OpenFileDialog();
@ -437,62 +414,8 @@ namespace FirstPlugin
}
public void Replace(string FileName)
{
string ext = System.IO.Path.GetExtension(FileName);
ext = ext.ToLower();
GTXImporterSettings setting = new GTXImporterSettings();
GTXTextureImporter importer = new GTXTextureImporter();
switch (ext)
{
case ".dds":
setting.LoadDDS(FileName, null);
break;
default:
setting.LoadBitMap(FileName);
importer.LoadSetting(setting);
break;
}
if (importer.ShowDialog() == DialogResult.OK)
{
Cursor.Current = Cursors.WaitCursor;
if (setting.GenerateMipmaps)
{
setting.DataBlockOutput.Clear();
setting.DataBlockOutput.Add(setting.GenerateMips());
}
if (setting.DataBlockOutput != null)
{
var surface = setting.CreateGx2Texture(setting.DataBlockOutput[0]);
}
else
{
MessageBox.Show("Something went wrong???");
}
UpdateEditor();
}
}
public class RenderableTex
{
public int width, height;
public int display;
public PixelInternalFormat pixelInternalFormat;
public PixelFormat pixelFormat;
public PixelType pixelType = PixelType.UnsignedByte;
public int mipMapCount;
public List<List<byte[]>> mipmaps = new List<List<byte[]>>();
public byte[] data;
public class Surface
{
}
}
public override void OnClick(TreeView treeView)
{
UpdateEditor();
@ -500,34 +423,7 @@ namespace FirstPlugin
public void UpdateEditor()
{
if (Viewport.Instance.gL_ControlModern1.Visible == false)
PluginRuntime.FSHPDockState = WeifenLuo.WinFormsUI.Docking.DockState.Document;
GTXEditor docked = (GTXEditor)LibraryGUI.Instance.GetContentDocked(new GTXEditor());
if (docked == null)
{
docked = new GTXEditor();
LibraryGUI.Instance.LoadDockContent(docked, PluginRuntime.FSHPDockState);
}
docked.Text = Text;
docked.Dock = DockStyle.Fill;
docked.LoadPicture(DisplayTexture());
docked.LoadProperty(this);
}
public Bitmap DisplayTexture(int DisplayMipIndex = 0, int ArrayIndex = 0)
{
if (renderedTex.mipmaps.Count <= 0)
{
throw new Exception("No texture data found");
}
uint width = (uint)Math.Max(1, renderedTex.width >> DisplayMipIndex);
uint height = (uint)Math.Max(1, renderedTex.height >> DisplayMipIndex);
byte[] data = renderedTex.mipmaps[ArrayIndex][DisplayMipIndex];
return FTEX.DecodeBlock(data, width, height, (Syroot.NintenTools.Bfres.GX2.GX2SurfaceFormat)surface.format);
}
}
public class SurfaceInfoParse : GTX.GX2Surface

View file

@ -141,7 +141,7 @@ namespace FirstPlugin
Console.WriteLine(texture.Format.ToString("x") + " " + file + " " + texture.Text);
try
{
Bitmap bitmap = texture.DisplayTexture();
Bitmap bitmap = texture.GetBitmap();
if (bitmap != null)
bitmap.Save(System.IO.Path.GetFullPath(file) + texture.ArcOffset + texture.Text + ".png");
@ -155,7 +155,7 @@ namespace FirstPlugin
{
Console.WriteLine("Something went wrong??");
}
texture.surfaces.Clear();
texture.Surfaces.Clear();
texture = null;
@ -199,17 +199,17 @@ namespace FirstPlugin
var tex = new TextureData();
tex.Replace(ofd.FileName);
if (surfaces[0].mipmaps[0].Length != surfaces[0].mipmaps[0].Length)
if (Surfaces[0].mipmaps[0].Length != Surfaces[0].mipmaps[0].Length)
throw new Exception("Image must be the same size!");
if (surfaces[0].mipmaps.Count != tex.surfaces[0].mipmaps.Count)
if (Surfaces[0].mipmaps.Count != tex.Surfaces[0].mipmaps.Count)
throw new Exception("Map map count must be the same!");
if (Width != tex.Texture.Width || Height != tex.Texture.Height)
throw new Exception("Image size must be the same!");
ImageData = tex.Texture.TextureData[0][0];
surfaces = tex.surfaces;
Surfaces = tex.Surfaces;
Width = tex.Texture.Width;
Height = tex.Texture.Height;
@ -263,29 +263,6 @@ namespace FirstPlugin
break;
}
}
internal void SaveBitMap(string FileName, int SurfaceLevel = 0, int MipLevel = 0)
{
Bitmap bitMap = DisplayTexture(SurfaceLevel, MipLevel);
bitMap.Save(FileName);
}
internal void SaveDDS(string FileName)
{
DDS dds = new DDS();
dds.header = new DDS.Header();
dds.header.width = Width;
dds.header.height = Height;
dds.header.mipmapCount = (uint)surfaces[0].mipmaps.Count;
dds.header.pitchOrLinearSize = (uint)surfaces[0].mipmaps[0].Length;
if (IsCompressedFormat((NUTEXImageFormat)Format))
dds.SetFlags(GetCompressedDXGI_FORMAT((NUTEXImageFormat)Format));
else
dds.SetFlags(GetUncompressedDXGI_FORMAT((NUTEXImageFormat)Format));
dds.Save(dds, FileName, surfaces);
}
public void Read(FileReader reader)
{
ImageKey = "Texture";
@ -367,116 +344,15 @@ namespace FirstPlugin
}
public override void OnClick(TreeView treeView)
{
UpdateEditor();
}
public Bitmap DisplayTexture(int ArrayIndex = 0, int DisplayMipIndex = 0)
public void UpdateEditor()
{
if (BadSwizzle)
return BitmapExtension.GetBitmap(Properties.Resources.Black, 32, 32);
if (IsSwizzled)
LoadTexture();
else
surfaces.Add(new Surface() {mipmaps = new List<byte[]>() { ImageData } } );
if (surfaces[0].mipmaps.Count <= 0)
{
return BitmapExtension.GetBitmap(Properties.Resources.Black, 32, 32);
}
Console.WriteLine(ArrayIndex);
uint width = (uint)Math.Max(1, Width >> DisplayMipIndex);
uint height = (uint)Math.Max(1, Height >> DisplayMipIndex);
byte[] data = surfaces[ArrayIndex].mipmaps[DisplayMipIndex];
return DecodeBlock(data, width, height, (NUTEXImageFormat)Format);
}
public static Bitmap DecodeBlock(byte[] data, uint Width, uint Height, NUTEXImageFormat Format)
{
Bitmap decomp;
Console.WriteLine(Format);
if (Format == NUTEXImageFormat.BC5_SNORM)
return DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true);
byte[] d = null;
if (IsCompressedFormat(Format))
d = DDSCompressor.DecompressBlock(data, (int)Width, (int)Height, GetCompressedDXGI_FORMAT(Format));
else
d = DDSCompressor.DecodePixelBlock(data, (int)Width, (int)Height, GetUncompressedDXGI_FORMAT(Format));
if (d != null)
{
decomp = BitmapExtension.GetBitmap(d, (int)Width, (int)Height);
return TextureData.SwapBlueRedChannels(decomp);
}
return null;
}
private static DDS.DXGI_FORMAT GetUncompressedDXGI_FORMAT(NUTEXImageFormat Format)
{
switch (Format)
{
case NUTEXImageFormat.R32G32B32A32_FLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_R32G32B32A32_FLOAT;
case NUTEXImageFormat.R8G8B8A8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
case NUTEXImageFormat.R8G8B8A8_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
case NUTEXImageFormat.B8G8R8A8_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM;
case NUTEXImageFormat.B8G8R8A8_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM;
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static DDS.DXGI_FORMAT GetCompressedDXGI_FORMAT(NUTEXImageFormat Format)
{
//This uses UNORM instead of SRGB due to decod
switch (Format)
{
case NUTEXImageFormat.BC1_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM;
case NUTEXImageFormat.BC1_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM;
case NUTEXImageFormat.BC2_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM;
case NUTEXImageFormat.BC2_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM;
case NUTEXImageFormat.BC3_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM;
case NUTEXImageFormat.BC3_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM;
case NUTEXImageFormat.BC4_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_UNORM;
case NUTEXImageFormat.BC4_SNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_SNORM;
case NUTEXImageFormat.BC5_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_UNORM;
case NUTEXImageFormat.BC5_SNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_SNORM;
case NUTEXImageFormat.BC6_UFLOAT: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC6H_UF16;
case NUTEXImageFormat.BC7_UNORM: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM;
case NUTEXImageFormat.BC7_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM;
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static bool IsCompressedFormat(NUTEXImageFormat Format)
{
switch (Format)
{
case NUTEXImageFormat.BC1_UNORM:
case NUTEXImageFormat.BC1_SRGB:
case NUTEXImageFormat.BC2_UNORM:
case NUTEXImageFormat.BC2_SRGB:
case NUTEXImageFormat.BC3_UNORM:
case NUTEXImageFormat.BC3_SRGB:
case NUTEXImageFormat.BC4_UNORM:
case NUTEXImageFormat.BC4_SNORM:
case NUTEXImageFormat.BC5_UNORM:
case NUTEXImageFormat.BC5_SNORM:
case NUTEXImageFormat.BC6_UFLOAT:
case NUTEXImageFormat.BC7_UNORM:
case NUTEXImageFormat.BC7_SRGB:
return true;
default:
return false;
}
}
public void LoadTexture(int target = 1)
{
surfaces.Clear();
Surfaces.Clear();
uint blk_dim = blk_dims((byte)Format);
uint blkWidth = blk_dim >> 4;
@ -534,25 +410,9 @@ namespace FirstPlugin
mipOffset += (uint)MipSize;
break;
}
surfaces.Add(new Surface() { mipmaps = mips });
Surfaces.Add(new Surface() { mipmaps = mips });
}
}
public void UpdateEditor()
{
if (Viewport.Instance.gL_ControlModern1.Visible == false)
PluginRuntime.FSHPDockState = WeifenLuo.WinFormsUI.Docking.DockState.Document;
NuTexEditor docked = (NuTexEditor)LibraryGUI.Instance.GetContentDocked(new NuTexEditor());
if (docked == null)
{
docked = new NuTexEditor();
LibraryGUI.Instance.LoadDockContent(docked, PluginRuntime.FSHPDockState);
}
docked.Text = Text;
docked.Dock = DockStyle.Fill;
docked.LoadProperty(this);
}
MenuItem save = new MenuItem("Save");
MenuItem export = new MenuItem("Export");
MenuItem replace = new MenuItem("Replace");

View file

@ -200,12 +200,10 @@ namespace FirstPlugin
}
}
}
public class TextureInfo : TreeNodeFile
public class TextureInfo : STGenericTexture
{
public UInt64 DataSize { get; set; }
public uint Alignment { get; set; }
public uint Width { get; set; }
public uint Height { get; set; }
public uint Depth { get; set; }
public uint Target { get; set; }
public XTXFormats.XTXImageFormat Format { get; set; }
@ -213,7 +211,6 @@ namespace FirstPlugin
public uint SliceSize { get; set; }
public uint[] MipOffsets { get; set; }
public BlockHeader DataBlockHeader { get; set; }
public List<byte[]> mipmaps = new List<byte[]>();
public byte[] ImageData;
@ -252,79 +249,9 @@ namespace FirstPlugin
EndBlockHeader.Read(reader);
}
public Bitmap DisplayImage(int mipLevel = 0, int arrayLevel = 0)
{
LoadTexture();
Bitmap decomp;
if (Format == XTXFormats.XTXImageFormat.BC5S)
return DDSCompressor.DecompressBC5(mipmaps[0], (int)Width, (int)Height, true);
byte[] d = null;
if (IsCompressedFormat(Format))
d = DDSCompressor.DecompressBlock(mipmaps[0], (int)Width, (int)Height, GetCompressedDXGI_FORMAT(Format));
else
d = DDSCompressor.DecodePixelBlock(mipmaps[0], (int)Width, (int)Height, GetUncompressedDXGI_FORMAT(Format));
if (d != null)
{
decomp = BitmapExtension.GetBitmap(d, (int)Width, (int)Height);
return TextureData.SwapBlueRedChannels(decomp);
}
return null;
}
private static DDS.DXGI_FORMAT GetCompressedDXGI_FORMAT(XTXFormats.XTXImageFormat Format)
{
switch (Format)
{
case XTXFormats.XTXImageFormat.DXT1: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM;
case XTXFormats.XTXImageFormat.DXT3: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM;
case XTXFormats.XTXImageFormat.DXT5: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM;
case XTXFormats.XTXImageFormat.BC4U: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_UNORM;
case XTXFormats.XTXImageFormat.BC4S: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_SNORM;
case XTXFormats.XTXImageFormat.BC5U: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_UNORM;
case XTXFormats.XTXImageFormat.BC5S: return DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_SNORM;
default:
throw new Exception($"Cannot convert format {Format}");
}
}
private static bool IsCompressedFormat(XTXFormats.XTXImageFormat Format)
{
switch (Format)
{
case XTXFormats.XTXImageFormat.DXT1:
case XTXFormats.XTXImageFormat.DXT3:
case XTXFormats.XTXImageFormat.DXT5:
case XTXFormats.XTXImageFormat.BC4U:
case XTXFormats.XTXImageFormat.BC4S:
case XTXFormats.XTXImageFormat.BC5U:
case XTXFormats.XTXImageFormat.BC5S:
return true;
default:
return false;
}
}
private static DDS.DXGI_FORMAT GetUncompressedDXGI_FORMAT(XTXFormats.XTXImageFormat Format)
{
switch (Format)
{
case XTXFormats.XTXImageFormat.NVN_FORMAT_R8: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RG8: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGB10A2: return DDS.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGB565: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGB5A1: return DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGBA4: return DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGBA8: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
case XTXFormats.XTXImageFormat.NVN_FORMAT_RGBA8_SRGB: return DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
default:
throw new Exception($"Cannot convert format {Format}");
}
}
public void LoadTexture()
{
mipmaps.Clear();
Surfaces.Clear();
Console.WriteLine(Format);
@ -340,6 +267,7 @@ namespace FirstPlugin
int TileMode = 0;
uint bpp = XTXFormats.bpps((uint)Format);
List<byte[]> mips = new List<byte[]>();
int blockHeightShift = 0;
for (int mipLevel = 0; mipLevel < MipOffsets.Length; mipLevel++)
@ -376,12 +304,9 @@ namespace FirstPlugin
byte[] result_ = new byte[size];
Array.Copy(result, 0, result_, 0, size);
mipmaps.Add(result_);
Console.WriteLine("bpp " + bpp);
Console.WriteLine("result_ " + size);
Console.WriteLine("width " + width);
Console.WriteLine("height " + height);
mips.Add(result_);
}
Surfaces.Add(new Surface() { mipmaps = mips });
}
}
}

View file

@ -320,7 +320,7 @@ namespace FirstPlugin
{
if (ftexContainer.Textures.ContainsKey(tex.Name))
{
BindGLTexture(tex, ftexContainer.Textures[tex.Name].renderedTex.display);
BindGLTexture(tex, ftexContainer.Textures[tex.Name].RenderableTex.display);
}
}
}
@ -330,7 +330,7 @@ namespace FirstPlugin
{
if (bntx.Textures.ContainsKey(tex.Name))
{
BindGLTexture(tex, bntx.Textures[tex.Name].renderedGLTex.display);
BindGLTexture(tex, bntx.Textures[tex.Name].RenderableTex.display);
}
}
}

View file

@ -7,6 +7,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.Rendering;
namespace FirstPlugin
{
@ -16,10 +18,9 @@ namespace FirstPlugin
{
InitializeComponent();
}
public void LoadTexture(TextureData tex)
public void LoadTexture(STGenericTexture tex)
{
TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
bntxEditor1.LoadProperty(tex);
RenderableTex renderedTex = tex.RenderableTex;
}
}
}

View file

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.Rendering;
namespace FirstPlugin
{
@ -53,10 +54,8 @@ namespace FirstPlugin
TextureData tex = bntx.Textures[item.Text];
tex.LoadOpenGLTexture();
TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
Bitmap temp = tex.GLTextureToBitmap(renderedTex, renderedTex.display);
RenderableTex renderedTex = tex.RenderableTex;
Bitmap temp = RenderableTex.GLTextureToBitmap(renderedTex, renderedTex.display);
textureImageList.Images.Add(tex.Text, temp);

View file

@ -207,8 +207,7 @@ namespace FirstPlugin
FoundTexture = true;
TextureData tex = bntx.Textures[item.Text];
TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
Bitmap temp = tex.GLTextureToBitmap(renderedTex, renderedTex.display);
Bitmap temp = tex.GetBitmap();
textureImageList.Images.Add(tex.Text, temp);
@ -225,8 +224,7 @@ namespace FirstPlugin
FoundTexture = true;
FTEX tex = ftexCont.Textures[item.Text];
FTEX.RenderableTex renderedTex = tex.renderedTex;
Bitmap temp = tex.GLTextureToBitmap(renderedTex, renderedTex.display);
Bitmap temp = tex.GetBitmap();
textureImageList.Images.Add(tex.Text, temp);

View file

@ -1,353 +0,0 @@
namespace FirstPlugin
{
partial class NuTexEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NuTexEditor));
this.panel1 = new System.Windows.Forms.Panel();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pictureBoxCustom1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
this.panel3 = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.arrayLevelCounterLabel = new System.Windows.Forms.Label();
this.btnRightArray = new System.Windows.Forms.Button();
this.btnLeftArray = new System.Windows.Forms.Button();
this.imageBGComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.texSizeMipsLabel = new System.Windows.Forms.Label();
this.mipLevelCounterLabel = new System.Windows.Forms.Label();
this.BtnMipsRight = new System.Windows.Forms.Button();
this.BtmMipsLeft = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.replaceSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).BeginInit();
this.panel3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel1.Controls.Add(this.propertyGrid1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(593, 296);
this.panel1.TabIndex = 1;
//
// propertyGrid1
//
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.propertyGrid1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.CategoryForeColor = System.Drawing.Color.WhiteSmoke;
this.propertyGrid1.CategorySplitterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.CommandsActiveLinkColor = System.Drawing.Color.Red;
this.propertyGrid1.CommandsBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsForeColor = System.Drawing.Color.White;
this.propertyGrid1.DisabledItemForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.propertyGrid1.HelpBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.HelpBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.propertyGrid1.HelpForeColor = System.Drawing.Color.White;
this.propertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.SelectedItemWithFocusForeColor = System.Drawing.Color.Silver;
this.propertyGrid1.Size = new System.Drawing.Size(593, 299);
this.propertyGrid1.TabIndex = 2;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.ViewBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.ViewBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.ViewForeColor = System.Drawing.Color.White;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// splitter1
//
this.splitter1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 296);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(593, 3);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel2.Controls.Add(this.panel4);
this.panel2.Controls.Add(this.panel3);
this.panel2.Controls.Add(this.button1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 299);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(593, 297);
this.panel2.TabIndex = 3;
//
// panel4
//
this.panel4.Controls.Add(this.pictureBoxCustom1);
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 80);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(593, 217);
this.panel4.TabIndex = 4;
//
// pictureBoxCustom1
//
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxCustom1.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
this.pictureBoxCustom1.Size = new System.Drawing.Size(593, 217);
this.pictureBoxCustom1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxCustom1.TabIndex = 0;
this.pictureBoxCustom1.TabStop = false;
//
// panel3
//
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.arrayLevelCounterLabel);
this.panel3.Controls.Add(this.btnRightArray);
this.panel3.Controls.Add(this.btnLeftArray);
this.panel3.Controls.Add(this.imageBGComboBox);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.texSizeMipsLabel);
this.panel3.Controls.Add(this.mipLevelCounterLabel);
this.panel3.Controls.Add(this.BtnMipsRight);
this.panel3.Controls.Add(this.BtmMipsLeft);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 25);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(593, 55);
this.panel3.TabIndex = 2;
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(342, 30);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Array Counter:";
//
// arrayLevelCounterLabel
//
this.arrayLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.arrayLevelCounterLabel.AutoSize = true;
this.arrayLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.arrayLevelCounterLabel.Location = new System.Drawing.Point(415, 30);
this.arrayLevelCounterLabel.Name = "arrayLevelCounterLabel";
this.arrayLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.arrayLevelCounterLabel.TabIndex = 8;
this.arrayLevelCounterLabel.Text = "00 / 00";
//
// btnRightArray
//
this.btnRightArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRightArray.Location = new System.Drawing.Point(533, 26);
this.btnRightArray.Name = "btnRightArray";
this.btnRightArray.Size = new System.Drawing.Size(57, 21);
this.btnRightArray.TabIndex = 7;
this.btnRightArray.Text = ">";
this.btnRightArray.UseVisualStyleBackColor = true;
this.btnRightArray.Click += new System.EventHandler(this.btnRightArray_Click);
//
// btnLeftArray
//
this.btnLeftArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnLeftArray.Enabled = false;
this.btnLeftArray.Location = new System.Drawing.Point(470, 26);
this.btnLeftArray.Name = "btnLeftArray";
this.btnLeftArray.Size = new System.Drawing.Size(57, 21);
this.btnLeftArray.TabIndex = 6;
this.btnLeftArray.Text = "<";
this.btnLeftArray.UseVisualStyleBackColor = true;
this.btnLeftArray.Click += new System.EventHandler(this.btnLeftArray_Click);
//
// imageBGComboBox
//
this.imageBGComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imageBGComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.imageBGComboBox.FormattingEnabled = true;
this.imageBGComboBox.Location = new System.Drawing.Point(215, 7);
this.imageBGComboBox.Name = "imageBGComboBox";
this.imageBGComboBox.Size = new System.Drawing.Size(121, 21);
this.imageBGComboBox.TabIndex = 5;
this.imageBGComboBox.SelectedIndexChanged += new System.EventHandler(this.imageBGComboBox_SelectedIndexChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(342, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 4;
this.label1.Text = "Mip Counter:";
//
// texSizeMipsLabel
//
this.texSizeMipsLabel.AutoSize = true;
this.texSizeMipsLabel.ForeColor = System.Drawing.Color.White;
this.texSizeMipsLabel.Location = new System.Drawing.Point(127, 34);
this.texSizeMipsLabel.Name = "texSizeMipsLabel";
this.texSizeMipsLabel.Size = new System.Drawing.Size(42, 13);
this.texSizeMipsLabel.TabIndex = 3;
this.texSizeMipsLabel.Text = "00 / 00";
//
// mipLevelCounterLabel
//
this.mipLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.mipLevelCounterLabel.AutoSize = true;
this.mipLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.mipLevelCounterLabel.Location = new System.Drawing.Point(415, 7);
this.mipLevelCounterLabel.Name = "mipLevelCounterLabel";
this.mipLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.mipLevelCounterLabel.TabIndex = 2;
this.mipLevelCounterLabel.Text = "00 / 00";
//
// BtnMipsRight
//
this.BtnMipsRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnMipsRight.Location = new System.Drawing.Point(533, 3);
this.BtnMipsRight.Name = "BtnMipsRight";
this.BtnMipsRight.Size = new System.Drawing.Size(57, 21);
this.BtnMipsRight.TabIndex = 1;
this.BtnMipsRight.Text = ">";
this.BtnMipsRight.UseVisualStyleBackColor = true;
this.BtnMipsRight.Click += new System.EventHandler(this.BtnMipsRight_Click);
//
// BtmMipsLeft
//
this.BtmMipsLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtmMipsLeft.Enabled = false;
this.BtmMipsLeft.Location = new System.Drawing.Point(470, 3);
this.BtmMipsLeft.Name = "BtmMipsLeft";
this.BtmMipsLeft.Size = new System.Drawing.Size(57, 21);
this.BtmMipsLeft.TabIndex = 0;
this.BtmMipsLeft.Text = "<";
this.BtmMipsLeft.UseVisualStyleBackColor = true;
this.BtmMipsLeft.Click += new System.EventHandler(this.BtmMipsLeft_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.button1.Dock = System.Windows.Forms.DockStyle.Top;
this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(593, 25);
this.button1.TabIndex = 1;
this.button1.Text = "Hide";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.replaceSurfaceLevelToolStripMenuItem,
this.exportSurfaceLevelToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(188, 48);
//
// replaceSurfaceLevelToolStripMenuItem
//
this.replaceSurfaceLevelToolStripMenuItem.Name = "replaceSurfaceLevelToolStripMenuItem";
this.replaceSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.replaceSurfaceLevelToolStripMenuItem.Text = "Replace Surface Level";
//
// exportSurfaceLevelToolStripMenuItem
//
this.exportSurfaceLevelToolStripMenuItem.Name = "exportSurfaceLevelToolStripMenuItem";
this.exportSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.exportSurfaceLevelToolStripMenuItem.Text = "Export Surface Level";
//
// NuTexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel2);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.panel1);
this.Name = "NuTexEditor";
this.Size = new System.Drawing.Size(593, 596);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panel2;
private Switch_Toolbox.Library.Forms.PictureBoxCustom pictureBoxCustom1;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label mipLevelCounterLabel;
private System.Windows.Forms.Button BtnMipsRight;
private System.Windows.Forms.Button BtmMipsLeft;
private System.Windows.Forms.Label texSizeMipsLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox imageBGComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label arrayLevelCounterLabel;
private System.Windows.Forms.Button btnRightArray;
private System.Windows.Forms.Button btnLeftArray;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem replaceSurfaceLevelToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSurfaceLevelToolStripMenuItem;
}
}

View file

@ -1,207 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Syroot.NintenTools.NSW.Bntx;
using Syroot.NintenTools.NSW.Bntx.GFX;
using Switch_Toolbox.Library;
namespace FirstPlugin
{
public partial class NuTexEditor : UserControl
{
private Thread Thread;
public NuTexEditor()
{
InitializeComponent();
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
imageBGComboBox.Items.Add(type);
imageBGComboBox.SelectedItem = Runtime.pictureBoxStyle;
UpdateBackgroundImage();
}
NUTEXB.NuTex textureData;
int CurMipDisplayLevel = 0;
int CurArrayDisplayLevel = 0;
class PropGridData
{
public string Name { get; set; }
public string Format { get; set; }
public uint Width { get; set; }
public uint Height { get; set; }
public uint MipCount { get; set; }
public uint ArrayCount { get; set; }
}
public void LoadProperty(NUTEXB.NuTex tex)
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
LoadImage();
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
textureData = tex;
UpdateMipDisplay();
PropGridData prop = new PropGridData();
prop.Name = textureData.Text;
prop.Width = textureData.Width;
prop.Height = textureData.Height;
// prop.MipCount = (uint)textureData.blocksCompressed[0].Count;
// prop.ArrayCount = (uint)textureData.blocksCompressed.Count;
prop.Height = textureData.Height;
prop.Format = ((NUTEXB.NUTEXImageFormat)textureData.Format).ToString();
propertyGrid1.PropertySort = PropertySort.Categorized;
propertyGrid1.SelectedObject = prop;
}
private void LoadImage()
{
if (Thread != null && Thread.IsAlive)
Thread.Abort();
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);
}));
Thread.Start();
GC.Collect();
}
private void UpdateMipDisplay()
{
LoadImage();
int MipCount = 1;
if (textureData.mipmaps.Count <= 0)
return;
else
MipCount = textureData.mipmaps[CurArrayDisplayLevel].Count;
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.mipmaps[CurArrayDisplayLevel].Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.mipmaps.Count - 1}";
if (CurMipDisplayLevel != MipCount - 1)
BtnMipsRight.Enabled = true;
else
BtnMipsRight.Enabled = false;
if (CurMipDisplayLevel != 0)
BtmMipsLeft.Enabled = true;
else
BtmMipsLeft.Enabled = false;
if (CurArrayDisplayLevel != textureData.mipmaps.Count - 1)
btnRightArray.Enabled = true;
else
btnRightArray.Enabled = false;
if (CurArrayDisplayLevel != 0)
btnLeftArray.Enabled = true;
else
btnLeftArray.Enabled = false;
}
bool IsHidden = false;
private void button1_Click(object sender, EventArgs e)
{
if (IsHidden)
{
panel1.Visible = true;
IsHidden = false;
button1.Text = "Hide";
}
else
{
panel1.Visible = false;
IsHidden = true;
button1.Text = "Show";
}
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (propertyGrid1.SelectedObject != null)
{
Texture tex = (Texture)propertyGrid1.SelectedObject;
textureData.Text = tex.Name;
}
}
private void BtmMipsLeft_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != 0)
CurMipDisplayLevel -= 1;
UpdateMipDisplay();
}
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.mipmaps[CurArrayDisplayLevel].Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();
}
private void btnLeftArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != 0)
CurArrayDisplayLevel -= 1;
UpdateMipDisplay();
}
private void btnRightArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != textureData.mipmaps.Count - 1)
CurArrayDisplayLevel += 1;
UpdateMipDisplay();
}
private void UpdateBackgroundImage()
{
switch (Runtime.pictureBoxStyle)
{
case Runtime.PictureBoxBG.Black:
pictureBoxCustom1.BackColor = Color.Black;
pictureBoxCustom1.BackgroundImage = null;
break;
case Runtime.PictureBoxBG.Checkerboard:
pictureBoxCustom1.BackColor = Color.Transparent;
pictureBoxCustom1.BackgroundImage = pictureBoxCustom1.GetCheckerBackground();
break;
}
}
private void imageBGComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.pictureBoxStyle = (Runtime.PictureBoxBG)imageBGComboBox.SelectedItem;
UpdateBackgroundImage();
}
private void btnEdit_Click(object sender, EventArgs e)
{
Button btnSender = (Button)sender;
Point ptLowerLeft = new Point(0, btnSender.Height);
ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
contextMenuStrip1.Show(ptLowerLeft);
}
}
}

View file

@ -1,331 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAADAFBMVEXMzMzNzc3Ozs7Pz8/Q0NDR0dHS
0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh4eHi4uLj4+Pk5OTl5eXm
5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u7v7+/w8PDx8fHy8vLz8/P09PT19fX29vb39/f4+Pj5+fn6
+vr7+/v8/Pz9/f3+/v7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
A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c7likYjkVi1Qsp2IZFcuoWOYjiqWfsUjF
MrpjGRXLqVikYjkVi1Qs96sUS3+PZVQspzsWqVhOxSIVy6lYRsUy9WLlQRHhuMHhVxAYHH4FgcFhg8MO
xw0Ov4LA4bjBYYPDDscNDr+CwOE44ajDcYPDDsdfQWBw+BUEBocNDjscNzjscPwVBAaHDQ6/goBw1OTv
PhP65gOeCX1AQPGZ0HfvPxM6PEv5hzwT+owEas+Ebnz8M6GfZwhMfNjyu8+EPn/8M6Fv6s+ERkL/xjOh
cesy2vNO2vPu4g8z8ZunPkzhVCyjYjkVi1Qsp2KRiuVULKNiGRXLqFhGxXIqFqlYTsUiFcupWEbFMiqW
UbGMiuVULFKxnIpFKpZTsYyKZVQso2KZH1Is/D4jM+80LrRKBLQZIoHmCIFJmoigv0FAZZjRKRDQqYuE
kvArnu7TMGOwQkBrBGaOgI59BJSFX8p1KhBQJ17HuoWEyvhbosYIaBiu4xxnNGq/GayHAJq139oVZ/QQ
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -84,7 +84,7 @@ namespace FirstPlugin
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Switch_Toolbox.Library.Imaging.GetLoadingImage();
pictureBoxCustom1.Image = texData.DisplayTexture();
pictureBoxCustom1.Image = texData.GetBitmap();
// texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
}));
Thread.Start();
@ -98,7 +98,7 @@ namespace FirstPlugin
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Switch_Toolbox.Library.Imaging.GetLoadingImage();
pictureBoxCustom1.Image = texData.DisplayTexture();
pictureBoxCustom1.Image = texData.GetBitmap();
// texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
}));
Thread.Start();

View file

@ -49,31 +49,26 @@ namespace FirstPlugin
}
private void LoadImage()
{
// if (Thread != null && Thread.IsAlive)
// Thread.Abort();
Thread = new Thread((ThreadStart)(() =>
{
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);
pictureBoxCustom1.Image = textureData.GetBitmap(CurMipDisplayLevel, CurArrayDisplayLevel);;
}));
Thread.Start();
GC.Collect();
}
private void UpdateMipDisplay()
{
LoadImage();
int MipCount = 1;
if (textureData.surfaces.Count <= 0)
if (textureData.Surfaces.Count <= 0)
return;
else
MipCount = textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count;
MipCount = textureData.Surfaces[CurArrayDisplayLevel].mipmaps.Count;
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.surfaces.Count - 1}";
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.Surfaces[CurArrayDisplayLevel].mipmaps.Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.Surfaces.Count - 1}";
if (CurMipDisplayLevel != MipCount - 1)
BtnMipsRight.Enabled = true;
@ -85,7 +80,7 @@ namespace FirstPlugin
else
BtmMipsLeft.Enabled = false;
if (CurArrayDisplayLevel != textureData.surfaces.Count - 1)
if (CurArrayDisplayLevel != textureData.Surfaces.Count - 1)
btnRightArray.Enabled = true;
else
btnRightArray.Enabled = false;
@ -119,7 +114,6 @@ namespace FirstPlugin
{
Texture tex = (Texture)propertyGrid1.SelectedObject;
textureData.Text = tex.Name;
pictureBoxCustom1.Image = textureData.UpdateBitmap(new Bitmap(pictureBoxCustom1.Image));
}
}
@ -133,7 +127,7 @@ namespace FirstPlugin
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count - 1)
if (CurMipDisplayLevel != textureData.Surfaces[CurArrayDisplayLevel].mipmaps.Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();
@ -149,7 +143,7 @@ namespace FirstPlugin
private void btnRightArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != textureData.surfaces.Count - 1)
if (CurArrayDisplayLevel != textureData.Surfaces.Count - 1)
CurArrayDisplayLevel += 1;
UpdateMipDisplay();
@ -204,7 +198,7 @@ namespace FirstPlugin
throw new Exception("Invalid Width! Must be same as original!");
List<byte[]> Mipmaps = TextureImporterSettings.SwizzleSurfaceMipMaps(textureData.Texture, dds.bdata, TileMode.Default);
textureData.surfaces[CurArrayDisplayLevel].mipmaps = Mipmaps;
textureData.Surfaces[CurArrayDisplayLevel].mipmaps = Mipmaps;
UpdateMipDisplay();
textureData.LoadOpenGLTexture();

View file

@ -9,6 +9,7 @@ using System.Threading;
using System.Windows.Forms;
using Syroot.NintenTools.NSW.Bntx;
using Syroot.NintenTools.NSW.Bntx.GFX;
using Switch_Toolbox.Library;
namespace FirstPlugin
{
@ -20,43 +21,29 @@ namespace FirstPlugin
listViewCustom1.FullRowSelect = true;
//Add enums
foreach (SurfaceFormat format in (SurfaceFormat[])Enum.GetValues(typeof(SurfaceFormat)))
{
// if (format != SurfaceFormat.Invalid)
}
formatComboBox.Items.Add(SurfaceFormat.A1_B5_G5_R5_UNORM);
formatComboBox.Items.Add(SurfaceFormat.A4_B4_G4_R4_UNORM);
formatComboBox.Items.Add(SurfaceFormat.B5_G5_R5_A1_UNORM);
formatComboBox.Items.Add(SurfaceFormat.B5_G6_R5_UNORM);
formatComboBox.Items.Add(SurfaceFormat.B8_G8_R8_A8_SRGB);
formatComboBox.Items.Add(SurfaceFormat.B8_G8_R8_A8_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R10_G10_B10_A2_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R11_G11_B10_FLOAT);
formatComboBox.Items.Add(SurfaceFormat.R16_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R32_FLOAT);
formatComboBox.Items.Add(SurfaceFormat.R4_G4_B4_A4_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R4_G4_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R5_G5_B5_A1_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R5_G6_B5_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R8_G8_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R8_UNORM);
formatComboBox.Items.Add(TEX_FORMAT.A1_B5_G5_R5);
formatComboBox.Items.Add(TEX_FORMAT.R4_G4_B4_A4);
formatComboBox.Items.Add(TEX_FORMAT.R5_G5_B5_A1);
formatComboBox.Items.Add(TEX_FORMAT.B5_G6_R5);
formatComboBox.Items.Add(TEX_FORMAT.R8_G8_B8_A8);
formatComboBox.Items.Add(TEX_FORMAT.R10_G10_B10_A2);
formatComboBox.Items.Add(TEX_FORMAT.R11_G11_B10);
formatComboBox.Items.Add(TEX_FORMAT.R16);
formatComboBox.Items.Add(TEX_FORMAT.R32);
formatComboBox.Items.Add(TEX_FORMAT.R4_G4_B4_A4);
formatComboBox.Items.Add(TEX_FORMAT.R4_G4);
formatComboBox.Items.Add(TEX_FORMAT.R5_G5_B5_A1);
formatComboBox.Items.Add(TEX_FORMAT.R8G8);
formatComboBox.Items.Add(TEX_FORMAT.R8);
formatComboBox.Items.Add(SurfaceFormat.R8_G8_B8_A8_UNORM);
formatComboBox.Items.Add(SurfaceFormat.R8_G8_B8_A8_SRGB);
formatComboBox.Items.Add(SurfaceFormat.BC1_SRGB);
formatComboBox.Items.Add(SurfaceFormat.BC1_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC2_SRGB);
formatComboBox.Items.Add(SurfaceFormat.BC2_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC3_SRGB);
formatComboBox.Items.Add(SurfaceFormat.BC3_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC4_SNORM);
formatComboBox.Items.Add(SurfaceFormat.BC4_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC5_SNORM);
formatComboBox.Items.Add(SurfaceFormat.BC5_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC6_UFLOAT);
formatComboBox.Items.Add(SurfaceFormat.BC6_FLOAT);
formatComboBox.Items.Add(SurfaceFormat.BC7_UNORM);
formatComboBox.Items.Add(SurfaceFormat.BC7_SRGB);
formatComboBox.Items.Add(TEX_FORMAT.R8_G8_B8_A8);
formatComboBox.Items.Add(TEX_FORMAT.BC1);
formatComboBox.Items.Add(TEX_FORMAT.BC2);
formatComboBox.Items.Add(TEX_FORMAT.BC3);
formatComboBox.Items.Add(TEX_FORMAT.BC4);
formatComboBox.Items.Add(TEX_FORMAT.BC5);
formatComboBox.Items.Add(TEX_FORMAT.BC6);
formatComboBox.Items.Add(TEX_FORMAT.BC7);
foreach (SurfaceDim dim in (SurfaceDim[])Enum.GetValues(typeof(SurfaceDim)))
{
@ -65,49 +52,24 @@ namespace FirstPlugin
tileModeCB.Items.Add("Texture");
ImgDimComb.SelectedIndex = 1;
tileModeCB.SelectedIndex = 0;
formatComboBox.SelectedItem = SurfaceFormat.BC1_SRGB;
formatComboBox.SelectedItem = TEX_FORMAT.BC1;
}
TextureImporterSettings SelectedTexSettings;
BNTX bntx;
public List<TextureImporterSettings> settings = new List<TextureImporterSettings>();
public void LoadSetting(TextureImporterSettings setting, BNTX b)
public void LoadSetting(TextureImporterSettings setting)
{
settings.Add(setting);
bntx = b;
listViewCustom1.Items.Add(setting.TexName).SubItems.Add(setting.Format.ToString());
listViewCustom1.Items[0].Selected = true;
listViewCustom1.Select();
}
public bool IsCompressed(SurfaceFormat format)
{
switch (format)
{
case SurfaceFormat.BC1_UNORM:
case SurfaceFormat.BC1_SRGB:
case SurfaceFormat.BC2_UNORM:
case SurfaceFormat.BC2_SRGB:
case SurfaceFormat.BC3_UNORM:
case SurfaceFormat.BC3_SRGB:
case SurfaceFormat.BC4_UNORM:
case SurfaceFormat.BC4_SNORM:
case SurfaceFormat.BC5_UNORM:
case SurfaceFormat.BC5_SNORM:
case SurfaceFormat.BC6_UFLOAT:
case SurfaceFormat.BC6_FLOAT:
case SurfaceFormat.BC7_UNORM:
case SurfaceFormat.BC7_SRGB:
return true;
default:
return false;
}
}
private Thread Thread;
public void SetupSettings()
{
if (SelectedTexSettings.Format == SurfaceFormat.Invalid)
if (SelectedTexSettings.Format == TEX_FORMAT.UNKNOWN)
return;
if (Thread != null && Thread.IsAlive)
@ -115,24 +77,26 @@ namespace FirstPlugin
try
{
if (formatComboBox.SelectedItem is SurfaceFormat)
if (formatComboBox.SelectedItem is TEX_FORMAT)
{
SelectedTexSettings.Format = (SurfaceFormat)formatComboBox.SelectedItem;
SelectedTexSettings.Format = (TEX_FORMAT)formatComboBox.SelectedItem;
listViewCustom1.SelectedItems[0].SubItems[1].Text = SelectedTexSettings.Format.ToString();
}
Bitmap bitmap = Switch_Toolbox.Library.Imaging.GetLoadingImage();
pictureBox1.Image = Switch_Toolbox.Library.Imaging.GetLoadingImage();
Thread = new Thread((ThreadStart)(() =>
{
pictureBox1.Image = bitmap;
SelectedTexSettings.Compress();
bitmap = TextureData.DecodeBlock(SelectedTexSettings.DataBlockOutput[0], SelectedTexSettings.
Bitmap bitmap = STGenericTexture.DecodeBlockGetBitmap(SelectedTexSettings.DataBlockOutput[0], SelectedTexSettings.
TexWidth, SelectedTexSettings.TexHeight, SelectedTexSettings.Format);
pictureBox1.Image = bitmap;
pictureBox1.Invoke((MethodInvoker)delegate {
pictureBox1.Refresh();
});
}));
Thread.Start();
}
catch

View file

@ -1,370 +0,0 @@
namespace FirstPlugin
{
partial class FTEXEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BNTXEditor));
this.panel1 = new System.Windows.Forms.Panel();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pictureBoxCustom1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
this.panel3 = new System.Windows.Forms.Panel();
this.imageBGComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.texSizeMipsLabel = new System.Windows.Forms.Label();
this.mipLevelCounterLabel = new System.Windows.Forms.Label();
this.BtnMipsRight = new System.Windows.Forms.Button();
this.BtmMipsLeft = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.arrayLevelCounterLabel = new System.Windows.Forms.Label();
this.btnRightArray = new System.Windows.Forms.Button();
this.btnLeftArray = new System.Windows.Forms.Button();
this.btnEdit = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.replaceSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).BeginInit();
this.panel3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel1.Controls.Add(this.propertyGrid1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(593, 296);
this.panel1.TabIndex = 1;
//
// propertyGrid1
//
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.propertyGrid1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.CategoryForeColor = System.Drawing.Color.WhiteSmoke;
this.propertyGrid1.CategorySplitterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.CommandsActiveLinkColor = System.Drawing.Color.Red;
this.propertyGrid1.CommandsBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsForeColor = System.Drawing.Color.White;
this.propertyGrid1.DisabledItemForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.propertyGrid1.HelpBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.HelpBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.propertyGrid1.HelpForeColor = System.Drawing.Color.White;
this.propertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.SelectedItemWithFocusForeColor = System.Drawing.Color.Silver;
this.propertyGrid1.Size = new System.Drawing.Size(593, 299);
this.propertyGrid1.TabIndex = 2;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.ViewBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.ViewBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.ViewForeColor = System.Drawing.Color.White;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// splitter1
//
this.splitter1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 296);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(593, 3);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel2.Controls.Add(this.panel4);
this.panel2.Controls.Add(this.panel3);
this.panel2.Controls.Add(this.button1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 299);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(593, 297);
this.panel2.TabIndex = 3;
//
// panel4
//
this.panel4.Controls.Add(this.pictureBoxCustom1);
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 80);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(593, 217);
this.panel4.TabIndex = 4;
//
// pictureBoxCustom1
//
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxCustom1.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
this.pictureBoxCustom1.Size = new System.Drawing.Size(593, 217);
this.pictureBoxCustom1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxCustom1.TabIndex = 0;
this.pictureBoxCustom1.TabStop = false;
//
// panel3
//
this.panel3.Controls.Add(this.btnEdit);
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.arrayLevelCounterLabel);
this.panel3.Controls.Add(this.btnRightArray);
this.panel3.Controls.Add(this.btnLeftArray);
this.panel3.Controls.Add(this.imageBGComboBox);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.texSizeMipsLabel);
this.panel3.Controls.Add(this.mipLevelCounterLabel);
this.panel3.Controls.Add(this.BtnMipsRight);
this.panel3.Controls.Add(this.BtmMipsLeft);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 25);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(593, 55);
this.panel3.TabIndex = 2;
//
// imageBGComboBox
//
this.imageBGComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imageBGComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.imageBGComboBox.FormattingEnabled = true;
this.imageBGComboBox.Location = new System.Drawing.Point(215, 7);
this.imageBGComboBox.Name = "imageBGComboBox";
this.imageBGComboBox.Size = new System.Drawing.Size(121, 21);
this.imageBGComboBox.TabIndex = 5;
this.imageBGComboBox.SelectedIndexChanged += new System.EventHandler(this.imageBGComboBox_SelectedIndexChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(342, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 4;
this.label1.Text = "Mip Counter:";
//
// texSizeMipsLabel
//
this.texSizeMipsLabel.AutoSize = true;
this.texSizeMipsLabel.ForeColor = System.Drawing.Color.White;
this.texSizeMipsLabel.Location = new System.Drawing.Point(127, 34);
this.texSizeMipsLabel.Name = "texSizeMipsLabel";
this.texSizeMipsLabel.Size = new System.Drawing.Size(42, 13);
this.texSizeMipsLabel.TabIndex = 3;
this.texSizeMipsLabel.Text = "00 / 00";
//
// mipLevelCounterLabel
//
this.mipLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.mipLevelCounterLabel.AutoSize = true;
this.mipLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.mipLevelCounterLabel.Location = new System.Drawing.Point(415, 7);
this.mipLevelCounterLabel.Name = "mipLevelCounterLabel";
this.mipLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.mipLevelCounterLabel.TabIndex = 2;
this.mipLevelCounterLabel.Text = "00 / 00";
//
// BtnMipsRight
//
this.BtnMipsRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnMipsRight.Location = new System.Drawing.Point(533, 3);
this.BtnMipsRight.Name = "BtnMipsRight";
this.BtnMipsRight.Size = new System.Drawing.Size(57, 21);
this.BtnMipsRight.TabIndex = 1;
this.BtnMipsRight.Text = ">";
this.BtnMipsRight.UseVisualStyleBackColor = true;
this.BtnMipsRight.Click += new System.EventHandler(this.BtnMipsRight_Click);
//
// BtmMipsLeft
//
this.BtmMipsLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtmMipsLeft.Enabled = false;
this.BtmMipsLeft.Location = new System.Drawing.Point(470, 3);
this.BtmMipsLeft.Name = "BtmMipsLeft";
this.BtmMipsLeft.Size = new System.Drawing.Size(57, 21);
this.BtmMipsLeft.TabIndex = 0;
this.BtmMipsLeft.Text = "<";
this.BtmMipsLeft.UseVisualStyleBackColor = true;
this.BtmMipsLeft.Click += new System.EventHandler(this.BtmMipsLeft_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.button1.Dock = System.Windows.Forms.DockStyle.Top;
this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(593, 25);
this.button1.TabIndex = 1;
this.button1.Text = "Hide";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(342, 30);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Array Counter:";
//
// arrayLevelCounterLabel
//
this.arrayLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.arrayLevelCounterLabel.AutoSize = true;
this.arrayLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.arrayLevelCounterLabel.Location = new System.Drawing.Point(415, 30);
this.arrayLevelCounterLabel.Name = "arrayLevelCounterLabel";
this.arrayLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.arrayLevelCounterLabel.TabIndex = 8;
this.arrayLevelCounterLabel.Text = "00 / 00";
//
// btnRightArray
//
this.btnRightArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRightArray.Location = new System.Drawing.Point(533, 26);
this.btnRightArray.Name = "btnRightArray";
this.btnRightArray.Size = new System.Drawing.Size(57, 21);
this.btnRightArray.TabIndex = 7;
this.btnRightArray.Text = ">";
this.btnRightArray.UseVisualStyleBackColor = true;
this.btnRightArray.Click += new System.EventHandler(this.btnRightArray_Click);
//
// btnLeftArray
//
this.btnLeftArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnLeftArray.Enabled = false;
this.btnLeftArray.Location = new System.Drawing.Point(470, 26);
this.btnLeftArray.Name = "btnLeftArray";
this.btnLeftArray.Size = new System.Drawing.Size(57, 21);
this.btnLeftArray.TabIndex = 6;
this.btnLeftArray.Text = "<";
this.btnLeftArray.UseVisualStyleBackColor = true;
this.btnLeftArray.Click += new System.EventHandler(this.btnLeftArray_Click);
//
// btnEdit
//
this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEdit.ForeColor = System.Drawing.Color.White;
this.btnEdit.Location = new System.Drawing.Point(6, 5);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(63, 23);
this.btnEdit.TabIndex = 12;
this.btnEdit.Text = "Edit";
this.btnEdit.UseVisualStyleBackColor = true;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.replaceSurfaceLevelToolStripMenuItem,
this.exportSurfaceLevelToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(188, 70);
//
// replaceSurfaceLevelToolStripMenuItem
//
this.replaceSurfaceLevelToolStripMenuItem.Name = "replaceSurfaceLevelToolStripMenuItem";
this.replaceSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.replaceSurfaceLevelToolStripMenuItem.Text = "Replace Surface Level";
this.replaceSurfaceLevelToolStripMenuItem.Click += new System.EventHandler(this.replaceSurfaceLevelToolStripMenuItem_Click);
//
// exportSurfaceLevelToolStripMenuItem
//
this.exportSurfaceLevelToolStripMenuItem.Name = "exportSurfaceLevelToolStripMenuItem";
this.exportSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.exportSurfaceLevelToolStripMenuItem.Text = "Export Surface Level";
this.exportSurfaceLevelToolStripMenuItem.Click += new System.EventHandler(this.exportSurfaceLevelToolStripMenuItem_Click);
//
// BNTXEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel2);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.panel1);
this.Name = "BNTXEditor";
this.Size = new System.Drawing.Size(593, 596);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panel2;
private Switch_Toolbox.Library.Forms.PictureBoxCustom pictureBoxCustom1;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label mipLevelCounterLabel;
private System.Windows.Forms.Button BtnMipsRight;
private System.Windows.Forms.Button BtmMipsLeft;
private System.Windows.Forms.Label texSizeMipsLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox imageBGComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label arrayLevelCounterLabel;
private System.Windows.Forms.Button btnRightArray;
private System.Windows.Forms.Button btnLeftArray;
private System.Windows.Forms.Button btnEdit;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem replaceSurfaceLevelToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSurfaceLevelToolStripMenuItem;
}
}

View file

@ -1,214 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Syroot.NintenTools.NSW.Bntx;
using Syroot.NintenTools.NSW.Bntx.GFX;
using Switch_Toolbox.Library;
namespace FirstPlugin
{
public partial class FTEXEditor : UserControl
{
private Thread Thread;
public FTEXEditor()
{
InitializeComponent();
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
imageBGComboBox.Items.Add(type);
imageBGComboBox.SelectedItem = Runtime.pictureBoxStyle;
UpdateBackgroundImage();
}
public void LoadPicture(Bitmap image)
{
// pictureBoxCustom1.Image = image;
}
FTEX textureData;
int CurMipDisplayLevel = 0;
int CurArrayDisplayLevel = 0;
public void LoadProperty(FTEX tex)
{
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
textureData = tex;
propertyGrid1.PropertySort = PropertySort.Categorized;
UpdateMipDisplay();
}
private void UpdateMipDisplay()
{
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.renderedTex.mipmaps.Count - 1}";
if (Thread != null && Thread.IsAlive)
Thread.Abort();
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);
// texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
}));
Thread.Start();
if (CurMipDisplayLevel != textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1)
BtnMipsRight.Enabled = true;
else
BtnMipsRight.Enabled = false;
if (CurMipDisplayLevel != 0)
BtmMipsLeft.Enabled = true;
else
BtmMipsLeft.Enabled = false;
if (CurArrayDisplayLevel != textureData.renderedTex.mipmaps.Count - 1)
btnRightArray.Enabled = true;
else
btnRightArray.Enabled = false;
if (CurArrayDisplayLevel != 0)
btnLeftArray.Enabled = true;
else
btnLeftArray.Enabled = false;
}
bool IsHidden = false;
private void button1_Click(object sender, EventArgs e)
{
if (IsHidden)
{
panel1.Visible = true;
IsHidden = false;
button1.Text = "Hide";
}
else
{
panel1.Visible = false;
IsHidden = true;
button1.Text = "Show";
}
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (propertyGrid1.SelectedObject != null)
{
Texture tex = (Texture)propertyGrid1.SelectedObject;
textureData.Text = tex.Name;
pictureBoxCustom1.Image = textureData.UpdateBitmap(new Bitmap(pictureBoxCustom1.Image));
}
}
private void BtmMipsLeft_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != 0)
CurMipDisplayLevel -= 1;
UpdateMipDisplay();
}
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();
}
private void btnLeftArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != 0)
CurArrayDisplayLevel -= 1;
UpdateMipDisplay();
}
private void btnRightArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != textureData.renderedTex.mipmaps.Count - 1)
CurArrayDisplayLevel += 1;
UpdateMipDisplay();
}
private void UpdateBackgroundImage()
{
switch (Runtime.pictureBoxStyle)
{
case Runtime.PictureBoxBG.Black:
pictureBoxCustom1.BackColor = Color.Black;
pictureBoxCustom1.BackgroundImage = null;
break;
case Runtime.PictureBoxBG.Checkerboard:
pictureBoxCustom1.BackColor = Color.Transparent;
pictureBoxCustom1.BackgroundImage = pictureBoxCustom1.GetCheckerBackground();
break;
}
}
private void imageBGComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.pictureBoxStyle = (Runtime.PictureBoxBG)imageBGComboBox.SelectedItem;
UpdateBackgroundImage();
}
private void btnEdit_Click(object sender, EventArgs e)
{
Button btnSender = (Button)sender;
Point ptLowerLeft = new Point(0, btnSender.Height);
ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
contextMenuStrip1.Show(ptLowerLeft);
}
private void replaceSurfaceLevelToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Supported Formats|*.dds|" +
"Microsoft DDS |*.dds|" +
"All files(*.*)|*.*";
if (ofd.ShowDialog() == DialogResult.OK)
{
DDS dds = new DDS(ofd.FileName);
if (textureData.renderedTex.height != (uint)dds.header.height)
throw new Exception("Invalid height! Must be same as original!");
if (textureData.renderedTex.width != (uint)dds.header.width)
throw new Exception("Invalid Width! Must be same as original!");
List<byte[]> Mipmaps = TextureImporterSettings.SwizzleSurfaceMipMaps(textureData, dds.bdata);
textureData.renderedTex.mipmaps[CurArrayDisplayLevel] = Mipmaps;
UpdateMipDisplay();
textureData.LoadOpenGLTexture();
}
}
private void exportSurfaceLevelToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Supported Formats|*.dds|" +
"Microsoft DDS |*.dds|" +
"All files(*.*)|*.*";
if (sfd.ShowDialog() == DialogResult.OK)
{
textureData.Export(sfd.FileName, true, false, CurArrayDisplayLevel, CurMipDisplayLevel);
}
}
}
}

View file

@ -1,331 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAADAFBMVEXMzMzNzc3Ozs7Pz8/Q0NDR0dHS
0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh4eHi4uLj4+Pk5OTl5eXm
5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u7v7+/w8PDx8fHy8vLz8/P09PT19fX29vb39/f4+Pj5+fn6
+vr7+/v8/Pz9/f3+/v7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Q
wKZAQMN4HYtwEv35BgnUnvuahhds44x+OIldGU5zkCOgVW25EZg8nOYorNUuPi91MEVg4lql8TSLOOMK
T8Q0kwOemQmnDAEN10jgvEJgFmdEsB0goCzMOOQIqF17zmh47muzCjM28TmjQwR0niCgzhYJVeE5o+3a
s0zjs2WH4YGq91l4lmm/9izTcB2156Xeh5NoJuFZpqf4TNZemHHeITCz8FjXfXwEbnxe6qlEYLZhueMz
WZtFWIratmJtTTba8+60592oWEbFMiqWUbHcP6NY+iS0UbGc7likYjkVi1Qsp2IZFcuoWOYjiqWfsUjF
MrpjGRXLqVikYjkVi1Qs96sUS3+PZVQspzsWqVhOxSIVy6lYRsUy9WLlQRHhuMHhVxAYHH4FgcFhg8MO
xw0Ov4LA4bjBYYPDDscNDr+CwOE44ajDcYPDDsdfQWBw+BUEBocNDjscNzjscPwVBAaHDQ6/goBw1OTv
PhP65gOeCX1AQPGZ0HfvPxM6PEv5hzwT+owEas+Ebnz8M6GfZwhMfNjyu8+EPn/8M6Fv6s+ERkL/xjOh
cesy2vNO2vPu4g8z8ZunPkzhVCyjYjkVi1Qsp2KRiuVULKNiGRXLqFhGxXIqFqlYTsUiFcupWEbFMiqW
UbGMiuVULFKxnIpFKpZTsYyKZVQso2KZH1Is/D4jM+80LrRKBLQZIoHmCIFJmoigv0FAZZjRKRDQqYuE
kvArnu7TMGOwQkBrBGaOgI59BJSFX8p1KhBQJ17HuoWEyvhbosYIaBiu4xxnNGq/GayHAJq139oVZ/QQ
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -1,341 +0,0 @@
namespace FirstPlugin
{
partial class GTXEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BNTXEditor));
this.panel1 = new System.Windows.Forms.Panel();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pictureBoxCustom1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
this.panel3 = new System.Windows.Forms.Panel();
this.imageBGComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.texSizeMipsLabel = new System.Windows.Forms.Label();
this.mipLevelCounterLabel = new System.Windows.Forms.Label();
this.BtnMipsRight = new System.Windows.Forms.Button();
this.BtmMipsLeft = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.arrayLevelCounterLabel = new System.Windows.Forms.Label();
this.btnRightArray = new System.Windows.Forms.Button();
this.btnLeftArray = new System.Windows.Forms.Button();
this.btnEdit = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).BeginInit();
this.panel3.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel1.Controls.Add(this.propertyGrid1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(593, 296);
this.panel1.TabIndex = 1;
//
// propertyGrid1
//
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.propertyGrid1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.CategoryForeColor = System.Drawing.Color.WhiteSmoke;
this.propertyGrid1.CategorySplitterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.CommandsActiveLinkColor = System.Drawing.Color.Red;
this.propertyGrid1.CommandsBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsForeColor = System.Drawing.Color.White;
this.propertyGrid1.DisabledItemForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.propertyGrid1.HelpBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.HelpBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.propertyGrid1.HelpForeColor = System.Drawing.Color.White;
this.propertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.SelectedItemWithFocusForeColor = System.Drawing.Color.Silver;
this.propertyGrid1.Size = new System.Drawing.Size(593, 299);
this.propertyGrid1.TabIndex = 2;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.ViewBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.ViewBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.ViewForeColor = System.Drawing.Color.White;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// splitter1
//
this.splitter1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 296);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(593, 3);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel2.Controls.Add(this.panel4);
this.panel2.Controls.Add(this.panel3);
this.panel2.Controls.Add(this.button1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 299);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(593, 297);
this.panel2.TabIndex = 3;
//
// panel4
//
this.panel4.Controls.Add(this.pictureBoxCustom1);
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 80);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(593, 217);
this.panel4.TabIndex = 4;
//
// pictureBoxCustom1
//
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxCustom1.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
this.pictureBoxCustom1.Size = new System.Drawing.Size(593, 217);
this.pictureBoxCustom1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxCustom1.TabIndex = 0;
this.pictureBoxCustom1.TabStop = false;
//
// panel3
//
this.panel3.Controls.Add(this.btnEdit);
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.arrayLevelCounterLabel);
this.panel3.Controls.Add(this.btnRightArray);
this.panel3.Controls.Add(this.btnLeftArray);
this.panel3.Controls.Add(this.imageBGComboBox);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.texSizeMipsLabel);
this.panel3.Controls.Add(this.mipLevelCounterLabel);
this.panel3.Controls.Add(this.BtnMipsRight);
this.panel3.Controls.Add(this.BtmMipsLeft);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 25);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(593, 55);
this.panel3.TabIndex = 2;
//
// imageBGComboBox
//
this.imageBGComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imageBGComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.imageBGComboBox.FormattingEnabled = true;
this.imageBGComboBox.Location = new System.Drawing.Point(215, 7);
this.imageBGComboBox.Name = "imageBGComboBox";
this.imageBGComboBox.Size = new System.Drawing.Size(121, 21);
this.imageBGComboBox.TabIndex = 5;
this.imageBGComboBox.SelectedIndexChanged += new System.EventHandler(this.imageBGComboBox_SelectedIndexChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(342, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 4;
this.label1.Text = "Mip Counter:";
//
// texSizeMipsLabel
//
this.texSizeMipsLabel.AutoSize = true;
this.texSizeMipsLabel.ForeColor = System.Drawing.Color.White;
this.texSizeMipsLabel.Location = new System.Drawing.Point(127, 34);
this.texSizeMipsLabel.Name = "texSizeMipsLabel";
this.texSizeMipsLabel.Size = new System.Drawing.Size(42, 13);
this.texSizeMipsLabel.TabIndex = 3;
this.texSizeMipsLabel.Text = "00 / 00";
//
// mipLevelCounterLabel
//
this.mipLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.mipLevelCounterLabel.AutoSize = true;
this.mipLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.mipLevelCounterLabel.Location = new System.Drawing.Point(415, 7);
this.mipLevelCounterLabel.Name = "mipLevelCounterLabel";
this.mipLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.mipLevelCounterLabel.TabIndex = 2;
this.mipLevelCounterLabel.Text = "00 / 00";
//
// BtnMipsRight
//
this.BtnMipsRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnMipsRight.Location = new System.Drawing.Point(533, 3);
this.BtnMipsRight.Name = "BtnMipsRight";
this.BtnMipsRight.Size = new System.Drawing.Size(57, 21);
this.BtnMipsRight.TabIndex = 1;
this.BtnMipsRight.Text = ">";
this.BtnMipsRight.UseVisualStyleBackColor = true;
this.BtnMipsRight.Click += new System.EventHandler(this.BtnMipsRight_Click);
//
// BtmMipsLeft
//
this.BtmMipsLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtmMipsLeft.Enabled = false;
this.BtmMipsLeft.Location = new System.Drawing.Point(470, 3);
this.BtmMipsLeft.Name = "BtmMipsLeft";
this.BtmMipsLeft.Size = new System.Drawing.Size(57, 21);
this.BtmMipsLeft.TabIndex = 0;
this.BtmMipsLeft.Text = "<";
this.BtmMipsLeft.UseVisualStyleBackColor = true;
this.BtmMipsLeft.Click += new System.EventHandler(this.BtmMipsLeft_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.button1.Dock = System.Windows.Forms.DockStyle.Top;
this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(593, 25);
this.button1.TabIndex = 1;
this.button1.Text = "Hide";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(342, 30);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Array Counter:";
//
// arrayLevelCounterLabel
//
this.arrayLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.arrayLevelCounterLabel.AutoSize = true;
this.arrayLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.arrayLevelCounterLabel.Location = new System.Drawing.Point(415, 30);
this.arrayLevelCounterLabel.Name = "arrayLevelCounterLabel";
this.arrayLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.arrayLevelCounterLabel.TabIndex = 8;
this.arrayLevelCounterLabel.Text = "00 / 00";
//
// btnRightArray
//
this.btnRightArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRightArray.Location = new System.Drawing.Point(533, 26);
this.btnRightArray.Name = "btnRightArray";
this.btnRightArray.Size = new System.Drawing.Size(57, 21);
this.btnRightArray.TabIndex = 7;
this.btnRightArray.Text = ">";
this.btnRightArray.UseVisualStyleBackColor = true;
this.btnRightArray.Click += new System.EventHandler(this.btnRightArray_Click);
//
// btnLeftArray
//
this.btnLeftArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnLeftArray.Enabled = false;
this.btnLeftArray.Location = new System.Drawing.Point(470, 26);
this.btnLeftArray.Name = "btnLeftArray";
this.btnLeftArray.Size = new System.Drawing.Size(57, 21);
this.btnLeftArray.TabIndex = 6;
this.btnLeftArray.Text = "<";
this.btnLeftArray.UseVisualStyleBackColor = true;
this.btnLeftArray.Click += new System.EventHandler(this.btnLeftArray_Click);
//
// btnEdit
//
this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEdit.ForeColor = System.Drawing.Color.White;
this.btnEdit.Location = new System.Drawing.Point(6, 5);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(63, 23);
this.btnEdit.TabIndex = 12;
this.btnEdit.Text = "Edit";
this.btnEdit.UseVisualStyleBackColor = true;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
// BNTXEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel2);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.panel1);
this.Name = "BNTXEditor";
this.Size = new System.Drawing.Size(593, 596);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panel2;
private Switch_Toolbox.Library.Forms.PictureBoxCustom pictureBoxCustom1;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label mipLevelCounterLabel;
private System.Windows.Forms.Button BtnMipsRight;
private System.Windows.Forms.Button BtmMipsLeft;
private System.Windows.Forms.Label texSizeMipsLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox imageBGComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label arrayLevelCounterLabel;
private System.Windows.Forms.Button btnRightArray;
private System.Windows.Forms.Button btnLeftArray;
private System.Windows.Forms.Button btnEdit;
private System.Windows.Forms.ToolStripMenuItem replaceSurfaceLevelToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSurfaceLevelToolStripMenuItem;
}
}

View file

@ -1,175 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Syroot.NintenTools.NSW.Bntx;
using Syroot.NintenTools.NSW.Bntx.GFX;
using Switch_Toolbox.Library;
namespace FirstPlugin
{
public partial class GTXEditor : UserControl
{
private Thread Thread;
public GTXEditor()
{
InitializeComponent();
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
imageBGComboBox.Items.Add(type);
imageBGComboBox.SelectedItem = Runtime.pictureBoxStyle;
UpdateBackgroundImage();
}
public void LoadPicture(Bitmap image)
{
// pictureBoxCustom1.Image = image;
}
GTXFile.TextureData textureData;
int CurMipDisplayLevel = 0;
int CurArrayDisplayLevel = 0;
public void LoadProperty(GTXFile.TextureData tex)
{
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
textureData = tex;
propertyGrid1.PropertySort = PropertySort.Categorized;
UpdateMipDisplay();
}
private void UpdateMipDisplay()
{
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.renderedTex.mipmaps.Count - 1}";
if (Thread != null && Thread.IsAlive)
Thread.Abort();
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
pictureBoxCustom1.Image = textureData.DisplayTexture(CurMipDisplayLevel, CurArrayDisplayLevel);
// texSizeMipsLabel.Text = $"Width = {pictureBoxCustom1.Image.Width} Height = {pictureBoxCustom1.Image.Height}";
}));
Thread.Start();
if (CurMipDisplayLevel != textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1)
BtnMipsRight.Enabled = true;
else
BtnMipsRight.Enabled = false;
if (CurMipDisplayLevel != 0)
BtmMipsLeft.Enabled = true;
else
BtmMipsLeft.Enabled = false;
if (CurArrayDisplayLevel != textureData.renderedTex.mipmaps.Count - 1)
btnRightArray.Enabled = true;
else
btnRightArray.Enabled = false;
if (CurArrayDisplayLevel != 0)
btnLeftArray.Enabled = true;
else
btnLeftArray.Enabled = false;
}
bool IsHidden = false;
private void button1_Click(object sender, EventArgs e)
{
if (IsHidden)
{
panel1.Visible = true;
IsHidden = false;
button1.Text = "Hide";
}
else
{
panel1.Visible = false;
IsHidden = true;
button1.Text = "Show";
}
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (propertyGrid1.SelectedObject != null)
{
Texture tex = (Texture)propertyGrid1.SelectedObject;
textureData.Text = tex.Name;
}
}
private void BtmMipsLeft_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != 0)
CurMipDisplayLevel -= 1;
UpdateMipDisplay();
}
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.renderedTex.mipmaps[CurArrayDisplayLevel].Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();
}
private void btnLeftArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != 0)
CurArrayDisplayLevel -= 1;
UpdateMipDisplay();
}
private void btnRightArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != textureData.renderedTex.mipmaps.Count - 1)
CurArrayDisplayLevel += 1;
UpdateMipDisplay();
}
private void UpdateBackgroundImage()
{
switch (Runtime.pictureBoxStyle)
{
case Runtime.PictureBoxBG.Black:
pictureBoxCustom1.BackColor = Color.Black;
pictureBoxCustom1.BackgroundImage = null;
break;
case Runtime.PictureBoxBG.Checkerboard:
pictureBoxCustom1.BackColor = Color.Transparent;
pictureBoxCustom1.BackgroundImage = pictureBoxCustom1.GetCheckerBackground();
break;
}
}
private void imageBGComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.pictureBoxStyle = (Runtime.PictureBoxBG)imageBGComboBox.SelectedItem;
UpdateBackgroundImage();
}
private void btnEdit_Click(object sender, EventArgs e)
{
Button btnSender = (Button)sender;
Point ptLowerLeft = new Point(0, btnSender.Height);
ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
}
}
}

View file

@ -1,331 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAADAFBMVEXMzMzNzc3Ozs7Pz8/Q0NDR0dHS
0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh4eHi4uLj4+Pk5OTl5eXm
5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u7v7+/w8PDx8fHy8vLz8/P09PT19fX29vb39/f4+Pj5+fn6
+vr7+/v8/Pz9/f3+/v7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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fQWBw+BUEBocNDjscNzjscPwVBAaHDQ6/goBw1OTv
PhP65gOeCX1AQPGZ0HfvPxM6PEv5hzwT+owEas+Ebnz8M6GfZwhMfNjyu8+EPn/8M6Fv6s+ERkL/xjOh
cesy2vNO2vPu4g8z8ZunPkzhVCyjYjkVi1Qsp2KRiuVULKNiGRXLqFhGxXIqFqlYTsUiFcupWEbFMiqW
UbGMiuVULFKxnIpFKpZTsYyKZVQso2KZH1Is/D4jM+80LrRKBLQZIoHmCIFJmoigv0FAZZjRKRDQqYuE
kvArnu7TMGOwQkBrBGaOgI59BJSFX8p1KhBQJ17HuoWEyvhbosYIaBiu4xxnNGq/GayHAJq139oVZ/QQ
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -1,385 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Drawing;
using System.Threading.Tasks;
using Switch_Toolbox.Library;
using Switch_Toolbox.Library.IO;
using Syroot.NintenTools.Bfres.GX2;
namespace FirstPlugin
{
public class GTXImporterSettings
{
public string TexName;
public uint TexWidth;
public uint TexHeight;
public uint MipCount;
public uint Depth = 1;
public uint arrayLength = 1;
public List<byte[]> DataBlockOutput = new List<byte[]>();
public List<byte[]> DecompressedData = new List<byte[]>();
public GTX.GX2SurfaceFormat Format;
public bool GenerateMipmaps;
public bool IsSRGB;
public uint tileMode = 4;
public uint swizzle = 4;
public GX2CompSel[] compSel = new GX2CompSel[4];
public GX2SurfaceDim SurfaceDim = GX2SurfaceDim.Dim2D;
public GX2AAMode AAMode = GX2AAMode.Mode1X;
public float alphaRef = 0.5f;
private GTX.GX2SurfaceFormat LoadDDSFormat(uint fourCC, DDS dds = null, bool IsSRGB = false)
{
bool IsDX10 = false;
switch (fourCC)
{
case DDS.FOURCC_DXT1:
if (IsSRGB)
return GTX.GX2SurfaceFormat.T_BC1_SRGB;
else
return GTX.GX2SurfaceFormat.T_BC1_UNORM;
case DDS.FOURCC_DXT3:
if (IsSRGB)
return GTX.GX2SurfaceFormat.T_BC2_SRGB;
else
return GTX.GX2SurfaceFormat.T_BC2_UNORM;
case DDS.FOURCC_DXT5:
if (IsSRGB)
return GTX.GX2SurfaceFormat.T_BC3_SRGB;
else
return GTX.GX2SurfaceFormat.T_BC3_UNORM;
case DDS.FOURCC_BC4U:
return GTX.GX2SurfaceFormat.T_BC4_UNORM;
case DDS.FOURCC_ATI1:
return GTX.GX2SurfaceFormat.T_BC4_UNORM;
case DDS.FOURCC_ATI2:
return GTX.GX2SurfaceFormat.T_BC5_UNORM;
case DDS.FOURCC_BC5U:
return GTX.GX2SurfaceFormat.T_BC4_UNORM;
case DDS.FOURCC_DX10:
IsDX10 = true;
break;
default:
return GTX.GX2SurfaceFormat.TCS_R8_G8_B8_A8_UNORM;
}
if (IsDX10)
{
switch (dds.DX10header.DXGI_Format)
{
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_UNORM:
return GTX.GX2SurfaceFormat.T_BC4_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_SNORM:
return GTX.GX2SurfaceFormat.T_BC4_SNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_TYPELESS:
return GTX.GX2SurfaceFormat.T_BC4_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_UNORM:
return GTX.GX2SurfaceFormat.T_BC5_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_SNORM:
return GTX.GX2SurfaceFormat.T_BC5_SNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_TYPELESS:
return GTX.GX2SurfaceFormat.T_BC5_UNORM;
default:
throw new Exception($"Format {dds.DX10header.DXGI_Format} not supported!");
}
}
throw new Exception($"This shouldn't happen :(");
}
public void LoadDDS(string FileName, byte[] FileData = null)
{
TexName = Path.GetFileNameWithoutExtension(FileName);
DDS dds = new DDS();
if (FileData != null)
dds.Load(new FileReader(new MemoryStream(FileData)));
else
dds.Load(new FileReader(FileName));
MipCount = dds.header.mipmapCount;
TexWidth = dds.header.width;
TexHeight = dds.header.height;
arrayLength = 1;
if (dds.header.caps2 == (uint)DDS.DDSCAPS2.CUBEMAP_ALLFACES)
{
arrayLength = 6;
}
DataBlockOutput.Add(dds.bdata);
Format = LoadDDSFormat(dds.header.ddspf.fourCC, dds, IsSRGB);
GTX.GX2Surface tex = CreateGx2Texture(DataBlockOutput[0]);
}
public void LoadBitMap(string FileName)
{
DecompressedData.Clear();
TexName = Path.GetFileNameWithoutExtension(FileName);
Format = GTX.GX2SurfaceFormat.T_BC1_SRGB;
GenerateMipmaps = true;
Bitmap Image = new Bitmap(FileName);
Image = TextureData.SwapBlueRedChannels(Image);
TexWidth = (uint)Image.Width;
TexHeight = (uint)Image.Height;
MipCount = (uint)GetTotalMipCount();
DecompressedData.Add(BitmapExtension.ImageToByte(Image));
Image.Dispose();
if (DecompressedData.Count == 0)
{
throw new Exception("Failed to load " + Format);
}
}
public int GetTotalMipCount()
{
int MipmapNum = 0;
uint num = Math.Max(TexHeight, TexWidth);
int width = (int)TexWidth;
int height = (int)TexHeight;
while (true)
{
num >>= 1;
width = width / 2;
height = height / 2;
if (width <= 0 || height <= 0)
break;
if (num > 0)
++MipmapNum;
else
break;
}
return MipmapNum;
}
public byte[] GenerateMips(int SurfaceLevel = 0)
{
Bitmap Image = BitmapExtension.GetBitmap(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight);
List<byte[]> mipmaps = new List<byte[]>();
mipmaps.Add(FTEX.CompressBlock(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight, Format, alphaRef));
//while (Image.Width / 2 > 0 && Image.Height / 2 > 0)
// for (int mipLevel = 0; mipLevel < MipCount; mipLevel++)
for (int mipLevel = 0; mipLevel < MipCount; mipLevel++)
{
Image = BitmapExtension.Resize(Image, Image.Width / 2, Image.Height / 2);
mipmaps.Add(FTEX.CompressBlock(BitmapExtension.ImageToByte(Image), Image.Width, Image.Height, Format, alphaRef));
}
Image.Dispose();
return Utils.CombineByteArray(mipmaps.ToArray());
}
public void Compress()
{
DataBlockOutput.Clear();
foreach (var surface in DecompressedData)
{
DataBlockOutput.Add(FTEX.CompressBlock(surface, (int)TexWidth, (int)TexHeight, Format, alphaRef));
}
}
public GTX.GX2Surface CreateGx2Texture(byte[] imageData)
{
var surfOut = GTX.getSurfaceInfo(Format, TexWidth, TexHeight, 1, 1, tileMode, 0, 0);
uint imageSize = (uint)surfOut.surfSize;
uint alignment = surfOut.baseAlign;
uint pitch = surfOut.pitch;
uint mipSize = 0;
uint dataSize = (uint)imageData.Length;
uint bpp = GTX.surfaceGetBitsPerPixel((uint)Format) >> 3;
if (dataSize <= 0)
throw new Exception($"Image is empty!!");
if (surfOut.depth != 1)
throw new Exception($"Unsupported Depth {surfOut.depth}!");
uint s = 0;
switch (tileMode)
{
case 1:
case 2:
case 3:
case 16:
s = 0;
break;
default:
s = 0xd0000 | swizzle << 8;
break;
}
uint blkWidth, blkHeight;
if (GTX.IsFormatBCN(Format))
{
blkWidth = 4;
blkHeight = 4;
}
else
{
blkWidth = 1;
blkHeight = 1;
}
List<uint> mipOffsets = new List<uint>();
List<byte[]> Swizzled = new List<byte[]>();
for (int mipLevel = 0; mipLevel < MipCount; mipLevel++)
{
var result = TextureHelper.GetCurrentMipSize(TexWidth, TexHeight, blkWidth, blkHeight, bpp, mipLevel);
uint offset = result.Item1;
uint size = result.Item2;
Console.WriteLine("Swizzle Size " + size);
Console.WriteLine("Swizzle offset " + offset);
Console.WriteLine("bpp " + bpp);
Console.WriteLine("TexWidth " + TexWidth);
Console.WriteLine("TexHeight " + TexHeight);
Console.WriteLine("blkWidth " + blkWidth);
Console.WriteLine("blkHeight " + blkHeight);
Console.WriteLine("mipLevel " + mipLevel);
byte[] data_ = new byte[size];
Array.Copy(imageData, offset, data_,0, size);
uint width_ = Math.Max(1, TexWidth >> mipLevel);
uint height_ = Math.Max(1, TexHeight >> mipLevel);
if (mipLevel != 0)
{
surfOut = GTX.getSurfaceInfo(Format, TexWidth, TexHeight, 1, 1, tileMode, 0, mipLevel);
if (mipLevel == 1)
mipOffsets.Add(imageSize);
else
mipOffsets.Add(mipSize);
}
data_ = Utils.CombineByteArray(data_, new byte[surfOut.surfSize - size]);
byte[] dataAlignBytes = new byte[RoundUp(mipSize, surfOut.baseAlign) - mipSize];
if (mipLevel != 0)
mipSize += (uint)(surfOut.surfSize + dataAlignBytes.Length);
byte[] SwizzledData = GTX.swizzle(width_, height_, surfOut.height, (uint)Format, surfOut.tileMode, s,
surfOut.pitch, surfOut.bpp, data_);
Swizzled.Add(dataAlignBytes.Concat(SwizzledData).ToArray());
}
compSel[0] = GX2CompSel.ChannelR;
compSel[1] = GX2CompSel.ChannelG;
compSel[2] = GX2CompSel.ChannelB;
compSel[3] = GX2CompSel.ChannelA;
GTX.GX2Surface surf = new GTX.GX2Surface();
surf.depth = Depth;
surf.width = TexWidth;
surf.height = TexHeight;
surf.depth = 1;
surf.use = 1;
surf.dim = (uint)SurfaceDim;
surf.tileMode = tileMode;
surf.swizzle = s;
surf.resourceFlags = 0;
surf.pitch = pitch;
surf.bpp = bpp;
surf.format = (uint)Format;
surf.numMips = MipCount;
surf.aa = (uint)AAMode;
surf.mipOffset = mipOffsets.ToArray();
surf.numMips = (uint)Swizzled.Count;
surf.alignment = alignment;
surf.mipSize = mipSize;
surf.imageSize = imageSize;
surf.data = Swizzled[0];
List<byte[]> mips = new List<byte[]>();
for (int mipLevel = 1; mipLevel < Swizzled.Count; mipLevel++)
{
mips.Add(Swizzled[mipLevel]);
Console.WriteLine(Swizzled[mipLevel].Length);
}
surf.mipData = Utils.CombineByteArray(mips.ToArray());
mips.Clear();
Console.WriteLine("");
Console.WriteLine("// ----- GX2Surface Info ----- ");
Console.WriteLine(" dim = 1");
Console.WriteLine(" width = " + surf.width);
Console.WriteLine(" height = " + surf.height);
Console.WriteLine(" depth = 1");
Console.WriteLine(" numMips = " + surf.numMips);
Console.WriteLine(" format = " + surf.format);
Console.WriteLine(" aa = 0");
Console.WriteLine(" use = 1");
Console.WriteLine(" imageSize = " + surf.imageSize);
Console.WriteLine(" mipSize = " + surf.mipSize);
Console.WriteLine(" tileMode = " + surf.tileMode);
Console.WriteLine(" swizzle = " + surf.swizzle);
Console.WriteLine(" alignment = " + surf.alignment);
Console.WriteLine(" pitch = " + surf.pitch);
Console.WriteLine("");
Console.WriteLine(" GX2 Component Selector:");
Console.WriteLine(" Red Channel: " + compSel[0]);
Console.WriteLine(" Green Channel: " + compSel[1]);
Console.WriteLine(" Blue Channel: " + compSel[2]);
Console.WriteLine(" Alpha Channel: " + compSel[3]);
Console.WriteLine("");
Console.WriteLine(" bits per pixel = " + (surf.bpp << 3));
Console.WriteLine(" bytes per pixel = " + surf.bpp);
Console.WriteLine(" realSize = " + imageData.Length);
return surf;
}
private static Tuple<uint, uint> GetCurrentMipSize(uint width, uint height, uint bpp, int CurLevel, bool IsCompressed)
{
uint offset = 0;
uint size = 0;
for (int mipLevel = 0; mipLevel < CurLevel; mipLevel++)
{
int level = mipLevel + 1;
if (IsCompressed)
offset += ((Math.Max(1, width >> level) + 3) >> 2) * ((Math.Max(1, height >> level) + 3) >> 2) * bpp;
else
offset += Math.Max(1, width >> level) * Math.Max(1, height >> level) * bpp;
}
if (IsCompressed)
size = ((Math.Max(1, width >> CurLevel) + 3) >> 2) * ((Math.Max(1, height >> CurLevel) + 3) >> 2) * bpp;
else
size = Math.Max(1, width >> CurLevel) * Math.Max(1, height >> CurLevel) * bpp;
return Tuple.Create(offset, size);
}
private uint getAlignBlockSize(uint dataOffset, uint alignment)
{
uint alignSize = RoundUp(dataOffset, alignment) - dataOffset - 32;
uint z = 1;
while (alignSize <= 0)
{
alignSize = RoundUp(dataOffset + (alignment * z), alignment) - dataOffset - 32;
z += 1;
}
return alignSize;
}
private int RoundUp(int X, int Y)
{
return ((X - 1) | (Y - 1)) + 1;
}
private uint RoundUp(uint X, uint Y)
{
return ((X - 1) | (Y - 1)) + 1;
}
}
}

View file

@ -1,281 +0,0 @@
namespace FirstPlugin
{
partial class GTXTextureImporter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GTXTextureImporter));
this.SwizzleNum = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label();
this.tileModeCB = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.ImgDimComb = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.MipmapNum = new System.Windows.Forms.NumericUpDown();
this.WidthLabel = new System.Windows.Forms.Label();
this.HeightLabel = new System.Windows.Forms.Label();
this.formatComboBox = new System.Windows.Forms.ComboBox();
this.listViewCustom1 = new Switch_Toolbox.Library.Forms.ListViewCustom();
this.Name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Format = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.pictureBox1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
((System.ComponentModel.ISupportInitialize)(this.SwizzleNum)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MipmapNum)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// SwizzleNum
//
this.SwizzleNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.SwizzleNum.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.SwizzleNum.ForeColor = System.Drawing.Color.White;
this.SwizzleNum.Location = new System.Drawing.Point(877, 142);
this.SwizzleNum.Name = "SwizzleNum";
this.SwizzleNum.Size = new System.Drawing.Size(130, 16);
this.SwizzleNum.TabIndex = 44;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(769, 142);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(42, 13);
this.label5.TabIndex = 43;
this.label5.Text = "Swizzle";
//
// tileModeCB
//
this.tileModeCB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.tileModeCB.FormattingEnabled = true;
this.tileModeCB.Location = new System.Drawing.Point(877, 69);
this.tileModeCB.Name = "tileModeCB";
this.tileModeCB.Size = new System.Drawing.Size(172, 21);
this.tileModeCB.TabIndex = 42;
this.tileModeCB.SelectedIndexChanged += new System.EventHandler(this.tileModeCB_SelectedIndexChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(769, 72);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(54, 13);
this.label4.TabIndex = 41;
this.label4.Text = "Tile Mode";
//
// ImgDimComb
//
this.ImgDimComb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ImgDimComb.FormattingEnabled = true;
this.ImgDimComb.Location = new System.Drawing.Point(875, 36);
this.ImgDimComb.Name = "ImgDimComb";
this.ImgDimComb.Size = new System.Drawing.Size(172, 21);
this.ImgDimComb.TabIndex = 40;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(769, 39);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(88, 13);
this.label3.TabIndex = 39;
this.label3.Text = "Image Dimension";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(766, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(39, 13);
this.label2.TabIndex = 38;
this.label2.Text = "Format";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(769, 107);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 13);
this.label1.TabIndex = 37;
this.label1.Text = "Number MipMaps";
//
// MipmapNum
//
this.MipmapNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.MipmapNum.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.MipmapNum.ForeColor = System.Drawing.Color.White;
this.MipmapNum.Location = new System.Drawing.Point(877, 105);
this.MipmapNum.Name = "MipmapNum";
this.MipmapNum.Size = new System.Drawing.Size(130, 16);
this.MipmapNum.TabIndex = 36;
//
// WidthLabel
//
this.WidthLabel.AutoSize = true;
this.WidthLabel.Location = new System.Drawing.Point(769, 210);
this.WidthLabel.Name = "WidthLabel";
this.WidthLabel.Size = new System.Drawing.Size(35, 13);
this.WidthLabel.TabIndex = 35;
this.WidthLabel.Text = "Width";
//
// HeightLabel
//
this.HeightLabel.AutoSize = true;
this.HeightLabel.Location = new System.Drawing.Point(769, 175);
this.HeightLabel.Name = "HeightLabel";
this.HeightLabel.Size = new System.Drawing.Size(38, 13);
this.HeightLabel.TabIndex = 34;
this.HeightLabel.Text = "Height";
//
// formatComboBox
//
this.formatComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.formatComboBox.FormattingEnabled = true;
this.formatComboBox.Location = new System.Drawing.Point(875, 6);
this.formatComboBox.Name = "formatComboBox";
this.formatComboBox.Size = new System.Drawing.Size(172, 21);
this.formatComboBox.TabIndex = 32;
this.formatComboBox.SelectedIndexChanged += new System.EventHandler(this.formatComboBox_SelectedIndexChanged);
//
// listViewCustom1
//
this.listViewCustom1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.listViewCustom1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Name,
this.Format});
this.listViewCustom1.Dock = System.Windows.Forms.DockStyle.Left;
this.listViewCustom1.ForeColor = System.Drawing.Color.White;
this.listViewCustom1.Location = new System.Drawing.Point(0, 0);
this.listViewCustom1.Name = "listViewCustom1";
this.listViewCustom1.Size = new System.Drawing.Size(237, 515);
this.listViewCustom1.TabIndex = 31;
this.listViewCustom1.UseCompatibleStateImageBehavior = false;
this.listViewCustom1.View = System.Windows.Forms.View.Details;
this.listViewCustom1.SelectedIndexChanged += new System.EventHandler(this.listViewCustom1_SelectedIndexChanged);
//
// Name
//
this.Name.Text = "Name";
this.Name.Width = 104;
//
// Format
//
this.Format.Text = "Format";
//
// button2
//
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.ForeColor = System.Drawing.Color.White;
this.button2.Location = new System.Drawing.Point(993, 470);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(79, 33);
this.button2.TabIndex = 30;
this.button2.Text = "Cancel";
this.button2.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(895, 470);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(79, 33);
this.button1.TabIndex = 29;
this.button1.Text = "Ok";
this.button1.UseVisualStyleBackColor = true;
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.pictureBox1.Location = new System.Drawing.Point(237, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(513, 515);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 33;
this.pictureBox1.TabStop = false;
//
// GTXTextureImporter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.ClientSize = new System.Drawing.Size(1084, 515);
this.Controls.Add(this.SwizzleNum);
this.Controls.Add(this.label5);
this.Controls.Add(this.tileModeCB);
this.Controls.Add(this.label4);
this.Controls.Add(this.ImgDimComb);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.MipmapNum);
this.Controls.Add(this.WidthLabel);
this.Controls.Add(this.HeightLabel);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.formatComboBox);
this.Controls.Add(this.listViewCustom1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.ForeColor = System.Drawing.Color.White;
this.Text = "GTXTextureImporter";
((System.ComponentModel.ISupportInitialize)(this.SwizzleNum)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MipmapNum)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.NumericUpDown SwizzleNum;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox tileModeCB;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox ImgDimComb;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown MipmapNum;
private System.Windows.Forms.Label WidthLabel;
private System.Windows.Forms.Label HeightLabel;
private Switch_Toolbox.Library.Forms.PictureBoxCustom pictureBox1;
private System.Windows.Forms.ComboBox formatComboBox;
private Switch_Toolbox.Library.Forms.ListViewCustom listViewCustom1;
private System.Windows.Forms.ColumnHeader Name;
private System.Windows.Forms.ColumnHeader Format;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
}
}

View file

@ -1,160 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FirstPlugin
{
public partial class GTXTextureImporter : Form
{
public GTXTextureImporter()
{
InitializeComponent();
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TCS_R8_G8_B8_A8_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TCS_R8_G8_B8_A8_SRGB);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TCS_R10_G10_B10_A2_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TCS_R5_G6_B5_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TC_R5_G5_B5_A1_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TC_R4_G4_B4_A4_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TC_R8_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.TC_R8_G8_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC1_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC1_SRGB);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC2_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC2_SRGB);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC3_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC3_SRGB);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC4_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC4_SNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC5_UNORM);
formatComboBox.Items.Add(GTX.GX2SurfaceFormat.T_BC5_SNORM);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_DEFAULT);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_LINEAR_ALIGNED);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_1D_TILED_THIN1);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_1D_TILED_THICK);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2D_TILED_THIN1);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2D_TILED_THIN2);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2D_TILED_THIN4);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2D_TILED_THICK);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2B_TILED_THIN1);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2B_TILED_THIN2);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2B_TILED_THIN4);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_2B_TILED_THICK);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_3D_TILED_THIN1);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_3D_TILED_THICK);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_3B_TILED_THIN1);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_3B_TILED_THICK);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_LINEAR_SPECIAL);
tileModeCB.Items.Add(GTX.GX2TileMode.MODE_DEFAULT_FIX2197);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_1D);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_1D_ARRAY);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_2D);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_2D_ARRAY);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_2D_MSAA);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_2D_MSAA_ARRAY);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_3D);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_CUBE);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_FIRST);
ImgDimComb.Items.Add(GTX.GX2SurfaceDimension.DIM_LAST);
ImgDimComb.SelectedItem = GTX.GX2SurfaceDimension.DIM_2D;
tileModeCB.SelectedItem = GTX.GX2TileMode.MODE_2D_TILED_THIN1;
formatComboBox.SelectedItem = GTX.GX2SurfaceFormat.T_BC1_SRGB;
}
GTXImporterSettings SelectedTexSettings;
List<GTXImporterSettings> settings = new List<GTXImporterSettings>();
public void LoadSettings(List<GTXImporterSettings> s)
{
settings = s;
foreach (var setting in settings)
{
listViewCustom1.Items.Add(setting.TexName).SubItems.Add(setting.Format.ToString());
}
listViewCustom1.Items[0].Selected = true;
listViewCustom1.Select();
}
public void LoadSetting(GTXImporterSettings setting)
{
settings = new List<GTXImporterSettings>();
settings.Add(setting);
listViewCustom1.Items.Add(setting.TexName).SubItems.Add(setting.Format.ToString());
listViewCustom1.Items[0].Selected = true;
listViewCustom1.Select();
}
private Thread Thread;
public void SetupSettings()
{
if (SelectedTexSettings.Format == GTX.GX2SurfaceFormat.INVALID)
return;
if (Thread != null && Thread.IsAlive)
Thread.Abort();
if (formatComboBox.SelectedItem is GTX.GX2SurfaceFormat)
{
SelectedTexSettings.Format = (GTX.GX2SurfaceFormat)formatComboBox.SelectedItem;
listViewCustom1.SelectedItems[0].SubItems[1].Text = SelectedTexSettings.Format.ToString();
}
HeightLabel.Text = $"Height: {SelectedTexSettings.TexHeight}";
WidthLabel.Text = $"Width: {SelectedTexSettings.TexWidth}";
Bitmap bitmap = Switch_Toolbox.Library.Imaging.GetLoadingImage();
Thread = new Thread((ThreadStart)(() =>
{
pictureBox1.Image = bitmap;
SelectedTexSettings.Compress();
bitmap = FTEX.DecodeBlock(SelectedTexSettings.DataBlockOutput[0], SelectedTexSettings.
TexWidth, SelectedTexSettings.TexHeight, (Syroot.NintenTools.Bfres.GX2.GX2SurfaceFormat)SelectedTexSettings.Format);
pictureBox1.Image = bitmap;
}));
Thread.Start();
}
private void tileModeCB_SelectedIndexChanged(object sender, EventArgs e)
{
if (tileModeCB.SelectedIndex > -1 && SelectedTexSettings != null)
SelectedTexSettings.tileMode = (uint)tileModeCB.SelectedItem;
}
private void formatComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (formatComboBox.SelectedIndex > -1 && SelectedTexSettings != null)
{
SetupSettings();
}
}
private void listViewCustom1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listViewCustom1.SelectedItems.Count > 0)
{
SelectedTexSettings = settings[listViewCustom1.SelectedIndices[0]];
formatComboBox.SelectedItem = SelectedTexSettings.Format;
SetupSettings();
MipmapNum.Maximum = SelectedTexSettings.GetTotalMipCount();
MipmapNum.Value = SelectedTexSettings.MipCount;
}
}
}
}

View file

@ -1,328 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAADAFBMVEXMzMzNzc3Ozs7Pz8/Q0NDR0dHS
0tLT09PU1NTV1dXW1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh4eHi4uLj4+Pk5OTl5eXm
5ubn5+fo6Ojp6enq6urr6+vs7Ozt7e3u7u7v7+/w8PDx8fHy8vLz8/P09PT19fX29vb39/f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class NuTexEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NuTexEditor));
this.panel1 = new System.Windows.Forms.Panel();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.pictureBoxCustom1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
this.panel3 = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.arrayLevelCounterLabel = new System.Windows.Forms.Label();
this.btnRightArray = new System.Windows.Forms.Button();
this.btnLeftArray = new System.Windows.Forms.Button();
this.imageBGComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.texSizeMipsLabel = new System.Windows.Forms.Label();
this.mipLevelCounterLabel = new System.Windows.Forms.Label();
this.BtnMipsRight = new System.Windows.Forms.Button();
this.BtmMipsLeft = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.replaceSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSurfaceLevelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).BeginInit();
this.panel3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel1.Controls.Add(this.propertyGrid1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(593, 296);
this.panel1.TabIndex = 1;
//
// propertyGrid1
//
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.propertyGrid1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.CategoryForeColor = System.Drawing.Color.WhiteSmoke;
this.propertyGrid1.CategorySplitterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.CommandsActiveLinkColor = System.Drawing.Color.Red;
this.propertyGrid1.CommandsBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
this.propertyGrid1.CommandsForeColor = System.Drawing.Color.White;
this.propertyGrid1.DisabledItemForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.propertyGrid1.HelpBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.HelpBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(45)))));
this.propertyGrid1.HelpForeColor = System.Drawing.Color.White;
this.propertyGrid1.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.SelectedItemWithFocusForeColor = System.Drawing.Color.Silver;
this.propertyGrid1.Size = new System.Drawing.Size(593, 299);
this.propertyGrid1.TabIndex = 2;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.ViewBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
this.propertyGrid1.ViewBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.propertyGrid1.ViewForeColor = System.Drawing.Color.White;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// splitter1
//
this.splitter1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.splitter1.Dock = System.Windows.Forms.DockStyle.Top;
this.splitter1.Location = new System.Drawing.Point(0, 296);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(593, 3);
this.splitter1.TabIndex = 2;
this.splitter1.TabStop = false;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.panel2.Controls.Add(this.panel4);
this.panel2.Controls.Add(this.panel3);
this.panel2.Controls.Add(this.button1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 299);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(593, 297);
this.panel2.TabIndex = 3;
//
// panel4
//
this.panel4.Controls.Add(this.pictureBoxCustom1);
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(0, 80);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(593, 217);
this.panel4.TabIndex = 4;
//
// pictureBoxCustom1
//
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxCustom1.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
this.pictureBoxCustom1.Size = new System.Drawing.Size(593, 217);
this.pictureBoxCustom1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBoxCustom1.TabIndex = 0;
this.pictureBoxCustom1.TabStop = false;
//
// panel3
//
this.panel3.Controls.Add(this.label5);
this.panel3.Controls.Add(this.arrayLevelCounterLabel);
this.panel3.Controls.Add(this.btnRightArray);
this.panel3.Controls.Add(this.btnLeftArray);
this.panel3.Controls.Add(this.imageBGComboBox);
this.panel3.Controls.Add(this.label1);
this.panel3.Controls.Add(this.texSizeMipsLabel);
this.panel3.Controls.Add(this.mipLevelCounterLabel);
this.panel3.Controls.Add(this.BtnMipsRight);
this.panel3.Controls.Add(this.BtmMipsLeft);
this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel3.Location = new System.Drawing.Point(0, 25);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(593, 55);
this.panel3.TabIndex = 2;
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(342, 30);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Array Counter:";
//
// arrayLevelCounterLabel
//
this.arrayLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.arrayLevelCounterLabel.AutoSize = true;
this.arrayLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.arrayLevelCounterLabel.Location = new System.Drawing.Point(415, 30);
this.arrayLevelCounterLabel.Name = "arrayLevelCounterLabel";
this.arrayLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.arrayLevelCounterLabel.TabIndex = 8;
this.arrayLevelCounterLabel.Text = "00 / 00";
//
// btnRightArray
//
this.btnRightArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnRightArray.Location = new System.Drawing.Point(533, 26);
this.btnRightArray.Name = "btnRightArray";
this.btnRightArray.Size = new System.Drawing.Size(57, 21);
this.btnRightArray.TabIndex = 7;
this.btnRightArray.Text = ">";
this.btnRightArray.UseVisualStyleBackColor = true;
this.btnRightArray.Click += new System.EventHandler(this.btnRightArray_Click);
//
// btnLeftArray
//
this.btnLeftArray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnLeftArray.Enabled = false;
this.btnLeftArray.Location = new System.Drawing.Point(470, 26);
this.btnLeftArray.Name = "btnLeftArray";
this.btnLeftArray.Size = new System.Drawing.Size(57, 21);
this.btnLeftArray.TabIndex = 6;
this.btnLeftArray.Text = "<";
this.btnLeftArray.UseVisualStyleBackColor = true;
this.btnLeftArray.Click += new System.EventHandler(this.btnLeftArray_Click);
//
// imageBGComboBox
//
this.imageBGComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imageBGComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.imageBGComboBox.FormattingEnabled = true;
this.imageBGComboBox.Location = new System.Drawing.Point(215, 7);
this.imageBGComboBox.Name = "imageBGComboBox";
this.imageBGComboBox.Size = new System.Drawing.Size(121, 21);
this.imageBGComboBox.TabIndex = 5;
this.imageBGComboBox.SelectedIndexChanged += new System.EventHandler(this.imageBGComboBox_SelectedIndexChanged);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(342, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 4;
this.label1.Text = "Mip Counter:";
//
// texSizeMipsLabel
//
this.texSizeMipsLabel.AutoSize = true;
this.texSizeMipsLabel.ForeColor = System.Drawing.Color.White;
this.texSizeMipsLabel.Location = new System.Drawing.Point(127, 34);
this.texSizeMipsLabel.Name = "texSizeMipsLabel";
this.texSizeMipsLabel.Size = new System.Drawing.Size(42, 13);
this.texSizeMipsLabel.TabIndex = 3;
this.texSizeMipsLabel.Text = "00 / 00";
//
// mipLevelCounterLabel
//
this.mipLevelCounterLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.mipLevelCounterLabel.AutoSize = true;
this.mipLevelCounterLabel.ForeColor = System.Drawing.Color.White;
this.mipLevelCounterLabel.Location = new System.Drawing.Point(415, 7);
this.mipLevelCounterLabel.Name = "mipLevelCounterLabel";
this.mipLevelCounterLabel.Size = new System.Drawing.Size(42, 13);
this.mipLevelCounterLabel.TabIndex = 2;
this.mipLevelCounterLabel.Text = "00 / 00";
//
// BtnMipsRight
//
this.BtnMipsRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnMipsRight.Location = new System.Drawing.Point(533, 3);
this.BtnMipsRight.Name = "BtnMipsRight";
this.BtnMipsRight.Size = new System.Drawing.Size(57, 21);
this.BtnMipsRight.TabIndex = 1;
this.BtnMipsRight.Text = ">";
this.BtnMipsRight.UseVisualStyleBackColor = true;
this.BtnMipsRight.Click += new System.EventHandler(this.BtnMipsRight_Click);
//
// BtmMipsLeft
//
this.BtmMipsLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtmMipsLeft.Enabled = false;
this.BtmMipsLeft.Location = new System.Drawing.Point(470, 3);
this.BtmMipsLeft.Name = "BtmMipsLeft";
this.BtmMipsLeft.Size = new System.Drawing.Size(57, 21);
this.BtmMipsLeft.TabIndex = 0;
this.BtmMipsLeft.Text = "<";
this.BtmMipsLeft.UseVisualStyleBackColor = true;
this.BtmMipsLeft.Click += new System.EventHandler(this.BtmMipsLeft_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.button1.Dock = System.Windows.Forms.DockStyle.Top;
this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(0, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(593, 25);
this.button1.TabIndex = 1;
this.button1.Text = "Hide";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.replaceSurfaceLevelToolStripMenuItem,
this.exportSurfaceLevelToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(188, 48);
//
// replaceSurfaceLevelToolStripMenuItem
//
this.replaceSurfaceLevelToolStripMenuItem.Name = "replaceSurfaceLevelToolStripMenuItem";
this.replaceSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.replaceSurfaceLevelToolStripMenuItem.Text = "Replace Surface Level";
//
// exportSurfaceLevelToolStripMenuItem
//
this.exportSurfaceLevelToolStripMenuItem.Name = "exportSurfaceLevelToolStripMenuItem";
this.exportSurfaceLevelToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
this.exportSurfaceLevelToolStripMenuItem.Text = "Export Surface Level";
//
// NuTexEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panel2);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.panel1);
this.Name = "NuTexEditor";
this.Size = new System.Drawing.Size(593, 596);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCustom1)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panel2;
private Switch_Toolbox.Library.Forms.PictureBoxCustom pictureBoxCustom1;
private System.Windows.Forms.PropertyGrid propertyGrid1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label mipLevelCounterLabel;
private System.Windows.Forms.Button BtnMipsRight;
private System.Windows.Forms.Button BtmMipsLeft;
private System.Windows.Forms.Label texSizeMipsLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox imageBGComboBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label arrayLevelCounterLabel;
private System.Windows.Forms.Button btnRightArray;
private System.Windows.Forms.Button btnLeftArray;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem replaceSurfaceLevelToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSurfaceLevelToolStripMenuItem;
}
}

View file

@ -1,208 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Syroot.NintenTools.NSW.Bntx;
using Syroot.NintenTools.NSW.Bntx.GFX;
using Switch_Toolbox.Library;
namespace FirstPlugin
{
public partial class NuTexEditor : UserControl
{
private Thread Thread;
public NuTexEditor()
{
InitializeComponent();
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
imageBGComboBox.Items.Add(type);
imageBGComboBox.SelectedItem = Runtime.pictureBoxStyle;
UpdateBackgroundImage();
}
NUTEXB textureData;
int CurMipDisplayLevel = 0;
int CurArrayDisplayLevel = 0;
class PropGridData
{
public string Name { get; set; }
public string Format { get; set; }
public uint Width { get; set; }
public uint Height { get; set; }
public uint MipCount { get; set; }
public uint ArrayCount { get; set; }
}
public void LoadProperty(NUTEXB tex)
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
LoadImage();
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
textureData = tex;
UpdateMipDisplay();
PropGridData prop = new PropGridData();
prop.Name = textureData.Text;
prop.Width = textureData.Width;
prop.Height = textureData.Height;
if (textureData.surfaces.Count > 0)
{
prop.MipCount = (uint)textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count;
prop.ArrayCount = (uint)textureData.surfaces.Count;
}
prop.Height = textureData.Height;
prop.Format = ((NUTEXB.NUTEXImageFormat)textureData.Format).ToString();
propertyGrid1.PropertySort = PropertySort.Categorized;
propertyGrid1.SelectedObject = prop;
}
private void LoadImage()
{
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
pictureBoxCustom1.Image = textureData.DisplayTexture(CurArrayDisplayLevel, CurMipDisplayLevel);
}));
Thread.Start();
GC.Collect();
}
private void UpdateMipDisplay()
{
LoadImage();
int MipCount = 1;
if (textureData.surfaces.Count <= 0)
return;
else
MipCount = textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count;
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count - 1}";
arrayLevelCounterLabel.Text = $"{CurArrayDisplayLevel} / {textureData.surfaces.Count - 1}";
if (CurMipDisplayLevel != MipCount - 1)
BtnMipsRight.Enabled = true;
else
BtnMipsRight.Enabled = false;
if (CurMipDisplayLevel != 0)
BtmMipsLeft.Enabled = true;
else
BtmMipsLeft.Enabled = false;
if (CurArrayDisplayLevel != textureData.surfaces.Count - 1)
btnRightArray.Enabled = true;
else
btnRightArray.Enabled = false;
if (CurArrayDisplayLevel != 0)
btnLeftArray.Enabled = true;
else
btnLeftArray.Enabled = false;
}
bool IsHidden = false;
private void button1_Click(object sender, EventArgs e)
{
if (IsHidden)
{
panel1.Visible = true;
IsHidden = false;
button1.Text = "Hide";
}
else
{
panel1.Visible = false;
IsHidden = true;
button1.Text = "Show";
}
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
if (propertyGrid1.SelectedObject != null)
{
Texture tex = (Texture)propertyGrid1.SelectedObject;
textureData.Text = tex.Name;
}
}
private void BtmMipsLeft_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != 0)
CurMipDisplayLevel -= 1;
UpdateMipDisplay();
}
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.surfaces[CurArrayDisplayLevel].mipmaps.Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();
}
private void btnLeftArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != 0)
CurArrayDisplayLevel -= 1;
UpdateMipDisplay();
}
private void btnRightArray_Click(object sender, EventArgs e)
{
if (CurArrayDisplayLevel != textureData.surfaces.Count - 1)
CurArrayDisplayLevel += 1;
UpdateMipDisplay();
}
private void UpdateBackgroundImage()
{
switch (Runtime.pictureBoxStyle)
{
case Runtime.PictureBoxBG.Black:
pictureBoxCustom1.BackColor = Color.Black;
pictureBoxCustom1.BackgroundImage = null;
break;
case Runtime.PictureBoxBG.Checkerboard:
pictureBoxCustom1.BackColor = Color.Transparent;
pictureBoxCustom1.BackgroundImage = pictureBoxCustom1.GetCheckerBackground();
break;
}
}
private void imageBGComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.pictureBoxStyle = (Runtime.PictureBoxBG)imageBGComboBox.SelectedItem;
UpdateBackgroundImage();
}
private void btnEdit_Click(object sender, EventArgs e)
{
Button btnSender = (Button)sender;
Point ptLowerLeft = new Point(0, btnSender.Height);
ptLowerLeft = btnSender.PointToScreen(ptLowerLeft);
contextMenuStrip1.Show(ptLowerLeft);
}
}
}

View file

@ -1,331 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAADAFBMVEXMzMzNzc3Ozs7Pz8/Q0NDR0dHS
0tLT09PU1NT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YIaBiu4xxnNGq/GayHAJq139oVZ/QQ
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -34,7 +34,9 @@ namespace FirstPlugin
public uint SampleCount = 1;
public uint Pitch = 32;
public uint[] Regs;
public SurfaceFormat Format;
public TEX_FORMAT Format;
public TEX_FORMAT_TYPE FormatType;
public SurfaceDim SurfaceDim = SurfaceDim.Dim2D;
public TileMode TileMode = TileMode.Default;
public Dim Dim = Dim.Dim2D;
@ -55,78 +57,6 @@ namespace FirstPlugin
public bool GenerateMipmaps = false; //If bitmap and count more that 1 then geenrate
public float alphaRef = 0.5f;
private SurfaceFormat LoadDDSFormat(uint fourCC, DDS dds = null, bool IsSRGB = false)
{
bool IsDX10 = false;
switch (fourCC)
{
case DDS.FOURCC_DXT1:
if (IsSRGB)
return SurfaceFormat.BC1_SRGB;
else
return SurfaceFormat.BC1_UNORM;
case DDS.FOURCC_DXT3:
if (IsSRGB)
return SurfaceFormat.BC2_SRGB;
else
return SurfaceFormat.BC2_UNORM;
case DDS.FOURCC_DXT5:
if (IsSRGB)
return SurfaceFormat.BC3_SRGB;
else
return SurfaceFormat.BC3_UNORM;
case DDS.FOURCC_BC4U:
return SurfaceFormat.BC4_UNORM;
case DDS.FOURCC_BC4S:
return SurfaceFormat.BC4_SNORM;
case DDS.FOURCC_ATI1:
return SurfaceFormat.BC4_UNORM;
case DDS.FOURCC_ATI2:
return SurfaceFormat.BC5_UNORM;
case DDS.FOURCC_BC5U:
return SurfaceFormat.BC5_UNORM;
case DDS.FOURCC_BC5S:
return SurfaceFormat.BC5_SNORM;
case DDS.FOURCC_DX10:
IsDX10 = true;
break;
default:
return SurfaceFormat.R8_G8_B8_A8_SRGB;
}
Console.WriteLine(IsDX10);
if (IsDX10)
{
Console.WriteLine(dds.DX10header.DXGI_Format);
switch (dds.DX10header.DXGI_Format)
{
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_UNORM:
return SurfaceFormat.BC4_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_SNORM:
return SurfaceFormat.BC4_SNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC4_TYPELESS:
return SurfaceFormat.BC4_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_UNORM:
return SurfaceFormat.BC5_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_SNORM:
return SurfaceFormat.BC5_SNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC5_TYPELESS:
return SurfaceFormat.BC5_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC6H_SF16:
return SurfaceFormat.BC6_FLOAT;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC6H_UF16:
return SurfaceFormat.BC6_UFLOAT;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM:
return SurfaceFormat.BC7_UNORM;
case DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM_SRGB:
return SurfaceFormat.BC7_SRGB;
default:
throw new Exception($"Format {dds.DX10header.DXGI_Format} not supported!");
}
}
throw new Exception($"This shouldn't happen :(");
}
public void LoadDDS(string FileName, BntxFile bntxFile, byte[] FileData = null, TextureData tree = null)
{
TexName = Path.GetFileNameWithoutExtension(FileName);
@ -148,8 +78,9 @@ namespace FirstPlugin
DataBlockOutput.Add(dds.bdata);
Format = LoadDDSFormat(dds.header.ddspf.fourCC, dds, IsSRGB);
var formats = dds.GetFormat();
Format = formats.Item1;
FormatType = formats.Item2;
Texture tex = FromBitMap(DataBlockOutput[0], this);
@ -168,11 +99,13 @@ namespace FirstPlugin
TexName = Path.GetFileNameWithoutExtension(FileName);
bntx = bntxFile;
Format = SurfaceFormat.BC1_SRGB;
Format = TEX_FORMAT.BC1;
FormatType = TEX_FORMAT_TYPE.SRGB;
GenerateMipmaps = true;
Bitmap Image = Paloma.TargaImage.LoadTargaImage(FileName);
Image = TextureData.SwapBlueRedChannels(Image);
Image = STGenericTexture.SwapBlueRedChannels(Image);
TexWidth = (uint)Image.Width;
TexHeight = (uint)Image.Height;
@ -192,11 +125,13 @@ namespace FirstPlugin
TexName = Path.GetFileNameWithoutExtension(FileName);
bntx = bntxFile;
Format = SurfaceFormat.BC1_SRGB;
Format = TEX_FORMAT.BC1;
FormatType = TEX_FORMAT_TYPE.SRGB;
GenerateMipmaps = true;
Bitmap Image = new Bitmap(FileName);
Image = TextureData.SwapBlueRedChannels(Image);
Image = STGenericTexture.SwapBlueRedChannels(Image);
TexWidth = (uint)Image.Width;
TexHeight = (uint)Image.Height;
@ -240,14 +175,14 @@ namespace FirstPlugin
Bitmap Image = BitmapExtension.GetBitmap(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight);
List<byte[]> mipmaps = new List<byte[]>();
mipmaps.Add(TextureData.CompressBlock(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight, Format, alphaRef));
mipmaps.Add(STGenericTexture.CompressBlock(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight, Format, FormatType, alphaRef));
//while (Image.Width / 2 > 0 && Image.Height / 2 > 0)
// for (int mipLevel = 0; mipLevel < MipCount; mipLevel++)
for (int mipLevel = 0; mipLevel < MipCount; mipLevel++)
{
Image = BitmapExtension.Resize(Image, Image.Width / 2, Image.Height / 2);
mipmaps.Add(TextureData.CompressBlock(BitmapExtension.ImageToByte(Image), Image.Width, Image.Height, Format, alphaRef));
mipmaps.Add(STGenericTexture.CompressBlock(BitmapExtension.ImageToByte(Image), Image.Width, Image.Height, Format, FormatType, alphaRef));
}
Image.Dispose();
@ -258,7 +193,7 @@ namespace FirstPlugin
DataBlockOutput.Clear();
foreach (var surface in DecompressedData)
{
DataBlockOutput.Add(TextureData.CompressBlock(surface, (int)TexWidth, (int)TexHeight, Format, alphaRef));
DataBlockOutput.Add(STGenericTexture.CompressBlock(surface, (int)TexWidth, (int)TexHeight, Format, FormatType, alphaRef));
}
}
public static uint DIV_ROUND_UP(uint value1, uint value2)
@ -270,7 +205,10 @@ namespace FirstPlugin
Texture tex = new Texture();
tex.Height = (uint)settings.TexHeight;
tex.Width = (uint)settings.TexWidth;
tex.Format = Format;
var formats = TextureData.GetSurfaceFormat(settings.Format, settings.FormatType);
tex.Format = formats.Item1;
tex.FormatType = formats.Item2;
tex.Name = settings.TexName;
tex.Path = "";
tex.TextureData = new List<List<byte[]>>();
@ -278,11 +216,11 @@ namespace FirstPlugin
if (settings.MipCount == 0)
settings.MipCount = 1;
ChannelType[] channels = TextureData.SetChannelsByFormat(settings.Format);
tex.ChannelRed = channels[0];
tex.ChannelGreen = channels[1];
tex.ChannelBlue = channels[2];
tex.ChannelAlpha = channels[3];
STChannelType[] channels = STGenericTexture.SetChannelsByFormat(settings.Format);
tex.ChannelRed = (ChannelType)channels[0];
tex.ChannelGreen = (ChannelType)channels[1];
tex.ChannelBlue = (ChannelType)channels[2];
tex.ChannelAlpha = (ChannelType)channels[3];
tex.sparseBinding = settings.sparseBinding;
tex.sparseResidency = settings.sparseResidency;
tex.AccessFlags = settings.AccessFlags;

View file

@ -73,7 +73,7 @@ namespace FirstPlugin
Thread = new Thread((ThreadStart)(() =>
{
pictureBoxCustom1.Image = Imaging.GetLoadingImage();
pictureBoxCustom1.Image = textureData.DisplayImage(CurMipDisplayLevel, CurArrayDisplayLevel);
pictureBoxCustom1.Image = textureData.GetBitmap(CurMipDisplayLevel, CurArrayDisplayLevel);
}));
Thread.Start();
@ -84,13 +84,13 @@ namespace FirstPlugin
LoadImage();
int MipCount = 1;
if (textureData.mipmaps.Count <= 0)
if (textureData.Surfaces.Count <= 0)
return;
else
MipCount = textureData.mipmaps.Count;
MipCount = textureData.Surfaces.Count;
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.mipmaps.Count - 1}";
mipLevelCounterLabel.Text = $"{CurMipDisplayLevel} / {textureData.Surfaces.Count - 1}";
if (CurMipDisplayLevel != MipCount - 1)
BtnMipsRight.Enabled = true;
@ -139,7 +139,7 @@ namespace FirstPlugin
private void BtnMipsRight_Click(object sender, EventArgs e)
{
if (CurMipDisplayLevel != textureData.mipmaps.Count - 1)
if (CurMipDisplayLevel != textureData.Surfaces.Count - 1)
CurMipDisplayLevel += 1;
UpdateMipDisplay();

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -10,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FirstPlugin</RootNamespace>
<AssemblyName>FirstPlugin.Plg</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
@ -52,10 +51,6 @@
<HintPath>..\Switch_Toolbox\Lib\ByamlExt.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Costura, Version=3.1.4.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\Switch_Toolbox\Lib\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="EditorCoreCommon">
<HintPath>..\Switch_Toolbox\Lib\EditorCoreCommon.dll</HintPath>
<Private>False</Private>
@ -113,7 +108,6 @@
</Reference>
<Reference Include="Syroot.NintenTools.NSW.Bntx">
<HintPath>..\Switch_Toolbox\Lib\Syroot.NintenTools.NSW.Bntx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -277,43 +271,18 @@
<DependentUpon>BfresShapeEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\FormLoader.cs" />
<Compile Include="GUI\TextureUI\GTXEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\TextureUI\GTXEditor.Designer.cs">
<DependentUpon>GTXEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TextureUI\GTXImporterSettings.cs" />
<Compile Include="GUI\TextureUI\GTXTextureImporter.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\TextureUI\GTXTextureImporter.Designer.cs">
<DependentUpon>GTXTextureImporter.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TextureUI\XTXEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\TextureUI\XTXEditor.Designer.cs">
<DependentUpon>XTXEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TextureUI\NuTexEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\TextureUI\NuTexEditor.Designer.cs">
<DependentUpon>NuTexEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TexturePatternEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\TexturePatternEditor.Designer.cs">
<DependentUpon>TexturePatternEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TextureUI\FTEXEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\TextureUI\FTEXEditor.Designer.cs">
<DependentUpon>FTEXEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\TextureUI\BNTXEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@ -447,24 +416,12 @@
<EmbeddedResource Include="GUI\BFRES\BfresShapeEditor.resx">
<DependentUpon>BfresShapeEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\GTXEditor.resx">
<DependentUpon>GTXEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\GTXTextureImporter.resx">
<DependentUpon>GTXTextureImporter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\XTXEditor.resx">
<DependentUpon>XTXEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\NuTexEditor.resx">
<DependentUpon>NuTexEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TexturePatternEditor.resx">
<DependentUpon>TexturePatternEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\FTEXEditor.resx">
<DependentUpon>FTEXEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\TextureUI\BNTXEditor.resx">
<DependentUpon>BNTXEditor.cs</DependentUpon>
</EmbeddedResource>
@ -576,8 +533,5 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.2.9\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.9\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" />
</Project>

View file

@ -16,4 +16,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="3.1.4" targetFramework="net461" />
<package id="CsvHelper" version="8.0.0-beta01" targetFramework="net462" />
<package id="DockPanelSuite" version="3.0.4" targetFramework="net461" />
<package id="Fody" version="3.2.9" targetFramework="net461" developmentDependency="true" />

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

Binary file not shown.

View file

@ -44,6 +44,9 @@ namespace Switch_Toolbox
case "OpenStartupWindow":
bool.TryParse(node.InnerText, out Runtime.OpenStartupWindow);
break;
case "DisableUpdatePrompt":
bool.TryParse(node.InnerText, out Runtime.DisableUpdatePrompt);
break;
case "DisableViewport":
bool.TryParse(node.InnerText, out Runtime.DisableViewport);
break;
@ -109,6 +112,7 @@ namespace Switch_Toolbox
parentNode.AppendChild(mainSettingsNode);
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "DisableViewport", Runtime.DisableViewport.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "DisableUpdatePrompt", Runtime.DisableUpdatePrompt.ToString()));
}
private static void AppendOCompressionFilelistSettings(XmlDocument doc, XmlNode parentNode)
{

View file

@ -1,25 +0,0 @@
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\vc141.pdb
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtexutil.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtexmipmaps.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxteximage.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtexdds.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtexconvert.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtexcompress.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\bc6hbc7.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\bc4bc5.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\bc.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\wrapper.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\.netframework,version=v4.6.assemblyattributes.obj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\.netframework,version=v4.6.assemblyattributes.asm
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\release\directxtex.ipdb
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\release\directxtex.iobj
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\release\directxtex.dll
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\cl.command.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\cl.read.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\cl.write.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\directxtex.write.1u.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\link.command.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\link.read.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\link.write.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\metagen.read.1.tlog
c:\users\nathan\documents\github\switch_toolbox\switch-toolbox - copy\switch_toolbox\lib\directxtex\release\directxtex.tlog\metagen.write.1.tlog

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -30,7 +30,8 @@
<ProjectGuid>{755AB64B-16B4-4C90-AA3B-BFF448E5A21E}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>DirectXTex</RootNamespace>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

Binary file not shown.

View file

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EditorCore.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="OdysseyEditor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
<userSettings>
<EditorCore.Properties.Settings>
<setting name="OnlyKnwonObjs" serializeAs="String">
<value>False</value>
</setting>
<setting name="CameraInertia" serializeAs="String">
<value>0.92</value>
</setting>
<setting name="ShowFps" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowTriCount" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowDbgInfo" serializeAs="String">
<value>False</value>
</setting>
<setting name="CameraMode" serializeAs="String">
<value>1</value>
</setting>
<setting name="ZoomSen" serializeAs="String">
<value>2</value>
</setting>
<setting name="RotSen" serializeAs="String">
<value>1</value>
</setting>
<setting name="DownloadDbLink" serializeAs="String">
<value>null</value>
</setting>
<setting name="CheckUpdates" serializeAs="String">
<value>True</value>
</setting>
<setting name="DownloadDb" serializeAs="String">
<value>True</value>
</setting>
<setting name="FirstStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="UpgradeSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="FarPlaneDistance" serializeAs="String">
<value>100000</value>
</setting>
<setting name="CustomModels" serializeAs="String">
<value>False</value>
</setting>
</EditorCore.Properties.Settings>
<OdysseyEditor.Properties.Settings>
<setting name="GamePath" serializeAs="String">
<value />
</setting>
<setting name="OnlyKnwonObjs" serializeAs="String">
<value>False</value>
</setting>
<setting name="CameraInertia" serializeAs="String">
<value>0.92</value>
</setting>
<setting name="ShowFps" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowTriCount" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowDbgInfo" serializeAs="String">
<value>False</value>
</setting>
<setting name="CameraMode" serializeAs="String">
<value>1</value>
</setting>
<setting name="ZoomSen" serializeAs="String">
<value>2</value>
</setting>
<setting name="RotSen" serializeAs="String">
<value>1</value>
</setting>
<setting name="DownloadDbLink" serializeAs="String">
<value>null</value>
</setting>
<setting name="CheckUpdates" serializeAs="String">
<value>True</value>
</setting>
<setting name="DownloadDb" serializeAs="String">
<value>True</value>
</setting>
<setting name="FirstStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="UpgradeSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="FarPlaneDistance" serializeAs="String">
<value>100000</value>
</setting>
</OdysseyEditor.Properties.Settings>
</userSettings>
</configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -2055,6 +2055,11 @@
Gets or sets the desired texture data buffer format.
</summary>
</member>
<member name="P:Syroot.NintenTools.NSW.Bntx.Texture.FormatType">
<summary>
Gets or sets the desired texture data buffer format type.
</summary>
</member>
<member name="P:Syroot.NintenTools.NSW.Bntx.Texture.Name">
<summary>
Gets or sets the name with which the instance can be referenced uniquely in <see cref="!:ResDict&lt;Texture&gt;"/>
@ -2132,10 +2137,5 @@
Gets or sets sample amount
</summary>
</member>
<member name="P:Syroot.NintenTools.NSW.Bntx.Texture.UserData">
<summary>
Gets or sets customly attached <see cref="P:Syroot.NintenTools.NSW.Bntx.Texture.UserData"/> instances.
</summary>
</member>
</members>
</doc>

Binary file not shown.

View file

@ -4,8 +4,8 @@ using System.ComponentModel;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using Switch_Toolbox.Library.Forms;
using WeifenLuo.WinFormsUI.Docking;
@ -32,20 +32,26 @@ namespace Switch_Toolbox
private static MainForm _instance;
public static MainForm Instance { get { return _instance == null ? _instance = new MainForm() : _instance; } }
bool AttachCommit = false;
bool DebugProgram = false;
public MainForm()
{
if (DebugProgram)
System.AppDomain.CurrentDomain.UnhandledException += ExceptionHandler;
InitializeComponent();
string commit = "";
if (AttachCommit)
commit = $"Commit: {Runtime.CommitInfo}";
Text = $"Switch Toolbox | Compile Date: {Runtime.CompileDate} Version: {Runtime.ProgramVersion} {commit}";
UpdateToolbar();
ShaderTools.executableDir = executableDir;
Config.StartupFromFile(MainForm.executableDir + "\\config.xml");
try
{
Config.StartupFromFile(executableDir + "\\config.xml");
}
catch (Exception ex)
{
MessageBox.Show($"Failed to load config file! {ex}");
}
GenericPluginLoader.LoadPlugin();
foreach (var plugin in GenericPluginLoader._Plugins)
@ -58,6 +64,12 @@ namespace Switch_Toolbox
Reload();
LoadPluginFileContextMenus();
}
private void ExceptionHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
MessageBox.Show(e.Message);
MessageBox.Show($"Runtime terminating: {args.IsTerminating}");
}
private List<IMenuExtension> menuExtentions = new List<IMenuExtension>();
private void LoadPluginContextMenus(Type[] types)
{
@ -83,6 +95,12 @@ namespace Switch_Toolbox
}
}
private void UpdateToolbar()
{
string commit = $"Commit: {Runtime.CommitInfo}";
Text = $"Switch Toolbox | Version: {Runtime.ProgramVersion} | {commit} | Compile Date: {Runtime.CompileDate}";
}
private void LoadPluginFileContextMenus()
{
foreach (IFileMenuExtension ext in FileMenuExtensions)
@ -118,6 +136,13 @@ namespace Switch_Toolbox
private void Form4_Load(object sender, EventArgs e)
{
VersionCheck version = new VersionCheck();
Runtime.ProgramVersion = version.ProgramVersion;
Runtime.CommitInfo = version.CommitInfo;
Runtime.CompileDate = version.CompileDate;
UpdateToolbar();
LoadObjectList();
LoadRecentList();
foreach (string item in RecentFiles)
@ -131,6 +156,12 @@ namespace Switch_Toolbox
fileRecent.ForeColor = Color.White;
recentToolStripMenuItem.DropDownItems.Add(fileRecent); //add the menu to "recent" menu
}
ThreadStart t = new ThreadStart(UpdateProgram.CheckLatest);
Thread thread = new Thread(t);
thread.Start();
Application.Idle += Application_Idle;
LibraryGUI.Instance.dockPanel = dockPanel1;
if (OpenTK.Graphics.GraphicsContext.CurrentContext != null)
@ -138,13 +169,47 @@ namespace Switch_Toolbox
OpenTKSharedResources.InitializeSharedResources();
}
if (Runtime.OpenStartupWindow)
if (Runtime.OpenStartupWindow && !UpdateProgram.CanUpdate)
{
Startup_Window window = new Startup_Window();
window.TopMost = true;
window.Show();
}
}
bool UpdatePromptShown = false;
private void Application_Idle(object sender, EventArgs e)
{
if (UpdateProgram.CanUpdate && !Runtime.DisableUpdatePrompt)
{
if (!UpdatePromptShown)
{
//Prompt once for the user to update the tool.
UpdatePromptShown = true;
DialogResult result;
using (DialogCenteringService centeringService = new DialogCenteringService(this)) // center message box
{
result = MessageBox.Show($"A new update is available {UpdateProgram.LatestRelease.TagName}!" +
$" Would you like to install it?", "Updater", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
}
if (result == DialogResult.Yes)
{
UpdateApplication();
}
}
}
}
private void UpdateApplication()
{
//Start updating while program is closed
Process proc = new Process();
proc.StartInfo.FileName = Path.Combine(executableDir, "Updater.exe");
proc.StartInfo.WorkingDirectory = executableDir;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.Arguments = "-d -i -b";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
proc.Start();
Application.Exit();
}
const int MRUnumber = 6;
private void SaveRecentFile(string path)
{
@ -234,89 +299,61 @@ namespace Switch_Toolbox
public void OpenFile(string FileName, byte[] data = null, bool Compressed = false,
CompressionType CompType = CompressionType.None)
{
Reload();
if (data == null)
data = File.ReadAllBytes(FileName);
if (File.Exists(FileName))
SaveRecentFile(FileName);
FileReader f = new FileReader(data);
uint Identifier = f.ReadUInt32();
f.Seek(0, SeekOrigin.Begin);
string Magic = f.ReadMagic(0, 4);
string Magic2 = f.ReadMagic(0, 2);
string Magic3 = f.ReadMagic((int)f.BaseStream.Length - 7, 3);
//Determine if the file is compressed or not
if (Magic == "Yaz0")
try
{
data = EveryFileExplorer.YAZ0.Decompress(data).ToArray();
OpenFile(FileName, data, true, CompressionType.Yaz0);
return;
}
if (Identifier == 0x28B52FFD || Identifier == 0xFD2FB528)
{
data = STLibraryCompression.ZSTD.Decompress(f.getSection(0, data.Length));
OpenFile(FileName, data, true, CompressionType.Zstb);
return;
}
if (Magic == "ZLIB")
{
data = FileReader.InflateZLIB(f.getSection(64, data.Length - 64));
OpenFile(FileName, data, true, CompressionType.Zlib);
return;
}
if (Path.GetExtension(FileName) == ".cmp" && CompType == CompressionType.None)
{
f.Position = 0;
int OuSize = f.ReadInt32();
int InSize = data.Length - 4;
data = STLibraryCompression.Type_LZ4F.Decompress(f.getSection(4, InSize));
OpenFile(FileName, data, true, CompressionType.Lz4f);
return;
}
Reload();
if (data == null)
data = File.ReadAllBytes(FileName);
f.Dispose();
f.Close();
if (File.Exists(FileName))
SaveRecentFile(FileName);
//Check magic first regardless of extension
foreach (IFileFormat format in SupportedFormats)
{
if (format.Magic == Magic || format.Magic == Magic3 || format.Magic == Magic2 || format.Magic.Reverse() == Magic2)
FileReader f = new FileReader(data);
uint Identifier = f.ReadUInt32();
f.Seek(0, SeekOrigin.Begin);
string Magic = f.ReadMagic(0, 4);
string Magic2 = f.ReadMagic(0, 2);
string Magic3 = f.ReadMagic((int)f.BaseStream.Length - 7, 3);
//Determine if the file is compressed or not
if (Magic == "Yaz0")
{
format.CompressionType = CompType;
format.FileIsCompressed = Compressed;
format.Data = data;
format.FileName = Path.GetFileName(FileName);
format.FilePath = FileName;
format.Load();
if (format is TreeNode)
{
ObjectList.Instance.treeView1.Nodes.Add((TreeNode)format);
}
if (format.CanSave)
{
saveAsToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
}
if (format.UseEditMenu)
editToolStripMenuItem.Enabled = true;
data = EveryFileExplorer.YAZ0.Decompress(data).ToArray();
OpenFile(FileName, data, true, CompressionType.Yaz0);
return;
}
}
//If magic fails, then check extensions
foreach (IFileFormat format in SupportedFormats)
{
foreach (string ext in format.Extension)
if (Identifier == 0x28B52FFD || Identifier == 0xFD2FB528)
{
if (ext.Remove(0, 1) == Path.GetExtension(FileName))
data = STLibraryCompression.ZSTD.Decompress(f.getSection(0, data.Length));
OpenFile(FileName, data, true, CompressionType.Zstb);
return;
}
if (Magic == "ZLIB")
{
data = FileReader.InflateZLIB(f.getSection(64, data.Length - 64));
OpenFile(FileName, data, true, CompressionType.Zlib);
return;
}
if (Path.GetExtension(FileName) == ".cmp" && CompType == CompressionType.None)
{
f.Position = 0;
int OuSize = f.ReadInt32();
int InSize = data.Length - 4;
data = STLibraryCompression.Type_LZ4F.Decompress(f.getSection(4, InSize));
OpenFile(FileName, data, true, CompressionType.Lz4f);
return;
}
f.Dispose();
f.Close();
//Check magic first regardless of extension
foreach (IFileFormat format in SupportedFormats)
{
if (format.Magic == Magic || format.Magic == Magic3 || format.Magic == Magic2 || format.Magic.Reverse() == Magic2)
{
format.CompressionType = CompType;
format.FileIsCompressed = Compressed;
@ -341,6 +378,41 @@ namespace Switch_Toolbox
return;
}
}
//If magic fails, then check extensions
foreach (IFileFormat format in SupportedFormats)
{
foreach (string ext in format.Extension)
{
if (ext.Remove(0, 1) == Path.GetExtension(FileName))
{
format.CompressionType = CompType;
format.FileIsCompressed = Compressed;
format.Data = data;
format.FileName = Path.GetFileName(FileName);
format.FilePath = FileName;
format.Load();
if (format is TreeNode)
{
ObjectList.Instance.treeView1.Nodes.Add((TreeNode)format);
}
if (format.CanSave)
{
saveAsToolStripMenuItem.Enabled = true;
saveToolStripMenuItem.Enabled = true;
}
if (format.UseEditMenu)
editToolStripMenuItem.Enabled = true;
return;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show($"Failed to open file! \n {ex}");
}
}
private void DisposeControls()
@ -485,8 +557,6 @@ namespace Switch_Toolbox
private void saveConfigToolStripMenuItem_Click(object sender, EventArgs e)
{
Config.Save();
// dockPanel1.SaveAsXml("DockStates/" + dockPanel1.Text + ".xml");
}
private void dockPanel1_DockChanged(object sender, EventArgs e)

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -9,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>Switch_Toolbox</RootNamespace>
<AssemblyName>Switch_Toolbox</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
@ -45,10 +44,6 @@
<HintPath>..\packages\AssimpNet.4.1.0\lib\net40\AssimpNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Costura, Version=3.1.4.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.1.4\lib\net46\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="CsvHelper, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.8.0.0-beta01\lib\net45\CsvHelper.dll</HintPath>
<Private>False</Private>
@ -77,6 +72,10 @@
<HintPath>..\Switch_FileFormatsMain\Externals\NAudio.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Octokit, Version=0.31.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Lib\Octokit.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\..\..\..\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Lib\OpenTK.dll</HintPath>
<Private>False</Private>
@ -167,6 +166,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Update.cs" />
<Compile Include="VersionCheck.cs" />
<EmbeddedResource Include="GUI\Credits.resx">
<DependentUpon>Credits.cs</DependentUpon>
@ -399,6 +399,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Projects\Recent\DUMMY.txt" />
<Content Include="Version.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\Logo.png" />
<Content Include="Tool.ico" />
</ItemGroup>
@ -409,10 +412,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.2.9\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.9\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\AssimpNet.4.1.0\build\AssimpNet.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\AssimpNet.4.1.0\build\AssimpNet.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" />
<Import Project="..\packages\AssimpNet.4.1.0\build\AssimpNet.targets" Condition="Exists('..\packages\AssimpNet.4.1.0\build\AssimpNet.targets')" />
</Project>

57
Switch_Toolbox/Update.cs Normal file
View file

@ -0,0 +1,57 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Octokit;
using System.IO;
using System.Diagnostics;
using System.Security.Cryptography;
using Switch_Toolbox.Library;
namespace Switch_Toolbox
{
public class UpdateProgram
{
static Release[] releases;
public static bool CanUpdate = false;
public static Release LatestRelease;
public static void CheckLatest()
{
try
{
var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool"));
GetReleases(client).Wait();
foreach (Release latest in releases)
{
Console.WriteLine(
"The latest release is tagged at {0} and is named {1} commit {2} date {3}",
latest.TagName,
latest.Name,
latest.TargetCommitish,
latest.Assets[0].UpdatedAt.ToString());
if (Runtime.CompileDate != latest.Assets[0].UpdatedAt.ToString())
{
CanUpdate = true;
LatestRelease = latest;
}
break;
}
}
catch (Exception ex)
{
Console.WriteLine($"Failed to get latest update\n{ex.ToString()}");
}
}
static async Task GetReleases(GitHubClient client)
{
List<Release> Releases = new List<Release>();
foreach (Release r in await client.Repository.Release.GetAll("KillzXGaming", "Switch-Toolbox"))
Releases.Add(r);
releases = Releases.ToArray();
}
}
}

View file

@ -1,3 +1,3 @@
Version:
Commit:
Build Date:
v0.8.5.1
12/6/2018 4:34:02 PM +00:00
master

View file

@ -9,22 +9,28 @@ namespace Switch_Toolbox
{
public class VersionCheck
{
public void ReadVersionInfo()
public string ProgramVersion;
public string CompileDate;
public string CommitInfo;
public VersionCheck()
{
string path = MainForm.executableDir + "Version.txt";
string path = System.IO.Path.Combine(MainForm.executableDir, "Version.txt");
using (StreamReader reader = new StreamReader(path))
{
string Version = reader.ReadLine();
ProgramVersion = reader.ReadLine();
CompileDate = reader.ReadLine();
CommitInfo = reader.ReadLine();
}
}
public void WriteVersionInfo()
public void SaveVersionInfo()
{
string path = MainForm.executableDir + "Version.txt";
using (StreamWriter writer = new StreamWriter(path))
{
writer.Write($"Version: {Runtime.ProgramVersion}");
writer.Write($"Commit: {Runtime.CommitInfo}");
writer.Write($"Build Date: {Runtime.CompileDate}");
writer.WriteLine($"{ProgramVersion}");
writer.WriteLine($"{CompileDate}");
writer.WriteLine($"{CommitInfo}");
}
}
}

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AssimpNet" version="4.1.0" targetFramework="net462" />
<package id="Costura.Fody" version="3.1.4" targetFramework="net461" />
<package id="CsvHelper" version="8.0.0-beta01" targetFramework="net462" />
<package id="DockPanelSuite" version="3.0.4" targetFramework="net461" />
<package id="DockPanelSuite.ThemeVS2015" version="3.0.4" targetFramework="net461" />

View file

@ -1,58 +0,0 @@
using DiscordRPC;
using DiscordRPC.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Switch_Toolbox_Library
{
/**
* Code from the DiscordRpc examples:
* https://github.com/Lachee/discord-rpc-csharp#usage
*/
public class DiscordPresence
{
public DiscordRpcClient client;
public String ClientID = "517901453935771668";
public void Initialize()
{
client = new DiscordRpcClient(ClientID);
client.Logger = new ConsoleLogger() { Level = LogLevel.Warning };
client.OnReady += (sender, e) =>
{
Console.WriteLine("Received Ready from user {0}", e.User.Username);
};
client.OnPresenceUpdate += (sender, e) =>
{
Console.WriteLine("Received Update! {0}", e.Presence);
};
client.Initialize();
var timer = new System.Timers.Timer(150);
timer.Elapsed += (sender, args) => { UpdatePresence(); };
timer.Start();
}
void UpdatePresence()
{
client.SetPresence(new RichPresence()
{
Details = "Working on a mod",
State ="",
Assets = new Assets()
{
LargeImageKey = "toolbox-logo",
LargeImageText = "Switch Toolbox"
}
});
}
}
}

View file

@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CsvHelper;
using System.IO;
using Switch_Toolbox.Library.Rendering;
namespace Switch_Toolbox.Library
{
}

View file

@ -405,6 +405,98 @@ namespace Switch_Toolbox.Library
return array;
}
}
public static DXGI_FORMAT GetDXGI_Format(TEX_FORMAT Format, TEX_FORMAT_TYPE type)
{
DXGI_FORMAT format = DXGI_FORMAT.DXGI_FORMAT_UNKNOWN;
string formatSTR = GetFormatString(Format);
string typeSTR = GetFormatTypeString(type, Format);
Enum.TryParse(formatSTR + typeSTR, out format);
return format;
}
public void SetFlags(TEX_FORMAT Format, TEX_FORMAT_TYPE type)
{
SetFlags(GetDXGI_Format(Format, type));
}
//Get format without type
private static string GetFormatString(TEX_FORMAT Format)
{
switch (Format)
{
case TEX_FORMAT.BC1: return "DXGI_FORMAT_BC1_";
case TEX_FORMAT.BC2: return "DXGI_FORMAT_BC2_";
case TEX_FORMAT.BC3: return "DXGI_FORMAT_BC3_";
case TEX_FORMAT.BC4: return "DXGI_FORMAT_BC4_";
case TEX_FORMAT.BC5: return "DXGI_FORMAT_BC5_";
case TEX_FORMAT.BC6: return "DXGI_FORMAT_BC6_";
case TEX_FORMAT.BC7: return "DXGI_FORMAT_BC7_";
case TEX_FORMAT.A1_B5_G5_R5: return "DXGI_FORMAT_B5G5R5A1_";
case TEX_FORMAT.A8: return "DXGI_FORMAT_A8_";
case TEX_FORMAT.A8P8: return "DXGI_FORMAT_A8P8";
case TEX_FORMAT.AI44: return "DXGI_FORMAT_AI44";
case TEX_FORMAT.AYUV: return "DXGI_FORMAT_AYUV";
case TEX_FORMAT.B5_G6_R5: return "DXGI_FORMAT_B5G6R5_";
case TEX_FORMAT.D16: return "DXGI_FORMAT_D16_";
case TEX_FORMAT.D32: return "DXGI_FORMAT_D32_";
case TEX_FORMAT.D32_S8_X24: return "DXGI_FORMAT_D32_FLOAT_S8X24_";
case TEX_FORMAT.R1: return "DXGI_FORMAT_R1_";
case TEX_FORMAT.R16: return "DXGI_FORMAT_R16_";
case TEX_FORMAT.R16_G16: return "DXGI_FORMAT_R16G16_";
case TEX_FORMAT.R10_G10_B10_A2: return "DXGI_FORMAT_R10G10B10A2_";
case TEX_FORMAT.R11_G11_B10: return "DXGI_FORMAT_R11G11B10_";
case TEX_FORMAT.R16_G16_B16_A16: return "DXGI_FORMAT_R16G16B16A16_";
case TEX_FORMAT.R24_G8: return "DXGI_FORMAT_R24G8_";
case TEX_FORMAT.R24_X8: return "DXGI_FORMAT_R24_UNORM_X8_";
case TEX_FORMAT.R32: return "DXGI_FORMAT_R32_";
case TEX_FORMAT.R32_G32: return "DXGI_FORMAT_R32G32_";
case TEX_FORMAT.R32_G32_B32: return "DXGI_FORMAT_R32G32B32_";
case TEX_FORMAT.R32_G32_B32_A32: return "DXGI_FORMAT_R32G32B32A32_";
case TEX_FORMAT.R4_G4_B4_A4: return "DXGI_FORMAT_B4G4R4A4_";
case TEX_FORMAT.R5_G5_B5_A1: return "DXGI_FORMAT_B5G5R5A1_";
case TEX_FORMAT.R8: return "DXGI_FORMAT_R8_";
case TEX_FORMAT.R8G8: return "DXGI_FORMAT_R8G8_";
case TEX_FORMAT.R8_G8_B8_A8: return "DXGI_FORMAT_R8G8B8A8_";
case TEX_FORMAT.R8_G8_B8_G8: return "DXGI_FORMAT_R8G8_B8G8_";
case TEX_FORMAT.R9_G9B9E5_SHAREDEXP: return "DXGI_FORMAT_R9G9B9E5_SHAREDEXP";
default:
throw new Exception($"Format not supported! {Format}");
}
}
//Get only type
private static string GetFormatTypeString(TEX_FORMAT_TYPE type, TEX_FORMAT format)
{
switch (type)
{
case TEX_FORMAT_TYPE.FLOAT:
if (format == TEX_FORMAT.BC6)
return "SF16";
else
return "FLOAT";
case TEX_FORMAT_TYPE.UFLOAT:
if (format == TEX_FORMAT.BC6)
return "UF16";
else
return "UFLOAT";
case TEX_FORMAT_TYPE.SINT:
return "SINT";
case TEX_FORMAT_TYPE.UINT:
return "UINT";
case TEX_FORMAT_TYPE.SNORM:
return "SNORM";
case TEX_FORMAT_TYPE.UNORM:
return "UNORM";
case TEX_FORMAT_TYPE.TYPELESS:
return "TYPELESS";
case TEX_FORMAT_TYPE.SRGB:
return "UNORM_SRGB";
default:
return "";
}
}
public void SetFlags(DXGI_FORMAT Format)
{
header.flags = (uint)(DDSD.CAPS | DDSD.HEIGHT | DDSD.WIDTH | DDSD.PIXELFORMAT | DDSD.MIPMAPCOUNT | DDSD.LINEARSIZE);
@ -504,34 +596,98 @@ namespace Switch_Toolbox.Library
}
}
}
public STGenericTexture.TEX_FORMAT GetFormat()
public Tuple<TEX_FORMAT, TEX_FORMAT_TYPE> GetFormat()
{
if (DX10header != null)
return (STGenericTexture.TEX_FORMAT)DX10header.DXGI_Format;
TEX_FORMAT format = TEX_FORMAT.UNKNOWN;
TEX_FORMAT_TYPE type = TEX_FORMAT_TYPE.UNORM;
if (DX10header != null)
{
string DXGIFormatSTR = DX10header.DXGI_Format.ToString();
//Set the type.
if (DXGIFormatSTR.Contains("SRGB"))
type = TEX_FORMAT_TYPE.SRGB;
else if (DXGIFormatSTR.Contains("SNORM"))
type = TEX_FORMAT_TYPE.SNORM;
else if (DXGIFormatSTR.Contains("UNORM"))
type = TEX_FORMAT_TYPE.UNORM;
else if (DXGIFormatSTR.Contains("UF16"))
type = TEX_FORMAT_TYPE.UFLOAT;
else if (DXGIFormatSTR.Contains("SF16"))
type = TEX_FORMAT_TYPE.FLOAT;
else if (DXGIFormatSTR.Contains("FLOAT"))
type = TEX_FORMAT_TYPE.FLOAT;
else if (DXGIFormatSTR.Contains("UFLOAT"))
type = TEX_FORMAT_TYPE.UFLOAT;
else if (DXGIFormatSTR.Contains("TYPELESS"))
type = TEX_FORMAT_TYPE.TYPELESS;
//Set the format.
if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC1"))
format = TEX_FORMAT.BC1;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC2"))
format = TEX_FORMAT.BC2;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC3"))
format = TEX_FORMAT.BC3;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC3"))
format = TEX_FORMAT.BC3;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC4"))
format = TEX_FORMAT.BC4;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC4"))
format = TEX_FORMAT.BC4;
else if(DXGIFormatSTR.Contains("DXGI_FORMAT_BC5"))
format = TEX_FORMAT.BC5;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC6"))
format = TEX_FORMAT.BC6;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_BC7"))
format = TEX_FORMAT.BC7;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_R8G8B8A8"))
format = TEX_FORMAT.R8_G8_B8_A8;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_R16"))
format = TEX_FORMAT.R16;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_R8G8"))
format = TEX_FORMAT.R8G8;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_A8"))
format = TEX_FORMAT.A8;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_A8"))
format = TEX_FORMAT.A8;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_R1"))
format = TEX_FORMAT.R1;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_R16G16"))
format = TEX_FORMAT.R16_G16;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_G8R8_G8B8"))
format = TEX_FORMAT.G8_R8_G8_B8;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_D32_FLOAT_S8X24"))
format = TEX_FORMAT.D32_S8_X24;
else if (DXGIFormatSTR.Contains("DXGI_FORMAT_D32"))
format = TEX_FORMAT.D32;
}
switch (header.ddspf.fourCC)
{
case FOURCC_DXT1:
return STGenericTexture.TEX_FORMAT.BC1_UNORM;
format = TEX_FORMAT.BC1; break;
case FOURCC_DXT2:
return STGenericTexture.TEX_FORMAT.BC2_UNORM;
format = TEX_FORMAT.BC2; break;
case FOURCC_DXT3:
return STGenericTexture.TEX_FORMAT.BC2_UNORM;
format = TEX_FORMAT.BC2; break;
case FOURCC_DXT4:
return STGenericTexture.TEX_FORMAT.BC3_UNORM;
format = TEX_FORMAT.BC3; break;
case FOURCC_DXT5:
return STGenericTexture.TEX_FORMAT.BC3_UNORM;
format = TEX_FORMAT.BC3; break;
case FOURCC_ATI1:
return STGenericTexture.TEX_FORMAT.BC4_UNORM;
format = TEX_FORMAT.BC4; break;
case FOURCC_BC4U:
return STGenericTexture.TEX_FORMAT.BC4_UNORM;
format = TEX_FORMAT.BC4; break;
case FOURCC_ATI2:
return STGenericTexture.TEX_FORMAT.BC5_UNORM;
format = TEX_FORMAT.BC5; break;
case FOURCC_BC5U:
return STGenericTexture.TEX_FORMAT.BC5_UNORM;
format = TEX_FORMAT.BC5; break;
default:
return STGenericTexture.TEX_FORMAT.UNKNOWN;
format = TEX_FORMAT.UNKNOWN; break;
}
return Tuple.Create(format, type);
}
public void Save(DDS dds, string FileName, List<STGenericTexture.Surface> data = null)
{

View file

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
@ -30,7 +31,15 @@ namespace Switch_Toolbox.Library
}
public static Bitmap Resize(Image original, int width, int height)
{
return new Bitmap(original, new Size(width, height));
Bitmap bitmap = new Bitmap(width, height);
using (Graphics gr = Graphics.FromImage(bitmap))
{
gr.SmoothingMode = SmoothingMode.HighQuality;
gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
gr.PixelOffsetMode = PixelOffsetMode.HighQuality;
gr.DrawImage(original, new Rectangle(0, 0, width, height));
}
return bitmap;
}
public static Bitmap GetBitmap(byte[] Buffer, int Width, int Height, PixelFormat pixelFormat = PixelFormat.Format32bppArgb)
{

View file

@ -23,6 +23,8 @@ namespace Switch_Toolbox.Library
public void LoadDockContent(Control control, DockState dockState)
{
return;
dockContent = new DockContent();
dockContent.Controls.Add(control);
dockContent.Show(dockPanel, dockState);

View file

@ -120,7 +120,7 @@ namespace Switch_Toolbox.Library
private void UpdateViewport()
{
if (IsDisposed)
if (IsDisposed || Viewport.Instance.gL_ControlModern1 == null)
return;
if (Viewport.Instance.gL_ControlModern1.InvokeRequired)
@ -137,7 +137,7 @@ namespace Switch_Toolbox.Library
}
private void RenderAndAnimationLoop()
{
if (IsDisposed)
if (IsDisposed || Viewport.Instance.gL_ControlModern1 == null)
return;
// TODO: We don't really need two timers.

View file

@ -0,0 +1,248 @@
using System;
using System.Drawing;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Switch_Toolbox.Library
{
public class DialogCenteringService : IDisposable
{
private readonly IWin32Window owner;
private readonly HookProc hookProc;
private readonly IntPtr hHook = IntPtr.Zero;
public DialogCenteringService(IWin32Window owner)
{
if (owner == null) throw new ArgumentNullException("owner");
this.owner = owner;
hookProc = DialogHookProc;
hHook = SetWindowsHookEx(WH_CALLWNDPROCRET, hookProc, IntPtr.Zero, GetCurrentThreadId());
}
private IntPtr DialogHookProc(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode < 0)
{
return CallNextHookEx(hHook, nCode, wParam, lParam);
}
CWPRETSTRUCT msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT));
IntPtr hook = hHook;
if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE)
{
try
{
CenterWindow(msg.hwnd);
}
finally
{
UnhookWindowsHookEx(hHook);
}
}
return CallNextHookEx(hook, nCode, wParam, lParam);
}
public void Dispose()
{
UnhookWindowsHookEx(hHook);
}
private void CenterWindow(IntPtr hChildWnd)
{
Rectangle recChild = new Rectangle(0, 0, 0, 0);
bool success = GetWindowRect(hChildWnd, ref recChild);
if (!success)
{
return;
}
int width = recChild.Width - recChild.X;
int height = recChild.Height - recChild.Y;
Rectangle recParent = new Rectangle(0, 0, 0, 0);
success = GetWindowRect(owner.Handle, ref recParent);
if (!success)
{
return;
}
Point ptCenter = new Point(0, 0);
ptCenter.X = recParent.X + ((recParent.Width - recParent.X) / 2);
ptCenter.Y = recParent.Y + ((recParent.Height - recParent.Y) / 2);
Point ptStart = new Point(0, 0);
ptStart.X = (ptCenter.X - (width / 2));
ptStart.Y = (ptCenter.Y - (height / 2));
//MoveWindow(hChildWnd, ptStart.X, ptStart.Y, width, height, false);
Task.Factory.StartNew(() => SetWindowPos(hChildWnd, (IntPtr)0, ptStart.X, ptStart.Y, width, height, SetWindowPosFlags.SWP_ASYNCWINDOWPOS | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOOWNERZORDER | SetWindowPosFlags.SWP_NOZORDER));
}
// some p/invoke
// ReSharper disable InconsistentNaming
public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
public delegate void TimerProc(IntPtr hWnd, uint uMsg, UIntPtr nIDEvent, uint dwTime);
private const int WH_CALLWNDPROCRET = 12;
// ReSharper disable EnumUnderlyingTypeIsInt
private enum CbtHookAction : int
// ReSharper restore EnumUnderlyingTypeIsInt
{
// ReSharper disable UnusedMember.Local
HCBT_MOVESIZE = 0,
HCBT_MINMAX = 1,
HCBT_QS = 2,
HCBT_CREATEWND = 3,
HCBT_DESTROYWND = 4,
HCBT_ACTIVATE = 5,
HCBT_CLICKSKIPPED = 6,
HCBT_KEYSKIPPED = 7,
HCBT_SYSCOMMAND = 8,
HCBT_SETFOCUS = 9
// ReSharper restore UnusedMember.Local
}
[DllImport("kernel32.dll")]
static extern int GetCurrentThreadId();
[DllImport("user32.dll")]
private static extern bool GetWindowRect(IntPtr hWnd, ref Rectangle lpRect);
[DllImport("user32.dll")]
private static extern int MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, SetWindowPosFlags uFlags);
[DllImport("User32.dll")]
public static extern UIntPtr SetTimer(IntPtr hWnd, UIntPtr nIDEvent, uint uElapse, TimerProc lpTimerFunc);
[DllImport("User32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
[DllImport("user32.dll")]
public static extern int UnhookWindowsHookEx(IntPtr idHook);
[DllImport("user32.dll")]
public static extern IntPtr CallNextHookEx(IntPtr idHook, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern int GetWindowTextLength(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int maxLength);
[DllImport("user32.dll")]
public static extern int EndDialog(IntPtr hDlg, IntPtr nResult);
[StructLayout(LayoutKind.Sequential)]
public struct CWPRETSTRUCT
{
public IntPtr lResult;
public IntPtr lParam;
public IntPtr wParam;
public uint message;
public IntPtr hwnd;
};
// ReSharper restore InconsistentNaming
}
[Flags]
public enum SetWindowPosFlags : uint
{
// ReSharper disable InconsistentNaming
/// <summary>
/// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
/// </summary>
SWP_ASYNCWINDOWPOS = 0x4000,
/// <summary>
/// Prevents generation of the WM_SYNCPAINT message.
/// </summary>
SWP_DEFERERASE = 0x2000,
/// <summary>
/// Draws a frame (defined in the window's class description) around the window.
/// </summary>
SWP_DRAWFRAME = 0x0020,
/// <summary>
/// Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
/// </summary>
SWP_FRAMECHANGED = 0x0020,
/// <summary>
/// Hides the window.
/// </summary>
SWP_HIDEWINDOW = 0x0080,
/// <summary>
/// Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
/// </summary>
SWP_NOACTIVATE = 0x0010,
/// <summary>
/// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
/// </summary>
SWP_NOCOPYBITS = 0x0100,
/// <summary>
/// Retains the current position (ignores X and Y parameters).
/// </summary>
SWP_NOMOVE = 0x0002,
/// <summary>
/// Does not change the owner window's position in the Z order.
/// </summary>
SWP_NOOWNERZORDER = 0x0200,
/// <summary>
/// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
/// </summary>
SWP_NOREDRAW = 0x0008,
/// <summary>
/// Same as the SWP_NOOWNERZORDER flag.
/// </summary>
SWP_NOREPOSITION = 0x0200,
/// <summary>
/// Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
/// </summary>
SWP_NOSENDCHANGING = 0x0400,
/// <summary>
/// Retains the current size (ignores the cx and cy parameters).
/// </summary>
SWP_NOSIZE = 0x0001,
/// <summary>
/// Retains the current Z order (ignores the hWndInsertAfter parameter).
/// </summary>
SWP_NOZORDER = 0x0004,
/// <summary>
/// Displays the window.
/// </summary>
SWP_SHOWWINDOW = 0x0040,
// ReSharper restore InconsistentNaming
}
}

View file

@ -135,7 +135,7 @@ namespace Switch_Toolbox.Library
{
foreach (IFileFormat file in FileManager.GetFileFormats())
{
if (file.IFileInfo.IsActive)
if (file.IFileInfo != null && file.IFileInfo.IsActive)
{
DialogResult dialogResult = MessageBox.Show("Are you sure you want to close this tab? Doing so may result in losing progress.", "", MessageBoxButtons.YesNo);
if (dialogResult != DialogResult.Yes)

View file

@ -28,7 +28,6 @@
/// </summary>
private void InitializeComponent()
{
this.gL_ControlModern1 = new GL_Core.GL_ControlModern();
this.animationPanel1 = new Switch_Toolbox.Library.AnimationPanel();
this.contextMenuStripDark1 = new Switch_Toolbox.Library.Forms.ContextMenuStripDark();
this.shadingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -39,23 +38,6 @@
this.contextMenuStripDark1.SuspendLayout();
this.SuspendLayout();
//
// gL_ControlModern1
//
this.gL_ControlModern1.ActiveCamera = null;
this.gL_ControlModern1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.gL_ControlModern1.BackColor = System.Drawing.Color.Black;
this.gL_ControlModern1.CurrentShader = null;
this.gL_ControlModern1.DisplayPolyCount = false;
this.gL_ControlModern1.Location = new System.Drawing.Point(-3, 66);
this.gL_ControlModern1.MainDrawable = null;
this.gL_ControlModern1.Name = "gL_ControlModern1";
this.gL_ControlModern1.Size = new System.Drawing.Size(791, 388);
this.gL_ControlModern1.Stereoscopy = false;
this.gL_ControlModern1.TabIndex = 0;
this.gL_ControlModern1.VSync = false;
//
// animationPanel1
//
this.animationPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
@ -138,7 +120,6 @@
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ClientSize = new System.Drawing.Size(781, 522);
this.Controls.Add(this.animationPanel1);
this.Controls.Add(this.gL_ControlModern1);
this.Controls.Add(this.contextMenuStripDark1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
@ -159,7 +140,6 @@
#endregion
public GL_Core.GL_ControlModern gL_ControlModern1;
public AnimationPanel animationPanel1;
private Forms.ContextMenuStripDark contextMenuStripDark1;
private System.Windows.Forms.ToolStripMenuItem shadingToolStripMenuItem;

View file

@ -18,9 +18,34 @@ namespace Switch_Toolbox.Library
public Viewport()
{
InitializeComponent();
if (Runtime.DisableViewport)
return;
SetViewport();
LoadViewportRuntimeValues();
LoadShadingModes();
}
public GL_Core.GL_ControlModern gL_ControlModern1;
private void SetViewport()
{
gL_ControlModern1 = new GL_ControlModern();
gL_ControlModern1.ActiveCamera = null;
gL_ControlModern1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
gL_ControlModern1.BackColor = System.Drawing.Color.Black;
gL_ControlModern1.CurrentShader = null;
gL_ControlModern1.DisplayPolyCount = false;
gL_ControlModern1.Location = new System.Drawing.Point(-3, 66);
gL_ControlModern1.MainDrawable = null;
gL_ControlModern1.Name = "gL_ControlModern1";
gL_ControlModern1.Size = new System.Drawing.Size(791, 388);
gL_ControlModern1.Stereoscopy = false;
gL_ControlModern1.TabIndex = 0;
gL_ControlModern1.VSync = false;
Controls.Add(this.gL_ControlModern1);
}
public static Viewport Instance
{
@ -32,6 +57,9 @@ namespace Switch_Toolbox.Library
public void UpdateViewport()
{
if (Runtime.DisableViewport)
return;
if (gL_ControlModern1 != null)
gL_ControlModern1.Refresh();
if (GL_ControlLegacy != null)
@ -39,7 +67,7 @@ namespace Switch_Toolbox.Library
}
public void RenderToTexture()
{
if (gL_ControlModern1 == null)
if (gL_ControlModern1 == null && !Runtime.DisableViewport)
return;
int Framebuffer = 0;
@ -70,6 +98,9 @@ namespace Switch_Toolbox.Library
}
public void LoadViewportRuntimeValues()
{
if (gL_ControlModern1 == null)
return;
switch (Runtime.cameraMovement)
{
case Runtime.CameraMovement.Inspect:

View file

@ -6,15 +6,36 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library.IO;
using OpenTK.Graphics.OpenGL;
using Switch_Toolbox.Library.Rendering;
namespace Switch_Toolbox.Library
{
public enum STChannelType
{
Red,
Green,
Blue,
Alpha,
One,
Zero
}
public class STGenericTexture : TreeNodeCustom
{
public STGenericTexture()
{
}
public STChannelType RedChannel;
public STChannelType GreenChannel;
public STChannelType BlueChannel;
public STChannelType AlphaChannel;
/// <summary>
/// Stores the <see cref="Surface"/> instances for arrays of images. Cubemaps use 6 surfaces.
/// </summary>
public List<Surface> surfaces = new List<Surface>();
public List<Surface> Surfaces = new List<Surface>();
/// <summary>
/// The total amount of surfaces for the texture.
@ -23,29 +44,97 @@ namespace Switch_Toolbox.Library
{
get
{
return surfaces.Count;
return Surfaces.Count;
}
}
/// <summary>
/// The width of the image in pixels
/// The width of the image in pixels.
/// </summary>
public uint Width;
public uint Width { get; set; }
/// <summary>
/// The height of the image in pixels
/// The height of the image in pixels.
/// </summary>
public uint Height;
public uint Height { get; set; }
/// <summary>
/// The <see cref="TEX_FORMAT"/> Format of the image.
/// </summary>
public TEX_FORMAT Format;
public TEX_FORMAT Format { get; set; }
/// <summary>
/// The total amount of mip maps for the texture.
/// The <see cref="TEX_FORMAT_TYPE"/> Format of the image.
/// </summary>
public uint MipmapCount;
public TEX_FORMAT_TYPE FormatType { get; set; }
public uint MipmapCount { get; set; }
public RenderableTex RenderableTex { get; set; }
public int GetBytesPerPixel(TEX_FORMAT Format)
{
return FormatTable[Format].BytesPerPixel;
}
public int GetBlockHeight(TEX_FORMAT Format)
{
return FormatTable[Format].BlockHeight;
}
public int GetBlockWidth(TEX_FORMAT Format)
{
return FormatTable[Format].BlockWidth;
}
// Based on Ryujinx's image table
// https://github.com/Ryujinx/Ryujinx/blob/c86aacde76b5f8e503e2b412385c8491ecc86b3b/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs
// A nice way to get bpp, block data, and buffer types for formats
private static readonly Dictionary<TEX_FORMAT, FormatInfo> FormatTable =
new Dictionary<TEX_FORMAT, FormatInfo>()
{
{ TEX_FORMAT.R32_G32_B32_A32, new FormatInfo(16, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R16_G16_B16_A16, new FormatInfo(8, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R32_G32, new FormatInfo(8, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R8_G8_B8_X8, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R8_G8_B8_A8, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R10_G10_B10_A2, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R32, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R4_G4_B4_A4, new FormatInfo(2, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.BC6, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.BC7, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.R16_G16, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R8G8, new FormatInfo(2, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R16, new FormatInfo(2, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R8, new FormatInfo(1, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.R11_G11_B10, new FormatInfo(4, 1, 1, TargetBuffer.Color) },
{ TEX_FORMAT.BC1, new FormatInfo(8, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.BC2, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.BC3, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.BC4, new FormatInfo(8, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.BC5, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC4x4, new FormatInfo(16, 4, 4, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC5x5, new FormatInfo(16, 5, 5, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC6x6, new FormatInfo(16, 6, 6, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC8x8, new FormatInfo(16, 8, 8, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC10x10, new FormatInfo(16, 10, 10, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC12x12, new FormatInfo(16, 12, 12, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC5x4, new FormatInfo(16, 5, 4, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC6x5, new FormatInfo(16, 6, 5, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC8x6, new FormatInfo(16, 8, 6, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC10x8, new FormatInfo(16, 10, 8, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC12x10, new FormatInfo(16, 12, 10, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC8x5, new FormatInfo(16, 8, 5, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC10x5, new FormatInfo(16, 10, 5, TargetBuffer.Color) },
{ TEX_FORMAT.ASTC10x6, new FormatInfo(16, 10, 6, TargetBuffer.Color) },
{ TEX_FORMAT.D16, new FormatInfo(2, 1, 1, TargetBuffer.Depth) },
{ TEX_FORMAT.D24, new FormatInfo(4, 1, 1, TargetBuffer.Depth) },
{ TEX_FORMAT.D24S8, new FormatInfo(4, 1, 1, TargetBuffer.DepthStencil) },
{ TEX_FORMAT.D32, new FormatInfo(4, 1, 1, TargetBuffer.Depth) },
{ TEX_FORMAT.D32S8, new FormatInfo(8, 1, 1, TargetBuffer.DepthStencil) }
};
/// <summary>
/// A Surface contains mip levels of compressed/uncompressed texture data
@ -55,6 +144,38 @@ namespace Switch_Toolbox.Library
public List<byte[]> mipmaps = new List<byte[]>();
}
public void CreateGenericTexture(uint width, uint height, List<Surface> surfaces, TEX_FORMAT format )
{
Width = width;
Height = height;
Surfaces = surfaces;
Surfaces = surfaces;
Format = format;
}
private enum TargetBuffer
{
Color = 1,
Depth = 2,
Stencil = 3,
DepthStencil = 4,
}
private class FormatInfo
{
public int BytesPerPixel { get; private set; }
public int BlockWidth { get; private set; }
public int BlockHeight { get; private set; }
public TargetBuffer TargetBuffer;
public FormatInfo(int bytesPerPixel, int blockWidth, int blockHeight, TargetBuffer targetBuffer)
{
BytesPerPixel = bytesPerPixel;
BlockWidth = blockWidth;
BlockHeight = blockHeight;
TargetBuffer = targetBuffer;
}
}
/// <summary>
/// Gets a <see cref="Bitmap"/> given an array and mip index.
/// </summary>
@ -63,12 +184,23 @@ namespace Switch_Toolbox.Library
/// <returns></returns>
public Bitmap GetBitmap(int ArrayIndex = 0, int MipLevel = 0)
{
if (surfaces.Count == 0)
if (Surfaces.Count == 0)
throw new Exception($"Surfaces are empty on texture {Text}! Failed to get bitmap!");
return BitmapExtension.GetBitmap(DecodeBlock(surfaces[ArrayIndex].mipmaps[MipLevel], Height, Width, Format),
Bitmap bitmap = BitmapExtension.GetBitmap(DecodeBlock(Surfaces[ArrayIndex].mipmaps[MipLevel], Width, Height, Format),
(int)Width, (int)Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
return bitmap;
}
public static Bitmap DecodeBlockGetBitmap(byte[] data, uint Width, uint Height, TEX_FORMAT Format)
{
Bitmap bitmap = BitmapExtension.GetBitmap(DecodeBlock(data, Width, Height, Format),
(int)Width, (int)Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
return bitmap;
}
/// <summary>
/// Decodes a byte array of image data given the source image in bytes, width, height, and DXGI format.
/// </summary>
@ -79,14 +211,12 @@ namespace Switch_Toolbox.Library
/// <returns>Returns a byte array of decoded data. </returns>
public static byte[] DecodeBlock(byte[] data, uint Width, uint Height, TEX_FORMAT Format)
{
if (data.Length <= 0)
throw new Exception($"Data is empty!");
if (Width <= 0)
throw new Exception($"Invalid width size {Width}!");
if (Height <= 0)
throw new Exception($"Invalid height size {Height}!");
if (Format <= 0) throw new Exception($"Invalid Format!");
if (data.Length <= 0) throw new Exception($"Data is empty!");
if (Width <= 0) throw new Exception($"Invalid width size {Width}!");
if (Height <= 0) throw new Exception($"Invalid height size {Height}!");
if (Format == TEX_FORMAT.BC5_SNORM)
if (Format == TEX_FORMAT.BC5)
return ConvertBgraToRgba(DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true, true));
if (IsCompressed(Format))
@ -102,6 +232,16 @@ namespace Switch_Toolbox.Library
}
public static byte[] CompressBlock(byte[] data, int width, int height, TEX_FORMAT format, TEX_FORMAT_TYPE type, float alphaRef)
{
if (IsCompressed(format))
return DDSCompressor.CompressBlock(data, width, height, DDS.GetDXGI_Format(format, type), alphaRef);
else if (IsAtscFormat(format))
return null;
else
return DDSCompressor.EncodePixelBlock(data, width, height, DDS.GetDXGI_Format(format, type));
}
public void LoadDDS(string path)
{
SetNameFromPath(path);
@ -111,7 +251,10 @@ namespace Switch_Toolbox.Library
Width = dds.header.width;
Height = dds.header.height;
Format = dds.GetFormat();
var formats = dds.GetFormat();
Format = formats.Item1;
FormatType = formats.Item2;
MipmapCount = dds.header.mipmapCount;
}
public void LoadTGA(string path)
@ -127,12 +270,10 @@ namespace Switch_Toolbox.Library
}
public void SaveASTC(string FileName, int SurfaceLevel = 0, int MipLevel = 0)
{
var blockDims = GetDims(Format);
ASTC atsc = new ASTC();
atsc.BlockDimX = (byte)blockDims.Item1;
atsc.BlockDimY = (byte)blockDims.Item2;
atsc.BlockDimZ = (byte)blockDims.Item3;
atsc.BlockDimX = (byte)GetBlockHeight(Format);
atsc.BlockDimY = (byte)GetBlockWidth(Format);
atsc.BlockDimZ = (byte)1;
}
public void SaveTGA(string FileName, int SurfaceLevel = 0, int MipLevel = 0)
{
@ -150,191 +291,132 @@ namespace Switch_Toolbox.Library
dds.header = new DDS.Header();
dds.header.width = Width;
dds.header.height = Height;
dds.header.mipmapCount = (uint)surfaces[SurfaceLevel].mipmaps.Count;
dds.header.pitchOrLinearSize = (uint)surfaces[SurfaceLevel].mipmaps[MipLevel].Length;
dds.SetFlags((DDS.DXGI_FORMAT)Format);
dds.header.mipmapCount = (uint)Surfaces[SurfaceLevel].mipmaps.Count;
dds.header.pitchOrLinearSize = (uint)Surfaces[SurfaceLevel].mipmaps[MipLevel].Length;
dds.SetFlags(Format, FormatType);
dds.Save(dds, FileName, surfaces);
dds.Save(dds, FileName, Surfaces);
}
public static Tuple<int, int, int> GetDims(TEX_FORMAT Format)
public void LoadOpenGLTexture()
{
switch (Format)
{
case TEX_FORMAT.BC1_TYPELESS:
return Tuple.Create(4,4,4);
}
return Tuple.Create(4, 4, 4);
RenderableTex.LoadOpenGLTexture(this);
}
public static bool IsAtscFormat(TEX_FORMAT Format)
{
if (Format.ToString().Contains("ASTC"))
return true;
else
return false;
}
public static bool IsCompressed(TEX_FORMAT Format)
{
switch (Format)
{
case TEX_FORMAT.BC1_UNORM:
case TEX_FORMAT.BC1_UNORM_SRGB:
case TEX_FORMAT.BC1_TYPELESS:
case TEX_FORMAT.BC2_UNORM_SRGB:
case TEX_FORMAT.BC2_UNORM:
case TEX_FORMAT.BC2_TYPELESS:
case TEX_FORMAT.BC3_UNORM_SRGB:
case TEX_FORMAT.BC3_UNORM:
case TEX_FORMAT.BC3_TYPELESS:
case TEX_FORMAT.BC4_UNORM:
case TEX_FORMAT.BC4_TYPELESS:
case TEX_FORMAT.BC4_SNORM:
case TEX_FORMAT.BC5_UNORM:
case TEX_FORMAT.BC5_TYPELESS:
case TEX_FORMAT.BC5_SNORM:
case TEX_FORMAT.BC1:
case TEX_FORMAT.BC2:
case TEX_FORMAT.BC3:
case TEX_FORMAT.BC4:
case TEX_FORMAT.BC5:
case TEX_FORMAT.BC6:
case TEX_FORMAT.BC7:
return true;
default:
return false;
}
}
//DXGI formats are first, then ASTC formats after
public enum TEX_FORMAT : uint
public static STChannelType[] SetChannelsByFormat(TEX_FORMAT Format)
{
UNKNOWN = 0,
R32G32B32A32_TYPELESS = 1,
R32G32B32A32_FLOAT = 2,
R32G32B32A32_UINT = 3,
R32G32B32A32_SINT = 4,
R32G32B32_TYPELESS = 5,
R32G32B32_FLOAT = 6,
R32G32B32_UINT = 7,
R32G32B32_SINT = 8,
R16G16B16A16_TYPELESS = 9,
R16G16B16A16_FLOAT = 10,
R16G16B16A16_UNORM = 11,
R16G16B16A16_UINT = 12,
R16G16B16A16_SNORM = 13,
R16G16B16A16_SINT = 14,
R32G32_TYPELESS = 15,
R32G32_FLOAT = 16,
R32G32_UINT = 17,
R32G32_SINT = 18,
R32G8X24_TYPELESS = 19,
D32_FLOAT_S8X24_UINT = 20,
R32_FLOAT_X8X24_TYPELESS = 21,
X32_TYPELESS_G8X24_UINT = 22,
R10G10B10A2_TYPELESS = 23,
R10G10B10A2_UNORM = 24,
R10G10B10A2_UINT = 25,
R11G11B10_FLOAT = 26,
R8G8B8A8_TYPELESS = 27,
R8G8B8A8_UNORM = 28,
R8G8B8A8_UNORM_SRGB = 29,
R8G8B8A8_UINT = 30,
R8G8B8A8_SNORM = 31,
R8G8B8A8_SINT = 32,
R16G16_TYPELESS = 33,
R16G16_FLOAT = 34,
R16G16_UNORM = 35,
R16G16_UINT = 36,
R16G16_SNORM = 37,
R16G16_SINT = 38,
R32_TYPELESS = 39,
D32_FLOAT = 40,
R32_FLOAT = 41,
R32_UINT = 42,
R32_SINT = 43,
R24G8_TYPELESS = 44,
D24_UNORM_S8_UINT = 45,
R24_UNORM_X8_TYPELESS = 46,
X24_TYPELESS_G8_UINT = 47,
R8G8_TYPELESS = 48,
R8G8_UNORM = 49,
R8G8_UINT = 50,
R8G8_SNORM = 51,
R8G8_SINT = 52,
R16_TYPELESS = 53,
R16_FLOAT = 54,
D16_UNORM = 55,
R16_UNORM = 56,
R16_UINT = 57,
R16_SNORM = 58,
R16_SINT = 59,
R8_TYPELESS = 60,
R8_UNORM = 61,
R8_UINT = 62,
R8_SNORM = 63,
R8_SINT = 64,
A8_UNORM = 65,
R1_UNORM = 66,
R9G9B9E5_SHAREDEXP = 67,
R8G8_B8G8_UNORM = 68,
G8R8_G8B8_UNORM = 69,
BC1_TYPELESS = 70,
BC1_UNORM = 71,
BC1_UNORM_SRGB = 72,
BC2_TYPELESS = 73,
BC2_UNORM = 74,
BC2_UNORM_SRGB = 75,
BC3_TYPELESS = 76,
BC3_UNORM = 77,
BC3_UNORM_SRGB = 78,
BC4_TYPELESS = 79,
BC4_UNORM = 80,
BC4_SNORM = 81,
BC5_TYPELESS = 82,
BC5_UNORM = 83,
BC5_SNORM = 84,
B5G6R5_UNORM = 85,
B5G5R5A1_UNORM = 86,
B8G8R8A8_UNORM = 87,
B8G8R8X8_UNORM = 88,
R10G10B10_XR_BIAS_A2_UNORM = 89,
B8G8R8A8_TYPELESS = 90,
B8G8R8A8_UNORM_SRGB = 91,
B8G8R8X8_TYPELESS = 92,
B8G8R8X8_UNORM_SRGB = 93,
BC6H_TYPELESS = 94,
BC6H_UF16 = 95,
BC6H_SF16 = 96,
BC7_TYPELESS = 97,
BC7_UNORM = 98,
BC7_UNORM_SRGB = 99,
AYUV = 100,
Y410 = 101,
Y416 = 102,
NV12 = 103,
P010 = 104,
P016 = 105,
Format_420_OPAQUE = 106,
YUY2 = 107,
Y210 = 108,
Y216 = 109,
NV11 = 110,
AI44 = 111,
IA44 = 112,
P8 = 113,
A8P8 = 114,
B4G4R4A4_UNORM = 115,
P208 = 130,
V208 = 131,
V408 = 132,
STChannelType[] channels = new STChannelType[4];
ASTC4x4 = 200,
ASTC5x4 = 201,
ASTC5x5 = 202,
ASTC6x5 = 203,
ASTC6x6 = 204,
ASTC8x5 = 205,
ASTC8x6 = 206,
ASTC8x8 = 207,
ASTC10x5 = 208,
ASTC10x6 = 209,
ASTC10x8 = 210,
ASTC10x10 = 211,
ASTC12x10 = 212,
ASTC12x12 = 213,
FORCE_UINT = 0xFFFFFFFF
switch (Format)
{
case TEX_FORMAT.BC5:
channels[0] = STChannelType.Red;
channels[1] = STChannelType.Green;
channels[2] = STChannelType.Zero;
channels[3] = STChannelType.One;
break;
case TEX_FORMAT.BC4:
channels[0] = STChannelType.Red;
channels[1] = STChannelType.Red;
channels[2] = STChannelType.Red;
channels[3] = STChannelType.Red;
break;
default:
channels[0] = STChannelType.Red;
channels[1] = STChannelType.Green;
channels[2] = STChannelType.Blue;
channels[3] = STChannelType.Alpha;
break;
}
return channels;
}
public STGenericTexture()
{
}
public override void OnClick(TreeView treeView)
{
public static Bitmap SwapBlueRedChannels(Bitmap bitmap)
{
return ColorComponentSelector(bitmap, STChannelType.Blue, STChannelType.Green, STChannelType.Red, STChannelType.Alpha);
}
public static Bitmap ColorComponentSelector(Bitmap image, STChannelType R, STChannelType G, STChannelType B, STChannelType A)
{
BitmapExtension.ColorSwapFilter color = new BitmapExtension.ColorSwapFilter();
if (R == STChannelType.Red)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Red;
if (R == STChannelType.Green)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Green;
if (R == STChannelType.Blue)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Blue;
if (R == STChannelType.Alpha)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Alpha;
if (R == STChannelType.One)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.One;
if (R == STChannelType.Zero)
color.CompRed = BitmapExtension.ColorSwapFilter.Red.Zero;
if (G == STChannelType.Red)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Red;
if (G == STChannelType.Green)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Green;
if (G == STChannelType.Blue)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Blue;
if (G == STChannelType.Alpha)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Alpha;
if (G == STChannelType.One)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.One;
if (G == STChannelType.Zero)
color.CompGreen = BitmapExtension.ColorSwapFilter.Green.Zero;
if (B == STChannelType.Red)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Red;
if (B == STChannelType.Green)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Green;
if (B == STChannelType.Blue)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Blue;
if (B == STChannelType.Alpha)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Alpha;
if (B == STChannelType.One)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.One;
if (B == STChannelType.Zero)
color.CompBlue = BitmapExtension.ColorSwapFilter.Blue.Zero;
if (A == STChannelType.Red)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Red;
if (A == STChannelType.Green)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Green;
if (A == STChannelType.Blue)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Blue;
if (A == STChannelType.Alpha)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Alpha;
if (A == STChannelType.One)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.One;
if (A == STChannelType.Zero)
color.CompAlpha = BitmapExtension.ColorSwapFilter.Alpha.Zero;
return BitmapExtension.SwapRGB(image, color);
}
private void SetNameFromPath(string path)
{
//Replace extensions manually. This is because using the

View file

@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Threading.Tasks;
using OpenTK.Graphics.OpenGL;
using Smash_Forge.Rendering;
namespace Switch_Toolbox.Library.Rendering
{
public class RenderableTex
{
public int width, height;
public int display;
public PixelInternalFormat pixelInternalFormat;
public PixelFormat pixelFormat;
public PixelType pixelType = PixelType.UnsignedByte;
public int mipMapCount;
public List<List<byte[]>> mipmaps = new List<List<byte[]>>();
public byte[] data;
public bool GLInitialized = false;
public void LoadOpenGLTexture(STGenericTexture GenericTexture)
{
if (OpenTKSharedResources.SetupStatus == OpenTKSharedResources.SharedResourceStatus.Unitialized)
return;
bool IsSNORM = (GenericTexture.FormatType == TEX_FORMAT_TYPE.SNORM);
bool IsSRGB = (GenericTexture.FormatType == TEX_FORMAT_TYPE.SRGB);
bool IsFLOAT = (GenericTexture.FormatType == TEX_FORMAT_TYPE.FLOAT);
bool IsSINT = (GenericTexture.FormatType == TEX_FORMAT_TYPE.SINT);
if (GenericTexture.Surfaces.Count <= 0)
{
throw new Exception($"No texture data found with texture {GenericTexture.Text}");
}
data = GenericTexture.Surfaces[0].mipmaps[0];
width = (int)GenericTexture.Width;
height = (int)GenericTexture.Height;
switch (GenericTexture.Format)
{
case TEX_FORMAT.BC1:
if (GenericTexture.FormatType == TEX_FORMAT_TYPE.SRGB)
pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
else
pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt1Ext;
break;
case TEX_FORMAT.BC2:
pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt3Ext;
break;
case TEX_FORMAT.BC3:
pixelInternalFormat = PixelInternalFormat.CompressedRgbaS3tcDxt5Ext;
break;
case TEX_FORMAT.BC4:
pixelInternalFormat = PixelInternalFormat.CompressedRedRgtc1;
break;
case TEX_FORMAT.BC5:
if (IsSNORM)
{
pixelInternalFormat = PixelInternalFormat.CompressedRgRgtc2;
data = DDSCompressor.DecompressBC5(GenericTexture.Surfaces[0].mipmaps[0],
(int)GenericTexture.Width, (int)GenericTexture.Height, true, true);
pixelInternalFormat = PixelInternalFormat.Rgba;
pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
}
else
pixelInternalFormat = PixelInternalFormat.CompressedRgRgtc2;
break;
case TEX_FORMAT.BC6:
if (IsFLOAT)
pixelInternalFormat = PixelInternalFormat.CompressedRgbBptcSignedFloat;
else
pixelInternalFormat = PixelInternalFormat.CompressedRgbBptcUnsignedFloat;
break;
case TEX_FORMAT.BC7:
if (IsSRGB)
pixelInternalFormat = PixelInternalFormat.CompressedRgbaBptcUnorm;
else
pixelInternalFormat = PixelInternalFormat.CompressedSrgbAlphaBptcUnorm;
break;
case TEX_FORMAT.R8_G8_B8_A8:
pixelInternalFormat = PixelInternalFormat.Rgba;
pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba;
break;
}
display = loadImage(this);
GLInitialized = true;
}
public static int loadImage(RenderableTex t)
{
if (!t.GLInitialized)
return -1;
int texID = GL.GenTexture();
GL.BindTexture(TextureTarget.Texture2D, texID);
if (t.pixelInternalFormat != PixelInternalFormat.Rgba)
{
GL.CompressedTexImage2D<byte>(TextureTarget.Texture2D, 0, (InternalFormat)t.pixelFormat,
t.width, t.height, 0, getImageSize(t), t.data);
//Debug.WriteLine(GL.GetError());
}
else
{
GL.TexImage2D<byte>(TextureTarget.Texture2D, 0, t.pixelInternalFormat, t.width, t.height, 0,
t.pixelFormat, PixelType.UnsignedByte, t.data);
}
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
return texID;
}
private static int getImageSize(RenderableTex t)
{
switch (t.pixelInternalFormat)
{
case PixelInternalFormat.CompressedRgbaS3tcDxt1Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt1Ext:
case PixelInternalFormat.CompressedRedRgtc1:
case PixelInternalFormat.CompressedSignedRedRgtc1:
return (t.width * t.height / 2);
case PixelInternalFormat.CompressedRgbaS3tcDxt3Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt3Ext:
case PixelInternalFormat.CompressedRgbaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSrgbAlphaS3tcDxt5Ext:
case PixelInternalFormat.CompressedSignedRgRgtc2:
case PixelInternalFormat.CompressedRgRgtc2:
return (t.width * t.height);
case PixelInternalFormat.Rgba:
return t.data.Length;
default:
return t.data.Length;
}
}
public static unsafe Bitmap GLTextureToBitmap(RenderableTex t, int id)
{
if (Viewport.Instance.gL_ControlModern1 == null)
return null;
Bitmap bitmap = new Bitmap(t.width, t.height);
System.Drawing.Imaging.BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, t.width, t.height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
GL.BindTexture(TextureTarget.Texture2D, id);
GL.GetTexImage(TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0);
bitmap.UnlockBits(bitmapData);
return bitmap;
}
}
}

View file

@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Switch_Toolbox.Library
{
public enum TEX_FORMAT_TYPE
{
TYPELESS = 0,
UNORM = 1,
SNORM = 2,
UFLOAT = 3,
FLOAT = 4,
SINT = 5,
UINT = 6,
SRGB = 7,
};
public enum TEX_FORMAT : int
{
UNKNOWN,
R32_G32_B32_A32,
R32_G32_B32,
R16_G16_B16_A16,
R5_G5_B5_A1,
R32_G32,
R32_G8_X24,
D32_S8_X24,
R32_X8_X24,
X32_G8_X24,
R10_G10_B10_A2,
R11_G11_B10,
R8_G8_B8_A8,
R9_G9B9E5_SHAREDEXP,
R8_G8_B8_G8,
R8_G8_B8_X8,
R4_G4_B4_A4,
R16_G16,
R32,
D32,
R24_G8,
D24_S8,
R24_X8,
X24_G8,
R8G8,
R4_G4,
R16,
G8_R8_G8_B8,
D16,
D24,
D24S8,
D32S8,
R8,
A8,
R1,
B5_G6_R5,
A1_B5_G5_R5,
BC1,
BC2,
BC3,
BC4,
BC5,
BC6,
BC7,
AYUV,
Y410,
Y416,
NV12,
P010,
P016,
YUY2,
Y210,
Y216,
NV11,
AI44,
IA44,
P8,
A8P8,
P208,
V208,
V408,
ASTC4x4,
ASTC5x4,
ASTC5x5,
ASTC6x5,
ASTC6x6,
ASTC8x5,
ASTC8x6,
ASTC8x8,
ASTC10x5,
ASTC10x6,
ASTC10x8,
ASTC10x10,
ASTC12x10,
ASTC12x12,
}
}

View file

@ -74,9 +74,12 @@ namespace Switch_Toolbox.Library.IO
/// <param name="Compressed">If the file is being compressed or not</param>
/// <param name="CompType">The type of <see cref="CompressionType"/> being used</param>
/// <returns></returns>
public static TreeNodeFile GetNodeFileFormat(string FileName, byte[] data, bool InArchive = false,
public static TreeNodeFile GetNodeFileFormat(string FileName, byte[] data = null, bool InArchive = false,
string ArchiveHash = "", TreeNode archiveNode = null, bool Compressed = false, CompressionType CompType = 0)
{
if (data == null)
data = File.ReadAllBytes(FileName);
IFileFormat format = OpenFileFormat(FileName, data, InArchive, ArchiveHash, archiveNode);
if (format is TreeNode)
@ -94,9 +97,12 @@ namespace Switch_Toolbox.Library.IO
/// <param name="Compressed">If the file is being compressed or not</param>
/// <param name="CompType">The type of <see cref="CompressionType"/> being used</param>
/// <returns></returns>
public static IFileFormat OpenFileFormat(string FileName, byte[] data, bool InArchive = false,
public static IFileFormat OpenFileFormat(string FileName, byte[] data = null, bool InArchive = false,
string ArchiveHash = "", TreeNode archiveNode = null, bool Compressed = false, CompressionType CompType = 0)
{
if (data == null)
data = File.ReadAllBytes(FileName);
Cursor.Current = Cursors.WaitCursor;
FileReader fileReader = new FileReader(data);
string Magic4 = fileReader.ReadMagic(0, 4);
@ -130,13 +136,13 @@ namespace Switch_Toolbox.Library.IO
if (Compressed)
fileFormat.CompressionType = CompType;
if (fileFormat is TreeNode)
if (fileFormat is TreeNode && archiveNode != null)
{
((TreeNode)fileFormat).Text = archiveNode.Text;
((TreeNode)fileFormat).ImageKey = archiveNode.ImageKey;
((TreeNode)fileFormat).SelectedImageKey = archiveNode.SelectedImageKey;
return fileFormat;
}
return fileFormat;
}
if (fileFormat.Magic == string.Empty)
{
@ -157,8 +163,8 @@ namespace Switch_Toolbox.Library.IO
((TreeNode)fileFormat).Text = archiveNode.Text;
((TreeNode)fileFormat).ImageKey = archiveNode.ImageKey;
((TreeNode)fileFormat).SelectedImageKey = archiveNode.SelectedImageKey;
return fileFormat;
}
return fileFormat;
}
}
}

View file

@ -144,6 +144,9 @@ namespace Switch_Toolbox.Library
public static void DrawCube(Vector3 center, float size)
{
if (Viewport.Instance.gL_ControlModern1 == null)
return;
DrawRectangularPrism(center, size, size, size, false);
}

View file

@ -23,6 +23,9 @@ namespace Switch_Toolbox.Library
}
public override void Draw(GL_ControlLegacy control)
{
if (Viewport.Instance.gL_ControlModern1 == null)
return;
control.ResetModelMatrix();
foreach (STBone bn in bones)

View file

@ -18,6 +18,8 @@ namespace Switch_Toolbox.Library
public static DockState objectListDockState = DockState.DockLeft;
public static bool DisableUpdatePrompt;
public static int Yaz0CompressionLevel = 3;
public static bool RenderModels = true;
public static bool RenderModelSelection = true;

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -10,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Switch_Toolbox.Library</RootNamespace>
<AssemblyName>Switch_Toolbox.Library</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
@ -122,6 +121,8 @@
<Compile Include="Generics\GenericMatTexture.cs" />
<Compile Include="Generics\GenericModel.cs" />
<Compile Include="Generics\GenericObject.cs" />
<Compile Include="Generics\RenderableTex.cs" />
<Compile Include="Generics\TEX_FORMAT.cs" />
<Compile Include="GUI Custom\ListViewCustom.cs">
<SubType>Component</SubType>
</Compile>
@ -146,6 +147,7 @@
<Compile Include="GUI\CubeMapFaceCreator.Designer.cs">
<DependentUpon>CubeMapFaceCreator.cs</DependentUpon>
</Compile>
<Compile Include="GUI\Dialogs\DialogCenter.cs" />
<Compile Include="GUI\Viewport.cs">
<SubType>Form</SubType>
</Compile>
@ -377,10 +379,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.3.2.9\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.2.9\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\AssimpNet.4.1.0\build\AssimpNet.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\AssimpNet.4.1.0\build\AssimpNet.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.targets')" />
<Import Project="..\packages\AssimpNet.4.1.0\build\AssimpNet.targets" Condition="Exists('..\packages\AssimpNet.4.1.0\build\AssimpNet.targets')" />
</Project>

View file

@ -16,4 +16,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AssimpNet" version="4.1.0" targetFramework="net462" />
<package id="Costura.Fody" version="3.1.4" targetFramework="net461" />
<package id="CsvHelper" version="8.0.0-beta01" targetFramework="net462" />
<package id="DockPanelSuite" version="3.0.4" targetFramework="net461" />
<package id="DockPanelSuite.ThemeVS2015" version="3.0.4" targetFramework="net461" />