From b324663f10cd5c9c672fcb89806f415d0f8ebec8 Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 9 Jul 2013 22:16:01 -0400 Subject: [PATCH] update RenderContext --- src/com/blarg/gdx/graphics/RenderContext.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/com/blarg/gdx/graphics/RenderContext.java b/src/com/blarg/gdx/graphics/RenderContext.java index 02d37e1..3974868 100644 --- a/src/com/blarg/gdx/graphics/RenderContext.java +++ b/src/com/blarg/gdx/graphics/RenderContext.java @@ -13,20 +13,19 @@ import com.badlogic.gdx.utils.Disposable; public class RenderContext implements Disposable { public final ExtendedSpriteBatch spriteBatch; - public final DecalBatch decalBatch; public final BillboardSpriteBatch billboardSpriteBatch; public final ShapeRenderer debugGeometryRenderer; public final ModelBatch modelBatch; public final ScreenPixelScaler pixelScaler; public final SolidColorTextureCache solidColorTextures; - AlphaTestCameraGroupStrategy cameraGroupStrategy; Camera perspectiveCamera; OrthographicCamera orthographicCamera; public RenderContext(boolean use2dPixelScaling) { Gdx.app.debug("RenderContext", "ctor"); spriteBatch = new ExtendedSpriteBatch(); + billboardSpriteBatch = new BillboardSpriteBatch(); debugGeometryRenderer = new ShapeRenderer(); modelBatch = new ModelBatch(); solidColorTextures = new SolidColorTextureCache(); @@ -39,10 +38,6 @@ public class RenderContext implements Disposable { orthographicCamera = new OrthographicCamera(pixelScaler.getScaledWidth(), pixelScaler.getScaledHeight()); setDefaultPerspectiveCamera(); - - cameraGroupStrategy = new AlphaTestCameraGroupStrategy(perspectiveCamera); - decalBatch = new DecalBatch(cameraGroupStrategy); - billboardSpriteBatch = new BillboardSpriteBatch(); } public Camera getPerspectiveCamera() { @@ -55,8 +50,6 @@ public class RenderContext implements Disposable { public void setPerspectiveCamera(Camera camera) { perspectiveCamera = camera; - if (cameraGroupStrategy != null) - cameraGroupStrategy.setCamera(camera); } public void setDefaultPerspectiveCamera() { @@ -82,11 +75,9 @@ public class RenderContext implements Disposable { spriteBatch.setProjectionMatrix(orthographicCamera.combined); spriteBatch.setPixelScale(pixelScaler.getScale()); debugGeometryRenderer.setProjectionMatrix(perspectiveCamera.combined); - billboardSpriteBatch.begin(decalBatch, perspectiveCamera); } public void onPostRender() { - billboardSpriteBatch.end(); } public void onUpdate(float delta) { @@ -116,8 +107,7 @@ public class RenderContext implements Disposable { public void dispose() { Gdx.app.debug("RenderContext", String.format("dispose")); solidColorTextures.dispose(); + billboardSpriteBatch.dispose(); spriteBatch.dispose(); - decalBatch.dispose(); - cameraGroupStrategy.dispose(); } }