forked from 0ad/0ad
Ykkrosh
d605cb39ec
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.
39 lines
668 B
C++
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();
|
|
}
|