-
Notifications
You must be signed in to change notification settings - Fork 329
fix: adds padding in between maps if they are of odd width size, making it possible to tile those. Small performance improvements. #6971
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
base: master
Are you sure you want to change the base?
Conversation
…possible to tile odd width boards, a few perf improvements
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.
Pull Request Overview
This PR enhances board handling by adding configurable padding between maps when board widths are odd, ensuring proper tiling, and also includes minor performance improvements and UI updates.
- Removed obsolete rotateBoard lists and updated calls to BoardUtilities.combine to use the new padding approach.
- Added support for a high performance graphics option with its associated UI elements.
- Made minor adjustments in Hex grid handling and additional cleanup in deployment and UI dialogs.
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
TWGameManager.java | Removed rotateBoard list usage in board combining. |
ServerBoardHelper.java | Adjusted combine() call to drop rotateBoard list. |
BoardUtilities.java | Added new combine() overload with padding support and deprecated legacy methods. |
ScenarioV1.java | Removed rotateBoard list from board creation. |
BoardDeserializer.java | Updated combine call to array-based version. |
TWBoardTransformer.java | Removed rotateBoards return value and refactored accordingly. |
Hex.java | Replaced stream-based map-to-array conversion with an explicit loop. |
Board.java | Added early break when “hex” tag is encountered in getTags(). |
UIUtil.java | Updated rendering hints handling with separate paths for high quality and high performance graphics. |
ChatLounge.java | Minor change to board tag refresh call (with inline comment “is this necessary?”). |
BoardView.java | Removed redundant blank line before drawing. |
GUIPreferences.java | Added new HIGH_PERFORMANCE_GRAPHICS setting with corresponding getter/setter. |
CommonSettingsDialog.java | Added checkbox for high performance graphics with tooltip and updated layout. |
BoardEditor.java | Updated combine() call to remove unused rotateBoard parameter. |
Files not reviewed (1)
- megamek/i18n/megamek/client/messages.properties: Language not supported
Co-authored-by: Copilot <[email protected]>
65a854a
to
ce60c26
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6971 +/- ##
============================================
- Coverage 30.32% 30.30% -0.02%
+ Complexity 15837 15823 -14
============================================
Files 2888 2888
Lines 283253 283348 +95
Branches 49328 49363 +35
============================================
- Hits 85903 85879 -24
- Misses 191748 191864 +116
- Partials 5602 5605 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
*/ | ||
public static Board combine(int width, int height, int sheetWidth, int sheetHeight, | ||
Board[] boards, List<Boolean> isRotated, int medium) { |
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.
isRotated was not used by this function, apparently it's just an old appendage that made sense sometime in the past.
Im hesitant to merge this one for the .06 release. These are nice additions but it's also adding a new feature, so to speak. |
In that case, I am reopening my previous PR which added the warning nag for users advising them for not selecting odd width boards for tiling maps together. |
What it does?
Adds padding in between maps if they are of odd size, making it possible to tile odd width boards, a few perf improvements when rendering the board and when making changes in the Select Map Tab.
4 maps 15x15 with 3 column padding in between
4 maps 11x11 with 3 column padding in between (before I added pavement to the padding generator)

Here we can see in detail the "lerp" functionality added, it averages the height in between both sides.

All changes
Board#getTags
function to stop when it finds the firsthex
intead of going until the end of the file.What it doesnt do
I does not make possible to rotate maps with odd number of columns, to do that the original board has to recreated with one extra column, it's possible and this makes it easier to do that.
Closes