From d9a390ce77f42f9e966e1eca69f5419c75414fa1 Mon Sep 17 00:00:00 2001 From: Alexander Koz Date: Fri, 15 Sep 2023 00:01:44 +0400 Subject: [PATCH] remove absolutely logically wrong and necessary method. --- api/gfx/src/bitmap/bitmap.rs | 15 --------------- 1 file changed, 15 deletions(-) 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() - } }