diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-05-29 09:35:05 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-05-29 09:35:05 +0000 |
commit | 04130c2c7ea49dca77144fbdab29262156e29db1 (patch) | |
tree | 8711fd3fbf20dd0db4c9e38147ba5b50b659b5b8 | |
parent | 8cd3f8452c65f2fbf423470e7e87999eaa2ba9fc (diff) |
be smarter about %xd so it only eats 2 letters if that image has subimages
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26371 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | utils/skinupdater/skinupdater.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/utils/skinupdater/skinupdater.c b/utils/skinupdater/skinupdater.c index 9329b9a9f0..755c912fa3 100644 --- a/utils/skinupdater/skinupdater.c +++ b/utils/skinupdater/skinupdater.c @@ -28,6 +28,8 @@ #define PUTCH(out, c) fprintf(out, "%c", c) extern struct tag_info legal_tags[]; +char images_with_subimages[100]; +int image_count = 0; /** Command line setting **/ bool is_mono_display = false; @@ -106,12 +108,14 @@ int parse_tag(FILE* out, const char* start, bool in_conditional) } else if (MATCH("xl")) { + char label = start[1]; PUTCH(out, '('); int read = 1+dump_arg(out, start+1, 4, false); len += read; start += read; if (*start>= '0' && *start <= '9') { + images_with_subimages[image_count++] = label; PUTCH(out, ','); len += dump_arg(out, start, 1, false); } @@ -119,11 +123,19 @@ int parse_tag(FILE* out, const char* start, bool in_conditional) } else if (MATCH("xd")) { - /* NOTE: almost certainly needs work */ + char label = start[0]; + int i=0; + while (i<image_count) + { + if (images_with_subimages[i] == label) + break; + i++; + } PUTCH(out, '('); PUTCH(out, *start++); len++; - if ((*start >= 'a' && *start <= 'z') || - (*start >= 'A' && *start <= 'Z')) + if (i<image_count && + ((*start >= 'a' && *start <= 'z') || + (*start >= 'A' && *start <= 'Z'))) { PUTCH(out, *start); len++; } |