Skip to content

Commit

Permalink
Merge pull request #33 from HaxeFlixel/dev
Browse files Browse the repository at this point in the history
Catch up with upstream.
  • Loading branch information
IBwWG authored Aug 10, 2016
2 parents 119aa76 + 3bdd6a6 commit cbf0dc6
Show file tree
Hide file tree
Showing 35 changed files with 253 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ before_install:
install:
- haxelib install munit > /dev/null
- haxelib install hamcrest > /dev/null
- haxelib install lime > /dev/null
- haxelib install openfl > /dev/null
- haxelib install lime 2.9.1 > /dev/null
- haxelib install openfl 3.6.1 > /dev/null
- haxelib install systools > /dev/null
- haxelib install nape > /dev/null
- haxelib install task > /dev/null
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
4.1.1
------------------------------
* fixed the check for Lime <= 2.9.1

4.1.0
------------------------------

Expand Down Expand Up @@ -52,6 +56,9 @@
* `FlxBitmapFont`: fixed a crash related to incorrect UTF-8 handling (#1857)
* `FlxAtlas`: fixed a crash when the constructor is called with `powerOfTwo == true` (#1858)
* `FlxTween`: fixed nested tween chains (#1871)
* `FlxTypedGroup`: fixed recursion in `forEachOfType()` (#1876)
* `Tracker`: [Neko] fixed a crash in `setVisible()` (#1879)
* Fixed some flixel-internal fields being accessible when they shouldn't be (#1849)

#### Changes and improvements:

Expand All @@ -60,6 +67,7 @@
* `FlxSpriteUtil`: changed `alphaMask()` arguments from `Dynamic` to `FlxGraphicAsset` (#1806)
* `FlxG.signals`: changed `preUpdate` to be dispatched _after_ `FlxG.elapsed` is updated (#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)

4.0.1
------------------------------
Expand Down
1 change: 0 additions & 1 deletion flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ using flixel.util.FlxColorTransformUtil;
* |-> canvas:Sprite (its graphics is used for rendering objects in tile render mode)
* |-> debugLayer:Sprite (this sprite is used in tile render mode for rendering debug info, like bounding boxes)
*/
@:allow(flixel.FlxGame)
class FlxCamera extends FlxBasic
{
/**
Expand Down
6 changes: 4 additions & 2 deletions flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import openfl.display.OpenGLView;
/**
* Global helper class for audio, input, the camera system, the debugger and other global properties.
*/
@:allow(flixel.FlxGame)
class FlxG
{
/**
Expand Down Expand Up @@ -91,7 +90,7 @@ class FlxG
* The HaxeFlixel version, in semantic versioning syntax. Use Std.string()
* on it to get a String formatted like this: "HaxeFlixel MAJOR.MINOR.PATCH-COMMIT_SHA".
*/
public static var VERSION(default, null):FlxVersion = new FlxVersion(4, 1, 0);
public static var VERSION(default, null):FlxVersion = new FlxVersion(4, 1, 1);

/**
* Internal tracker for game object.
Expand Down Expand Up @@ -126,6 +125,7 @@ class FlxG
/**
* Represents the amount of time in seconds that passed since last frame.
*/
@:allow(flixel.FlxGame.updateElapsed)
public static var elapsed(default, null):Float = 0;
/**
* Useful when the timestep is NOT fixed (i.e. variable), to prevent jerky movement or erratic behavior at very low fps.
Expand Down Expand Up @@ -512,6 +512,7 @@ class FlxG
/**
* Called by FlxGame to set up FlxG during FlxGame's constructor.
*/
@:allow(flixel.FlxGame.new)
private static function init(Game:FlxGame, Width:Int, Height:Int, Zoom:Float):Void
{
game = Game;
Expand Down Expand Up @@ -595,6 +596,7 @@ class FlxG
/**
* Called whenever the game is reset, doesn't have to do quite as much work as the basic initialization stuff.
*/
@:allow(flixel.FlxGame)
private static function reset():Void
{
random.resetInitialSeed();
Expand Down
7 changes: 6 additions & 1 deletion flixel/FlxGame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import flixel.system.ui.FlxFocusLostScreen;
* It is basically only used to create your game object in the first place,
* after that FlxG and FlxState have all the useful stuff you actually need.
*/
@:allow(flixel)
@:allow(flixel.FlxG)
class FlxGame extends Sprite
{
/**
Expand All @@ -49,10 +49,12 @@ class FlxGame extends Sprite
/**
* Flag for whether a replay is currently playing.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd)
public var replaying(default, null):Bool = false;
/**
* Flag for whether a new recording is being made.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd)
public var recording(default, null):Bool = false;
#end

Expand Down Expand Up @@ -196,14 +198,17 @@ class FlxGame extends Sprite
/**
* Container for a game replay object.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd)
private var _replay:FlxReplay;
/**
* Flag for whether a playback of a recording was requested.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd)
private var _replayRequested:Bool = false;
/**
* Flag for whether a new recording was requested.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd)
private var _recordingRequested:Bool = false;
#end

Expand Down
2 changes: 2 additions & 0 deletions flixel/FlxObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ class FlxObject extends FlxBasic
* @param Camera Specify which game camera you want. If null getScreenPosition() will just grab the first global camera.
* @return Whether or not the two objects overlap.
*/
@:access(flixel.group.FlxTypedGroup)
public function overlaps(ObjectOrGroup:FlxBasic, InScreenSpace:Bool = false, ?Camera:FlxCamera):Bool
{
var group = FlxTypedGroup.resolveGroup(ObjectOrGroup);
Expand Down Expand Up @@ -729,6 +730,7 @@ class FlxObject extends FlxBasic
* @param Camera Specify which game camera you want. If null getScreenPosition() will just grab the first global camera.
* @return Whether or not the two objects overlap.
*/
@:access(flixel.group.FlxTypedGroup)
public function overlapsAt(X:Float, Y:Float, ObjectOrGroup:FlxBasic, InScreenSpace:Bool = false, ?Camera:FlxCamera):Bool
{
var group = FlxTypedGroup.resolveGroup(ObjectOrGroup);
Expand Down
1 change: 1 addition & 0 deletions flixel/FlxSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,7 @@ class FlxSprite extends FlxObject
* @param saveAnimations Whether to save animations in animation controller or not
* @return This sprite with loaded frames
*/
@:access(flixel.animation.FlxAnimationController)
public function setFrames(Frames:FlxFramesCollection, saveAnimations:Bool = true):FlxSprite
{
if (saveAnimations)
Expand Down
5 changes: 3 additions & 2 deletions flixel/FlxSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import flixel.util.FlxColor;
* This is the basic game "state" object - e.g. in a simple game you might have a menu state and a play state.
* It is for all intents and purpose a fancy FlxGroup. And really, it's not even that fancy.
*/
@:allow(flixel.FlxState)
class FlxSubState extends FlxState
{
/**
Expand All @@ -22,11 +21,13 @@ class FlxSubState extends FlxState

/**
* Helper var for close() so closeSubState() can be called on the parent.
*/
*/
@:allow(flixel.FlxState.resetSubState)
private var _parentState:FlxState;

private var _bgColor:FlxColor;

@:allow(flixel.FlxState.resetSubState)
private var _created:Bool = false;

/**
Expand Down
1 change: 0 additions & 1 deletion flixel/animation/FlxAnimationController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class FlxAnimationController implements IFlxDestroyable
/**
* Internal, stores all the animation that were added to this sprite.
*/
@:allow(flixel.FlxSprite)
private var _animations(default, null):Map<String, FlxAnimation>;

private var _prerotated:FlxPrerotatedAnimation;
Expand Down
6 changes: 4 additions & 2 deletions flixel/graphics/frames/FlxFrame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class FlxFrame implements IFlxDestroyable

private var blitMatrix:Vector<Float>;

@:allow(flixel)
@:allow(flixel.graphics.FlxGraphic)
@:allow(flixel.graphics.frames.FlxFramesCollection)
private function new(parent:FlxGraphic, angle:FlxFrameAngle = FlxFrameAngle.ANGLE_0, flipX:Bool = false, flipY:Bool = false)
{
this.parent = parent;
Expand All @@ -98,7 +99,8 @@ class FlxFrame implements IFlxDestroyable
}
}

@:allow(flixel.graphics.frames)
@:allow(flixel.graphics.frames.FlxFramesCollection)
@:allow(flixel.graphics.frames.FlxBitmapFont)
private function cacheFrameMatrix():Void
{
prepareBlitMatrix(matrix, true);
Expand Down
13 changes: 5 additions & 8 deletions flixel/group/FlxGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class FlxTypedGroup<T:FlxBasic> extends FlxBasic
/**
* Helper function for overlap functions in FlxObject and FlxTilemap.
*/
@:allow(flixel)
private static inline function overlaps(Callback:FlxBasic->Float->Float->Bool->FlxCamera->Bool,
private static function overlaps(Callback:FlxBasic->Float->Float->Bool->FlxCamera->Bool,
Group:FlxTypedGroup<FlxBasic>, X:Float, Y:Float, InScreenSpace:Bool, Camera:FlxCamera):Bool
{
var result:Bool = false;
Expand All @@ -43,8 +42,7 @@ class FlxTypedGroup<T:FlxBasic> extends FlxBasic
return result;
}

@:allow(flixel)
private static inline function resolveGroup(ObjectOrGroup:FlxBasic):FlxTypedGroup<FlxBasic>
private static function resolveGroup(ObjectOrGroup:FlxBasic):FlxTypedGroup<FlxBasic>
{
var group:FlxTypedGroup<FlxBasic> = null;
if (ObjectOrGroup != null)
Expand Down Expand Up @@ -88,9 +86,7 @@ class FlxTypedGroup<T:FlxBasic> extends FlxBasic
super();

members = [];

maxSize = Std.int(Math.abs(MaxSize));

flixelType = GROUP;
}

Expand Down Expand Up @@ -806,7 +802,7 @@ class FlxTypedGroup<T:FlxBasic> extends FlxBasic
{
basic = members[i++];

if (basic != null && Std.is(basic, ObjectClass))
if (basic != null)
{
if (Recurse)
{
Expand All @@ -817,7 +813,8 @@ class FlxTypedGroup<T:FlxBasic> extends FlxBasic
}
}

Function(cast basic);
if (Std.is(basic, ObjectClass))
Function(cast basic);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion flixel/input/FlxKeyManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import flash.events.KeyboardEvent;
import flixel.FlxG;
import flixel.input.FlxInput.FlxInputState;

@:allow(flixel)
class FlxKeyManager<Key:Int, KeyList:FlxBaseKeyList> implements IFlxInputManager
{
/**
Expand Down Expand Up @@ -33,6 +32,7 @@ class FlxKeyManager<Key:Int, KeyList:FlxBaseKeyList> implements IFlxInputManager
/**
* Internal storage of input keys as an array, for efficient iteration.
*/
@:allow(flixel.input.FlxBaseKeyList)
private var _keyListArray:Array<FlxInput<Key>> = [];
/**
* Internal storage of input keys as a map, for efficient indexing.
Expand Down
1 change: 1 addition & 0 deletions flixel/input/FlxPointer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class FlxPointer
* @param Camera Specify which game camera you want. If null getScreenPosition() will just grab the first global camera.
* @return Whether or not the two objects overlap.
*/
@:access(flixel.group.FlxTypedGroup.resolveGroup)
public function overlaps(ObjectOrGroup:FlxBasic, ?Camera:FlxCamera):Bool
{
var result:Bool = false;
Expand Down
3 changes: 2 additions & 1 deletion flixel/input/keyboard/FlxKeyboard.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import flixel.system.replay.CodeValuePair;
/**
* Keeps track of what keys are pressed and how with handy Bools or strings.
*/
@:allow(flixel)
class FlxKeyboard extends FlxKeyManager<FlxKey, FlxKeyList>
{
#if !web
Expand Down Expand Up @@ -133,6 +132,7 @@ class FlxKeyboard extends FlxKeyManager<FlxKey, FlxKeyList>
*
* @return An array of key state data. Null if there is no data.
*/
@:allow(flixel.system.replay.FlxReplay)
private function record():Array<CodeValuePair>
{
var data:Array<CodeValuePair> = null;
Expand Down Expand Up @@ -161,6 +161,7 @@ class FlxKeyboard extends FlxKeyManager<FlxKey, FlxKeyList>
*
* @param Record Array of data about key states.
*/
@:allow(flixel.system.replay.FlxReplay)
private function playback(Record:Array<CodeValuePair>):Void
{
var i:Int = 0;
Expand Down
7 changes: 5 additions & 2 deletions flixel/input/mouse/FlxMouse.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ private class GraphicCursor extends BitmapData {}
* This class helps contain and track the mouse pointer in your game.
* Automatically accounts for parallax scrolling, etc.
*/
@:allow(flixel)
class FlxMouse extends FlxPointer implements IFlxInputManager
{
/**
Expand Down Expand Up @@ -101,16 +100,19 @@ class FlxMouse extends FlxPointer implements IFlxInputManager
/**
* The left mouse button.
*/
@:allow(flixel.input.mouse.FlxMouseButton)
private var _leftButton:FlxMouseButton;

#if FLX_MOUSE_ADVANCED
/**
* The middle mouse button.
*/
@:allow(flixel.input.mouse.FlxMouseButton)
private var _middleButton:FlxMouseButton;
/**
* The right mouse button.
*/
@:allow(flixel.input.mouse.FlxMouseButton)
private var _rightButton:FlxMouseButton;
#end

Expand Down Expand Up @@ -448,7 +450,6 @@ class FlxMouse extends FlxPointer implements IFlxInputManager
#end
}

@:allow(flixel.FlxGame)
private function onGameStart():Void
{
// Call set_visible with the value visible has been initialized with
Expand Down Expand Up @@ -573,6 +574,7 @@ class FlxMouse extends FlxPointer implements IFlxInputManager

// Replay functions

@:allow(flixel.system.replay.FlxReplay)
private function record():MouseRecord
{
if ((_lastX == _globalScreenX) && (_lastY == _globalScreenY)
Expand All @@ -586,6 +588,7 @@ class FlxMouse extends FlxPointer implements IFlxInputManager
return new MouseRecord(_lastX, _lastY, _leftButton.current, _lastWheel);
}

@:allow(flixel.system.replay.FlxReplay)
private function playback(Record:MouseRecord):Void
{
_leftButton.current = Record.button;
Expand Down
1 change: 1 addition & 0 deletions flixel/input/mouse/FlxMouseEventManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class FlxMouseEventManager extends FlxBasic
}
}

@:access(flixel.group.FlxTypedGroup.resolveGroup)
private static function traverseFlxGroup(Group:FlxTypedGroup<Dynamic>, OrderedObjects:Array<ObjectMouseData<Dynamic>>):Void
{
for (basic in Group.members)
Expand Down
4 changes: 2 additions & 2 deletions flixel/math/FlxRandom.hx
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class FlxRandom
*
* @return The new value of the state seed.
*/
@:allow(flixel.FlxGame.switchState)
@:allow(flixel.FlxGame)
private static inline function updateStateSeed():Int
{
return _stateSeed = FlxG.random.currentSeed;
Expand All @@ -467,7 +467,7 @@ class FlxRandom
*
* @param StandardMode If true, entire game will be reset, else just the current state will be reset.
*/
@:allow(flixel.system.frontEnds.VCRFrontEnd.startRecording)
@:allow(flixel.system.frontEnds.VCRFrontEnd)
private static inline function updateRecordingSeed(StandardMode:Bool = true):Int
{
return _recordingSeed = FlxG.random.initialSeed = StandardMode ? FlxG.random.initialSeed : _stateSeed;
Expand Down
1 change: 1 addition & 0 deletions flixel/system/FlxQuadTree.hx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ class FlxQuadTree extends FlxRect
* @param ObjectOrGroup FlxObjects are just added, FlxGroups are recursed and their applicable members added accordingly.
* @param List A int flag indicating the list to which you want to add the objects. Options are A_LIST and B_LIST.
*/
@:access(flixel.group.FlxTypedGroup.resolveGroup)
public function add(ObjectOrGroup:FlxBasic, list:Int):Void
{
_list = list;
Expand Down
Loading

0 comments on commit cbf0dc6

Please sign in to comment.