-
Notifications
You must be signed in to change notification settings - Fork 79
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
Map object documentation #333
base: main
Are you sure you want to change the base?
Conversation
… (naming variables/functions, removing unnecessary params, combining if statements)
src/map_object_move.c
Outdated
} | ||
|
||
int sub_02064488(int param0, int param1, int param2, int param3) | ||
int sub_02064488(int x, int z, int xPrev, int zPrev) |
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.
Are you sure about these parameter names? They don't look quite right.
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.
It seems like I focussed a bit too much on one specific instance of it being used:
static int sub_0206A034(MapObject *mapObj, UnkStruct_02069F48 *param1)
{
int v0 = MapObject_GetX(mapObj);
int v1 = MapObject_GetZ(mapObj);
int v2 = MapObject_GetX(param1->unk_08);
int v3 = MapObject_GetZ(param1->unk_08);
int v4 = MapObject_GetXPrev(param1->unk_08);
int v5 = MapObject_GetZPrev(param1->unk_08);
int v6;
if ((v0 == v2) && (v1 == v3)) {
return 0;
}
v6 = sub_02064488(v0, v1, v4, v5);
It varies quite a bit tough, so you're right in that it doesn't really make sense. I don't think there's really descriptive names I could give them that covers all usages of the function besides just x1
, z1
, x2
and z2
, do you think I should do that, or revert them back to paramX
names?
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.
Keep as paramX
if unsure.
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 am sure that the params are two sets of coordinates, so x1
, z1
, x2
and z2
would be true, but they're not very descriptive besides that it's two sets of coordinates. The issue is that I don't think there's a more descriptive option because of this function being used in different ways, so the param names can't be more specific I think. Sorry I should've made that a bit more clear, I'm just not sure if it's then still worth it to give the names x1
, z1
, x2
and z2
.
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.
If you're unsure then it's okay to leave this function as it is for now and not rename anything. We can always come back again when the other functions (that invoke this function) themselves get documented.
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.
Okay, I have changed it back and committed that together with fixes for your other comments, thanks for all the feedback!
Documentation centered around
map_object.c
andmap_object_save.c