Example #1
0
// this is now recursive, so watch what you're doing...
//
void CSequence::_Init(bool bGenLoopFrame, bool bIsGLA, LPCTSTR path, int startFrame, int targetFrame, int frameCount, int frameSpeed, int frameSpeedFromHeader, CComment* comments)
{
	static bool bHere = false;	

	m_path = NULL;
	m_next = NULL;
	m_name = NULL;
	m_fill = -1;	
	// another Jake thing, not sure if this'll stay in when valid StarWars enums are available
#if 0
	m_enum = "";//NULL;
#else
	m_enum = path;
	if (!m_enum.IsEmpty())
	{
		Filename_BaseOnly(m_enum);
		m_enum.MakeUpper();
	}
#endif
	m_sound = NULL;
	m_action = NULL;
	m_comments = comments;	
	m_validEnum = false;
	m_loopFrame = -1;
	m_bIsGLA = bIsGLA;
	m_bGenLoopFrame = bGenLoopFrame;

	SetPath(path);
	SetStartFrame(startFrame);
	SetTargetFrame(targetFrame);
	SetFrameCount(frameCount);
	SetFrameSpeed(frameSpeed);	
	SetFrameSpeedFromHeader(frameSpeedFromHeader);

	if (bHere)
	{
		for (int i=0; i<MAX_ADDITIONAL_SEQUENCES; i++)
		{
			AdditionalSeqs[i] = NULL;
		}
	}
	else
	{
		bHere = true;

		for (int i=0; i<MAX_ADDITIONAL_SEQUENCES; i++)
		{
			AdditionalSeqs[i] = new CSequence();
			AdditionalSeqs[i]->_Init(false, false,NULL, 0, 0, 0, iDEFAULTSEQFRAMESPEED, iDEFAULTSEQFRAMESPEED, NULL);
		}

		bHere = false;
	}
}
Example #2
0
void CSequence::ReadHeader()
{
	int iStartFrame, iFrameCount, iFrameSpeed;

	CString nameASE = ((CAssimilateApp*)AfxGetApp())->GetQuakeDir();
			nameASE+= GetPath();	

	ReadASEHeader( nameASE, iStartFrame, iFrameCount, iFrameSpeed);

	SetStartFrame( iStartFrame );
	SetFrameCount( iFrameCount );
	SetFrameSpeed( iFrameSpeed );	// iDEFAULTSEQFRAMESPEED
	SetFrameSpeedFromHeader( iFrameSpeed );	
}
Example #3
0
///////////////////////////////////////////////
//  CONSTRUCTOR / DECONSTRUCT / OP OVERLOADS
///////////////////////////////////////////////
CAnimation::CAnimation(int nImageID,int nImageWidth,int nImageHeight, int nFrameWidth,
				int nFrameHeight,int nFrames,int nCurrent,float fTimePerFrame,bool bLooping,bool bStatic)
{
	SetImageID(nImageID);
	SetImageWidth(nImageWidth);
	SetImageHeight(nImageHeight);
	SetFrameWidth(nFrameWidth);
	SetFrameHeight(nFrameHeight);
	// Because framecount starts at 0
	SetFrameCount(nFrames - 1);
	SetCurrentFrame(nCurrent);
	SetLooping(bLooping);
	SetStatic(bStatic);
	SetTimePerFrame(fTimePerFrame);
	SetTimeWaited(0.0f);
}
Example #4
0
void UIDirect3D9Window::SetRefreshRate(double Rate, int ModeIndex)
{
    if (m_timer && qFuzzyCompare(Rate + 1.0f, m_refreshRate + 1.0f))
        return;

    m_refreshRate = Rate;
    if (ModeIndex > -1)
        SwitchToMode(ModeIndex); // NB this will also update m_refreshRate

    LOG(VB_GENERAL, LOG_INFO, QString("Setting display rate to %1 (interval %2us)")
        .arg(m_refreshRate).arg(1000000.0f / m_refreshRate));

    SetFrameCount(5000.0 / m_refreshRate);

    if (m_timer)
        m_timer->SetInterval(1000000.0f / m_refreshRate);
    else
        m_timer = new UITimer(1000000.0f / m_refreshRate);
}