Renamed "OsuTimingPoint" class to "TimingPoint".
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
436aa2bed9
commit
0a80590505
|
@ -168,7 +168,7 @@ public class OsuFile implements Comparable<OsuFile> {
|
|||
*/
|
||||
|
||||
/** All timing points. */
|
||||
public ArrayList<OsuTimingPoint> timingPoints;
|
||||
public ArrayList<TimingPoint> timingPoints;
|
||||
|
||||
/** Song BPM range. */
|
||||
public int bpmMin = 0, bpmMax = 0;
|
||||
|
@ -363,7 +363,7 @@ public class OsuFile implements Comparable<OsuFile> {
|
|||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (OsuTimingPoint p : timingPoints) {
|
||||
for (TimingPoint p : timingPoints) {
|
||||
sb.append(p.toString());
|
||||
sb.append('|');
|
||||
}
|
||||
|
@ -377,14 +377,14 @@ public class OsuFile implements Comparable<OsuFile> {
|
|||
* @param s the string
|
||||
*/
|
||||
public void timingPointsFromString(String s) {
|
||||
this.timingPoints = new ArrayList<OsuTimingPoint>();
|
||||
this.timingPoints = new ArrayList<TimingPoint>();
|
||||
if (s == null)
|
||||
return;
|
||||
|
||||
String[] tokens = s.split("\\|");
|
||||
for (int i = 0; i < tokens.length; i++) {
|
||||
try {
|
||||
timingPoints.add(new OsuTimingPoint(tokens[i]));
|
||||
timingPoints.add(new TimingPoint(tokens[i]));
|
||||
} catch (Exception e) {
|
||||
Log.warn(String.format("Failed to read timing point '%s'.", tokens[i]), e);
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ public class OsuParser {
|
|||
*/
|
||||
private static OsuFile parseFile(File file, File dir, ArrayList<OsuFile> osuFiles, boolean parseObjects) {
|
||||
OsuFile osu = new OsuFile(file);
|
||||
osu.timingPoints = new ArrayList<OsuTimingPoint>();
|
||||
osu.timingPoints = new ArrayList<TimingPoint>();
|
||||
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"))) {
|
||||
String line = in.readLine();
|
||||
|
@ -469,7 +469,7 @@ public class OsuParser {
|
|||
|
||||
try {
|
||||
// parse timing point
|
||||
OsuTimingPoint timingPoint = new OsuTimingPoint(line);
|
||||
TimingPoint timingPoint = new TimingPoint(line);
|
||||
|
||||
// calculate BPM
|
||||
if (!timingPoint.isInherited()) {
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.newdawn.slick.util.Log;
|
|||
/**
|
||||
* Data type representing a timing point.
|
||||
*/
|
||||
public class OsuTimingPoint {
|
||||
public class TimingPoint {
|
||||
/** Timing point start time/offset (in ms). */
|
||||
private int time = 0;
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class OsuTimingPoint {
|
|||
* Constructor.
|
||||
* @param line the line to be parsed
|
||||
*/
|
||||
public OsuTimingPoint(String line) {
|
||||
public TimingPoint(String line) {
|
||||
// TODO: better support for old formats
|
||||
String[] tokens = line.split(",");
|
||||
try {
|
|
@ -61,7 +61,7 @@ public class CatmullCurve extends EqualDistanceMultiCurve {
|
|||
points.removeFirst();
|
||||
}
|
||||
}
|
||||
if (getX(ncontrolPoints - 1) != getX(ncontrolPoints - 2)
|
||||
if (getX(ncontrolPoints - 1) != getX(ncontrolPoints - 2)
|
||||
||getY(ncontrolPoints - 1) != getY(ncontrolPoints - 2))
|
||||
points.addLast(new Vec2f(getX(ncontrolPoints - 1), getY(ncontrolPoints - 1)));
|
||||
if (points.size() >= 4) {
|
||||
|
|
|
@ -28,8 +28,8 @@ import itdelatrisu.opsu.Options;
|
|||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.OsuHitObject;
|
||||
import itdelatrisu.opsu.OsuParser;
|
||||
import itdelatrisu.opsu.OsuTimingPoint;
|
||||
import itdelatrisu.opsu.ScoreData;
|
||||
import itdelatrisu.opsu.TimingPoint;
|
||||
import itdelatrisu.opsu.UI;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.HitSound;
|
||||
|
@ -684,7 +684,7 @@ public class Game extends BasicGameState {
|
|||
|
||||
// timing points
|
||||
if (timingPointIndex < osu.timingPoints.size()) {
|
||||
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||
TimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||
if (trackPosition >= timingPoint.getTime()) {
|
||||
setBeatLength(timingPoint, true);
|
||||
timingPointIndex++;
|
||||
|
@ -1045,7 +1045,7 @@ public class Game extends BasicGameState {
|
|||
|
||||
// load the first timingPoint for stacking
|
||||
if (!osu.timingPoints.isEmpty()) {
|
||||
OsuTimingPoint timingPoint = osu.timingPoints.get(0);
|
||||
TimingPoint timingPoint = osu.timingPoints.get(0);
|
||||
if (!timingPoint.isInherited()) {
|
||||
setBeatLength(timingPoint, true);
|
||||
timingPointIndex++;
|
||||
|
@ -1066,7 +1066,7 @@ public class Game extends BasicGameState {
|
|||
// pass beatLength to hit objects
|
||||
int hitObjectTime = hitObject.getTime();
|
||||
while (timingPointIndex < osu.timingPoints.size()) {
|
||||
OsuTimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||
TimingPoint timingPoint = osu.timingPoints.get(timingPointIndex);
|
||||
if (timingPoint.getTime() > hitObjectTime)
|
||||
break;
|
||||
setBeatLength(timingPoint, false);
|
||||
|
@ -1096,7 +1096,7 @@ public class Game extends BasicGameState {
|
|||
timingPointIndex = 0;
|
||||
beatLengthBase = beatLength = 1;
|
||||
if (!osu.timingPoints.isEmpty()) {
|
||||
OsuTimingPoint timingPoint = osu.timingPoints.get(0);
|
||||
TimingPoint timingPoint = osu.timingPoints.get(0);
|
||||
if (!timingPoint.isInherited()) {
|
||||
setBeatLength(timingPoint, true);
|
||||
timingPointIndex++;
|
||||
|
@ -1440,7 +1440,7 @@ public class Game extends BasicGameState {
|
|||
* @param timingPoint the timing point
|
||||
* @param setSampleSet whether to set the hit sample set based on the timing point
|
||||
*/
|
||||
private void setBeatLength(OsuTimingPoint timingPoint, boolean setSampleSet) {
|
||||
private void setBeatLength(TimingPoint timingPoint, boolean setSampleSet) {
|
||||
if (!timingPoint.isInherited())
|
||||
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user