diff --git a/Assets/Cryville/Crtr/Game.cs b/Assets/Cryville/Crtr/Game.cs index 2d995e4..81f1fe9 100644 --- a/Assets/Cryville/Crtr/Game.cs +++ b/Assets/Cryville/Crtr/Game.cs @@ -86,11 +86,9 @@ namespace Cryville.Crtr { AudioClient.Start(); ChartPlayer.motionRegistry = new Dictionary { + { "pt" , new MotionRegistry(typeof(VecPt)) }, { "dir" , new MotionRegistry(typeof(Vec3)) }, { "normal" , new MotionRegistry(typeof(Vec3)) }, - // { "pdirz", new MotionRegistry(typeof(Vec1)) }, - { "pt" , new MotionRegistry(typeof(VecPt)) }, - // { "visible", new MotionRegistry(typeof(VecI1)) }, { "sv" , new MotionRegistry(new VecPtComp(0f, 0f), new VecPtComp(0f, 1f)) }, { "svm" , new MotionRegistry(new Vec1m(1f)) }, { "dist" , new MotionRegistry(new VecPtComp(0f, 0f), new VecPtComp(0f, float.PositiveInfinity)) }, @@ -98,8 +96,6 @@ namespace Cryville.Crtr { { "ctrl0" , new MotionRegistry(typeof(VecCtrl)) }, { "ctrl1" , new MotionRegistry(typeof(VecCtrl)) }, { "track" , new MotionRegistry(typeof(Vec1)) }, - // { "judge" , new MotionRegistry(typeof(Vec1)) }, - // { "width" , new MotionRegistry(new Vec1(0), new Vec1(1)) }, }; var dir = new DirectoryInfo(Settings.Default.GameDataPath + "/charts"); diff --git a/Assets/Cryville/Crtr/Judge.cs b/Assets/Cryville/Crtr/Judge.cs index dffe702..eb306f2 100644 --- a/Assets/Cryville/Crtr/Judge.cs +++ b/Assets/Cryville/Crtr/Judge.cs @@ -22,13 +22,16 @@ namespace Cryville.Crtr { public readonly Dictionary scoreDefs = new Dictionary(); public readonly Dictionary scores = new Dictionary(); readonly Dictionary ScoreCache = new Dictionary(); + readonly object _lock = new object(); public Dictionary GetFormattedScoreStrings() { + lock (_lock) { if (ScoreCache.Count == 0) { foreach (var s in scores) ScoreCache.Add(s.Key, s.Value.ToString(scoreDefs[s.Key].format)); } return ScoreCache; } + } public string GetFullFormattedScoreString() { bool flag = false; string result = ""; diff --git a/Assets/Cryville/Crtr/PdtEvaluator.cs b/Assets/Cryville/Crtr/PdtEvaluator.cs index 46a8e54..d23e159 100644 --- a/Assets/Cryville/Crtr/PdtEvaluator.cs +++ b/Assets/Cryville/Crtr/PdtEvaluator.cs @@ -70,7 +70,7 @@ namespace Cryville.Crtr { } else if (sig.Name == _op_sep) { result = new op_arr(sig.ParamCount); - _shortops.Add(new PdtOperatorSignature(",", sig.ParamCount), result); + _shortops.Add(new PdtOperatorSignature(_op_sep, sig.ParamCount), result); return result; } else if (_longops.TryGetValue(sig.Name, out result)) { @@ -234,13 +234,13 @@ namespace Cryville.Crtr { int type = o0.Type; int len = o0.Length; bool blit = !IsBlittable(type); - for (var i = 1; i < ParamCount; i++) { + for (var i = 1; i < LoadedOperandCount; i++) { var o = GetOperand(i); if (o.Type != type) throw new InvalidOperationException("Cannot create variant type array"); else if (!IsBlittable(o.Type)) blit = true; len += o.Length; } - if (blit) GetReturnFrame(PdtInternalType.Array, len + 2 * sizeof(int)).SetArraySuffix(type, ParamCount); + if (blit) GetReturnFrame(PdtInternalType.Array, len + 2 * sizeof(int)).SetArraySuffix(type, LoadedOperandCount); else GetReturnFrame(PdtInternalType.Vector, len + sizeof(int)).SetArraySuffix(type); } bool IsBlittable(int type) { diff --git a/Assets/Cryville/Crtr/StateBase.cs b/Assets/Cryville/Crtr/StateBase.cs index 5ba791f..d2374f6 100644 --- a/Assets/Cryville/Crtr/StateBase.cs +++ b/Assets/Cryville/Crtr/StateBase.cs @@ -32,17 +32,11 @@ namespace Cryville.Crtr { } public void Forward(Action callback = null) { - ForwardToTime(float.PositiveInfinity, ev => { - if (callback != null) - callback(ev); - }); + ForwardToTime(float.PositiveInfinity, callback); } public void ForwardByTime(float time, Action callback = null) { - ForwardToTime(Time + time, ev => { - if (callback != null) - callback(ev); - }); + ForwardToTime(Time + time, callback); } public void ForwardOnceByTime(float time, Action callback = null) {