From 101f076a44c8e083f4ff6f9bffcde062fdd6f293 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 25 Nov 2011 10:13:59 +0800 Subject: [PATCH 1/2] fixed #760: implement functions in .cpp --- cocos2dx/CCDirector.cpp | 12 ++++++++++++ cocos2dx/include/CCDirector.h | 12 +++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 3ec93fe1ce..1cd5485a91 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -835,6 +835,18 @@ void CCDirector::setContentScaleFactor(CGFloat scaleFactor) } } +CCNode* getNotificationNode() +{ + return m_pNotificationNode; +} + +void setNotificationNode(CCNode *node) +{ + CC_SAFE_RELEASE(m_pNotificationNode); + m_pNotificationNode = node; + CC_SAFE_RETAIN(m_pNotificationNode); +} + void CCDirector::applyOrientation(void) { CCSize s = m_obWinSizeInPixels; diff --git a/cocos2dx/include/CCDirector.h b/cocos2dx/include/CCDirector.h index 02ea9d7ae0..94cd10ef3d 100755 --- a/cocos2dx/include/CCDirector.h +++ b/cocos2dx/include/CCDirector.h @@ -35,7 +35,6 @@ THE SOFTWARE. #include "CCGeometry.h" #include "CCEGLView.h" #include "CCGL.h" -#include "CCNode.h" namespace cocos2d { @@ -139,6 +138,7 @@ class CCLabelTTF; class CCScene; class CCEGLView; class CCProjectionProtocol; +class CCNode; /** @brief Class that creates and handle the main Window and manages how @@ -216,14 +216,8 @@ public: 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); - } - + CCNode* getNotificationNode(); + void setNotificationNode(CCNode *node); // window size From c034f84b2d1415027af99e5afc16cfec765db2ab Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 25 Nov 2011 10:17:32 +0800 Subject: [PATCH 2/2] fixed #760: implement functions in .cpp --- cocos2dx/CCDirector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 1cd5485a91..cd1566716d 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -835,12 +835,12 @@ void CCDirector::setContentScaleFactor(CGFloat scaleFactor) } } -CCNode* getNotificationNode() +CCNode* CCDirector::getNotificationNode() { return m_pNotificationNode; } -void setNotificationNode(CCNode *node) +void CCDirector::setNotificationNode(CCNode *node) { CC_SAFE_RELEASE(m_pNotificationNode); m_pNotificationNode = node;