summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bauer <fred.w.bauer@gmail.com>2011-10-19 16:33:33 +0000
committerFred Bauer <fred.w.bauer@gmail.com>2011-10-19 16:33:33 +0000
commit8d7445874419e118fcf54f55be70e0bbfc46696e (patch)
treea011cc9a94b3f0ce82a5b3974c788b182ddf8acb
parent67a1db437f5dd5f095410a809e1d4122739b5bca (diff)
downloadrockbox-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.c19
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 @@
#define WPS_ERROR_INVALID_PARAM -1
-#if LCD_HEIGHT > 160
-#define SKIN_FONT_SIZE (1024*10)
-#else
-#define SKIN_FONT_SIZE (1024*3)
-#endif
#define GLYPHS_TO_CACHE 256
static bool isdefault(struct skin_tag_parameter *param)
@@ -419,7 +414,7 @@ static int parse_font_load(struct skin_element *element,
if(element->params_count > 2)
glyphs = element->params[2].data.number;
else
- glyphs = 0;
+ glyphs = GLYPHS_TO_CACHE;
if (id < 2)
{
DEBUGF("font id must be >= 2\n");
@@ -1678,14 +1673,12 @@ static bool skin_load_fonts(struct wps_data *data)
char path[MAX_PATH];
snprintf(path, sizeof path, FONT_DIR "/%s", font->name);
#ifndef __PCTOOL__
- if (skinfonts[font_id-2].glyphs > 0)
- {
- font->id = font_load_ex(path,
- font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
- }
- else
-#endif
+ font->id = font_load_ex(path,
+ font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
+
+#else
font->id = font_load(path);
+#endif
//printf("[%d] %s -> %d\n",font_id, font->name, font->id);
id_array[font_count++] = font->id;
}