mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-26 09:38:14 -05:00
Improve MxTickleManager::Tickle code gneeration
This commit is contained in:
parent
d23b4db2ff
commit
84056c6ea2
1 changed files with 11 additions and 12 deletions
|
@ -29,30 +29,29 @@ MxTickleManager::~MxTickleManager()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Match.
|
|
||||||
// FUNCTION: LEGO1 0x100bdde0
|
// FUNCTION: LEGO1 0x100bdde0
|
||||||
MxResult MxTickleManager::Tickle()
|
MxResult MxTickleManager::Tickle()
|
||||||
{
|
{
|
||||||
MxTime time = Timer()->GetTime();
|
MxTime time = Timer()->GetTime();
|
||||||
|
|
||||||
MxTickleClientPtrList::iterator it = m_clients.begin();
|
for (MxTickleClientPtrList::iterator it = m_clients.begin(); it != m_clients.end();) {
|
||||||
|
|
||||||
while (it != m_clients.end()) {
|
|
||||||
MxTickleClient* client = *it;
|
MxTickleClient* client = *it;
|
||||||
if ((client->GetFlags() & TICKLE_MANAGER_FLAG_DESTROY) == 0) {
|
|
||||||
if (client->GetLastUpdateTime() >= time)
|
// TODO: Match.
|
||||||
|
if ((MxU8) client->GetFlags() & TICKLE_MANAGER_FLAG_DESTROY) {
|
||||||
|
m_clients.erase(it++);
|
||||||
|
delete client;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
it++;
|
||||||
|
|
||||||
|
if (client->GetLastUpdateTime() > time)
|
||||||
client->SetLastUpdateTime(-client->GetTickleInterval());
|
client->SetLastUpdateTime(-client->GetTickleInterval());
|
||||||
|
|
||||||
if ((client->GetTickleInterval() + client->GetLastUpdateTime()) < time) {
|
if ((client->GetTickleInterval() + client->GetLastUpdateTime()) < time) {
|
||||||
client->GetClient()->Tickle();
|
client->GetClient()->Tickle();
|
||||||
client->SetLastUpdateTime(time);
|
client->SetLastUpdateTime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
it++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
m_clients.erase(it++);
|
|
||||||
delete client;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue