Skip to content

Commit

Permalink
remove absolutely logically wrong and necessary method.
Browse files Browse the repository at this point in the history
  • Loading branch information
boozook committed Sep 14, 2023
1 parent 50318b7 commit d9a390c
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions api/gfx/src/bitmap/bitmap.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -298,19 +296,6 @@ impl<Api: api::Api, const FOD: bool> Bitmap<Api, FOD> {
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()
}
}


Expand Down

0 comments on commit d9a390c

Please sign in to comment.