Example #1
0
void DUtilCamera::SendCallBack( dword dwMsg )
{
	m_CallBackMsgPrev = dwMsg;
	if( m_CallBack )
	{
		m_CallBack( dwMsg );
	}
}
void DCameraPathFollower::SendCallBack( dword dwMsg )
{
	m_CallBackMsgPrev = dwMsg;
	if( m_CallBack )
	{
		m_CallBack( dwMsg );
	}
}
Example #3
0
//更新时间
void BufferSchedule::Update(float time)
{
    
    m_TotalTime -= time;
    m_CbIntervalSurplusTime -= time;
    m_UpdateTextSurplusTime -= time;
    if (m_UpdateTextSurplusTime <= 0)
    {
        m_UpdateTextSurplusTime =  m_UpdateTextIntervalTime;
        if (m_TimeText != nullptr)
        {
            m_TotalTime = m_TotalTime < 0 ? 0 : m_TotalTime;
            m_TimeText->setString(StringUtils::format("%.1f", m_TotalTime));
        }
    }
    
    if (m_CbIntervalSurplusTime <= 0)
    {
        if(m_CallBack != nullptr) m_CallBack();
        m_CbIntervalSurplusTime = m_CbIntervalTime;
    }
    
    if (m_TotalTime <= 0)
    {
        m_LayoutBuffer->unschedule(m_ScheduleName);
        if (m_DelOrHidelLayoutBuffer)
        {
            if (m_LayoutBuffer->getParent())
            {
                m_LayoutBuffer->removeFromParent();
            }
        }else
        {
            m_LayoutBuffer->setVisible(false);
        }
        
        delete this;
    }
}
Example #4
0
void EventCallBack::DoWork()
{
    assert(NULL != m_CallBack);
    m_CallBack(m_wParam,m_lParam);
    delete this;		//必须自我释放,这个一定要通过new ,后面把构造函数变成私有,只要另外一个友元函数访问
}
void CTraceCollector::OnIncomingData(const char* pStr, DWORD nSize)
{
    CAutoCriticalSection cas(m_CriticalSectionData);
    if (m_CallBack)
        m_CallBack(pStr, nSize);
}