aboutsummaryrefslogtreecommitdiffstats
path: root/drv_Image.c
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-06-08 04:45:16 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2007-06-08 04:45:16 +0000
commit684bc9f48bbd560618bb2c07f5482d28d1519644 (patch)
tree80e30b96a3a724c5c43a3f42883fdcf42afc53ff /drv_Image.c
parent775475883e63c7486c3ec043d10f62502cf40826 (diff)
downloadlcd4linux-684bc9f48bbd560618bb2c07f5482d28d1519644.tar.gz
Image driver libgd dependancy fix
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@803 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_Image.c')
-rw-r--r--drv_Image.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drv_Image.c b/drv_Image.c
index 82521a7..15be190 100644
--- a/drv_Image.c
+++ b/drv_Image.c
@@ -80,7 +80,7 @@
static char Name[] = "Image";
-static enum { PPM, PNG } Format;
+static enum { NIL, PPM, PNG } Format;
static int pixel = -1; /* pointsize in pixel */
static int pgap = 0; /* gap between points */
@@ -266,6 +266,8 @@ static void drv_IMG_flush(void)
drv_IMG_flush_PNG();
#endif
break;
+ default:
+ break;
}
}
@@ -315,11 +317,21 @@ static int drv_IMG_start(const char *section)
return -1;
}
+ Format = NIL;
+
+#ifdef WITH_PPM
if (strcmp(s, "PPM") == 0) {
Format = PPM;
- } else if (strcmp(s, "PNG") == 0) {
+ }
+#endif
+
+#ifdef WITH_PNG
+ if (strcmp(s, "PNG") == 0) {
Format = PNG;
- } else {
+ }
+#endif
+
+ if (Format == NIL) {
error("%s: bad %s.Format '%s' from %s", Name, section, s, cfg_source());
free(s);
return -1;
@@ -411,7 +423,12 @@ static int drv_IMG_start(const char *section)
/* list models */
int drv_IMG_list(void)
{
- printf("PPM PNG");
+#ifdef WITH_PPM
+ printf("PPM ");
+#endif
+#ifdef WITH_PNG
+ printf("PNG ");
+#endif
return 0;
}