Code style cleanup from #12.
- Moved all curve-related classes into a new package. - Added some fields and methods to Curve abstract class. - Removed the old (no longer used) Bezier subclass. - Changed Error throwing to ErrorHandler.error() calls. - Formatted code. Also fixed a crash when reaching the ranking screen with the "Auto" mod active. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -104,17 +104,26 @@ public class OsuHitObject {
|
||||
public static void init(int width, int height) {
|
||||
int swidth = width;
|
||||
int sheight = height;
|
||||
if(swidth*3>sheight*4){
|
||||
swidth = sheight*4/3;
|
||||
}else{
|
||||
sheight = swidth*3/4;
|
||||
}
|
||||
xMultiplier = swidth / 640f; //(width * 1f) / MAX_X; // width * MAX_X/800f / MAX_X
|
||||
yMultiplier = sheight / 480f;//(height * 1f) / MAX_Y;
|
||||
xOffset = (int)(width - MAX_X * xMultiplier)/2 ;//width / 5; 800-512/2
|
||||
yOffset = (int)(height - MAX_Y * yMultiplier)/2 ;//height / 5;
|
||||
if (swidth * 3 > sheight * 4)
|
||||
swidth = sheight * 4 / 3;
|
||||
else
|
||||
sheight = swidth * 3 / 4;
|
||||
xMultiplier = swidth / 640f;
|
||||
yMultiplier = sheight / 480f;
|
||||
xOffset = (int) (width - MAX_X * xMultiplier) / 2;
|
||||
yOffset = (int) (height - MAX_Y * yMultiplier) / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the X multiplier for coordinates.
|
||||
*/
|
||||
public static float getXMultiplier() { return xMultiplier; }
|
||||
|
||||
/**
|
||||
* Returns the Y multiplier for coordinates.
|
||||
*/
|
||||
public static float getYMultiplier() { return yMultiplier; }
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param line the line to be parsed
|
||||
@@ -287,11 +296,4 @@ public class OsuHitObject {
|
||||
* @return true if new combo
|
||||
*/
|
||||
public boolean isNewCombo() { return (type & TYPE_NEWCOMBO) > 0; }
|
||||
/**
|
||||
* Returns the multiplier for coordinates
|
||||
* @return
|
||||
*/
|
||||
public static float getMultiplier() {
|
||||
return xMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user