Skip to content

remove all deprecated fields as of 6.0.0 #3355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flixel/FlxGame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class FlxGame extends Sprite
*
* @see [scale modes](https://api.haxeflixel.com/flixel/system/scaleModes/index.html)
*/
public function new(gameWidth = 0, gameHeight = 0, ?initialState:InitialState, updateFramerate = 60, drawFramerate = 60, skipSplash = false,
public function new(gameWidth = 0, gameHeight = 0, ?initialState:NextState, updateFramerate = 60, drawFramerate = 60, skipSplash = false,
startFullscreen = false)
{
super();
Expand Down Expand Up @@ -269,7 +269,7 @@ class FlxGame extends Sprite
#end

// Then get ready to create the game object for real
_initialState = (initialState == null) ? FlxState.new : initialState.toNextState();
_initialState = (initialState == null) ? FlxState.new : initialState;

addEventListener(Event.ADDED_TO_STAGE, create);
}
Expand Down Expand Up @@ -577,7 +577,7 @@ class FlxGame extends Sprite

// Finally assign and create the new state
_state = _nextState.createInstance();
_state._constructor = _nextState.getConstructor();
_state._constructor = _nextState;
_nextState = null;

if (_gameJustStarted)
Expand Down
7 changes: 3 additions & 4 deletions flixel/FlxObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class FlxObject extends FlxBasic
* @return The result of whichever separator was used
* @since 5.9.0
*/
@:haxe.warning("-WDeprecated")
static function processCheckTilemap(object1:FlxObject, object2:FlxObject, func:(FlxObject, FlxObject)->Bool,
?position:FlxPoint, isCollision = true):Bool
{
Expand All @@ -134,7 +133,7 @@ class FlxObject extends FlxBasic
// Keep tile as first arg
return processCheckTilemap(tile, object2, func, position, isCollision);
}
return tilemap.overlapsWithCallback(object2, recurseProcess, false, position);
return tilemap.objectOverlapsTiles(object2, recurseProcess, position);
}
else if (object2.flixelType == TILEMAP)
{
Expand All @@ -145,7 +144,7 @@ class FlxObject extends FlxBasic
// Keep tile as second arg
return processCheckTilemap(object1, tile, func, position, isCollision);
}
return tilemap.overlapsWithCallback(object1, recurseProcess, false, position);
return tilemap.objectOverlapsTiles(object1, recurseProcess, position);
}

return func(object1, object2);
Expand Down Expand Up @@ -1400,7 +1399,7 @@ class FlxObject extends FlxBasic
@:noCompletion
inline function get_solid():Bool
{
return (allowCollisions & FlxDirectionFlags.ANY) > FlxDirectionFlags.NONE;
return allowCollisions != FlxDirectionFlags.NONE;
}

@:noCompletion
Expand Down
32 changes: 0 additions & 32 deletions flixel/animation/FlxAnimationController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ class FlxAnimationController implements IFlxDestroyable
* @since 5.3.0
*/
public var numFrames(get, never):Int;

/**
* If assigned, will be called each time the current animation's frame changes
*
* @param animName The name of the current animation
* @param frameNumber The progress of the current animation, in frames
* @param frameIndex The current animation's frameIndex in the tile sheet
*/
@:deprecated('callback is deprecated, use onFrameChange.add') // 5.9.0
public var callback:(animName:String, frameNumber:Int, frameIndex:Int)->Void;

/**
* If assigned, will be called each time the current animation finishes.
*
* @param animName The name of the current animation
*/
@:deprecated('finishCallback is deprecated, use onFinish.add') // 5.9.0
public var finishCallback:(animName:String) -> Void;

/**
* Dispatches each time the current animation's frame changes
Expand Down Expand Up @@ -171,7 +153,6 @@ class FlxAnimationController implements IFlxDestroyable
clearPrerotated();
}

@:haxe.warning("-WDeprecated")
public function destroy():Void
{
FlxDestroyUtil.destroy(onFrameChange);
Expand All @@ -180,8 +161,6 @@ class FlxAnimationController implements IFlxDestroyable

destroyAnimations();
_animations = null;
callback = null;
finishCallback = null;
_sprite = null;
}

Expand Down Expand Up @@ -701,28 +680,17 @@ class FlxAnimationController implements IFlxDestroyable
frameIndex = FlxG.random.int(0, numFrames - 1);
}

@:haxe.warning("-WDeprecated")
function fireCallback():Void
{
final name = (_curAnim != null) ? (_curAnim.name) : null;
final number = (_curAnim != null) ? (_curAnim.curFrame) : frameIndex;
if (callback != null)
{
callback(name, number, frameIndex);
}

onFrameChange.dispatch(name, number, frameIndex);
}

@:allow(flixel.animation)
@:haxe.warning("-WDeprecated")
function fireFinishCallback(?name:String):Void
{
if (finishCallback != null)
{
finishCallback(name);
}

onFinish.dispatch(name);
}

Expand Down
32 changes: 0 additions & 32 deletions flixel/graphics/FlxGraphic.hx
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,6 @@ class FlxGraphic implements IFlxDestroyable
*/
public var canBeRefreshed(get, never):Bool;

