mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 23:57:54 -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
|
||||
MxResult MxTickleManager::Tickle()
|
||||
{
|
||||
MxTime time = Timer()->GetTime();
|
||||
|
||||
MxTickleClientPtrList::iterator it = m_clients.begin();
|
||||
|
||||
while (it != m_clients.end()) {
|
||||
for (MxTickleClientPtrList::iterator it = m_clients.begin(); it != m_clients.end();) {
|
||||
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());
|
||||
|
||||
if ((client->GetTickleInterval() + client->GetLastUpdateTime()) < time) {
|
||||
client->GetClient()->Tickle();
|
||||
client->SetLastUpdateTime(time);
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
else {
|
||||
m_clients.erase(it++);
|
||||
delete client;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue