Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11305 - Correct "reuse buffers if the backdrop file is already loaded"

Attached to Project: Rockbox
Opened by Teruaki Kawashima (teru) - Friday, 21 May 2010, 17:32 GMT+2
Last edited by Teruaki Kawashima (teru) - Thursday, 03 June 2010, 16:02 GMT+2
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Release 3.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

in current svn, reusing buffer works only if both skins don't contais %X tag.
the cause is:
if the skin contains %X tag, string passed to skin_backdrop_load as backdrop is somthing like "sbsback.bmp|\n%Vi|14|66|212|224|1|000000|ffffff|\n..." and will be stored to bdrop->name as "sbsback.bmp|\n%Vi|14|66|212|224|1|0000".
so, comparing passed backdrop and bdrop->name will always fail.

attached correct_reusing_backdrop.diff changes this like follows:
change size of bdrop->name to MAX_PATH,
use filename which is fullpath of the file for both comparing and stored value.

improve_set_as_backdrop.diff improve "Set as backdrop" functionality.
it fix that, after N times of failure of "Set As Backdrop" or "Clear Backdrop", "Set As Backdrop" always fails until reloading a skin becase of lack of memory.
instead of allocating buffer by skin_buffer_alloc(), add new function skin_backdrop_getbuffer() and pass "-" as filename to get same buffer for the backdrop used in sb_set_backdrop().
   correct_reusing_backdrop.diff (5.2 KiB)
 apps/gui/statusbar-skinned.c          |   13 +----
 apps/gui/skin_engine/skin_engine.h    |    2 
 apps/gui/skin_engine/skin_backdrops.c |   78 +++++++++++++++++++++-------------
 3 files changed, 55 insertions(+), 38 deletions(-)

   improve_set_as_backdrop.diff (5.2 KiB)
 apps/gui/statusbar-skinned.c          |   13 +----
 apps/gui/skin_engine/skin_engine.h    |    2 
 apps/gui/skin_engine/skin_backdrops.c |   78 +++++++++++++++++++++-------------
 3 files changed, 55 insertions(+), 38 deletions(-)

This task depends upon

Closed by  Teruaki Kawashima (teru)
Thursday, 03 June 2010, 16:02 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed in r26510.
Comment by Teruaki Kawashima (teru) - Friday, 21 May 2010, 17:36 GMT+2
i uploaded wrong correct_reusing_backdrop.diff... this is the correct one.
   correct_reusing_backdrop.diff (1.1 KiB)
 apps/gui/skin_engine/skin_backdrops.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Loading...