18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 03:37:09 +01:00
pol102 65b45839fd Editor: track names outside of ASCII listed, not renamed; every name the editor gives is plain ASCII (#376)
* feat(editor): track names with characters outside of ASCII changed to ASCII when a scenery is opened for editing, with a 20 s warning in the middle of the screen

Tracks, and events named after a track (<track>:event0), are still found by their old names, so events, trainsets and memory cells keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ

* chore(editor): the brush and the ASCII track names cleaned up for Sonar (init-statements, std::numbers::pi, ranges, the dab of the stroke and the settings of many models in functions of their own)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ

* chore(editor): the rest of the Sonar notes of the PRs (bytes as numbers, std::format, no copy of the old track name, no shadowed names, try_emplace, deduced template arguments)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ

* feat(editor): the track names outside of ASCII listed, not renamed; the names the editor gives are ASCII only

Reworked after the reviews of maj00r and jerrrrycho and the proposal on the PR: renaming the tracks of
existing sceneries as they're opened, and then chasing every reference to the old names, broke references
it couldn't reach (memory cells in files the editor doesn't write, folded names colliding, the parameters
of includes naming events and cells, names outside of Latin folding to underscores), and its fallback ran
in the game too. So:

- Nothing is renamed when a scenery is opened for editing. The tracks whose names have characters outside of
  ASCII are listed in the log, and the status line says how many there are and that they work as they are.
- Tools -> "Track names outside of ASCII..." opens the list: each name as it reads, its ASCII form, whether
  that form is taken (by another path, or another name giving the same), whether the name comes from a
  parameter of an include, and whether its file is one the editor writes. It changes nothing; a track is
  renamed, if at all, by hand in its properties, where the cells, includes and events it touches are shown.
- editor_track::name_valid() refuses a name with characters outside of ASCII, so every name the editor gives
  (the track properties, the switches, the stations) is plain ASCII.
- The game is as on master: no folded lookups of paths or events (path_table::find, FindEventAscii and the
  map behind it are gone), so a reference to a missing name is reported as before and never binds to
  another track. The big warning in the middle of the screen is gone with the renaming it announced.

ascii_name (plain, fold, readable) and its tests stay, for the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QRgQ1K1Qu7TCsa74zsNURd

* fix(editor): the switch tool takes no name outside of ASCII

The Name field of the switch tool went straight to switch_name_for_new(), so a typed name such as łąka1 became the name of
the new switch and of its drive events, outside the check of editor_track::name_valid(). A letter outside of ASCII is now
refused as it's typed, with the reason name_valid() gives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(editor): the switch, turntable and SRK station code fields drop letters outside of ASCII as they're typed; the include-named tracks said where they're renamed

A character filter (ImGuiInputTextFlags_CallbackCharFilter) keeps the refused letter out of the field, so it no longer shows while the switch name is typed. The turntable name and the SRK station code go into track names too and get the same filter. The window of the track names outside of ASCII says that a track named by an include parameter is renamed through that parameter, not in the track properties.

* Revert "fix(physicslog): no road-vehicle logs, formatting on the writer, a slow disk and the closing kept short (#408)"

This reverts commit d6c3593520.

* fix(editor): a letter outside ASCII refused in the turntable name goes to the status line as an error, as in the switch tool

The nit of the review of #376 (jerrrrycho, 21.11): the turntable tool set its own status only,
while the switch tool reports the same refusal through refused(), which also puts it in the
status line of the editor as an error. The text is the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QRgQ1JTXWSz4YufC1QZtrY

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: jerrrrycho <jurek.pakula@gmail.com>
2026-11-27 23:20:30 +01:00
2017-10-28 19:21:37 +02:00
2025-09-19 17:53:46 +02:00
2015-04-03 21:58:35 +08:00
2026-04-01 20:10:33 +02:00
2026-05-11 18:21:12 +02:00
2025-09-09 16:46:12 +02:00
2026-02-25 08:30:20 +01:00
2025-03-09 15:36:11 +01:00
2021-02-13 18:32:19 +01:00
2019-07-09 22:09:37 +02:00

Repo banner

MaSzyna - Railway vehicle simulator

Website · Report an issue · Community Discord · MaSzyna on Steam · MaSzyna on Epic Games Store

Discord Github Actions Quality gate Sonar cloud violations License: MPL 2.0 Last commit Open issues Pull requests GitHub stars GitHub forks C++ Windows Linux OpenGL

MaSzyna executable source code is licensed under the MPL 2.0 and comes with a large pack of free assets under a custom license.

Table of Contents

Getting Started

MaSzyna compiles and runs natively on Linux and Windows. Other platforms are not tested.

Heads-up
Our dev team is small; we keep improving the build process, but issues may still occur. If you get stuck, please ask on the official Discord server.

