Skip to content
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

deprecate dumping and post processing for #3059 #3060

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,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 @@ -568,6 +569,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 @@ -583,6 +585,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
5 changes: 5 additions & 0 deletions flixel/FlxGame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class FlxGame extends Sprite
* Ugly workaround to ensure consistent behaviour between flash and cpp
* (the focus event should not fire when the game starts up!)
*/
@:deprecated("_onFocusFiredOnce is being removed") // 5.7.0
var _onFocusFiredOnce:Bool = false;
#end

Expand Down Expand Up @@ -234,11 +235,13 @@ class FlxGame extends Sprite
/**
* `Sprite` for postprocessing effects
*/
@:deprecated("Flixel's PostProcess is being removed") // 5.7.0
var postProcessLayer:Sprite = new Sprite();

/**
* Post process effects active on the `postProcessLayer`.
*/
@:deprecated("Flixel's PostProcess is being removed") // 5.7.0
var postProcesses:Array<PostProcess> = [];
#end

Expand Down Expand Up @@ -308,6 +311,7 @@ class FlxGame extends Sprite
/**
* Used to instantiate the guts of the flixel game object once we have a valid reference to the root.
*/
@:haxe.warning("-WDeprecated") // remove in 6.0.0
function create(_):Void
{
if (stage == null)
Expand Down Expand Up @@ -466,6 +470,7 @@ class FlxGame extends Sprite
}

@:allow(flixel.FlxG)
@:haxe.warning("-WDeprecated")
function onResize(_):Void
{
var width:Int = FlxG.stage.stageWidth;
Expand Down
8 changes: 8 additions & 0 deletions flixel/graphics/FlxGraphic.hx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ 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 @@ -48,6 +48,7 @@ class BitmapFrontEnd
reset();
}

@:deprecated("FlxGraphic dumping is being removed") // 5.7.0
public function onAssetsReload(_):Void
{
for (key in _cache.keys())
Expand All @@ -64,6 +65,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 @@ -80,6 +82,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 @@ -97,6 +100,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