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

@@ -440,7 +440,7 @@ public class BeatmapParser {
tokens[2] = tokens[2].replaceAll("^\"|\"$", "");
String ext = BeatmapParser.getExtension(tokens[2]);
if (ext.equals("jpg") || ext.equals("png"))
beatmap.bg = getDBString(tokens[2]);
beatmap.bg = new File(dir, getDBString(tokens[2]));
break;
case "2": // break periods
try {