summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/wps_parser.c40
-rw-r--r--apps/recorder/bmp.c7
2 files changed, 37 insertions, 10 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index ae50499960..55b4ed9cae 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -17,18 +17,29 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <stdio.h>
21#include <string.h>
22#include "gwps.h"
23#ifdef __PCTOOL__
24#define DEBUGF printf
25#define FONT_SYSFIXED 0
26#define FONT_UI 1
27#else
28#include "debug.h"
29#endif
30
31#ifndef __PCTOOL__
20#include <ctype.h> 32#include <ctype.h>
21#include <stdbool.h> 33#include <stdbool.h>
22#include <stdio.h> 34#include <stdio.h>
23#include <stdlib.h> 35#include <stdlib.h>
24#include <string.h> 36#include <string.h>
37#include "font.h"
38
25#include "atoi.h" 39#include "atoi.h"
26#include "gwps.h" 40#include "gwps.h"
27#include "font.h"
28#ifndef __PCTOOL__
29#include "settings.h" 41#include "settings.h"
30#include "misc.h" 42#include "misc.h"
31#include "debug.h"
32#include "plugin.h" 43#include "plugin.h"
33 44
34#ifdef HAVE_LCD_BITMAP 45#ifdef HAVE_LCD_BITMAP
@@ -382,7 +393,7 @@ static bool load_bitmap(struct wps_data *wps_data,
382 int ret = read_bmp_file(filename, bm, 393 int ret = read_bmp_file(filename, bm,
383 wps_data->img_buf_free, 394 wps_data->img_buf_free,
384 format); 395 format);
385 396 DEBUGF("Read %s, ret=%d\n",filename,ret);
386 if (ret > 0) 397 if (ret > 0)
387 { 398 {
388#if LCD_DEPTH == 16 399#if LCD_DEPTH == 16
@@ -1370,12 +1381,11 @@ static void wps_reset(struct wps_data *data)
1370 1381
1371#ifdef HAVE_LCD_BITMAP 1382#ifdef HAVE_LCD_BITMAP
1372 1383
1373static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir) 1384static bool load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir)
1374{ 1385{
1375 char img_path[MAX_PATH]; 1386 char img_path[MAX_PATH];
1376 struct bitmap *bitmap; 1387 struct bitmap *bitmap;
1377 bool *loaded; 1388 bool *loaded;
1378
1379 int n; 1389 int n;
1380 for (n = 0; n < BACKDROP_BMP; n++) 1390 for (n = 0; n < BACKDROP_BMP; n++)
1381 { 1391 {
@@ -1405,6 +1415,12 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir)
1405 wps_data->img[n].subimage_height = wps_data->img[n].bm.height / 1415 wps_data->img[n].subimage_height = wps_data->img[n].bm.height /
1406 wps_data->img[n].num_subimages; 1416 wps_data->img[n].num_subimages;
1407 } 1417 }
1418 else
1419 {
1420 /* Abort if we can't load an image */
1421 DEBUGF("ERR: Failed to load image %d - %s\n",n,img_path);
1422 return false;
1423 }
1408 } 1424 }
1409 } 1425 }
1410 1426
@@ -1416,14 +1432,19 @@ static void load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir)
1416#ifdef HAVE_REMOTE_LCD 1432#ifdef HAVE_REMOTE_LCD
1417 if (wps_data->remote_wps) 1433 if (wps_data->remote_wps)
1418#if LCD_REMOTE_DEPTH > 1 1434#if LCD_REMOTE_DEPTH > 1
1419 load_remote_wps_backdrop(img_path) 1435 if (!load_remote_wps_backdrop(img_path))
1436 return false
1420#endif 1437#endif
1421 ; 1438 ;
1422 else 1439 else
1423#endif /* HAVE_REMOTE_LCD */ 1440#endif /* HAVE_REMOTE_LCD */
1424 load_wps_backdrop(img_path); 1441 if (!load_wps_backdrop(img_path))
1442 return false;
1425 } 1443 }
1426#endif /* has backdrop support */ 1444#endif /* has backdrop support */
1445
1446 /* If we got here, everything was OK */
1447 return true;
1427} 1448}
1428 1449
1429#endif /* HAVE_LCD_BITMAP */ 1450#endif /* HAVE_LCD_BITMAP */
@@ -1552,7 +1573,8 @@ bool wps_data_load(struct wps_data *wps_data,
1552 bmpdir[bmpdirlen] = 0; 1573 bmpdir[bmpdirlen] = 0;
1553 1574
1554 /* load the bitmaps that were found by the parsing */ 1575 /* load the bitmaps that were found by the parsing */
1555 load_wps_bitmaps(wps_data, bmpdir); 1576 if (!load_wps_bitmaps(wps_data, bmpdir))
1577 return false;
1556#endif 1578#endif
1557 return true; 1579 return true;
1558 } 1580 }
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 3db2cb1817..f844c8908f 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -38,11 +38,16 @@
38#ifdef HAVE_REMOTE_LCD 38#ifdef HAVE_REMOTE_LCD
39#include "lcd-remote.h" 39#include "lcd-remote.h"
40#endif 40#endif
41#ifndef __PCTOOL__
41#include "file.h" 42#include "file.h"
42#include "config.h" 43#include "config.h"
43#include "system.h" 44#include "system.h"
44#include "bmp.h" 45#include "bmp.h"
45#include "lcd.h" 46#include "debug.h"
47#else
48#undef DEBUGF
49#define DEBUGF(...)
50#endif
46 51
47#ifdef __GNUC__ 52#ifdef __GNUC__
48#define STRUCT_PACKED __attribute__((packed)) 53#define STRUCT_PACKED __attribute__((packed))