18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 07:45:25 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
jerrrrycho d670cc2e53 fix(files): the files #362 left are found and written in another case on Linux (GE#542)
were still opened by the name the scenery gives, in lowercase, and some were written by it, so on Linux a new file went
to a new lowercase folder next to the real one, or a second file was made next to the one there.

Opened through FileOnDisk() now: the .vmd animations of the events, the Lua script of the scenery, the Lua and WASM
screens and the files they read from their folder, the textures read for the colour of the rails, and the .sbt files a
scenery includes with the terrain directive.

FileOnDiskToWrite() gives the file to write: the one there in any case under its name on the disk, otherwise the name
given in the folders as they are on the disk, the folders missing in any case named as given. The editor's layers
(node_layers::path()), the .sbt the game writes and the heightmap terrain folder go through it; the editor removes an
.sbt there in another case. The .e3d made of a .t3d is written next to the text, or over the .e3d there in another case.

FileCased() writes each file found only in another case to the log once (logtype::file), the list for the authors of
the data to name the files as they're asked for.

Nothing changes on Windows: FileCased() gives the name back as it is there, and nothing is logged.
2026-12-01 18:23:24 +01:00
jerrrrycho 1bd7187db7 fix(scripting): close the small holes in the script screen sandbox
- Lua: once the instruction budget of a call is spent, the count hook
  runs at every instruction and raises again, so pcall, nested pcall and
  coroutine.resume can't swallow the limit; xpcall is rebuilt on pcall
  so its handler runs after the error left f, while the hook works
- Lua: the metatables of eu07.image/font/sprite are locked
  (__metatable = false); __gc destroys only an object of its own type,
  once
- Lua: read_png checks the size with stbi_info before decoding
- Lua: string.rep makes no string over 1 MiB
- Lua and WASM: at most 64 commands per call, names up to 64 bytes,
  32 log lines per call cut at 1024 bytes; the drops are logged once
- fonts: a glyph wider than 4096 is skipped; more than 4096 glyphs,
  8192 columns or an image side over 4096 refuse the font; cut_glyph
  reads only the columns inside the image
- the script path from the .mmd (cab screens, destination signs,
  make: textures) must stay inside the game folder; the files a screen
  reads, its script and its module must be regular files of 16 MiB at
  most

Tests for each in test_script_screen_host.cpp, test_script_screen_drawing.cpp
and test_script_screens.cpp; the test stubs can capture the log.
2026-11-13 14:25:18 +01:00
Hirek e433b43fef Script screens: led_post and resize of the Lua screens on the gpu 2026-11-10 16:22:35 +01:00
Hirek c4924f756d Lua script screens beside the WebAssembly ones 2026-11-10 15:29:25 +01:00