Beispiel #1
0
		/// <summary>
		/// Reads a MapBlock from a stream
		/// </summary>
		/// <param name="stream">The stream containing the data to read</param>
		/// <returns>The MapBlock object read from the stream</returns>
		public unsafe static MapBlock ReadFromStream( FileStream stream )
		{
			MapBlock block = new MapBlock();

			// Skip the int Header value, not used by the viewer
			stream.Seek( 4, SeekOrigin.Current );

			int n = 0;

			fixed ( MapCell* pCell = block.Cells )
			{
				// Issue 7 - Handle Warnings - http://code.google.com/p/pandorasbox3/issues/detail?id=7&can=1 - Kons
				ReadFile( stream.SafeFileHandle.DangerousGetHandle(), pCell, 192, &n, 0 );
				// Issue 7 - End
			}
			return block;
		}