Automatic bidirectional alignment in x and y direction #1788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses bidirectional alignment as mentioned in #400 and y-alignment as mentioned in #486. These are the aspects implemented:
Aspects not implemented:
This supersedes my previous pull request #1780 as I restructured the alignment implementation to minimize code duplication and extensive parameter passing, and extended the scope to generalized auto-alignment.
As this is limited to the single y-offset from vanilla DOOM, vertical alignment cannot be applied so that the whole wall is properly aligned, but instead only to part of a wall. The wall part selected when activating the alignment hotkey is taken as an indicator of user intent, i.e.
When a one-sided wall is encountered while aligning with "upper wall" or "lower wall" intent, the middle section of the one-sided wall is aligned appropriately. Thus, taking the intent into consideration, this should mostly "just work as expected" (tm).
However, a wall is taken into consideration for alignment if any of its upper, middle or lower texture match the texture of the initial wall segment selected. If, for example, a one-sided wall is selected as initial wall by the user, alignment applies to the middle texture of two-sided walls, even if only the upper or lower wall texture matches that of the initial wall. In that case the non-matching middle texture of the two-sided wall would be aligned to the single middle texture of the one-sided wall.
This could be "fixed" by being more strict about the inclusion of walls into the alignment, but I have shied away from that as it would be a significant change away from the old behavior. However, if that is desired, I can amend this pull request appropriately.