rust/lib-hedgewars-engine/src/render/gl.rs
changeset 15764 b10bbfb2b354
parent 15762 84c07aa94b61
equal deleted inserted replaced
15763:f6af9d05b03c 15764:b10bbfb2b354
   171         data: &[u8],
   171         data: &[u8],
   172         data_stride: Option<NonZeroU32>,
   172         data_stride: Option<NonZeroU32>,
   173         format: TextureFormat,
   173         format: TextureFormat,
   174         data_type: TextureDataType,
   174         data_type: TextureDataType,
   175     ) {
   175     ) {
   176         if is_out_of_bounds(data, data_stride, self.size) {
       
   177             return;
       
   178         }
       
   179 
       
   180         if let Some(handle) = self.handle {
   176         if let Some(handle) = self.handle {
   181             unsafe {
   177             unsafe {
   182                 gl::BindTexture(gl::TEXTURE_2D, handle.get());
   178                 gl::BindTexture(gl::TEXTURE_2D, handle.get());
   183                 gl::PixelStorei(gl::UNPACK_ROW_LENGTH, get_u32(data_stride) as i32);
   179                 gl::PixelStorei(gl::UNPACK_ROW_LENGTH, get_u32(data_stride) as i32);
   184                 gl::TexSubImage2D(
   180                 gl::TexSubImage2D(