Prerequisites

For runtime requirements see Minimum Requirements.

1) Software (oldest tested in parentheses)

  • CMake (3.0)

  • make

  • A C++ compiler with C++20 support:

    • Windows: Visual Studio 2022

    • Linux: GCC (12.3.1)

Note: MinGW is currently not supported.

2) Libraries (oldest tested in parentheses)

3) Graphics API

CMake flags

Flag Meaning
-DCMAKE_BUILD_TYPE=Debug Debug build
-DCMAKE_BUILD_TYPE=Release Release build
-DCMAKE_BUILD_TYPE=RelWithDebInfo Release build with debug symbols
-DUSE_SYSTEM_JSON=ON/OFF Use an installed nlohmann_json 3.9 or newer (e.g. nlohmann-json3-dev, vcpkg nlohmann-json) instead of the ref/json submodule (default OFF)
-DPython3_ROOT_DIR=<path> Root of the Python 3.14 install on Windows (python.exe, Lib, DLLs) for embed/copy steps; on Linux, optional if CMake picks the wrong interpreter

macOS note: macOS provides OpenGL only up to 4.1, so the OpenGL 4.6 renderer does not run there.

Windows

Install Python 3.14 x64 from python.org and include the optional Python native development feature (headers and .lib for embedding). Pass -DPython3_ROOT_DIR="C:\Path\To\Python314" on the cmake line when you want the layout under that directory used for embedding and for copying Lib / DLLs next to the executable. The cab screens are drawn with Pillow: install it into that Python (python -m pip install Pillow) before building, so it is copied along with Lib.

AppVeyor CI builds with the worker image’s preinstalled Python at C:/Python314-x64 (see appveyor.yml: -DPython3_ROOT_DIR=...).

# Clone repository with submodules
git clone --recursive https://github.com/MaSzyna-EU07/maszyna.git

cd maszyna

# Init vcpkg
call setup.bat

# Create directory for CMake build files
mkdir build
cd build

# Generate CMake project (replace %CONFIG% with Debug/Release/RelWithDebInfo)
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%CONFIG%

# Build (replace %CONFIG% accordingly)
cmake --build . --config %CONFIG% --parallel

Linux

# Install dependencies (Fedora/RHEL family)
sudo dnf install -y \
  @development-tools \
  cmake \
  mesa-libGL-devel \
  glew-devel \
  glfw-devel \
  python3.14-devel \
  libpng-devel \
  openal-soft-devel \
  luajit-devel \
  libserialport-devel \
  libsndfile-devel \
  gcc \
  g++ \
  wayland-devel \
  wayland-protocols-devel \
  libxkbcommon-devel

# Clone repository with submodules
git clone --recursive https://github.com/MaSzyna-EU07/maszyna.git

cd maszyna

# Create directory for CMake build files
mkdir build
cd build

# Generate Makefiles
cmake ..

# Compile using all cores
make -j"$(nproc)"

Tip (Ubuntu/Debian): Package names differ; install equivalent build-essential, libgl1-mesa-dev, libglew-dev, libglfw3-dev, python3.14-dev, libpng-dev, libopenal-dev, libluajit-5.1-dev, libserialport-dev, libsndfile1-dev, and Wayland/X11 dev packages as needed.

Installing

There is no make install yet. Copy the built executable to your MaSzyna installation manually.

  • Output directory: ./bin

  • File name format: eu07_YYYY-MM-DD_<commit>[_d]

    • YYYY-MM-DD – build date

    • <commit> – short commit hash

    • _d – present in Debug builds

If you already have the MaSzyna assets, copy the executable to the install dir. Assets can be downloaded from eu07.pl.

Rainsted on Linux

If Rainsted (a third‑party starter) fails to detect the executable under Linux, you can create a small wrapper script named eu07.exe:

#!/bin/sh
./eu07 "$1" "$2" "$3" "$4" "$5"

If detection still fails, padding the file (with comments) up to ~1 MB may help.

Known Issues

  • GLFW linking – On some systems you must provide the GLFW library path explicitly with -DGLFW3_LIBRARIES.

  • X11/Wayland linking order – Linking order of X11 and related libs can matter.

Support

Minimum requirements

  • OS: Windows 10 64-bit
  • Processor: 4 cores with AVX2 support (e.g. Intel Core i5-4430 / AMD Ryzen 3 1200)
  • RAM: 6 GB RAM
  • Graphics Card: supporting OpenGL 4.6 with at least 1GB VRAM
  • 150 GB of free disk space
  • Sound card supporting OpenAL with stereo
  • Optional COM ports for custom control panel setups.

License

Languages
C++ 71%
C 26.6%
HLSL 1.1%
Python 0.5%
GLSL 0.5%
Other 0.3%