optimization
This commit is contained in:
parent
86a606c44e
commit
a41923fa12
@ -15,11 +15,10 @@ import zero1hd.rhythmbullet.audio.MusicManager;
|
|||||||
|
|
||||||
public class BasicVisualizer extends VisualizerCore {
|
public class BasicVisualizer extends VisualizerCore {
|
||||||
private Pixmap pixmap;
|
private Pixmap pixmap;
|
||||||
private Texture bar;
|
private Texture barTexture;
|
||||||
private int barWidth;
|
private int barWidth;
|
||||||
private int binsPerBar;
|
private int binsPerBar;
|
||||||
private int spaceBetweenBars;
|
private int spaceBetweenBars;
|
||||||
private Texture[] textures;
|
|
||||||
private Sprite[] bars;
|
private Sprite[] bars;
|
||||||
private float[] barHeights;
|
private float[] barHeights;
|
||||||
private int smoothRange;
|
private int smoothRange;
|
||||||
@ -41,13 +40,11 @@ public class BasicVisualizer extends VisualizerCore {
|
|||||||
barCount = 75;
|
barCount = 75;
|
||||||
smoothRange = 2;
|
smoothRange = 2;
|
||||||
angleRot = new Vector2(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation));
|
angleRot = new Vector2(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation));
|
||||||
textures = new Texture[barCount];
|
|
||||||
bars = new Sprite[barCount];
|
bars = new Sprite[barCount];
|
||||||
barHeights = new float[barCount];
|
barHeights = new float[barCount];
|
||||||
|
barTexture = new Texture(pixmap);
|
||||||
for (int i = 0; i < textures.length; i++) {
|
for (int i = 0; i < bars.length; i++) {
|
||||||
textures[i] = new Texture(pixmap);
|
bars[i] = new Sprite(barTexture);
|
||||||
bars[i] = new Sprite(textures[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePositionInfo();
|
updatePositionInfo();
|
||||||
@ -118,10 +115,7 @@ public class BasicVisualizer extends VisualizerCore {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
bar.dispose();
|
barTexture.dispose();
|
||||||
for (int i = 0; i < textures.length; i++) {
|
|
||||||
textures[i].dispose();
|
|
||||||
}
|
|
||||||
if (mm != null) {
|
if (mm != null) {
|
||||||
mm.dispose();
|
mm.dispose();
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects this panel
|
* Selects this panel
|
||||||
* @param updateGlobalSelection whether or not to tell everything that this is selected. Usually true unless you set the global somewhere else.
|
|
||||||
*/
|
*/
|
||||||
public void select() {
|
public void select() {
|
||||||
msp.deselectAll();
|
msp.deselectAll();
|
||||||
|
@ -208,10 +208,10 @@ public class MusicSelectionPage extends Page implements Observer {
|
|||||||
|
|
||||||
exec.submit(() -> {
|
exec.submit(() -> {
|
||||||
for (int i = 0; i < selectables.size; i++) {
|
for (int i = 0; i < selectables.size; i++) {
|
||||||
MusicSelectable info = selectables.get(i);
|
MusicSelectable selectable = selectables.get(i);
|
||||||
info.getAudioInfo().loadInfo();
|
selectable.getAudioInfo().loadInfo();
|
||||||
Gdx.app.postRunnable(() -> {
|
Gdx.app.postRunnable(() -> {
|
||||||
info.updateInfo();
|
selectable.updateInfo();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
extraInfoDone = true;
|
extraInfoDone = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user