Logic cleanup.
This commit is contained in:
@@ -328,23 +328,6 @@ namespace Cryville.Crtr {
|
||||
FileInfo skinFile = new FileInfo(
|
||||
Game.GameDataPath + "/skins/" + Settings.Default.LoadSkin
|
||||
);
|
||||
|
||||
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
||||
texloadtimer = new diag::Stopwatch();
|
||||
texloadtimer.Start();
|
||||
texs = new Dictionary<string, Texture2D>();
|
||||
var flist = skinFile.Directory.GetFiles("*.png");
|
||||
foreach (FileInfo f in flist) {
|
||||
#if NO_THREAD
|
||||
using (WWW w = new WWW("file:///" + f.FullName)) {
|
||||
string name = StringUtils.TrimExt(f.Name);
|
||||
while (!w.isDone);
|
||||
texs.Add(name, w.texture);
|
||||
}
|
||||
#else
|
||||
texLoadQueue.Enqueue(f.FullName);
|
||||
#endif
|
||||
}
|
||||
#if NO_THREAD
|
||||
texloadtimer.Stop();
|
||||
Logger.LogFormat("main", 0, "Load/MainThread", "Textures loaded successfully ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
|
||||
@@ -362,6 +345,23 @@ namespace Cryville.Crtr {
|
||||
skinFile = skinFile,
|
||||
});
|
||||
#endif
|
||||
|
||||
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
||||
texloadtimer = new diag::Stopwatch();
|
||||
texloadtimer.Start();
|
||||
texs = new Dictionary<string, Texture2D>();
|
||||
var flist = skinFile.Directory.GetFiles("*.png");
|
||||
foreach (FileInfo f in flist) {
|
||||
#if NO_THREAD
|
||||
using (WWW w = new WWW("file:///" + f.FullName)) {
|
||||
string name = StringUtils.TrimExt(f.Name);
|
||||
while (!w.isDone);
|
||||
texs.Add(name, w.texture);
|
||||
}
|
||||
#else
|
||||
texLoadQueue.Enqueue(f.FullName);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void Prehandle() {
|
||||
|
@@ -314,7 +314,6 @@ namespace Cryville.Crtr.Event {
|
||||
public void Handle(StampedEvent ev, Action<StampedEvent> callback = null) {
|
||||
if (breakflag) return;
|
||||
if (ev != null) {
|
||||
bool flag = false;
|
||||
if (ev.Unstamped is Chart.Motion) {
|
||||
var tev = (Chart.Motion)ev.Unstamped;
|
||||
var mv = RMVPool.Rent(tev.Name);
|
||||
@@ -354,18 +353,9 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ev.Unstamped == null) {
|
||||
Callback(ev, callback);
|
||||
flag = true;
|
||||
}
|
||||
else if (ev.Unstamped.Priority >= 0) {
|
||||
Callback(ev, callback);
|
||||
flag = true;
|
||||
}
|
||||
if (!flag) Callback(null, callback);
|
||||
return;
|
||||
Callback(ev.Unstamped == null || ev.Unstamped.Priority >= 0 ? ev : null, callback);
|
||||
}
|
||||
Callback(null, callback);
|
||||
else Callback(null, callback);
|
||||
}
|
||||
|
||||
void Callback(StampedEvent ev, Action<StampedEvent> callback) {
|
||||
|
Reference in New Issue
Block a user