-
Notifications
You must be signed in to change notification settings - Fork 265
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
cute_tiled: overload class with type #363
Conversation
This is related to RandyGaul#362 Newer versions of Tiled seem to use this the same way as earlier `type` so this just uses the same field.
while (cute_tiled_peak(m) != ',' && cute_tiled_peak(m) != '}') cute_tiled_next(m); | ||
if (cute_tiled_peak(m) == '}') continue; | ||
// This is technically different than type, but it used the same way in newer versions of Tiled | ||
cute_tiled_intern_string(m, &object->type); |
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.
Seems strange to load class
into type
. Should we not have a type
case that would load type
? While the JSON Map Format documents both types as strings, it seems weird to mix the two.
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.
What better way to represent a class, than as a string? I think I recall entire objects can be stored there, but, for now at least parsing the string is better than nothing.
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.
As a string makes sense. I'm more concerned about class
being loaded into type
.
Objects don't even have a class
associated with them, so if anything, the class
case should be removed entirely:
https://doc.mapeditor.org/en/stable/reference/json-map-format/#object
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 added more notes on #362 somehow class
is sometimes used instead of type
. it's the same data, but in some situations it will name it one or the other, this just puts that same data in type
struct-field. This doesn't remove type
case which does the same thing.
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.
Ah, that makes sense. Thanks for some of the context 👍..... Since class
isn't a property associated with object
, seems like this is a fine addition to have.
This is related to #362
Newer versions of Tiled seem to use this the same way as earlier
type
so this just uses the same struct-field.