16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 13:29:18 +02:00

async mesh loading

This commit is contained in:
maj00r
2026-06-16 01:04:37 +02:00
parent 2f90246907
commit 9574d2051b
35 changed files with 3239 additions and 859 deletions

View File

@@ -1623,8 +1623,10 @@ glm::vec3 TSubModel::offset(float const Geometrytestoffsetthreshold) const
return offset;
}
bool TModel3d::LoadFromFile(std::string const &FileName, bool dynamic)
{
bool TModel3d::LoadFromFile(
std::string const &FileName,
bool const dynamic,
bool const defer_gpu_init ) {
// wczytanie modelu z pliku
/*
// NOTE: disabled, this work is now done by the model manager
@@ -1646,20 +1648,24 @@ bool TModel3d::LoadFromFile(std::string const &FileName, bool dynamic)
{
WriteLog("Forced loading text model \"" + name + ".t3d\"");
LoadFromTextFile(name + ".t3d", dynamic);
if (!dynamic)
if( false == defer_gpu_init && false == dynamic ) {
Init();
}
}
else if (FileExists(asBinary))
{
LoadFromBinFile(asBinary, dynamic);
asBinary = "";
Init();
if( false == defer_gpu_init ) {
Init();
}
}
else if (FileExists(name + ".t3d"))
{
LoadFromTextFile(name + ".t3d", dynamic);
if (!dynamic)
if( false == defer_gpu_init && false == dynamic ) {
Init();
}
}
bool const result = Root ? (iSubModelsCount > 0) : false; // brak pliku albo problem z wczytaniem