Skip to content

Commit 687c1cc

Browse files
committed
Merge branch 'dev'
2 parents ca2d0a9 + b46850c commit 687c1cc

File tree

27 files changed

+425
-194
lines changed

27 files changed

+425
-194
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@
6262
"haxeTestExplorer.testCommand": [
6363
"haxelib", "run", "lime", "test", "tests/unit/project.xml", "cpp", "--haxelib=test-adapter"
6464
]
65-
}
65+
}

CHANGELOG.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
# 6.1.0 (Apr 28, 2025)
1+
### 6.1.1 (Oct 7, 2025)
2+
3+
#### Changes and improvements:
4+
- `FlxSignal`: Remove antiquated Hashlink workaround ([#3458](https://github.com/HaxeFlixel/flixel/pull/3458))
5+
- `FlxCollision`: Make result optional in `calcRectExit` ([#3448](https://github.com/HaxeFlixel/flixel/pull/3448))
6+
- `FlxCamera`: Honor alpha in `flash()` ([#3455](https://github.com/HaxeFlixel/flixel/pull/3455))
7+
- `FlxGame`: Update inputs before dispatching `FlxG.signals.preUpdate` ([#3442](https://github.com/HaxeFlixel/flixel/pull/3442))
8+
- `FlxTouchManager`: add null-safety ([#3440](https://github.com/HaxeFlixel/flixel/pull/3440))
9+
- `FlxCamera`: Improve error message when drawing a destroyed `FlxGraphic` ([#3417](https://github.com/HaxeFlixel/flixel/pull/3417))
10+
- `FlxCamera`: Remove references to unused `blending` variable ([#3467](https://github.com/HaxeFlixel/flixel/pull/3467))
11+
- `FlxText`: Improve pixel font support ([#3453](https://github.com/HaxeFlixel/flixel/pull/3453))
12+
- `FlxDrawQuadsItem`: Call `endFill()` after drawing ([#3462](https://github.com/HaxeFlixel/flixel/pull/3462))
13+
- `FlxFrame`: Update `uv` in `clip` method ([#3476](https://github.com/HaxeFlixel/flixel/pull/3476))
14+
- `FlxSignal`: Allow `destroy` during `dispatch` ([#3436](https://github.com/HaxeFlixel/flixel/pull/3436))
15+
- `FlxG.gamepads`: Extend PS4 mapping to work with PS5 ([#3380](https://github.com/HaxeFlixel/flixel/pull/3380))
16+
17+
#### Bugfixes:
18+
- `FlxCamera`: Honor `filter` changes when `active = false` ([#3481](https://github.com/HaxeFlixel/flixel/pull/3481))
19+
- `FlxUVRect`: Fix mixup of `right` and `top` fields ([#3475](https://github.com/HaxeFlixel/flixel/pull/3475))
20+
- `FlxCamera`: Fix `FlxStrip` disapearing on zoomed out cameras ([#3484](https://github.com/HaxeFlixel/flixel/pull/3484))
21+
- `FlxFrame`: Fix rotated frames not rendering on Hashlink ([#3454](https://github.com/HaxeFlixel/flixel/pull/3454))
22+
- `FlxSound`: Prevent paused sounds resuming on focus ([#3316](https://github.com/HaxeFlixel/flixel/pull/3316))
23+
- `FlxTilemap`: Fix debug draw when zoomed ([#3504](https://github.com/HaxeFlixel/flixel/pull/3504))
24+
25+
## 6.1.0 (Apr 28, 2025)
226

327
#### Changes and improvements:
428
- Various improvements to debug tools ([#3328](https://github.com/HaxeFlixel/flixel/pull/3328)) ([#3374](https://github.com/HaxeFlixel/flixel/pull/3374)) ([#3375](https://github.com/HaxeFlixel/flixel/pull/3375))
@@ -15,7 +39,7 @@
1539
- Refactor `Pointer`, `BitmapLog` and `Transform` windows
1640
- `Transform` debug tool: Improved scaling
1741
- `FlxGroup`: Inline group iterators ([#3362](https://github.com/HaxeFlixel/flixel/pull/3362))
18-
- `FlxFrame`: Imprive code readability with `UVRect` ([#3371](https://github.com/HaxeFlixel/flixel/pull/3371))
42+
- `FlxFrame`: Improve code readability with `UVRect` ([#3371](https://github.com/HaxeFlixel/flixel/pull/3371))
1943
- `FlxG.bitmap`: Query max texture size only once instead of every time it's needed ([#3369](https://github.com/HaxeFlixel/flixel/pull/3369))
2044
- `FlxSprite`: Allow changes to `clipRect` to take effect without the setter ([#3381](https://github.com/HaxeFlixel/flixel/pull/3381))
2145
- `FlxSoundTray`: Various improvements for extending classes ([#3378](https://github.com/HaxeFlixel/flixel/pull/3378))

flixel/FlxCamera.hx

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -579,14 +579,12 @@ class FlxCamera extends FlxBasic
579579
return startTrianglesBatch(graphic, smooth, colored, blend);
580580
#else
581581
var itemToReturn = null;
582-
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);
583582

584583
if (_currentDrawItem != null
585584
&& _currentDrawItem.type == FlxDrawItemType.TILES
586585
&& _headTiles.graphics == graphic
587586
&& _headTiles.colored == colored
588587
&& _headTiles.hasColorOffsets == hasColorOffsets
589-
&& _headTiles.blending == blendInt
590588
&& _headTiles.blend == blend
591589
&& _headTiles.antialiasing == smooth
592590
&& _headTiles.shader == shader)
@@ -608,13 +606,12 @@ class FlxCamera extends FlxBasic
608606

609607
// TODO: catch this error when the dev actually messes up, not in the draw phase
610608
if (graphic.isDestroyed)
611-
throw 'Attempted to queue an invalid FlxDrawItem, did you destroy a cached sprite?';
609+
throw 'Cannot queue ${graphic.key}. This sprite was destroyed.';
612610

613611
itemToReturn.graphics = graphic;
614612
itemToReturn.antialiasing = smooth;
615613
itemToReturn.colored = colored;
616614
itemToReturn.hasColorOffsets = hasColorOffsets;
617-
itemToReturn.blending = blendInt;
618615
itemToReturn.blend = blend;
619616
itemToReturn.shader = shader;
620617

@@ -640,14 +637,11 @@ class FlxCamera extends FlxBasic
640637
@:noCompletion
641638
public function startTrianglesBatch(graphic:FlxGraphic, smoothing:Bool = false, isColored:Bool = false, ?blend:BlendMode, ?hasColorOffsets:Bool, ?shader:FlxShader):FlxDrawTrianglesItem
642639
{
643-
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);
644-
645640
if (_currentDrawItem != null
646641
&& _currentDrawItem.type == FlxDrawItemType.TRIANGLES
647642
&& _headTriangles.graphics == graphic
648643
&& _headTriangles.antialiasing == smoothing
649644
&& _headTriangles.colored == isColored
650-
&& _headTriangles.blending == blendInt
651645
&& _headTriangles.blend == blend
652646
#if !flash
653647
&& _headTriangles.hasColorOffsets == hasColorOffsets
@@ -665,7 +659,6 @@ class FlxCamera extends FlxBasic
665659
public function getNewDrawTrianglesItem(graphic:FlxGraphic, smoothing:Bool = false, isColored:Bool = false, ?blend:BlendMode, ?hasColorOffsets:Bool, ?shader:FlxShader):FlxDrawTrianglesItem
666660
{
667661
var itemToReturn:FlxDrawTrianglesItem = null;
668-
var blendInt:Int = FlxDrawBaseItem.blendToInt(blend);
669662

670663
if (_storageTrianglesHead != null)
671664
{
@@ -682,7 +675,6 @@ class FlxCamera extends FlxBasic
682675
itemToReturn.graphics = graphic;
683676
itemToReturn.antialiasing = smoothing;
684677
itemToReturn.colored = isColored;
685-
itemToReturn.blending = blendInt;
686678
itemToReturn.blend = blend;
687679
#if !flash
688680
itemToReturn.hasColorOffsets = hasColorOffsets;
@@ -743,6 +735,8 @@ class FlxCamera extends FlxBasic
743735
@:allow(flixel.system.frontEnds.CameraFrontEnd)
744736
function render():Void
745737
{
738+
flashSprite.filters = filtersEnabled ? filters : null;
739+
746740
var currItem:FlxDrawBaseItem<Dynamic> = _headOfDrawStack;
747741
while (currItem != null)
748742
{
@@ -830,13 +824,13 @@ class FlxCamera extends FlxBasic
830824
public function drawTriangles(graphic:FlxGraphic, vertices:DrawData<Float>, indices:DrawData<Int>, uvtData:DrawData<Float>, ?colors:DrawData<Int>,
831825
?position:FlxPoint, ?blend:BlendMode, repeat:Bool = false, smoothing:Bool = false, ?transform:ColorTransform, ?shader:FlxShader):Void
832826
{
827+
final cameraBounds = _bounds.set(viewMarginLeft, viewMarginTop, viewWidth, viewHeight);
828+
833829
if (FlxG.renderBlit)
834830
{
835831
if (position == null)
836832
position = renderPoint.set();
837833

838-
_bounds.set(0, 0, width, height);
839-
840834
var verticesLength:Int = vertices.length;
841835
var currentVertexPosition:Int = 0;
842836

@@ -867,7 +861,7 @@ class FlxCamera extends FlxBasic
867861

868862
position.putWeak();
869863

870-
if (!_bounds.overlaps(bounds))
864+
if (!cameraBounds.overlaps(bounds))
871865
{
872866
drawVertices.splice(drawVertices.length - verticesLength, verticesLength);
873867
}
@@ -905,17 +899,16 @@ class FlxCamera extends FlxBasic
905899
}
906900
else
907901
{
908-
_bounds.set(0, 0, width, height);
909902
var isColored:Bool = (colors != null && colors.length != 0);
910903

911904
#if !flash
912905
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());
913906
isColored = isColored || (transform != null && transform.hasRGBMultipliers());
914907
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend, hasColorOffsets, shader);
915-
drawItem.addTriangles(vertices, indices, uvtData, colors, position, _bounds, transform);
908+
drawItem.addTriangles(vertices, indices, uvtData, colors, position, cameraBounds, transform);
916909
#else
917910
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend);
918-
drawItem.addTriangles(vertices, indices, uvtData, colors, position, _bounds);
911+
drawItem.addTriangles(vertices, indices, uvtData, colors, position, cameraBounds);
919912
#end
920913
}
921914
}
@@ -1106,7 +1099,7 @@ class FlxCamera extends FlxBasic
11061099
_helperPoint = null;
11071100
}
11081101

1109-
_bounds = null;
1102+
_bounds = FlxDestroyUtil.put(_bounds);
11101103
scroll = FlxDestroyUtil.put(scroll);
11111104
targetOffset = FlxDestroyUtil.put(targetOffset);
11121105
deadzone = FlxDestroyUtil.put(deadzone);
@@ -1139,8 +1132,6 @@ class FlxCamera extends FlxBasic
11391132
updateFlash(elapsed);
11401133
updateFade(elapsed);
11411134

1142-
flashSprite.filters = filtersEnabled ? filters : null;
1143-
11441135
updateFlashSpritePosition();
11451136
updateShake(elapsed);
11461137
}
@@ -1707,7 +1698,7 @@ class FlxCamera extends FlxBasic
17071698
}
17081699
else
17091700
{
1710-
final alpha = color.alphaFloat * _fxFlashAlpha;
1701+
final alpha = _fxFlashColor.alphaFloat * _fxFlashAlpha;
17111702
fill(_fxFlashColor.rgb, true, alpha, canvas.graphics);
17121703
}
17131704
}

flixel/FlxG.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class FlxG
100100
* The HaxeFlixel version, in semantic versioning syntax. Use `Std.string()`
101101
* on it to get a `String` formatted like this: `"HaxeFlixel MAJOR.MINOR.PATCH-COMMIT_SHA"`.
102102
*/
103-
public static var VERSION(default, null):FlxVersion = new FlxVersion(6, 1, 0);
103+
public static final VERSION = new FlxVersion(6, 1, 1);
104104

105105
/**
106106
* Internal tracker for game object.

flixel/FlxGame.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,9 @@ class FlxGame extends Sprite
681681

682682
updateElapsed();
683683

684-
FlxG.signals.preUpdate.dispatch();
685-
686684
updateInput();
685+
686+
FlxG.signals.preUpdate.dispatch();
687687

688688
#if FLX_SOUND_SYSTEM
689689
FlxG.sound.update(FlxG.elapsed);

flixel/FlxObject.hx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,10 +1246,25 @@ class FlxObject extends FlxBasic
12461246
if (!camera.visible || !camera.exists || !isOnScreen(camera))
12471247
return;
12481248

1249-
var rect = getBoundingBox(camera);
1250-
var gfx:Graphics = beginDrawDebug(camera);
1251-
drawDebugBoundingBox(gfx, rect, allowCollisions, immovable);
1252-
endDrawDebug(camera);
1249+
final rect = getBoundingBox(camera);
1250+
if (FlxG.renderTile)
1251+
{
1252+
final PAD = 2;
1253+
final view = camera.getViewMarginRect();
1254+
view.left -= PAD;
1255+
view.top -= PAD;
1256+
view.right += PAD;
1257+
view.bottom += PAD;
1258+
rect.clipTo(view);
1259+
view.put();
1260+
}
1261+
1262+
if (rect.width > 0 && rect.height > 0)
1263+
{
1264+
final gfx = beginDrawDebug(camera);
1265+
drawDebugBoundingBox(gfx, rect, allowCollisions, immovable);
1266+
endDrawDebug(camera);
1267+
}
12531268
}
12541269

12551270
function drawDebugBoundingBox(gfx:Graphics, rect:FlxRect, allowCollisions:FlxDirectionFlags, partial:Bool)
@@ -1277,7 +1292,7 @@ class FlxObject extends FlxBasic
12771292
function drawDebugBoundingBoxColor(gfx:Graphics, rect:FlxRect, color:FlxColor)
12781293
{
12791294
// fill static graphics object with square shape
1280-
gfx.lineStyle(1, color, 0.75);
1295+
gfx.lineStyle(1, color, 0.75, false, null, null, MITER, 255);
12811296
gfx.drawRect(rect.x + 0.5, rect.y + 0.5, rect.width - 1.0, rect.height - 1.0);
12821297
}
12831298

flixel/FlxSprite.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class FlxSprite extends FlxObject
267267
public var color(default, set):FlxColor = FlxColor.WHITE;
268268

269269
/**
270-
* The color effects of this sprite, changes to `color` or `alplha` will be reflected here
270+
* The color effects of this sprite, changes to `color` or `alpha` will be reflected here
271271
*/
272272
public var colorTransform(default, null) = new ColorTransform();
273273

flixel/graphics/frames/FlxFrame.hx

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ class FlxFrame implements IFlxDestroyable
663663
cacheFrameMatrix();
664664
}
665665

666+
updateUV();
667+
666668
frameRect.put();
667669
return this;
668670
}
@@ -717,15 +719,21 @@ class FlxFrame implements IFlxDestroyable
717719

718720
function set_frame(value:FlxRect):FlxRect
719721
{
720-
if (value != null)
721-
{
722-
if (uv == null)
723-
uv = FlxUVRect.get();
724-
725-
uv.set(value.x / parent.width, value.y / parent.height, value.right / parent.width, value.bottom / parent.height);
726-
}
722+
frame = value;
723+
updateUV();
724+
725+
return value;
726+
}
727+
728+
function updateUV()
729+
{
730+
if (frame == null)
731+
return;
732+
733+
if (uv == null)
734+
uv = FlxUVRect.get();
727735

728-
return frame = value;
736+
uv.setFromFrameRect(frame, parent);
729737
}
730738
}
731739

@@ -761,13 +769,13 @@ abstract FlxUVRect(FlxRect) from FlxRect to flixel.util.FlxPool.IFlxPooled
761769

762770
/** Top */
763771
public var right(get, set):Float;
764-
inline function get_right():Float { return this.y; }
765-
inline function set_right(value):Float { return this.y = value; }
772+
inline function get_right():Float { return this.width; }
773+
inline function set_right(value):Float { return this.width = value; }
766774

767775
/** Right */
768776
public var top(get, set):Float;
769-
inline function get_top():Float { return this.width; }
770-
inline function set_top(value):Float { return this.width = value; }
777+
inline function get_top():Float { return this.y; }
778+
inline function set_top(value):Float { return this.y = value; }
771779

772780
/** Bottom */
773781
public var bottom(get, set):Float;
@@ -779,6 +787,11 @@ abstract FlxUVRect(FlxRect) from FlxRect to flixel.util.FlxPool.IFlxPooled
779787
this.set(l, t, r, b);
780788
}
781789

790+
public inline function setFromFrameRect(frame:FlxRect, parent:FlxGraphic)
791+
{
792+
this.set(frame.x / parent.width, frame.y / parent.height, frame.right / parent.width, frame.bottom / parent.height);
793+
}
794+
782795
public inline function copyTo(uv:FlxUVRect)
783796
{
784797
uv.set(left, top, right, bottom);
@@ -789,6 +802,16 @@ abstract FlxUVRect(FlxRect) from FlxRect to flixel.util.FlxPool.IFlxPooled
789802
set(uv.left, uv.top, uv.right, uv.bottom);
790803
}
791804

805+
public inline function toString()
806+
{
807+
return return FlxStringUtil.getDebugString([
808+
LabelValuePair.weak("l", left),
809+
LabelValuePair.weak("t", top),
810+
LabelValuePair.weak("r", right),
811+
LabelValuePair.weak("b", bottom)
812+
]);
813+
}
814+
792815
public static function get(l = 0.0, t = 0.0, r = 0.0, b = 0.0)
793816
{
794817
return FlxRect.get(l, t, r, b);
@@ -842,7 +865,7 @@ abstract MatrixVector(Vector<Float>)
842865
ty = 0;
843866
}
844867

845-
public inline function set(a = 1.0, b = 0.0, c = 0.0, d = 1.0, tx = 0.0, ty = 0.0)
868+
public #if !hl inline #end function set(a = 1.0, b = 0.0, c = 0.0, d = 1.0, tx = 0.0, ty = 0.0)
846869
{
847870
set_a(a);
848871
set_b(b);
@@ -914,4 +937,4 @@ abstract MatrixVector(Vector<Float>)
914937
mat.ty = ty;
915938
return mat;
916939
}
917-
}
940+
}

flixel/graphics/tile/FlxDrawBaseItem.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class FlxDrawBaseItem<T>
1616
*/
1717
public static var drawCalls:Int = 0;
1818

19+
@:noCompletion
20+
@:deprecated("blendToInt() is deprecated, remove all references to it")
1921
public static function blendToInt(blend:BlendMode):Int
2022
{
2123
return 0; // no blend mode support in drawQuads()
@@ -29,9 +31,12 @@ class FlxDrawBaseItem<T>
2931
public var antialiasing:Bool = false;
3032
public var colored:Bool = false;
3133
public var hasColorOffsets:Bool = false;
32-
public var blending:Int = 0;
3334
public var blend:BlendMode;
3435

36+
@:noCompletion
37+
@:deprecated("blending is deprecated, remove all references to it")
38+
public var blending:Int = 0;
39+
3540
public var type:FlxDrawItemType;
3641

3742
public var numVertices(get, never):Int;

flixel/graphics/tile/FlxDrawQuadsItem.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class FlxDrawQuadsItem extends FlxDrawBaseItem<FlxDrawQuadsItem>
136136
camera.canvas.graphics.overrideBlendMode(blend);
137137
camera.canvas.graphics.beginShaderFill(shader);
138138
camera.canvas.graphics.drawQuads(rects, null, transforms);
139+
camera.canvas.graphics.endFill();
139140
super.render(camera);
140141
}
141142

@@ -146,4 +147,4 @@ class FlxDrawQuadsItem extends FlxDrawBaseItem<FlxDrawQuadsItem>
146147
parameter.value[0] = value;
147148
}
148149
#end
149-
}
150+
}

0 commit comments

Comments
 (0)