mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
如果动画未加载好,则跳过
This commit is contained in:
parent
d3a125ac1d
commit
d0f985c8ca
@ -167,7 +167,7 @@ namespace VPet_Simulator.Core
|
||||
/// <summary>
|
||||
/// 最大同时加载数
|
||||
/// </summary>
|
||||
public static int MaxLoadNumber = 20;
|
||||
public static int MaxLoadNumber = 40;
|
||||
|
||||
private void startup(string path, FileInfo[] paths)
|
||||
{
|
||||
@ -179,7 +179,7 @@ namespace VPet_Simulator.Core
|
||||
//新方法:加载大图片
|
||||
//生成大文件加载非常慢,先看看有没有缓存能用
|
||||
Path = System.IO.Path.Combine(GraphCore.CachePath, $"{GraphCore.Resolution}_{Math.Abs(Sub.GetHashCode(path))}_{paths.Length}.png");
|
||||
Width = 500 * (paths.Length + 1);
|
||||
Width = 500 * (paths.Length + 1);
|
||||
if (!File.Exists(Path) && !((List<string>)GraphCore.CommConfig["Cache"]).Contains(path))
|
||||
{
|
||||
((List<string>)GraphCore.CommConfig["Cache"]).Add(path);
|
||||
@ -194,7 +194,7 @@ namespace VPet_Simulator.Core
|
||||
w = GraphCore.Resolution;
|
||||
h = (int)(h * (GraphCore.Resolution / (double)img.Width));
|
||||
}
|
||||
if(paths.Length * w >= 60000)
|
||||
if (paths.Length * w >= 60000)
|
||||
{//修复大长动画导致过长分辨率导致可能的报错
|
||||
w = 60000 / paths.Length;
|
||||
h = (int)(img.Height * (w / (double)img.Width));
|
||||
@ -325,6 +325,11 @@ namespace VPet_Simulator.Core
|
||||
// endwilldo.Invoke();
|
||||
// endwilldo = null;
|
||||
//}
|
||||
if (!IsReady)
|
||||
{
|
||||
EndAction?.Invoke();
|
||||
return;
|
||||
}
|
||||
if (PlayState)
|
||||
{//如果当前正在运行,重置状态
|
||||
//IsResetPlay = true;
|
||||
|
@ -53,9 +53,9 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
|
||||
#if X64
|
||||
PNGAnimation.MaxLoadNumber = 50;
|
||||
PNGAnimation.MaxLoadNumber = 100;
|
||||
#else
|
||||
PNGAnimation.MaxLoadNumber = 20;
|
||||
PNGAnimation.MaxLoadNumber = 50;
|
||||
#endif
|
||||
ExtensionValue.BaseDirectory = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user