@:deprecated("`canBeDumped` is deprecated, use `canBeRefreshed`")
public var canBeDumped(get, never):Bool;

/**
* GLSL shader for this graphic. Only used if utilizing sprites do not define a shader
* Avoid changing it frequently as this is a costly operation.
Expand Down Expand Up @@ -374,24 +371,6 @@ class FlxGraphic implements IFlxDestroyable
public var trackingInfo:String = "";
#end

/**
* Internal var holding `FlxImageFrame` for the whole bitmap of this graphic.
* Use public `imageFrame` var to access/generate it.
*/
@:deprecated("_imageFrame is deprecated, use imageFrame")
var _imageFrame(get, set):FlxImageFrame;
inline function get__imageFrame() return imageFrame;
inline function set__imageFrame(value:FlxImageFrame) return imageFrame = value;

@:deprecated('_useCount is deprecated, use incrementUseCount and decrementUseCount')
var _useCount(get, set):Int;
inline function get__useCount() return useCount;
inline function set__useCount(value:Int) return useCount = value;

@:deprecated('_destroyOnNoUse is deprecated, use destroyOnNoUse')
var _destroyOnNoUse(get, set):Bool;
inline function get__destroyOnNoUse() return destroyOnNoUse;
inline function set__destroyOnNoUse(value:Bool) return destroyOnNoUse = value;
/**
* `FlxGraphic` constructor
*
Expand Down Expand Up @@ -422,12 +401,6 @@ class FlxGraphic implements IFlxDestroyable
bitmap = newBitmap;
}

@:deprecated("`undump` is deprecated, use `refresh`")
public function undump():Void
{
refresh();
}

/**
* Asset reload callback for this graphic object.
* It regenerates its bitmap data.
Expand Down Expand Up @@ -557,11 +530,6 @@ class FlxGraphic implements IFlxDestroyable
return assetsClass != null || assetsKey != null;
}

inline function get_canBeDumped():Bool
{
return canBeRefreshed;
}

public function incrementUseCount()
{
useCount++;
Expand Down
7 changes: 0 additions & 7 deletions flixel/graphics/frames/FlxAtlasFrames.hx
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,3 @@ class FlxAtlasFrames extends FlxFramesCollection
return this;
}
}

@:deprecated("Use TexturePackerAtlas instead")// 5.4.0
typedef TexturePackerObject = TexturePackerAtlas;
@:deprecated("Use TexturePackerAtlasFrame instead")// 5.4.0
typedef TexturePackerFrameData = TexturePackerAtlasFrame;
@:deprecated("Use AtlasRect instead")// 5.4.0
typedef TexturePackerFrameRect = AtlasRect;
19 changes: 0 additions & 19 deletions flixel/graphics/frames/FlxFramesCollection.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ class FlxFramesCollection implements IFlxDestroyable
* Number of frames in this collection.
*/
public var numFrames(get, never):Int;

/**
* Hash of frames for this frame collection.
* Used only in `FlxAtlasFrames` and `FlxBitmapFont` (not implemented yet),
* but you can try to use it for other types of collections
* (give names to your frames).
*/
@:deprecated("`framesHash` is deprecated, use `getByName()` or `exists()`")
public var framesHash(get, set):Map<String, FlxFrame>;

/**
* Hash of frames, by name, for this frame collection.
Expand Down Expand Up @@ -399,16 +390,6 @@ class FlxFramesCollection implements IFlxDestroyable
{
return frames.length;
}

inline function get_framesHash()
{
return framesByName;
}

inline function set_framesHash(value)
{
return framesByName = value;
}
}

/**
Expand Down
14 changes: 1 addition & 13 deletions flixel/group/FlxSpriteGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,7 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite
* Optimization to allow setting position of group without transforming children twice.
*/
var _skipTransformChildren:Bool = false;

/**
* Array of all the `FlxSprite`s that exist in this group for
* optimization purposes / static typing on cpp targets.
*/
@:deprecated("_sprites is deprecated, use group.members")
var _sprites(get, never):Array<FlxSprite>;


/**
* @param X The initial X position of the group.
* @param Y The initial Y position of the group.
Expand Down Expand Up @@ -1167,11 +1160,6 @@ class FlxTypedSpriteGroup<T:FlxSprite> extends FlxSprite
return null;
}

inline function get__sprites():Array<FlxSprite>
{
return cast group.members;
}

function set_group(value:FlxTypedGroup<T>):FlxTypedGroup<T>
{
return this.group = value;
Expand Down
Loading