While implementing a cubemap initialization of the <surface> element loading each cube face by a single 2d-img, I came up with this xml-code:
<newparam sid="file8Surface">
<surface type="CUBE">
<init_from face="POSITIVE_X" slice="0" mip="0">envCubePosX</init_from>
<init_from face="NEGATIVE_X" slice="0" mip="0">envCubeNegX</init_from>
<init_from face="POSITIVE_Y" slice="0" mip="0">envCubePosY</init_from>
<init_from face="NEGATIVE_Y" slice="0" mip="0">envCubeNegY</init_from>
<init_from face="POSITIVE_Z" slice="0" mip="0">envCubePosZ</init_from>
<init_from face="NEGATIVE_Z" slice="0" mip="0">envCubeNegZ</init_from>
<mipmap_generate>true</mipmap_generate>
</surface>
</newparam>
According to the schema this should be valid (please correct if I’m wrong). However loading a document with those init_from arrays crashes the DOM, while loading the document.
I tried a small example loading the document only, with the following mini-code:
#include <dae.h>
int main(int argc, char* argv[]) {
DAE* daeObject = new DAE;
int error = daeObject->load("cubeInitBug.dae");
return 0;
}
The DOM crashes in daeElement::release(). Strange enough, this happens with the statically linked version only, DLL-DOM seems to load without complaining.
You can try this dae file, the dead file references are not important for this problem:
I know, you could also load each face with
<init_cube>
<face ref="...">
...
</init_cube>
(which works well loading a document)
But I understand init_cube should be used with compound images only (like DDS)…
I wasn’t sure if that’s really a bug, if it is, I will post it on sourceforge.