Fix Landscape copy/paste gizmo not being selected automatically when entering the copy/paste tool, or importing data into the gizmo, or switching to the gizmo brush, or opening the landscape editor when the copy/paste tool or the gizmo brush was the active tool/brush. This was causing it to unexpectedly not be movable/rotatable/resizable in those situations.
Fix Landscape copy/paste gizmo not being selectable with a single click. Coupled with the previous bug, this was causing a lot of confusion!
A bit of cleanup of the gizmo code:
- the landscape edmode is no-longer responsible for rendering a (0% opacity) box around the gizmo to make it selectable, instead the gizmo itself is now selectable.
- the gizmo frustrum transform is now calculated significantly more sanely!
[CL 2412231 by Gareth Martin in Main branch]
Most code accessing brush/landscape data by calculating indexes (e.g. Data + (Y-Y1)*XSize + (X-X1)) replaced with scanline[X] style for speed
LandscapeInfo->SelectedRegion is now only queried if it contains anything, to avoid hashing the key unneccessarily (the hash function was showing on profiles :( )
Smoothing tool's SmoothFilterKernel*Scale* replaced by the more intuitive Size
Component brush fixed to be properly centered on the cursor at odd sizes and work correctly with the add component tool when cursor is over the landscape (but part of the brush is off the landscape) and size is >1
Copy tool fixed to copy the selected area and not a circle when using ctrl+c
Also a few style cleanups. for (auto it = xyz.CreateIterator...) replaced with ranged for, enums replaced with enum classes, 0.f -> 0.0f, NULL->nullptr, etc.
[CL 2392355 by Gareth Martin in Main branch]
Refactored landscape tool strokes somewhat, removing unnecessary virtual functions (most of the stroke classes were single-level hierarchies, making virtuals pointless), empty functions and unnecessary dynamic allocation (using refactored TOptional)
[CL 2293878 by Gareth Martin in Main branch]
- Inverse was one of the main reasons of crashes via lots of functions. Seems making default Inverse to be safer version seems better.
[CL 2255081 by Lina Halper in Main branch]