fix some camera properties not being used/reset in RenderContext

This commit is contained in:
Gered 2013-07-07 18:38:26 -04:00
parent 31809c6586
commit e4ad88abc8

View file

@ -83,6 +83,7 @@ public class RenderContext implements Disposable {
public void onPreRender() { public void onPreRender() {
spriteBatch.setProjectionMatrix(orthographicCamera.combined); spriteBatch.setProjectionMatrix(orthographicCamera.combined);
debugGeometryRenderer.setProjectionMatrix(perspectiveCamera.combined);
debugGeometryRenderer.begin(ShapeRenderer.ShapeType.Line); debugGeometryRenderer.begin(ShapeRenderer.ShapeType.Line);
delayedSpriteBatch.begin(spriteBatch, perspectiveCamera, pixelScaler.getScale()); delayedSpriteBatch.begin(spriteBatch, perspectiveCamera, pixelScaler.getScale());
billboardSpriteBatch.begin(decalBatch, perspectiveCamera); billboardSpriteBatch.begin(decalBatch, perspectiveCamera);
@ -105,6 +106,8 @@ public class RenderContext implements Disposable {
Gdx.app.debug("RenderContext", String.format("onResize(%d, %d)", width, height)); Gdx.app.debug("RenderContext", String.format("onResize(%d, %d)", width, height));
pixelScaler.calculateScale(width, height); pixelScaler.calculateScale(width, height);
orthographicCamera.setToOrtho(false, pixelScaler.getScaledWidth(), pixelScaler.getScaledHeight()); orthographicCamera.setToOrtho(false, pixelScaler.getScaledWidth(), pixelScaler.getScaledHeight());
perspectiveCamera.viewportWidth = width;
perspectiveCamera.viewportHeight = height;
} }
public void onPause() { public void onPause() {