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

feat: Whitelist textures #3505

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gnarhard
Copy link
Contributor

Description

Adds the optional ability to whitelist relative path names to shrink an atlas down to contain only the images you need. This saves significantly on memory usage with large texture packs.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Overall it looks good, a test is needed though.

@@ -15,6 +15,7 @@ A flame plugin to import sprite sheets generated by <a href="https://github.com/
<a title="Test" href="https://github.com/flame-engine/flame/actions?query=workflow%3Acicd+branch%3Amain"><img src="https://github.com/flame-engine/flame/workflows/cicd/badge.svg?branch=main&event=push"/></a>
<a title="Discord" href="https://discord.gg/pxrBmy4"><img src="https://img.shields.io/discord/509714518008528896.svg"/></a>
<a title="Melos" href="https://github.com/invertase/melos"><img src="https://img.shields.io/badge/maintained%20with-melos-f700ff.svg"/></a>
<a title="AI Assist" href="https://app.commanddash.io/agent/flame_engine"><img src="https://img.shields.io/badge/AI-Code%20Assist-EB9FDA.svg"></a>
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed, since it isn't in service anymore. (You probably based your commit off an old commit)

@@ -54,6 +80,23 @@ class TexturePackerAtlas {
);
}

/// Loads the atlas that resides on the [path] and
/// returns a new [TextureAtlasData].
Copy link
Member

Choose a reason for hiding this comment

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

Nit: line break earlier than 80

@@ -1,7 +1,7 @@
name: flame_texturepacker
resolution: workspace
description: A simple plugin for the Flame Engine to import spritesheets generated by the TexturePacker tool.
version: 4.1.6
version: 4.2.0
Copy link
Member

Choose a reason for hiding this comment

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

This is done automatically by Melos, no need to bump this

Comment on lines -15 to +20
sdk: ">=3.6.0 <4.0.0"
flutter: ">=3.27.1"
sdk: ">=3.5.3 <4.0.0"
flutter: ">=3.24.3"

dependencies:
collection: ^1.17.1
flame: ^1.25.0
flame: ^1.22.0
Copy link
Member

Choose a reason for hiding this comment

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

All dependencies should stay the same as before

bool useOriginalSize = true,
String assetsPrefix = 'images/',
List<String> whiteList = const [],
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is passed anywhere?

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.

2 participants