#if !defined(CTRL__Flow_inl__INCLUDED) #define CTRL__Flow_inl__INCLUDED #pragma once #if ENABLE_MSGTABLE_API /***************************************************************************\ ***************************************************************************** * * Global Functions * ***************************************************************************** \***************************************************************************/ //------------------------------------------------------------------------------ inline int Round(float f) { return (int) (f + 0.5); } //------------------------------------------------------------------------------ inline int Compute(Interpolation * pipol, float flProgress, int nStart, int nEnd) { float flResult = 0.0f; VerifyHR(pipol->Compute(flProgress, (float) nStart, (float) nEnd, &flResult)); return Round(flResult); } //------------------------------------------------------------------------------ inline float Compute(Interpolation * pipol, float flProgress, float flStart, float flEnd) { float flResult = 0.0f; VerifyHR(pipol->Compute(flProgress, flStart, flEnd, &flResult)); return flResult; } /***************************************************************************\ ***************************************************************************** * * class DuFlow * ***************************************************************************** \***************************************************************************/ //------------------------------------------------------------------------------ inline DuFlow::DuFlow() { m_cRef = 1; } //------------------------------------------------------------------------------ inline void DuFlow::AddRef() { ++m_cRef; } //------------------------------------------------------------------------------ inline void DuFlow::Release() { if (--m_cRef == 0) Delete(); } /***************************************************************************\ ***************************************************************************** * * class DuAlphaFlow * ***************************************************************************** \***************************************************************************/ //------------------------------------------------------------------------------ inline float DuAlphaFlow::BoxAlpha(float flAlpha) const { if (flAlpha < 0.0f) { return 0.0f; } else if (flAlpha > 1.0f) { return 1.0f; } else { return flAlpha; } } /***************************************************************************\ ***************************************************************************** * * class DuScaleFlow * ***************************************************************************** \***************************************************************************/ /***************************************************************************\ ***************************************************************************** * * class DuRectFlow * ***************************************************************************** \***************************************************************************/ /***************************************************************************\ ***************************************************************************** * * class DuRotateFlow * ***************************************************************************** \***************************************************************************/ //------------------------------------------------------------------------------ inline void DuRotateFlow::MarkDirty() { m_fDirty = TRUE; } #endif // ENABLE_MSGTABLE_API #endif // CTRL__Flow_inl__INCLUDED