diff --git a/cocos/2d/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp index 6dedb2f3cb..6b12aa58e1 100644 --- a/cocos/2d/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -590,7 +590,7 @@ void EventDispatcher::dispatchEventToListeners(EventListenerVector* listeners, c // priority < 0 if (fixedPriorityListeners) { - CCASSERT(listeners->getGt0Index() <= fixedPriorityListeners->size(), "Out of range exception!"); + CCASSERT(listeners->getGt0Index() <= static_cast(fixedPriorityListeners->size()), "Out of range exception!"); if (!fixedPriorityListeners->empty()) { diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index caaf2eb6ba..19aace6e9c 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -388,7 +388,7 @@ unsigned char * makeDistanceMap( unsigned char *img, long width, long height) double * data = (double *) calloc( pixelAmount, sizeof(double) ); double * outside = (double *) calloc( pixelAmount, sizeof(double) ); double * inside = (double *) calloc( pixelAmount, sizeof(double) ); - unsigned int i,j; + long i,j; // Convert img into double (data) rescale image levels between 0 and 1 long outWidth = width + 2 * FontFreeType::DistanceMapSpread; diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index 1007dd9585..983d7e9d14 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -492,7 +492,7 @@ void TMXLayer::setTileGID(uint32_t gid, const Point& pos, TMXTileFlags flags) { CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, "TMXLayer: invalid position"); CCASSERT(_tiles && _atlasIndexArray, "TMXLayer: the tiles map has been released"); - CCASSERT(gid == 0 || gid >= _tileSet->_firstGid, "TMXLayer: invalid gid" ); + CCASSERT(gid == 0 || (int)gid >= _tileSet->_firstGid, "TMXLayer: invalid gid" ); TMXTileFlags currentFlags; uint32_t currentGID = getTileGIDAt(pos, ¤tFlags); diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index d615b11c46..2ef5097230 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -241,7 +241,7 @@ void ActionNode::insertFrame(int index, ActionFrame* frame) return; } int frameType = frame->getFrameType(); - if(frameType < _frameArray.size()) + if(frameType < (int)_frameArray.size()) { auto cArray = _frameArray.at(frameType); cArray->insert(index, frame); @@ -256,7 +256,7 @@ void ActionNode::addFrame(ActionFrame* frame) } int frameType = frame->getFrameType(); - if(frameType < _frameArray.size()) + if(frameType < (int)_frameArray.size()) { auto cArray = _frameArray.at(frameType); cArray->pushBack(frame); @@ -270,7 +270,7 @@ void ActionNode::deleteFrame(ActionFrame* frame) return; } int frameType = frame->getFrameType(); - if(frameType < _frameArray.size()) + if(frameType < (int)_frameArray.size()) { auto cArray = _frameArray.at(frameType); cArray->eraseObject(frame); diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index 4d153f5baf..259eb4af6d 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -126,8 +126,8 @@ void Skin::setSkinData(const BaseData &var) setScaleX(_skinData.scaleX); setScaleY(_skinData.scaleY); - setRotationX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); - setRotationY(CC_RADIANS_TO_DEGREES(-_skinData.skewY)); + setRotationSkewX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); + setRotationSkewY(CC_RADIANS_TO_DEGREES(-_skinData.skewY)); setPosition(Point(_skinData.x, _skinData.y)); _skinTransform = getNodeToParentTransform(); diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 48a64f7c88..706d7b624e 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -340,7 +340,7 @@ void RichText::formarRenderers() float newContentSizeHeight = 0.0f; float *maxHeights = new float[_elementRenders.size()]; - for (ssize_t i=0; i<_elementRenders.size(); i++) + for (size_t i=0; i<_elementRenders.size(); i++) { Vector* row = (_elementRenders[i]); float maxHeight = 0.0f; @@ -355,7 +355,7 @@ void RichText::formarRenderers() float nextPosY = _customSize.height; - for (ssize_t i=0; i<_elementRenders.size(); i++) + for (size_t i=0; i<_elementRenders.size(); i++) { Vector* row = (_elementRenders[i]); float nextPosX = 0.0f; @@ -375,7 +375,7 @@ void RichText::formarRenderers() } size_t length = _elementRenders.size(); - for (ssize_t i = 0; i* l = _elementRenders[i]; l->clear(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index e1043b8dc5..32f624d1ab 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1040,7 +1040,7 @@ void TestColliderDetector::update(float delta) float minx = 0, miny = 0, maxx = 0, maxy = 0; size_t length = vertexList.size(); - for (int i = 0; iremoveFromParent(); _emitter = ParticleSystemQuad::create(plist); } - Node::addChild(_emitter , getZOrder() + 1, -1); + Node::addChild(_emitter , getLocalZOrder() + 1, -1); _emitterPlist = plist; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp index 5780b30a08..9c78795fe5 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp @@ -39,7 +39,7 @@ bool UILayoutTest_Editor::init() left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -47,7 +47,7 @@ bool UILayoutTest_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -94,7 +94,7 @@ bool UILayoutTest_Color_Editor::init() left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -102,7 +102,7 @@ bool UILayoutTest_Color_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -149,7 +149,7 @@ bool UILayoutTest_Gradient_Editor::init() left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -157,7 +157,7 @@ bool UILayoutTest_Gradient_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -204,7 +204,7 @@ bool UILayoutTest_BackGroundImage_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -212,7 +212,7 @@ bool UILayoutTest_BackGroundImage_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -259,7 +259,7 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init() left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -267,7 +267,7 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -314,7 +314,7 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -322,7 +322,7 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -369,7 +369,7 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -377,7 +377,7 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -425,7 +425,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -433,7 +433,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -480,7 +480,7 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -488,7 +488,7 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp index 83cfeccd19..89c2954979 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp @@ -42,7 +42,7 @@ bool UIListViewTest_Vertical_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -50,7 +50,7 @@ bool UIListViewTest_Vertical_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -98,7 +98,7 @@ bool UIListViewTest_Horizontal_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -106,7 +106,7 @@ bool UIListViewTest_Horizontal_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); return true; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp index 743b5fc1f7..427b847820 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp @@ -40,7 +40,7 @@ bool UIPageViewTest_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -48,7 +48,7 @@ bool UIPageViewTest_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index afd0e47ba8..f0f33e7afd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -36,7 +36,7 @@ bool UIRichTextTest::init() button->setTitleText("switch"); button->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + button->getSize().height * 2.5)); button->addTouchEventListener(this, toucheventselector(UIRichTextTest::touchEvent)); - button->setZOrder(10); + button->setLocalZOrder(10); _widget->addChild(button); @@ -69,7 +69,7 @@ bool UIRichTextTest::init() _richText->pushBackElement(re6); _richText->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2)); - _richText->setZOrder(10); + _richText->setLocalZOrder(10); _widget->addChild(_richText); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp index d9a0d53e55..d3d7077f2d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp @@ -39,7 +39,7 @@ bool UIScrollViewTest_Vertical_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -47,7 +47,7 @@ bool UIScrollViewTest_Vertical_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -94,7 +94,7 @@ bool UIScrollViewTest_Horizontal_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -102,7 +102,7 @@ bool UIScrollViewTest_Horizontal_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); @@ -149,7 +149,7 @@ bool UIScrollViewTest_Both_Editor::init() left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::previousCallback)); - left_button->setZOrder(_layout->getZOrder() + 1); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(left_button); Button* right_button = Button::create(); @@ -157,7 +157,7 @@ bool UIScrollViewTest_Both_Editor::init() right_button->setPosition(Point(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); - right_button->setZOrder(_layout->getZOrder() + 1); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); right_button->addTouchEventListener(this, toucheventselector(UIScene_Editor::nextCallback)); _layout->addChild(right_button); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index b65d499f76..d50b5afc9b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -336,7 +336,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextFiledEventType t { TextField* textField = dynamic_cast(pSender); Size widgetSize = _widget->getSize(); - textField->runAction(CCMoveTo::create(0.225, + textField->runAction(CCMoveTo::create(0.225f, Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + textField->getContentSize().height / 2))); textField->setTextHorizontalAlignment(TextHAlignment::LEFT); textField->setTextVerticalAlignment(TextVAlignment::TOP); @@ -349,7 +349,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextFiledEventType t { TextField* textField = dynamic_cast(pSender); Size widgetSize = _widget->getSize(); - textField->runAction(CCMoveTo::create(0.175, Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f))); + textField->runAction(CCMoveTo::create(0.175f, Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f))); textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp index d4ad1b94f9..d07e20e34c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp @@ -37,7 +37,7 @@ bool UIWidgetAddNodeTest_Editor::init() // Create the ui widget Widget* widget = Widget::create(); widget->setPosition(Point(rootSize.width / 2.0f, rootSize.height / 2.0f)); - widget->setZOrder(_layout->getZOrder() + 1); + widget->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(widget); Sprite* sprite = Sprite::create("cocosui/ccicon.png"); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp old mode 100755 new mode 100644 index 4449d2cd9d..4e29ed3236 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -199,7 +199,7 @@ void TMoveBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = DICTOOL->getIntValue_json(subDict, "value") ? true : false; continue; } } @@ -337,7 +337,7 @@ void TRotateBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _reverse = (int)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (DICTOOL->getIntValue_json(subDict, "value")) ? true : false; continue; } } @@ -483,7 +483,7 @@ void TScaleBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = (DICTOOL->getIntValue_json(subDict, "value")) ? true : false; continue; } } @@ -629,7 +629,7 @@ void TSkewBy::serialize(const rapidjson::Value &val) } else if (key == "IsReverse") { - _reverse = (bool)(DICTOOL->getIntValue_json(subDict, "value")); + _reverse = DICTOOL->getIntValue_json(subDict, "value") ? true : false; } } } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp old mode 100755 new mode 100644 index ea2f3a3971..e0f402d587 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp @@ -255,7 +255,7 @@ void NodeVisible::serialize(const rapidjson::Value &val) } else if (key == "Visible") { - _visible = DICTOOL->getIntValue_json(subDict, "value"); + _visible = DICTOOL->getIntValue_json(subDict, "value") ? true : false; continue; } } diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index e063733a1b..f793e7b8f7 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -845,7 +845,7 @@ void PhysicsDemoJoints::onEnter() _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp2->getPhysicsBody(), box, sp2->getPosition())); - PhysicsJointRotaryLimit* joint = PhysicsJointRotaryLimit::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), 0.0f, M_PI_2); + PhysicsJointRotaryLimit* joint = PhysicsJointRotaryLimit::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), 0.0f,(float) M_PI_2); _scene->getPhysicsWorld()->addJoint(joint); this->addChild(sp1); @@ -861,7 +861,7 @@ void PhysicsDemoJoints::onEnter() _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp2->getPhysicsBody(), box, sp2->getPosition())); - PhysicsJointRatchet* joint = PhysicsJointRatchet::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), 0.0f, M_PI_2); + PhysicsJointRatchet* joint = PhysicsJointRatchet::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), 0.0f, (float)M_PI_2); _scene->getPhysicsWorld()->addJoint(joint); this->addChild(sp1); @@ -893,7 +893,7 @@ void PhysicsDemoJoints::onEnter() _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp2->getPhysicsBody(), box, sp2->getPosition())); - PhysicsJointMotor* joint = PhysicsJointMotor::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), M_PI_2); + PhysicsJointMotor* joint = PhysicsJointMotor::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), (float)M_PI_2); _scene->getPhysicsWorld()->addJoint(joint); this->addChild(sp1); @@ -1445,7 +1445,7 @@ void PhysicsContactTest::resetTest() label->setPosition(Point(s.width/2, s.height-170)); auto wall = Node::create(); - wall->setPhysicsBody(PhysicsBody::createEdgeBox(VisibleRect::getVisibleRect().size, PhysicsMaterial(0.1, 1, 0.0))); + wall->setPhysicsBody(PhysicsBody::createEdgeBox(VisibleRect::getVisibleRect().size, PhysicsMaterial(0.1f, 1, 0.0f))); wall->setPosition(VisibleRect::center()); root->addChild(wall); @@ -1463,7 +1463,7 @@ void PhysicsContactTest::resetTest() position.y = position.y * CCRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Point(size.width/2, size.height/2); Vect velocity((CCRANDOM_0_1() - 0.5)*200, (CCRANDOM_0_1() - 0.5)*200); - auto box = makeBox(position, size, 1, PhysicsMaterial(0.1, 1, 0.0)); + auto box = makeBox(position, size, 1, PhysicsMaterial(0.1f, 1, 0.0f)); box->getPhysicsBody()->setVelocity(velocity); box->getPhysicsBody()->setCategoryBitmask(0x01); // 0001 box->getPhysicsBody()->setContactTestBitmask(0x04); // 0100 @@ -1481,7 +1481,7 @@ void PhysicsContactTest::resetTest() position.y = position.y * CCRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Point(size.width/2, size.height/2); Vect velocity((CCRANDOM_0_1() - 0.5)*200, (CCRANDOM_0_1() - 0.5)*200); - auto box = makeBox(position, size, 2, PhysicsMaterial(0.1, 1, 0.0)); + auto box = makeBox(position, size, 2, PhysicsMaterial(0.1f, 1, 0.0f)); box->getPhysicsBody()->setVelocity(velocity); box->getPhysicsBody()->setCategoryBitmask(0x02); // 0010 box->getPhysicsBody()->setContactTestBitmask(0x08); // 1000 @@ -1499,7 +1499,7 @@ void PhysicsContactTest::resetTest() position.y = position.y * CCRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Point(size.width/2, size.height/2); Vect velocity((CCRANDOM_0_1() - 0.5)*300, (CCRANDOM_0_1() - 0.5)*300); - auto triangle = makeTriangle(position, size, 1, PhysicsMaterial(0.1, 1, 0.0)); + auto triangle = makeTriangle(position, size, 1, PhysicsMaterial(0.1f, 1, 0.0f)); triangle->getPhysicsBody()->setVelocity(velocity); triangle->getPhysicsBody()->setCategoryBitmask(0x04); // 0100 triangle->getPhysicsBody()->setContactTestBitmask(0x01); // 0001 @@ -1517,7 +1517,7 @@ void PhysicsContactTest::resetTest() position.y = position.y * CCRANDOM_0_1(); position = VisibleRect::leftBottom() + position + Point(size.width/2, size.height/2); Vect velocity((CCRANDOM_0_1() - 0.5)*300, (CCRANDOM_0_1() - 0.5)*300); - auto triangle = makeTriangle(position, size, 2, PhysicsMaterial(0.1, 1, 0.0)); + auto triangle = makeTriangle(position, size, 2, PhysicsMaterial(0.1f, 1, 0.0f)); triangle->getPhysicsBody()->setVelocity(velocity); triangle->getPhysicsBody()->setCategoryBitmask(0x08); // 1000 triangle->getPhysicsBody()->setContactTestBitmask(0x02); // 0010 @@ -1566,7 +1566,7 @@ void PhysicsPositionRotationTest::onEnter() // anchor test auto anchorNode = Sprite::create("Images/YellowSquare.png"); - anchorNode->setAnchorPoint(Point(0.1, 0.9)); + anchorNode->setAnchorPoint(Point(0.1f, 0.9f)); anchorNode->setPosition(100, 100); anchorNode->setScale(0.25); anchorNode->setPhysicsBody(PhysicsBody::createBox(anchorNode->getContentSize()*anchorNode->getScale())); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index b817ed6701..49e5848a08 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -314,9 +314,9 @@ RenderTextureZbuffer::RenderTextureZbuffer() label3->setPosition(Point(size.width / 2, size.height * 0.75f)); this->addChild(label3); - label->setVertexZ(50); - label2->setVertexZ(0); - label3->setVertexZ(-50); + label->setPositionZ(50); + label2->setPositionZ(0); + label3->setPositionZ(-50); SpriteFrameCache::getInstance()->addSpriteFramesWithFile("Images/bugs/circle.plist"); mgr = SpriteBatchNode::create("Images/bugs/circle.png", 9); @@ -341,15 +341,15 @@ RenderTextureZbuffer::RenderTextureZbuffer() mgr->addChild(sp8, 2); mgr->addChild(sp9, 1); - sp1->setVertexZ(400); - sp2->setVertexZ(300); - sp3->setVertexZ(200); - sp4->setVertexZ(100); - sp5->setVertexZ(0); - sp6->setVertexZ(-100); - sp7->setVertexZ(-200); - sp8->setVertexZ(-300); - sp9->setVertexZ(-400); + sp1->setPositionZ(400); + sp2->setPositionZ(300); + sp3->setPositionZ(200); + sp4->setPositionZ(100); + sp5->setPositionZ(0); + sp6->setPositionZ(-100); + sp7->setPositionZ(-200); + sp8->setPositionZ(-300); + sp9->setPositionZ(-400); sp9->setScale(2); sp9->setColor(Color3B::YELLOW); diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index b98c1b9d46..ac73085b6b 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -4bb0b2a6151e4910ea662bedd91a5be655ec05d1 \ No newline at end of file +4d17613c96e30631ec5da21b2629fa3d0fc39f2d \ No newline at end of file diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp index ecad3ef353..4b26ddbe49 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -285,7 +285,7 @@ TMXOrthoTest::TMXOrthoTest() Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width,s.height); - auto scale = ScaleBy::create(10, 0.1); + auto scale = ScaleBy::create(10, 0.1f); auto back = scale->reverse(); auto seq = Sequence::create(scale, back, NULL); auto repeat = RepeatForever::create(seq); @@ -1086,7 +1086,7 @@ void TMXIsoVertexZ::repositionSprite(float dt) auto p = _tamara->getPosition(); p = CC_POINT_POINTS_TO_PIXELS(p); float newZ = -(p.y+32) /16; - _tamara->setVertexZ( newZ ); + _tamara->setPositionZ( newZ ); } void TMXIsoVertexZ::onEnter() @@ -1132,7 +1132,7 @@ TMXOrthoVertexZ::TMXOrthoVertexZ() // can use any Sprite and it will work OK. auto layer = map->getLayer("trees"); _tamara = layer->getTileAt(Point(0,11)); - CCLOG("%p vertexZ: %f", _tamara, _tamara->getVertexZ()); + CCLOG("%p vertexZ: %f", _tamara, _tamara->getPositionZ()); _tamara->retain(); auto move = MoveBy::create(10, Point(400,450) * (1/CC_CONTENT_SCALE_FACTOR())); @@ -1155,7 +1155,7 @@ void TMXOrthoVertexZ::repositionSprite(float dt) // map size: 12x12 auto p = _tamara->getPosition(); p = CC_POINT_POINTS_TO_PIXELS(p); - _tamara->setVertexZ( -( (p.y+81) /81) ); + _tamara->setPositionZ( -( (p.y+81) /81) ); } void TMXOrthoVertexZ::onEnter() diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 6687de06da..25a44638ed 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -185,8 +185,8 @@ void ZwoptexGenericTest::flipSprites(float dt) char str2[32] = {0}; sprintf(str1, "grossini_dance_%02d.png", spriteFrameIndex); sprintf(str2, "grossini_dance_generic_%02d.png", spriteFrameIndex); - sprite1->setDisplayFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(str1)); - sprite2->setDisplayFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(str2)); + sprite1->setSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(str1)); + sprite2->setSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(str2)); } ZwoptexGenericTest::~ZwoptexGenericTest()