aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gdisp/images_animated/main.c
diff options
context:
space:
mode:
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