Move Editor to Artemis-based runtime:

* Epic artemis switch!
* Update to 0.0.8-SNAPSHOT
This commit is contained in:
fgnm
2021-08-07 18:07:09 +02:00
parent 79c2630a3e
commit 8adf63dff9
171 changed files with 1400 additions and 1385 deletions
+2 -2
View File
@@ -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'
@@ -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,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: