diff --git a/Cargo.toml b/Cargo.toml index 84e6d54c..bda84bc6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,6 @@ path = "src/sdl2_gfx/lib.rs" [dependencies] num = "0.1" libc = "0.1" -sdl2 = "0.5" -sdl2-sys = "0.5" +sdl2 = "0.6" +sdl2-sys = "0.6" c_vec = "1.0.*" diff --git a/src/sdl2_gfx/rotozoom.rs b/src/sdl2_gfx/rotozoom.rs index 6d8c1ac6..3d2c79be 100644 --- a/src/sdl2_gfx/rotozoom.rs +++ b/src/sdl2_gfx/rotozoom.rs @@ -55,50 +55,50 @@ impl<'a> RotozoomSurface for Surface<'a> { let raw = unsafe { ll::rotozoomSurface(self.raw(), angle, zoom, smooth as c_int) }; - if raw.is_null() { + if (raw as *mut ()).is_null() { Err("rotozoomSurface: error.".to_string()) } else { - unsafe { Ok(Surface::from_ll(raw, true)) } + unsafe { Ok(Surface::from_ll(raw)) } } } fn rotozoom_xy(&self, angle: f64, zoomx: f64, zoomy: f64, smooth: bool) -> SdlResult { let raw = unsafe { ll::rotozoomSurfaceXY(self.raw(), angle, zoomx, zoomy, smooth as c_int) }; - if raw.is_null() { + if (raw as *mut ()).is_null() { Err("rotozoomSurfaceXY: error.".to_string()) } else { - unsafe { Ok(Surface::from_ll(raw, true)) } + unsafe { Ok(Surface::from_ll(raw)) } } } fn zoom(&self, zoomx: f64, zoomy: f64, smooth: bool) -> SdlResult { let raw = unsafe { ll::zoomSurface(self.raw(), zoomx, zoomy, smooth as c_int) }; - if raw.is_null() { + if (raw as *mut ()).is_null() { Err("zoomSurface: error.".to_string()) } else { - unsafe { Ok(Surface::from_ll(raw, true)) } + unsafe { Ok(Surface::from_ll(raw)) } } } fn shrink(&self, factorx: isize, factory: isize) -> SdlResult { let raw = unsafe { ll::shrinkSurface(self.raw(), factorx as c_int, factory as c_int) }; - if raw.is_null() { + if (raw as *mut ()).is_null() { Err("shrinkSurface: error.".to_string()) } else { - unsafe { Ok(Surface::from_ll(raw, true)) } + unsafe { Ok(Surface::from_ll(raw)) } } } fn rotate_90deg(&self, turns: isize) -> SdlResult { let raw = unsafe { ll::rotateSurface90Degrees(self.raw(), turns as c_int) }; - if raw.is_null() { + if (raw as *mut ()).is_null() { Err("rotateSurface90Degrees: error.".to_string()) } else { - unsafe { Ok(Surface::from_ll(raw, true)) } + unsafe { Ok(Surface::from_ll(raw)) } } } }