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

Added Draw Distance option to Display settings #446

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

Conversation

Mode8fx
Copy link
Contributor

@Mode8fx Mode8fx commented Nov 26, 2020

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).

Also changed applicable files to only import configfile if NODRAWINGDISTANCE is not used (otherwise it's an unused import)
@fgsfdsfgs
Copy link
Collaborator

Maybe it would be a good idea to eliminate NODRAWINGDISTANCE entirely later if we merge this. That could be its own separate PR though.

@Mode8fx
Copy link
Contributor Author

Mode8fx commented Nov 27, 2020

Maybe, but it's not really hurting anything, either.

@porcino
Copy link
Contributor

porcino commented Nov 27, 2020

Nice I wanted something like this, because when you add a lot of high poly models with NODRAWINGDISTANCE sometimes it lags. What if the distance is set automatically based on the performance? it's posible?

@Mode8fx
Copy link
Contributor Author

Mode8fx commented Nov 27, 2020

Maybe you could check what entities are in a level when you load it and how many polygons exist among these entities, then scale according to your hardware? No idea, maybe someone with a better understanding of loading that stuff could look into it.

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.

3 participants