Merge branch 'Perfare_master' into AssetStudio-mod

This commit is contained in:
VaDiM 2021-12-05 01:32:48 +02:00
commit f0b23bbfe7
13 changed files with 63 additions and 28 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks> <TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>0.16.8.1</Version> <Version>0.16.8.1</Version>
<AssemblyVersion>0.16.8.1</AssemblyVersion> <AssemblyVersion>0.16.8.1</AssemblyVersion>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks> <TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
<Version>0.16.8.1</Version> <Version>0.16.8.1</Version>
<AssemblyVersion>0.16.8.1</AssemblyVersion> <AssemblyVersion>0.16.8.1</AssemblyVersion>
<FileVersion>0.16.8.1</FileVersion> <FileVersion>0.16.8.1</FileVersion>

View File

@ -21,7 +21,7 @@ namespace AssetStudio
public void LoadFiles(params string[] files) public void LoadFiles(params string[] files)
{ {
var path = Path.GetDirectoryName(files[0]); var path = Path.GetDirectoryName(Path.GetFullPath(files[0]));
MergeSplitAssets(path); MergeSplitAssets(path);
var toReadFile = ProcessingSplitFiles(files.ToList()); var toReadFile = ProcessingSplitFiles(files.ToList());
Load(toReadFile); Load(toReadFile);
@ -424,6 +424,10 @@ namespace AssetStudio
} }
else if (obj is SpriteAtlas m_SpriteAtlas) else if (obj is SpriteAtlas m_SpriteAtlas)
{ {
if (m_SpriteAtlas.m_IsVariant)
{
continue;
}
foreach (var m_PackedSprite in m_SpriteAtlas.m_PackedSprites) foreach (var m_PackedSprite in m_SpriteAtlas.m_PackedSprites)
{ {
if (m_PackedSprite.TryGet(out var m_Sprite)) if (m_PackedSprite.TryGet(out var m_Sprite))

View File

@ -197,7 +197,7 @@ namespace AssetStudio
public Vector2 m_Offset; public Vector2 m_Offset;
public Vector4 m_Border; public Vector4 m_Border;
public float m_PixelsToUnits; public float m_PixelsToUnits;
public Vector2 m_Pivot; public Vector2 m_Pivot = new Vector2(0.5f, 0.5f);
public uint m_Extrude; public uint m_Extrude;
public bool m_IsPolygon; public bool m_IsPolygon;
public KeyValuePair<Guid, long> m_RenderDataKey; public KeyValuePair<Guid, long> m_RenderDataKey;

View File

@ -46,6 +46,7 @@ namespace AssetStudio
{ {
public PPtr<Sprite>[] m_PackedSprites; public PPtr<Sprite>[] m_PackedSprites;
public Dictionary<KeyValuePair<Guid, long>, SpriteAtlasData> m_RenderDataMap; public Dictionary<KeyValuePair<Guid, long>, SpriteAtlasData> m_RenderDataMap;
public bool m_IsVariant;
public SpriteAtlas(ObjectReader reader) : base(reader) public SpriteAtlas(ObjectReader reader) : base(reader)
{ {
@ -67,8 +68,9 @@ namespace AssetStudio
var value = new SpriteAtlasData(reader); var value = new SpriteAtlasData(reader);
m_RenderDataMap.Add(new KeyValuePair<Guid, long>(first, second), value); m_RenderDataMap.Add(new KeyValuePair<Guid, long>(first, second), value);
} }
//string m_Tag var m_Tag = reader.ReadAlignedString();
//bool m_IsVariant m_IsVariant = reader.ReadBoolean();
reader.AlignStream();
} }
} }
} }

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks> <TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>0.16.8.1</Version> <Version>0.16.8.1</Version>
<AssemblyVersion>0.16.8.1</AssemblyVersion> <AssemblyVersion>0.16.8.1</AssemblyVersion>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework> <TargetFrameworks>net472;net5.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\as.ico</ApplicationIcon> <ApplicationIcon>Resources\as.ico</ApplicationIcon>
<AssemblyTitle>AssetStudio Mod by VaDiM</AssemblyTitle> <AssemblyTitle>AssetStudio Mod by VaDiM</AssemblyTitle>
@ -57,16 +57,33 @@
</ContentWithTargetPath> </ContentWithTargetPath>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup Condition=" '$(TargetFramework)' == 'net5.0-windows' ">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="OpenTK" Version="4.6.7" />
<Reference Include="OpenTK.WinForms">
<HintPath>Libraries\OpenTK.WinForms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="OpenTK" Version="3.1.0" /> <PackageReference Include="OpenTK" Version="3.1.0" />
<PackageReference Include="OpenTK.GLControl" Version="3.1.0" /> <PackageReference Include="OpenTK.GLControl" Version="3.1.0" />
</ItemGroup> </ItemGroup>
<Target Name="CustomAfterBuild" AfterTargets="AfterBuild"> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<Target Name="CopyExtraFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" /> <Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" /> <Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" /> <Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" /> <Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
</Target> </Target>
<Target Name="PublishExtraFiles" AfterTargets="Publish">
<Copy SourceFiles="$(TargetDir)x86\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x86\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
</Target>
</Project> </Project>

