Ejemplo n.º 1
0
		public void Initialize() {
			if (_isInitialized) return;
						logger.Trace("Initializing TMP data for file {0}", FileName);
			_isInitialized = true;
			Position = 0;

			Width = ReadInt32();
			Height = ReadInt32();
			BlockWidth = ReadInt32();
			BlockHeight = ReadInt32();

			byte[] index = Read(Width * Height * sizeof(int));
			Images = new List<TmpImage>(Width * Height);
			for (int x = 0; x < Width * Height; x++) {
				int imageData = BitConverter.ToInt32(index, x * 4);
				Seek(imageData, SeekOrigin.Begin);
				var img = new TmpImage();
				img.Read(this);
				Images.Add(img);
			}
		}