mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 23:17:56 +01:00
Merge branch 'feat/eu07m-skinning' into feat/eu07m-clips
This commit is contained in:
@@ -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
|
||||
@@ -220,7 +220,7 @@ Odwołania wewnątrz danych to indeksy: string, węzeł albo komponent; `0xFFFFF
|
||||
|
||||
## Konwersja z E3D i T3D
|
||||
|
||||
`eu07 -eu07m convert <wejście.e3d|.t3d> <wyjście.eu07m> [dynamic]` wczytuje model istniejącym loaderem (jak `-e3d`) i zapisuje
|
||||
`eu07 -eu07m convert <wejście.e3d|.t3d> <wyjście.r3a> [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.
|
||||
@@ -233,13 +233,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 <plik.eu07m>` (zawartość jako tekst) i `eu07 -eu07m validate <plik.eu07m>` (sprawdzenie
|
||||
Pozostałe polecenia: `eu07 -eu07m dump <plik.r3a>` (zawartość jako tekst) i `eu07 -eu07m validate <plik.r3a>` (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,
|
||||
@@ -316,5 +316,5 @@ egzemplarz osobno. Dotyczy to modeli EU07M i E3D tak samo.
|
||||
|
||||
## 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`.
|
||||
|
||||
+2
-2
@@ -167,8 +167,8 @@ TModelsManager::find_on_disk( std::string const &Name ) {
|
||||
|
||||
std::vector<std::string> 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 ) {
|
||||
|
||||
|
||||
+3
-3
@@ -1831,7 +1831,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<std::string> const Sources)
|
||||
{
|
||||
@@ -1953,10 +1953,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);
|
||||
|
||||
@@ -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 <model.e3d|model.t3d> <model.eu07m> [dynamic 0|1]\n";
|
||||
std::cerr << "usage: -eu07m diff <model.e3d|model.t3d> <model.r3a> [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 <model.e3d|model.t3d> <model.eu07m> [dynamic 0|1] [convertmodels flags]\n";
|
||||
std::cerr << "usage: -eu07m convert <model.e3d|model.t3d> <model.r3a> [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 {} <model.eu07m>\n", Dump ? "dump" : "validate");
|
||||
std::cerr << std::format("usage: -eu07m {} <model.r3a>\n", Dump ? "dump" : "validate");
|
||||
return 2;
|
||||
}
|
||||
auto const file{read_whole_file(Argv[3])};
|
||||
|
||||
@@ -216,7 +216,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<char const *>(file.data()), static_cast<std::streamsize>(file.size()));
|
||||
CHECK(output.good());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2695,7 +2695,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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user