From 156d52f8c83a54d5814f721fe6cdc6d5631204f7 Mon Sep 17 00:00:00 2001 From: yugecin Date: Tue, 20 Dec 2016 00:40:51 +0100 Subject: [PATCH] cleanup --- src/itdelatrisu/opsu/beatmap/BeatmapParser.java | 9 +-------- src/itdelatrisu/opsu/states/SongMenu.java | 9 ++++++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java index 59d20639..37bbb60e 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapParser.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapParser.java @@ -225,8 +225,7 @@ public class BeatmapParser { } try ( InputStream bis = new BufferedInputStream(new FileInputStream(map.getFile())); - MD5InputStreamWrapper md5stream = (!hasNoMD5Algorithm) ? new MD5InputStreamWrapper(bis) : null; - BufferedReader in = new BufferedReader(new InputStreamReader((md5stream != null) ? md5stream : bis, "UTF-8")); + BufferedReader in = new BufferedReader(new InputStreamReader(bis, "UTF-8")); ) { String line; boolean found = false; @@ -249,12 +248,6 @@ public class BeatmapParser { map.timingPoints.trimToSize(); } catch (IOException e) { ErrorHandler.error(String.format("Failed to read file '%s'.", map.getFile().getAbsolutePath()), e, false); - } catch (NoSuchAlgorithmException e) { - ErrorHandler.error("Failed to get MD5 hash stream.", e, true); - - // retry without MD5 - hasNoMD5Algorithm = true; - parseOnlyTimingPoints(map); } } diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 51bf534b..df46742b 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -262,6 +262,9 @@ public class SongMenu extends BasicGameState { /** Footer pulsing logo button. */ private MenuButton footerLogoButton; + /** Size of the footer pulsing logo. */ + private float footerLogoSize; + /** Whether the cursor hovers over the footer logo. */ private boolean bottomLogoHovered; @@ -343,8 +346,9 @@ public class SongMenu extends BasicGameState { // logo coordinates float footerHeight = height - footerY; + footerLogoSize = footerHeight * 3.25f; Image logo = GameImage.MENU_LOGO.getImage(); - logo = logo.getScaledCopy(footerHeight * 3.25f / logo.getWidth()); + logo = logo.getScaledCopy(footerLogoSize / logo.getWidth()); footerLogoButton = new MenuButton(logo, width - footerHeight * 0.8f, height - footerHeight * 0.65f); footerLogoButton.setHoverAnimationDuration(1); footerLogoButton.setHoverExpand(1.4f); @@ -523,8 +527,7 @@ public class SongMenu extends BasicGameState { float expand = position * 0.15f; footerLogoButton.draw(Color.white, 1f - expand); Image ghostLogo = GameImage.MENU_LOGO.getImage(); - ghostLogo = ghostLogo.getScaledCopy((height - footerY) * 3.25f / ghostLogo.getWidth()); - ghostLogo = ghostLogo.getScaledCopy(1f + expand); + ghostLogo = ghostLogo.getScaledCopy((1f + expand) * footerLogoSize / ghostLogo.getWidth()); float scaleposmodx = ghostLogo.getWidth() / 2; float scaleposmody = ghostLogo.getHeight() / 2; float a = Colors.GHOST_LOGO.a;