View File

@ -820,20 +820,21 @@
// //
// FMODtimerLabel // FMODtimerLabel
// //
this.FMODtimerLabel.AutoSize = true;
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODtimerLabel.Location = new System.Drawing.Point(404, 255); this.FMODtimerLabel.Location = new System.Drawing.Point(457, 253);
this.FMODtimerLabel.Name = "FMODtimerLabel"; this.FMODtimerLabel.Name = "FMODtimerLabel";
this.FMODtimerLabel.Size = new System.Drawing.Size(155, 13); this.FMODtimerLabel.Size = new System.Drawing.Size(102, 13);
this.FMODtimerLabel.TabIndex = 7; this.FMODtimerLabel.TabIndex = 7;
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0"; this.FMODtimerLabel.Text = "00:00.00 / 00:00.00";
this.FMODtimerLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
// //
// FMODstatusLabel // FMODstatusLabel
// //
this.FMODstatusLabel.AutoSize = true;
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODstatusLabel.Location = new System.Drawing.Point(213, 255); this.FMODstatusLabel.Location = new System.Drawing.Point(213, 255);
this.FMODstatusLabel.Name = "FMODstatusLabel"; this.FMODstatusLabel.Name = "FMODstatusLabel";
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 13); this.FMODstatusLabel.Size = new System.Drawing.Size(47, 13);
this.FMODstatusLabel.TabIndex = 6; this.FMODstatusLabel.TabIndex = 6;
this.FMODstatusLabel.Text = "Stopped"; this.FMODstatusLabel.Text = "Stopped";
// //
@ -1024,7 +1025,7 @@
this.goToSceneHierarchyToolStripMenuItem, this.goToSceneHierarchyToolStripMenuItem,
this.showOriginalFileToolStripMenuItem}); this.showOriginalFileToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(304, 158); this.contextMenuStrip1.Size = new System.Drawing.Size(304, 136);
// //
// copyToolStripMenuItem // copyToolStripMenuItem
// //
@ -1074,8 +1075,6 @@
// AssetStudioGUIForm // AssetStudioGUIForm
// //
this.AllowDrop = true; this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1264, 681); this.ClientSize = new System.Drawing.Size(1264, 681);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);

View File

