mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 05:44:08 -07:00
Fixed Atlas project creation. Improved VS2005 linking speed. Added work-in-progress environment (water, sun) editing to Atlas. This was SVN commit r3935.
24 lines
575 B
C++
24 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)
|
|
|
|
}
|