bump version, fix compile error under sdl2 0.6.0

This commit is contained in:
andelf
2015-07-23 17:28:38 +08:00
parent f5d95e1961
commit b238337a2e
2 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -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.*"
+10 -10
View File
@@ -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<Surface> {
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<Surface> {
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<Surface> {
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<Surface> {
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)) }
}
}
}