📄 libmng_hlapi.c
字号:
pData->iRequestlayer = 0; pData->iRequesttime = 0; pData->bSearching = MNG_FALSE; pData->iRuntime = 0; pData->iSynctime = pData->fGettickcount (hHandle);#ifdef MNG_SUPPORT_READ pData->iSuspendtime = 0;#endif pData->iStarttime = pData->iSynctime; pData->iEndtime = 0; pData->pCurraniobj = pData->pFirstaniobj; iRetcode = process_display (pData); /* go do it */ if (iRetcode) /* on error bail out */ return iRetcode; if (pData->bTimerset) /* indicate timer break ? */ iRetcode = MNG_NEEDTIMERWAIT; else pData->bRunning = MNG_FALSE; /* no breaks = end of run */#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY, MNG_LC_END)#endif return iRetcode;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_resume (mng_handle hHandle){ mng_datap pData; /* local vars */ mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_RESUME, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ if (!pData->bDisplaying) /* can we expect this call ? */ MNG_ERROR (pData, MNG_FUNCTIONINVALID) cleanup_errors (pData); /* cleanup previous errors */ if (pData->bRunning) /* was it running ? */ { /* are we expecting this call ? */ if ((pData->bTimerset) || (pData->bSuspended) || (pData->bSectionwait)) { pData->bTimerset = MNG_FALSE; /* reset the flags */ pData->bSectionwait = MNG_FALSE;#ifdef MNG_SUPPORT_READ if (pData->bReading) /* set during read&display ? */ { if (pData->bSuspended) /* calculate proper synchronization */ pData->iSynctime = pData->iSynctime - pData->iSuspendtime + pData->fGettickcount (hHandle); else pData->iSynctime = pData->fGettickcount (hHandle); pData->bSuspended = MNG_FALSE; /* now reset this flag */ /* and continue reading */ iRetcode = read_graphic (pData); if (pData->bEOF) /* already at EOF ? */ { pData->bReading = MNG_FALSE; /* then we're no longer reading */ /* drop invalidly stored objects */ drop_invalid_objects (pData); } } else#endif /* MNG_SUPPORT_READ */ { /* synchronize timing */ pData->iSynctime = pData->fGettickcount (hHandle); /* resume display processing */ iRetcode = process_display (pData); } } else { MNG_ERROR (pData, MNG_FUNCTIONINVALID) } } else { /* synchronize timing */ pData->iSynctime = pData->fGettickcount (hHandle); pData->bRunning = MNG_TRUE; /* it's restarted again ! */ /* resume display processing */ iRetcode = process_display (pData); } if (iRetcode) /* on error bail out */ return iRetcode; if (pData->bSuspended) /* read suspension ? */ { iRetcode = MNG_NEEDMOREDATA; pData->iSuspendtime = pData->fGettickcount ((mng_handle)pData); } else if (pData->bTimerset) /* indicate timer break ? */ iRetcode = MNG_NEEDTIMERWAIT; else if (pData->bSectionwait) /* indicate section break ? */ iRetcode = MNG_NEEDSECTIONWAIT; else { /* no breaks = end of run */ pData->bRunning = MNG_FALSE; if (pData->bFreezing) /* trying to freeze ? */ { /* then we're there ! */ pData->bFreezing = MNG_FALSE; } if (pData->bResetting) /* trying to reset as well ? */ { /* full stop!!! */ pData->bDisplaying = MNG_FALSE; iRetcode = mng_reset_rundata (pData); if (iRetcode) /* on error bail out */ return iRetcode; } } #ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_RESUME, MNG_LC_END)#endif return iRetcode;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_freeze (mng_handle hHandle){ mng_datap pData;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_FREEZE, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ /* can we expect this call ? */ if ((!pData->bDisplaying) || (pData->bReading)) MNG_ERROR (pData, MNG_FUNCTIONINVALID) cleanup_errors (pData); /* cleanup previous errors */ if (pData->bRunning) /* is it running ? */ { mng_retcode iRetcode; pData->bFreezing = MNG_TRUE; /* indicate we need to freeze */ /* continue "normal" processing */ iRetcode = mng_display_resume (hHandle); if (iRetcode) /* on error bail out */ return iRetcode; }#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_FREEZE, MNG_LC_END)#endif return MNG_NOERROR;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_reset (mng_handle hHandle){ mng_datap pData; mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_RESET, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ /* can we expect this call ? */ if ((!pData->bDisplaying) || (pData->bReading)) MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (!pData->bCacheplayback) /* must store playback info to work!! */ MNG_ERROR (pData, MNG_FUNCTIONINVALID) cleanup_errors (pData); /* cleanup previous errors */ if (pData->bRunning) /* is it running ? */ { pData->bFreezing = MNG_TRUE; /* indicate we need to freeze */ pData->bResetting = MNG_TRUE; /* indicate we're about to reset too */ /* continue normal processing ? */ iRetcode = mng_display_resume (hHandle); if (iRetcode) /* on error bail out */ return iRetcode; } else { /* full stop!!! */ pData->bDisplaying = MNG_FALSE; iRetcode = mng_reset_rundata (pData); if (iRetcode) /* on error bail out */ return iRetcode; }#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_RESET, MNG_LC_END)#endif return MNG_NOERROR;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_goframe (mng_handle hHandle, mng_uint32 iFramenr){ mng_datap pData; mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_GOFRAME, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ if (pData->eImagetype != mng_it_mng) /* is it an animation ? */ MNG_ERROR (pData, MNG_NOTANANIMATION); /* can we expect this call ? */ if ((!pData->bDisplaying) || (pData->bRunning)) MNG_ERROR ((mng_datap)hHandle, MNG_FUNCTIONINVALID) if (!pData->bCacheplayback) /* must store playback info to work!! */ MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (iFramenr > pData->iFramecount) /* is the parameter within bounds ? */ MNG_ERROR (pData, MNG_FRAMENRTOOHIGH); cleanup_errors (pData); /* cleanup previous errors */ pData->iRequestframe = iFramenr; /* go find the requested frame then */ iRetcode = process_display (pData); if (iRetcode) /* on error bail out */ return iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_GOFRAME, MNG_LC_END)#endif return MNG_NOERROR;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_golayer (mng_handle hHandle, mng_uint32 iLayernr){ mng_datap pData; mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_GOLAYER, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ if (pData->eImagetype != mng_it_mng) /* is it an animation ? */ MNG_ERROR (pData, MNG_NOTANANIMATION) /* can we expect this call ? */ if ((!pData->bDisplaying) || (pData->bRunning)) MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (!pData->bCacheplayback) /* must store playback info to work!! */ MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (iLayernr > pData->iLayercount) /* is the parameter within bounds ? */ MNG_ERROR (pData, MNG_LAYERNRTOOHIGH) cleanup_errors (pData); /* cleanup previous errors */ pData->iRequestlayer = iLayernr; /* go find the requested layer then */ iRetcode = process_display (pData); if (iRetcode) /* on error bail out */ return iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_GOLAYER, MNG_LC_END)#endif return MNG_NOERROR;}#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** */#ifdef MNG_SUPPORT_DISPLAYmng_retcode MNG_DECL mng_display_gotime (mng_handle hHandle, mng_uint32 iPlaytime){ mng_datap pData; mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_DISPLAY_GOTIME, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = ((mng_datap)hHandle); /* and make it addressable */ if (pData->eImagetype != mng_it_mng) /* is it an animation ? */ MNG_ERROR (pData, MNG_NOTANANIMATION) /* can we expect this call ? */ if ((!pData->bDisplaying) || (pData->bRunning)) MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (!pData->bCacheplayback) /* must store playback info to work!! */ MNG_ERROR (pData, MNG_FUNCTIONINVALID) if (iPlaytime > pData->iPlaytime) /* is the parameter within bounds ? */ MNG_ERROR (pData, MNG_PLAYTIMETOOHIGH) cleanup_errors (pData); /* cleanup previous errors */ pData->iRequesttime = iPlaytime; /* go find the requested playtime then */ iRetcode = process_displa
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -