Fix loading binary LWO files

pull/4977/head
Turo Lamminen 2023-02-24 14:34:32 +02:00
parent 3bdc43a216
commit e8f0eb930d
2 changed files with 5 additions and 16 deletions

View File

@ -178,7 +178,7 @@ void LWOImporter::InternReadFile(const std::string &pFile,
mLayers->push_back(Layer()); mLayers->push_back(Layer());
mCurLayer = &mLayers->back(); mCurLayer = &mLayers->back();
mCurLayer->mName = "<LWODefault>"; mCurLayer->mName = "<LWODefault>";
mCurLayer->mIndex = (uint16_t) -1; mCurLayer->mIndex = 1;
// old lightwave file format (prior to v6) // old lightwave file format (prior to v6)
mIsLWO2 = false; mIsLWO2 = false;

View File

@ -357,16 +357,11 @@ TEST_F(utLWOImportExport, importLWOuvtest) {
} }
// These tests leak memory and complain on ASAN CI build
#if 0
TEST_F(utLWOImportExport, importLWOBConcavePolygon) { TEST_F(utLWOImportExport, importLWOBConcavePolygon) {
::Assimp::Importer importer; ::Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/ConcavePolygon.lwo", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/ConcavePolygon.lwo", aiProcess_ValidateDataStructure);
// FIXME: this should succees but there's a bug in the importer EXPECT_NE(nullptr, scene);
EXPECT_EQ(nullptr, scene);
} }
@ -374,8 +369,7 @@ TEST_F(utLWOImportExport, importLWOBbluewithcylindrictex) {
::Assimp::Importer importer; ::Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/MappingModes/bluewithcylindrictexz.lwo", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/MappingModes/bluewithcylindrictexz.lwo", aiProcess_ValidateDataStructure);
// FIXME: this should succees but there's a bug in the importer EXPECT_NE(nullptr, scene);
EXPECT_EQ(nullptr, scene);
} }
@ -383,8 +377,7 @@ TEST_F(utLWOImportExport, importLWOBsphere_with_mat_gloss_10pc) {
::Assimp::Importer importer; ::Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/sphere_with_mat_gloss_10pc.lwo", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/sphere_with_mat_gloss_10pc.lwo", aiProcess_ValidateDataStructure);
// FIXME: this should succees but there's a bug in the importer EXPECT_NE(nullptr, scene);
EXPECT_EQ(nullptr, scene);
} }
@ -392,9 +385,5 @@ TEST_F(utLWOImportExport, importLWOBsphere_with_mat_gloss_50pc) {
::Assimp::Importer importer; ::Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/sphere_with_mat_gloss_50pc.lwo", aiProcess_ValidateDataStructure); const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/LWO/LWOB/sphere_with_mat_gloss_50pc.lwo", aiProcess_ValidateDataStructure);
// FIXME: this should succees but there's a bug in the importer EXPECT_NE(nullptr, scene);
EXPECT_EQ(nullptr, scene);
} }
#endif // ASAN failing tests