示例#1
0
    void AddFlare(const Point& point, float duration)
    {
        m_list.PushFront();

        m_list.GetFront().m_point     = point;
        m_list.GetFront().m_time      = GetTime()->GetValue() + duration;
        m_list.GetFront().m_bRendered = false;
    }
示例#2
0
 bool OnMainTopic(const ZString& str)
 {
     if (m_listHistory.GetFront()   != str) {
         m_listHistory.PushFront(str);
         DoSetTopic();
     }
     return true;
 }
示例#3
0
    void AddExplosion(
        const Vector&                 position,
        const Vector&                 forward,
        const Vector&                 right,
        const Vector&                 dposition,
		float                         radiusExplosion,
        float                         radiusShockWave,
        const Color&                  color,
        int                           countDecals,
        TVector<TRef<AnimatedImage> > vpimage,
        Image*                        pimageShockwave
    ) {
        //
        // Add the shockwave
        //

		if (pimageShockwave != NULL) {
			m_listShockwave.PushFront();
			ShockwaveData& sdata = m_listShockwave.GetFront();

			sdata.m_timeStart       = GetTime()->GetValue();
			sdata.m_pimageShockwave = pimageShockwave;
			sdata.m_color           = color;
			sdata.m_position        = position;
			sdata.m_dposition       = dposition;
			sdata.m_scale           = radiusShockWave;
			sdata.m_forward         = forward;
			sdata.m_right           = right;
		}

        //
        // Add the little explosions
        //

        int countImage = vpimage.GetCount();
        int indexImage = 0;

        for (int index = 0; index < countDecals; index++) {
            ExplosionDataList& list  = m_vlistExplosion.Get(index);
            list.PushFront();
            ExplosionData&     edata = list.GetFront();

            edata.m_timeStart = GetTime()->GetValue() + index * 0.25f;
            edata.m_pimage    = vpimage[indexImage];
            edata.m_position  = position + Vector::RandomPosition(radiusExplosion * 0.5f);
            edata.m_dposition = dposition;
            edata.m_angle     = random(0, 2 * pi);
            edata.m_scale     = radiusExplosion;

            indexImage++;
            if (indexImage >= countImage) {
                indexImage = 0;
            }
        }
    }
示例#4
0
    void AddPoster(Image* pimage, const Vector& vec, float scale)
    {
        m_list.PushFront();

        m_list.GetFront().m_pimage   = pimage;
        m_list.GetFront().m_vec      = vec;
        m_list.GetFront().m_scale    = scale;

        m_list.GetFront().m_mat.SetScale(scale);
        m_list.GetFront().m_mat.LookAtFrom(Vector(0, 0, 0), vec * 400.0f, Vector(0, 1, 0));
    }
void Win32App::DebugOutput(const char *psz)
{
    #ifdef MemoryOutput
        g_listOutput.PushFront(ZString(psz));

        if (g_listOutput.GetCount() > 100) {
            g_listOutput.PopEnd();
        }
    #else
		// mmf for now tie this to a registry key
		if (g_outputdebugstring)
			::OutputDebugStringA(psz);

        if (g_logfile) {
            DWORD nBytes;
            ::WriteFile(g_logfile, psz, strlen(psz), &nBytes, NULL);
        }
    #endif
}
void CLobbyApp::BuildStaticCoreInfo()
{
	// build the master core list
	// then set coremask for each server
	// 1. get ride of the old list
	FreeStaticCoreInfo();
	// 2. loop thru unpaused servers and build a TList of StaticCoreInfo and the coremask
	ListConnections::Iterator iterCnxn(*GetFMServers().GetConnections());
	TList<StaticCoreInfo*,StaticCoreInfoEquals> CoreList;
	while (!iterCnxn.End())
	{
		CFLServer * pServerT = CFLServer::FromConnection(*iterCnxn.Value());
		if (pServerT) // skip lost/terminating server
		{
			pServerT->SetStaticCoreMask(0); // clear the core mask, not really needed here but it doesnt hurt
			int c = pServerT->GetcStaticCoreInfo();
			if (!pServerT->GetPaused()) // skip paused serveR
				for (int i=0; i<c; i++)
				{
					if (!CoreList.Find(&(pServerT->GetvStaticCoreInfo()[i])))
						CoreList.PushFront(&(pServerT->GetvStaticCoreInfo()[i]));
				}
		}
		iterCnxn.Next();
	}

	// 3. Allocate mem 
	m_cStaticCoreInfo = CoreList.GetCount();
	if (m_cStaticCoreInfo)
		m_vStaticCoreInfo =  new StaticCoreInfo[m_cStaticCoreInfo];
	else
		return; // no core, all done


    // 4. transform the TList into an array

	for (int i = 0; i < m_cStaticCoreInfo; i++)
		Strcpy(m_vStaticCoreInfo[i].cbIGCFile,CoreList[i]->cbIGCFile);
	CoreList.SetEmpty();

	// 5. loop thru unpaused servers and build the coremask
	ListConnections::Iterator iterCnxn2(*GetFMServers().GetConnections());
	while (!iterCnxn2.End())
	{
		CFLServer * pServerT = CFLServer::FromConnection(*iterCnxn2.Value());
		if (pServerT) // skip lost/terminating server
		{
			int c = pServerT->GetcStaticCoreInfo();
			pServerT->SetStaticCoreMask(0); // clear the core mask
			if (!pServerT->GetPaused()) // skip paused server
				for (int i=0; i<c; i++)
				{
					for (int j = 0; j < m_cStaticCoreInfo; j++)
						if (strcmp(pServerT->GetvStaticCoreInfo()[i].cbIGCFile,m_vStaticCoreInfo[j].cbIGCFile) == 0)
							pServerT->SetStaticCoreMask(pServerT->GetStaticCoreMask() | 1<<j);
						
				}
		}
		iterCnxn2.Next();
	}
}
示例#7
0
 void SetTopic(const ZString& str)
 {
     m_listHistory.SetEmpty();
     m_listHistory.PushFront(str);
     DoSetTopic();
 }