From 0de981ad1371f8a33e67a126e9cdf1fe9715626c Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 17 Jan 2018 11:42:51 -0600 Subject: [PATCH] better organization and cleaner output --- .../rhythmbullet/desktop/audio/Mp3Manager.java | 6 ++++-- .../desktop/graphics/ui/pages/AnalysisPage.java | 3 +-- .../graphics/ui/pages/MusicSelectionPage.java | 3 +-- .../rhythmbullet/desktop/screens/GameScreen.java | 12 ++++++------ .../rhythmbullet/desktop/screens/MainMenu.java | 14 +++++++------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java index 08a4bdd..6384312 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java @@ -159,8 +159,10 @@ public class Mp3Manager implements MusicManager { try { decoder.decodeFrame(header, bitstream); - } catch (ArrayIndexOutOfBoundsException | DecoderException e) { - Gdx.app.error("Shader Error", e.toString()); + } catch (ArrayIndexOutOfBoundsException e) { + Gdx.app.debug("Mp3Manager", "Last buffer reached since array was out of bounds."); + } catch (DecoderException e) { + Gdx.app.error("MP3 Decoder Error", e.toString()); } bitstream.closeFrame(); bytesRead = sampleBuffer.reset(); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java index c2b5f30..6bbc9f6 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java @@ -47,7 +47,7 @@ public class AnalysisPage extends Page { }); adjustment.add(difficultyModLabel); adjustment.add(difficultyModifierSlider).minWidth(0.5f*getWidth()); - adjustment.add(diffModPercentLabel).spaceLeft(10f); + adjustment.add(diffModPercentLabel).spaceLeft(10f).center().expandX().fill(); adjustment.row(); healthModLabel = new Label("Health Modifier: ", skin, "sub-font", skin.getColor("default")); healthModifierSlider = new Slider(1f, 3f, 0.5f, false, skin); @@ -93,7 +93,6 @@ public class AnalysisPage extends Page { progressLabel = new Label("Loading... ", skin); adjustment.add(progressLabel).colspan(2).left().spaceTop(20f); - adjustment.debug(); } public void processSong(MusicManager mm, Texture albumCover, MusicInfo mi) { diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java index f337f20..1cb6828 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java @@ -138,7 +138,7 @@ public class MusicSelectionPage extends Page implements Observer { @Override public void changed(ChangeEvent event, Actor actor) { cameraTarget.x = 2.5f*getWidth(); - ap.processSong(mc.getMusicList().getAudioData(getSelectedMusic()), albumCoverTexture, mic.getInfo(getSelectedMusic())); + ap.processSong(mc.getMusicList().getAudioData(getSelectedMusic()), (albumCoverTexture != null ? albumCoverTexture : assets.get("defaultCover.png", Texture.class)), mic.getInfo(getSelectedMusic())); } }); } @@ -339,7 +339,6 @@ public class MusicSelectionPage extends Page implements Observer { albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(albumCoverTexture)))); } else { albumCover.setDrawable((new TextureRegionDrawable(new TextureRegion(assets.get("defaultCover.png", Texture.class))))); - albumCoverTexture = assets.get("defaultCover.png", Texture.class); } } } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/screens/GameScreen.java b/desktop/src/zero1hd/rhythmbullet/desktop/screens/GameScreen.java index 88d4dbd..ab0e49f 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/screens/GameScreen.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/screens/GameScreen.java @@ -98,29 +98,29 @@ public class GameScreen extends ScreenAdapter { Gdx.app.debug("Shader", "using glow shader"); brightFilterShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/bright_filter.fsh")); if (!brightFilterShader.isCompiled()) { - Gdx.app.error("Shader Error", brightFilterShader.getLog()); + Gdx.app.error("Shader failed to compile", brightFilterShader.getLog()); System.exit(0); } if (brightFilterShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", brightFilterShader.getLog()); + Gdx.app.error("Shader", brightFilterShader.getLog()); } gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh")); if (!gaussianBlurShader.isCompiled()) { - Gdx.app.error("Shader Error", gaussianBlurShader.getLog()); + Gdx.app.error("Shader failed to compile", gaussianBlurShader.getLog()); System.exit(0); } if (gaussianBlurShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", gaussianBlurShader.getLog()); + Gdx.app.error("Shader", gaussianBlurShader.getLog()); } combineShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/combine.fsh")); if (!combineShader.isCompiled()) { - Gdx.app.error("Shader Error", combineShader.getLog()); + Gdx.app.error("Shader failed to compile", combineShader.getLog()); System.exit(0); } if (combineShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", combineShader.getLog()); + Gdx.app.error("Shader", combineShader.getLog()); } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java index 1cf801e..7684768 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/screens/MainMenu.java @@ -331,7 +331,7 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { } else { blurlvl = 1; } - + Gdx.app.debug("Shader", "Loading glow shaders."); batch = new SpriteBatch(); screenViewport = new ScreenViewport(); screenViewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); @@ -340,29 +340,29 @@ public class MainMenu extends ScreenAdapter implements AdvancedResizeScreen { Gdx.app.debug("Shader", "using glow shader"); brightFilterShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/bright_filter.fsh")); if (!brightFilterShader.isCompiled()) { - Gdx.app.error("Shader Error", brightFilterShader.getLog()); + Gdx.app.error("Shader failed to compile", brightFilterShader.getLog()); System.exit(0); } if (brightFilterShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", brightFilterShader.getLog()); + Gdx.app.error("Shader", brightFilterShader.getLog()); } gaussianBlurShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/gaussian_blur.fsh")); if (!gaussianBlurShader.isCompiled()) { - Gdx.app.error("Shader Error", gaussianBlurShader.getLog()); + Gdx.app.error("Shader failed to compile", gaussianBlurShader.getLog()); System.exit(0); } if (gaussianBlurShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", gaussianBlurShader.getLog()); + Gdx.app.error("Shader", gaussianBlurShader.getLog()); } combineShader = new ShaderProgram(Gdx.files.internal("shaders/basic.vsh"), Gdx.files.internal("shaders/combine.fsh")); if (!combineShader.isCompiled()) { - Gdx.app.error("Shader Error", combineShader.getLog()); + Gdx.app.error("Shader failed to compile", combineShader.getLog()); System.exit(0); } if (combineShader.getLog().length() != 0) { - Gdx.app.error("Shader Error", combineShader.getLog()); + Gdx.app.error("Shader", combineShader.getLog()); }