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

George 6.0.0 #3079

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c72b219
Enable GLSL 3.00 migration
EliteMasterEric Dec 2, 2022
f2959a6
Fix issue causing his to be null on HTML5
EliteMasterEric Nov 3, 2023
8708ef1
Merge remote-tracking branch 'eric/bugfix/glsl-300-shader' into dev-new
EliteMasterEric Dec 14, 2023
9bdea91
Merge remote-tracking branch 'eric/bugfix/switch-state-crash' into de…
EliteMasterEric Dec 14, 2023
adcaa36
Merge remote-tracking branch 'flixel/dev' into dev
EliteMasterEric Dec 20, 2023
a837386
Readd wasDestroyed warnings to camera draw functions.
EliteMasterEric Dec 20, 2023
6af9faf
Update BitmapFrontEnd.hx
EliteMasterEric Jan 17, 2024
8c030ad
Update FlxGraphic.hx
EliteMasterEric Jan 17, 2024
b2d2363
Prevent readding collections.
EliteMasterEric Jan 17, 2024
07c6018
Merge branch 'dev' of https://github.com/FunkinCrew/flixel into dev
EliteMasterEric Jan 17, 2024
25c84b2
Merge remote-tracking branch 'flixel/dev' into dev
EliteMasterEric Feb 5, 2024
2afdd54
Merge remote-tracking branch 'flixel/release6' into dev-6.0.0
EliteMasterEric Feb 6, 2024
4d054bd
Merge remote-tracking branch 'flixel/dev' into dev-6.0.0
EliteMasterEric Feb 13, 2024
edfaf85
Fix a crash when flickering in onComplete
EliteMasterEric Mar 13, 2024
44f2961
Include the text in the bitmap key.
EliteMasterEric Mar 13, 2024
5823c46
Add convenience functions to FlxFlicker.
EliteMasterEric Mar 13, 2024
4d51f0c
Merge branch 'release6' into george-6.0.0
Geokureli Mar 13, 2024
a7d8e3b
debug pointer accounts for flxsprite opacity
ninjamuffin99 Apr 27, 2024
ed33afd
Merge branch 'release6' into george-6.0.0
Geokureli May 9, 2024
735187e
Merge remote-tracking branch 'flixel/release6' into HEAD
EliteMasterEric May 28, 2024
128d9ee
Merge branch 'release6' into george-6.0.0
Geokureli Jun 11, 2024
fd4a996
Merge branch 'dev-6.0.0' into george-6.0.0
Geokureli Jun 11, 2024
9d3d561
Merge branch 'release6' into george-6.0.0
Geokureli Jun 14, 2024
d3f64d7
Merge branch 'release6' into george-6.0.0
Geokureli Jun 14, 2024
7845afc
revert style deviations
Geokureli Jun 14, 2024
6b4260c
remove duplicate pause/resume
Geokureli Jun 14, 2024
7427f01
revert style deviations
Geokureli Jun 14, 2024
ce3661f
revert pre-tracking key
Geokureli Jun 14, 2024
09c891b
more reverts
Geokureli Jun 14, 2024
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
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ We removed many features and utilities that were previously deprecated
- **README.md**: Add Turkish translations
- `AssetPaths`: Add `allFiles` field, and an arg in `FlxAssets.buildFileReferences` to change the identifier ([#2807](https://github.com/HaxeFlixel/flixel/pull/2807))
- Debug tools: Add ways to remove custom debug tools ([#2792](https://github.com/HaxeFlixel/flixel/pull/2792))
- `FlxG.console`: Add `removeByAlias`, `removeEnum`, `removeClass`, `removeObject` and `removeFunction`
- `FlxG.console`: Add `removeByAlias`, `removeEnum`, `removeClass`, `removeObject` and `removeFunction`
- `FlxG.game.debugger.interaction`: Add `removeTool`
- `FlxText`: Add `fieldHeight` field ([#2789](https://github.com/HaxeFlixel/flixel/pull/2789))
- `FlxG`: Add compiler flag `FLX_NO_SAVE` to remove `FlxG.save` (also counter-flag `FLX_SAVE`) ([#2840](https://github.com/HaxeFlixel/flixel/pull/2840))
Expand Down Expand Up @@ -277,7 +277,7 @@ We removed many features and utilities that were previously deprecated
- `AssetPaths`: various fixes ([#2680](https://github.com/HaxeFlixel/flixel/pull/2680))
- apply `include`/`exclude` args to files, not directories
- default file renamer will replace spaces with underscore

#### New features:
- `FlxKeys`: Added `SCROLL_LOCK`, `NUMLOCK`, `WINDOWS`, `MENU`, `BREAK` and `NUMPADSLASH` keys ([#2638](https://github.com/HaxeFlixel/flixel/pull/2638))

Expand Down Expand Up @@ -315,7 +315,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
- `WatchFrontEnd`: added `FlxG.watch.addFunction` ([#2500](https://github.com/HaxeFlixel/flixel/pull/2500))
- `FlxPoint`: added binary operators `+`, `-`, `+=`, `-=`, `*`, and `*=` ([#2557](https://github.com/HaxeFlixel/flixel/pull/2557))
- `FlxColor`: added `rgb` getter and setter ([#2555](https://github.com/HaxeFlixel/flixel/pull/2555))
- `FlxSave`: added `mergeDataFrom`, `mergeData` `status`, `isBound` and `isEmpty`
- `FlxSave`: added `mergeDataFrom`, `mergeData` `status`, `isBound` and `isEmpty`
([#2566](https://github.com/HaxeFlixel/flixel/pull/2566))
([#2584](https://github.com/HaxeFlixel/flixel/pull/2584))
- `FlxAnimation` - added `loopPoint` to allow looping to a frame other than the starting frame ([#2621](https://github.com/HaxeFlixel/flixel/pull/2621))
Expand Down Expand Up @@ -630,7 +630,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
- fixed selections being canceled on interaction with debugger UI ([897f21f](https://github.com/HaxeFlixel/flixel/commit/897f21f))
- `FlxG.html5`: fixed `platform` detecting iPhone and iPod as "Mac" ([#2052](https://github.com/HaxeFlixel/flixel/issues/2052))
- `FlxTilemap`: fixed a missing bounds check in `getTileIndexByCoords()` ([#2024](https://github.com/HaxeFlixel/flixel/issues/2024))
- `FlxAnalog`: fixed mouse input without `FLX_NO_TOUCH` ([#2067](https://github.com/HaxeFlixel/flixel/issues/2067))
- `FlxAnalog`: fixed mouse input without `FLX_NO_TOUCH` ([#2067](https://github.com/HaxeFlixel/flixel/issues/2067))
- `flixel.input`: fixed `Float` being used for tick values ([#2071](https://github.com/HaxeFlixel/flixel/issues/2071))
- `FlxCamera`: fixed object visibility for `zoom < 1` ([#2003](https://github.com/HaxeFlixel/flixel/issues/2003))
- `FlxEmitter`: fixed issues with `lifespan == 0` ([#2074](https://github.com/HaxeFlixel/flixel/issues/2074))
Expand Down Expand Up @@ -789,7 +789,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
* `FlxTween`: fixed nested tween chains ([#1871](https://github.com/HaxeFlixel/flixel/issues/1871))
* `FlxTypedGroup`: fixed recursion in `forEachOfType()` ([#1876](https://github.com/HaxeFlixel/flixel/issues/1876))
* `Tracker`: [Neko] fixed a crash in `setVisible()` ([#1879](https://github.com/HaxeFlixel/flixel/issues/1879))
* Fixed some flixel-internal fields being accessible when they shouldn't be ([#1849](https://github.com/HaxeFlixel/flixel/issues/1849))
* Fixed some flixel-internal fields being accessible when they shouldn't be ([#1849](https://github.com/HaxeFlixel/flixel/issues/1849))

#### Changes and improvements:

Expand All @@ -798,7 +798,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
* `FlxSpriteUtil`: changed `alphaMask()` arguments from `Dynamic` to `FlxGraphicAsset` ([#1806](https://github.com/HaxeFlixel/flixel/issues/1806))
* `FlxG.signals`: changed `preUpdate` to be dispatched _after_ `FlxG.elapsed` is updated ([#1836](https://github.com/HaxeFlixel/flixel/issues/1836))
* `FlxG.debugger`: changed `drawDebugChanged` to be dispatched _after_ `drawDebug` is updated
* `FlxDefines`: added a check for incompatible OpenFL / Lime versions (should be < 4.0.0 / < 3.0.0 respectively)
* `FlxDefines`: added a check for incompatible OpenFL / Lime versions (should be < 4.0.0 / < 3.0.0 respectively)

4.0.1 (March 19, 2016)
------------------------------
Expand All @@ -815,7 +815,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
* `FlxStringUtil.formatMoney()`:
* fixed formatting for `Amount < 0` ([#1754](https://github.com/HaxeFlixel/flixel/issues/1754))
* fixed formatting for negative amounts
* [HTML5] fixed formatting for amounts > Int32
* [HTML5] fixed formatting for amounts > Int32
* Debugger Stats window: fixed paused time being taken into account for average FPS

4.0.0 (February 16, 2016)
Expand Down Expand Up @@ -1055,7 +1055,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the

* `FlxAssets`:
* `cacheSounds()` -> `FlxG.sound.cacheAll()` ([#1097](https://github.com/HaxeFlixel/flixel/issues/1097))
* OpenFL live asset reloading is now supported (native targets)
* OpenFL live asset reloading is now supported (native targets)
* `FlxSound`
* can now be used even if `FLX_NO_SOUND_SYSTEM` is enabled ([#1199](https://github.com/HaxeFlixel/flixel/issues/1199))
* `looped` is now `public`
Expand Down Expand Up @@ -1097,7 +1097,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
added `setRect()` method which allows you to set a rectangular region of tiles to the provided index
* `FlxTile`:
added `frame` variable which holds tile's "graphic"
* `FlxTileblock`:
* `FlxTileblock`:
* added `setTile()` and `tileSprite` ([#1300](https://github.com/HaxeFlixel/flixel/issues/1300))
* added `loadFrames()` method which allows you to use frames collection as a source of graphic
* `FlxTilemap`:
Expand Down Expand Up @@ -1156,7 +1156,7 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the
* `FlxColor`:
* `FlxColor` is now an `abstract`, interchangeable with `Int` - the `FlxColorUtil` functions have been merged into it ([#1027](https://github.com/HaxeFlixel/flixel/issues/1027))
* the color presets have been reduced to a smaller, more useful selection ([#1117](https://github.com/HaxeFlixel/flixel/issues/1117))
* `FlxPath`:
* `FlxPath`:
* the original `FlxObject#immovable` value is now restored after completion
* `active` is now only true when in progress
* fixed velocity being set even if the object position matches the current node
Expand All @@ -1180,5 +1180,5 @@ The alpha was causing issues with CI due to haxelib issues. We're foregoing the

* Added an initialization macro that aborts compilation with helpful errors when:
* targeting older SWF versions with invalid defines
* using an unsupported Haxe version
* using an unsupported Haxe version
* Flixel sound assets are now being embedded via `embed="true"`
62 changes: 32 additions & 30 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FlxCamera extends FlxBasic
/**
* Used behind-the-scenes during the draw phase so that members use the same default
* cameras as their parent.
*
*
* This is the non-deprecated list that the public `defaultCameras` proxies. Allows flixel classes
* to use it without warning.
*/
Expand Down Expand Up @@ -209,7 +209,7 @@ class FlxCamera extends FlxBasic
* WARNING: setting this to `false` on blitting targets is very expensive.
*/
public var pixelPerfectRender:Bool;

/**
* If true, screen shake will be rounded to game pixels. If null, pixelPerfectRender is used.
* @since 5.4.0
Expand Down Expand Up @@ -609,6 +609,8 @@ class FlxCamera extends FlxBasic
itemToReturn = new FlxDrawItem();
}

if (graphic.isDestroyed) throw 'Attempted to queue an invalid FlxDrawItem, did you destroy a cached sprite?';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this triggering for you? My hope with #2974 was to prevent these issues

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in discord:

FlxCamera Line 612 does trigger for me when I try to draw a sprite whose graphic has been disposed

itemToReturn.graphics = graphic;
itemToReturn.antialiasing = smooth;
itemToReturn.colored = colored;
Expand Down Expand Up @@ -1146,11 +1148,11 @@ class FlxCamera extends FlxBasic
// Make sure we didn't go outside the camera's bounds
bindScrollPos(scroll);
}

/**
* Takes the desired scroll position and restricts it to the camera's min/max scroll properties.
* This modifies the given point.
*
*
* @param scrollPos The scroll position
* @return The same point passed in, moved within the scroll bounds
* @since 5.4.0
Expand Down Expand Up @@ -1207,7 +1209,7 @@ class FlxCamera extends FlxBasic
{
_scrollTarget.y -= viewHeight;
}

// without this we see weird behavior when switching to SCREEN_BY_SCREEN at arbitrary scroll positions
bindScrollPos(_scrollTarget);
}
Expand Down Expand Up @@ -1332,16 +1334,16 @@ class FlxCamera extends FlxBasic
var shakePixels = FlxG.random.float(-1, 1) * _fxShakeIntensity * width;
if (pixelPerfect)
shakePixels = Math.round(shakePixels);

flashSprite.x += shakePixels * zoom * FlxG.scaleMode.scale.x;
}

if (_fxShakeAxes.y)
{
var shakePixels = FlxG.random.float(-1, 1) * _fxShakeIntensity * height;
if (pixelPerfect)
shakePixels = Math.round(shakePixels);

flashSprite.y += shakePixels * zoom * FlxG.scaleMode.scale.y;
}
}
Expand Down Expand Up @@ -1863,7 +1865,7 @@ class FlxCamera extends FlxBasic
updateFlashOffset();
setScale(scaleX, scaleY);
}

/**
* The size and position of this camera's margins, via `viewMarginLeft`, `viewMarginTop`, `viewWidth`
* and `viewHeight`.
Expand All @@ -1873,10 +1875,10 @@ class FlxCamera extends FlxBasic
{
if (rect == null)
rect = FlxRect.get();

return rect.set(viewMarginLeft, viewMarginTop, viewWidth, viewHeight);
}

/**
* Checks whether this camera contains a given point or rectangle, in
* screen coordinates.
Expand All @@ -1889,7 +1891,7 @@ class FlxCamera extends FlxBasic
point.putWeak();
return contained;
}

/**
* Checks whether this camera contains a given rectangle, in screen coordinates.
* @since 4.11.0
Expand Down Expand Up @@ -2036,72 +2038,72 @@ class FlxCamera extends FlxBasic
{
viewMarginY = 0.5 * height * (scaleY - initialZoom) / scaleY;
}

static inline function get_defaultCameras():Array<FlxCamera>
{
return _defaultCameras;
}

static inline function set_defaultCameras(value:Array<FlxCamera>):Array<FlxCamera>
{
return _defaultCameras = value;
}

inline function get_viewMarginLeft():Float
{
return viewMarginX;
}

inline function get_viewMarginTop():Float
{
return viewMarginY;
}

inline function get_viewMarginRight():Float
{
return width - viewMarginX;
}

inline function get_viewMarginBottom():Float
{
return height - viewMarginY;
}

inline function get_viewWidth():Float
{
return width - viewMarginX * 2;
}

inline function get_viewHeight():Float
{
return height - viewMarginY * 2;
}

inline function get_viewX():Float
{
return scroll.x + viewMarginX;
}

inline function get_viewY():Float
{
return scroll.y + viewMarginY;
}

inline function get_viewLeft():Float
{
return viewX;
}

inline function get_viewTop():Float
{
return viewY;
}

inline function get_viewRight():Float
{
return scroll.x + viewMarginRight;
}

inline function get_viewBottom():Float
{
return scroll.y + viewMarginBottom;
Expand All @@ -2114,19 +2116,19 @@ class FlxCamera extends FlxBasic
@:deprecated("don't reference camera.camera")
@:noCompletion
override function get_camera():FlxCamera throw "don't reference camera.camera";

@:deprecated("don't reference camera.camera")
@:noCompletion
override function set_camera(value:FlxCamera):FlxCamera throw "don't reference camera.camera";

@:deprecated("don't reference camera.cameras")
@:noCompletion
override function get_cameras():Array<FlxCamera> throw "don't reference camera.cameras";

@:deprecated("don't reference camera.cameras")
@:noCompletion
override function set_cameras(value:Array<FlxCamera>):Array<FlxCamera> throw "don't reference camera.cameras";

}

enum FlxCameraFollowStyle
Expand Down
17 changes: 16 additions & 1 deletion flixel/effects/FlxFlicker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ class FlxFlicker implements IFlxDestroyable
progressCallback = null;
}

public function pause():Void {
if (timer == null) return;
timer.active = false;
}

public function resume():Void {
if (timer == null) return;
timer.active = true;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty simple change, why not, same for preventing double release, below
Made an Issue: #3082

/**
* Starts flickering behavior.
*/
Expand Down Expand Up @@ -182,7 +192,12 @@ class FlxFlicker implements IFlxDestroyable
{
completionCallback(this);
}
release();

// NOTE: Calling `flicker` in the completion callback will call release() on this object before reinstantiating it.
// If that happens, we don't want to call release() again! So we check if the flicker is still done before releasing.
if (this.timer == Timer) {
release();
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion flixel/graphics/FlxGraphic.hx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ class FlxGraphic implements IFlxDestroyable
if (collection.type != null)
{
var collections:Array<Dynamic> = getFramesCollections(collection.type);
collections.push(collection);
if (collections.indexOf(collection) == -1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add this to flixel? what does it improve?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to say I made this change back when I was working on trying to resolve an issue with FlxAnimate. I'd definitely keep it as you don't want the list of collections to have duplicate references in it (as that can cause the reference counts to get messed up).

collections.push(collection);
}
}

Expand All @@ -511,6 +512,8 @@ class FlxGraphic implements IFlxDestroyable
*/
public inline function getFramesCollections(type:FlxFrameCollectionType):Array<Dynamic>
{
if (isDestroyed) return [];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question, should this have been added in #2974


var collections:Array<Dynamic> = frameCollections.get(type);
if (collections == null)
{
Expand Down
5 changes: 4 additions & 1 deletion flixel/graphics/tile/FlxDrawQuadsItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class FlxDrawQuadsItem extends FlxDrawBaseItem<FlxDrawQuadsItem>
return;

var shader = shader != null ? shader : graphics.shader;

if (shader == null) throw 'Attempted to render an invalid FlxDrawItem, did you destroy a cached sprite?';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, re: #2974

shader.bitmap.input = graphics.bitmap;
shader.bitmap.filter = (camera.antialiasing || antialiasing) ? LINEAR : NEAREST;
shader.alpha.value = alphas;
Expand Down Expand Up @@ -144,4 +147,4 @@ class FlxDrawQuadsItem extends FlxDrawBaseItem<FlxDrawQuadsItem>
parameter.value[0] = value;
}
#end
}
}
4 changes: 2 additions & 2 deletions flixel/graphics/tile/FlxGraphicsShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FlxGraphicsShader extends GraphicsShader
openfl_ColorOffsetv = colorOffset / 255.0;
openfl_ColorMultiplierv = colorMultiplier;
}
}")
}", true)
@:glFragmentHeader("
uniform bool hasTransform;
uniform bool hasColorTransform;
Expand Down Expand Up @@ -62,7 +62,7 @@ class FlxGraphicsShader extends GraphicsShader
}
return vec4(0.0, 0.0, 0.0, 0.0);
}
")
", true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this change?

@:glFragmentSource("
#pragma header

Expand Down
Loading
Loading