From c3a034a19bb1b9acfe04c5b02fa1d381b4dfa65b Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 23 Nov 2011 17:18:53 +0800 Subject: [PATCH] fixed #760: add functions to get/add m_pNotificationNode --- cocos2dx/include/CCDirector.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cocos2dx/include/CCDirector.h b/cocos2dx/include/CCDirector.h index b3219f68a5..02ea9d7ae0 100755 --- a/cocos2dx/include/CCDirector.h +++ b/cocos2dx/include/CCDirector.h @@ -35,6 +35,7 @@ THE SOFTWARE. #include "CCGeometry.h" #include "CCEGLView.h" #include "CCGL.h" +#include "CCNode.h" namespace cocos2d { @@ -137,7 +138,6 @@ typedef enum { class CCLabelTTF; class CCScene; class CCEGLView; -class CCNode; class CCProjectionProtocol; /** @@ -211,6 +211,19 @@ public: */ inline bool isSendCleanupToScene(void) { return m_bSendCleanupToScene; } + /** This object will be visited after the main scene is visited. + This object MUST implement the "visit" selector. + Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications) + @since v0.99.5 + */ + inline CCNode* getNotificationNode() { return m_pNotificationNode; } + inline void setNotificationNode(CCNode *node) + { + CC_SAFE_RELEASE(m_pNotificationNode); + m_pNotificationNode = node; + CC_SAFE_RETAIN(m_pNotificationNode); + } + // window size