Skip to content

Commit f642a23

Browse files
committed
Merge branch 'dev'
2 parents 687c1cc + 22008f3 commit f642a23

File tree

21 files changed

+665
-319
lines changed

21 files changed

+665
-319
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### 6.1.2 (December 6, 2025)
2+
3+
#### Changes and improvements:
4+
- `FlxG.Assets`: Check any sound extension before appending in `getSoundAddExt` ([#3511](https://github.com/HaxeFlixel/flixel/pull/3511))
5+
- `FlxCamera`: Honor color transformation in `drawTriangles` on `renderBlit` targets ([#3503](https://github.com/HaxeFlixel/flixel/pull/3503))
6+
- `FlxInputText`: Honor `selectionColor.alphaFloat` ([#3491](https://github.com/HaxeFlixel/flixel/pull/3491))
7+
- `FlxGraphicsShader`: Remove redundant body glsl ([#3512](https://github.com/HaxeFlixel/flixel/pull/3512))
8+
- `BaseScaleMode`: Add `setGlobalSize` to allow derived classes to modify `FlxG.width` / `height` ([#3516](https://github.com/HaxeFlixel/flixel/pull/3516))
9+
- `FlxG`: query maxTextureSize when window is created ([#3522](https://github.com/HaxeFlixel/flixel/pull/3522))
10+
- `FlxCallbackPoint`: Fix duplicate calls and call xy whenever x or y is set directly ([#3524](https://github.com/HaxeFlixel/flixel/pull/3524))
11+
12+
#### Bugfixes:
13+
- `FlxDebugger`: Fixed watch window position ([#3506](https://github.com/HaxeFlixel/flixel/pull/3506))
14+
- `FlxCamera`: Fix filter memory leak ([#3459](https://github.com/HaxeFlixel/flixel/pull/3459))
15+
- `FlxTilemap`: Fix tilemap debug drawing on `renderBlit` targets([#3509](https://github.com/HaxeFlixel/flixel/issues/3509))
16+
- `FlxCamera`: Fix FLX_RENDER_TRIANGLE not rendering anything ([#3505](https://github.com/HaxeFlixel/flixel/pull/3505))
17+
118
### 6.1.1 (Oct 7, 2025)
219

320
#### Changes and improvements:

flixel/FlxCamera.hx

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import openfl.geom.Rectangle;
1111
import flixel.graphics.FlxGraphic;
1212
import flixel.graphics.frames.FlxFrame;
1313
import flixel.graphics.tile.FlxDrawBaseItem;
14+
import flixel.graphics.tile.FlxDrawQuadsItem;
1415
import flixel.graphics.tile.FlxDrawTrianglesItem;
1516
import flixel.math.FlxMath;
1617
import flixel.math.FlxMatrix;
@@ -27,8 +28,6 @@ import openfl.filters.BitmapFilter;
2728

2829
using flixel.util.FlxColorTransformUtil;
2930

30-
private typedef FlxDrawItem = flixel.graphics.tile.FlxDrawQuadsItem;
31-
3231
/**
3332
* The camera class is used to display the game's visuals.
3433
* By default one camera is created automatically, that is the same size as window.
@@ -537,7 +536,7 @@ class FlxCamera extends FlxBasic
537536
/**
538537
* Last draw tiles item
539538
*/
540-
var _headTiles:FlxDrawItem;
539+
var _headTiles:FlxDrawQuadsItem;
541540

542541
/**
543542
* Last draw triangles item
@@ -547,7 +546,7 @@ class FlxCamera extends FlxBasic
547546
/**
548547
* Draw tiles stack items that can be reused
549548
*/
550-
static var _storageTilesHead:FlxDrawItem;
549+
static var _storageTilesHead:FlxDrawQuadsItem;
551550

552551
/**
553552
* Draw triangles stack items that can be reused
@@ -601,7 +600,7 @@ class FlxCamera extends FlxBasic
601600
}
602601
else
603602
{
604-
itemToReturn = new FlxDrawItem();
603+
itemToReturn = new FlxDrawQuadsItem();
605604
}
606605

607606
// TODO: catch this error when the dev actually messes up, not in the draw phase
@@ -643,10 +642,8 @@ class FlxCamera extends FlxBasic
643642
&& _headTriangles.antialiasing == smoothing
644643
&& _headTriangles.colored == isColored
645644
&& _headTriangles.blend == blend
646-
#if !flash
647645
&& _headTriangles.hasColorOffsets == hasColorOffsets
648646
&& _headTriangles.shader == shader
649-
#end
650647
)
651648
{
652649
return _headTriangles;
@@ -676,10 +673,8 @@ class FlxCamera extends FlxBasic
676673
itemToReturn.antialiasing = smoothing;
677674
itemToReturn.colored = isColored;
678675
itemToReturn.blend = blend;
679-
#if !flash
680676
itemToReturn.hasColorOffsets = hasColorOffsets;
681677
itemToReturn.shader = shader;
682-
#end
683678

684679
itemToReturn.nextTyped = _headTriangles;
685680
_headTriangles = itemToReturn;
@@ -769,9 +764,9 @@ class FlxCamera extends FlxBasic
769764
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());
770765

771766
#if FLX_RENDER_TRIANGLE
772-
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(frame.parent, smoothing, isColored, blend);
767+
final drawItem:FlxDrawTrianglesItem = startTrianglesBatch(frame.parent, smoothing, isColored, blend, hasColorOffsets, shader);
773768
#else
774-
var drawItem = startQuadBatch(frame.parent, isColored, hasColorOffsets, blend, smoothing, shader);
769+
final drawItem:FlxDrawQuadsItem = startQuadBatch(frame.parent, isColored, hasColorOffsets, blend, smoothing, shader);
775770
#end
776771
drawItem.addQuad(frame, matrix, transform);
777772
}
@@ -812,10 +807,10 @@ class FlxCamera extends FlxBasic
812807
var isColored = (transform != null && transform.hasRGBMultipliers());
813808
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());
814809

815-
#if !FLX_RENDER_TRIANGLE
816-
var drawItem = startQuadBatch(frame.parent, isColored, hasColorOffsets, blend, smoothing, shader);
810+
#if FLX_RENDER_TRIANGLE
811+
final drawItem:FlxDrawTrianglesItem = startTrianglesBatch(frame.parent, smoothing, isColored, blend, hasColorOffsets, shader);
817812
#else
818-
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(frame.parent, smoothing, isColored, blend);
813+
final drawItem:FlxDrawQuadsItem = startQuadBatch(frame.parent, isColored, hasColorOffsets, blend, smoothing, shader);
819814
#end
820815
drawItem.addQuad(frame, _helperMatrix, transform);
821816
}
@@ -881,7 +876,8 @@ class FlxCamera extends FlxBasic
881876
_helperMatrix.translate(-viewMarginLeft, -viewMarginTop);
882877
}
883878

884-
buffer.draw(trianglesSprite, _helperMatrix);
879+
buffer.draw(trianglesSprite, _helperMatrix, transform);
880+
885881
#if FLX_DEBUG
886882
if (FlxG.debugger.drawDebug)
887883
{
@@ -899,17 +895,11 @@ class FlxCamera extends FlxBasic
899895
}
900896
else
901897
{
902-
var isColored:Bool = (colors != null && colors.length != 0);
898+
final isColored = (colors != null && colors.length != 0) || (transform != null && transform.hasRGBMultipliers());
899+
final hasColorOffsets = (transform != null && transform.hasRGBAOffsets());
903900

904-
#if !flash
905-
var hasColorOffsets:Bool = (transform != null && transform.hasRGBAOffsets());
906-
isColored = isColored || (transform != null && transform.hasRGBMultipliers());
907-
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend, hasColorOffsets, shader);
901+
final drawItem = startTrianglesBatch(graphic, smoothing, isColored, blend, hasColorOffsets, shader);
908902
drawItem.addTriangles(vertices, indices, uvtData, colors, position, cameraBounds, transform);
909-
#else
910-
var drawItem:FlxDrawTrianglesItem = startTrianglesBatch(graphic, smoothing, isColored, blend);
911-
drawItem.addTriangles(vertices, indices, uvtData, colors, position, cameraBounds);
912-
#end
913903
}
914904
}
915905

@@ -1667,9 +1657,6 @@ class FlxCamera extends FlxBasic
16671657
}
16681658
else
16691659
{
1670-
if (FxAlpha == 0)
1671-
return;
1672-
16731660
final targetGraphics = (graphics == null) ? canvas.graphics : graphics;
16741661

16751662
targetGraphics.overrideBlendMode(null);

flixel/FlxG.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,10 @@ class FlxG
539539
FlxG.height = height;
540540

541541
initRenderMethod();
542+
#if FLX_OPENGL_AVAILABLE
543+
// Query once when window is created and cache for later
544+
bitmap.get_maxTextureSize();
545+
#end
542546

543547
FlxG.initialWidth = width;
544548
FlxG.initialHeight = height;

flixel/FlxSprite.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ class FlxSprite extends FlxObject
10541054
/**
10551055
* Whether this sprite has a color transform, menaing any of the following: less than full
10561056
* `alpha`, a `color` tint, or a `colorTransform` whos values are not the default.
1057+
* @since 6.1.0
10571058
*/
10581059
@:haxe.warning("-WDeprecated")
10591060
public function hasColorTransform()

flixel/FlxStrip.hx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,9 @@ class FlxStrip extends FlxSprite
5656
if (!camera.visible || !camera.exists)
5757
continue;
5858

59-
getScreenPosition(_point, camera).subtractPoint(offset);
60-
#if !flash
59+
getScreenPosition(_point, camera);
60+
_point -= offset;
6161
camera.drawTriangles(graphic, vertices, indices, uvtData, colors, _point, blend, repeat, antialiasing, colorTransform, shader);
62-
#else
63-
camera.drawTriangles(graphic, vertices, indices, uvtData, colors, _point, blend, repeat, antialiasing);
64-
#end
6562
}
6663
}
6764
}

flixel/graphics/frames/FlxTileFrames.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package flixel.graphics.frames;
22

3-
import openfl.display.BitmapData;
4-
import openfl.geom.Point;
53
import flixel.graphics.FlxGraphic;
64
import flixel.graphics.frames.FlxFramesCollection.FlxFrameCollectionType;
75
import flixel.math.FlxPoint;
@@ -10,6 +8,8 @@ import flixel.system.FlxAssets.FlxGraphicAsset;
108
import flixel.util.FlxBitmapDataUtil;
119
import flixel.util.FlxColor;
1210
import flixel.util.FlxDestroyUtil;
11+
import openfl.display.BitmapData;
12+
import openfl.geom.Point;
1313

1414
/**
1515
* Spritesheet frame collection. It is used for tilemaps and animated sprites.
@@ -91,7 +91,7 @@ class FlxTileFrames extends FlxFramesCollection
9191
borderY = Std.int(tileBorder.y);
9292
}
9393

94-
var tileFrames:FlxTileFrames = FlxTileFrames.fromGraphic(result, FlxPoint.get().addPoint(tileSize).add(2 * borderX, 2 * borderY), null, tileSpacing);
94+
var tileFrames:FlxTileFrames = FlxTileFrames.fromGraphic(result, FlxPoint.get().add(tileSize).add(2 * borderX, 2 * borderY), null, tileSpacing);
9595

9696
if (tileBorder == null)
9797
return tileFrames;

0 commit comments

Comments
 (0)