summaryrefslogtreecommitdiffstats
path: root/tools/worldbuilder/code/main/pluginMain.h
blob: 3645a0d5df8b10eb6541ce99ab812ad746073b15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//----------------------------------------
// MACROS
//----------------------------------------

#define REGISTER_COMMAND( p, c ) if ( ! ( ( p ).registerCommand( c##::stringId, \
                                                                 c##::creator ) \
                                        ) \
                                    ) return MS::kFailure

#define REGISTER_CONTEXT( p, c ) if ( ! ( ( p ).registerContextCommand( c##::stringId, \
                                                                        c##Cmd::creator ) \
                                        ) \
                                    ) return MS::kFailure


#define REGISTER_LOCATOR( p, n ) if ( ! ( ( p ).registerNode( n##::stringId, \
                                                              n##::id, \
                                                              n##::creator, \
                                                              n##::initialize, \
                                                              MPxNode::kLocatorNode ) \
                                      ) \
                                 ) return MS::kFailure

#define REGISTER_NODE( p, n ) if ( ! ( ( p ).registerNode( n##::stringId, \
                                                           n##::id, \
                                                           n##::creator, \
                                                           n##::initialize ) \
                                      ) \
                                 ) return MS::kFailure

#define DEREGISTER_COMMAND( p, c ) ( p ).deregisterCommand( c##::stringId )

#define DEREGISTER_CONTEXT( p, c ) ( p ).deregisterContextCommand( c##::stringId )

//#define DEREGISTER_NODE( p, n ) n##::Unload();\
//                               ( p ).deregisterNode( n##::id )

#define DEREGISTER_NODE( p, n ) ( p ).deregisterNode( n##::id )