From caec8d7032099c87252c85f1db981f03749fce45 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 9 Nov 2019 22:09:39 -0800 Subject: [PATCH] Small optimizations --- .../com/riiablo/engine/system/AnimationLoaderSystem.java | 7 ++++--- core/src/com/riiablo/engine/system/CofSystem.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/com/riiablo/engine/system/AnimationLoaderSystem.java b/core/src/com/riiablo/engine/system/AnimationLoaderSystem.java index d7809bb8..ca5c7238 100644 --- a/core/src/com/riiablo/engine/system/AnimationLoaderSystem.java +++ b/core/src/com/riiablo/engine/system/AnimationLoaderSystem.java @@ -13,7 +13,6 @@ import com.riiablo.codec.DC; import com.riiablo.engine.Dirty; import com.riiablo.engine.SystemPriority; import com.riiablo.engine.component.AnimationComponent; -import com.riiablo.engine.component.BBoxComponent; import com.riiablo.engine.component.CofComponent; @DependsOn(CofLoaderSystem.class) @@ -25,7 +24,6 @@ public class AnimationLoaderSystem extends IteratingSystem { private final ComponentMapper cofComponent = ComponentMapper.getFor(CofComponent.class); private final ComponentMapper animComponent = ComponentMapper.getFor(AnimationComponent.class); - private final ComponentMapper boxComponent = ComponentMapper.getFor(BBoxComponent.class); public AnimationLoaderSystem() { super(Family.all(CofComponent.class, AnimationComponent.class).get(), SystemPriority.AnimationLoaderSystem); @@ -62,7 +60,10 @@ public class AnimationLoaderSystem extends IteratingSystem { cofComponent.load &= ~(1 << layer.component); Gdx.app.debug(TAG, "finished loading " + descriptor); DC dc = Riiablo.assets.get(descriptor); - anim.setLayer(layer, dc, false); + anim.setLayer(layer, dc, false) + .setTransform((byte) cofComponent.transform[layer.component]) + .setAlpha(cofComponent.alpha[layer.component]) + ; changed = true; } } diff --git a/core/src/com/riiablo/engine/system/CofSystem.java b/core/src/com/riiablo/engine/system/CofSystem.java index 394f285b..86f4f15c 100644 --- a/core/src/com/riiablo/engine/system/CofSystem.java +++ b/core/src/com/riiablo/engine/system/CofSystem.java @@ -40,7 +40,7 @@ public class CofSystem extends IteratingSystem { cofComponent.load = Dirty.NONE; } - private String generateCof(CofComponent c, TypeComponent.Type t) { + private static String generateCof(CofComponent c, TypeComponent.Type t) { return c.token + t.MODE[c.mode] + CofComponent.WCLASS[c.wclass]; } } \ No newline at end of file