Switch to a LRU cache for beatmap background images.

Created a separate BeatmapImageCache class to handle cache operations.  The cache now uses File objects as keys, rather than Beatmap objects (which was buggy).

Also renamed "OsuHitObjectResult" helper class to "HitObjectResult".

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-06-09 03:10:44 -04:00
parent 74f7ac18b9
commit 92f4a5176d
6 changed files with 113 additions and 53 deletions

View File

@@ -335,7 +335,7 @@ public class BeatmapDB {
stmt.setBoolean(33, beatmap.letterboxInBreaks);
stmt.setBoolean(34, beatmap.widescreenStoryboard);
stmt.setBoolean(35, beatmap.epilepsyWarning);
stmt.setString(36, beatmap.bg);
stmt.setString(36, beatmap.bg.getName());
stmt.setString(37, beatmap.sliderBorderToString());
stmt.setString(38, beatmap.timingPointsToString());
stmt.setString(39, beatmap.breaksToString());
@@ -476,7 +476,7 @@ public class BeatmapDB {
beatmap.letterboxInBreaks = rs.getBoolean(33);
beatmap.widescreenStoryboard = rs.getBoolean(34);
beatmap.epilepsyWarning = rs.getBoolean(35);
beatmap.bg = BeatmapParser.getDBString(rs.getString(36));
beatmap.bg = new File(beatmap.getFile().getParentFile(), BeatmapParser.getDBString(rs.getString(36)));
beatmap.sliderBorderFromString(rs.getString(37));
} catch (SQLException e) {
throw e;