diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-06-05 14:57:07 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-06-05 14:57:07 +0000 |
commit | 887b31c01aebb46c0fcc6910241a4a64d9e7991e (patch) | |
tree | d4631266370ad3203a1b94ad9aa569f3e52658db | |
parent | b5f4d90b4b4e88f83828681c7d708338fdcee8d0 (diff) | |
download | rockbox-887b31c01aebb46c0fcc6910241a4a64d9e7991e.tar.gz rockbox-887b31c01aebb46c0fcc6910241a4a64d9e7991e.zip |
Add some more explicit defines for my previous commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13561 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/gwps.h | 7 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 25 |
2 files changed, 18 insertions, 14 deletions
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 609e2af91f..26a800cbbd 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -69,13 +69,6 @@ struct align_pos { | |||
69 | #ifdef HAVE_LCD_BITMAP | 69 | #ifdef HAVE_LCD_BITMAP |
70 | 70 | ||
71 | #define MAX_IMAGES (26*2) /* a-z and A-Z */ | 71 | #define MAX_IMAGES (26*2) /* a-z and A-Z */ |
72 | |||
73 | #if LCD_DEPTH > 1 | ||
74 | #define MAX_BITMAPS MAX_IMAGES+2 /* WPS images + pbar bitmap + backdrop */ | ||
75 | #else | ||
76 | #define MAX_BITMAPS MAX_IMAGES+1 /* WPS images + pbar bitmap */ | ||
77 | #endif | ||
78 | |||
79 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ | 72 | #define IMG_BUFSIZE ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \ |
80 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) | 73 | + (2*LCD_HEIGHT*LCD_WIDTH/8)) |
81 | 74 | ||
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 5be93c6d91..6b1f666474 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -64,9 +64,20 @@ static int numoptions[WPS_MAX_COND_LEVEL]; | |||
64 | static int line; | 64 | static int line; |
65 | 65 | ||
66 | #ifdef HAVE_LCD_BITMAP | 66 | #ifdef HAVE_LCD_BITMAP |
67 | |||
68 | #if LCD_DEPTH > 1 | ||
69 | #define MAX_BITMAPS MAX_IMAGES+2 /* WPS images + pbar bitmap + backdrop */ | ||
70 | #else | ||
71 | #define MAX_BITMAPS MAX_IMAGES+1 /* WPS images + pbar bitmap */ | ||
72 | #endif | ||
73 | |||
74 | #define PROGRESSBAR_BMP MAX_IMAGES | ||
75 | #define BACKDROP_BMP MAX_IMAGES+1 | ||
76 | |||
67 | /* pointers to the bitmap filenames in the WPS source */ | 77 | /* pointers to the bitmap filenames in the WPS source */ |
68 | static const char *bmp_names[MAX_BITMAPS]; | 78 | static const char *bmp_names[MAX_BITMAPS]; |
69 | #endif | 79 | |
80 | #endif /* HAVE_LCD_BITMAP */ | ||
70 | 81 | ||
71 | #ifdef DEBUG | 82 | #ifdef DEBUG |
72 | /* debugging function */ | 83 | /* debugging function */ |
@@ -468,13 +479,13 @@ static int parse_image_special(const char *wps_bufptr, | |||
468 | if (token->type == WPS_TOKEN_IMAGE_PROGRESS_BAR) | 479 | if (token->type == WPS_TOKEN_IMAGE_PROGRESS_BAR) |
469 | { | 480 | { |
470 | /* format: %P|filename.bmp| */ | 481 | /* format: %P|filename.bmp| */ |
471 | bmp_names[MAX_IMAGES] = wps_bufptr + 1; | 482 | bmp_names[PROGRESSBAR_BMP] = wps_bufptr + 1; |
472 | } | 483 | } |
473 | #if LCD_DEPTH > 1 | 484 | #if LCD_DEPTH > 1 |
474 | else if (token->type == WPS_TOKEN_IMAGE_BACKDROP) | 485 | else if (token->type == WPS_TOKEN_IMAGE_BACKDROP) |
475 | { | 486 | { |
476 | /* format: %X|filename.bmp| */ | 487 | /* format: %X|filename.bmp| */ |
477 | bmp_names[MAX_IMAGES + 1] = wps_bufptr + 1; | 488 | bmp_names[BACKDROP_BMP] = wps_bufptr + 1; |
478 | } | 489 | } |
479 | #endif | 490 | #endif |
480 | 491 | ||
@@ -921,14 +932,14 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
921 | bool *loaded; | 932 | bool *loaded; |
922 | 933 | ||
923 | int n; | 934 | int n; |
924 | for (n = 0; n < MAX_BITMAPS - 1; n++) | 935 | for (n = 0; n < BACKDROP_BMP; n++) |
925 | { | 936 | { |
926 | if (bmp_names[n]) | 937 | if (bmp_names[n]) |
927 | { | 938 | { |
928 | get_image_filename(bmp_names[n], bmpdir, | 939 | get_image_filename(bmp_names[n], bmpdir, |
929 | img_path, sizeof(img_path)); | 940 | img_path, sizeof(img_path)); |
930 | 941 | ||
931 | if (n == MAX_IMAGES) { | 942 | if (n == PROGRESSBAR_BMP) { |
932 | /* progressbar bitmap */ | 943 | /* progressbar bitmap */ |
933 | bitmap = &wps_data->progressbar.bm; | 944 | bitmap = &wps_data->progressbar.bm; |
934 | loaded = &wps_data->progressbar.have_bitmap_pb; | 945 | loaded = &wps_data->progressbar.have_bitmap_pb; |
@@ -948,9 +959,9 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) | |||
948 | } | 959 | } |
949 | 960 | ||
950 | #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) | 961 | #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) |
951 | if (bmp_names[MAX_IMAGES + 1]) | 962 | if (bmp_names[BACKDROP_BMP]) |
952 | { | 963 | { |
953 | get_image_filename(bmp_names[MAX_IMAGES + 1], bmpdir, | 964 | get_image_filename(bmp_names[BACKDROP_BMP], bmpdir, |
954 | img_path, sizeof(img_path)); | 965 | img_path, sizeof(img_path)); |
955 | #ifdef HAVE_REMOTE_LCD | 966 | #ifdef HAVE_REMOTE_LCD |
956 | if (wps_data->remote_wps) | 967 | if (wps_data->remote_wps) |