public Texture2D GetZTexture(GraphicsDevice device) { DecodeIfRequired(); if (ZCache == null) { if (ZBufferData == null || this.Width == 0 || this.Height == 0) { return null; } ZCache = new Texture2D(device, this.Width, this.Height, false, SurfaceFormat.Alpha8); ZCache.SetData<byte>(this.ZBufferData); if (!IffFile.RETAIN_CHUNK_DATA) ZBufferData = null; } return ZCache; }