ModuleRendering.java set context in constructor, don't store ModuleRendering in context (is accesible trough manager), add setContext() method for when ModuleRendering is instanciated during gameCreation phase and has different context than it needs during runtime.
public ModuleRendering(Context context) {
this.context = context;
+ // context.put(ModuleRendering.class, this);
moduleManager = context.get(ModuleManager.class);
providingModule = moduleManager.getEnvironment().getModuleProviding(this.getClass());
}
+ public void setContext(Context newContext) {
+ this.context = newContext;
+ }
+
public void setProvidingModule(Name providingModule) {
this.providingModule = providingModule;
}
@@ -69,7 +74,6 @@ public void setInitializationPriority(int initPriority) {
}
public void initialise() {
- context.put(ModuleRendering.class, this);
renderGraph = context.get(RenderGraph.class);
worldRenderer = context.get(WorldRenderer.class);
}
