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

@@ -680,9 +680,8 @@ public class Options {
* If the configured resolution is larger than the screen size, the smallest
* available resolution will be used.
* @param app the game container
* @throws SlickException failure to set display mode
*/
public static void setDisplayMode(Container app) throws SlickException {
public static void setDisplayMode(Container app) {
int screenWidth = app.getScreenWidth();
int screenHeight = app.getScreenHeight();
@@ -690,7 +689,11 @@ public class Options {
if (screenWidth < resolution.getWidth() || screenHeight < resolution.getHeight())
resolution = Resolution.RES_800_600;
app.setDisplayMode(resolution.getWidth(), resolution.getHeight(), false);
try {
app.setDisplayMode(resolution.getWidth(), resolution.getHeight(), false);
} catch (SlickException e) {
ErrorHandler.error("Failed to set display mode.", e, true);
}
// set borderless window if dimensions match screen size
boolean borderless = (screenWidth == resolution.getWidth() && screenHeight == resolution.getHeight());