From 993e420ce4130fe9ca5fb9316f540842e3c74970 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 3 Jul 2015 11:30:38 +0800 Subject: [PATCH 1/9] Fix drawLine & drawPoints won't use blendFunc bug --- cocos/2d/CCDrawNode.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 2d04abb00f..c2b0b37b73 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -371,7 +371,9 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR); glProgram->use(); glProgram->setUniformsForBuiltins(transform); - + + GL::blendFunc(_blendFunc.src, _blendFunc.dst); + if (_dirtyGLLine) { glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine); @@ -412,7 +414,9 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags) auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE); glProgram->use(); glProgram->setUniformsForBuiltins(transform); - + + GL::blendFunc(_blendFunc.src, _blendFunc.dst); + if (_dirtyGLPoint) { glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint); From d6fc8ecc94effb2662de8fc90e5cda9886cc945e Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 6 Jul 2015 16:02:19 +0800 Subject: [PATCH 2/9] Fix when use percentage size & position to a UIWidget which parent is a layout component, when change simulator screen size, layout won't effect correctly. --- cocos/ui/UILayoutComponent.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cocos/ui/UILayoutComponent.cpp b/cocos/ui/UILayoutComponent.cpp index 200a2714f2..0f7bc5dadc 100644 --- a/cocos/ui/UILayoutComponent.cpp +++ b/cocos/ui/UILayoutComponent.cpp @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - +#include "UIPageView.h" #include "UILayoutComponent.h" #include "2d/CCNode.h" #include "GUIDefine.h" @@ -667,7 +667,23 @@ namespace ui { _owner->setPosition(ownerPosition); _owner->setContentSize(ownerSize); - ui::Helper::doLayout(_owner); + if (typeid(*_owner) == typeid(PageView)) + { + PageView* page = static_cast(_owner); + page->forceDoLayout(); + + Vector _layoutVector = page->getPages(); + Vector::iterator iter = _layoutVector.begin(); + while (iter != _layoutVector.end()) + { + ui::Helper::doLayout(*(iter)); + iter++; + } + } + else + { + ui::Helper::doLayout(_owner); + } } void LayoutComponent::setActiveEnabled(bool enable) From 9fab1e77021bf55556060a931e7949d6d26e4e1f Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 6 Jul 2015 16:39:00 +0800 Subject: [PATCH 3/9] Change to use auto & for each to enum sub items --- cocos/ui/UILayoutComponent.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UILayoutComponent.cpp b/cocos/ui/UILayoutComponent.cpp index 0f7bc5dadc..70fa9aa57b 100644 --- a/cocos/ui/UILayoutComponent.cpp +++ b/cocos/ui/UILayoutComponent.cpp @@ -673,11 +673,9 @@ namespace ui { page->forceDoLayout(); Vector _layoutVector = page->getPages(); - Vector::iterator iter = _layoutVector.begin(); - while (iter != _layoutVector.end()) + for each (auto item in _layoutVector) { - ui::Helper::doLayout(*(iter)); - iter++; + ui::Helper::doLayout(item); } } else From 214684b3be28c393f726163ddc5946cd6dc56d30 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 6 Jul 2015 16:45:04 +0800 Subject: [PATCH 4/9] Fix --- cocos/ui/UILayoutComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/ui/UILayoutComponent.cpp b/cocos/ui/UILayoutComponent.cpp index 70fa9aa57b..50a01a7d85 100644 --- a/cocos/ui/UILayoutComponent.cpp +++ b/cocos/ui/UILayoutComponent.cpp @@ -673,7 +673,7 @@ namespace ui { page->forceDoLayout(); Vector _layoutVector = page->getPages(); - for each (auto item in _layoutVector) + for(auto& item : _layoutVector) { ui::Helper::doLayout(item); } From 9a6ffd8904e85f520e399f4347f2cd274fcc66f9 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Tue, 7 Jul 2015 09:54:42 +0800 Subject: [PATCH 5/9] Add bug test for PageView layout & CCNodeDraw::onDrawGLLine --- .../UserCameraReader/UserCameraReader.cpp | 1 + .../Classes/BugsTest/Bug-CCDrawNode.cpp | 40 ++++++++++++++++++ .../Classes/BugsTest/Bug-CCDrawNode.h | 14 +++++++ .../Classes/BugsTest/Bug-PageViewLayout.cpp | 41 +++++++++++++++++++ .../Classes/BugsTest/Bug-PageViewLayout.h | 14 +++++++ tests/cpp-tests/Classes/BugsTest/BugsTest.cpp | 4 ++ tests/cpp-tests/Resources/ccs-res | 2 +- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 4 ++ .../proj.win32/cpp-tests.vcxproj.filters | 12 ++++++ 9 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.h diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 6f3fa906e4..f05bd905f3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -125,6 +125,7 @@ namespace cocostudio else if(value == "USER1") cameraFlag = 1 << 1; else if(value == "USER2") cameraFlag = 1 << 2; else if(value == "USER3") cameraFlag = 1 << 3; + else if(value == "USER4") cameraFlag = 1 << 4; } attribute = attribute->Next(); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp new file mode 100644 index 0000000000..918a00d93e --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp @@ -0,0 +1,40 @@ +// +// CCDrawNode::onDrawGLPoint & CCDrawNode::onDrawGLLine miss +// calling GL::blendFunc, so when a sprite set blendFunc, these +// function will get a wrong result. +// In this test, see a red line when bug resolved. +// + +#include "Bug-CCDrawNode.h" + +USING_NS_CC; + +bool BugDrawNodeLayer::init() +{ + if (BugsTestBase::init()) + { + auto size = Director::getInstance()->getWinSize(); + auto testSprite = Sprite::create("cocosui/CloseNormal.png"); + BlendFunc blend; + blend.src = GL_ZERO; + blend.dst = GL_ONE_MINUS_SRC_ALPHA; + testSprite->setBlendFunc(blend); + testSprite->setPosition(Vec2(size.width / 2, size.height / 2)); + testSprite->setScale(10); + addChild(testSprite); + + auto drawNode = DrawNode::create(); + drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1, 0, 0, 0.5f)); + addChild(drawNode); + + auto label = Label::create(); + label->setString(std::string("If you see a red line, the bug is fixed!")); + label->setPosition(size.width / 2, size.height / 4); + label->setTextColor(Color4B::ORANGE); + addChild(label); + + return true; + } + + return false; +} diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h new file mode 100644 index 0000000000..d55729d2a6 --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.h @@ -0,0 +1,14 @@ +#ifndef __BUG_CCDRAWNODE_H__ +#define __BUG_CCDRAWNODE_H__ + +#include "BugsTest.h" + +class BugDrawNodeLayer : public BugsTestBase +{ +public: + CREATE_FUNC(BugDrawNodeLayer); + + virtual bool init() override; +}; + +#endif \ No newline at end of file diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp new file mode 100644 index 0000000000..65895dd515 --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp @@ -0,0 +1,41 @@ +// +// When a pageview set to relative position & size, if it +// has child widget set to relative position & size either, +// when change layer size, relayout won't correctly effect +// to the child. +// In this test, if button at the center of panel, bug is fixed! +// + +#include "Bug-PageViewLayout.h" +#include "cocostudio/CocoStudio.h" +#include "ui/CocosGUI.h" +#include "CCFileUtils.h" + +USING_NS_CC; +using namespace ui; + +bool BugPageViewLayer::init() +{ + if (BugsTestBase::init()) + { + auto size = Director::getInstance()->getWinSize(); + + FileUtils::getInstance()->addSearchPath("ccs-res/cocosui/CustomTest/CustomWidgetCallbackBindTest"); + FileUtils::getInstance()->addSearchPath("ccs-res/cocosui/CustomTest/CustomWidgetCallbackBindTest/Default", true); + auto rootNode = CSLoader::createNode("cocosui/CustomTest/CustomWidgetCallbackBindTest/PageViewBugScene.csb"); + auto child = rootNode->getChildByName("ProjectNode_1"); + child->setContentSize(Size(480, 320)); + Helper::doLayout(child); + addChild(rootNode); + + auto label = Label::create(); + label->setString(std::string("If button is at the center of panel, the bug is fixed!")); + label->setPosition(size.width / 2, size.height / 4); + label->setTextColor(Color4B::ORANGE); + this->addChild(label); + + return true; + } + + return false; +} diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.h b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.h new file mode 100644 index 0000000000..a8218d7a28 --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.h @@ -0,0 +1,14 @@ +#ifndef __BUG_PAGEVIEWLAYOUT_H__ +#define __BUG_PAGEVIEWLAYOUT_H__ + +#include "BugsTest.h" + +class BugPageViewLayer : public BugsTestBase +{ +public: + CREATE_FUNC(BugPageViewLayer); + + virtual bool init() override; +}; + +#endif // !__BUG_PAGEVIEWLAYOUT_H__ diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index f2bfecc07a..c2323763a3 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -9,6 +9,8 @@ #include "Bug-1159.h" #include "Bug-1174.h" #include "Bug-Child.h" +#include "Bug-CCDrawNode.h" +#include "Bug-PageViewLayout.h" BugsTests::BugsTests() { @@ -23,4 +25,6 @@ BugsTests::BugsTests() ADD_TEST_CASE(Bug1174Layer); ADD_TEST_CASE(BugChild); ADD_TEST_CASE(BugCameraMask); + ADD_TEST_CASE(BugDrawNodeLayer); + ADD_TEST_CASE(BugPageViewLayer); } diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index dc719c1676..6bf41210fb 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit dc719c167623d343cd5fdaaba867e9e1a26a24d3 +Subproject commit 6bf41210fb5b1fc1e3458ae690461b7c6e73f0b0 diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index d1432c9dfd..647fc25f62 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -151,7 +151,9 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y + + @@ -354,7 +356,9 @@ xcopy "$(OutDir)..\*.dll" "$(OutDir)" /D /Y + + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 69be119287..aee368235e 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -960,6 +960,12 @@ Classes\Scene3DTest + + Classes\BugsTest + + + Classes\BugsTest + @@ -1748,5 +1754,11 @@ Classes\Scene3DTest + + Classes\BugsTest + + + Classes\BugsTest + \ No newline at end of file From a9dfd8012ca9bd9557a0de9fcba0ce7d4cf260ba Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Tue, 7 Jul 2015 11:02:00 +0800 Subject: [PATCH 6/9] Add new bug test to Android, Win 10, Win Universal, Linux project file --- tests/cpp-tests/CMakeLists.txt | 2 ++ .../cpp-tests/proj.android-studio/app/jni/Android.mk | 2 ++ tests/cpp-tests/proj.android/jni/Android.mk | 2 ++ tests/cpp-tests/proj.win10/cpp-tests.vcxproj | 4 ++++ tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters | 12 ++++++++++++ .../cpp-tests.Shared/cpp-tests.Shared.vcxitems | 4 ++++ .../cpp-tests.Shared.vcxitems.filters | 12 ++++++++++++ 7 files changed, 38 insertions(+) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 36dfb8a705..0dd94940ed 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -29,6 +29,8 @@ set(TESTS_SRC Classes/AppDelegate.cpp Classes/BaseTest.cpp Classes/BillBoardTest/BillBoardTest.cpp + Classes/BugsTest/Bug-CCDrawNode.cpp + Classes/BugsTest/Bug-PageViewLayout.cpp Classes/BugsTest/Bug-1159.cpp Classes/BugsTest/Bug-1174.cpp Classes/BugsTest/Bug-350.cpp 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 6179bca134..6844b42a50 100644 --- a/tests/cpp-tests/proj.android-studio/app/jni/Android.mk +++ b/tests/cpp-tests/proj.android-studio/app/jni/Android.mk @@ -20,6 +20,8 @@ LOCAL_SRC_FILES := main.cpp \ ../../../Classes/Box2DTestBed/GLES-Render.cpp \ ../../../Classes/Box2DTestBed/Test.cpp \ ../../../Classes/Box2DTestBed/TestEntries.cpp \ +../../../Classes/BugsTest/Bug-CCDrawNode.cpp \ +../../../Classes/BugsTest/Bug-PageViewLayout.cpp \ ../../../Classes/BugsTest/Bug-1159.cpp \ ../../../Classes/BugsTest/Bug-1174.cpp \ ../../../Classes/BugsTest/Bug-350.cpp \ diff --git a/tests/cpp-tests/proj.android/jni/Android.mk b/tests/cpp-tests/proj.android/jni/Android.mk index fdf9a83c53..5a28621436 100644 --- a/tests/cpp-tests/proj.android/jni/Android.mk +++ b/tests/cpp-tests/proj.android/jni/Android.mk @@ -20,6 +20,8 @@ LOCAL_SRC_FILES := main.cpp \ ../../Classes/Box2DTestBed/GLES-Render.cpp \ ../../Classes/Box2DTestBed/Test.cpp \ ../../Classes/Box2DTestBed/TestEntries.cpp \ +../../Classes/BugsTest/Bug-CCDrawNode.cpp \ +../../Classes/BugsTest/Bug-PageViewLayout.cpp \ ../../Classes/BugsTest/Bug-1159.cpp \ ../../Classes/BugsTest/Bug-1174.cpp \ ../../Classes/BugsTest/Bug-350.cpp \ diff --git a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj index 6efdc834f6..331d7f7250 100644 --- a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj @@ -298,6 +298,8 @@ + + @@ -546,6 +548,8 @@ + + diff --git a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters index d979dc6a43..1601899174 100644 --- a/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win10/cpp-tests.vcxproj.filters @@ -467,6 +467,12 @@ Classes\BugsTest + + Classes\BugsTest + + + Classes\BugsTest + Classes\BugsTest @@ -1206,6 +1212,12 @@ Classes\BugsTest + + Classes\BugsTest + + + Classes\BugsTest + Classes\BugsTest diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems index d13db0bb66..dfbf32d6e3 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems @@ -38,6 +38,8 @@ + + @@ -291,6 +293,8 @@ + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters index 6d13ce25c5..2027f4aa60 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters @@ -222,6 +222,12 @@ Classes\BugsTest + + Classes\BugsTest + + + Classes\BugsTest + Classes\BugsTest @@ -867,6 +873,12 @@ Classes\BugsTest + + Classes\BugsTest + + + Classes\BugsTest + Classes\BugsTest From 37674c3689bcc67ae01589fc6dabaff866a1d6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=B3=B0?= Date: Tue, 7 Jul 2015 11:17:08 +0800 Subject: [PATCH 7/9] Add bug test to Mac & iOS cpp-test project --- build/cocos2d_tests.xcodeproj/project.pbxproj | 16 ++++++++++++++++ .../Classes/BugsTest/Bug-PageViewLayout.cpp | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 88669d2829..975b7b0518 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -814,6 +814,10 @@ 688669711AE8E8B500C2CFD9 /* SpritePolygonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6886696F1AE8E8B500C2CFD9 /* SpritePolygonTest.cpp */; }; 688669721AE8E8B500C2CFD9 /* SpritePolygonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6886696F1AE8E8B500C2CFD9 /* SpritePolygonTest.cpp */; }; 826294431AAF071500CB7CF7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 826294421AAF071500CB7CF7 /* Security.framework */; }; + 94D793D91B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */; }; + 94D793DA1B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */; }; + 94D793DB1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */; }; + 94D793DC1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */; }; A05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; }; A07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; }; A07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; }; @@ -1774,6 +1778,10 @@ 70A7F72D191D3E4900F0F206 /* shaderTest.psh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = shaderTest.psh.h; sourceTree = ""; }; 70A7F730191D421B00F0F206 /* ShaderTest.vsh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShaderTest.vsh.h; sourceTree = ""; }; 826294421AAF071500CB7CF7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-CCDrawNode.cpp"; sourceTree = ""; }; + 94D793D61B4B7A3600F60F10 /* Bug-CCDrawNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-CCDrawNode.h"; sourceTree = ""; }; + 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-PageViewLayout.cpp"; sourceTree = ""; }; + 94D793D81B4B7A3600F60F10 /* Bug-PageViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-PageViewLayout.h"; sourceTree = ""; }; A035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; A07A52291783A1D20073F6A7 /* cpp-tests iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-tests iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A52B71783AE6D0073F6A7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; @@ -2427,6 +2435,10 @@ 1AC3597618CECF0B00F37B72 /* BugsTest */ = { isa = PBXGroup; children = ( + 94D793D51B4B7A3600F60F10 /* Bug-CCDrawNode.cpp */, + 94D793D61B4B7A3600F60F10 /* Bug-CCDrawNode.h */, + 94D793D71B4B7A3600F60F10 /* Bug-PageViewLayout.cpp */, + 94D793D81B4B7A3600F60F10 /* Bug-PageViewLayout.h */, 1AC3597718CECF0B00F37B72 /* Bug-1159.cpp */, 1AC3597818CECF0B00F37B72 /* Bug-1159.h */, 1AC3597918CECF0B00F37B72 /* Bug-1174.cpp */, @@ -4904,6 +4916,7 @@ 1AC35BEB18CECF0C00F37B72 /* CCControlSliderTest.cpp in Sources */, 1AC35C4D18CECF0C00F37B72 /* SpineTest.cpp in Sources */, 3E92EA821921A1400094CD21 /* Sprite3DTest.cpp in Sources */, + 94D793DB1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */, 1AC35C1D18CECF0C00F37B72 /* NewRendererTest.cpp in Sources */, 1AC35B6718CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080DB7191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */, @@ -5047,6 +5060,7 @@ 1AC35B2518CECF0C00F37B72 /* ActionsProgressTest.cpp in Sources */, 1AC35B6518CECF0C00F37B72 /* EffectsTest.cpp in Sources */, 1AC35B7118CECF0C00F37B72 /* TestHeaderLayer.cpp in Sources */, + 94D793D91B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */, 29080D93191B595E0066F8DF /* CustomImageTest.cpp in Sources */, 1AC35B2118CECF0C00F37B72 /* ActionManagerTest.cpp in Sources */, 1AC35C3D18CECF0C00F37B72 /* PhysicsTest.cpp in Sources */, @@ -5185,6 +5199,7 @@ 1AC35B2818CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4A18CECF0C00F37B72 /* ShaderTest.cpp in Sources */, B609E67419C18DAD003D0074 /* BillBoardTest.cpp in Sources */, + 94D793DC1B4B7A3600F60F10 /* Bug-PageViewLayout.cpp in Sources */, C04F935B1941B05400E9FEAB /* TileMapTest2.cpp in Sources */, 1AC35B4418CECF0C00F37B72 /* Bug-624.cpp in Sources */, 1AC35BF818CECF0C00F37B72 /* SocketIOTest.cpp in Sources */, @@ -5293,6 +5308,7 @@ 1AC35BEA18CECF0C00F37B72 /* CCControlSceneManager.cpp in Sources */, 182C5CBB1A95B30500C30D34 /* CocosStudio3DTest.cpp in Sources */, 1AC35B7418CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */, + 94D793DA1B4B7A3600F60F10 /* Bug-CCDrawNode.cpp in Sources */, 29080D9E191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */, 1AC35BFC18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */, 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */, diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp index 65895dd515..3572c5f41b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-PageViewLayout.cpp @@ -9,7 +9,7 @@ #include "Bug-PageViewLayout.h" #include "cocostudio/CocoStudio.h" #include "ui/CocosGUI.h" -#include "CCFileUtils.h" +#include "platform/CCFileUtils.h" USING_NS_CC; using namespace ui; @@ -21,7 +21,6 @@ bool BugPageViewLayer::init() auto size = Director::getInstance()->getWinSize(); FileUtils::getInstance()->addSearchPath("ccs-res/cocosui/CustomTest/CustomWidgetCallbackBindTest"); - FileUtils::getInstance()->addSearchPath("ccs-res/cocosui/CustomTest/CustomWidgetCallbackBindTest/Default", true); auto rootNode = CSLoader::createNode("cocosui/CustomTest/CustomWidgetCallbackBindTest/PageViewBugScene.csb"); auto child = rootNode->getChildByName("ProjectNode_1"); child->setContentSize(Size(480, 320)); From 707b4d8b908ca445fe1baf29eec135d81dd46f9a Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Tue, 7 Jul 2015 19:44:18 +0800 Subject: [PATCH 8/9] Fix windows universal project file --- .../cpp-tests.Shared.vcxitems | 8 +++---- .../cpp-tests.Shared.vcxitems.filters | 24 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems index dfbf32d6e3..7c802de63c 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems @@ -38,8 +38,6 @@ - - @@ -50,7 +48,9 @@ + + @@ -293,8 +293,6 @@ - - @@ -305,7 +303,9 @@ + + diff --git a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters index 2027f4aa60..a05a9aafcb 100644 --- a/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters +++ b/tests/cpp-tests/proj.win8.1-universal/cpp-tests.Shared/cpp-tests.Shared.vcxitems.filters @@ -222,12 +222,6 @@ Classes\BugsTest - - Classes\BugsTest - - - Classes\BugsTest - Classes\BugsTest @@ -802,6 +796,12 @@ Classes\NavMeshTest + + Classes\BugsTest + + + Classes\BugsTest + @@ -873,12 +873,6 @@ Classes\BugsTest - - Classes\BugsTest - - - Classes\BugsTest - Classes\BugsTest @@ -1779,5 +1773,11 @@ Classes\NavMeshTest + + Classes\BugsTest + + + Classes\BugsTest + \ No newline at end of file From 8429cc1d9093ed052c13c0da669be8a455413319 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Wed, 8 Jul 2015 09:35:29 +0800 Subject: [PATCH 9/9] Update CCDrawNode bug test --- tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp index 918a00d93e..60913d0c14 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-CCDrawNode.cpp @@ -25,10 +25,12 @@ bool BugDrawNodeLayer::init() auto drawNode = DrawNode::create(); drawNode->drawLine(Vec2(0, 0), Vec2(size.width, size.height), Color4F(1, 0, 0, 0.5f)); + Vec2 point = Vec2(size.width / 2, size.height / 2); + drawNode->drawPoint(point, 8, Color4F(1, 0, 0, 0.5f)); addChild(drawNode); auto label = Label::create(); - label->setString(std::string("If you see a red line, the bug is fixed!")); + label->setString(std::string("If you see a red line with a block at center, the bug is fixed!")); label->setPosition(size.width / 2, size.height / 4); label->setTextColor(Color4B::ORANGE); addChild(label);