@@ -16,6 +16,8 @@ import funkin.backend.utils.XMLUtil.AnimData;
1616import funkin .backend .utils .XMLUtil .BeatAnim ;
1717import funkin .backend .utils .XMLUtil .IXMLEvents ;
1818import haxe .io .Path ;
19+ import flixel .graphics .frames .FlxFrame ;
20+ import flixel .math .FlxAngle ;
1921
2022enum abstract XMLAnimType (Int )
2123{
@@ -373,4 +375,46 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
373375 animation .curAnim .curFrame = val ;
374376 return val ;
375377 }
378+
379+ override function drawComplex (camera : FlxCamera ): Void
380+ {
381+ #if (flixel < "6.1.0") final frame = this ._frame ; #end
382+ final matrix = this ._matrix ; // TODO: Just use local?
383+
384+ frame .prepareMatrix (matrix , FlxFrameAngle .ANGLE_0 , checkFlipX () != camera .flipX , checkFlipY () != camera .flipY );
385+ matrix .translate (- origin .x , - origin .y );
386+
387+ if (frameOffsetAngle != null && frameOffsetAngle != angle )
388+ {
389+ var angleOff = (frameOffsetAngle - angle ) * FlxAngle .TO_RAD ;
390+ var cos = Math .cos (angleOff );
391+ var sin = Math .sin (angleOff );
392+ // cos doesnt need to be negated
393+ _matrix .rotateWithTrig (cos , - sin );
394+ _matrix .translate (- frameOffset .x , - frameOffset .y );
395+ _matrix .rotateWithTrig (cos , sin );
396+ }
397+ else
398+ _matrix .translate (- frameOffset .x , - frameOffset .y );
399+
400+ matrix .scale (scale .x , scale .y );
401+ if (bakedRotationAngle <= 0 )
402+ {
403+ updateTrig ();
404+ if (angle != 0 )
405+ matrix .rotateWithTrig (_cosAngle , _sinAngle );
406+ }
407+ if (skew .x != 0 || skew .y != 0 )
408+ {
409+ updateSkew ();
410+ _matrix .concat (FlxAnimate ._skewMatrix );
411+ }
412+ getScreenPosition (_point , camera );
413+ _point .x + = origin .x - offset .x ;
414+ _point .y + = origin .y - offset .y ;
415+ matrix .translate (_point .x , _point .y );
416+ if (isPixelPerfectRender (camera ))
417+ preparePixelPerfectMatrix (matrix );
418+ camera .drawPixels (frame , framePixels , matrix , colorTransform , blend , antialiasing , shader );
419+ }
376420}
0 commit comments