From 924017afdd9ad3580ccca2832ba11869de672fec Mon Sep 17 00:00:00 2001 From: Ming Date: Tue, 6 Jul 2010 12:40:11 +0000 Subject: [PATCH] issue #6 --- cocos2dx/CCConfiguration.cpp | 6 +- cocos2dx/CCConfiguration.h | 4 +- cocos2dx/CCDrawingPrimitives.h | 2 +- cocos2dx/cocoa/NSAutoreleasePool.cpp | 9 ++- cocos2dx/cocoa/NSAutoreleasePool.h | 10 +-- cocos2dx/cocos2dx.vcproj | 96 +++++++++++++++------------- cocos2dx/include/CCCamera.h | 2 +- 7 files changed, 66 insertions(+), 63 deletions(-) diff --git a/cocos2dx/CCConfiguration.cpp b/cocos2dx/CCConfiguration.cpp index 23d57f46a8..d811807707 100644 --- a/cocos2dx/CCConfiguration.cpp +++ b/cocos2dx/CCConfiguration.cpp @@ -60,12 +60,12 @@ CCConfiguration* CCConfiguration::sharedConfiguration(void) BOOL CCConfiguration::checkForGLExtension(const string &searchName) { BOOL ret = FALSE; - const char *pszSearchName = searchName.c_str(); + const char *kSearchName = searchName.c_str(); - if (strstr(g_pGlExtensions, pszSearchName)) + if (strstr(g_pGlExtensions, kSearchName)) ret = TRUE; - delete pszSearchName; + delete kSearchName; return ret; } diff --git a/cocos2dx/CCConfiguration.h b/cocos2dx/CCConfiguration.h index 7b63484555..d27369503d 100644 --- a/cocos2dx/CCConfiguration.h +++ b/cocos2dx/CCConfiguration.h @@ -23,8 +23,8 @@ THE SOFTWARE. #ifndef __CCCONFIGURATION_H__ #define __CCCONFIGURATION_H__ -#include "include/Cocos2dTypes.h" -#include "include/NSObject.h" +#include "Cocos2dTypes.h" +#include "Cocoa/NSObject.h" #include #include diff --git a/cocos2dx/CCDrawingPrimitives.h b/cocos2dx/CCDrawingPrimitives.h index 277f67912a..d03de8bf91 100644 --- a/cocos2dx/CCDrawingPrimitives.h +++ b/cocos2dx/CCDrawingPrimitives.h @@ -42,7 +42,7 @@ extern "C" { @warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. */ -#include "CGGeometry.h" // for CGPoint +#include "Cocoa/CGGeometry.h" // for CGPoint #include "Cocos2dTypes.h" /** draws a point given x and y coordinate */ diff --git a/cocos2dx/cocoa/NSAutoreleasePool.cpp b/cocos2dx/cocoa/NSAutoreleasePool.cpp index 3f4b3c5287..373d4731ba 100644 --- a/cocos2dx/cocoa/NSAutoreleasePool.cpp +++ b/cocos2dx/cocoa/NSAutoreleasePool.cpp @@ -21,21 +21,19 @@ THE SOFTWARE. ****************************************************************************/ #include "NSAutoReleasePool.h" -using namespace std: NSAutoreleasePool::NSAutoreleasePool(void) { - m_managedObjectArray = vector(); } void NSAutoreleasePool::addObject(NSObject *pObject) { - m_managedObjectArray.push_back(pObject); + } void NSAutoreleasePool::removeObject(NSObject *pObject) { - m_managedObjectArray.po + } @@ -46,8 +44,9 @@ NSPoolManager* NSPoolManager::getInstance(void) { static BOOL bInit = FALSE; - if (bInit == FLASE) + if (bInit == FALSE) { + bInit = TRUE; m_pPoolManager = new NSPoolManager(); } diff --git a/cocos2dx/cocoa/NSAutoreleasePool.h b/cocos2dx/cocoa/NSAutoreleasePool.h index 3f4526ecc6..d5a8970381 100644 --- a/cocos2dx/cocoa/NSAutoreleasePool.h +++ b/cocos2dx/cocoa/NSAutoreleasePool.h @@ -24,7 +24,6 @@ THE SOFTWARE. #define __NS_AUTO_RELEASE_POOL_H__ #include "NSObject.h" -#include class NSAutoreleasePool : public NSObject { @@ -36,15 +35,12 @@ public: void clear(void); private: - std::vector m_managedObjectArray; + //todo: add mutable array }; class NSPoolManager { public: - - ~NSPoolManager(); - void finalize(void); void push(void); void pop(void); @@ -56,10 +52,10 @@ public: static NSPoolManager* getInstance(); private: - NSPoolManager(); + NSPoolManager() {}; private: static NSPoolManager *m_pPoolManager; -} +}; #endif //__NS_AUTO_RELEASE_POOL_H__ diff --git a/cocos2dx/cocos2dx.vcproj b/cocos2dx/cocos2dx.vcproj index 9f37eac10c..1521edae11 100644 --- a/cocos2dx/cocos2dx.vcproj +++ b/cocos2dx/cocos2dx.vcproj @@ -207,14 +207,6 @@ RelativePath=".\include\ccConfig.h" > - - - - @@ -227,10 +219,6 @@ RelativePath=".\include\ccTypes.h" > - - @@ -243,38 +231,6 @@ RelativePath=".\glu.h" > - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2dx/include/CCCamera.h b/cocos2dx/include/CCCamera.h index c33089049b..1df6866f87 100644 --- a/cocos2dx/include/CCCamera.h +++ b/cocos2dx/include/CCCamera.h @@ -23,7 +23,7 @@ THE SOFTWARE. #ifndef __CCCAMERA_H__ #define __CCCAMERA_H__ -#include "NSObject.h" +#include "Cocoa/NSObject.h" #include "ccMacros.h" #include