-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve map grid size handling, fix fullscreen map cutting off #35
Conversation
@@ -74,14 +73,13 @@ public class GridRenderer | |||
private FloatBuffer winPosBuf; | |||
private FloatBuffer objPosBuf; | |||
|
|||
public GridRenderer(int gridSize) |
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.
Leave the API as is, use wrappers to clamp the inputs to a new scheme.
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.
The input will get overwritten anyway when the gridSize gets recalculated next (I think the caller has no useful purpose for passing a gridSize here).
I could leave a constructor that accepts a gridSize but just discards it to call the normal constructor for API compatability (As added initially, removed in second commit)
If that doesn't satisfy, I don't know what you mean; please clarify.
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 mean to keep public API breakage to an absolute minimum. You never know, where it would be called, and you can't possibly fix every dependent code you don't control.
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.
If it works fine in gtnh pack it can be removed
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.
Confirmed compatability with a recent GTNH nightly.
Also confirmed compatability with VisualProspecting overlays.
Compatability with TCNodeTracker overlays couldn't be tested because TCNodeTracker appears to be fully broken in nightly.
I can still restore api compatability if it's preferred (already have that stashed anyway), although methods such as public setGridSize would have to be empty dummy methods.
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.
please update the doc/changelog.html
you can replace the current line item in there.
This is very similar, almost identical in places to the changes I did to fix this in 1.12.2, did you decompile that code to look? It's fine if you did, just curious.
Other than the change log update, looks great, thanks a lot.
I did take a look at the recalculation logic, but I think that was the only sensible way to implement this anyway. Looks like later releases still use a square tile size though(?); I wonder what the performance impact of that is. |
Looks like minimap calculation is coming up with needing only 1x1 tiles? Maybe just let it be minimum 3x3, think that should fix it (not 100% sure). Alternatively change formula to be ceil(cells)+1 instead of ceil(cells+0.5), the exact thing I wrote about before... But that may result in some unnecessary work done on specific resolutions. |
I am also going to be very busy until next week. Users can use the old version until a fix can be completed. |
First commit makes the grid size dynamic instead of a constant 5x5. Fixes #34
Other 2 commits clean things up and make the grid able to be non-square, e.g. 5 tiles in width and 3 tiles in height.
This should reduce the amount of work done. when playing in fullscreen on a 1920x1080 screen, only 3x5=15 tiles are used instead of 5x5=25.
I have not benchmarked the actual impact of this as I'm not sure how to do this here.
These also create changes in
public
functions, which may count as a breaking (major version increase) change, depending on your versioning.If these other things are unwanted, I can drop the commits.
All changes are tested ingame. Proper review and testing would still be appreciated as i find this codebase a bit confusing.