mirror of https://github.com/axmolengine/axmol.git
issue #6
This commit is contained in:
parent
afffd75d0e
commit
924017afdd
|
@ -60,12 +60,12 @@ CCConfiguration* CCConfiguration::sharedConfiguration(void)
|
||||||
BOOL CCConfiguration::checkForGLExtension(const string &searchName)
|
BOOL CCConfiguration::checkForGLExtension(const string &searchName)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE;
|
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;
|
ret = TRUE;
|
||||||
|
|
||||||
delete pszSearchName;
|
delete kSearchName;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,8 @@ THE SOFTWARE.
|
||||||
#ifndef __CCCONFIGURATION_H__
|
#ifndef __CCCONFIGURATION_H__
|
||||||
#define __CCCONFIGURATION_H__
|
#define __CCCONFIGURATION_H__
|
||||||
|
|
||||||
#include "include/Cocos2dTypes.h"
|
#include "Cocos2dTypes.h"
|
||||||
#include "include/NSObject.h"
|
#include "Cocoa/NSObject.h"
|
||||||
#include <GLES/gl.h>
|
#include <GLES/gl.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
@ -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.
|
@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"
|
#include "Cocos2dTypes.h"
|
||||||
|
|
||||||
/** draws a point given x and y coordinate */
|
/** draws a point given x and y coordinate */
|
||||||
|
|
|
@ -21,21 +21,19 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "NSAutoReleasePool.h"
|
#include "NSAutoReleasePool.h"
|
||||||
using namespace std:
|
|
||||||
|
|
||||||
NSAutoreleasePool::NSAutoreleasePool(void)
|
NSAutoreleasePool::NSAutoreleasePool(void)
|
||||||
{
|
{
|
||||||
m_managedObjectArray = vector<NSObject *>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NSAutoreleasePool::addObject(NSObject *pObject)
|
void NSAutoreleasePool::addObject(NSObject *pObject)
|
||||||
{
|
{
|
||||||
m_managedObjectArray.push_back(pObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NSAutoreleasePool::removeObject(NSObject *pObject)
|
void NSAutoreleasePool::removeObject(NSObject *pObject)
|
||||||
{
|
{
|
||||||
m_managedObjectArray.po
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,8 +44,9 @@ NSPoolManager* NSPoolManager::getInstance(void)
|
||||||
{
|
{
|
||||||
static BOOL bInit = FALSE;
|
static BOOL bInit = FALSE;
|
||||||
|
|
||||||
if (bInit == FLASE)
|
if (bInit == FALSE)
|
||||||
{
|
{
|
||||||
|
bInit = TRUE;
|
||||||
m_pPoolManager = new NSPoolManager();
|
m_pPoolManager = new NSPoolManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ THE SOFTWARE.
|
||||||
#define __NS_AUTO_RELEASE_POOL_H__
|
#define __NS_AUTO_RELEASE_POOL_H__
|
||||||
|
|
||||||
#include "NSObject.h"
|
#include "NSObject.h"
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
class NSAutoreleasePool : public NSObject
|
class NSAutoreleasePool : public NSObject
|
||||||
{
|
{
|
||||||
|
@ -36,15 +35,12 @@ public:
|
||||||
|
|
||||||
void clear(void);
|
void clear(void);
|
||||||
private:
|
private:
|
||||||
std::vector<NSObject *> m_managedObjectArray;
|
//todo: add mutable array
|
||||||
};
|
};
|
||||||
|
|
||||||
class NSPoolManager
|
class NSPoolManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
~NSPoolManager();
|
|
||||||
|
|
||||||
void finalize(void);
|
void finalize(void);
|
||||||
void push(void);
|
void push(void);
|
||||||
void pop(void);
|
void pop(void);
|
||||||
|
@ -56,10 +52,10 @@ public:
|
||||||
static NSPoolManager* getInstance();
|
static NSPoolManager* getInstance();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NSPoolManager();
|
NSPoolManager() {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static NSPoolManager *m_pPoolManager;
|
static NSPoolManager *m_pPoolManager;
|
||||||
}
|
};
|
||||||
|
|
||||||
#endif //__NS_AUTO_RELEASE_POOL_H__
|
#endif //__NS_AUTO_RELEASE_POOL_H__
|
||||||
|
|
|
@ -207,14 +207,6 @@
|
||||||
RelativePath=".\include\ccConfig.h"
|
RelativePath=".\include\ccConfig.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\include\CCConfiguration.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\CCDrawingPrimitives.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\ccMacros.h"
|
RelativePath=".\include\ccMacros.h"
|
||||||
>
|
>
|
||||||
|
@ -227,10 +219,6 @@
|
||||||
RelativePath=".\include\ccTypes.h"
|
RelativePath=".\include\ccTypes.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\include\CGGeometry.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\cocos2d.h"
|
RelativePath=".\include\cocos2d.h"
|
||||||
>
|
>
|
||||||
|
@ -243,38 +231,6 @@
|
||||||
RelativePath=".\glu.h"
|
RelativePath=".\glu.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSArray.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSAutoreleasePool.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSData.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSLock.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSObject.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSSet.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSString.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\include\NSZone.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Makefiles"
|
Name="Makefiles"
|
||||||
|
@ -344,38 +300,82 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="cocoa"
|
Name="cocoa"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\CGGeometry.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSArray.cpp"
|
RelativePath=".\cocoa\NSArray.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSArray.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSAutoreleasePool.cpp"
|
RelativePath=".\cocoa\NSAutoreleasePool.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSAutoreleasePool.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSData.cpp"
|
RelativePath=".\cocoa\NSData.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSData.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSLock.cpp"
|
RelativePath=".\cocoa\NSLock.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSLock.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSMutableArray.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSMutableArray.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSObject.cpp"
|
RelativePath=".\cocoa\NSObject.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSObject.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSSet.cpp"
|
RelativePath=".\cocoa\NSSet.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSSet.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSString.cpp"
|
RelativePath=".\cocoa\NSString.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSString.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocoa\NSZone.cpp"
|
RelativePath=".\cocoa\NSZone.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\cocoa\NSZone.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\CCamera.cpp"
|
RelativePath=".\CCamera.cpp"
|
||||||
|
@ -385,10 +385,18 @@
|
||||||
RelativePath=".\CCConfiguration.cpp"
|
RelativePath=".\CCConfiguration.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ccconfiguration.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\CCDrawingPrimitives.cpp"
|
RelativePath=".\CCDrawingPrimitives.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CCDrawingPrimitives.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\cocos2d.cpp"
|
RelativePath=".\cocos2d.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||||
#ifndef __CCCAMERA_H__
|
#ifndef __CCCAMERA_H__
|
||||||
#define __CCCAMERA_H__
|
#define __CCCAMERA_H__
|
||||||
|
|
||||||
#include "NSObject.h"
|
#include "Cocoa/NSObject.h"
|
||||||
#include "ccMacros.h"
|
#include "ccMacros.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue