From 60dacb6d4c5a46c5b801d926671f2db4986db51c Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 19 Jul 2017 23:31:05 -0500 Subject: [PATCH] fbo is now properly sized --- android/assets/particles/standard_thrust.p | 4 +-- .../polyjet/ui/stages/GamePlayArea.java | 34 +++++-------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/android/assets/particles/standard_thrust.p b/android/assets/particles/standard_thrust.p index bfcbf98..8e127b5 100755 --- a/android/assets/particles/standard_thrust.p +++ b/android/assets/particles/standard_thrust.p @@ -119,7 +119,7 @@ active: false - Tint - colorsCount: 3 colors0: 0.15294118 -colors1: 0.85882354 +colors1: 0.8627451 colors2: 1.0 timelineCount: 1 timeline0: 0.0 @@ -147,7 +147,7 @@ timeline5: 1.0 attached: false continuous: true aligned: false -additive: true +additive: false behind: false premultipliedAlpha: false - Image Path - diff --git a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java index 57d0aa8..2310947 100755 --- a/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java +++ b/core/src/zero1hd/polyjet/ui/stages/GamePlayArea.java @@ -128,23 +128,21 @@ public class GamePlayArea extends Stage { Gdx.gl.glClearColor(0f, 0f, 0f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); -// + getBatch().setBlendFunction(-1, -1); + Gdx.gl20.glBlendFuncSeparate(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA,GL20.GL_ONE, GL20.GL_DST_ALPHA); getBatch().setShader(null); -// resizeBatch(fboSize, fboSize); -// resizeBatch(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT); - updateBatch(); - getBatch().begin(); - getRoot().draw(getBatch(), 1f); - getBatch().flush(); + + // use -1 to ignore.. somebody should fix this in LibGDX :\ + getBatch().setBlendFunction(-1, -1); + // setup our alpha blending to avoid blending twice + Gdx.gl20.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_ONE, GL20.GL_ONE); + super.draw(); blurTarget.end(getViewport().getScreenX(), getViewport().getScreenY(), getViewport().getScreenWidth(), getViewport().getScreenHeight()); - -// resizeBatch(Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT); - updateBatch(); + getBatch().begin(); // getBatch().setShader(glowShader); getBatch().draw(fboRegion, 0f, 0f, Polyjet.GAME_AREA_WIDTH, Polyjet.GAME_AREA_HEIGHT); - getBatch().setShader(null); getBatch().end(); @@ -154,20 +152,6 @@ public class GamePlayArea extends Stage { } } - private void updateBatch() { - Camera camera = getViewport().getCamera(); - camera.update(); - - Batch batch = getBatch(); - batch.setProjectionMatrix(camera.combined); - } - - void resizeBatch(int width, int height) { - ((OrthographicCamera) getCamera()).setToOrtho(false, width, height); - getBatch().setProjectionMatrix(getCamera().combined); -// getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); - } - @Override public void act(float delta) { MapWindowData mwd;