New gdispImageInit() call to initialise a gdispImage structure

Use in gwinImage
remotes/origin_old/ugfx_release_2.6
inmarket 2014-05-09 21:30:00 +10:00
parent 7c2b2555f8
commit cf5867b33d
3 changed files with 13 additions and 2 deletions

View File

@ -130,6 +130,10 @@ gdispImageError
}
#endif
void gdispImageInit(gdispImage *img) {
img->type = GDISP_IMAGE_TYPE_UNKNOWN;
}
gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f) {
gdispImageError err;

View File

@ -130,6 +130,14 @@ extern "C" {
#define gdispImageSetSimulFileReader(img, fname) gdispImageSetFileReader(img, fname)
#endif
/**
* @brief Initialise a gdispImage object
*
* @param[in] img The image structure to initialise
*
*/
void gdispImageInit(gdispImage *img);
/**
* @brief Open an image using an open GFILE and get it ready for drawing
* @details Determine the image format and get ready to decode the first image frame

View File

@ -127,8 +127,7 @@ GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) {
return 0;
// Ensure the gdispImageIsOpen() gives valid results
gobj->image.type = 0;
gobj->image.fns = 0;
gdispImageInit(&gobj->image);
// Initialise the timer
#if GWIN_NEED_IMAGE_ANIMATION