pebble-dev / RebbleOS

open source operating system for low-power smartwatches
Other
366 stars 38 forks source link

Issues with graphics_draw_bitmap_in_rect #58

Open gameblabla opened 6 years ago

gameblabla commented 6 years ago

I have noticed several issues with graphics_draw_bitmap_in_rect. Seems like Pebble's own function is actually more complex, somehow.

Big image files (larger than 168 pixels) somehow get cut off weirdly. I've first noticed this in my game Western Ideals. differance The titlescreen image file itself is 200 pixels big. It works as expected and i can scroll through the entire image. Not so on RebbleOS where a part of the pict is cut off. See this line of code for reference: https://github.com/gameblabla/western_ideals/blob/master/src/c/test.c#L713

After noticing this, i tried to trim it down to see if it wasn't just an implemented function or anything funky. I've made a small program that you can scroll the picture through with the buttons. diff3 I could sadly confirm that the image here too gets cut off. It also has a height of 200 pixels. See the program here : https://github.com/gameblabla/testapp_pebble/tree/master/test_bigpict

I've also noticed another interesting corner case that is also not supported by RebbleOS. What if i try to display a picture smaller than the screen size and then tell graphics_draw_bitmap_in_rect to use the full screen size ? graphics_draw_bitmap_in_rect(ctx, current_background, GRect(0, 0, 144, 168)); The picture itself is only 140 pixels big in height. However, we tell the function to draw it as if it was bigger than that. tiling This interesting thing happens. However, it only does so if the image is smaller than the screen size. See https://github.com/gameblabla/testapp_pebble/tree/master/test_fillrect to give it a try.

Of course, i only tried vertically but i'm sure it has the same issues horizontally as well. I probably scratched only the surface so more investigating might be needed.

ginge commented 6 years ago

excellent report, thanks