17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00
Commit Graph

3286 Commits

Author SHA1 Message Date
maj00r
7371b18910 feat(editor): vertical profile editor, grade lines kept in the scenery 2026-10-04 00:14:03 +02:00
maj00r
cdd5c242d1 feat(editor): curves take over the adjoining straights 2026-10-04 00:14:03 +02:00
d37dff11e1 fix(editor): ground lookups sorted once instead of walking every terrain model, orthophoto kept under the roads; feat(roads): junction sides, stop lines and junction options 2026-10-03 23:13:01 +02:00
502c609b13 feat(roads): single piece widening with generated transitions, point height tools, fix for the frame rate drop in the road tools 2026-10-03 22:18:53 +02:00
1d4c448e30 feat(roads): junctions made by leading a road out of another, width and height set at road points 2026-10-03 21:20:00 +02:00
daeed40f15 feat(roads): junctions, height above the ground and rounded profile following the terrain 2026-10-03 20:28:37 +02:00
e4083d507f feat(roads): editor menu and window for building roads, lanes shown as trajectories 2026-10-03 18:21:10 +02:00
2f417fddcc feat(roads): road node with generated lanes, surface and markings 2026-10-03 17:35:08 +02:00
3eb1f42e8e fix(editor): rename lambda clashing with the windows far macro 2026-10-03 17:34:48 +02:00
pawelw
51521a135a Text displays: accept characters above 127, in windows-1250 or utf-8 (#198)
* Text displays: accept characters above 127, in windows-1250 or utf-8

A text display (sub-model of type "text") looks up the sub-model of each character
in a 256 entry table, and indexed it with a plain char. With char being signed, any
character above 127 gave a negative index: reading the text went outside the table,
and so did filling the table if a character sub-model had such a name. In effect the
displays could only show ASCII, and a text with national characters could crash.

The lookup is now keyed by unicode code point. Both the displayed text and the names
of the character sub-models are decoded as utf-8 if they are valid utf-8, and as
windows-1250 otherwise, so legacy (ansi) sceneries and models work next to utf-8
ones, and the two can be mixed. A short ansi text can be valid utf-8 by accident
(two upper case accented letters in a row will do); when both readings are possible
the one which finds more of its characters in the model is used.

The rest is unchanged: the first character of the text still isn't displayed, the
characters are still drawn in the translucent pass only. A missing text pointer no
longer gets dereferenced.

* Text displays: prepare the characters once for each text

The sequence of character sub-models was cached for the last text only, so
displays of several instances drawn in turn decoded their texts again on
every draw. It is now kept for each text the display shows; the texts of the
instances don't change, so a draw costs a single lookup.

Also the comments added in the renderers are now in English.

* Text displays: move the text decoding to utilities

utf8_to_utf32() and win1250_to_utf32(), with the windows-1250 table, now sit
next to win1250_to_utf8(). The existing function maps only the Polish letters
and passes other bytes above 127 through, so it can't serve the displays.

* Text displays: address the SonarCloud findings

std::array instead of the C-style arrays, the utf-8 sequence length worked
out in a function of its own instead of nested conditional operators,
std::byte for the bit operations, std::ranges::count_if and contains().
The character loop of the renderers moved to Render_Alpha_text(), which
takes the nesting back to the limit, and the static pasText is accessed
through the class.
2026-10-03 12:05:32 +02:00
maj00r
676bf39136 feat(editor): track editor saves changed paths to scenery 2026-10-03 02:41:35 +02:00
maj00r
38161572b4 fix(editor): switches follow cant on curves 2026-10-03 02:41:35 +02:00
maj00r
acd2f8a28a feat(editor): switches bend along curves 2026-10-03 02:41:35 +02:00
maj00r
5fba2a4a68 feat(editor): double slip auto-fits radius, click to replace 2026-10-03 02:41:35 +02:00
maj00r
7825b92190 feat(editor): add R500 double slip 2026-10-03 02:41:35 +02:00
maj00r
4d060f166e feat(editor): add R300 double slip 2026-10-03 02:41:34 +02:00
maj00r
55fd0c74bd feat(editor): insert double slip at crossing 2026-10-03 02:41:34 +02:00
maj00r
de6053e18a feat(editor): crossover snaps to parallel straight 2026-10-03 02:41:34 +02:00
maj00r
a9e63e9496 fix(editor): fix: zero-vector curves detection 2026-10-03 02:41:34 +02:00
maj00r
de5f2069f7 feat(editor): dragging straight refits neighbor curves 2026-10-03 02:41:34 +02:00
maj00r
613ee89c69 fix(editor): apply the transition split when the slider is released 2026-10-03 02:41:34 +02:00
maj00r
bf24c3983a feat(editor): no sub-metre straights, switches snap, K splits path 2026-10-03 02:41:34 +02:00
maj00r
8a50d352fb feat(editor): shift with 4 points, single path curves, undo 2026-10-03 02:41:34 +02:00
maj00r
b5e1510c1e fix(editor): break near end splits last path 2026-10-03 02:41:34 +02:00
maj00r
a5955f322e feat(editor): context editor for geometry, paths behind switches, switch textures 2026-10-03 02:41:34 +02:00
maj00r
40422aec30 feat(editor): compound curves with dual radii and transition 2026-10-03 02:41:34 +02:00
maj00r
1985758a86 feat(editor): insert switches by dragging, paths from free ends 2026-10-03 02:41:34 +02:00
maj00r
32798a32bb feat(editor): switch templates, auto distances with snapping 2026-10-03 02:41:34 +02:00
maj00r
5caefa297b feat(editor): context from path, modifier keys, radius grip, viewport hints 2026-10-03 02:41:34 +02:00
maj00r
e910af4712 feat(editor): break and S-curve with mouse 2026-10-03 02:41:34 +02:00
maj00r
a392364f06 feat(editor): curves over 180°, click to load curve 2026-10-03 02:41:34 +02:00
maj00r
9877ebe261 feat(editor): break straight with curve, S-curve shift 2026-10-03 02:41:34 +02:00
maj00r
b986cc8990 feat(editor): move straights keeping parallel 2026-10-03 02:41:34 +02:00
maj00r
90f03849c0 fix(editor): keep straight handle selected after drag 2026-10-03 02:41:34 +02:00
maj00r
9198840d0f feat(editor): straights include switches, drag to edit 2026-10-03 02:41:34 +02:00
maj00r
78c4b9f6df feat(editor): add orthographic top view toggle 2026-10-03 02:41:34 +02:00
maj00r
b19f3de0d4 feat(editor): recognize collinear straights, measure 2026-10-03 02:41:34 +02:00
maj00r
d6519531ed feat(editor): fit curves between fixed ends 2026-10-03 02:41:34 +02:00
maj00r
7ede96df5f chore(editor): cleanup comments 2026-10-03 02:41:34 +02:00
maj00r
8f2a34b3cf feat(editor): route design with curves and transitions 2026-10-03 02:41:34 +02:00
maj00r
b93c5dde60 feat(editor): edit tracks loaded from the scenery 2026-10-03 02:41:34 +02:00
maj00r
e46fe6d06c refactor(track): reusable segment init, geometry rebuild, cell removal 2026-10-03 02:41:30 +02:00
521c4f9ebb feat(editor): keep content added by the editor ahead of FirstInit 2026-10-03 01:59:13 +02:00
ced26d171f feat(editor): edit parameters of a placed include 2026-10-03 00:37:17 +02:00
968594c3e9 feat(editor): include database, placing .inc templates from the node bank 2026-10-02 23:57:35 +02:00
a612b0c96c fix(editor): release the scenario file after load, undo a failed save 2026-10-02 22:54:19 +02:00
3199f3796e feat(editor): layers window, scenery save and include descriptions 2026-10-02 22:40:52 +02:00
73f2f68aa0 feat(editor): edit session (-edit) and scenery layers 2026-10-02 21:29:18 +02:00
jerrrrycho
06fc3915f4 fix(renderer): guard replacable skin lookup and light colour access (#200) 2026-10-02 21:19:16 +02:00
69f5f551a1 feat(editor): orthophoto lift above the ground and opacity in the scene 2026-10-01 22:17:12 +02:00