void VDecorationDensityChannel::GetLockInfo(VTerrainSector *pSector, VTerrainLockObject &destInfo) { VASSERT(pSector); destInfo.Init(pSector->m_iIndexX*m_iSizeX,pSector->m_iIndexY*m_iSizeY,m_iSizeX,m_iSizeY,0); destInfo.m_iStride = m_iSizeX; destInfo.m_iComponentSize = sizeof(UBYTE); destInfo.m_pData = NULL; //destInfo.m_pTerrain = destInfo.m_iReserved[0] = m_spSource->GetID(); }
inline void CloneData(VTerrainLockObject &target) { target.Init(m_iPos[0],m_iPos[1],m_iSize[0],m_iSize[1],0); if (!IsValid()) return; target.m_iStride = m_iStride; target.m_iComponentSize = m_iComponentSize; target.m_bOwnsData = true; int iByteCount = m_iStride*m_iSize[1]*m_iComponentSize; target.m_pData = vMemAlloc(iByteCount); memcpy(target.m_pData,m_pData,iByteCount); // copy additional properties (important since resource infos might be stored) target.m_pTerrain = m_pTerrain; memcpy(target.m_iSectorRect,m_iSectorRect,sizeof(m_iSectorRect)); memcpy(target.m_iReserved,m_iReserved,sizeof(m_iReserved)); memcpy(target.m_pReserved,m_pReserved,sizeof(m_pReserved)); }