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

More settings to the Camera settings menu #555

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

Sunketchupm
Copy link
Contributor

@Sunketchupm Sunketchupm commented Dec 11, 2024

Sherbie's suggestions from #497 and #538, as well as suggestions from others on discord.
Add 2 new camera settings to free camera, being camera collision and dpad usage.
Add an entire new camera submenu for romhack camera, which are now no longer exclusive to romhacks.
I'm well aware that the code here isn't well made so I will need some feedback to make it better.

No other languages are supported right now.

kermeow pushed a commit to kermeow/sm64coopdx that referenced this pull request Dec 21, 2024
* Main code

* Added gInCredits

* Added gInCredits

* Reset gInCredits when network_shutdown() is ran

* Update mario_actions_cutscene.c

* Remove gInCredits

* Remove gInCredits (header file)

* Update network.c

* Update mario_actions_cutscene.c
@Sunketchupm Sunketchupm changed the title Add two new free camera toggles More settings to the Camera settings menu Jan 7, 2025
@Sunketchupm Sunketchupm marked this pull request as draft January 7, 2025 19:11
@Sunketchupm Sunketchupm marked this pull request as ready for review January 8, 2025 07:06
@Sunketchupm
Copy link
Contributor Author

That is about every feature I wanted to add and no known major bugs. Will need feedback on making the code better though as well as bugs I did not encounter.

Suggestion by Fearl
This most likely affects more than I could think
Thanks Sherbie
Copy link
Collaborator

@Isaac0-dev Isaac0-dev left a comment

Choose a reason for hiding this comment

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

here's some feedback.
another general comment, indentation looks more clean with mutiline conditions when formatted like this:

if ((gOverrideRomhackCamera != RCO_ALL_INCLUDING_VANILLA && gOverrideRomhackCamera != RCO_ALL_VANILLA_EXCEPT_BOWSER) &&
    (dynos_level_is_vanilla_level(gCurrLevelNum))) {

puZ = math_ceil((-8192 + m.pos.z) / 65536)
end
if puX ~= 0 or puZ ~= 0 then
if m.playerIndex == 0 and (m.pos.x > 32767 or m.pos.x < -32768 or m.pos.z > 32767 or m.pos.z < -32768) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

rather than 32768 and 32767 use 0x8000 (which is 32768 in hex).
when replacing 32767, put >= to keep the same logic.
this is represents 180 degrees in sm64 angles, and hex is typically how we write it

if (gOverrideRomhackCamera == RCO_ALL_EXCEPT_BOWSER) {
if (gCurrLevelNum == LEVEL_BOWSER_1 || gCurrLevelNum == LEVEL_BOWSER_2 || gCurrLevelNum == LEVEL_BOWSER_3) {
if ((!(gOverrideRomhackCamera == RCO_ALL_INCLUDING_VANILLA || gOverrideRomhackCamera == RCO_ALL_VANILLA_EXCEPT_BOWSER)) &&
dynos_level_is_vanilla_level(gCurrLevelNum)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this line doesn't look great here. prefer

if (gOverrideRomhackCamera != RCO_ALL_INCLUDING_VANILLA && gOverrideRomhackCamera != RCO_ALL_VANILLA_EXCEPT_BOWSER && dynos_level_is_vanilla_level(gCurrLevelNum)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants