-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Move TileMap layers to their own class #78328
Move TileMap layers to their own class #78328
Conversation
11951e8
to
681d518
Compare
681d518
to
16575b3
Compare
Tested with my project. Overall seems to work fine and layer modifications are noticeably faster, but something wrong is happening with physics. I have a condition like this: for body in collider.get_overlapping_bodies():
if body.is_in_group(&"powable"):
body.do_pow(down)
powed_any = true And it results in outright crash:
In both cases I'm accessing a TileMap collider, which seems to be RefCounted. Did the collision change from TileMap node to TileMapLayer refcounted? |
Yes, but the TileMapLayer is refcounted too, so that should not be a problem ? I am not really sure how to reproduce the bug though, seems like |
16575b3
to
9a76a08
Compare
Ah nevermind, found the issue! That was an oversight with a call to Can you try again ? |
I can't test right now, will do tomorrow. |
The error is fixed. |
9a76a08
to
4df04e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not review the whole code, because GitHub is super slow with this many changes. Though I assume it's mostly a copy paste of the previous code.
I didn't spot any regressions from testing with my project, but I don't use all TileMap features. Most notably I didn't test terrains and navigation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving in principle, the nitpick needs fixing.
This also breaks compatibility with GDExtension by making get_used_rect
const. This needs to be handled gracefully.
Does it though ? I am not sure it has any big implication on either the C or the C++ bindings, besides removing errors about not respecting const-ness. I mean that, theoretically, you don't need any change to your code to make things work. |
It does at least in the sense that we include const-ness in the hash calculation. So you get a hash mismatch, which I think means that ABI compatibility is going to be broken for that method. |
6ca5094
to
a4edc96
Compare
a4edc96
to
17a77bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new compat changes seem correct 👍
17a77bf
to
d6379e9
Compare
Thanks! Now the real work begins 🙃 |
Sorry for the huge PR, but it, hopefully, does not change the TileMap behavior. It does the following:
canvas_item_set_draw_index
. It might create bugs too as I am not 100% of the change. Though it looks like it worked well on my test project.Might fix: #77477, to be tested.
Bugsquad edit: Fixes #79553