setup(Interpolation interpolation, float duration) {
return this;
}
+ @Override
+ public void reset() {
+ super.reset();
+ m = null; // might be after world reset.
+ }
+
@SuppressWarnings("unchecked")
public final T getFrom() {
return (T) a;
diff --git a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/OperationIntegrationTest.java b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/OperationIntegrationTest.java
index 552be12..ac93392 100644
--- a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/OperationIntegrationTest.java
+++ b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/OperationIntegrationTest.java
@@ -1,7 +1,7 @@
package net.mostlyoriginal.api.operation;
import com.artemis.Component;
-import net.mostlyoriginal.api.operation.basic.LegacyAddOperation;
+import net.mostlyoriginal.api.operation.basic.AddOperation;
import net.mostlyoriginal.api.operation.common.Operation;
import net.mostlyoriginal.api.operation.common.TestOperation;
import net.mostlyoriginal.api.operation.flow.OperationTest;
@@ -29,15 +29,15 @@ public void ensure_operations_chain_released() {
DelayOperation delayOperation = delay(1);
Operation deleteFromWorldOperation = deleteFromWorld();
- LegacyAddOperation legacyAddOperation = add(new TestComponent());
+ AddOperation addOperation = add(new TestComponent());
- SequenceOperation sequenceOperation = sequence(delayOperation, deleteFromWorldOperation, legacyAddOperation);
+ SequenceOperation sequenceOperation = sequence(delayOperation, deleteFromWorldOperation, addOperation);
ParallelOperation parallelOperation = parallel(sequenceOperation);
// set all completed as an easy test to see if reset.
delayOperation.setCompleted(true);
deleteFromWorldOperation.setCompleted(true);
- legacyAddOperation.setCompleted(true);
+ addOperation.setCompleted(true);
sequenceOperation.setCompleted(true);
parallelOperation.setCompleted(true);
@@ -45,7 +45,7 @@ public void ensure_operations_chain_released() {
Assert.assertFalse(delayOperation.isCompleted());
Assert.assertFalse(deleteFromWorldOperation.isCompleted());
- Assert.assertFalse(legacyAddOperation.isCompleted());
+ Assert.assertFalse(addOperation.isCompleted());
Assert.assertFalse(sequenceOperation.isCompleted());
Assert.assertFalse(parallelOperation.isCompleted());
}
diff --git a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent.java b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent.java
index 12a2688..ee0a757 100644
--- a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent.java
+++ b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent.java
@@ -19,8 +19,7 @@ public TweenableTestComponent(float val) {
}
@Override
- public TweenableTestComponent tween(TweenableTestComponent a, TweenableTestComponent b, float value) {
+ public void tween(TweenableTestComponent a, TweenableTestComponent b, float value) {
this.val = Interpolation.linear.apply(a.val, b.val, value);
- return this;
}
}
diff --git a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent2.java b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent2.java
index 2b082b6..e44e5fb 100644
--- a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent2.java
+++ b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/TweenableTestComponent2.java
@@ -16,8 +16,7 @@ public TweenableTestComponent2(float val) {
}
@Override
- public TweenableTestComponent2 tween(TweenableTestComponent2 a, TweenableTestComponent2 b, float value) {
+ public void tween(TweenableTestComponent2 a, TweenableTestComponent2 b, float value) {
this.val = Interpolation.linear.apply(a.val, b.val, value);
- return this;
}
}
diff --git a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/basic/MirrorableTestComponent.java b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/basic/MirrorableTestComponent.java
index 39a294d..663e9e6 100644
--- a/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/basic/MirrorableTestComponent.java
+++ b/contrib-plugin-operations/src/test/java/net/mostlyoriginal/api/operation/basic/MirrorableTestComponent.java
@@ -18,8 +18,7 @@ public MirrorableTestComponent(int val) {
}
@Override
- public MirrorableTestComponent set(MirrorableTestComponent monkey) {
+ public void set(MirrorableTestComponent monkey) {
this.val = monkey.val;
- return this;
}
}
diff --git a/contrib-plugin-profiler/pom.xml b/contrib-plugin-profiler/pom.xml
index 148f616..4df8fbd 100644
--- a/contrib-plugin-profiler/pom.xml
+++ b/contrib-plugin-profiler/pom.xml
@@ -5,7 +5,7 @@
net.mostlyoriginal.artemis-odb
contrib-parent
- 1.2.1
+ 2.1.0
contrib-plugin-profiler
diff --git a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/ProfilerPlugin.java b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/ProfilerPlugin.java
index 5f0af0a..495d61a 100644
--- a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/ProfilerPlugin.java
+++ b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/ProfilerPlugin.java
@@ -13,7 +13,7 @@
*
* Does not require {@see @com.artemis.annotations.Profile} on systems.
*
- * Open/Close with F3.
+ * Open/Close with P by default.
*
* @author piotr-j (Plugin)
* @author Daan van Yperen (Integration)
diff --git a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerInvocationStrategy.java b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerInvocationStrategy.java
index b40378d..6daf1df 100644
--- a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerInvocationStrategy.java
+++ b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerInvocationStrategy.java
@@ -8,7 +8,7 @@
/**
* {@link SystemInvocationStrategy} that will create a profiler for all systems that don't already have one
* Can be used in addition to or instead of {@link com.artemis.annotations.Profile} annotation
- *
+ *
* In addition creates {@link SystemProfiler} with name "Frame" for total frame time
* It can be accessed with {@link SystemProfiler#get(String)}
*
@@ -16,63 +16,66 @@
* @author Daan van Yperen
*/
public class ProfilerInvocationStrategy extends SystemInvocationStrategy {
- private boolean initialized = false;
+ private boolean initialized = false;
+
+ protected SystemProfiler frameProfiler;
+ protected SystemProfiler[] profilers;
+
+ @Override
+ protected void process() {
- protected SystemProfiler frameProfiler;
- protected SystemProfiler[] profilers;
+ if (!initialized) {
+ initialize();
+ initialized = true;
+ }
- @Override
- protected void process () {
+ frameProfiler.start();
+ processProfileSystems(systems);
+ frameProfiler.stop();
+ }
- if ( !initialized )
- {
- initialize();
- initialized = true;
- }
+ private void processProfileSystems(Bag systems) {
+ final Object[] systemsData = systems.getData();
+ for (int i = 0, s = systems.size(); s > i; i++) {
+ if (disabled.get(i))
+ continue;
- frameProfiler.start();
- processProfileSystems(systems);
- frameProfiler.stop();
- }
+ updateEntityStates();
+ processProfileSystem(profilers[i], (BaseSystem) systemsData[i]);
+ }
- private void processProfileSystems(Bag systems) {
- final Object[] systemsData = systems.getData();
- for (int i = 0; i < systems.size(); i++) {
- final BaseSystem system = (BaseSystem)systemsData[i];
- processProfileSystem(profilers[i], system);
- updateEntityStates();
- }
- }
+ updateEntityStates();
+ }
- private void processProfileSystem(SystemProfiler profiler, BaseSystem system) {
- if (profiler != null) profiler.start();
- system.process();
- if (profiler != null) profiler.stop();
- }
+ private void processProfileSystem(SystemProfiler profiler, BaseSystem system) {
+ if (profiler != null) profiler.start();
+ system.process();
+ if (profiler != null) profiler.stop();
+ }
- protected void initialize() {
- createFrameProfiler();
- createSystemProfilers();
- }
+ protected void initialize() {
+ createFrameProfiler();
+ createSystemProfilers();
+ }
- private void createSystemProfilers() {
- final ImmutableBag systems = world.getSystems();
- profilers = new SystemProfiler[systems.size()];
- for (int i = 0; i < systems.size(); i++) {
- profilers[i] = createSystemProfiler(systems.get(i));
- }
- }
+ private void createSystemProfilers() {
+ final ImmutableBag systems = world.getSystems();
+ profilers = new SystemProfiler[systems.size()];
+ for (int i = 0; i < systems.size(); i++) {
+ profilers[i] = createSystemProfiler(systems.get(i));
+ }
+ }
- private SystemProfiler createSystemProfiler(BaseSystem system) {
- SystemProfiler old = SystemProfiler.getFor(system);
- if (old == null) {
- old = SystemProfiler.createFor(system, world);
- }
- return old;
- }
+ private SystemProfiler createSystemProfiler(BaseSystem system) {
+ SystemProfiler old = SystemProfiler.getFor(system);
+ if (old == null) {
+ old = SystemProfiler.createFor(system, world);
+ }
+ return old;
+ }
- private void createFrameProfiler() {
- frameProfiler = SystemProfiler.create("Frame");
- frameProfiler.setColor(1, 1, 1, 1);
- }
+ private void createFrameProfiler() {
+ frameProfiler = SystemProfiler.create("Frame");
+ frameProfiler.setColor(1, 1, 1, 1);
+ }
}
diff --git a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerSystem.java b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerSystem.java
index fc24958..a1ce075 100644
--- a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerSystem.java
+++ b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/ProfilerSystem.java
@@ -21,13 +21,15 @@
@Wire
public class ProfilerSystem extends BaseSystem {
- public static final int TOGGLE_PROFILER_KEY = Input.Keys.P;
+ public static final int DEFAULT_PROFILER_KEY = Input.Keys.P;
OrthographicCamera camera;
ShapeRenderer renderer;
Stage stage;
Skin skin;
+ private int key = DEFAULT_PROFILER_KEY;
+
SystemProfilerGUI gui;
private boolean f3ButtonDown;
@@ -78,7 +80,7 @@ private void render() {
}
private void checkActivationButton() {
- if ( Gdx.input.isKeyPressed(TOGGLE_PROFILER_KEY) ) {
+ if ( Gdx.input.isKeyPressed(key) ) {
if ( !f3ButtonDown ) {
if (!SystemProfiler.isRunning()) {
gui.setHeight(Gdx.graphics.getHeight()/2);
@@ -113,4 +115,12 @@ private void processInput() {
protected void dispose() {
SystemProfiler.dispose();
}
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
}
diff --git a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/SystemProfilerGUI.java b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/SystemProfilerGUI.java
index 4829f02..157d0d9 100644
--- a/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/SystemProfilerGUI.java
+++ b/contrib-plugin-profiler/src/main/java/net/mostlyoriginal/plugin/profiler/SystemProfilerGUI.java
@@ -287,7 +287,7 @@ public ProfilerRow(SystemProfiler profiler, Skin skin) {
public void init (final SystemProfiler profiler) {
this.profiler = profiler;
- draw.removeListener(listener);
+ if ( listener != null ) draw.removeListener(listener);
draw.setChecked(profiler.getDrawGraph());
draw.addListener(listener = new ChangeListener() {
@Override public void changed (ChangeEvent event, Actor actor) {
diff --git a/contrib-test-gwt/pom.xml b/contrib-test-gwt/pom.xml
index 002fe0d..a3c1b5e 100644
--- a/contrib-test-gwt/pom.xml
+++ b/contrib-test-gwt/pom.xml
@@ -5,7 +5,7 @@
net.mostlyoriginal.artemis-odb
contrib-parent
- 1.2.1
+ 2.1.0
contrib-test-gwt
war
diff --git a/pom.xml b/pom.xml
index e2798b7..9dbad38 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
net.mostlyoriginal.artemis-odb
contrib-parent
- 1.2.1
+ 2.1.0
pom
contrib-parent
Drop-in extensions for artemis-odb. Prefab systems, components, networking, events!
@@ -16,7 +16,7 @@
UTF-8
4.1
[2.0.0,3.0.0)
- [1.9.0,2.0.0)
+ [1.9.0,1.9.4]