Skip to content

Commit

Permalink
Fix incorrect usage of FlxPoint and FlxRect
Browse files Browse the repository at this point in the history
  • Loading branch information
NeeEoo committed Aug 11, 2024
1 parent 959267b commit e7d9c00
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,9 @@ class FlxCamera extends FlxBasic
* Internal variables, used in blit render mode to draw trianglesSprite on camera's buffer.
* Added for less garbage creation.
*/
static var renderPoint:FlxPoint = FlxPoint.get();
static var renderPoint:FlxPoint = new FlxPoint();

static var renderRect:FlxRect = FlxRect.get();
static var renderRect:FlxRect = new FlxRect();

@:noCompletion
public function startQuadBatch(graphic:FlxGraphic, colored:Bool, hasColorOffsets:Bool = false, ?blend:BlendMode, smooth:Bool = false, ?shader:FlxShader)
Expand Down
2 changes: 1 addition & 1 deletion flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class FlxG
* The dimensions of the game world, used by the quad tree for collisions and overlap checks.
* Use `.set()` instead of creating a new object!
*/
public static var worldBounds(default, null):FlxRect = FlxRect.get();
public static var worldBounds(default, null):FlxRect = new FlxRect();

#if FLX_SAVE
/**
Expand Down
7 changes: 4 additions & 3 deletions flixel/graphics/tile/FlxDrawTrianglesItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxShader;
import flixel.util.FlxColor;
import flixel.util.FlxDestroyUtil;
import openfl.display.Graphics;
import openfl.display.ShaderParameter;
import openfl.display.TriangleCulling;
Expand All @@ -20,8 +21,8 @@ typedef DrawData<T> = openfl.Vector<T>;
*/
class FlxDrawTrianglesItem extends FlxDrawBaseItem<FlxDrawTrianglesItem>
{
static var point:FlxPoint = FlxPoint.get();
static var rect:FlxRect = FlxRect.get();
static var point:FlxPoint = new FlxPoint();
static var rect:FlxRect = new FlxRect();

#if !flash
public var shader:FlxShader;
Expand Down Expand Up @@ -126,7 +127,7 @@ class FlxDrawTrianglesItem extends FlxDrawBaseItem<FlxDrawTrianglesItem>
indices = null;
uvtData = null;
colors = null;
bounds = null;
bounds = FlxDestroyUtil.put(bounds);
#if !flash
alphas = null;
colorMultipliers = null;
Expand Down
2 changes: 1 addition & 1 deletion flixel/path/FlxPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class FlxPath extends FlxBasePath
/**
* Path behavior controls: move from the start of the path to the end then stop.
*/
static var _point:FlxPoint = FlxPoint.get();
static var _point:FlxPoint = new FlxPoint();

/**
* The speed at which the object is moving on the path.
Expand Down

0 comments on commit e7d9c00

Please sign in to comment.