if (pData->bHasTERM)
if ((pData->bDisplaying) && (pData->bRunning) && (pData->bHasTERM))
mng_retcode process_display_mend (mng_datap pData){#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_PROCESS_DISPLAY_MEND, MNG_LC_START)#endif  if (pData->bHasTERM)                 /* TERM processed ? */  {    mng_retcode   iRetcode;    mng_ani_termp pTERM;                                       /* get the right animation object ! */    pTERM = (mng_ani_termp)pData->pTermaniobj;    switch (pTERM->iTermaction)        /* determine what to do! */    {      case 0 : {                       /* show last frame indefinitly */                 pData->bRunning       = MNG_FALSE;                 break;                /* piece of cake, that is... */               }      case 1 : {                       /* cease displaying anything */                 pData->bFrameclipping = MNG_FALSE;                 load_bkgdlayer (pData);                 pData->bRunning       = MNG_FALSE;                 break;               }      case 2 : {                       /* show first image after TERM */                 /* TODO: something */                 break;               }      case 3 : {                       /* repeat */                 if ((pTERM->iItermax) && (pTERM->iItermax < 0x7FFFFFFF))                   pTERM->iItermax--;                 if (pTERM->iItermax)  /* go back to TERM ? */                 {                     /* restore to initial or SAVE state */                   iRetcode = restore_state (pData);                   if (iRetcode)       /* on error bail out */                     return iRetcode;                                       /* restart from TERM chunk */                   pData->pCurraniobj = pTERM;                                       /* set the delay */                   iRetcode = set_delay (pData, pTERM->iDelay);                   if (iRetcode)       /* on error bail out */                     return iRetcode;                 }                 else                 {                   switch (pTERM->iIteraction)                   {                     case 0 : {        /* show last frame indefinitly */                                pData->bRunning       = MNG_FALSE;                                break; /* piece of cake, that is... */                              }                     case 1 : {        /* cease displaying anything */                                pData->bFrameclipping = MNG_FALSE;                                load_bkgdlayer (pData);                                pData->bRunning       = MNG_FALSE;                                break;                              }                     case 2 : {        /* show first image after TERM */                                /* TODO: something */                                break;                              }                   }                 }                 break;               }    }  }  else  {    pData->bRunning = MNG_FALSE;       /* all done now ! */  }  if (!pData->pCurraniobj)             /* always let the app refresh at the end ! */    pData->bNeedrefresh = MNG_TRUE;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_PROCESS_DISPLAY_MEND, MNG_LC_END)#endif  return MNG_NOERROR;}