Skip to content

Commit

Permalink
remove some unnecesary reflect calls
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed May 13, 2024
1 parent 2bdc5b3 commit bb9e291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/funkin/graphics/FlxSpriteExt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class FlxSpriteExt extends FlxSkewedSprite
updateAnimation(elapsed);

if (_dynamic.update != null)
Reflect.callMethod(null, _dynamic.update, [elapsed]);
_dynamic.update(elapsed);

#if FLX_DEBUG
FlxBasic.activeCount++;
Expand Down
8 changes: 5 additions & 3 deletions source/funkin/substates/MusicBeatSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ class MusicBeatSubstate extends FlxSubState implements IMusicGetter
if (createMusic) add(musicBeat = new MusicBeat(this));
}

public var _update:Dynamic = null;
override function update(elapsed:Float) {
public var _update:(Float)->Void;

override function update(elapsed:Float)
{
ModdingUtil.addCall('subStateUpdate', [elapsed]);
if (_update != null) Reflect.callMethod(null, _update, [elapsed]);
if (_update != null) _update(elapsed);
super.update(elapsed);
}

Expand Down

0 comments on commit bb9e291

Please sign in to comment.