This commit is contained in:
Ming 2010-09-02 02:33:39 +00:00
parent 28d54ab45a
commit 6a4af3bcfd
9 changed files with 42 additions and 39 deletions

View File

@ -50,7 +50,8 @@ THE SOFTWARE.
using namespace std; using namespace std;
using namespace cocos2d; using namespace cocos2d;
namespace cocos2d { namespace cocos2d
{
// singleton stuff // singleton stuff
static CCDisplayLinkDirector s_sharedDirector; static CCDisplayLinkDirector s_sharedDirector;
@ -799,4 +800,5 @@ void CCDisplayLinkDirector::setAnimationInterval(double dValue)
startAnimation(); startAnimation();
} }
} }
} //namespace cocos2d } //namespace cocos2d

View File

@ -45,7 +45,7 @@ CCCamera::~CCCamera(void)
char * CCCamera::description(void) char * CCCamera::description(void)
{ {
char *ret = new char[100]; char *ret = new char[100];
sprintf_s(ret, 100, "<CCCamera | center = (%.2f,%.2f,%.2f)>", m_fCenterX, m_fCenterY, m_fCenterZ); sprintf(ret, "<CCCamera | center = (%.2f,%.2f,%.2f)>", m_fCenterX, m_fCenterY, m_fCenterZ);
return ret; return ret;
} }

View File

@ -571,7 +571,7 @@ protected:
CCFiniteTimeAction *m_pOther; CCFiniteTimeAction *m_pOther;
}; };
class CCX_DLL CCTexture2D; class CCTexture2D;
/** Animates a sprite given the name of an Animation */ /** Animates a sprite given the name of an Animation */
class CCX_DLL CCAnimate : public CCIntervalAction class CCX_DLL CCAnimate : public CCIntervalAction
{ {

View File

@ -28,6 +28,7 @@ THE SOFTWARE.
#include "NSObject.h" #include "NSObject.h"
#include <vector> #include <vector>
#include <assert.h> #include <assert.h>
#include <stdarg.h>
namespace cocos2d { namespace cocos2d {
@ -54,7 +55,7 @@ public:
unsigned int count(void) unsigned int count(void)
{ {
unsigned int uCount = 0; unsigned int uCount = 0;
NSObjectArray::iterator it; NSMutableArrayIterator it;
for (it = m_array.begin(); it != m_array.end(); ++it) for (it = m_array.begin(); it != m_array.end(); ++it)
{ {
if (*it == NULL) if (*it == NULL)
@ -249,7 +250,7 @@ public:
{ {
if(pDeleteArray && pDeleteArray->count()) if(pDeleteArray && pDeleteArray->count())
{ {
NSObjectArray::iterator it; NSMutableArrayIterator it;
for( it = pDeleteArray->m_array.begin(); it != pDeleteArray->m_array.end(); it++) for( it = pDeleteArray->m_array.begin(); it != pDeleteArray->m_array.end(); it++)
{ {
removeObject(*it); removeObject(*it);

View File

@ -151,25 +151,25 @@ default gl blend src function. Compatible with premultiplied alpha images.
//---- todo: replace with uphone window //---- todo: replace with uphone window
/*
#define CC_DIRECTOR_INIT() \ // #define CC_DIRECTOR_INIT() \
do { \ // do { \
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; \ // window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; \
if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] ) \ // if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] ) \
[CCDirector setDirectorType:kCCDirectorTypeNSTimer]; \ // [CCDirector setDirectorType:kCCDirectorTypeNSTimer]; \
CCDirector *__director = [CCDirector sharedDirector]; \ // CCDirector *__director = [CCDirector sharedDirector]; \
[__director setDeviceOrientation:kCCDeviceOrientationPortrait]; \ // [__director setDeviceOrientation:kCCDeviceOrientationPortrait]; \
[__director setDisplayFPS:NO]; \ // [__director setDisplayFPS:NO]; \
[__director setAnimationInterval:1.0/60]; \ // [__director setAnimationInterval:1.0/60]; \
EAGLView *__glView = [EAGLView viewWithFrame:[window bounds] \ // EAGLView *__glView = [EAGLView viewWithFrame:[window bounds] \
pixelFormat:kEAGLColorFormatRGB565 \ // pixelFormat:kEAGLColorFormatRGB565 \
depthFormat:0 /* GL_DEPTH_COMPONENT24_OES \ // depthFormat:0 GL_DEPTH_COMPONENT24_OES \
preserveBackbuffer:NO]; \ // preserveBackbuffer:NO]; \
[__director setOpenGLView:__glView]; \ // [__director setOpenGLView:__glView]; \
[window addSubview:__glView]; \ // [window addSubview:__glView]; \
[window makeKeyAndVisible]; \ // [window makeKeyAndVisible]; \
} while(0) // } while(0)
*/
/** @def CC_DIRECTOR_END /** @def CC_DIRECTOR_END
Stops and removes the director from memory. Stops and removes the director from memory.
@ -180,15 +180,15 @@ do { \
//---- todo: replace with uphone window //---- todo: replace with uphone window
/*
#define CC_DIRECTOR_END() \ // #define CC_DIRECTOR_END() \
do { \ // do { \
CCDirector *__director = [CCDirector sharedDirector]; \ // CCDirector *__director = [CCDirector sharedDirector]; \
EAGLView *__view = [__director openGLView]; \ // EAGLView *__view = [__director openGLView]; \
[__view removeFromSuperview]; \ // [__view removeFromSuperview]; \
[__director end]; \ // [__director end]; \
} while(0) // } while(0)
*/
#ifndef FLT_EPSILON #ifndef FLT_EPSILON
#define FLT_EPSILON 1.192092896e-07F #define FLT_EPSILON 1.192092896e-07F

View File

@ -103,7 +103,7 @@ static inline void ccArrayEnsureExtraCapacity(ccArray *arr, unsigned int extra)
} }
/** Returns index of first occurence of object, UXNotFound if object not found. */ /** Returns index of first occurence of object, UXNotFound if object not found. */
static inline unsigned int ccArrayGetIndexOfObject(ccArray *arr, NSObject* object) static inline int ccArrayGetIndexOfObject(ccArray *arr, NSObject* object)
{ {
for ( unsigned int i = 0; i < arr->num; i++) for ( unsigned int i = 0; i < arr->num; i++)
{ {
@ -284,7 +284,7 @@ static inline void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra
} }
/** Returns index of first occurence of value, NSNotFound if value not found. */ /** Returns index of first occurence of value, NSNotFound if value not found. */
static inline unsigned int ccCArrayGetIndexOfValue(ccCArray *arr, void* value) static inline int ccCArrayGetIndexOfValue(ccCArray *arr, void* value)
{ {
for (unsigned int i = 0; i < arr->num; i++) for (unsigned int i = 0; i < arr->num; i++)
{ {