Removed some unnecessary SlickException throwing/catching.

Mostly leftovers from moving Image creation to GameImage.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-21 18:56:53 -05:00
parent e02cf60312
commit d6c7476b88
7 changed files with 81 additions and 85 deletions

View File

@@ -29,7 +29,6 @@ import itdelatrisu.opsu.states.Game;
import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
/**
* Data type representing a circle object.
@@ -64,9 +63,8 @@ public class Circle implements HitObject {
* Initializes the Circle data type with map modifiers, images, and dimensions.
* @param container the game container
* @param circleSize the map's circleSize value
* @throws SlickException
*/
public static void init(GameContainer container, float circleSize) throws SlickException {
public static void init(GameContainer container, float circleSize) {
int diameter = (int) (96 - (circleSize * 8));
diameter = diameter * container.getWidth() / 640; // convert from Osupixels (640x480)
GameImage.HITCIRCLE.setImage(GameImage.HITCIRCLE.getImage().getScaledCopy(diameter, diameter));

View File

@@ -32,7 +32,6 @@ import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
/**
* Data type representing a slider object.
@@ -273,9 +272,8 @@ public class Slider implements HitObject {
* @param container the game container
* @param circleSize the map's circleSize value
* @param osu the associated OsuFile object
* @throws SlickException
*/
public static void init(GameContainer container, float circleSize, OsuFile osu) throws SlickException {
public static void init(GameContainer container, float circleSize, OsuFile osu) {
int diameter = (int) (96 - (circleSize * 8));
diameter = diameter * container.getWidth() / 640; // convert from Osupixels (640x480)

View File

@@ -32,7 +32,6 @@ import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
/**
* Data type representing a spinner object.
@@ -71,17 +70,10 @@ public class Spinner implements HitObject {
/**
* Initializes the Spinner data type with images and dimensions.
* @param container the game container
* @throws SlickException
*/
public static void init(GameContainer container) throws SlickException {
public static void init(GameContainer container) {
width = container.getWidth();
height = container.getHeight();
Image spinnerCircle = GameImage.SPINNER_CIRCLE.getImage();
GameImage.SPINNER_CIRCLE.setImage(spinnerCircle.getScaledCopy(height * 9 / 10, height * 9 / 10));
GameImage.SPINNER_APPROACHCIRCLE.setImage(GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(
spinnerCircle.getWidth(), spinnerCircle.getHeight()));
GameImage.SPINNER_METRE.setImage(GameImage.SPINNER_METRE.getImage().getScaledCopy(width, height));
}
/**
@@ -109,7 +101,7 @@ public class Spinner implements HitObject {
boolean spinnerComplete = (rotations >= rotationsNeeded);
// TODO: draw "OSU!" image after spinner ends
//spinnerOsuImage.drawCentered(width / 2, height / 4);
//GameImage.SPINNER_OSU.getImage().drawCentered(width / 2, height / 4);
// darken screen
g.setColor(Utils.COLOR_BLACK_ALPHA);