try to debug why images aren't showing up

This commit is contained in:
bunnie 2022-06-14 19:06:33 +08:00
parent 18fc6663b2
commit 1bd82b9ea4
3 changed files with 4 additions and 5 deletions

View file

@ -348,6 +348,7 @@ fn main() -> ! {
} }
#[cfg(feature="ditherpunk")] #[cfg(feature="ditherpunk")]
GamObjectType::Tile(mut tile) => { GamObjectType::Tile(mut tile) => {
log::info!("drawing tile {:?}", tile);
tile.translate(canvas.clip_rect().tl); tile.translate(canvas.clip_rect().tl);
tile.translate(canvas.pan_offset()); tile.translate(canvas.pan_offset());
gfx.draw_tile_clipped( gfx.draw_tile_clipped(

View file

@ -36,6 +36,7 @@ impl ActionApi for Image {
fn redraw(&self, _at_height: i16, modal: &Modal) { fn redraw(&self, _at_height: i16, modal: &Modal) {
if self.bitmap.is_some() { if self.bitmap.is_some() {
//bm.translate(Point::new(0, at_height)); //bm.translate(Point::new(0, at_height));
log::info!("drawing bitmap");
modal modal
.gam .gam
.draw_bitmap(modal.canvas, self.bitmap.as_ref().unwrap()) .draw_bitmap(modal.canvas, self.bitmap.as_ref().unwrap())

View file

@ -159,10 +159,7 @@ pub fn spawn_test() {
let width: usize = info.width.try_into().unwrap(); let width: usize = info.width.try_into().unwrap();
let img = Img::new(pixels, width); let img = Img::new(pixels, width);
*/ */
#[cfg(all( #[cfg(feature = "ditherpunk")]
feature = "ditherpunk",
not(any(target_os = "none", target_os = "xous"))
))]
{ {
log::info!("testing image"); log::info!("testing image");
let img = clifford(); let img = clifford();
@ -174,7 +171,7 @@ pub fn spawn_test() {
} }
// https://sequelaencollection.home.blog/2d-chaotic-attractors/ // https://sequelaencollection.home.blog/2d-chaotic-attractors/
#[allow(dead_code)] #[cfg(feature = "ditherpunk")]
fn clifford() -> Img { fn clifford() -> Img {
const SIZE: u32 = Modals::MODAL_WIDTH; const SIZE: u32 = Modals::MODAL_WIDTH;
const CENTER: f32 = (SIZE / 2) as f32; const CENTER: f32 = (SIZE / 2) as f32;