Tous les collages #638099 Brut Modifier

tex loading

public text v1 · immuable
#638099 ·publié 2007-07-29 14:56 UTC
corps du collage affiché
            int frameSize = reader.ReadInt32();
            
            byte[] data = reader.ReadBytes(frameSize);
            Bgr565[] pixels = new Bgr565[data.Length / 2];
            int currentPixel = 0;
            for (int i = 0; i < data.Length; i += 2)
            {
                pixels[currentPixel].PackedValue = (data[i] << 8 ) + data[i+1];
                
                currentPixel++;
            }

            _texture.SetData<Bgr565>(pixels);