From 31ad6f4a10c97c1f6d650a7056a26d76c02056f1 Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 13 Oct 2017 19:09:17 -0500 Subject: [PATCH] fixed visualizer width, changed scroll bar skin, changed functioning of shader options --- android/assets/uiskin.png | Bin 6342 -> 6288 bytes .../audio/visualizer/BasicVisualizer.java | 21 +++++++---- .../audio/visualizer/MirrorVisualizer.java | 4 +-- .../audio/visualizer/VisualizerCore.java | 14 ++++++++ .../ui/components/GraphicsOptions.java | 16 +++++---- .../ui/components/TitleBarVisualizer.java | 2 ++ .../graphics/ui/components/Visualizer.java | 8 +++++ .../graphics/ui/pages/MainPage.java | 1 - .../graphics/ui/pages/VideoOptionsPage.java | 5 +-- .../rhythmbullet/screens/MainMenu.java | 33 +++++++++++++++--- 10 files changed, 82 insertions(+), 22 deletions(-) diff --git a/android/assets/uiskin.png b/android/assets/uiskin.png index 54dd45bd16dfef98a63deae47e8ea745442f99c4..fa5bcfec8132f571756989c134614a2d4b64fe04 100755 GIT binary patch literal 6288 zcmeHM2UnBpvi=f@KtMoB07XJH6fty_-a$buD54+;0fgw0UZjN(iUOi^L8K}hv9KWl z2_P*Y{Q>u`o3)ZRdB4m%GtV>6%$Joo%d;o%ba=JqzT^#cGH|Ia4~&({^p z-sJQ*KV!-{#>FXoO!JDjFO_aR8d(`MP1D^ z&jkQP*Ue1~F9tcx=IDP#^#@SkaR^2GDz4@T;lsRpkzi3nG3O-ni#F&n;RudvNYS~p zH>Ob0-P{sLGZT9owD;ZEDrKaRBCl^UC(J}p5Ef#zdn-=*V2gm^1+npiw-H%OIl7pD z)ww{o?mF!n?WN(>U3r0lU4xmQMrL#|?8nNGfYIQX4wEsF<+4v*Z*#%;l{R+0b*Wpw zAtF(4{cDd=GaS3ncqaA+Y51ParFRyg6g)EY%Y)0umFgMe5$ayUs8sKzLBH-<{}VjG zy~!9Ws?#NE`r?ye6{)r)Z?mo|&4;*Y8elOhU-=*@En_7CVF#SGh8UEzY2WDsFSPFW zLW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z%s}dQjqHPrCN{Bqu<+Tq`gP^RdN61~P=50>Guu+89v3IZn?ezb{YPK!l$xJs67kKSFT26>4I5Tb;_6t-G8rNAj9-6gXq5`%?mg~A}w>V!KGx&r+W(>4RO)st&(+~P{?-<@N-v8$&dw}0RfpP2OF;@F z!Y)=rm^5!r6?re6ZnfAwqH4MS5Bpy&3A4D+Ulsnp@#3HFKlyGOWXmyleZNV;uYW86 NV*@k&Vm+tme*vi)m$d)@ diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java index 3a3d3c9..7c0af99 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java @@ -68,7 +68,6 @@ public class BasicVisualizer extends VisualizerCore { } public void modify(float delta) { - //Averaging bins together for (int i = 0; i < barCount; i++) { float barHeight = 0; @@ -128,18 +127,18 @@ public class BasicVisualizer extends VisualizerCore { int barSpace = 0; angleRot.set(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation)); - barWidth = MathUtils.ceil((float) width/(float) barCount); + barWidth = MathUtils.round((float) width/(float) barCount); barWidth -= spaceBetweenBars; for (int i = 0; i < bars.length; i++) { barSpace = i*(barWidth+spaceBetweenBars); - if (i == bars.length - 1) { - barSpace -= 2; - } if (flip) { bars[i].setRotation(rotation+180); } else { bars[i].setRotation(rotation); } + if (i == bars.length-1 && width <= getActualWidth()) { + barSpace -= 2; + } if (reverse) { bars[bars.length-i-1].setPosition(xPos + barSpace*angleRot.x, yPos + barSpace*angleRot.y); } else { @@ -147,10 +146,14 @@ public class BasicVisualizer extends VisualizerCore { } } for (int i = 0; i < mirrors.size; i++) { - mirrors.get(i).position(barWidth, spaceBetweenBars); + mirrors.get(i).position(barWidth, spaceBetweenBars, (width <= getActualWidth())); } } + public float getActualWidth() { + return (barWidth+spaceBetweenBars)*(barCount - 1); + } + public void setColor(Color color) { for (int i = 0; i < bars.length; i++) { bars[i].setColor(color); @@ -184,6 +187,7 @@ public class BasicVisualizer extends VisualizerCore { public void addMirrorVisualizer(MirrorVisualizer mirror) { mirror.setup(bars, xPos, yPos, rotation); mirrors.add(mirror); + updatePositionInfo(); } public void removeMirrorVisualizer(MirrorVisualizer mirror) { @@ -217,4 +221,9 @@ public class BasicVisualizer extends VisualizerCore { public float getMaxAvgHeight() { return maxAvgHeight; } + + public int getSpaceBetweenBars() { + System.out.println(spaceBetweenBars); + return spaceBetweenBars; + } } diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java index 46c8966..a9c59e6 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java @@ -34,7 +34,7 @@ public class MirrorVisualizer { this.bars[renderID].draw(batch); } - public void position(int barWidth, int spaceBetweenBars) { + public void position(int barWidth, int spaceBetweenBars, boolean shrink) { int barSpaceMultiplier = barWidth + spaceBetweenBars; for (int i = 0; i < bars.length; i ++) { @@ -44,7 +44,7 @@ public class MirrorVisualizer { bars[i].setRotation(rotation); } int barSpace = i*(barWidth+spaceBetweenBars); - if (i == bars.length - 1) { + if (i == bars.length-1 && shrink) { barSpace -= 2; } bars[i].setPosition(xPos + barSpace*rectCoordRot.x, yPos + barSpace*rectCoordRot.y); diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java index dc822be..2b92d2b 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java @@ -76,4 +76,18 @@ public class VisualizerCore implements Disposable { this.height = height; } + public float getxPos() { + return xPos; + } + public float getyPos() { + return yPos; + } + + public float getWidth() { + return width; + } + public float getHeight() { + return height; + } + } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsOptions.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsOptions.java index cec90c6..cd75367 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsOptions.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsOptions.java @@ -11,6 +11,8 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.utils.Align; +import zero1hd.rhythmbullet.screens.MainMenu; + public class GraphicsOptions extends Table { private Label resolutions, shaders; private Preferences prefs; @@ -27,7 +29,7 @@ public class GraphicsOptions extends Table { _800x480; - public GraphicsOptions(Skin skin, final Preferences prefs) { + public GraphicsOptions(MainMenu mainMenu, Skin skin, Preferences prefs) { align(Align.center); defaults().space(10f); this.prefs = prefs; @@ -41,10 +43,10 @@ public class GraphicsOptions extends Table { @Override public void changed(ChangeEvent event, Actor actor) { save(); - if (prefs.getBoolean("fullscreen")) { - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + if (glowShader.isChecked()) { + mainMenu.loadShaders(); } else { - Gdx.graphics.setWindowedMode(prefs.getInteger("screen-width"), prefs.getInteger("screen-height")); + mainMenu.unloadShaders(); } } }); @@ -57,10 +59,10 @@ public class GraphicsOptions extends Table { @Override public void changed(ChangeEvent event, Actor actor) { save(); - if (prefs.getBoolean("fullscreen")) { - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + if (enhancedGlow.isChecked()) { + mainMenu.setBlurlvl(6); } else { - Gdx.graphics.setWindowedMode(prefs.getInteger("screen-width"), prefs.getInteger("screen-height")); + mainMenu.setBlurlvl(1); } } }); diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java index b091c02..71c66c8 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java @@ -44,8 +44,10 @@ public class TitleBarVisualizer extends Group implements Disposable { visual.getVis().flip(); visual.getVis().reverse(); visual2 = new MirrorVisualizer(); + visual.setUpdatePositioning(false); visual.getVis().addMirrorVisualizer(visual2); visual2.setyPos(MathUtils.round(getHeight())); + visual.updateVisualPosition(); Pixmap pixmap = new Pixmap(MathUtils.round(getWidth()), MathUtils.round(getHeight()), Format.RGBA8888); pixmap.setColor(Color.WHITE); diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java index 9af205c..d6306da 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java @@ -41,6 +41,7 @@ public class Visualizer extends Widget { vis.setRotation(getRotation()); if (updatePositioning) { vis.updatePositionInfo(); + vis.setxPos((getWidth() - vis.getActualWidth())/2f); } vis.calculate(); super.act(delta); @@ -65,9 +66,16 @@ public class Visualizer extends Widget { } public void setUpdatePositioning(boolean updatePositioning) { + vis.updatePositionInfo(); + vis.setxPos(((vis.getWidth() - vis.getActualWidth())/2f)); + vis.updatePositionInfo(); this.updatePositioning = updatePositioning; } + public void updateVisualPosition() { + vis.updatePositionInfo(); + } + public boolean isUpdatePositioning() { return updatePositioning; } diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java index 4fcd091..1d6ecd3 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java @@ -32,7 +32,6 @@ public class MainPage extends Page implements OnDifferentSongListener { addActor(titleBar); titleBar.getHvisual().setMM(sc.getCurrentSong()); - sc.addOnDifferentSongListener(this); versionLabel = new Label("Version: " + RhythmBullet.VERSION, core.getDefaultSkin(), "sub-font", diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/VideoOptionsPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/VideoOptionsPage.java index 752324d..83eff78 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/VideoOptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/VideoOptionsPage.java @@ -11,12 +11,13 @@ import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import zero1hd.rhythmbullet.graphics.ui.components.GraphicsOptions; +import zero1hd.rhythmbullet.screens.MainMenu; public class VideoOptionsPage extends Page { private ScrollPane scrollPane; private GraphicsOptions graphicsTable; - public VideoOptionsPage(Skin skin, Preferences prefs) { - graphicsTable = new GraphicsOptions(skin, prefs); + public VideoOptionsPage(Skin skin, Preferences prefs, MainMenu menu) { + graphicsTable = new GraphicsOptions(menu, skin, prefs); scrollPane = new ScrollPane(graphicsTable, skin); scrollPane.setFadeScrollBars(false); scrollPane.setFillParent(true); diff --git a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java index 262a03d..9addc6f 100755 --- a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java +++ b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java @@ -54,7 +54,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { private Batch batch; private ScreenViewport screenViewport; - public MainMenu(final RhythmBullet core) { + public MainMenu(RhythmBullet core) { this.core = core; stage = new Stage(new ScreenViewport()); targetPosition = new Vector3(stage.getCamera().position); @@ -83,7 +83,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { keybindPage.setPosition(1f*Gdx.graphics.getWidth(), -1f*Gdx.graphics.getHeight()); stage.addActor(keybindPage); - graphicsPage = new VideoOptionsPage(core.getDefaultSkin(), core.getPrefs()); + graphicsPage = new VideoOptionsPage(core.getDefaultSkin(), core.getPrefs(), this); graphicsPage.setPosition(1f*Gdx.graphics.getWidth(), 1f*Gdx.graphics.getHeight()); stage.addActor(graphicsPage); @@ -197,10 +197,10 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { @Override public void render(float delta) { - Gdx.gl.glClearColor(0.32f, 0f, 0f, 1f); + Gdx.gl.glClearColor(0.22f, 0f, 0f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); - if (gaussianBlurShader != null) { + if (blurlvl > 0) { //Begin drawing a normal version of screen normalBuffer.begin(); stage.getViewport().apply(); @@ -309,6 +309,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { @Override public void dispose() { stage.dispose(); + unloadShaders(); super.dispose(); } @@ -319,4 +320,28 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { lerpAlpha = 0.15f; } } + + public void unloadShaders() { + brightFilterShader.dispose(); + combineShader.dispose(); + gaussianBlurShader.dispose(); + normalBuffer.dispose(); + lightFilterBuffer.dispose(); + vBlur.dispose(); + hBlur.dispose(); + + brightFilterShader = null; + combineShader = null; + gaussianBlurShader = null; + normalBuffer = null; + lightFilterBuffer = null; + vBlur = null; + hBlur = null; + + setBlurlvl(0); + } + + public void setBlurlvl(int blurlvl) { + this.blurlvl = blurlvl; + } }