Code cleanup.

This commit is contained in:
2023-02-18 14:46:08 +08:00
parent 274a823d02
commit a1f7418d32
10 changed files with 78 additions and 66 deletions

View File

@@ -53,10 +53,11 @@ namespace Cryville.Crtr {
public SkinElement elements;
public void Optimize(PdtEvaluator etor) {
foreach (var animation in animations.Values) {
animation.Optimize(etor);
foreach (var a in animations) {
a.Value.Optimize(etor);
}
foreach (var effect in effects.Values) {
foreach (var e in effects) {
var effect = e.Value;
etor.ContextCascadeInsert();
if (effect.args != null) foreach (var i in effect.args) {
etor.ContextCascadeUpdate(i.Key, PropSrc.Error);
@@ -85,9 +86,9 @@ namespace Cryville.Crtr {
public void Optimize(PdtEvaluatorBase etor) {
IsDynamic = true;
foreach (var e in properties.Values) {
etor.Optimize(e);
if (!e.IsConstant)
foreach (var e in properties) {
etor.Optimize(e.Value);
if (!e.Value.IsConstant)
IsDynamic = true;
}
foreach (var e in elements) {
@@ -115,11 +116,11 @@ namespace Cryville.Crtr {
= new Dictionary<SkinPropertyKey, PdtExpression>();
public void Optimize(PdtEvaluator etor) {
foreach (var p in properties.Values) {
etor.Optimize(p);
foreach (var p in properties) {
etor.Optimize(p.Value);
}
foreach (var e in spans.Values) {
e.Optimize(etor);
foreach (var e in spans) {
e.Value.Optimize(etor);
}
}
}