Updated NewAbstractNode:
protected- void addInputFboConnection(id, DATA(new, besides FboConnection version)),
protected- FBO getOutputFboData(#);
public- FboConnection getInputFboConnection(#);
Essential capability added before: connectFbo() to connect nodes
import org.terasology.engine.module.ModuleManager;
import org.terasology.naming.Name;
import org.terasology.rendering.assets.material.Material;
-import org.terasology.rendering.dag.Node;
+import org.terasology.rendering.dag.NewNode;
import org.terasology.rendering.dag.StateChange;
import org.terasology.rendering.opengl.BaseFBOsManager;
import org.terasology.rendering.opengl.FBO;
* It provides the default functionality to identify a node, handle its status (enabled/disabled),
* deal with StateChange objects and Frame Buffer objects.
*/
-public abstract class NewAbstractNode implements Node {
+public abstract class NewAbstractNode implements NewNode {
protected static final Logger logger = LoggerFactory.getLogger(NewAbstractNode.class);
protected boolean enabled = true;
@@ -93,10 +93,18 @@ protected FBO getInputFboData(int number) {
return ((FboConnection) this.inputConnections.get((new StringBuilder("FBO").append(number).toString()))).getFboData();
}
+ protected FBO getOutputFboData(int number) {
+ return ((FboConnection) this.outputConnections.get((new StringBuilder("FBO").append(number).toString()))).getFboData();
+ }
+
protected void addInputFboConnection(int id, FboConnection from) {
DependencyConnection fboConnection = new FboConnection(FboConnection.getFboName(id), DependencyConnection.Type.INPUT, from.getFboData());
addInputConnection(fboConnection);
}
+ protected void addInputFboConnection(int id, FBO fboData) {
+ DependencyConnection fboConnection = new FboConnection(FboConnection.getFboName(id), DependencyConnection.Type.INPUT, fboData);
+ addInputConnection(fboConnection);
+ }
protected void addOutputFboConnection(int id, FBO fboData) {
DependencyConnection fboConnection = new FboConnection(FboConnection.getFboName(id), DependencyConnection.Type.OUTPUT, fboData);
@@ -104,7 +112,7 @@ protected void addOutputFboConnection(int id, FBO fboData) {
}
public void connectFbo(int inputFboId, FboConnection from) {
-
+ // TODO: null checks everywhere
addInputFboConnection(inputFboId, from);
}
@@ -112,6 +120,10 @@ public FboConnection getOutputFboConnection(int outputFboId) {
return (FboConnection) getOutputConnection(FboConnection.getFboName(outputFboId));
}
+ public FboConnection getInputFboConnection(int inputFboId) {
+ return (FboConnection) getInputConnection(FboConnection.getFboName(inputFboId));
+ }
+
/*public FBO getOutputFboData(int id)
return ((FboConnection) this.outputConnections.get(DependencyConnection.getFboName(id))).getFboData();
}*/
