Conversation
|
It's possible that Godot used to use |
|
To change this to a Vector I kind of have to rework a lot of things so I don't want to do it in this PR. I compared the MethodDefinition struct and D_METHOD function in godot-cpp to the one's in godot and they do the same thing but for some reason the way they are implemented is completely different. Differences I found are:
I'm not sure if this stuff is an oversight and they are meant to be debug only or if they are actually needed, it's hard to tell but it doesn't look like they are actually used so the differences are confusing. A lot of this came from and hasn't been changed since this commit 4 years ago https://github.com/godotengine/godot-cpp/tree/e4ed4897, which is the same commit that added all the stl containers so maybe there was some reason for it back then but I can't see one now. |
There was a problem hiding this comment.
Alright, if the change to Vector / LocalVector increases the complexity of the PR, we don't have to wait for that. Changing away from STL list is a goal in its own right, to decrease complexity and improve compile time.
Sorry for taking so long to approve this. By now the PR needs a rebase.
std::list was being used in in one place for method args in class_db.hpp. This replaces it with Godot's List.
This works fine but after looking at the code I'm pretty sure this shouldn't even be using a List at all. It's only used in MethodDefinition's args member but internally Godot uses a
Vector<StringName>for this but godot-cpp is using aList<StringName>. godot-cpp's D_METHOD works different than the internal Godot one though so maybe this is intentional? Either way I don't want to make that change until #1841 gets merged as they will conflict.