Move Editor to Artemis-based runtime:
* Epic artemis switch! * Update to 0.0.8-SNAPSHOT
This commit is contained in:
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group 'games.rednblack'
|
||||
version '0.0.7'
|
||||
version '0.0.8'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -12,8 +12,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
implementation "com.badlogicgames.ashley:ashley:$ashleyVersion"
|
||||
implementation "com.kotcrab.vis:vis-ui:$visuiVersion"
|
||||
implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion"
|
||||
|
||||
implementation 'net.mountainblade:modular:1.0'
|
||||
|
||||
|
||||
+8
-5
@@ -1,6 +1,8 @@
|
||||
package games.rednblack.editor.plugin.performance;
|
||||
|
||||
import com.badlogic.ashley.core.Engine;
|
||||
import com.artemis.Aspect;
|
||||
import com.artemis.EntitySubscription;
|
||||
import com.artemis.utils.IntBag;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.profiling.GLProfiler;
|
||||
import com.kotcrab.vis.ui.widget.VisLabel;
|
||||
@@ -16,7 +18,7 @@ public class PerformancePanel extends UIDraggablePanel {
|
||||
|
||||
private VisLabel entitiesCount, memoryLabel, fpsLbl, glCalls, drawCalls, shaderSwitch, textureBind, vertexCount;
|
||||
|
||||
private Engine engine;
|
||||
private EntitySubscription entitySubscription;
|
||||
private final GLProfiler profiler;
|
||||
|
||||
public PerformancePanel() {
|
||||
@@ -87,7 +89,7 @@ public class PerformancePanel extends UIDraggablePanel {
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
super.act(delta);
|
||||
entitiesCount.setText(engine.getEntities().size());
|
||||
entitiesCount.setText(entitySubscription.getEntities().size());
|
||||
fpsLbl.setText(Gdx.graphics.getFramesPerSecond());
|
||||
MemoryUsage memoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
|
||||
long usedMemory = memoryUsage.getUsed() / (1024 * 1024);
|
||||
@@ -109,7 +111,8 @@ public class PerformancePanel extends UIDraggablePanel {
|
||||
profiler.reset();
|
||||
}
|
||||
|
||||
public void setEngine(Engine engine) {
|
||||
this.engine = engine;
|
||||
public void setEngine(com.artemis.World engine) {
|
||||
entitySubscription = engine.getAspectSubscriptionManager()
|
||||
.get(Aspect.all());
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
package games.rednblack.editor.plugin.performance;
|
||||
|
||||
import com.badlogic.ashley.core.Engine;
|
||||
import games.rednblack.h2d.common.MsgAPI;
|
||||
import org.puremvc.java.interfaces.INotification;
|
||||
import org.puremvc.java.patterns.mediator.Mediator;
|
||||
@@ -33,7 +32,7 @@ public class PerformancePanelMediator extends Mediator<PerformancePanel> {
|
||||
switch (notification.getName()) {
|
||||
case MsgAPI.SCENE_LOADED:
|
||||
viewComponent.initView();
|
||||
Engine engine = performancePlugin.getAPI().getEngine();
|
||||
com.artemis.World engine = performancePlugin.getAPI().getEngine();
|
||||
viewComponent.setEngine(engine);
|
||||
break;
|
||||
case PerformancePlugin.PANEL_OPEN:
|
||||
|
||||
Reference in New Issue
Block a user