-
Notifications
You must be signed in to change notification settings - Fork 197
Separate behavior files into standalone C files #721
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
base: develop/3.0.0
Are you sure you want to change the base?
Separate behavior files into standalone C files #721
Conversation
tracking warnings
|
i see we're making 3.0 the "even more hellish to upgrade to than 2.0" update |
|
encouraging 3.0 to be the starting point for a romhack rather than another upgrade point is the point |
|
watch me |
|
Tracking a rogue issue that causes the o->oDoorForwardRoom and o->oDoorBackwardRoom values to lock to |
|
TODO: Files that include |
|
Have you actually profiled this? If I've learned anything from Kaze, it's that this might potentially be an atrocity for object runtimes. Also you still need copy the object action enums. |
|
how would this affect performance? it shouldnt affect the compiled rom too much, i was under the impression this PR was just to make programming easier |
|
The door bug is now fixed (as well as every other thing that could've broken due to that issue). This leaves Scope Bullet Point 2 (merging object helper files) as the last TODO for this PR. |
|
Did another run-through to make sure everything was in order; I believe this is ready for review now |
src/game/camera.h
Outdated
| **/ | ||
|
|
||
| /* End Birds */ | ||
| #define /*0x104*/ oEndBirdCutsceneVars9PointX OBJECT_FIELD_F32(0x1F) |
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.
Why have it here?
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 was a remnant of the behaviors that were still in camera.c, but now I guess it can just go to global_object_fields
| return dialogResponse; | ||
| } | ||
|
|
||
| void obj_set_dist_from_home(f32 distFromHome) { |
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.
All small functions like this should be static inline in header files.
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 enough function moving here to get rid of obj_behaviors_2 and object_helpers_2, but anything further is so out of scope that i have another in progress branch trying to consolidate and split everything in a way that makes sense
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 agree, let's keep this PR majorly to splitting behaviors to C files first to ease reviewing process. Can consider minor perf stuff later.
|
Is this ready to review? |
|
yes (but even if you approve the changes it looks like i have to fix some merge conflicts either way) |
arthurtilly
left a comment
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.
Get fixing them then!
|
done! |
| #ifndef GLOBAL_OBJECT_FIELDS_H | ||
| #define GLOBAL_OBJECT_FIELDS_H | ||
|
|
||
| /** |
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 don't see any reason to rename this file to something longer
| #define /*0x088*/ oBowserCamAct OBJECT_FIELD_S32(0x00) | ||
| #define /*0x0F4*/ oBowserStatus OBJECT_FIELD_S32(0x1B) | ||
|
|
||
| /* Hoot */ |
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.
still a bunch of specific ones here... if this is because they're referenced by other behaviors seems like a better solution is necessary
Scope:
src/game/behaviorsto standalone .c files. (COMPLETE)merge the remaining parts of obj_behaviors, obj_behaviors_2, object_helpers, and behavior_actions in some way.(Waaaaay out of scope; postponed to a future PR)Tracked to-do list before PR is ready to merge:
Create a list of behavior files that need more splitting or naming.(N/A)