/*
 * Copyright 2014-2015 See AUTHORS file.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.kotcrab.vis.runtime.system.physics;

import com.artemis.BaseSystem;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.kotcrab.vis.runtime.system.CameraManager;

/** @author Kotcrab */
@Wire
public class Box2dDebugRenderSystem extends BaseSystem {
	private CameraManager cameraManager;
	private PhysicsSystem physicsSystem;

	private Box2DDebugRenderer debugRenderer;

	public Box2dDebugRenderSystem () {
		Gdx.app.postRunnable(new Runnable() {
			@Override
			public void run () {
				debugRenderer = new Box2DDebugRenderer();
			}
		});
	}

	@Override
	protected void processSystem () {
		if(debugRenderer != null) debugRenderer.render(physicsSystem.getPhysicsWorld(), cameraManager.getCombined());
	}
}

@@ -717,37 +717,8 @@
 re;%0A
-import com.badlogic.gdx.Gdx;%0A
 impo
@@ -823,16 +823,68 @@
 Manager;
+%0Aimport com.kotcrab.vis.runtime.util.AfterSceneInit;
 %0A%0A/** @a
@@ -961,16 +961,42 @@
 eSystem 
+implements AfterSceneInit 
 %7B%0A%09priva
@@ -1114,86 +1114,8 @@
 r;%0A%0A
-%09public Box2dDebugRenderSystem () %7B%0A%09%09Gdx.app.postRunnable(new Runnable() %7B%0A%09%09
 %09@Ov
@@ -1121,18 +1121,16 @@
 verride%0A
-%09%09
 %09public 
@@ -1138,19 +1138,28 @@
 oid 
-run
+afterSceneInit
  () %7B%0A
-%09%09
 %09%09de
@@ -1202,19 +1202,8 @@
 ();%0A
-%09%09%09%7D%0A%09%09%7D);%0A
 %09%7D%0A%0A
@@ -1254,34 +1254,8 @@
 %7B%0A%09%09
-if(debugRenderer != null) 
 debu

Simplify box2d debug renderer init