From 2fe1064f9a586c8dfb6ecaa3731eadbb5960ad73 Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:11:57 +0100 Subject: [PATCH 1/2] feat(model): the EU07M model files take the .r3a extension, the switch is modelformat r3a The model files of the format are named .r3a in place of .eu07m, and eu07.ini selects them with modelformat r3a in place of modelformat eu07m. The format keeps its name (EU07M), its magic and the -eu07m command line tool. Neither the extension nor the key has been released, so nothing reads the old ones. --- docs/eu07m-format.md | 14 +++++++------- model/MdlMngr.cpp | 4 ++-- model/Model3d.cpp | 6 +++--- model/eu07m/eu07m_convert.cpp | 8 ++++---- utilities/Globals.cpp | 6 +++--- utilities/Globals.h | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/eu07m-format.md b/docs/eu07m-format.md index e12101ca7..8c7188753 100644 --- a/docs/eu07m-format.md +++ b/docs/eu07m-format.md @@ -1,4 +1,4 @@ -# Format modeli EU07M (`.eu07m`) +# Format modeli EU07M (`.r3a`) Następca E3D: w pełni binarny format modeli. Plik czyta się prawie bez przetwarzania, prosto do buforów OpenGL 4.6 i Vulkana 1.4. Niesie węzły TRS, skinning, typowane komponenty i metadane węzłów oraz grup wierzchołków. Rozszerza się bez @@ -215,7 +215,7 @@ Odwołania wewnątrz danych to indeksy: string, węzeł albo komponent; `0xFFFFF ## Konwersja z E3D i T3D -`eu07 -eu07m convert [dynamic]` wczytuje model istniejącym loaderem (jak `-e3d`) i zapisuje +`eu07 -eu07m convert [dynamic]` wczytuje model istniejącym loaderem (jak `-e3d`) i zapisuje go w EU07M: - Submodel staje się węzłem. Kolejność dzieci i nazwy zostają, więc `GetFromName`, `.mmd` i eventy działają po staremu. @@ -228,13 +228,13 @@ go w EU07M: zgaduje je na nowo gra, z prawdziwym materiałem. Model pojazdu konwertuje się z `.e3d`, który robi z niego gra, nie z `.t3d`. - Wymienna skóra `-k` w przebiegu przezroczystym (bit k−1 flag E3D) ma w `MATL` flagę `translucent`. -Pozostałe polecenia: `eu07 -eu07m dump ` (zawartość jako tekst) i `eu07 -eu07m validate ` (sprawdzenie +Pozostałe polecenia: `eu07 -eu07m dump ` (zawartość jako tekst) i `eu07 -eu07m validate ` (sprawdzenie pliku wraz z hashem zawartości). ## W grze -Z `modelformat eu07m` w `eu07.ini` model z plikiem `.eu07m` obok `.e3d` / `.t3d` jest wczytywany z niego (`TModel3d::LoadFromEU07M`). -Domyślne `modelformat legacy` zostawia pliki `.eu07m` w spokoju. +Z `modelformat r3a` w `eu07.ini` model z plikiem `.r3a` obok `.e3d` / `.t3d` jest wczytywany z niego (`TModel3d::LoadFromEU07M`). +Domyślne `modelformat legacy` zostawia pliki `.r3a` w spokoju. - **Renderer Vulkan** trzyma strumienie modelu EU07M tak, jak leżą w pliku: pozycje (12 B), atrybuty z `VATT` (16 B), dane użytkownika i indeksy, każde w osobnym buforze banku (`vertex_kind::scene_compact`). Shadery czytają pozycję i UV jak dotąd, @@ -247,5 +247,5 @@ Domyślne `modelformat legacy` zostawia pliki `.eu07m` w spokoju. ## Zgodność wstecz -E3D i T3D są czytane jak dotąd. Plik `.eu07m` jest wczytywany tylko wtedy, gdy istnieje, za przełącznikiem `modelformat eu07m` -w `eu07.ini`. Obecne wydanie nie czyta `.eu07m`. +E3D i T3D są czytane jak dotąd. Plik `.r3a` jest wczytywany tylko wtedy, gdy istnieje, za przełącznikiem `modelformat r3a` +w `eu07.ini`. Obecne wydanie nie czyta `.r3a`. diff --git a/model/MdlMngr.cpp b/model/MdlMngr.cpp index 4ced75029..ce3198d1a 100644 --- a/model/MdlMngr.cpp +++ b/model/MdlMngr.cpp @@ -167,8 +167,8 @@ TModelsManager::find_on_disk( std::string const &Name ) { std::vector extensions { { ".e3d" }, { ".t3d" } }; if( Global.modelformat_eu07m ) { - // a model may come as an .eu07m alone - extensions.emplace_back( ".eu07m" ); + // a model may come as an .r3a alone + extensions.emplace_back( ".r3a" ); } for( auto const &extension : extensions ) { diff --git a/model/Model3d.cpp b/model/Model3d.cpp index 485bb7054..d6609513a 100644 --- a/model/Model3d.cpp +++ b/model/Model3d.cpp @@ -1790,7 +1790,7 @@ glm::vec3 TSubModel::offset(float const Geometrytestoffsetthreshold) const namespace { -// modelformat eu07m: an .eu07m older than the .e3d / .t3d it was made from isn't used, the model was changed after it was +// modelformat r3a: an .r3a older than the .e3d / .t3d it was made from isn't used, the model was changed after it was // converted (the hash of the source in its header would need the source read whole to be compared) bool eu07m_up_to_date(std::string const &Eu07m, std::initializer_list const Sources) { @@ -1912,10 +1912,10 @@ bool TModel3d::LoadFromFile(std::string const &FileName, bool dynamic) Init(); assign_lod_ranges(Root, name); } - else if (auto const eu07mfile{Global.modelformat_eu07m ? FileCased(name + ".eu07m") : std::string{}}; + else if (auto const eu07mfile{Global.modelformat_eu07m ? FileCased(name + ".r3a") : std::string{}}; (false == eu07mfile.empty()) && eu07m_up_to_date(eu07mfile, {binaryfile, textfile}) && LoadFromEU07M(eu07mfile, dynamic)) { - // modelformat eu07m: the .eu07m made from the model takes its place; one which doesn't load leaves the .e3d / .t3d to go on + // modelformat r3a: the .r3a made from the model takes its place; one which doesn't load leaves the .e3d / .t3d to go on asBinary = ""; Init(); assign_lod_ranges(Root, name); diff --git a/model/eu07m/eu07m_convert.cpp b/model/eu07m/eu07m_convert.cpp index 3e6ac0676..f52c78613 100644 --- a/model/eu07m/eu07m_convert.cpp +++ b/model/eu07m/eu07m_convert.cpp @@ -315,7 +315,7 @@ bool load_source(std::string const &Input, bool const Dynamic, TModel3d &Source, auto const start{std::chrono::steady_clock::now()}; if (extension_of(Input) == ".e3d") Source.LoadFromBinFile(Input, Dynamic); - else if (extension_of(Input) == ".eu07m") + else if (extension_of(Input) == ".r3a") Source.LoadFromEU07M(Input, Dynamic); else Source.LoadFromTextFile(Input, Dynamic); @@ -476,7 +476,7 @@ void model_diff::geometry(TSubModel const &Left, TSubModel const &Right) { int command_diff(int const Argc, char *Argv[]) { if (Argc < 5) { - std::cerr << "usage: -eu07m diff [dynamic 0|1]\n"; + std::cerr << "usage: -eu07m diff [dynamic 0|1]\n"; return 2; } if (false == start_tools(Argc, Argv)) @@ -501,7 +501,7 @@ int command_diff(int const Argc, char *Argv[]) { int command_convert(int const Argc, char *Argv[]) { if (Argc < 5) { - std::cerr << "usage: -eu07m convert [dynamic 0|1] [convertmodels flags]\n"; + std::cerr << "usage: -eu07m convert [dynamic 0|1] [convertmodels flags]\n"; return 2; } std::string const input{Argv[3]}; @@ -543,7 +543,7 @@ int command_convert(int const Argc, char *Argv[]) { int command_read(int const Argc, char *Argv[], bool const Dump) { if (Argc < 4) { - std::cerr << std::format("usage: -eu07m {} \n", Dump ? "dump" : "validate"); + std::cerr << std::format("usage: -eu07m {} \n", Dump ? "dump" : "validate"); return 2; } auto const file{read_whole_file(Argv[3])}; diff --git a/utilities/Globals.cpp b/utilities/Globals.cpp index 5d2e56522..558f37bc7 100644 --- a/utilities/Globals.cpp +++ b/utilities/Globals.cpp @@ -1001,10 +1001,10 @@ bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string& if (token == "modelformat") { - // eu07m: a model with an .eu07m file beside its .e3d / .t3d is loaded from it; legacy: the .eu07m files are left alone + // r3a: a model with an .r3a file beside its .e3d / .t3d is loaded from it; legacy: the .r3a files are left alone std::string value; ParseOne(Parser, value, 1); - modelformat_eu07m = value == "eu07m"; + modelformat_eu07m = value == "r3a"; return true; } @@ -2690,7 +2690,7 @@ global_settings::export_as_text( std::ostream &Output ) const { export_as_text( Output, "hiddenevents", iHiddenEvents ); export_as_text( Output, "pause", ( iPause & 1 ) != 0 ); export_as_text(Output, "priorityLoadText3D", priorityLoadText3D); - export_as_text(Output, "modelformat", std::string{modelformat_eu07m ? "eu07m" : "legacy"}); + export_as_text(Output, "modelformat", std::string{modelformat_eu07m ? "r3a" : "legacy"}); export_as_text( Output, "lang", asLang ); export_as_text( Output, "python.updatetime", PythonScreenUpdateRate ); Output diff --git a/utilities/Globals.h b/utilities/Globals.h index 80052fef1..ba8182e60 100644 --- a/utilities/Globals.h +++ b/utilities/Globals.h @@ -121,7 +121,7 @@ struct global_settings { int file_binary_terrain_skipped{0}; // number of terrain includes left out by the parser during the current scenery load // logs bool priorityLoadText3D{false}; // ladowanie T3D priorytetowo - bool modelformat_eu07m{false}; // modelformat eu07m: models are loaded from their .eu07m files where there are some + bool modelformat_eu07m{false}; // modelformat r3a: models are loaded from their .r3a files where there are some int iWriteLogEnabled{ 3 }; // maska bitowa: 1-zapis do pliku, 2-okienko, 4-nazwy torów bool MultipleLogs{ false }; bool crashdump_full{ false }; // crash dump with the whole memory of the process instead of the small one From 8dc60036a09ee05ff852426000aabb890b1c215d Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:12:10 +0100 Subject: [PATCH 2/2] feat(model): .r3a and .r3p in what this branch adds, as below it The model files are .r3a and the family store .r3p, selected with modelformat r3a (2fe1064f9 on feat/e4d-compact). --- tests/unit/test_skinning.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_skinning.cpp b/tests/unit/test_skinning.cpp index 7520bb304..9f3f0a8e3 100644 --- a/tests/unit/test_skinning.cpp +++ b/tests/unit/test_skinning.cpp @@ -215,7 +215,7 @@ TEST_CASE("skinning: the skinned tube is a valid EU07M file") { CHECK(read.weights.size() == read.positions.size()); CHECK(read.primitives[0].skin == 0); // kept in the scratch folder for a look in the game - auto const path{std::filesystem::path{EU07_UNIT_TESTS_SCRATCH} / "skinned_tube.eu07m"}; + auto const path{std::filesystem::path{EU07_UNIT_TESTS_SCRATCH} / "skinned_tube.r3a"}; std::ofstream output{path, std::ios::binary}; output.write(reinterpret_cast(file.data()), static_cast(file.size())); CHECK(output.good());