1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Update more files

This commit is contained in:
KillzXGaming 2020-01-14 20:43:36 -05:00
parent 100cd88534
commit a80f6af6d5
20 changed files with 413 additions and 64 deletions

View File

@ -44,6 +44,8 @@ namespace FirstPlugin
public void Load(System.IO.Stream stream)
{
CanSave = true;
header = new Header();
header.Read(new FileReader(stream));
@ -67,8 +69,8 @@ namespace FirstPlugin
}
public void Save(System.IO.Stream stream)
{
public void Save(System.IO.Stream stream) {
header.Write(new FileWriter(stream));
}
//Docs https://github.com/Kinnay/Wii-U-File-Formats/wiki/SHARCFB-File-Format
@ -87,7 +89,7 @@ namespace FirstPlugin
uint FileSize = reader.ReadUInt32();
uint bom = reader.ReadUInt32();
uint FileLength = reader.ReadUInt32();
Name = reader.ReadString((int)FileLength);
Name = reader.ReadString((int)FileLength, true);
var pos = reader.Position;
@ -113,9 +115,37 @@ namespace FirstPlugin
SourceDatas.Add(source);
}
}
public void Write(FileWriter reader)
{
public void Write(FileWriter writer)
{
writer.ByteOrder = Syroot.BinaryData.ByteOrder.LittleEndian;
writer.WriteSignature("AAHS");
writer.Write(Version);
writer.Write(uint.MaxValue); //fileSize
writer.Write(1);
writer.Write(Name.Length);
writer.WriteString(Name);
Console.WriteLine("pos " + writer.Position);
long sourceArrayPos = writer.Position;
writer.Write(uint.MaxValue);
writer.Write(ShaderPrograms.Count);
for (int i = 0; i < ShaderPrograms.Count; i++) {
long pos = writer.Position;
ShaderPrograms[i].Write(writer, this);
SharcCommon.WriteSectionSize(writer, pos);
}
writer.WriteUint32Offset(sourceArrayPos);
for (int i = 0; i < SourceDatas.Count; i++) {
long pos = writer.Position;
SourceDatas[i].Write(writer, this);
SharcCommon.WriteSectionSize(writer, pos);
}
using (writer.TemporarySeek(8, System.IO.SeekOrigin.Begin)) {
writer.Write((uint)writer.BaseStream.Length);
};
}
}
@ -143,6 +173,10 @@ namespace FirstPlugin
public ShaderSymbolData SamplerVariables;
public ShaderSymbolData AttributeVariables;
public int VertexShaderIndex;
public int FragmentShaderIndex;
public int GeoemetryShaderIndex;
public override void OnClick(TreeView treeview)
{
ShaderEditor editor = (ShaderEditor)LibraryGUI.GetActiveContent(typeof(ShaderEditor));
@ -166,9 +200,9 @@ namespace FirstPlugin
if (header.Version >= 13)
{
ushort vertexUnk1 = reader.ReadUInt16();
ushort fragmentUnk1 = reader.ReadUInt16();
ushort geometryUnk1 = reader.ReadUInt16();
VertexShaderIndex = reader.ReadInt32();
FragmentShaderIndex = reader.ReadInt32();
GeoemetryShaderIndex = reader.ReadInt32();
ushort computeUnk1 = reader.ReadUInt16();
ushort vertexUnk2 = reader.ReadUInt16();
ushort fragmentUnk2 = reader.ReadUInt16();
@ -177,12 +211,11 @@ namespace FirstPlugin
}
else
{
uint vertexUnk1 = reader.ReadUInt32();
uint fragmentUnk1 = reader.ReadUInt32();
uint geometryUnk1 = reader.ReadUInt32();
VertexShaderIndex = reader.ReadInt32();
FragmentShaderIndex = reader.ReadInt32();
GeoemetryShaderIndex = reader.ReadInt32();
}
Text = reader.ReadString((int)NameLength);
Text = reader.ReadString((int)NameLength, true);
variationVertexMacroData = new VariationMacroData();
variationFragmenMacroData = new VariationMacroData();
@ -224,6 +257,39 @@ namespace FirstPlugin
reader.Seek(SectionSize + pos, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer, SHARC.Header header)
{
writer.Write(uint.MaxValue);
writer.Write(Text.Length);
writer.Write(VertexShaderIndex);
writer.Write(FragmentShaderIndex);
writer.Write(GeoemetryShaderIndex);
variationVertexMacroData.Write(writer, header.Version);
variationFragmenMacroData.Write(writer, header.Version);
variationGeometryMacroData.Write(writer, header.Version);
if (header.Version >= 13)
{
variationComputeMacroData.Write(writer, header.Version);
}
variationSymbolData.Write(writer);
variationSymbolDataFull.Write(writer);
if (header.Version <= 12)
{
UniformVariables.Write(writer);
if (header.Version >= 11) {
UniformBlocks.Write(writer, header.Version);
}
SamplerVariables.Write(writer);
AttributeVariables.Write(writer);
}
}
}
public class SourceData : TreeNodeCustom
@ -253,15 +319,21 @@ namespace FirstPlugin
uint CodeLength = reader.ReadUInt32();
uint CodeLength2 = reader.ReadUInt32(); //?????
Text = reader.ReadString((int)FileNameLength);
// Code = reader.ReadString((int)CodeLength, Encoding.UTF32);
byte[] CodeData = reader.ReadBytes((int)CodeLength);
Code = Encoding.GetEncoding(932).GetString(CodeData);
byte[] data = reader.ReadBytes((int)CodeLength);
Code = Encoding.GetEncoding("shift_jis").GetString(data);
reader.Seek(SectioSize + pos, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter reader)
{
public void Write(FileWriter writer, SHARC.Header header)
{
var data = Encoding.GetEncoding("shift_jis").GetBytes(Code);
writer.Write(uint.MaxValue);
writer.Write(Name.Length);
writer.Write(data.Length);
writer.Write(data.Length);
writer.WriteString(Name);
writer.Write(data);
}
}
}

