commit e41ca868f4dbfac9fb981229395cb2b137ab562a
parent e3d19a6c2143fe2ba5e9bca123e6266b827b7511
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 15 Jun 2020 17:48:24 +0200
Manage new star-enclosures behaviour regarding some ill-formed models
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/sdis_scene_Xd.h b/src/sdis_scene_Xd.h
@@ -532,6 +532,7 @@ XD(run_analyze)
struct geometry geom;
struct sencXd(device)* senc = NULL;
struct sencXd(scene)* senc3d_scn = NULL;
+ unsigned count;
res_T res = RES_OK;
ASSERT(scn && nprims && indices && interf && nverts && position && out_scn);
@@ -549,6 +550,10 @@ XD(run_analyze)
(unsigned)nprims, XD(geometry_indices), geometry_media,
(unsigned)nverts, XD(geometry_position), &geom, &senc3d_scn);
if(res != RES_OK) goto error;
+ /* With il-formed scenes, scene creation can success without being able
+ * to extract enclosures; in this case just fail */
+ res = sencXd(scene_get_enclosure_count(senc3d_scn, &count));
+ if(res != RES_OK) goto error;
exit:
if(senc) SENCXD(device_ref_put(senc));
@@ -560,7 +565,6 @@ error:
senc3d_scn = NULL;
}
goto exit;
-
}
/* Register the media and the interfaces, map each primitive to its interface