Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-07-16 23:35:21 +02:00
|
|
|
|
using Toolbox;
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
using System.Windows.Forms;
|
2019-07-16 23:35:21 +02:00
|
|
|
|
using Toolbox.Library;
|
2019-08-30 01:35:50 +02:00
|
|
|
|
using Toolbox.Library.Forms;
|
2019-08-04 17:50:57 +02:00
|
|
|
|
using Toolbox.Library.IO;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
using FirstPlugin.Forms;
|
|
|
|
|
using Syroot.Maths;
|
|
|
|
|
using SharpYaml.Serialization;
|
2019-08-29 22:33:23 +02:00
|
|
|
|
using FirstPlugin;
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
namespace LayoutBXLYT
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public class BFLYT : IFileFormat, IEditorForm<LayoutEditor>, IConvertableTextFormat
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
{
|
2019-05-08 22:45:27 +02:00
|
|
|
|
public FileType FileType { get; set; } = FileType.Layout;
|
|
|
|
|
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
public bool CanSave { get; set; }
|
|
|
|
|
public string[] Description { get; set; } = new string[] { "Cafe Layout (GUI)" };
|
|
|
|
|
public string[] Extension { get; set; } = new string[] { "*.bflyt" };
|
|
|
|
|
public string FileName { get; set; }
|
|
|
|
|
public string FilePath { get; set; }
|
|
|
|
|
public IFileInfo IFileInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Identify(System.IO.Stream stream)
|
|
|
|
|
{
|
2019-07-16 23:35:21 +02:00
|
|
|
|
using (var reader = new Toolbox.Library.IO.FileReader(stream, true))
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
{
|
|
|
|
|
return reader.CheckSignature(4, "FLYT");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Type[] Types
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
List<Type> types = new List<Type>();
|
2019-08-30 01:35:50 +02:00
|
|
|
|
types.Add(typeof(MenuExt));
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
return types.ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-30 01:35:50 +02:00
|
|
|
|
class MenuExt : IFileMenuExtension
|
|
|
|
|
{
|
|
|
|
|
public STToolStripItem[] NewFileMenuExtensions => newFileExt;
|
|
|
|
|
public STToolStripItem[] NewFromFileMenuExtensions => null;
|
|
|
|
|
public STToolStripItem[] ToolsMenuExtensions => null;
|
|
|
|
|
public STToolStripItem[] TitleBarExtensions => null;
|
|
|
|
|
public STToolStripItem[] CompressionMenuExtensions => null;
|
|
|
|
|
public STToolStripItem[] ExperimentalMenuExtensions => null;
|
|
|
|
|
public STToolStripItem[] EditMenuExtensions => null;
|
|
|
|
|
public ToolStripButton[] IconButtonMenuExtensions => null;
|
|
|
|
|
|
|
|
|
|
STToolStripItem[] newFileExt = new STToolStripItem[1];
|
|
|
|
|
|
|
|
|
|
public MenuExt()
|
|
|
|
|
{
|
|
|
|
|
newFileExt[0] = new STToolStripItem("Layout Editor");
|
|
|
|
|
newFileExt[0].Click += LoadNewLayoutEditor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LoadNewLayoutEditor(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LayoutEditor editor = new LayoutEditor();
|
|
|
|
|
editor.Show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
#region Text Converter Interface
|
|
|
|
|
public TextFileType TextFileType => TextFileType.Xml;
|
2019-08-28 01:03:01 +02:00
|
|
|
|
public bool CanConvertBack => false;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
public string ConvertToString()
|
|
|
|
|
{
|
|
|
|
|
var serializerSettings = new SerializerSettings()
|
|
|
|
|
{
|
|
|
|
|
// EmitTags = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
serializerSettings.DefaultStyle = SharpYaml.YamlStyle.Any;
|
|
|
|
|
serializerSettings.ComparerForKeySorting = null;
|
|
|
|
|
serializerSettings.RegisterTagMapping("Header", typeof(Header));
|
|
|
|
|
|
|
|
|
|
var serializer = new Serializer(serializerSettings);
|
|
|
|
|
string yaml = serializer.Serialize(header, typeof(Header));
|
|
|
|
|
return yaml;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ConvertFromString(string text)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public LayoutEditor OpenForm()
|
|
|
|
|
{
|
|
|
|
|
LayoutEditor editor = new LayoutEditor();
|
|
|
|
|
editor.Dock = DockStyle.Fill;
|
|
|
|
|
editor.LoadBflyt(header, FileName);
|
|
|
|
|
return editor;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public void FillEditor(Form control) {
|
2019-08-27 22:38:06 +02:00
|
|
|
|
((LayoutEditor)control).LoadBflyt(header, FileName);
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-30 00:05:44 +02:00
|
|
|
|
public Header header;
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
public void Load(System.IO.Stream stream)
|
|
|
|
|
{
|
2019-08-28 01:03:01 +02:00
|
|
|
|
CanSave = false;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
header = new Header();
|
2019-08-29 21:45:32 +02:00
|
|
|
|
header.Read(new FileReader(stream), this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<GTXFile> GetShadersGTX()
|
|
|
|
|
{
|
|
|
|
|
List<GTXFile> shaders = new List<GTXFile>();
|
|
|
|
|
if (IFileInfo.ArchiveParent != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var file in IFileInfo.ArchiveParent.Files)
|
|
|
|
|
{
|
|
|
|
|
if (Utils.GetExtension(file.FileName) == ".gsh")
|
|
|
|
|
{
|
|
|
|
|
GTXFile bnsh = (GTXFile)file.OpenFile();
|
|
|
|
|
shaders.Add(bnsh);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return shaders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<BNSH> GetShadersNX()
|
|
|
|
|
{
|
|
|
|
|
List<BNSH> shaders = new List<BNSH>();
|
|
|
|
|
if (IFileInfo.ArchiveParent != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var file in IFileInfo.ArchiveParent.Files)
|
|
|
|
|
{
|
|
|
|
|
if (Utils.GetExtension(file.FileName) == ".bnsh")
|
|
|
|
|
{
|
|
|
|
|
BNSH bnsh = (BNSH)file.OpenFile();
|
|
|
|
|
shaders.Add(bnsh);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return shaders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<BFLYT> GetLayouts()
|
|
|
|
|
{
|
|
|
|
|
List<BFLYT> animations = new List<BFLYT>();
|
|
|
|
|
if (IFileInfo.ArchiveParent != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var file in IFileInfo.ArchiveParent.Files)
|
|
|
|
|
{
|
|
|
|
|
if (Utils.GetExtension(file.FileName) == ".bflyt")
|
|
|
|
|
{
|
|
|
|
|
BFLYT bflyt = (BFLYT)file.OpenFile();
|
|
|
|
|
animations.Add(bflyt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return animations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<BFLAN> GetAnimations()
|
|
|
|
|
{
|
|
|
|
|
List<BFLAN> animations = new List<BFLAN>();
|
|
|
|
|
if (IFileInfo.ArchiveParent != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var file in IFileInfo.ArchiveParent.Files)
|
|
|
|
|
{
|
|
|
|
|
if (Utils.GetExtension(file.FileName) == ".bflan")
|
|
|
|
|
{
|
|
|
|
|
BFLAN bflan = (BFLAN)file.OpenFile();
|
|
|
|
|
animations.Add(bflan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return animations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Dictionary<string, STGenericTexture> GetTextures()
|
|
|
|
|
{
|
|
|
|
|
Dictionary<string, STGenericTexture> textures = new Dictionary<string, STGenericTexture>();
|
|
|
|
|
if (IFileInfo.ArchiveParent != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var file in IFileInfo.ArchiveParent.Files)
|
|
|
|
|
{
|
|
|
|
|
if (Utils.GetExtension(file.FileName) == ".bntx")
|
|
|
|
|
{
|
|
|
|
|
BNTX bntx = (BNTX)file.OpenFile();
|
|
|
|
|
foreach (var tex in bntx.Textures)
|
|
|
|
|
textures.Add(tex.Key, tex.Value);
|
|
|
|
|
}
|
|
|
|
|
else if (Utils.GetExtension(file.FileName) == ".bflim")
|
|
|
|
|
{
|
|
|
|
|
BFLIM bflim = (BFLIM)file.OpenFile();
|
|
|
|
|
textures.Add(bflim.FileName, bflim);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return textures;
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
public void Unload()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2019-08-06 23:35:18 +02:00
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public void Save(System.IO.Stream stream) {
|
|
|
|
|
header.Write(new FileWriter(stream));
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
}
|
2019-08-04 17:50:57 +02:00
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
//Thanks to SwitchThemes for flags, and enums
|
|
|
|
|
//https://github.com/FuryBaguette/SwitchLayoutEditor/tree/master/SwitchThemesCommon
|
2019-08-30 01:01:47 +02:00
|
|
|
|
public class Header : BxlytHeader, IDisposable
|
2019-08-04 17:50:57 +02:00
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public string FileName
|
|
|
|
|
{
|
|
|
|
|
get { return FileInfo.FileName; }
|
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
2019-08-04 17:50:57 +02:00
|
|
|
|
private const string Magic = "FLYT";
|
|
|
|
|
|
|
|
|
|
private ushort ByteOrderMark;
|
|
|
|
|
private ushort HeaderSize;
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public LYT1 LayoutInfo { get; set; }
|
|
|
|
|
public TXL1 TextureList { get; set; }
|
|
|
|
|
public MAT1 MaterialList { get; set; }
|
|
|
|
|
public FNL1 FontList { get; set; }
|
|
|
|
|
// private List<SectionCommon> Sections;
|
2019-08-29 23:17:24 +02:00
|
|
|
|
// public List<PAN1> Panes = new List<PAN1>();
|
|
|
|
|
|
|
|
|
|
public override List<string> Textures
|
|
|
|
|
{
|
|
|
|
|
get { return TextureList.Textures; }
|
|
|
|
|
}
|
2019-08-04 17:50:57 +02:00
|
|
|
|
|
2019-08-29 23:17:24 +02:00
|
|
|
|
public override Dictionary<string, STGenericTexture> GetTextures
|
|
|
|
|
{
|
2019-08-30 01:01:47 +02:00
|
|
|
|
get { return ((BFLYT)FileInfo).GetTextures(); }
|
2019-08-29 23:17:24 +02:00
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public void Read(FileReader reader, BFLYT bflyt)
|
2019-08-04 17:50:57 +02:00
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
LayoutInfo = new LYT1();
|
|
|
|
|
TextureList = new TXL1();
|
|
|
|
|
MaterialList = new MAT1();
|
|
|
|
|
FontList = new FNL1();
|
|
|
|
|
RootPane = new PAN1();
|
|
|
|
|
RootGroup = new GRP1();
|
|
|
|
|
|
|
|
|
|
FileInfo = bflyt;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
reader.SetByteOrder(true);
|
2019-08-04 17:50:57 +02:00
|
|
|
|
reader.ReadSignature(4, Magic);
|
|
|
|
|
ByteOrderMark = reader.ReadUInt16();
|
|
|
|
|
reader.CheckByteOrderMark(ByteOrderMark);
|
|
|
|
|
HeaderSize = reader.ReadUInt16();
|
|
|
|
|
Version = reader.ReadUInt32();
|
|
|
|
|
uint FileSize = reader.ReadUInt32();
|
|
|
|
|
ushort sectionCount = reader.ReadUInt16();
|
|
|
|
|
reader.ReadUInt16(); //Padding
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
bool setRoot = false;
|
|
|
|
|
bool setGroupRoot = false;
|
|
|
|
|
|
|
|
|
|
BasePane currentPane = null;
|
|
|
|
|
BasePane parentPane = null;
|
|
|
|
|
|
2019-08-04 17:50:57 +02:00
|
|
|
|
reader.SeekBegin(HeaderSize);
|
|
|
|
|
for (int i = 0; i < sectionCount; i++)
|
|
|
|
|
{
|
|
|
|
|
long pos = reader.Position;
|
|
|
|
|
|
|
|
|
|
string Signature = reader.ReadString(4, Encoding.ASCII);
|
|
|
|
|
uint SectionSize = reader.ReadUInt32();
|
|
|
|
|
|
|
|
|
|
SectionCommon section = new SectionCommon();
|
|
|
|
|
switch (Signature)
|
|
|
|
|
{
|
2019-08-27 22:38:06 +02:00
|
|
|
|
case "lyt1":
|
|
|
|
|
LayoutInfo = new LYT1(reader);
|
|
|
|
|
break;
|
|
|
|
|
case "txl1":
|
|
|
|
|
TextureList = new TXL1(reader);
|
|
|
|
|
break;
|
|
|
|
|
case "fnl1":
|
|
|
|
|
FontList = new FNL1(reader);
|
|
|
|
|
break;
|
|
|
|
|
case "mat1":
|
|
|
|
|
MaterialList = new MAT1(reader, this);
|
|
|
|
|
break;
|
|
|
|
|
case "pan1":
|
|
|
|
|
var panel = new PAN1(reader);
|
|
|
|
|
if (!setRoot)
|
|
|
|
|
{
|
|
|
|
|
RootPane = panel;
|
|
|
|
|
setRoot = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetPane(panel, parentPane);
|
|
|
|
|
currentPane = panel;
|
|
|
|
|
break;
|
|
|
|
|
case "pic1":
|
2019-08-29 21:45:32 +02:00
|
|
|
|
var picturePanel = new PIC1(reader, this);
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
SetPane(picturePanel, parentPane);
|
|
|
|
|
currentPane = picturePanel;
|
|
|
|
|
break;
|
|
|
|
|
case "txt1":
|
|
|
|
|
var textPanel = new TXT1(reader);
|
|
|
|
|
|
|
|
|
|
SetPane(textPanel, parentPane);
|
|
|
|
|
currentPane = textPanel;
|
|
|
|
|
break;
|
|
|
|
|
case "bnd1":
|
|
|
|
|
var boundsPanel = new BND1(reader);
|
|
|
|
|
|
|
|
|
|
SetPane(boundsPanel, parentPane);
|
|
|
|
|
currentPane = boundsPanel;
|
|
|
|
|
break;
|
|
|
|
|
case "prt1":
|
|
|
|
|
var partsPanel = new PRT1(reader);
|
|
|
|
|
|
|
|
|
|
SetPane(partsPanel, parentPane);
|
|
|
|
|
currentPane = partsPanel;
|
|
|
|
|
break;
|
|
|
|
|
case "wnd1":
|
2019-08-29 21:45:32 +02:00
|
|
|
|
var windowPanel = new WND1(reader);
|
2019-08-27 22:38:06 +02:00
|
|
|
|
SetPane(windowPanel, parentPane);
|
|
|
|
|
currentPane = windowPanel;
|
|
|
|
|
break;
|
|
|
|
|
case "cnt1":
|
|
|
|
|
break;
|
|
|
|
|
case "pas1":
|
|
|
|
|
if (currentPane != null)
|
|
|
|
|
parentPane = currentPane;
|
|
|
|
|
break;
|
|
|
|
|
case "pae1":
|
|
|
|
|
currentPane = parentPane;
|
|
|
|
|
parentPane = currentPane.Parent;
|
|
|
|
|
break;
|
|
|
|
|
case "grp1":
|
|
|
|
|
var groupPanel = new GRP1(reader, this);
|
|
|
|
|
|
|
|
|
|
if (!setGroupRoot)
|
|
|
|
|
{
|
|
|
|
|
RootGroup = groupPanel;
|
|
|
|
|
setGroupRoot = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case "grs1":
|
|
|
|
|
break;
|
|
|
|
|
case "gre1":
|
|
|
|
|
break;
|
|
|
|
|
case "usd1":
|
|
|
|
|
break;
|
2019-08-04 17:50:57 +02:00
|
|
|
|
//If the section is not supported store the raw bytes
|
|
|
|
|
default:
|
|
|
|
|
section.Data = reader.ReadBytes((int)SectionSize);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
section.Signature = Signature;
|
|
|
|
|
section.SectionSize = SectionSize;
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
reader.SeekBegin(pos + SectionSize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetPane(BasePane pane, BasePane parentPane)
|
|
|
|
|
{
|
|
|
|
|
if (parentPane != null)
|
|
|
|
|
{
|
|
|
|
|
parentPane.Childern.Add(pane);
|
|
|
|
|
pane.Parent = parentPane;
|
2019-08-04 17:50:57 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Write(FileWriter writer)
|
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
Version = VersionMajor << 24 | VersionMinor << 16 | VersionMicro << 8 | VersionMicro2;
|
|
|
|
|
|
2019-08-04 17:50:57 +02:00
|
|
|
|
writer.WriteSignature(Magic);
|
|
|
|
|
writer.Write(ByteOrderMark);
|
|
|
|
|
writer.Write(HeaderSize);
|
|
|
|
|
writer.Write(Version);
|
|
|
|
|
writer.Write(uint.MaxValue); //Reserve space for file size later
|
|
|
|
|
writer.Write(ushort.MaxValue); //Reserve space for section count later
|
|
|
|
|
writer.Seek(2); //padding
|
|
|
|
|
|
|
|
|
|
//Write the total file size
|
|
|
|
|
using (writer.TemporarySeek(0x0C, System.IO.SeekOrigin.Begin))
|
|
|
|
|
{
|
|
|
|
|
writer.Write((uint)writer.BaseStream.Length);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public class TexCoord
|
|
|
|
|
{
|
|
|
|
|
public Vector2F TopLeft { get; set; }
|
|
|
|
|
public Vector2F TopRight { get; set; }
|
|
|
|
|
public Vector2F BottomLeft { get; set; }
|
|
|
|
|
public Vector2F BottomRight { get; set; }
|
|
|
|
|
|
|
|
|
|
public TexCoord()
|
|
|
|
|
{
|
|
|
|
|
TopLeft = new Vector2F(0, 0);
|
|
|
|
|
TopRight = new Vector2F(1, 0);
|
|
|
|
|
BottomLeft = new Vector2F(0, 1);
|
|
|
|
|
BottomRight = new Vector2F(1, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TXT1 : PAN1
|
|
|
|
|
{
|
|
|
|
|
public TXT1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginX HorizontalAlignment
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginX)((TextAlignment >> 2) & 0x3); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
TextAlignment &= unchecked((byte)(~0xC));
|
|
|
|
|
TextAlignment |= (byte)((byte)(value) << 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginX VerticalAlignment
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginX)((TextAlignment) & 0x3); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
TextAlignment &= unchecked((byte)(~0x3));
|
|
|
|
|
TextAlignment |= (byte)(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public ushort TextLength { get; set; }
|
|
|
|
|
public ushort MaxTextLength { get; set; }
|
|
|
|
|
public ushort MaterialIndex { get; set; }
|
|
|
|
|
public ushort FontIndex { get; set; }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
public byte TextAlignment { get; set; }
|
|
|
|
|
public LineAlign LineAlignment { get; set; }
|
|
|
|
|
|
|
|
|
|
public float ItalicTilt { get; set; }
|
|
|
|
|
|
|
|
|
|
public STColor8 FontForeColor { get; set; }
|
|
|
|
|
public STColor8 FontBackColor { get; set; }
|
|
|
|
|
public Vector2F FontSize { get; set; }
|
|
|
|
|
|
|
|
|
|
public float CharacterSpace { get; set; }
|
|
|
|
|
public float LineSpace { get; set; }
|
|
|
|
|
|
|
|
|
|
public Vector2F ShadowXY { get; set; }
|
|
|
|
|
public Vector2F ShadowXYSize { get; set; }
|
|
|
|
|
|
|
|
|
|
public STColor8 ShadowForeColor { get; set; }
|
|
|
|
|
public STColor8 ShadowBackColor { get; set; }
|
|
|
|
|
|
|
|
|
|
public float ShadowItalic { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool PerCharTransform
|
|
|
|
|
{
|
|
|
|
|
get { return (_flags & 0x10) != 0; }
|
|
|
|
|
set { _flags = value ? (byte)(_flags | 0x10) : unchecked((byte)(_flags & (~0x10))); }
|
|
|
|
|
}
|
|
|
|
|
public bool RestrictedTextLengthEnabled
|
|
|
|
|
{
|
|
|
|
|
get { return (_flags & 0x2) != 0; }
|
|
|
|
|
set { _flags = value ? (byte)(_flags | 0x2) : unchecked((byte)(_flags & (~0x2))); }
|
|
|
|
|
}
|
|
|
|
|
public bool ShadowEnabled
|
|
|
|
|
{
|
|
|
|
|
get { return (_flags & 1) != 0; }
|
|
|
|
|
set { _flags = value ? (byte)(_flags | 1) : unchecked((byte)(_flags & (~1))); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private byte _flags;
|
|
|
|
|
|
|
|
|
|
public TXT1(FileReader reader) : base(reader)
|
|
|
|
|
{
|
|
|
|
|
TextLength = reader.ReadUInt16();
|
|
|
|
|
MaxTextLength = reader.ReadUInt16();
|
|
|
|
|
MaterialIndex = reader.ReadUInt16();
|
|
|
|
|
FontIndex = reader.ReadUInt16();
|
|
|
|
|
TextAlignment = reader.ReadByte();
|
|
|
|
|
LineAlignment = (LineAlign)reader.ReadByte();
|
|
|
|
|
_flags = reader.ReadByte();
|
|
|
|
|
reader.Seek(1); //padding
|
|
|
|
|
ItalicTilt = reader.ReadSingle();
|
|
|
|
|
uint textOffset = reader.ReadUInt32();
|
|
|
|
|
FontForeColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
FontBackColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
FontSize = reader.ReadVec2SY();
|
|
|
|
|
CharacterSpace = reader.ReadSingle();
|
|
|
|
|
LineSpace = reader.ReadSingle();
|
|
|
|
|
ShadowXY = reader.ReadVec2SY();
|
|
|
|
|
ShadowXYSize = reader.ReadVec2SY();
|
|
|
|
|
ShadowForeColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
ShadowBackColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
ShadowItalic = reader.ReadSingle();
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
base.Write(writer, header);
|
|
|
|
|
writer.Write(TextLength);
|
|
|
|
|
writer.Write(MaxTextLength);
|
|
|
|
|
writer.Write(MaterialIndex);
|
|
|
|
|
writer.Write(FontIndex);
|
|
|
|
|
writer.Write(TextAlignment);
|
|
|
|
|
writer.Write(LineAlignment, false);
|
|
|
|
|
writer.Write(_flags);
|
|
|
|
|
writer.Seek(1);
|
|
|
|
|
writer.Write(ItalicTilt);
|
|
|
|
|
writer.Write(0); //text offset
|
|
|
|
|
writer.Write(FontForeColor.ToBytes());
|
|
|
|
|
writer.Write(FontBackColor.ToBytes());
|
|
|
|
|
writer.Write(FontSize);
|
|
|
|
|
writer.Write(CharacterSpace);
|
|
|
|
|
writer.Write(LineSpace);
|
|
|
|
|
writer.Write(ShadowXY);
|
|
|
|
|
writer.Write(ShadowXYSize);
|
|
|
|
|
writer.Write(ShadowForeColor.ToBytes());
|
|
|
|
|
writer.Write(ShadowBackColor.ToBytes());
|
|
|
|
|
writer.Write(ShadowItalic);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum BorderType : byte
|
|
|
|
|
{
|
|
|
|
|
Standard = 0,
|
|
|
|
|
DeleteBorder = 1,
|
|
|
|
|
RenderTwoCycles = 2,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public enum LineAlign : byte
|
|
|
|
|
{
|
|
|
|
|
Unspecified = 0,
|
|
|
|
|
Left = 1,
|
|
|
|
|
Center = 2,
|
|
|
|
|
Right = 3,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class WND1 : PAN1
|
|
|
|
|
{
|
|
|
|
|
public WND1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WND1(FileReader reader) : base(reader)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
base.Write(writer, header);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BND1 : PAN1
|
|
|
|
|
{
|
|
|
|
|
public BND1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BND1(FileReader reader) : base(reader)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
base.Write(writer, header);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public class GRP1 : BasePane
|
|
|
|
|
{
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public List<string> Panes { get; set; } = new List<string>();
|
|
|
|
|
|
|
|
|
|
public GRP1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GRP1(FileReader reader, Header header)
|
|
|
|
|
{
|
|
|
|
|
ushort numNodes = 0;
|
2019-08-29 21:45:32 +02:00
|
|
|
|
if (header.VersionMajor >= 5)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
Name = reader.ReadString(34).Replace("\0", string.Empty);
|
|
|
|
|
numNodes = reader.ReadUInt16();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Name = reader.ReadString(24).Replace("\0", string.Empty);
|
|
|
|
|
numNodes = reader.ReadUInt16();
|
|
|
|
|
reader.Seek(2); //padding
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < numNodes; i++)
|
|
|
|
|
Panes.Add(reader.ReadString(24));
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
if (header.Version >= 0x05020000)
|
|
|
|
|
{
|
|
|
|
|
writer.WriteString(Name, 34);
|
|
|
|
|
writer.Write((ushort)Panes.Count);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
writer.WriteString(Name, 24);
|
|
|
|
|
writer.Write((ushort)Panes.Count);
|
|
|
|
|
writer.Seek(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < Panes.Count; i++)
|
|
|
|
|
writer.WriteString(Panes[i], 24);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PRT1 : PAN1
|
|
|
|
|
{
|
|
|
|
|
public PRT1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PRT1(FileReader reader) : base(reader)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
base.Write(writer, header);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PIC1 : PAN1
|
|
|
|
|
{
|
|
|
|
|
public TexCoord[] TexCoords { get; set; }
|
|
|
|
|
|
|
|
|
|
public STColor8 ColorTopLeft { get; set; }
|
|
|
|
|
public STColor8 ColorTopRight { get; set; }
|
|
|
|
|
public STColor8 ColorBottomLeft { get; set; }
|
|
|
|
|
public STColor8 ColorBottomRight { get; set; }
|
|
|
|
|
|
|
|
|
|
public ushort MaterialIndex { get; set; }
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public Material GetMaterial()
|
|
|
|
|
{
|
|
|
|
|
return ParentLayout.MaterialList.Materials[MaterialIndex];
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public string GetTexture(int index)
|
|
|
|
|
{
|
|
|
|
|
var mat = GetMaterial();
|
|
|
|
|
return ParentLayout.TextureList.Textures[mat.TextureMaps[index].ID];
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
private BFLYT.Header ParentLayout;
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public PIC1() : base() {
|
|
|
|
|
ColorTopLeft = STColor8.White;
|
|
|
|
|
ColorTopRight = STColor8.White;
|
|
|
|
|
ColorBottomLeft = STColor8.White;
|
|
|
|
|
ColorBottomRight = STColor8.White;
|
|
|
|
|
MaterialIndex = 0;
|
|
|
|
|
TexCoords = new TexCoord[1];
|
|
|
|
|
TexCoords[0] = new TexCoord();
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public PIC1(FileReader reader, BFLYT.Header header) : base(reader)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
ParentLayout = header;
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
ColorTopLeft = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
ColorTopRight = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
ColorBottomLeft = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
ColorBottomRight = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
MaterialIndex = reader.ReadUInt16();
|
|
|
|
|
byte numUVs = reader.ReadByte();
|
|
|
|
|
reader.Seek(1); //padding
|
2019-08-29 21:45:32 +02:00
|
|
|
|
|
|
|
|
|
TexCoords = new TexCoord[numUVs];
|
|
|
|
|
for (int i = 0; i < numUVs; i++)
|
|
|
|
|
{
|
|
|
|
|
TexCoords[i] = new TexCoord()
|
|
|
|
|
{
|
|
|
|
|
TopLeft = reader.ReadVec2SY(),
|
|
|
|
|
TopRight = reader.ReadVec2SY(),
|
|
|
|
|
BottomLeft = reader.ReadVec2SY(),
|
|
|
|
|
BottomRight = reader.ReadVec2SY(),
|
|
|
|
|
};
|
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
base.Write(writer, header);
|
|
|
|
|
writer.Write(ColorTopLeft.ToBytes());
|
|
|
|
|
writer.Write(ColorTopRight.ToBytes());
|
|
|
|
|
writer.Write(ColorBottomLeft.ToBytes());
|
|
|
|
|
writer.Write(ColorBottomRight.ToBytes());
|
|
|
|
|
writer.Write(MaterialIndex);
|
|
|
|
|
writer.Write(TexCoords != null ? TexCoords.Length : 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PAN1 : BasePane
|
|
|
|
|
{
|
|
|
|
|
private byte _flags1;
|
|
|
|
|
private byte _flags2;
|
|
|
|
|
|
|
|
|
|
public bool Visible
|
|
|
|
|
{
|
|
|
|
|
get { return (_flags1 & 0x1) == 0x1; }
|
|
|
|
|
set {
|
|
|
|
|
if (value)
|
|
|
|
|
_flags1 |= 0x1;
|
|
|
|
|
else
|
|
|
|
|
_flags1 &= 0xFE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool InfluenceAlpha
|
|
|
|
|
{
|
|
|
|
|
get { return (_flags1 & 0x2) == 0x2; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value)
|
|
|
|
|
_flags1 |= 0x2;
|
|
|
|
|
else
|
|
|
|
|
_flags1 &= 0xFD;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginX originX
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginX)((_flags2 & 0xC0) >> 6); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_flags2 &= unchecked((byte)(~0xC0));
|
|
|
|
|
_flags2 |= (byte)((byte)value << 6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginY originY
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginY)((_flags2 & 0x30) >> 4); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_flags2 &= unchecked((byte)(~0x30));
|
|
|
|
|
_flags2 |= (byte)((byte)value << 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginX ParentOriginX
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginX)((_flags2 & 0xC) >> 2); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_flags2 &= unchecked((byte)(~0xC));
|
|
|
|
|
_flags2 |= (byte)((byte)value << 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public OriginY ParentOriginY
|
|
|
|
|
{
|
2019-08-27 22:58:46 +02:00
|
|
|
|
get { return (OriginY)((_flags2 & 0x3)); }
|
2019-08-27 22:38:06 +02:00
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_flags2 &= unchecked((byte)(~0x3));
|
|
|
|
|
_flags2 |= (byte)value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public byte Alpha { get; set; }
|
|
|
|
|
public byte Unknown { get; set; }
|
|
|
|
|
|
|
|
|
|
public string UserDataInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
public PAN1() : base()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PAN1(FileReader reader) : base()
|
|
|
|
|
{
|
|
|
|
|
_flags1 = reader.ReadByte();
|
|
|
|
|
_flags2 = reader.ReadByte();
|
|
|
|
|
Alpha = reader.ReadByte();
|
|
|
|
|
Unknown = reader.ReadByte();
|
|
|
|
|
Name = reader.ReadString(0x18).Replace("\0", string.Empty);
|
2019-08-29 21:45:32 +02:00
|
|
|
|
UserDataInfo = reader.ReadString(0x8).Replace("\0", string.Empty);
|
2019-08-27 22:38:06 +02:00
|
|
|
|
Translate = reader.ReadVec3SY();
|
|
|
|
|
Rotate = reader.ReadVec3SY();
|
|
|
|
|
Scale = reader.ReadVec2SY();
|
|
|
|
|
Width = reader.ReadSingle();
|
|
|
|
|
Height = reader.ReadSingle();
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
writer.Write(_flags1);
|
|
|
|
|
writer.Write(_flags2);
|
|
|
|
|
writer.Write(Alpha);
|
|
|
|
|
writer.Write(Unknown);
|
|
|
|
|
writer.WriteString(Name, 0x18);
|
2019-08-29 21:45:32 +02:00
|
|
|
|
writer.WriteString(UserDataInfo, 0x8);
|
2019-08-27 22:38:06 +02:00
|
|
|
|
writer.Write(Translate);
|
|
|
|
|
writer.Write(Rotate);
|
|
|
|
|
writer.Write(Scale);
|
|
|
|
|
writer.Write(Width);
|
|
|
|
|
writer.Write(Height);
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
public bool ParentVisibility
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Scale.X == 0 || Scale.Y == 0)
|
|
|
|
|
return false;
|
|
|
|
|
if (!Visible)
|
|
|
|
|
return false;
|
|
|
|
|
if (Parent != null && Parent is PAN1)
|
|
|
|
|
{
|
|
|
|
|
return ((PAN1)Parent).ParentVisibility && Visible;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class MAT1 : SectionCommon
|
|
|
|
|
{
|
|
|
|
|
public List<Material> Materials { get; set; }
|
|
|
|
|
|
|
|
|
|
public MAT1() {
|
|
|
|
|
Materials = new List<Material>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MAT1(FileReader reader, Header header) : base()
|
|
|
|
|
{
|
|
|
|
|
Materials = new List<Material>();
|
|
|
|
|
|
|
|
|
|
long pos = reader.Position;
|
|
|
|
|
|
|
|
|
|
ushort numMats = reader.ReadUInt16();
|
|
|
|
|
reader.Seek(2); //padding
|
|
|
|
|
|
|
|
|
|
uint[] offsets = reader.ReadUInt32s(numMats);
|
|
|
|
|
for (int i = 0; i < numMats; i++)
|
|
|
|
|
{
|
|
|
|
|
reader.SeekBegin(pos + offsets[i] - 8);
|
|
|
|
|
Materials.Add(new Material(reader, header));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
writer.Write((ushort)Materials.Count);
|
|
|
|
|
writer.Seek(2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Material
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
public STColor8 ForeColor { get; set; }
|
|
|
|
|
public STColor8 BackColor { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<TextureRef> TextureMaps { get; set; }
|
|
|
|
|
public List<TextureTransform> TextureTransforms { get; set; }
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
private uint flags;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
private int unknown;
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
private BFLYT.Header ParentLayout;
|
|
|
|
|
public string GetTexture(int index)
|
|
|
|
|
{
|
2019-08-29 23:17:24 +02:00
|
|
|
|
if (TextureMaps[index].ID != -1)
|
|
|
|
|
return ParentLayout.TextureList.Textures[TextureMaps[index].ID];
|
|
|
|
|
else
|
|
|
|
|
return "";
|
2019-08-29 22:33:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public Material()
|
|
|
|
|
{
|
|
|
|
|
TextureMaps = new List<TextureRef>();
|
|
|
|
|
TextureTransforms = new List<TextureTransform>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Material(FileReader reader, Header header) : base()
|
|
|
|
|
{
|
2019-08-29 22:33:23 +02:00
|
|
|
|
ParentLayout = header;
|
|
|
|
|
|
2019-08-27 22:38:06 +02:00
|
|
|
|
TextureMaps = new List<TextureRef>();
|
|
|
|
|
TextureTransforms = new List<TextureTransform>();
|
|
|
|
|
|
|
|
|
|
Name = reader.ReadString(0x1C).Replace("\0", string.Empty);
|
2019-08-29 21:45:32 +02:00
|
|
|
|
if (header.VersionMajor == 8)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
2019-08-29 21:45:32 +02:00
|
|
|
|
flags = reader.ReadUInt32();
|
2019-08-27 22:38:06 +02:00
|
|
|
|
unknown = reader.ReadInt32();
|
|
|
|
|
ForeColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
BackColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ForeColor = STColor8.FromBytes(reader.ReadBytes(4));
|
|
|
|
|
BackColor = STColor8.FromBytes(reader.ReadBytes(4));
|
2019-08-29 21:45:32 +02:00
|
|
|
|
flags = reader.ReadUInt32();
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 21:45:32 +02:00
|
|
|
|
uint texCount = Convert.ToUInt32(flags & 3);
|
|
|
|
|
uint mtxCount = Convert.ToUInt32(flags >> 2) & 3;
|
2019-08-27 22:38:06 +02:00
|
|
|
|
for (int i = 0; i < texCount; i++)
|
|
|
|
|
TextureMaps.Add(new TextureRef(reader));
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < mtxCount; i++)
|
|
|
|
|
TextureTransforms.Add(new TextureTransform(reader));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Write(FileWriter writer, Header header)
|
|
|
|
|
{
|
|
|
|
|
writer.WriteString(Name, 0x1C);
|
|
|
|
|
if (header.Version == 0x8030000)
|
|
|
|
|
{
|
|
|
|
|
writer.Write(flags);
|
|
|
|
|
writer.Write(unknown);
|
|
|
|
|
writer.Write(ForeColor);
|
|
|
|
|
writer.Write(BackColor);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
writer.Write(ForeColor);
|
|
|
|
|
writer.Write(BackColor);
|
|
|
|
|
writer.Write(flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < TextureMaps.Count; i++)
|
|
|
|
|
TextureMaps[i].Write(writer);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < TextureTransforms.Count; i++)
|
|
|
|
|
TextureTransforms[i].Write(writer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TextureTransform
|
|
|
|
|
{
|
|
|
|
|
public Vector2F Translate;
|
|
|
|
|
public float Rotate;
|
|
|
|
|
public Vector2F Scale;
|
|
|
|
|
|
|
|
|
|
public TextureTransform() { }
|
|
|
|
|
|
|
|
|
|
public TextureTransform(FileReader reader)
|
|
|
|
|
{
|
|
|
|
|
Translate = reader.ReadVec2SY();
|
|
|
|
|
Rotate = reader.ReadSingle();
|
|
|
|
|
Scale = reader.ReadVec2SY();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Write(FileWriter writer)
|
|
|
|
|
{
|
|
|
|
|
writer.Write(Translate);
|
|
|
|
|
writer.Write(Rotate);
|
|
|
|
|
writer.Write(Scale);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TextureRef
|
|
|
|
|
{
|
2019-08-29 23:17:24 +02:00
|
|
|
|
public short ID;
|
2019-08-29 21:45:32 +02:00
|
|
|
|
byte flag1;
|
|
|
|
|
byte flag2;
|
|
|
|
|
|
|
|
|
|
public WrapMode WrapModeU
|
|
|
|
|
{
|
|
|
|
|
get { return (WrapMode)(flag1 & 0x3); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WrapMode WrapModeV
|
|
|
|
|
{
|
|
|
|
|
get { return (WrapMode)(flag2 & 0x3); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public FilterMode MinFilterMode
|
|
|
|
|
{
|
|
|
|
|
get { return (FilterMode)((flag1 >> 2) & 0x3); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public FilterMode MaxFilterMode
|
|
|
|
|
{
|
|
|
|
|
get { return (FilterMode)((flag2 >> 2) & 0x3); }
|
|
|
|
|
}
|
2019-08-27 22:38:06 +02:00
|
|
|
|
|
|
|
|
|
public TextureRef() {}
|
|
|
|
|
|
|
|
|
|
public TextureRef(FileReader reader) {
|
2019-08-29 23:17:24 +02:00
|
|
|
|
ID = reader.ReadInt16();
|
2019-08-29 21:45:32 +02:00
|
|
|
|
flag1 = reader.ReadByte();
|
|
|
|
|
flag2 = reader.ReadByte();
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Write(FileWriter writer)
|
|
|
|
|
{
|
|
|
|
|
writer.Write(ID);
|
2019-08-29 21:45:32 +02:00
|
|
|
|
writer.Write(flag1);
|
|
|
|
|
writer.Write(flag2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum FilterMode
|
|
|
|
|
{
|
|
|
|
|
Near = 0,
|
|
|
|
|
Linear = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum WrapMode
|
|
|
|
|
{
|
|
|
|
|
Clamp = 0,
|
|
|
|
|
Repeat = 1,
|
|
|
|
|
Mirror = 2
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class FNL1 : SectionCommon
|
|
|
|
|
{
|
|
|
|
|
public List<string> Fonts { get; set; }
|
|
|
|
|
|
|
|
|
|
public FNL1()
|
|
|
|
|
{
|
|
|
|
|
Fonts = new List<string>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public FNL1(FileReader reader) : base()
|
|
|
|
|
{
|
|
|
|
|
Fonts = new List<string>();
|
|
|
|
|
|
|
|
|
|
ushort numFonts = reader.ReadUInt16();
|
|
|
|
|
reader.Seek(2); //padding
|
|
|
|
|
|
|
|
|
|
long pos = reader.Position;
|
|
|
|
|
|
|
|
|
|
uint[] offsets = reader.ReadUInt32s(numFonts);
|
|
|
|
|
for (int i = 0; i < offsets.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
reader.SeekBegin(offsets[i] + pos);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
writer.Write((ushort)Fonts.Count);
|
|
|
|
|
writer.Seek(2);
|
|
|
|
|
|
|
|
|
|
//Fill empty spaces for offsets later
|
|
|
|
|
long pos = writer.Position;
|
|
|
|
|
writer.Write(new uint[Fonts.Count]);
|
|
|
|
|
|
|
|
|
|
//Save offsets and strings
|
|
|
|
|
for (int i = 0; i < Fonts.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
writer.WriteUint32Offset(pos + (i * 4), pos);
|
|
|
|
|
writer.WriteString(Fonts[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TXL1 : SectionCommon
|
|
|
|
|
{
|
|
|
|
|
public List<string> Textures { get; set; }
|
|
|
|
|
|
|
|
|
|
public TXL1()
|
|
|
|
|
{
|
|
|
|
|
Textures = new List<string>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TXL1(FileReader reader) : base()
|
|
|
|
|
{
|
|
|
|
|
Textures = new List<string>();
|
|
|
|
|
|
|
|
|
|
ushort numTextures = reader.ReadUInt16();
|
|
|
|
|
reader.Seek(2); //padding
|
|
|
|
|
|
|
|
|
|
long pos = reader.Position;
|
|
|
|
|
|
|
|
|
|
uint[] offsets = reader.ReadUInt32s(numTextures);
|
|
|
|
|
for (int i = 0; i < offsets.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
reader.SeekBegin(offsets[i] + pos);
|
2019-08-29 21:45:32 +02:00
|
|
|
|
Textures.Add(reader.ReadZeroTerminatedString());
|
2019-08-27 22:38:06 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
writer.Write((ushort)Textures.Count);
|
|
|
|
|
writer.Seek(2);
|
|
|
|
|
|
|
|
|
|
//Fill empty spaces for offsets later
|
|
|
|
|
long pos = writer.Position;
|
|
|
|
|
writer.Write(new uint[Textures.Count]);
|
|
|
|
|
|
|
|
|
|
//Save offsets and strings
|
|
|
|
|
for (int i = 0; i < Textures.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
writer.WriteUint32Offset(pos + (i * 4), pos);
|
|
|
|
|
writer.WriteString(Textures[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-04 17:50:57 +02:00
|
|
|
|
public class LYT1 : SectionCommon
|
|
|
|
|
{
|
2019-08-27 22:38:06 +02:00
|
|
|
|
public bool DrawFromCenter { get; set; }
|
|
|
|
|
|
|
|
|
|
public float Width { get; set; }
|
|
|
|
|
public float Height { get; set; }
|
|
|
|
|
|
|
|
|
|
public float MaxPartsWidth { get; set; }
|
|
|
|
|
public float MaxPartsHeight { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
public LYT1()
|
|
|
|
|
{
|
|
|
|
|
DrawFromCenter = false;
|
|
|
|
|
Width = 0;
|
|
|
|
|
Height = 0;
|
|
|
|
|
MaxPartsWidth = 0;
|
|
|
|
|
MaxPartsHeight = 0;
|
|
|
|
|
Name = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LYT1(FileReader reader)
|
|
|
|
|
{
|
|
|
|
|
DrawFromCenter = reader.ReadBoolean();
|
|
|
|
|
reader.Seek(3); //padding
|
|
|
|
|
Width = reader.ReadSingle();
|
|
|
|
|
Height = reader.ReadSingle();
|
|
|
|
|
MaxPartsWidth = reader.ReadSingle();
|
|
|
|
|
MaxPartsHeight = reader.ReadSingle();
|
|
|
|
|
Name = reader.ReadZeroTerminatedString();
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-29 22:33:23 +02:00
|
|
|
|
public override void Write(FileWriter writer, BxlytHeader header)
|
2019-08-27 22:38:06 +02:00
|
|
|
|
{
|
|
|
|
|
writer.Write(DrawFromCenter);
|
|
|
|
|
writer.Seek(3);
|
|
|
|
|
writer.Write(Width);
|
|
|
|
|
writer.Write(Height);
|
|
|
|
|
writer.Write(MaxPartsWidth);
|
|
|
|
|
writer.Write(MaxPartsHeight);
|
|
|
|
|
writer.Write(Name);
|
|
|
|
|
}
|
2019-08-04 17:50:57 +02:00
|
|
|
|
}
|
Add files for the new one.
Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles
Alot of things optimized. UI is very fast and snappy now
Dae rigging fixed.
Dae bones can be imported.
Dae with textures can be imported and exported to a folder
Custom sampler editor for sampler data.
Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited
User data editor
Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements
Skeleton can be viewed
GFPAK with some fixes in saving
NUTEXB has proper mip map viewing
PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed
Files can be associated with the program and opened with on clicking them
ASTC textures can be viewed
UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits
Textures use a new editor. It includes channel viewing and some new editing options
Fixed black textures on some wii u bfres
Fixed saving sarcs in sarcs
Shortcut keys have been added in. CTRL + S can save the active file in the currently used window
Fix more issues with bfres crashing
File - New includes BNTX for creating new bntx files from scatch
Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these
Sharc files can have source data previewed and shader programs in XML
Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update
Byaml uses it's own editor instead of a seperate window for easy saving within sarcs
Archives have a hex viewer
Dae exporting greatly improved and can export rigged meshes
Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list)
Memory usage is greatly improved
Narc (Nitro Archives) can be viewed and extracted.
Fixed importing TGA images
Support importing ASTC textures for bntx
Added in PBR lighting for bfres from my implimentaion in forge
Added gradient background for viewport. This can be edited in the settings
Added skybox background option for viewport. Can load cubemaps
Added grid with customizable cells for viewport.
DDS decompression no longer requires Direct X tex.
Zlib decompression has been improved for opening files that use it
Rigid bones are properly ordered on importing a mesh. May fix some exploding issues.
Endianness for KCL can be toggled for saving. Will be set to what it was using orignally
Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good
Vertex buffers can be added and removed. Also re encoded
Parameters now use drop down panels with values for easier editing
Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically
Fixed animation scaling for skeletal animations finally!
Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport
Fixed support for audio files to be big endian in BARS
Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save.
Animations are split into multiple sub sections for switch's material animation for easier access
Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from)
Every section can be added in as new for both wii u and switch.
Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later)
Added option to copy UV channel
Bone weights can be previewed
Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more!
Fixed 3.3 Wii U bfres from not opening
Wii U Sharcfb files can have shader program data previewed (XML)
And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
|
|
|
|
}
|
|
|
|
|
}
|