1
0
forked from 0ad/0ad
0ad/source/tools/atlas/AtlasUI/General/AtlasEventLoop.cpp
Ykkrosh d605cb39ec # Atlas editor: Control over 'random' actor variations.
Actor variation selection (though not saved to maps, so not very
useful).
Added more levels of complexity to the waiting-for-game-to-respond
message pump, to fix reentrancy problems.
Use number keys to assign player to selected unit.

This was SVN commit r3913.
2006-05-31 05:27:02 +00:00

39 lines
668 B
C++

#include "stdafx.h"
#include "AtlasEventLoop.h"
AtlasEventLoop::AtlasEventLoop()
: m_NeedsPaint(false)
{
}
void AtlasEventLoop::AddMessage(MSG* msg)
{
m_Messages.push_back(msg);
}
void AtlasEventLoop::NeedsPaint()
{
m_NeedsPaint = true;
}
bool AtlasEventLoop::Dispatch()
{
// Process the messages that QueryCallback collected
for (size_t i = 0; i < m_Messages.size(); ++i)
{
MSG* pMsg = m_Messages[i];
wxEventLoop::GetActive()->ProcessMessage(pMsg);
delete pMsg;
}
m_Messages.clear();
if (m_NeedsPaint && wxTheApp && wxTheApp->GetTopWindow())
{
wxTheApp->GetTopWindow()->Refresh();
m_NeedsPaint = false;
}
return wxEventLoop::Dispatch();
}