From 0a381653592e8c7723e4a85b8a9629f0793003b1 Mon Sep 17 00:00:00 2001 From: "Chris Weermann (TGE)" Date: Thu, 18 Jun 2020 14:42:27 +0200 Subject: [PATCH] TMX: save UserId, allow editing in UI AMD: fix 'Cannot open a closed file' --- .../System.ValueTuple.4.4.0/.signature.p7s | Bin 0 -> 9482 bytes .../Nuget/morelinq.2.10.0/.signature.p7s | Bin 0 -> 9463 bytes Source/Amicitia/Properties/AssemblyInfo.cs | 4 +-- Source/Amicitia/ResourceWrapperFactory.cs | 3 +++ .../ResourceWrappers/PAKFileSystemWrapper.cs | 3 +-- .../ResourceWrappers/ResourceWrapper.cs | 11 +++++++++ .../ResourceWrappers/TMXFileWrapper.cs | 23 ++++++++++++++++++ .../FileSystems/AMD/AMDFile.cs | 3 ++- .../FileSystems/CVM/CVMExecutableListing.cs | 4 +-- .../Graphics/RenderWare/RMDNodeLink.cs | 4 +-- .../AmicitiaLibrary/Graphics/TMX/TMXFile.cs | 11 ++++++--- 11 files changed, 53 insertions(+), 13 deletions(-) create mode 100644 Dependencies/Nuget/System.ValueTuple.4.4.0/.signature.p7s create mode 100644 Dependencies/Nuget/morelinq.2.10.0/.signature.p7s diff --git a/Dependencies/Nuget/System.ValueTuple.4.4.0/.signature.p7s b/Dependencies/Nuget/System.ValueTuple.4.4.0/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..1b0092581327584e794d6373d53f6660d7798bdc GIT binary patch literal 9482 zcmds-cUTiy+r~*D^xk`@0#YUkU8G1y0R^d|5PD4@30;MRricP6O<^gDqJl`1buEZA z6;M%-qR2{mkY+e{lmNg-JV)c(F+JVN{426- zl~-e5*W(NyVpTJER~&Org$8zgF5JtqbCrqE`;+U7GpVXg;kJp$g6G45jE~KZqOvdn z5@U%k&`yQFa8WouYVze~YY_@YmM`~o@}WX*#vhZosS7bqn3s)sT;4lm&)0BVnDtiG z*(-LH_bW0#UcWkB(^#yV&ii7uAY+2wg+I&+3WLxxTK>{(-<9zJ`!K)iR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~=D9*IbXo&zH?3tll&rXFuHR z{diG8>{|I-4Z5nQvB}MlzTXu{b)NgZ zL(gkR^8Fe)@>zw)U zFX;yO$Jj!Ho+>EXe^+c+nt)q}-ajv+!Jz)@SDfdkzjwo#V9^U*wwKR7+#NO==G1zG zZZLlOVd6l7%ol;t&NI|W=6`Tm=yY|+7YvEk;vg;UC%`Vt6{Rzvwsr7d@R0wm%^mUdQEAZ!T?mtBza zc7;dL<0gg56HQ%oyMIWhATy7Ub~9Dh_Ug8eKQV|J`um@ zSHdmFm$v#CH;v2g<$hCCZp_{U`DE#0Pk;uwHt$-)Un6*@YJrVj(0>bbS~Q@F!PNoK z>Db`s`H|&8w+LQiQ*R`NW8=jUCEkJ2P*wXZ_V!Y|Qhb84-)Z z;}3RST9g-(rZ69 zwo_t24Wc?bXdxFO$C*%O;u)d{6AtrWO6IQ^>a*_H%3LFyVY-))p>rOQg+s!zC!&mH$Do7w)z0 zn*t5&-@QYq0tOV60QlV%II1zb$Ic(MZsIUuu8s+YQ$#sqJC9tkgsIlO1$dgf zv-XV{2+boClY`_;TyR55o>dOg8BoS_!%<`QFVt(VrJOa{XF?&c~|?cevR#BOqr5 zWl~f5ivyE0m*%p5>)0Qv-3ULE(!4Z4CsN@$vygT#jV^uCvyV-J3&&)T7s0Tnd_Dm+ zot_Yak8_xRr} { - res.Save().SaveToFile( leaveOpen: false, path ); - + res.Save( path ); } ); RegisterFileReplaceAction( SupportedFileType.PakArchiveFile, ( res, path ) => { diff --git a/Source/Amicitia/ResourceWrappers/ResourceWrapper.cs b/Source/Amicitia/ResourceWrappers/ResourceWrapper.cs index 9e9f730..f443b6b 100644 --- a/Source/Amicitia/ResourceWrappers/ResourceWrapper.cs +++ b/Source/Amicitia/ResourceWrappers/ResourceWrapper.cs @@ -96,6 +96,8 @@ public abstract partial class ResourceWrapper : TreeNode, IResourceWr private Dictionary>> mFileAddActions; private Func, TResource> mRebuildAction; private List mCustomActions; + private Dictionary mContextMenuStripCache + = new Dictionary(); public event PropertyChangedEventHandler PropertyChanged; @@ -574,6 +576,13 @@ private void PopulateViewFully() /// private void PopulateContextMenuStrip() { + var type = GetType(); + if (mContextMenuStripCache.TryGetValue( type, out var temp ) ) + { + ContextMenuStrip = temp; + return; + } + ContextMenuStrip = new ContextMenuStrip(); if ( mCustomActions != null ) @@ -629,6 +638,8 @@ private void PopulateContextMenuStrip() { ContextMenuStrip.Items.Add(new ToolStripMenuItem("&Delete", null, DeleteEventHandler, Keys.Control | Keys.Delete)); } + + mContextMenuStripCache[type] = ContextMenuStrip; } /// diff --git a/Source/Amicitia/ResourceWrappers/TMXFileWrapper.cs b/Source/Amicitia/ResourceWrappers/TMXFileWrapper.cs index 2ff8535..925a3f5 100644 --- a/Source/Amicitia/ResourceWrappers/TMXFileWrapper.cs +++ b/Source/Amicitia/ResourceWrappers/TMXFileWrapper.cs @@ -37,6 +37,14 @@ public class TmxFileWrapper : ResourceWrapper [OrderedProperty] public byte MipMapCount => Resource.MipMapCount; + [Category( "Texture format" )] + [OrderedProperty] + public float MipMapKValue => Resource.MipMapKValue; + + [Category( "Texture format" )] + [OrderedProperty] + public float MipMapLValue => Resource.MipMapLValue; + [Category("Texture wrapping modes")] [OrderedProperty] public TmxWrapMode HorizontalWrappingMode @@ -53,6 +61,13 @@ public TmxWrapMode VerticalWrappingMode set => SetProperty(Resource, value); } + [Category("Texture metadata"), OrderedProperty] + public short UserId + { + get => Resource.UserId; + set => SetProperty(Resource, value); + } + [Category("Texture metadata")] [OrderedProperty] public int UserTextureId @@ -77,6 +92,14 @@ public string UserComment set => SetProperty(Resource, value); } + [Category("Misc")] + [OrderedProperty] + public byte Reserved + { + get => Resource.Reserved; + set => SetProperty(Resource, value); + } + public TmxFileWrapper(string text, TmxFile resource) : base(text, resource) { } diff --git a/Source/AmicitiaLibrary/FileSystems/AMD/AMDFile.cs b/Source/AmicitiaLibrary/FileSystems/AMD/AMDFile.cs index 3d8b29c..31b2b51 100644 --- a/Source/AmicitiaLibrary/FileSystems/AMD/AMDFile.cs +++ b/Source/AmicitiaLibrary/FileSystems/AMD/AMDFile.cs @@ -3,6 +3,7 @@ using IO; using System.Collections.Generic; using System.IO; + using System.Text; using Utilities; public class AmdFile : BinaryBase @@ -65,7 +66,7 @@ public AmdFile(string path) /// The path pointing to the the file to load. public AmdFile(Stream stream, bool leaveOpen = false) { - using (BinaryReader reader = new BinaryReader(stream)) + using (BinaryReader reader = new BinaryReader( stream, Encoding.Default, leaveOpen ) ) { Read(reader); } diff --git a/Source/AmicitiaLibrary/FileSystems/CVM/CVMExecutableListing.cs b/Source/AmicitiaLibrary/FileSystems/CVM/CVMExecutableListing.cs index 68abb06..b3ad6bc 100644 --- a/Source/AmicitiaLibrary/FileSystems/CVM/CVMExecutableListing.cs +++ b/Source/AmicitiaLibrary/FileSystems/CVM/CVMExecutableListing.cs @@ -17,9 +17,9 @@ public CvmExecutableListing(string path) mRootDirectoryListing = new CvmDirectoryListing(reader, null); } - public CvmExecutableListing(Stream stream) + public CvmExecutableListing(Stream stream, bool leaveOpen = false) { - using (BinaryReader reader = new BinaryReader(stream, System.Text.Encoding.Default, true)) + using (BinaryReader reader = new BinaryReader(stream, System.Text.Encoding.Default, leaveOpen ) ) mRootDirectoryListing = new CvmDirectoryListing(reader, null); } diff --git a/Source/AmicitiaLibrary/Graphics/RenderWare/RMDNodeLink.cs b/Source/AmicitiaLibrary/Graphics/RenderWare/RMDNodeLink.cs index 1311929..73bfbcb 100644 --- a/Source/AmicitiaLibrary/Graphics/RenderWare/RMDNodeLink.cs +++ b/Source/AmicitiaLibrary/Graphics/RenderWare/RMDNodeLink.cs @@ -35,9 +35,9 @@ public RmdNodeLink(byte[] data) { } - public RmdNodeLink(Stream stream) + public RmdNodeLink(Stream stream, bool leaveOpen = false) { - using (BinaryReader reader = new BinaryReader(stream)) + using (BinaryReader reader = new BinaryReader(stream, System.Text.Encoding.Default, leaveOpen) ) { Read(reader); } diff --git a/Source/AmicitiaLibrary/Graphics/TMX/TMXFile.cs b/Source/AmicitiaLibrary/Graphics/TMX/TMXFile.cs index 47c5c92..6201d16 100644 --- a/Source/AmicitiaLibrary/Graphics/TMX/TMXFile.cs +++ b/Source/AmicitiaLibrary/Graphics/TMX/TMXFile.cs @@ -96,6 +96,7 @@ internal TmxFile(BinaryReader reader) /********************/ /**** Properties ****/ /********************/ + public short UserId { get; set; } public byte PaletteCount { get; private set; } @@ -139,6 +140,8 @@ public byte MipMapLValue } } + public byte Reserved { get; set; } + public TmxWrapMode HorizontalWrappingMode { get @@ -289,7 +292,7 @@ internal override void Write(BinaryWriter writer) writer.Write((byte)PixelFormat); writer.Write(MipMapCount); writer.Write(mMipKl); - writer.Write((byte)0); + writer.Write(Reserved); writer.Write(mWrapModes); writer.Write(UserTextureId); writer.Write(UserClutId); @@ -311,7 +314,7 @@ internal override void Write(BinaryWriter writer) // Seek back to the chunk header and write it writer.BaseStream.Seek(posFileStart, SeekOrigin.Begin); writer.Write(FLAG); - writer.Write((short)0); // userID + writer.Write(UserId); // userID writer.Write(length); writer.WriteCString(TAG, 4); @@ -323,7 +326,7 @@ private void Read(BinaryReader reader) { long posFileStart = reader.GetPosition(); short flag = reader.ReadInt16(); - short userId = reader.ReadInt16(); + UserId = reader.ReadInt16(); int length = reader.ReadInt32(); string tag = reader.ReadCString(4); reader.AlignPosition(16); @@ -340,7 +343,7 @@ private void Read(BinaryReader reader) PixelFormat = (PS2PixelFormat)reader.ReadByte(); MipMapCount = reader.ReadByte(); mMipKl = reader.ReadUInt16(); - byte reserved = reader.ReadByte(); + Reserved = reader.ReadByte(); mWrapModes = reader.ReadByte(); UserTextureId = reader.ReadInt32(); UserClutId = reader.ReadInt32();