Skip to content

Commit

Permalink
fix pooling in cameras following
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Apr 15, 2024
1 parent 540cf28 commit 25ea1d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1477,14 +1477,14 @@ class FlxCamera extends FlxBasic
style = Style;
target = Target;
followLerp = Lerp;
var helper:Float;
var w:Float = 0;
var h:Float = 0;
_lastTargetPosition = null;
_lastTargetPosition = FlxDestroyUtil.put(_lastTargetPosition);
deadzone = FlxDestroyUtil.put(deadzone);

switch (Style)
{
case LOCKON:
var w:Float = 0;
var h:Float = 0;
if (target != null)
{
w = target.width;
Expand All @@ -1493,16 +1493,16 @@ class FlxCamera extends FlxBasic
deadzone = FlxRect.get((width - w) / 2, (height - h) / 2 - h * 0.25, w, h);

case PLATFORMER:
var w:Float = (width / 8);
var h:Float = (height / 3);
final w:Float = (width / 8);
final h:Float = (height / 3);
deadzone = FlxRect.get((width - w) / 2, (height - h) / 2 - h * 0.25, w, h);

case TOPDOWN:
helper = Math.max(width, height) / 4;
final helper = Math.max(width, height) / 4;
deadzone = FlxRect.get((width - helper) / 2, (height - helper) / 2, helper, helper);

case TOPDOWN_TIGHT:
helper = Math.max(width, height) / 8;
final helper = Math.max(width, height) / 8;
deadzone = FlxRect.get((width - helper) / 2, (height - helper) / 2, helper, helper);

case SCREEN_BY_SCREEN:
Expand Down
2 changes: 1 addition & 1 deletion flixel/util/FlxPool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class FlxPool<T:IFlxDestroyable> implements IFlxPool<T>
function trackGet(obj:T)
{
final callStack = haxe.CallStack.callStack();
final stack = stackToString(callStack[3]);
final stack = stackToString(callStack[2]);
if (stack == null)
return;

Expand Down

0 comments on commit 25ea1d4

Please sign in to comment.