private static Block GetTextureDeclarationBlock(Texture texture) { var w = new BlockWriter(); w.WriteString(texture.Name); // texture name // Texture image format. w.WriteU32(0); // texture height w.WriteU32(0); // texture width w.WriteU8(0x0F); // texture image type, 0x0F - color RGBA w.WriteU32(1); // continuation image count // Continuation image format. w.WriteU8((byte)texture.ImageFormat); // compression type, 0x01 - JPEG-24, 0x02 - PNG, 0x03 - JPEG-8, 0x04 - TIFF w.WriteU8(0x0F); // texture image channels, 0x0F: alpha, red, green, blue w.WriteU16(0x0000); // continuation image attributes, 0x0000 - default attributes w.WriteU32((uint)texture.Image.Length); // image data byte count return(w.GetBlock(BlockType.TextureDeclaration)); }