Remove obsolete NO_THREAD symbol.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
//#define NO_THREAD
|
|
||||||
#define BUILD
|
#define BUILD
|
||||||
|
|
||||||
using Cryville.Common;
|
using Cryville.Common;
|
||||||
@@ -74,9 +73,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
#if !NO_THREAD
|
|
||||||
if (loadThread != null) loadThread.Abort();
|
if (loadThread != null) loadThread.Abort();
|
||||||
#endif
|
|
||||||
if (texLoader != null) texLoader.Dispose();
|
if (texLoader != null) texLoader.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +105,7 @@ namespace Cryville.Crtr {
|
|||||||
double atime0;
|
double atime0;
|
||||||
void Update() {
|
void Update() {
|
||||||
if (started) GameUpdate();
|
if (started) GameUpdate();
|
||||||
#if !NO_THREAD
|
|
||||||
else if (loadThread != null) LoadUpdate();
|
else if (loadThread != null) LoadUpdate();
|
||||||
#endif
|
|
||||||
if (logEnabled) LogUpdate();
|
if (logEnabled) LogUpdate();
|
||||||
else Game.MainLogger.Enumerate((level, module, msg) => { });
|
else Game.MainLogger.Enumerate((level, module, msg) => { });
|
||||||
}
|
}
|
||||||
@@ -308,9 +303,7 @@ namespace Cryville.Crtr {
|
|||||||
startOffset = Settings.Default.StartOffset;
|
startOffset = Settings.Default.StartOffset;
|
||||||
sv = Settings.Default.ScrollVelocity;
|
sv = Settings.Default.ScrollVelocity;
|
||||||
firstFrame = true;
|
firstFrame = true;
|
||||||
#if !NO_THREAD
|
|
||||||
texloaddone = false;
|
texloaddone = false;
|
||||||
#endif
|
|
||||||
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
||||||
Game.AudioSession = Game.AudioSequencer.NewSession();
|
Game.AudioSession = Game.AudioSequencer.NewSession();
|
||||||
|
|
||||||
@@ -338,23 +331,12 @@ namespace Cryville.Crtr {
|
|||||||
FileInfo skinFile = new FileInfo(
|
FileInfo skinFile = new FileInfo(
|
||||||
Game.GameDataPath + "/skins/" + Settings.Default.LoadSkin
|
Game.GameDataPath + "/skins/" + Settings.Default.LoadSkin
|
||||||
);
|
);
|
||||||
#if NO_THREAD
|
|
||||||
texloadtimer.Stop();
|
|
||||||
Logger.LogFormat("main", 0, "Load/MainThread", "Textures loaded successfully ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
|
|
||||||
Load(new LoadInfo(){
|
|
||||||
chartFile = chartFile,
|
|
||||||
rulesetFile = rulesetFile,
|
|
||||||
skinFile = skinFile,
|
|
||||||
});
|
|
||||||
Prehandle();
|
|
||||||
#else
|
|
||||||
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
||||||
loadThread.Start(new LoadInfo() {
|
loadThread.Start(new LoadInfo() {
|
||||||
chartFile = chartFile,
|
chartFile = chartFile,
|
||||||
rulesetFile = rulesetFile,
|
rulesetFile = rulesetFile,
|
||||||
skinFile = skinFile,
|
skinFile = skinFile,
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
Logger.Log("main", 0, "Load/MainThread", "Loading textures...");
|
||||||
texloadtimer = new diag::Stopwatch();
|
texloadtimer = new diag::Stopwatch();
|
||||||
@@ -362,15 +344,7 @@ namespace Cryville.Crtr {
|
|||||||
texs = new Dictionary<string, Texture2D>();
|
texs = new Dictionary<string, Texture2D>();
|
||||||
var flist = skinFile.Directory.GetFiles("*.png");
|
var flist = skinFile.Directory.GetFiles("*.png");
|
||||||
foreach (FileInfo f in flist) {
|
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);
|
texLoadQueue.Enqueue(f.FullName);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user