- Actually provide relevant information when an audio file can't be found. - When loading timing points, don't reset the start index every time. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
4eaf0b6a54
commit
13d383463f
|
@ -244,7 +244,7 @@ public class OsuParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!match) {
|
if (!match) {
|
||||||
Log.error(String.format("File not found: '%s'", tokens[1]));
|
Log.error(String.format("Audio file '%s' not found in directory '%s'.", tokens[1], dir.getName()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import itdelatrisu.opsu.objects.DummyObject;
|
||||||
import itdelatrisu.opsu.objects.HitObject;
|
import itdelatrisu.opsu.objects.HitObject;
|
||||||
import itdelatrisu.opsu.objects.Slider;
|
import itdelatrisu.opsu.objects.Slider;
|
||||||
import itdelatrisu.opsu.objects.Spinner;
|
import itdelatrisu.opsu.objects.Spinner;
|
||||||
|
import itdelatrisu.opsu.replay.PlaybackSpeed;
|
||||||
import itdelatrisu.opsu.replay.Replay;
|
import itdelatrisu.opsu.replay.Replay;
|
||||||
import itdelatrisu.opsu.replay.ReplayFrame;
|
import itdelatrisu.opsu.replay.ReplayFrame;
|
||||||
|
|
||||||
|
@ -50,7 +51,6 @@ import java.io.File;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import itdelatrisu.opsu.replay.PlaybackSpeed;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.Display;
|
||||||
import org.newdawn.slick.Animation;
|
import org.newdawn.slick.Animation;
|
||||||
|
@ -686,9 +686,7 @@ public class Game extends BasicGameState {
|
||||||
if (timingPointIndex < osu.timingPoints.size()) {
|
if (timingPointIndex < osu.timingPoints.size()) {
|
||||||
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||||
if (trackPosition >= timingPoint.getTime()) {
|
if (trackPosition >= timingPoint.getTime()) {
|
||||||
setBeatLength(timingPoint);
|
setBeatLength(timingPoint, true);
|
||||||
HitSound.setDefaultSampleSet(timingPoint.getSampleType());
|
|
||||||
SoundController.setSampleVolume(timingPoint.getSampleVolume());
|
|
||||||
timingPointIndex++;
|
timingPointIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1058,12 +1056,11 @@ public class Game extends BasicGameState {
|
||||||
|
|
||||||
// pass beatLength to hit objects
|
// pass beatLength to hit objects
|
||||||
int hitObjectTime = hitObject.getTime();
|
int hitObjectTime = hitObject.getTime();
|
||||||
int timingPointIndex = 0;
|
|
||||||
while (timingPointIndex < osu.timingPoints.size()) {
|
while (timingPointIndex < osu.timingPoints.size()) {
|
||||||
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||||
if (timingPoint.getTime() > hitObjectTime)
|
if (timingPoint.getTime() > hitObjectTime)
|
||||||
break;
|
break;
|
||||||
setBeatLength(timingPoint);
|
setBeatLength(timingPoint, false);
|
||||||
timingPointIndex++;
|
timingPointIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1087,12 +1084,12 @@ public class Game extends BasicGameState {
|
||||||
calculateStacks();
|
calculateStacks();
|
||||||
|
|
||||||
// load the first timingPoint
|
// load the first timingPoint
|
||||||
|
timingPointIndex = 0;
|
||||||
|
beatLengthBase = beatLength = 1;
|
||||||
if (!osu.timingPoints.isEmpty()) {
|
if (!osu.timingPoints.isEmpty()) {
|
||||||
OsuTimingPoint timingPoint = osu.timingPoints.get(0);
|
OsuTimingPoint timingPoint = osu.timingPoints.get(0);
|
||||||
if (!timingPoint.isInherited()) {
|
if (!timingPoint.isInherited()) {
|
||||||
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
setBeatLength(timingPoint, true);
|
||||||
HitSound.setDefaultSampleSet(timingPoint.getSampleType());
|
|
||||||
SoundController.setSampleVolume(timingPoint.getSampleVolume());
|
|
||||||
timingPointIndex++;
|
timingPointIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1431,12 +1428,18 @@ public class Game extends BasicGameState {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the beat length fields based on a given timing point.
|
* Sets the beat length fields based on a given timing point.
|
||||||
|
* @param timingPoint the timing point
|
||||||
|
* @param setSampleSet whether to set the hit sample set based on the timing point
|
||||||
*/
|
*/
|
||||||
private void setBeatLength(OsuTimingPoint timingPoint) {
|
private void setBeatLength(OsuTimingPoint timingPoint, boolean setSampleSet) {
|
||||||
if (!timingPoint.isInherited())
|
if (!timingPoint.isInherited())
|
||||||
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
||||||
else
|
else
|
||||||
beatLength = beatLengthBase * timingPoint.getSliderMultiplier();
|
beatLength = beatLengthBase * timingPoint.getSliderMultiplier();
|
||||||
|
if (setSampleSet) {
|
||||||
|
HitSound.setDefaultSampleSet(timingPoint.getSampleType());
|
||||||
|
SoundController.setSampleVolume(timingPoint.getSampleVolume());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user