better organization and cleaner output

This commit is contained in:
Harrison Deng 2018-01-17 11:42:51 -06:00
parent d4869d0348
commit 0de981ad13
5 changed files with 19 additions and 19 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -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);
}
}
}

View File

@ -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());
}

View File

@ -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());
}