Skip to content
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

Separate behavior files into standalone C files #721

Open
wants to merge 36 commits into
base: develop/3.0.0
Choose a base branch
from

Conversation

someone2639
Copy link
Collaborator

@someone2639 someone2639 commented Oct 4, 2023

Scope:

  • convert all .inc.c files in src/game/behaviors to 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)
  • Create a global object_fields and object_constants header that only has shared params, and localize the relevant local fields and constants to their behavior files. (COMPLETE)
  • Move relevant global object functions that were in behavior files to their "correct" files
  • Move toad_message to its own behavior file, and rename mario_misc.c to mario_geo.c

Tracked to-do list before PR is ready to merge:
Create a list of behavior files that need more splitting or naming. (N/A)

  • Clean up. (DONE)

@someone2639 someone2639 added enhancement New feature or request do not merge Do not merge (yet) subjective Multiple opinions are desirable labels Oct 4, 2023
@someone2639 someone2639 self-assigned this Oct 4, 2023
@axollyon
Copy link
Collaborator

axollyon commented Oct 4, 2023

i see we're making 3.0 the "even more hellish to upgrade to than 2.0" update

@someone2639
Copy link
Collaborator Author

encouraging 3.0 to be the starting point for a romhack rather than another upgrade point is

the point

@axollyon
Copy link
Collaborator

axollyon commented Oct 4, 2023

watch me

@someone2639
Copy link
Collaborator Author

Tracking a rogue issue that causes the o->oDoorForwardRoom and o->oDoorBackwardRoom values to lock to -1 when rooms are present, but I do not know how to reproduce this (alignment issue?)

@gheskett gheskett added this to the 3.0 milestone Oct 12, 2023
@someone2639
Copy link
Collaborator Author

TODO: Files that include debug.h need to also include the relevant header that defines the UNUSED qualifier

@someone2639 someone2639 linked an issue Dec 11, 2023 that may be closed by this pull request
@someone2639
Copy link
Collaborator Author

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.

@someone2639 someone2639 marked this pull request as ready for review July 21, 2024 16:17
@someone2639 someone2639 requested a review from gheskett as a code owner July 21, 2024 16:17
@someone2639
Copy link
Collaborator Author

Did another run-through to make sure everything was in order; I believe this is ready for review now

@someone2639 someone2639 added monkaS monkaS and removed do not merge Do not merge (yet) labels Dec 29, 2024
**/

/* End Birds */
#define /*0x104*/ oEndBirdCutsceneVars9PointX OBJECT_FIELD_F32(0x1F)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have it here?

Copy link
Collaborator Author

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) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

@someone2639 someone2639 Dec 29, 2024

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

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request monkaS monkaS subjective Multiple opinions are desirable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split behavior files into separate c files
5 participants