This commit is contained in:
2022-11-16 12:08:11 +08:00
parent f04d0ec299
commit 87e406e903
2 changed files with 18 additions and 16 deletions

View File

@@ -85,7 +85,14 @@ namespace Cryville.Crtr {
texHandler = new DownloadHandlerTexture();
#if BUILD
Play();
try {
Play();
}
catch (Exception ex) {
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
Popup.CreateException(ex);
ReturnToMenu();
}
#endif
// Camera.main.RenderToCubemap();
@@ -160,25 +167,18 @@ namespace Cryville.Crtr {
var tex = texHandler.texture;
tex.wrapMode = TextureWrapMode.Clamp;
texs.Add(name, tex);
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.downloadedBytes);
texLoader.Dispose();
texHandler.Dispose();
texLoader = null;
}
else if (texLoader.downloadProgress != 0) {
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.downloadProgress);
}
#else
if (texLoader.isDone) {
var tex = texLoader.texture;
texs.Add(name, tex);
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.bytesDownloaded);
texLoader.Dispose();
texLoader = null;
}
else if (texLoader.progress != 0) {
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.progress);
}
if (texLoader.isDone) {
var tex = texLoader.texture;
tex.wrapMode = TextureWrapMode.Clamp;
texs.Add(name, tex);
texLoader.Dispose();
texLoader = null;
}
#endif
}
if (texLoader == null)
@@ -336,6 +336,7 @@ namespace Cryville.Crtr {
FileInfo rulesetFile = new FileInfo(
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
);
if (!rulesetFile.Exists) throw new FileNotFoundException("Ruleset for the chart not found\nMake sure you have imported the ruleset");
FileInfo rulesetConfigFile = new FileInfo(
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
);
@@ -348,6 +349,7 @@ namespace Cryville.Crtr {
FileInfo skinFile = new FileInfo(
string.Format("{0}/skins/{1}/{2}/.umgs", Game.GameDataPath, rulesetFile.Directory.Name, _rscfg.generic.Skin)
);
if (!skinFile.Exists) throw new FileNotFoundException("Skin not found\nPlease specify an available skin in the config");
loadThread = new Thread(new ParameterizedThreadStart(Load));
loadThread.Start(new LoadInfo() {
chartFile = chartFile,

View File

@@ -112,7 +112,7 @@ namespace Cryville.Crtr {
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
public float RenderDistance {
get {
return PlayerPrefs.GetFloat("RenderDistance", 6);
return PlayerPrefs.GetFloat("RenderDistance", 4);
}
set {
PlayerPrefs.SetFloat("RenderDistance", value);