All pastes #638097 Raw Edit

tex loading

public text v1 · immutable
#638097 ·published 2007-07-29 14:55 UTC
rendered paste body
            int frameSize = reader.ReadInt32();
            
            byte[] data = reader.ReadBytes(frameSize);
            Bgr565[] pixels = new Bgr565[data.Length / 16];
            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);