www.jpct.net

jPCT - a 3d engine for Java => Bugs => Topic started by: mystara on August 27, 2009, 12:43:18 pm

Title: World.toXML() error
Post by: mystara on August 27, 2009, 12:43:18 pm
Hello,

I've spent a little while trying to figure out why some exported XML structures are not producing any triangles when imported. Looking at the XML files themselves, I discovered that the tag:

<triangle_list>

Is not being exported. I believe that this is a bug and has been introduced in the latest version of JPCT, since the only change I've made to my code is to start using the latest version of JPCT.
The other slightly concerning thing is that the XML importer does not seem to recognise that the XML file is invalid. Shouldn't it notice that the <triangle_list> is missing, and refuse to load it?

Cheers!
Title: Re: World.toXML() error
Post by: EgonOlsen on August 27, 2009, 02:21:01 pm
That part actually hasn't changed for years... ??? Are you using compiled/stripped objects in your application?
Title: Re: World.toXML() error
Post by: mystara on August 27, 2009, 02:37:48 pm
No, not compiled or stripped.

Also, it's only the tag "<triangle_list>" which is missing. The closing tag ("</triangle_list>") is present.
Title: Re: World.toXML() error
Post by: mystara on August 27, 2009, 03:22:56 pm
I should also add that the triangles themselves are ALSO present. It's literally that one tag which is missing.
Title: Re: World.toXML() error
Post by: EgonOlsen on August 27, 2009, 05:10:41 pm
It's a bug...a side effect from some memory saving that i introduced in 1.17. That combined with Config.saveMemory=true being the default in the latest version causes the problem. I've tried to fix it here: http://www.jpct.net/download/beta/jpctapi_119pre1.zip (http://www.jpct.net/download/beta/jpctapi_119pre1.zip)

About the importer not noticing it...that could be. It's a pretty basic parser. It will choke on tags being opened and not closed but i think it may simply ignore ones that don't open anywhere. I think i'll just live with that... ;)
Title: Re: World.toXML() error
Post by: EgonOlsen on August 28, 2009, 01:32:38 pm
Did the fix work?
Title: Re: World.toXML() error
Post by: mystara on August 30, 2009, 04:17:09 pm
That seems to have fixed the problem.