@@ -1,5 +1,10 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v0.16.5
|
||||||
|
|
||||||
|
- 修复对于无 size 行的旧 atlas 格式读取错误
|
||||||
|
- 修复托盘化之后无法联动显示窗口的问题
|
||||||
|
|
||||||
## v0.16.4
|
## v0.16.4
|
||||||
|
|
||||||
- 增加 apng 导出格式
|
- 增加 apng 导出格式
|
||||||
|
|||||||
@@ -112,6 +112,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime34.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime34.AtlasPage page, string path)
|
||||||
@@ -147,6 +155,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime35.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime35.AtlasPage page, string path)
|
||||||
@@ -182,6 +198,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime36.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime36.AtlasPage page, string path)
|
||||||
@@ -217,6 +241,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime37.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime37.AtlasPage page, string path)
|
||||||
@@ -252,6 +284,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime38.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime38.AtlasPage page, string path)
|
||||||
@@ -288,9 +328,13 @@ namespace Spine.Implementations
|
|||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
// 似乎是不需要设置的, 因为存在某些 png 和 atlas 大小不同的情况, 一般是有一些缩放, 如果设置了反而渲染异常
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
// page.width = (int)texture.Size.X;
|
if (page.width <= 0 || page.height <= 0)
|
||||||
// page.height = (int)texture.Size.Y;
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime40.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime40.AtlasPage page, string path)
|
||||||
@@ -326,6 +370,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime41.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime41.AtlasPage page, string path)
|
||||||
@@ -361,6 +413,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Load(SpineRuntime42.AtlasPage page, string path)
|
public virtual void Load(SpineRuntime42.AtlasPage page, string path)
|
||||||
@@ -396,6 +456,14 @@ namespace Spine.Implementations
|
|||||||
if (ForceMipmap) texture.GenerateMipmap();
|
if (ForceMipmap) texture.GenerateMipmap();
|
||||||
|
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
|
|
||||||
|
// 有些旧的 atlas 会省略 size 行, 这时需要在读取纹理时赋值
|
||||||
|
if (page.width <= 0 || page.height <= 0)
|
||||||
|
{
|
||||||
|
var texSize = texture.Size;
|
||||||
|
page.width = (int)texSize.X;
|
||||||
|
page.height = (int)texSize.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Unload(object texture)
|
public virtual void Unload(object texture)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
||||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||||
<Version>0.16.4</Version>
|
<Version>0.16.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ namespace SpineViewer
|
|||||||
_instanceMutex = new Mutex(true, MutexName, out var createdNew);
|
_instanceMutex = new Mutex(true, MutexName, out var createdNew);
|
||||||
if (!createdNew)
|
if (!createdNew)
|
||||||
{
|
{
|
||||||
ShowExistedInstance();
|
|
||||||
SendCommandLineArgs();
|
SendCommandLineArgs();
|
||||||
Environment.Exit(0); // 不再启动新实例
|
Environment.Exit(0); // 不再启动新实例
|
||||||
return;
|
return;
|
||||||
@@ -100,37 +99,6 @@ namespace SpineViewer
|
|||||||
LogManager.Configuration = config;
|
LogManager.Configuration = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ShowExistedInstance()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 遍历同名进程
|
|
||||||
var processes = Process.GetProcessesByName(ProcessName);
|
|
||||||
foreach (var p in processes)
|
|
||||||
{
|
|
||||||
// 跳过当前进程
|
|
||||||
if (p.Id == Process.GetCurrentProcess().Id)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
IntPtr hWnd = p.MainWindowHandle;
|
|
||||||
if (hWnd != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
// 3. 显示并置顶窗口
|
|
||||||
if (User32.IsIconic(hWnd))
|
|
||||||
{
|
|
||||||
User32.ShowWindow(hWnd, User32.SW_RESTORE);
|
|
||||||
}
|
|
||||||
User32.SetForegroundWindow(hWnd);
|
|
||||||
break; // 找到一个就可以退出
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// 忽略异常,不影响当前进程退出
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SendCommandLineArgs()
|
private static void SendCommandLineArgs()
|
||||||
{
|
{
|
||||||
var args = Environment.GetCommandLineArgs().Skip(1).ToArray();
|
var args = Environment.GetCommandLineArgs().Skip(1).ToArray();
|
||||||
@@ -187,13 +155,31 @@ namespace SpineViewer
|
|||||||
args.Add(line);
|
args.Add(line);
|
||||||
|
|
||||||
if (args.Count > 0)
|
if (args.Count > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Current.Dispatcher.Invoke(() =>
|
Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
var vm = (MainWindowViewModel)((MainWindow)Current.MainWindow).DataContext;
|
// 只要收到参数就可以显示窗口了
|
||||||
|
var window = (MainWindow)Current.MainWindow;
|
||||||
|
window.Show();
|
||||||
|
if (window.WindowState == WindowState.Minimized)
|
||||||
|
{
|
||||||
|
window.WindowState = WindowState.Normal;
|
||||||
|
}
|
||||||
|
window.Activate();
|
||||||
|
|
||||||
|
// 尝试加载参数内容
|
||||||
|
var vm = (MainWindowViewModel)window.DataContext;
|
||||||
vm.SpineObjectListViewModel.AddSpineObjectFromFileList(args);
|
vm.SpineObjectListViewModel.AddSpineObjectFromFileList(args);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Trace(ex.ToString());
|
||||||
|
_logger.Error("Failed to process arguments, {0}", ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
|
||||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||||
<Version>0.16.4</Version>
|
<Version>0.16.5</Version>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user