diff options
author | Fred Bauer <fred.w.bauer@gmail.com> | 2011-10-19 16:33:33 +0000 |
---|---|---|
committer | Fred Bauer <fred.w.bauer@gmail.com> | 2011-10-19 16:33:33 +0000 |
commit | 8d7445874419e118fcf54f55be70e0bbfc46696e (patch) | |
tree | a011cc9a94b3f0ce82a5b3974c788b182ddf8acb | |
parent | 67a1db437f5dd5f095410a809e1d4122739b5bca (diff) | |
download | rockbox-8d7445874419e118fcf54f55be70e0bbfc46696e.tar.gz rockbox-8d7445874419e118fcf54f55be70e0bbfc46696e.zip |
Revert skin font allocation size to the behavior prior to r30589. i.e. Default to 256 glyphs rather than trying to load MAX_FONT_SIZE. This matches the manual and saves a lot of ram if a theme uses multiple fonts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30804 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index a6359b1956..a9689a8e00 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -76,11 +76,6 @@ | |||
76 | 76 | ||
77 | #define WPS_ERROR_INVALID_PARAM -1 | 77 | #define WPS_ERROR_INVALID_PARAM -1 |
78 | 78 | ||
79 | #if LCD_HEIGHT > 160 | ||
80 | #define SKIN_FONT_SIZE (1024*10) | ||
81 | #else | ||
82 | #define SKIN_FONT_SIZE (1024*3) | ||
83 | #endif | ||
84 | #define GLYPHS_TO_CACHE 256 | 79 | #define GLYPHS_TO_CACHE 256 |
85 | 80 | ||
86 | static bool isdefault(struct skin_tag_parameter *param) | 81 | static bool isdefault(struct skin_tag_parameter *param) |
@@ -419,7 +414,7 @@ static int parse_font_load(struct skin_element *element, | |||
419 | if(element->params_count > 2) | 414 | if(element->params_count > 2) |
420 | glyphs = element->params[2].data.number; | 415 | glyphs = element->params[2].data.number; |
421 | else | 416 | else |
422 | glyphs = 0; | 417 | glyphs = GLYPHS_TO_CACHE; |
423 | if (id < 2) | 418 | if (id < 2) |
424 | { | 419 | { |
425 | DEBUGF("font id must be >= 2\n"); | 420 | DEBUGF("font id must be >= 2\n"); |
@@ -1678,14 +1673,12 @@ static bool skin_load_fonts(struct wps_data *data) | |||
1678 | char path[MAX_PATH]; | 1673 | char path[MAX_PATH]; |
1679 | snprintf(path, sizeof path, FONT_DIR "/%s", font->name); | 1674 | snprintf(path, sizeof path, FONT_DIR "/%s", font->name); |
1680 | #ifndef __PCTOOL__ | 1675 | #ifndef __PCTOOL__ |
1681 | if (skinfonts[font_id-2].glyphs > 0) | 1676 | font->id = font_load_ex(path, |
1682 | { | 1677 | font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs)); |
1683 | font->id = font_load_ex(path, | 1678 | |
1684 | font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs)); | 1679 | #else |
1685 | } | ||
1686 | else | ||
1687 | #endif | ||
1688 | font->id = font_load(path); | 1680 | font->id = font_load(path); |
1681 | #endif | ||
1689 | //printf("[%d] %s -> %d\n",font_id, font->name, font->id); | 1682 | //printf("[%d] %s -> %d\n",font_id, font->name, font->id); |
1690 | id_array[font_count++] = font->id; | 1683 | id_array[font_count++] = font->id; |
1691 | } | 1684 | } |