Пример #1
0
//----------------------------------------------------------------------------
bool Object::Register (Stream& rkStream)
{
    if ( rkStream.InsertInMap(this,NULL) )
    {
        // Used to ensure the objects are saved in the order corresponding to
        // a depth-first traversal of the scene.
        rkStream.InsertInOrdered(this);

        if ( m_spkControl )
            m_spkControl->Register(rkStream);
        return true;
    }

    return false;
}
Пример #2
0
//----------------------------------------------------------------------------
void Object::Load (Stream& rkStream, Stream::Link* pkLink)
{
    // get old address of object, save it for linking phase
    Object* pkLinkID;
    StreamRead(rkStream,pkLinkID);
    rkStream.InsertInMap(pkLinkID,pkLink);

    // native data
    rkStream.Read(m_acName);

    // link data
    Object* pkControl;
    StreamRead(rkStream,pkControl);
    pkLink->Add(pkControl);
}