void UpdatePlanes() { ulong currentVersion = m_View.ReadUInt64(0); if (currentVersion == m_lastReadVersion) { return; // Up to date! } // Read the entire buffer m_View.ReadArray(0, m_buffer, 0, 1 << 20); using (MemoryStream S = new MemoryStream(m_buffer)) using (BinaryReader R = new BinaryReader(S)) { ulong version = R.ReadUInt64(); ulong blockLength = R.ReadUInt64(); ulong checkSum = R.ReadUInt64(); ulong obtainedCheckSum = ComputeCheckSum(m_buffer, 24, blockLength); if (obtainedCheckSum != checkSum) { return; // Failed! Retry next time... } int cellIndex = R.ReadInt32(); cell_t C = null; while (m_cells.Count <= cellIndex) { C = new cell_t(); C.m_index = m_cells.Count; C.m_wsPosition = new float3(-10000, -10000, -10000); m_cells.Add(C); integerTrackbarControlCell.Value = C.m_index; // Always track last cell } m_cells[cellIndex].Read(R); m_lastReadVersion = version; } // Update text that is now maybe valid? UpdatePlaneInfos(); }
public plane_t( cell_t _owner ) { m_owner = _owner; }
public plane_t(cell_t _owner) { m_owner = _owner; }
void UpdatePlanes() { ulong currentVersion = m_View.ReadUInt64( 0 ); if ( currentVersion == m_lastReadVersion ) { return; // Up to date! } // Read the entire buffer m_View.ReadArray( 0, m_buffer, 0, 1 << 20 ); using ( MemoryStream S = new MemoryStream( m_buffer ) ) using ( BinaryReader R = new BinaryReader( S ) ) { ulong version = R.ReadUInt64(); ulong blockLength = R.ReadUInt64(); ulong checkSum = R.ReadUInt64(); ulong obtainedCheckSum = ComputeCheckSum( m_buffer, 24, blockLength ); if ( obtainedCheckSum != checkSum ) { return; // Failed! Retry next time... } int cellIndex = R.ReadInt32(); cell_t C = null; while ( m_cells.Count <= cellIndex ) { C = new cell_t(); C.m_index = m_cells.Count; C.m_wsPosition = new float3( -10000, -10000, -10000 ); m_cells.Add( C ); integerTrackbarControlCell.Value = C.m_index; // Always track last cell } m_cells[cellIndex].Read( R ); m_lastReadVersion = version; } // Update text that is now maybe valid? UpdatePlaneInfos(); }