From bb9e291324e27f684a7db56f7df413cb4ef141c5 Mon Sep 17 00:00:00 2001 From: MaybeMaru <97055307+MaybeMaru@users.noreply.github.com> Date: Tue, 14 May 2024 00:30:43 +0200 Subject: [PATCH] remove some unnecesary reflect calls --- source/funkin/graphics/FlxSpriteExt.hx | 2 +- source/funkin/substates/MusicBeatSubstate.hx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/funkin/graphics/FlxSpriteExt.hx b/source/funkin/graphics/FlxSpriteExt.hx index b61301d9..d5298d54 100644 --- a/source/funkin/graphics/FlxSpriteExt.hx +++ b/source/funkin/graphics/FlxSpriteExt.hx @@ -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++; diff --git a/source/funkin/substates/MusicBeatSubstate.hx b/source/funkin/substates/MusicBeatSubstate.hx index 143aa371..25a803d0 100644 --- a/source/funkin/substates/MusicBeatSubstate.hx +++ b/source/funkin/substates/MusicBeatSubstate.hx @@ -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); }