From bcadbdea02cf0ea734477b7d9660f348cf05c157 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Wed, 6 Mar 2024 13:46:07 -0600 Subject: [PATCH] deprecate dumping and post processing for #3059 --- flixel/FlxG.hx | 3 +++ flixel/graphics/FlxGraphic.hx | 10 +++++++++- flixel/system/frontEnds/BitmapFrontEnd.hx | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flixel/FlxG.hx b/flixel/FlxG.hx index a7dd006d2a..7238ba8f56 100644 --- a/flixel/FlxG.hx +++ b/flixel/FlxG.hx @@ -535,6 +535,7 @@ class FlxG return child; } + @:deprecated("Flixel's PostProcess is being removed") // 5.7.0 public static function addPostProcess(postProcess:PostProcess):PostProcess { #if FLX_POST_PROCESS @@ -561,6 +562,7 @@ class FlxG return postProcess; } + @:deprecated("Flixel's PostProcess is being removed") // 5.7.0 public static function removePostProcess(postProcess:PostProcess):Void { #if FLX_POST_PROCESS @@ -576,6 +578,7 @@ class FlxG } #if FLX_POST_PROCESS + @:deprecated("Flixel's PostProcess is being removed") // 5.7.0 static function chainPostProcesses():Void { var postProcesses = game.postProcesses; diff --git a/flixel/graphics/FlxGraphic.hx b/flixel/graphics/FlxGraphic.hx index 18ff89f271..4528758d3c 100644 --- a/flixel/graphics/FlxGraphic.hx +++ b/flixel/graphics/FlxGraphic.hx @@ -305,7 +305,8 @@ class FlxGraphic implements IFlxDestroyable /** * Whether the `BitmapData` of this graphic object has been dumped or not. - */ + */= + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public var isDumped(default, null):Bool = false; /** @@ -324,6 +325,7 @@ class FlxGraphic implements IFlxDestroyable * but may cause some issues (when you need direct access to pixels of this graphic. * If the graphic is dumped then you should call `undump()` and have total access to pixels. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public var canBeDumped(get, never):Bool; /** @@ -419,6 +421,7 @@ class FlxGraphic implements IFlxDestroyable * Dumps bits of `BitmapData` to decrease memory usage, but you can't read/write pixels on it anymore * (but you can call `onContext()` (or `undump()`) method which will restore it again). */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function dump():Void { #if (lime_legacy && !flash) @@ -433,6 +436,7 @@ class FlxGraphic implements IFlxDestroyable /** * Undumps bits of the `BitmapData` - regenerates it and regenerate tilesheet data for this object */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function undump():Void { var newBitmap:BitmapData = getBitmapFromSystem(); @@ -445,6 +449,7 @@ class FlxGraphic implements IFlxDestroyable * Use this method to restore cached `BitmapData` (if it's possible). * It's called automatically when the RESIZE event occurs. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function onContext():Void { // no need to restore tilesheet if it hasn't been dumped @@ -459,6 +464,7 @@ class FlxGraphic implements IFlxDestroyable * Asset reload callback for this graphic object. * It regenerated its tilesheet and resets frame bitmaps. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function onAssetsReload():Void { if (!canBeDumped) @@ -558,6 +564,7 @@ class FlxGraphic implements IFlxDestroyable * Gets the `BitmapData` for this graphic object from OpenFL. * This method is used for undumping graphic. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 function getBitmapFromSystem():BitmapData { var newBitmap:BitmapData = null; @@ -582,6 +589,7 @@ class FlxGraphic implements IFlxDestroyable return shader == null; } + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 inline function get_canBeDumped():Bool { return assetsClass != null || assetsKey != null; diff --git a/flixel/system/frontEnds/BitmapFrontEnd.hx b/flixel/system/frontEnds/BitmapFrontEnd.hx index a60557099e..a649cfade1 100644 --- a/flixel/system/frontEnds/BitmapFrontEnd.hx +++ b/flixel/system/frontEnds/BitmapFrontEnd.hx @@ -44,6 +44,7 @@ class BitmapFrontEnd reset(); } + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function onAssetsReload(_):Void { for (key in _cache.keys()) @@ -60,6 +61,7 @@ class BitmapFrontEnd * New context handler. * Regenerates tilesheets for all dumped graphics objects in the cache. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function onContext():Void { for (key in _cache.keys()) @@ -76,6 +78,7 @@ class BitmapFrontEnd * Dumps bits of all graphics in the cache. This frees some memory, but you can't read/write pixels on those graphics anymore. * You can call undump() method for each FlxGraphic (or undumpCache()) object which will restore it again. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function dumpCache():Void { #if !web @@ -93,6 +96,7 @@ class BitmapFrontEnd /** * Restores graphics of all dumped objects in the cache. */ + @:deprecated("FlxGraphic dumping is being removed") // 5.7.0 public function undumpCache():Void { #if !web