View File

@ -139,7 +139,6 @@ namespace FirstPlugin
Name = reader.ReadString((int)NameLength);
var pos = reader.Position;
uint BinarySectionSize = reader.ReadUInt32();
uint BinaryFileCount = reader.ReadUInt32();
@ -167,6 +166,7 @@ namespace FirstPlugin
}
}
public class ShaderProgram : TreeNodeCustom
{
public enum ShaderType
@ -309,7 +309,20 @@ namespace FirstPlugin
}
reader.Seek(SectionPos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer, uint Version = 12)
{
long pos = writer.Position;
writer.Write(uint.MaxValue);
writer.Write(macros.Count);
for (int i = 0; i < macros.Count; i++)
macros[i].Write(writer, Version);
SharcCommon.WriteSectionSize(writer, pos);
}
}
public class VariationMacro
{
public string Name { get; set; }
@ -334,6 +347,17 @@ namespace FirstPlugin
reader.Seek(pos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer, uint Version)
{
var pos = writer.Position;
writer.Write(uint.MaxValue);
writer.Write(Name.Length);
writer.Write(Value.Length);
writer.WriteString(Name);
writer.WriteString(Value);
SharcCommon.WriteSectionSize(writer, pos);
}
}
public class VariationSymbolData
@ -353,6 +377,17 @@ namespace FirstPlugin
}
reader.Seek(SectionPos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer)
{
var pos = writer.Position;
writer.Write(uint.MaxValue);
writer.Write(symbols.Count);
for (int i = 0; i < symbols.Count; i++)
symbols[i].Write(writer);
SharcCommon.WriteSectionSize(writer, pos);
}
}
public class VariationSymbol
{
@ -379,6 +414,18 @@ namespace FirstPlugin
reader.Seek(pos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer)
{
var pos = writer.Position;
writer.Write(Name.Length);
writer.Write(DefaultValue.Length);
writer.Write(SymbolName.Length);
writer.WriteString(Name);
writer.WriteString(DefaultValue);
writer.WriteString(SymbolName);
SharcCommon.WriteSectionSize(writer, pos);
}
}
public class ShaderSymbolData
@ -402,6 +449,17 @@ namespace FirstPlugin
reader.Seek(SectionPos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer, uint Version = 12)
{
var pos = writer.Position;
writer.Write(uint.MaxValue);
writer.Write(symbols.Count);
for (int i = 0; i < symbols.Count; i++)
symbols[i].Write(writer);
SharcCommon.WriteSectionSize(writer, pos);
}
}
public class ShaderSymbol
@ -516,6 +574,20 @@ namespace FirstPlugin
reader.Seek(pos + SectionSize, System.IO.SeekOrigin.Begin);
}
public void Write(FileWriter writer)
{
var pos = writer.Position;
writer.Write(0);
writer.Write(Name.Length);
writer.Write(SymbolName.Length);
writer.Write(DefaultValue.Length);
writer.Write(0);
writer.WriteString(Name);
writer.Write(DefaultValue);
writer.WriteString(SymbolName);
SharcCommon.WriteSectionSize(writer, pos);
}
public class SharcNXValue
{
public string Name { get; set; }

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Toolbox.Library.IO;
namespace FirstPlugin
{
public class SharcCommon
{
public static void WriteSectionSize(FileWriter writer, long startPos)
{
long endPos = writer.Position;
using (writer.TemporarySeek(startPos, System.IO.SeekOrigin.Begin)) {
writer.Write((uint)(endPos - startPos));
};
}
}
}

View File

@ -143,6 +143,12 @@
<Reference Include="SharpYaml">
<HintPath>..\Toolbox\Lib\SharpYaml.dll</HintPath>
</Reference>
<Reference Include="SPICA">
<HintPath>..\Toolbox\Lib\SPICA.dll</HintPath>
</Reference>
<Reference Include="SPICA.Rendering">
<HintPath>..\Toolbox\Lib\SPICA.Rendering.dll</HintPath>
</Reference>
<Reference Include="SuperBMDLib">
<HintPath>..\Toolbox\Lib\SuperBMDLib.dll</HintPath>
<Private>False</Private>
@ -216,6 +222,16 @@
<Compile Include="FileFormats\Archives\DARC.cs" />
<Compile Include="FileFormats\Archives\DAT_Bayonetta.cs" />
<Compile Include="FileFormats\Archives\GFA.cs" />
<Compile Include="FileFormats\BCH\BCH.cs" />
<Compile Include="FileFormats\BCH\MBN.cs" />
<Compile Include="FileFormats\BCH\Wrappers\BCHGroupNode.cs" />
<Compile Include="FileFormats\BCH\Wrappers\H3DTextureWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\Model\H3DBoneWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\Model\H3DMaterialWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\Model\H3DMeshWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\Model\H3DModelWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\Model\H3DSkeletonWrapper.cs" />
<Compile Include="FileFormats\BCH\Wrappers\SkeletalAnimation\H3DSkeletalAnimWrapper.cs" />
<Compile Include="FileFormats\LM1\LM1_MDL.cs" />
<Compile Include="FileFormats\MarioParty\HSF.cs" />
<Compile Include="FileFormats\MKAGPDX\LM2_ARCADE_Model.cs" />
@ -288,15 +304,6 @@
<Compile Include="FileFormats\Audio\MP3.cs" />
<Compile Include="FileFormats\Audio\Ogg.cs" />
<Compile Include="FileFormats\Audio\WAV.cs" />
<Compile Include="FileFormats\BCRES\BCRES.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\BCRESGroupNode.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\BcresMatTexture.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\CMDLWrapper.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\CRESBoneWrapper.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\CRESSkeletonWrapper.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\MTOBWrapper.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\CMDL\SOBJWrapper.cs" />
<Compile Include="FileFormats\BCRES\Wrappers\TXOBWrapper.cs" />
<Compile Include="FileFormats\BFRES\PlatformConverter\BfresPlatformConverter.cs" />
<Compile Include="FileFormats\BFRES\BFRESGroupNode.cs" />
<Compile Include="FileFormats\BFRES\BFRESAnimFolder.cs" />
@ -379,6 +386,7 @@
<Compile Include="FileFormats\Rom\3DS\NCCH.cs" />
<Compile Include="FileFormats\Rom\3DS\NCCHStructs.cs" />
<Compile Include="FileFormats\Rom\3DS\RomFSStructure.cs" />
<Compile Include="FileFormats\Shader\SHARC\SharcCommon.cs" />
<Compile Include="FileFormats\Texture\CTPK.cs" />
<Compile Include="FileFormats\Grezzo\CTXB.cs" />
<Compile Include="FileFormats\Texture\SIR0.cs" />
@ -387,6 +395,8 @@
<Compile Include="FileFormats\Rom\GCDisk.cs" />
<Compile Include="FileFormats\Texture\BTI.cs" />
<Compile Include="FileFormats\Texture\WTB.cs" />
<Compile Include="GL\BCH_Render.cs" />
<Compile Include="GL\BFRESRender.cs" />
<Compile Include="GL\BMD_Renderer.cs" />
<Compile Include="GL\CMB_Renderer.cs" />
<Compile Include="GL\GXToOpenGL.cs" />
@ -397,12 +407,91 @@
<Compile Include="GL\LM3_Renderer.cs" />
<Compile Include="GL\PunchOutWii_Renderer.cs" />
<Compile Include="GL\Strikers_Renderer.cs" />
<Compile Include="GUI\BCH\BCHMeshEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\BCHMeshEditor.Designer.cs">
<DependentUpon>BCHMeshEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\BCHModelEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\BCHModelEditor.Designer.cs">
<DependentUpon>BCHModelEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\BCHBoneEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\BCHBoneEditor.Designer.cs">
<DependentUpon>BCHBoneEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialGeneralEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialGeneralEditor.Designer.cs">
<DependentUpon>BCHMaterialGeneralEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialShaderParamEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialShaderParamEditor.Designer.cs">
<DependentUpon>BCHMaterialShaderParamEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialEditor.Designer.cs">
<DependentUpon>BCHMaterialEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialColorEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialColorEditor.Designer.cs">
<DependentUpon>BCHMaterialColorEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialBlendingEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialBlendingEditor.Designer.cs">
<DependentUpon>BCHMaterialBlendingEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialFragmentEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHMaterialFragmentEditor.Designer.cs">
<DependentUpon>BCHMaterialFragmentEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\BCHTextureMapEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\Material\BCHTextureMapEditor.Designer.cs">
<DependentUpon>BCHTextureMapEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\Material\IMaterialLoader.cs" />
<Compile Include="GUI\BCH\MetaData\UserDataEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCH\MetaData\UserDataEditor.Designer.cs">
<DependentUpon>UserDataEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCH\MetaData\UserDataParser.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\BCH\MetaData\UserDataParser.Designer.cs">
<DependentUpon>UserDataParser.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFLYT\Editor\PaneAnimationController.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFLYT\Editor\PaneAnimationController.Designer.cs">
<DependentUpon>PaneAnimationController.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFRES\Materials\RenderState\RenderStateEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFRES\Materials\RenderState\RenderStateEditor.Designer.cs">
<DependentUpon>RenderStateEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFRES\Materials\ShaderParams\TexSrtPanel2D.cs">
<SubType>UserControl</SubType>
</Compile>
@ -708,7 +797,7 @@
<Compile Include="FileFormats\Shader\NSWShaderDecompile.cs" />
<Compile Include="FileFormats\Shader\NUSHDB.cs" />
<Compile Include="FileFormats\Shader\NVNSH.cs" />
<Compile Include="FileFormats\Shader\SHARCFBNX.cs" />
<Compile Include="FileFormats\Shader\SHARC\SHARCFBNX.cs" />
<Compile Include="FileFormats\Texture\BCLIM.cs" />
<Compile Include="FileFormats\Texture\BFLIM.cs" />
<Compile Include="FileFormats\Layout\CAFE\BFLAN.cs" />
@ -718,7 +807,6 @@
<Compile Include="FileFormats\Texture\NUT.cs" />
<Compile Include="FileFormats\Texture\TEX3DS.cs" />
<Compile Include="FileFormats\XLINK\XLINK.cs" />
<Compile Include="GL\BCRES_Render.cs" />
<Compile Include="GL\GFBMDL_Render.cs" />
<Compile Include="GL\GMX_Renderer.cs" />
<Compile Include="GL\Helpers\DepthGLControl.cs" />
@ -734,7 +822,7 @@
<Compile Include="FileFormats\Audio\BFSTM.cs" />
<Compile Include="FileFormats\Archives\NARC.cs" />
<Compile Include="FileFormats\Archives\SDF.cs" />
<Compile Include="FileFormats\Shader\SHARCFB.cs" />
<Compile Include="FileFormats\Shader\SHARC\SHARCFB.cs" />
<Compile Include="FileFormats\Audio\BRSTM.cs" />
<Compile Include="GL\Helpers\AlphaGLControl.cs" />
<Compile Include="GL\Helpers\ColorGLControl.cs" />
@ -856,18 +944,6 @@
<Compile Include="Scenes\SMO_Scene.cs" />
<Compile Include="Scenes\ZTP_Scene.cs" />
<Compile Include="YAML\YamlAamp.cs" />
<Compile Include="GUI\BCRES\BcresEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCRES\BcresEditor.Designer.cs">
<DependentUpon>BcresEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BCRES\Material\SamplerEditorSimple.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BCRES\Material\SamplerEditorSimple.Designer.cs">
<DependentUpon>SamplerEditorSimple.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFRES\BoneVisualAnims\BoneVisualAnimEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@ -1306,7 +1382,7 @@
<Compile Include="FileFormats\Rom\NSP.cs" />
<Compile Include="FileFormats\Effects\PCTL.cs" />
<Compile Include="FileFormats\Archives\SARC.cs" />
<Compile Include="FileFormats\Shader\SHARC.cs" />
<Compile Include="FileFormats\Shader\SHARC\SHARC.cs" />
<Compile Include="FileFormats\Texture\BNTX.cs" />
<Compile Include="FileFormats\Effects\EFF.cs" />
<Compile Include="FileFormats\BFRES\Bfres Structs\SubFiles\FTEX.cs" />
@ -1316,7 +1392,7 @@
<Compile Include="FileFormats\Texture\XTX.cs" />
<Compile Include="FileFormats\Rom\XCI.cs" />
<Compile Include="GetSwitchKeys.cs" />
<Compile Include="GL\BFRES_Render.cs" />
<Compile Include="GL\BFRES\BFRES_Render.cs" />
<Compile Include="GUI\Advanced Editor\TextureViewer.cs">
<SubType>UserControl</SubType>
</Compile>
@ -1453,8 +1529,8 @@
<Compile Include="XML\Sharc2XML.cs" />
<Compile Include="YAML\YamlFmaa.cs" />
<Compile Include="YAML\YamlFmat.cs" />
<Compile Include="YAML\YamlFska.cs" />
<Compile Include="YAML\YamlFscn.cs" />
<Compile Include="YAML\YamlFska.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@ -1471,9 +1547,51 @@
<EmbeddedResource Include="GUI\AttributeEditor.resx">
<DependentUpon>AttributeEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\BCHMeshEditor.resx">
<DependentUpon>BCHMeshEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\BCHModelEditor.resx">
<DependentUpon>BCHModelEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\BCHBoneEditor.resx">
<DependentUpon>BCHBoneEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialGeneralEditor.resx">
<DependentUpon>BCHMaterialGeneralEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialBlendingEditor.resx">
<DependentUpon>BCHMaterialBlendingEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialColorEditor.resx">
<DependentUpon>BCHMaterialColorEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialEditor.resx">
<DependentUpon>BCHMaterialEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialFragmentEditor.resx">
<DependentUpon>BCHMaterialFragmentEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHMaterialShaderParamEditor.resx">
<DependentUpon>BCHMaterialShaderParamEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\Material\BCHTextureMapEditor.resx">
<DependentUpon>BCHTextureMapEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\MetaData\UserDataEditor.resx">
<DependentUpon>UserDataEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCH\MetaData\UserDataParser.resx">
<DependentUpon>UserDataParser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFLYT\Editor\PaneAnimationController.resx">
<DependentUpon>PaneAnimationController.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFRES\Materials\RenderState\RenderStateEditor.resx">
<DependentUpon>RenderStateEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFRES\Materials\ShaderParams\TexSrtPanel2D.resx">
<DependentUpon>TexSrtPanel2D.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\GFBMDL\GFLXMaterialEditor.resx">
<DependentUpon>GFLXMaterialEditor.cs</DependentUpon>
</EmbeddedResource>
@ -1492,12 +1610,6 @@
<EmbeddedResource Include="GUI\ViewportEditor.resx">
<DependentUpon>ViewportEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCRES\BcresEditor.resx">
<DependentUpon>BcresEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BCRES\Material\SamplerEditorSimple.resx">
<DependentUpon>SamplerEditorSimple.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFFNT\BffntEditor.resx">
<DependentUpon>BffntEditor.cs</DependentUpon>
</EmbeddedResource>
@ -2028,4 +2140,4 @@
<Content Include="Resources\Hashes\Pkmn.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SPICA.Formats.CtrH3D.Model.Mesh;
using Toolbox.Library.Forms;
namespace FirstPlugin.CtrLibrary.Forms
{
public partial class BCHMeshEditor : UserControl
{
public H3DMeshWrapper MeshWrapper;
public H3DMesh ActiveMesh => MeshWrapper.Mesh;
public BCHMeshEditor()
{
InitializeComponent();
stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
}
public void LoadMesh(H3DMeshWrapper mesh) {
MeshWrapper = mesh;
if (ActiveMesh.MetaData != null)
bchUserDataEditor1.LoadUserData(ActiveMesh.MetaData);
}
}
}

View File

@ -368,7 +368,7 @@ namespace FirstPlugin.CtrLibrary.Forms
if (index == -1 || !(comboBox.SelectedItem is PICATextureCombinerSource))
return;
switch ((PICATextureCombinerSource)comboBox.SelectedItem)
/* switch ((PICATextureCombinerSource)comboBox.SelectedItem)
{
case PICATextureCombinerSource.Texture0:
if (CombinerImages.ContainsKey("Texture0"))
@ -382,7 +382,7 @@ namespace FirstPlugin.CtrLibrary.Forms
if (CombinerImages.ContainsKey("Texture2"))
comboBox.Items[index].Image = CombinerImages["Texture2"];
break;
}
}*/
}
private void layerCB_SelectedIndexChanged(object sender, EventArgs e) {

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Toolbox.Library.Compression.Formats
{
class BPE
{
}
}

View File

@ -793,11 +793,10 @@ namespace Toolbox.Library.Collada
Writer.WriteStartElement("instance_material");
Writer.WriteAttributeString("symbol", mat);
Writer.WriteAttributeString("target", "#" + mat);
Writer.WriteEndElement();
WriteChannel(0);
WriteChannel(1);
WriteChannel(2);
Writer.WriteEndElement();
}
Writer.WriteEndElement();
Writer.WriteEndElement();

