summaryrefslogtreecommitdiff
path: root/src/sdl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl.rs')
-rw-r--r--src/sdl.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sdl.rs b/src/sdl.rs
index 5574373..0b06ed4 100644
--- a/src/sdl.rs
+++ b/src/sdl.rs
@@ -738,16 +738,18 @@ impl SDL_Surface {
self.flags
}
pub fn width(&self) -> i32 {
- self.w.try_into().unwrap()
+ assert!(self.w >= 0);
+ self.w
}
pub fn height(&self) -> i32 {
- self.h.try_into().unwrap()
+ assert!(self.h >= 0);
+ self.h
}
pub fn pitch(&self) -> i32 {
- self.pitch.try_into().unwrap()
+ self.pitch
}
pub fn locked(&self) -> i32 {
- self.locked.try_into().unwrap()
+ self.locked
}
pub fn pixel_format(&self) -> &SDL_PixelFormat {
// SAFETY: this should be a valid pointer as long as self is a valid SDL_Surface