@ -21,8 +21,14 @@ using static AssetStudioGUI.Studio;
using Font = AssetStudio.Font; using Font = AssetStudio.Font;
using ImageFormat = AssetStudio.ImageFormat; using ImageFormat = AssetStudio.ImageFormat;
using PixelFormat = System.Drawing.Imaging.PixelFormat; using PixelFormat = System.Drawing.Imaging.PixelFormat;
#if NET472
using Vector3 = OpenTK.Vector3; using Vector3 = OpenTK.Vector3;
using Vector4 = OpenTK.Vector4; using Vector4 = OpenTK.Vector4;
#else
using Vector3 = OpenTK.Mathematics.Vector3;
using Vector4 = OpenTK.Mathematics.Vector4;
using Matrix4 = OpenTK.Mathematics.Matrix4;
#endif
namespace AssetStudioGUI namespace AssetStudioGUI
{ {
@ -944,7 +950,7 @@ namespace AssetStudioGUI
if (ERRCHECK(result)) return; if (ERRCHECK(result)) return;
FMODinfoLabel.Text = frequency + " Hz"; FMODinfoLabel.Text = frequency + " Hz";
FMODtimerLabel.Text = $"0:0.0 / {FMODlenms / 1000 / 60}:{FMODlenms / 1000 % 60}.{FMODlenms / 10 % 100}"; FMODtimerLabel.Text = $"00:00.00 / {(FMODlenms / 1000 / 60):00}:{(FMODlenms / 1000 % 60):00}.{(FMODlenms / 10 % 100):00}";
} }
private void PreviewShader(Shader m_Shader) private void PreviewShader(Shader m_Shader)

Binary file not shown.

View File

@ -457,7 +457,7 @@ namespace AssetStudioGUI
if (Properties.Settings.Default.openAfterExport && exportedCount > 0) if (Properties.Settings.Default.openAfterExport && exportedCount > 0)
{ {
Process.Start(savePath); OpenFolderInExplorer(savePath);
} }
}); });
} }
@ -502,7 +502,7 @@ namespace AssetStudioGUI
if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0) if (Properties.Settings.Default.openAfterExport && toExportAssets.Count() > 0)
{ {
Process.Start(savePath); OpenFolderInExplorer(savePath);
} }
}); });
} }
@ -562,7 +562,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(savePath); OpenFolderInExplorer(savePath);
} }
StatusStripUpdate("Finished"); StatusStripUpdate("Finished");
}); });
@ -588,7 +588,7 @@ namespace AssetStudioGUI
ExportAnimator(animator, exportPath, animationList); ExportAnimator(animator, exportPath, animationList);
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(exportPath); OpenFolderInExplorer(exportPath);
} }
Progress.Report(1, 1); Progress.Report(1, 1);
StatusStripUpdate($"Finished exporting {animator.Text}"); StatusStripUpdate($"Finished exporting {animator.Text}");
@ -630,7 +630,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(exportPath); OpenFolderInExplorer(exportPath);
} }
} }
else else
@ -660,7 +660,7 @@ namespace AssetStudioGUI
} }
if (Properties.Settings.Default.openAfterExport) if (Properties.Settings.Default.openAfterExport)
{ {
Process.Start(Path.GetDirectoryName(exportPath)); OpenFolderInExplorer(Path.GetDirectoryName(exportPath));
} }
}); });
} }
@ -708,5 +708,12 @@ namespace AssetStudioGUI
} }
return str; return str;
} }
public static void OpenFolderInExplorer(string path)
{
var info = new ProcessStartInfo(path);
info.UseShellExecute = true;
Process.Start(info);
}
} }
} }

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks> <TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
<Version>0.16.8.1</Version> <Version>0.16.8.1</Version>
<AssemblyVersion>0.16.8.1</AssemblyVersion> <AssemblyVersion>0.16.8.1</AssemblyVersion>
<FileVersion>0.16.8.1</FileVersion> <FileVersion>0.16.8.1</FileVersion>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks> <TargetFrameworks>net472;netstandard2.0;net5.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>0.16.8.1</Version> <Version>0.16.8.1</Version>
<AssemblyVersion>0.16.8.1</AssemblyVersion> <AssemblyVersion>0.16.8.1</AssemblyVersion>