View File

@ -95,7 +95,8 @@ namespace Toolbox.Library
List<string> textureNames = new List<string>();
for (int i = 0; i < Textures?.Count; i++)
{
textureNames.Add(Textures[i].Text);
if (!textureNames.Contains(Textures[i].Text))
textureNames.Add(Textures[i].Text);
if (settings.ExportTextures) {
@ -176,7 +177,7 @@ namespace Toolbox.Library
//If no textures are saved, still keep images references
//So the user can still dump textures after
if (Textures?.Count == 0)
if (Textures?.Count == 0 && !textureNames.Contains(texMap.Name))
textureNames.Add($"{texMap.Name}");
material.Textures.Add(texMap);

View File

@ -554,6 +554,7 @@ namespace Toolbox.Library
return Convert(data, width, height, DXGI_FORMAT.R8G8B8A8_UNORM, (DXGI_FORMAT)format);
}
public static unsafe byte[] Convert(Byte[] data, int width, int height, DXGI_FORMAT inputFormat, DXGI_FORMAT outputFormat)
{
long inputRowPitch;

View File

@ -102,8 +102,7 @@ namespace Toolbox.Library
if (GenericPluginLoader._Plugins == null)
GenericPluginLoader.LoadPlugin();
foreach (var plugin in GenericPluginLoader._Plugins)
{
foreach (var plugin in GenericPluginLoader._Plugins) {
LoadCompressionFormats(plugin.Value.Types, types);
}

View File

@ -310,13 +310,13 @@ namespace Toolbox.Library.Forms
if (!huePanel.Enabled)
{
for (int i = 0; i < _mainBrush.SurroundColors.Length; i++)
_mainBrush.SurroundColors[i] = _mainBrush.SurroundColors[i].Darken(190);
_boxColors[0] = _boxColors[4] = new HSVPixel(_hsv.H, 0, 50).ToRGBA();
_mainBrush.SurroundColors = _boxColors;
_mainBrush.CenterColor = new HSVPixel(_hsv.H, 0, 50).ToRGBA();
}
g.FillRectangle(_mainBrush, r);
//Draw indicator
int x = (int)(_hsv.V / 100.0f * colorSquare.Width);
int y = (int)((100 - _hsv.S) / 100.0f * colorSquare.Height);

View File

@ -0,0 +1,13 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace Toolbox.Library.Forms
{
public class ImagedComboBox : STComboBox
{
}
}

View File

@ -970,6 +970,7 @@ namespace Toolbox.Library
{
var prevNode = (TreeNode)ArchiveFileInfo.FileFormat;
var parent = prevNode.Parent;
if (parent == null) return;
var index = parent.Nodes.IndexOf(prevNode);
parent.Nodes.RemoveAt(index);

View File

@ -227,6 +227,7 @@
<Compile Include="Compression\7ZIP\LZ\LzBinTree.cs" />
<Compile Include="Compression\7ZIP\LZ\LzInWindow.cs" />
<Compile Include="Compression\7ZIP\LZ\LzOutWindow.cs" />
<Compile Include="Compression\Formats\BPE.cs" />
<Compile Include="Compression\Formats\Gzip.cs" />
<Compile Include="Compression\Formats\lz4.cs" />
<Compile Include="Compression\Formats\LZ4F.cs" />
@ -283,12 +284,21 @@
<Compile Include="Forms\Color\AlphaSelectorHorizontalPanel.Designer.cs">
<DependentUpon>AlphaSelectorHorizontalPanel.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Color\STColorControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\Color\STColorControl.Designer.cs">
<DependentUpon>STColorControl.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Color\VertexColorBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\Color\VertexColorTopBottomBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\Custom\ComboBox\ImagedComboBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Forms\Custom\SideMenu\STVerticalNavigationMenu.cs">
<SubType>UserControl</SubType>
</Compile>
@ -959,6 +969,9 @@
<EmbeddedResource Include="Forms\Color\ColorSelector.resx">
<DependentUpon>ColorSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Color\STColorControl.resx">
<DependentUpon>STColorControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Custom\ColorSlider.resx" />
<EmbeddedResource Include="Forms\Custom\DropdownPanel\STCollapsePanelButton.resx">
<DependentUpon>STCollapsePanelButton.cs</DependentUpon>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.