Skip to content

Sprite packing collection order not deterministic #162

Description

@bfloch

When packing the same data, but written at a slightly different order the packing might result in swapping some of the sprites with similar geometry around.

The reason is that filesystems might not list files in any particular order.
Ideally the same input data (filenames, sprite data etc.) should result in the same packing, regardless of the filesystem.

Motivation:
The reason this matters to me is I have a automated parallel export that pipes into gdx-texture-packer-gui via CLI. I would love the packed data to be same on same inputs, so I can determine if the data has changed or not.

Suggested solution:
I have a branch that fixes this by sorting the sprites during collection.
It probably needs cleanup/formatting, but it does solve the problem as the order of the gathered sprites is consistent, and packing becomes deterministic.

Let me know you consider it and would like me to prepare a PR.
Thanks.

Maybe somewhat related to:
#19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions