forked from mirrors/0ad
54c1508db6
Fixed Atlas project creation. Improved VS2005 linking speed. Added work-in-progress environment (water, sun) editing to Atlas. This was SVN commit r3935.
25 lines
575 B
C++
25 lines
575 B
C++
#include "../Messages.h"
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
namespace AtlasMessage
|
|
{
|
|
|
|
typedef void (*msgHandler)(IMessage*);
|
|
typedef std::map<std::string, msgHandler> msgHandlers;
|
|
extern msgHandlers& GetMsgHandlers();
|
|
|
|
#define THINGHANDLER(prefix, expectedtype, t) \
|
|
void f##t(prefix##t*); \
|
|
void f##t##__wrapper(IMessage* msg) { \
|
|
debug_assert(msg->GetType() == IMessage::expectedtype); \
|
|
f##t (static_cast<prefix##t*>(msg)); \
|
|
} \
|
|
void f##t(prefix##t* msg)
|
|
|
|
#define MESSAGEHANDLER(t) THINGHANDLER(m, Message, t)
|
|
#define QUERYHANDLER(t) THINGHANDLER(q, Query, t)
|
|
|
|
}
|