# HG changeset patch # User Thinker K.F. Li # Date 1274806272 -28800 # Node ID d7f224b97b7f6192c6fbd73011c14d6fdad86463 # Parent f42419c08a65c452cce24d3f6842fdca60c04c3f Fix the wrong way of getting the paint of an image. You can not get paint of an image with symbol looking up. I don't why we do it in this way, here. diff -r f42419c08a65 -r d7f224b97b7f examples/menu/filebrowser.c --- a/examples/menu/filebrowser.c Mon May 24 21:09:32 2010 +0800 +++ b/examples/menu/filebrowser.c Wed May 26 00:51:12 2010 +0800 @@ -69,21 +69,20 @@ { redraw_man_t *rdman = MBAF_RDMAN(app); paint_t *paint, *old_paint; - paint_t *previewimg_paint; shape_t *obj = (shape_t *) MB_SPRITE_GET_OBJ(app->rootsprite, "previewimg"); int w, h; - previewimg_paint = - (paint_t *)MB_SPRITE_GET_OBJ(app->rootsprite, - "previewimg_paint_img"); printf("Preview %s\n",path); - paint = rdman_img_ldr_load_paint(rdman, path); + paint = rdman_img_ldr_load_paint(rdman, path); /* return a cached + * paint if the + * path was loaded + * before */ if (paint) { paint_image_get_size(paint, &w, &h); printf("image %d %d\n",w, h); old_paint = sh_get_fill(obj); rdman_paint_fill(rdman, paint, obj); - if(old_paint != previewimg_paint) + if(old_paint != paint) rdman_paint_free(rdman, old_paint); rdman_shape_changed(MBAF_RDMAN(app),obj);