mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-19 10:02:45 -05:00
puzzles: fix blitting when zoomed
Both blitter_save() and blitter_load() functioned incorrectly when zoomed in -- blitter_save() would copy from the wrong location, and blitter_load() would ignore the y-coordinate of the destination. Change-Id: I7c85debf5953575f72c4a81e3dbcf514202c3aed
This commit is contained in:
parent
7f1dd6f593
commit
d9a55ac816
1 changed files with 5 additions and 2 deletions
|
|
@ -1196,14 +1196,17 @@ static void rb_blitter_save(void *handle, blitter *bl, int x, int y)
|
||||||
if(bl->bmp.data)
|
if(bl->bmp.data)
|
||||||
{
|
{
|
||||||
int w = bl->bmp.width, h = bl->bmp.height;
|
int w = bl->bmp.width, h = bl->bmp.height;
|
||||||
|
int screen_w = zoom_enabled ? zoom_w : LCD_WIDTH;
|
||||||
|
|
||||||
trim_rect(&x, &y, &w, &h);
|
trim_rect(&x, &y, &w, &h);
|
||||||
|
|
||||||
fb_data *fb = zoom_enabled ? zoom_fb : rb->lcd_framebuffer;
|
fb_data *fb = zoom_enabled ? zoom_fb : rb->lcd_framebuffer;
|
||||||
LOGF("rb_blitter_save(%d, %d, %d, %d)", x, y, w, h);
|
LOGF("rb_blitter_save(%d, %d, %d, %d)", x, y, w, h);
|
||||||
for(int i = 0; i < h; ++i)
|
for(int i = 0; i < h; ++i)
|
||||||
{
|
{
|
||||||
/* copy line-by-line */
|
/* copy line-by-line */
|
||||||
rb->memcpy(bl->bmp.data + sizeof(fb_data) * i * w,
|
rb->memcpy(bl->bmp.data + sizeof(fb_data) * i * w,
|
||||||
fb + (y + i) * LCD_WIDTH + x,
|
fb + (y + i) * screen_w + x,
|
||||||
w * sizeof(fb_data));
|
w * sizeof(fb_data));
|
||||||
}
|
}
|
||||||
bl->x = x;
|
bl->x = x;
|
||||||
|
|
@ -1236,7 +1239,7 @@ static void rb_blitter_load(void *handle, blitter *bl, int x, int y)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < h; ++i)
|
for(int i = 0; i < h; ++i)
|
||||||
{
|
{
|
||||||
rb->memcpy(zoom_fb + i * zoom_w + x,
|
rb->memcpy(zoom_fb + (y + i) * zoom_w + x,
|
||||||
bl->bmp.data + sizeof(fb_data) * i * w,
|
bl->bmp.data + sizeof(fb_data) * i * w,
|
||||||
w * sizeof(fb_data));
|
w * sizeof(fb_data));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue