diff --git a/android/assets/1280x720/RhythmBulletBG.png b/android/assets/1280x720/RhythmBulletBG.png new file mode 100644 index 0000000..e93e249 Binary files /dev/null and b/android/assets/1280x720/RhythmBulletBG.png differ diff --git a/android/assets/1280x720/star_bg.png b/android/assets/1280x720/star_bg.png deleted file mode 100755 index 81bcfb1..0000000 Binary files a/android/assets/1280x720/star_bg.png and /dev/null differ diff --git a/android/assets/1280x800/RhythmBulletBG.png b/android/assets/1280x800/RhythmBulletBG.png new file mode 100644 index 0000000..4c9d321 Binary files /dev/null and b/android/assets/1280x800/RhythmBulletBG.png differ diff --git a/android/assets/1280x800/star_bg.png b/android/assets/1280x800/star_bg.png deleted file mode 100755 index e6036b5..0000000 Binary files a/android/assets/1280x800/star_bg.png and /dev/null differ diff --git a/android/assets/1366x768/RhythmBulletBG.png b/android/assets/1366x768/RhythmBulletBG.png new file mode 100644 index 0000000..75fd847 Binary files /dev/null and b/android/assets/1366x768/RhythmBulletBG.png differ diff --git a/android/assets/1366x768/star_bg.png b/android/assets/1366x768/star_bg.png deleted file mode 100755 index 890b1b2..0000000 Binary files a/android/assets/1366x768/star_bg.png and /dev/null differ diff --git a/android/assets/1920x1080/RhythmBulletBG.png b/android/assets/1920x1080/RhythmBulletBG.png new file mode 100644 index 0000000..177ecec Binary files /dev/null and b/android/assets/1920x1080/RhythmBulletBG.png differ diff --git a/android/assets/1920x1080/star_bg.png b/android/assets/1920x1080/star_bg.png deleted file mode 100755 index c9f5785..0000000 Binary files a/android/assets/1920x1080/star_bg.png and /dev/null differ diff --git a/android/assets/1920x1200/RhythmBulletBG.png b/android/assets/1920x1200/RhythmBulletBG.png new file mode 100644 index 0000000..5bd56df Binary files /dev/null and b/android/assets/1920x1200/RhythmBulletBG.png differ diff --git a/android/assets/1920x1200/star_bg.png b/android/assets/1920x1200/star_bg.png deleted file mode 100755 index 08437b0..0000000 Binary files a/android/assets/1920x1200/star_bg.png and /dev/null differ diff --git a/android/assets/2560x1440/RhythmBulletBG.png b/android/assets/2560x1440/RhythmBulletBG.png new file mode 100644 index 0000000..e155bc5 Binary files /dev/null and b/android/assets/2560x1440/RhythmBulletBG.png differ diff --git a/android/assets/2560x1440/star_bg.png b/android/assets/2560x1440/star_bg.png deleted file mode 100755 index 42d1c0d..0000000 Binary files a/android/assets/2560x1440/star_bg.png and /dev/null differ diff --git a/android/assets/3840x2160/RhythmBulletBG.png b/android/assets/3840x2160/RhythmBulletBG.png new file mode 100644 index 0000000..2c83916 Binary files /dev/null and b/android/assets/3840x2160/RhythmBulletBG.png differ diff --git a/android/assets/3840x2160/RhythmBulletMenuBG.png b/android/assets/3840x2160/RhythmBulletMenuBG.png deleted file mode 100644 index bc4a48c..0000000 Binary files a/android/assets/3840x2160/RhythmBulletMenuBG.png and /dev/null differ diff --git a/android/assets/3840x2160/star_bg.png b/android/assets/3840x2160/star_bg.png deleted file mode 100755 index 5f82063..0000000 Binary files a/android/assets/3840x2160/star_bg.png and /dev/null differ diff --git a/android/assets/gradients.atlas b/android/assets/gradients.atlas deleted file mode 100755 index 863e694..0000000 --- a/android/assets/gradients.atlas +++ /dev/null @@ -1,19 +0,0 @@ -gradients.png -size: 128,128 -format: RGBA8888 -filter: Linear,Linear -repeat: none -round-grad - rotate: false - xy: 2, 2 - size: 5, 5 - orig: 5, 5 - offset: 0, 0 - index: -1 -linear-up-grad - rotate: false - xy: 10, 2 - size: 5, 5 - orig: 5, 5 - offset: 0, 0 - index: -1 \ No newline at end of file diff --git a/android/assets/gradients.png b/android/assets/gradients.png deleted file mode 100755 index 70c1cc9..0000000 Binary files a/android/assets/gradients.png and /dev/null differ diff --git a/core/src/zero1hd/rhythmbullet/RhythmBullet.java b/core/src/zero1hd/rhythmbullet/RhythmBullet.java index 5a5d839..7668a46 100755 --- a/core/src/zero1hd/rhythmbullet/RhythmBullet.java +++ b/core/src/zero1hd/rhythmbullet/RhythmBullet.java @@ -230,7 +230,6 @@ public class RhythmBullet extends Game { assetManager.load("shard.png", Texture.class); assetManager.load("bar.png", Texture.class); assetManager.load("flake.png", Texture.class); - assetManager.load("star_bg.png", Texture.class); assetManager.load("void_circle.png", Texture.class); assetManager.load("laser.ogg", Sound.class); assetManager.load("explosion.ogg", Sound.class); @@ -239,7 +238,7 @@ public class RhythmBullet extends Game { assetManager.load("beateffect.p", ParticleEffect.class); assetManager.load("tpSelector.png", Texture.class); assetManager.load("magic1.png", Texture.class); - assetManager.load("gradients.atlas", TextureAtlas.class); + assetManager.load("RhythmBulletBG.png", Texture.class); } public void generateFonts(final int height) { diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/GraphicsOptions.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/GraphicsOptions.java index 3a68c30..1295ef0 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/GraphicsOptions.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/GraphicsOptions.java @@ -43,12 +43,10 @@ public class GraphicsOptions extends Table { public void changed(ChangeEvent event, Actor actor) { save(); if (glowShader.isChecked()) { - mainMenu.attemptLoadShaders(); enhancedGlow.setDisabled(false); } else { enhancedGlow.setChecked(false); enhancedGlow.setDisabled(true); - mainMenu.unloadShaders(); } } }); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java index 0097e9e..1bda8fd 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java @@ -6,6 +6,7 @@ import com.badlogic.gdx.ScreenAdapter; 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; @@ -34,6 +35,7 @@ import zero1hd.rhythmbullet.util.MusicManager; public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { public Stage stage; + private Texture background; private Vector3 cameraPosition; private MainPage mainPage; @@ -59,8 +61,9 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { private TextureRegion fboRegion; private int fboSize; private int blurlvl; - private Batch batch; + private Batch screenBatch; private ScreenViewport screenViewport; + private boolean shaderLoaded; public MainMenu(RhythmBullet core) { this.core = core; @@ -75,6 +78,8 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { mlc.setShuffle(true); mic = new MusicInfoController(musicList); + + screenBatch = new SpriteBatch(); } @Override @@ -85,6 +90,8 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { stage.addActor(mainPage); //End main menu + background = core.getAssetManager().get("RhythmBulletBG.png", Texture.class); + keybindPage = new KeybindOptionsPage(core.getDefaultSkin(), core.getAssetManager(), cameraPosition); keybindPage.setPosition(-1f*Gdx.graphics.getWidth(), -1f*Gdx.graphics.getHeight()); stage.addActor(keybindPage); @@ -153,7 +160,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { // Begin drawing a normal version of screen normalBuffer.begin(); stage.getViewport().apply(); - Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1f); + Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); draw(); normalBuffer.end(); @@ -163,14 +170,17 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { // Begin light filtering lightFilterBuffer.begin(); - Gdx.gl.glClearColor(0f, 0f, 0f, 1f); + Gdx.gl.glClearColor(0f, 0f, 0f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); fboRegion.setTexture(normalBuffer.getColorBufferTexture()); - batch.setShader(brightFilterShader); - batch.setProjectionMatrix(screenViewport.getCamera().combined); - batch.begin(); //BATCH STARTS HERE - batch.draw(fboRegion, 0, 0, stage.getWidth(), stage.getHeight()); - batch.flush(); + 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()); + screenBatch.flush(); lightFilterBuffer.end(); // for (int i = 0; i < blurlvl; i++) { @@ -181,31 +191,34 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { } else { fboRegion.setTexture(lightFilterBuffer.getColorBufferTexture()); } - batch.setShader(gaussianBlurShader); + screenBatch.setShader(gaussianBlurShader); gaussianBlurShader.setUniformi("horizontal", 1); - batch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight()); - batch.flush(); + screenBatch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight()); + screenBatch.flush(); hBlur.end(); // //Vertical gaussian blur vBlur.begin(); fboRegion.setTexture(hBlur.getColorBufferTexture()); - batch.setShader(gaussianBlurShader); + screenBatch.setShader(gaussianBlurShader); gaussianBlurShader.setUniformi("horizontal", 0); - batch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight()); - batch.flush(); + screenBatch.draw(fboRegion, 0f, 0f, stage.getWidth(), stage.getHeight()); + screenBatch.flush(); vBlur.end(); } Gdx.gl.glClearColor(0f, 0f, 0f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - batch.setShader(combineShader); + screenBatch.setShader(combineShader); fboRegion.setTexture(normalBuffer.getColorBufferTexture()); - batch.draw(fboRegion, 0f, 0f, fboSize, fboSize); - batch.setShader(null); - batch.end(); //STAGE BATCH ENDS HERE + screenBatch.draw(fboRegion, 0f, 0f, fboSize, fboSize); + screenBatch.setShader(null); + screenBatch.end(); //BATCH ENDS HERE } else { + screenBatch.begin(); + screenBatch.draw(background, 0, 0); + screenBatch.end(); draw(); } @@ -219,7 +232,6 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { } private void draw() { - //TODO draw background stage.draw(); } @@ -227,6 +239,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { public void preAssetLoad() { stage.clear(); mainPage.dispose(); + screenBatch.dispose(); optionsPage.dispose(); creditsPage.dispose(); keybindPage.dispose(); @@ -297,11 +310,16 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { vBlur = null; hBlur = null; - setBlurlvl(0); + shaderLoaded = false; } public void setBlurlvl(int blurlvl) { this.blurlvl = blurlvl; + if (blurlvl > 0) { + attemptLoadShaders(); + } else { + unloadShaders(); + } } public Vector3 getCameraPosition() { @@ -329,14 +347,13 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { } public void attemptLoadShaders() { - if (core.getPrefs().getBoolean("glow shader", true)) { + if (core.getPrefs().getBoolean("glow shader", true) && !shaderLoaded) { if (core.getPrefs().getBoolean("enhanced glow", false)) { blurlvl = 5; } else { blurlvl = 1; } Gdx.app.debug("Shader", "Loading glow shaders."); - batch = new SpriteBatch(); screenViewport = new ScreenViewport(); screenViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); ((OrthographicCamera) screenViewport.getCamera()).setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); @@ -345,7 +362,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { brightFilterShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/bright_filter.fsh")); if (!brightFilterShader.isCompiled()) { Gdx.app.error("Shader failed to compile", brightFilterShader.getLog()); - System.exit(0); + setBlurlvl(0); } if (brightFilterShader.getLog().length() != 0) { Gdx.app.error("Shader", brightFilterShader.getLog()); @@ -354,7 +371,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh")); if (!gaussianBlurShader.isCompiled()) { Gdx.app.error("Shader failed to compile", gaussianBlurShader.getLog()); - System.exit(0); + setBlurlvl(0); } if (gaussianBlurShader.getLog().length() != 0) { Gdx.app.error("Shader", gaussianBlurShader.getLog()); @@ -363,7 +380,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { combineShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/combine.fsh")); if (!combineShader.isCompiled()) { Gdx.app.error("Shader failed to compile", combineShader.getLog()); - System.exit(0); + setBlurlvl(0); } if (combineShader.getLog().length() != 0) { Gdx.app.error("Shader", combineShader.getLog()); @@ -393,9 +410,9 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { vBlur.getColorBufferTexture().bind(1); Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0); + ShaderProgram.pedantic = false; + shaderLoaded = true; } - - ShaderProgram.pedantic = false; } }