diff --git a/Cargo.lock b/Cargo.lock index 9b14d575..a2f7be03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2603,7 +2603,7 @@ dependencies = [ [[package]] name = "playdate-graphics" -version = "0.1.1" +version = "0.1.2" dependencies = [ "playdate-color", "playdate-fs", diff --git a/api/gfx/Cargo.toml b/api/gfx/Cargo.toml index febb2412..727f3632 100644 --- a/api/gfx/Cargo.toml +++ b/api/gfx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "playdate-graphics" -version = "0.1.1" +version = "0.1.2" edition = "2021" readme = "README.md" diff --git a/api/gfx/src/bitmap/bitmap.rs b/api/gfx/src/bitmap/bitmap.rs index bf2f9055..251d9618 100644 --- a/api/gfx/src/bitmap/bitmap.rs +++ b/api/gfx/src/bitmap/bitmap.rs @@ -1,12 +1,10 @@ use core::ffi::c_char; use core::ffi::c_float; use core::ffi::c_int; -use core::ffi::c_void; use alloc::boxed::Box; use sys::ffi::CString; use sys::ffi::LCDColor; -use sys::ffi::LCDPattern; use sys::ffi::LCDRect; use sys::ffi::LCDBitmap; pub use sys::ffi::LCDBitmapFlip as BitmapFlip; @@ -298,19 +296,6 @@ impl Bitmap { let f = self.1.set_color_to_pattern(); unsafe { f(color as _, self.0, x, y) } } - - /// Returns 8 x 8 pattern using this bitmap. - /// `x, y` indicates the top left corner of the 8 x 8 pattern. - pub fn get_color_of_pattern<'t>(&'t self, x: c_int, y: c_int) -> &mut LCDPattern { - let mut color: LCDColor = 0; - let f = self.1.set_color_to_pattern(); - unsafe { f(&mut color, self.0, x, y) } - assert!(color.is_pattern()); - - let ptr = color as *mut c_void as *mut u8 as *mut LCDPattern; - // TODO: check if ptr.is_null() ... - unsafe { ptr.as_mut() }.unwrap() - } }