Skip to content

Commit

Permalink
deprecate dumping and post processing for HaxeFlixel#3059
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored and charlesisfeline committed Aug 19, 2024
1 parent 1de8de0 commit bcadbde
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion flixel/graphics/FlxGraphic.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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;

/**
Expand Down Expand Up @@ -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)
Expand All @@ -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();
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions flixel/system/frontEnds/BitmapFrontEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bcadbde

Please sign in to comment.