18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 05:57:08 +01:00
Commit Graph

2 Commits

Author SHA1 Message Date
maj00r b15f7dcdec fix(editor): file names outside the code page don't crash the project, includes are found in any case, a project file cut short isn't put in place
- The scenario index made a string of the name of every file in the folder, which throws on Windows for a name the ANSI code
  page can't hold (the class of GE#560). It looks at the extension first and leaves out a .scn the game couldn't open by its
  name either; the messages of the project file show paths as UTF-8.
- The includes are read with the FileCased() fallback of the game (scenery_text::file_text), so on Linux an include written in
  another case no longer drops the scenario from the index, skips the migration of its file or marks its tracks as changed by
  hand.
- save() closes the file before looking at it: a failed last flush no longer renames a truncated .new over the project.
- "next node 0" is refused instead of wrapping to 0xffffffff.
- open_project() writes no .eu07proj when there were no //$ lines to migrate, and asks exists() without throwing.
2026-11-24 18:54:33 +01:00
maj00r c912ed2ab1 feat(editor): the tracks the generator wrote kept by their checksums, a track changed by hand marking its line
Continues E3 (editor-tracks-domain.md §9, "Ręczna zmiana wygenerowanego węzła ... wykrywana po sumie kontrolnej"): the generated
section of the project file and what the scenery files hold of it now. Nothing of the editor writes the tracks yet (E4).

- generated: a record a track the generator wrote, its name, its line, the file it's written into and the FNV-1a checksum (64 bits)
  of its text as the simulator reads it: the words joined by one blank, the comments left out, so the line ends and the blanks
  another tool writes aren't a change; the switch track of a turnout kept by the main track of the turnout.
    track l1_s11 line 1 file trasa/tory.scm sum 0123456789abcdef
    switch t1 line 2 file trasa/tory.scm sum 00000000000000ff
    hand 3
  record_generated() puts the pieces of a line, or the switch track of a turnout, in the place of the ones the project had of it;
  find_hand_changes() looks the names up in the text of the files now: a text of another checksum, or a track gone, or a file which
  can't be read; mark_hand_changes() marks their lines changed by hand (hand <line>, kept by the file), may_overwrite() tells the
  editor to leave them, until the line is written again by the editor (the author decided).
- editor/project/sceneryText: the text of the scenery files read as cParser and state_serializer read it, with no scene: the words
  (blanks and semicolons between them, // and /* */ comments, the quotes), the node of a name and its words up to the end word of its
  type, and the statements of a scenery with its includes followed relative to the scenery folder (the words of each file taken as
  they're needed, the includes no deeper than 32), the parameters of a template in place of (p1)..., the placement of origin, rotate
  and scale at each include, the terrain files passed over for a binary terrain. The scenario index and the migration read the files
  with it.

Tests: U: two lines generated into one file among other nodes: as written nothing is changed, through the project file too; the speed
of a track of the second line edited: that line and that track told, marked changed by hand once, kept by the file, the first line
not; written again, not marked. The switch track of a turnout: its speed edited marks its main track. Blanks doubled, the line ends of
windows and comments inside a track aren't a change; a track taken away, a file which can't be read are. The node of a name found by
the words.
2026-11-23 13:11:46 +01:00