Compare commits

..

13 Commits

Author SHA1 Message Date
ww-rm
4983b1fa88 更新至v0.12.11 2025-05-08 18:35:23 +08:00
ww-rm
f6b6d9f0e7 update changelog 2025-05-08 18:35:12 +08:00
ww-rm
12a168df92 修复atlas null 引用导致的闪退 2025-05-08 18:34:43 +08:00
ww-rm
e06d2012d6 更新至v0.12.10 2025-05-07 17:45:07 +08:00
ww-rm
faed2448eb update changelog 2025-05-07 17:44:52 +08:00
ww-rm
a80aed54a0 增加纹理加载菜单选项 2025-05-07 17:43:55 +08:00
ww-rm
3f9c4dfe99 抽出TextureLoader,增加部分可调参数 2025-05-07 17:43:42 +08:00
ww-rm
3c91f335fc 修复skin索引顺序问题 2025-05-06 19:11:46 +08:00
ww-rm
1ea4586360 Merge pull request #21 from steve14608/main
4.1版本格式转换,以及4.2版本发现的一些小bug
2025-05-02 16:29:23 +08:00
YongQi Li
45e08b5b60 Merge branch 'main' of https://github.com/steve14608/SpineViewer 2025-05-02 16:25:53 +08:00
YongQi Li
43ce5a5288 修改了skin2idx的读取逻辑 2025-05-02 16:25:39 +08:00
YongQi Li
887315ceda Merge branch 'main' of https://github.com/steve14608/SpineViewer 2025-05-02 14:52:01 +08:00
ww-rm
30b5c8dd74 4.1的格式转换 2025-05-02 14:51:40 +08:00
18 changed files with 4433 additions and 1691 deletions

View File

@@ -1,5 +1,14 @@
# CHANGELOG
## v0.12.11
- 修复可能的闪退错误
## v0.12.10
- 增加纹理全局加载选项
## v0.12.9
- 修复由于未调用 UpdateCache 导致的约束 bug

View File

