main menu background progress
BIN
android/assets/1280x720/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 738 KiB |
BIN
android/assets/1280x800/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 947 KiB |
BIN
android/assets/1366x768/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 891 KiB |
BIN
android/assets/1920x1080/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 3.5 MiB |
Before Width: | Height: | Size: 1.3 MiB |
BIN
android/assets/1920x1200/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 3.8 MiB |
Before Width: | Height: | Size: 1.7 MiB |
BIN
android/assets/2560x1440/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 6.4 MiB |
Before Width: | Height: | Size: 2.0 MiB |
BIN
android/assets/3840x2160/RhythmBulletBG.png
Normal file
After Width: | Height: | Size: 15 MiB |
Before Width: | Height: | Size: 452 KiB |
Before Width: | Height: | Size: 4.0 MiB |
@ -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
|
Before Width: | Height: | Size: 581 B |
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|