|
From: Jose' C. <cru...@ce...> - 2004-06-23 07:48:22
|
On Jun 22, 2004, at 7:36 PM, Roger Holmes 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.
Pax et Bonum
# dott. Jose' Cruanyes Aguilar - C.E. Soft srl
# Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA
# 02,33603122 0372,460602
|