Specify whether Curve uses scaled or unscaled coordinates.
Unscaled coordinates will be used in a future commit (hopefully). Added a normalize() method to Vec2f. Throw RuntimeExceptions for any Curve initialization errors; the game would crash anyway, and this way the objects can be substituted for DummyObjects for a graceful failure. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -64,13 +64,21 @@ public abstract class Curve {
|
||||
/**
|
||||
* Constructor.
|
||||
* @param hitObject the associated HitObject
|
||||
* @param scaled whether to use scaled coordinates
|
||||
*/
|
||||
protected Curve(HitObject hitObject) {
|
||||
protected Curve(HitObject hitObject, boolean scaled) {
|
||||
this.hitObject = hitObject;
|
||||
this.x = hitObject.getScaledX();
|
||||
this.y = hitObject.getScaledY();
|
||||
this.sliderX = hitObject.getScaledSliderX();
|
||||
this.sliderY = hitObject.getScaledSliderY();
|
||||
if (scaled) {
|
||||
this.x = hitObject.getScaledX();
|
||||
this.y = hitObject.getScaledY();
|
||||
this.sliderX = hitObject.getScaledSliderX();
|
||||
this.sliderY = hitObject.getScaledSliderY();
|
||||
} else {
|
||||
this.x = hitObject.getX();
|
||||
this.y = hitObject.getY();
|
||||
this.sliderX = hitObject.getSliderX();
|
||||
this.sliderY = hitObject.getSliderY();
|
||||
}
|
||||
this.renderState = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user