Found with an address and undefined behaviour sanitizer build, random
monkey sessions on the test sceneries and broken inputs:
- A deleted model left its pointer in the pick list of the renderer, the
bound node of the panels, the bindings of the infrastructure and the
selection: the next pick or panel frame read freed memory. The renderer
forgets it, and one erase_model does the cleaning for all the places
which deleted a model by hand.
- The plan band of a route read the vertex before the first one in the
frame a drag was let go.
- A scenery which can't be opened goes back to the launcher with the
reason in the log, a track of an unknown type or a tributary loads as
a normal track or a river with a message, and a spline with no finite
length or step gets a sane number of segments.
- Typed numbers which aren't (NaN, inf, ends 0 m or 1000 km apart, a
vector of 1e30, a diverging track part of 5 km, a curve threshold of 0,
a zero history size, radius norms below zero) are refused or clamped,
where they made the geometry run away or divide by zero.
- Folders which can't be read and file names which aren't valid in the
locale no longer throw out of the scans of sceneries, textures, sweeps,
roads and signal plates; the scans skip them.
- The launcher: Ctrl+Del with no trainset selected, a dropped vehicle
whose skin is gone and a text with a percent sign.
- A terrain mesh made for another resolution of its chunk isn't put into
the chunk, and a slot is reused only for a mesh of the same size.
- Vehicles on a track changed by the editor are moved over a copy of the
list they leave.
- The table of the keyboard shortcuts gives its stretched column a
weight, else ImGui divides 0 by 0 in the first frame of the window.
The geometry of a track made anew, ten times a second while it's
dragged, only forgot the chunks it had: the bank kept them all, so the
buffer of the section grew by the whole track and its neighbours each
time and was sent to the gpu in full again. Ten rebuilds of a test
scenery took the bank from 2 to 29 MB; a long session would run the
card out of memory. The old chunks are erased from the bank now, but
for those of a moving nose, laid again in place, and a moved traction
wire drops its old one too.
A chunk swapped for one without the extra vertex data kept the flag of
having it and the upload read from an empty array; the buffer is made
again when that changes.
- sleepers3d / sleepers3dplain / sleepers3dbed in eu07.ini: timbers put together from the begin, main and end parts of a model
and stretched to their length, plain sleepers of their own model; tracks whose plain sleepers would touch are laid as one
cluster, lines of timbers led by priority and turned to the bisectors of frogs and crossings at a limited rate, whole timbers
under crossings, split ones between tracks with room to part them, gaps filled per rail and overlaps shortened or dropped;
clusters worked out in a background thread while driving, on demand in the editor
- the ballast can be left out under the beams (sleepers3dbed no)
- blades get their heel and throw from the switch template or blades <heel> <throw> in the scenery; blades of double switches
run on into the track linking them to the next switch
- rail cutting at frogs, wing rails, movable noses and switch crossings done by one carving pass (RailCarve)
- tint of the rail treads applied to the colour only, without the matte band at the frog
- a switch trailed through with a movable nose set the other way derails the vehicle
- self-tests: sleepercheck, sharedzones, beamsnear, throw, sleepersbg