aboutsummaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2012-09-04 14:28:25 -0700
committerDoug Zongker <dougz@google.com>2012-09-04 14:28:25 -0700
commit52eeea4fa59c15ecb09c32b8e05653f4e55f5188 (patch)
treed26dc6dc861c69c8f80ae9aac9a13b14bee3381b /minui
parentf4c6ec84c24611856374353bdef87baca5694cc0 (diff)
downloadbootable_recovery-52eeea4fa59c15ecb09c32b8e05653f4e55f5188.zip
bootable_recovery-52eeea4fa59c15ecb09c32b8e05653f4e55f5188.tar.gz
bootable_recovery-52eeea4fa59c15ecb09c32b8e05653f4e55f5188.tar.bz2
minor recovery fixes
- protect against missing/malformed bitmaps: fail to display them but don't crash. - don't draw animation overlays until the overlay offset is computed. - logging cleanup Change-Id: Ieb1c155cfbb11e643000bdb5d1a57900c8757739
Diffstat (limited to 'minui')
-rw-r--r--minui/graphics.c5
-rw-r--r--minui/resources.c7
2 files changed, 6 insertions, 6 deletions
diff --git a/minui/graphics.c b/minui/graphics.c
index 88572a8..287878e 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -245,6 +245,9 @@ int gr_text(int x, int y, const char *s)
}
void gr_texticon(int x, int y, gr_surface icon) {
+ if (gr_context == NULL || icon == NULL) {
+ return;
+ }
GGLContext* gl = gr_context;
gl->bindTexture(gl, (GGLSurface*) icon);
@@ -268,7 +271,7 @@ void gr_fill(int x, int y, int w, int h)
}
void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) {
- if (gr_context == NULL) {
+ if (gr_context == NULL || source == NULL) {
return;
}
GGLContext *gl = gr_context;
diff --git a/minui/resources.c b/minui/resources.c
index ac7bdac..065f431 100644
--- a/minui/resources.c
+++ b/minui/resources.c
@@ -178,8 +178,6 @@ exit:
static int matches_locale(const char* loc) {
if (locale == NULL) return 0;
- printf("matching loc=[%s] vs locale=[%s]\n", loc, locale);
-
if (strcmp(loc, locale) == 0) return 1;
// if loc does *not* have an underscore, and it matches the start
@@ -190,7 +188,6 @@ static int matches_locale(const char* loc) {
int i;
for (i = 0; loc[i] != 0 && loc[i] != '_'; ++i);
if (loc[i] == '_') return 0;
- printf(" partial match possible; i = %d\n", i);
return (strncmp(locale, loc, i) == 0 && locale[i] == '_');
}
@@ -268,9 +265,9 @@ int res_create_localized_surface(const char* name, gr_surface* pSurface) {
int len = row[4];
char* loc = row+5;
- printf("row %d: %s %d x %d\n", y, loc, w, h);
-
if (y+1+h >= height || matches_locale(loc)) {
+ printf(" %20s: %s (%d x %d @ %d)\n", name, loc, w, h, y);
+
surface = malloc(sizeof(GGLSurface));
if (surface == NULL) {
result = -8;