@@ -64,6 +64,10 @@
toolStripMenuItem_ExportCustom = new ToolStripMenuItem();
toolStripSeparator2 = new ToolStripSeparator();
toolStripMenuItem_Exit = new ToolStripMenuItem();
toolStripMenuItem_Texture = new ToolStripMenuItem();
toolStripMenuItem_ForceSmooth = new ToolStripMenuItem();
toolStripMenuItem_ForceRepeated = new ToolStripMenuItem();
toolStripMenuItem_ForceMipmap = new ToolStripMenuItem();
toolStripMenuItem_Tool = new ToolStripMenuItem();
toolStripMenuItem_ConvertFileFormat = new ToolStripMenuItem();
toolStripMenuItem_Download = new ToolStripMenuItem();
@@ -106,98 +110,80 @@
//
// splitContainer_MainForm
//
resources.ApplyResources(splitContainer_MainForm, "splitContainer_MainForm");
splitContainer_MainForm.Cursor = Cursors.SizeNS;
resources.ApplyResources(splitContainer_MainForm, "splitContainer_MainForm");
splitContainer_MainForm.FixedPanel = FixedPanel.Panel2;
splitContainer_MainForm.Name = "splitContainer_MainForm";
//
// splitContainer_MainForm.Panel1
//
resources.ApplyResources(splitContainer_MainForm.Panel1, "splitContainer_MainForm.Panel1");
splitContainer_MainForm.Panel1.Controls.Add(splitContainer_Functional);
splitContainer_MainForm.Panel1.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_MainForm.Panel1, resources.GetString("splitContainer_MainForm.Panel1.ToolTip"));
//
// splitContainer_MainForm.Panel2
//
resources.ApplyResources(splitContainer_MainForm.Panel2, "splitContainer_MainForm.Panel2");
splitContainer_MainForm.Panel2.Controls.Add(rtbLog);
splitContainer_MainForm.Panel2.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_MainForm.Panel2, resources.GetString("splitContainer_MainForm.Panel2.ToolTip"));
splitContainer_MainForm.TabStop = false;
toolTip.SetToolTip(splitContainer_MainForm, resources.GetString("splitContainer_MainForm.ToolTip"));
splitContainer_MainForm.SplitterMoved += splitContainer_SplitterMoved;
splitContainer_MainForm.MouseUp += splitContainer_MouseUp;
//
// splitContainer_Functional
//
resources.ApplyResources(splitContainer_Functional, "splitContainer_Functional");
splitContainer_Functional.Cursor = Cursors.SizeWE;
resources.ApplyResources(splitContainer_Functional, "splitContainer_Functional");
splitContainer_Functional.FixedPanel = FixedPanel.Panel1;
splitContainer_Functional.Name = "splitContainer_Functional";
//
// splitContainer_Functional.Panel1
//
resources.ApplyResources(splitContainer_Functional.Panel1, "splitContainer_Functional.Panel1");
splitContainer_Functional.Panel1.Controls.Add(splitContainer_Information);
splitContainer_Functional.Panel1.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_Functional.Panel1, resources.GetString("splitContainer_Functional.Panel1.ToolTip"));
//
// splitContainer_Functional.Panel2
//
resources.ApplyResources(splitContainer_Functional.Panel2, "splitContainer_Functional.Panel2");
splitContainer_Functional.Panel2.Controls.Add(groupBox_Preview);
splitContainer_Functional.Panel2.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_Functional.Panel2, resources.GetString("splitContainer_Functional.Panel2.ToolTip"));
splitContainer_Functional.TabStop = false;
toolTip.SetToolTip(splitContainer_Functional, resources.GetString("splitContainer_Functional.ToolTip"));
splitContainer_Functional.SplitterMoved += splitContainer_SplitterMoved;
splitContainer_Functional.MouseUp += splitContainer_MouseUp;
//
// splitContainer_Information
//
resources.ApplyResources(splitContainer_Information, "splitContainer_Information");
splitContainer_Information.Cursor = Cursors.SizeWE;
resources.ApplyResources(splitContainer_Information, "splitContainer_Information");
splitContainer_Information.Name = "splitContainer_Information";
//
// splitContainer_Information.Panel1
//
resources.ApplyResources(splitContainer_Information.Panel1, "splitContainer_Information.Panel1");
splitContainer_Information.Panel1.Controls.Add(groupBox_SkelList);
splitContainer_Information.Panel1.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_Information.Panel1, resources.GetString("splitContainer_Information.Panel1.ToolTip"));
//
// splitContainer_Information.Panel2
//
resources.ApplyResources(splitContainer_Information.Panel2, "splitContainer_Information.Panel2");
splitContainer_Information.Panel2.Controls.Add(splitContainer_Config);
splitContainer_Information.Panel2.Cursor = Cursors.Default;
toolTip.SetToolTip(splitContainer_Information.Panel2, resources.GetString("splitContainer_Information.Panel2.ToolTip"));
splitContainer_Information.TabStop = false;
toolTip.SetToolTip(splitContainer_Information, resources.GetString("splitContainer_Information.ToolTip"));
splitContainer_Information.SplitterMoved += splitContainer_SplitterMoved;
splitContainer_Information.MouseUp += splitContainer_MouseUp;
//
// groupBox_SkelList
//
resources.ApplyResources(groupBox_SkelList, "groupBox_SkelList");
groupBox_SkelList.Controls.Add(spineListView);
resources.ApplyResources(groupBox_SkelList, "groupBox_SkelList");
groupBox_SkelList.Name = "groupBox_SkelList";
groupBox_SkelList.TabStop = false;
toolTip.SetToolTip(groupBox_SkelList, resources.GetString("groupBox_SkelList.ToolTip"));
//
// spineListView
//
resources.ApplyResources(spineListView, "spineListView");
spineListView.Name = "spineListView";
spineListView.SpinePropertyGrid = spineViewPropertyGrid;
toolTip.SetToolTip(spineListView, resources.GetString("spineListView.ToolTip"));
//
// spineViewPropertyGrid
//
resources.ApplyResources(spineViewPropertyGrid, "spineViewPropertyGrid");
spineViewPropertyGrid.Name = "spineViewPropertyGrid";
toolTip.SetToolTip(spineViewPropertyGrid, resources.GetString("spineViewPropertyGrid.ToolTip"));
//
// splitContainer_Config
//
@@ -206,47 +192,38 @@
//
// splitContainer_Config.Panel1
//
resources.ApplyResources(splitContainer_Config.Panel1, "splitContainer_Config.Panel1");
splitContainer_Config.Panel1.Controls.Add(groupBox_PreviewConfig);
toolTip.SetToolTip(splitContainer_Config.Panel1, resources.GetString("splitContainer_Config.Panel1.ToolTip"));
//
// splitContainer_Config.Panel2
//
resources.ApplyResources(splitContainer_Config.Panel2, "splitContainer_Config.Panel2");
splitContainer_Config.Panel2.Controls.Add(groupBox_SkelConfig);
toolTip.SetToolTip(splitContainer_Config.Panel2, resources.GetString("splitContainer_Config.Panel2.ToolTip"));
toolTip.SetToolTip(splitContainer_Config, resources.GetString("splitContainer_Config.ToolTip"));
//
// groupBox_PreviewConfig
//
resources.ApplyResources(groupBox_PreviewConfig, "groupBox_PreviewConfig");
groupBox_PreviewConfig.Controls.Add(propertyGrid_Previewer);
resources.ApplyResources(groupBox_PreviewConfig, "groupBox_PreviewConfig");
groupBox_PreviewConfig.Name = "groupBox_PreviewConfig";
groupBox_PreviewConfig.TabStop = false;
toolTip.SetToolTip(groupBox_PreviewConfig, resources.GetString("groupBox_PreviewConfig.ToolTip"));
//
// propertyGrid_Previewer
//
resources.ApplyResources(propertyGrid_Previewer, "propertyGrid_Previewer");
propertyGrid_Previewer.Name = "propertyGrid_Previewer";
propertyGrid_Previewer.ToolbarVisible = false;
toolTip.SetToolTip(propertyGrid_Previewer, resources.GetString("propertyGrid_Previewer.ToolTip"));
//
// groupBox_SkelConfig
//
resources.ApplyResources(groupBox_SkelConfig, "groupBox_SkelConfig");
groupBox_SkelConfig.Controls.Add(spineViewPropertyGrid);
resources.ApplyResources(groupBox_SkelConfig, "groupBox_SkelConfig");
groupBox_SkelConfig.Name = "groupBox_SkelConfig";
groupBox_SkelConfig.TabStop = false;
toolTip.SetToolTip(groupBox_SkelConfig, resources.GetString("groupBox_SkelConfig.ToolTip"));
//
// groupBox_Preview
//
resources.ApplyResources(groupBox_Preview, "groupBox_Preview");
groupBox_Preview.Controls.Add(spinePreviewPanel);
resources.ApplyResources(groupBox_Preview, "groupBox_Preview");
groupBox_Preview.Name = "groupBox_Preview";
groupBox_Preview.TabStop = false;
toolTip.SetToolTip(groupBox_Preview, resources.GetString("groupBox_Preview.ToolTip"));
//
// spinePreviewPanel
//
@@ -254,230 +231,250 @@
spinePreviewPanel.Name = "spinePreviewPanel";
spinePreviewPanel.PropertyGrid = propertyGrid_Previewer;
spinePreviewPanel.SpineListView = spineListView;
toolTip.SetToolTip(spinePreviewPanel, resources.GetString("spinePreviewPanel.ToolTip"));
//
// rtbLog
//
resources.ApplyResources(rtbLog, "rtbLog");
rtbLog.BackColor = SystemColors.Window;
rtbLog.BorderStyle = BorderStyle.None;
resources.ApplyResources(rtbLog, "rtbLog");
rtbLog.Name = "rtbLog";
rtbLog.ReadOnly = true;
toolTip.SetToolTip(rtbLog, resources.GetString("rtbLog.ToolTip"));
//
// menuStrip
//
resources.ApplyResources(menuStrip, "menuStrip");
menuStrip.BackColor = SystemColors.Control;
menuStrip.ImageScalingSize = new Size(24, 24);
menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem_File, toolStripMenuItem_Tool, toolStripMenuItem_Download, toolStripMenuItem_Help, toolStripMenuItem_Experiment, ToolStripMenuItem_Language });
menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem_File, toolStripMenuItem_Texture, toolStripMenuItem_Tool, toolStripMenuItem_Download, toolStripMenuItem_Help, toolStripMenuItem_Experiment, ToolStripMenuItem_Language });
resources.ApplyResources(menuStrip, "menuStrip");
menuStrip.Name = "menuStrip";
toolTip.SetToolTip(menuStrip, resources.GetString("menuStrip.ToolTip"));
//
// toolStripMenuItem_File
//
resources.ApplyResources(toolStripMenuItem_File, "toolStripMenuItem_File");
toolStripMenuItem_File.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_Open, toolStripMenuItem_BatchOpen, toolStripSeparator1, toolStripMenuItem_Export, toolStripSeparator2, toolStripMenuItem_Exit });
toolStripMenuItem_File.Name = "toolStripMenuItem_File";
resources.ApplyResources(toolStripMenuItem_File, "toolStripMenuItem_File");
//
// toolStripMenuItem_Open
//
resources.ApplyResources(toolStripMenuItem_Open, "toolStripMenuItem_Open");
toolStripMenuItem_Open.Name = "toolStripMenuItem_Open";
resources.ApplyResources(toolStripMenuItem_Open, "toolStripMenuItem_Open");
toolStripMenuItem_Open.Click += toolStripMenuItem_Open_Click;
//
// toolStripMenuItem_BatchOpen
//
resources.ApplyResources(toolStripMenuItem_BatchOpen, "toolStripMenuItem_BatchOpen");
toolStripMenuItem_BatchOpen.Name = "toolStripMenuItem_BatchOpen";
resources.ApplyResources(toolStripMenuItem_BatchOpen, "toolStripMenuItem_BatchOpen");
toolStripMenuItem_BatchOpen.Click += toolStripMenuItem_BatchOpen_Click;
//
// toolStripSeparator1
//
resources.ApplyResources(toolStripSeparator1, "toolStripSeparator1");
toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(toolStripSeparator1, "toolStripSeparator1");
//
// toolStripMenuItem_Export
//
resources.ApplyResources(toolStripMenuItem_Export, "toolStripMenuItem_Export");
toolStripMenuItem_Export.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ExportFrame, toolStripMenuItem_ExportFrameSequence, toolStripSeparator4, toolStripMenuItem_ExportGif, toolStripMenuItem_ExportWebp, toolStripMenuItem_ExportAvif, toolStripSeparator5, toolStripMenuItem_ExportMp4, toolStripMenuItem_ExportWebm, toolStripMenuItem_ExportMkv, toolStripMenuItem_ExportMov, toolStripSeparator6, toolStripMenuItem_ExportCustom });
toolStripMenuItem_Export.Name = "toolStripMenuItem_Export";
resources.ApplyResources(toolStripMenuItem_Export, "toolStripMenuItem_Export");
//
// toolStripMenuItem_ExportFrame
//
resources.ApplyResources(toolStripMenuItem_ExportFrame, "toolStripMenuItem_ExportFrame");
toolStripMenuItem_ExportFrame.Name = "toolStripMenuItem_ExportFrame";
resources.ApplyResources(toolStripMenuItem_ExportFrame, "toolStripMenuItem_ExportFrame");
toolStripMenuItem_ExportFrame.Click += toolStripMenuItem_ExportFrame_Click;
//
// toolStripMenuItem_ExportFrameSequence
//
resources.ApplyResources(toolStripMenuItem_ExportFrameSequence, "toolStripMenuItem_ExportFrameSequence");
toolStripMenuItem_ExportFrameSequence.Name = "toolStripMenuItem_ExportFrameSequence";
resources.ApplyResources(toolStripMenuItem_ExportFrameSequence, "toolStripMenuItem_ExportFrameSequence");
toolStripMenuItem_ExportFrameSequence.Click += toolStripMenuItem_ExportFrameSequence_Click;
//
// toolStripSeparator4
//
resources.ApplyResources(toolStripSeparator4, "toolStripSeparator4");
toolStripSeparator4.Name = "toolStripSeparator4";
resources.ApplyResources(toolStripSeparator4, "toolStripSeparator4");
//
// toolStripMenuItem_ExportGif
//
resources.ApplyResources(toolStripMenuItem_ExportGif, "toolStripMenuItem_ExportGif");
toolStripMenuItem_ExportGif.Name = "toolStripMenuItem_ExportGif";
resources.ApplyResources(toolStripMenuItem_ExportGif, "toolStripMenuItem_ExportGif");
toolStripMenuItem_ExportGif.Click += toolStripMenuItem_ExportGif_Click;
//
// toolStripMenuItem_ExportWebp
//
resources.ApplyResources(toolStripMenuItem_ExportWebp, "toolStripMenuItem_ExportWebp");
toolStripMenuItem_ExportWebp.Name = "toolStripMenuItem_ExportWebp";
resources.ApplyResources(toolStripMenuItem_ExportWebp, "toolStripMenuItem_ExportWebp");
toolStripMenuItem_ExportWebp.Click += toolStripMenuItem_ExportWebp_Click;
//
// toolStripMenuItem_ExportAvif
//
resources.ApplyResources(toolStripMenuItem_ExportAvif, "toolStripMenuItem_ExportAvif");
toolStripMenuItem_ExportAvif.Name = "toolStripMenuItem_ExportAvif";
resources.ApplyResources(toolStripMenuItem_ExportAvif, "toolStripMenuItem_ExportAvif");
toolStripMenuItem_ExportAvif.Click += toolStripMenuItem_ExportAvif_Click;
//
// toolStripSeparator5
//
resources.ApplyResources(toolStripSeparator5, "toolStripSeparator5");
toolStripSeparator5.Name = "toolStripSeparator5";
resources.ApplyResources(toolStripSeparator5, "toolStripSeparator5");
//
// toolStripMenuItem_ExportMp4
//
resources.ApplyResources(toolStripMenuItem_ExportMp4, "toolStripMenuItem_ExportMp4");
toolStripMenuItem_ExportMp4.Name = "toolStripMenuItem_ExportMp4";
resources.ApplyResources(toolStripMenuItem_ExportMp4, "toolStripMenuItem_ExportMp4");
toolStripMenuItem_ExportMp4.Click += toolStripMenuItem_ExportMp4_Click;
//
// toolStripMenuItem_ExportWebm
//
resources.ApplyResources(toolStripMenuItem_ExportWebm, "toolStripMenuItem_ExportWebm");
toolStripMenuItem_ExportWebm.Name = "toolStripMenuItem_ExportWebm";
resources.ApplyResources(toolStripMenuItem_ExportWebm, "toolStripMenuItem_ExportWebm");
toolStripMenuItem_ExportWebm.Click += toolStripMenuItem_ExportWebm_Click;
//
// toolStripMenuItem_ExportMkv
//
resources.ApplyResources(toolStripMenuItem_ExportMkv, "toolStripMenuItem_ExportMkv");
toolStripMenuItem_ExportMkv.Name = "toolStripMenuItem_ExportMkv";
resources.ApplyResources(toolStripMenuItem_ExportMkv, "toolStripMenuItem_ExportMkv");
toolStripMenuItem_ExportMkv.Click += toolStripMenuItem_ExportMkv_Click;
//
// toolStripMenuItem_ExportMov
//
resources.ApplyResources(toolStripMenuItem_ExportMov, "toolStripMenuItem_ExportMov");
toolStripMenuItem_ExportMov.Name = "toolStripMenuItem_ExportMov";
resources.ApplyResources(toolStripMenuItem_ExportMov, "toolStripMenuItem_ExportMov");
toolStripMenuItem_ExportMov.Click += toolStripMenuItem_ExportMov_Click;
//
// toolStripSeparator6
//
resources.ApplyResources(toolStripSeparator6, "toolStripSeparator6");
toolStripSeparator6.Name = "toolStripSeparator6";
resources.ApplyResources(toolStripSeparator6, "toolStripSeparator6");
//
// toolStripMenuItem_ExportCustom
//
resources.ApplyResources(toolStripMenuItem_ExportCustom, "toolStripMenuItem_ExportCustom");
toolStripMenuItem_ExportCustom.Name = "toolStripMenuItem_ExportCustom";
resources.ApplyResources(toolStripMenuItem_ExportCustom, "toolStripMenuItem_ExportCustom");
toolStripMenuItem_ExportCustom.Click += toolStripMenuItem_ExportCustom_Click;
//
// toolStripSeparator2
//
resources.ApplyResources(toolStripSeparator2, "toolStripSeparator2");
toolStripSeparator2.Name = "toolStripSeparator2";
resources.ApplyResources(toolStripSeparator2, "toolStripSeparator2");
//
// toolStripMenuItem_Exit
//
resources.ApplyResources(toolStripMenuItem_Exit, "toolStripMenuItem_Exit");
toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit";
resources.ApplyResources(toolStripMenuItem_Exit, "toolStripMenuItem_Exit");
toolStripMenuItem_Exit.Click += toolStripMenuItem_Exit_Click;
//
// toolStripMenuItem_Texture
//
toolStripMenuItem_Texture.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ForceSmooth, toolStripMenuItem_ForceRepeated, toolStripMenuItem_ForceMipmap });
toolStripMenuItem_Texture.Name = "toolStripMenuItem_Texture";
resources.ApplyResources(toolStripMenuItem_Texture, "toolStripMenuItem_Texture");
//
// toolStripMenuItem_ForceSmooth
//
toolStripMenuItem_ForceSmooth.Name = "toolStripMenuItem_ForceSmooth";
resources.ApplyResources(toolStripMenuItem_ForceSmooth, "toolStripMenuItem_ForceSmooth");
toolStripMenuItem_ForceSmooth.Click += toolStripMenuItem_ForceSmooth_Click;
//
// toolStripMenuItem_ForceRepeated
//
toolStripMenuItem_ForceRepeated.Name = "toolStripMenuItem_ForceRepeated";
resources.ApplyResources(toolStripMenuItem_ForceRepeated, "toolStripMenuItem_ForceRepeated");
toolStripMenuItem_ForceRepeated.Click += toolStripMenuItem_ForceRepeated_Click;
//
// toolStripMenuItem_ForceMipmap
//
toolStripMenuItem_ForceMipmap.Name = "toolStripMenuItem_ForceMipmap";
resources.ApplyResources(toolStripMenuItem_ForceMipmap, "toolStripMenuItem_ForceMipmap");
toolStripMenuItem_ForceMipmap.Click += toolStripMenuItem_ForceMipmap_Click;
//
// toolStripMenuItem_Tool
//
resources.ApplyResources(toolStripMenuItem_Tool, "toolStripMenuItem_Tool");
toolStripMenuItem_Tool.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ConvertFileFormat });
toolStripMenuItem_Tool.Name = "toolStripMenuItem_Tool";
resources.ApplyResources(toolStripMenuItem_Tool, "toolStripMenuItem_Tool");
//
// toolStripMenuItem_ConvertFileFormat
//
resources.ApplyResources(toolStripMenuItem_ConvertFileFormat, "toolStripMenuItem_ConvertFileFormat");
toolStripMenuItem_ConvertFileFormat.Name = "toolStripMenuItem_ConvertFileFormat";
resources.ApplyResources(toolStripMenuItem_ConvertFileFormat, "toolStripMenuItem_ConvertFileFormat");
toolStripMenuItem_ConvertFileFormat.Click += toolStripMenuItem_ConvertFileFormat_Click;
//
// toolStripMenuItem_Download
//
resources.ApplyResources(toolStripMenuItem_Download, "toolStripMenuItem_Download");
toolStripMenuItem_Download.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_ManageResource });
toolStripMenuItem_Download.Name = "toolStripMenuItem_Download";
resources.ApplyResources(toolStripMenuItem_Download, "toolStripMenuItem_Download");
//
// toolStripMenuItem_ManageResource
//
resources.ApplyResources(toolStripMenuItem_ManageResource, "toolStripMenuItem_ManageResource");
toolStripMenuItem_ManageResource.Name = "toolStripMenuItem_ManageResource";
resources.ApplyResources(toolStripMenuItem_ManageResource, "toolStripMenuItem_ManageResource");
toolStripMenuItem_ManageResource.Click += toolStripMenuItem_ManageResource_Click;
//
// toolStripMenuItem_Help
//
resources.ApplyResources(toolStripMenuItem_Help, "toolStripMenuItem_Help");
toolStripMenuItem_Help.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_Diagnostics, toolStripSeparator3, toolStripMenuItem_About, toolStripMenuItem_Debug });
toolStripMenuItem_Help.Name = "toolStripMenuItem_Help";
resources.ApplyResources(toolStripMenuItem_Help, "toolStripMenuItem_Help");
//
// toolStripMenuItem_Diagnostics
//
resources.ApplyResources(toolStripMenuItem_Diagnostics, "toolStripMenuItem_Diagnostics");
toolStripMenuItem_Diagnostics.Name = "toolStripMenuItem_Diagnostics";
resources.ApplyResources(toolStripMenuItem_Diagnostics, "toolStripMenuItem_Diagnostics");
toolStripMenuItem_Diagnostics.Click += toolStripMenuItem_Diagnostics_Click;
//
// toolStripSeparator3
//
resources.ApplyResources(toolStripSeparator3, "toolStripSeparator3");
toolStripSeparator3.Name = "toolStripSeparator3";
resources.ApplyResources(toolStripSeparator3, "toolStripSeparator3");
//
// toolStripMenuItem_About
//
resources.ApplyResources(toolStripMenuItem_About, "toolStripMenuItem_About");
toolStripMenuItem_About.Name = "toolStripMenuItem_About";
resources.ApplyResources(toolStripMenuItem_About, "toolStripMenuItem_About");
toolStripMenuItem_About.Click += toolStripMenuItem_About_Click;
//
// toolStripMenuItem_Debug
//
resources.ApplyResources(toolStripMenuItem_Debug, "toolStripMenuItem_Debug");
toolStripMenuItem_Debug.Name = "toolStripMenuItem_Debug";
resources.ApplyResources(toolStripMenuItem_Debug, "toolStripMenuItem_Debug");
toolStripMenuItem_Debug.Click += toolStripMenuItem_Debug_Click;
//
// toolStripMenuItem_Experiment
//
resources.ApplyResources(toolStripMenuItem_Experiment, "toolStripMenuItem_Experiment");
toolStripMenuItem_Experiment.DropDownItems.AddRange(new ToolStripItem[] { toolStripMenuItem_DesktopProjection });
toolStripMenuItem_Experiment.Name = "toolStripMenuItem_Experiment";
resources.ApplyResources(toolStripMenuItem_Experiment, "toolStripMenuItem_Experiment");
//
// toolStripMenuItem_DesktopProjection
//
resources.ApplyResources(toolStripMenuItem_DesktopProjection, "toolStripMenuItem_DesktopProjection");
toolStripMenuItem_DesktopProjection.Name = "toolStripMenuItem_DesktopProjection";
resources.ApplyResources(toolStripMenuItem_DesktopProjection, "toolStripMenuItem_DesktopProjection");
toolStripMenuItem_DesktopProjection.Click += toolStripMenuItem_DesktopProjection_Click;
//
// ToolStripMenuItem_Language
//
resources.ApplyResources(ToolStripMenuItem_Language, "ToolStripMenuItem_Language");
ToolStripMenuItem_Language.DropDownItems.AddRange(new ToolStripItem[] { ToolStripMenuItem_English, ToolStripMenuItem_Chinese });
ToolStripMenuItem_Language.Name = "ToolStripMenuItem_Language";
resources.ApplyResources(ToolStripMenuItem_Language, "ToolStripMenuItem_Language");
//
// ToolStripMenuItem_English
//
resources.ApplyResources(ToolStripMenuItem_English, "ToolStripMenuItem_English");
ToolStripMenuItem_English.Name = "ToolStripMenuItem_English";
resources.ApplyResources(ToolStripMenuItem_English, "ToolStripMenuItem_English");
ToolStripMenuItem_English.Click += ToolStripMenuItem_English_Click;
//
// ToolStripMenuItem_Chinese
//
resources.ApplyResources(ToolStripMenuItem_Chinese, "ToolStripMenuItem_Chinese");
ToolStripMenuItem_Chinese.Name = "ToolStripMenuItem_Chinese";
resources.ApplyResources(ToolStripMenuItem_Chinese, "ToolStripMenuItem_Chinese");
ToolStripMenuItem_Chinese.Click += ToolStripMenuItem_Chinese_Click;
//
// panel_MainForm
//
resources.ApplyResources(panel_MainForm, "panel_MainForm");
panel_MainForm.Controls.Add(splitContainer_MainForm);
resources.ApplyResources(panel_MainForm, "panel_MainForm");
panel_MainForm.Name = "panel_MainForm";
toolTip.SetToolTip(panel_MainForm, resources.GetString("panel_MainForm.ToolTip"));
//
// toolTip
//
@@ -491,7 +488,6 @@
Controls.Add(menuStrip);
MainMenuStrip = menuStrip;
Name = "SpineViewerForm";
toolTip.SetToolTip(this, resources.GetString("$this.ToolTip"));
FormClosing += MainForm_FormClosing;
Load += MainForm_Load;
splitContainer_MainForm.Panel1.ResumeLayout(false);
@@ -573,5 +569,9 @@
private ToolStripMenuItem ToolStripMenuItem_Language;
private ToolStripMenuItem ToolStripMenuItem_English;
private ToolStripMenuItem ToolStripMenuItem_Chinese;
}
private ToolStripMenuItem toolStripMenuItem_Texture;
private ToolStripMenuItem toolStripMenuItem_ForceSmooth;
private ToolStripMenuItem toolStripMenuItem_ForceRepeated;
private ToolStripMenuItem toolStripMenuItem_ForceMipmap;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -119,7 +119,7 @@
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="groupBox_SkelList.Size" type="System.Drawing.Size, System.Drawing">
<value>350, 808</value>
<value>350, 804</value>
</data>
<data name="groupBox_SkelList.Text" xml:space="preserve">
<value>Model List</value>
@@ -131,7 +131,7 @@
<value />
</data>
<data name="groupBox_PreviewConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>430, 267</value>
<value>430, 265</value>
</data>
<data name="groupBox_PreviewConfig.Text" xml:space="preserve">
<value>Image Parameters</value>
@@ -143,7 +143,7 @@
<value />
</data>
<data name="groupBox_SkelConfig.Size" type="System.Drawing.Size, System.Drawing">
<value>430, 533</value>
<value>430, 531</value>
</data>
<data name="groupBox_SkelConfig.Text" xml:space="preserve">
<value>Model Parameters</value>
@@ -155,11 +155,11 @@
<value />
</data>
<data name="splitContainer_Config.Size" type="System.Drawing.Size, System.Drawing">
<value>430, 808</value>
<value>430, 804</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="splitContainer_Config.SplitterDistance" type="System.Int32, mscorlib">
<value>267</value>
<value>265</value>
</data>
<data name="splitContainer_Config.ToolTip" xml:space="preserve">
<value />
@@ -168,7 +168,7 @@
<value />
</data>
<data name="splitContainer_Information.Size" type="System.Drawing.Size, System.Drawing">
<value>788, 808</value>
<value>788, 804</value>
</data>
<data name="splitContainer_Information.ToolTip" xml:space="preserve">
<value />
@@ -177,7 +177,7 @@
<value />
</data>
<data name="groupBox_Preview.Size" type="System.Drawing.Size, System.Drawing">
<value>962, 808</value>
<value>962, 804</value>
</data>
<data name="groupBox_Preview.Text" xml:space="preserve">
<value>Preview Screen</value>
@@ -189,7 +189,7 @@
<value />
</data>
<data name="splitContainer_Functional.Size" type="System.Drawing.Size, System.Drawing">
<value>1758, 808</value>
<value>1758, 804</value>
</data>
<data name="splitContainer_Functional.ToolTip" xml:space="preserve">
<value />
@@ -198,7 +198,7 @@
<value />
</data>
<data name="rtbLog.Size" type="System.Drawing.Size, System.Drawing">
<value>1758, 188</value>
<value>1758, 192</value>
</data>
<data name="rtbLog.ToolTip" xml:space="preserve">
<value />
@@ -207,16 +207,16 @@
<value />
</data>
<data name="splitContainer_MainForm.SplitterDistance" type="System.Int32, mscorlib">
<value>808</value>
<value>804</value>
</data>
<data name="splitContainer_MainForm.ToolTip" xml:space="preserve">
<value />
</data>
<data name="spineListView.Size" type="System.Drawing.Size, System.Drawing">
<value>346, 781</value>
<value>346, 777</value>
</data>
<data name="spineViewPropertyGrid.Size" type="System.Drawing.Size, System.Drawing">
<value>426, 506</value>
<value>426, 504</value>
</data>
<data name="spineViewPropertyGrid.ToolTip" xml:space="preserve">
<value />
@@ -225,13 +225,13 @@
<value />
</data>
<data name="propertyGrid_Previewer.Size" type="System.Drawing.Size, System.Drawing">
<value>426, 240</value>
<value>426, 238</value>
</data>
<data name="propertyGrid_Previewer.ToolTip" xml:space="preserve">
<value />
</data>
<data name="spinePreviewPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>958, 781</value>
<value>958, 777</value>
</data>
<data name="spinePreviewPanel.ToolTip" xml:space="preserve">
<value />
@@ -246,22 +246,22 @@
<value>File(&amp;F)</value>
</data>
<data name="toolStripMenuItem_Open.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
<value>266, 34</value>
</data>
<data name="toolStripMenuItem_Open.Text" xml:space="preserve">
<value>Open(&amp;O)...</value>
</data>
<data name="toolStripMenuItem_BatchOpen.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
<value>266, 34</value>
</data>
<data name="toolStripMenuItem_BatchOpen.Text" xml:space="preserve">
<value>Batch Open(&amp;B)...</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>267, 6</value>
<value>263, 6</value>
</data>
<data name="toolStripMenuItem_Export.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
<value>266, 34</value>
</data>
<data name="toolStripMenuItem_Export.Text" xml:space="preserve">
<value>Export(&amp;E)</value>
@@ -315,14 +315,29 @@
<value>FFmpeg Custom Export...</value>
</data>
<data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing">
<value>267, 6</value>
<value>263, 6</value>
</data>
<data name="toolStripMenuItem_Exit.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
<value>266, 34</value>
</data>
<data name="toolStripMenuItem_Exit.Text" xml:space="preserve">
<value>Exit(&amp;X)</value>
</data>
<data name="toolStripMenuItem_Texture.Size" type="System.Drawing.Size, System.Drawing">
<value>112, 32</value>
</data>
<data name="toolStripMenuItem_Texture.Text" xml:space="preserve">
<value>Texture(&amp;E)</value>
</data>
<data name="toolStripMenuItem_ForceSmooth.Text" xml:space="preserve">
<value>Force Smooth</value>
</data>
<data name="toolStripMenuItem_ForceRepeated.Text" xml:space="preserve">
<value>Force Repeated</value>
</data>
<data name="toolStripMenuItem_ForceMipmap.Text" xml:space="preserve">
<value>Force Mipmap</value>
</data>
<data name="toolStripMenuItem_Tool.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 32</value>
</data>
@@ -392,12 +407,6 @@
<data name="ToolStripMenuItem_Language.Text" xml:space="preserve">
<value>Language(&amp;L)</value>
</data>
<data name="ToolStripMenuItem_English.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
</data>
<data name="ToolStripMenuItem_Chinese.Size" type="System.Drawing.Size, System.Drawing">
<value>270, 34</value>
</data>
<data name="panel_MainForm.ToolTip" xml:space="preserve">
<value />
</data>

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
using NLog;
using SpineViewer.Spine.Implementations.SkeletonConverter;
using SpineViewer.Utils;
using SpineViewer.Utils.Localize;
using System.Configuration;
@@ -47,14 +48,14 @@ namespace SpineViewer
InitializeLogConfiguration();
logger.Info("Program Started");
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
LocalizeConfiguration.SetCulture();
try
try
{
Application.Run(new SpineViewerForm() { Text = $"SpineViewer - v{Version}"});
Application.Run(new SpineViewerForm() { Text = $"SpineViewer - v{Version}" });
}
catch (Exception ex)
{

File diff suppressed because it is too large Load Diff

View File

@@ -294,7 +294,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
data["inertia"] = reader.ReadFloat();
data["strength"] = reader.ReadFloat();
data["damping"] = reader.ReadFloat();
if ((flags & 128) != 0) data["mass"] = reader.ReadFloat();
if ((flags & 128) != 0) data["mass"] = 1.0f / reader.ReadFloat(); //在binary中存储的是质量的倒数在json中存储的是质量
data["wind"] = reader.ReadFloat();
data["gravity"] = reader.ReadFloat();
@@ -325,6 +325,21 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
// other skins
for (int n = reader.ReadVarInt(); n > 0; n--)
skins.Add(ReadSkin());
//处理linkedmesh的问题后面有相关代码和注释
foreach (JsonObject skin in skins)
{
foreach (var (_, slot) in skin["attachments"].AsObject())
{
foreach (var (_, attachment) in slot.AsObject())
{
if ((string)attachment["type"] == "linkedMesh")
{
attachment["skin"] = (string)skins[(int)attachment["skin"]]["name"];
}
}
}
}
}
private JsonObject? ReadSkin(bool isDefault = false)
@@ -423,7 +438,9 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
if ((flags & 32) != 0) attachment["color"] = reader.ReadInt().ToString("x8");
if ((flags & 64) != 0) attachment["sequence"] = ReadSequence();
if ((flags & 128) == 0) attachment["timelines"] = false;
attachment["skin"] = (string)skins[reader.ReadVarInt()]["name"];
//attachment["skin"] = (string)skins[reader.ReadVarInt()]["name"];
//还是那个mix-and-match4.2版本的mix-and-match出现了读取错误,后面写的时候也一样linkedmesh的skin为后面还未访问的skin
attachment["skin"] = reader.ReadVarInt();
attachment["parent"] = reader.ReadStringRef();
if (nonessential)
{
@@ -1500,7 +1517,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
writer.WriteFloat((float)(data["inertia"] ?? 1f));
writer.WriteFloat((float)(data["strength"] ?? 100f));
writer.WriteFloat((float)(data["damping"] ?? 1f));
if ((flags & 128) != 0) writer.WriteFloat(1f / (float)data["mass"]);
if ((flags & 128) != 0) writer.WriteFloat(1f / (float)data["mass"]);
writer.WriteFloat((float)(data["wind"] ?? 0f));
writer.WriteFloat((float)(data["gravity"] ?? 0f));
@@ -1528,8 +1545,26 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
writer.WriteVarInt(0); // 其他皮肤数量
return;
}
//此处还是得先把数据全读了反面例子还是那个mix-and-match4.2版本的mix-and-match中default用到了后面的skin,转换失败
//mix-and-match的full-skins/boy这个skin他的linkedmesh调用了后面的full-skins/boy
JsonArray skins = root["skins"].AsArray();
foreach (JsonObject sk in skins)
{
if ((string)sk["name"] == "default")
{
skin2idx["default"] = 0;
break;
}
}
foreach (JsonObject sk in skins)
{
if ((string)sk["name"] != "default")
{
skin2idx["default"] = skin2idx.Count;
}
}
bool hasDefault = false;
foreach (JsonObject skin in skins)
{
@@ -1537,7 +1572,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
{
hasDefault = true;
WriteSkin(skin, true);
skin2idx["default"] = skin2idx.Count;
//skin2idx["default"] = skin2idx.Count;
break;
}
}
@@ -1558,7 +1593,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter
if (name != "default")
{
WriteSkin(skin);
skin2idx[name] = skin2idx.Count;
//skin2idx[name] = skin2idx.Count;
}
}
}

View File

@@ -29,26 +29,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
// };
//}
private class TextureLoader : SpineRuntime21.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private readonly static TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -70,7 +50,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject21(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -90,6 +71,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -116,7 +98,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -29,26 +29,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime36.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -69,7 +49,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject36(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -89,6 +70,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -115,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -26,26 +26,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime37.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -66,7 +46,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject37(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -86,6 +67,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -112,7 +94,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -30,29 +30,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime38.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
// 似乎是不需要设置的, 因为存在某些 png 和 atlas 大小不同的情况, 一般是有一些缩放, 如果设置了反而渲染异常
// page.width = (int)texture.Size.X;
// page.height = (int)texture.Size.Y;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -73,7 +50,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject38(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -93,6 +71,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch (Exception ex)
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}", ex);
}
}
@@ -119,7 +98,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -28,26 +28,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime40.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -68,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject40(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -88,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -115,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -28,26 +28,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime41.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -68,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject41(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -88,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -115,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -28,26 +28,6 @@ namespace SpineViewer.Spine.Implementations.SpineObject
};
}
private class TextureLoader : SpineRuntime42.TextureLoader
{
public void Load(AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == TextureFilter.Linear)
texture.Smooth = true;
if (page.uWrap == TextureWrap.Repeat && page.vWrap == TextureWrap.Repeat)
texture.Repeated = true;
page.rendererObject = texture;
}
public void Unload(object texture)
{
((SFML.Graphics.Texture)texture).Dispose();
}
}
private static readonly TextureLoader textureLoader = new();
private static readonly Animation EmptyAnimation = new(EMPTY_ANIMATION, [], 0);
private readonly Atlas atlas;
@@ -68,7 +48,8 @@ namespace SpineViewer.Spine.Implementations.SpineObject
public SpineObject42(string skelPath, string atlasPath) : base(skelPath, atlasPath)
{
atlas = new Atlas(AtlasPath, textureLoader);
try { atlas = new Atlas(AtlasPath, textureLoader); }
catch (Exception ex) { throw new InvalidDataException($"Failed to load atlas '{atlasPath}'", ex); }
try
{
// 先尝试二进制文件
@@ -88,6 +69,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
catch
{
// 都不行就报错
atlas.Dispose();
throw new InvalidDataException($"Unknown skeleton file format {SkelPath}");
}
}
@@ -115,7 +97,7 @@ namespace SpineViewer.Spine.Implementations.SpineObject
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
atlas.Dispose();
atlas?.Dispose();
}
public override string FileVersion { get => skeletonData.Version; }

