if (pData->iFrameseq)
if ((pData->iFrameseq) && (iFramemode != 1) && (iFramemode != 3))
mng_retcode next_frame (mng_datap  pData,                        mng_uint8  iFramemode,                        mng_uint8  iChangedelay,                        mng_uint32 iDelay,                        mng_uint8  iChangetimeout,                        mng_uint32 iTimeout,                        mng_uint8  iChangeclipping,                        mng_uint8  iCliptype,                        mng_int32  iClipl,                        mng_int32  iClipr,                        mng_int32  iClipt,                        mng_int32  iClipb){  mng_retcode iRetcode = MNG_NOERROR;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_NEXT_FRAME, MNG_LC_START)#endif  if (!pData->iBreakpoint)             /* no previous break here ? */  {    mng_uint8 iOldmode = pData->iFramemode;                                       /* interframe delay required ? */    if ((iOldmode == 2) || (iOldmode == 4))    {      if (pData->iFrameseq)        iRetcode = interframe_delay (pData);      else        pData->iFramedelay = pData->iNextdelay;    }    if (iRetcode)                      /* on error bail out */      return iRetcode;                                       /* now we'll assume we're in the next frame! */    if (iFramemode)                    /* save the new framing mode ? */    {      pData->iFRAMmode  = iFramemode;      pData->iFramemode = iFramemode;    }    else                               /* reload default */      pData->iFramemode = pData->iFRAMmode;    if (iChangedelay)                  /* delay changed ? */    {      pData->iNextdelay = iDelay;      /* for *after* next subframe */      if ((iOldmode == 2) || (iOldmode == 4))        pData->iFramedelay = pData->iNextdelay;      if (iChangedelay == 2)           /* also overall ? */        pData->iFRAMdelay = iDelay;    }    else    {                                  /* reload default */      pData->iNextdelay = pData->iFRAMdelay;      if ((iOldmode == 2) || (iOldmode == 4))        pData->iFramedelay = pData->iNextdelay;    }    if (iChangetimeout)                /* timeout changed ? */    {                                  /* for next subframe */      pData->iFrametimeout = iTimeout;      if ((iChangetimeout == 2) ||     /* also overall ? */          (iChangetimeout == 4) ||          (iChangetimeout == 6) ||          (iChangetimeout == 8))        pData->iFRAMtimeout = iTimeout;    }    else                               /* reload default */      pData->iFrametimeout = pData->iFRAMtimeout;    if (iChangeclipping)               /* clipping changed ? */    {      pData->bFrameclipping = MNG_TRUE;      if (!iCliptype)                  /* absolute ? */      {        pData->iFrameclipl = iClipl;        pData->iFrameclipr = iClipr;        pData->iFrameclipt = iClipt;        pData->iFrameclipb = iClipb;      }      else                             /* relative */      {        pData->iFrameclipl = pData->iFrameclipl + iClipl;        pData->iFrameclipr = pData->iFrameclipr + iClipr;        pData->iFrameclipt = pData->iFrameclipt + iClipt;        pData->iFrameclipb = pData->iFrameclipb + iClipb;      }      if (iChangeclipping == 2)        /* also overall ? */      {        pData->bFRAMclipping = MNG_TRUE;        if (!iCliptype)                /* absolute ? */        {          pData->iFRAMclipl = iClipl;          pData->iFRAMclipr = iClipr;          pData->iFRAMclipt = iClipt;          pData->iFRAMclipb = iClipb;        }        else                           /* relative */        {          pData->iFRAMclipl = pData->iFRAMclipl + iClipl;          pData->iFRAMclipr = pData->iFRAMclipr + iClipr;          pData->iFRAMclipt = pData->iFRAMclipt + iClipt;          pData->iFRAMclipb = pData->iFRAMclipb + iClipb;        }      }    }    else    {                                  /* reload defaults */      pData->bFrameclipping = pData->bFRAMclipping;      pData->iFrameclipl    = pData->iFRAMclipl;      pData->iFrameclipr    = pData->iFRAMclipr;      pData->iFrameclipt    = pData->iFRAMclipt;      pData->iFrameclipb    = pData->iFRAMclipb;    }  }  if (!pData->bTimerset)               /* timer still off ? */  {    if ((pData->iFramemode == 4) ||    /* insert background layer after a new frame */        (!pData->iLayerseq))           /* and certainly before the very first layer */      iRetcode = load_bkgdlayer (pData);    if (iRetcode)                      /* on error bail out */      return iRetcode;    pData->iFrameseq++;                /* count the frame ! */  }#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_NEXT_FRAME, MNG_LC_END)#endif  return MNG_NOERROR;}