Skip to content

Commit

Permalink
fix broken transition exit animation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Apr 10, 2024
1 parent d610b69 commit 31d5b85
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/funkin/states/MusicBeatState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class MusicBeatState extends FlxUIState implements IMusicGetter {
ModdingUtil.addCall('stateCreate');
}

if (Main.transition != null)
Main.transition.exitTrans();
if (Main.transition != null) // Make sure it runs after all of create is loaded in
FlxG.signals.postUpdate.addOnce(() -> Main.transition.exitTrans());
}

// Only for backwards compatibility
Expand Down
7 changes: 7 additions & 0 deletions source/funkin/util/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ class CoolUtil {

gc(true);
}

inline public static function enableGc(enable:Bool = true)
{
#if (cpp || hl)
Gc.enable(enable);
#end
}

inline public static function gc(major:Bool = false) {
#if (cpp || hl || neko)
Expand Down
3 changes: 3 additions & 0 deletions source/funkin/util/backend/AssetManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ class AssetManager
}
}

CoolUtil.enableGc(false);

if (stageImages.length > 0)
FunkThread.run(() -> cacheImages(stageImages));

Expand Down Expand Up @@ -305,6 +307,7 @@ class AssetManager
sounds.clear();
sounds = null;

CoolUtil.enableGc(true);
CoolUtil.gc(true);

if (onComplete != null)
Expand Down

0 comments on commit 31d5b85

Please sign in to comment.