Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with graphics_draw_bitmap_in_rect #58

Open
gameblabla opened this issue May 3, 2018 · 1 comment
Open

Issues with graphics_draw_bitmap_in_rect #58

gameblabla opened this issue May 3, 2018 · 1 comment

Comments

@gameblabla
Copy link

gameblabla commented May 3, 2018

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
Copy link
Collaborator

ginge commented May 3, 2018

excellent report, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants