本文整理汇总了C++中TList::PushFront方法的典型用法代码示例。如果您正苦于以下问题:C++ TList::PushFront方法的具体用法?C++ TList::PushFront怎么用?C++ TList::PushFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TList
的用法示例。
在下文中一共展示了TList::PushFront方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddFlare
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: OnMainTopic
bool OnMainTopic(const ZString& str)
{
if (m_listHistory.GetFront() != str) {
m_listHistory.PushFront(str);
DoSetTopic();
}
return true;
}
示例3: AddExplosion
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: AddPoster
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));
}
示例5: strlen
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
}
示例6: BuildStaticCoreInfo
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: SetTopic
void SetTopic(const ZString& str)
{
m_listHistory.SetEmpty();
m_listHistory.PushFront(str);
DoSetTopic();
}