From 0a8059050583456b51ff1267abe63f85b36246e4 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Sat, 16 May 2015 17:58:32 -0400 Subject: [PATCH] Renamed "OsuTimingPoint" class to "TimingPoint". Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/OsuFile.java | 8 ++++---- src/itdelatrisu/opsu/OsuParser.java | 4 ++-- .../opsu/{OsuTimingPoint.java => TimingPoint.java} | 4 ++-- .../opsu/objects/curves/CatmullCurve.java | 2 +- src/itdelatrisu/opsu/states/Game.java | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) rename src/itdelatrisu/opsu/{OsuTimingPoint.java => TimingPoint.java} (98%) diff --git a/src/itdelatrisu/opsu/OsuFile.java b/src/itdelatrisu/opsu/OsuFile.java index 388a8ef2..b1ee9b4f 100644 --- a/src/itdelatrisu/opsu/OsuFile.java +++ b/src/itdelatrisu/opsu/OsuFile.java @@ -168,7 +168,7 @@ public class OsuFile implements Comparable { */ /** All timing points. */ - public ArrayList timingPoints; + public ArrayList timingPoints; /** Song BPM range. */ public int bpmMin = 0, bpmMax = 0; @@ -363,7 +363,7 @@ public class OsuFile implements Comparable { 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 { * @param s the string */ public void timingPointsFromString(String s) { - this.timingPoints = new ArrayList(); + this.timingPoints = new ArrayList(); 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); } diff --git a/src/itdelatrisu/opsu/OsuParser.java b/src/itdelatrisu/opsu/OsuParser.java index 84fd475b..943d232d 100644 --- a/src/itdelatrisu/opsu/OsuParser.java +++ b/src/itdelatrisu/opsu/OsuParser.java @@ -201,7 +201,7 @@ public class OsuParser { */ private static OsuFile parseFile(File file, File dir, ArrayList osuFiles, boolean parseObjects) { OsuFile osu = new OsuFile(file); - osu.timingPoints = new ArrayList(); + osu.timingPoints = new ArrayList(); 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()) { diff --git a/src/itdelatrisu/opsu/OsuTimingPoint.java b/src/itdelatrisu/opsu/TimingPoint.java similarity index 98% rename from src/itdelatrisu/opsu/OsuTimingPoint.java rename to src/itdelatrisu/opsu/TimingPoint.java index be99b486..bce03408 100644 --- a/src/itdelatrisu/opsu/OsuTimingPoint.java +++ b/src/itdelatrisu/opsu/TimingPoint.java @@ -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 { diff --git a/src/itdelatrisu/opsu/objects/curves/CatmullCurve.java b/src/itdelatrisu/opsu/objects/curves/CatmullCurve.java index 11f53497..94944e13 100644 --- a/src/itdelatrisu/opsu/objects/curves/CatmullCurve.java +++ b/src/itdelatrisu/opsu/objects/curves/CatmullCurve.java @@ -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) { diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 72674b13..8efebb3e 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -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