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

Draw Distance Setting #19

Open
wants to merge 45 commits into
base: nightly
Choose a base branch
from
Open

Draw Distance Setting #19

wants to merge 45 commits into from

Conversation

Mode8fx
Copy link
Owner

@Mode8fx Mode8fx commented Jan 11, 2021

This adds a new setting to the Display menu that lets you change the draw distance to anywhere between 0.5x and 5x the original game's draw distance, in 10% increments. This should be useful for weaker devices like a Raspberry Pi that can't handle the NODRAWINGDISTANCE build option. This option does not appear in the menu if NODRAWINGDISTANCE is used.

This was implemented by adding a new variable that is multiplied with every instance where an object's distance to Mario is compared in an "#ifndef NODRAWINGDISTANCE" define. Additionally, all of the original draw distances are divided by 100 since 100 represents a normal draw distance. The end result is the same, but this removes the need for continuous float multiplication where applicable (example: "2400.0f" becomes "24 * configDrawDistance", where configDrawDistance is an integer between 50 and 500, default=100).

Draw Distance Setting.zip

(Note: Ignore the "Files changed" section and instead look at the "Files changed" in the pull request on the main repo. In the PR that you're currently reading, there are many changes that are not part of this patch; they may have been mixed in because I made this using an outdated nightly. The patch does still work on current nightlies, however, and the redundant changes are not included in the patch itself.)

pouar and others added 30 commits June 18, 2020 19:34
The bullets snufit shoots immediately got deleted shortly after
shooting when NODRAWDISTANCE was enabled. This fixes it
fix mac build
Fix: Free Camera is forever inverted on the Y-Axis, changing the setting does nothing. sm64pc#373
for that sweet Win9x support
BUGFIX: Camera bugs when using flying cap with BETTERCAMERA=1 sm64pc#370
Fixes controllers which don't check for rumble_strength and have constant rumble from rumbling even when set to 0 in the config.
Check for zero rumble setting before allowing rumble
it's more to deal with the mouse not working I suppose
Fix Yoshi dialog error that has bothered me for 24 years.
The precision of ray casting was too low previously, causing the
collision checks to skip right past a wall sometimes. There was also
nothing to prevent the camera from getting too close to a wall
horizontally or vertically.
Improve bettercam/puppycam's collision detection and avoidance
fgsfdsfgs and others added 15 commits September 29, 2020 19:28
BUGFIX:  Text Saves aren't saving cannon flags. sm64pc#397
unknown if this has actually caused any issues in EX
Fix by PeachyPeach to stop crashes with Discord Integration when enter later Bowser courses and fights early
apparently this was causing collision issues
The segfault is hit while trying to render bhvCheckerboardElevatorGroup
when the player first enters the stage.

So here's some background: bhvCheckerboardElevatorGroup is the invisible
parent object that defines where the two platforms will rotate around. It
has a model, but it's never rendered in game. The entity only exists for
a few frames before being removed from the scene.

Here's the theory: Since it is only valid for a few frames, I believe the
model gets deallocated after removal. Since changing the camera precision
makes the camera end up in a slightly different spot, it could be trying
to render the object when precision is set to 3 but not to 1.

Here's the solution: Adding cur_obj_hide() to the start of
bhv_checkerboard_elevator_group_init() prevents the crash

fixes sm64pc#437
Prevent crash in vanish cap switch course
thanks to opmox for initial implementation
Also changed applicable files to only import configfile if NODRAWINGDISTANCE is not used (otherwise it's an unused import)
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.

9 participants