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) { public static void SetLogPath(string path) {
logPath = path; logPath = path;
var dir = new DirectoryInfo(path); var dir = new DirectoryInfo(path);
if (!dir.Exists) Directory.CreateDirectory(dir.FullName); if (!dir.Exists) dir.Create();
} }
/// <summary> /// <summary>
/// Logs to the specified logger. /// Logs to the specified logger.

View File

@@ -157,6 +157,7 @@ namespace Cryville.Crtr {
#if UNITY_5_4_OR_NEWER #if UNITY_5_4_OR_NEWER
if (texHandler.isDone) { if (texHandler.isDone) {
var tex = texHandler.texture; var tex = texHandler.texture;
tex.wrapMode = TextureWrapMode.Clamp;
texs.Add(name, tex); texs.Add(name, tex);
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.downloadedBytes); Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.downloadedBytes);
texLoader.Dispose(); texLoader.Dispose();

View File

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