Skip to content

Commit

Permalink
Add blend mode support for flxanimate
Browse files Browse the repository at this point in the history
  • Loading branch information
NeeEoo committed Dec 27, 2024
1 parent e2a3951 commit 17cc888
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion art/generateDoc.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@ECHO OFF
cd ..
echo Building Game...
lime build windows --haxeflag="--macro include('scripting')" --haxeflag="-xml docs/doc.xml" -D DOCUMENTATION --no-output
lime build windows --haxeflag="-xml docs/doc.xml" -D doc-gen -D DOCUMENTATION --no-output
echo art

echo Generated the api xml file at docs/doc.xml
Expand Down
9 changes: 7 additions & 2 deletions source/funkin/backend/FlxAnimate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import flixel.math.FlxAngle;
import flixel.math.FlxRect;
import flixel.graphics.frames.FlxFrame;
import flixel.math.FlxPoint;
import openfl.display.BlendMode;

class FlxAnimate extends flxanimate.FlxAnimate {
static var rMatrix = new FlxMatrix();

override function drawLimb(limb:FlxFrame, _rMatrix:FlxMatrix, ?colorTransform:ColorTransform)
override function drawLimb(limb:FlxFrame, _rMatrix:FlxMatrix, ?colorTransform:ColorTransform, ?blendMode:BlendMode)
{
if (alpha == 0 || colorTransform != null && (colorTransform.alphaMultiplier == 0 || colorTransform.alphaOffset == -255) || limb == null || limb.type == EMPTY)
return;

if (blendMode != null)
blendMode = BlendMode.NORMAL;

for (camera in cameras)
{
rMatrix.identity();
Expand Down Expand Up @@ -69,7 +74,7 @@ class FlxAnimate extends flxanimate.FlxAnimate {
}

rMatrix.translate(_point.x, _point.y);
camera.drawPixels(limb, null, rMatrix, colorTransform, blend, antialiasing, shaderEnabled ? shader : null);
camera.drawPixels(limb, null, rMatrix, colorTransform, blendMode, antialiasing, shaderEnabled ? shader : null);
#if FLX_DEBUG
FlxBasic.visibleCount++;
#end
Expand Down

0 comments on commit 17cc888

Please sign in to comment.