3 Commits

Author SHA1 Message Date
15e66d29c4 Code cleanup. 2022-11-15 20:14:36 +08:00
3d5ea4f056 Fix null vector passing. 2022-11-15 20:14:27 +08:00
1772c90c2f Fix texture wrap mode. 2022-11-15 20:12:24 +08:00
3 changed files with 7 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ namespace Cryville.Common {
public static void SetLogPath(string path) {
logPath = path;
var dir = new DirectoryInfo(path);
if (!dir.Exists) Directory.CreateDirectory(dir.FullName);
if (!dir.Exists) dir.Create();
}
/// <summary>
/// Logs to the specified logger.

View File

@@ -157,6 +157,7 @@ namespace Cryville.Crtr {
#if UNITY_5_4_OR_NEWER
if (texHandler.isDone) {
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();

View File

@@ -182,14 +182,15 @@ namespace Cryville.Crtr {
if (!_vect.TryGetValue(id, out ft)) ft = tt;
if (vec.IsNull) {
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Null, _nullvalue));
OnInput(id, proxy.Target, ft, tt, true);
}
else {
fixed (byte* ptr = _vecbuf) {
*(Vector3*)ptr = vec.Vector;
}
_etor.ContextCascadeUpdate(_var_value, new PropSrc.Arbitrary(PdtInternalType.Vector, _vecbuf));
OnInput(id, proxy.Target, ft, tt, false);
}
OnInput(id, proxy.Target, ft, tt);
_vect[id] = tt;
_etor.ContextCascadeDiscard();
}
@@ -197,14 +198,14 @@ namespace Cryville.Crtr {
}
static readonly int _var_fv = IdentifierManager.SharedInstance.Request("fv");
static readonly int _var_tv = IdentifierManager.SharedInstance.Request("tv");
unsafe void OnInput(InputIdentifier id, Identifier target, float ft, float tt) {
unsafe void OnInput(InputIdentifier id, Identifier target, float ft, float tt, bool nullflag) {
var def = _ruleset.inputs[target];
if (def.pass != null) {
foreach (var p in def.pass) {
_etor.ContextCascadeInsert();
_arbop.Name = _var_value;
_etor.Evaluate(_arbop, p.Value);
OnInput(id, p.Key, ft, tt);
if (!nullflag) _etor.Evaluate(_arbop, p.Value);
OnInput(id, p.Key, ft, tt, nullflag);
_etor.ContextCascadeDiscard();
}
}