From 4d3a08f5cfd244f82d1283cab702450e1dad14cd Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 7 Feb 2014 18:44:32 +1000 Subject: Update image demo's to use GFILE ROMFS. --- demos/modules/gdisp/images_animated/main.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'demos/modules/gdisp/images_animated/main.c') 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 -- cgit v1.2.3