//绘画时间标志 void CGameClientView::DrawTime(CDC * pDC,int nWidth,int nHeight) { CImageHandle HandleTime(&m_ImageTime); m_ImageTime.AlphaDrawImage(pDC,m_pTimeFlag.x,m_pTimeFlag.y,RGB(255,0,255)); CImageHandle HandleTime2(&m_ImageTime2); m_lTimeCount=m_lTimeCount<112?m_lTimeCount:112; for(BYTE i=0;i<m_lTimeCount;i++) m_ImageTime2.AlphaDrawImage(pDC,m_pTimeFlag.x+8*m_nXBorder-1+i,m_pTimeFlag.y,RGB(255,0,255)); }
void MorphAnimation::Update(float dt) { /*mTime += dt; if (mTime > mKeyFrames[mCurrentFrame].TimeSpan) { if (mCurrentFrame < mKeyFrames.size() - 2) { mCurrentFrame++; mTime = 0.0f; } else mTime = mKeyFrames[mCurrentFrame].TimeSpan; }*/ HandleTime(dt); mEffect->SetVariable("g_t", mTime / mKeyFrames[mCurrentFrame].TimeSpan); }
void MorphAnimation::Update(float dt) { HandleTime(dt); mEffect.SetVariable("t", mTime / mKeyFrames[mCurrentFrame].TimeSpan); }