aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp/images_animated/main.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-02-07 18:44:32 +1000
committerinmarket <andrewh@inmarket.com.au>2014-02-07 18:44:32 +1000
commit4d3a08f5cfd244f82d1283cab702450e1dad14cd (patch)
tree817f58f61455ef4d0c296a7a44f4b56d0999b29e /demos/modules/gdisp/images_animated/main.c
parentf7d6b9b58e4e8d979004026b41c1bfd275218fb9 (diff)
downloaduGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.tar.gz
uGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.tar.bz2
uGFX-4d3a08f5cfd244f82d1283cab702450e1dad14cd.zip
Update image demo's to use GFILE ROMFS.
Diffstat (limited to 'demos/modules/gdisp/images_animated/main.c')
-rw-r--r--demos/modules/gdisp/images_animated/main.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/demos/modules/gdisp/images_animated/main.c b/demos/modules/gdisp/images_animated/main.c
index bf49f692..039cf584 100644
--- a/demos/modules/gdisp/images_animated/main.c
+++ b/demos/modules/gdisp/images_animated/main.c
@@ -29,23 +29,20 @@
#include "gfx.h"
+/**
+ * The image file must be stored on a GFILE file-system.
+ * Use either GFILE_NEED_NATIVEFS or GFILE_NEED_ROMFS (or both).
+ *
+ * The ROMFS uses the file "romfs_files.h" to describe the set of files in the ROMFS.
+ */
+
#define USE_IMAGE_CACHE FALSE // Only if you want to get performance at the expense of RAM
#define MY_BG_COLOR RGB2COLOR(220, 220, 255) // Pale blue so we can see the transparent parts
-#ifdef WIN32
- #define USE_MEMORY_FILE TRUE // Can be true or false for Win32
-#else
- #define USE_MEMORY_FILE TRUE // Non-Win32 - use the compiled in image
-#endif
+static gdispImage myImage;
#define SHOW_ERROR(color) gdispFillArea(errx, erry, errcx, errcy, color)
-#if USE_MEMORY_FILE
- #include "testanim.h"
-#endif
-
-static gdispImage myImage;
-
/**
* This demo display the animated gif (either directly from a file or from a
* file encoded in flash.
@@ -75,11 +72,7 @@ int main(void) {
errcy = sheight;
// Set up IO for our image
-#if USE_MEMORY_FILE
- if (!(gdispImageOpenMemory(&myImage, testanim) & GDISP_IMAGE_ERR_UNRECOVERABLE)) {
-#else
if (!(gdispImageOpenFile(&myImage, "testanim.gif") & GDISP_IMAGE_ERR_UNRECOVERABLE)) {
-#endif
gdispImageSetBgColor(&myImage, MY_BG_COLOR);
// Adjust the error indicator area if necessary