diff --git a/.travis.yml b/.travis.yml index 1bccfbf9d6..2ab4eb079d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,4 +37,4 @@ before_install: # whitelist branches: only: - - v3 + - v3.7-release diff --git a/cocos/2d/CCAutoPolygon.h b/cocos/2d/CCAutoPolygon.h index e20ac0b000..e94c92e286 100644 --- a/cocos/2d/CCAutoPolygon.h +++ b/cocos/2d/CCAutoPolygon.h @@ -41,7 +41,7 @@ NS_CC_BEGIN */ /** - * PolygonInfo is an object holding the required data to display Sprites。 + * PolygonInfo is an object holding the required data to display Sprites. * It can be a simple as a triangle, or as complex as a whole 3D mesh */ class CC_DLL PolygonInfo diff --git a/cocos/audio/linux/SimpleAudioEngineFMOD.cpp b/cocos/audio/linux/SimpleAudioEngineFMOD.cpp index a72ad34d0e..26fd913abe 100644 --- a/cocos/audio/linux/SimpleAudioEngineFMOD.cpp +++ b/cocos/audio/linux/SimpleAudioEngineFMOD.cpp @@ -46,7 +46,10 @@ SimpleAudioEngine* SimpleAudioEngine::getInstance() { } void SimpleAudioEngine::end() { - oAudioPlayer->close(); + if(oAudioPlayer) + { + oAudioPlayer->close(); + } } ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/audio/winrt/AudioCachePlayer.cpp b/cocos/audio/winrt/AudioCachePlayer.cpp index d6dbbd3af5..9f2cdb2f5b 100644 --- a/cocos/audio/winrt/AudioCachePlayer.cpp +++ b/cocos/audio/winrt/AudioCachePlayer.cpp @@ -332,6 +332,9 @@ bool AudioPlayer::play2d(AudioCache* cache) _duration = getDuration(); ret = _play(); } + else { + error(); + } } return ret; @@ -342,6 +345,7 @@ void AudioPlayer::init() do { memset(&_xaBuffer, 0, sizeof(_xaBuffer)); if (FAILED(XAudio2Create(_xaEngine.ReleaseAndGetAddressOf()))) { + error(); break; } @@ -354,8 +358,10 @@ void AudioPlayer::init() _xaEngine->RegisterForCallbacks(this); if (FAILED(_xaEngine->CreateMasteringVoice(&_xaMasterVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, nullptr, nullptr, AudioCategory_GameMedia))) { + error(); break; } + _ready = true; _state = AudioPlayerState::READY; } while (false); @@ -363,10 +369,12 @@ void AudioPlayer::init() void AudioPlayer::free() { + _ready = false; _stop(); memset(&_xaBuffer, 0, sizeof(_xaBuffer)); if (_xaEngine) { + _xaEngine->UnregisterForCallbacks(this); _xaEngine->StopEngine(); } @@ -430,6 +438,7 @@ void AudioPlayer::error() _criticalError = true; _ready = false; _state = AudioPlayerState::ERRORED; + CCLOG("Audio system encountered error."); } void AudioPlayer::popBuffer() @@ -537,13 +546,15 @@ void AudioPlayer::OnProcessingPassEnd() void AudioPlayer::OnCriticalError(HRESULT err) { UNREFERENCED_PARAMETER(err); - error(); + if (_ready) { + error(); + } } // IXAudio2VoiceCallback void AudioPlayer::OnVoiceProcessingPassStart(UINT32 uBytesRequired) { - if (uBytesRequired && _isStreaming){ + if (_ready && uBytesRequired && _isStreaming){ submitBuffers(); } } @@ -554,7 +565,9 @@ void AudioPlayer::OnVoiceProcessingPassEnd() void AudioPlayer::OnStreamEnd() { - onBufferRunOut(); + if (_ready) { + onBufferRunOut(); + } } void AudioPlayer::OnBufferStart(void* pBufferContext) @@ -565,14 +578,16 @@ void AudioPlayer::OnBufferStart(void* pBufferContext) void AudioPlayer::OnBufferEnd(void* pBufferContext) { UNREFERENCED_PARAMETER(pBufferContext); - updateState(); + if (_ready) { + updateState(); + } } void AudioPlayer::OnLoopEnd(void* pBufferContext) { UNREFERENCED_PARAMETER(pBufferContext); - if (!_loop) { + if (_ready && !_loop) { _stop(); } } @@ -581,7 +596,9 @@ void AudioPlayer::OnVoiceError(void* pBufferContext, HRESULT err) { UNREFERENCED_PARAMETER(pBufferContext); UNREFERENCED_PARAMETER(err); - error(); + if (_ready) { + error(); + } } #endif diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 5cda9f553d..34cc2ee17a 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -1412,7 +1412,7 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, st } else { - if (dynamic_cast(widget)) + if (nullptr == dynamic_cast(widget)) { if (child->getPositionType() == ui::Widget::PositionType::PERCENT) { @@ -1504,7 +1504,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va } else { - if (dynamic_cast(widget)) + if (nullptr == dynamic_cast(widget)) { if (child->getPositionType() == ui::Widget::PositionType::PERCENT) { diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 316d8a51d1..d97fdda1b5 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -5,6 +5,10 @@ LOCAL_MODULE := cocos_ui_static LOCAL_MODULE_FILENAME := libui +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := \ UIWidget.cpp \ UILayout.cpp \ diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 94668591a3..cd5777edc7 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -23,13 +23,24 @@ THE SOFTWARE. ****************************************************************************/ #include "ui/UIScrollView.h" +#include "platform/CCDevice.h" +#include "base/CCDirector.h" NS_CC_BEGIN namespace ui { +#define MOVE_INCH 7.0f/160.0f static const float AUTOSCROLLMAXSPEED = 1000.0f; +static float convertDistanceFromPointToInch(Vec2 dis) +{ + auto glview = Director::getInstance()->getOpenGLView(); + int dpi = Device::getDPI(); + float distance = Vec2(dis.x * glview->getScaleX() / dpi, dis.y * glview->getScaleY() / dpi).getLength(); + return distance; +} + const Vec2 SCROLLDIR_UP(0.0f, 1.0f); const Vec2 SCROLLDIR_DOWN(0.0f, -1.0f); const Vec2 SCROLLDIR_LEFT(-1.0f, 0.0f); @@ -56,7 +67,7 @@ _isAutoScrollSpeedAttenuated(false), _needCheckAutoScrollDestination(false), _bePressed(false), _slidTime(0.0f), -_childFocusCancelOffset(5.0f), +_childFocusCancelOffsetInInch(MOVE_INCH), _leftBounceNeeded(false), _topBounceNeeded(false), _rightBounceNeeded(false), @@ -1576,9 +1587,24 @@ void ScrollView::interceptTouchEvent(Widget::TouchEventType event, Widget *sende break; case TouchEventType::MOVED: { - float offset = (sender->getTouchBeganPosition() - touchPoint).getLength(); _touchMovePosition = touch->getLocation(); - if (offset > _childFocusCancelOffset) + // calculates move offset in points + float offsetInInch = 0; + switch (_direction) + { + case Direction::HORIZONTAL: + offsetInInch = convertDistanceFromPointToInch(Vec2(fabs(sender->getTouchBeganPosition().x - touchPoint.x), 0)); + break; + case Direction::VERTICAL: + offsetInInch = convertDistanceFromPointToInch(Vec2(0, fabs(sender->getTouchBeganPosition().y - touchPoint.y))); + break; + case Direction::BOTH: + offsetInInch = convertDistanceFromPointToInch(sender->getTouchBeganPosition() - touchPoint); + break; + default: + break; + } + if (offsetInInch > _childFocusCancelOffsetInInch) { sender->setHighlighted(false); handleMoveLogic(touch); diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index 414153e25e..456e1bbcfa 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -491,7 +491,7 @@ protected: bool _bePressed; float _slidTime; Vec2 _moveChildPoint; - float _childFocusCancelOffset; + float _childFocusCancelOffsetInInch; bool _leftBounceNeeded; bool _topBounceNeeded; diff --git a/extensions/Android.mk b/extensions/Android.mk index 90a1561c6f..0e5d7e2514 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -5,6 +5,10 @@ LOCAL_MODULE := cocos_extension_static LOCAL_MODULE_FILENAME := libextension +ifeq ($(USE_ARM_MODE),1) +LOCAL_ARM_MODE := arm +endif + LOCAL_SRC_FILES := \ assets-manager/AssetsManager.cpp \ assets-manager/Downloader.cpp \ diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h index 574af60526..0c1183bf32 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.h @@ -1,7 +1,6 @@ #ifndef _ACTION_MANAGER_TEST_H_ #define _ACTION_MANAGER_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ActionManagerTests); diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h index 7123948e84..43010127a1 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.h @@ -26,8 +26,6 @@ #ifndef _ACTIONS__EASE_TEST_H_ #define _ACTIONS__EASE_TEST_H_ -////----#include "cocos2d.h" -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ActionsEaseTests); diff --git a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.h b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.h index 1818b957f1..f769537dac 100644 --- a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.h +++ b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.h @@ -26,7 +26,6 @@ #ifndef _ACTIONS__PROGRESS_TEST_H_ #define _ACTIONS__PROGRESS_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ActionsProgressTests); diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index b5acaa5d07..16c05cc432 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -26,7 +26,6 @@ #ifndef _ActionsTest_H_ #define _ActionsTest_H_ -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ActionsTests); diff --git a/tests/cpp-tests/Classes/AllocatorTest/AllocatorTest.h b/tests/cpp-tests/Classes/AllocatorTest/AllocatorTest.h index 75c54b80ae..50dc5c7aef 100644 --- a/tests/cpp-tests/Classes/AllocatorTest/AllocatorTest.h +++ b/tests/cpp-tests/Classes/AllocatorTest/AllocatorTest.h @@ -25,7 +25,6 @@ THE SOFTWARE. ****************************************************************************/ -#include "../testBasic.h" #include "../BaseTest.h" #include "base/allocator/CCAllocatorStrategyPool.h" diff --git a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp index f2defcfe69..21ccf5f301 100644 --- a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp +++ b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.cpp @@ -74,7 +74,7 @@ BillBoardRotationTest::BillBoardRotationTest() root->runAction(rp); auto jump = JumpBy::create(1, Vec2(0, 0), 30, 1); - auto scale = ScaleBy::create(2, 2, 2, 0.1); + auto scale = ScaleBy::create(2.f, 2.f, 2.f, 0.1f); auto seq = Sequence::create(jump,scale, NULL); auto rot = RotateBy::create(2, Vec3(-90, 0, 0)); diff --git a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h index 4ee680a251..478f3c5bb5 100644 --- a/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h +++ b/tests/cpp-tests/Classes/BillBoardTest/BillBoardTest.h @@ -25,7 +25,6 @@ #ifndef _BILLBOARD_TEST_H_ #define _BILLBOARD_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" #include diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h index 1ce606a6cc..eb246abc1e 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.h @@ -25,7 +25,6 @@ #ifndef _COCOSSTUDIO3D_TEST_H_ #define _COCOSSTUDIO3D_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" #include diff --git a/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.h b/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.h index ec7f618689..7410a50645 100644 --- a/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.h +++ b/tests/cpp-tests/Classes/ConfigurationTest/ConfigurationTest.h @@ -1,7 +1,6 @@ #ifndef __CONFIGURATIONTEST_H__ #define __CONFIGURATIONTEST_H__ -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(ConfigurationTests); diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp index 41348974fc..87cbe8043b 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.cpp @@ -220,22 +220,22 @@ void Material_AutoBindings::onEnter() Material *mat1 = Material::createWithProperties(properties); auto spriteBlur = Sprite::create("Images/grossini.png"); - spriteBlur->setNormalizedPosition(Vec2(0.2, 0.5)); + spriteBlur->setNormalizedPosition(Vec2(0.2f, 0.5f)); this->addChild(spriteBlur); spriteBlur->setGLProgramState(mat1->getTechniqueByName("blur")->getPassByIndex(0)->getGLProgramState()); auto spriteOutline = Sprite::create("Images/grossini.png"); - spriteOutline->setNormalizedPosition(Vec2(0.4, 0.5)); + spriteOutline->setNormalizedPosition(Vec2(0.4f, 0.5f)); this->addChild(spriteOutline); spriteOutline->setGLProgramState(mat1->getTechniqueByName("outline")->getPassByIndex(0)->getGLProgramState()); auto spriteNoise = Sprite::create("Images/grossini.png"); - spriteNoise->setNormalizedPosition(Vec2(0.6, 0.5)); + spriteNoise->setNormalizedPosition(Vec2(0.6f, 0.5f)); this->addChild(spriteNoise); spriteNoise->setGLProgramState(mat1->getTechniqueByName("noise")->getPassByIndex(0)->getGLProgramState()); auto spriteEdgeDetect = Sprite::create("Images/grossini.png"); - spriteEdgeDetect->setNormalizedPosition(Vec2(0.8, 0.5)); + spriteEdgeDetect->setNormalizedPosition(Vec2(0.8f, 0.5f)); this->addChild(spriteEdgeDetect); spriteEdgeDetect->setGLProgramState(mat1->getTechniqueByName("edge_detect")->getPassByIndex(0)->getGLProgramState()); @@ -396,7 +396,7 @@ void Material_invalidate::onEnter() sprite->setScale(5); sprite->setRotation3D(Vec3(0,180,0)); addChild(sprite); - sprite->setNormalizedPosition(Vec2(0.3,0.3)); + sprite->setNormalizedPosition(Vec2(0.3f,0.3f)); auto rotate = RotateBy::create(5, Vec3(0,360,0)); auto repeat = RepeatForever::create(rotate); @@ -408,7 +408,7 @@ void Material_invalidate::onEnter() skeletonNode->setSkin("goblin"); skeletonNode->setScale(0.25); - skeletonNode->setNormalizedPosition(Vec2(0.6,0.3)); + skeletonNode->setNormalizedPosition(Vec2(0.6f,0.3f)); this->addChild(skeletonNode); } @@ -465,7 +465,7 @@ void Material_renderState::onEnter() sprite->setScale(5); sprite->setRotation3D(Vec3(0,180,0)); addChild(sprite); - sprite->setNormalizedPosition(Vec2(0.3,0.3)); + sprite->setNormalizedPosition(Vec2(0.3f,0.3f)); auto rotate = RotateBy::create(5, Vec3(0,360,0)); auto repeat = RepeatForever::create(rotate); @@ -477,7 +477,7 @@ void Material_renderState::onEnter() skeletonNode->setSkin("goblin"); skeletonNode->setScale(0.25); - skeletonNode->setNormalizedPosition(Vec2(0.6,0.3)); + skeletonNode->setNormalizedPosition(Vec2(0.6f,0.3f)); this->addChild(skeletonNode); _stateBlock.setDepthTest(false); diff --git a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h index 02a09afc00..4bf9403ee0 100644 --- a/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h +++ b/tests/cpp-tests/Classes/MaterialSystemTest/MaterialSystemTest.h @@ -24,7 +24,6 @@ #pragma once -#include "../testBasic.h" #include "../BaseTest.h" DEFINE_TEST_SUITE(MaterialSystemTest); diff --git a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h index ceb0981aa0..146ca249ec 100644 --- a/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h +++ b/tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.h @@ -25,7 +25,6 @@ #ifndef _NAVMESH_TEST_H_ #define _NAVMESH_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" #include "navmesh/CCNavMesh.h" #include diff --git a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h index 03c77a6ffd..10874eca49 100644 --- a/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h +++ b/tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.h @@ -25,7 +25,6 @@ #ifndef _PHYSICS3D_TEST_H_ #define _PHYSICS3D_TEST_H_ -#include "../testBasic.h" #include "../BaseTest.h" #include diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 849044931f..5fd99c31e0 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -1,5 +1,4 @@ #include "RenderTextureTest.h" -#include "../testBasic.h" USING_NS_CC; using namespace cocos2d::ui; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index a02451e83a..fd47bd65e0 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -3,7 +3,6 @@ #include "ui/CocosGUI.h" -#include "../testBasic.h" #include "extensions/cocos-ext.h" #include "../BaseTest.h" diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index 7144ba78f7..06bdb867c6 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -1,6 +1,6 @@ #ifndef _SHADER_TEST2_H_ #define _SHADER_TEST2_H_ -#include "../testBasic.h" + #include "extensions/cocos-ext.h" #include "../BaseTest.h" diff --git a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h index 5bfc7b8531..13f8a93868 100644 --- a/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h +++ b/tests/cpp-tests/Classes/SpritePolygonTest/SpritePolygonTest.h @@ -1,6 +1,5 @@ #ifndef __cocos2d_tests__SpritePolygonTest__ -#include "../testBasic.h" #include "../BaseTest.h" #include "ui/CocosGUI.h" diff --git a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h index 49cee0307b..68bd98d139 100644 --- a/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h +++ b/tests/cpp-tests/Classes/TerrainTest/TerrainTest.h @@ -1,5 +1,5 @@ #ifndef TERRAIN_TESH_H -#include "../testBasic.h" + #include "../BaseTest.h" #include "3d/CCSprite3D.h" diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h index 2eedfdf06a..5e6668ae7f 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h @@ -1,7 +1,6 @@ #ifndef __TEXT_INPUT_TEST_H__ #define __TEXT_INPUT_TEST_H__ -#include "../testBasic.h" #include "../BaseTest.h" class KeyboardNotificationLayer; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp index 631efa239a..1fe1096a8f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp @@ -30,4 +30,6 @@ CocostudioParserTests::CocostudioParserTests() addTestCase("cocostudio 1.3", [](){ return CocostudioParserJsonScene::create("cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson"); }); addTestCase("cocostudio 1.4", [](){ return CocostudioParserJsonScene::create("cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson"); }); addTestCase("cocostudio 1.5", [](){ return CocostudioParserJsonScene::create("cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson"); }); + addTestCase("cocostudio 1.6", [](){ return CocostudioParserJsonScene::create("cocosui/UIEditorTest/cocostudio1_6/CocoStudio1.6Demo_1.ExportJson"); }); + } diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index 65f45cef16..dc719c1676 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit 65f45cef163bea7f25d20fe9ba77f6af871656c0 +Subproject commit dc719c167623d343cd5fdaaba867e9e1a26a24d3 diff --git a/tests/cpp-tests/proj.android-studio/app/jni/Android.mk b/tests/cpp-tests/proj.android-studio/app/jni/Android.mk index a0396a022c..6179bca134 100644 --- a/tests/cpp-tests/proj.android-studio/app/jni/Android.mk +++ b/tests/cpp-tests/proj.android-studio/app/jni/Android.mk @@ -202,7 +202,8 @@ LOCAL_SRC_FILES := main.cpp \ ../../../Classes/VisibleRect.cpp \ ../../../Classes/ZwoptexTest/ZwoptexTest.cpp \ ../../../Classes/controller.cpp \ -../../../Classes/testBasic.cpp +../../../Classes/testBasic.cpp \ +../../../Classes/NavMeshTest/NavMeshTest.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes \ $(LOCAL_PATH)/../../../../.. diff --git a/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua b/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua index e61b88c6cd..4982f19902 100644 --- a/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua +++ b/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua @@ -1242,15 +1242,9 @@ function LabelCharMapTest.create() local label2 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.plist") layer:addChild(label2, 0, kTagSprite2) label2:setAnchorPoint(cc.p(0, 0)) - label2:setPosition( cc.p(10,160) ) + label2:setPosition( cc.p(10,200) ) label2:setOpacity( 32 ) - local label3 = cc.Label:createWithCharMap("fonts/tuffy_bold_italic-charmap.plist")--32 means Space key - label3:setString("123 Test") - layer:addChild(label3, 0, kTagSprite3) - label3:setAnchorPoint(cc.p(0, 0)) - label3:setPosition(cc.p(10,220)) - local function step(dt) time = time + dt local info = string.format("%2.2f Test", time) diff --git a/tests/lua-tests/src/SpritePolygonTest/SpritePolygonTest.lua b/tests/lua-tests/src/SpritePolygonTest/SpritePolygonTest.lua index 3d30986394..c5d3362e17 100644 --- a/tests/lua-tests/src/SpritePolygonTest/SpritePolygonTest.lua +++ b/tests/lua-tests/src/SpritePolygonTest/SpritePolygonTest.lua @@ -103,7 +103,7 @@ function SpritePolygonTest1:ctor() spp:setPosition(cc.p(s.width / 2 + offset.x, s.height / 2 + offset.y)) - sp = cc.Sprite:create(filename) + local sp = cc.Sprite:create(filename) self:addChild(sp) sp:setPosition(cc.p(s.width/2 - offset.x, s.height/2 - offset.y)) @@ -119,7 +119,7 @@ function SpritePolygonTest1:ctor() temp = "SpritePolygon:\nPixels drawn: " local vertCount = "\nverts:" .. info:getVertCount() - local sppArea = cc.Label:createWithTTF(ttfConfig, temp .. info:getArea() .. vertCount) + local sppArea = cc.Label:createWithTTF(ttfConfig, temp .. math.floor(info:getArea()) .. vertCount) spp:addChild(sppArea) sppArea:setAnchorPoint(cc.p(0, 1)) @@ -212,7 +212,7 @@ function SpritePolygonTest2:make2Sprites() temp = "SpritePolygon:\nPixels drawn: " local vertCount = "\nverts:" .. info:getVertCount() - local sppArea = cc.Label:createWithTTF(ttfConfig, temp .. info:getArea() .. vertCount) + local sppArea = cc.Label:createWithTTF(ttfConfig, temp .. math.floor(info:getArea()) .. vertCount) self.spp:addChild(sppArea) sppArea:setAnchorPoint(cc.p(0, 1)) end diff --git a/tests/lua-tests/src/helper.lua b/tests/lua-tests/src/helper.lua index bf20656cf0..63eba2d289 100644 --- a/tests/lua-tests/src/helper.lua +++ b/tests/lua-tests/src/helper.lua @@ -113,6 +113,7 @@ local function MainMenuCallback() local scene = cc.Scene:create() scene:addChild(CreateTestMenu()) Helper.usePhysics = false + cc.Director:getInstance():setDepthTest(false) cc.Director:getInstance():replaceScene(scene) end diff --git a/tools/framework-compile/bin/utils_cocos.py b/tools/framework-compile/bin/utils_cocos.py index c538de65d6..880b111b40 100755 --- a/tools/framework-compile/bin/utils_cocos.py +++ b/tools/framework-compile/bin/utils_cocos.py @@ -120,7 +120,7 @@ def get_vs_cmd_path(vs_version): def rmdir(folder): if os.path.exists(folder): if sys.platform == 'win32': - execute_command("rd /s/q %s" % folder) + execute_command("rd /s/q \"%s\"" % folder) else: shutil.rmtree(folder) diff --git a/tools/make-package/config.json b/tools/make-package/config.json index 61caceba9b..9d5b64509b 100644 --- a/tools/make-package/config.json +++ b/tools/make-package/config.json @@ -11,9 +11,5 @@ "zip_file_path": "../cocos2d-console", "extract_to_zip_path": "tools/cocos2d-console" } - ], - "extra_dirs": - [ - "tools/fbx-conv" ] } diff --git a/tools/make-package/git-archive-all b/tools/make-package/git-archive-all index 32b1c98260..82215a4e33 100755 --- a/tools/make-package/git-archive-all +++ b/tools/make-package/git-archive-all @@ -238,11 +238,22 @@ class GitArchiver(object): extra_folder_path = os.path.join(self.main_repo_abspath, extra_folder_name) extra_folders.append(extra_folder_path) extra_file_paths = self.unpack_zipfile(zip_file_path, self.main_repo_abspath) + + key_move_dirs = "move_dirs" for file_path in extra_file_paths: if file_path.find(extra_folder_path) == -1: raise Exception("Couldn't find extra folder path (%s) in (%s)!" % (extra_folder_path, file_path)) path_in_zip = extra_to_zip_file + file_path[(len(extra_folder_path)):] + if key_move_dirs in zip_config: + move_dirs = zip_config[key_move_dirs] + related_path = os.path.relpath(file_path, extra_folder_path) + temp_rel_path = related_path.replace('\\', '/') + for move_dir in move_dirs: + if temp_rel_path.startswith(move_dir): + move_to_dir = move_dirs[move_dir] + path_in_zip = os.path.join(move_to_dir, related_path) + break try: add(file_path, path_in_zip) @@ -250,19 +261,20 @@ class GitArchiver(object): print('add %s failed.' % file_path) pass - outfile_name, outfile_ext = path.splitext(output_path) - for extra_dir in config_data["extra_dirs"]: - dir_path = path.join(self.main_repo_abspath, extra_dir) - list_dirs = os.walk(dir_path) - for root,dirs,files in list_dirs: - for f in files: - file_path = path.join(root,f) - path_in_zip = file_path[(len(self.main_repo_abspath)+1):] - try: - add(file_path, path_in_zip) - except: - print('add %s failed.' % file_path) - pass + key_extra_dirs = "extra_dirs" + if key_extra_dirs in config_data: + for extra_dir in config_data[key_extra_dirs]: + dir_path = path.join(self.main_repo_abspath, extra_dir) + list_dirs = os.walk(dir_path) + for root,dirs,files in list_dirs: + for f in files: + file_path = path.join(root,f) + path_in_zip = file_path[(len(self.main_repo_abspath)+1):] + try: + add(file_path, path_in_zip) + except: + print('add %s failed.' % file_path) + pass if not dry_run: archive.close() diff --git a/tools/travis-scripts/generate-bindings.sh b/tools/travis-scripts/generate-bindings.sh index 7c51476415..8e5d9a7b51 100755 --- a/tools/travis-scripts/generate-bindings.sh +++ b/tools/travis-scripts/generate-bindings.sh @@ -25,7 +25,7 @@ ELAPSEDSECS=`date +%s` COCOS_BRANCH="update_lua_bindings_$ELAPSEDSECS" COCOS_ROBOT_REMOTE="https://${GH_USER}:${GH_PASSWORD}@github.com/${GH_USER}/cocos2d-x.git" PULL_REQUEST_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" -FETCH_REMOTE_BRANCH="v3" +FETCH_REMOTE_BRANCH="v3.7-release" LUA_COMMIT_PATH="cocos/scripting/lua-bindings/auto" JS_COMMIT_PATH="cocos/scripting/js-bindings/auto" diff --git a/tools/travis-scripts/generate-cocosfiles.sh b/tools/travis-scripts/generate-cocosfiles.sh index d946787499..1bfedb3cf0 100755 --- a/tools/travis-scripts/generate-cocosfiles.sh +++ b/tools/travis-scripts/generate-cocosfiles.sh @@ -6,7 +6,7 @@ PROJECT_ROOT="$DIR"/../.. COMMITTAG="[AUTO][ci skip]: updating cocos2dx_files.json" PUSH_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls" OUTPUT_FILE_PATH="${PROJECT_ROOT}/templates/cocos2dx_files.json" -FETCH_REMOTE_BRANCH="v3" +FETCH_REMOTE_BRANCH="v3.7-release" COMMIT_PATH="templates/cocos2dx_files.json" # Exit on error diff --git a/tools/travis-scripts/travis_mac.yml b/tools/travis-scripts/travis_mac.yml index d5ea1235f9..7c5913bb23 100644 --- a/tools/travis-scripts/travis_mac.yml +++ b/tools/travis-scripts/travis_mac.yml @@ -16,4 +16,4 @@ notifications: # whitelist branches: only: - - v3 + - v3.7-release