From 1c0240b5de2561704899508e555e2b88d852ffce Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 22 Oct 2012 13:48:11 +0800 Subject: [PATCH 01/23] fixed #1493: Added doxygen comments in CCNotificationCenter.h --- cocos2dx/support/CCNotificationCenter.cpp | 4 +- cocos2dx/support/CCNotificationCenter.h | 54 ++++++++++++++++++++--- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/cocos2dx/support/CCNotificationCenter.cpp b/cocos2dx/support/CCNotificationCenter.cpp index 2fe860a129..0a9e63974e 100644 --- a/cocos2dx/support/CCNotificationCenter.cpp +++ b/cocos2dx/support/CCNotificationCenter.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. using namespace std; -NS_CC_BEGIN; +NS_CC_BEGIN static CCNotificationCenter *s_sharedNotifCenter = NULL; @@ -214,4 +214,4 @@ CCObject *CCNotificationObserver::getObject() return m_object; } -NS_CC_END; +NS_CC_END diff --git a/cocos2dx/support/CCNotificationCenter.h b/cocos2dx/support/CCNotificationCenter.h index 183c5f7020..df0cd49cb5 100644 --- a/cocos2dx/support/CCNotificationCenter.h +++ b/cocos2dx/support/CCNotificationCenter.h @@ -28,38 +28,71 @@ THE SOFTWARE. #include "cocoa/CCObject.h" #include "cocoa/CCArray.h" -NS_CC_BEGIN; +NS_CC_BEGIN class CC_DLL CCNotificationCenter : public CCObject { public: + /* CCNotificationCenter constructor */ CCNotificationCenter(); + + /* CCNotificationCenter destructor */ ~CCNotificationCenter(); + /* Get the single instance of CCNotificationCenter. */ static CCNotificationCenter *sharedNotificationCenter(void); + + /* Destroy the single instance of CCNotificationCenter. */ static void purgeNotificationCenter(void); + /* @brief Add an observer for the specified target. + * @param target The target which want to be observed. + * @param selector The callback function which will be invoked when the specified notification event was posted. + * @param name The name of notification. + * @param obj The extra parameter which will be passed to the callback function. + */ void addObserver(CCObject *target, SEL_CallFuncO selector, const char *name, CCObject *obj); - + + /* @brief Remove the observer for the specified target. + * @param target The target which will not be observed any more. + * @param name The notification name which will not be observed any more. + */ void removeObserver(CCObject *target,const char *name); + /* @brief Register one hander for script binding. + * @note Only support Lua Binding now. + * @param handler The lua handler. + */ void registerScriptObserver(int handler); + + /* Unregister script observer */ void unregisterScriptObserver(void); + /* brief Post one notification event by name. + * param name The name of this notification. + */ void postNotification(const char *name); + + /* brief Post one notification event by name. + * param name The name of this notification. + * param object The extra parameter. + */ void postNotification(const char *name, CCObject *object); + /* brief Get script handler. + * note Only support Lua Binding now. + * return The script handle. + */ inline int getScriptHandler() { return m_scriptHandler; }; private: - // // internal functions - // + + // Check whether the observer exists by the specified target and name. bool observerExisted(CCObject *target,const char *name); - // // variables // CCArray *m_observers; @@ -69,12 +102,21 @@ private: class CC_DLL CCNotificationObserver : public CCObject { public: + /* brief Observer constructor + * @param target The target which want to be observed. + * @param selector The callback function which will be invoked when the specified notification event was posted. + * @param name The name of notification. + * @param obj The extra parameter which will be passed to the callback function. + */ CCNotificationObserver(CCObject *target, SEL_CallFuncO selector, const char *name, CCObject *obj); + + /* Observer destructor function */ ~CCNotificationObserver(); + /* Invoke the callback function of this observer */ void performSelector(CCObject *obj); private: CC_PROPERTY_READONLY(CCObject *, m_target, Target); @@ -83,6 +125,6 @@ private: CC_PROPERTY_READONLY(CCObject *, m_object, Object); }; -NS_CC_END; +NS_CC_END #endif//__CCNOTIFICATIONCENTER_H__ \ No newline at end of file From 6f4e56cd923c36828db15693b18b8e8c0c7c721c Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 22 Oct 2012 15:49:33 +0800 Subject: [PATCH 02/23] fixed #1493: Corrected some comments for CCNotificationCenter. --- cocos2dx/support/CCNotificationCenter.h | 62 ++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/cocos2dx/support/CCNotificationCenter.h b/cocos2dx/support/CCNotificationCenter.h index df0cd49cb5..c3aaea43ec 100644 --- a/cocos2dx/support/CCNotificationCenter.h +++ b/cocos2dx/support/CCNotificationCenter.h @@ -33,58 +33,58 @@ NS_CC_BEGIN class CC_DLL CCNotificationCenter : public CCObject { public: - /* CCNotificationCenter constructor */ + /** CCNotificationCenter constructor */ CCNotificationCenter(); - /* CCNotificationCenter destructor */ + /** CCNotificationCenter destructor */ ~CCNotificationCenter(); - /* Get the single instance of CCNotificationCenter. */ + /** Gets the single instance of CCNotificationCenter. */ static CCNotificationCenter *sharedNotificationCenter(void); - /* Destroy the single instance of CCNotificationCenter. */ + /** Destroys the single instance of CCNotificationCenter. */ static void purgeNotificationCenter(void); - /* @brief Add an observer for the specified target. - * @param target The target which want to be observed. - * @param selector The callback function which will be invoked when the specified notification event was posted. - * @param name The name of notification. - * @param obj The extra parameter which will be passed to the callback function. + /** @brief Adds an observer for the specified target. + * @param target The target which wants to observe notification events. + * @param selector The callback function which will be invoked when the specified notification event was posted. + * @param name The name of notification. + * @param obj The extra parameter which will be passed to the callback function. */ void addObserver(CCObject *target, SEL_CallFuncO selector, const char *name, CCObject *obj); - /* @brief Remove the observer for the specified target. - * @param target The target which will not be observed any more. - * @param name The notification name which will not be observed any more. + /** @brief Removes the observer by the specified target and name. + * @param target The target of this notification. + * @param name The name of this notification. */ void removeObserver(CCObject *target,const char *name); - /* @brief Register one hander for script binding. - * @note Only support Lua Binding now. - * @param handler The lua handler. + /** @brief Registers one hander for script binding. + * @note Only support Lua Binding now. + * @param handler The lua handler. */ void registerScriptObserver(int handler); - /* Unregister script observer */ + /** Unregisters script observer */ void unregisterScriptObserver(void); - /* brief Post one notification event by name. - * param name The name of this notification. + /** @brief Posts one notification event by name. + * @param name The name of this notification. */ void postNotification(const char *name); - /* brief Post one notification event by name. - * param name The name of this notification. - * param object The extra parameter. + /** @brief Posts one notification event by name. + * @param name The name of this notification. + * @param object The extra parameter. */ void postNotification(const char *name, CCObject *object); - /* brief Get script handler. - * note Only support Lua Binding now. - * return The script handle. + /** @brief Gets script handler. + * @note Only support Lua Binding now. + * @return The script handle. */ inline int getScriptHandler() { return m_scriptHandler; }; private: @@ -102,21 +102,21 @@ private: class CC_DLL CCNotificationObserver : public CCObject { public: - /* brief Observer constructor - * @param target The target which want to be observed. - * @param selector The callback function which will be invoked when the specified notification event was posted. - * @param name The name of notification. - * @param obj The extra parameter which will be passed to the callback function. + /** @brief CCNotificationObserver constructor + * @param target The target which wants to observer notification events. + * @param selector The callback function which will be invoked when the specified notification event was posted. + * @param name The name of this notification. + * @param obj The extra parameter which will be passed to the callback function. */ CCNotificationObserver(CCObject *target, SEL_CallFuncO selector, const char *name, CCObject *obj); - /* Observer destructor function */ + /** CCNotificationObserver destructor function */ ~CCNotificationObserver(); - /* Invoke the callback function of this observer */ + /** Invokes the callback function of this observer */ void performSelector(CCObject *obj); private: CC_PROPERTY_READONLY(CCObject *, m_target, Target); From 7af2f7c5ce2f7d4c037a07b55646acdfccd37abf Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 22 Oct 2012 15:51:06 +0800 Subject: [PATCH 03/23] fixed #1493: Updated one comment. --- cocos2dx/support/CCNotificationCenter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/support/CCNotificationCenter.h b/cocos2dx/support/CCNotificationCenter.h index c3aaea43ec..4dd28f471d 100644 --- a/cocos2dx/support/CCNotificationCenter.h +++ b/cocos2dx/support/CCNotificationCenter.h @@ -48,7 +48,7 @@ public: /** @brief Adds an observer for the specified target. * @param target The target which wants to observe notification events. * @param selector The callback function which will be invoked when the specified notification event was posted. - * @param name The name of notification. + * @param name The name of this notification. * @param obj The extra parameter which will be passed to the callback function. */ void addObserver(CCObject *target, From 56cdb7686756edeeb05d38a2210d1470f97f672e Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 22 Oct 2012 15:52:11 +0800 Subject: [PATCH 04/23] fixed #1493: Updated one comment. --- cocos2dx/support/CCNotificationCenter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/support/CCNotificationCenter.h b/cocos2dx/support/CCNotificationCenter.h index 4dd28f471d..4d7201fcb9 100644 --- a/cocos2dx/support/CCNotificationCenter.h +++ b/cocos2dx/support/CCNotificationCenter.h @@ -63,7 +63,7 @@ public: void removeObserver(CCObject *target,const char *name); /** @brief Registers one hander for script binding. - * @note Only support Lua Binding now. + * @note Only supports Lua Binding now. * @param handler The lua handler. */ void registerScriptObserver(int handler); @@ -83,7 +83,7 @@ public: void postNotification(const char *name, CCObject *object); /** @brief Gets script handler. - * @note Only support Lua Binding now. + * @note Only supports Lua Binding now. * @return The script handle. */ inline int getScriptHandler() { return m_scriptHandler; }; From f4f63fd824a0d373534070877ba87e97375108dd Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 23 Oct 2012 10:50:47 +0800 Subject: [PATCH 05/23] fixed #1520: Added comments for using multiresolution in HelloCpp. --- cocos2dx/CCDirector.cpp | 33 +++++------- cocos2dx/CCDirector.h | 6 --- cocos2dx/platform/CCEGLViewProtocol.cpp | 5 +- cocos2dx/platform/CCEGLViewProtocol.h | 19 +++---- samples/HelloCpp/Classes/AppDelegate.cpp | 43 +++++++++------- samples/HelloCpp/Classes/AppMacros.h | 54 +++++++++++++++----- samples/HelloCpp/Classes/HelloWorldScene.cpp | 2 +- samples/HelloCpp/proj.win32/HelloCpp.vcproj | 4 ++ 8 files changed, 94 insertions(+), 72 deletions(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 80c9a6f60b..638111a0b5 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -131,7 +131,7 @@ bool CCDirector::init(void) // purge ? m_bPurgeDirecotorInNextLoop = false; - m_obWinSizeInPixels = m_obWinSizeInPoints = CCSizeZero; + m_obWinSizeInPoints = CCSizeZero; m_pobOpenGLView = NULL; @@ -301,8 +301,7 @@ void CCDirector::setOpenGLView(CCEGLView *pobOpenGLView) m_pobOpenGLView = pobOpenGLView; // set size - m_obWinSizeInPoints = m_pobOpenGLView->getSize(); - m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); + m_obWinSizeInPoints = m_pobOpenGLView->getDesignResolutionSize(); createStatsLabel(); @@ -454,7 +453,7 @@ CCSize CCDirector::getWinSize(void) CCSize CCDirector::getWinSizeInPixels() { - return m_obWinSizeInPixels; + return CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); } CCSize CCDirector::getVisibleSize() @@ -481,20 +480,6 @@ CCPoint CCDirector::getVisibleOrigin() } } -void CCDirector::reshapeProjection(const CCSize& newWindowSize) -{ - CC_UNUSED_PARAM(newWindowSize); - if (m_pobOpenGLView) - { - m_obWinSizeInPoints = m_pobOpenGLView->getSize(); - m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, - m_obWinSizeInPoints.height * m_fContentScaleFactor); - - setProjection(m_eProjection); - } - -} - // scene management void CCDirector::runWithScene(CCScene *pScene) @@ -775,7 +760,16 @@ void CCDirector::createStatsLabel() m_pDrawsLabel = new CCLabelAtlas(); m_pDrawsLabel->initWithString("000", "fps_images.png", 12, 32, '.'); */ - int fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24); + int fontSize = 0; + if (m_obWinSizeInPoints.width > m_obWinSizeInPoints.height) + { + fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24); + } + else + { + fontSize = (int)(m_obWinSizeInPoints.width / 320.0f * 24); + } + m_pFPSLabel = CCLabelTTF::create("00.0", "Arial", fontSize); m_pFPSLabel->retain(); m_pSPFLabel = CCLabelTTF::create("0.000", "Arial", fontSize); @@ -809,6 +803,7 @@ void CCDirector::setContentScaleFactor(float scaleFactor) if (scaleFactor != m_fContentScaleFactor) { m_fContentScaleFactor = scaleFactor; + createStatsLabel(); } } diff --git a/cocos2dx/CCDirector.h b/cocos2dx/CCDirector.h index 7b02fcb59b..1005003c77 100644 --- a/cocos2dx/CCDirector.h +++ b/cocos2dx/CCDirector.h @@ -180,9 +180,6 @@ public: */ CCPoint getVisibleOrigin(); - /** changes the projection size */ - void reshapeProjection(const CCSize& newWindowSize); - /** converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touches coordinates to the current layout (portrait or landscape) */ @@ -389,9 +386,6 @@ protected: /* window size in points */ CCSize m_obWinSizeInPoints; - - /* window size in pixels */ - CCSize m_obWinSizeInPixels; /* content scale factor */ float m_fContentScaleFactor; diff --git a/cocos2dx/platform/CCEGLViewProtocol.cpp b/cocos2dx/platform/CCEGLViewProtocol.cpp index d1e8d90772..3a1a25266a 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.cpp +++ b/cocos2dx/platform/CCEGLViewProtocol.cpp @@ -88,13 +88,12 @@ void CCEGLViewProtocol::setDesignResolutionSize(float width, float height, Resol m_eResolutionPolicy = resolutionPolicy; // reset director's member variables to fit visible rect - CCDirector::sharedDirector()->m_obWinSizeInPoints = getSize(); - CCDirector::sharedDirector()->m_obWinSizeInPixels = CCSizeMake(m_obDesignResolutionSize.width*CC_CONTENT_SCALE_FACTOR(), m_obDesignResolutionSize.height*CC_CONTENT_SCALE_FACTOR()); + CCDirector::sharedDirector()->m_obWinSizeInPoints = getDesignResolutionSize(); CCDirector::sharedDirector()->createStatsLabel(); CCDirector::sharedDirector()->setGLDefaultValues(); } -const CCSize& CCEGLViewProtocol::getSize() const +const CCSize& CCEGLViewProtocol::getDesignResolutionSize() const { return m_obDesignResolutionSize; } diff --git a/cocos2dx/platform/CCEGLViewProtocol.h b/cocos2dx/platform/CCEGLViewProtocol.h index 0c710241c2..f76aa5161d 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.h +++ b/cocos2dx/platform/CCEGLViewProtocol.h @@ -48,13 +48,6 @@ public: /** Open or close IME keyboard , subclass must implement this method. */ virtual void setIMEKeyboardState(bool bOpen) = 0; - /** - * Get design resolution size. - * If setDesignResolutionSize wasn't invoked, the result of this function return is the same as 'getFrameSize' - */ - - virtual const CCSize& getSize() const; - /** * Get the frame size of EGL view. * In general, it returns the screen size since the EGL view is a fullscreen view. @@ -78,16 +71,20 @@ public: /** * Set the design resolution size. - * Behavior undefined when enableRetina == true. * @param width Design resolution width. * @param height Design resolution height. * @param resolutionPolicy The resolution policy desired, you may choose: - * [1] kCCResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. - * [2] kCCResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. - * [3] kCCResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown. + * [1] kResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. + * [2] kResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. + * [3] kResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown. */ virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy); + /** Get design resolution size. + * If setDesignResolutionSize wasn't invoked, the result of this function return is the same as 'getFrameSize' + */ + virtual const CCSize& getDesignResolutionSize() const; + /** Set touch delegate */ virtual void setTouchDelegate(EGLTouchDelegate * pDelegate); diff --git a/samples/HelloCpp/Classes/AppDelegate.cpp b/samples/HelloCpp/Classes/AppDelegate.cpp index 84e2527106..c3b597c085 100644 --- a/samples/HelloCpp/Classes/AppDelegate.cpp +++ b/samples/HelloCpp/Classes/AppDelegate.cpp @@ -14,30 +14,37 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { // initialize director - CCDirector *pDirector = CCDirector::sharedDirector(); + CCDirector* pDirector = CCDirector::sharedDirector(); + CCEGLView* pEGLView = CCEGLView::sharedOpenGLView(); - pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - //pDirector->setProjection(kCCDirectorProjection2D); - CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); - - if (screenSize.height > 768) - { - CCFileUtils::sharedFileUtils()->setResourceDirectory("ipadhd"); - pDirector->setContentScaleFactor(1536.0f/kDesignResolutionSize_height); + pDirector->setOpenGLView(pEGLView); + + // Set the design resolution + pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder); + + CCSize frameSize = pEGLView->getFrameSize(); + // if the frame size is larger than medium resource size, select large resource. + if (frameSize.height > mediumResource.size.height) + { + CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory); + // The contentScaleFactor is set by the ratio of resource's height and design resolution's height when your game is in landscape. + // Oppositely, if your game is in portrait, it need to be set by width. + // This can make sure your game's status is in full screen. + pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height); } - else if (screenSize.height > 320) - { - CCFileUtils::sharedFileUtils()->setResourceDirectory("ipad"); - pDirector->setContentScaleFactor(768.0f/kDesignResolutionSize_height); + // if the frame size is larger than small resource size, select medium resource. + else if (frameSize.height > smallResource.size.height) + { + CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory); + pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height); } + // if the frame size is smaller than medium resource size, select small resource. else - { - CCFileUtils::sharedFileUtils()->setResourceDirectory("iphone"); - pDirector->setContentScaleFactor(320.0f/kDesignResolutionSize_height); + { + CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory); + pDirector->setContentScaleFactor(smallResource.size.height/designResolutionSize.height); } - CCEGLView::sharedOpenGLView()->setDesignResolutionSize(kDesignResolutionSize_width, kDesignResolutionSize_height, kResolutionNoBorder); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/samples/HelloCpp/Classes/AppMacros.h b/samples/HelloCpp/Classes/AppMacros.h index 355f25a76f..b9ca794821 100644 --- a/samples/HelloCpp/Classes/AppMacros.h +++ b/samples/HelloCpp/Classes/AppMacros.h @@ -1,30 +1,56 @@ #ifndef __APPMACROS_H__ #define __APPMACROS_H__ +#include "cocos2d.h" -#define kDesignResolution_480x320 0 -#define kDesignResolution_1024x768 1 -#define kDesignResolution_2048x1536 2 +/* For demonstrating using one design resolution to match different resources, + or one resource to match different design resolutions. -#define kTargetDesignResolutionSize kDesignResolution_2048x1536 + [Situation 1] Using the same design resolution to match different resources. + Please look into Appdelegate::applicationDidFinishLaunching. + We check current device frame size to decide which resource need to be selected. + So if you want to test this situation which said in title '[Situation 1]', + you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina), + or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform + and modify "proj.mac/AppController.mm" by changing the window rectangle. -#if (kTargetDesignResolutionSize == kDesignResolution_480x320) -#define kDesignResolutionSize_width 480.0f -#define kDesignResolutionSize_height 320.0f + [Situation 2] Using the same resource to match different design resolutions. + The coordinates in your codes is based on your current design resolution rather than resource size. + Therefore, your design resolution could be very large and your resource could be small. + To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' + and open iphone simulator or create a window of 480x320 size. + [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources. + */ -#elif (kTargetDesignResolutionSize == kDesignResolution_1024x768) -#define kDesignResolutionSize_width 1024.0f -#define kDesignResolutionSize_height 768.0f +#define DESIGN_RESOLUTION_480X320 0 +#define DESIGN_RESOLUTION_1024X768 1 +#define DESIGN_RESOLUTION_2048X1536 2 -#elif (kTargetDesignResolutionSize == kDesignResolution_2048x1536) -#define kDesignResolutionSize_width 2048.0f -#define kDesignResolutionSize_height 1536.0f +/* If you want to switch design resolution, change next line */ +#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_2048X1536 +typedef struct tagResource +{ + cocos2d::CCSize size; + char directory[100]; +}Resource; + +static Resource smallResource = { cocos2d::CCSizeMake(480, 320), "iphone" }; +static Resource mediumResource = { cocos2d::CCSizeMake(1024, 768), "ipad" }; +static Resource largeResource = { cocos2d::CCSizeMake(2048, 1536), "ipadhd" }; + +#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320) +static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(480, 320); +#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768) +static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(1024, 768); +#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536) +static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(2048, 1536); #else #error unknown target design resolution! #endif -#define kTitleFontSize (kDesignResolutionSize_width / 480.0f * 24) +// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution +#define TITLE_FONT_SIZE (cocos2d::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24) #endif /* __APPMACROS_H__ */ diff --git a/samples/HelloCpp/Classes/HelloWorldScene.cpp b/samples/HelloCpp/Classes/HelloWorldScene.cpp index 20f7bc6767..94c515a196 100644 --- a/samples/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/HelloCpp/Classes/HelloWorldScene.cpp @@ -56,7 +56,7 @@ bool HelloWorld::init() // add a label shows "Hello World" // create and initialize a label - CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", kTitleFontSize); + CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE); // position the label on the center of the screen pLabel->setPosition(ccp(origin.x + visibleSize.width/2, diff --git a/samples/HelloCpp/proj.win32/HelloCpp.vcproj b/samples/HelloCpp/proj.win32/HelloCpp.vcproj index 3d9326ae5f..f854468dc9 100644 --- a/samples/HelloCpp/proj.win32/HelloCpp.vcproj +++ b/samples/HelloCpp/proj.win32/HelloCpp.vcproj @@ -190,6 +190,10 @@ RelativePath="..\Classes\AppDelegate.h" > + + From b3db7e91f89f0c0048bf689fc7b3b2a40c7e2323 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 23 Oct 2012 14:01:48 +0800 Subject: [PATCH 06/23] fixed #1520: Updated some comments. --- cocos2dx/platform/CCEGLViewProtocol.h | 2 +- samples/HelloCpp/Classes/AppDelegate.cpp | 15 +++++++++------ samples/HelloCpp/Classes/AppMacros.h | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cocos2dx/platform/CCEGLViewProtocol.h b/cocos2dx/platform/CCEGLViewProtocol.h index f76aa5161d..9cc1c65334 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.h +++ b/cocos2dx/platform/CCEGLViewProtocol.h @@ -81,7 +81,7 @@ public: virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy); /** Get design resolution size. - * If setDesignResolutionSize wasn't invoked, the result of this function return is the same as 'getFrameSize' + * Default resolution size is the same as 'getFrameSize'. */ virtual const CCSize& getDesignResolutionSize() const; diff --git a/samples/HelloCpp/Classes/AppDelegate.cpp b/samples/HelloCpp/Classes/AppDelegate.cpp index c3b597c085..86fb4632aa 100644 --- a/samples/HelloCpp/Classes/AppDelegate.cpp +++ b/samples/HelloCpp/Classes/AppDelegate.cpp @@ -23,22 +23,25 @@ bool AppDelegate::applicationDidFinishLaunching() { pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder); CCSize frameSize = pEGLView->getFrameSize(); - // if the frame size is larger than medium resource size, select large resource. + + // In this demo, we select resource according to the frame's height. + // If the resource size is different from design resolution size, you need to set contentScaleFactor. + // We use the ratio of resource's height to design resolution's height, + // this can make sure that the resource's height could fit for the height of design resolution. + + // if the frame's height is larger than the height of medium resource size, select large resource. if (frameSize.height > mediumResource.size.height) { CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory); - // The contentScaleFactor is set by the ratio of resource's height and design resolution's height when your game is in landscape. - // Oppositely, if your game is in portrait, it need to be set by width. - // This can make sure your game's status is in full screen. pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height); } - // if the frame size is larger than small resource size, select medium resource. + // if the frame's height is larger than the height of small resource size, select medium resource. else if (frameSize.height > smallResource.size.height) { CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory); pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height); } - // if the frame size is smaller than medium resource size, select small resource. + // if the frame's height is smaller than the height of medium resource size, select small resource. else { CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory); diff --git a/samples/HelloCpp/Classes/AppMacros.h b/samples/HelloCpp/Classes/AppMacros.h index b9ca794821..7223673b50 100644 --- a/samples/HelloCpp/Classes/AppMacros.h +++ b/samples/HelloCpp/Classes/AppMacros.h @@ -6,7 +6,7 @@ /* For demonstrating using one design resolution to match different resources, or one resource to match different design resolutions. - [Situation 1] Using the same design resolution to match different resources. + [Situation 1] Using one design resolution to match different resources. Please look into Appdelegate::applicationDidFinishLaunching. We check current device frame size to decide which resource need to be selected. So if you want to test this situation which said in title '[Situation 1]', @@ -14,9 +14,9 @@ or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform and modify "proj.mac/AppController.mm" by changing the window rectangle. - [Situation 2] Using the same resource to match different design resolutions. + [Situation 2] Using one resource to match different design resolutions. The coordinates in your codes is based on your current design resolution rather than resource size. - Therefore, your design resolution could be very large and your resource could be small. + Therefore, your design resolution could be very large and your resource size could be small. To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536' and open iphone simulator or create a window of 480x320 size. From b383704ebc9d02feeb5751f311ae4ef9750b39db Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 23 Oct 2012 14:04:35 +0800 Subject: [PATCH 07/23] fixed #1520: Updated one comment in HelloCpp. --- samples/HelloCpp/Classes/AppDelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/HelloCpp/Classes/AppDelegate.cpp b/samples/HelloCpp/Classes/AppDelegate.cpp index 86fb4632aa..329b962fee 100644 --- a/samples/HelloCpp/Classes/AppDelegate.cpp +++ b/samples/HelloCpp/Classes/AppDelegate.cpp @@ -26,7 +26,7 @@ bool AppDelegate::applicationDidFinishLaunching() { // In this demo, we select resource according to the frame's height. // If the resource size is different from design resolution size, you need to set contentScaleFactor. - // We use the ratio of resource's height to design resolution's height, + // We use the ratio of resource's height to the height of design resolution, // this can make sure that the resource's height could fit for the height of design resolution. // if the frame's height is larger than the height of medium resource size, select large resource. From 62f7b25df237046b6ee070a1563c2335c9f4f2c6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 23 Oct 2012 17:48:50 +0800 Subject: [PATCH 08/23] issue #1521: Using relative coordinates in TestCpp. --- samples/TestCpp/Android.mk | 3 +- .../AccelerometerTest/AccelerometerTest.cpp | 10 +- .../ActionManagerTest/ActionManagerTest.cpp | 37 +++-- .../ActionsEaseTest/ActionsEaseTest.cpp | 72 +++------- .../ActionsProgressTest.cpp | 22 +-- .../Classes/ActionsTest/ActionsTest.cpp | 126 +++++++++--------- samples/TestCpp/Classes/AppDelegate.cpp | 18 +-- .../TestCpp/Classes/Box2DTest/Box2dTest.cpp | 23 ++-- .../Classes/Box2DTestBed/Box2dView.cpp | 6 +- samples/TestCpp/Classes/BugsTest/BugsTest.cpp | 2 +- .../ChipmunkAccelTouchTest.cpp | 26 ++-- .../ClickAndMoveTest/ClickAndMoveTest.cpp | 6 +- .../CocosDenshionTest/CocosDenshionTest.cpp | 12 +- samples/TestCpp/Classes/CurlTest/CurlTest.cpp | 5 +- .../CurrentLanguageTest.cpp | 5 +- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 16 +-- .../EffectsAdvancedTest.cpp | 21 ++- .../Classes/EffectsTest/EffectsTest.cpp | 26 ++-- .../ControlExtensionTest/CCControlScene.cpp | 19 ++- .../NetworkTest/HttpClientTest.cpp | 2 +- .../NotificationCenterTest.cpp | 2 +- .../TableViewTest/TableViewTestScene.cpp | 2 +- samples/TestCpp/Classes/FontTest/FontTest.cpp | 7 +- .../Classes/IntervalTest/IntervalTest.cpp | 18 +-- .../TestCpp/Classes/LabelTest/LabelTest.cpp | 19 ++- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 18 +-- samples/TestCpp/Classes/MenuTest/MenuTest.cpp | 24 ++-- .../MotionStreakTest/MotionStreakTest.cpp | 12 +- samples/TestCpp/Classes/NodeTest/NodeTest.cpp | 70 +++++----- .../Classes/ParallaxTest/ParallaxTest.cpp | 6 +- .../Classes/ParticleTest/ParticleTest.cpp | 40 +++--- .../PerformanceTest/PerformanceTest.cpp | 8 +- .../RenderTextureTest/RenderTextureTest.cpp | 8 +- .../RotateWorldTest/RotateWorldTest.cpp | 16 +-- .../TestCpp/Classes/SceneTest/SceneTest.cpp | 6 +- .../Classes/SchedulerTest/SchedulerTest.cpp | 22 ++- .../TestCpp/Classes/ShaderTest/ShaderTest.cpp | 6 +- .../SpriteTest/SpriteTest.cpp.REMOVED.git-id | 2 +- .../Classes/TextInputTest/TextInputTest.cpp | 6 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 6 +- .../TextureCacheTest/TextureCacheTest.cpp | 36 ++--- .../Classes/TileMapTest/TileMapTest.cpp | 6 +- samples/TestCpp/Classes/TouchesTest/Ball.cpp | 15 +-- .../TestCpp/Classes/TouchesTest/Paddle.cpp | 2 +- .../Classes/TouchesTest/TouchesTest.cpp | 20 ++- .../TestCpp/Classes/TouchesTest/TouchesTest.h | 1 - .../TransitionsTest/TransitionsTest.cpp | 24 ++-- samples/TestCpp/Classes/VisibleRect.cpp | 73 ++++++++++ samples/TestCpp/Classes/VisibleRect.h | 26 ++++ .../Classes/ZwoptexTest/ZwoptexTest.cpp | 6 +- samples/TestCpp/Classes/controller.cpp | 13 +- samples/TestCpp/Classes/testBasic.cpp | 4 +- samples/TestCpp/Classes/testBasic.h | 1 + samples/TestCpp/proj.linux/Makefile | 1 + samples/TestCpp/proj.win32/TestCpp.vcproj | 8 ++ samples/TestCpp/proj.win32/TestCpp.vcxproj | 2 + .../proj.win32/TestCpp.vcxproj.filters | 6 + 57 files changed, 516 insertions(+), 483 deletions(-) create mode 100644 samples/TestCpp/Classes/VisibleRect.cpp create mode 100644 samples/TestCpp/Classes/VisibleRect.h diff --git a/samples/TestCpp/Android.mk b/samples/TestCpp/Android.mk index 57c0d33223..be417237db 100644 --- a/samples/TestCpp/Android.mk +++ b/samples/TestCpp/Android.mk @@ -91,7 +91,8 @@ Classes/UserDefaultTest/UserDefaultTest.cpp \ Classes/ZwoptexTest/ZwoptexTest.cpp \ Classes/controller.cpp \ Classes/testBasic.cpp \ -Classes/AppDelegate.cpp +Classes/AppDelegate.cpp \ +Classes/VisibleRect.cpp LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static diff --git a/samples/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp b/samples/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp index 18e148507e..db5702e1af 100644 --- a/samples/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp +++ b/samples/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp @@ -34,14 +34,13 @@ void AccelerometerTest::onEnter() setAccelerometerEnabled(true); - CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label, 1); - label->setPosition( CCPointMake(s.width/2, s.height-50) ); + label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-50) ); m_pBall = CCSprite::create("Images/ball.png"); - m_pBall->setPosition(ccp(s.width / 2, s.height / 2)); + m_pBall->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y)); addChild(m_pBall); m_pBall->retain(); @@ -59,7 +58,6 @@ void AccelerometerTest::didAccelerate(CCAcceleration* pAccelerationValue) // m_fLastTime = fNow; CCDirector* pDir = CCDirector::sharedDirector(); - CCSize winSize = pDir->getWinSize(); /*FIXME: Testing on the Nexus S sometimes m_pBall is NULL */ if ( m_pBall == NULL ) { @@ -75,8 +73,8 @@ void AccelerometerTest::didAccelerate(CCAcceleration* pAccelerationValue) ptTemp.y -= pAccelerationValue->y * 9.81f; CCPoint ptNext = pDir->convertToGL(ptTemp); - FIX_POS(ptNext.x, (ballSize.width / 2.0), (winSize.width - ballSize.width / 2.0)); - FIX_POS(ptNext.y, (ballSize.height / 2.0), (winSize.height - ballSize.height / 2.0)); + FIX_POS(ptNext.x, (VisibleRect::left().x+ballSize.width / 2.0), (VisibleRect::right().x - ballSize.width / 2.0)); + FIX_POS(ptNext.y, (VisibleRect::bottom().y+ballSize.height / 2.0), (VisibleRect::top().y - ballSize.height / 2.0)); m_pBall->setPosition(ptNext); } diff --git a/samples/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp b/samples/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp index a5090d6553..cae6ec05bd 100644 --- a/samples/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/samples/TestCpp/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -86,11 +86,9 @@ void ActionManagerTest::onEnter() { CCLayer::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label, 1); - label->setPosition(CCPointMake(s.width/2, s.height-50)); + label->setPosition(ccp(VisibleRect::center().x, VisibleRect::top().y-50)); CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(ActionManagerTest::backCallback) ); CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(ActionManagerTest::restartCallback) ); @@ -99,9 +97,9 @@ void ActionManagerTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(CCPointMake(s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(CCPointMake(s.width/2, item2->getContentSize().height/2)); - item3->setPosition(CCPointMake(s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y + item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y + item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y + item2->getContentSize().height/2)); addChild(menu, 1); } @@ -142,7 +140,7 @@ void CrashTest::onEnter() ActionManagerTest::onEnter(); CCSprite* child = CCSprite::create(s_pPathGrossini); - child->setPosition( CCPointMake(200,200) ); + child->setPosition( VisibleRect::center() ); addChild(child, 1); //Sum of all action's duration is 1.5 second. @@ -184,10 +182,10 @@ void LogicTest::onEnter() CCSprite* grossini = CCSprite::create(s_pPathGrossini); addChild(grossini, 0, 2); - grossini->setPosition(CCPointMake(200,200)); + grossini->setPosition(VisibleRect::center()); grossini->runAction( CCSequence::create( - CCMoveBy::create(1, CCPointMake(150,0)), + CCMoveBy::create(1, ccp(150,0)), CCCallFuncN::create(this, callfuncN_selector(LogicTest::bugMe)), NULL) ); @@ -218,11 +216,10 @@ void PauseTest::onEnter() // ActionManagerTest::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* l = CCLabelTTF::create("After 5 seconds grossini should move", "Thonburi", 16); addChild(l); - l->setPosition( CCPointMake(s.width/2, 245) ); + l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-75) ); // @@ -230,9 +227,9 @@ void PauseTest::onEnter() // CCSprite* grossini = CCSprite::create(s_pPathGrossini); addChild(grossini, 0, kTagGrossini); - grossini->setPosition( CCPointMake(200,200) ); + grossini->setPosition(VisibleRect::center() ); - CCAction* action = CCMoveBy::create(1, CCPointMake(150,0)); + CCAction* action = CCMoveBy::create(1, ccp(150,0)); CCDirector* pDirector = CCDirector::sharedDirector(); pDirector->getActionManager()->addAction(action, grossini, true); @@ -262,19 +259,17 @@ void RemoveTest::onEnter() { ActionManagerTest::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCLabelTTF* l = CCLabelTTF::create("Should not crash", "Thonburi", 16); addChild(l); - l->setPosition( CCPointMake(s.width/2, 245) ); + l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 75) ); - CCMoveBy* pMove = CCMoveBy::create(2, CCPointMake(200, 0)); + CCMoveBy* pMove = CCMoveBy::create(2, ccp(200, 0)); CCCallFunc* pCallback = CCCallFunc::create(this, callfunc_selector(RemoveTest::stopAction)); CCActionInterval* pSequence = (CCActionInterval*) CCSequence::create(pMove, pCallback, NULL); pSequence->setTag(kTagSequence); CCSprite* pChild = CCSprite::create(s_pPathGrossini); - pChild->setPosition(CCPointMake(200, 200)); + pChild->setPosition( VisibleRect::center() ); addChild(pChild, 1, kTagGrossini); pChild->runAction(pSequence); @@ -305,15 +300,13 @@ void ResumeTest::onEnter() { ActionManagerTest::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCLabelTTF* l = CCLabelTTF::create("Grossini only rotate/scale in 3 seconds", "Thonburi", 16); addChild(l); - l->setPosition( CCPointMake(s.width/2, 245)); + l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 75)); CCSprite* pGrossini = CCSprite::create(s_pPathGrossini); addChild(pGrossini, 0, kTagGrossini); - pGrossini->setPosition(CCPointMake(s.width / 2, s.height / 2)); + pGrossini->setPosition(VisibleRect::center()); pGrossini->runAction(CCScaleBy::create(2, 2)); diff --git a/samples/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/samples/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp index 333af20dfb..320d683bae 100644 --- a/samples/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/samples/TestCpp/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -21,9 +21,7 @@ void SpriteEase::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130,0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseIn::create((CCActionInterval*)(move->copy()->autorelease()), 2.5f); @@ -74,10 +72,8 @@ std::string SpriteEase::title() void SpriteEaseInOut::onEnter() { EaseSpriteDemo::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130,0)); // id move_back = move->reverse(); CCActionInterval* move_ease_inout1 = CCEaseInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.65f); @@ -116,9 +112,7 @@ void SpriteEaseExponential::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130,0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseExponentialIn::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -153,10 +147,8 @@ std::string SpriteEaseExponential::title() void SpriteEaseExponentialInOut::onEnter() { EaseSpriteDemo::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease = CCEaseExponentialInOut::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -188,10 +180,8 @@ std::string SpriteEaseExponentialInOut::title() void SpriteEaseSine::onEnter() { EaseSpriteDemo::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseSineIn::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -227,10 +217,8 @@ std::string SpriteEaseSine::title() void SpriteEaseSineInOut::onEnter() { EaseSpriteDemo::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130,0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease = CCEaseSineInOut::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -262,9 +250,7 @@ void SpriteEaseElastic::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseElasticIn::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -300,9 +286,7 @@ void SpriteEaseElasticInOut::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_ease_inout1 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.3f); CCActionInterval* move_ease_inout_back1 = move_ease_inout1->reverse(); @@ -341,9 +325,7 @@ void SpriteEaseBounce::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseBounceIn::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -379,10 +361,8 @@ std::string SpriteEaseBounce::title() void SpriteEaseBounceInOut::onEnter() { EaseSpriteDemo::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease = CCEaseBounceInOut::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -415,9 +395,7 @@ void SpriteEaseBack::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease_in = CCEaseBackIn::create((CCActionInterval*)(move->copy()->autorelease())); @@ -453,9 +431,7 @@ void SpriteEaseBackInOut::onEnter() { EaseSpriteDemo::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130, 0)); CCActionInterval* move_back = move->reverse(); CCActionInterval* move_ease = CCEaseBackInOut::create((CCActionInterval*)(move->copy()->autorelease()) ); @@ -491,7 +467,7 @@ void SpeedTest::onEnter() CCSize s = CCDirector::sharedDirector()->getWinSize(); // rotate and jump - CCActionInterval *jump1 = CCJumpBy::create(4, CCPointMake(-s.width+80, 0), 100, 4); + CCActionInterval *jump1 = CCJumpBy::create(4, ccp(-s.width+80, 0), 100, 4); CCActionInterval *jump2 = jump1->reverse(); CCActionInterval *rot1 = CCRotateBy::create(4, 360*2); CCActionInterval *rot2 = rot1->reverse(); @@ -617,10 +593,8 @@ EaseSpriteDemo::~EaseSpriteDemo(void) void EaseSpriteDemo::positionForTwo() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - m_grossini->setPosition(CCPointMake(60, s.height*1/5)); - m_tamara->setPosition(CCPointMake( 60, s.height*4/5)); + m_grossini->setPosition(ccp(VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*1/5)); + m_tamara->setPosition(ccp( VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*4/5)); m_kathia->setVisible(false); } @@ -643,15 +617,13 @@ void EaseSpriteDemo::onEnter() addChild( m_kathia, 2); addChild( m_tamara, 1); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - m_grossini->setPosition(CCPointMake(60, s.height*1/5)); - m_kathia->setPosition(CCPointMake(60, s.height*2.5f/5)); - m_tamara->setPosition(CCPointMake(60, s.height*4/5)); + m_grossini->setPosition(ccp(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*1/5)); + m_kathia->setPosition(ccp(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2.5f/5)); + m_tamara->setPosition(ccp(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*4/5)); CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label); - label->setPosition(CCPointMake(s.width/2, s.height-50)); + label->setPosition(ccp(VisibleRect::center().x, VisibleRect::top().y-50)); CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(EaseSpriteDemo::backCallback) ); CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(EaseSpriteDemo::restartCallback) ); @@ -660,9 +632,9 @@ void EaseSpriteDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(CCPointMake(s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(CCPointMake( s.width/2, item2->getContentSize().height/2)); - item3->setPosition(CCPointMake( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y + item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y + item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y + item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/samples/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 3b050b11bd..25c90986a9 100644 --- a/samples/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/samples/TestCpp/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -96,14 +96,14 @@ void SpriteDemo::onEnter() CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 18); addChild(label, 1); - label->setPosition( CCPointMake(s.width/2, s.height-50) ); + label->setPosition( ccp(s.width/2, s.height-50) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) { CCLabelTTF* l = CCLabelTTF::create(strSubtitle.c_str(), "Thonburi", 22); addChild(l, 1); - l->setPosition( CCPointMake(s.width/2, s.height-80) ); + l->setPosition( ccp(s.width/2, s.height-80) ); } CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(SpriteDemo::backCallback) ); @@ -112,9 +112,9 @@ void SpriteDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(CCPointMake( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(CCPointMake( s.width/2, item2->getContentSize().height/2)); - item3->setPosition(CCPointMake( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); CCLayerColor *background = CCLayerColor::create(ccc4(255,0,0,255)); @@ -163,7 +163,7 @@ void SpriteProgressToRadial::onEnter() CCProgressTimer *left = CCProgressTimer::create(CCSprite::create(s_pPathSister1)); left->setType( kCCProgressTimerTypeRadial ); addChild(left); - left->setPosition(CCPointMake(100, s.height/2)); + left->setPosition(ccp(100, s.height/2)); left->runAction( CCRepeatForever::create(to1)); CCProgressTimer *right = CCProgressTimer::create(CCSprite::create(s_pPathBlock)); @@ -171,7 +171,7 @@ void SpriteProgressToRadial::onEnter() // Makes the ridial CCW right->setReverseProgress(true); addChild(right); - right->setPosition(CCPointMake(s.width-100, s.height/2)); + right->setPosition(ccp(s.width-100, s.height/2)); right->runAction( CCRepeatForever::create(to2)); } @@ -202,7 +202,7 @@ void SpriteProgressToHorizontal::onEnter() // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change left->setBarChangeRate(ccp(1, 0)); addChild(left); - left->setPosition(CCPointMake(100, s.height/2)); + left->setPosition(ccp(100, s.height/2)); left->runAction( CCRepeatForever::create(to1)); CCProgressTimer *right = CCProgressTimer::create(CCSprite::create(s_pPathSister2)); @@ -212,7 +212,7 @@ void SpriteProgressToHorizontal::onEnter() // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change right->setBarChangeRate(ccp(1, 0)); addChild(right); - right->setPosition(CCPointMake(s.width-100, s.height/2)); + right->setPosition(ccp(s.width-100, s.height/2)); right->runAction( CCRepeatForever::create(to2)); } @@ -243,7 +243,7 @@ void SpriteProgressToVertical::onEnter() // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change left->setBarChangeRate(ccp(0, 1)); addChild(left); - left->setPosition(CCPointMake(100, s.height/2)); + left->setPosition(ccp(100, s.height/2)); left->runAction( CCRepeatForever::create(to1)); CCProgressTimer *right = CCProgressTimer::create(CCSprite::create(s_pPathSister2)); @@ -253,7 +253,7 @@ void SpriteProgressToVertical::onEnter() // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change right->setBarChangeRate(ccp(0, 1)); addChild(right); - right->setPosition(CCPointMake(s.width-100, s.height/2)); + right->setPosition(ccp(s.width-100, s.height/2)); right->runAction( CCRepeatForever::create(to2)); } diff --git a/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp index 3c3c8f17ba..f51b48fe2d 100644 --- a/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp +++ b/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp @@ -164,27 +164,23 @@ void ActionsDemo::onEnter() addChild(m_tamara, 2); addChild(m_kathia, 3); - CCDirector* pDirector = CCDirector::sharedDirector(); - CCPoint visibleOrigin = pDirector->getVisibleOrigin(); - CCSize visibleSize = pDirector->getVisibleSize(); - - m_grossini->setPosition(ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/3)); - m_tamara->setPosition(ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+2*visibleSize.height/3)); - m_kathia->setPosition(ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); + m_grossini->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/3)); + m_tamara->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2/3)); + m_kathia->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/2)); // add title and subtitle std::string str = title(); const char * pTitle = str.c_str(); CCLabelTTF* label = CCLabelTTF::create(pTitle, "Arial", 18); addChild(label, 1); - label->setPosition( ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height - 30) ); + label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 30) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) { CCLabelTTF* l = CCLabelTTF::create(strSubtitle.c_str(), "Thonburi", 22); addChild(l, 1); - l->setPosition( ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height - 60) ); + l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 60) ); } // add menu @@ -195,9 +191,9 @@ void ActionsDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp(visibleOrigin.x+visibleSize.width/2 - item2->getContentSize().width*2, visibleOrigin.y+item2->getContentSize().height/2)); - item2->setPosition(ccp(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+item2->getContentSize().height/2)); - item3->setPosition(ccp(visibleOrigin.x+visibleSize.width/2 + item2->getContentSize().width*2, visibleOrigin.y+item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } @@ -249,19 +245,19 @@ void ActionsDemo::centerSprites(unsigned int numberOfSprites) { m_tamara->setVisible(false); m_kathia->setVisible(false); - m_grossini->setPosition(CCPointMake(s.width/2, s.height/2)); + m_grossini->setPosition(ccp(s.width/2, s.height/2)); } else if( numberOfSprites == 2 ) { - m_kathia->setPosition( CCPointMake(s.width/3, s.height/2)); - m_tamara->setPosition( CCPointMake(2*s.width/3, s.height/2)); + m_kathia->setPosition( ccp(s.width/3, s.height/2)); + m_tamara->setPosition( ccp(2*s.width/3, s.height/2)); m_grossini->setVisible(false); } else if( numberOfSprites == 3 ) { - m_grossini->setPosition( CCPointMake(s.width/2, s.height/2)); - m_tamara->setPosition( CCPointMake(s.width/4, s.height/2)); - m_kathia->setPosition( CCPointMake(3 * s.width/4, s.height/2)); + m_grossini->setPosition( ccp(s.width/2, s.height/2)); + m_tamara->setPosition( ccp(s.width/4, s.height/2)); + m_kathia->setPosition( ccp(3 * s.width/4, s.height/2)); } } @@ -273,19 +269,19 @@ void ActionsDemo::alignSpritesLeft(unsigned int numberOfSprites) { m_tamara->setVisible(false); m_kathia->setVisible(false); - m_grossini->setPosition(CCPointMake(60, s.height/2)); + m_grossini->setPosition(ccp(60, s.height/2)); } else if( numberOfSprites == 2 ) { - m_kathia->setPosition( CCPointMake(60, s.height/3)); - m_tamara->setPosition( CCPointMake(60, 2*s.height/3)); + m_kathia->setPosition( ccp(60, s.height/3)); + m_tamara->setPosition( ccp(60, 2*s.height/3)); m_grossini->setVisible( false ); } else if( numberOfSprites == 3 ) { - m_grossini->setPosition( CCPointMake(60, s.height/2)); - m_tamara->setPosition( CCPointMake(60, 2*s.height/3)); - m_kathia->setPosition( CCPointMake(60, s.height/3)); + m_grossini->setPosition( ccp(60, s.height/2)); + m_tamara->setPosition( ccp(60, 2*s.height/3)); + m_kathia->setPosition( ccp(60, s.height/3)); } } @@ -302,14 +298,14 @@ void ActionManual::onEnter() m_tamara->setScaleX( 2.5f); m_tamara->setScaleY( -1.0f); - m_tamara->setPosition( CCPointMake(100,70) ); + m_tamara->setPosition( ccp(100,70) ); m_tamara->setOpacity( 128); m_grossini->setRotation( 120); - m_grossini->setPosition( CCPointMake(s.width/2, s.height/2)); + m_grossini->setPosition( ccp(s.width/2, s.height/2)); m_grossini->setColor( ccc3( 255,0,0)); - m_kathia->setPosition( CCPointMake(s.width-100, s.height/2)); + m_kathia->setPosition( ccp(s.width-100, s.height/2)); m_kathia->setColor( ccBLUE); } @@ -331,13 +327,13 @@ void ActionMove::onEnter() CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCActionInterval* actionTo = CCMoveTo::create(2, CCPointMake(s.width-40, s.height-40)); - CCActionInterval* actionBy = CCMoveBy::create(2, CCPointMake(80,80)); + CCActionInterval* actionTo = CCMoveTo::create(2, ccp(s.width-40, s.height-40)); + CCActionInterval* actionBy = CCMoveBy::create(2, ccp(80,80)); CCActionInterval* actionByBack = actionBy->reverse(); m_tamara->runAction( actionTo); m_grossini->runAction( CCSequence::create(actionBy, actionByBack, NULL)); - m_kathia->runAction(CCMoveTo::create(1, CCPointMake(40,40))); + m_kathia->runAction(CCMoveTo::create(1, ccp(40,40))); } std::string ActionMove::subtitle() @@ -484,9 +480,9 @@ void ActionJump::onEnter() centerSprites(3); - CCActionInterval* actionTo = CCJumpTo::create(2, CCPointMake(300,300), 50, 4); - CCActionInterval* actionBy = CCJumpBy::create(2, CCPointMake(300,0), 50, 4); - CCActionInterval* actionUp = CCJumpBy::create(2, CCPointMake(0,0), 80, 4); + CCActionInterval* actionTo = CCJumpTo::create(2, ccp(300,300), 50, 4); + CCActionInterval* actionBy = CCJumpBy::create(2, ccp(300,0), 50, 4); + CCActionInterval* actionUp = CCJumpBy::create(2, ccp(0,0), 80, 4); CCActionInterval* actionByBack = actionBy->reverse(); m_tamara->runAction( actionTo); @@ -518,9 +514,9 @@ void ActionBezier::onEnter() // sprite 1 ccBezierConfig bezier; - bezier.controlPoint_1 = CCPointMake(0, s.height/2); - bezier.controlPoint_2 = CCPointMake(300, -s.height/2); - bezier.endPosition = CCPointMake(300,100); + bezier.controlPoint_1 = ccp(0, s.height/2); + bezier.controlPoint_2 = ccp(300, -s.height/2); + bezier.endPosition = ccp(300,100); CCActionInterval* bezierForward = CCBezierBy::create(3, bezier); CCActionInterval* bezierBack = bezierForward->reverse(); @@ -528,16 +524,16 @@ void ActionBezier::onEnter() // sprite 2 - m_tamara->setPosition(CCPointMake(80,160)); + m_tamara->setPosition(ccp(80,160)); ccBezierConfig bezier2; - bezier2.controlPoint_1 = CCPointMake(100, s.height/2); - bezier2.controlPoint_2 = CCPointMake(200, -s.height/2); - bezier2.endPosition = CCPointMake(240,160); + bezier2.controlPoint_1 = ccp(100, s.height/2); + bezier2.controlPoint_2 = ccp(200, -s.height/2); + bezier2.endPosition = ccp(240,160); CCActionInterval* bezierTo1 = CCBezierTo::create(2, bezier2); // sprite 3 - m_kathia->setPosition(CCPointMake(400,160)); + m_kathia->setPosition(ccp(400,160)); CCActionInterval* bezierTo2 = CCBezierTo::create(2, bezier2); m_grossini->runAction( rep); @@ -714,7 +710,7 @@ void ActionSequence::onEnter() alignSpritesLeft(1); CCFiniteTimeAction* action = CCSequence::create( - CCMoveBy::create( 2, CCPointMake(240,0)), + CCMoveBy::create( 2, ccp(240,0)), CCRotateBy::create( 2, 540), NULL); @@ -740,9 +736,9 @@ void ActionSequence2::onEnter() m_grossini->setVisible(false); CCFiniteTimeAction* action = CCSequence::create( - CCPlace::create(CCPointMake(200,200)), + CCPlace::create(ccp(200,200)), CCShow::create(), - CCMoveBy::create(1, CCPointMake(100,0)), + CCMoveBy::create(1, ccp(100,0)), CCCallFunc::create(this, callfunc_selector(ActionSequence2::callback1)), CCCallFuncN::create(this, callfuncN_selector(ActionSequence2::callback2)), CCCallFuncND::create(this, callfuncND_selector(ActionSequence2::callback3), (void*)0xbebabeba), @@ -755,7 +751,7 @@ void ActionSequence2::callback1() { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 1 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*1,s.height/2)); + label->setPosition(ccp( s.width/4*1,s.height/2)); addChild(label); } @@ -764,7 +760,7 @@ void ActionSequence2::callback2(CCNode* sender) { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 2 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*2,s.height/2)); + label->setPosition(ccp( s.width/4*2,s.height/2)); addChild(label); } @@ -773,7 +769,7 @@ void ActionSequence2::callback3(CCNode* sender, void* data) { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 3 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*3,s.height/2)); + label->setPosition(ccp( s.width/4*3,s.height/2)); addChild(label); } @@ -795,7 +791,7 @@ void ActionCallFunc::onEnter() centerSprites(3); CCFiniteTimeAction* action = CCSequence::create( - CCMoveBy::create(2, CCPointMake(200,0)), + CCMoveBy::create(2, ccp(200,0)), CCCallFunc::create(this, callfunc_selector(ActionCallFunc::callback1)), NULL); @@ -821,7 +817,7 @@ void ActionCallFunc::callback1() { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 1 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*1,s.height/2)); + label->setPosition(ccp( s.width/4*1,s.height/2)); addChild(label); } @@ -830,7 +826,7 @@ void ActionCallFunc::callback2(CCNode* pSender) { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 2 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*2,s.height/2)); + label->setPosition(ccp( s.width/4*2,s.height/2)); addChild(label); } @@ -839,7 +835,7 @@ void ActionCallFunc::callback3(CCNode* pTarget, void* data) { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF *label = CCLabelTTF::create("callback 3 called", "Marker Felt", 16); - label->setPosition(CCPointMake( s.width/4*3,s.height/2)); + label->setPosition(ccp( s.width/4*3,s.height/2)); addChild(label); } @@ -896,7 +892,7 @@ void ActionSpawn::onEnter() CCAction* action = CCSpawn::create( - CCJumpBy::create(2, CCPointMake(300,0), 50, 4), + CCJumpBy::create(2, ccp(300,0), 50, 4), CCRotateBy::create( 2, 720), NULL); @@ -1007,7 +1003,7 @@ void ActionReverse::onEnter() alignSpritesLeft(1); - CCActionInterval* jump = CCJumpBy::create(2, CCPointMake(300,0), 50, 4); + CCActionInterval* jump = CCJumpBy::create(2, ccp(300,0), 50, 4); CCFiniteTimeAction* action = CCSequence::create( jump, jump->reverse(), NULL); m_grossini->runAction(action); @@ -1030,7 +1026,7 @@ void ActionDelayTime::onEnter() alignSpritesLeft(1); - CCActionInterval* move = CCMoveBy::create(1, CCPointMake(150,0)); + CCActionInterval* move = CCMoveBy::create(1, ccp(150,0)); CCFiniteTimeAction* action = CCSequence::create( move, CCDelayTime::create(2), move, NULL); m_grossini->runAction(action); @@ -1053,8 +1049,8 @@ void ActionReverseSequence::onEnter() alignSpritesLeft(1); - CCActionInterval* move1 = CCMoveBy::create(1, CCPointMake(250,0)); - CCActionInterval* move2 = CCMoveBy::create(1, CCPointMake(0,50)); + CCActionInterval* move1 = CCMoveBy::create(1, ccp(250,0)); + CCActionInterval* move2 = CCMoveBy::create(1, ccp(0,50)); CCFiniteTimeAction* seq = CCSequence::create( move1, move2, move1->reverse(), NULL); CCFiniteTimeAction* action = CCSequence::create( seq, seq->reverse(), NULL); @@ -1081,8 +1077,8 @@ void ActionReverseSequence2::onEnter() // Test: // Sequence should work both with IntervalAction and InstantActions - CCActionInterval* move1 = CCMoveBy::create(1, CCPointMake(250,0)); - CCActionInterval* move2 = CCMoveBy::create(1, CCPointMake(0,50)); + CCActionInterval* move1 = CCMoveBy::create(1, ccp(250,0)); + CCActionInterval* move2 = CCMoveBy::create(1, ccp(0,50)); CCToggleVisibility* tog1 = new CCToggleVisibility(); CCToggleVisibility* tog2 = new CCToggleVisibility(); tog1->autorelease(); @@ -1096,8 +1092,8 @@ void ActionReverseSequence2::onEnter() // Also test that the reverse of Hide is Show, and vice-versa m_kathia->runAction(action); - CCActionInterval* move_tamara = CCMoveBy::create(1, CCPointMake(100,0)); - CCActionInterval* move_tamara2 = CCMoveBy::create(1, CCPointMake(50,0)); + CCActionInterval* move_tamara = CCMoveBy::create(1, ccp(100,0)); + CCActionInterval* move_tamara2 = CCMoveBy::create(1, ccp(50,0)); CCActionInstant* hide = new CCHide(); hide->autorelease(); CCFiniteTimeAction* seq_tamara = CCSequence::create( move_tamara, hide, move_tamara2, NULL); @@ -1121,9 +1117,9 @@ void ActionRepeat::onEnter() alignSpritesLeft(2); - CCActionInterval* a1 = CCMoveBy::create(1, CCPointMake(150,0)); + CCActionInterval* a1 = CCMoveBy::create(1, ccp(150,0)); CCActionInterval* action1 = CCRepeat::create( - CCSequence::create( CCPlace::create(CCPointMake(60,60)), a1, NULL) , + CCSequence::create( CCPlace::create(ccp(60,60)), a1, NULL) , 3); CCAction* action2 = CCRepeatForever::create( (CCActionInterval*)(CCSequence::create((CCActionInterval*)(a1->copy()->autorelease()), a1->reverse(), NULL)) @@ -1171,7 +1167,7 @@ void ActionOrbit::onEnter() m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)action2)); m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)action3)); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(100,-100)); + CCActionInterval* move = CCMoveBy::create(3, ccp(100,-100)); CCActionInterval* move_back = move->reverse(); CCFiniteTimeAction* seq = CCSequence::create(move, move_back, NULL); CCAction* rfe = CCRepeatForever::create((CCActionInterval*)seq); @@ -1197,8 +1193,8 @@ void ActionFollow::onEnter() centerSprites(1); CCSize s = CCDirector::sharedDirector()->getWinSize(); - m_grossini->setPosition(CCPointMake(-200, s.height / 2)); - CCActionInterval* move = CCMoveBy::create(2, CCPointMake(s.width * 3, 0)); + m_grossini->setPosition(ccp(-200, s.height / 2)); + CCActionInterval* move = CCMoveBy::create(2, ccp(s.width * 3, 0)); CCActionInterval* move_back = move->reverse(); CCFiniteTimeAction* seq = CCSequence::create(move, move_back, NULL); CCAction* rep = CCRepeatForever::create((CCActionInterval*)seq); diff --git a/samples/TestCpp/Classes/AppDelegate.cpp b/samples/TestCpp/Classes/AppDelegate.cpp index 01f76e4ecf..cd1f5d8a69 100644 --- a/samples/TestCpp/Classes/AppDelegate.cpp +++ b/samples/TestCpp/Classes/AppDelegate.cpp @@ -23,22 +23,14 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); - CCSize designSize = CCSizeMake(480, 320); - if (screenSize.height > 768) - { - CCFileUtils::sharedFileUtils()->setResourceDirectory("ipadhd"); - pDirector->setContentScaleFactor(1536.0f/designSize.height); - } - else if (screenSize.height > 640) - { - CCFileUtils::sharedFileUtils()->setResourceDirectory("ipad"); - pDirector->setContentScaleFactor(768.0f/designSize.height); - } - else if (screenSize.height > 320) + CCSize designSize = CCSizeMake(480, 320); + + if (screenSize.height > 320) { + CCSize resourceSize = CCSizeMake(960, 640); CCFileUtils::sharedFileUtils()->setResourceDirectory("hd"); - pDirector->setContentScaleFactor(640.0f/designSize.height); + pDirector->setContentScaleFactor(resourceSize.height/designSize.height); } CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); diff --git a/samples/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/TestCpp/Classes/Box2DTest/Box2dTest.cpp index e036425d15..9dc0ead0df 100644 --- a/samples/TestCpp/Classes/Box2DTest/Box2dTest.cpp +++ b/samples/TestCpp/Classes/Box2DTest/Box2dTest.cpp @@ -63,7 +63,6 @@ Box2DTestLayer::Box2DTestLayer() setTouchEnabled( true ); setAccelerometerEnabled( true ); - CCSize s = CCDirector::sharedDirector()->getWinSize(); // init physics this->initPhysics(); // create reset button @@ -82,12 +81,12 @@ Box2DTestLayer::Box2DTestLayer() addChild(parent, 0, kTagParentNode); - addNewSpriteAtPosition(ccp(s.width/2, s.height/2)); + addNewSpriteAtPosition(VisibleRect::center()); CCLabelTTF *label = CCLabelTTF::create("Tap screen", "Marker Felt", 32); addChild(label, 0); label->setColor(ccc3(0,0,255)); - label->setPosition(ccp( s.width/2, s.height-50)); + label->setPosition(ccp( VisibleRect::center().x, VisibleRect::top().y-50)); scheduleUpdate(); } @@ -102,9 +101,6 @@ Box2DTestLayer::~Box2DTestLayer() void Box2DTestLayer::initPhysics() { - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - b2Vec2 gravity; gravity.Set(0.0f, -10.0f); world = new b2World(gravity); @@ -139,20 +135,19 @@ void Box2DTestLayer::initPhysics() b2EdgeShape groundBox; // bottom - - groundBox.Set(b2Vec2(0,0), b2Vec2(s.width/PTM_RATIO,0)); + groundBox.Set(b2Vec2(VisibleRect::leftBottom().x/PTM_RATIO,VisibleRect::leftBottom().y/PTM_RATIO), b2Vec2(VisibleRect::rightBottom().x/PTM_RATIO,VisibleRect::rightBottom().y/PTM_RATIO)); groundBody->CreateFixture(&groundBox,0); // top - groundBox.Set(b2Vec2(0,s.height/PTM_RATIO), b2Vec2(s.width/PTM_RATIO,s.height/PTM_RATIO)); + groundBox.Set(b2Vec2(VisibleRect::leftTop().x/PTM_RATIO,VisibleRect::leftTop().y/PTM_RATIO), b2Vec2(VisibleRect::rightTop().x/PTM_RATIO,VisibleRect::rightTop().y/PTM_RATIO)); groundBody->CreateFixture(&groundBox,0); // left - groundBox.Set(b2Vec2(0,s.height/PTM_RATIO), b2Vec2(0,0)); + groundBox.Set(b2Vec2(VisibleRect::leftTop().x/PTM_RATIO,VisibleRect::leftTop().y/PTM_RATIO), b2Vec2(VisibleRect::leftBottom().x/PTM_RATIO,VisibleRect::leftBottom().y/PTM_RATIO)); groundBody->CreateFixture(&groundBox,0); // right - groundBox.Set(b2Vec2(s.width/PTM_RATIO,s.height/PTM_RATIO), b2Vec2(s.width/PTM_RATIO,0)); + groundBox.Set(b2Vec2(VisibleRect::rightBottom().x/PTM_RATIO,VisibleRect::rightBottom().y/PTM_RATIO), b2Vec2(VisibleRect::rightTop().x/PTM_RATIO,VisibleRect::rightTop().y/PTM_RATIO)); groundBody->CreateFixture(&groundBox,0); } @@ -162,9 +157,7 @@ void Box2DTestLayer::createResetButton() CCMenu *menu = CCMenu::create(reset, NULL); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - menu->setPosition(ccp(s.width/2, 30)); + menu->setPosition(ccp(VisibleRect::bottom().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); } @@ -212,7 +205,7 @@ void Box2DTestLayer::addNewSpriteAtPosition(CCPoint p) parent->addChild(sprite); - sprite->setPosition( CCPointMake( p.x, p.y) ); + sprite->setPosition( ccp( p.x, p.y) ); // Define the dynamic body. //Set up a 1m squared box in the physics world diff --git a/samples/TestCpp/Classes/Box2DTestBed/Box2dView.cpp b/samples/TestCpp/Classes/Box2DTestBed/Box2dView.cpp index 2d872f6b42..1fd9198e4f 100644 --- a/samples/TestCpp/Classes/Box2DTestBed/Box2dView.cpp +++ b/samples/TestCpp/Classes/Box2DTestBed/Box2dView.cpp @@ -74,9 +74,9 @@ bool MenuLayer::initWithEntryID(int entryId) CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( visibleOrigin.x+visibleSize.width/2 - 100,visibleOrigin.y+30) ); - item2->setPosition( ccp( visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+30) ); - item3->setPosition( ccp( visibleOrigin.x+visibleSize.width/2 + 100,visibleOrigin.y+30) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); diff --git a/samples/TestCpp/Classes/BugsTest/BugsTest.cpp b/samples/TestCpp/Classes/BugsTest/BugsTest.cpp index 020eafc061..87bdde4cb5 100644 --- a/samples/TestCpp/Classes/BugsTest/BugsTest.cpp +++ b/samples/TestCpp/Classes/BugsTest/BugsTest.cpp @@ -157,7 +157,7 @@ void BugsTestBaseLayer::onEnter() CCMenuItemFont::setFontSize(24); CCMenuItemFont* pMainItem = CCMenuItemFont::create("Back", this, menu_selector(BugsTestBaseLayer::backCallback)); - pMainItem->setPosition(ccp(s.width - 50, 25)); + pMainItem->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu* pMenu = CCMenu::create(pMainItem, NULL); pMenu->setPosition( CCPointZero ); addChild(pMenu); diff --git a/samples/TestCpp/Classes/ChipmunkAccelTouchTest/ChipmunkAccelTouchTest.cpp b/samples/TestCpp/Classes/ChipmunkAccelTouchTest/ChipmunkAccelTouchTest.cpp index e3dbc70719..3b4794d03b 100644 --- a/samples/TestCpp/Classes/ChipmunkAccelTouchTest/ChipmunkAccelTouchTest.cpp +++ b/samples/TestCpp/Classes/ChipmunkAccelTouchTest/ChipmunkAccelTouchTest.cpp @@ -74,11 +74,9 @@ ChipmunkAccelTouchTestLayer::ChipmunkAccelTouchTestLayer() setTouchEnabled(true); setAccelerometerEnabled(true); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - // title CCLabelTTF *label = CCLabelTTF::create("Multi touch the screen", "Marker Felt", 36); - label->setPosition(ccp( s.width / 2, s.height - 30)); + label->setPosition(ccp( VisibleRect::center().x, VisibleRect::bottom().y - 30)); this->addChild(label, -1); // reset button @@ -116,8 +114,6 @@ ChipmunkAccelTouchTestLayer::~ChipmunkAccelTouchTestLayer() void ChipmunkAccelTouchTestLayer::initPhysics() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); - // init chipmunk //cpInitChipmunk(); @@ -130,16 +126,24 @@ void ChipmunkAccelTouchTestLayer::initPhysics() // We have to free them manually // // bottom - m_pWalls[0] = cpSegmentShapeNew( m_pSpace->staticBody, cpv(0,0), cpv(s.width,0), 0.0f); + m_pWalls[0] = cpSegmentShapeNew( m_pSpace->staticBody, + cpv(VisibleRect::leftBottom().x,VisibleRect::leftBottom().y), + cpv(VisibleRect::rightBottom().x, VisibleRect::rightBottom().y), 0.0f); // top - m_pWalls[1] = cpSegmentShapeNew( m_pSpace->staticBody, cpv(0,s.height), cpv(s.width,s.height), 0.0f); + m_pWalls[1] = cpSegmentShapeNew( m_pSpace->staticBody, + cpv(VisibleRect::leftTop().x, VisibleRect::leftTop().y), + cpv(VisibleRect::rightTop().x, VisibleRect::rightTop().y), 0.0f); // left - m_pWalls[2] = cpSegmentShapeNew( m_pSpace->staticBody, cpv(0,0), cpv(0,s.height), 0.0f); + m_pWalls[2] = cpSegmentShapeNew( m_pSpace->staticBody, + cpv(VisibleRect::leftBottom().x,VisibleRect::leftBottom().y), + cpv(VisibleRect::leftTop().x,VisibleRect::leftTop().y), 0.0f); // right - m_pWalls[3] = cpSegmentShapeNew( m_pSpace->staticBody, cpv(s.width,0), cpv(s.width,s.height), 0.0f); + m_pWalls[3] = cpSegmentShapeNew( m_pSpace->staticBody, + cpv(VisibleRect::rightBottom().x, VisibleRect::rightBottom().y), + cpv(VisibleRect::rightTop().x, VisibleRect::rightTop().y), 0.0f); for( int i=0;i<4;i++) { m_pWalls[i]->e = 1.0f; @@ -165,9 +169,7 @@ void ChipmunkAccelTouchTestLayer::createResetButton() CCMenu *menu = CCMenu::create(reset, NULL); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - - menu->setPosition(ccp(s.width/2, 30)); + menu->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); } diff --git a/samples/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/samples/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index cf3d5654d0..c020d4c03a 100644 --- a/samples/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/samples/TestCpp/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -25,9 +25,9 @@ MainLayer::MainLayer() addChild(layer, -1); addChild(sprite, 0, kTagSprite); - sprite->setPosition( CCPointMake(20,150) ); + sprite->setPosition( ccp(20,150) ); - sprite->runAction( CCJumpTo::create(4, CCPointMake(300,48), 100, 4) ); + sprite->runAction( CCJumpTo::create(4, ccp(300,48), 100, 4) ); layer->runAction( CCRepeatForever::create( (CCActionInterval*)( CCSequence::create( @@ -46,7 +46,7 @@ void MainLayer::ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) CCNode* s = getChildByTag(kTagSprite); s->stopAllActions(); - s->runAction( CCMoveTo::create(1, CCPointMake(location.x, location.y) ) ); + s->runAction( CCMoveTo::create(1, ccp(location.x, location.y) ) ); float o = location.x - s->getPosition().x; float a = location.y - s->getPosition().y; float at = (float) CC_RADIANS_TO_DEGREES( atanf( o/a) ); diff --git a/samples/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp index d177f0aa90..461189dc9b 100644 --- a/samples/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/samples/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -53,7 +53,7 @@ m_nSoundId(0) // add menu items for tests m_pItmeMenu = CCMenu::create(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); + m_nTestCount = sizeof(testItems) / sizeof(testItems[0]); for (int i = 0; i < m_nTestCount; ++i) @@ -66,10 +66,10 @@ m_nSoundId(0) CCMenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, this, menu_selector(CocosDenshionTest::menuCallback)); m_pItmeMenu->addChild(pMenuItem, i + 10000); - pMenuItem->setPosition( CCPointMake( s.width / 2, (s.height - (i + 1) * LINE_SPACE) )); + pMenuItem->setPosition( ccp( VisibleRect::center().x, (VisibleRect::top().y - (i + 1) * LINE_SPACE) )); } - m_pItmeMenu->setContentSize(CCSizeMake(s.width, (m_nTestCount + 1) * LINE_SPACE)); + m_pItmeMenu->setContentSize(CCSizeMake(VisibleRect::getVisibleRect().size.width, (m_nTestCount + 1) * LINE_SPACE)); m_pItmeMenu->setPosition(CCPointZero); addChild(m_pItmeMenu); @@ -204,16 +204,16 @@ void CocosDenshionTest::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) CCPoint curPos = m_pItmeMenu->getPosition(); CCPoint nextPos = ccp(curPos.x, curPos.y + nMoveY); - CCSize winSize = CCDirector::sharedDirector()->getWinSize(); + if (nextPos.y < 0.0f) { m_pItmeMenu->setPosition(CCPointZero); return; } - if (nextPos.y > ((m_nTestCount + 1)* LINE_SPACE - winSize.height)) + if (nextPos.y > ((m_nTestCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - m_pItmeMenu->setPosition(ccp(0, ((m_nTestCount + 1)* LINE_SPACE - winSize.height))); + m_pItmeMenu->setPosition(ccp(0, ((m_nTestCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } diff --git a/samples/TestCpp/Classes/CurlTest/CurlTest.cpp b/samples/TestCpp/Classes/CurlTest/CurlTest.cpp index e4d47265ec..7972ab2353 100644 --- a/samples/TestCpp/Classes/CurlTest/CurlTest.cpp +++ b/samples/TestCpp/Classes/CurlTest/CurlTest.cpp @@ -5,16 +5,15 @@ CurlTest::CurlTest() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* label = CCLabelTTF::create("Curl Test", "Arial", 28); addChild(label, 0); - label->setPosition( ccp(s.width/2, s.height-50) ); + label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-50) ); setTouchEnabled(true); // create a label to display the tip string m_pLabel = CCLabelTTF::create("Touch the screen to connect", "Arial", 22); - m_pLabel->setPosition(ccp(s.width / 2, s.height / 2)); + m_pLabel->setPosition(VisibleRect::center()); addChild(m_pLabel, 0); m_pLabel->retain(); diff --git a/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp index 6a954b4971..0ef3d20c89 100644 --- a/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp +++ b/samples/TestCpp/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp @@ -2,13 +2,12 @@ CurrentLanguageTest::CurrentLanguageTest() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* label = CCLabelTTF::create("Current language Test", "Arial", 28); addChild(label, 0); - label->setPosition( ccp(s.width/2, s.height-50) ); + label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-50) ); CCLabelTTF *labelLanguage = CCLabelTTF::create("", "Arial", 20); - labelLanguage->setPosition(ccp(s.width/2, s.height/2)); + labelLanguage->setPosition(VisibleRect::center()); ccLanguageType currentLanguageType = CCApplication::sharedApplication()->getCurrentLanguage(); switch (currentLanguageType) diff --git a/samples/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/samples/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index a012a8bf57..1a446c5dcb 100644 --- a/samples/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/samples/TestCpp/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -6,8 +6,6 @@ DrawPrimitivesTest::DrawPrimitivesTest() void DrawPrimitivesTest::draw() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CHECK_GL_ERROR_DEBUG(); // draw a simple line @@ -16,7 +14,7 @@ void DrawPrimitivesTest::draw() // color: 255,255,255,255 (white, non-transparent) // Anti-Aliased // glEnable(GL_LINE_SMOOTH); - ccDrawLine( ccp(0, 0), ccp(s.width, s.height) ); + ccDrawLine( VisibleRect::leftBottom(), VisibleRect::rightTop() ); CHECK_GL_ERROR_DEBUG(); @@ -26,7 +24,7 @@ void DrawPrimitivesTest::draw() // glDisable(GL_LINE_SMOOTH); glLineWidth( 5.0f ); ccDrawColor4B(255,0,0,255); - ccDrawLine( ccp(0, s.height), ccp(s.width, 0) ); + ccDrawLine( VisibleRect::leftTop(), VisibleRect::rightBottom() ); CHECK_GL_ERROR_DEBUG(); @@ -39,7 +37,7 @@ void DrawPrimitivesTest::draw() // draw big point in the center ccPointSize(64); ccDrawColor4B(0,0,255,128); - ccDrawPoint( ccp(s.width / 2, s.height / 2) ); + ccDrawPoint( VisibleRect::center() ); CHECK_GL_ERROR_DEBUG(); @@ -54,14 +52,14 @@ void DrawPrimitivesTest::draw() // draw a green circle with 10 segments glLineWidth(16); ccDrawColor4B(0, 255, 0, 255); - ccDrawCircle( ccp(s.width/2, s.height/2), 100, 0, 10, false); + ccDrawCircle( VisibleRect::center(), 100, 0, 10, false); CHECK_GL_ERROR_DEBUG(); // draw a green circle with 50 segments with line to center glLineWidth(2); ccDrawColor4B(0, 255, 255, 255); - ccDrawCircle( ccp(s.width/2, s.height/2), 50, CC_DEGREES_TO_RADIANS(90), 50, true); + ccDrawCircle( VisibleRect::center(), 50, CC_DEGREES_TO_RADIANS(90), 50, true); CHECK_GL_ERROR_DEBUG(); @@ -87,12 +85,12 @@ void DrawPrimitivesTest::draw() CHECK_GL_ERROR_DEBUG(); // draw quad bezier path - ccDrawQuadBezier(ccp(0,s.height), ccp(s.width/2,s.height/2), ccp(s.width,s.height), 50); + ccDrawQuadBezier(VisibleRect::leftTop(), VisibleRect::center(), VisibleRect::rightTop(), 50); CHECK_GL_ERROR_DEBUG(); // draw cubic bezier path - ccDrawCubicBezier(ccp(s.width/2, s.height/2), ccp(s.width/2+30,s.height/2+50), ccp(s.width/2+60,s.height/2-50),ccp(s.width, s.height/2),100); + ccDrawCubicBezier(VisibleRect::center(), ccp(VisibleRect::center().x+30,VisibleRect::center().y+50), ccp(VisibleRect::center().x+60,VisibleRect::center().y-50),VisibleRect::right(),100); CHECK_GL_ERROR_DEBUG(); diff --git a/samples/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/samples/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp index 77971b6da1..e01e1fbecc 100644 --- a/samples/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp +++ b/samples/TestCpp/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp @@ -329,33 +329,28 @@ CCLayer* restartEffectAdvanceAction() void EffectAdvanceTextLayer::onEnter(void) { CCLayer::onEnter(); - float x,y; - - CCSize size = CCDirector::sharedDirector()->getWinSize(); - x = size.width; - y = size.height; CCSprite *bg = CCSprite::create("Images/background3.png"); addChild(bg, 0, kTagBackground); - bg->setPosition( ccp(x/2,y/2) ); + bg->setPosition( VisibleRect::center() ); CCSprite* grossini = CCSprite::create("Images/grossinis_sister2.png"); bg->addChild(grossini, 1, kTagSprite1); - grossini->setPosition( ccp(x/3.0f,200) ); + grossini->setPosition( ccp(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3.0f, VisibleRect::bottom().y+ 200) ); CCActionInterval* sc = CCScaleBy::create(2, 5); CCActionInterval* sc_back = sc->reverse(); grossini->runAction( CCRepeatForever::create( (CCActionInterval*)(CCSequence::create(sc, sc_back, NULL)) ) ); CCSprite* tamara = CCSprite::create("Images/grossinis_sister1.png"); bg->addChild(tamara, 1, kTagSprite2); - tamara->setPosition( ccp(2*x/3.0f,200) ); + tamara->setPosition( ccp(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3.0f,VisibleRect::bottom().y+200) ); CCActionInterval* sc2 = CCScaleBy::create(2, 5); CCActionInterval* sc2_back = sc2->reverse(); tamara->runAction( CCRepeatForever::create( (CCActionInterval*)(CCSequence::create(sc2, sc2_back, NULL)) ) ); CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Marker Felt", 28); - label->setPosition( ccp(x/2,y-80) ); + label->setPosition( ccp(VisibleRect::center().x,VisibleRect::top().y-80) ); addChild(label); label->setTag( kTagLabel ); @@ -364,7 +359,7 @@ void EffectAdvanceTextLayer::onEnter(void) { CCLabelTTF* l = CCLabelTTF::create(strSubtitle.c_str(), "Thonburi", 16); addChild(l, 101); - l->setPosition( ccp(size.width/2, size.height-80) ); + l->setPosition( ccp(VisibleRect::center().x,VisibleRect::top().y-80) ); } CCMenuItemImage *item1 = CCMenuItemImage::create("Images/b1.png", "Images/b2.png", this, menu_selector(EffectAdvanceTextLayer::backCallback) ); @@ -374,9 +369,9 @@ void EffectAdvanceTextLayer::onEnter(void) CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp(size.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(ccp(size.width/2, item2->getContentSize().height/2)); - item3->setPosition(ccp(size.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/EffectsTest/EffectsTest.cpp b/samples/TestCpp/Classes/EffectsTest/EffectsTest.cpp index 937e4602a1..aa6fdd33ac 100644 --- a/samples/TestCpp/Classes/EffectsTest/EffectsTest.cpp +++ b/samples/TestCpp/Classes/EffectsTest/EffectsTest.cpp @@ -86,7 +86,7 @@ public: static CCActionInterval* create(float t) { CCSize size = CCDirector::sharedDirector()->getWinSize(); - return CCLens3D::create(CCPointMake(size.width/2,size.height/2), 240, ccg(15,10), t); + return CCLens3D::create(ccp(size.width/2,size.height/2), 240, ccg(15,10), t); } }; @@ -97,7 +97,7 @@ public: static CCActionInterval* create(float t) { CCSize size = CCDirector::sharedDirector()->getWinSize(); - return CCRipple3D::create(CCPointMake(size.width/2,size.height/2), 240, 4, 160, ccg(32,24), t); + return CCRipple3D::create(ccp(size.width/2,size.height/2), 240, 4, 160, ccg(32,24), t); } }; @@ -128,7 +128,7 @@ public: static CCActionInterval* create(float t) { CCSize size = CCDirector::sharedDirector()->getWinSize(); - return CCTwirl::create(CCPointMake(size.width/2, size.height/2), 1, 2.5f, ccg(12,8), t); + return CCTwirl::create(ccp(size.width/2, size.height/2), 1, 2.5f, ccg(12,8), t); } }; @@ -340,12 +340,6 @@ void EffectTestScene::runThisTest() TextLayer::TextLayer(void) { initWithColor( ccc4(32,128,32,255) ); - - float x,y; - - CCSize s = CCDirector::sharedDirector()->getWinSize(); - x = s.width; - y = s.height; CCNode* node = CCNode::create(); CCActionInterval* effect = getAction(); @@ -355,25 +349,25 @@ TextLayer::TextLayer(void) CCSprite *bg = CCSprite::create(s_back3); node->addChild(bg, 0); // bg->setAnchorPoint( CCPointZero ); - bg->setPosition(ccp(s.width/2, s.height/2)); + bg->setPosition(VisibleRect::center()); CCSprite* grossini = CCSprite::create(s_pPathSister2); node->addChild(grossini, 1); - grossini->setPosition( CCPointMake(x/3,y/2) ); + grossini->setPosition( ccp(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); CCActionInterval* sc = CCScaleBy::create(2, 5); CCActionInterval* sc_back = sc->reverse(); grossini->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(sc, sc_back, NULL)) ) ); CCSprite* tamara = CCSprite::create(s_pPathSister1); node->addChild(tamara, 1); - tamara->setPosition( CCPointMake(2*x/3,y/2) ); + tamara->setPosition( ccp(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); CCActionInterval* sc2 = CCScaleBy::create(2, 5); CCActionInterval* sc2_back = sc2->reverse(); tamara->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(sc2, sc2_back, NULL))) ); CCLabelTTF* label = CCLabelTTF::create((effectsList[actionIdx]).c_str(), "Marker Felt", 32); - label->setPosition( CCPointMake(x/2,y-80) ); + label->setPosition( ccp(VisibleRect::center().x,VisibleRect::top().y-80) ); addChild(label); label->setTag( kTagLabel ); @@ -384,9 +378,9 @@ TextLayer::TextLayer(void) CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(CCPointMake( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(CCPointMake( s.width/2, item2->getContentSize().height/2)); - item3->setPosition(CCPointMake( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); diff --git a/samples/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp b/samples/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp index fa4e477a67..549da85611 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp @@ -42,30 +42,27 @@ bool CCControlScene::init() { if (CCLayer::init()) { - // Get the sceensize - CCSize screensize = CCDirector::sharedDirector()->getWinSize(); - CCMenuItemFont* pBackItem = CCMenuItemFont::create("Back", this, menu_selector(CCControlScene::toExtensionsMainLayer)); - pBackItem->setPosition(ccp(screensize.width - 50, 25)); + pBackItem->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu* pBackMenu = CCMenu::create(pBackItem, NULL); pBackMenu->setPosition( CCPointZero ); addChild(pBackMenu, 10); // Add the generated background CCSprite *background = CCSprite::create("extensions/background.png"); - background->setPosition(ccp(screensize.width / 2, screensize.height / 2)); + background->setPosition(VisibleRect::center()); addChild(background); // Add the ribbon CCScale9Sprite *ribbon = CCScale9Sprite::create("extensions/ribbon.png", CCRectMake(1, 1, 48, 55)); - ribbon->setContentSize(CCSizeMake(screensize.width, 57)); - ribbon->setPosition(ccp(screensize.width / 2.0f, screensize.height - ribbon->getContentSize().height / 2.0f)); + ribbon->setContentSize(CCSizeMake(VisibleRect::getVisibleRect().size.width, 57)); + ribbon->setPosition(ccp(VisibleRect::center().x, VisibleRect::top().y - ribbon->getContentSize().height / 2.0f)); addChild(ribbon); // Add the title setSceneTitleLabel(CCLabelTTF::create("Title", "Arial", 12)); - m_pSceneTitleLabel->setPosition(ccp (screensize.width / 2, screensize.height - m_pSceneTitleLabel->getContentSize().height / 2 - 5)); + m_pSceneTitleLabel->setPosition(ccp (VisibleRect::center().x, VisibleRect::top().y - m_pSceneTitleLabel->getContentSize().height / 2 - 5)); addChild(m_pSceneTitleLabel, 1); // Add the menu @@ -75,9 +72,9 @@ bool CCControlScene::init() CCMenu *menu = CCMenu::create(item1, item3, item2, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp(screensize.width / 2 - 100, 37)); - item2->setPosition(ccp(screensize.width / 2, 35)); - item3->setPosition(ccp(screensize.width / 2 + 100, 37)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu ,1); diff --git a/samples/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/samples/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index abe50a6030..251439c2fa 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -43,7 +43,7 @@ HttpClientTest::HttpClientTest() // Back Menu CCMenuItemFont *itemBack = CCMenuItemFont::create("Back", this, menu_selector(HttpClientTest::toExtensionsMainLayer)); - itemBack->setPosition(ccp(winSize.width - 50, 25)); + itemBack->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu *menuBack = CCMenu::create(itemBack, NULL); menuBack->setPosition(CCPointZero); addChild(menuBack); diff --git a/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index ceb07b80b7..f3feef0716 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -84,7 +84,7 @@ NotificationCenterTest::NotificationCenterTest() CCMenuItemFont* pBackItem = CCMenuItemFont::create("Back", this, menu_selector(NotificationCenterTest::toExtensionsMainLayer)); - pBackItem->setPosition(ccp(s.width - 50, 25)); + pBackItem->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu* pBackMenu = CCMenu::create(pBackItem, NULL); pBackMenu->setPosition( CCPointZero ); addChild(pBackMenu); diff --git a/samples/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/samples/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index daafeb6b38..7bbd2e691f 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -40,7 +40,7 @@ bool TableViewTestLayer::init() // Back Menu CCMenuItemFont *itemBack = CCMenuItemFont::create("Back", this, menu_selector(TableViewTestLayer::toExtensionsMainLayer)); - itemBack->setPosition(ccp(winSize.width - 50, 25)); + itemBack->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu *menuBack = CCMenu::create(itemBack, NULL); menuBack->setPosition(CCPointZero); addChild(menuBack); diff --git a/samples/TestCpp/Classes/FontTest/FontTest.cpp b/samples/TestCpp/Classes/FontTest/FontTest.cpp index 75a7be595c..3e8c9d46a2 100644 --- a/samples/TestCpp/Classes/FontTest/FontTest.cpp +++ b/samples/TestCpp/Classes/FontTest/FontTest.cpp @@ -74,16 +74,15 @@ static const char* restartAction(void) FontTest::FontTest() { - CCSize s = CCDirector::sharedDirector()->getWinSize(); CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(FontTest::backCallback)); CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(FontTest::restartCallback)); CCMenuItemImage *item3 = CCMenuItemImage::create(s_pPathF1, s_pPathF2, this, menu_selector(FontTest::nextCallback)); CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(ccp( s.width/2, item2->getContentSize().height/2)); - item3->setPosition(ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); showFont(restartAction()); diff --git a/samples/TestCpp/Classes/IntervalTest/IntervalTest.cpp b/samples/TestCpp/Classes/IntervalTest/IntervalTest.cpp index 18f8173abd..166604e7c8 100644 --- a/samples/TestCpp/Classes/IntervalTest/IntervalTest.cpp +++ b/samples/TestCpp/Classes/IntervalTest/IntervalTest.cpp @@ -17,7 +17,7 @@ IntervalLayer::IntervalLayer() // sun CCParticleSystem* sun = CCParticleSun::create(); sun->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png")); - sun->setPosition( CCPointMake(s.width-32,s.height-32) ); + sun->setPosition( ccp(VisibleRect::rightTop().x-32,VisibleRect::rightTop().y-32) ); sun->setTotalParticles(130); sun->setLife(0.6f); @@ -36,11 +36,11 @@ IntervalLayer::IntervalLayer() schedule(schedule_selector(IntervalLayer::step3), 1.0f); schedule(schedule_selector(IntervalLayer::step4), 2.0f); - m_label0->setPosition(CCPointMake(s.width*1/6, s.height/2)); - m_label1->setPosition(CCPointMake(s.width*2/6, s.height/2)); - m_label2->setPosition(CCPointMake(s.width*3/6, s.height/2)); - m_label3->setPosition(CCPointMake(s.width*4/6, s.height/2)); - m_label4->setPosition(CCPointMake(s.width*5/6, s.height/2)); + m_label0->setPosition(ccp(s.width*1/6, s.height/2)); + m_label1->setPosition(ccp(s.width*2/6, s.height/2)); + m_label2->setPosition(ccp(s.width*3/6, s.height/2)); + m_label3->setPosition(ccp(s.width*4/6, s.height/2)); + m_label4->setPosition(ccp(s.width*5/6, s.height/2)); addChild(m_label0); addChild(m_label1); @@ -50,9 +50,9 @@ IntervalLayer::IntervalLayer() // Sprite CCSprite* sprite = CCSprite::create(s_pPathGrossini); - sprite->setPosition( CCPointMake(40,50) ); + sprite->setPosition( ccp(VisibleRect::left().x + 40, VisibleRect::bottom().y + 50) ); - CCJumpBy* jump = CCJumpBy::create(3, CCPointMake(s.width-80,0), 50, 4); + CCJumpBy* jump = CCJumpBy::create(3, ccp(s.width-80,0), 50, 4); addChild(sprite); sprite->runAction( CCRepeatForever::create( @@ -62,7 +62,7 @@ IntervalLayer::IntervalLayer() // pause button CCMenuItem* item1 = CCMenuItemFont::create("Pause", this, menu_selector(IntervalLayer::onPause) ); CCMenu* menu = CCMenu::create(item1, NULL); - menu->setPosition( CCPointMake(s.width/2, s.height-50) ); + menu->setPosition( ccp(s.width/2, s.height-50) ); addChild( menu ); } diff --git a/samples/TestCpp/Classes/LabelTest/LabelTest.cpp b/samples/TestCpp/Classes/LabelTest/LabelTest.cpp index 020d2a7e46..b583099621 100644 --- a/samples/TestCpp/Classes/LabelTest/LabelTest.cpp +++ b/samples/TestCpp/Classes/LabelTest/LabelTest.cpp @@ -155,9 +155,9 @@ void AtlasDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2)); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2));; addChild(menu, 1); } @@ -447,9 +447,9 @@ Atlas3::Atlas3() CCSize s = CCDirector::sharedDirector()->getWinSize(); - label1->setPosition( ccp( 0,0) ); - label2->setPosition( ccp( s.width/2, s.height/2) ); - label3->setPosition( ccp( s.width, s.height) ); + label1->setPosition( VisibleRect::leftBottom() ); + label2->setPosition( VisibleRect::center() ); + label3->setPosition( VisibleRect::rightTop() ); schedule( schedule_selector(Atlas3::step) );//:@selector(step:)]; } @@ -776,10 +776,9 @@ BitmapFontMultiLine::BitmapFontMultiLine() s = label3->getContentSize(); CCLOG("content size: %.2fx%.2f", s.width, s.height); - s = CCDirector::sharedDirector()->getWinSize(); - label1->setPosition(ccp( 0,0)); - label2->setPosition(ccp( s.width/2, s.height/2)); - label3->setPosition(ccp( s.width, s.height)); + label1->setPosition(VisibleRect::leftBottom()); + label2->setPosition(VisibleRect::center()); + label3->setPosition(VisibleRect::rightTop()); } std::string BitmapFontMultiLine::title() diff --git a/samples/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/TestCpp/Classes/LayerTest/LayerTest.cpp index 55f8e61c3f..cfafc72df6 100644 --- a/samples/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -94,7 +94,7 @@ void LayerTest::onEnter() CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label, 1); - label->setPosition( CCPointMake(s.width/2, s.height-50) ); + label->setPosition( ccp(s.width/2, s.height-50) ); string subtitle_ = subtitle(); if (subtitle_.size() > 0) @@ -111,9 +111,9 @@ void LayerTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } @@ -158,7 +158,7 @@ void LayerTest1::onEnter() CCLayerColor* layer = CCLayerColor::create( ccc4(0xFF, 0x00, 0x00, 0x80), 200, 200); layer->ignoreAnchorPointForPosition(false); - layer->setPosition( CCPointMake(s.width/2, s.height/2) ); + layer->setPosition( ccp(s.width/2, s.height/2) ); addChild(layer, 1, kTagLayer); } @@ -218,12 +218,12 @@ void LayerTest2::onEnter() CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLayerColor* layer1 = CCLayerColor::create( ccc4(255, 255, 0, 80), 100, 300); - layer1->setPosition(CCPointMake(s.width/3, s.height/2)); + layer1->setPosition(ccp(s.width/3, s.height/2)); layer1->ignoreAnchorPointForPosition(false); addChild(layer1, 1); CCLayerColor* layer2 = CCLayerColor::create( ccc4(0, 0, 255, 255), 100, 300); - layer2->setPosition(CCPointMake((s.width/3)*2, s.height/2)); + layer2->setPosition(ccp((s.width/3)*2, s.height/2)); layer2->ignoreAnchorPointForPosition(false); addChild(layer2, 1); @@ -261,8 +261,8 @@ LayerTestBlend::LayerTestBlend() addChild(sister2); addChild(layer1, 100, kTagLayer); - sister1->setPosition( CCPointMake( 160, s.height/2) ); - sister2->setPosition( CCPointMake( 320, s.height/2) ); + sister1->setPosition( ccp( 160, s.height/2) ); + sister2->setPosition( ccp( 320, s.height/2) ); schedule( schedule_selector(LayerTestBlend::newBlend), 1.0f); } diff --git a/samples/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/TestCpp/Classes/MenuTest/MenuTest.cpp index 3b39b9b5a8..04dffd740e 100644 --- a/samples/TestCpp/Classes/MenuTest/MenuTest.cpp +++ b/samples/TestCpp/Classes/MenuTest/MenuTest.cpp @@ -97,11 +97,9 @@ MenuLayerMainMenu::MenuLayerMainMenu() if( i % 2 == 0) offset = -offset; - child->setPosition( CCPointMake( dstPoint.x + offset, dstPoint.y) ); + child->setPosition( ccp( dstPoint.x + offset, dstPoint.y) ); child->runAction( - CCEaseElasticOut::create( - CCMoveBy::create(2, CCPointMake(dstPoint.x - offset,0)), 0.35f - ) + CCEaseElasticOut::create(CCMoveBy::create(2, ccp(dstPoint.x - offset,0)), 0.35f) ); i++; } @@ -237,7 +235,7 @@ void MenuLayer2::alignMenusH() // TIP: if no padding, padding = 5 menu->alignItemsHorizontally(); CCPoint p = menu->getPosition(); - menu->setPosition( ccpAdd(p, CCPointMake(0,30)) ); + menu->setPosition( ccpAdd(p, ccp(0,30)) ); } else @@ -245,7 +243,7 @@ void MenuLayer2::alignMenusH() // TIP: but padding is configurable menu->alignItemsHorizontallyWithPadding(40); CCPoint p = menu->getPosition(); - menu->setPosition( ccpSub(p, CCPointMake(0,30)) ); + menu->setPosition( ccpSub(p, ccp(0,30)) ); } } } @@ -261,14 +259,14 @@ void MenuLayer2::alignMenusV() // TIP: if no padding, padding = 5 menu->alignItemsVertically(); CCPoint p = menu->getPosition(); - menu->setPosition( ccpAdd(p, CCPointMake(100,0)) ); + menu->setPosition( ccpAdd(p, ccp(100,0)) ); } else { // TIP: but padding is configurable menu->alignItemsVerticallyWithPadding(40); CCPoint p = menu->getPosition(); - menu->setPosition( ccpSub(p, CCPointMake(100,0)) ); + menu->setPosition( ccpSub(p, ccp(100,0)) ); } } } @@ -322,15 +320,15 @@ MenuLayer3::MenuLayer3() m_disabledItem->setEnabled( false ); CCMenu *menu = CCMenu::create( item1, item2, item3, NULL); - menu->setPosition( CCPointMake(0,0) ); + menu->setPosition( ccp(0,0) ); CCSize s = CCDirector::sharedDirector()->getWinSize(); - item1->setPosition( CCPointMake(s.width/2 - 150, s.height/2) ); - item2->setPosition( CCPointMake(s.width/2 - 200, s.height/2) ); - item3->setPosition( CCPointMake(s.width/2, s.height/2 - 100) ); + item1->setPosition( ccp(s.width/2 - 150, s.height/2) ); + item2->setPosition( ccp(s.width/2 - 200, s.height/2) ); + item3->setPosition( ccp(s.width/2, s.height/2 - 100) ); - CCJumpBy* jump = CCJumpBy::create(3, CCPointMake(400,0), 50, 4); + CCJumpBy* jump = CCJumpBy::create(3, ccp(400,0), 50, 4); item2->runAction( CCRepeatForever::create( (CCActionInterval*)(CCSequence::create( jump, jump->reverse(), NULL)) ) diff --git a/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp index c6851be64d..99194e1550 100644 --- a/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -42,7 +42,7 @@ void MotionStreakTest1::onEnter() CCActionInterval* a1 = CCRotateBy::create(2, 360); CCAction* action1 = CCRepeatForever::create(a1); - CCActionInterval* motion = CCMoveBy::create(2, CCPointMake(100,0) ); + CCActionInterval* motion = CCMoveBy::create(2, ccp(100,0) ); m_root->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(motion, motion->reverse(), NULL)) ) ); m_root->runAction( action1 ); @@ -87,7 +87,7 @@ void MotionStreakTest2::onEnter() streak = CCMotionStreak::create(3, 3, 64, ccWHITE, s_streak ); addChild(streak); - streak->setPosition( CCPointMake(s.width/2, s.height/2) ); + streak->setPosition( ccp(s.width/2, s.height/2) ); } void MotionStreakTest2::ccTouchesMoved(CCSet* touches, CCEvent* event) @@ -234,7 +234,7 @@ void MotionStreakTest::onEnter() CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label, 0, kTagLabel); - label->setPosition(CCPointMake(s.width/2, s.height-50)); + label->setPosition(ccp(s.width/2, s.height-50)); string subTitle = this->subtitle(); if (subTitle.size() > 0) @@ -251,9 +251,9 @@ void MotionStreakTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(CCPointMake(s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(CCPointMake(s.width/2, item2->getContentSize().height/2)); - item3->setPosition(CCPointMake(s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); diff --git a/samples/TestCpp/Classes/NodeTest/NodeTest.cpp b/samples/TestCpp/Classes/NodeTest/NodeTest.cpp index 82b6b8385d..2d02b84807 100644 --- a/samples/TestCpp/Classes/NodeTest/NodeTest.cpp +++ b/samples/TestCpp/Classes/NodeTest/NodeTest.cpp @@ -106,14 +106,14 @@ void TestCocosNodeDemo::onEnter() CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label, 10); - label->setPosition( CCPointMake(s.width/2, s.height-50) ); + label->setPosition( ccp(s.width/2, s.height-50) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) { CCLabelTTF* l = CCLabelTTF::create(strSubtitle.c_str(), "Thonburi", 16); addChild(l, 1); - l->setPosition( CCPointMake(s.width/2, s.height-80) ); + l->setPosition( ccp(s.width/2, s.height-80) ); } CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(TestCocosNodeDemo::backCallback) ); @@ -123,9 +123,9 @@ void TestCocosNodeDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 11); } @@ -172,8 +172,8 @@ void Test2::onEnter() CCSprite *sp3 = CCSprite::create(s_pPathSister1); CCSprite *sp4 = CCSprite::create(s_pPathSister2); - sp1->setPosition(CCPointMake(100, s.height /2 )); - sp2->setPosition(CCPointMake(380, s.height /2 )); + sp1->setPosition(ccp(100, s.height /2 )); + sp2->setPosition(ccp(380, s.height /2 )); addChild(sp1); addChild(sp2); @@ -197,7 +197,7 @@ void Test2::onEnter() NULL) ) ); - sp2->setAnchorPoint(CCPointMake(0,0)); + sp2->setAnchorPoint(ccp(0,0)); sp1->runAction(action1); sp2->runAction(action2); @@ -222,8 +222,8 @@ Test4::Test4() CCSprite *sp1 = CCSprite::create(s_pPathSister1); CCSprite *sp2 = CCSprite::create(s_pPathSister2); - sp1->setPosition( CCPointMake(100,160) ); - sp2->setPosition( CCPointMake(380,160) ); + sp1->setPosition( ccp(100,160) ); + sp2->setPosition( ccp(380,160) ); addChild(sp1, 0, 2); addChild(sp2, 0, 3); @@ -261,8 +261,8 @@ Test5::Test5() CCSprite* sp1 = CCSprite::create(s_pPathSister1); CCSprite* sp2 = CCSprite::create(s_pPathSister2); - sp1->setPosition(CCPointMake(100,160)); - sp2->setPosition(CCPointMake(380,160)); + sp1->setPosition(ccp(100,160)); + sp2->setPosition(ccp(380,160)); CCRotateBy* rot = CCRotateBy::create(2, 360); CCActionInterval* rot_back = rot->reverse(); @@ -318,8 +318,8 @@ Test6::Test6() CCSprite* sp2 = CCSprite::create(s_pPathSister2); CCSprite* sp21 = CCSprite::create(s_pPathSister2); - sp1->setPosition(CCPointMake(100,160)); - sp2->setPosition(CCPointMake(380,160)); + sp1->setPosition(ccp(100,160)); + sp2->setPosition(ccp(380,160)); CCActionInterval* rot = CCRotateBy::create(2, 360); CCActionInterval* rot_back = rot->reverse(); @@ -379,7 +379,7 @@ StressTest1::StressTest1() CCSprite *sp1 = CCSprite::create(s_pPathSister1); addChild(sp1, 0, kTagSprite1); - sp1->setPosition( CCPointMake(s.width/2, s.height/2) ); + sp1->setPosition( ccp(s.width/2, s.height/2) ); schedule( schedule_selector(StressTest1::shouldNotCrash), 1.0f); } @@ -397,7 +397,7 @@ void StressTest1::shouldNotCrash(float dt) // if it doesn't, it works Ok. // CocosNode *explosion = [Sprite create:@"grossinis_sister2.png"); - explosion->setPosition( CCPointMake(s.width/2, s.height/2) ); + explosion->setPosition( ccp(s.width/2, s.height/2) ); runAction( CCSequence::create( CCRotateBy::create(2, 360), @@ -432,9 +432,9 @@ StressTest2::StressTest2() CCLayer* sublayer = CCLayer::create(); CCSprite *sp1 = CCSprite::create(s_pPathSister1); - sp1->setPosition( CCPointMake(80, s.height/2) ); + sp1->setPosition( ccp(80, s.height/2) ); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(350,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(350,0)); CCActionInterval* move_ease_inout3 = CCEaseInOut::create((CCActionInterval*)(move->copy()->autorelease()), 2.0f); CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse(); CCFiniteTimeAction* seq3 = CCSequence::create( move_ease_inout3, move_ease_inout_back3, NULL); @@ -443,7 +443,7 @@ StressTest2::StressTest2() CCParticleFire* fire = CCParticleFire::create(); fire->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png")); - fire->setPosition( CCPointMake(80, s.height/2-50) ); + fire->setPosition( ccp(80, s.height/2-50) ); CCActionInterval* copy_seq3 = (CCActionInterval*)(seq3->copy()->autorelease()); @@ -512,20 +512,20 @@ NodeToWorld::NodeToWorld() CCSprite *back = CCSprite::create(s_back3); addChild( back, -10); - back->setAnchorPoint( CCPointMake(0,0) ); + back->setAnchorPoint( ccp(0,0) ); CCSize backSize = back->getContentSize(); CCMenuItem *item = CCMenuItemImage::create(s_PlayNormal, s_PlaySelect); CCMenu *menu = CCMenu::create(item, NULL); menu->alignItemsVertically(); - menu->setPosition( CCPointMake(backSize.width/2, backSize.height/2)); + menu->setPosition( ccp(backSize.width/2, backSize.height/2)); back->addChild(menu); CCActionInterval* rot = CCRotateBy::create(5, 360); CCAction* fe = CCRepeatForever::create( rot); item->runAction( fe ); - CCActionInterval* move = CCMoveBy::create(3, CCPointMake(200,0)); + CCActionInterval* move = CCMoveBy::create(3, ccp(200,0)); CCActionInterval* move_back = move->reverse(); CCFiniteTimeAction* seq = CCSequence::create( move, move_back, NULL); CCAction* fe2 = CCRepeatForever::create((CCActionInterval*)seq); @@ -560,7 +560,7 @@ CameraOrbitTest::CameraOrbitTest() CCSprite *p = CCSprite::create(s_back3); addChild( p, 0); - p->setPosition( CCPointMake(s.width/2, s.height/2) ); + p->setPosition( ccp(s.width/2, s.height/2) ); p->setOpacity( 128 ); CCSprite* sprite; @@ -573,7 +573,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = CCSprite::create(s_pPathGrossini); sprite->setScale(0.5f); p->addChild(sprite, 0); - sprite->setPosition( CCPointMake(s.width/4*1, s.height/2) ); + sprite->setPosition( ccp(s.width/4*1, s.height/2) ); cam = sprite->getCamera(); orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 0, 0); sprite->runAction( CCRepeatForever::create( orbit ) ); @@ -582,7 +582,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = CCSprite::create(s_pPathGrossini); sprite->setScale( 1.0f ); p->addChild(sprite, 0); - sprite->setPosition( CCPointMake(s.width/4*2, s.height/2) ); + sprite->setPosition( ccp(s.width/4*2, s.height/2) ); orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 45, 0); sprite->runAction( CCRepeatForever::create( orbit ) ); @@ -591,7 +591,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = CCSprite::create(s_pPathGrossini); sprite->setScale( 2.0f ); p->addChild(sprite, 0); - sprite->setPosition( CCPointMake(s.width/4*3, s.height/2) ); + sprite->setPosition( ccp(s.width/4*3, s.height/2) ); ss = sprite->getContentSize(); orbit = CCOrbitCamera::create(2, 1, 0, 0, 360, 90, -45), sprite->runAction( CCRepeatForever::create(orbit) ); @@ -638,7 +638,7 @@ CameraZoomTest::CameraZoomTest() // LEFT sprite = CCSprite::create(s_pPathGrossini); addChild( sprite, 0); - sprite->setPosition( CCPointMake(s.width/4*1, s.height/2) ); + sprite->setPosition( ccp(s.width/4*1, s.height/2) ); cam = sprite->getCamera(); cam->setEyeXYZ(0, 0, 415/2); cam->setCenterXYZ(0, 0, 0); @@ -646,12 +646,12 @@ CameraZoomTest::CameraZoomTest() // CENTER sprite = CCSprite::create(s_pPathGrossini); addChild( sprite, 0, 40); - sprite->setPosition(CCPointMake(s.width/4*2, s.height/2)); + sprite->setPosition(ccp(s.width/4*2, s.height/2)); // RIGHT sprite = CCSprite::create(s_pPathGrossini); addChild( sprite, 0, 20); - sprite->setPosition(CCPointMake(s.width/4*3, s.height/2)); + sprite->setPosition(ccp(s.width/4*3, s.height/2)); m_z = 0; scheduleUpdate(); @@ -693,19 +693,19 @@ CameraCenterTest::CameraCenterTest() // LEFT-TOP sprite = CCSprite::create("Images/white-512x512.png"); addChild( sprite, 0); - sprite->setPosition(CCPointMake(s.width/5*1, s.height/5*1)); + sprite->setPosition(ccp(s.width/5*1, s.height/5*1)); sprite->setColor(ccRED); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = CCOrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(CCRepeatForever::create( orbit )); -// [sprite setAnchorPoint: CCPointMake(0,1)); +// [sprite setAnchorPoint: ccp(0,1)); // LEFT-BOTTOM sprite = CCSprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(CCPointMake(s.width/5*1, s.height/5*4)); + sprite->setPosition(ccp(s.width/5*1, s.height/5*4)); sprite->setColor(ccBLUE); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = CCOrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -715,7 +715,7 @@ CameraCenterTest::CameraCenterTest() // RIGHT-TOP sprite = CCSprite::create("Images/white-512x512.png"); addChild( sprite, 0); - sprite->setPosition(CCPointMake(s.width/5*4, s.height/5*1)); + sprite->setPosition(ccp(s.width/5*4, s.height/5*1)); sprite->setColor(ccYELLOW); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = CCOrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -725,7 +725,7 @@ CameraCenterTest::CameraCenterTest() // RIGHT-BOTTOM sprite = CCSprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(CCPointMake(s.width/5*4, s.height/5*4)); + sprite->setPosition(ccp(s.width/5*4, s.height/5*4)); sprite->setColor(ccGREEN); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = CCOrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -734,7 +734,7 @@ CameraCenterTest::CameraCenterTest() // CENTER sprite = CCSprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(CCPointMake(s.width/2, s.height/2)); + sprite->setPosition(ccp(s.width/2, s.height/2)); sprite->setColor(ccWHITE); sprite->setTextureRect(CCRectMake(0, 0, 120, 50)); orbit = CCOrbitCamera::create(10, 1, 0, 0, 360, 0, 0); diff --git a/samples/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp b/samples/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp index 4f78f9f520..d2a647fcf3 100644 --- a/samples/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp +++ b/samples/TestCpp/Classes/ParallaxTest/ParallaxTest.cpp @@ -249,9 +249,9 @@ void ParallaxDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp index bf2122bd9b..eb22af4e64 100644 --- a/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -54,7 +54,7 @@ void DemoFire::onEnter() m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) );//.pvr"); CCPoint p = m_emitter->getPosition(); - m_emitter->setPosition( CCPointMake(p.x, 100) ); + m_emitter->setPosition( ccp(p.x, 100) ); setEmitterPosition(); } @@ -171,7 +171,7 @@ void DemoBigFlower::onEnter() m_emitter->setTangentialAccelVar(0); // emitter position - m_emitter->setPosition( CCPointMake(160,240) ); + m_emitter->setPosition( ccp(160,240) ); m_emitter->setPosVar(CCPointZero); // life of particles @@ -256,7 +256,7 @@ void DemoRotFlower::onEnter() m_emitter->setTangentialAccelVar(0); // emitter position - m_emitter->setPosition( CCPointMake(160,240) ); + m_emitter->setPosition( ccp(160,240) ); m_emitter->setPosVar(CCPointZero); // life of particles @@ -387,7 +387,7 @@ void DemoSmoke::onEnter() m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) ); CCPoint p = m_emitter->getPosition(); - m_emitter->setPosition( CCPointMake( p.x, 100) ); + m_emitter->setPosition( ccp( p.x, 100) ); setEmitterPosition(); } @@ -411,12 +411,12 @@ void DemoSnow::onEnter() m_background->addChild(m_emitter, 10); CCPoint p = m_emitter->getPosition(); - m_emitter->setPosition( CCPointMake( p.x, p.y-110) ); + m_emitter->setPosition( ccp( p.x, p.y-110) ); m_emitter->setLife(3); m_emitter->setLifeVar(1); // gravity - m_emitter->setGravity(CCPointMake(0,-10)); + m_emitter->setGravity(ccp(0,-10)); // speed of particles m_emitter->setSpeed(130); @@ -459,7 +459,7 @@ void DemoRain::onEnter() m_background->addChild(m_emitter, 10); CCPoint p = m_emitter->getPosition(); - m_emitter->setPosition( CCPointMake( p.x, p.y-100) ); + m_emitter->setPosition( ccp( p.x, p.y-100) ); m_emitter->setLife(4); m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) ); @@ -497,7 +497,7 @@ void DemoModernArt::onEnter() m_emitter->setDuration(-1); // gravity - m_emitter->setGravity(CCPointMake(0,0)); + m_emitter->setGravity(ccp(0,0)); // angle m_emitter->setAngle(0); @@ -516,7 +516,7 @@ void DemoModernArt::onEnter() m_emitter->setSpeedVar(10); // emitter position - m_emitter->setPosition( CCPointMake( s.width/2, s.height/2) ); + m_emitter->setPosition( ccp( s.width/2, s.height/2) ); m_emitter->setPosVar(CCPointZero); // life of particles @@ -606,21 +606,21 @@ void ParallaxParticle::onEnter() CCSprite *p1 = CCSprite::create(s_back3); CCSprite *p2 = CCSprite::create(s_back3); - p->addChild( p1, 1, CCPointMake(0.5f,1), CCPointMake(0,250) ); - p->addChild(p2, 2, CCPointMake(1.5f,1), CCPointMake(0,50) ); + p->addChild( p1, 1, ccp(0.5f,1), ccp(0,250) ); + p->addChild(p2, 2, ccp(1.5f,1), ccp(0,50) ); m_emitter = CCParticleFlower::create(); m_emitter->retain(); m_emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) ); p1->addChild(m_emitter, 10); - m_emitter->setPosition( CCPointMake(250,200) ); + m_emitter->setPosition( ccp(250,200) ); CCParticleSun* par = CCParticleSun::create(); p2->addChild(par, 10); par->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_fire) ); - CCActionInterval* move = CCMoveBy::create(4, CCPointMake(300,0)); + CCActionInterval* move = CCMoveBy::create(4, ccp(300,0)); CCActionInterval* move_back = move->reverse(); CCFiniteTimeAction* seq = CCSequence::create( move, move_back, NULL); p->runAction(CCRepeatForever::create((CCActionInterval*)seq)); @@ -1077,11 +1077,11 @@ void ParticleDemo::onEnter(void) CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 28); addChild(label, 100, 1000); - label->setPosition( CCPointMake(s.width/2, s.height-50) ); + label->setPosition( ccp(s.width/2, s.height-50) ); CCLabelTTF *sub = CCLabelTTF::create(subtitle().c_str(), "Arial", 16); addChild(sub, 100); - sub->setPosition(CCPointMake(s.width/2, s.height-80)); + sub->setPosition(ccp(s.width/2, s.height-80)); CCMenuItemImage* item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(ParticleDemo::backCallback) ); @@ -1098,10 +1098,10 @@ void ParticleDemo::onEnter(void) CCMenu *menu = CCMenu::create(item1, item2, item3, item4, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item4->setPosition( ccp( 0, 100) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item4->setPosition( ccp( VisibleRect::left().x, VisibleRect::bottom().y+ 100) ); item4->setAnchorPoint( ccp(0,0) ); addChild( menu, 100 ); @@ -1222,7 +1222,7 @@ void ParticleDemo::setEmitterPosition() CCSize s = CCDirector::sharedDirector()->getWinSize(); if (m_emitter != NULL) { - m_emitter->setPosition( CCPointMake(s.width / 2, s.height / 2) ); + m_emitter->setPosition( ccp(s.width / 2, s.height / 2) ); } } diff --git a/samples/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp b/samples/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp index a4dee167c4..d0703cfafa 100644 --- a/samples/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp +++ b/samples/TestCpp/Classes/PerformanceTest/PerformanceTest.cpp @@ -98,7 +98,7 @@ void PerformBasicLayer::onEnter() CCMenuItemFont::setFontSize(24); CCMenuItemFont* pMainItem = CCMenuItemFont::create("Back", this, menu_selector(PerformBasicLayer::toMainLayer)); - pMainItem->setPosition(ccp(s.width - 50, 25)); + pMainItem->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); CCMenu* pMenu = CCMenu::create(pMainItem, NULL); pMenu->setPosition( CCPointZero ); @@ -107,9 +107,9 @@ void PerformBasicLayer::onEnter() CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(PerformBasicLayer::backCallback) ); CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(PerformBasicLayer::restartCallback) ); CCMenuItemImage *item3 = CCMenuItemImage::create(s_pPathF1, s_pPathF2, this, menu_selector(PerformBasicLayer::nextCallback) ); - item1->setPosition( ccp( s.width/2 - 100,30) ); - item2->setPosition( ccp( s.width/2, 30) ); - item3->setPosition( ccp( s.width/2 + 100,30) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); pMenu->addChild(item1, kItemTagBasic); pMenu->addChild(item2, kItemTagBasic); diff --git a/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index e699e26d95..8cc931d54d 100644 --- a/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -79,9 +79,9 @@ void RenderTextureTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } @@ -151,7 +151,7 @@ RenderTextureSave::RenderTextureSave() CCMenu *menu = CCMenu::create(item1, item2, NULL); this->addChild(menu); menu->alignItemsVertically(); - menu->setPosition(ccp(s.width - 80, s.height - 30)); + menu->setPosition(ccp(VisibleRect::rightTop().x - 80, VisibleRect::rightTop().y - 30)); } string RenderTextureSave::title() diff --git a/samples/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp b/samples/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp index db97d16360..3dd1344e73 100644 --- a/samples/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp +++ b/samples/TestCpp/Classes/RotateWorldTest/RotateWorldTest.cpp @@ -21,7 +21,7 @@ void TestLayer::onEnter() // NSLog( s ); CCLabelTTF* label = CCLabelTTF::create("cocos2d", "Tahoma", 64); - label->setPosition( CCPointMake(x/2,y/2) ); + label->setPosition( ccp(x/2,y/2) ); addChild(label); } @@ -49,9 +49,9 @@ void SpriteLayer::onEnter() spriteSister1->setScale(1.5f); spriteSister2->setScale(1.5f); - sprite->setPosition(CCPointMake(x/2,y/2)); - spriteSister1->setPosition(CCPointMake(40,y/2)); - spriteSister2->setPosition(CCPointMake(x-40,y/2)); + sprite->setPosition(ccp(x/2,y/2)); + spriteSister1->setPosition(ccp(40,y/2)); + spriteSister2->setPosition(ccp(x-40,y/2)); CCAction *rot = CCRotateBy::create(16, -3600); @@ -61,7 +61,7 @@ void SpriteLayer::onEnter() sprite->runAction(rot); - CCActionInterval *jump1 = CCJumpBy::create(4, CCPointMake(-400,0), 100, 4); + CCActionInterval *jump1 = CCJumpBy::create(4, ccp(-400,0), 100, 4); CCActionInterval *jump2 = jump1->reverse(); CCActionInterval *rot1 = CCRotateBy::create(4, 360*2); @@ -96,14 +96,14 @@ void RotateWorldMainLayer::onEnter() CCNode* white = CCLayerColor::create(ccc4(255,255,255,255)); blue->setScale(0.5f); - blue->setPosition(CCPointMake(-x/4,-y/4)); + blue->setPosition(ccp(-x/4,-y/4)); blue->addChild( SpriteLayer::create() ); red->setScale(0.5f); - red->setPosition(CCPointMake(x/4,-y/4)); + red->setPosition(ccp(x/4,-y/4)); green->setScale(0.5f); - green->setPosition(CCPointMake(-x/4,y/4)); + green->setPosition(ccp(-x/4,y/4)); green->addChild(TestLayer::create()); white->setScale(0.5f); diff --git a/samples/TestCpp/Classes/SceneTest/SceneTest.cpp b/samples/TestCpp/Classes/SceneTest/SceneTest.cpp index f9096b87bd..dad2e641a5 100644 --- a/samples/TestCpp/Classes/SceneTest/SceneTest.cpp +++ b/samples/TestCpp/Classes/SceneTest/SceneTest.cpp @@ -30,7 +30,7 @@ SceneTestLayer1::SceneTestLayer1() CCSize s = CCDirector::sharedDirector()->getWinSize(); CCSprite* sprite = CCSprite::create(s_pPathGrossini); addChild(sprite); - sprite->setPosition( CCPointMake(s.width-40, s.height/2) ); + sprite->setPosition( ccp(s.width-40, s.height/2) ); CCActionInterval* rotate = CCRotateBy::create(2, 360); CCAction* repeat = CCRepeatForever::create(rotate); sprite->runAction(repeat); @@ -115,7 +115,7 @@ SceneTestLayer2::SceneTestLayer2() CCSize s = CCDirector::sharedDirector()->getWinSize(); CCSprite* sprite = CCSprite::create(s_pPathGrossini); addChild(sprite); - sprite->setPosition( CCPointMake(s.width-40, s.height/2) ); + sprite->setPosition( ccp(s.width-40, s.height/2) ); CCActionInterval* rotate = CCRotateBy::create(2, 360); CCAction* repeat = CCRepeatForever::create(rotate); sprite->runAction(repeat); @@ -184,7 +184,7 @@ bool SceneTestLayer3::init() CCSprite* sprite = CCSprite::create(s_pPathGrossini); addChild(sprite); - sprite->setPosition( CCPointMake(s.width/2, 40) ); + sprite->setPosition( ccp(s.width/2, 40) ); CCActionInterval* rotate = CCRotateBy::create(2, 360); CCAction* repeat = CCRepeatForever::create(rotate); sprite->runAction(repeat); diff --git a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp index 4e5f4daa66..412c601ec2 100644 --- a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp +++ b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp @@ -84,18 +84,16 @@ void SchedulerTestLayer::onEnter() { CCLayer::onEnter(); - CCSize s = CCDirector::sharedDirector()->getWinSize(); - CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Arial", 32); addChild(label); - label->setPosition(ccp(s.width/2, s.height-50)); + label->setPosition(ccp(VisibleRect::center().x, VisibleRect::top().y-50)); std::string subTitle = subtitle(); if(! subTitle.empty()) { CCLabelTTF* l = CCLabelTTF::create(subTitle.c_str(), "Thonburi", 16); addChild(l, 1); - l->setPosition(ccp(s.width/2, s.height-80)); + l->setPosition(ccp(VisibleRect::center().x, VisibleRect::top().y-80)); } CCMenuItemImage *item1 = CCMenuItemImage::create("Images/b1.png", "Images/b2.png", this, menu_selector(SchedulerTestLayer::backCallback)); @@ -104,9 +102,9 @@ void SchedulerTestLayer::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2)); - item2->setPosition(ccp( s.width/2, item2->getContentSize().height/2)); - item3->setPosition(ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } @@ -250,12 +248,10 @@ SchedulerPauseResumeAll::~SchedulerPauseResumeAll() void SchedulerPauseResumeAll::onEnter() { - SchedulerTestLayer::onEnter(); - - CCSize s = CCDirector::sharedDirector()->getWinSize(); + SchedulerTestLayer::onEnter(); CCSprite *sprite = CCSprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(ccp(s.width/2, s.height/2)); + sprite->setPosition(VisibleRect::center()); this->addChild(sprite); sprite->runAction(CCRepeatForever::create(CCRotateBy::create(3.0, 360))); @@ -1058,12 +1054,12 @@ void TwoSchedulers::onEnter() sliderCtl1 = sliderCtl(); addChild(sliderCtl1); sliderCtl1->retain(); - sliderCtl1->setPosition(ccp(s.width / 4.0f, s.height - 20)); + sliderCtl1->setPosition(ccp(s.width / 4.0f, VisibleRect::top().y - 20)); sliderCtl2 = sliderCtl(); addChild(sliderCtl2); sliderCtl2->retain(); - sliderCtl2->setPosition(ccp(s.width / 4.0f*3.0f, s.height-20)); + sliderCtl2->setPosition(ccp(s.width / 4.0f*3.0f, VisibleRect::top().y-20)); } diff --git a/samples/TestCpp/Classes/ShaderTest/ShaderTest.cpp b/samples/TestCpp/Classes/ShaderTest/ShaderTest.cpp index 565fecf34f..35ce46668b 100644 --- a/samples/TestCpp/Classes/ShaderTest/ShaderTest.cpp +++ b/samples/TestCpp/Classes/ShaderTest/ShaderTest.cpp @@ -85,9 +85,9 @@ bool ShaderTestDemo::init() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(ccp(0, 0)); - item1->setPosition(s.width/2- item2->getContentSize().width*2, item2->getContentSize().height/2); - item2->setPosition(s.width/2, item2->getContentSize().height/2); - item3->setPosition(s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); return true; diff --git a/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index 5ce9ed44e2..927b3c9026 100644 --- a/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -df160f753d51ed74299d3410c03f775116c9ba27 \ No newline at end of file +ce6df80aa5c6af9053f975aeb41f028bc9701f00 \ No newline at end of file diff --git a/samples/TestCpp/Classes/TextInputTest/TextInputTest.cpp b/samples/TestCpp/Classes/TextInputTest/TextInputTest.cpp index 10087ae7a1..fec9dcc15c 100644 --- a/samples/TestCpp/Classes/TextInputTest/TextInputTest.cpp +++ b/samples/TestCpp/Classes/TextInputTest/TextInputTest.cpp @@ -138,9 +138,9 @@ void TextInputTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp( s.width/2 - 100,30)); - item2->setPosition(ccp( s.width/2, 30)); - item3->setPosition(ccp( s.width/2 + 100,30)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index f504fe4239..e5a33b9174 100644 --- a/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -154,9 +154,9 @@ void TextureDemo::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition(ccp( s.width/2 - 100,30)); - item2->setPosition(ccp( s.width/2, 30)); - item3->setPosition(ccp( s.width/2 + 100,30)); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo(); } diff --git a/samples/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp b/samples/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp index 3addc3d29f..e38dfff59f 100644 --- a/samples/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/samples/TestCpp/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -14,8 +14,8 @@ TextureCacheTest::TextureCacheTest() m_pLabelLoading = CCLabelTTF::create("loading...", "Arial", 15); m_pLabelPercent = CCLabelTTF::create("%0", "Arial", 15); - m_pLabelLoading->setPosition(CCPointMake(size.width / 2, size.height / 2 - 20)); - m_pLabelPercent->setPosition(CCPointMake(size.width / 2, size.height / 2 + 20)); + m_pLabelLoading->setPosition(ccp(size.width / 2, size.height / 2 - 20)); + m_pLabelPercent->setPosition(ccp(size.width / 2, size.height / 2 + 20)); this->addChild(m_pLabelLoading); this->addChild(m_pLabelPercent); @@ -65,7 +65,7 @@ void TextureCacheTest::addSprite() // create sprites CCSprite *bg = CCSprite::create("Images/HelloWorld.png"); - bg->setPosition(CCPointMake(size.width / 2, size.height / 2)); + bg->setPosition(ccp(size.width / 2, size.height / 2)); CCSprite *s1 = CCSprite::create("Images/grossini.png"); CCSprite *s2 = CCSprite::create("Images/grossini_dance_01.png"); @@ -89,23 +89,23 @@ void TextureCacheTest::addSprite() CCSprite::create("Images/background3.png"); CCSprite::create("Images/blocks.png"); - s1->setPosition(CCPointMake(50, 50)); - s2->setPosition(CCPointMake(60, 50)); - s3->setPosition(CCPointMake(70, 50)); - s4->setPosition(CCPointMake(80, 50)); - s5->setPosition(CCPointMake(90, 50)); - s6->setPosition(CCPointMake(100, 50)); + s1->setPosition(ccp(50, 50)); + s2->setPosition(ccp(60, 50)); + s3->setPosition(ccp(70, 50)); + s4->setPosition(ccp(80, 50)); + s5->setPosition(ccp(90, 50)); + s6->setPosition(ccp(100, 50)); - s7->setPosition(CCPointMake(50, 180)); - s8->setPosition(CCPointMake(60, 180)); - s9->setPosition(CCPointMake(70, 180)); - s10->setPosition(CCPointMake(80, 180)); - s11->setPosition(CCPointMake(90, 180)); - s12->setPosition(CCPointMake(100, 180)); + s7->setPosition(ccp(50, 180)); + s8->setPosition(ccp(60, 180)); + s9->setPosition(ccp(70, 180)); + s10->setPosition(ccp(80, 180)); + s11->setPosition(ccp(90, 180)); + s12->setPosition(ccp(100, 180)); - s13->setPosition(CCPointMake(50, 270)); - s14->setPosition(CCPointMake(60, 270)); - s15->setPosition(CCPointMake(70, 270)); + s13->setPosition(ccp(50, 270)); + s14->setPosition(ccp(60, 270)); + s15->setPosition(ccp(70, 270)); this->addChild(bg); diff --git a/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 2d5f1bd7cb..372574d285 100644 --- a/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1456,9 +1456,9 @@ TileDemo::TileDemo(void) CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/TouchesTest/Ball.cpp b/samples/TestCpp/Classes/TouchesTest/Ball.cpp index 8295691f2b..84107bb219 100644 --- a/samples/TestCpp/Classes/TouchesTest/Ball.cpp +++ b/samples/TestCpp/Classes/TouchesTest/Ball.cpp @@ -1,5 +1,6 @@ #include "Ball.h" #include "Paddle.h" +#include "VisibleRect.h" Ball::Ball(void) { @@ -25,18 +26,16 @@ Ball* Ball::ballWithTexture(CCTexture2D* aTexture) void Ball::move(float delta) { - CCSize size = CCDirector::sharedDirector()->getWinSize(); - this->setPosition( ccpAdd(getPosition(), ccpMult(m_velocity, delta)) ); - if (getPosition().x > size.width - radius()) + if (getPosition().x > VisibleRect::right().x - radius()) { - setPosition( ccp( size.width - radius(), getPosition().y) ); + setPosition( ccp( VisibleRect::right().x - radius(), getPosition().y) ); m_velocity.x *= -1; } - else if (getPosition().x < radius()) + else if (getPosition().x < VisibleRect::left().x + radius()) { - setPosition( ccp(radius(), getPosition().y) ); + setPosition( ccp(VisibleRect::left().x + radius(), getPosition().y) ); m_velocity.x *= -1; } } @@ -61,13 +60,13 @@ void Ball::collideWithPaddle(Paddle* paddle) if (getPosition().y > midY && getPosition().y <= highY + radius()) { - setPosition( CCPointMake(getPosition().x, highY + radius()) ); + setPosition( ccp(getPosition().x, highY + radius()) ); hit = true; angleOffset = (float)M_PI / 2; } else if (getPosition().y < midY && getPosition().y >= lowY - radius()) { - setPosition( CCPointMake(getPosition().x, lowY - radius()) ); + setPosition( ccp(getPosition().x, lowY - radius()) ); hit = true; angleOffset = -(float)M_PI / 2; } diff --git a/samples/TestCpp/Classes/TouchesTest/Paddle.cpp b/samples/TestCpp/Classes/TouchesTest/Paddle.cpp index 491d21f8a6..f4e16d4b02 100644 --- a/samples/TestCpp/Classes/TouchesTest/Paddle.cpp +++ b/samples/TestCpp/Classes/TouchesTest/Paddle.cpp @@ -74,7 +74,7 @@ void Paddle::ccTouchMoved(CCTouch* touch, CCEvent* event) CCPoint touchPoint = touch->getLocation(); - setPosition( CCPointMake(touchPoint.x, getPosition().y) ); + setPosition( ccp(touchPoint.x, getPosition().y) ); } CCObject* Paddle::copyWithZone(CCZone *pZone) diff --git a/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp b/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp index cf7a472952..9b74cf4314 100644 --- a/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp +++ b/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp @@ -42,12 +42,10 @@ void PongScene::MainMenuCallback(CCObject* pSender) //------------------------------------------------------------------ PongLayer::PongLayer() { - m_tWinSize = CCDirector::sharedDirector()->getWinSize(); - - m_ballStartingVelocity = CCPointMake(20.0f, -100.0f); + m_ballStartingVelocity = ccp(20.0f, -100.0f); m_ball = Ball::ballWithTexture( CCTextureCache::sharedTextureCache()->addImage(s_Ball) ); - m_ball->setPosition( CCPointMake(m_tWinSize.width/2, m_tWinSize.height/2) ); + m_ball->setPosition( VisibleRect::center() ); m_ball->setVelocity( m_ballStartingVelocity ); addChild( m_ball ); m_ball->retain(); @@ -57,19 +55,19 @@ PongLayer::PongLayer() CCArray *paddlesM = CCArray::createWithCapacity(4); Paddle* paddle = Paddle::paddleWithTexture(paddleTexture); - paddle->setPosition( CCPointMake(m_tWinSize.width/2, 15) ); + paddle->setPosition( ccp(VisibleRect::center().x, VisibleRect::bottom().y + 15) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); - paddle->setPosition( CCPointMake(m_tWinSize.width/2, m_tWinSize.height - kStatusBarHeight - 15) ); + paddle->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 15) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); - paddle->setPosition( CCPointMake(m_tWinSize.width/2, 100) ); + paddle->setPosition( ccp(VisibleRect::center().x, VisibleRect::bottom().y + 100) ); paddlesM->addObject( paddle ); paddle = Paddle::paddleWithTexture( paddleTexture ); - paddle->setPosition( CCPointMake(m_tWinSize.width/2, m_tWinSize.height - kStatusBarHeight - 100) ); + paddle->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 100) ); paddlesM->addObject( paddle ); m_paddles = (CCArray*)paddlesM->copy(); @@ -98,7 +96,7 @@ void PongLayer::resetAndScoreBallForPlayer(int player) { m_ballStartingVelocity = ccpMult(m_ballStartingVelocity, -1.1f); m_ball->setVelocity( m_ballStartingVelocity ); - m_ball->setPosition( CCPointMake(m_tWinSize.width/2, m_tWinSize.height/2) ); + m_ball->setPosition( VisibleRect::center() ); // TODO -- scoring } @@ -119,9 +117,9 @@ void PongLayer::doStep(float delta) m_ball->collideWithPaddle( paddle ); } - if (m_ball->getPosition().y > m_tWinSize.height - kStatusBarHeight + m_ball->radius()) + if (m_ball->getPosition().y > VisibleRect::top().y - kStatusBarHeight + m_ball->radius()) resetAndScoreBallForPlayer( kLowPlayer ); - else if (m_ball->getPosition().y < -m_ball->radius()) + else if (m_ball->getPosition().y < VisibleRect::bottom().y-m_ball->radius()) resetAndScoreBallForPlayer( kHighPlayer ); m_ball->draw(); } diff --git a/samples/TestCpp/Classes/TouchesTest/TouchesTest.h b/samples/TestCpp/Classes/TouchesTest/TouchesTest.h index b7b6221d9f..971199ef22 100644 --- a/samples/TestCpp/Classes/TouchesTest/TouchesTest.h +++ b/samples/TestCpp/Classes/TouchesTest/TouchesTest.h @@ -20,7 +20,6 @@ class Ball; class PongLayer : public CCLayer { private: - CCSize m_tWinSize; Ball* m_ball; CCArray* m_paddles; CCPoint m_ballStartingVelocity; diff --git a/samples/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp b/samples/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp index d7e7c0297f..158e157d83 100644 --- a/samples/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp +++ b/samples/TestCpp/Classes/TransitionsTest/TransitionsTest.cpp @@ -283,17 +283,17 @@ TestLayer1::TestLayer1(void) y = size.height; CCSprite* bg1 = CCSprite::create(s_back1); - bg1->setPosition( CCPointMake(size.width/2, size.height/2) ); + bg1->setPosition( ccp(size.width/2, size.height/2) ); addChild(bg1, -1); CCLabelTTF* title = CCLabelTTF::create( (transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); addChild(title); title->setColor( ccc3(255,32,32) ); - title->setPosition( CCPointMake(x/2, y-100) ); + title->setPosition( ccp(x/2, y-100) ); CCLabelTTF* label = CCLabelTTF::create("SCENE 1", "Marker Felt", 38); label->setColor( ccc3(16,16,255)); - label->setPosition( CCPointMake(x/2,y/2)); + label->setPosition( ccp(x/2,y/2)); addChild( label); // menu @@ -304,9 +304,9 @@ TestLayer1::TestLayer1(void) CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( size.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( size.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( size.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); @@ -412,17 +412,17 @@ TestLayer2::TestLayer2() y = size.height; CCSprite* bg1 = CCSprite::create(s_back2); - bg1->setPosition( CCPointMake(size.width/2, size.height/2) ); + bg1->setPosition( ccp(size.width/2, size.height/2) ); addChild(bg1, -1); CCLabelTTF* title = CCLabelTTF::create((transitions[s_nSceneIdx]).c_str(), "Thonburi", 32 ); addChild(title); title->setColor( ccc3(255,32,32) ); - title->setPosition( CCPointMake(x/2, y-100) ); + title->setPosition( ccp(x/2, y-100) ); CCLabelTTF* label = CCLabelTTF::create("SCENE 2", "Marker Felt", 38); label->setColor( ccc3(16,16,255)); - label->setPosition( CCPointMake(x/2,y/2)); + label->setPosition( ccp(x/2,y/2)); addChild( label); // menu @@ -433,9 +433,9 @@ TestLayer2::TestLayer2() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition( CCPointZero ); - item1->setPosition( ccp( size.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( size.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( size.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); diff --git a/samples/TestCpp/Classes/VisibleRect.cpp b/samples/TestCpp/Classes/VisibleRect.cpp new file mode 100644 index 0000000000..9595afa791 --- /dev/null +++ b/samples/TestCpp/Classes/VisibleRect.cpp @@ -0,0 +1,73 @@ +#include "VisibleRect.h" + +CCRect VisibleRect::s_visibleRect; + +void VisibleRect::lazyInit() +{ + if (s_visibleRect.size.width == 0.0f && s_visibleRect.size.height == 0.0f) + { + CCEGLView* pEGLView = CCEGLView::sharedOpenGLView(); + s_visibleRect.origin = pEGLView->getVisibleOrigin(); + s_visibleRect.size = pEGLView->getVisibleSize(); + } +} + +CCRect VisibleRect::getVisibleRect() +{ + lazyInit(); + return CCRectMake(s_visibleRect.origin.x, s_visibleRect.origin.y, s_visibleRect.size.width, s_visibleRect.size.height); +} + +CCPoint VisibleRect::left() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height/2); +} + +CCPoint VisibleRect::right() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height/2); +} + +CCPoint VisibleRect::top() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height); +} + +CCPoint VisibleRect::bottom() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y); +} + +CCPoint VisibleRect::center() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height/2); +} + +CCPoint VisibleRect::leftTop() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height); +} + +CCPoint VisibleRect::rightTop() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height); +} + +CCPoint VisibleRect::leftBottom() +{ + lazyInit(); + return s_visibleRect.origin; +} + +CCPoint VisibleRect::rightBottom() +{ + lazyInit(); + return ccp(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y); +} diff --git a/samples/TestCpp/Classes/VisibleRect.h b/samples/TestCpp/Classes/VisibleRect.h new file mode 100644 index 0000000000..2f94da90a3 --- /dev/null +++ b/samples/TestCpp/Classes/VisibleRect.h @@ -0,0 +1,26 @@ +#ifndef __VISIBLERECT_H__ +#define __VISIBLERECT_H__ + +#include "cocos2d.h" +USING_NS_CC; + +class VisibleRect +{ +public: + static CCRect getVisibleRect(); + + static CCPoint left(); + static CCPoint right(); + static CCPoint top(); + static CCPoint bottom(); + static CCPoint center(); + static CCPoint leftTop(); + static CCPoint rightTop(); + static CCPoint leftBottom(); + static CCPoint rightBottom(); +private: + static void lazyInit(); + static CCRect s_visibleRect; +}; + +#endif /* __VISIBLERECT_H__ */ diff --git a/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp index bb143af603..dcb3139c5c 100644 --- a/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -81,9 +81,9 @@ void ZwoptexTest::onEnter() CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); menu->setPosition(CCPointZero); - item1->setPosition( ccp( s.width/2 - item2->getContentSize().width*2, item2->getContentSize().height/2) ); - item2->setPosition( ccp( s.width/2, item2->getContentSize().height/2) ); - item3->setPosition( ccp( s.width/2 + item2->getContentSize().width*2, item2->getContentSize().height/2) ); + item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); } diff --git a/samples/TestCpp/Classes/controller.cpp b/samples/TestCpp/Classes/controller.cpp index 74d91e5a8c..183772f85d 100644 --- a/samples/TestCpp/Classes/controller.cpp +++ b/samples/TestCpp/Classes/controller.cpp @@ -135,10 +135,9 @@ TestController::TestController() // add close menu CCMenuItemImage *pCloseItem = CCMenuItemImage::create(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) ); CCMenu* pMenu =CCMenu::create(pCloseItem, NULL); - CCSize s = CCDirector::sharedDirector()->getWinSize(); pMenu->setPosition( CCPointZero ); - pCloseItem->setPosition(CCPointMake( s.width - 30, s.height - 30)); + pCloseItem->setPosition(ccp( VisibleRect::right().x - 30, VisibleRect::top().y - 30)); // add menu items for tests m_pItemMenu = CCMenu::create(); @@ -152,10 +151,10 @@ TestController::TestController() CCMenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, this, menu_selector(TestController::menuCallback)); m_pItemMenu->addChild(pMenuItem, i + 10000); - pMenuItem->setPosition( CCPointMake( s.width / 2, (s.height - (i + 1) * LINE_SPACE) )); + pMenuItem->setPosition( ccp( VisibleRect::center().x, (VisibleRect::top().y - (i + 1) * LINE_SPACE) )); } - m_pItemMenu->setContentSize(CCSizeMake(s.width, (TESTS_COUNT + 1) * (LINE_SPACE))); + m_pItemMenu->setContentSize(CCSizeMake(VisibleRect::getVisibleRect().size.width, (TESTS_COUNT + 1) * (LINE_SPACE))); m_pItemMenu->setPosition(s_tCurPos); addChild(m_pItemMenu); @@ -210,16 +209,16 @@ void TestController::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) CCPoint curPos = m_pItemMenu->getPosition(); CCPoint nextPos = ccp(curPos.x, curPos.y + nMoveY); - CCSize winSize = CCDirector::sharedDirector()->getWinSize(); + if (nextPos.y < 0.0f) { m_pItemMenu->setPosition(CCPointZero); return; } - if (nextPos.y > ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height)) + if (nextPos.y > ((TESTS_COUNT + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - m_pItemMenu->setPosition(ccp(0, ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height))); + m_pItemMenu->setPosition(ccp(0, ((TESTS_COUNT + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } diff --git a/samples/TestCpp/Classes/testBasic.cpp b/samples/TestCpp/Classes/testBasic.cpp index a3ffca4967..e0c900df00 100644 --- a/samples/TestCpp/Classes/testBasic.cpp +++ b/samples/TestCpp/Classes/testBasic.cpp @@ -20,9 +20,9 @@ void TestScene::onEnter() CCMenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, this, menu_selector(TestScene::MainMenuCallback)); CCMenu* pMenu =CCMenu::create(pMenuItem, NULL); - CCSize s = CCDirector::sharedDirector()->getWinSize(); + pMenu->setPosition( CCPointZero ); - pMenuItem->setPosition( CCPointMake( s.width - 50, 25) ); + pMenuItem->setPosition( ccp( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/samples/TestCpp/Classes/testBasic.h b/samples/TestCpp/Classes/testBasic.h index fa4e77cc2b..38790c2c71 100644 --- a/samples/TestCpp/Classes/testBasic.h +++ b/samples/TestCpp/Classes/testBasic.h @@ -2,6 +2,7 @@ #define _TEST_BASIC_H_ #include "cocos2d.h" +#include "VisibleRect.h" USING_NS_CC; using namespace std; diff --git a/samples/TestCpp/proj.linux/Makefile b/samples/TestCpp/proj.linux/Makefile index f05c22528a..3cf5f55790 100644 --- a/samples/TestCpp/proj.linux/Makefile +++ b/samples/TestCpp/proj.linux/Makefile @@ -121,6 +121,7 @@ OBJECTS = ../Classes/AccelerometerTest/AccelerometerTest.o \ ../Classes/controller.o \ ../Classes/testBasic.o \ ../Classes/AppDelegate.o \ + ../Classes/VisibleRect.o \ ./main.o diff --git a/samples/TestCpp/proj.win32/TestCpp.vcproj b/samples/TestCpp/proj.win32/TestCpp.vcproj index ee8c75b63b..647dcac1bd 100644 --- a/samples/TestCpp/proj.win32/TestCpp.vcproj +++ b/samples/TestCpp/proj.win32/TestCpp.vcproj @@ -224,6 +224,14 @@ RelativePath="..\Classes\tests.h" > + + + + diff --git a/samples/TestCpp/proj.win32/TestCpp.vcxproj b/samples/TestCpp/proj.win32/TestCpp.vcxproj index 2b40ecd7c9..de07d0a9b9 100644 --- a/samples/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/TestCpp/proj.win32/TestCpp.vcxproj @@ -113,6 +113,7 @@ + @@ -201,6 +202,7 @@ + diff --git a/samples/TestCpp/proj.win32/TestCpp.vcxproj.filters b/samples/TestCpp/proj.win32/TestCpp.vcxproj.filters index 79976ce976..44b21ac25e 100644 --- a/samples/TestCpp/proj.win32/TestCpp.vcxproj.filters +++ b/samples/TestCpp/proj.win32/TestCpp.vcxproj.filters @@ -459,6 +459,9 @@ Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest + + Classes + @@ -893,5 +896,8 @@ Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest + + Classes + \ No newline at end of file From 0b381357b08fafc564267f2e3885b952e6425fee Mon Sep 17 00:00:00 2001 From: Sergey Buravtsov Date: Wed, 24 Oct 2012 03:14:40 +0400 Subject: [PATCH 09/23] Fix for correct unscheduling and instance destruction --- extensions/network/HttpClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/network/HttpClient.cpp b/extensions/network/HttpClient.cpp index 1fa241540c..6a5b0709db 100644 --- a/extensions/network/HttpClient.cpp +++ b/extensions/network/HttpClient.cpp @@ -354,9 +354,9 @@ CCHttpClient* CCHttpClient::getInstance() void CCHttpClient::destroyInstance() { - CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks), - CCHttpClient::getInstance()); - CC_SAFE_RELEASE_NULL(s_pHttpClient); + CC_ASSERT(s_pHttpClient); + CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks), s_pHttpClient); + s_pHttpClient->release(); } CCHttpClient::CCHttpClient() @@ -376,7 +376,7 @@ CCHttpClient::~CCHttpClient() sem_post(s_pSem); } - CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks), this); + s_pHttpClient = NULL; } //Lazy create semaphore & mutex & thread From c797af0fe9dcf0107bf7df559f865486678861f9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Oct 2012 10:03:19 +0800 Subject: [PATCH 10/23] fixed #1522: CCEGLView class of desktop platforms should override CCEGLViewProtocol::setScissorInPoints. --- cocos2dx/platform/linux/CCEGLView.cpp | 9 +++++++++ cocos2dx/platform/linux/CCEGLView.h | 2 ++ cocos2dx/platform/mac/CCEGLView.h | 1 + cocos2dx/platform/mac/CCEGLView.mm | 10 ++++++++++ cocos2dx/platform/win32/CCEGLView.cpp | 8 ++++++++ cocos2dx/platform/win32/CCEGLView.h | 2 ++ 6 files changed, 32 insertions(+) diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index 99744d378b..6cabdcb5ac 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -261,6 +261,15 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h) (GLsizei)(h * m_fScaleY * m_fFrameZoomFactor)); } +void CCEGLView::setScissorInPoints(float x , float y , float w , float h) +{ + glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor), + (GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor), + (GLsizei)(w * m_fScaleX * m_fFrameZoomFactor), + (GLsizei)(h * m_fScaleY * m_fFrameZoomFactor)); +} + + bool CCEGLView::isOpenGLReady() { return bIsInit; diff --git a/cocos2dx/platform/linux/CCEGLView.h b/cocos2dx/platform/linux/CCEGLView.h index 65cb82f7ff..c65489efdd 100644 --- a/cocos2dx/platform/linux/CCEGLView.h +++ b/cocos2dx/platform/linux/CCEGLView.h @@ -33,6 +33,8 @@ public: */ virtual void setFrameSize(float width, float height); virtual void setViewPortInPoints(float x , float y , float w , float h); + virtual void setScissorInPoints(float x , float y , float w , float h); + /* * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop. */ diff --git a/cocos2dx/platform/mac/CCEGLView.h b/cocos2dx/platform/mac/CCEGLView.h index c0182b8bbd..3c1708cd82 100755 --- a/cocos2dx/platform/mac/CCEGLView.h +++ b/cocos2dx/platform/mac/CCEGLView.h @@ -49,6 +49,7 @@ public: * Set opengl view port rectangle with points. */ virtual void setViewPortInPoints(float x , float y , float w , float h); + virtual void setScissorInPoints(float x , float y , float w , float h); virtual void setIMEKeyboardState(bool bOpen); virtual void setMultiTouchMask(bool mask); diff --git a/cocos2dx/platform/mac/CCEGLView.mm b/cocos2dx/platform/mac/CCEGLView.mm index 92d22ab021..b098e8a1f8 100755 --- a/cocos2dx/platform/mac/CCEGLView.mm +++ b/cocos2dx/platform/mac/CCEGLView.mm @@ -98,6 +98,16 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h) (GLsizei)(h * m_fScaleY * frameZoomFactor)); } +void CCEGLView::setScissorInPoints(float x , float y , float w , float h) +{ + float frameZoomFactor = [[EAGLView sharedEGLView] frameZoomFactor]; + + glScissor((GLint)(x * m_fScaleX * frameZoomFactor + m_obViewPortRect.origin.x * frameZoomFactor), + (GLint)(y * m_fScaleY * frameZoomFactor + m_obViewPortRect.origin.y * frameZoomFactor), + (GLsizei)(w * m_fScaleX * frameZoomFactor), + (GLsizei)(h * m_fScaleY * frameZoomFactor)); +} + void CCEGLView::setMultiTouchMask(bool mask) { //EAGLView *glView = [EAGLView sharedEGLView]; diff --git a/cocos2dx/platform/win32/CCEGLView.cpp b/cocos2dx/platform/win32/CCEGLView.cpp index ed49e15a7b..3dc8a05be3 100644 --- a/cocos2dx/platform/win32/CCEGLView.cpp +++ b/cocos2dx/platform/win32/CCEGLView.cpp @@ -697,6 +697,14 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h) (GLsizei)(h * m_fScaleY * m_fFrameZoomFactor)); } +void CCEGLView::setScissorInPoints(float x , float y , float w , float h) +{ + glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor), + (GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor), + (GLsizei)(w * m_fScaleX * m_fFrameZoomFactor), + (GLsizei)(h * m_fScaleY * m_fFrameZoomFactor)); +} + CCEGLView* CCEGLView::sharedOpenGLView() { static CCEGLView* s_pEglView = NULL; diff --git a/cocos2dx/platform/win32/CCEGLView.h b/cocos2dx/platform/win32/CCEGLView.h index 896ac939db..c1c3d475e2 100644 --- a/cocos2dx/platform/win32/CCEGLView.h +++ b/cocos2dx/platform/win32/CCEGLView.h @@ -73,6 +73,8 @@ public: void setAccelerometerKeyHook( LPFN_ACCELEROMETER_KEYHOOK lpfnAccelerometerKeyHook ); virtual void setViewPortInPoints(float x , float y , float w , float h); + virtual void setScissorInPoints(float x , float y , float w , float h); + // static function /** @brief get the shared main open gl window From 38cd1ecd4602a3bd3379ed6da06765b7dd999d31 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 24 Oct 2012 10:09:25 +0800 Subject: [PATCH 11/23] fixed #1512: add VisableRect.cpp/h into iOS and mac project --- .../proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- .../proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index e56c8faf78..9916eb7ff8 100644 --- a/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -ac3dd574a71d609ed13ae44389209e35f22d6392 \ No newline at end of file +5982545917607b9c428c7256b3c983b0526804a5 \ No newline at end of file diff --git a/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index 54d31e8db3..0995775fa4 100644 --- a/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -bbbb2450a8de63794b1d5e2b00341086f5aee574 \ No newline at end of file +7150b3ae596f748ee383fb0fb7d59a8c317a7d08 \ No newline at end of file From ffe52a157f1424fa6bbf4756bf0f99d5690a07f1 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Oct 2012 16:12:40 +0800 Subject: [PATCH 12/23] Removed some unused codes about "enableRetinaDisplay". --- samples/HelloLua/Classes/AppDelegate.cpp | 3 --- samples/MoonWarriors/Classes/AppDelegate.cpp | 6 +++--- samples/TestJavascript/Classes/AppDelegate.cpp | 3 --- samples/TestLua/Classes/AppDelegate.cpp | 3 --- template/android/Classes/AppDelegate.cpp | 3 --- .../CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp | 3 --- template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp | 3 --- .../cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp | 3 --- .../cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp | 3 --- .../xcode4/cocos2dx_js.xctemplate/Classes/AppDelegate.cpp | 3 --- .../xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp | 5 ----- 11 files changed, 3 insertions(+), 35 deletions(-) diff --git a/samples/HelloLua/Classes/AppDelegate.cpp b/samples/HelloLua/Classes/AppDelegate.cpp index c33c165795..666373c5a7 100644 --- a/samples/HelloLua/Classes/AppDelegate.cpp +++ b/samples/HelloLua/Classes/AppDelegate.cpp @@ -28,9 +28,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCEGLView::sharedOpenGLView()->setDesignResolutionSize(480, 320, kResolutionNoBorder); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/samples/MoonWarriors/Classes/AppDelegate.cpp b/samples/MoonWarriors/Classes/AppDelegate.cpp index f4947cf2e5..ffc68f1efa 100644 --- a/samples/MoonWarriors/Classes/AppDelegate.cpp +++ b/samples/MoonWarriors/Classes/AppDelegate.cpp @@ -23,10 +23,10 @@ bool AppDelegate::applicationDidFinishLaunching() // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); + + // Set the design resolution CCEGLView::sharedOpenGLView()->setDesignResolutionSize(320, 480, kResolutionShowAll); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - + // turn on display FPS pDirector->setDisplayStats(true); diff --git a/samples/TestJavascript/Classes/AppDelegate.cpp b/samples/TestJavascript/Classes/AppDelegate.cpp index 354a9db101..154d9db7ac 100644 --- a/samples/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/TestJavascript/Classes/AppDelegate.cpp @@ -25,9 +25,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/samples/TestLua/Classes/AppDelegate.cpp b/samples/TestLua/Classes/AppDelegate.cpp index e87925fc68..7ee7266ca7 100644 --- a/samples/TestLua/Classes/AppDelegate.cpp +++ b/samples/TestLua/Classes/AppDelegate.cpp @@ -23,9 +23,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. -// pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/android/Classes/AppDelegate.cpp b/template/android/Classes/AppDelegate.cpp index 447d84142f..61fb994cdb 100644 --- a/template/android/Classes/AppDelegate.cpp +++ b/template/android/Classes/AppDelegate.cpp @@ -20,9 +20,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp index 052cce558a..09c0a6af80 100644 --- a/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp +++ b/template/msvc/CCAppWiz.win32/Templates/1033/Classes/AppDelegate.cpp @@ -31,9 +31,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. -// pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp index 01eedc43ca..f9dd07bc43 100644 --- a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp @@ -28,9 +28,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp index 0a066f1849..142b992f45 100644 --- a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp @@ -28,9 +28,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp index 41237a35e9..9b7ad94815 100644 --- a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp @@ -28,9 +28,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/xcode4/cocos2dx_js.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_js.xctemplate/Classes/AppDelegate.cpp index c0b3a774af..15b072046c 100644 --- a/template/xcode4/cocos2dx_js.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_js.xctemplate/Classes/AppDelegate.cpp @@ -28,9 +28,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); diff --git a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp index 21ca3dcefc..ba615ffad3 100644 --- a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp @@ -26,11 +26,6 @@ bool AppDelegate::applicationDidFinishLaunching() CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); - CCEGLView::sharedOpenGLView()->setDesignResolutionSize(480, 320, kResolutionShowAll); - - // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. - // pDirector->enableRetinaDisplay(true); - // turn on display FPS pDirector->setDisplayStats(true); From e07ca43c3d33ebbb41f332a0ee8c3fb1c9684689 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 24 Oct 2012 16:28:54 +0800 Subject: [PATCH 13/23] fixes a compilation error in TestCpp. --- samples/TestCpp/Classes/TouchesTest/Ball.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/TestCpp/Classes/TouchesTest/Ball.cpp b/samples/TestCpp/Classes/TouchesTest/Ball.cpp index 84107bb219..9fa2e56419 100644 --- a/samples/TestCpp/Classes/TouchesTest/Ball.cpp +++ b/samples/TestCpp/Classes/TouchesTest/Ball.cpp @@ -1,6 +1,6 @@ #include "Ball.h" #include "Paddle.h" -#include "VisibleRect.h" +#include "../VisibleRect.h" Ball::Ball(void) { From 26f7b3679747117e67034877c8661fca9468e8e6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 25 Oct 2012 11:40:24 +0800 Subject: [PATCH 14/23] update submodule for JS-Bindings auto-gen codes. --- scripting/javascript/bindings/generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 79337ba58c..c38342f85f 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 79337ba58c9b43e603a0ec41db6cdb968d7284f2 +Subproject commit c38342f85f58e3238a7597d973457ca03b4a79c4 From 84e48ed7e7c9f8ade1d3dc9edebc8e7f088772aa Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 25 Oct 2012 14:32:28 +0800 Subject: [PATCH 15/23] issue #1312:update libcurl for android and strip all libs --- .../prebuilt/libcurl/include/curl/curl.h | 196 +++++++++++++----- .../prebuilt/libcurl/include/curl/curlbuild.h | 22 +- .../prebuilt/libcurl/include/curl/curlver.h | 14 +- .../prebuilt/libcurl/include/curl/easy.h | 4 +- .../libcurl/include/curl/typecheck-gcc.h | 144 +++++++------ .../libs/armeabi-v7a/libcurl.a.REMOVED.git-id | 2 +- .../libs/armeabi/libcurl.a.REMOVED.git-id | 2 +- .../libcurl/libs/x86/libcurl.a.REMOVED.git-id | 2 +- .../libs/armeabi-v7a/libjpeg.a.REMOVED.git-id | 2 +- .../libs/armeabi/libjpeg.a.REMOVED.git-id | 2 +- .../libjpeg/libs/x86/libjpeg.a.REMOVED.git-id | 2 +- .../libs/armeabi-v7a/libpng.a.REMOVED.git-id | 2 +- .../libs/armeabi/libpng.a.REMOVED.git-id | 2 +- .../libpng/libs/x86/libpng.a.REMOVED.git-id | 2 +- .../libs/armeabi-v7a/libtiff.a.REMOVED.git-id | 2 +- .../libs/armeabi/libtiff.a.REMOVED.git-id | 2 +- .../libtiff/libs/x86/libtiff.a.REMOVED.git-id | 2 +- .../libs/armeabi-v7a/libxml2.a.REMOVED.git-id | 2 +- .../libs/armeabi/libxml2.a.REMOVED.git-id | 2 +- .../libxml2/libs/x86/libxml2.a.REMOVED.git-id | 2 +- 20 files changed, 260 insertions(+), 150 deletions(-) diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h index 4744f48305..2cad28298e 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curl.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -55,34 +55,32 @@ #include #include -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ - !defined(__CYGWIN__) || defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__)) /* The check above prevents the winsock2 inclusion if winsock.h already was included, since they can't co-exist without problems */ #include #include #endif -#else +#endif /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on system that are known to + libc5-based Linux systems. Only include it on systems that are known to require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ - defined(ANDROID) || \ + defined(ANDROID) || defined(__ANDROID__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include #endif -#ifndef _WIN32_WCE +#if !defined(WIN32) && !defined(_WIN32_WCE) #include #endif + #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) #include #endif -#include -#endif #ifdef __BEOS__ #include @@ -122,7 +120,7 @@ typedef void CURL; #ifndef curl_socket_typedef /* socket typedef */ -#ifdef WIN32 +#if defined(WIN32) && !defined(__LWIP_OPT_H__) typedef SOCKET curl_socket_t; #define CURL_SOCKET_BAD INVALID_SOCKET #else @@ -189,10 +187,10 @@ typedef int (*curl_progress_callback)(void *clientp, #define CURL_MAX_HTTP_HEADER (100*1024) #endif - /* This is a magic return code for the write callback that, when returned, will signal libcurl to pause receiving on the current transfer. */ #define CURL_WRITEFUNC_PAUSE 0x10000001 + typedef size_t (*curl_write_callback)(char *buffer, size_t size, size_t nitems, @@ -315,6 +313,13 @@ typedef enum { CURLSOCKTYPE_LAST /* never use */ } curlsocktype; +/* The return code from the sockopt_callback can signal information back + to libcurl: */ +#define CURL_SOCKOPT_OK 0 +#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return + CURLE_ABORTED_BY_CALLBACK */ +#define CURL_SOCKOPT_ALREADY_CONNECTED 2 + typedef int (*curl_sockopt_callback)(void *clientp, curl_socket_t curlfd, curlsocktype purpose); @@ -334,6 +339,9 @@ typedef curl_socket_t curlsocktype purpose, struct curl_sockaddr *address); +typedef int +(*curl_closesocket_callback)(void *clientp, curl_socket_t item); + typedef enum { CURLIOE_OK, /* I/O operation successful */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ @@ -394,7 +402,8 @@ typedef enum { CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ - CURLE_OBSOLETE4, /* 4 - NOT USED */ + CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for + 7.17.0, reused in April 2011 for 7.21.5] */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ @@ -402,9 +411,12 @@ typedef enum { CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server due to lack of access - when login fails this is not returned. */ - CURLE_OBSOLETE10, /* 10 - NOT USED */ + CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for + 7.15.4, reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ - CURLE_OBSOLETE12, /* 12 - NOT USED */ + CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server + [was obsoleted in August 2007 for 7.17.0, + reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_CANT_GET_HOST, /* 15 */ @@ -444,7 +456,7 @@ typedef enum { CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ CURLE_OBSOLETE46, /* 46 - NOT USED */ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ - CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ + CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ CURLE_OBSOLETE50, /* 50 - NOT USED */ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint @@ -459,7 +471,7 @@ typedef enum { CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ - CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ + CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ @@ -499,17 +511,24 @@ typedef enum { 7.19.0) */ CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ - CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */ + CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ - CURL_LAST /* never use! */ } CURLcode; #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ -/* Backwards compatibility with older names */ +/* Previously obsoletes error codes re-used in 7.24.0 */ +#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED +#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT + +/* compatibility with older names */ +#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING + +/* The following were added in 7.21.5, April 2011 */ +#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION /* The following were added in 7.17.1 */ /* These are scheduled to disappear by 2009 */ @@ -517,7 +536,7 @@ typedef enum { /* The following were added in 7.17.0 */ /* These are scheduled to disappear by 2009 */ -#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */ +#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 @@ -529,7 +548,7 @@ typedef enum { #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 -#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4 +#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE @@ -579,17 +598,32 @@ typedef enum { in 7.18.0 */ } curl_proxytype; /* this enum was added in 7.10 */ -#define CURLAUTH_NONE 0 /* nothing */ -#define CURLAUTH_BASIC (1<<0) /* Basic (default) */ -#define CURLAUTH_DIGEST (1<<1) /* Digest */ -#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */ -#define CURLAUTH_NTLM (1<<3) /* NTLM */ -#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */ -#define CURLAUTH_ONLY (1<<31) /* used together with a single other - type to force no auth or just that - single type */ -#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */ -#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) +/* + * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: + * + * CURLAUTH_NONE - No HTTP authentication + * CURLAUTH_BASIC - HTTP Basic authentication (default) + * CURLAUTH_DIGEST - HTTP Digest authentication + * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication + * CURLAUTH_NTLM - HTTP NTLM authentication + * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour + * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper + * CURLAUTH_ONLY - Use together with a single other type to force no + * authentication or just that single type + * CURLAUTH_ANY - All fine types set + * CURLAUTH_ANYSAFE - All fine types except Basic + */ + +#define CURLAUTH_NONE ((unsigned long)0) +#define CURLAUTH_BASIC (((unsigned long)1)<<0) +#define CURLAUTH_DIGEST (((unsigned long)1)<<1) +#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2) +#define CURLAUTH_NTLM (((unsigned long)1)<<3) +#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) +#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) +#define CURLAUTH_ONLY (((unsigned long)1)<<31) +#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) +#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ @@ -599,6 +633,10 @@ typedef enum { #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY +#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ +#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ +#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ + #define CURL_ERROR_SIZE 256 struct curl_khkey { @@ -649,6 +687,15 @@ typedef enum { CURLUSESSL_LAST /* not an option, never use */ } curl_usessl; +/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ + +/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the + name of improving interoperability with older servers. Some SSL libraries + have introduced work-arounds for this flaw but those work-arounds sometimes + make the SSL communication fail. To regain functionality with those broken + servers, a user can this way allow the vulnerability back. */ +#define CURLSSLOPT_ALLOW_BEAST (1<<0) + #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ @@ -743,7 +790,7 @@ typedef enum { #endif #ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number +#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG @@ -901,9 +948,7 @@ typedef enum { /* send linked-list of post-transfer QUOTE commands */ CINIT(POSTQUOTE, OBJECTPOINT, 39), - /* Pass a pointer to string of the output using full variable-replacement - as described elsewhere. */ - CINIT(WRITEINFO, OBJECTPOINT, 40), + CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */ CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(HEADER, LONG, 42), /* throw the header out too */ @@ -912,7 +957,7 @@ typedef enum { CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(POST, LONG, 47), /* HTTP POST method */ - CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ + CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ @@ -979,9 +1024,7 @@ typedef enum { /* Max amount of cached alive connections */ CINIT(MAXCONNECTS, LONG, 71), - /* What policy to use when closing connections when the cache is filled - up */ - CINIT(CLOSEPOLICY, LONG, 72), + CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */ /* 73 = OBSOLETE */ @@ -1055,7 +1098,7 @@ typedef enum { CINIT(SSLENGINE_DEFAULT, LONG, 90), /* Non-zero value means to use the global dns cache */ - CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ + CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */ /* DNS cache timeout */ CINIT(DNS_CACHE_TIMEOUT, LONG, 92), @@ -1092,8 +1135,9 @@ typedef enum { CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like - the response to be compressed. */ - CINIT(ENCODING, OBJECTPOINT, 102), + the response to be compressed. Before 7.21.6, this was known as + CURLOPT_ENCODING */ + CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), @@ -1106,8 +1150,8 @@ typedef enum { and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), - /* Specifically switch on or off the FTP engine's use of the EPRT command ( it - also disables the LPRT attempt). By default, those ones will always be + /* Specifically switch on or off the FTP engine's use of the EPRT command ( + it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), @@ -1451,6 +1495,46 @@ typedef enum { /* Set authentication type for authenticated TLS */ CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), + /* Set to 1 to enable the "TE:" header in HTTP requests to ask for + compressed transfer-encoded responses. Set to 0 to disable the use of TE: + in outgoing requests. The current default is 0, but it might change in a + future libcurl release. + + libcurl will ask for the compressed methods it knows of, and if that + isn't any, it will not ask for transfer-encoding at all even if this + option is set to 1. + + */ + CINIT(TRANSFER_ENCODING, LONG, 207), + + /* Callback function for closing socket (instead of close(2)). The callback + should have type curl_closesocket_callback */ + CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), + CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), + + /* allow GSSAPI credential delegation */ + CINIT(GSSAPI_DELEGATION, LONG, 210), + + /* Set the name servers to use for DNS resolution */ + CINIT(DNS_SERVERS, OBJECTPOINT, 211), + + /* Time-out accept operations (currently for FTP only) after this amount + of miliseconds. */ + CINIT(ACCEPTTIMEOUT_MS, LONG, 212), + + /* Set TCP keepalive */ + CINIT(TCP_KEEPALIVE, LONG, 213), + + /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ + CINIT(TCP_KEEPIDLE, LONG, 214), + CINIT(TCP_KEEPINTVL, LONG, 215), + + /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ + CINIT(SSL_OPTIONS, LONG, 216), + + /* set the SMTP auth originator */ + CINIT(MAIL_AUTH, OBJECTPOINT, 217), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; @@ -1554,13 +1638,16 @@ enum CURL_TLSAUTH { }; /* symbols to use with CURLOPT_POSTREDIR. - CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that - CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */ + CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 + can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 + | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ #define CURL_REDIR_GET_ALL 0 #define CURL_REDIR_POST_301 1 #define CURL_REDIR_POST_302 2 -#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302) +#define CURL_REDIR_POST_303 4 +#define CURL_REDIR_POST_ALL \ + (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) typedef enum { CURL_TIMECOND_NONE, @@ -1679,7 +1766,8 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, * Should return the buffer length passed to it as the argument "len" on * success. */ -typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); +typedef size_t (*curl_formget_callback)(void *arg, const char *buf, + size_t len); /* * NAME curl_formget() @@ -1978,8 +2066,9 @@ typedef enum { CURLSHE_BAD_OPTION, /* 1 */ CURLSHE_IN_USE, /* 2 */ CURLSHE_INVALID, /* 3 */ - CURLSHE_NOMEM, /* out of memory */ - CURLSHE_LAST /* never use */ + CURLSHE_NOMEM, /* 4 out of memory */ + CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ + CURLSHE_LAST /* never use */ } CURLSHcode; typedef enum { @@ -2059,8 +2148,9 @@ typedef struct { #define CURL_VERSION_CONV (1<<12) /* character conversions supported */ #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ +#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ -/* + /* * NAME curl_version_info() * * DESCRIPTION diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h index 81f4a28547..98ede6eef7 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlbuild.h @@ -8,7 +8,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -59,52 +59,52 @@ /* ================================================================ */ #ifdef CURL_SIZEOF_LONG -# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" +#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined #endif #ifdef CURL_TYPEOF_CURL_SOCKLEN_T -# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" +#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_SOCKLEN_T -# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" +#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_TYPEOF_CURL_OFF_T -# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" +#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_T -# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" +#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_TU -# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" +#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined #endif #ifdef CURL_FORMAT_OFF_T -# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" +#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_OFF_T -# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" +#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_T -# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" +#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_TU -# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" +#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined #endif diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h index c7c7238e8e..b7e8acf538 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/curlver.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -26,17 +26,17 @@ a script at release-time. This was made its own header file in 7.11.2 */ /* This is the global package copyright */ -#define LIBCURL_COPYRIGHT "1996 - 2010 Daniel Stenberg, ." +#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, ." /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "7.21.4" +#define LIBCURL_VERSION "7.26.0" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 21 -#define LIBCURL_VERSION_PATCH 4 +#define LIBCURL_VERSION_MINOR 26 +#define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier parsing and comparions by programs. The LIBCURL_VERSION_NUM define will @@ -53,7 +53,7 @@ and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ -#define LIBCURL_VERSION_NUM 0x071504 +#define LIBCURL_VERSION_NUM 0x071a00 /* * This is the date and time when the full source package was created. The @@ -64,6 +64,6 @@ * * "Mon Feb 12 11:35:33 UTC 2007" */ -#define LIBCURL_TIMESTAMP "Thu Feb 17 12:19:40 UTC 2011" +#define LIBCURL_TIMESTAMP "Thu May 24 16:05:42 UTC 2012" #endif /* __CURL_CURLVER_H */ diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h index 1ddb4fe5a2..c1e3e76096 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/easy.h @@ -53,8 +53,8 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); * * Creates a new curl session handle with the same options set for the handle * passed in. Duplicating a handle could only be a matter of cloning data and - * options, internal state info and things like persistant connections cannot - * be transfered. It is useful in multithreaded applications when you can run + * options, internal state info and things like persistent connections cannot + * be transferred. It is useful in multithreaded applications when you can run * curl_easy_duphandle() for each new thread to avoid a series of identical * curl_easy_setopt() invokes in every thread. */ diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h index e6f74a9584..f8917e8112 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/include/curl/typecheck-gcc.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -41,66 +41,66 @@ #define curl_easy_setopt(handle, option, value) \ __extension__ ({ \ __typeof__ (option) _curl_opt = option; \ - if (__builtin_constant_p(_curl_opt)) { \ - if (_curl_is_long_option(_curl_opt)) \ - if (!_curl_is_long(value)) \ + if(__builtin_constant_p(_curl_opt)) { \ + if(_curl_is_long_option(_curl_opt)) \ + if(!_curl_is_long(value)) \ _curl_easy_setopt_err_long(); \ - if (_curl_is_off_t_option(_curl_opt)) \ - if (!_curl_is_off_t(value)) \ + if(_curl_is_off_t_option(_curl_opt)) \ + if(!_curl_is_off_t(value)) \ _curl_easy_setopt_err_curl_off_t(); \ - if (_curl_is_string_option(_curl_opt)) \ - if (!_curl_is_string(value)) \ + if(_curl_is_string_option(_curl_opt)) \ + if(!_curl_is_string(value)) \ _curl_easy_setopt_err_string(); \ - if (_curl_is_write_cb_option(_curl_opt)) \ - if (!_curl_is_write_cb(value)) \ + if(_curl_is_write_cb_option(_curl_opt)) \ + if(!_curl_is_write_cb(value)) \ _curl_easy_setopt_err_write_callback(); \ - if ((_curl_opt) == CURLOPT_READFUNCTION) \ - if (!_curl_is_read_cb(value)) \ + if((_curl_opt) == CURLOPT_READFUNCTION) \ + if(!_curl_is_read_cb(value)) \ _curl_easy_setopt_err_read_cb(); \ - if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ - if (!_curl_is_ioctl_cb(value)) \ + if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ + if(!_curl_is_ioctl_cb(value)) \ _curl_easy_setopt_err_ioctl_cb(); \ - if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ - if (!_curl_is_sockopt_cb(value)) \ + if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ + if(!_curl_is_sockopt_cb(value)) \ _curl_easy_setopt_err_sockopt_cb(); \ - if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ - if (!_curl_is_opensocket_cb(value)) \ + if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ + if(!_curl_is_opensocket_cb(value)) \ _curl_easy_setopt_err_opensocket_cb(); \ - if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ - if (!_curl_is_progress_cb(value)) \ + if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ + if(!_curl_is_progress_cb(value)) \ _curl_easy_setopt_err_progress_cb(); \ - if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ - if (!_curl_is_debug_cb(value)) \ + if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ + if(!_curl_is_debug_cb(value)) \ _curl_easy_setopt_err_debug_cb(); \ - if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ - if (!_curl_is_ssl_ctx_cb(value)) \ + if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ + if(!_curl_is_ssl_ctx_cb(value)) \ _curl_easy_setopt_err_ssl_ctx_cb(); \ - if (_curl_is_conv_cb_option(_curl_opt)) \ - if (!_curl_is_conv_cb(value)) \ + if(_curl_is_conv_cb_option(_curl_opt)) \ + if(!_curl_is_conv_cb(value)) \ _curl_easy_setopt_err_conv_cb(); \ - if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \ - if (!_curl_is_seek_cb(value)) \ + if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ + if(!_curl_is_seek_cb(value)) \ _curl_easy_setopt_err_seek_cb(); \ - if (_curl_is_cb_data_option(_curl_opt)) \ - if (!_curl_is_cb_data(value)) \ + if(_curl_is_cb_data_option(_curl_opt)) \ + if(!_curl_is_cb_data(value)) \ _curl_easy_setopt_err_cb_data(); \ - if ((_curl_opt) == CURLOPT_ERRORBUFFER) \ - if (!_curl_is_error_buffer(value)) \ + if((_curl_opt) == CURLOPT_ERRORBUFFER) \ + if(!_curl_is_error_buffer(value)) \ _curl_easy_setopt_err_error_buffer(); \ - if ((_curl_opt) == CURLOPT_STDERR) \ - if (!_curl_is_FILE(value)) \ + if((_curl_opt) == CURLOPT_STDERR) \ + if(!_curl_is_FILE(value)) \ _curl_easy_setopt_err_FILE(); \ - if (_curl_is_postfields_option(_curl_opt)) \ - if (!_curl_is_postfields(value)) \ + if(_curl_is_postfields_option(_curl_opt)) \ + if(!_curl_is_postfields(value)) \ _curl_easy_setopt_err_postfields(); \ - if ((_curl_opt) == CURLOPT_HTTPPOST) \ - if (!_curl_is_arr((value), struct curl_httppost)) \ + if((_curl_opt) == CURLOPT_HTTPPOST) \ + if(!_curl_is_arr((value), struct curl_httppost)) \ _curl_easy_setopt_err_curl_httpost(); \ - if (_curl_is_slist_option(_curl_opt)) \ - if (!_curl_is_arr((value), struct curl_slist)) \ + if(_curl_is_slist_option(_curl_opt)) \ + if(!_curl_is_arr((value), struct curl_slist)) \ _curl_easy_setopt_err_curl_slist(); \ - if ((_curl_opt) == CURLOPT_SHARE) \ - if (!_curl_is_ptr((value), CURLSH)) \ + if((_curl_opt) == CURLOPT_SHARE) \ + if(!_curl_is_ptr((value), CURLSH)) \ _curl_easy_setopt_err_CURLSH(); \ } \ curl_easy_setopt(handle, _curl_opt, value); \ @@ -111,18 +111,18 @@ __extension__ ({ \ #define curl_easy_getinfo(handle, info, arg) \ __extension__ ({ \ __typeof__ (info) _curl_info = info; \ - if (__builtin_constant_p(_curl_info)) { \ - if (_curl_is_string_info(_curl_info)) \ - if (!_curl_is_arr((arg), char *)) \ + if(__builtin_constant_p(_curl_info)) { \ + if(_curl_is_string_info(_curl_info)) \ + if(!_curl_is_arr((arg), char *)) \ _curl_easy_getinfo_err_string(); \ - if (_curl_is_long_info(_curl_info)) \ - if (!_curl_is_arr((arg), long)) \ + if(_curl_is_long_info(_curl_info)) \ + if(!_curl_is_arr((arg), long)) \ _curl_easy_getinfo_err_long(); \ - if (_curl_is_double_info(_curl_info)) \ - if (!_curl_is_arr((arg), double)) \ + if(_curl_is_double_info(_curl_info)) \ + if(!_curl_is_arr((arg), double)) \ _curl_easy_getinfo_err_double(); \ - if (_curl_is_slist_info(_curl_info)) \ - if (!_curl_is_arr((arg), struct curl_slist *)) \ + if(_curl_is_slist_info(_curl_info)) \ + if(!_curl_is_arr((arg), struct curl_slist *)) \ _curl_easy_getinfo_err_curl_slist(); \ } \ curl_easy_getinfo(handle, _curl_info, arg); \ @@ -141,15 +141,17 @@ __extension__ ({ \ /* To define a new warning, use _CURL_WARNING(identifier, "message") */ #define _CURL_WARNING(id, message) \ - static void __attribute__((warning(message))) __attribute__((unused)) \ - __attribute__((noinline)) id(void) { __asm__(""); } + static void __attribute__((__warning__(message))) \ + __attribute__((__unused__)) __attribute__((__noinline__)) \ + id(void) { __asm__(""); } _CURL_WARNING(_curl_easy_setopt_err_long, "curl_easy_setopt expects a long argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_off_t, "curl_easy_setopt expects a curl_off_t argument for this option") _CURL_WARNING(_curl_easy_setopt_err_string, - "curl_easy_setopt expects a string (char* or char[]) argument for this option" + "curl_easy_setopt expects a " + "string (char* or char[]) argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_write_callback, "curl_easy_setopt expects a curl_write_callback argument for this option") @@ -160,7 +162,8 @@ _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, "curl_easy_setopt expects a curl_sockopt_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, - "curl_easy_setopt expects a curl_opensocket_callback argument for this option" + "curl_easy_setopt expects a " + "curl_opensocket_callback argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_progress_cb, "curl_easy_setopt expects a curl_progress_callback argument for this option") @@ -173,9 +176,11 @@ _CURL_WARNING(_curl_easy_setopt_err_conv_cb, _CURL_WARNING(_curl_easy_setopt_err_seek_cb, "curl_easy_setopt expects a curl_seek_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_cb_data, - "curl_easy_setopt expects a private data pointer as argument for this option") + "curl_easy_setopt expects a " + "private data pointer as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_error_buffer, - "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option") + "curl_easy_setopt expects a " + "char buffer of CURL_ERROR_SIZE as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_FILE, "curl_easy_setopt expects a FILE* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_postfields, @@ -224,7 +229,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, (option) == CURLOPT_PROXYUSERNAME || \ (option) == CURLOPT_PROXYPASSWORD || \ (option) == CURLOPT_NOPROXY || \ - (option) == CURLOPT_ENCODING || \ + (option) == CURLOPT_ACCEPT_ENCODING || \ (option) == CURLOPT_REFERER || \ (option) == CURLOPT_USERAGENT || \ (option) == CURLOPT_COOKIE || \ @@ -388,7 +393,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ /* XXX: also check size of an char[] array? */ #define _curl_is_error_buffer(expr) \ - (__builtin_types_compatible_p(__typeof__(expr), char *) || \ + (_curl_is_NULL(expr) || \ + __builtin_types_compatible_p(__typeof__(expr), char *) || \ __builtin_types_compatible_p(__typeof__(expr), char[])) /* evaluates to true if expr is of type (const) void* or (const) FILE* */ @@ -481,7 +487,8 @@ typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, curlsocktype); -/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ +/* evaluates to true if expr is of type curl_opensocket_callback or + "similar" */ #define _curl_is_opensocket_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ @@ -516,7 +523,11 @@ typedef int (_curl_progress_callback2)(const void *, _curl_callback_compatible((expr), _curl_debug_callback1) || \ _curl_callback_compatible((expr), _curl_debug_callback2) || \ _curl_callback_compatible((expr), _curl_debug_callback3) || \ - _curl_callback_compatible((expr), _curl_debug_callback4)) + _curl_callback_compatible((expr), _curl_debug_callback4) || \ + _curl_callback_compatible((expr), _curl_debug_callback5) || \ + _curl_callback_compatible((expr), _curl_debug_callback6) || \ + _curl_callback_compatible((expr), _curl_debug_callback7) || \ + _curl_callback_compatible((expr), _curl_debug_callback8)) typedef int (_curl_debug_callback1) (CURL *, curl_infotype, char *, size_t, void *); typedef int (_curl_debug_callback2) (CURL *, @@ -525,6 +536,14 @@ typedef int (_curl_debug_callback3) (CURL *, curl_infotype, const char *, size_t, void *); typedef int (_curl_debug_callback4) (CURL *, curl_infotype, const char *, size_t, const void *); +typedef int (_curl_debug_callback5) (CURL *, + curl_infotype, unsigned char *, size_t, void *); +typedef int (_curl_debug_callback6) (CURL *, + curl_infotype, unsigned char *, size_t, const void *); +typedef int (_curl_debug_callback7) (CURL *, + curl_infotype, const unsigned char *, size_t, void *); +typedef int (_curl_debug_callback8) (CURL *, + curl_infotype, const unsigned char *, size_t, const void *); /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ /* this is getting even messier... */ @@ -550,7 +569,8 @@ typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); -typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *); +typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, + const void *); #else typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id index 85faa41a12..186bc6d3b2 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -89c49d395ece44cf2d891cd5c2a84f819e229d30 \ No newline at end of file +a23875412ca7660ea9bada038fd05f84534b2b85 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id index 2b4ee2dcf5..b874fdb868 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -4dc0690a9f8419b4aba821eeb739d6beb4242cda \ No newline at end of file +a04bd2973966590291accfdcd0624e015334652a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id index 9747da75e9..7144bc7322 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -fca1b81187a22728c6c352f121ac03f8abf2ae75 \ No newline at end of file +dbf2fdecca23632d13cf417e0a7e5412c4786a5c \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id index 78fc8dfc68..c41b4a903f 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -68aaf2639b745d8479ad875745409f9cf65f4b93 \ No newline at end of file +21cc0d62d0f8fb702fb49766e9bbc14ff54be5bf \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id index ff515f9e04..1698f90c51 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -0319233cc1a28ea568fdc4ced57f2d1cfe11e81f \ No newline at end of file +a28766b9e95f451e1743be3562ce2e5fb17da67a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id index 17d5d4a48f..b155ac8f59 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -54d8098e43887d3bb3a773542d869491d77d8e45 \ No newline at end of file +4a9068c1be4b5e5143ec763db264efda1f455f6c \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id index 968b0d0810..b43e4bc0ba 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id @@ -1 +1 @@ -2f84bee7e68f8b6766688634d6a35221cd006a66 \ No newline at end of file +22e24082eae1ffb8482044a22300fb82abdbbf72 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id index f893d8f899..611488db2e 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id @@ -1 +1 @@ -67df2bca4c4bdf2c53f0ae219f55ad5efdd8dd48 \ No newline at end of file +b60c3d26c3a22525dd4c910f97e22885c3c3a4bd \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id index a0ec7b688d..8fa6854858 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id @@ -1 +1 @@ -03f601480de32bbcc70313b8afda1bbf0194944c \ No newline at end of file +c67e594f3c1e1583fa2c2db0a609865da6b01df8 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id index b6cae73302..ef45440b47 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -08568c709e115ac77d96705d4b5cb47c1f494514 \ No newline at end of file +847ed6f57adc00708211a427105807cd955179e3 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id index c88b1b6289..498bc34b54 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -8ae8c1465f02581e5f557c549ccbd31f77ac392e \ No newline at end of file +1d348a7593920f7706d1689a1d1d9530ed50cf00 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id index 85d964f2e2..145b64b2a3 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -829ad7281999aff0543b4aca6574779ef6c48644 \ No newline at end of file +15244fa0efa82876e4b4d525af784fac1ac358d4 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id index 38c23edc1f..89d674b4e0 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -813164629a16c93ebc3ff20a39072f2cae2aee3a \ No newline at end of file +62051e2fe2e9a8d383d827f83c12321b7d3a83fe \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id index f3101146e8..06bae4982e 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -936f891620a0dbe86ae34809f3472d57497a6098 \ No newline at end of file +9978214f8c9fe1a615368f222515d6a1badf1b23 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id index ac8cf02993..cb2ab3b9b0 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -e9908a726968236013dd4a7488211f936d1eb406 \ No newline at end of file +ca9e20ce632d8e0c45d40bd51ecce8dde8150fc1 \ No newline at end of file From 81ff3d349590db308fed195af011e29f73aa3dd5 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 25 Oct 2012 16:30:14 +0800 Subject: [PATCH 16/23] issue #1312: use --strip-unneeded parameter to strip lib --- .../prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id | 2 +- .../prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id | 2 +- .../android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id | 2 +- .../prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id | 2 +- .../prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id | 2 +- .../android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id | 2 +- .../prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id | 2 +- .../prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id | 2 +- .../android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id | 2 +- .../prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id | 2 +- .../prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id | 2 +- .../android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id | 2 +- .../prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id | 2 +- .../prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id | 2 +- .../android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id index 186bc6d3b2..2f6af6f123 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi-v7a/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -a23875412ca7660ea9bada038fd05f84534b2b85 \ No newline at end of file +a62cf1a73b170a4fee840de349019fd33e9970f4 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id index b874fdb868..46336725d2 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/armeabi/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -a04bd2973966590291accfdcd0624e015334652a \ No newline at end of file +e83a0838166d5ccccc914361fc7d98f2b6e12e1e \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id index 7144bc7322..2aea0ff9e2 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libcurl/libs/x86/libcurl.a.REMOVED.git-id @@ -1 +1 @@ -dbf2fdecca23632d13cf417e0a7e5412c4786a5c \ No newline at end of file +bfedd8e90d438c9fcf1c469fa7bb0ff2a59167af \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id index c41b4a903f..e6f2193250 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi-v7a/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -21cc0d62d0f8fb702fb49766e9bbc14ff54be5bf \ No newline at end of file +e3bc493ab52f7a8d3da445e15f43c0c775740192 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id index 1698f90c51..13239bd184 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -a28766b9e95f451e1743be3562ce2e5fb17da67a \ No newline at end of file +78e9ef9f9794da2d2098e733fd90ecad403ed735 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id index b155ac8f59..2655455767 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/x86/libjpeg.a.REMOVED.git-id @@ -1 +1 @@ -4a9068c1be4b5e5143ec763db264efda1f455f6c \ No newline at end of file +e8d210cb8607af7aa98219fce89ea1e6c14f8fc2 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id index b43e4bc0ba..16e9c6924d 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi-v7a/libpng.a.REMOVED.git-id @@ -1 +1 @@ -22e24082eae1ffb8482044a22300fb82abdbbf72 \ No newline at end of file +527a6e940f83b5d54b37b193af2081647cea4e90 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id index 611488db2e..b4165dcf2c 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/armeabi/libpng.a.REMOVED.git-id @@ -1 +1 @@ -b60c3d26c3a22525dd4c910f97e22885c3c3a4bd \ No newline at end of file +7fc417297c12c4199a31febebb0e9c53abb5f762 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id index 8fa6854858..7f1854025a 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libpng/libs/x86/libpng.a.REMOVED.git-id @@ -1 +1 @@ -c67e594f3c1e1583fa2c2db0a609865da6b01df8 \ No newline at end of file +649d8a9d888a3368eeb0b63ac2832b9faebc3502 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id index ef45440b47..7e11081f2b 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi-v7a/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -847ed6f57adc00708211a427105807cd955179e3 \ No newline at end of file +ee2bf5ad51a3a637deeee985082760f9b843bbe7 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id index 498bc34b54..247ad6a921 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/armeabi/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -1d348a7593920f7706d1689a1d1d9530ed50cf00 \ No newline at end of file +3e4d0de19a158758f19a5b65db8b7f14c314771a \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id index 145b64b2a3..c038ab38fa 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libtiff/libs/x86/libtiff.a.REMOVED.git-id @@ -1 +1 @@ -15244fa0efa82876e4b4d525af784fac1ac358d4 \ No newline at end of file +f14376ce9ace14d386cb5a3b2178454bad786fb6 \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id index 89d674b4e0..6d74f742a1 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi-v7a/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -62051e2fe2e9a8d383d827f83c12321b7d3a83fe \ No newline at end of file +7a291da70df8112d8be685fd326a4171a9eff66c \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id index 06bae4982e..4275730ad2 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/armeabi/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -9978214f8c9fe1a615368f222515d6a1badf1b23 \ No newline at end of file +f2063d0cb885da76b53ff7278eb34635c460d09e \ No newline at end of file diff --git a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id index cb2ab3b9b0..79dd036f57 100644 --- a/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id +++ b/cocos2dx/platform/third_party/android/prebuilt/libxml2/libs/x86/libxml2.a.REMOVED.git-id @@ -1 +1 @@ -ca9e20ce632d8e0c45d40bd51ecce8dde8150fc1 \ No newline at end of file +22740a73cdc408d9a8557d0f462f0a49bd29e26e \ No newline at end of file From f1da845bf993477987421439a083ebbd12e45c1b Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 25 Oct 2012 16:33:34 +0800 Subject: [PATCH 17/23] Updated the submodule of cocos2d-html5-test. --- samples/TestJavascript/cocos2d-html5-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/TestJavascript/cocos2d-html5-tests b/samples/TestJavascript/cocos2d-html5-tests index ba897b31b3..01d0bb4e80 160000 --- a/samples/TestJavascript/cocos2d-html5-tests +++ b/samples/TestJavascript/cocos2d-html5-tests @@ -1 +1 @@ -Subproject commit ba897b31b3175afdfb88cd52f24cc7520fb9cf0b +Subproject commit 01d0bb4e8091382647f929cb734330970c67b089 From c99c9baf6d172d14ac2e6d926c7e2020e87425aa Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 25 Oct 2012 17:07:18 +0800 Subject: [PATCH 18/23] Update AUTHORS --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8af4791fe9..dfdc779e83 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,9 @@ Developers: Rolando Abarca Javascript Binding and testjs + sburavtsov + fix for correct unscheduling and instance destruction of extensions/network/HttpClient.cpp + wenbin wang add korean language support fix getDeviceModel bug in android CocosDenshion From 132d927f18a819df72aba3937ae75e12015f2d12 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 26 Oct 2012 09:57:01 +0800 Subject: [PATCH 19/23] Updated the submodule of tools/cxx-generator. --- tools/cxx-generator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cxx-generator b/tools/cxx-generator index 5486f5cb9a..6e14e97554 160000 --- a/tools/cxx-generator +++ b/tools/cxx-generator @@ -1 +1 @@ -Subproject commit 5486f5cb9aeeceb41882468cb7186b0740061cdd +Subproject commit 6e14e97554b3cd25a1a69eace05377ff7d58aded From 0ce4f61bb624ddf7e3b8494af18c76e5702272fd Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 26 Oct 2012 10:04:29 +0800 Subject: [PATCH 20/23] Updating submodule reference to latest autogenerated bindings. --- scripting/javascript/bindings/generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index c38342f85f..e1a713cbaf 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit c38342f85f58e3238a7597d973457ca03b4a79c4 +Subproject commit e1a713cbaf36b2de82b64ab148532b4c30fa2f20 From 77b69262c8c433e9818f5765c6da766b96520557 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 26 Oct 2012 10:10:34 +0800 Subject: [PATCH 21/23] not invoke CCDirector::reshapeProjection() in EAGLView::layoutSubViews --- cocos2dx/platform/ios/EAGLView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/platform/ios/EAGLView.mm b/cocos2dx/platform/ios/EAGLView.mm index 46588c2a17..47eb9ff862 100755 --- a/cocos2dx/platform/ios/EAGLView.mm +++ b/cocos2dx/platform/ios/EAGLView.mm @@ -263,7 +263,7 @@ static EAGLView *view = 0; cocos2d::CCSize size; size.width = size_.width; size.height = size_.height; - cocos2d::CCDirector::sharedDirector()->reshapeProjection(size); + //cocos2d::CCDirector::sharedDirector()->reshapeProjection(size); // Avoid flicker. Issue #350 //[director performSelectorOnMainThread:@selector(drawScene) withObject:nil waitUntilDone:YES]; From 9d530c8d54411afe6b5e498c94fc03a8be94f358 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 26 Oct 2012 12:04:45 +0800 Subject: [PATCH 22/23] fix a compiling error --- cocos2dx/platform/mac/EAGLView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/platform/mac/EAGLView.mm b/cocos2dx/platform/mac/EAGLView.mm index b10ff34cf6..37681020fe 100755 --- a/cocos2dx/platform/mac/EAGLView.mm +++ b/cocos2dx/platform/mac/EAGLView.mm @@ -158,7 +158,7 @@ static EAGLView *view; cocos2d::CCDirector *director = cocos2d::CCDirector::sharedDirector(); CGSize size = NSSizeToCGSize(rect.size); cocos2d::CCSize ccsize = cocos2d::CCSizeMake(size.width, size.height); - director->reshapeProjection(ccsize); + //director->reshapeProjection(ccsize); // avoid flicker director->drawScene(); From 138ea49b0e73a009c9587dc12568479e1fb843e7 Mon Sep 17 00:00:00 2001 From: Andrew Perrault Date: Sat, 27 Oct 2012 09:58:49 -0400 Subject: [PATCH 23/23] fixed a couple typos --- cocos2dx/platform/blackberry/CCEGLView.h | 2 +- cocos2dx/proj.blackberry/.project | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/blackberry/CCEGLView.h b/cocos2dx/platform/blackberry/CCEGLView.h index 27e07421f0..dc9c9998bb 100644 --- a/cocos2dx/platform/blackberry/CCEGLView.h +++ b/cocos2dx/platform/blackberry/CCEGLView.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "cocoa/CCGeometry.h" #include "platform/CCEGLViewProtocol.h" -#include "platform/CCPlatFormMacros.h" +#include "platform/CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos2dx/proj.blackberry/.project b/cocos2dx/proj.blackberry/.project index 70f91bd758..c504e72c35 100644 --- a/cocos2dx/proj.blackberry/.project +++ b/cocos2dx/proj.blackberry/.project @@ -208,7 +208,7 @@ tilemap_parallax_nodes 2 - PARENT-1-PROJECT_LOC/tileMap_parallax_nodes + PARENT-1-PROJECT_LOC/tilemap_parallax_nodes touch_dispatcher