began testing, working through various errors, ended on constant
reloading in the game manager;
This commit is contained in:
@@ -44,14 +44,9 @@ public class PCMObtainer implements Observer, Disposable, PCMSystem {
|
||||
try {
|
||||
Field bufferField = ClassReflection.getDeclaredField(OpenALMusic.class, "tempBuffer");
|
||||
bufferField.setAccessible(true);
|
||||
Field bufferSizeField = ClassReflection.getDeclaredField(OpenALMusic.class, "bufferSize");
|
||||
bufferSizeField.setAccessible(true);
|
||||
bufferSizeField.set(null, new Integer(4096 * 5));
|
||||
|
||||
buffer = ((ByteBuffer) bufferField.get(null)).asShortBuffer().asReadOnlyBuffer();
|
||||
} catch (IllegalArgumentException | SecurityException | ReflectionException e) {
|
||||
e.printStackTrace();
|
||||
Gdx.app.debug("Visualizer reflection", "Failed attempt at retrieving tempBuffer field.");
|
||||
Gdx.app.debug("Visualizer reflection", "Failed attempt at retrieving tempBuffer field.", e);
|
||||
Gdx.app.exit();
|
||||
}
|
||||
|
||||
@@ -146,7 +141,7 @@ public class PCMObtainer implements Observer, Disposable, PCMSystem {
|
||||
if (updated) {
|
||||
synchronized (PCM) {
|
||||
fft.fft(PCM);
|
||||
System.arraycopy(PCM, 0, frequencyBins, 0, frequencyBins.length);
|
||||
System.arraycopy(PCM, 1, frequencyBins, 0, frequencyBins.length);
|
||||
}
|
||||
}
|
||||
return frequencyBins;
|
||||
@@ -199,7 +194,7 @@ public class PCMObtainer implements Observer, Disposable, PCMSystem {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (thread == null && !thread.isAlive()) {
|
||||
if (thread == null) {
|
||||
thread = new Thread(this, name);
|
||||
thread.start();
|
||||
} else {
|
||||
|
@@ -21,17 +21,12 @@ public class SplashScreen extends ScreenAdapter implements ResizeReadyScreen, In
|
||||
private Texture splash;
|
||||
private Image zero1HD;
|
||||
|
||||
public SplashScreen() {
|
||||
@Override
|
||||
public void init() {
|
||||
splash = new Texture(Gdx.files.internal("splashlogo.png"));
|
||||
zero1HD = new Image(splash);
|
||||
zero1HD.setScale((Gdx.graphics.getHeight()*0.8f)/zero1HD.getHeight());
|
||||
zero1HD.setColor(0f,1f,1f,0.1f);
|
||||
stage.addActor(zero1HD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,6 +51,7 @@ public class SplashScreen extends ScreenAdapter implements ResizeReadyScreen, In
|
||||
@Override
|
||||
public void postAssetLoad() {
|
||||
stage = new Stage(new ScreenViewport());
|
||||
stage.addActor(zero1HD);
|
||||
zero1HD.setScale((Gdx.graphics.getHeight()*0.8f)/zero1HD.getHeight());
|
||||
zero1HD.setColor(0f,1f,1f,0f);
|
||||
zero1HD.setPosition((stage.getWidth() - zero1HD.getWidth()*zero1HD.getScaleX())/2f, (stage.getHeight() - zero1HD.getHeight()*zero1HD.getScaleY())/2f);
|
||||
|
@@ -52,7 +52,7 @@ public class MainPage extends Page implements Observer {
|
||||
title.setPosition((getWidth()-title.getWidth())/2f, (getHeight()-title.getHeight())/2f);
|
||||
addActor(title);
|
||||
|
||||
versionLabel = new Label("Version: " + RhythmBullet.VERSION, skin, "sub-font");
|
||||
versionLabel = new Label("Version: " + RhythmBullet.VERSION, skin, "sub-font", skin.getColor("default"));
|
||||
versionLabel.setPosition(3, 3);
|
||||
addActor(versionLabel);
|
||||
|
||||
@@ -94,13 +94,13 @@ public class MainPage extends Page implements Observer {
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
dhv.act(delta);
|
||||
// dhv.act(delta);
|
||||
super.act(delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
dhv.draw(batch, parentAlpha);
|
||||
// dhv.draw(batch, parentAlpha);
|
||||
super.draw(batch, parentAlpha);
|
||||
}
|
||||
|
||||
|
@@ -79,7 +79,10 @@ public class MainScreen extends ScreenAdapter implements ResizeReadyScreen {
|
||||
} else {
|
||||
draw();
|
||||
}
|
||||
|
||||
|
||||
draw();
|
||||
|
||||
|
||||
if (stage.getCamera().position.x != cameraPosition.x || stage.getCamera().position.y != cameraPosition.y) {
|
||||
stage.getCamera().position.lerp(cameraPosition, delta*lerpAlpha);
|
||||
stage.getViewport().apply();
|
||||
|
@@ -194,7 +194,7 @@ public class MusicSelectionPage extends Page implements Observer {
|
||||
}
|
||||
}
|
||||
|
||||
if (selectables.getButtons().size == mc.getMusicList().getTotal()) {
|
||||
if (mc.getMusicList().isSearched() && selectables.getButtons().size == mc.getMusicList().getTotal()) {
|
||||
if (selectables.getButtons().size != stackSelectables.getChildren().size) {
|
||||
int index = selectables.getButtons().size - stackSelectables.getChildren().size - 1;
|
||||
stackSelectables.add(selectables.getButtons().get(index));
|
||||
|
Reference in New Issue
Block a user