bug with X_NUMFACES
If i dont call X_DRAWOBJ right before X_NUMFACES, the program crashes.
Is this normal?
= this is ok
X_LOADOBJ "name.ddd",0
X_DRAWOBJ 0 , 0
Count = X_NUMFACES( 0 )
= this crashes program
X_LOADOBJ "name.ddd",0
Count = X_NUMFACES( 0 )
a crash is always a bug :(
Ok more info about this bug..and ill move this to bug reports.
On first run, loading an object, then calling x_numface, is ok.
However if you load then draw it, crash.
Also when using filerequest, then loading object, you must draw it or it crashes.
I´m not sure Hemlos, but I think I did a test some days ago, and I don´t draw the mesh, and if I don´t rebember bad my code works... I speak about 10.x
Ok i think i nipped it in the bud.
Here is my workaround...as im loading multiple objects, this is needed..
First call:
X_LOADOBJ "", 1
X_DRAWOBJ 1, 0 //Prevent a crash
X_LOADOBJ Filename$, 1
Count = X_NUMFACES(1)
And if i want to replace object #1, and reuse X_NUMFACES(1) multiple more times:
X_LOADOBJ "", 1
X_DRAWOBJ 1, 0
X_NUMFACES(1)
X_LOADOBJ FileName$, 1
X_DRAWOBJ 1 , 0
Count = X_NUMFACES(1)
If these commands are not called as i listed, in order...eventually the program crashed.
I suspect a memory/array crash here.