summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-09-07 02:36:56 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-09-07 02:36:56 +0000
commitfe2f042670a59cf73c3775945df9185d933ca9b4 (patch)
treecbb5efd5f4cad7fd524a43d304e1dbeeddc2cdb1 /apps/recorder
parent8898339fcf07aee644ebcabe77d5a2dd323642ed (diff)
downloadrockbox-fe2f042670a59cf73c3775945df9185d933ca9b4.tar.gz
rockbox-fe2f042670a59cf73c3775945df9185d933ca9b4.zip
rework AA load/display handling in the skins to get them working in viewports again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22646 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/albumart.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index 438c173211..7715287d46 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -308,6 +308,7 @@ void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
308 return; 308 return;
309 309
310 struct wps_data *data = gwps->data; 310 struct wps_data *data = gwps->data;
311 struct skin_albumart *aa = data->albumart;
311 312
312#ifdef HAVE_REMOTE_LCD 313#ifdef HAVE_REMOTE_LCD
313 /* No album art on RWPS */ 314 /* No album art on RWPS */
@@ -315,37 +316,40 @@ void draw_album_art(struct gui_wps *gwps, int handle_id, bool clear)
315 return; 316 return;
316#endif 317#endif
317 318
319 if (!aa)
320 return;
321
318 struct bitmap *bmp; 322 struct bitmap *bmp;
319 if (bufgetdata(handle_id, 0, (void *)&bmp) <= 0) 323 if (bufgetdata(handle_id, 0, (void *)&bmp) <= 0)
320 return; 324 return;
321 325
322 short x = data->albumart_x; 326 short x = aa->albumart_x;
323 short y = data->albumart_y; 327 short y = aa->albumart_y;
324 short width = bmp->width; 328 short width = bmp->width;
325 short height = bmp->height; 329 short height = bmp->height;
326 330
327 if (data->albumart_max_width > 0) 331 if (aa->albumart_max_width > 0)
328 { 332 {
329 /* Crop if the bitmap is too wide */ 333 /* Crop if the bitmap is too wide */
330 width = MIN(bmp->width, data->albumart_max_width); 334 width = MIN(bmp->width, aa->albumart_max_width);
331 335
332 /* Align */ 336 /* Align */
333 if (data->albumart_xalign & WPS_ALBUMART_ALIGN_RIGHT) 337 if (aa->albumart_xalign & WPS_ALBUMART_ALIGN_RIGHT)
334 x += data->albumart_max_width - width; 338 x += aa->albumart_max_width - width;
335 else if (data->albumart_xalign & WPS_ALBUMART_ALIGN_CENTER) 339 else if (aa->albumart_xalign & WPS_ALBUMART_ALIGN_CENTER)
336 x += (data->albumart_max_width - width) / 2; 340 x += (aa->albumart_max_width - width) / 2;
337 } 341 }
338 342
339 if (data->albumart_max_height > 0) 343 if (aa->albumart_max_height > 0)
340 { 344 {
341 /* Crop if the bitmap is too high */ 345 /* Crop if the bitmap is too high */
342 height = MIN(bmp->height, data->albumart_max_height); 346 height = MIN(bmp->height, aa->albumart_max_height);
343 347
344 /* Align */ 348 /* Align */
345 if (data->albumart_yalign & WPS_ALBUMART_ALIGN_BOTTOM) 349 if (aa->albumart_yalign & WPS_ALBUMART_ALIGN_BOTTOM)
346 y += data->albumart_max_height - height; 350 y += aa->albumart_max_height - height;
347 else if (data->albumart_yalign & WPS_ALBUMART_ALIGN_CENTER) 351 else if (aa->albumart_yalign & WPS_ALBUMART_ALIGN_CENTER)
348 y += (data->albumart_max_height - height) / 2; 352 y += (aa->albumart_max_height - height) / 2;
349 } 353 }
350 354
351 if (!clear) 355 if (!clear)