17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 15:39:20 +02:00
Commit Graph

3138 Commits

Author SHA1 Message Date
maj00r
d069743265 Switches: enforced branch tangency, internal basket, Polish turnout templates
A switch (rozjazd) is a relation on a through niweleta, not a niweleta - the
through track is never split. It marks the theoretical point on the through
centreline; two tangent lines cross there (the through heading and that heading
turned by the crossing mark 1:n), and the internal diverging curve is fitted to
round the corner between them, reusing the same GapFitter the gap fits go
through. So the curve is free: a plain arc, or a łuk koszowy right inside the
switch. The theoretical tangent lengths and the curve length follow from it and
are read off, not set.

The branch niweleta's leaving straight is now locked to the frog: it starts at
the frog and runs along the frog heading every solve, only its length is the
user's. That enforces tangency no matter what is drawn, and because the first
straight is pinned tangent, any fit in the branch's first gap - including a
basket - meets the switch tangentially by construction.

solve_layout solves the niwelety and the switches together in two passes: solve,
read each frog, pin the branches, solve again. Switches serialize as an ejuncs /
ejunc section; older files without it still load.

Typical Polish turnouts (rozjazdy zwyczajne) are offered as templates that set
the crossing mark and radius together; the length each spans is computed from
them (arc = R*atan(1/n)) and shown, so how long the switch is is known.
2026-08-27 19:36:55 +02:00
maj00r
d4b1d73338 Keep tiles on disk, add basket curves, undo the image flip
The flip was my mistake. Measured against the service instead of guessed:
fetching a box and its northern half shows the half matching the top of the
whole, so the images arrive with their first row at the north edge and the
default texture coordinates were right all along. Both the base map and the
orthophoto go back to them.

Imagery of a given piece of ground does not change, so a fetched tile is now
kept under editor/cache/orto and the next session starts from it. Until now
the cache lived only in memory, which meant going back to a slow and flaky
service for ground that had already been fetched once.

Gaps can be fitted with a basket curve as well: the library's compound mode,
with clothoids at both ends and a chain of arcs between them. Arcs can be
added and removed; the closing one takes whatever deflection the earlier
ones leave, so its length is not offered for editing.
2026-08-27 19:36:55 +02:00
maj00r
32a4df6111 Fix the base map orientation, drop the city overlay, keep td.scn out of the editor
The Geoportal images arrive with their first row at the north edge, which is
the opposite of what the default texture coordinates assume - the vertical
ones are now swapped, for the picker's base map and the orthophoto alike.

With the real map carrying its own detail as the view zooms in, the drawn
city markers had nothing to add and are gone, along with the coordinate
table behind them. Only the country's extent remains, to open the picker on.

-editor no longer inherits the scenery named in eu07.ini. That is whatever
was last driven, which has nothing to do with editing; without an explicit
-s the editor opens on empty ground.
2026-08-27 19:36:55 +02:00
maj00r
8d007291e2 Put Geoportal imagery behind the plan and clear the scenery on a new map
The location picker now shows the real topographic map instead of a
hand-drawn outline, fetched as one WMS image for whatever box is on screen;
the schematic border is gone and only the city list remains, to jump the
view somewhere recognisable. Under the plan itself a georeferenced map gets
the orthophoto, tiled through the layout library's own EPSG:2180 grid and
cache.

What a native build was missing is here: the download (WinHTTP, on worker
threads), the decode and the texture. Finished transfers are handed back on
the thread that drains them, so both the library's cache and the graphics
API stay on one thread. The imagery service turns down browser user agents
and fails the odd request even for a plain one, so requests go out as curl
and are retried a few times.

Starting a new map now drops the loaded scenery and comes back on empty
ground, instead of leaving the previous scenery's contents under a plan that
has nothing to do with them. The reload is deferred to the top of the frame:
taking the editor off the mode stack while it is drawing its own panels
would pull the ground out from under them.
2026-08-27 19:36:55 +02:00
maj00r
bf82c35734 Georeference a new map against a point in Poland
"New map" now asks what is being started. A fictional scenery keeps its own
frame, where coordinates mean nothing outside it. A real one pins the
scenery's zero to a point picked off a map of Poland, so the plan is drawn
in EPSG:2180 - the frame the layout library already works in, and the one
Geoportal serves imagery in.

The projection is the standard transverse Mercator series for PUWG 1992 on
GRS80. Checked against known values: the central meridian comes out at
easting 500000 exactly, Warszawa at 637382/486757, Krakow at 567614/244588,
Gdansk at 477038/720937.

The map behind the picker is a schematic border outline plus the larger
cities, projected from geographic coordinates on first use. It is coarse on
purpose - it is there to point at a region, not to measure against - and the
dialog says so. No network is involved.
2026-08-27 19:36:55 +02:00
maj00r
3fbc1aaaaf Draw the track plan on the scenery instead of on a canvas
The plan panel had its own 2D canvas, which was the wrong place for it: the
layout is drawn on the scenery. The canvas is gone. Points are laid by
clicking the ground under the cursor, the solved geometry is painted over
the rendered world through the colour pass camera, and the panel keeps only
the controls - fits, storage and what is being edited.

The left button belongs to the plan tool while it is up, so a click no
longer also picks or places a scenery node. Clicks landing on a panel stay
with the panel.

With no georeference set the plan frame and the world share an origin, so
easting runs along world x and northing against world z.
2026-08-27 19:36:55 +02:00
maj00r
db49039b9d Put the editor viewport into a top-down orthographic plan view
Opening the Plan tool now switches the whole colour pass to an orthographic
projection and pins the camera looking straight down, so the plan is drawn
against the loaded scenery rather than in a window of its own. Closing the
tool hands the camera's orientation back; leaving the editor clears the view
outright. The wheel changes how much ground fits on screen instead of moving
the camera, which with no perspective would change nothing but the clipping.

Both configured backends follow: the experimental renderer swaps the pass
projection (and fits its shadow cascades to it), the modern GL renderer uses
its existing ortho helpers. Everything reading the pass projection - the
mouse ray, the frustum test - picks the change up on its own.

The experimental renderer also publishes its colour pass camera now, which
it previously left at the interface defaults, so overlays can place world
points on screen.
2026-08-27 19:36:55 +02:00
maj00r
4bef28cf94 Add a track layout drawing board to the editor
A "Plan" panel, opened from Track layout in the editor's menu bar, draws a
niweleta the way the web frontend did: click to lay chained straights, drag
a corner to move it, and pick a fit for each gap between them. The geometry
is entirely maj0sted's - the panel gathers the input, hands the document to
solve_project and paints the rails that come back, coloured by whether they
came from a straight, an arc or a clothoid. Scenery nodes are untouched.

A fit the library cannot produce is simply absent from its answer, so the
gap is labelled as not fitting rather than left looking as though its
parameters took effect. Save/load go through the library's own document
format, so a project written here opens in the same state.

Also translates the comments added with -editor into English, matching the
files they sit in.
2026-08-27 19:36:55 +02:00
maj00r
e3237034db Give the editor a camera when it starts on its own
The scenery camera is set up by the driver mode, which never runs when the
exe starts straight in the editor - the editor then copied an untouched
global camera and rendered a black view with only the UI on top. Entering
the editor as the startup mode now initialises the camera itself, falling
back on a view above the origin for sceneries that name no camera, and
resets the timers so the loading time does not land in the first frame.
2026-08-27 19:36:55 +02:00
maj00r
94b01c8ca3 Add -editor startup so the exe comes up straight in the editor
The editor was reachable only from the driver mode with F11, which meant
loading a scenario and starting the whole simulation first. With -editor
the scenario loader hands over to the editor instead of the driver, so
physics, AI and timetables never run - only the loaded world is there to
be worked on.

Without -s the scenery from eu07.ini is used, falling back to pusta.scn
when the ini names none. F11 quits instead of popping the mode, since the
editor is now the bottom of the mode stack and popping it would leave the
rest of the frame reading an empty one. Editor entry forces free-fly even
with no vehicle to leave.
2026-08-27 19:36:55 +02:00
maj00r
a083269867 Vendor the maj0sted track layout library and link it into the editor
Drop-in copy of C:\Users\maj00r\Projects\maj0sted-master minus its web/
directory - the WASM frontend is not being ported, the editor drives the
same C++ API natively. What is left is plain C++20 with no dependencies:
domain model (niweleta, plan and profile geometry, fitting, parallelism),
project serialization, rail sampling and the editor document.

src/web/ribbon.cpp was missing from the library source list; added, since
without it the ribbon symbols never make it into the archive.
2026-08-27 19:36:55 +02:00
maj00r
0aceb120e2 make targetfps great again 2026-08-25 18:03:55 +02:00
jakubg1
f8cb5e4431 Fix EP fuse auto-(dis)engaging
When the Autorewident function is enabled, the EP fuse switch will no longer automatically engage or disengage if the player is controlling the train. This would happen for example when approaching a station.
2026-08-24 00:24:15 +02:00
jakubg1
363b50c9c2 Remove training card window
This was a leftover from attempts at modifying MaSzyna for professional simulators.
Interaction with this window could cause a crash.
2026-08-23 22:37:33 +02:00
jakubg1
9a0b63a97c Merge pull request #133 from dos1/launcher-panel
launcher: Open on scenery list panel
2026-08-23 21:53:12 +02:00
df9ba73a88 Merge pull request #158 from MaSzyna-EU07/migrate-to-actions
Migrate to actions
2026-08-20 23:11:27 +02:00
66302bd88e Remove appveyor and update readme 2026-08-19 14:50:28 +02:00
8024c2be7b Revert "Delete appveyor.yml"
This reverts commit 8a22553e7c.
2026-08-19 14:48:03 +02:00
3c61168783 Revert "Delete azure-pipelines.yml"
This reverts commit 67bb6e1d3c.
2026-08-19 14:47:59 +02:00
67bb6e1d3c Delete azure-pipelines.yml eu07-2026.423-prerelease 2026-08-19 14:45:49 +02:00
8a22553e7c Delete appveyor.yml eu07-2026.422-prerelease 2026-08-19 14:45:33 +02:00
6b50a6aa68 Update CI configuration for Windows and Linux builds 2026-08-19 14:23:40 +02:00
1cfe44a9d3 Add Linux Python environment setup in workflow
Added a step to prepare a Linux Python environment with a virtual environment and install Pillow.
2026-08-19 14:07:30 +02:00
fee2dcea28 Fix path for vswhere.exe in build_bin.yml 2026-08-19 13:20:53 +02:00
af08beaaa8 Change push branch filter to include all branches 2026-08-19 13:17:00 +02:00
518ac093ac Rename workflow from 'Build' to 'Build binaries' 2026-08-19 13:15:29 +02:00
9d1a8244ed Add GitHub Actions workflow for building binaries 2026-08-19 13:14:53 +02:00
4dcf0abfa1 Merge pull request #157 from MaSzyna-EU07/python-add-dynamicbrakectrlpos
Add DynamicBrakeCtrlPos to python
2026-08-19 10:32:16 +02:00
4aa4918a36 Merge pull request #155 from MaSzyna-EU07/fix/default-shader-reflections
Fix default shader reflection
2026-08-19 10:03:45 +02:00
dcd87d8c80 Merge pull request #156 from MaSzyna-EU07/fix-traxx-independent-brake
Fix "Traxx" local brake
2026-08-19 10:03:11 +02:00
Ryba04
763a76d48c Expose dynamic brake controller position to python script dictionary 2026-08-19 00:55:24 +02:00
Ryba04
7cc6a67399 Followed sonar's suggestions 2026-08-18 20:34:37 +02:00
Ryba04
7d3b9a7360 Fix "Traxx" local brake 2026-08-18 00:04:31 +02:00
3b4df9bb6d Fix default shader reflection 2026-08-17 18:51:36 +02:00
Ryba04
72f932e5d9 Add independent dynamic brake support (eg. Vectron) to UART controllers 2026-08-16 21:34:22 +02:00
Ryba04
1357afb9e1 Update C++ version in readme 2026-08-16 12:40:47 +02:00
Ryba04
7ed57d1b3b Fix assets license link in README
Updated the link for the assets license in the README.
2026-08-09 19:27:27 +02:00
Ryba04
8cd94859c3 Update assets license link in README.md 2026-08-09 19:26:24 +02:00
b70afe6a74 Merge pull request #152 from combolek/unc-path
mashadercompiler: Add support for UNC paths
2026-08-06 21:38:27 +02:00
e65b062721 Merge pull request #151 from combolek/smoke-fix
Disable GLM_FORCE_DEFAULT_ALIGNED_GENTYPES to fix graphics corruption
2026-08-06 21:23:03 +02:00
Sebastian Krzyszkowiak
f249781805 launcher: Open on scenery list panel
This is the panel that allow to quickly launch a selected scenario, so
it makes sense to show it by default.
2026-08-06 16:53:58 +02:00
combolek
1d08198d22 mashadercompiler: Add support for UNC paths
MS DXC on Windows (at least IDxcUtils::BuildArguments) does not support forward slashes in UNC paths. This change feeds it native format with backslashes.

This makes it possible to build Linux and Windows binaries from a single source on a network share.
2026-07-28 18:51:10 -07:00
combolek
a62c9d12f4 Disable GLM_FORCE_DEFAULT_ALIGNED_GENTYPES to fix graphics corruption
This is a regression introduced in 7525b54f (merged via df5a8a89), GLM_FORCE_DEFAULT_ALIGNED_GENTYPES causes visible screen corruption, particularly in the smoke from chimneys or vehicles.
2026-07-28 14:57:30 -07:00
combolek
19441b5e91 Convert Przekladniki to std::array 2026-07-28 09:28:10 -07:00
combolek
12c583f418 Fix some SonarQube warnings 2026-07-28 08:54:33 -07:00
combolek
00bb44a789 state_manager: Optimize computation of pressure flow for Oerlikon ESt valves
TNESt3::GetPF() is a *major* hotspot in simulation state update. The leading cause is the use of typeid (RTTI) which is implemented in the C++ runtime essentially as a string compare. This change eliminates the use of typeid and instead caches statically typed pointers for the few TPrzekladnik subclass objects that need their parameters adjusted in TNESt3::GetPF(). As a bonus some virtual methods on TPrzekladnik can now be removed. Overall this change reduces the TNESt3::GetPF() contribution from about 25% to 16%.
2026-07-26 21:19:38 -07:00
d9eb705d4a Revert "Update GLM ref"
This reverts commit 38db27d3de.
2026-07-25 12:59:54 +02:00
38db27d3de Update GLM ref 2026-07-24 13:05:18 +02:00
8399f55e53 Enable GLM_FORCE_INLINE only for MSVC compiler
Fixes compilation under gcc 15
2026-07-24 12:53:55 +02:00
Sebastian Krzyszkowiak
8383472bbe stdafx: Only use GLM_FORCE_DEFAULT_ALIGNED_GENTYPES on MSVC (#136)
It causes the game to crash on launch while attempting to use SIMD
instructions when compiled with GCC or Clang.

Since it's known to work on MSVC and was enabled due to performance
improvement, leave it enabled there.
2026-07-21 22:57:00 +02:00