mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
fix return type error
This commit is contained in:
+6
-4
@@ -173,10 +173,12 @@ impl Surface {
|
||||
else { Ok(~Surface{raw: raw, owned: true}) }
|
||||
}
|
||||
|
||||
pub fn save_bmp(&self, path: &Path) -> bool {
|
||||
unsafe {
|
||||
ll::SDL_SaveBMP_RW(self.raw, try!(rwops::RWops::from_file(path, "rb")).raw, 0) == 0
|
||||
}
|
||||
pub fn save_bmp(&self, path: &Path) -> Result<(), ~str> {
|
||||
let ret = unsafe {
|
||||
ll::SDL_SaveBMP_RW(self.raw, try!(rwops::RWops::from_file(path, "rb")).raw, 0)
|
||||
};
|
||||
if ret == 0 { Ok(()) }
|
||||
else { Err(get_error()) }
|
||||
}
|
||||
|
||||
pub fn set_palette(&self, palette: &pixels::Palette) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user