mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-04 22:50:36 +07:00
Small optimizations
This commit is contained in:
parent
c270dbb7a3
commit
caec8d7032
@ -13,7 +13,6 @@ import com.riiablo.codec.DC;
|
|||||||
import com.riiablo.engine.Dirty;
|
import com.riiablo.engine.Dirty;
|
||||||
import com.riiablo.engine.SystemPriority;
|
import com.riiablo.engine.SystemPriority;
|
||||||
import com.riiablo.engine.component.AnimationComponent;
|
import com.riiablo.engine.component.AnimationComponent;
|
||||||
import com.riiablo.engine.component.BBoxComponent;
|
|
||||||
import com.riiablo.engine.component.CofComponent;
|
import com.riiablo.engine.component.CofComponent;
|
||||||
|
|
||||||
@DependsOn(CofLoaderSystem.class)
|
@DependsOn(CofLoaderSystem.class)
|
||||||
@ -25,7 +24,6 @@ public class AnimationLoaderSystem extends IteratingSystem {
|
|||||||
|
|
||||||
private final ComponentMapper<CofComponent> cofComponent = ComponentMapper.getFor(CofComponent.class);
|
private final ComponentMapper<CofComponent> cofComponent = ComponentMapper.getFor(CofComponent.class);
|
||||||
private final ComponentMapper<AnimationComponent> animComponent = ComponentMapper.getFor(AnimationComponent.class);
|
private final ComponentMapper<AnimationComponent> animComponent = ComponentMapper.getFor(AnimationComponent.class);
|
||||||
private final ComponentMapper<BBoxComponent> boxComponent = ComponentMapper.getFor(BBoxComponent.class);
|
|
||||||
|
|
||||||
public AnimationLoaderSystem() {
|
public AnimationLoaderSystem() {
|
||||||
super(Family.all(CofComponent.class, AnimationComponent.class).get(), SystemPriority.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);
|
cofComponent.load &= ~(1 << layer.component);
|
||||||
Gdx.app.debug(TAG, "finished loading " + descriptor);
|
Gdx.app.debug(TAG, "finished loading " + descriptor);
|
||||||
DC dc = Riiablo.assets.get(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;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class CofSystem extends IteratingSystem {
|
|||||||
cofComponent.load = Dirty.NONE;
|
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];
|
return c.token + t.MODE[c.mode] + CofComponent.WCLASS[c.wclass];
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user