mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
bump version, fix compile error under sdl2 0.6.0
This commit is contained in:
+2
-2
@@ -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
@@ -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)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user