Move stuff out of arch using a registration system modeled after Screen.

This commit is contained in:
Steve Checkoway
2006-11-18 19:34:28 +00:00
parent 2202eb8547
commit 6365e3607f
21 changed files with 243 additions and 199 deletions
@@ -68,6 +68,18 @@ private:
int m_iInputsSinceUpdate;
};
typedef InputHandler *(*CreateInputHandlerFn)();
struct RegisterInputHandler
{
static map<istring, CreateInputHandlerFn> *g_pRegistrees;
RegisterInputHandler( const istring &sName, CreateInputHandlerFn pfn );
};
#define REGISTER_INPUT_HANDLER_CLASS2( name, x ) \
static InputHandler *Create##name() { return new x; } \
static RegisterInputHandler register_##className( #name, Create##name )
#define REGISTER_INPUT_HANDLER_CLASS( name ) REGISTER_INPUT_HANDLER_CLASS2( name, InputHandler_##name )
#endif
/*