Exemple #1
0
 public TextureFormat(TexturePixelStorage format, uint size, uint flags, int glFormat)
 {
     this.Format   = format;
     this.Size     = size;
     this.Flags    = flags;
     this.GLFormat = glFormat;
 }
Exemple #2
0
        public static uint CalculateChecksum(byte *address, uint width, uint height, TexturePixelStorage format)
        {
            TextureFormat textureFormat = TextureFormats[( int )format];
            uint          size          = textureFormat.Size;

            if (size == 0)
            {
                size   = 1;
                width /= 2;
            }

            uint checksum = 0;
            uint stride   = width * size;

            // Offset a bit
            address += stride / 2;

            stride *= ChecksumSpacing;
            for (int n = 0; n < (height / ChecksumSpacing); n++)
            {
                checksum += *(( uint * )address);
                address  += stride;
            }

            return(checksum);
        }
 public TextureFormat(TexturePixelStorage format, uint size)
 {
     Format = format;
     Size   = size;
 }