diff --git a/flixel/FlxGame.hx b/flixel/FlxGame.hx index d752a04a1d..a3cf249131 100644 --- a/flixel/FlxGame.hx +++ b/flixel/FlxGame.hx @@ -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(); @@ -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); } @@ -576,8 +576,8 @@ class FlxGame extends Sprite FlxG.bitmap.clearCache(); // Finally assign and create the new state - _state = _nextState.createInstance(); - _state._constructor = _nextState.getConstructor(); + _state = _nextState(); + _state._constructor = _nextState; _nextState = null; if (_gameJustStarted) diff --git a/flixel/FlxObject.hx b/flixel/FlxObject.hx index 3c9b1d4f3b..41046913b8 100644 --- a/flixel/FlxObject.hx +++ b/flixel/FlxObject.hx @@ -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 { @@ -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) { @@ -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); @@ -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 diff --git a/flixel/animation/FlxAnimationController.hx b/flixel/animation/FlxAnimationController.hx index 938ea13625..9d5e48f7de 100644 --- a/flixel/animation/FlxAnimationController.hx +++ b/flixel/animation/FlxAnimationController.hx @@ -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 @@ -171,7 +153,6 @@ class FlxAnimationController implements IFlxDestroyable clearPrerotated(); } - @:haxe.warning("-WDeprecated") public function destroy():Void { FlxDestroyUtil.destroy(onFrameChange); @@ -180,8 +161,6 @@ class FlxAnimationController implements IFlxDestroyable destroyAnimations(); _animations = null; - callback = null; - finishCallback = null; _sprite = null; } @@ -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); } diff --git a/flixel/graphics/FlxGraphic.hx b/flixel/graphics/FlxGraphic.hx index 6dbf70adfc..5f96d7f3b7 100644 --- a/flixel/graphics/FlxGraphic.hx +++ b/flixel/graphics/FlxGraphic.hx @@ -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. @@ -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 * @@ -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. @@ -557,11 +530,6 @@ class FlxGraphic implements IFlxDestroyable return assetsClass != null || assetsKey != null; } - inline function get_canBeDumped():Bool - { - return canBeRefreshed; - } - public function incrementUseCount() { useCount++; diff --git a/flixel/graphics/frames/FlxAtlasFrames.hx b/flixel/graphics/frames/FlxAtlasFrames.hx index 91fe6baf39..633aab1673 100644 --- a/flixel/graphics/frames/FlxAtlasFrames.hx +++ b/flixel/graphics/frames/FlxAtlasFrames.hx @@ -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; diff --git a/flixel/graphics/frames/FlxFramesCollection.hx b/flixel/graphics/frames/FlxFramesCollection.hx index c6f38861f1..165b268c87 100644 --- a/flixel/graphics/frames/FlxFramesCollection.hx +++ b/flixel/graphics/frames/FlxFramesCollection.hx @@ -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; /** * Hash of frames, by name, for this frame collection. @@ -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; - } } /** diff --git a/flixel/group/FlxSpriteGroup.hx b/flixel/group/FlxSpriteGroup.hx index a1f43596e1..250bf72ae8 100644 --- a/flixel/group/FlxSpriteGroup.hx +++ b/flixel/group/FlxSpriteGroup.hx @@ -70,14 +70,7 @@ class FlxTypedSpriteGroup 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; - + /** * @param X The initial X position of the group. * @param Y The initial Y position of the group. @@ -1167,11 +1160,6 @@ class FlxTypedSpriteGroup extends FlxSprite return null; } - inline function get__sprites():Array - { - return cast group.members; - } - function set_group(value:FlxTypedGroup):FlxTypedGroup { return this.group = value; diff --git a/flixel/input/FlxPointer.hx b/flixel/input/FlxPointer.hx index efe7578a6a..b50887d9df 100644 --- a/flixel/input/FlxPointer.hx +++ b/flixel/input/FlxPointer.hx @@ -12,13 +12,6 @@ class FlxPointer /** The position in the world */ public var y(default, null):Int = 0; - /** The world position relative to the main camera's scroll position */ - @:deprecated("screenX is deprecated, use viewX, instead") - public var screenX(default, never):Int = 0; - /** The world position relative to the main camera's scroll position */ - @:deprecated("screenY is deprecated, use viewY, instead") - public var screenY(default, never):Int = 0; - /** * The world position relative to the main camera's scroll position, `cam.viewMarginX` or * `cam.viewMarginLeft` is the left edge of the camera and `cam.viewMarginRight` is the right @@ -49,11 +42,6 @@ class FlxPointer */ public var gameY(default, null):Int = 0; - @:deprecated("_globalScreenX is deprecated, use gameX, instead") // 5.9.0 - var _globalScreenX(get, set):Int; - @:deprecated("_globalScreenY is deprecated, use gameY, instead") // 5.9.0 - var _globalScreenY(get, set):Int; - var _rawX(default, null):Float = 0; var _rawY(default, null):Float = 0; @@ -120,57 +108,6 @@ class FlxPointer return result; } - /** - * Fetch the position of the pointer relative to given camera's `scroll` position, where - * `(cam.viewMarginLeft, cam.viewMarginTop)` is the top-left of the camera and - * `(cam.viewMarginRight, cam.viewMarginBottom)` is the bottom right of the camera - * - * **Note:** Fields `viewX` and `viewY` also store this result for `FlxG.camera` - * - * @param camera If unspecified, `FlxG.camera` is used, instead - * @param result An existing point to store the results, if unspecified, one is created - */ - @:deprecated("getScreenPosition is deprecated, use getViewPosition, instead") // 5.9.0 - public function getScreenPosition(?camera:FlxCamera, ?result:FlxPoint):FlxPoint - { - if (camera == null) - camera = FlxG.camera; - - if (result == null) - result = FlxPoint.get(); - - result.x = (gameX - camera.x + 0.5 * camera.width * (camera.zoom - camera.initialZoom)) / camera.zoom; - result.y = (gameY - camera.y + 0.5 * camera.height * (camera.zoom - camera.initialZoom)) / camera.zoom; - - return result; - } - - /** - * Fetch the position of the pointer relative to given camera's `scroll` position, where - * `(cam.viewMarginLeft, cam.viewMarginTop)` is the top-left of the camera and - * `(cam.viewMarginRight, cam.viewMarginBottom)` is the bottom right of the camera - * - * **Note:** Fields `viewX` and `viewY` also store this result for `FlxG.camera` - * - * @param camera If unspecified, `FlxG.camera` is used, instead. - * @param result An existing point to store the results, if unspecified, one is created - * @return The pointer's location relative to camera's viewport. - */ - @:deprecated("getPositionInCameraView is deprecated, use getViewPosition, instead") // 5.9.0 - public function getPositionInCameraView(?camera:FlxCamera, ?result:FlxPoint):FlxPoint - { - if (camera == null) - camera = FlxG.camera; - - if (result == null) - result = FlxPoint.get(); - - result.x = (gameX - camera.x) / camera.zoom + camera.viewMarginX; - result.y = (gameY - camera.y) / camera.zoom + camera.viewMarginY; - - return result; - } - /** * Returns a FlxPoint with this input's x and y. */ @@ -210,22 +147,11 @@ class FlxPointer return object.overlapsPoint(_cachedPoint, true, camera); } - /** - * Directly set the underyling screen position variable. WARNING! You should never use - * this unless you are trying to manually dispatch low-level mouse / touch events to the stage. - */ - @:deprecated("setGlobalScreenPositionUnsafe is deprecated, use setRawPositionUnsafe, instead") - public inline function setGlobalScreenPositionUnsafe(newX:Float, newY:Float):Void - { - setRawPositionUnsafe(newX, newY); - } - /** * Directly set the underyling position variable. WARNING! You should never use * this unless you are trying to manually dispatch low-level mouse / touch events to the stage. * @since 5.9.0 */ - @:haxe.warning("-WDeprecated") public function setRawPositionUnsafe(x:Float, y:Float) { _rawX = x / FlxG.scaleMode.scale.x; @@ -236,7 +162,7 @@ class FlxPointer /** * Helper function to update the cursor used by update() and playback(). - * Updates the x, y, screenX, and screenY variables based on the default camera. + * Updates the x, y, viewX, and viewY variables based on the default camera. */ function updatePositions():Void { @@ -257,26 +183,4 @@ class FlxPointer { return FlxStringUtil.getDebugString([LabelValuePair.weak("x", x), LabelValuePair.weak("y", y)]); } - - inline function get__globalScreenX():Int - { - return gameX; - } - - inline function get__globalScreenY():Int - { - return gameY; - } - - inline function set__globalScreenX(value:Int):Int - { - _rawX = value * FlxG.scaleMode.scale.x; - return value; - } - - inline function set__globalScreenY(value:Int):Int - { - _rawY = value * FlxG.scaleMode.scale.y; - return value; - } } diff --git a/flixel/input/actions/FlxAction.hx b/flixel/input/actions/FlxAction.hx index 27e37d06a0..df07e1a336 100644 --- a/flixel/input/actions/FlxAction.hx +++ b/flixel/input/actions/FlxAction.hx @@ -342,8 +342,6 @@ class FlxAction implements IFlxDestroyable var _y:Null = null; var _timestamp:Int = 0; - @:deprecated("_checked is deprecated, use triggered, instead") - var _checked:Bool = false; /** * Whether the steam controller inputs for this action have changed since the last time origins were polled. Always false if steam isn't active diff --git a/flixel/input/mouse/FlxMouse.hx b/flixel/input/mouse/FlxMouse.hx index 9b191291fb..a4c16b3bc8 100644 --- a/flixel/input/mouse/FlxMouse.hx +++ b/flixel/input/mouse/FlxMouse.hx @@ -84,18 +84,6 @@ class FlxMouse extends FlxPointer implements IFlxInputManager */ public var deltaY(get, never):Int; - /** - * Distance in pixels the mouse has moved in screen space since the last frame in the X direction. - */ - @:deprecated("deltaScreenX is deprecated, use deltaViewX, instead") // 5.9.0 - public var deltaScreenX(get, never):Int; - - /** - * Distance in pixels the mouse has moved in screen space since the last frame in the Y direction. - */ - @:deprecated("deltaScreenY is deprecated, use deltaViewY, instead") // 5.9.0 - public var deltaScreenY(get, never):Int; - /** * Distance in pixels the mouse has moved in view space since the last frame in the X direction. * @since 5.9.0 @@ -211,8 +199,6 @@ class FlxMouse extends FlxPointer implements IFlxInputManager var _rightButton:FlxMouseButton; #end - @:deprecated("_cursor is deprecated, use the new, public cursor, instead") - var _cursor(get, set):Bitmap; var _cursorBitmapData:BitmapData; var _wheelUsed:Bool = false; var _visibleWhenFocusLost:Bool = true; @@ -233,10 +219,6 @@ class FlxMouse extends FlxPointer implements IFlxInputManager var _prevY:Int = 0; var _prevViewX:Int = 0; var _prevViewY:Int = 0; - @:deprecated("_prevScreenX is deprecated, use _prevViewX, instead") - var _prevScreenX(get, never):Int; - @:deprecated("_prevScreenY is deprecated, use _prevViewY, instead") - var _prevScreenY(get, never):Int; // Helper variable for cleaning up memory var _stage:Stage; @@ -618,19 +600,7 @@ class FlxMouse extends FlxPointer implements IFlxInputManager inline function get_deltaViewY():Int return viewY - _prevViewY; - - inline function get__prevScreenX():Int - return _prevViewX; - - inline function get__prevScreenY():Int - return _prevViewY; - - inline function get_deltaScreenX():Int - return deltaViewX; - inline function get_deltaScreenY():Int - return deltaViewY; - inline function get_pressed():Bool return _leftButton.pressed; @@ -790,15 +760,5 @@ class FlxMouse extends FlxPointer implements IFlxInputManager _rawY = record.y; updatePositions(); } - - inline function get__cursor() - { - return cursor; - } - - inline function set__cursor(value:Bitmap) - { - return cursor = value; - } } #end diff --git a/flixel/path/FlxPath.hx b/flixel/path/FlxPath.hx index 6cfcb3316e..b4901f2da1 100644 --- a/flixel/path/FlxPath.hx +++ b/flixel/path/FlxPath.hx @@ -137,12 +137,6 @@ class FlxPath extends FlxBasePath */ public var angle(default, null):Float = 0; - /** - * Legacy method of alignment for the object following the path. If true, align the midpoint of the object on the path, else use the x, y position. - */ - @:deprecated("path.autoCenter is deprecated, use centerMode") // 5.7.0 - public var autoCenter(get, set):Bool; - /** * How to center the object on the path. * @since 5.7.0 @@ -163,15 +157,6 @@ class FlxPath extends FlxBasePath */ public var angleOffset:Float = 0; - @:deprecated("onComplete is deprecated, use the onEndReached signal, instead") - public var onComplete:FlxPath->Void; - - /** - * Tracks which node of the path this object is currently moving toward. - */ - @:deprecated("nodeIndex is deprecated, use nextIndex, instead") - public var nodeIndex(get, never):Int; - /** * Whether to limit movement to certain axes. */ @@ -199,17 +184,11 @@ class FlxPath extends FlxBasePath @:allow(flixel.FlxObject) var object(get, set):FlxObject; - @:haxe.warning("-WDeprecated") public function new(?nodes:Array) { super(nodes != null ? nodes.copy() : []); active = false; - onEndReached.add(function (_) - { - if (onComplete != null) - onComplete(this); - }); } /** @@ -454,29 +433,6 @@ class FlxPath extends FlxBasePath super.advance(); } - #if FLX_DEBUG - - /** - * While this doesn't override `FlxBasic.drawDebug()`, the behavior is very similar. - * Based on this path data, it draws a simple lines-and-boxes representation of the path - * if the `drawDebug` mode was toggled in the debugger overlay. - * You can use `debugColor` to control the path's appearance. - * - * @param camera The camera object the path will draw to. - */ - @:deprecated("FlxPath.debugDraw() is deprecated, use draw() OR drawDebugOnCamera(camera), instead") - public function drawDebug(?camera:FlxCamera):Void - { - if (nodes == null || nodes.length <= 0 || ignoreDrawDebug) - return; - - if (camera == null) - camera = FlxG.camera; - - drawDebugOnCamera(camera); - } - #end - /** * Stops the path's movement. * @@ -648,11 +604,6 @@ class FlxPath extends FlxBasePath } return null; } - - inline function get_nodeIndex() - { - return nextIndex; - } function set_immovable(value:Bool):Bool { @@ -673,21 +624,6 @@ class FlxPath extends FlxBasePath return this.immovable = value; } - // deprecated 5.7.0 - @:noCompletion - function set_autoCenter(value:Bool):Bool - { - centerMode = value ? CENTER : TOP_LEFT; - return value; - } - - // deprecated 5.7.0 - @:noCompletion - function get_autoCenter():Bool - { - return centerMode.match(CENTER); - } - function get__inc() { return direction.toInt(); diff --git a/flixel/sound/FlxSound.hx b/flixel/sound/FlxSound.hx index b45f6c8f1e..5294f4e287 100644 --- a/flixel/sound/FlxSound.hx +++ b/flixel/sound/FlxSound.hx @@ -114,9 +114,9 @@ class FlxSound extends FlxBasic /** * The sound group this sound belongs to, can only be in one group. - * NOTE: This setter is deprecated, use `group.add(sound)` or `group.remove(sound)`. */ - public var group(default, set):FlxSoundGroup; + @:allow(flixel.sound.FlxSoundGroup) + public var group(default, null):FlxSoundGroup; /** * Whether or not this sound should loop. @@ -709,22 +709,6 @@ class FlxSound extends FlxBasic } #end - @:deprecated("sound.group = myGroup is deprecated, use myGroup.add(sound)") // 5.7.0 - function set_group(value:FlxSoundGroup):FlxSoundGroup - { - if (value != null) - { - // add to new group, also removes from prev and calls updateTransform - value.add(this); - } - else - { - // remove from prev group, also calls updateTransform - group.remove(this); - } - return value; - } - inline function get_playing():Bool { return _channel != null; diff --git a/flixel/sound/FlxSoundGroup.hx b/flixel/sound/FlxSoundGroup.hx index cc37421248..da5c1cd430 100644 --- a/flixel/sound/FlxSoundGroup.hx +++ b/flixel/sound/FlxSoundGroup.hx @@ -38,7 +38,6 @@ class FlxSoundGroup sound.group.sounds.remove(sound); sounds.push(sound); - @:bypassAccessor sound.group = this; sound.updateTransform(); return true; @@ -55,7 +54,6 @@ class FlxSoundGroup { if (sounds.contains(sound)) { - @:bypassAccessor sound.group = null; sounds.remove(sound); sound.updateTransform(); diff --git a/flixel/system/FlxAssets.hx b/flixel/system/FlxAssets.hx index 7bc4db3e92..db579ff589 100644 --- a/flixel/system/FlxAssets.hx +++ b/flixel/system/FlxAssets.hx @@ -49,10 +49,6 @@ abstract FlxAngelCodeAsset(OneOfThree) from Xml from String } } - -@:deprecated("`FlxAngelCodeXmlAsset` is deprecated, use `FlxAngelCodeAsset` instead")// 5.6.0 -typedef FlxAngelCodeXmlAsset = FlxAngelCodeAsset; - abstract FlxXmlAsset(OneOfTwo) from Xml from String { public function getXml() @@ -347,19 +343,6 @@ class FlxAssets return null; } - - /** - * Loads an OpenFL sound asset from the given asset id. If an extension not provided the - * `defaultSoundExtension` is used (defaults to "ogg" on non-flash targets). - * - * @param id The asset id of the local sound file. - * @return The sound file. - */ - @:deprecated("FlxAssets.getSound is deprecated, use getSoundAddExtension, instead") - public static inline function getSound(id:String):Sound - { - return getSoundAddExtension(id); - } /** * Loads an OpenFL sound asset from the given asset id. If an extension not provided the diff --git a/flixel/system/debug/interaction/Interaction.hx b/flixel/system/debug/interaction/Interaction.hx index 8c6b4c7d77..7b0f6f5256 100644 --- a/flixel/system/debug/interaction/Interaction.hx +++ b/flixel/system/debug/interaction/Interaction.hx @@ -626,12 +626,6 @@ class Interaction extends Window return items; } - @:deprecated("findItemsWithinState is deprecated, use getItemsWithinState or addItemsWithinState") - public inline function findItemsWithinState(items:Array, state:FlxState, area:FlxRect):Void - { - addItemsWithinState(cast items, state, area); - } - /** * finds all items in the state and substate that are within the given area and * adds them to the given list. @@ -662,22 +656,6 @@ class Interaction extends Window return getTopItemWithinArea(state.members, area); } - - /** - * Find all items within an area. In order to improve performance and reduce temporary allocations, - * the method has no return, you must pass an array where items will be placed. The method decides - * if an item is within the searching area or not by checking if the item's hitbox (obtained from - * `getHitbox()`) overlaps the area parameter. - * - * @param items Array where the method will place all found items. Any previous content in the array will be preserved. - * @param members Array where the method will recursively search for items. - * @param area A rectangle that describes the area where the method should search within. - */ - @:deprecated("findItemsWithinArea is deprecated, use addItemsWithinArea")// since 5.6.0 - public inline function findItemsWithinArea(items:Array, members:Array, area:FlxRect):Void - { - addItemsWithinArea(cast items, members, area); - } inline function isOverObject(object:FlxObject, area:FlxRect):Bool { diff --git a/flixel/system/debug/log/LogStyle.hx b/flixel/system/debug/log/LogStyle.hx index 91707aaab3..e5b43836a5 100644 --- a/flixel/system/debug/log/LogStyle.hx +++ b/flixel/system/debug/log/LogStyle.hx @@ -40,14 +40,7 @@ class LogStyle /** * A callback function that is called when this LogStyle is used - */ - @:deprecated("callbackFunction is deprecated, use callback, instead") - public var callbackFunction:()->Void; - - /** - * A callback function that is called when this LogStyle is used - * **Note:** Unlike the deprecated `callbackFunction`, this is called every time, - * even when logged with `once = true` and even in release mode. + * **Note:** This is called every time, even when logged with `once = true` and even in release mode */ public final onLog = new FlxTypedSignal<(data:Any, ?pos:PosInfos) -> Void>(); @@ -73,7 +66,6 @@ class LogStyle * @param callback A callback function that is called when this LogStyle is used * @param throwError Whether an error is thrown when this LogStyle is used */ - @:haxe.warning("-WDeprecated") public function new(prefix = "", color = "FFFFFF", size = 12, bold = false, italic = false, underlined = false, ?errorSound:String, openConsole = false, ?callbackFunction:()->Void, ?callback:(Any, ?PosInfos)->Void, throwException = false) { @@ -85,7 +77,6 @@ class LogStyle this.underlined = underlined; this.errorSound = errorSound; this.openConsole = openConsole; - this.callbackFunction = callbackFunction; if (callback != null) onLog.add(callback); this.throwException = throwException; diff --git a/flixel/system/frontEnds/InputFrontEnd.hx b/flixel/system/frontEnds/InputFrontEnd.hx index 5a3e0e60b4..42bad0e6df 100644 --- a/flixel/system/frontEnds/InputFrontEnd.hx +++ b/flixel/system/frontEnds/InputFrontEnd.hx @@ -19,16 +19,6 @@ class InputFrontEnd * Disable if you need persistent input states across states. */ public var resetOnStateSwitch:Bool = true; - - /** - * Add an input to the system - */ - @:generic - @:deprecated("add is deprecated, use addUniqueType") - public inline function add(input:T):T - { - return addUniqueType(input); - } /** * Add an input to the system, unless the same instance was already added diff --git a/flixel/system/frontEnds/LogFrontEnd.hx b/flixel/system/frontEnds/LogFrontEnd.hx index 71031aca89..dec3a30956 100644 --- a/flixel/system/frontEnds/LogFrontEnd.hx +++ b/flixel/system/frontEnds/LogFrontEnd.hx @@ -44,7 +44,6 @@ class LogFrontEnd * @param style The LogStyle to use, for example LogStyle.WARNING. You can also create your own by importing the LogStyle class. * @param fireOnce Whether you only want to log the Data in case it hasn't been added already */ - @:haxe.warning("-WDeprecated") public function advanced(data:Any, ?style:LogStyle, fireOnce = false, ?pos:PosInfos):Void { if (style == null) @@ -71,9 +70,6 @@ class LogFrontEnd if (style.openConsole) FlxG.debugger.visible = true; - - if (style.callbackFunction != null) - style.callbackFunction(); } #end diff --git a/flixel/system/frontEnds/PluginFrontEnd.hx b/flixel/system/frontEnds/PluginFrontEnd.hx index e34aefef17..d708232112 100644 --- a/flixel/system/frontEnds/PluginFrontEnd.hx +++ b/flixel/system/frontEnds/PluginFrontEnd.hx @@ -23,20 +23,6 @@ class PluginFrontEnd * @since 5.7.0 */ public var drawOnTop:Bool = false; - - /** - * Adds a new plugin to the global plugin array. - * **DEPRECATED:** In a later version this will be changed to behave like `addPlugin`. - * - * @param plugin Any object that extends FlxBasic. Useful for managers and other things. - * @return The same plugin you passed in. - */ - @:generic - @:deprecated("FlxG.plugins.add is deprecated, use `addIfUniqueType` or `addPlugin`, instead.\nNote: In a later version `add` will be changed to behave like `addPlugin`") - public inline function add(plugin:T):T - { - return addIfUniqueType(plugin); - } /** * Adds a new plugin to the global plugin array, does not check for existing instances of this type. @@ -104,18 +90,6 @@ class PluginFrontEnd list.remove(plugin); return plugin; } - - /** - * Removes all instances of a plugin from the global plugin array. - * - * @param type The class name of the plugin type you want removed from the array. - * @return Whether or not at least one instance of this plugin type was removed. - */ - @:deprecated("FlxG.plugin.removeType is deprecated, use `removeAllByType` instead") - public inline function removeType(type:Class):Bool - { - return removeAllByType(type); - } public function removeAllByType(type:Class):Bool { diff --git a/flixel/system/frontEnds/SoundFrontEnd.hx b/flixel/system/frontEnds/SoundFrontEnd.hx index e07db4ec29..5e9adec604 100644 --- a/flixel/system/frontEnds/SoundFrontEnd.hx +++ b/flixel/system/frontEnds/SoundFrontEnd.hx @@ -28,14 +28,7 @@ class SoundFrontEnd * Whether or not the game sounds are muted. */ public var muted:Bool = false; - - /** - * Set this hook to get a callback whenever the volume changes. - * Function should take the form myVolumeHandler(volume:Float). - */ - @:deprecated("volumeHandler is deprecated, use onVolumeChange, instead") - public var volumeHandler:Float->Void; - + /** * A signal that gets dispatched whenever the volume changes. */ @@ -338,18 +331,12 @@ class SoundFrontEnd /** * Toggles muted, also activating the sound tray. */ - @:haxe.warning("-WDeprecated") public function toggleMuted():Void { muted = !muted; - - if (volumeHandler != null) - { - volumeHandler(muted ? 0 : volume); - } - + onVolumeChange.dispatch(muted ? 0 : volume); - + showSoundTray(true); } @@ -464,18 +451,12 @@ class SoundFrontEnd } #end - @:haxe.warning("-WDeprecated") function set_volume(Volume:Float):Float { Volume = FlxMath.bound(Volume, 0, 1); - - if (volumeHandler != null) - { - volumeHandler(muted ? 0 : Volume); - } - + onVolumeChange.dispatch(muted ? 0 : Volume); - + return volume = Volume; } } diff --git a/flixel/text/FlxBitmapText.hx b/flixel/text/FlxBitmapText.hx index 4d0ec1551b..5344b6e838 100644 --- a/flixel/text/FlxBitmapText.hx +++ b/flixel/text/FlxBitmapText.hx @@ -76,19 +76,6 @@ class FlxBitmapText extends FlxSprite */ public var wrap(default, set):Wrap = WORD(NEVER); - /** - * A Boolean value that indicates whether the text field has word wrap. - */ - @:deprecated("wordWrap is deprecated use wrap, instead") - public var wordWrap(get, set):Bool; - - /** - * Whether word wrapping algorithm should wrap lines by words or by single character. - * Default value is true. - */ - @:deprecated("wrapByWord is deprecated use wrap with values CHAR or WORD, instead") - public var wrapByWord(get, set):Bool; - /** * Whether this text field have fixed width or not. * Default value if true. @@ -152,18 +139,6 @@ class FlxBitmapText extends FlxSprite * NOTE: If the borderSize is 1, borderQuality of 0 or 1 will have the exact same effect (and performance). */ public var borderQuality(default, set):Float = 0; - - /** - * Internal handler for deprecated `shadowOffset` field - */ - var _shadowOffset:FlxPoint = FlxPoint.get(1, 1); - - /** - * Offset that is applied to the shadow border style, if active. - * `x` and `y` are multiplied by `borderSize`. Default is `(1, 1)`, or lower-right corner. - */ - @:deprecated("shadowOffset is deprecated, use setBorderStyle(SHADOW_XY(offsetX, offsetY)), instead") // 5.9.0 - public var shadowOffset(get, never):FlxPoint; /** * Specifies whether the text should have a background. It is recommended to use a @@ -251,7 +226,6 @@ class FlxBitmapText extends FlxSprite _lines = null; _linesWidth = null; - _shadowOffset = FlxDestroyUtil.put(_shadowOffset); textBitmap = FlxDestroyUtil.dispose(textBitmap); _colorParams = null; @@ -1300,24 +1274,6 @@ class FlxBitmapText extends FlxSprite // render border switch (borderStyle) { - case SHADOW if (_shadowOffset.x != 1 || _shadowOffset.y != 1): - var iterationsX = Math.round(Math.abs(_shadowOffset.x) * borderQuality); - iterationsX = (iterationsX <= 0) ? 1 : iterationsX; - - var iterationsY = Math.round(Math.abs(_shadowOffset.y) * borderQuality); - iterationsY = (iterationsY <= 0) ? 1 : iterationsY; - - final deltaX = Math.round(_shadowOffset.x / iterationsX); - final deltaY = Math.round(_shadowOffset.y / iterationsY); - - for (iterY in 0...iterationsY) - { - for (iterX in 0...iterationsX) - { - drawText(deltaX * (iterX + 1), deltaY * (iterY + 1), isFront, bitmap, useTiles); - } - } - case SHADOW: final iterations = borderQuality < 1 ? 1 : Std.int(Math.abs(borderSize) * borderQuality); final delta = borderSize / iterations; @@ -1496,10 +1452,6 @@ class FlxBitmapText extends FlxSprite borderColor = color; borderSize = size; borderQuality = quality; - if (borderStyle == FlxTextBorderStyle.SHADOW) - { - _shadowOffset.set(borderSize, borderSize); - } pendingTextBitmapChange = true; } @@ -1582,27 +1534,6 @@ class FlxBitmapText extends FlxSprite return wrap = value; } - function get_wordWrap():Bool - { - return wrap != NONE; - } - - function set_wordWrap(value:Bool):Bool - { - wrap = value ? WORD(NEVER) : NONE; - return value; - } - - function get_wrapByWord():Bool - { - return wrap.match(WORD(_)); - } - function set_wrapByWord(value:Bool):Bool - { - wrap = value ? WORD(NEVER) : CHAR; - return value; - } - function set_autoSize(value:Bool):Bool { if (autoSize != value) @@ -1758,12 +1689,7 @@ class FlxBitmapText extends FlxSprite checkPendingChanges(true); return super.get_height(); } - - inline function get_shadowOffset() - { - return _shadowOffset; - } - + /** * Checks if the specified code is one of the Unicode Combining Diacritical Marks * @param Code The charactercode we want to check diff --git a/flixel/text/FlxText.hx b/flixel/text/FlxText.hx index 5b3a797f8b..4c3f98037c 100644 --- a/flixel/text/FlxText.hx +++ b/flixel/text/FlxText.hx @@ -156,19 +156,7 @@ class FlxText extends FlxSprite public var autoSize(get, set):Bool; var _autoHeight:Bool = true; - - /** - * Internal handler for deprecated `shadowOffset` field - */ - var _shadowOffset:FlxPoint = FlxPoint.get(1, 1); - - /** - * Offset that is applied to the shadow border style, if active. - * `x` and `y` are multiplied by `borderSize`. Default is `(1, 1)`, or lower-right corner. - */ - @:deprecated("shadowOffset is deprecated, use setBorderStyle(SHADOW_XY(offsetX, offsetY)), instead") // 5.9.0 - public var shadowOffset(get, never):FlxPoint; - + /** * Used to offset the graphic to account for the border */ @@ -257,7 +245,6 @@ class FlxText extends FlxSprite _font = null; _defaultFormat = null; _formatAdjusted = null; - _shadowOffset = FlxDestroyUtil.put(_shadowOffset); _graphicOffset = FlxDestroyUtil.put(_graphicOffset); super.destroy(); } @@ -847,11 +834,6 @@ class FlxText extends FlxSprite regenGraphic(); return super.get_height(); } - - inline function get_shadowOffset() - { - return _shadowOffset; - } override function updateColorTransform():Void { @@ -887,11 +869,7 @@ class FlxText extends FlxSprite var borderHeight:Float = 0; switch(borderStyle) { - case SHADOW if (_shadowOffset.x != 1 || _shadowOffset.y != 1): - borderWidth += Math.abs(_shadowOffset.x); - borderHeight += Math.abs(_shadowOffset.y); - - case SHADOW: // With the default shadowOffset value + case SHADOW: borderWidth += Math.abs(borderSize); borderHeight += Math.abs(borderSize); @@ -1089,11 +1067,7 @@ class FlxText extends FlxSprite // offset entire image to fit the border switch(borderStyle) { - case SHADOW if (_shadowOffset.x != 1 || _shadowOffset.y != 1): - _graphicOffset.x = _shadowOffset.x > 0 ? _shadowOffset.x : 0; - _graphicOffset.y = _shadowOffset.y > 0 ? _shadowOffset.y : 0; - - case SHADOW: // With the default shadowOffset value + case SHADOW: if (borderSize < 0) _graphicOffset.set(-borderSize, -borderSize); @@ -1111,20 +1085,7 @@ class FlxText extends FlxSprite switch (borderStyle) { - case SHADOW if (_shadowOffset.x != 1 || _shadowOffset.y != 1): - // Render a shadow beneath the text using the shadowOffset property - applyFormats(_formatAdjusted, true); - - var iterations = borderQuality < 1 ? 1 : Std.int(Math.abs(borderSize) * borderQuality); - final delta = borderSize / iterations; - for (i in 0...iterations) - { - copyTextWithOffset(delta, delta); - } - - _matrix.translate(-_shadowOffset.x * borderSize, -_shadowOffset.y * borderSize); - - case SHADOW: // With the default shadowOffset value + case SHADOW: // Render a shadow beneath the text applyFormats(_formatAdjusted, true); diff --git a/flixel/tile/FlxBaseTilemap.hx b/flixel/tile/FlxBaseTilemap.hx index 4858ac21b3..2c32c79544 100644 --- a/flixel/tile/FlxBaseTilemap.hx +++ b/flixel/tile/FlxBaseTilemap.hx @@ -15,7 +15,6 @@ import openfl.display.BitmapData; using StringTools; -@:autoBuild(flixel.system.macros.FlxMacroUtil.deprecateOverride("overlapsWithCallback", "overlapsWithCallback is deprecated, use objectOverlapsTiles")) class FlxBaseTilemap extends FlxObject { /** @@ -184,23 +183,6 @@ class FlxBaseTilemap extends FlxObject { throw "getRowPos must be implemented"; } - - /** - * **Note:** This method name is misleading! It does not return a `tileIndex`, it returns a `mapIndex` - * - * @param worldPos A location in the world - * @return The `mapIndex` placed at the given world location - */ - @:deprecated("getTileIndexByCoords is deprecated, use getMapIndex, instead") // 5.9.0 - public function getTileIndexByCoords(worldPos:FlxPoint):Int - { - return getMapIndex(worldPos); - } - @:deprecated("getTileCoordsByIndex is deprecated, use getTilePos, instead") // 5.9.0 - public function getTileCoordsByIndex(mapIndex:Int, midpoint = true):FlxPoint - { - return getTilePos(mapIndex, midpoint); - } /** * Shoots a ray from the start point to the end point. @@ -316,13 +298,7 @@ class FlxBaseTilemap extends FlxObject { throw "overlapsWithCallback must be implemented"; } - - @:deprecated("overlapsWithCallback is deprecated, use objectOverlapsTiles(object, callback, pos), instead") // 5.9.0 - public function overlapsWithCallback(object:FlxObject, ?callback:(FlxObject, FlxObject)->Bool, flipCallbackParams = false, ?position:FlxPoint):Bool - { - return objectOverlapsTiles(object, (t, o)->{ return flipCallbackParams ? callback(o, t) : callback(t, o); }, position); - } - + /** * Checks if the Object overlaps any tiles with any collision flags set, * and calls the specified callback function (if there is one). @@ -1134,34 +1110,7 @@ class FlxBaseTilemap extends FlxObject } return result; } - - /** - * Check the value of a particular tile. - * - * @param column The grid X location, in tiles - * @param row The grid Y location, in tiles - * @return The tile index of the tile at this location - */ - @:deprecated("getTile is deprecated use getTileIndex(column, row), instead") // 5.9.0 - public function getTile(column:Int, row:Int):Int - { - return getTileIndex(column, row); - } - - /** - * Get the `tileIndex` at the given map location - * - * **Note:** A tile's `mapIndex` can be calculated via `row * widthInTiles + column` - * - * @param mapIndex The desired location in the map - * @return An integer containing the value of the tile at this spot in the array. - */ - @:deprecated("getTileByIndex is deprecated use getTileIndex(mapIndex), instead") // 5.9.0 - public function getTileByIndex(mapIndex:Int):Int - { - return getTileIndex(mapIndex); - } - + /** * Gets the collision flags of the tile at the given location * @@ -1177,23 +1126,7 @@ class FlxBaseTilemap extends FlxObject { return getTileData(mapIndex).allowCollisions; } - - /** - * Returns a new array full of every map index of the requested tile type - * - * **Note:** Unlike `getAllMapIndices` this will return `null` if no tiles are found - * - * @param index The requested tile type. - * @return An Array with a list of all map indices of that tile type. - */ - @:deprecated("getTileInstances is deprecated, use getTileIndices, instead")// 5.9.0 - public inline function getTileInstances(tileIndex:Int):Array - { - // for backwards compat, return `null` if none are found - final result = getAllMapIndices(tileIndex); - return result.length == 0 ? null : result; - } - + /** * Returns a new array full of every map index of the requested tile type. * @@ -1294,36 +1227,7 @@ class FlxBaseTilemap extends FlxObject { return setTileHelper(getMapIndexAt(worldX, worldY), tileIndex, redraw); } - - /** - * Change the data and graphic of a tile in the tilemap. - * - * @param column The grid X location, in tiles - * @param row The grid Y location, in tiles - * @param tileIndex The new integer data you wish to inject. - * @param redraw Whether the graphical representation of this tile should change. - * @return Whether or not the tile was actually changed. - */ - @:deprecated("setTile is deprecated, use setTileIndex(column, row, tileIndex,...), instead") // 5.9.0 - public function setTile(column:Int, row:Int, tileIndex:Int, redraw = true):Bool - { - return setTileIndex(getMapIndex(column, row), tileIndex, redraw); - } - - /** - * Change the data and graphic of a tile in the tilemap. - * - * @param mapIndex The slot in the data array (Y * widthInTiles + X) where this tile is stored. - * @param tileIndex The new tileIndex to place at the mapIndex - * @param redraw Whether the graphical representation of this tile should change. - * @return Whether or not the tile was actually changed. - */ - @:deprecated("setTileByIndex is deprecated, use setTileIndex(mapIndex, tileIndex,...), instead") // 5.9.0 - public function setTileByIndex(mapIndex:Int, tileIndex:Int, redraw = true):Bool - { - return setTileIndex(mapIndex, tileIndex, redraw); - } - + function setTileHelper(mapIndex:Int, tileIndex:Int, redraw = true):Bool { if (!tileExists(mapIndex)) diff --git a/flixel/tile/FlxTilemap.hx b/flixel/tile/FlxTilemap.hx index 80aecfc4d9..ba985ef62e 100644 --- a/flixel/tile/FlxTilemap.hx +++ b/flixel/tile/FlxTilemap.hx @@ -850,20 +850,7 @@ class FlxTypedTilemap extends FlxBaseTilemap { return y + row * scaledTileHeight + (midpoint ? scaledTileHeight * 0.5 : 0); } - - /** - * Returns a new array full of every coordinate of the requested tile type. - * - * @param index The requested tile type. - * @param midpoint Whether to return the coordinates of the tile midpoint, or upper left corner. Default is true, return midpoint. - * @return An Array with a list of all the coordinates of that tile type. - */ - @:deprecated("getTileCoords is deprecated, use getAllTilePos, instead") - public function getTileCoords(tileIndex:Int, midpoint = true):Array - { - return getAllTilePos(tileIndex, midpoint); - } - + /** * Call this function to lock the automatic camera to the map's edges. * @@ -1287,7 +1274,7 @@ class FlxTypedTilemap extends FlxBaseTilemap #if FLX_DEBUG if (FlxG.debugger.drawDebug && !ignoreDrawDebug) { - if (tile.allowCollisions <= NONE) + if (tile.allowCollisions == NONE) { debugTile = _debugTileNotSolid; } diff --git a/flixel/ui/FlxAnalog.hx b/flixel/ui/FlxAnalog.hx deleted file mode 100644 index 98c96b15ed..0000000000 --- a/flixel/ui/FlxAnalog.hx +++ /dev/null @@ -1,460 +0,0 @@ -package flixel.ui; - -import flixel.FlxG; -import flixel.FlxSprite; -import flixel.group.FlxSpriteContainer; -import flixel.input.touch.FlxTouch; -import flixel.math.FlxAngle; -import flixel.math.FlxMath; -import flixel.math.FlxPoint; -import flixel.math.FlxRect; -import flixel.system.FlxAssets; -import flixel.util.FlxDestroyUtil; - -/** - * A virtual thumbstick - useful for input on mobile devices. - * - * @author Ka Wing Chin - */ -@:deprecated("FlxAnalog is deprecated, use FlxVirtualStick or FlxVirtualPad, instead") -class FlxAnalog extends FlxSpriteContainer -{ - /** - * Shows the current state of the button. - */ - public var status:Int = NORMAL; - - public var thumb:FlxSprite; - - /** - * The background of the joystick, also known as the base. - */ - public var base:FlxSprite; - - /** - * This function is called when the button is released. - */ - public var onUp:Void->Void; - - /** - * This function is called when the button is pressed down. - */ - public var onDown:Void->Void; - - /** - * This function is called when the mouse goes over the button. - */ - public var onOver:Void->Void; - - /** - * This function is called when the button is hold down. - */ - public var onPressed:Void->Void; - - /** - * Used with public variable status, means not highlighted or pressed. - */ - static inline var NORMAL:Int = 0; - - /** - * Used with public variable status, means highlighted (usually from mouse over). - */ - static inline var HIGHLIGHT:Int = 1; - - /** - * Used with public variable status, means pressed (usually from mouse click). - */ - static inline var PRESSED:Int = 2; - - /** - * A list of analogs that are currently active. - */ - static var _analogs:Array = []; - - #if FLX_TOUCH - /** - * The current pointer that's active on the analog. - */ - var _currentTouch:FlxTouch; - - /** - * Helper array for checking touches - */ - var _tempTouches:Array = []; - #end - - /** - * The area which the joystick will react. - */ - var _zone:FlxRect = FlxRect.get(); - - /** - * The radius in which the stick can move. - */ - var _radius:Float = 0; - - var _direction:Float = 0; - var _amount:Float = 0; - - /** - * The speed of easing when the thumb is released. - */ - var _ease:Float; - - /** - * Create a virtual thumbstick - useful for input on mobile devices. - * - * @param X The X-coordinate of the point in space. - * @param Y The Y-coordinate of the point in space. - * @param Radius The radius where the thumb can move. If 0, half the base's width will be used. - * @param Ease Used to smoothly back thumb to center. Must be between 0 and (FlxG.updateFrameRate / 60). - * @param BaseGraphic The graphic you want to display as base of the joystick. - * @param ThumbGraphic The graphic you want to display as thumb of the joystick. - */ - public function new(X:Float = 0, Y:Float = 0, Radius:Float = 0, Ease:Float = 0.25, ?BaseGraphic:FlxGraphicAsset, ?ThumbGraphic:FlxGraphicAsset) - { - super(); - - _radius = Radius; - _ease = FlxMath.bound(Ease, 0, 60 / FlxG.updateFramerate); - - _analogs.push(this); - - _point = FlxPoint.get(); - - createBase(BaseGraphic); - createThumb(ThumbGraphic); - - x = X; - y = Y; - - scrollFactor.set(); - moves = false; - } - - /** - * Creates the background of the analog stick. - */ - function createBase(?Graphic:FlxGraphicAsset):Void - { - base = new FlxSprite(0, 0, Graphic); - if (Graphic == null) - { - base.frames = FlxAssets.getVirtualInputFrames(); - base.animation.frameName = "base"; - base.resetSizeFromFrame(); - } - base.x += -base.width * 0.5; - base.y += -base.height * 0.5; - base.scrollFactor.set(); - base.solid = false; - - #if FLX_DEBUG - base.ignoreDrawDebug = true; - #end - - add(base); - } - - /** - * Creates the thumb of the analog stick. - */ - function createThumb(?Graphic:FlxGraphicAsset):Void - { - thumb = new FlxSprite(0, 0, Graphic); - if (Graphic == null) - { - thumb.frames = FlxAssets.getVirtualInputFrames(); - thumb.animation.frameName = "thumb"; - thumb.resetSizeFromFrame(); - } - thumb.scrollFactor.set(); - thumb.solid = false; - - #if FLX_DEBUG - thumb.ignoreDrawDebug = true; - #end - - add(thumb); - } - - /** - * Creates the touch zone. It's based on the size of the background. - * The thumb will react when the mouse is in the zone. - */ - function createZone():Void - { - if (base != null && _radius == 0) - _radius = base.width * 0.5; - - _zone.set(x - _radius, y - _radius, 2 * _radius, 2 * _radius); - } - - /** - * Clean up memory. - */ - override public function destroy():Void - { - super.destroy(); - - _zone = FlxDestroyUtil.put(_zone); - - _analogs.remove(this); - onUp = null; - onDown = null; - onOver = null; - onPressed = null; - thumb = null; - base = null; - - #if FLX_TOUCH - _currentTouch = null; - _tempTouches = null; - #end - } - - /** - * Update the behavior. - */ - override public function update(elapsed:Float):Void - { - var offAll:Bool = true; - - #if FLX_MOUSE - _point.set(FlxG.mouse.viewX, FlxG.mouse.viewY); - - if (!updateAnalog(_point, FlxG.mouse.pressed, FlxG.mouse.justPressed, FlxG.mouse.justReleased)) - { - offAll = false; - } - #end - - // There is no reason to get into the loop if their is already a pointer on the analog - #if FLX_TOUCH - if (_currentTouch != null) - { - _tempTouches.push(_currentTouch); - } - else - { - for (touch in FlxG.touches.list) - { - var touchInserted:Bool = false; - - for (analog in _analogs) - { - // Check whether the pointer is already taken by another analog. - // TODO: check this place. This line was 'if (analog != this && analog._currentTouch != touch && touchInserted == false)' - if (analog == this && analog._currentTouch != touch && !touchInserted) - { - _tempTouches.push(touch); - touchInserted = true; - } - } - } - } - - for (touch in _tempTouches) - { - _point = touch.getWorldPosition(FlxG.camera, _point); - - if (!updateAnalog(_point, touch.pressed, touch.justPressed, touch.justReleased, touch)) - { - offAll = false; - break; - } - } - #end - - if ((status == HIGHLIGHT || status == NORMAL) && _amount != 0) - { - _amount -= _amount * _ease * FlxG.updateFramerate / 60; - - if (Math.abs(_amount) < 0.1) - { - _amount = 0; - _direction = 0; - } - } - - thumb.x = x + Math.cos(_direction) * _amount * _radius - (thumb.width * 0.5); - thumb.y = y + Math.sin(_direction) * _amount * _radius - (thumb.height * 0.5); - - if (offAll) - { - status = NORMAL; - } - - #if FLX_TOUCH - _tempTouches.splice(0, _tempTouches.length); - #end - - super.update(elapsed); - } - - function updateAnalog(TouchPoint:FlxPoint, Pressed:Bool, JustPressed:Bool, JustReleased:Bool, ?Touch:FlxTouch):Bool - { - var offAll:Bool = true; - - #if FLX_TOUCH - // Use the touch to figure out the world position if it's passed in, as - // the screen coordinates passed in touchPoint are wrong - // if the control is used in a group, for example. - if (Touch != null) - { - TouchPoint.set(Touch.viewX, Touch.viewY); - } - #end - - if (_zone.containsPoint(TouchPoint) || (status == PRESSED)) - { - offAll = false; - - if (Pressed) - { - #if FLX_TOUCH - if (Touch != null) - { - _currentTouch = Touch; - } - #end - status = PRESSED; - - if (JustPressed) - { - if (onDown != null) - { - onDown(); - } - } - - if (status == PRESSED) - { - if (onPressed != null) - { - onPressed(); - } - - var dx:Float = TouchPoint.x - x; - var dy:Float = TouchPoint.y - y; - - var dist:Float = Math.sqrt(dx * dx + dy * dy); - - if (dist < 1) - { - dist = 0; - } - - _direction = Math.atan2(dy, dx); - _amount = Math.min(_radius, dist) / _radius; - - acceleration.x = Math.cos(_direction) * _amount; - acceleration.y = Math.sin(_direction) * _amount; - } - } - else if (JustReleased && status == PRESSED) - { - #if FLX_TOUCH - _currentTouch = null; - #end - - status = HIGHLIGHT; - - if (onUp != null) - { - onUp(); - } - - acceleration.set(); - } - - if (status == NORMAL) - { - status = HIGHLIGHT; - - if (onOver != null) - { - onOver(); - } - } - } - - return offAll; - } - - /** - * Returns the angle in degrees. - */ - public function getAngle():Float - { - return _direction * FlxAngle.TO_DEG; - } - - /** - * Whether the thumb is pressed or not. - */ - public var pressed(get, never):Bool; - - inline function get_pressed():Bool - { - return status == PRESSED; - } - - /** - * Whether the thumb is just pressed or not. - */ - public var justPressed(get, never):Bool; - - function get_justPressed():Bool - { - #if FLX_MOUSE - return FlxG.mouse.justPressed && status == PRESSED; - #end - - #if FLX_TOUCH - if (_currentTouch != null) - { - return _currentTouch.justPressed && status == PRESSED; - } - #end - - return false; - } - - /** - * Whether the thumb is just released or not. - */ - public var justReleased(get, never):Bool; - - function get_justReleased():Bool - { - #if FLX_MOUSE - return FlxG.mouse.justReleased && status == HIGHLIGHT; - #end - - #if FLX_TOUCH - if (_currentTouch != null) - { - return _currentTouch.justReleased && status == HIGHLIGHT; - } - #end - - return false; - } - - override function set_x(X:Float):Float - { - super.set_x(X); - createZone(); - - return X; - } - - override function set_y(Y:Float):Float - { - super.set_y(Y); - createZone(); - - return Y; - } -} diff --git a/flixel/ui/FlxButton.hx b/flixel/ui/FlxButton.hx index d30f35318b..7cbcb8dfc5 100644 --- a/flixel/ui/FlxButton.hx +++ b/flixel/ui/FlxButton.hx @@ -54,34 +54,6 @@ enum abstract FlxButtonState(Int) to Int */ class FlxButton extends FlxTypedButton { - /** - * Used with public variable status, means not highlighted or pressed. - */ - @:dox(hide) @:noCompletion - @:deprecated("FlxButton.NORMAL is deprecated, use FlxButtonState.NORMAL") - public static inline var NORMAL = FlxButtonState.NORMAL; - - /** - * Used with public variable status, means highlighted (usually from mouse over). - */ - @:dox(hide) @:noCompletion - @:deprecated("FlxButton.HIGHLIGHT is deprecated, use FlxButtonState.HIGHLIGHT") - public static inline var HIGHLIGHT = FlxButtonState.HIGHLIGHT; - - /** - * Used with public variable status, means pressed (usually from mouse click). - */ - @:dox(hide) @:noCompletion - @:deprecated("FlxButton.PRESSED is deprecated, use FlxButtonState.PRESSED") - public static inline var PRESSED = FlxButtonState.PRESSED; - - /** - * Used with public variable status, means non interactible. - */ - @:dox(hide) @:noCompletion - @:deprecated("FlxButton.DISABLED is deprecated, use FlxButtonState.DISABLED") - public static inline var DISABLED = FlxButtonState.DISABLED; - /** * Shortcut to setting label.text */ @@ -174,13 +146,6 @@ class FlxTypedButton extends FlxSprite implements IFlxInput */ public var labelAlphas:Array = [0.8, 1.0, 0.5, 0.3]; - /** - * What animation should be played for each status. - * Default is ["normal", "highlight", "pressed"]. - */ - @:deprecated("statusAnimations is deprecated, use status.toString(), instead") - public var statusAnimations:Array = ["normal", "highlight", "pressed", "disabled"]; - /** * Whether you can press the button simply by releasing the touch / mouse button over it (default). * If false, the input has to be pressed while hovering over the button. diff --git a/flixel/ui/FlxVirtualPad.hx b/flixel/ui/FlxVirtualPad.hx index 37b0a5cbce..5bb293249d 100644 --- a/flixel/ui/FlxVirtualPad.hx +++ b/flixel/ui/FlxVirtualPad.hx @@ -1,6 +1,5 @@ package flixel.ui; -import flixel.ui.FlxAnalog; import flixel.FlxG; import flixel.graphics.frames.FlxTileFrames; import flixel.group.FlxSpriteContainer; @@ -33,42 +32,6 @@ class FlxVirtualPad extends FlxSpriteContainer */ public final stick:Null; - @:deprecated("buttonA is deprecated, use getButton(A), instead") - public var buttonA(get, never):Null; - inline function get_buttonA() return actions.getButton(A); - - @:deprecated("buttonB is deprecated, use getButton(B), instead") - public var buttonB(get, never):Null; - inline function get_buttonB() return actions.getButton(B); - - @:deprecated("buttonC is deprecated, use getButton(C), instead") - public var buttonC(get, never):Null; - inline function get_buttonC() return actions.getButton(C); - - @:deprecated("buttonY is deprecated, use getButton(Y), instead") - public var buttonY(get, never):Null; - inline function get_buttonY() return actions.getButton(Y); - - @:deprecated("buttonX is deprecated, use getButton(X), instead") - public var buttonX(get, never):Null; - inline function get_buttonX() return actions.getButton(X); - - @:deprecated("buttonLeft is deprecated, use getButton(LEFT), instead") - public var buttonLeft(get, never):Null; - inline function get_buttonLeft() return dPad.getButton(LEFT); - - @:deprecated("buttonUp is deprecated, use getButton(UP), instead") - public var buttonUp(get, never):Null; - inline function get_buttonUp() return dPad.getButton(UP); - - @:deprecated("buttonRight is deprecated, use getButton(RIGHT), instead") - public var buttonRight(get, never):Null; - inline function get_buttonRight() return dPad.getButton(RIGHT); - - @:deprecated("buttonDown is deprecated, use getButton(DOWN), instead") - public var buttonDown(get, never):Null; - inline function get_buttonDown() return dPad.getButton(DOWN); - /** * Create a gamepad which contains 4 directional buttons and 4 action buttons. * diff --git a/flixel/util/FlxArrayUtil.hx b/flixel/util/FlxArrayUtil.hx index f874e3a016..5eb21b6122 100644 --- a/flixel/util/FlxArrayUtil.hx +++ b/flixel/util/FlxArrayUtil.hx @@ -5,21 +5,6 @@ package flixel.util; */ class FlxArrayUtil { - /** - * Sets the length of an array. - * - * @param array The array. - * @param newLength The length you want the array to have. - */ - @:deprecated("setLength is deprecated, use array.resize instead") - public static inline function setLength(array:Array, newLength:Int):Array - { - if (newLength > 0 && newLength < array.length) - array.resize(newLength); - - return array; - } - /** * Safely removes an element from an array by swapping it with the last element and calling `pop()` * (won't do anything if the element is not in the array). This is a lot faster than regular `splice()`, diff --git a/flixel/util/FlxDirection.hx b/flixel/util/FlxDirection.hx index c389351294..bcb16cf027 100644 --- a/flixel/util/FlxDirection.hx +++ b/flixel/util/FlxDirection.hx @@ -37,26 +37,11 @@ enum abstract FlxDirection(Int) } } - @:deprecated("implicit cast from FlxDirection to Int is deprecated, use toInt()") - @:to - inline function toIntImplicit() - { - return toInt(); - } - - inline public function toInt() { return this; } - @:deprecated("implicit cast from Int to FlxDirection is deprecated, use FlxDirection.fromInt") - @:from - inline static function fromIntImplicit(value:Int):FlxDirection - { - return fromInt(value); - } - public inline static function fromInt(value:Int):FlxDirection { return new FlxDirection(value); diff --git a/flixel/util/FlxDirectionFlags.hx b/flixel/util/FlxDirectionFlags.hx index 86d7b6ab49..268a7e7e9f 100644 --- a/flixel/util/FlxDirectionFlags.hx +++ b/flixel/util/FlxDirectionFlags.hx @@ -134,13 +134,6 @@ enum abstract FlxDirectionFlags(Int) { return fromInt((~this & ANY.toInt())); } - - @:deprecated("implicit cast from FlxDirectionFlags to Int is deprecated, use toInt") - @:to - inline function toIntImplicit() - { - return toInt(); - } public inline function toInt():Int { @@ -177,13 +170,6 @@ enum abstract FlxDirectionFlags(Int) | (up ? UP : NONE) | (down ? DOWN : NONE); } - - @:deprecated("implicit cast from Int to FlxDirectionFlags is deprecated, use FlxDirectionFlags.fromInt") - @:from - inline static function fromIntImplicit(value:Int):FlxDirectionFlags - { - return fromInt(value); - } public inline static function fromInt(value:Int):FlxDirectionFlags { @@ -195,17 +181,6 @@ enum abstract FlxDirectionFlags(Int) { return fromInt(dir.toInt()); } - - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead")// Expose int operators - @:op(A & B) static function and(a:FlxDirectionFlags, b:FlxDirectionFlags):FlxDirectionFlags; - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead") + @:op(A | B) static function or(a:FlxDirectionFlags, b:FlxDirectionFlags):FlxDirectionFlags; - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead") - @:op(A > B) static function gt(a:FlxDirectionFlags, b:FlxDirectionFlags):Bool; - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead") - @:op(A < B) static function lt(a:FlxDirectionFlags, b:FlxDirectionFlags):Bool; - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead") - @:op(A >= B) static function gte(a:FlxDirectionFlags, b:FlxDirectionFlags):Bool; - @:deprecated("FlxDirectionFlags operators are deprecated, use has(), instead") - @:op(A <= B) static function lte(a:FlxDirectionFlags, b:FlxDirectionFlags):Bool; } diff --git a/flixel/util/FlxPool.hx b/flixel/util/FlxPool.hx index c25a8ca880..7e2e138c0f 100644 --- a/flixel/util/FlxPool.hx +++ b/flixel/util/FlxPool.hx @@ -4,37 +4,8 @@ import flixel.FlxG; import flixel.util.FlxDestroyUtil; import flixel.util.typeLimit.OneOfTwo; -/** - * Helper type that allows the `FlxPool` constructor to take the new function param and the old, - * deprecated `Class` param. This will be removed, soon anf FlxPool will only take a function. - */ -abstract PoolFactory(()->T) -{ - @:from - #if FLX_NO_UNIT_TEST - @:deprecated("use `MyType.new` or `()->new MyType()` instead of `MyType`)") - #end - public static inline function fromClass(classRef:Class):PoolFactory - { - return fromFunction(()->Type.createInstance(classRef, [])); - } - - @:from - public static inline function fromFunction(func:()->T):PoolFactory - { - return cast func; - } - - @:allow(flixel.util.FlxPool) - inline function getFunction():()->T - { - return this; - } -} - /** * A generic container that facilitates pooling and recycling of objects. - * WARNING: Pooled objects must have parameter-less constructors: function new() */ class FlxPool implements IFlxPool { @@ -64,12 +35,12 @@ class FlxPool implements IFlxPool /** * Creates a pool of the specified type * @param constructor A function that takes no args and creates an instance, - * example: `FlxRect.new.bind(0, 0, 0, 0)` + * example: `FlxRect.new.bind(0, 0, 0, 0)` or `()->FlxRect.get()` */ - public function new(constructor:PoolFactory) + public function new(constructor) { - _constructor = constructor.getFunction(); + _constructor = constructor; } public function get():T diff --git a/flixel/util/FlxSave.hx b/flixel/util/FlxSave.hx index e364f26e08..f91d1327f2 100644 --- a/flixel/util/FlxSave.hx +++ b/flixel/util/FlxSave.hx @@ -364,8 +364,6 @@ class FlxSave implements IFlxDestroyable FlxG.log.error('Invalid path:"$path", ${reason == null ? "" : reason}.'); case LOAD_ERROR(PARSING(rawData, e)): FlxG.log.error('Error parsing "$rawData", ${e.message}.'); - case found: - throw 'Unexpected status: $found'; } return false; } @@ -764,7 +762,7 @@ enum FlxSaveStatus BOUND(name:String, ?path:String); /** - * There was an issue during `flush`. Previously known as `ERROR(msg:String)` + * There was an issue during `flush` */ SAVE_ERROR(type:SaveFailureType); @@ -772,8 +770,4 @@ enum FlxSaveStatus * There was an issue while loading */ LOAD_ERROR(type:LoadFailureType); - - @:noCompletion - @:deprecated("FlxSaveStatus.ERROR is never used, it has been replaced by SAVE_ERROR") - ERROR(msg:String); } diff --git a/flixel/util/typeLimit/NextState.hx b/flixel/util/typeLimit/NextState.hx index d1979a165a..e1b24cf41d 100644 --- a/flixel/util/typeLimit/NextState.hx +++ b/flixel/util/typeLimit/NextState.hx @@ -1,75 +1,5 @@ package flixel.util.typeLimit; -import flixel.FlxState; - -/** - * A utility type that allows methods to accept multiple types, when dealing with "future" `FlxStates`. - * Prior to HaxeFlixel 6, `FlxG.switchState` and other similar methods took a `FlxState` instance, - * which meant `FlxStates` were instantiated before the previous state was destroyed, potentially - * causing errors. It also meant that states with args couldn't be reset via `FlxG.resetState`. In version - * 5.6.0 and higher, these methods now take a function that returns a newly created state instance. This - * allows the state's instantiation to happen after the previous state is destroyed. - * - * ## examples: - * You can pass the state's contructor in directly: - * ```haxe - * FlxG.switchState(PlayState.new); - * ``` - * You can use short lambas (arrow functions) that return a newly created instance: - * ```haxe - * var levelID = 1; - * FlxG.switchState(()->new PlayState(levelID)); - * ``` - * You can do things the long way, and use an anonymous function: - * ```haxe - * FlxG.switchState(function () { return new PlayState(); }); - * ``` - * [Deprecated] Lastly, you can use the old way and pass in an instance (until it's removed): - * ```haxe - * FlxG.switchState(new PlayState()); - * ``` - * - * @since 5.6.0 - * @see [HaxeFlixel issue #2541](https://github.com/HaxeFlixel/flixel/issues/2541) - */ -abstract NextState(Dynamic) -{ - @:from - @:deprecated("use `MyState.new` or `()->new MyState()` instead of `new MyState()`)") - public static function fromState(state:FlxState):NextState - { - return cast state; - } - - @:from - public static function fromMaker(func:()->FlxState):NextState - { - return cast func; - } - - public function createInstance():FlxState - { - if (this is FlxState) - return cast this; - else if (this is Class) - return Type.createInstance(this, []); - else - return cast this(); - } - - public function getConstructor():()->FlxState - { - if (this is FlxState) - { - return function ():FlxState - { - return cast Type.createInstance(Type.getClass(this), []); - } - } - else - return cast this; - } -} /** * A utility type that allows methods to accept multiple types, when dealing with "future" `FlxStates`. @@ -99,31 +29,17 @@ abstract NextState(Dynamic) * @since 5.6.0 * @see [HaxeFlixel issue #2541](https://github.com/HaxeFlixel/flixel/issues/2541) */ -abstract InitialState(Dynamic) to NextState +abstract NextState(()->FlxState) from ()->FlxState to ()->FlxState { @:from - public static function fromType(state:Class):InitialState + public static function fromType(state:Class):NextState { - return cast state; + return ()->Type.createInstance(state, []); } - @:from - public static function fromMaker(func:()->FlxState):InitialState - { - return cast func; - } - - @:to - public function toNextState():NextState + @:op(a()) + public function createInstance():FlxState { - if (this is Class) - { - return function ():FlxState - { - return cast Type.createInstance(this, []); - } - } - else - return cast this; + return this(); } } \ No newline at end of file diff --git a/tests/unit/src/flixel/FlxStateTest.hx b/tests/unit/src/flixel/FlxStateTest.hx index 5f81512a98..a26f961ee9 100644 --- a/tests/unit/src/flixel/FlxStateTest.hx +++ b/tests/unit/src/flixel/FlxStateTest.hx @@ -27,19 +27,6 @@ class FlxStateTest extends FlxTest Assert.areEqual(nextState, FlxG.state); } - @Test - @:haxe.warning("-WDeprecated") - function testResetStateLegacy() - { - switchState(TestState.new); - var state = FlxG.state; - Assert.areEqual(state, FlxG.state); - - resetState(); - Assert.areNotEqual(state, FlxG.state); - Assert.isTrue(FlxG.state is TestState); - } - @Test function testResetState() { diff --git a/tests/unit/src/flixel/animation/FlxAnimationControllerTest.hx b/tests/unit/src/flixel/animation/FlxAnimationControllerTest.hx index 8e8f119111..f24cf8ae7c 100644 --- a/tests/unit/src/flixel/animation/FlxAnimationControllerTest.hx +++ b/tests/unit/src/flixel/animation/FlxAnimationControllerTest.hx @@ -32,24 +32,6 @@ class FlxAnimationControllerTest extends FlxTest #end } - @Test - @:haxe.warning("-WDeprecated") - function testCallbackAfterFirstLoadGraphic():Void - { - var timesCalled:Int = 0; - var callbackFrameIndex:Int = -1; - sprite.animation.callback = function(s:String, n:Int, i:Int) - { - timesCalled++; - callbackFrameIndex = i; - }; - - loadSpriteSheet(); - - Assert.areEqual(1, timesCalled); - Assert.areEqual(0, callbackFrameIndex); - } - @Test function testOnFrameChangeAfterFirstLoadGraphic():Void { @@ -67,21 +49,6 @@ class FlxAnimationControllerTest extends FlxTest Assert.areEqual(0, callbackFrameIndex); } - @Test - @:haxe.warning("-WDeprecated") - function testOnFrameChangeNoFrameIndexChange():Void - { - var timesCalled:Int = 0; - sprite.animation.callback = function(_, _, _) timesCalled++;// remove later - sprite.animation.onFrameChange.add(function(_, _, _) timesCalled++); - - sprite.animation.frameIndex = 0; - sprite.animation.frameIndex = 0; - sprite.animation.frameIndex = 0; - - Assert.areEqual(0, timesCalled); - } - @Test function testAddUnmodifiedArray():Void { @@ -93,21 +60,6 @@ class FlxAnimationControllerTest extends FlxTest FlxAssert.arraysEqual([0, 1, 2], animation); } - - @Test // #1781 - @:haxe.warning("-WDeprecated") - function testFinishCallbackOnce():Void - { - loadSpriteSheet(); - sprite.animation.add("animation", [0, 1, 0], 3000, false); - - var timesCalled = 0; - sprite.animation.finishCallback = function(_) timesCalled++; - sprite.animation.play("animation"); - - step(); - Assert.areEqual(1, timesCalled); - } @Test // #1781 function testOnFinishOnce():Void diff --git a/tests/unit/src/flixel/path/FlxPathTest.hx b/tests/unit/src/flixel/path/FlxPathTest.hx index 336ea0348d..fe0c7abd63 100644 --- a/tests/unit/src/flixel/path/FlxPathTest.hx +++ b/tests/unit/src/flixel/path/FlxPathTest.hx @@ -41,19 +41,6 @@ class FlxPathTest extends FlxTest Assert.isFalse(object.immovable); } - @Test - @:haxe.warning("-WDeprecated") - function testCancelNoCallback() - { - startPath(); - path.onComplete = function(_) - { - Assert.fail("Callback called"); - }; - path.cancel(); - step(); - } - @Test function testAddAtNoCrashOnEmptyPath() { diff --git a/tests/unit/src/flixel/sound/FlxSoundGroupTest.hx b/tests/unit/src/flixel/sound/FlxSoundGroupTest.hx index a33efd884f..2b3960fd63 100644 --- a/tests/unit/src/flixel/sound/FlxSoundGroupTest.hx +++ b/tests/unit/src/flixel/sound/FlxSoundGroupTest.hx @@ -16,16 +16,4 @@ class FlxSoundGroupTest Assert.areEqual(0, group.sounds.length); Assert.areEqual(1, FlxG.sound.defaultSoundGroup.sounds.length); } - - @:haxe.warning("-WDeprecated") - function testSetter() - { - var group = new FlxSoundGroup(); - var sound = new FlxSound(); - sound.group = group; - Assert.areEqual(1, group.sounds.length); - sound.group = FlxG.sound.defaultSoundGroup; - Assert.areEqual(0, group.sounds.length); - Assert.areEqual(1, FlxG.sound.defaultSoundGroup.sounds.length); - } } diff --git a/tests/unit/src/flixel/system/frontEnds/InputFrontEndTest.hx b/tests/unit/src/flixel/system/frontEnds/InputFrontEndTest.hx index 43e6272e59..1511e5e29f 100644 --- a/tests/unit/src/flixel/system/frontEnds/InputFrontEndTest.hx +++ b/tests/unit/src/flixel/system/frontEnds/InputFrontEndTest.hx @@ -16,19 +16,6 @@ class InputFrontEndTest inputs = new InputFrontEnd(); } - @Test - @:haxe.warning("-WDeprecated") - function testAdd() - { - final input1 = new CustomInputManager(); - inputs.add(input1); - FlxAssert.arrayContains(inputs.list, input1); - - final input2 = new CustomInputManager(); - inputs.add(input2); - FlxAssert.arrayNotContains(inputs.list, input2); - } - @Test function testAddUniqueType() { diff --git a/tests/unit/src/flixel/tile/FlxTilemapTest.hx b/tests/unit/src/flixel/tile/FlxTilemapTest.hx index c721c1554e..d10a645b9b 100644 --- a/tests/unit/src/flixel/tile/FlxTilemapTest.hx +++ b/tests/unit/src/flixel/tile/FlxTilemapTest.hx @@ -171,16 +171,6 @@ class FlxTilemapTest extends FlxTest } @Test // #1546 - @:haxe.warning("-WDeprecated") - function testOffMapOverlap() - { - tilemap.loadMapFrom2DArray([[1], [0]], getBitmapData(), 8, 8); - var sprite = new FlxSprite(-2, 10); - Assert.isFalse(tilemap.overlapsWithCallback(sprite)); - } - - @Test // #1546 - // same as testOffMapOverlap but with objectOverlapsTiles function testOffMapOverlap2() { tilemap.loadMapFrom2DArray([[1], [0]], getBitmapData(), 8, 8); diff --git a/tests/unit/src/flixel/util/FlxArrayUtilTest.hx b/tests/unit/src/flixel/util/FlxArrayUtilTest.hx index 18271fb889..3338ae694d 100644 --- a/tests/unit/src/flixel/util/FlxArrayUtilTest.hx +++ b/tests/unit/src/flixel/util/FlxArrayUtilTest.hx @@ -102,23 +102,4 @@ class FlxArrayUtilTest Assert.isTrue([0, 1, 2, 3, 4, 5].safeSwap(0, 2).equals([2, 1, 0, 3, 4, 5])); Assert.isTrue([0, 1, 2, 3, 4, 5].safeSwap(1, 6).equals([0, 1, 2, 3, 4, 5])); } - - @Test - @:haxe.warning("-WDeprecated") - function testSetLength() - { - final arr = [0, 1, 2, 3, 4, 5]; - - // ignores negative numbers - arr.setLength(-1); - FlxAssert.arraysEqual([0, 1, 2, 3, 4, 5], arr); - - // expected usage - arr.setLength(3); - FlxAssert.arraysEqual([0, 1, 2], arr); - - // can't make arrays bigger - arr.setLength(5); - FlxAssert.arraysEqual([0, 1, 2], arr); - } } diff --git a/tests/unit/src/flixel/util/FlxDirectionFlagsTest.hx b/tests/unit/src/flixel/util/FlxDirectionFlagsTest.hx index 7765f538c3..9b456ee8f9 100644 --- a/tests/unit/src/flixel/util/FlxDirectionFlagsTest.hx +++ b/tests/unit/src/flixel/util/FlxDirectionFlagsTest.hx @@ -82,21 +82,7 @@ class FlxDirectionFlagsTest extends FlxTest Assert.areEqual(WALL, (LEFT | RIGHT)); Assert.areEqual(WALL, (RIGHT | LEFT)); } - - @Test - function andSame() - { - Assert.areEqual(LEFT, (LEFT & LEFT)); - Assert.areEqual(RIGHT, (RIGHT & RIGHT)); - } - - @Test - function andNotSame() - { - Assert.areEqual(NONE, (LEFT & RIGHT)); - Assert.areEqual(NONE, (RIGHT & LEFT)); - } - + @Test function withoutSame() { @@ -186,15 +172,5 @@ class FlxDirectionFlagsTest extends FlxTest assertNot(RIGHT, LEFT | UP | DOWN); assertNot(ANY, NONE); } - - @Test - @:haxe.warning("-WDeprecated") - function implicitBackwardsCompat() - { - - Assert.isTrue(FlxDirectionFlags.NONE == 0); - Assert.isTrue(0 == FlxDirectionFlags.NONE); - Assert.isTrue(flixel.util.FlxDirection.LEFT == 0x0001); - Assert.isTrue(0x0001 == flixel.util.FlxDirection.LEFT); - } + } diff --git a/tests/unit/src/flixel/util/FlxPoolTest.hx b/tests/unit/src/flixel/util/FlxPoolTest.hx index 0c3cc4c9d5..8225e058f4 100644 --- a/tests/unit/src/flixel/util/FlxPoolTest.hx +++ b/tests/unit/src/flixel/util/FlxPoolTest.hx @@ -13,12 +13,6 @@ class FlxPoolTest extends FlxTest ppool = new FlxPool(FlxBasePoint.new.bind(0, 0)); } - @Test - function testLegacy():Void - { - final pool = new FlxPool(FlxBasePoint); - } - @Test function putNull():Void {