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

Flatten Vec<Vec<LayerTile>> to Vec<LayerTile> #128

Merged
merged 2 commits into from
Jan 24, 2022

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Jan 24, 2022

This simplifies code and should be better on memory usage since it is less fragmented.

Also added width and height attributes to Layer.

Closes #54

assert_eq!(tiles[100].gid, 17);
assert_eq!(tiles[200].gid, 0);
assert_eq!(tiles[200 + 1].gid, 17);
assert!(tiles[9900..9999].iter().map(|t| t.gid).all(|g| g == 0));
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit hard to read, but it should be fixed soon when we add Layer.get_tile (#125).

@bjorn bjorn requested a review from aleokdev January 24, 2022 14:28
aleokdev
aleokdev previously approved these changes Jan 24, 2022
Copy link
Contributor

@aleokdev aleokdev left a comment

Choose a reason for hiding this comment

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

Looks good!

@aleokdev
Copy link
Contributor

Could you add any interface changes to CHANGELOG.md?

This simplifies code and should be better on memory usage since it is
less fragmented.

Also added `width` and `height` attributes to `Layer`.

Closes mapeditor#54
@bjorn bjorn merged commit 28ba42c into mapeditor:master Jan 24, 2022
@bjorn bjorn deleted the flatten-tiles branch January 24, 2022 14:50
@aleokdev aleokdev added breaking This change breaks backwards-compatibility enhancement labels Jan 25, 2022
@aleokdev aleokdev added this to the 0.10.0 milestone Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change breaks backwards-compatibility enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vec<Vec<T>> is inefficient
2 participants