//---------------------------------------------------------------------------- void SEObject::Load(SEStream& rStream, SEStream::SELink* pLink) { SE_BEGIN_DEBUG_STREAM_LOAD; // 获取save时存入的object内存指针,稍后用于link阶段 SEObject* pLinkID; rStream.Read(pLinkID); rStream.InsertInMap(pLinkID, pLink); // 获取name rStream.Read(m_Name); SE_END_DEBUG_STREAM_LOAD(SEObject); }
//---------------------------------------------------------------------------- bool SEObject::Register(SEStream& rStream) const { SEObject* pThis = (SEObject*)this; // 该object是否已插入到hash表,确保唯一性 if( rStream.InsertInMap(pThis, 0) ) { // 所有object按照深度优先的顺序,在遍历场景树时被收集, // 该object不能重复被收集 rStream.InsertInOrdered(pThis); return true; } return false; }