Enabled application restarts.
- Pressing Ctrl+Shift+F5 in the options menu restarts the game. Beatmaps and sounds are not reloaded. - Use GameContainer.setForceExit(false) to trigger a restart after exiting. Other changes: - Fixed general issues with track pausing/pause states. - Store all background images loaded in OsuFiles in a static hash table, instead of in individual objects. This allows easier access to the allocated memory. - Only delete OSZ files if they were unzipped. (They were previously deleted in all cases.) - Moved more images (mods, playfield, lighting) into GameImage. - Moved OsuHitObject initialization inside Utils. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -217,6 +217,9 @@ public class Utils {
|
||||
for (SongSort sort : SongSort.values())
|
||||
sort.init(width, height);
|
||||
|
||||
// initialize hit objects
|
||||
OsuHitObject.init(width, height);
|
||||
|
||||
// back button
|
||||
Image back = GameImage.MENU_BACK.getImage();
|
||||
backButton = new MenuButton(back,
|
||||
@@ -316,11 +319,11 @@ public class Utils {
|
||||
*/
|
||||
public static void loadCursor() throws SlickException {
|
||||
// destroy old cursors, if they exist
|
||||
if (cursor != null)
|
||||
if (cursor != null && !cursor.isDestroyed())
|
||||
cursor.destroy();
|
||||
if (cursorTrail != null)
|
||||
if (cursorTrail != null && !cursorTrail.isDestroyed())
|
||||
cursorTrail.destroy();
|
||||
if (cursorMiddle != null)
|
||||
if (cursorMiddle != null && !cursorMiddle.isDestroyed())
|
||||
cursorMiddle.destroy();
|
||||
cursor = cursorTrail = cursorMiddle = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user