Ykkrosh
92b9c07f95
Greek basket texture # New Greek vases # housekeeping documentation fix: trailing / in directory names is mandatory # Atlas: Sky texture selection; save with maps Atlas code tidying: Slightly nicer syntax for defining command handlers, and some explanation of how it works Automated build. This was SVN commit r4008.
25 lines
574 B
C++
25 lines
574 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)
|
|
|
|
}
|