This commit is contained in:
RongHong 2011-07-11 14:02:34 +08:00
commit 41049ec0be
7 changed files with 30 additions and 61 deletions

View File

@ -9,45 +9,6 @@
namespace cocos2d { namespace cocos2d {
enum {
/// If the window is resized, it won't be autoscaled
kCCDirectorResize_NoScale,
/// If the window is resized, it will be autoscaled (default behavior)
kCCDirectorResize_AutoScale,
};
/** @typedef tPixelFormat
Possible Pixel Formats for the CCEGLView
*/
typedef enum {
/** RGB565 pixel format. No alpha. 16-bit. (Default) */
kCCPixelFormatRGB565,
/** RGBA format. 32-bit. Needed for some 3D effects. It is not as fast as the RGB565 format. */
kCCPixelFormatRGBA8888,
/** default pixel format */
kCCPixelFormatDefault = kCCPixelFormatRGB565,
// backward compatibility stuff
kPixelFormatRGB565 = kCCPixelFormatRGB565,
kRGB565 = kCCPixelFormatRGB565,
kPixelFormatRGBA8888 = kCCPixelFormatRGBA8888,
kRGBA8 = kCCPixelFormatRGBA8888,
} tPixelFormat;
typedef enum {
/// A Depth Buffer of 0 bits will be used (default)
kCCDepthBufferNone,
/// A depth buffer of 16 bits will be used
kCCDepthBuffer16,
/// A depth buffer of 24 bits will be used
kCCDepthBuffer24,
// backward compatibility stuff
kDepthBuffer16 = kCCDepthBuffer16,
kDepthBuffer24 = kCCDepthBuffer24,
} tDepthBufferFormat;
typedef enum { typedef enum {
/// sets a 2D projection (orthogonal projection) /// sets a 2D projection (orthogonal projection)
kCCDirectorProjection2D, kCCDirectorProjection2D,
@ -123,6 +84,7 @@ namespace cocos2d {
bool isNextDeltaTimeZero(void); bool isNextDeltaTimeZero(void);
void setNextDeltaTimeZero(bool bNextDeltaTimeZero); void setNextDeltaTimeZero(bool bNextDeltaTimeZero);
bool isPaused(void); bool isPaused(void);
unsigned int getFrames(void);
ccDirectorProjection getProjection(void); ccDirectorProjection getProjection(void);
void setProjection(ccDirectorProjection kProjection); void setProjection(ccDirectorProjection kProjection);
bool isSendCleanupToScene(void); bool isSendCleanupToScene(void);
@ -169,17 +131,6 @@ namespace cocos2d {
static bool setDirectorType(ccDirectorType obDirectorType); static bool setDirectorType(ccDirectorType obDirectorType);
void setPixelFormat(tPixelFormat kPixelFormat);
/** Pixel format used to create the context */
tPixelFormat getPiexFormat(void);
void setDepthBufferFormat(tDepthBufferFormat kDepthBufferFormat);
bool detach(void);
static CCDirector* sharedDirector(void); static CCDirector* sharedDirector(void);
}; };

View File

@ -76,7 +76,8 @@ namespace cocos2d {
class CCColorLayer : public CCLayerColor class CCColorLayer : public CCLayerColor
{ {
static CCColorLayer * layerWithColorWidthHeight(ccColor4B color, GLfloat width, GLfloat height);
static CCColorLayer * layerWithColor(ccColor4B color);
}; };
class CCLayerGradient : public CCLayerColor class CCLayerGradient : public CCLayerColor
@ -108,19 +109,27 @@ namespace cocos2d {
void setVector(CCPoint Value); void setVector(CCPoint Value);
CCPoint getVector(void); CCPoint getVector(void);
void setIsCompressedInterpolation(bool Value);
bool getIsCompressedInterpolation(void);
}; };
class CCMultiplexLayer : public CCLayer class CCLayerMultiplex : public CCLayer
{ {
CCMultiplexLayer(); CCLayerMultiplex();
//static CCMultiplexLayer * layerWithLayers(CCLayer* layer, ... ); //static CCLayerMultiplex * layerWithLayers(CCLayer* layer, ... );
//lua instead with follow func //lua instead with follow func
static CCMultiplexLayer * layerWithLayer(CCLayer* layer); static CCLayerMultiplex * layerWithLayer(CCLayer* layer);
void addLayer(CCLayer* layer); void addLayer(CCLayer* layer);
bool initWithLayer(CCLayer* layer); bool initWithLayer(CCLayer* layer);
bool initWithLayers(CCLayer* layer, va_list params); bool initWithLayers(CCLayer* layer, va_list params);
void switchTo(unsigned int n); void switchTo(unsigned int n);
void switchToAndReleaseMe(unsigned int n); void switchToAndReleaseMe(unsigned int n);
}; };
class CCMultiplexLayer : public CCLayerMultiplex
{
};
}//namespace cocos2d }//namespace cocos2d

View File

@ -34,6 +34,7 @@ namespace cocos2d{
CCMenuItemLabel(); CCMenuItemLabel();
static CCMenuItemLabel * itemWithLabel(CCNode*label, SelectorProtocol* target, SEL_MenuHandler selector); static CCMenuItemLabel * itemWithLabel(CCNode*label, SelectorProtocol* target, SEL_MenuHandler selector);
static CCMenuItemLabel* itemWithLabel(CCNode *label);
bool initWithLabel(CCNode* label, SelectorProtocol* target, SEL_MenuHandler selector); bool initWithLabel(CCNode* label, SelectorProtocol* target, SEL_MenuHandler selector);

View File

@ -21,7 +21,7 @@ class CCMotionStreak : public CCNode, public CCTextureProtocol
CCMotionStreak(); CCMotionStreak();
static CCMotionStreak * streakWithFade(float fade, float seg, const char *imagePath, float width, float length, ccColor4B color); static CCMotionStreak * streakWithFade(float fade, float seg, const char *imagePath, float width, float length, ccColor4B color);
bool initWithFade(float fade, float seg, const char *imagePath, float width, float length, ccColor4B color); bool initWithFade(float fade, float seg, const char *imagePath, float width, float length, ccColor4B color);
void updateMotion(ccTime delta); void update(ccTime delta);
}; };
} // namespace cocos2d } // namespace cocos2d

View File

@ -12,13 +12,18 @@ class CCNode : public CCObject, public SelectorProtocol
void setRotation(float newRotation); void setRotation(float newRotation);
float getScale(); float getScale();
void setScale(float scale); void setScale(float scale);
void setScale(float scale);
float getScaleX(); float getScaleX();
void setScaleX(float newScaleX); void setScaleX(float newScaleX);
float getScaleY(); float getScaleY();
void setScaleY(float newScaleY); void setScaleY(float newScaleY);
CCPoint getPosition(); CCPoint getPosition();
void setPosition(CCPoint newPosition); void setPosition(CCPoint newPosition);
float getSkewX();
void setSkewX(float skewX);
float getSkewY();
void setSkewY(float skewY);
CCMutableArray<CCNode*> * getChildren(); CCMutableArray<CCNode*> * getChildren();
CCCamera* getCamera(); CCCamera* getCamera();
CCGridBase* getGrid(); CCGridBase* getGrid();
@ -65,7 +70,7 @@ class CCNode : public CCObject, public SelectorProtocol
CCAction* getActionByTag(int tag); CCAction* getActionByTag(int tag);
char * description(void); char * description(void);
CCNode* getChildByTag(int tag); CCNode* getChildByTag(int tag);
int numberOfRunningActions(void); unsigned int numberOfRunningActions(void);
//bool isScheduled(SEL_SCHEDULE selector); //bool isScheduled(SEL_SCHEDULE selector);
void scheduleUpdate(void); void scheduleUpdate(void);
void scheduleUpdateWithPriority(int priority); void scheduleUpdateWithPriority(int priority);

View File

@ -10,8 +10,8 @@ namespace cocos2d {
CCParallaxNode(); CCParallaxNode();
~CCParallaxNode(); ~CCParallaxNode();
static CCParallaxNode * node(); static CCParallaxNode * node();
void addChild(CCNode * child, int z, CCPoint parallaxRatio, CCPoint positionOffset); void addChild(CCNode * child, unsigned int z, CCPoint parallaxRatio, CCPoint positionOffset);
void addChild(CCNode * child, int zOrder, int tag); void addChild(CCNode * child, unsigned int zOrder, int tag);
void removeChild(CCNode* child, bool cleanup); void removeChild(CCNode* child, bool cleanup);
void removeAllChildrenWithCleanup(bool cleanup); void removeAllChildrenWithCleanup(bool cleanup);
void visit(void); void visit(void);

View File

@ -59,9 +59,12 @@ float ccpAngle(const CCPoint& a, const CCPoint& b);
CCPoint ccpRotateByAngle(const CCPoint& v, const CCPoint& pivot, float angle); CCPoint ccpRotateByAngle(const CCPoint& v, const CCPoint& pivot, float angle);
bool ccpLineIntersect(const CCPoint& p1, const CCPoint& p2, const CCPoint& p3, const CCPoint& p4, float *s, float *t); bool ccpLineIntersect(const CCPoint& p1, const CCPoint& p2, const CCPoint& p3, const CCPoint& p4, float *s, float *t);
bool ccpSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
CCPoint ccpIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D);
}//namespace cocos2d }//namespace cocos2d