|
From: Roger H. <rog...@mi...> - 2004-06-24 12:50:02
|
On Wednesday, June 23, 2004, at 12:58 am, Jose' Cruanyes wrote: >> >> Could you clarify this a little. I have an object whose reference >> count is say 2, and it is in the attribute >> sets of two objects. If either of the objects get deleted then the >> other must of course still to work correctly. >> If both get deleted I want the texture deleted too. How can this be >> made to work with your method of >> writing the texture once and then using references? Unless I do a >> pre-pass through the data I am going >> to write. Could Quesa do this for me as it writes out the data? >> > > let's see: > > Object 1 ---+ > | > Object 2 ---+--- Texture (with ref count of at least 3) > | > Object 3 ---+ > > when Quesa writes a 3DMF: > it writes the first object and with the texture, pushing both two in > the TOC with ref count 1 > then the second object, but when tries to write the texture it is > found in the TOC, and so the texture is not written, just the ref > count in the TOC is incremented, and what gets written is an object > reference. > > same for object three > > at the end the TOC is writen (or at least the entries in the TOC with > ref count greater than one) > > so the texture is written only once > > when reading you get the same object tree with only one texture that > has a ref count of exactly three. > > when you delete two objects, each object releases a ref count of the > texture, remaining an object with the texture with a ref count of just > one. > > deleting the last object the texture is released, its ref count reach > zero and then is deleted > > is should work like this, if not, it's a bug. Thanks for the clarification. Quesa is doing it for me already, you have fixed the bug which was in the later versions of QD3D, so it is now safe for me to remove the horrible work around I had to write for QD3D. Many thanks. Roger. |