Add progress tracking for chart loading.
This commit is contained in:
26
Assets/Cryville/Common/Coroutine.cs
Normal file
26
Assets/Cryville/Common/Coroutine.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Cryville.Common {
|
||||||
|
public class Coroutine {
|
||||||
|
readonly IEnumerator<float> _enumerator;
|
||||||
|
readonly Stopwatch _stopwatch = new Stopwatch();
|
||||||
|
public float Progress { get; private set; }
|
||||||
|
public Coroutine(IEnumerator<float> enumerator) {
|
||||||
|
_enumerator = enumerator;
|
||||||
|
}
|
||||||
|
public bool TickOnce() {
|
||||||
|
if (!_enumerator.MoveNext()) return false;
|
||||||
|
Progress = _enumerator.Current;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public bool Tick(double minTime) {
|
||||||
|
_stopwatch.Restart();
|
||||||
|
while (_stopwatch.Elapsed.TotalSeconds < minTime) {
|
||||||
|
if (!_enumerator.MoveNext()) return false;
|
||||||
|
Progress = _enumerator.Current;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Common/Coroutine.cs.meta
Normal file
11
Assets/Cryville/Common/Coroutine.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 387adc7d494be0147b7cb930bc2e726b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -16,7 +16,8 @@ using UnityEngine;
|
|||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using UnityEngine.Scripting;
|
using UnityEngine.Scripting;
|
||||||
using diag = System.Diagnostics;
|
using Coroutine = Cryville.Common.Coroutine;
|
||||||
|
using Stopwatch = System.Diagnostics.Stopwatch;
|
||||||
using Logger = Cryville.Common.Logger;
|
using Logger = Cryville.Common.Logger;
|
||||||
|
|
||||||
namespace Cryville.Crtr {
|
namespace Cryville.Crtr {
|
||||||
@@ -30,14 +31,6 @@ namespace Cryville.Crtr {
|
|||||||
Dictionary<string, Texture2D> texs;
|
Dictionary<string, Texture2D> texs;
|
||||||
public static Dictionary<string, SpriteFrame> frames;
|
public static Dictionary<string, SpriteFrame> frames;
|
||||||
|
|
||||||
readonly Queue<string> texLoadQueue = new Queue<string>();
|
|
||||||
#if UNITY_5_4_OR_NEWER
|
|
||||||
DownloadHandlerTexture texHandler;
|
|
||||||
UnityWebRequest texLoader = null;
|
|
||||||
#else
|
|
||||||
WWW texLoader = null;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EventBus cbus;
|
EventBus cbus;
|
||||||
EventBus bbus;
|
EventBus bbus;
|
||||||
EventBus tbus;
|
EventBus tbus;
|
||||||
@@ -88,7 +81,6 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
status = GameObject.Find("Status").GetComponent<TextMeshProUGUI>();
|
status = GameObject.Find("Status").GetComponent<TextMeshProUGUI>();
|
||||||
|
|
||||||
texHandler = new DownloadHandlerTexture();
|
|
||||||
#if BUILD
|
#if BUILD
|
||||||
try {
|
try {
|
||||||
Play();
|
Play();
|
||||||
@@ -109,18 +101,32 @@ namespace Cryville.Crtr {
|
|||||||
if (tbus != null) tbus.Dispose();
|
if (tbus != null) tbus.Dispose();
|
||||||
if (nbus != null) nbus.Dispose();
|
if (nbus != null) nbus.Dispose();
|
||||||
if (loadThread != null) loadThread.Abort();
|
if (loadThread != null) loadThread.Abort();
|
||||||
if (texLoader != null) texLoader.Dispose();
|
|
||||||
if (inputProxy != null) inputProxy.Dispose();
|
if (inputProxy != null) inputProxy.Dispose();
|
||||||
if (texs != null) foreach (var t in texs) Texture.Destroy(t.Value);
|
if (texs != null) foreach (var t in texs) Texture.Destroy(t.Value);
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Coroutine texLoader;
|
||||||
bool texloaddone;
|
bool texloaddone;
|
||||||
diag::Stopwatch texloadtimer = new diag::Stopwatch();
|
Coroutine prehandler;
|
||||||
int forceSyncFrames;
|
int forceSyncFrames;
|
||||||
double atime0;
|
double atime0;
|
||||||
void Update() {
|
void Update() {
|
||||||
if (started) GameUpdate();
|
if (started) GameUpdate();
|
||||||
|
else if (prehandler != null) {
|
||||||
|
try {
|
||||||
|
if (!prehandler.Tick(1.0 / Application.targetFrameRate)) {
|
||||||
|
prehandler = null;
|
||||||
|
started = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Game.LogException("Load/Prehandle", "An error occured while prehandling the data", ex);
|
||||||
|
Popup.CreateException(ex);
|
||||||
|
prehandler = null;
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (loadThread != null) LoadUpdate();
|
else if (loadThread != null) LoadUpdate();
|
||||||
if (logEnabled) LogUpdate();
|
if (logEnabled) LogUpdate();
|
||||||
else Game.MainLogger.Enumerate((level, module, msg) => { });
|
else Game.MainLogger.Enumerate((level, module, msg) => { });
|
||||||
@@ -171,55 +177,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void LoadUpdate() {
|
void LoadUpdate() {
|
||||||
if (texLoader != null) {
|
if (!texloaddone) texLoader.Tick(1.0 / Application.targetFrameRate);
|
||||||
string url = texLoader.url;
|
|
||||||
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
|
|
||||||
#if UNITY_5_4_OR_NEWER
|
|
||||||
if (texLoader.isDone) {
|
|
||||||
if (texHandler.isDone) {
|
|
||||||
var tex = texHandler.texture;
|
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
|
||||||
if (frames.ContainsKey(name)) {
|
|
||||||
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
frames.Add(name, new SpriteFrame(tex));
|
|
||||||
}
|
|
||||||
texs.Add(name, tex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Logger.Log("main", 4, "Load/Prehandle", "Unable to load texture: {0}", name);
|
|
||||||
}
|
|
||||||
texLoader.Dispose();
|
|
||||||
texHandler.Dispose();
|
|
||||||
texLoader = null;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (texLoader.isDone) {
|
|
||||||
var tex = texLoader.texture;
|
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
|
||||||
texs.Add(name, tex);
|
|
||||||
texLoader.Dispose();
|
|
||||||
texLoader = null;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (texLoader == null) {
|
|
||||||
if (texLoadQueue.Count > 0) {
|
|
||||||
#if UNITY_5_4_OR_NEWER
|
|
||||||
texHandler = new DownloadHandlerTexture();
|
|
||||||
texLoader = new UnityWebRequest(Game.FileProtocolPrefix + texLoadQueue.Dequeue(), "GET", texHandler, null);
|
|
||||||
texLoader.SendWebRequest();
|
|
||||||
#else
|
|
||||||
texLoader = new WWW(Game.FileProtocolPrefix + texLoadQueue.Dequeue());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else if (!texloaddone) {
|
|
||||||
texloaddone = true;
|
|
||||||
texloadtimer.Stop();
|
|
||||||
Logger.Log("main", 1, "Load/MainThread", "Main thread done ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!loadThread.IsAlive) {
|
if (!loadThread.IsAlive) {
|
||||||
if (threadException != null) {
|
if (threadException != null) {
|
||||||
Logger.Log("main", 4, "Load/MainThread", "Load failed");
|
Logger.Log("main", 4, "Load/MainThread", "Load failed");
|
||||||
@@ -229,8 +187,8 @@ namespace Cryville.Crtr {
|
|||||||
ReturnToMenu();
|
ReturnToMenu();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (texLoader == null) {
|
else if (texloaddone) {
|
||||||
Prehandle();
|
prehandler = new Coroutine(Prehandle());
|
||||||
loadThread = null;
|
loadThread = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,6 +250,13 @@ namespace Cryville.Crtr {
|
|||||||
UnityEngine.Profiling.Profiler.GetTotalReservedMemory()
|
UnityEngine.Profiling.Profiler.GetTotalReservedMemory()
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
if (loadThread != null) {
|
||||||
|
statusbuf.AppendFormat(
|
||||||
|
"\n(Loading textures) Progress: {0:P}\n(Loading files) Progress: {1:P}",
|
||||||
|
texLoader.Progress, loadPregress
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (prehandler != null) statusbuf.AppendFormat("\n(Prehandling) Progress: {0:P}", prehandler.Progress);
|
||||||
if (started) {
|
if (started) {
|
||||||
statusbuf.AppendFormat(
|
statusbuf.AppendFormat(
|
||||||
"\nStates: c{0} / b{1}\nPools: RMV {2}, MC {3}",
|
"\nStates: c{0} / b{1}\nPools: RMV {2}, MC {3}",
|
||||||
@@ -357,7 +322,7 @@ namespace Cryville.Crtr {
|
|||||||
public void TogglePlay() {
|
public void TogglePlay() {
|
||||||
if (started) Stop();
|
if (started) Stop();
|
||||||
else {
|
else {
|
||||||
if (loadThread == null) Play();
|
if (texLoader == null && loadThread == null && prehandler == null) Play();
|
||||||
else Logger.Log("main", 2, "Load/MainThread", "The chart is currently loading");
|
else Logger.Log("main", 2, "Load/MainThread", "The chart is currently loading");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -446,54 +411,103 @@ namespace Cryville.Crtr {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
||||||
texloadtimer = new diag::Stopwatch();
|
|
||||||
texloadtimer.Start();
|
|
||||||
frames = new Dictionary<string, SpriteFrame>();
|
frames = new Dictionary<string, SpriteFrame>();
|
||||||
texs = new Dictionary<string, Texture2D>();
|
texs = new Dictionary<string, Texture2D>();
|
||||||
var skinDir = skinFile.Directory.FullName;
|
var skinDir = skinFile.Directory.FullName;
|
||||||
|
var texLoadQueue = new List<string>();
|
||||||
foreach (var f in skin.frames) {
|
foreach (var f in skin.frames) {
|
||||||
texLoadQueue.Enqueue(Path.Combine(skinDir, f));
|
texLoadQueue.Add(Path.Combine(skinDir, f));
|
||||||
}
|
}
|
||||||
|
texLoader = new Coroutine(LoadTextures(texLoadQueue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Prehandle() {
|
IEnumerator<float> LoadTextures(List<string> queue) {
|
||||||
try {
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
diag::Stopwatch timer = new diag::Stopwatch();
|
stopwatch.Start();
|
||||||
timer.Reset(); timer.Start();
|
#if UNITY_5_4_OR_NEWER
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 2)");
|
DownloadHandlerTexture texHandler = null;
|
||||||
cbus.BroadcastPreInit();
|
UnityWebRequest texLoader = null;
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)");
|
#else
|
||||||
using (var pbus = cbus.Clone(17)) {
|
WWW texLoader = null;
|
||||||
pbus.Forward();
|
#endif
|
||||||
|
for (int i = 0; i < queue.Count; i++) {
|
||||||
|
#if UNITY_5_4_OR_NEWER
|
||||||
|
texHandler = new DownloadHandlerTexture();
|
||||||
|
texLoader = new UnityWebRequest(Game.FileProtocolPrefix + queue[i], "GET", texHandler, null);
|
||||||
|
texLoader.SendWebRequest();
|
||||||
|
#else
|
||||||
|
texLoader = new WWW(Game.FileProtocolPrefix + queue[i]);
|
||||||
|
#endif
|
||||||
|
while (!texLoader.isDone) yield return (float)i / queue.Count;
|
||||||
|
#if UNITY_5_4_OR_NEWER
|
||||||
|
if (texHandler.isDone) {
|
||||||
|
string url = texLoader.url;
|
||||||
|
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
|
||||||
|
var tex = texHandler.texture;
|
||||||
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
|
if (frames.ContainsKey(name)) {
|
||||||
|
Logger.Log("main", 3, "Load/Prehandle", "Duplicated texture name: {0}", name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frames.Add(name, new SpriteFrame(tex));
|
||||||
|
}
|
||||||
|
texs.Add(name, tex);
|
||||||
}
|
}
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)");
|
else {
|
||||||
cbus.BroadcastPostInit();
|
Logger.Log("main", 4, "Load/Prehandle", "Unable to load texture: {0}", name);
|
||||||
inputProxy.Activate();
|
|
||||||
if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
|
|
||||||
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up");
|
|
||||||
GC.Collect();
|
|
||||||
if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
|
|
||||||
cbus.ForwardByTime(startOffset);
|
|
||||||
bbus.ForwardByTime(startOffset);
|
|
||||||
timer.Stop();
|
|
||||||
Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds);
|
|
||||||
if (Settings.Default.ClearLogOnPlay) {
|
|
||||||
logEntries.Clear();
|
|
||||||
logsLength = 0;
|
|
||||||
Game.MainLogger.Enumerate((level, module, msg) => { });
|
|
||||||
logs.text = "";
|
|
||||||
}
|
}
|
||||||
Game.AudioSequencer.SeekTime(startOffset, SeekOrigin.Current);
|
texLoader.Dispose();
|
||||||
Game.AudioSequencer.Playing = true;
|
texHandler.Dispose();
|
||||||
atime0 = Game.AudioClient.BufferPosition - startOffset;
|
#else
|
||||||
inputProxy.SyncTime(cbus.Time);
|
string url = texLoader.url;
|
||||||
started = true;
|
string name = StringUtils.TrimExt(url.Substring(url.LastIndexOfAny(new char[] {'/', '\\'}) + 1));
|
||||||
|
var tex = texLoader.texture;
|
||||||
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
|
texs.Add(name, tex);
|
||||||
|
texLoader.Dispose();
|
||||||
|
texLoader = null;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
texloaddone = true;
|
||||||
Game.LogException("Load/Prehandle", "An error occured while prehandling the data", ex);
|
stopwatch.Stop();
|
||||||
Popup.CreateException(ex);
|
Logger.Log("main", 1, "Load/MainThread", "Main thread done ({0}ms)", stopwatch.Elapsed.TotalMilliseconds);
|
||||||
Stop();
|
yield return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator<float> Prehandle() {
|
||||||
|
Stopwatch timer = new Stopwatch();
|
||||||
|
timer.Reset(); timer.Start();
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 2)"); yield return .00f;
|
||||||
|
cbus.BroadcastPreInit();
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 3)"); yield return .05f;
|
||||||
|
using (var pbus = cbus.Clone(17)) {
|
||||||
|
while (pbus.Time != double.PositiveInfinity) {
|
||||||
|
pbus.ForwardOnce();
|
||||||
|
yield return (float)pbus.EventId / pbus.EventCount * .80f + .05f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)"); yield return .85f;
|
||||||
|
cbus.BroadcastPostInit();
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Seeking to start offset"); yield return .90f;
|
||||||
|
cbus.ForwardByTime(startOffset);
|
||||||
|
bbus.ForwardByTime(startOffset);
|
||||||
|
Game.AudioSequencer.SeekTime(startOffset, SeekOrigin.Current);
|
||||||
|
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up"); yield return .95f;
|
||||||
|
if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
|
||||||
|
inputProxy.Activate();
|
||||||
|
GC.Collect();
|
||||||
|
if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
|
||||||
|
timer.Stop();
|
||||||
|
Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds); yield return 1;
|
||||||
|
if (Settings.Default.ClearLogOnPlay) {
|
||||||
|
logEntries.Clear();
|
||||||
|
logsLength = 0;
|
||||||
|
Game.MainLogger.Enumerate((level, module, msg) => { });
|
||||||
|
logs.text = "";
|
||||||
|
}
|
||||||
|
Game.AudioSequencer.Playing = true;
|
||||||
|
atime0 = Game.AudioClient.BufferPosition - startOffset;
|
||||||
|
inputProxy.SyncTime(cbus.Time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop() {
|
public void Stop() {
|
||||||
@@ -545,12 +559,13 @@ namespace Cryville.Crtr {
|
|||||||
Exception threadException;
|
Exception threadException;
|
||||||
#if !NO_THREAD
|
#if !NO_THREAD
|
||||||
Thread loadThread = null;
|
Thread loadThread = null;
|
||||||
diag::Stopwatch workerTimer;
|
volatile float loadPregress;
|
||||||
|
Stopwatch workerTimer;
|
||||||
#endif
|
#endif
|
||||||
void Load(object _info) {
|
void Load(object _info) {
|
||||||
var info = (LoadInfo)_info;
|
var info = (LoadInfo)_info;
|
||||||
try {
|
try {
|
||||||
workerTimer = new diag::Stopwatch();
|
workerTimer = new Stopwatch();
|
||||||
workerTimer.Start();
|
workerTimer.Start();
|
||||||
LoadChart(info);
|
LoadChart(info);
|
||||||
workerTimer.Stop();
|
workerTimer.Stop();
|
||||||
@@ -573,20 +588,20 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
if (chart.format != 2) throw new FormatException("Invalid chart file format version");
|
if (chart.format != 2) throw new FormatException("Invalid chart file format version");
|
||||||
|
|
||||||
etor = new PdtEvaluator();
|
etor = new PdtEvaluator(); loadPregress = .05f;
|
||||||
|
|
||||||
LoadRuleset(info.rulesetFile);
|
LoadRuleset(info.rulesetFile);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)"); loadPregress = .10f;
|
||||||
pruleset.PrePatch(chart);
|
pruleset.PrePatch(chart);
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Batching events");
|
Logger.Log("main", 0, "Load/WorkerThread", "Batching events"); loadPregress = .20f;
|
||||||
var batcher = new EventBatcher(chart);
|
var batcher = new EventBatcher(chart);
|
||||||
batcher.Forward();
|
batcher.Forward();
|
||||||
cbus = batcher.Batch();
|
cbus = batcher.Batch(); loadPregress = .30f;
|
||||||
|
|
||||||
LoadSkin(info.skinFile);
|
LoadSkin(info.skinFile);
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Initializing judge and input");
|
Logger.Log("main", 0, "Load/WorkerThread", "Initializing judge and input"); loadPregress = .35f;
|
||||||
judge = new Judge(this, pruleset);
|
judge = new Judge(this, pruleset);
|
||||||
etor.ContextJudge = judge;
|
etor.ContextJudge = judge;
|
||||||
|
|
||||||
@@ -596,7 +611,7 @@ namespace Cryville.Crtr {
|
|||||||
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
|
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Attaching handlers");
|
Logger.Log("main", 0, "Load/WorkerThread", "Attaching handlers"); loadPregress = .40f;
|
||||||
var ch = new ChartHandler(chart, dir);
|
var ch = new ChartHandler(chart, dir);
|
||||||
cbus.RootState.AttachHandler(ch);
|
cbus.RootState.AttachHandler(ch);
|
||||||
foreach (var gs in cbus.RootState.Children) {
|
foreach (var gs in cbus.RootState.Children) {
|
||||||
@@ -614,17 +629,18 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
cbus.AttachSystems(pskin, judge);
|
cbus.AttachSystems(pskin, judge);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Prehandling (iteration 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Prehandling (iteration 1)"); loadPregress = .60f;
|
||||||
using (var pbus = cbus.Clone(16)) {
|
using (var pbus = cbus.Clone(16)) {
|
||||||
pbus.Forward();
|
pbus.Forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 1)"); loadPregress = .70f;
|
||||||
bbus = cbus.Clone(1, -clippingDist);
|
bbus = cbus.Clone(1, -clippingDist);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 2)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 2)"); loadPregress = .80f;
|
||||||
tbus = bbus.Clone(2);
|
tbus = bbus.Clone(2);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 3)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Cloning states (type 3)"); loadPregress = .90f;
|
||||||
nbus = bbus.Clone(3);
|
nbus = bbus.Clone(3);
|
||||||
|
loadPregress = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,11 @@ namespace Cryville.Crtr {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The index of the event to be handled next.
|
/// The index of the event to be handled next.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected int EventId;
|
public int EventId { get; protected set; }
|
||||||
|
/// <summary>
|
||||||
|
/// The event count.
|
||||||
|
/// </summary>
|
||||||
|
public int EventCount { get { return Events.Count; } }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The event list.
|
/// The event list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,6 +70,13 @@ namespace Cryville.Crtr {
|
|||||||
ForwardToTime(double.PositiveInfinity);
|
ForwardToTime(double.PositiveInfinity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Forwards to the next event.
|
||||||
|
/// </summary>
|
||||||
|
public void ForwardOnce() {
|
||||||
|
ForwardOnceToTime(double.PositiveInfinity);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Forwards the time by the specified span and walks through all the encountered events.
|
/// Forwards the time by the specified span and walks through all the encountered events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user