View File

@@ -32,6 +32,12 @@ namespace SpineViewer.Spine
/// </summary>
protected static readonly Size PreviewResolution = new(256, 256);
/// <summary>
/// 纹理加载器
/// </summary>
public static TextureLoader TextureLoader => textureLoader;
protected readonly static TextureLoader textureLoader = new();
/// <summary>
/// 创建特定版本的 Spine
/// </summary>

View File

@@ -0,0 +1,287 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SpineViewer.Spine
{
/// <summary>
/// 实现不同版本的 TextureLoader
/// </summary>
public class TextureLoader :
SpineRuntime21.TextureLoader,
SpineRuntime36.TextureLoader,
SpineRuntime37.TextureLoader,
SpineRuntime38.TextureLoader,
SpineRuntime40.TextureLoader,
SpineRuntime41.TextureLoader,
SpineRuntime42.TextureLoader
{
/// <summary>
/// 强制启用 Smooth
/// </summary>
public bool ForceSmooth { get; set; } = false;
/// <summary>
/// 强制启用 Repeated
/// </summary>
public bool ForceRepeated { get; set; } = false;
/// <summary>
/// 强制启用 Mipmap
/// </summary>
public bool ForceMipmap { get; set; } = false;
public void Load(SpineRuntime21.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime21.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime21.TextureWrap.Repeat && page.vWrap == SpineRuntime21.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime21.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime21.TextureFilter.MipMap:
case SpineRuntime21.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime21.TextureFilter.MipMapLinearNearest:
case SpineRuntime21.TextureFilter.MipMapNearestLinear:
case SpineRuntime21.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime36.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime36.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime36.TextureWrap.Repeat && page.vWrap == SpineRuntime36.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime36.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime36.TextureFilter.MipMap:
case SpineRuntime36.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime36.TextureFilter.MipMapLinearNearest:
case SpineRuntime36.TextureFilter.MipMapNearestLinear:
case SpineRuntime36.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime37.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime37.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime37.TextureWrap.Repeat && page.vWrap == SpineRuntime37.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime37.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime37.TextureFilter.MipMap:
case SpineRuntime37.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime37.TextureFilter.MipMapLinearNearest:
case SpineRuntime37.TextureFilter.MipMapNearestLinear:
case SpineRuntime37.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime38.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime38.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime38.TextureWrap.Repeat && page.vWrap == SpineRuntime38.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime38.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime38.TextureFilter.MipMap:
case SpineRuntime38.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime38.TextureFilter.MipMapLinearNearest:
case SpineRuntime38.TextureFilter.MipMapNearestLinear:
case SpineRuntime38.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime40.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime40.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime40.TextureWrap.Repeat && page.vWrap == SpineRuntime40.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime40.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime40.TextureFilter.MipMap:
case SpineRuntime40.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime40.TextureFilter.MipMapLinearNearest:
case SpineRuntime40.TextureFilter.MipMapNearestLinear:
case SpineRuntime40.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime41.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime41.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime41.TextureWrap.Repeat && page.vWrap == SpineRuntime41.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime41.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime41.TextureFilter.MipMap:
case SpineRuntime41.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime41.TextureFilter.MipMapLinearNearest:
case SpineRuntime41.TextureFilter.MipMapNearestLinear:
case SpineRuntime41.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
}
public void Load(SpineRuntime42.AtlasPage page, string path)
{
var texture = new SFML.Graphics.Texture(path);
if (page.magFilter == SpineRuntime42.TextureFilter.Linear)
{
texture.Smooth = true;
}
if (page.uWrap == SpineRuntime42.TextureWrap.Repeat && page.vWrap == SpineRuntime42.TextureWrap.Repeat)
{
texture.Repeated = true;
}
switch (page.minFilter)
{
case SpineRuntime42.TextureFilter.Linear:
texture.Smooth = true;
break;
case SpineRuntime42.TextureFilter.MipMap:
case SpineRuntime42.TextureFilter.MipMapNearestNearest:
texture.GenerateMipmap();
break;
case SpineRuntime42.TextureFilter.MipMapLinearNearest:
case SpineRuntime42.TextureFilter.MipMapNearestLinear:
case SpineRuntime42.TextureFilter.MipMapLinearLinear:
texture.Smooth = true;
texture.GenerateMipmap();
break;
}
if (ForceSmooth) texture.Smooth = true;
if (ForceRepeated) texture.Repeated = true;
if (ForceMipmap) texture.GenerateMipmap();
page.rendererObject = texture;
// 似乎是不需要设置的, 因为存在某些 png 和 atlas 大小不同的情况, 一般是有一些缩放, 如果设置了反而渲染异常
// page.width = (int)texture.Size.X;
// page.height = (int)texture.Size.Y;
}
public void Unload(object texture) => ((SFML.Graphics.Texture)texture).Dispose();
}
}

View File

@@ -7,7 +7,7 @@
<TargetFramework>net8.0-windows</TargetFramework>
<BaseOutputPath>$(SolutionDir)out</BaseOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>0.12.9</Version>
<Version>0.12.11</Version>
<OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>appicon.ico</ApplicationIcon>