Skip to content

Commit

Permalink
Merge pull request #1710 from Gama11/updateFramePixels
Browse files Browse the repository at this point in the history
FlxSprite: getFlxFrameBitmapData -> updateFramePixels()
  • Loading branch information
Gama11 committed Feb 1, 2016
2 parents 01f1f21 + bff1c46 commit d608422
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions flixel/FlxSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class FlxSprite extends FlxObject
if (FlxG.renderBlit)
{
dirty = true;
getFlxFrameBitmapData();
updateFramePixels();
}
}

Expand Down Expand Up @@ -852,7 +852,7 @@ class FlxSprite extends FlxObject
}
else // 2. Check pixel at (_flashPoint.x, _flashPoint.y)
{
var frameData:BitmapData = getFlxFrameBitmapData();
var frameData:BitmapData = updateFramePixels();
var pixelColor:FlxColor = frameData.getPixel32(Std.int(_flashPoint.x), Std.int(_flashPoint.y));
return pixelColor.alpha * alpha >= Mask;
}
Expand All @@ -871,13 +871,13 @@ class FlxSprite extends FlxObject
if (FlxG.renderTile && !RunOnCpp)
return;

getFlxFrameBitmapData();
updateFramePixels();
}

/**
* Retrieves BitmapData of current FlxFrame. Updates framePixels.
*/
public function getFlxFrameBitmapData():BitmapData
public function updateFramePixels():BitmapData
{
if (_frame == null || !dirty)
return framePixels;
Expand Down Expand Up @@ -1317,7 +1317,7 @@ class FlxSprite extends FlxObject

if (value)
{
getFlxFrameBitmapData();
updateFramePixels();
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/flixel/FlxSpriteTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,6 @@ class FlxSpriteTest extends FlxTest
sprite.stamp(text);

Assert.areEqual(FlxColor.RED,
sprite.getFlxFrameBitmapData().getPixel32(3, 3));
sprite.updateFramePixels().getPixel32(3, 3));
}
}

0 comments on commit d608422

Please sign in to comment.