minor cleanup and fixing

This commit is contained in:
Harrison Deng 2018-02-14 22:28:10 -06:00
parent da9e657564
commit 188608d40d

View File

@ -7,7 +7,6 @@ import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
@ -61,7 +60,7 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
private TextureRegion fboRegion;
private int fboSize;
private int blurlvl;
private Batch screenBatch;
private SpriteBatch screenBatch;
private ScreenViewport screenViewport;
private boolean shaderLoaded;
@ -92,6 +91,7 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
background = core.getAssetManager().get("backgrounds/mainBG.png", Texture.class);
keybindPage = new KeybindOptionsPage(core.getDefaultSkin(), core.getAssetManager(), cameraPosition);
keybindPage.setPosition(-1f*Gdx.graphics.getWidth(), -1f*Gdx.graphics.getHeight());
stage.addActor(keybindPage);
@ -162,9 +162,6 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
stage.getViewport().apply();
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
screenBatch.begin();
screenBatch.draw(background, 0, 0);
screenBatch.end();
draw();
normalBuffer.end();
@ -179,7 +176,6 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
screenBatch.setShader(brightFilterShader);
screenBatch.setProjectionMatrix(screenViewport.getCamera().combined);
screenBatch.begin(); //BATCH STARTS HERE
//TODO Do shader version of background for main menu.
screenBatch.draw(fboRegion, 0, 0, stage.getWidth(), stage.getHeight());
@ -219,9 +215,6 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
screenBatch.end(); //BATCH ENDS HERE
} else {
screenBatch.begin();
screenBatch.draw(background, 0, 0);
screenBatch.end();
draw();
}
@ -235,6 +228,9 @@ public class MainMenuScreen extends ScreenAdapter implements AdvancedResizeScree
}
private void draw() {
screenBatch.begin();
screenBatch.draw(background, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
screenBatch.end();
stage.draw();
}