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

add antialiasing to FlxTilemap #1850

Merged
merged 2 commits into from
May 13, 2016

Conversation

larsiusprime
Copy link
Member

No description provided.

@@ -1013,6 +1018,11 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile>
}
#end

private function set_antialiasing(value:Bool):Bool
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a setter here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm just following the convention from FlxSprite

@Gama11
Copy link
Member

Gama11 commented May 12, 2016

Does this work with both FlxG.renderTile and FlxG.renderBlit?

@larsiusprime
Copy link
Member Author

@Gama11: It works with rendertile, not sure about renderblit. Let me see.

@larsiusprime
Copy link
Member Author

Okay, looks like it doesn't -- in BLIT mode, the draw call happens on the FlxTilemapBuffer, which passes a null (and thus false) value for "smoothing" to draw().

Serendipitously, this creates a non-speculative use for the antialiasing setter on the tilemap -- we need to add an antialiasing flag to the FlxTilemapBuffers, and that's a natural place to update it.

@Gama11
Copy link
Member

Gama11 commented May 12, 2016

I was about to tell you that there's a reason why FlxSprite has an empty setter, namely that it's overriden by FlxSpriteGroup. Actually looking into that though, that doesn't seem to be the case...

@Gama11
Copy link
Member

Gama11 commented May 12, 2016

Hm, looks like it was needed by the old version of the bitmap text class, but apparently not anymore in the refactored FlxBitmapText: f4829a8

@larsiusprime
Copy link
Member Author

Okay, I have the change for Blit, tested and works. one second.

@@ -970,6 +975,10 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile>
{
var buffer = new FlxTilemapBuffer(_tileWidth, _tileHeight, widthInTiles, heightInTiles, camera, scale.x, scale.y);
buffer.pixelPerfectRender = pixelPerfectRender;
if (FlxG.renderBlit)
Copy link
Member

Choose a reason for hiding this comment

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

you can skip this check for render mode and just set antialiasing directly

@Gama11 Gama11 merged commit 4de3eb6 into HaxeFlixel:dev May 13, 2016
Gama11 added a commit that referenced this pull request May 13, 2016
Aurel300 pushed a commit to larsiusprime/haxeflixel that referenced this pull request Apr 18, 2018
Aurel300 pushed a commit to larsiusprime/haxeflixel that referenced this pull request Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants