fix rendering too much merged slider after loading checkpoint

This commit is contained in:
yugecin 2016-12-09 22:09:50 +01:00
parent 2000aacde3
commit 4c64eee4db
2 changed files with 5 additions and 25 deletions

View File

@ -288,7 +288,7 @@ public class Game extends BasicGameState {
sbOverlay = new SBOverlay(this); sbOverlay = new SBOverlay(this);
} }
public void setObjectIndex(int newObjIndex) { public void loadCheckpoint(int checkpoint) {
try { try {
restart = Restart.MANUAL; restart = Restart.MANUAL;
enter(container, game); enter(container, game);
@ -298,7 +298,6 @@ public class Game extends BasicGameState {
epiImgTime = 0; epiImgTime = 0;
MusicController.resume(); MusicController.resume();
} }
int checkpoint = gameObjects[newObjIndex].getTime();
// skip to checkpoint // skip to checkpoint
MusicController.setPosition(checkpoint); MusicController.setPosition(checkpoint);
while (objectIndex < gameObjects.length && beatmap.objects[objectIndex].getTime() <= checkpoint) { while (objectIndex < gameObjects.length && beatmap.objects[objectIndex].getTime() <= checkpoint) {
@ -1031,28 +1030,9 @@ public class Game extends BasicGameState {
int checkpoint = Options.getCheckpoint(); int checkpoint = Options.getCheckpoint();
if (checkpoint == 0 || checkpoint > beatmap.endTime) if (checkpoint == 0 || checkpoint > beatmap.endTime)
break; // invalid checkpoint break; // invalid checkpoint
try { loadCheckpoint(checkpoint);
restart = Restart.MANUAL;
enter(container, game);
checkpointLoaded = true;
if (isLeadIn()) {
leadInTime = 0;
MusicController.resume();
}
SoundController.playSound(SoundEffect.MENUHIT); SoundController.playSound(SoundEffect.MENUHIT);
UI.sendBarNotification("Checkpoint loaded."); UI.sendBarNotification("Checkpoint loaded.");
// skip to checkpoint
MusicController.setPosition(checkpoint);
MusicController.setPitch(GameMod.getSpeedMultiplier() * playbackSpeed.getModifier());
while (objectIndex < gameObjects.length &&
beatmap.objects[objectIndex++].getTime() <= checkpoint)
;
objectIndex--;
lastReplayTime = beatmap.objects[objectIndex].getTime();
} catch (SlickException e) {
ErrorHandler.error("Failed to load checkpoint.", e, false);
}
} }
break; break;
case Input.KEY_F: case Input.KEY_F:

View File

@ -172,7 +172,7 @@ public class SBOverlay {
} }
private void setMusicPosition() { private void setMusicPosition() {
game.setObjectIndex(index); game.loadCheckpoint(gameObjects[index].getTime());
if (speed != 0) { if (speed != 0) {
MusicController.setPitch(speed / 10f); MusicController.setPitch(speed / 10f);
MusicController.resume(); MusicController.resume();