From f6eac43a0a7f8b0e9d1fbab62fecc45bf0c2968a Mon Sep 17 00:00:00 2001 From: 2youyou2 Date: Mon, 5 May 2014 09:45:06 +0800 Subject: [PATCH 001/125] fixed no effect with stopping tween between two frames --- cocos/editor-support/cocostudio/CCDatas.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index 5e97f43519..44030e2ea1 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -290,7 +290,8 @@ void FrameData::copy(const BaseData *baseData) } } - blendFunc = frameData->blendFunc; + blendFunc = frameData->blendFunc; + isTween = frameData->isTween; } } From d4f644814c194a6f4abd6101e64a4193040ce8c5 Mon Sep 17 00:00:00 2001 From: 2youyou2 Date: Mon, 5 May 2014 17:43:15 +0800 Subject: [PATCH 002/125] change tab to 4 space --- cocos/editor-support/cocostudio/CCDatas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index 44030e2ea1..14e0f942dd 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -291,7 +291,7 @@ void FrameData::copy(const BaseData *baseData) } blendFunc = frameData->blendFunc; - isTween = frameData->isTween; + isTween = frameData->isTween; } } From 44b93f35486709168f4dcc79c377f16af9064228 Mon Sep 17 00:00:00 2001 From: 2youyou2 Date: Mon, 5 May 2014 17:46:06 +0800 Subject: [PATCH 003/125] change tab to 4 space --- cocos/editor-support/cocostudio/CCDatas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index 14e0f942dd..df3ececb81 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -290,7 +290,7 @@ void FrameData::copy(const BaseData *baseData) } } - blendFunc = frameData->blendFunc; + blendFunc = frameData->blendFunc; isTween = frameData->isTween; } } From 8507fd7f8d5ed04c5099455b07363ddf0fb7b3c9 Mon Sep 17 00:00:00 2001 From: Jason Xu Date: Thu, 8 May 2014 10:28:41 +0800 Subject: [PATCH 004/125] FIx: correct TotalTime of ActionObject. --- cocos/editor-support/cocostudio/CCActionObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp index 0c95b3d128..3688ce0f9a 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -123,7 +123,7 @@ void ActionObject::initWithDictionary(const rapidjson::Value& dic, Ref* root) if(length > maxLength) maxLength = length; } - _fTotalTime = maxLength*_fTotalTime; + _fTotalTime = maxLength*_fUnitTime; } void ActionObject::addActionNode(ActionNode* node) From 1053cacc16f7313d70d6c4d8af139462c37d5aa1 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 12 May 2014 15:05:21 +0800 Subject: [PATCH 005/125] don't trigger onExitTransitionDidStart --- cocos/base/CCDirector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 53e9b53eea..d5f5386d90 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -819,11 +819,13 @@ void Director::replaceScene(Scene *scene) CCASSERT(_runningScene, "Use runWithScene: instead to start the director"); CCASSERT(scene != nullptr, "the scene should not be null"); + if (scene == _nextScene) + return; + if (_nextScene) { if (_nextScene->isRunning()) { - _nextScene->onExitTransitionDidStart(); _nextScene->onExit(); } _nextScene->cleanup(); @@ -894,7 +896,6 @@ void Director::popToSceneStackLevel(int level) if (current->isRunning()) { - current->onExitTransitionDidStart(); current->onExit(); } @@ -925,7 +926,6 @@ void Director::purgeDirector() if (_runningScene) { - _runningScene->onExitTransitionDidStart(); _runningScene->onExit(); _runningScene->cleanup(); _runningScene->release(); From 1aabedb316a741be692ddea9381b22be1e77ca2a Mon Sep 17 00:00:00 2001 From: heliclei Date: Mon, 12 May 2014 21:47:55 +0800 Subject: [PATCH 006/125] support auto start tests --- tests/cpp-tests/Classes/AppDelegate.cpp | 9 +-- tests/cpp-tests/Classes/controller.cpp | 82 ++++++++++++++++++++++++- tests/cpp-tests/Classes/controller.h | 3 +- 3 files changed, 86 insertions(+), 8 deletions(-) diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index c9b47f1b15..85c5e0bb4c 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -113,11 +113,6 @@ bool AppDelegate::applicationDidFinishLaunching() auto scene = Scene::create(); auto layer = new TestController(); -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) - layer->addConsoleAutoTest(); -#endif - - layer->autorelease(); scene->addChild(layer); director->runWithScene(scene); @@ -126,8 +121,10 @@ bool AppDelegate::applicationDidFinishLaunching() #if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) auto console = director->getConsole(); console->listenOnTCP(5678); + layer->addConsoleAutoTest(); + //layer->startAutoRun(); #endif - + layer->autorelease(); return true; } diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 00994e451e..40a4219599 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -14,7 +14,9 @@ #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) #include +#include #include +#include #else #include #endif @@ -31,7 +33,7 @@ Controller g_aTestNames[] = { // TESTS MUST BE ORDERED ALPHABETICALLY // violators will be prosecuted // - { "A new UI", [](){ return new UITestScene(); }}, + //{ "A new UI", [](){ return new UITestScene(); }}, { "Accelerometer", []() { return new AccelerometerTestScene(); } }, { "ActionManager", [](){return new ActionManagerTestScene(); } }, { "Actions - Basic", [](){ return new ActionsTestScene(); } }, @@ -442,5 +444,83 @@ void TestController::addConsoleAutoTest() }; console->addCommand(autotest); } + +void TestController::startAutoRun() +{ + + std::thread t = std::thread( &TestController::autorun, this); + t.detach(); +} + +void TestController::autorun() +{ + struct addrinfo hints; + struct addrinfo *result, *rp; + int sfd, s; + + /* Obtain address(es) matching host/port */ + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_INET; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_STREAM; /* stream socket */ + hints.ai_flags = 0; + hints.ai_protocol = 0; /* Any protocol */ + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2),&wsaData); +#endif + + s = getaddrinfo("localhost", "5678", &hints, &result); + if (s != 0) + { + CCLOG("autotest: getaddrinfo error"); + return; + } + + /* getaddrinfo() returns a list of address structures. + Try each address until we successfully connect(2). + If socket(2) (or connect(2)) fails, we (close the socket + and) try the next address. */ + + for (rp = result; rp != NULL; rp = rp->ai_next) { + sfd = socket(rp->ai_family, rp->ai_socktype, + rp->ai_protocol); + if (sfd == -1) + continue; + + if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) + break; /* Success */ + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + closesocket(sfd); +#else + close(sfd); +#endif + } + + if (rp == NULL) { /* No address succeeded */ + CCLOG("autotest: could not connect!"); + return; + } + + freeaddrinfo(result); /* No longer needed */ + + std::string tmp = "autotest run\n"; + + char cmd[512]; + + strcpy(cmd, tmp.c_str()); + wait(3); + send(sfd,cmd,strlen(cmd),0); + wait(36000); + #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + closesocket(sfd); + WSACleanup(); +#else + close(sfd); +#endif + return; +} + #endif diff --git a/tests/cpp-tests/Classes/controller.h b/tests/cpp-tests/Classes/controller.h index cf30606d55..10f3c53acb 100644 --- a/tests/cpp-tests/Classes/controller.h +++ b/tests/cpp-tests/Classes/controller.h @@ -19,7 +19,8 @@ public: void onMouseScroll(Event *event); void addConsoleAutoTest(); - + void autorun(); + void startAutoRun(); private: Vector2 _beginPos; Menu* _itemMenu; From 471f218acf2a295506fec5f28e78cd3480fe04e9 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 11:47:32 +0800 Subject: [PATCH 007/125] add config item to control whether start autorun --- tests/cpp-tests/Classes/AppDelegate.cpp | 13 +++++++++---- tests/cpp-tests/Classes/controller.cpp | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index 85c5e0bb4c..c417e33456 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -113,7 +113,8 @@ bool AppDelegate::applicationDidFinishLaunching() auto scene = Scene::create(); auto layer = new TestController(); - + layer->autorelease(); + layer->addConsoleAutoTest(); scene->addChild(layer); director->runWithScene(scene); @@ -121,10 +122,14 @@ bool AppDelegate::applicationDidFinishLaunching() #if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) auto console = director->getConsole(); console->listenOnTCP(5678); - layer->addConsoleAutoTest(); - //layer->startAutoRun(); + Configuration *conf = Configuration::getInstance(); + bool isAutoRun = conf->getValue("cocos2d.x.testcpp.autorun", Value(false)).asBool(); + if(isAutoRun) + { + layer->startAutoRun(); + } #endif - layer->autorelease(); + return true; } diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 40a4219599..652b196e44 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -33,7 +33,7 @@ Controller g_aTestNames[] = { // TESTS MUST BE ORDERED ALPHABETICALLY // violators will be prosecuted // - //{ "A new UI", [](){ return new UITestScene(); }}, + { "A new UI", [](){ return new UITestScene(); }}, { "Accelerometer", []() { return new AccelerometerTestScene(); } }, { "ActionManager", [](){return new ActionManagerTestScene(); } }, { "Actions - Basic", [](){ return new ActionsTestScene(); } }, From b2397f40592fe25dcc90b0a36a646a51e6f00749 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 12:04:43 +0800 Subject: [PATCH 008/125] issue #5005, fix widget hittest problem --- cocos/ui/UIWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index 14d7f63597..fd1f58a70f 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -543,7 +543,7 @@ void Widget::didNotSelectSelf() bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { _hitted = false; - if (isEnabled() && isTouchEnabled()) + if (isVisible() && isEnabled() && isTouchEnabled()) { _touchStartPos = touch->getLocation(); if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) From e1f82c174b7a8c0f221ad788abeeb07234987716 Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Mon, 12 May 2014 22:50:31 -0700 Subject: [PATCH 009/125] add TestCase for reparentChildren bug --- build/cocos2d_tests.xcodeproj/project.pbxproj | 8 +++ .../cpp-tests/Classes/BugsTest/Bug-Child.cpp | 68 +++++++++++++++++++ tests/cpp-tests/Classes/BugsTest/Bug-Child.h | 34 ++++++++++ 3 files changed, 110 insertions(+) create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp create mode 100644 tests/cpp-tests/Classes/BugsTest/Bug-Child.h diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 5282890068..faa0204c74 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -815,6 +815,8 @@ 3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; 3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; }; + 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; + 59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.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 */; }; @@ -1852,6 +1854,8 @@ 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIVideoPlayerTest.cpp; sourceTree = ""; }; 3EA0FB71191C844400B170C8 /* UIVideoPlayerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayerTest.h; sourceTree = ""; }; 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = cocos2d_libs.xcodeproj; sourceTree = ""; }; + 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-Child.cpp"; sourceTree = ""; }; + 59620E8E1921E5CF002021B6 /* Bug-Child.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-Child.h"; sourceTree = ""; }; 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 = ""; }; A035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; @@ -2425,6 +2429,8 @@ 1AC3598B18CECF0B00F37B72 /* Bug-914.h */, 1AC3598C18CECF0B00F37B72 /* BugsTest.cpp */, 1AC3598D18CECF0B00F37B72 /* BugsTest.h */, + 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */, + 59620E8E1921E5CF002021B6 /* Bug-Child.h */, ); path = BugsTest; sourceTree = ""; @@ -4588,6 +4594,7 @@ 1AC35C3118CECF0C00F37B72 /* PerformanceRendererTest.cpp in Sources */, 1AC35C4518CECF0C00F37B72 /* SceneTest.cpp in Sources */, 1AC35B6F18CECF0C00F37B72 /* MenuTestLayer.cpp in Sources */, + 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */, 29080DCD191B595E0066F8DF /* UIScrollViewTest_Editor.cpp in Sources */, 1AC35B5118CECF0C00F37B72 /* ClippingNodeTest.cpp in Sources */, 1AC35C1318CECF0C00F37B72 /* LayerTest.cpp in Sources */, @@ -4880,6 +4887,7 @@ 1AC35B3018CECF0C00F37B72 /* Box2dView.cpp in Sources */, 29080DAE191B595E0066F8DF /* UIImageViewTest.cpp in Sources */, 1AC35C1018CECF0C00F37B72 /* LabelTest.cpp in Sources */, + 59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */, 29080DC8191B595E0066F8DF /* UISceneManager.cpp in Sources */, 1AC35C6A18CECF0C00F37B72 /* VisibleRect.cpp in Sources */, 1AC35C4018CECF0C00F37B72 /* ReleasePoolTest.cpp in Sources */, diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp new file mode 100644 index 0000000000..8408dd9810 --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -0,0 +1,68 @@ +// +// Bug-Child.cpp +// cocos2d_tests +// +// Created by NiTe Luo on 5/12/14. +// +// + +#include "Bug-Child.h" + +Scene* BugChild::scene() +{ + // 'scene' is an autorelease object. + auto scene = Scene::create(); + // 'layer' is an autorelease object. + auto layer = BugChild::create(); + + // add layer as a child to scene + scene->addChild(layer); + + // return the scene + return scene; +} + +bool BugChild::init() +{ + if (BugsTestBaseLayer::init()) + { + auto size = Director::getInstance()->getWinSize(); + + // create and initialize a Label + auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(BugChild::switchChild, this)); + + menu = Menu::create(item1, NULL); + + menu->alignItemsVertically(); + menu->setPosition(size.width/2, 100); + addChild(menu); + + parent1 = Sprite::create("grossini.png"); + parent1->setPosition(100, size.height/2); + addChild(parent1); + + parent2 = Sprite::create("grossini_sister1.png"); + parent2->setPosition(300, size.height/2); + addChild(parent2); + + child = Sprite::create("grossini_sister2.png"); + + return true; + } + + return false; +} + +void BugChild::switchChild(Ref *sender) +{ + if(parent1->getChildrenCount() > 0) + { + child->removeFromParent(); + parent2->addChild(child); + } + else + { + child->removeFromParent(); + parent1->addChild(child); + } +} diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.h b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h new file mode 100644 index 0000000000..aace4944a9 --- /dev/null +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.h @@ -0,0 +1,34 @@ +// +// Bug-Child.h +// cocos2d_tests +// +// Created by NiTe Luo on 5/12/14. +// +// + +#ifndef __Bug_Child__ +#define __Bug_Child__ + +#include "BugsTest.h" + +class BugChild : public BugsTestBaseLayer +{ +public: + static Scene* scene(); + virtual bool init(); + + void switchChild(Ref* sender); + + CREATE_FUNC(BugChild); + +protected: + + Sprite* parent1; + Sprite* parent2; + + Sprite* child; + + Menu* menu; +}; + +#endif /* defined(__Bug_Child__) */ From eaa879a9f3e021b35324a3553a6fc91e522a7c07 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 14:08:49 +0800 Subject: [PATCH 010/125] fix for winrt build --- tests/cpp-tests/Classes/AppDelegate.cpp | 3 +++ tests/cpp-tests/Classes/controller.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index c417e33456..724a110c20 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -113,6 +113,9 @@ bool AppDelegate::applicationDidFinishLaunching() auto scene = Scene::create(); auto layer = new TestController(); +#if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) + layer->addConsoleAutoTest(); +#endif layer->autorelease(); layer->addConsoleAutoTest(); scene->addChild(layer); diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 652b196e44..e0bb8d32be 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -512,7 +512,7 @@ void TestController::autorun() strcpy(cmd, tmp.c_str()); wait(3); send(sfd,cmd,strlen(cmd),0); - wait(36000); + wait(3600); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) closesocket(sfd); WSACleanup(); From 45d85476229468808793e28e756023e127b9ccf1 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 14:16:06 +0800 Subject: [PATCH 011/125] add config item --- tests/cpp-tests/Classes/controller.cpp | 5 ++++- tests/cpp-tests/Resources/configs/config-example.plist | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index e0bb8d32be..d301c1a3e7 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -512,7 +512,10 @@ void TestController::autorun() strcpy(cmd, tmp.c_str()); wait(3); send(sfd,cmd,strlen(cmd),0); - wait(3600); + while(true) + { + wait(1); + } #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) closesocket(sfd); WSACleanup(); diff --git a/tests/cpp-tests/Resources/configs/config-example.plist b/tests/cpp-tests/Resources/configs/config-example.plist index b680f89421..7bcad82e8c 100755 --- a/tests/cpp-tests/Resources/configs/config-example.plist +++ b/tests/cpp-tests/Resources/configs/config-example.plist @@ -14,6 +14,8 @@ rgba8888 cocos2d.x.texture.pvrv2_has_alpha_premultiplied + cocos2d.x.testcpp.autorun + metadata From 8cc224dcef96af20e43497f354969e448a30d80e Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 14:17:43 +0800 Subject: [PATCH 012/125] change default auto-run config to false --- tests/cpp-tests/Resources/configs/config-example.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Resources/configs/config-example.plist b/tests/cpp-tests/Resources/configs/config-example.plist index 7bcad82e8c..4567088b08 100755 --- a/tests/cpp-tests/Resources/configs/config-example.plist +++ b/tests/cpp-tests/Resources/configs/config-example.plist @@ -15,7 +15,7 @@ cocos2d.x.texture.pvrv2_has_alpha_premultiplied cocos2d.x.testcpp.autorun - + metadata From 7d8cfc4cca37a21b5b445f8b7252b55523c4b941 Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Mon, 12 May 2014 23:28:20 -0700 Subject: [PATCH 013/125] set parent transform dirty when addChild --- .../xcschemes/build all libs Mac.xcscheme | 2 +- .../xcschemes/build all libs iOS.xcscheme | 2 +- .../xcschemes/build all tests Mac.xcscheme | 2 +- .../xcschemes/build all tests iOS.xcscheme | 2 +- cocos/2d/CCNode.cpp | 1 + .../cpp-tests/Classes/BugsTest/Bug-Child.cpp | 22 +++++++++++-------- tests/cpp-tests/Classes/BugsTest/BugsTest.cpp | 2 ++ 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme index 25dbc11dbb..a3edd49794 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme index 170dc164b6..faeccc8ba0 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme index 2937783395..d834a30c7e 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme index ecc2fd2528..c4b41a8e88 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme @@ -15,7 +15,7 @@ diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 7296f3dec8..c577703ead 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -915,6 +915,7 @@ void Node::detachChild(Node *child, ssize_t childIndex, bool doCleanup) // helper used by reorderChild & add void Node::insertChild(Node* child, int z) { + _transformUpdated = true; _reorderChildDirty = true; _children.pushBack(child); child->_setLocalZOrder(z); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp index 8408dd9810..cfe1e363e6 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -29,7 +29,7 @@ bool BugChild::init() auto size = Director::getInstance()->getWinSize(); // create and initialize a Label - auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(BugChild::switchChild, this)); + auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugChild::switchChild, this)); menu = Menu::create(item1, NULL); @@ -37,16 +37,18 @@ bool BugChild::init() menu->setPosition(size.width/2, 100); addChild(menu); - parent1 = Sprite::create("grossini.png"); - parent1->setPosition(100, size.height/2); + parent1 = Sprite::create("Images/grossini.png"); + parent1->setPosition(size.width/4, size.height/2); addChild(parent1); - parent2 = Sprite::create("grossini_sister1.png"); - parent2->setPosition(300, size.height/2); + parent2 = Sprite::create("Images/grossinis_sister1.png"); + parent2->setPosition(size.width*3/4, size.height/2); addChild(parent2); - child = Sprite::create("grossini_sister2.png"); - + child = Sprite::create("Images/grossinis_sister2.png"); + child->setPosition(20, 20); + child->retain(); + parent1->addChild(child); return true; } @@ -57,12 +59,14 @@ void BugChild::switchChild(Ref *sender) { if(parent1->getChildrenCount() > 0) { - child->removeFromParent(); + parent1->removeChild(child, false); parent2->addChild(child); + CCLOG("Child attached to parent2"); } else { - child->removeFromParent(); + parent2->removeChild(child, false); parent1->addChild(child); + CCLOG("Child attached to parent1"); } } diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index 528d953461..17c89890db 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -8,6 +8,7 @@ #include "Bug-914.h" #include "Bug-1159.h" #include "Bug-1174.h" +#include "Bug-Child.h" #define TEST_BUG(__bug__) \ { \ @@ -31,6 +32,7 @@ struct { const char *test_name; std::function callback; } g_bugs[] = { + { "Bug-Child", [](Ref* sender){Director::getInstance()->replaceScene(BugChild::scene());} }, { "Bug-350", [](Ref* sender){ TEST_BUG(350)} }, { "Bug-422", [](Ref* sender){ TEST_BUG(422)} }, { "Bug-458", [](Ref* sender){ TEST_BUG(458)} }, From fca0ec696f1ebe149afcfc953fdb1e621507e12d Mon Sep 17 00:00:00 2001 From: Nite Luo Date: Mon, 12 May 2014 23:32:19 -0700 Subject: [PATCH 014/125] Undo project file changes --- .../xcshareddata/xcschemes/build all libs Mac.xcscheme | 2 +- .../xcshareddata/xcschemes/build all libs iOS.xcscheme | 2 +- .../xcshareddata/xcschemes/build all tests Mac.xcscheme | 2 +- .../xcshareddata/xcschemes/build all tests iOS.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme index a3edd49794..25dbc11dbb 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme index faeccc8ba0..170dc164b6 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme index d834a30c7e..2937783395 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme @@ -15,7 +15,7 @@ diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme index c4b41a8e88..ecc2fd2528 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme @@ -15,7 +15,7 @@ From 17cd12f8b157bcd3b2c1fa6ca039ca45eaded5a4 Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 14:43:11 +0800 Subject: [PATCH 015/125] fix win32 compile --- tests/cpp-tests/Classes/controller.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index d301c1a3e7..763ee57930 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -19,6 +19,7 @@ #include #else #include +#include #endif #include "cocostudio/CocoStudio.h" #include "UITest/UITest.h" From 1a319b3f125d39a5869bebcfe339d926158a6ada Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 14:52:27 +0800 Subject: [PATCH 016/125] issue #5005, deprecated setTouchEnabled --- cocos/ui/UIWidget.cpp | 2 +- cocos/ui/UIWidget.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index fd1f58a70f..a920648bc1 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -543,7 +543,7 @@ void Widget::didNotSelectSelf() bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { _hitted = false; - if (isVisible() && isEnabled() && isTouchEnabled()) + if (isVisible() && isEnabled()) { _touchStartPos = touch->getLocation(); if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index ab0486bf0f..f00ee80a1f 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -166,7 +166,7 @@ public: * * @param visible true if the widget is touch enabled, false if the widget is touch disabled. */ - virtual void setTouchEnabled(bool enabled); + CC_DEPRECATED_ATTRIBUTE virtual void setTouchEnabled(bool enabled); /** * To set the bright style of widget. @@ -182,7 +182,7 @@ public: * * @return true if the widget is touch enabled, false if the widget is touch disabled. */ - bool isTouchEnabled() const; + CC_DEPRECATED_ATTRIBUTE bool isTouchEnabled() const; /** * Determines if the widget is highlighted From 1c47c833c6887a83d67a8f1d6aceaf67e471944e Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 14:56:44 +0800 Subject: [PATCH 017/125] issue #5005, fixed widget visit method --- cocos/ui/UIWidget.cpp | 2 +- cocos/ui/UIWidget.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index cba820fffc..f050b576d8 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -122,7 +122,7 @@ void Widget::onExit() void Widget::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) { - if (_enabled) + if (_visible) { adaptRenderers(); ProtectedNode::visit(renderer, parentTransform, parentTransformUpdated); diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 2a319a3d83..a2e873358f 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -122,11 +122,12 @@ public: /** * Sets whether the widget is enabled + * + * true if the widget is enabled, widget may be touched , false if the widget is disabled, widget cannot be touched. * - * Highest control of widget. * The default value is true, a widget is default to enabled * - * @param enabled true if the widget is enabled, widget may be touched and visible, false if the widget is disabled, widget cannot be touched and hidden. + * @param enabled */ virtual void setEnabled(bool enabled); From 86411837c677d12f885fe6223c74352fca04437a Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 16:15:21 +0800 Subject: [PATCH 018/125] PLEASE NEVER `using namespace cocos2d;` in header file --- cocos/2d/CCActionCamera.h | 2 -- cocos/2d/CCDrawingPrimitives.h | 2 -- cocos/2d/CCNode.h | 2 -- cocos/base/CCDirector.h | 2 -- cocos/base/ccTypes.h | 2 -- .../cocosbuilder/CCScale9SpriteLoader.h | 4 +--- cocos/editor-support/cocostudio/CCActionFrame.h | 8 +++----- cocos/editor-support/cocostudio/CCArmature.h | 14 ++++++-------- cocos/editor-support/cocostudio/CCBatchNode.h | 6 ++---- cocos/editor-support/cocostudio/CCBone.h | 10 ++++------ .../editor-support/cocostudio/CCColliderDetector.h | 4 +--- cocos/editor-support/cocostudio/CCDisplayManager.h | 4 ++-- cocos/editor-support/cocostudio/CCSkin.h | 8 ++++---- cocos/editor-support/cocostudio/CCTransformHelp.h | 6 ++---- cocos/editor-support/spine/CCSkeleton.h | 6 ++---- cocos/math/CCAffineTransform.h | 2 -- cocos/math/CCGeometry.h | 2 -- cocos/renderer/CCGLProgram.h | 2 -- extensions/physics-nodes/CCPhysicsSprite.h | 2 -- .../TableViewTest/CustomTableViewCell.h | 4 +--- 20 files changed, 28 insertions(+), 64 deletions(-) diff --git a/cocos/2d/CCActionCamera.h b/cocos/2d/CCActionCamera.h index cec8250cd5..68eb8f4e2b 100644 --- a/cocos/2d/CCActionCamera.h +++ b/cocos/2d/CCActionCamera.h @@ -33,8 +33,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - class Camera; /** diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index 05f8265b1e..a687302390 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -69,8 +69,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - /** * @addtogroup global * @{ diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index e12688151f..3f7f20d38c 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -71,8 +71,6 @@ enum { kNodeOnCleanup }; -USING_NS_CC_MATH; - bool nodeComparisonLess(Node* n1, Node* n2); class EventListener; diff --git a/cocos/base/CCDirector.h b/cocos/base/CCDirector.h index 14c7a4e6d7..6a69f8c2c1 100644 --- a/cocos/base/CCDirector.h +++ b/cocos/base/CCDirector.h @@ -41,8 +41,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - /** * @addtogroup base_nodes * @{ diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index b2ce67c65d..2806a74aac 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -35,8 +35,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - struct Color4B; struct Color4F; diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h index 9e65125046..39ac673b01 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h @@ -7,8 +7,6 @@ namespace cocosbuilder { -USING_NS_CC_MATH; - /* Forward declaration. */ class CCBReader; @@ -33,7 +31,7 @@ protected: virtual cocos2d::extension::Scale9Sprite * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { cocos2d::extension::Scale9Sprite* pNode = cocos2d::extension::Scale9Sprite::create(); - pNode->setAnchorPoint(Vector2(0,0)); + pNode->setAnchorPoint(cocos2d::Vector2::ZERO); return pNode; }; diff --git a/cocos/editor-support/cocostudio/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h index dac652843b..f5ef0ba2e4 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -30,8 +30,6 @@ THE SOFTWARE. namespace cocostudio { -USING_NS_CC_MATH; - enum FrameType { kKeyframeMove = 0, @@ -231,14 +229,14 @@ public: * * @param the move action position. */ - void setPosition(Vector2 pos); + void setPosition(cocos2d::Vector2 pos); /** * Gets the move action position. * * @return the move action position. */ - Vector2 getPosition(); + cocos2d::Vector2 getPosition(); /** * Gets the ActionInterval of ActionFrame. @@ -249,7 +247,7 @@ public: */ virtual cocos2d::ActionInterval* getAction(float duration); protected: - Vector2 _position; + cocos2d::Vector2 _position; }; /** diff --git a/cocos/editor-support/cocostudio/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h index 41c5124912..7d3eaeac0f 100644 --- a/cocos/editor-support/cocostudio/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -38,8 +38,6 @@ struct cpBody; namespace cocostudio { -USING_NS_CC_MATH; - CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; @@ -159,14 +157,14 @@ public: * @js NA * @lua NA */ - virtual void visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; - virtual void draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; virtual void update(float dt) override; virtual void onEnter() override; virtual void onExit() override; - virtual const Matrix& getNodeToParentTransform() const override; + virtual const cocos2d::Matrix& getNodeToParentTransform() const override; /** * @js NA * @lua NA @@ -183,8 +181,8 @@ public: * Set contentsize and Calculate anchor point. */ virtual void updateOffsetPoint(); - virtual void setAnchorPoint(const Vector2& point) override; - virtual const Vector2& getAnchorPointInPoints() const override; + virtual void setAnchorPoint(const cocos2d::Vector2& point) override; + virtual const cocos2d::Vector2& getAnchorPointInPoints() const override; virtual void setAnimation(ArmatureAnimation *animation); virtual ArmatureAnimation *getAnimation() const; @@ -272,7 +270,7 @@ protected: cocos2d::BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance cocos2d::Vector2 _offsetPoint; - Vector2 _realAnchorPointInPoints; + cocos2d::Vector2 _realAnchorPointInPoints; ArmatureAnimation *_animation; diff --git a/cocos/editor-support/cocostudio/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h index cfd6d69e9d..b32aa2a130 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -34,8 +34,6 @@ namespace cocos2d { namespace cocostudio { -USING_NS_CC_MATH; - class BatchNode : public cocos2d::Node { public: @@ -58,8 +56,8 @@ public: virtual void addChild(cocos2d::Node *pChild, int zOrder) override; virtual void addChild(cocos2d::Node *pChild, int zOrder, int tag) override; virtual void removeChild(cocos2d::Node* child, bool cleanup) override; - virtual void visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; - virtual void draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; protected: void generateGroupCommand(); diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index 18eb0a566a..8d20281f39 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -35,8 +35,6 @@ THE SOFTWARE. namespace cocostudio { -USING_NS_CC_MATH; - class Armature; class Bone : public cocos2d::Node @@ -156,10 +154,10 @@ public: virtual void setTransformDirty(bool dirty) { _boneTransformDirty = dirty; } virtual bool isTransformDirty() { return _boneTransformDirty; } - virtual Matrix getNodeToArmatureTransform() const; - virtual Matrix getNodeToWorldTransform() const override; + virtual cocos2d::Matrix getNodeToArmatureTransform() const; + virtual cocos2d::Matrix getNodeToWorldTransform() const override; - Node *getDisplayRenderNode(); + cocos2d::Node *getDisplayRenderNode(); DisplayType getDisplayRenderNodeType(); /* @@ -250,7 +248,7 @@ protected: bool _boneTransformDirty; //! Whether or not transform dirty //! self Transform, use this to change display's state - Matrix _worldTransform; + cocos2d::Matrix _worldTransform; BaseData *_worldInfo; diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h index d78a6c7aaa..496f905681 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -42,8 +42,6 @@ THE SOFTWARE. namespace cocostudio { -USING_NS_CC_MATH; - class Bone; /** @@ -157,7 +155,7 @@ public: void removeContourData(ContourData *contourData); void removeAll(); - void updateTransform(Matrix &t); + void updateTransform(cocos2d::Matrix &t); void setActive(bool active); bool getActive(); diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index e99bca9947..4ae988699e 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -119,8 +119,8 @@ public: cocos2d::Size getContentSize() const; cocos2d::Rect getBoundingBox() const; - Vector2 getAnchorPoint() const; - Vector2 getAnchorPointInPoints() const; + cocos2d::Vector2 getAnchorPoint() const; + cocos2d::Vector2 getAnchorPointInPoints() const; /** * Check if the position is inside the bone. diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index 5a2f2f70b4..d27ff5fb2c 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -51,10 +51,10 @@ public: void updateArmatureTransform(); void updateTransform() override; - Matrix getNodeToWorldTransform() const override; - Matrix getNodeToWorldTransformAR() const; + cocos2d::Matrix getNodeToWorldTransform() const override; + cocos2d::Matrix getNodeToWorldTransformAR() const; - virtual void draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; /** * @js NA @@ -75,7 +75,7 @@ protected: BaseData _skinData; Bone *_bone; Armature *_armature; - Matrix _skinTransform; + cocos2d::Matrix _skinTransform; std::string _displayName; cocos2d::QuadCommand _quadCommand; // quad command }; diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h index f95b3fef6b..5e45890ba3 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -30,8 +30,6 @@ THE SOFTWARE. namespace cocostudio { -USING_NS_CC_MATH; - /* * use to calculate the matrix of node from parent node * @js NA @@ -49,9 +47,9 @@ public: static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode); static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix); - static void nodeToMatrix(const BaseData &node, Matrix &matrix); + static void nodeToMatrix(const BaseData &node, cocos2d::Matrix &matrix); static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node); - static void matrixToNode(const Matrix &_matrix, BaseData &_node); + static void matrixToNode(const cocos2d::Matrix &_matrix, BaseData &_node); static void nodeConcat(BaseData &target, BaseData &source); static void nodeSub(BaseData &target, BaseData &source); diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index b2c4445b10..2ff978ffda 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -43,8 +43,6 @@ namespace spine { -USING_NS_CC_MATH; - /** Draws a skeleton. */ @@ -69,8 +67,8 @@ public: virtual ~Skeleton (); virtual void update (float deltaTime) override; - virtual void draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) override; - void onDraw(const Matrix &transform, bool transformUpdated); + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; + void onDraw(const cocos2d::Matrix &transform, bool transformUpdated); void onEnter() override; void onExit() override; virtual cocos2d::Rect getBoundingBox () const override; diff --git a/cocos/math/CCAffineTransform.h b/cocos/math/CCAffineTransform.h index 211aa6e960..e2f16ef92c 100644 --- a/cocos/math/CCAffineTransform.h +++ b/cocos/math/CCAffineTransform.h @@ -33,8 +33,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - struct AffineTransform { float a, b, c, d; float tx, ty; diff --git a/cocos/math/CCGeometry.h b/cocos/math/CCGeometry.h index 7ecfc0affb..47be81c1ee 100644 --- a/cocos/math/CCGeometry.h +++ b/cocos/math/CCGeometry.h @@ -35,8 +35,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - /** * @addtogroup data_structures * @{ diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index 448af919d6..7e1ee760ee 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -39,8 +39,6 @@ THE SOFTWARE. NS_CC_BEGIN -USING_NS_CC_MATH; - /** * @addtogroup shaders * @{ diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index 51b488d16b..ed817473a4 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -31,8 +31,6 @@ class b2Body; NS_CC_EXT_BEGIN -USING_NS_CC_MATH; - /** A Sprite subclass that is bound to a physics body. It works with: - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h index 7d997ca9a4..ca63419f98 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -4,12 +4,10 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" -USING_NS_CC_MATH; - class CustomTableViewCell : public cocos2d::extension::TableViewCell { public: - virtual void draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; }; #endif /* __CUSTOMTABELVIEWCELL_H__ */ From 2d88c8ea92917ccb1107d876d9d4e98f62cb721e Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 16:37:41 +0800 Subject: [PATCH 019/125] closed #5005, fix visible and enable issue --- cocos/ui/UIButton.cpp | 1 - cocos/ui/UICheckBox.cpp | 1 - cocos/ui/UIScrollView.cpp | 1 - cocos/ui/UISlider.cpp | 1 - cocos/ui/UITextField.cpp | 1 - cocos/ui/UIWidget.cpp | 72 ++++++++++++++++++++++++--------------- cocos/ui/UIWidget.h | 9 +++-- 7 files changed, 51 insertions(+), 35 deletions(-) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index b54c7816bd..3c1ed0c869 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -113,7 +113,6 @@ bool Button::init(const std::string &normalImage, break; } - setTouchEnabled(true); this->loadTextures(normalImage, selectedImage, disableImage,texType); } while (0); return ret; diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 003b5623c9..8e9078074c 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -117,7 +117,6 @@ bool CheckBox::init(const std::string& backGround, } setSelectedState(false); - setTouchEnabled(true); loadTextures(backGround, backGroundSeleted, cross, backGroundDisabled, frontCrossDisabled,texType); } while (0); return ret; diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 6a54a07c45..f1b7efb6cb 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -142,7 +142,6 @@ bool ScrollView::init() { if (Layout::init()) { - setTouchEnabled(true); setClippingEnabled(true); _innerContainer->setTouchEnabled(false); return true; diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index e94e071e00..f18ac6bbed 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -89,7 +89,6 @@ bool Slider::init() { if (Widget::init()) { - setTouchEnabled(true); return true; } return false; diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index fcffdd379c..4bbb95cbdd 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -393,7 +393,6 @@ TextField* TextField::create(const std::string &placeholder, const std::string & TextField* widget = new TextField(); if (widget && widget->init()) { - widget->setTouchEnabled(true); widget->setPlaceHolder(placeholder); widget->setFontName(fontName); widget->setFontSize(fontSize); diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index f050b576d8..f78c2aa325 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -37,7 +37,6 @@ Widget::Widget(): _enabled(true), _bright(true), _touchEnabled(false), -_touchPassedEnabled(false), _highlight(false), _brightStyle(BrightStyle::NONE), _touchStartPos(Vector2::ZERO), @@ -68,6 +67,7 @@ _focusEnabled(true) onFocusChanged = CC_CALLBACK_2(Widget::onFocusChange,this); onNextFocusedWidget = nullptr; this->setAnchorPoint(Vector2(0.5f, 0.5f)); + this->setTouchEnabled(true); } Widget::~Widget() @@ -137,29 +137,6 @@ Widget* Widget::getWidgetParent() void Widget::setEnabled(bool enabled) { _enabled = enabled; - for (auto& child : _children) - { - if (child) - { - Widget* widgetChild = dynamic_cast(child); - if (widgetChild) - { - widgetChild->setEnabled(enabled); - } - } - } - - for (auto& child : _protectedChildren) - { - if (child) - { - Widget* widgetChild = dynamic_cast(child); - if (widgetChild) - { - widgetChild->setEnabled(enabled); - } - } - } } Widget* Widget::getChildByName(const std::string& name) @@ -539,11 +516,53 @@ void Widget::didNotSelectSelf() { } + +Widget* Widget::getAncensterWidget(Node* node) +{ + if (nullptr == node) { + return nullptr; + } + Node* parent = node->getParent(); + Widget* parentWidget = dynamic_cast(parent); + if (parentWidget) { + return parentWidget; + } + else{ + return this->getAncensterWidget(parent->getParent()); + } +} + +bool Widget::isAncestorsVisible(Node* node) +{ + if (nullptr == node) { + return true; + } + Node* parent = node->getParent(); + + if (parent && !parent->isVisible()) { + return false; + } + return this->isAncestorsVisible(parent); +} + +bool Widget::isAncestorsEnable() +{ + Widget* parentWidget = this->getAncensterWidget(this); + if (parentWidget == nullptr) { + return true; + } + if (parentWidget && !parentWidget->isEnabled()) { + return false; + } + + return parentWidget->isAncestorsEnable(); +} bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { _hitted = false; - if (isVisible() && isEnabled()) + //check parent + if (isAncestorsEnable() && isAncestorsVisible(this) && isVisible() && isEnabled()) { _touchStartPos = touch->getLocation(); if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) @@ -562,7 +581,7 @@ bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) widgetParent->checkChildInfo(0,this,_touchStartPos); } pushDownEvent(); - return !_touchPassedEnabled; + return true; } void Widget::onTouchMoved(Touch *touch, Event *unusedEvent) @@ -892,7 +911,6 @@ void Widget::copyProperties(Widget *widget) setVisible(widget->isVisible()); setBright(widget->isBright()); setTouchEnabled(widget->isTouchEnabled()); - _touchPassedEnabled = false; setLocalZOrder(widget->getLocalZOrder()); setTag(widget->getTag()); setName(widget->getName()); diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index a2e873358f..92afa55832 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -161,7 +161,7 @@ public: * * @param visible true if the widget is touch enabled, false if the widget is touch disabled. */ - CC_DEPRECATED_ATTRIBUTE virtual void setTouchEnabled(bool enabled); + virtual void setTouchEnabled(bool enabled); /** * To set the bright style of widget. @@ -177,7 +177,7 @@ public: * * @return true if the widget is touch enabled, false if the widget is touch disabled. */ - CC_DEPRECATED_ATTRIBUTE bool isTouchEnabled() const; + bool isTouchEnabled() const; /** * Determines if the widget is highlighted @@ -635,11 +635,14 @@ protected: Widget* getWidgetParent(); void updateContentSizeWithTextureSize(const Size& size); virtual void adaptRenderers(){}; + bool isAncestorsEnable(); + Widget* getAncensterWidget(Node* node); + bool isAncestorsVisible(Node* node); + protected: bool _enabled; ///< Highest control of widget bool _bright; ///< is this widget bright bool _touchEnabled; ///< is this widget touch endabled - bool _touchPassedEnabled; ///< is the touch event should be passed bool _highlight; ///< is the widget on focus BrightStyle _brightStyle; ///< bright style Vector2 _touchStartPos; ///< touch began point From fbfbcaffc8cef9c3416a63613a86f1ab4a95fa3d Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 13 May 2014 16:43:19 +0800 Subject: [PATCH 020/125] update project --- tests/cpp-tests/Android.mk | 1 + tests/cpp-tests/CMakeLists.txt | 1 + tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp | 2 +- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 10 ++++++---- tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters | 6 ++++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 8299f055bf..572a970cbd 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -31,6 +31,7 @@ Classes/BugsTest/Bug-886.cpp \ Classes/BugsTest/Bug-899.cpp \ Classes/BugsTest/Bug-914.cpp \ Classes/BugsTest/BugsTest.cpp \ +Classes/BugsTest/Bug-Child.cpp \ Classes/BugsTest/Bug-458/Bug-458.cpp \ Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \ Classes/ChipmunkTest/ChipmunkTest.cpp \ diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index f223415d79..ac78d4eb2a 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -35,6 +35,7 @@ set(SAMPLE_SRC Classes/BugsTest/Bug-899.cpp Classes/BugsTest/Bug-914.cpp Classes/BugsTest/BugsTest.cpp + Classes/BugsTest/cppBug-Child.cpp Classes/ChipmunkTest/ChipmunkTest.cpp Classes/ClickAndMoveTest/ClickAndMoveTest.cpp Classes/ClippingNodeTest/ClippingNodeTest.cpp diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp index cfe1e363e6..e162fcb632 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-Child.cpp @@ -31,7 +31,7 @@ bool BugChild::init() // create and initialize a Label auto item1 = MenuItemFont::create("Switch Child", CC_CALLBACK_1(BugChild::switchChild, this)); - menu = Menu::create(item1, NULL); + menu = Menu::create(item1, nullptr); menu->alignItemsVertically(); menu->setPosition(size.width/2, 100); diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 435e5fe31a..def15253e9 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -23,8 +23,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp Application @@ -32,8 +32,8 @@ v100 v110 v110_xp - v120 - v120_xp + v120 + v120_xp @@ -141,6 +141,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou + @@ -320,6 +321,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 705e464be0..e14b692c16 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -849,6 +849,9 @@ Classes\UITest\CocostudioGUISceneTest\UIWidgetAddNodeTest + + Classes\BugsTest + @@ -1565,5 +1568,8 @@ Classes\UITest\CocostudioGUISceneTest\UIWidgetAddNodeTest + + Classes\BugsTest + \ No newline at end of file From d0c98d62690afef3698c103069a3f415c4b3058e Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 17:03:48 +0800 Subject: [PATCH 021/125] Adds ValueVectorNull, ValueMapNull, ValueMapIntKeyNull global variables. --- cocos/base/CCValue.cpp | 4 ++++ cocos/base/CCValue.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cocos/base/CCValue.cpp b/cocos/base/CCValue.cpp index a8ecc73278..1e00c22244 100644 --- a/cocos/base/CCValue.cpp +++ b/cocos/base/CCValue.cpp @@ -28,6 +28,10 @@ NS_CC_BEGIN +const ValueVector ValueVectorNull; +const ValueMap ValueMapNull; +const ValueMapIntKey ValueMapIntKeyNull; + const Value Value::Null; Value::Value() diff --git a/cocos/base/CCValue.h b/cocos/base/CCValue.h index 6e5792d7c7..58d63d727c 100644 --- a/cocos/base/CCValue.h +++ b/cocos/base/CCValue.h @@ -39,6 +39,10 @@ typedef std::vector ValueVector; typedef std::unordered_map ValueMap; typedef std::unordered_map ValueMapIntKey; +extern const ValueVector ValueVectorNull; +extern const ValueMap ValueMapNull; +extern const ValueMapIntKey ValueMapIntKeyNull; + class Value { public: From 0cd2196b88fbc0f3a1966a3e18c71c61f8eb8505 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 17:08:30 +0800 Subject: [PATCH 022/125] closed #5160: Dispatch a custom event after an animation frame is displayed --- cocos/2d/CCActionInterval.cpp | 10 +++++++++- cocos/2d/CCAnimation.h | 7 +++++++ cocos/2d/CCAnimationCache.cpp | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index d52949d403..0dfeb7f47a 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -30,6 +30,9 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "CCStdC.h" #include "2d/CCActionInstant.h" +#include "base/CCDirector.h" +#include "base/CCEventCustom.h" + #include NS_CC_BEGIN @@ -2256,7 +2259,12 @@ void Animate::update(float t) const ValueMap& dict = frame->getUserInfo(); if ( !dict.empty() ) { - //TODO: [[NSNotificationCenter defaultCenter] postNotificationName:AnimationFrameDisplayedNotification object:target_ userInfo:dict]; + static EventCustom event(AnimationFrameDisplayedNotification); + static AnimationFrame::DisplayedNotificationInfo info; + info.target = _target; + info.userInfo = &dict; + event.setUserData(&info); + Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } _nextFrame = i+1; } diff --git a/cocos/2d/CCAnimation.h b/cocos/2d/CCAnimation.h index 6c08f837e5..ee1b208a53 100644 --- a/cocos/2d/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -57,6 +57,13 @@ class SpriteFrame; class CC_DLL AnimationFrame : public Ref, public Clonable { public: + + struct DisplayedNotificationInfo + { + Node* target; + const ValueMap* userInfo; + }; + /** * Creates the animation frame with a spriteframe, number of delay units and a notification user info * @since 3.0 diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index 6c5a05cbd7..e1e922d8ae 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -174,7 +174,7 @@ void AnimationCache::parseVersion2(const ValueMap& animations) float delayUnits = entry["delayUnits"].asFloat(); Value& userInfo = entry["notification"]; - AnimationFrame *animFrame = AnimationFrame::create(spriteFrame, delayUnits, userInfo.asValueMap()); + AnimationFrame *animFrame = AnimationFrame::create(spriteFrame, delayUnits, userInfo.getType() == Value::Type::MAP ? userInfo.asValueMap() : ValueMapNull); array.pushBack(animFrame); } From 0dd22af688a29cdbae0378ec6f0430eae07dba93 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 17:08:52 +0800 Subject: [PATCH 023/125] closed #5160: Updates ActionTest --- .../cpp-tests/Classes/ActionsTest/ActionsTest.cpp | 14 +++++++------- tests/cpp-tests/Classes/ActionsTest/ActionsTest.h | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 92fc0405ea..cb81c09873 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -723,13 +723,13 @@ void ActionAnimate::onEnter() auto action2 = Animate::create(animation2); _tamara->runAction(Sequence::create(action2, action2->reverse(), NULL)); -// TODO: -// observer_ = [[NSNotificationCenter defaultCenter] addObserverForName:AnimationFrameDisplayedNotification object:nil queue:nil usingBlock:^(NSNotification* notification) { -// -// auto userInfo = [notification userInfo); -// NSLog(@"object %@ with data %@", [notification object), userInfo ); -// }); + _frameDisplayedListener = EventListenerCustom::create(AnimationFrameDisplayedNotification, [](EventCustom * event){ + auto userData = static_cast(event->getUserData()); + + log("target %p with data %s", userData->target, Value(userData->userInfo).getDescription().c_str()); + }); + _eventDispatcher->addEventListenerWithFixedPriority(_frameDisplayedListener, -1); // // File animation @@ -746,7 +746,7 @@ void ActionAnimate::onEnter() void ActionAnimate::onExit() { ActionsDemo::onExit(); - //TODO:[[NSNotificationCenter defaultCenter] removeObserver:observer_); + _eventDispatcher->removeEventListener(_frameDisplayedListener); } std::string ActionAnimate::title() const diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index ab7d67b7b5..9b6a77e9be 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -197,6 +197,9 @@ public: virtual void onExit() override; virtual std::string title() const override; virtual std::string subtitle() const override; + +private: + EventListenerCustom* _frameDisplayedListener; }; class ActionSequence : public ActionsDemo From 41fe56ee70a3a3832d1763e9e1640bfc3f77d763 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 17:12:48 +0800 Subject: [PATCH 024/125] closed #5005, fix a null pointer exception --- cocos/ui/UIWidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index f78c2aa325..ccc8e106b1 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -523,6 +523,9 @@ Widget* Widget::getAncensterWidget(Node* node) return nullptr; } Node* parent = node->getParent(); + if (nullptr == parent) { + return nullptr; + } Widget* parentWidget = dynamic_cast(parent); if (parentWidget) { return parentWidget; From 35b19a239a0875b7c864183a4dc282820ed2f01e Mon Sep 17 00:00:00 2001 From: heliclei Date: Tue, 13 May 2014 17:20:12 +0800 Subject: [PATCH 025/125] exit gracefully after running all tests --- tests/cpp-tests/Classes/controller.cpp | 40 +++++++++++++++++++++++++- tests/cpp-tests/Classes/controller.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 763ee57930..aa46f47eda 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -409,6 +409,9 @@ void TestController::addConsoleAutoTest() } } } + std::string msg("autotest run successfully!"); + send(fd, msg.c_str(), strlen(msg.c_str()),0); + send(fd, "\n",1,0); return; } @@ -453,6 +456,30 @@ void TestController::startAutoRun() t.detach(); } +ssize_t TestController::readline(int fd, char* ptr, size_t maxlen) +{ + size_t n, rc; + char c; + + for( n = 0; n < maxlen - 1; n++ ) { + if( (rc = recv(fd, &c, 1, 0)) ==1 ) { + *ptr++ = c; + if(c == '\n') { + break; + } + } else if( rc == 0 ) { + return 0; + } else if( errno == EINTR ) { + continue; + } else { + return -1; + } + } + + *ptr = 0; + return n; +} + void TestController::autorun() { struct addrinfo hints; @@ -515,8 +542,19 @@ void TestController::autorun() send(sfd,cmd,strlen(cmd),0); while(true) { - wait(1); + char resp[512]; + readline(sfd, resp, 512); + if(strcmp(resp, "autotest run successfully!\n") == 0) + { + break; + } + wait(3); } + + tmp = "director end\n"; + strcpy(cmd, tmp.c_str()); + send(sfd,cmd,strlen(cmd),0); + wait(1); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) closesocket(sfd); WSACleanup(); diff --git a/tests/cpp-tests/Classes/controller.h b/tests/cpp-tests/Classes/controller.h index 10f3c53acb..f5139cd61e 100644 --- a/tests/cpp-tests/Classes/controller.h +++ b/tests/cpp-tests/Classes/controller.h @@ -21,6 +21,7 @@ public: void addConsoleAutoTest(); void autorun(); void startAutoRun(); + ssize_t readline(int fd, char* ptr, size_t maxlen); private: Vector2 _beginPos; Menu* _itemMenu; From 1ced31a2d37f84833412ca840d07f6e2f078ffc6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 17:29:05 +0800 Subject: [PATCH 026/125] issue #5160: Don't use static variables, use member variables --- cocos/2d/CCActionInterval.cpp | 15 +++++++++------ cocos/2d/CCActionInterval.h | 2 ++ cocos/2d/CCAnimation.h | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index 0dfeb7f47a..3bade7d8de 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -2140,6 +2140,7 @@ Animate::Animate() , _origFrame(nullptr) , _executedLoops(0) , _animation(nullptr) +, _frameDisplayedEvent(nullptr) { } @@ -2149,6 +2150,7 @@ Animate::~Animate() CC_SAFE_RELEASE(_animation); CC_SAFE_RELEASE(_origFrame); CC_SAFE_DELETE(_splitTimes); + CC_SAFE_RELEASE(_frameDisplayedEvent); } bool Animate::initWithAnimation(Animation* animation) @@ -2259,12 +2261,13 @@ void Animate::update(float t) const ValueMap& dict = frame->getUserInfo(); if ( !dict.empty() ) { - static EventCustom event(AnimationFrameDisplayedNotification); - static AnimationFrame::DisplayedNotificationInfo info; - info.target = _target; - info.userInfo = &dict; - event.setUserData(&info); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); + if (_frameDisplayedEvent == nullptr) + _frameDisplayedEvent = new EventCustom(AnimationFrameDisplayedNotification); + + _frameDisplayedEventInfo.target = _target; + _frameDisplayedEventInfo.userInfo = &dict; + _frameDisplayedEvent->setUserData(&_frameDisplayedEventInfo); + Director::getInstance()->getEventDispatcher()->dispatchEvent(_frameDisplayedEvent); } _nextFrame = i+1; } diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index a9ca37b52d..cc0f22f4ec 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -1037,6 +1037,8 @@ protected: unsigned int _executedLoops; Animation* _animation; + EventCustom* _frameDisplayedEvent; + AnimationFrame::DisplayedEventInfo _frameDisplayedEventInfo; private: CC_DISALLOW_COPY_AND_ASSIGN(Animate); }; diff --git a/cocos/2d/CCAnimation.h b/cocos/2d/CCAnimation.h index ee1b208a53..32e4cd56c4 100644 --- a/cocos/2d/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -58,7 +58,7 @@ class CC_DLL AnimationFrame : public Ref, public Clonable { public: - struct DisplayedNotificationInfo + struct DisplayedEventInfo { Node* target; const ValueMap* userInfo; From 24524cb5be35e3d77fb068a24820fb43d2d0fbf0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 17:30:48 +0800 Subject: [PATCH 027/125] issue #5160: Updates actiontest --- tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index cb81c09873..ad0cd4c39a 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -724,7 +724,7 @@ void ActionAnimate::onEnter() _tamara->runAction(Sequence::create(action2, action2->reverse(), NULL)); _frameDisplayedListener = EventListenerCustom::create(AnimationFrameDisplayedNotification, [](EventCustom * event){ - auto userData = static_cast(event->getUserData()); + auto userData = static_cast(event->getUserData()); log("target %p with data %s", userData->target, Value(userData->userInfo).getDescription().c_str()); }); From 31a2194dcbe8d9578ab4db6b0bcfe98346bb81ff Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 17:45:15 +0800 Subject: [PATCH 028/125] closed #4900, add TTF font to UIText --- cocos/ui/UIText.cpp | 29 ++++++++++++++++++++++++++--- cocos/ui/UIText.h | 8 ++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index a0fc15131a..c45ef913e9 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -40,7 +40,8 @@ _fontName("Thonburi"), _fontSize(10), _onSelectedScaleOffset(0.5), _labelRenderer(nullptr), -_labelRendererAdaptDirty(true) +_labelRendererAdaptDirty(true), +_type(Type::SYSTEM) { } @@ -121,8 +122,15 @@ ssize_t Text::getStringLength() void Text::setFontSize(int size) { + if (_type == Type::SYSTEM) { + _labelRenderer->setSystemFontSize(size); + } + else{ + TTFConfig config = _labelRenderer->getTTFConfig(); + config.fontSize = size; + _labelRenderer->setTTFConfig(config); + } _fontSize = size; - _labelRenderer->setSystemFontSize(size); updateContentSizeWithTextureSize(_labelRenderer->getContentSize()); _labelRendererAdaptDirty = true; } @@ -134,8 +142,18 @@ int Text::getFontSize() void Text::setFontName(const std::string& name) { + if(FileUtils::getInstance()->isFileExist(name)) + { + TTFConfig config = _labelRenderer->getTTFConfig(); + config.fontFilePath = name; + _labelRenderer->setTTFConfig(config); + _type = Type::TTF; + } + else{ + _labelRenderer->setSystemFontName(name); + _type = Type::SYSTEM; + } _fontName = name; - _labelRenderer->setSystemFontName(name); updateContentSizeWithTextureSize(_labelRenderer->getContentSize()); _labelRendererAdaptDirty = true; } @@ -144,6 +162,11 @@ const std::string& Text::getFontName() { return _fontName; } + +Text::Type Text::getType() const +{ + return _type; +} void Text::setTextAreaSize(const Size &size) { diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 65d1d04ed9..53f66e9572 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -41,6 +41,11 @@ class Text : public Widget DECLARE_CLASS_GUI_INFO public: + enum class Type + { + SYSTEM, + TTF + }; /** * Default constructor */ @@ -101,6 +106,8 @@ public: void setFontName(const std::string& name); const std::string& getFontName(); + + Type getType() const; /** * Sets the touch scale enabled of label. @@ -169,6 +176,7 @@ protected: float _onSelectedScaleOffset; Label* _labelRenderer; bool _labelRendererAdaptDirty; + Type _type; }; } From 2a25afbb76ca092495bb7207d2cafc1f052a1639 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 18:15:53 +0800 Subject: [PATCH 029/125] closed #4900. add comment --- cocos/ui/UIText.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 53f66e9572..2121f28ae8 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -100,6 +100,8 @@ public: /** * Sets the font name of label. + * If you are trying to use a system font, you could just pass a font name, for example: Arial + * If you are trying to use a TTF, you should pass a file path to the TTF file, for example: resource/XXX.ttf * * @param font name. */ From 5cd5a2339b9d535b8793cdde2017f0963eddb68b Mon Sep 17 00:00:00 2001 From: lm Date: Tue, 13 May 2014 18:16:51 +0800 Subject: [PATCH 030/125] [Jenkins][ci skip] Add error commit status for cancel build in queue --- tools/jenkins-scripts/job-trigger.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/jenkins-scripts/job-trigger.py b/tools/jenkins-scripts/job-trigger.py index 5e347b3f0d..8da34ab1dd 100755 --- a/tools/jenkins-scripts/job-trigger.py +++ b/tools/jenkins-scripts/job-trigger.py @@ -21,6 +21,14 @@ def check_queue_build(action, pr_num, statuses_url): if(q_pr_num == pr_num): if(action == 'closed') or (q_statuses_url != statuses_url): queues.delete_item(queue) + target_url = os.environ['JOB_PULL_REQUEST_BUILD_URL'] + data = {"state":"error", "target_url":target_url} + access_token = os.environ['GITHUB_ACCESS_TOKEN'] + Headers = {"Authorization":"token " + access_token} + try: + requests.post(statuses_url, data=json.dumps(data), headers=Headers) + except: + traceback.print_exc() def main(): #get payload from os env From a28bdb0ed54b1d1f9ec6a7b91f1dadbebc3c9cc6 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 18:41:38 +0800 Subject: [PATCH 031/125] closed #5005, refactor --- cocos/ui/UIWidget.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index ccc8e106b1..0bd49d4eaa 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -519,30 +519,37 @@ void Widget::didNotSelectSelf() Widget* Widget::getAncensterWidget(Node* node) { - if (nullptr == node) { + if (nullptr == node) + { return nullptr; } + Node* parent = node->getParent(); - if (nullptr == parent) { + if (nullptr == parent) + { return nullptr; } Widget* parentWidget = dynamic_cast(parent); - if (parentWidget) { + if (parentWidget) + { return parentWidget; } - else{ + else + { return this->getAncensterWidget(parent->getParent()); } } bool Widget::isAncestorsVisible(Node* node) { - if (nullptr == node) { + if (nullptr == node) + { return true; } Node* parent = node->getParent(); - if (parent && !parent->isVisible()) { + if (parent && !parent->isVisible()) + { return false; } return this->isAncestorsVisible(parent); @@ -551,10 +558,12 @@ bool Widget::isAncestorsVisible(Node* node) bool Widget::isAncestorsEnable() { Widget* parentWidget = this->getAncensterWidget(this); - if (parentWidget == nullptr) { + if (parentWidget == nullptr) + { return true; } - if (parentWidget && !parentWidget->isEnabled()) { + if (parentWidget && !parentWidget->isEnabled()) + { return false; } @@ -564,8 +573,7 @@ bool Widget::isAncestorsEnable() bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { _hitted = false; - //check parent - if (isAncestorsEnable() && isAncestorsVisible(this) && isVisible() && isEnabled()) + if (isVisible() && isEnabled() && isAncestorsEnable() && isAncestorsVisible(this) ) { _touchStartPos = touch->getLocation(); if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) From ac22dc236ad1cabd75f0a261fb77958771ddb42b Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 13 May 2014 18:45:41 +0800 Subject: [PATCH 032/125] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d5c21121bd..ed4737b669 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ cocos2d-x-3.1-alpha1 May.9 2014 + [NEW] Animate: Dispatch a custom event after an animation frame is displayed [NEW] GLProgram: Easy to customize uniforms and attributes by using the new class GLProgramState [NEW] Template: cpp project support Eclipse c++ project [NEW] UI: add navigation support From ed0ae9d5b36495f2d91be28ecfc6fa12c12e8202 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 13 May 2014 18:51:02 +0800 Subject: [PATCH 033/125] fix compiling fail on Linux. --- tests/cpp-tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index ac78d4eb2a..eeec422504 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -35,7 +35,7 @@ set(SAMPLE_SRC Classes/BugsTest/Bug-899.cpp Classes/BugsTest/Bug-914.cpp Classes/BugsTest/BugsTest.cpp - Classes/BugsTest/cppBug-Child.cpp + Classes/BugsTest/Bug-Child.cpp Classes/ChipmunkTest/ChipmunkTest.cpp Classes/ClickAndMoveTest/ClickAndMoveTest.cpp Classes/ClippingNodeTest/ClippingNodeTest.cpp From bd82c119b639c1d7884c261ed3c3e55de70f9314 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 13 May 2014 21:26:25 +0800 Subject: [PATCH 034/125] Updates travis.yml, adds email notification to @Minggo and @James --- .travis.yml | 5 +++++ tools/travis-scripts/travis_mac.yml | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99f439d3e7..cdee895bb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,11 @@ script: before_install: - tools/travis-scripts/before-install.sh +notifications: + email: + - xiaoming.zhang@cocos2d-x.org + - jianhua.chen@cocos2d-x.org + # whitelist branches: only: diff --git a/tools/travis-scripts/travis_mac.yml b/tools/travis-scripts/travis_mac.yml index 284bd31684..611e72263f 100644 --- a/tools/travis-scripts/travis_mac.yml +++ b/tools/travis-scripts/travis_mac.yml @@ -8,4 +8,14 @@ env: matrix: - PLATFORM=mac-ios SDK=iphonesimulator7.1 ARCH=i386 SCHEME="build all tests iOS" # - PLATFORM=mac-ios SDK=iphonesimulator7.1 ARCH=x86_64 SCHEME="build all tests iOS" - - PLATFORM=mac-ios SDK=macosx10.9 ARCH=x86_64 SCHEME="build all tests Mac" \ No newline at end of file + - PLATFORM=mac-ios SDK=macosx10.9 ARCH=x86_64 SCHEME="build all tests Mac" + +notifications: + email: + - xiaoming.zhang@cocos2d-x.org + - jianhua.chen@cocos2d-x.org + +# whitelist +branches: + only: + - v3 From 31dd70dba298b95b39acdd1ddc3246d5ebe1b9dc Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 13 May 2014 10:26:25 -0700 Subject: [PATCH 035/125] Matrix::identity() -> IDENTITY consistency with the rest of the cocos2d API --- cocos/2d/CCActionCamera.cpp | 2 +- cocos/2d/CCNode.cpp | 2 +- cocos/2d/CCSprite.cpp | 2 +- cocos/base/CCDirector.cpp | 20 +++---- cocos/deprecated/CCDeprecated.cpp | 2 +- cocos/editor-support/cocostudio/CCBone.cpp | 2 +- cocos/editor-support/cocostudio/CCSkin.cpp | 2 +- .../cocostudio/CCTransformHelp.cpp | 2 +- cocos/math/Matrix.cpp | 60 +++++++------------ cocos/math/Matrix.h | 26 ++------ 10 files changed, 44 insertions(+), 76 deletions(-) diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 4799dd46e4..87d377372c 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -98,7 +98,7 @@ void ActionCamera::updateTransform() bool needsTranslation = !anchorPoint.equals(Vector2::ZERO); - Matrix mv = Matrix::identity(); + Matrix mv = Matrix::IDENTITY; if(needsTranslation) { Matrix t; diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 7296f3dec8..5a0daeba6d 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -135,7 +135,7 @@ Node::Node(void) ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); _scriptType = engine != nullptr ? engine->getScriptType() : kScriptTypeNone; #endif - _transform = _inverse = _additionalTransform = Matrix::identity(); + _transform = _inverse = _additionalTransform = Matrix::IDENTITY; } Node::~Node() diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 34305cae42..4059c1f87a 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -1004,7 +1004,7 @@ void Sprite::setBatchNode(SpriteBatchNode *spriteBatchNode) } else { // using batch - _transformToBatch = Matrix::identity(); + _transformToBatch = Matrix::IDENTITY; setTextureAtlas(_batchNode->getTextureAtlas()); // weak ref } } diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 53e9b53eea..01f2d392d6 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -285,19 +285,17 @@ void Director::drawScene() pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - Matrix identity = Matrix::identity(); - // draw the scene if (_runningScene) { - _runningScene->visit(_renderer, identity, false); + _runningScene->visit(_renderer, Matrix::IDENTITY, false); _eventDispatcher->dispatchEvent(_eventAfterVisit); } // draw the notifications node if (_notificationNode) { - _notificationNode->visit(_renderer, identity, false); + _notificationNode->visit(_renderer, Matrix::IDENTITY, false); } if (_displayStats) @@ -451,9 +449,9 @@ void Director::initMatrixStack() _textureMatrixStack.pop(); } - _modelViewMatrixStack.push(Matrix::identity()); - _projectionMatrixStack.push(Matrix::identity()); - _textureMatrixStack.push(Matrix::identity()); + _modelViewMatrixStack.push(Matrix::IDENTITY); + _projectionMatrixStack.push(Matrix::IDENTITY); + _textureMatrixStack.push(Matrix::IDENTITY); } void Director::resetMatrixStack() @@ -485,15 +483,15 @@ void Director::loadIdentityMatrix(MATRIX_STACK_TYPE type) { if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type) { - _modelViewMatrixStack.top() = Matrix::identity(); + _modelViewMatrixStack.top() = Matrix::IDENTITY; } else if(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION == type) { - _projectionMatrixStack.top() = Matrix::identity(); + _projectionMatrixStack.top() = Matrix::IDENTITY; } else if(MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE == type) { - _textureMatrixStack.top() = Matrix::identity(); + _textureMatrixStack.top() = Matrix::IDENTITY; } else { @@ -1082,7 +1080,7 @@ void Director::showStats() prevVerts = currentVerts; } - Matrix identity = Matrix::identity(); + Matrix identity = Matrix::IDENTITY; _drawnVerticesLabel->visit(_renderer, identity, false); _drawnBatchesLabel->visit(_renderer, identity, false); diff --git a/cocos/deprecated/CCDeprecated.cpp b/cocos/deprecated/CCDeprecated.cpp index 0faa03ca17..34e13a210a 100644 --- a/cocos/deprecated/CCDeprecated.cpp +++ b/cocos/deprecated/CCDeprecated.cpp @@ -275,7 +275,7 @@ Matrix* kmMat4Assign(Matrix* pOut, const Matrix* pIn) Matrix* kmMat4Identity(Matrix* pOut) { - *pOut = Matrix::identity(); + *pOut = Matrix::IDENTITY; return pOut; } diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index d7b06e2617..530cc47089 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -72,7 +72,7 @@ Bone::Bone() _displayManager = nullptr; _ignoreMovementBoneData = false; // _worldTransform = AffineTransformMake(1, 0, 0, 1, 0, 0); - _worldTransform = Matrix::identity(); + _worldTransform = Matrix::IDENTITY; _boneTransformDirty = true; _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; _blendDirty = false; diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index 7af7220625..ea1f678e1d 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -86,7 +86,7 @@ Skin::Skin() , _armature(nullptr) , _displayName("") { - _skinTransform = Matrix::identity(); + _skinTransform = Matrix::IDENTITY; } bool Skin::initWithSpriteFrameName(const std::string& spriteFrameName) diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/CCTransformHelp.cpp index f30b1a13e0..453331521f 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/CCTransformHelp.cpp @@ -120,7 +120,7 @@ void TransformHelp::nodeToMatrix(const BaseData &node, AffineTransform &matrix) void TransformHelp::nodeToMatrix(const BaseData &node, Matrix &matrix) { - matrix = Matrix::identity(); + matrix = Matrix::IDENTITY; if (node.skewX == -node.skewY) { diff --git a/cocos/math/Matrix.cpp b/cocos/math/Matrix.cpp index b6cf7462ab..5f3503fb3d 100644 --- a/cocos/math/Matrix.cpp +++ b/cocos/math/Matrix.cpp @@ -25,17 +25,9 @@ NS_CC_MATH_BEGIN -static const float MATRIX_IDENTITY[16] = -{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - Matrix::Matrix() { - *this = Matrix::identity(); + *this = IDENTITY; } Matrix::Matrix(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, @@ -58,26 +50,6 @@ Matrix::~Matrix() { } -const Matrix& Matrix::identity() -{ - static Matrix m( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 ); - return m; -} - -const Matrix& Matrix::zero() -{ - static Matrix m( - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0 ); - return m; -} - void Matrix::createLookAt(const Vector3& eyePosition, const Vector3& targetPosition, const Vector3& up, Matrix* dst) { createLookAt(eyePosition.x, eyePosition.y, eyePosition.z, targetPosition.x, targetPosition.y, targetPosition.z, @@ -250,7 +222,7 @@ void Matrix::createScale(const Vector3& scale, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[0] = scale.x; dst->m[5] = scale.y; @@ -261,7 +233,7 @@ void Matrix::createScale(float xScale, float yScale, float zScale, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[0] = xScale; dst->m[5] = yScale; @@ -371,7 +343,7 @@ void Matrix::createRotationX(float angle, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); @@ -386,7 +358,7 @@ void Matrix::createRotationY(float angle, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); @@ -401,7 +373,7 @@ void Matrix::createRotationZ(float angle, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); @@ -416,7 +388,7 @@ void Matrix::createTranslation(const Vector3& translation, Matrix* dst) { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[12] = translation.x; dst->m[13] = translation.y; @@ -427,7 +399,7 @@ void Matrix::createTranslation(float xTranslation, float yTranslation, float zTr { GP_ASSERT(dst); - memcpy(dst, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[12] = xTranslation; dst->m[13] = yTranslation; @@ -712,7 +684,7 @@ bool Matrix::inverse() bool Matrix::isIdentity() const { - return (memcmp(m, MATRIX_IDENTITY, MATRIX_SIZE) == 0); + return (memcmp(m, &IDENTITY, MATRIX_SIZE) == 0); } void Matrix::multiply(float scalar) @@ -882,7 +854,7 @@ void Matrix::set(const Matrix& mat) void Matrix::setIdentity() { - memcpy(m, MATRIX_IDENTITY, MATRIX_SIZE); + memcpy(m, &IDENTITY, MATRIX_SIZE); } void Matrix::setZero() @@ -978,4 +950,16 @@ Matrix Matrix::getTransposed() const return mat; } +const Matrix Matrix::IDENTITY = Matrix( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + +const Matrix Matrix::ZERO = Matrix( + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 ); + NS_CC_MATH_END diff --git a/cocos/math/Matrix.h b/cocos/math/Matrix.h index c5aa436a03..4ee9f927ee 100644 --- a/cocos/math/Matrix.h +++ b/cocos/math/Matrix.h @@ -138,25 +138,6 @@ public: */ ~Matrix(); - /** - * Returns the identity matrix: - * - * 1 0 0 0 - * 0 1 0 0 - * 0 0 1 0 - * 0 0 0 1 - * - * @return The identity matrix. - */ - static const Matrix& identity(); - - /** - * Returns the matrix with all zeros. - * - * @return The matrix with all zeros. - */ - static const Matrix& zero(); - /** * Creates a view matrix based on the specified input parameters. * @@ -940,7 +921,12 @@ public: * @return This matrix, after the multiplication occurs. */ inline Matrix& operator*=(const Matrix& mat); - + + /** equals to a matrix full of zeros */ + static const Matrix ZERO; + /** equals to the identity matrix */ + static const Matrix IDENTITY; + private: static void createBillboardHelper(const Vector3& objectPosition, const Vector3& cameraPosition, From 6462a1bf79806597705f695fa11cfa011264bcc8 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 13 May 2014 12:55:34 -0700 Subject: [PATCH 036/125] Adds simple sample for multitexturing --- cocos/renderer/CCGLProgramState.cpp | 1 - .../Classes/ShaderTest/ShaderTest.cpp | 102 ++++++++++-------- .../cpp-tests/Classes/ShaderTest/ShaderTest.h | 20 ++-- .../Resources/Shaders/example_Blur.fsh | 0 .../Resources/Shaders/example_ColorBars.fsh | 0 .../Resources/Shaders/example_ColorBars.vsh | 0 .../Resources/Shaders/example_Flower.fsh | 0 .../Resources/Shaders/example_Heart.fsh | 0 .../Shaders/example_HorizontalColor.fsh | 0 .../Resources/Shaders/example_Julia.fsh | 0 .../Resources/Shaders/example_Mandelbrot.fsh | 0 .../Resources/Shaders/example_Monjori.fsh | 0 .../Shaders/example_MultiTexture.fsh | 18 ++++ .../Shaders/example_MultiTexture.vsh | 19 ++++ .../Resources/Shaders/example_Noisy.fsh | 0 .../Resources/Shaders/example_Plasma.fsh | 0 .../Resources/Shaders/example_Twist.fsh | 0 .../Resources/Shaders/example_bloom.fsh | 0 .../Resources/Shaders/example_celShading.fsh | 0 .../Shaders/example_edgeDetection.fsh | 0 .../Resources/Shaders/example_greyScale.fsh | 0 .../Resources/Shaders/example_lensFlare.fsh | 0 .../Resources/Shaders/example_normal.fsh | 0 .../Resources/Shaders/example_outline.fsh | 0 24 files changed, 102 insertions(+), 58 deletions(-) mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Blur.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_ColorBars.vsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Flower.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Heart.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Julia.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Mandelbrot.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Monjori.fsh create mode 100644 tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh create mode 100644 tests/cpp-tests/Resources/Shaders/example_MultiTexture.vsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Noisy.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Plasma.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_Twist.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_bloom.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_celShading.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_greyScale.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_normal.fsh mode change 100755 => 100644 tests/cpp-tests/Resources/Shaders/example_outline.fsh diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 6190156bde..ecb03e562e 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -71,7 +71,6 @@ void UniformValue::apply() switch (_uniform->type) { case GL_SAMPLER_2D: _glprogram->setUniformLocationWith1i(_uniform->location, _value.tex.textureUnit); - GL::activeTexture(_value.tex.textureUnit); GL::bindTexture2DN(_value.tex.textureUnit, _value.tex.textureId); break; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index dcb9115eee..20e4e204d4 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -4,23 +4,23 @@ static int sceneIdx = -1; -#define MAX_LAYER 10 +#define MAX_LAYER 11 static Layer* createShaderLayer(int nIndex) { switch (sceneIdx) { - case 0: return new ShaderLensFlare(); - case 1: return new ShaderMandelbrot(); - case 2: return new ShaderJulia(); - case 3: return new ShaderHeart(); - case 4: return new ShaderFlower(); - case 5: return new ShaderPlasma(); - case 6: return new ShaderBlur(); - case 7: return new ShaderRetroEffect(); - case 8: return new ShaderMonjori(); - //case 9: return new ShaderFireBall(); - case 9: return new ShaderGlow(); + case 0: return new ShaderLensFlare(); + case 1: return new ShaderMandelbrot(); + case 2: return new ShaderJulia(); + case 3: return new ShaderHeart(); + case 4: return new ShaderFlower(); + case 5: return new ShaderPlasma(); + case 6: return new ShaderBlur(); + case 7: return new ShaderRetroEffect(); + case 8: return new ShaderMonjori(); + case 9: return new ShaderGlow(); + case 10: return new ShaderMultiTexture(); } return NULL; } @@ -694,39 +694,9 @@ bool ShaderLensFlare::init() return false; } -ShaderFireBall::ShaderFireBall() -{ - init(); -} - -std::string ShaderFireBall::title() const -{ - return "ShaderToy Test"; -} - -std::string ShaderFireBall::subtitle() const -{ - return "Fire Ball"; -} - -bool ShaderFireBall::init() -{ - if (ShaderTestDemo::init()) - { - auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/shadertoy_FireBall.fsh"); - - auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); - sn->setContentSize(Size(s.width/2,s.height/2)); - addChild(sn); - - return true; - } - - return false; -} - - +// +// ShaderGlow +// ShaderGlow::ShaderGlow() { init(); @@ -759,6 +729,48 @@ bool ShaderGlow::init() return false; } +// +// ShaderMultiTexture +// +ShaderMultiTexture::ShaderMultiTexture() +{ + init(); +} + +std::string ShaderMultiTexture::title() const +{ + return "MultiTexture test"; +} + +std::string ShaderMultiTexture::subtitle() const +{ + return "MultiTexture"; +} + +bool ShaderMultiTexture::init() +{ + if (ShaderTestDemo::init()) + { + auto s = Director::getInstance()->getWinSize(); + + auto sprite = Sprite::create("Images/grossinis_sister1.png"); + Texture2D *texture1 = Director::getInstance()->getTextureCache()->addImage("Images/grossinis_sister2.png"); + + addChild(sprite); + + sprite->setPosition(Vector2(s.width/2, s.height/2)); + + auto glprogram = GLProgram::createWithFilenames("Shaders/example_MultiTexture.vsh", "Shaders/example_MultiTexture.fsh"); + auto glprogramstate = GLProgramState::getOrCreate(glprogram); + sprite->setGLProgramState(glprogramstate); + + glprogramstate->setUniformTexture("u_texture1", texture1); + return true; + } + + return false; +} + ///--------------------------------------- // diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index c8918e4529..3a58be9ed8 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -152,16 +152,6 @@ public: virtual bool init(); }; -class ShaderFireBall : public ShaderTestDemo -{ -public: - ShaderFireBall(); - - virtual std::string title() const override; - virtual std::string subtitle() const override; - virtual bool init(); -}; - class ShaderGlow : public ShaderTestDemo { public: @@ -172,8 +162,14 @@ public: virtual bool init(); }; +class ShaderMultiTexture : public ShaderTestDemo +{ +public: + ShaderMultiTexture(); - -//CCLayer* nextAction(); + virtual std::string title() const override; + virtual std::string subtitle() const override; + virtual bool init(); +}; #endif diff --git a/tests/cpp-tests/Resources/Shaders/example_Blur.fsh b/tests/cpp-tests/Resources/Shaders/example_Blur.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh b/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_ColorBars.vsh b/tests/cpp-tests/Resources/Shaders/example_ColorBars.vsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Flower.fsh b/tests/cpp-tests/Resources/Shaders/example_Flower.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Heart.fsh b/tests/cpp-tests/Resources/Shaders/example_Heart.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh b/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Julia.fsh b/tests/cpp-tests/Resources/Shaders/example_Julia.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Mandelbrot.fsh b/tests/cpp-tests/Resources/Shaders/example_Mandelbrot.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Monjori.fsh b/tests/cpp-tests/Resources/Shaders/example_Monjori.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh new file mode 100644 index 0000000000..1dcee6bd83 --- /dev/null +++ b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh @@ -0,0 +1,18 @@ + +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 v_fragmentColor; +varying vec2 v_texCoord; + +uniform sampler2D CC_Texture0; +uniform sampler2D u_texture1; + + +void main() { + vec4 color1 = texture2D(CC_Texture0, v_texCoord) * vec4(1,1,1,CC_SinTime[3]); + vec4 color2 = texture2D(u_texture1, v_texCoord) * vec4(1,1,1,CC_CosTime[3]); + gl_FragColor = (color1 + color2) * v_fragmentColor; +} + diff --git a/tests/cpp-tests/Resources/Shaders/example_MultiTexture.vsh b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.vsh new file mode 100644 index 0000000000..5b2fdbc972 --- /dev/null +++ b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.vsh @@ -0,0 +1,19 @@ + +attribute vec4 a_position; +attribute vec2 a_texCoord; +attribute vec4 a_color; + +#ifdef GL_ES +varying lowp vec4 v_fragmentColor; +varying mediump vec2 v_texCoord; +#else +varying vec4 v_fragmentColor; +varying vec2 v_texCoord; +#endif + +void main() +{ + gl_Position = CC_PMatrix * a_position; + v_fragmentColor = a_color; + v_texCoord = a_texCoord; +} diff --git a/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh b/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Plasma.fsh b/tests/cpp-tests/Resources/Shaders/example_Plasma.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_Twist.fsh b/tests/cpp-tests/Resources/Shaders/example_Twist.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_bloom.fsh b/tests/cpp-tests/Resources/Shaders/example_bloom.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_celShading.fsh b/tests/cpp-tests/Resources/Shaders/example_celShading.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh b/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh b/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh b/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_normal.fsh b/tests/cpp-tests/Resources/Shaders/example_normal.fsh old mode 100755 new mode 100644 diff --git a/tests/cpp-tests/Resources/Shaders/example_outline.fsh b/tests/cpp-tests/Resources/Shaders/example_outline.fsh old mode 100755 new mode 100644 From 723938e29251d71aaed10530dd953c025f333159 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 13 May 2014 18:12:58 -0700 Subject: [PATCH 037/125] Adds effectNode in ShaderTest2 --- cocos/2d/CCNode.cpp | 2 +- cocos/deprecated/CCDeprecated.cpp | 2 +- cocos/deprecated/CCDeprecated.h | 2 +- cocos/renderer/CCGLProgram.cpp | 83 +++++---- cocos/renderer/CCGLProgram.h | 29 +-- cocos/renderer/CCGLProgramState.cpp | 8 +- cocos/renderer/CCGLProgramState.h | 2 +- .../Classes/ShaderTest/ShaderTest.cpp | 6 +- .../Classes/ShaderTest/ShaderTest2.cpp | 170 +++++++++++++++++- .../Classes/ShaderTest/ShaderTest2.h | 8 + 10 files changed, 253 insertions(+), 59 deletions(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 23a8750180..2d3ba688e9 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -647,7 +647,7 @@ void Node::setGLProgram(GLProgram *glProgram) if (_glProgramState == nullptr || (_glProgramState && _glProgramState->getGLProgram() != glProgram)) { CC_SAFE_RELEASE(_glProgramState); - _glProgramState = GLProgramState::getOrCreate(glProgram); + _glProgramState = GLProgramState::getOrCreateWithGLProgram(glProgram); _glProgramState->retain(); } } diff --git a/cocos/deprecated/CCDeprecated.cpp b/cocos/deprecated/CCDeprecated.cpp index 34e13a210a..4c77adebbe 100644 --- a/cocos/deprecated/CCDeprecated.cpp +++ b/cocos/deprecated/CCDeprecated.cpp @@ -72,7 +72,7 @@ const char* kCCUniformTime_s = GLProgram::UNIFORM_NAME_TIME; const char* kCCUniformSinTime_s = GLProgram::UNIFORM_NAME_SIN_TIME; const char* kCCUniformCosTime_s = GLProgram::UNIFORM_NAME_COS_TIME; const char* kCCUniformRandom01_s = GLProgram::UNIFORM_NAME_RANDOM01; -const char* kCCUniformSampler_s = GLProgram::UNIFORM_NAME_SAMPLER; +const char* kCCUniformSampler_s = GLProgram::UNIFORM_NAME_SAMPLER0; const char* kCCUniformAlphaTestValue = GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE; // Attribute names diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index a266998a24..7f89021b8c 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -817,7 +817,7 @@ CC_DEPRECATED_ATTRIBUTE const int kCCUniformTime = GLProgram::UNIFORM_TIME; CC_DEPRECATED_ATTRIBUTE const int kCCUniformSinTime = GLProgram::UNIFORM_SIN_TIME; CC_DEPRECATED_ATTRIBUTE const int kCCUniformCosTime = GLProgram::UNIFORM_COS_TIME; CC_DEPRECATED_ATTRIBUTE const int kCCUniformRandom01 = GLProgram::UNIFORM_RANDOM01; -CC_DEPRECATED_ATTRIBUTE const int kCCUniformSampler = GLProgram::UNIFORM_SAMPLER; +CC_DEPRECATED_ATTRIBUTE const int kCCUniformSampler = GLProgram::UNIFORM_SAMPLER0; CC_DEPRECATED_ATTRIBUTE const int kCCUniform_MAX = GLProgram::UNIFORM_MAX; CC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureColor; diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 9bc582d0dd..4fb7b16895 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -78,7 +78,10 @@ const char* GLProgram::UNIFORM_NAME_TIME = "CC_Time"; const char* GLProgram::UNIFORM_NAME_SIN_TIME = "CC_SinTime"; const char* GLProgram::UNIFORM_NAME_COS_TIME = "CC_CosTime"; const char* GLProgram::UNIFORM_NAME_RANDOM01 = "CC_Random01"; -const char* GLProgram::UNIFORM_NAME_SAMPLER = "CC_Texture0"; +const char* GLProgram::UNIFORM_NAME_SAMPLER0 = "CC_Texture0"; +const char* GLProgram::UNIFORM_NAME_SAMPLER1 = "CC_Texture1"; +const char* GLProgram::UNIFORM_NAME_SAMPLER2 = "CC_Texture2"; +const char* GLProgram::UNIFORM_NAME_SAMPLER3 = "CC_Texture3"; const char* GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE = "CC_alpha_value"; // Attribute names @@ -123,7 +126,7 @@ GLProgram::GLProgram() , _hashForUniforms(nullptr) , _flags() { - memset(_uniforms, 0, sizeof(_uniforms)); + memset(_builtInUniforms, 0, sizeof(_builtInUniforms)); } GLProgram::~GLProgram() @@ -275,7 +278,7 @@ void GLProgram::bindPredefinedVertexAttribs() void GLProgram::parseVertexAttribs() { - _attributesDictionary.clear(); + _vertexAttribs.clear(); // Query and store vertex attribute meta-data from the program. GLint activeAttributes; @@ -299,7 +302,7 @@ void GLProgram::parseVertexAttribs() // Query the pre-assigned attribute location attribute.index = glGetAttribLocation(_program, attribName); - _attributesDictionary[attribute.name] = attribute; + _vertexAttribs[attribute.name] = attribute; } } } @@ -307,7 +310,7 @@ void GLProgram::parseVertexAttribs() void GLProgram::parseUniforms() { - _uniformsDictionary.clear(); + _userUniforms.clear(); // Query and store uniforms from the program. GLint activeUniforms; @@ -344,7 +347,7 @@ void GLProgram::parseUniforms() uniform.name = std::string(uniformName); uniform.location = glGetUniformLocation(_program, uniformName); - _uniformsDictionary[uniform.name] = uniform; + _userUniforms[uniform.name] = uniform; } } } @@ -353,16 +356,16 @@ void GLProgram::parseUniforms() Uniform* GLProgram::getUniform(const std::string &name) { - const auto itr = _uniformsDictionary.find(name); - if( itr != _uniformsDictionary.end()) + const auto itr = _userUniforms.find(name); + if( itr != _userUniforms.end()) return &itr->second; return nullptr; } VertexAttrib* GLProgram::getVertexAttrib(const std::string &name) { - const auto itr = _attributesDictionary.find(name); - if( itr != _attributesDictionary.end()) + const auto itr = _vertexAttribs.find(name); + if( itr != _vertexAttribs.end()) return &itr->second; return nullptr; } @@ -446,32 +449,42 @@ void GLProgram::bindAttribLocation(const std::string &attributeName, GLuint inde void GLProgram::updateUniforms() { - _uniforms[UNIFORM_P_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_P_MATRIX); - _uniforms[UNIFORM_MV_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MV_MATRIX); - _uniforms[UNIFORM_MVP_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MVP_MATRIX); + _builtInUniforms[UNIFORM_P_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_P_MATRIX); + _builtInUniforms[UNIFORM_MV_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MV_MATRIX); + _builtInUniforms[UNIFORM_MVP_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MVP_MATRIX); - _uniforms[UNIFORM_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_TIME); - _uniforms[UNIFORM_SIN_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_SIN_TIME); - _uniforms[UNIFORM_COS_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_COS_TIME); + _builtInUniforms[UNIFORM_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_TIME); + _builtInUniforms[UNIFORM_SIN_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_SIN_TIME); + _builtInUniforms[UNIFORM_COS_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_COS_TIME); - _uniforms[UNIFORM_RANDOM01] = glGetUniformLocation(_program, UNIFORM_NAME_RANDOM01); + _builtInUniforms[UNIFORM_RANDOM01] = glGetUniformLocation(_program, UNIFORM_NAME_RANDOM01); - _uniforms[UNIFORM_SAMPLER] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER); + _builtInUniforms[UNIFORM_SAMPLER0] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER0); + _builtInUniforms[UNIFORM_SAMPLER1] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER1); + _builtInUniforms[UNIFORM_SAMPLER2] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER2); + _builtInUniforms[UNIFORM_SAMPLER3] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER3); - _flags.usesP = _uniforms[UNIFORM_P_MATRIX] != -1; - _flags.usesMV = _uniforms[UNIFORM_MV_MATRIX] != -1; - _flags.usesMVP = _uniforms[UNIFORM_MVP_MATRIX] != -1; + _flags.usesP = _builtInUniforms[UNIFORM_P_MATRIX] != -1; + _flags.usesMV = _builtInUniforms[UNIFORM_MV_MATRIX] != -1; + _flags.usesMVP = _builtInUniforms[UNIFORM_MVP_MATRIX] != -1; _flags.usesTime = ( - _uniforms[UNIFORM_TIME] != -1 || - _uniforms[UNIFORM_SIN_TIME] != -1 || - _uniforms[UNIFORM_COS_TIME] != -1 + _builtInUniforms[UNIFORM_TIME] != -1 || + _builtInUniforms[UNIFORM_SIN_TIME] != -1 || + _builtInUniforms[UNIFORM_COS_TIME] != -1 ); - _flags.usesRandom = _uniforms[UNIFORM_RANDOM01] != -1; + _flags.usesRandom = _builtInUniforms[UNIFORM_RANDOM01] != -1; this->use(); - // Since sample most probably won't change, set it to 0 now. - this->setUniformLocationWith1i(_uniforms[UNIFORM_SAMPLER], 0); + // Since sample most probably won't change, set it to 0,1,2,3 now. + if(_builtInUniforms[UNIFORM_SAMPLER0] != -1) + setUniformLocationWith1i(_builtInUniforms[UNIFORM_SAMPLER0], 0); + if(_builtInUniforms[UNIFORM_SAMPLER1] != -1) + setUniformLocationWith1i(_builtInUniforms[UNIFORM_SAMPLER1], 1); + if(_builtInUniforms[UNIFORM_SAMPLER2] != -1) + setUniformLocationWith1i(_builtInUniforms[UNIFORM_SAMPLER2], 2); + if(_builtInUniforms[UNIFORM_SAMPLER3] != -1) + setUniformLocationWith1i(_builtInUniforms[UNIFORM_SAMPLER3], 3); } bool GLProgram::link() @@ -806,14 +819,14 @@ void GLProgram::setUniformsForBuiltins(const Matrix &matrixMV) Matrix matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); if(_flags.usesP) - setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_P_MATRIX], matrixP.m, 1); + setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_P_MATRIX], matrixP.m, 1); if(_flags.usesMV) - setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MV_MATRIX], matrixMV.m, 1); + setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_MV_MATRIX], matrixMV.m, 1); if(_flags.usesMVP) { Matrix matrixMVP = matrixP * matrixMV; - setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MVP_MATRIX], matrixMVP.m, 1); + setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_MVP_MATRIX], matrixMVP.m, 1); } if(_flags.usesTime) { @@ -823,19 +836,19 @@ void GLProgram::setUniformsForBuiltins(const Matrix &matrixMV) // Getting Mach time per frame per shader using time could be extremely expensive. float time = director->getTotalFrames() * director->getAnimationInterval(); - setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_TIME], time/10.0, time, time*2, time*4); - setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_SIN_TIME], time/8.0, time/4.0, time/2.0, sinf(time)); - setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_COS_TIME], time/8.0, time/4.0, time/2.0, cosf(time)); + setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_TIME], time/10.0, time, time*2, time*4); + setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_SIN_TIME], time/8.0, time/4.0, time/2.0, sinf(time)); + setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_COS_TIME], time/8.0, time/4.0, time/2.0, cosf(time)); } if(_flags.usesRandom) - setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_RANDOM01], CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1()); + setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_RANDOM01], CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1()); } void GLProgram::reset() { _vertShader = _fragShader = 0; - memset(_uniforms, 0, sizeof(_uniforms)); + memset(_builtInUniforms, 0, sizeof(_builtInUniforms)); // it is already deallocated by android diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index 7e1ee760ee..fe403872d9 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -100,8 +100,11 @@ public: UNIFORM_SIN_TIME, UNIFORM_COS_TIME, UNIFORM_RANDOM01, - UNIFORM_SAMPLER, - + UNIFORM_SAMPLER0, + UNIFORM_SAMPLER1, + UNIFORM_SAMPLER2, + UNIFORM_SAMPLER3, + UNIFORM_MAX, }; @@ -132,7 +135,10 @@ public: static const char* UNIFORM_NAME_SIN_TIME; static const char* UNIFORM_NAME_COS_TIME; static const char* UNIFORM_NAME_RANDOM01; - static const char* UNIFORM_NAME_SAMPLER; + static const char* UNIFORM_NAME_SAMPLER0; + static const char* UNIFORM_NAME_SAMPLER1; + static const char* UNIFORM_NAME_SAMPLER2; + static const char* UNIFORM_NAME_SAMPLER3; static const char* UNIFORM_NAME_ALPHA_TEST_VALUE; // Attribute names @@ -288,11 +294,11 @@ public: inline const GLuint getProgram() const { return _program; } // DEPRECATED - CC_DEPRECATED_ATTRIBUTE bool initWithVertexShaderByteArray(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) - { return initWithByteArrays(vShaderByteArray, fShaderByteArray); } - CC_DEPRECATED_ATTRIBUTE bool initWithVertexShaderFilename(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray) - { return initWithFilenames(vShaderByteArray, fShaderByteArray); } - CC_DEPRECATED_ATTRIBUTE void addAttribute(const char* attributeName, GLuint index) const { return bindAttribLocation(attributeName, index); } + CC_DEPRECATED_ATTRIBUTE bool initWithVertexShaderByteArray(const GLchar* vertexByteArray, const GLchar* fragByteArray) + { return initWithByteArrays(vertexByteArray, fragByteArray); } + CC_DEPRECATED_ATTRIBUTE bool initWithVertexShaderFilename(const std::string &vertexFilename, const std::string& fragFilename) + { return initWithFilenames(vertexFilename, fragFilename); } + CC_DEPRECATED_ATTRIBUTE void addAttribute(const std::string &attributeName, GLuint index) const { return bindAttribLocation(attributeName, index); } protected: @@ -307,10 +313,9 @@ protected: std::string logForOpenGLObject(GLuint object, GLInfoFunction infoFunc, GLLogFunction logFunc) const; GLuint _program; - GLuint _vertShader; GLuint _fragShader; - GLint _uniforms[UNIFORM_MAX]; + GLint _builtInUniforms[UNIFORM_MAX]; struct _hashUniformEntry* _hashForUniforms; bool _hasShaderCompiler; @@ -329,8 +334,8 @@ protected: flag_struct() { memset(this, 0, sizeof(*this)); } } _flags; - std::unordered_map _uniformsDictionary; - std::unordered_map _attributesDictionary; + std::unordered_map _userUniforms; + std::unordered_map _vertexAttribs; }; NS_CC_END diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index ecb03e562e..d1965dd256 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -251,14 +251,14 @@ GLProgramState* GLProgramState::getOrCreateWithGLProgramName(const std::string & { GLProgram *glProgram = GLProgramCache::getInstance()->getGLProgram(glProgramName); if( glProgram ) - return getOrCreate(glProgram); + return getOrCreateWithGLProgram(glProgram); CCLOG("cocos2d: warning: GLProgram '%s' not found", glProgramName.c_str()); return nullptr; } -GLProgramState* GLProgramState::getOrCreate(GLProgram *glprogram) +GLProgramState* GLProgramState::getOrCreateWithGLProgram(GLProgram *glprogram) { GLProgramState* ret = GLProgramStateCache::getInstance()->getGLProgramState(glprogram); return ret; @@ -283,12 +283,12 @@ bool GLProgramState::init(GLProgram* glprogram) _glprogram = glprogram; _glprogram->retain(); - for(auto &attrib : _glprogram->_attributesDictionary) { + for(auto &attrib : _glprogram->_vertexAttribs) { VertexAttribValue value(&attrib.second); _attributes[attrib.first] = value; } - for(auto &uniform : _glprogram->_uniformsDictionary) { + for(auto &uniform : _glprogram->_userUniforms) { UniformValue value(&uniform.second, _glprogram); _uniforms[uniform.first] = value; } diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index 2340ac3c13..5a71bc7f53 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -150,7 +150,7 @@ public: static GLProgramState* create(GLProgram* glprogram); /** gets-or-creates an instance of GLProgramState for a given GLProgram */ - static GLProgramState* getOrCreate(GLProgram* glprogram); + static GLProgramState* getOrCreateWithGLProgram(GLProgram* glprogram); /** gets-or-creates an instance of GLProgramState for a given GLProgramName */ static GLProgramState* getOrCreateWithGLProgramName(const std::string &glProgramName ); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 20e4e204d4..27dad3df56 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -176,7 +176,7 @@ void ShaderNode::loadShaderVertex(const std::string &vert, const std::string &fr } auto glprogram = GLProgram::createWithByteArrays(vertSource.c_str(), fragSource.c_str()); - auto glprogramstate = GLProgramState::getOrCreate(glprogram); + auto glprogramstate = GLProgramState::getOrCreateWithGLProgram(glprogram); setGLProgramState(glprogramstate); } @@ -493,7 +493,7 @@ void SpriteBlur::initGLProgram() FileUtils::getInstance()->fullPathForFilename("Shaders/example_Blur.fsh").c_str())->getCString(); auto program = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource); - auto glProgramState = GLProgramState::getOrCreate(program); + auto glProgramState = GLProgramState::getOrCreateWithGLProgram(program); setGLProgramState(glProgramState); } @@ -761,7 +761,7 @@ bool ShaderMultiTexture::init() sprite->setPosition(Vector2(s.width/2, s.height/2)); auto glprogram = GLProgram::createWithFilenames("Shaders/example_MultiTexture.vsh", "Shaders/example_MultiTexture.fsh"); - auto glprogramstate = GLProgramState::getOrCreate(glprogram); + auto glprogramstate = GLProgramState::getOrCreateWithGLProgram(glprogram); sprite->setGLProgramState(glprogramstate); glprogramstate->setUniformTexture("u_texture1", texture1); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 6b005cc816..73d4bce1d9 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -41,6 +41,8 @@ namespace ShaderTest2 CL(CelShadingSpriteTest), CL(LensFlareSpriteTest), CL(OutlineShadingSpriteTest), + + CL(EffectSprite_Blur), }; static unsigned int TEST_CASE_COUNT = sizeof(ShaderTest2::createFunctions) / sizeof(ShaderTest2::createFunctions[0]); @@ -127,6 +129,150 @@ public: } }; +// +// Effect +// +class Effect : public Ref +{ +public: + GLProgramState* getGLProgramState() const { return _glprogramstate; } + +protected: + bool initGLProgramState(const std::string &fragmentFilename); + Effect() : _glprogramstate(nullptr) + {} + virtual ~Effect() {} + GLProgramState *_glprogramstate; +}; + +bool Effect::initGLProgramState(const std::string &fragmentFilename) +{ + auto fileUtiles = FileUtils::getInstance(); + auto fragmentFullPath = fileUtiles->fullPathForFilename(fragmentFilename); + auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath); + auto glprogram = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource.c_str()); + + _glprogramstate = GLProgramState::getOrCreateWithGLProgram(glprogram); + _glprogramstate->retain(); + + return _glprogramstate != nullptr; +} + +class EffectBlur : public Effect +{ +public: + static EffectBlur *create(float blurSize); + void setGaussian(float value); + void setCustomUniforms(); + void setBlurSize(float f); + +protected: + bool init(float blurSize); + + int _blurRadius; + Vector2 _pixelSize; + + int _samplingRadius; + float _scale; + float _cons; + float _weightSum; +}; + +EffectBlur *EffectBlur::create(float blurSize) +{ + auto ret = new (std::nothrow) EffectBlur; + if(ret && ret->init(blurSize)) { + ret->autorelease(); + return ret; + } + CC_SAFE_RELEASE(ret); + return nullptr; +} + +bool EffectBlur::init(float blurSize) +{ + initGLProgramState("Shaders/example_Blur.fsh"); +// auto s = getTexture()->getContentSizeInPixels(); + auto s = Size(100,100); + + _blurRadius = 0; + _pixelSize = Vector2(1/s.width, 1/s.height); + _samplingRadius = 0; + + setBlurSize(blurSize); + + _glprogramstate->setUniformVec2("onePixelSize", _pixelSize); + _glprogramstate->setUniformVec4("gaussianCoefficient", Vector4(_samplingRadius, _scale, _cons, _weightSum)); + return true; +} + +void EffectBlur::setBlurSize(float f) +{ + if(_blurRadius == (int)f) + return; + _blurRadius = (int)f; + + _samplingRadius = _blurRadius; + if (_samplingRadius > 10) + { + _samplingRadius = 10; + } + if (_blurRadius > 0) + { + float sigma = _blurRadius / 2.0f; + _scale = -0.5f / (sigma * sigma); + _cons = -1.0f * _scale / 3.141592f; + _weightSum = -_cons; + + float weight; + int squareX; + for(int dx = 0; dx <= _samplingRadius; ++dx) + { + squareX = dx * dx; + weight = _cons * exp(squareX * _scale); + _weightSum += 2.0 * weight; + for (int dy = 1; dy <= _samplingRadius; ++dy) + { + weight = _cons * exp((squareX + dy * dy) * _scale); + _weightSum += 4.0 * weight; + } + } + } +} + + +// +// EffectSprite +// +class EffectSprite : public Sprite +{ +public: + static EffectSprite *create(const std::string& filename) { + auto ret = new (std::nothrow) EffectSprite; + if(ret && ret->initWithFile(filename)) { + ret->autorelease(); + return ret; + } + CC_SAFE_RELEASE(ret); + return nullptr; + } + + void setEffect(Effect *effect) { + if(_effect != effect) { + CC_SAFE_RELEASE(_effect); + _effect = effect; + CC_SAFE_RETAIN(_effect); + setGLProgramState(_effect->getGLProgramState()); + } + } +protected: + EffectSprite() : _effect(nullptr) {} + Effect *_effect; +}; + +// +// ShaderSprite +// class ShaderSprite : public Sprite { public: @@ -179,7 +325,7 @@ void ShaderSprite::initShader() } auto glprogram = GLProgram::createWithByteArrays(vertSource.c_str(), fragSource.c_str()); - auto glprogramState = GLProgramState::getOrCreate(glprogram); + auto glprogramState = GLProgramState::getOrCreateWithGLProgram(glprogram); this->setGLProgramState(glprogramState); setCustomUniforms(); @@ -583,3 +729,25 @@ OutlineShadingSpriteTest::OutlineShadingSpriteTest() } } + +EffectSprite_Blur::EffectSprite_Blur() +{ + if (ShaderTestDemo2::init()) { + auto s = Director::getInstance()->getWinSize(); + EffectSprite* sprite = EffectSprite::create("Images/grossini.png"); + sprite->setPosition(Vector2(0, s.height/2)); + addChild(sprite); + + auto jump = JumpBy::create(4, Vector2(s.width,0), 100, 4); + auto rot = RotateBy::create(4, 720); + auto spawn = Spawn::create(jump, rot, NULL); + auto rev = spawn->reverse(); + auto seq = Sequence::create(spawn, rev, NULL); + auto repeat = RepeatForever::create(seq); + sprite->runAction(repeat); + + auto effect = EffectBlur::create(3.0); + sprite->setEffect(effect); + } +} + diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index 4d38d755d0..3b851b1493 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -102,5 +102,13 @@ public: virtual std::string subtitle() const {return "OutlineShadingSpriteTest";} }; +class EffectSprite_Blur : public ShaderTestDemo2 +{ +public: + CREATE_FUNC(EffectSprite_Blur); + EffectSprite_Blur(); + virtual std::string subtitle() const {return "Blur Effect on Sprite";} +}; + #endif \ No newline at end of file From df86b07f1575a565b97476fd35d0558f9427dbe0 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 09:23:56 +0800 Subject: [PATCH 038/125] closed #5005, refactor --- cocos/ui/UIWidget.cpp | 6 +++--- cocos/ui/UIWidget.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index 0bd49d4eaa..dc5c445f66 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -555,7 +555,7 @@ bool Widget::isAncestorsVisible(Node* node) return this->isAncestorsVisible(parent); } -bool Widget::isAncestorsEnable() +bool Widget::isAncestorsEnabled() { Widget* parentWidget = this->getAncensterWidget(this); if (parentWidget == nullptr) @@ -567,13 +567,13 @@ bool Widget::isAncestorsEnable() return false; } - return parentWidget->isAncestorsEnable(); + return parentWidget->isAncestorsEnabled(); } bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { _hitted = false; - if (isVisible() && isEnabled() && isAncestorsEnable() && isAncestorsVisible(this) ) + if (isVisible() && isEnabled() && isAncestorsEnabled() && isAncestorsVisible(this) ) { _touchStartPos = touch->getLocation(); if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos)) diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 92afa55832..edb4435718 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -635,7 +635,7 @@ protected: Widget* getWidgetParent(); void updateContentSizeWithTextureSize(const Size& size); virtual void adaptRenderers(){}; - bool isAncestorsEnable(); + bool isAncestorsEnabled(); Widget* getAncensterWidget(Node* node); bool isAncestorsVisible(Node* node); From 92d9120967fe31c7bc3f2a044332f7eaa07d2a8b Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 09:37:21 +0800 Subject: [PATCH 039/125] issue #4900, refactor --- cocos/ui/UIText.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 2121f28ae8..72936269e4 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -63,6 +63,9 @@ public: /** * create a Text object with textContent, fontName and fontSize + * the fontName could be a system font name or a TTF file path. + * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText + * Text *text = Text::create("xxx\xxx.ttf", "Arial", 20); //create a TTF font UIText */ static Text* create(const std::string& textContent, const std::string& fontName, @@ -100,9 +103,11 @@ public: /** * Sets the font name of label. - * If you are trying to use a system font, you could just pass a font name, for example: Arial - * If you are trying to use a TTF, you should pass a file path to the TTF file, for example: resource/XXX.ttf - * + * If you are trying to use a system font, you could just pass a font name + * If you are trying to use a TTF, you should pass a file path to the TTF file + * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText + * text->setFontName("Marfelt"); // call this method will change the system font + * text->setFontName("xxxx/xxx.ttf"); * @param font name. */ void setFontName(const std::string& name); From ca4a7a7e53d6074a38b7b065de1c61f1b7c251c9 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 09:55:55 +0800 Subject: [PATCH 040/125] issue #4900, refactor --- cocos/ui/UIText.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 72936269e4..a9dd6d8482 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -65,7 +65,7 @@ public: * create a Text object with textContent, fontName and fontSize * the fontName could be a system font name or a TTF file path. * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText - * Text *text = Text::create("xxx\xxx.ttf", "Arial", 20); //create a TTF font UIText + * Text *text = Text::create("Hello", "xxx\xxx.ttf", 20); //create a TTF font UIText */ static Text* create(const std::string& textContent, const std::string& fontName, @@ -106,8 +106,8 @@ public: * If you are trying to use a system font, you could just pass a font name * If you are trying to use a TTF, you should pass a file path to the TTF file * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText - * text->setFontName("Marfelt"); // call this method will change the system font - * text->setFontName("xxxx/xxx.ttf"); + * text->setFontName("Marfelt"); // it will change the font to system font no matter the previous font type is TTF or system font + * text->setFontName("xxxx/xxx.ttf"); //it will change the font to TTF font no matter the previous font type is TTF or system font * @param font name. */ void setFontName(const std::string& name); From 89bb56e8294852798374711f9ce19964b488d6ec Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 14 May 2014 09:59:38 +0800 Subject: [PATCH 041/125] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index ed4737b669..d119acf01d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ cocos2d-x-3.1-alpha1 May.9 2014 [FIX] ParticleSystem: yFlippedCoord behavior fixed. Added cocos2d/tools/particle to fix particles that were based on the old (broken) behaviour [FIX] Setup.py: Added SDK / NDK detection based on PATH + [FIX] UIText: support TTF [FIX] Value: all types share the same union to reduce memory usage cocos2d-x-3.1-alpha0 May.1 2014 From 20c50ef189d167f20ba3d4aeff896b6bda902d69 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 14 May 2014 02:03:18 +0000 Subject: [PATCH 042/125] [AUTO]: updating luabinding automatically --- .../scripting/lua-bindings/auto/api/Text.lua | 13 ++- .../auto/lua_cocos2dx_ui_auto.cpp | 81 ++++++++++++++----- .../auto/lua_cocos2dx_ui_auto.hpp | 1 + 3 files changed, 73 insertions(+), 22 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/Text.lua b/cocos/scripting/lua-bindings/auto/api/Text.lua index 6e326cc7a7..c1cb540796 100644 --- a/cocos/scripting/lua-bindings/auto/api/Text.lua +++ b/cocos/scripting/lua-bindings/auto/api/Text.lua @@ -43,15 +43,20 @@ -- @param self -- @return TextHAlignment#TextHAlignment ret (return value: cc.TextHAlignment) +-------------------------------- +-- @function [parent=#Text] setTextVerticalAlignment +-- @param self +-- @param #cc.TextVAlignment textvalignment + -------------------------------- -- @function [parent=#Text] getTextAreaSize -- @param self -- @return size_table#size_table ret (return value: size_table) -------------------------------- --- @function [parent=#Text] setTextVerticalAlignment +-- @function [parent=#Text] setTextHorizontalAlignment -- @param self --- @param #cc.TextVAlignment textvalignment +-- @param #cc.TextHAlignment texthalignment -------------------------------- -- @function [parent=#Text] setFontSize @@ -64,9 +69,9 @@ -- @return bool#bool ret (return value: bool) -------------------------------- --- @function [parent=#Text] setTextHorizontalAlignment +-- @function [parent=#Text] getType -- @param self --- @param #cc.TextHAlignment texthalignment +-- @return Text::Type#Text::Type ret (return value: ccui.Text::Type) -------------------------------- -- @function [parent=#Text] getFontName diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 0b9c9d88ea..ab138421dc 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -7971,6 +7971,52 @@ int lua_cocos2dx_ui_Text_getTextHorizontalAlignment(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Text_setTextVerticalAlignment(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Text* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Text",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Text*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setTextVerticalAlignment'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::TextVAlignment arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->setTextVerticalAlignment(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTextVerticalAlignment",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setTextVerticalAlignment'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Text_getTextAreaSize(lua_State* tolua_S) { int argc = 0; @@ -8015,7 +8061,7 @@ int lua_cocos2dx_ui_Text_getTextAreaSize(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_Text_setTextVerticalAlignment(lua_State* tolua_S) +int lua_cocos2dx_ui_Text_setTextHorizontalAlignment(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Text* cobj = nullptr; @@ -8035,7 +8081,7 @@ int lua_cocos2dx_ui_Text_setTextVerticalAlignment(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setTextVerticalAlignment'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setTextHorizontalAlignment'", nullptr); return 0; } #endif @@ -8043,20 +8089,20 @@ int lua_cocos2dx_ui_Text_setTextVerticalAlignment(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::TextVAlignment arg0; + cocos2d::TextHAlignment arg0; ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); if(!ok) return 0; - cobj->setTextVerticalAlignment(arg0); + cobj->setTextHorizontalAlignment(arg0); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTextVerticalAlignment",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTextHorizontalAlignment",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setTextVerticalAlignment'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setTextHorizontalAlignment'.",&tolua_err); #endif return 0; @@ -8151,7 +8197,7 @@ int lua_cocos2dx_ui_Text_isTouchScaleChangeEnabled(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_Text_setTextHorizontalAlignment(lua_State* tolua_S) +int lua_cocos2dx_ui_Text_getType(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Text* cobj = nullptr; @@ -8171,28 +8217,26 @@ int lua_cocos2dx_ui_Text_setTextHorizontalAlignment(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setTextHorizontalAlignment'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_getType'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) + if (argc == 0) { - cocos2d::TextHAlignment arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); if(!ok) return 0; - cobj->setTextHorizontalAlignment(arg0); - return 0; + int ret = (int)cobj->getType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTextHorizontalAlignment",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getType",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setTextHorizontalAlignment'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_getType'.",&tolua_err); #endif return 0; @@ -8423,11 +8467,12 @@ int lua_register_cocos2dx_ui_Text(lua_State* tolua_S) tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_Text_getStringValue); tolua_function(tolua_S,"setText",lua_cocos2dx_ui_Text_setText); tolua_function(tolua_S,"getTextHorizontalAlignment",lua_cocos2dx_ui_Text_getTextHorizontalAlignment); - tolua_function(tolua_S,"getTextAreaSize",lua_cocos2dx_ui_Text_getTextAreaSize); tolua_function(tolua_S,"setTextVerticalAlignment",lua_cocos2dx_ui_Text_setTextVerticalAlignment); + tolua_function(tolua_S,"getTextAreaSize",lua_cocos2dx_ui_Text_getTextAreaSize); + tolua_function(tolua_S,"setTextHorizontalAlignment",lua_cocos2dx_ui_Text_setTextHorizontalAlignment); tolua_function(tolua_S,"setFontSize",lua_cocos2dx_ui_Text_setFontSize); tolua_function(tolua_S,"isTouchScaleChangeEnabled",lua_cocos2dx_ui_Text_isTouchScaleChangeEnabled); - tolua_function(tolua_S,"setTextHorizontalAlignment",lua_cocos2dx_ui_Text_setTextHorizontalAlignment); + tolua_function(tolua_S,"getType",lua_cocos2dx_ui_Text_getType); tolua_function(tolua_S,"getFontName",lua_cocos2dx_ui_Text_getFontName); tolua_function(tolua_S,"setTextAreaSize",lua_cocos2dx_ui_Text_setTextAreaSize); tolua_function(tolua_S,"new",lua_cocos2dx_ui_Text_constructor); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index 630851454b..a9c37dc9c1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -382,6 +382,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ From d9d4d9d51a5762a52c18cd8be391988493d22316 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:07:03 +0800 Subject: [PATCH 043/125] Adds ref memory tracker to easily find out memory leak for instance of Ref or its subclasses --- cocos/base/CCRef.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++ cocos/base/CCRef.h | 8 ++++++ 2 files changed, 73 insertions(+) diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 6b9e0f8b96..5dea2c84fe 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -30,6 +30,11 @@ THE SOFTWARE. NS_CC_BEGIN +#ifdef CC_USE_MEM_LEAK_DETECTION +void trackRef(Ref* ref); +void untrackRef(Ref* ref); +#endif + Ref::Ref() : _referenceCount(1) // when the Ref is created, the reference count of it is 1 { @@ -38,6 +43,7 @@ Ref::Ref() _luaID = 0; _ID = ++uObjectCount; #endif + trackRef(this); } Ref::~Ref() @@ -57,6 +63,14 @@ Ref::~Ref() } } #endif + + +#ifdef CC_USE_MEM_LEAK_DETECTION + if (_referenceCount != 0) + untrackRef(this); +#endif + + //CCASSERT(0 == _referenceCount, "Ref class has to be deleted by Ref::release(), don't use 'delete pointer' directly."); } void Ref::retain() @@ -106,6 +120,10 @@ void Ref::release() CCASSERT(false, "The reference shouldn't be 0 because it is still in autorelease pool."); } #endif + +#ifdef CC_USE_MEM_LEAK_DETECTION + untrackRef(this); +#endif delete this; } } @@ -121,4 +139,51 @@ unsigned int Ref::getReferenceCount() const return _referenceCount; } +#ifdef CC_USE_MEM_LEAK_DETECTION + +static std::list __refAllocationList; + +void Ref::printLeaks() +{ + // Dump Ref object memory leaks + if (__refAllocationList.empty()) + { + log("[memory] All Ref objects successfully cleaned up (no leaks detected).\n"); + } + else + { + log("[memory] WARNING: %d Ref objects still active in memory.\n", (int)__refAllocationList.size()); + + for (const auto& ref : __refAllocationList) + { + CC_ASSERT(ref); + const char* type = typeid(*ref).name(); + log("[memory] LEAK: Ref object '%s' still active with reference count %d.\n", (type ? type : ""), ref->getReferenceCount()); + } + } +} + +void trackRef(Ref* ref) +{ + CC_ASSERT(ref); + + // Create memory allocation record. + __refAllocationList.push_back(ref); +} + +void untrackRef(Ref* ref) +{ + auto iter = std::find(__refAllocationList.begin(), __refAllocationList.end(), ref); + if (iter == __refAllocationList.end()) + { + log("[memory] CORRUPTION: Attempting to free (%s) with invalid ref tracking record.\n", typeid(*ref).name()); + return; + } + + __refAllocationList.erase(iter); +} + +#endif + + NS_CC_END diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index 2459e51ba6..b903fc00a9 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -29,6 +29,8 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #include "base/ccConfig.h" +#define CC_USE_MEM_LEAK_DETECTION 1 + NS_CC_BEGIN /** @@ -141,6 +143,12 @@ public: /// Lua reference id int _luaID; #endif + + // Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined) +#ifdef CC_USE_MEM_LEAK_DETECTION +public: + static void printLeaks(); +#endif }; class Node; From eb8f07370cd84d48ef5592b54f9438a02900ae95 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:12:49 +0800 Subject: [PATCH 044/125] Remove a comment in CCRef.cpp --- cocos/base/CCRef.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 5dea2c84fe..53dc9189c5 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -69,8 +69,6 @@ Ref::~Ref() if (_referenceCount != 0) untrackRef(this); #endif - - //CCASSERT(0 == _referenceCount, "Ref class has to be deleted by Ref::release(), don't use 'delete pointer' directly."); } void Ref::retain() From 72d29976c34de2be896ab38d62237186bdda1774 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:16:05 +0800 Subject: [PATCH 045/125] Disables memory tracker by default --- cocos/base/CCRef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index b903fc00a9..bcce5b8b03 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #include "base/ccConfig.h" -#define CC_USE_MEM_LEAK_DETECTION 1 +#define CC_USE_MEM_LEAK_DETECTION 0 NS_CC_BEGIN From ba3f5f8eee9f55a241abe175a76a371dc7651569 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:17:08 +0800 Subject: [PATCH 046/125] Updates indention in CCRef.h --- cocos/base/CCRef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index bcce5b8b03..45979601a9 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -147,7 +147,7 @@ public: // Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined) #ifdef CC_USE_MEM_LEAK_DETECTION public: - static void printLeaks(); + static void printLeaks(); #endif }; From c14482254da4a2040963c6abc831f8a5a2fd6c7c Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:25:45 +0800 Subject: [PATCH 047/125] Fixes wrong indention and whitespace cleanup --- cocos/base/CCRef.cpp | 20 ++++++++++---------- cocos/base/CCRef.h | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 53dc9189c5..98f12ce363 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. NS_CC_BEGIN -#ifdef CC_USE_MEM_LEAK_DETECTION +#if CC_USE_MEM_LEAK_DETECTION void trackRef(Ref* ref); void untrackRef(Ref* ref); #endif @@ -63,9 +63,9 @@ Ref::~Ref() } } #endif - -#ifdef CC_USE_MEM_LEAK_DETECTION + +#if CC_USE_MEM_LEAK_DETECTION if (_referenceCount != 0) untrackRef(this); #endif @@ -81,7 +81,7 @@ void Ref::release() { CCASSERT(_referenceCount > 0, "reference count should greater than 0"); --_referenceCount; - + if (_referenceCount == 0) { #if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) @@ -118,8 +118,8 @@ void Ref::release() CCASSERT(false, "The reference shouldn't be 0 because it is still in autorelease pool."); } #endif - -#ifdef CC_USE_MEM_LEAK_DETECTION + +#if CC_USE_MEM_LEAK_DETECTION untrackRef(this); #endif delete this; @@ -137,7 +137,7 @@ unsigned int Ref::getReferenceCount() const return _referenceCount; } -#ifdef CC_USE_MEM_LEAK_DETECTION +#if CC_USE_MEM_LEAK_DETECTION static std::list __refAllocationList; @@ -151,7 +151,7 @@ void Ref::printLeaks() else { log("[memory] WARNING: %d Ref objects still active in memory.\n", (int)__refAllocationList.size()); - + for (const auto& ref : __refAllocationList) { CC_ASSERT(ref); @@ -164,7 +164,7 @@ void Ref::printLeaks() void trackRef(Ref* ref) { CC_ASSERT(ref); - + // Create memory allocation record. __refAllocationList.push_back(ref); } @@ -177,7 +177,7 @@ void untrackRef(Ref* ref) log("[memory] CORRUPTION: Attempting to free (%s) with invalid ref tracking record.\n", typeid(*ref).name()); return; } - + __refAllocationList.erase(iter); } diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index 45979601a9..e418d3d659 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -44,16 +44,16 @@ class Ref; class CC_DLL Clonable { public: - /** returns a copy of the Ref */ + /** returns a copy of the Ref */ virtual Clonable* clone() const = 0; /** * @js NA * @lua NA */ - virtual ~Clonable() {}; + virtual ~Clonable() {}; /** returns a copy of the Ref. - @deprecated Use clone() instead + * @deprecated Use clone() instead */ CC_DEPRECATED_ATTRIBUTE Ref* copy() const { @@ -75,9 +75,9 @@ public: * @js NA */ void retain(); - + /** - * Release the ownership immediately. + * Releases the ownership immediately. * * This decrements the Ref's reference count. * @@ -90,7 +90,7 @@ public: void release(); /** - * Release the ownership sometime soon automatically. + * Releases the ownership sometime soon automatically. * * This descrements the Ref's reference count at the end of current * autorelease pool block. @@ -113,7 +113,7 @@ public: * @js NA */ unsigned int getReferenceCount() const; - + protected: /** * Constructor @@ -122,20 +122,20 @@ protected: * @js NA */ Ref(); - + public: /** * @js NA * @lua NA */ virtual ~Ref(); - + protected: /// count of references unsigned int _referenceCount; - + friend class AutoreleasePool; - + #if CC_ENABLE_SCRIPT_BINDING public: /// object id, ScriptSupport need public _ID @@ -143,9 +143,9 @@ public: /// Lua reference id int _luaID; #endif - - // Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined) -#ifdef CC_USE_MEM_LEAK_DETECTION + + // Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined and its value isn't zero) +#if CC_USE_MEM_LEAK_DETECTION public: static void printLeaks(); #endif From 54176b0267f5ea5ab5c9ff4b4a831ca72342148f Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 10:31:09 +0800 Subject: [PATCH 048/125] Include for std::find --- cocos/base/CCRef.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 98f12ce363..958d0b1072 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -28,6 +28,10 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "2d/CCScriptSupport.h" +#if CC_USE_MEM_LEAK_DETECTION +#include // std::find +#endif + NS_CC_BEGIN #if CC_USE_MEM_LEAK_DETECTION @@ -43,7 +47,10 @@ Ref::Ref() _luaID = 0; _ID = ++uObjectCount; #endif + +#if CC_USE_MEM_LEAK_DETECTION trackRef(this); +#endif } Ref::~Ref() @@ -181,7 +188,7 @@ void untrackRef(Ref* ref) __refAllocationList.erase(iter); } -#endif +#endif // #if CC_USE_MEM_LEAK_DETECTION NS_CC_END From 08801c035e82fd064c967981f740aab6d8a15f5d Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 10:48:16 +0800 Subject: [PATCH 049/125] issue #5110. refactor UILoadingBar, remove unneeded deprecats --- cocos/editor-support/cocostudio/CCSGUIReader.cpp | 4 ++-- .../LoadingBarReader/LoadingBarReader.cpp | 2 +- cocos/ui/UILoadingBar.cpp | 14 +++----------- cocos/ui/UILoadingBar.h | 14 ++++++-------- .../UILoadingBarTest/UILoadingBarTest.cpp | 4 ++-- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 58d8f03a37..a4e1199691 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -912,7 +912,7 @@ void WidgetPropertiesReader0250::setPropsForLoadingBarFromJsonDictionary(Widget { loadingBar->loadTexture(imageFileName_tp); } - loadingBar->setBarDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); + loadingBar->setDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); loadingBar->setPercent(DICTOOL->getIntValue_json(options, "percent")); setColorPropsForWidgetFromJsonDictionary(widget,options); } @@ -1989,7 +1989,7 @@ void WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget } /**/ - loadingBar->setBarDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); + loadingBar->setDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); loadingBar->setPercent(DICTOOL->getIntValue_json(options, "percent")); setColorPropsForWidgetFromJsonDictionary(widget,options); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index 39f430b7b6..c5452a908b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -63,7 +63,7 @@ namespace cocostudio } /**/ - loadingBar->setBarDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); + loadingBar->setDirection(LoadingBar::Direction(DICTOOL->getIntValue_json(options, "direction"))); loadingBar->setPercent(DICTOOL->getIntValue_json(options, "percent")); diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index ed9f3094f7..0b1571a98a 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -85,12 +85,8 @@ void LoadingBar::initRenderer() _barRenderer->setAnchorPoint(Vector2(0.0,0.5)); } -void LoadingBar::setDirection(Direction direction) -{ - this->setBarDirection(direction); -} -void LoadingBar::setBarDirection(cocos2d::ui::LoadingBar::Direction direction) +void LoadingBar::setDirection(cocos2d::ui::LoadingBar::Direction direction) { if (_direction == direction) { @@ -120,15 +116,11 @@ void LoadingBar::setBarDirection(cocos2d::ui::LoadingBar::Direction direction) } -LoadingBar::Direction LoadingBar::getBarDirection() +LoadingBar::Direction LoadingBar::getDirection() { return _direction; } -int LoadingBar::getDirection() -{ - return static_cast(_direction); -} void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) { @@ -396,7 +388,7 @@ void LoadingBar::copySpecialProperties(Widget *widget) loadTexture(loadingBar->_textureFile, loadingBar->_renderBarTexType); setCapInsets(loadingBar->_capInsets); setPercent(loadingBar->_percent); - setBarDirection(loadingBar->_direction); + setDirection(loadingBar->_direction); } } diff --git a/cocos/ui/UILoadingBar.h b/cocos/ui/UILoadingBar.h index 7c2d2df5eb..9c3467a648 100644 --- a/cocos/ui/UILoadingBar.h +++ b/cocos/ui/UILoadingBar.h @@ -69,22 +69,20 @@ public: /** * Changes the progress direction of loadingbar. * - * @see LoadingBarType LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise. + * @see Direction LEFT means progress left to right, RIGHT otherwise. * - * @param LoadingBarType + * @param Direction */ - CC_DEPRECATED_ATTRIBUTE void setDirection(Direction direction); - void setBarDirection(Direction direction); + void setDirection(Direction direction); /** * Gets the progress direction of loadingbar. * - * @see LoadingBarType LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise. + * @see Direction LEFT means progress left to right, RIGHT otherwise. * - * @param LoadingBarType + * @return Direction */ - CC_DEPRECATED_ATTRIBUTE int getDirection(); - Direction getBarDirection(); + Direction getDirection(); /** * Load texture for loadingbar. diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index aaec09b33e..7722f2e3b5 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -111,7 +111,7 @@ bool UILoadingBarTest_Right::init() // Create the loading bar LoadingBar* loadingBar = LoadingBar::create("cocosui/sliderProgress.png"); loadingBar->setTag(0); - loadingBar->setBarDirection(LoadingBar::Direction::RIGHT); + loadingBar->setDirection(LoadingBar::Direction::RIGHT); loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); @@ -276,7 +276,7 @@ bool UILoadingBarTest_Right_Scale9::init() loadingBar->setScale9Enabled(true); loadingBar->setCapInsets(Rect(0, 0, 0, 0)); loadingBar->setSize(Size(300, 13)); - loadingBar->setBarDirection(LoadingBar::Direction::RIGHT); + loadingBar->setDirection(LoadingBar::Direction::RIGHT); loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); From e6a36fde18d7678e572572b4b693ba32844a7f7a Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 11:18:11 +0800 Subject: [PATCH 050/125] issue #5110, refactor VideoPlayer --- cocos/ui/UIVideoPlayer.h | 32 ++--- cocos/ui/UIVideoPlayerIOS.mm | 110 +++++++++--------- .../UIVideoPlayerTest/UIVideoPlayerTest.cpp | 14 +-- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/cocos/ui/UIVideoPlayer.h b/cocos/ui/UIVideoPlayer.h index fcbc722835..67a356d959 100644 --- a/cocos/ui/UIVideoPlayer.h +++ b/cocos/ui/UIVideoPlayer.h @@ -43,24 +43,24 @@ namespace experimental{ STOPPED, COMPLETED }; - typedef std::function EventCallback; + typedef std::function ccVideoPlayerCallback; CREATE_FUNC(VideoPlayer); //Sets local file[support assets' file on android] as a video source for VideoPlayer - virtual void setVideoFileName(const std::string& videoPath); - virtual const std::string& getVideoFileName() const { return _videoUrl;} + virtual void setFileName(const std::string& videoPath); + virtual const std::string& getFileName() const { return _videoURL;} //Sets network link as a video source for VideoPlayer - virtual void setVideoURL(const std::string& videoUrl); - virtual const std::string& getVideoURL() const { return _videoUrl;} + virtual void setURL(const std::string& _videoURL); + virtual const std::string& getURL() const { return _videoURL;} - virtual void startVideo(); - virtual void pauseVideo(); - virtual void resumeVideo(); - virtual void stopVideo(); + virtual void play(); + virtual void pause(); + virtual void resume(); + virtual void stop(); - virtual void seekVideoTo(float sec); + virtual void seekTo(float sec); virtual bool isPlaying() const; virtual void setVisible(bool visible) override; @@ -71,9 +71,9 @@ namespace experimental{ virtual void setFullScreenEnabled(bool enabled); virtual bool isFullScreenEnabled(); - virtual void addEventListener(const VideoPlayer::EventCallback& callback); + virtual void addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback); - virtual void onVideoEvent(VideoPlayer::EventType event); + virtual void onPlayEvent(VideoPlayer::EventType event); virtual void draw(Renderer *renderer, const Matrix& transform, bool transformUpdated) override; protected: @@ -85,7 +85,7 @@ namespace experimental{ void VideoPlayer::drawDebugData(); #endif - enum class VideoSource + enum class Source { FILENAME = 0, URL @@ -96,11 +96,11 @@ namespace experimental{ bool _fullScreenEnabled; bool _keepAspectRatioEnabled; - std::string _videoUrl; - VideoSource _videoSource; + std::string _videoURL; + Source _videoSource; int _videoPlayerIndex; - EventCallback _callback; + ccVideoPlayerCallback _eventCallback; void* _videiView; }; diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index 27737f3eba..dea276f6f2 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -35,15 +35,15 @@ using namespace cocos2d::experimental::ui; @property (strong,nonatomic) MPMoviePlayerController * moviePlayer; -- (void) setVideoRect:(int) left :(int) top :(int) width :(int) height; -- (void) setVideoURL:(int) videoSource :(std::string&) videoUrl; -- (void) startVideo; -- (void) pauseVideo; -- (void) resumeVideo; -- (void) stopVideo; -- (void) seekVideoTo:(float) sec; -- (void) setVideoVisible:(bool) visible; -- (void) setVideoKeepRatioEnabled:(bool) enabled; +- (void) setFrame:(int) left :(int) top :(int) width :(int) height; +- (void) setURL:(int) videoSource :(std::string&) videoUrl; +- (void) play; +- (void) pause; +- (void) resume; +- (void) stop; +- (void) seekTo:(float) sec; +- (void) setVisible:(bool) visible; +- (void) setKeepRatioEnabled:(bool) enabled; - (void) setFullScreenEnabled:(bool) enabled; - (bool) isFullScreenEnabled; @@ -92,7 +92,7 @@ using namespace cocos2d::experimental::ui; [super dealloc]; } --(void) setVideoRect:(int)left :(int)top :(int)width :(int)height +-(void) setFrame:(int)left :(int)top :(int)width :(int)height { _left = left; _width = width; @@ -119,7 +119,7 @@ using namespace cocos2d::experimental::ui; return false; } --(void) setVideoURL:(int)videoSource :(std::string &)videoUrl +-(void) setURL:(int)videoSource :(std::string &)videoUrl { if (self.moviePlayer != nullptr) { [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer]; @@ -169,7 +169,7 @@ using namespace cocos2d::experimental::ui; { if([self.moviePlayer playbackState] != MPMoviePlaybackStateStopped) { - _videoPlayer->onVideoEvent(VideoPlayer::EventType::COMPLETED); + _videoPlayer->onPlayEvent(VideoPlayer::EventType::COMPLETED); } } } @@ -179,13 +179,13 @@ using namespace cocos2d::experimental::ui; MPMoviePlaybackState state = [self.moviePlayer playbackState]; switch (state) { case MPMoviePlaybackStatePaused: - _videoPlayer->onVideoEvent(VideoPlayer::EventType::PAUSED); + _videoPlayer->onPlayEvent(VideoPlayer::EventType::PAUSED); break; case MPMoviePlaybackStateStopped: - _videoPlayer->onVideoEvent(VideoPlayer::EventType::STOPPED); + _videoPlayer->onPlayEvent(VideoPlayer::EventType::STOPPED); break; case MPMoviePlaybackStatePlaying: - _videoPlayer->onVideoEvent(VideoPlayer::EventType::PLAYING); + _videoPlayer->onPlayEvent(VideoPlayer::EventType::PLAYING); break; case MPMoviePlaybackStateInterrupted: break; @@ -198,21 +198,21 @@ using namespace cocos2d::experimental::ui; } } --(void) seekVideoTo:(float)sec +-(void) seekTo:(float)sec { if (self.moviePlayer != NULL) { [self.moviePlayer setCurrentPlaybackTime:(sec)]; } } --(void) setVideoVisible:(bool)visible +-(void) setVisible:(bool)visible { if (self.moviePlayer != NULL) { [self.moviePlayer.view setHidden:visible]; } } --(void) setVideoKeepRatioEnabled:(bool)enabled +-(void) setKeepRatioEnabled:(bool)enabled { _keepRatioEnabled = enabled; if (self.moviePlayer != NULL) { @@ -224,7 +224,7 @@ using namespace cocos2d::experimental::ui; } } --(void) startVideo +-(void) play { if (self.moviePlayer != NULL) { [self.moviePlayer.view setFrame:CGRectMake(_left, _top, _width, _height)]; @@ -232,14 +232,14 @@ using namespace cocos2d::experimental::ui; } } --(void) pauseVideo +-(void) pause { if (self.moviePlayer != NULL) { [self.moviePlayer pause]; } } --(void) resumeVideo +-(void) resume { if (self.moviePlayer != NULL) { if([self.moviePlayer playbackState] == MPMoviePlaybackStatePaused) @@ -249,7 +249,7 @@ using namespace cocos2d::experimental::ui; } } --(void) stopVideo +-(void) stop { if (self.moviePlayer != NULL) { [self.moviePlayer stop]; @@ -281,7 +281,7 @@ using namespace cocos2d::experimental::ui; VideoPlayer::VideoPlayer() : _videoPlayerIndex(-1) -, _callback(nullptr) +, _eventCallback(nullptr) , _fullScreenEnabled(false) , _fullScreenDirty(false) , _keepAspectRatioEnabled(false) @@ -298,18 +298,18 @@ VideoPlayer::~VideoPlayer() } } -void VideoPlayer::setVideoFileName(const std::string& fileName) +void VideoPlayer::setFileName(const std::string& fileName) { - _videoUrl = fileName; - _videoSource = VideoPlayer::VideoSource::FILENAME; - [((UIVideoViewWrapperIos*)_videiView) setVideoURL:(int)_videoSource :_videoUrl]; + _videoURL = fileName; + _videoSource = VideoPlayer::Source::FILENAME; + [((UIVideoViewWrapperIos*)_videiView) setURL:(int)_videoSource :_videoURL]; } -void VideoPlayer::setVideoURL(const std::string& videoUrl) +void VideoPlayer::setURL(const std::string& videoUrl) { - _videoUrl = videoUrl; - _videoSource = VideoPlayer::VideoSource::URL; - [((UIVideoViewWrapperIos*)_videiView) setVideoURL:(int)_videoSource :_videoUrl]; + _videoURL = videoUrl; + _videoSource = VideoPlayer::Source::URL; + [((UIVideoViewWrapperIos*)_videiView) setURL:(int)_videoSource :_videoURL]; } void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) @@ -331,7 +331,7 @@ void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transfo auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; - [((UIVideoViewWrapperIos*)_videiView) setVideoRect:uiLeft :uiTop + [((UIVideoViewWrapperIos*)_videiView) setFrame :uiLeft :uiTop :(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor :( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)]; } @@ -358,7 +358,7 @@ void VideoPlayer::setKeepAspectRatioEnabled(bool enable) if (_keepAspectRatioEnabled != enable) { _keepAspectRatioEnabled = enable; - [((UIVideoViewWrapperIos*)_videiView) setVideoKeepRatioEnabled:enable]; + [((UIVideoViewWrapperIos*)_videiView) setKeepRatioEnabled:enable]; } } @@ -387,43 +387,43 @@ void VideoPlayer::drawDebugData() } #endif -void VideoPlayer::startVideo() +void VideoPlayer::play() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) startVideo]; + [((UIVideoViewWrapperIos*)_videiView) play]; } } -void VideoPlayer::pauseVideo() +void VideoPlayer::pause() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) pauseVideo]; + [((UIVideoViewWrapperIos*)_videiView) pause]; } } -void VideoPlayer::resumeVideo() +void VideoPlayer::resume() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) resumeVideo]; + [((UIVideoViewWrapperIos*)_videiView) resume]; } } -void VideoPlayer::stopVideo() +void VideoPlayer::stop() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) stopVideo]; + [((UIVideoViewWrapperIos*)_videiView) stop]; } } -void VideoPlayer::seekVideoTo(float sec) +void VideoPlayer::seekTo(float sec) { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) seekVideoTo:sec]; + [((UIVideoViewWrapperIos*)_videiView) seekTo:sec]; } } @@ -436,18 +436,18 @@ void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) setVideoVisible:visible]; + [((UIVideoViewWrapperIos*)_videiView) setVisible:visible]; } } -void VideoPlayer::addEventListener(const VideoPlayer::EventCallback& callback) +void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback) { - _callback = callback; + _eventCallback = callback; } -void VideoPlayer::onVideoEvent(VideoPlayer::EventType event) +void VideoPlayer::onPlayEvent(VideoPlayer::EventType event) { if (event == VideoPlayer::EventType::PLAYING) { _isPlaying = true; @@ -455,9 +455,9 @@ void VideoPlayer::onVideoEvent(VideoPlayer::EventType event) _isPlaying = false; } - if (_callback) + if (_eventCallback) { - _callback(this,event); + _eventCallback(this,event); } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index 050a6e186f..cdaaceac7b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -89,8 +89,8 @@ void VideoPlayerTest::menuResourceVideoCallback(Ref* sender) { if (_videoPlayer) { - _videoPlayer->setVideoFileName("cocosvideo.mp4"); - _videoPlayer->startVideo(); + _videoPlayer->setFileName("cocosvideo.mp4"); + _videoPlayer->play(); } } @@ -98,8 +98,8 @@ void VideoPlayerTest::menuOnlineVideoCallback(Ref* sender) { if (_videoPlayer) { - _videoPlayer->setVideoURL("http://video001.smgbb.cn/gslb/program/FDN/FDN1190949/HLSVodService.m3u8?_mdCode=6065719&_cdnCode=B2B_XL_TEST&_type=0&_rCode=TerOut_18865&_userId=020341000456068&_categoryCode=SMG_HUAYU&_categoryPath=SMG_1002,SMG_HUAYU,&_adPositionId=01001000&_adCategorySource=0&_flag=.m3u8&_enCode=m3u8&taskID=ysh_ps_002-ott_1397459105893_020341000456068&_client=103&_cms=ctv&_CDNToken=76C043FD4969501754DC19E54EC8DC2C"); - _videoPlayer->startVideo(); + _videoPlayer->setURL("http://video001.smgbb.cn/gslb/program/FDN/FDN1190949/HLSVodService.m3u8?_mdCode=6065719&_cdnCode=B2B_XL_TEST&_type=0&_rCode=TerOut_18865&_userId=020341000456068&_categoryCode=SMG_HUAYU&_categoryPath=SMG_1002,SMG_HUAYU,&_adPositionId=01001000&_adCategorySource=0&_flag=.m3u8&_enCode=m3u8&taskID=ysh_ps_002-ott_1397459105893_020341000456068&_client=103&_cms=ctv&_CDNToken=76C043FD4969501754DC19E54EC8DC2C"); + _videoPlayer->play(); } } @@ -107,7 +107,7 @@ void VideoPlayerTest::menuPauseCallback(Ref* sender) { if (_videoPlayer) { - _videoPlayer->pauseVideo(); + _videoPlayer->pause(); } } @@ -115,7 +115,7 @@ void VideoPlayerTest::menuResumeCallback(Ref* sender) { if (_videoPlayer) { - _videoPlayer->resumeVideo(); + _videoPlayer->resume(); } } @@ -123,7 +123,7 @@ void VideoPlayerTest::menuStopCallback(Ref* sender) { if (_videoPlayer) { - _videoPlayer->stopVideo(); + _videoPlayer->stop(); } } From 1341970b40b0d2c78edc06e9c0f4dd6d8763e327 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Wed, 14 May 2014 11:19:30 +0800 Subject: [PATCH 051/125] [ci skip], modify v3!=v2 about config.json. --- tools/jenkins-scripts/pull-request-builder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index cfb99b5f19..8e61696efe 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -29,11 +29,13 @@ def set_description(desc, url): except: traceback.print_exc() -def check_current_3rd_libs(): +def check_current_3rd_libs(branch): #get current_libs config backup_files = range(2) current_files = range(2) config_file_paths = ['external/config.json','templates/lua-template-runtime/runtime/config.json'] + if (branch == 'v2'): + config_file_paths = ['external/config.json'] for i, config_file_path in enumerate(config_file_paths): if not os.path.isfile(config_file_path): raise Exception("Could not find 'external/config.json'") @@ -133,7 +135,7 @@ def main(): return(2) #copy check_current_3rd_libs - check_current_3rd_libs() + check_current_3rd_libs(branch) # Generate binding glue codes if(branch == 'v3'): From 46cf6251b6cf1d5475f4e70cd224d960c9caf6dd Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 11:26:04 +0800 Subject: [PATCH 052/125] issue #5110, rename a member variable and delete gui prefix in ui tests --- cocos/ui/UIVideoPlayer.h | 2 +- cocos/ui/UIVideoPlayerIOS.mm | 30 ++++---- .../CocoStudioGUITest/CocosGUIScene.cpp | 71 ++++++++++--------- 3 files changed, 52 insertions(+), 51 deletions(-) diff --git a/cocos/ui/UIVideoPlayer.h b/cocos/ui/UIVideoPlayer.h index 67a356d959..24558c6b60 100644 --- a/cocos/ui/UIVideoPlayer.h +++ b/cocos/ui/UIVideoPlayer.h @@ -102,7 +102,7 @@ namespace experimental{ int _videoPlayerIndex; ccVideoPlayerCallback _eventCallback; - void* _videiView; + void* _videoView; }; } } diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index dea276f6f2..ed54eb2ecc 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -287,14 +287,14 @@ VideoPlayer::VideoPlayer() , _keepAspectRatioEnabled(false) , _isPlaying(false) { - _videiView = [[UIVideoViewWrapperIos alloc] init:this]; + _videoView = [[UIVideoViewWrapperIos alloc] init:this]; } VideoPlayer::~VideoPlayer() { - if(_videiView) + if(_videoView) { - [((UIVideoViewWrapperIos*)_videiView) dealloc]; + [((UIVideoViewWrapperIos*)_videoView) dealloc]; } } @@ -302,14 +302,14 @@ void VideoPlayer::setFileName(const std::string& fileName) { _videoURL = fileName; _videoSource = VideoPlayer::Source::FILENAME; - [((UIVideoViewWrapperIos*)_videiView) setURL:(int)_videoSource :_videoURL]; + [((UIVideoViewWrapperIos*)_videoView) setURL:(int)_videoSource :_videoURL]; } void VideoPlayer::setURL(const std::string& videoUrl) { _videoURL = videoUrl; _videoSource = VideoPlayer::Source::URL; - [((UIVideoViewWrapperIos*)_videiView) setURL:(int)_videoSource :_videoURL]; + [((UIVideoViewWrapperIos*)_videoView) setURL:(int)_videoSource :_videoURL]; } void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) @@ -331,7 +331,7 @@ void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transfo auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; - [((UIVideoViewWrapperIos*)_videiView) setFrame :uiLeft :uiTop + [((UIVideoViewWrapperIos*)_videoView) setFrame :uiLeft :uiTop :(rightTop.x - leftBottom.x) * glView->getScaleX() / scaleFactor :( (rightTop.y - leftBottom.y) * glView->getScaleY()/scaleFactor)]; } @@ -345,12 +345,12 @@ void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transfo bool VideoPlayer::isFullScreenEnabled() { - return [((UIVideoViewWrapperIos*)_videiView) isFullScreenEnabled]; + return [((UIVideoViewWrapperIos*)_videoView) isFullScreenEnabled]; } void VideoPlayer::setFullScreenEnabled(bool enabled) { - [((UIVideoViewWrapperIos*)_videiView) setFullScreenEnabled:enabled]; + [((UIVideoViewWrapperIos*)_videoView) setFullScreenEnabled:enabled]; } void VideoPlayer::setKeepAspectRatioEnabled(bool enable) @@ -358,7 +358,7 @@ void VideoPlayer::setKeepAspectRatioEnabled(bool enable) if (_keepAspectRatioEnabled != enable) { _keepAspectRatioEnabled = enable; - [((UIVideoViewWrapperIos*)_videiView) setKeepRatioEnabled:enable]; + [((UIVideoViewWrapperIos*)_videoView) setKeepRatioEnabled:enable]; } } @@ -391,7 +391,7 @@ void VideoPlayer::play() { if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) play]; + [((UIVideoViewWrapperIos*)_videoView) play]; } } @@ -399,7 +399,7 @@ void VideoPlayer::pause() { if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) pause]; + [((UIVideoViewWrapperIos*)_videoView) pause]; } } @@ -407,7 +407,7 @@ void VideoPlayer::resume() { if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) resume]; + [((UIVideoViewWrapperIos*)_videoView) resume]; } } @@ -415,7 +415,7 @@ void VideoPlayer::stop() { if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) stop]; + [((UIVideoViewWrapperIos*)_videoView) stop]; } } @@ -423,7 +423,7 @@ void VideoPlayer::seekTo(float sec) { if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) seekTo:sec]; + [((UIVideoViewWrapperIos*)_videoView) seekTo:sec]; } } @@ -438,7 +438,7 @@ void VideoPlayer::setVisible(bool visible) if (! _videoURL.empty()) { - [((UIVideoViewWrapperIos*)_videiView) setVisible:visible]; + [((UIVideoViewWrapperIos*)_videoView) setVisible:visible]; } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 614649a83c..917d203beb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -16,8 +16,22 @@ static struct } g_guisTests[] = { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) { - "gui focus test", + "VideoPlayerTest", + [](Ref* sender) + { + UISceneManager* pManager = UISceneManager::sharedUISceneManager(); + pManager->setCurrentUISceneId(kUIVideoPlayerTest); + pManager->setMinUISceneId(kUIVideoPlayerTest); + pManager->setMaxUISceneId(kUIVideoPlayerTest); + Scene* pScene = pManager->currentUIScene(); + Director::getInstance()->replaceScene(pScene); + } + }, +#endif + { + "focus test", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -30,7 +44,7 @@ g_guisTests[] = }, { - "gui ButtonTest", + "ButtonTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -42,7 +56,7 @@ g_guisTests[] = } }, { - "gui CheckBoxTest", + "CheckBoxTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -54,7 +68,7 @@ g_guisTests[] = } }, { - "gui SliderTest", + "SliderTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -67,7 +81,7 @@ g_guisTests[] = }, /* { - "gui PotentiometerTest", + "PotentiometerTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -81,7 +95,7 @@ g_guisTests[] = */ /* { - "gui SwitchTest", + "SwitchTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -94,7 +108,7 @@ g_guisTests[] = }, */ { - "gui ImageViewTest", + "ImageViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -106,7 +120,7 @@ g_guisTests[] = } }, { - "gui LoadingBarTest", + "LoadingBarTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -119,7 +133,7 @@ g_guisTests[] = }, /* { - "gui ProgressTimerTest", + "ProgressTimerTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -132,7 +146,7 @@ g_guisTests[] = }, */ { - "gui TextAtalsTest", + "TextAtalsTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -144,7 +158,7 @@ g_guisTests[] = } }, { - "gui TextTest", + "TextTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -156,7 +170,7 @@ g_guisTests[] = } }, { - "gui TextBMFontTest", + "TextBMFontTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -168,7 +182,7 @@ g_guisTests[] = } }, { - "gui TextFieldTest", + "TextFieldTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -180,7 +194,7 @@ g_guisTests[] = } }, { - "gui LayoutTest", + "LayoutTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -192,7 +206,7 @@ g_guisTests[] = } }, { - "gui ScrollViewTest", + "ScrollViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -204,7 +218,7 @@ g_guisTests[] = } }, { - "gui PageViewTest", + "PageViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -216,7 +230,7 @@ g_guisTests[] = } }, { - "gui ListViewTest", + "ListViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -229,7 +243,7 @@ g_guisTests[] = }, /* { - "gui GridViewTest", + "GridViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -243,7 +257,7 @@ g_guisTests[] = */ /* { - "gui PickerViewTest", + "PickerViewTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -256,7 +270,7 @@ g_guisTests[] = }, */ { - "gui WidgetAddNodeTest", + "WidgetAddNodeTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -268,7 +282,7 @@ g_guisTests[] = } }, { - "gui RichTextTest", + "RichTextTest", [](Ref* sender) { UISceneManager* pManager = UISceneManager::sharedUISceneManager(); @@ -279,20 +293,7 @@ g_guisTests[] = Director::getInstance()->replaceScene(pScene); } }, -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - { - "gui VideoPlayerTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIVideoPlayerTest); - pManager->setMinUISceneId(kUIVideoPlayerTest); - pManager->setMaxUISceneId(kUIVideoPlayerTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - } -#endif + }; static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); From a463a1630f4568ef326ca6103b75178cbc99dcbb Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 14 May 2014 11:49:09 +0800 Subject: [PATCH 053/125] Fixed #5040: Remove memory allocation assertion to permit multiply init --- cocos/2d/CCParticleSystemQuad.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 941aab8ac5..8cf35514b5 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -523,7 +523,6 @@ void ParticleSystemQuad::listenBackToForeground(EventCustom* event) bool ParticleSystemQuad::allocMemory() { - CCASSERT( ( !_quads && !_indices), "Memory already alloced"); CCASSERT( !_batchNode, "Memory should not be alloced when not using batchNode"); CC_SAFE_FREE(_quads); From cf24e327ee57f1669a901e3a6ff3fc6b2da84ceb Mon Sep 17 00:00:00 2001 From: lm Date: Wed, 14 May 2014 11:53:27 +0800 Subject: [PATCH 054/125] [Jenkins][ci skip] Add external lib to ci release build --- tools/jenkins-scripts/ci-release-test.py | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/jenkins-scripts/ci-release-test.py b/tools/jenkins-scripts/ci-release-test.py index 6e83e92519..e1c190f5a2 100644 --- a/tools/jenkins-scripts/ci-release-test.py +++ b/tools/jenkins-scripts/ci-release-test.py @@ -47,6 +47,36 @@ def make_temp_dir(): print cmd os.system(cmd) +def check_current_3rd_libs(branch): + #get current_libs config + backup_files = range(2) + current_files = range(2) + config_file_paths = ['external/config.json','templates/lua-template-runtime/runtime/config.json'] + if (branch == 'v2'): + config_file_paths = ['external/config.json'] + for i, config_file_path in enumerate(config_file_paths): + if not os.path.isfile(config_file_path): + raise Exception("Could not find 'external/config.json'") + + with open(config_file_path) as data_file: + data = json.load(data_file) + + current_3rd_libs_version = data["version"] + filename = current_3rd_libs_version + '.zip' + node_name = os.environ['NODE_NAME'] + backup_file = '../../../cocos-2dx-external/node/' + node_name + '/' + filename + backup_files[i] = backup_file + current_file = filename + current_files[i] = current_file + if os.path.isfile(backup_file): + copy(backup_file, current_file) + #run download-deps.py + os.system('python download-deps.py -r no') + #backup file + for i, backup_file in enumerate(backup_files): + current_file = current_files[i] + copy(current_file, backup_file) + def main(): #get tag tag = os.environ['tag'] @@ -91,6 +121,9 @@ def main(): if(ret != 0): return(2) + #copy check_current_3rd_libs + check_current_3rd_libs(branch) + #build #TODO: add android-linux build #TODO: add mac build From 4c23ff5b8c353afecae35c9ab9910b864b3f449d Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 14 May 2014 11:55:20 +0800 Subject: [PATCH 055/125] trackRef and untrackRef are static function now. --- cocos/base/CCRef.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 958d0b1072..9163a32409 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -35,8 +35,8 @@ THE SOFTWARE. NS_CC_BEGIN #if CC_USE_MEM_LEAK_DETECTION -void trackRef(Ref* ref); -void untrackRef(Ref* ref); +static void trackRef(Ref* ref); +static void untrackRef(Ref* ref); #endif Ref::Ref() @@ -168,15 +168,15 @@ void Ref::printLeaks() } } -void trackRef(Ref* ref) +static void trackRef(Ref* ref) { - CC_ASSERT(ref); + CCASSERT(ref, "Invalid parameter, ref should not be null!"); // Create memory allocation record. __refAllocationList.push_back(ref); } -void untrackRef(Ref* ref) +static void untrackRef(Ref* ref) { auto iter = std::find(__refAllocationList.begin(), __refAllocationList.end(), ref); if (iter == __refAllocationList.end()) From 534ad2aafbb630d41a44153002b7b914311daf57 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 14 May 2014 14:43:10 +0800 Subject: [PATCH 056/125] =?UTF-8?q?fix=20the=20compile=20error=20in=20Xcod?= =?UTF-8?q?e=204.6=20for=20mac=20platform=20which=20trigger=20by=20the=20A?= =?UTF-8?q?rchitectures=E2=80=99=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/cocos2d_tests.xcodeproj/project.pbxproj | 8 ++++++++ .../cocos2d_lua_bindings.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 10 insertions(+) diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 5282890068..b0f9666fb6 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -5213,6 +5213,7 @@ 1A0EE2B018CDF6DA004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -5226,6 +5227,7 @@ 1A0EE2B118CDF6DA004CD58F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -5240,6 +5242,7 @@ 1A0EE31218CDF733004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -5258,6 +5261,7 @@ 1A0EE31318CDF733004CD58F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -5343,6 +5347,7 @@ 1ABCA2B318CD91520087CE3A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -5361,6 +5366,7 @@ 1ABCA2B418CD91520087CE3A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -5417,6 +5423,7 @@ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -5429,6 +5436,7 @@ 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index 90a9e92d9f..ed02f45ec4 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -958,6 +958,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -977,6 +978,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; GCC_PREPROCESSOR_DEFINITIONS = ( From 578ff2735dda3c3f753115d8db17d39002442726 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 14:44:04 +0800 Subject: [PATCH 057/125] issue #5110, fix VideoPlayer android compile error --- cocos/ui/UIVideoPlayerAndroid.cpp | 52 +++++++++++++++---------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/cocos/ui/UIVideoPlayerAndroid.cpp b/cocos/ui/UIVideoPlayerAndroid.cpp index a12d111aab..02ffbc1432 100644 --- a/cocos/ui/UIVideoPlayerAndroid.cpp +++ b/cocos/ui/UIVideoPlayerAndroid.cpp @@ -156,7 +156,7 @@ static std::unordered_map s_allVideoPlayers; VideoPlayer::VideoPlayer() : _videoPlayerIndex(-1) -, _callback(nullptr) +, _eventCallback(nullptr) , _fullScreenEnabled(false) , _fullScreenDirty(false) , _keepAspectRatioEnabled(false) @@ -181,18 +181,18 @@ VideoPlayer::~VideoPlayer() removeVideoWidgetJNI(_videoPlayerIndex); } -void VideoPlayer::setVideoFileName(const std::string& fileName) +void VideoPlayer::setFileName(const std::string& fileName) { - _videoUrl = fileName; - _videoSource = VideoPlayer::VideoSource::FILENAME; - setVideoURLJNI(_videoPlayerIndex, (int)VideoSource::FILENAME,_videoUrl); + _videoURL = fileName; + _videoSource = VideoPlayer::Source::FILENAME; + setVideoURLJNI(_videoPlayerIndex, (int)Source::FILENAME,_videoURL); } -void VideoPlayer::setVideoURL(const std::string& videoUrl) +void VideoPlayer::setURL(const std::string& videoUrl) { - _videoUrl = videoUrl; - _videoSource = VideoPlayer::VideoSource::URL; - setVideoURLJNI(_videoPlayerIndex,(int)VideoSource::URL,_videoUrl); + _videoURL = videoUrl; + _videoSource = VideoPlayer::Source::URL; + setVideoURLJNI(_videoPlayerIndex,(int)Source::URL,_videoURL); } void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) @@ -281,41 +281,41 @@ void VideoPlayer::drawDebugData() } #endif -void VideoPlayer::startVideo() +void VideoPlayer::play() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { startVideoJNI(_videoPlayerIndex); } } -void VideoPlayer::pauseVideo() +void VideoPlayer::pause() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { pauseVideoJNI(_videoPlayerIndex); } } -void VideoPlayer::resumeVideo() +void VideoPlayer::resume() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { resumeVideoJNI(_videoPlayerIndex); } } -void VideoPlayer::stopVideo() +void VideoPlayer::stop() { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { stopVideoJNI(_videoPlayerIndex); } } -void VideoPlayer::seekVideoTo(float sec) +void VideoPlayer::seekTo(float sec) { - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { seekVideoToJNI(_videoPlayerIndex,int(sec * 1000)); } @@ -330,18 +330,18 @@ void VideoPlayer::setVisible(bool visible) { cocos2d::ui::Widget::setVisible(visible); - if (! _videoUrl.empty()) + if (! _videoURL.empty()) { setVideoVisible(_videoPlayerIndex,visible); } } -void VideoPlayer::addEventListener(const VideoPlayer::EventCallback& callback) +void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback) { - _callback = callback; + _eventCallback = callback; } -void VideoPlayer::onVideoEvent(VideoPlayer::EventType event) +void VideoPlayer::onPlayEvent(VideoPlayer::EventType event) { if (event == VideoPlayer::EventType::PLAYING) { _isPlaying = true; @@ -349,9 +349,9 @@ void VideoPlayer::onVideoEvent(VideoPlayer::EventType event) _isPlaying = false; } - if (_callback) + if (_eventCallback) { - _callback(this,event); + _eventCallback(this,event); } } @@ -360,7 +360,7 @@ void executeVideoCallback(int index,int event) auto it = s_allVideoPlayers.find(index); if (it != s_allVideoPlayers.end()) { - s_allVideoPlayers[index]->onVideoEvent((VideoPlayer::EventType)event); + s_allVideoPlayers[index]->onPlayEvent((VideoPlayer::EventType)event); } } From c58f303a31434b48a571f2f475fc6b4b57cabba0 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Wed, 14 May 2014 15:13:43 +0800 Subject: [PATCH 058/125] [ci skip], set v2-branch different variable in pull-request-builder.py. --- tools/jenkins-scripts/pull-request-builder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 8e61696efe..7a5efdd10b 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -36,6 +36,7 @@ def check_current_3rd_libs(branch): config_file_paths = ['external/config.json','templates/lua-template-runtime/runtime/config.json'] if (branch == 'v2'): config_file_paths = ['external/config.json'] + backup_files = current_files = range(1) for i, config_file_path in enumerate(config_file_paths): if not os.path.isfile(config_file_path): raise Exception("Could not find 'external/config.json'") From e6889dca3649a95adb062e70585a8180087ab10a Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 15:26:14 +0800 Subject: [PATCH 059/125] issue #5110, refactor UIText --- .../cocostudio/CCSGUIReader.cpp | 4 +-- .../WidgetReader/TextReader/TextReader.cpp | 2 +- cocos/ui/UIText.cpp | 13 ++++---- cocos/ui/UIText.h | 10 ++++-- .../UIButtonTest/UIButtonTest.cpp | 32 +++++++++---------- .../UIButtonTest/UIButtonTest_Editor.cpp | 10 +++--- .../UICheckBoxTest/UICheckBoxTest.cpp | 4 +-- .../UICheckBoxTest/UICheckBoxTest_Editor.cpp | 6 ++-- .../UIFocusTest/UIFocusTest.cpp | 20 ++++++------ .../UIPageViewTest/UIPageViewTest.cpp | 2 +- .../UITest/CocoStudioGUITest/UIScene.h | 2 +- .../UITest/CocoStudioGUITest/UIScene_Editor.h | 2 +- .../UISliderTest/UISliderTest.cpp | 4 +-- .../UISliderTest/UISliderTest_Editor.cpp | 4 +-- .../UITextFieldTest/UITextFieldTest.cpp | 32 +++++++++---------- .../UITextFieldTest_Editor.cpp | 10 +++--- .../UIWidgetAddNodeTest.cpp | 2 +- 17 files changed, 82 insertions(+), 77 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index a4e1199691..f80d20231a 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -632,7 +632,7 @@ void WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widge bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable"); label->setTouchScaleChangeEnabled(touchScaleChangeAble); const char* text = DICTOOL->getStringValue_json(options, "text"); - label->setText(text); + label->setString(text); bool fs = DICTOOL->checkObjectExist_json(options, "fontSize"); if (fs) { @@ -1571,7 +1571,7 @@ void WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widge bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable"); label->setTouchScaleChangeEnabled(touchScaleChangeAble); const char* text = DICTOOL->getStringValue_json(options, "text"); - label->setText(text); + label->setString(text); bool fs = DICTOOL->checkObjectExist_json(options, "fontSize"); if (fs) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index 76db3ff6f1..08144322b4 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -42,7 +42,7 @@ namespace cocostudio bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, "touchScaleEnable"); label->setTouchScaleChangeEnabled(touchScaleChangeAble); const char* text = DICTOOL->getStringValue_json(options, "text"); - label->setText(text); + label->setString(text); bool fs = DICTOOL->checkObjectExist_json(options, "fontSize"); if (fs) { diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index a0fc15131a..77f7d18cf2 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -89,7 +89,7 @@ bool Text::init(const std::string &textContent, const std::string &fontName, int ret = false; break; } - this->setText(textContent); + this->setString(textContent); this->setFontName(fontName); this->setFontSize(fontSize); } while (0); @@ -102,21 +102,22 @@ void Text::initRenderer() addProtectedChild(_labelRenderer, LABEL_RENDERER_Z, -1); } -void Text::setText(const std::string& text) + +void Text::setString(const std::string &text) { _labelRenderer->setString(text); updateContentSizeWithTextureSize(_labelRenderer->getContentSize()); _labelRendererAdaptDirty = true; } - -const std::string& Text::getStringValue() + +const std::string& Text::getString() const { return _labelRenderer->getString(); } ssize_t Text::getStringLength() { - return _labelRenderer->getString().size(); + return _labelRenderer->getStringLength(); } void Text::setFontSize(int size) @@ -324,7 +325,7 @@ void Text::copySpecialProperties(Widget *widget) { setFontName(label->_fontName); setFontSize(label->_labelRenderer->getSystemFontSize()); - setText(label->getStringValue()); + setString(label->getString()); setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled); setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment()); setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment()); diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 65d1d04ed9..ce5115ffa8 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -68,17 +68,21 @@ public: * * @param text string value. */ - void setText(const std::string& text); + CC_DEPRECATED_ATTRIBUTE void setText(const std::string& text){this->setString(text);} + void setString(const std::string& text); /** * Gets the string value of label. * * @return text string value. */ - const std::string& getStringValue(); + CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue(){ return this->getString();} + const std::string& getString()const; /** - * Gets the string length of label. + * Gets the string length of the label. + * Note: This length will be larger than the raw string length, + * if you want to get the raw string length, you should call this->getString().size() instead * * @return string length. */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index bcc8146bfe..51904b8368 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -53,19 +53,19 @@ void UIButtonTest::touchEvent(Ref *pSender, Widget::TouchEventType type) switch (type) { case Widget::TouchEventType::BEGAN: - _displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); break; case Widget::TouchEventType::MOVED: - _displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); break; case Widget::TouchEventType::ENDED: - _displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); break; case Widget::TouchEventType::CANCELED: - _displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); break; default: @@ -125,19 +125,19 @@ void UIButtonTest_Scale9::touchEvent(Ref *pSender, Widget::TouchEventType type) switch (type) { case Widget::TouchEventType::BEGAN: - _displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); break; case Widget::TouchEventType::MOVED: - _displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); break; case Widget::TouchEventType::ENDED: - _displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); break; case Widget::TouchEventType::CANCELED: - _displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); break; default: @@ -194,19 +194,19 @@ void UIButtonTest_PressedAction::touchEvent(Ref *pSender, Widget::TouchEventType switch (type) { case Widget::TouchEventType::BEGAN: - _displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); break; case Widget::TouchEventType::MOVED: - _displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); break; case Widget::TouchEventType::ENDED: - _displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); break; case Widget::TouchEventType::CANCELED: - _displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); break; default: @@ -264,19 +264,19 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, Widget::TouchEventType type) switch (type) { case Widget::TouchEventType::BEGAN: - _displayValueLabel->setText(String::createWithFormat("Touch Down")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); break; case Widget::TouchEventType::MOVED: - _displayValueLabel->setText(String::createWithFormat("Touch Move")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); break; case Widget::TouchEventType::ENDED: - _displayValueLabel->setText(String::createWithFormat("Touch Up")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); break; case Widget::TouchEventType::CANCELED: - _displayValueLabel->setText(String::createWithFormat("Touch Cancelled")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp index 26ab2f1ee6..73c41acc5d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp @@ -50,7 +50,7 @@ bool UIButtonTest_Editor::init() _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); - _displayValueLabel->setText("No event"); + _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); @@ -66,19 +66,19 @@ void UIButtonTest_Editor::touchEvent(Ref *pSender, Widget::TouchEventType type) switch (type) { case Widget::TouchEventType::BEGAN: - _displayValueLabel->setText("Touch Down"); + _displayValueLabel->setString("Touch Down"); break; case Widget::TouchEventType::MOVED: - _displayValueLabel->setText("Touch Moved"); + _displayValueLabel->setString("Touch Moved"); break; case Widget::TouchEventType::ENDED: - _displayValueLabel->setText("Touch Ended"); + _displayValueLabel->setString("Touch Ended"); break; case Widget::TouchEventType::CANCELED: - _displayValueLabel->setText("Touch Canceled"); + _displayValueLabel->setString("Touch Canceled"); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index 8b076fc264..a91cce09f5 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -53,11 +53,11 @@ void UICheckBoxTest::selectedEvent(Ref* pSender,CheckBox::EventType type) switch (type) { case CheckBox::EventType::SELECTED: - _displayValueLabel->setText(String::createWithFormat("Selected")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Selected")->getCString()); break; case CheckBox::EventType::UNSELECTED: - _displayValueLabel->setText(String::createWithFormat("Unselected")->getCString()); + _displayValueLabel->setString(String::createWithFormat("Unselected")->getCString()); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp index 1b1ff152b8..283105c988 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp @@ -40,7 +40,7 @@ bool UICheckBoxTest_Editor::init() _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); - _displayValueLabel->setText("No event"); + _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); @@ -56,11 +56,11 @@ void UICheckBoxTest_Editor::selectedStateEvent(Ref *pSender, CheckBox::EventType switch (type) { case CheckBox::EventType::UNSELECTED: - _displayValueLabel->setText("Unselected"); + _displayValueLabel->setString("Unselected"); break; case CheckBox::EventType::SELECTED: - _displayValueLabel->setText("Selected"); + _displayValueLabel->setString("Selected"); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index 22059a3f78..585c4f39e6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -196,9 +196,9 @@ void UIFocusTestHorizontal::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::TouchE if (type == Widget::TouchEventType::ENDED) { _horizontalLayout->setLoopFocus(!_horizontalLayout->isLoopFocus()); if (_horizontalLayout->isLoopFocus()) { - _loopText->setText("loop enabled"); + _loopText->setString("loop enabled"); }else{ - _loopText->setText("loop disabled"); + _loopText->setString("loop disabled"); } } } @@ -267,9 +267,9 @@ void UIFocusTestVertical::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::TouchEve if (type == Widget::TouchEventType::ENDED) { _verticalLayout->setLoopFocus(!_verticalLayout->isLoopFocus()); if (_verticalLayout->isLoopFocus()) { - _loopText->setText("loop enabled"); + _loopText->setString("loop enabled"); }else{ - _loopText->setText("loop disabled"); + _loopText->setString("loop disabled"); } } } @@ -369,9 +369,9 @@ void UIFocusTestNestedLayout1::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou if (type == Widget::TouchEventType::ENDED) { _verticalLayout->setLoopFocus(!_verticalLayout->isLoopFocus()); if (_verticalLayout->isLoopFocus()) { - _loopText->setText("loop enabled"); + _loopText->setString("loop enabled"); }else{ - _loopText->setText("loop disabled"); + _loopText->setString("loop disabled"); } } } @@ -471,9 +471,9 @@ void UIFocusTestNestedLayout2::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou if (type == Widget::TouchEventType::ENDED) { _horizontalLayout->setLoopFocus(!_horizontalLayout->isLoopFocus()); if (_horizontalLayout->isLoopFocus()) { - _loopText->setText("loop enabled"); + _loopText->setString("loop enabled"); }else{ - _loopText->setText("loop disabled"); + _loopText->setString("loop disabled"); } } } @@ -581,9 +581,9 @@ void UIFocusTestNestedLayout3::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou if (type == Widget::TouchEventType::ENDED) { _verticalLayout->setLoopFocus(!_verticalLayout->isLoopFocus()); if (_verticalLayout->isLoopFocus()) { - _loopText->setText("loop enabled"); + _loopText->setString("loop enabled"); }else{ - _loopText->setText("loop disabled"); + _loopText->setString("loop disabled"); } } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 9ce8a0e649..6fa60775b1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -82,7 +82,7 @@ void UIPageViewTest::pageViewEvent(Ref *pSender, PageView::EventType type) { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setText(CCString::createWithFormat("page = %ld", pageView->getCurPageIndex() + 1)->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("page = %ld", pageView->getCurPageIndex() + 1)->getCString()); } break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h index eb1c77c1a2..28a1b172e7 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h @@ -42,7 +42,7 @@ static Scene* sceneWithTitle(const char * title) \ if (uiLayer && uiLayer->init()) \ { \ uiLayer->autorelease(); \ - uiLayer->getSceneTitle()->setText(title); \ + uiLayer->getSceneTitle()->setString(title); \ pScene->addChild(uiLayer); \ } \ else \ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h index b485871969..d681787126 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h @@ -43,7 +43,7 @@ static Scene* sceneWithTitle(const char * title) \ if (uiLayer && uiLayer->init()) \ { \ uiLayer->autorelease(); \ - uiLayer->getSceneTitle()->setText(title); \ + uiLayer->getSceneTitle()->setString(title); \ pScene->addChild(uiLayer); \ } \ else \ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 8dde41c942..1dafc7582d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -54,7 +54,7 @@ void UISliderTest::sliderEvent(Ref *pSender, Slider::EventType type) { Slider* slider = dynamic_cast(pSender); int percent = slider->getPercent(); - _displayValueLabel->setText(String::createWithFormat("Percent %d", percent)->getCString()); + _displayValueLabel->setString(String::createWithFormat("Percent %d", percent)->getCString()); } } @@ -112,6 +112,6 @@ void UISliderTest_Scale9::sliderEvent(Ref *pSender, Slider::EventType type) { Slider* slider = dynamic_cast(pSender); int percent = slider->getPercent(); - _displayValueLabel->setText(String::createWithFormat("Percent %d", percent)->getCString()); + _displayValueLabel->setString(String::createWithFormat("Percent %d", percent)->getCString()); } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp index bc4760c140..69bb9273e0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp @@ -45,7 +45,7 @@ bool UISliderTest_Editor::init() _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); - _displayValueLabel->setText("No event"); + _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); @@ -63,7 +63,7 @@ void UISliderTest_Editor::sliderEvent(Ref *pSender, Slider::EventType type) case Slider::EventType::ON_PERCENTAGE_CHANGED: { Slider* slider = static_cast(pSender); - _displayValueLabel->setText(CCString::createWithFormat("percent %d", slider->getPercent())->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("percent %d", slider->getPercent())->getCString()); } break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 8658d7b384..6f40044104 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -54,7 +54,7 @@ void UITextFieldTest::textFieldEvent(Ref *pSender, TextField::EventType type) Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("attach with IME")->getCString()); + _displayValueLabel->setString(String::createWithFormat("attach with IME")->getCString()); } break; @@ -63,16 +63,16 @@ void UITextFieldTest::textFieldEvent(Ref *pSender, TextField::EventType type) TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("detach with IME")->getCString()); + _displayValueLabel->setString(String::createWithFormat("detach with IME")->getCString()); } break; case TextField::EventType::INSERT_TEXT: - _displayValueLabel->setText(String::createWithFormat("insert words")->getCString()); + _displayValueLabel->setString(String::createWithFormat("insert words")->getCString()); break; case TextField::EventType::DELETE_BACKWARD: - _displayValueLabel->setText(String::createWithFormat("delete word")->getCString()); + _displayValueLabel->setString(String::createWithFormat("delete word")->getCString()); break; default: @@ -132,7 +132,7 @@ void UITextFieldTest_MaxLength::textFieldEvent(Ref *pSender, TextField::EventTyp Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("attach with IME max length %d", textField->getMaxLength())->getCString()); + _displayValueLabel->setString(String::createWithFormat("attach with IME max length %d", textField->getMaxLength())->getCString()); } break; @@ -141,21 +141,21 @@ void UITextFieldTest_MaxLength::textFieldEvent(Ref *pSender, TextField::EventTyp TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("detach with IME max length %d", textField->getMaxLength())->getCString()); + _displayValueLabel->setString(String::createWithFormat("detach with IME max length %d", textField->getMaxLength())->getCString()); } break; case TextField::EventType::INSERT_TEXT: { TextField* textField = dynamic_cast(pSender); - _displayValueLabel->setText(String::createWithFormat("insert words max length %d", textField->getMaxLength())->getCString()); + _displayValueLabel->setString(String::createWithFormat("insert words max length %d", textField->getMaxLength())->getCString()); } break; case TextField::EventType::DELETE_BACKWARD: { TextField* textField = dynamic_cast(pSender); - _displayValueLabel->setText(String::createWithFormat("delete word max length %d", textField->getMaxLength())->getCString()); + _displayValueLabel->setString(String::createWithFormat("delete word max length %d", textField->getMaxLength())->getCString()); } break; @@ -216,7 +216,7 @@ void UITextFieldTest_Password::textFieldEvent(Ref *pSender, TextField::EventType Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("attach with IME password")->getCString()); + _displayValueLabel->setString(String::createWithFormat("attach with IME password")->getCString()); } break; @@ -225,16 +225,16 @@ void UITextFieldTest_Password::textFieldEvent(Ref *pSender, TextField::EventType TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); - _displayValueLabel->setText(String::createWithFormat("detach with IME password")->getCString()); + _displayValueLabel->setString(String::createWithFormat("detach with IME password")->getCString()); } break; case TextField::EventType::INSERT_TEXT: - _displayValueLabel->setText(String::createWithFormat("insert words password")->getCString()); + _displayValueLabel->setString(String::createWithFormat("insert words password")->getCString()); break; case TextField::EventType::DELETE_BACKWARD: - _displayValueLabel->setText(String::createWithFormat("delete word password")->getCString()); + _displayValueLabel->setString(String::createWithFormat("delete word password")->getCString()); break; default: @@ -300,7 +300,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextField::EventType textField->setTextHorizontalAlignment(TextHAlignment::LEFT); textField->setTextVerticalAlignment(TextVAlignment::TOP); - _displayValueLabel->setText(CCString::createWithFormat("attach with IME")->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("attach with IME")->getCString()); } break; @@ -312,16 +312,16 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextField::EventType textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); - _displayValueLabel->setText(CCString::createWithFormat("detach with IME")->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("detach with IME")->getCString()); } break; case TextField::EventType::INSERT_TEXT: - _displayValueLabel->setText(CCString::createWithFormat("insert words")->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("insert words")->getCString()); break; case TextField::EventType::DELETE_BACKWARD: - _displayValueLabel->setText(CCString::createWithFormat("delete word")->getCString()); + _displayValueLabel->setString(CCString::createWithFormat("delete word")->getCString()); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp index 808fc8b846..ee13dd3969 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp @@ -46,7 +46,7 @@ bool UITextFieldTest_Editor::init() _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); - _displayValueLabel->setText("No event"); + _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); @@ -62,19 +62,19 @@ void UITextFieldTest_Editor::textFieldEvent(Ref *pSender, TextField::EventType t switch (type) { case TextField::EventType::ATTACH_WITH_IME: - _displayValueLabel->setText("attach with IME"); + _displayValueLabel->setString("attach with IME"); break; case TextField::EventType::DETACH_WITH_IME: - _displayValueLabel->setText("detach with IME"); + _displayValueLabel->setString("detach with IME"); break; case TextField::EventType::INSERT_TEXT: - _displayValueLabel->setText("insert words"); + _displayValueLabel->setString("insert words"); break; case TextField::EventType::DELETE_BACKWARD: - _displayValueLabel->setText("delete word"); + _displayValueLabel->setString("delete word"); break; default: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp index 32a9940649..cf7ad6e7ea 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp @@ -22,7 +22,7 @@ bool UIWidgetAddNodeTest::init() // Add the alert Text* alert = Text::create(); - alert->setText("Widget Add Node"); + alert->setString("Widget Add Node"); alert->setFontName("fonts/Marker Felt.ttf"); alert->setFontSize(30); alert->setColor(Color3B(159, 168, 176)); From 76cefcaa3f379f8b086ef724912e0b36a0458456 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 15:51:50 +0800 Subject: [PATCH 060/125] issue #5110, refactor UITextAtlas --- cocos/ui/UITextAtlas.cpp | 20 ++++++++++++++------ cocos/ui/UITextAtlas.h | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/cocos/ui/UITextAtlas.cpp b/cocos/ui/UITextAtlas.cpp index 0beb9c67b9..bce366478b 100644 --- a/cocos/ui/UITextAtlas.cpp +++ b/cocos/ui/UITextAtlas.cpp @@ -62,7 +62,7 @@ TextAtlas* TextAtlas::create() void TextAtlas::initRenderer() { - _labelAtlasRenderer = LabelAtlas::create(); + _labelAtlasRenderer = Label::create(); _labelAtlasRenderer->setAnchorPoint(Point::ANCHOR_MIDDLE); addProtectedChild(_labelAtlasRenderer, LABELATLAS_RENDERER_Z, -1); } @@ -91,25 +91,33 @@ void TextAtlas::setProperty(const std::string& stringValue, const std::string& c _itemWidth = itemWidth; _itemHeight = itemHeight; _startCharMap = startCharMap; - _labelAtlasRenderer->initWithString(stringValue, charMapFile, itemWidth, itemHeight, (int)(startCharMap[0])); + + _labelAtlasRenderer->setCharMap(_charMapFileName, _itemWidth, _itemHeight, (int)(_startCharMap[0])); + _labelAtlasRenderer->setString(stringValue); + updateContentSizeWithTextureSize(_labelAtlasRenderer->getContentSize()); _labelAtlasRendererAdaptDirty = true; - CCLOG("cs w %f, h %f", _contentSize.width, _contentSize.height); +// CCLOG("cs w %f, h %f", _contentSize.width, _contentSize.height); } -void TextAtlas::setStringValue(const std::string& value) +void TextAtlas::setString(const std::string& value) { _stringValue = value; _labelAtlasRenderer->setString(value); updateContentSizeWithTextureSize(_labelAtlasRenderer->getContentSize()); _labelAtlasRendererAdaptDirty = true; - CCLOG("cssss w %f, h %f", _contentSize.width, _contentSize.height); +// CCLOG("cssss w %f, h %f", _contentSize.width, _contentSize.height); } -const std::string& TextAtlas::getStringValue() const +const std::string& TextAtlas::getString() const { return _labelAtlasRenderer->getString(); } + +ssize_t TextAtlas::getStringLength() +{ + return _labelAtlasRenderer->getStringLength(); +} void TextAtlas::onSizeChanged() { diff --git a/cocos/ui/UITextAtlas.h b/cocos/ui/UITextAtlas.h index 2a79e84803..18942830bd 100644 --- a/cocos/ui/UITextAtlas.h +++ b/cocos/ui/UITextAtlas.h @@ -73,10 +73,21 @@ public: const std::string& startCharMap); //set string value for labelatlas. - void setStringValue(const std::string& value); + CC_DEPRECATED_ATTRIBUTE void setStringValue(const std::string& value){this->setString(value);} + void setString(const std::string& value); //get string value for labelatlas. - const std::string& getStringValue() const; + CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue() const{return this->getString();} + const std::string& getString() const; + + /** + * Gets the string length of the label. + * Note: This length will be larger than the raw string length, + * if you want to get the raw string length, you should call this->getString().size() instead + * + * @return string length. + */ + ssize_t getStringLength(); //override "getVirtualRendererSize" method of widget. virtual const Size& getVirtualRendererSize() const override; @@ -100,7 +111,7 @@ protected: virtual Widget* createCloneInstance() override; virtual void copySpecialProperties(Widget* model) override; protected: - LabelAtlas* _labelAtlasRenderer; + Label* _labelAtlasRenderer; std::string _stringValue; std::string _charMapFileName; int _itemWidth; From 437b30487cd6771ad393100864077156105f127e Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 16:02:31 +0800 Subject: [PATCH 061/125] issue #5110, refactor UITextBMFont --- cocos/editor-support/cocostudio/CCSGUIReader.cpp | 4 ++-- .../TextBMFontReader/TextBMFontReader.cpp | 2 +- cocos/ui/UITextBMFont.cpp | 15 ++++++++++----- cocos/ui/UITextBMFont.h | 15 +++++++++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index f80d20231a..dc30adc143 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -932,7 +932,7 @@ void WidgetPropertiesReader0250::setPropsForLabelBMFontFromJsonDictionary(Widget labelBMFont->setFntFile(cmf_tp); const char* text = DICTOOL->getStringValue_json(options, "text"); - labelBMFont->setText(text); + labelBMFont->setString(text); setColorPropsForWidgetFromJsonDictionary(widget,options); } @@ -2020,7 +2020,7 @@ void WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget } const char* text = DICTOOL->getStringValue_json(options, "text"); - labelBMFont->setText(text); + labelBMFont->setString(text); setColorPropsForWidgetFromJsonDictionary(widget,options); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index cd5ca3d85b..0558c1b072 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -60,7 +60,7 @@ namespace cocostudio } const char* text = DICTOOL->getStringValue_json(options, "text"); - labelBMFont->setText(text); + labelBMFont->setString(text); WidgetReader::setColorPropsFromJsonDictionary(widget, options); diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 78648b464f..28b6e050a5 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -64,7 +64,7 @@ TextBMFont* TextBMFont::create(const std::string &text, const std::string &filen if (widget && widget->init()) { widget->setFntFile(filename); - widget->setText(text); + widget->setString(text); widget->autorelease(); return widget; } @@ -88,10 +88,10 @@ void TextBMFont::setFntFile(const std::string& fileName) _labelBMFontRenderer->setBMFontFilePath(fileName); updateRGBAToRenderer(_labelBMFontRenderer); _fntFileHasInit = true; - setText(_stringValue); + setString(_stringValue); } -void TextBMFont::setText(const std::string& value) +void TextBMFont::setString(const std::string& value) { _stringValue = value; if (!_fntFileHasInit) @@ -103,10 +103,15 @@ void TextBMFont::setText(const std::string& value) _labelBMFontRendererAdaptDirty = true; } -const std::string TextBMFont::getStringValue() +const std::string& TextBMFont::getString()const { return _stringValue; } + +ssize_t TextBMFont::getStringLength() +{ + return _labelBMFontRenderer->getStringLength(); +} void TextBMFont::onSizeChanged() { @@ -186,7 +191,7 @@ void TextBMFont::copySpecialProperties(Widget *widget) if (labelBMFont) { setFntFile(labelBMFont->_fntFileName); - setText(labelBMFont->_stringValue); + setString(labelBMFont->_stringValue); } } diff --git a/cocos/ui/UITextBMFont.h b/cocos/ui/UITextBMFont.h index 99fa26906f..03c3334555 100644 --- a/cocos/ui/UITextBMFont.h +++ b/cocos/ui/UITextBMFont.h @@ -62,10 +62,21 @@ public: void setFntFile(const std::string& fileName); /** set string value for labelbmfont*/ - void setText(const std::string& value); + CC_DEPRECATED_ATTRIBUTE void setText(const std::string& value){this->setString(value);} + void setString(const std::string& value); /** get string value for labelbmfont*/ - const std::string getStringValue(); + CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue()const{return this->getString();} + const std::string& getString()const; + + /** + * Gets the string length of the label. + * Note: This length will be larger than the raw string length, + * if you want to get the raw string length, you should call this->getString().size() instead + * + * @return string length. + */ + ssize_t getStringLength(); virtual const Size& getVirtualRendererSize() const override; virtual Node* getVirtualRenderer() override; From 09fce798f0504c17cecc61221d1fb7cdf6958ca3 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 16:14:28 +0800 Subject: [PATCH 062/125] closed #5110, add const reference to typedef --- cocos/ui/UICheckBox.cpp | 2 +- cocos/ui/UICheckBox.h | 2 +- cocos/ui/UIListView.cpp | 2 +- cocos/ui/UIListView.h | 2 +- cocos/ui/UIPageView.cpp | 2 +- cocos/ui/UIPageView.h | 2 +- cocos/ui/UIScrollView.cpp | 2 +- cocos/ui/UIScrollView.h | 2 +- cocos/ui/UISlider.cpp | 2 +- cocos/ui/UISlider.h | 2 +- cocos/ui/UIText.h | 7 ++++--- cocos/ui/UITextField.cpp | 2 +- cocos/ui/UITextField.h | 2 +- cocos/ui/UIWidget.cpp | 4 ---- cocos/ui/UIWidget.h | 5 ----- 15 files changed, 16 insertions(+), 24 deletions(-) diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 003b5623c9..9b59671e6b 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -386,7 +386,7 @@ void CheckBox::addEventListenerCheckBox(Ref *target, SEL_SelectedStateEvent sele _checkBoxEventSelector = selector; } -void CheckBox::addEventListener(ccCheckBoxCallback callback) +void CheckBox::addEventListener(const ccCheckBoxCallback& callback) { _checkBoxEventCallback = callback; } diff --git a/cocos/ui/UICheckBox.h b/cocos/ui/UICheckBox.h index f05d282ec9..bcfb68e628 100644 --- a/cocos/ui/UICheckBox.h +++ b/cocos/ui/UICheckBox.h @@ -174,7 +174,7 @@ public: //add a call back function would called when checkbox is selected or unselected. CC_DEPRECATED_ATTRIBUTE void addEventListenerCheckBox(Ref* target,SEL_SelectedStateEvent selector); - void addEventListener(ccCheckBoxCallback callback); + void addEventListener(const ccCheckBoxCallback& callback); //override "onTouchEnded" method of widget. virtual void onTouchEnded(Touch *touch, Event *unusedEvent); diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 18323fcbb6..dd3f8ee01a 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -409,7 +409,7 @@ void ListView::addEventListenerListView(Ref *target, SEL_ListViewEvent selector) _listViewEventSelector = selector; } -void ListView::addEventListener(ccListViewCallback callback) +void ListView::addEventListener(const ccListViewCallback& callback) { _eventCallback = callback; } diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index dc490026e5..8394c340ef 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -166,7 +166,7 @@ public: ssize_t getCurSelectedIndex() const; CC_DEPRECATED_ATTRIBUTE void addEventListenerListView(Ref* target, SEL_ListViewEvent selector); - void addEventListener(ccListViewCallback callback); + void addEventListener(const ccListViewCallback& callback); /** * Changes scroll direction of scrollview. diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index ef2173bb77..ae65a9036f 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -577,7 +577,7 @@ void PageView::addEventListenerPageView(Ref *target, SEL_PageViewEvent selector) _pageViewEventSelector = selector; } -void PageView::addEventListener(ccPageViewCallback callback) +void PageView::addEventListener(const ccPageViewCallback& callback) { _eventCallback = callback; } diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 4a007ed42d..8d6f9b4728 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -134,7 +134,7 @@ public: // event CC_DEPRECATED_ATTRIBUTE void addEventListenerPageView(Ref *target, SEL_PageViewEvent selector); - void addEventListener(ccPageViewCallback callback); + void addEventListener(const ccPageViewCallback& callback); diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 6a54a07c45..3d904cda8a 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -1655,7 +1655,7 @@ void ScrollView::addEventListenerScrollView(Ref *target, SEL_ScrollViewEvent sel _scrollViewEventSelector = selector; } -void ScrollView::addEventListener(ccScrollViewCallback callback) +void ScrollView::addEventListener(const ccScrollViewCallback& callback) { _eventCallback = callback; } diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index 62da6e45ee..96e68d9e7b 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -259,7 +259,7 @@ public: * Add call back function called scrollview event triggered */ CC_DEPRECATED_ATTRIBUTE void addEventListenerScrollView(Ref* target, SEL_ScrollViewEvent selector); - void addEventListener(ccScrollViewCallback callback); + void addEventListener(const ccScrollViewCallback& callback); virtual void addChild(Node * child) override; /** diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index e94e071e00..cc7c26d6ee 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -434,7 +434,7 @@ void Slider::addEventListenerSlider(Ref *target, SEL_SlidPercentChangedEvent sel _sliderEventSelector = selector; } -void Slider::addEventListener(ccSliderCallback callback) +void Slider::addEventListener(const ccSliderCallback& callback) { _eventCallback = callback; } diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index ab4b4fff29..3472266a8f 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -182,7 +182,7 @@ public: * Add call back function called when slider's percent has changed to slider. */ CC_DEPRECATED_ATTRIBUTE void addEventListenerSlider(Ref* target,SEL_SlidPercentChangedEvent selector); - void addEventListener(ccSliderCallback callback); + void addEventListener(const ccSliderCallback& callback); virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override; virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override; diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index ce5115ffa8..3b2690b3f0 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -32,9 +32,10 @@ NS_CC_BEGIN namespace ui { /** -* @js NA -* @lua NA -*/ + * For creating a system font or a TTF font Text + *@js + *@lua NA + */ class Text : public Widget { diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index fcffdd379c..e77e7f6420 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -742,7 +742,7 @@ void TextField::addEventListenerTextField(Ref *target, SEL_TextFieldEvent seleco _textFieldEventSelector = selecor; } -void TextField::addEventListener(ccTextFieldCallback callback) +void TextField::addEventListener(const ccTextFieldCallback& callback) { _eventCallback = callback; } diff --git a/cocos/ui/UITextField.h b/cocos/ui/UITextField.h index 58309551d4..1279304531 100644 --- a/cocos/ui/UITextField.h +++ b/cocos/ui/UITextField.h @@ -154,7 +154,7 @@ public: bool getDeleteBackward(); void setDeleteBackward(bool deleteBackward); CC_DEPRECATED_ATTRIBUTE void addEventListenerTextField(Ref* target, SEL_TextFieldEvent selecor); - void addEventListener(ccTextFieldCallback callback); + void addEventListener(const ccTextFieldCallback& callback); /** * Returns the "class name" of widget. diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index 7129ccdbf1..2c74761008 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -535,10 +535,6 @@ void Widget::onPressStateChangedToDisabled() } -void Widget::didNotSelectSelf() -{ - -} bool Widget::onTouchBegan(Touch *touch, Event *unusedEvent) { diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 7dce8f4e45..517adda8af 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -343,11 +343,6 @@ public: /** @deprecated Use setFlippedY() instead */ CC_DEPRECATED_ATTRIBUTE void setFlipY(bool flipY) { setFlippedY(flipY); }; - /** - * A call back function when widget lost of focus. - */ - void didNotSelectSelf(); - /* * Checks a point if in parent's area. * From 9d5c2ba773a65af13948f8bab919dcbc96c23550 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 16:25:30 +0800 Subject: [PATCH 063/125] closed #5110, add const specifier to getStringLength function --- cocos/ui/UIText.cpp | 2 +- cocos/ui/UIText.h | 2 +- cocos/ui/UITextAtlas.cpp | 2 +- cocos/ui/UITextAtlas.h | 2 +- cocos/ui/UITextBMFont.cpp | 2 +- cocos/ui/UITextBMFont.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index 77f7d18cf2..ba9806f12e 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -115,7 +115,7 @@ const std::string& Text::getString() const return _labelRenderer->getString(); } -ssize_t Text::getStringLength() +ssize_t Text::getStringLength()const { return _labelRenderer->getStringLength(); } diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 3b2690b3f0..408a93623a 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -87,7 +87,7 @@ public: * * @return string length. */ - ssize_t getStringLength(); + ssize_t getStringLength()const; /** * Sets the font size of label. diff --git a/cocos/ui/UITextAtlas.cpp b/cocos/ui/UITextAtlas.cpp index bce366478b..d249f4422b 100644 --- a/cocos/ui/UITextAtlas.cpp +++ b/cocos/ui/UITextAtlas.cpp @@ -114,7 +114,7 @@ const std::string& TextAtlas::getString() const return _labelAtlasRenderer->getString(); } -ssize_t TextAtlas::getStringLength() +ssize_t TextAtlas::getStringLength()const { return _labelAtlasRenderer->getStringLength(); } diff --git a/cocos/ui/UITextAtlas.h b/cocos/ui/UITextAtlas.h index 18942830bd..4ffa93f927 100644 --- a/cocos/ui/UITextAtlas.h +++ b/cocos/ui/UITextAtlas.h @@ -87,7 +87,7 @@ public: * * @return string length. */ - ssize_t getStringLength(); + ssize_t getStringLength()const; //override "getVirtualRendererSize" method of widget. virtual const Size& getVirtualRendererSize() const override; diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 28b6e050a5..f6769ee2dc 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -108,7 +108,7 @@ const std::string& TextBMFont::getString()const return _stringValue; } -ssize_t TextBMFont::getStringLength() +ssize_t TextBMFont::getStringLength()const { return _labelBMFontRenderer->getStringLength(); } diff --git a/cocos/ui/UITextBMFont.h b/cocos/ui/UITextBMFont.h index 03c3334555..5cca667916 100644 --- a/cocos/ui/UITextBMFont.h +++ b/cocos/ui/UITextBMFont.h @@ -76,7 +76,7 @@ public: * * @return string length. */ - ssize_t getStringLength(); + ssize_t getStringLength()const; virtual const Size& getVirtualRendererSize() const override; virtual Node* getVirtualRenderer() override; From 059ea3dd8a0ebf2fddc7c848d65b357dba43d377 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 14 May 2014 16:41:26 +0800 Subject: [PATCH 064/125] label's small improvement. --- cocos/2d/CCFontAtlas.cpp | 4 ++-- cocos/2d/CCLabel.cpp | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 0b98028855..fd3425c4fa 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -33,8 +33,8 @@ NS_CC_BEGIN -const int FontAtlas::CacheTextureWidth = 1024; -const int FontAtlas::CacheTextureHeight = 1024; +const int FontAtlas::CacheTextureWidth = 512; +const int FontAtlas::CacheTextureHeight = 512; const char* FontAtlas::EVENT_PURGE_TEXTURES = "__cc_FontAtlasPurgeTextures"; FontAtlas::FontAtlas(Font &theFont) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 7e990b7e28..e5a2e5863a 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -260,6 +260,7 @@ Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = Te , _shadowDirty(false) , _compatibleMode(false) , _insideBounds(true) +, _effectColorF(Color4F::BLACK) { setAnchorPoint(Vector2::ANCHOR_MIDDLE); reset(); @@ -426,6 +427,7 @@ bool Label::setTTFConfig(const TTFConfig& ttfConfig) reset(); return false; } + _systemFontDirty = false; _currentLabelType = LabelType::TTF; setFontAtlas(newAtlas,ttfConfig.distanceFieldEnabled,true); @@ -470,13 +472,16 @@ bool Label::setBMFontFilePath(const std::string& bmfontFilePath, const Vector2& void Label::setString(const std::string& text) { - _originalUTF8String = text; - _contentDirty = true; - - std::u16string utf16String; - if (StringUtils::UTF8ToUTF16(_originalUTF8String, utf16String)) + if (text.compare(_originalUTF8String)) { - _currentUTF16String = utf16String; + _originalUTF8String = text; + _contentDirty = true; + + std::u16string utf16String; + if (StringUtils::UTF8ToUTF16(_originalUTF8String, utf16String)) + { + _currentUTF16String = utf16String; + } } } From 6cb3b47488fe86ae1bce4cf79b5907f5bd0fc24f Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 14 May 2014 17:07:24 +0800 Subject: [PATCH 065/125] closed #5110, refactor --- cocos/ui/UILoadingBar.cpp | 2 +- cocos/ui/UILoadingBar.h | 2 +- .../CocoStudioGUITest/CocoStudioGUITest.cpp | 18 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 274 +++++++----------- 4 files changed, 113 insertions(+), 183 deletions(-) diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index 0b1571a98a..56e6f0b8ac 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -116,7 +116,7 @@ void LoadingBar::setDirection(cocos2d::ui::LoadingBar::Direction direction) } -LoadingBar::Direction LoadingBar::getDirection() +LoadingBar::Direction LoadingBar::getDirection()const { return _direction; } diff --git a/cocos/ui/UILoadingBar.h b/cocos/ui/UILoadingBar.h index 9c3467a648..b20c9d0c59 100644 --- a/cocos/ui/UILoadingBar.h +++ b/cocos/ui/UILoadingBar.h @@ -82,7 +82,7 @@ public: * * @return Direction */ - Direction getDirection(); + Direction getDirection()const; /** * Load texture for loadingbar. diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp index 019d9d5f3b..1a2a14b52e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp @@ -25,27 +25,27 @@ g_guisTests[] = "GUI Dynamic Create Test", [](Ref* sender) { - CocosGUITestScene *pScene = new CocosGUITestScene(); - pScene->runThisTest(); - pScene->release(); + CocosGUITestScene *scene = new CocosGUITestScene(); + scene->runThisTest(); + scene->release(); } }, { "GUI Editor Test", [](Ref* sender) { - GUIEditorTestScene* pScene = new GUIEditorTestScene(); - pScene->runThisTest(); - pScene->release(); + GUIEditorTestScene* scene = new GUIEditorTestScene(); + scene->runThisTest(); + scene->release(); } }, { "Custom GUI Test", [](Ref* sender) { - CustomGUITestScene* pScene = new CustomGUITestScene(); - pScene->runThisTest(); - pScene->release(); + CustomGUITestScene* scene = new CustomGUITestScene(); + scene->runThisTest(); + scene->release(); } }, }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 917d203beb..708adbc641 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -21,12 +21,12 @@ g_guisTests[] = "VideoPlayerTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIVideoPlayerTest); - pManager->setMinUISceneId(kUIVideoPlayerTest); - pManager->setMaxUISceneId(kUIVideoPlayerTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIVideoPlayerTest); + sceneManager->setMinUISceneId(kUIVideoPlayerTest); + sceneManager->setMaxUISceneId(kUIVideoPlayerTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, #endif @@ -34,12 +34,12 @@ g_guisTests[] = "focus test", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(KUIFocusTest_HBox); - pManager->setMinUISceneId(KUIFocusTest_HBox); - pManager->setMaxUISceneId(KUIFocusTest_NestedLayout3); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(KUIFocusTest_HBox); + sceneManager->setMinUISceneId(KUIFocusTest_HBox); + sceneManager->setMaxUISceneId(KUIFocusTest_NestedLayout3); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { @@ -47,250 +47,180 @@ g_guisTests[] = "ButtonTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIButtonTest); - pManager->setMinUISceneId(kUIButtonTest); - pManager->setMaxUISceneId(kUIButtonTest_Title); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIButtonTest); + sceneManager->setMinUISceneId(kUIButtonTest); + sceneManager->setMaxUISceneId(kUIButtonTest_Title); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "CheckBoxTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUICheckBoxTest); - pManager->setMinUISceneId(kUICheckBoxTest); - pManager->setMaxUISceneId(kUICheckBoxTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUICheckBoxTest); + sceneManager->setMinUISceneId(kUICheckBoxTest); + sceneManager->setMaxUISceneId(kUICheckBoxTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "SliderTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUISliderTest); - pManager->setMinUISceneId(kUISliderTest); - pManager->setMaxUISceneId(kUISliderTest_Scale9); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUISliderTest); + sceneManager->setMinUISceneId(kUISliderTest); + sceneManager->setMaxUISceneId(kUISliderTest_Scale9); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, - /* - { - "PotentiometerTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIPotentiometerTest); - pManager->setMinUISceneId(kUIPotentiometerTest); - pManager->setMaxUISceneId(kUIPotentiometerTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - }, - */ - /* - { - "SwitchTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUISwitchTest_Horizontal); - pManager->setMinUISceneId(kUISwitchTest_Horizontal); - pManager->setMaxUISceneId(kUISwitchTest_VerticalAndTitleVertical); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - }, - */ { "ImageViewTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIImageViewTest); - pManager->setMinUISceneId(kUIImageViewTest); - pManager->setMaxUISceneId(kUIImageViewTest_Scale9); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIImageViewTest); + sceneManager->setMinUISceneId(kUIImageViewTest); + sceneManager->setMaxUISceneId(kUIImageViewTest_Scale9); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "LoadingBarTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUILoadingBarTest_Left); - pManager->setMinUISceneId(kUILoadingBarTest_Left); - pManager->setMaxUISceneId(kUILoadingBarTest_Right_Scale9); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUILoadingBarTest_Left); + sceneManager->setMinUISceneId(kUILoadingBarTest_Left); + sceneManager->setMaxUISceneId(kUILoadingBarTest_Right_Scale9); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, - /* - { - "ProgressTimerTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIProgressTimerTest_Radial); - pManager->setMinUISceneId(kUIProgressTimerTest_Radial); - pManager->setMaxUISceneId(kUIProgressTimerTest_WithSpriteFrame); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - }, - */ { "TextAtalsTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUITextAtlasTest); - pManager->setMinUISceneId(kUITextAtlasTest); - pManager->setMaxUISceneId(kUITextAtlasTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUITextAtlasTest); + sceneManager->setMinUISceneId(kUITextAtlasTest); + sceneManager->setMaxUISceneId(kUITextAtlasTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "TextTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUITextTest); - pManager->setMinUISceneId(kUITextTest); - pManager->setMaxUISceneId(kUITextTest_TTF); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUITextTest); + sceneManager->setMinUISceneId(kUITextTest); + sceneManager->setMaxUISceneId(kUITextTest_TTF); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "TextBMFontTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUITextBMFontTest); - pManager->setMinUISceneId(kUITextBMFontTest); - pManager->setMaxUISceneId(kUITextBMFontTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUITextBMFontTest); + sceneManager->setMinUISceneId(kUITextBMFontTest); + sceneManager->setMaxUISceneId(kUITextBMFontTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "TextFieldTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUITextFieldTest); - pManager->setMinUISceneId(kUITextFieldTest); - pManager->setMaxUISceneId(kUITextFieldTest_LineWrap); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUITextFieldTest); + sceneManager->setMinUISceneId(kUITextFieldTest); + sceneManager->setMaxUISceneId(kUITextFieldTest_LineWrap); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "LayoutTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUILayoutTest); - pManager->setMinUISceneId(kUILayoutTest); - pManager->setMaxUISceneId(kUILayoutTest_Layout_Relative_Location); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUILayoutTest); + sceneManager->setMinUISceneId(kUILayoutTest); + sceneManager->setMaxUISceneId(kUILayoutTest_Layout_Relative_Location); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "ScrollViewTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIScrollViewTest_Vertical); - pManager->setMinUISceneId(kUIScrollViewTest_Vertical); - pManager->setMaxUISceneId(kUIScrollViewTest_ScrollToPercentBothDirection_Bounce); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIScrollViewTest_Vertical); + sceneManager->setMinUISceneId(kUIScrollViewTest_Vertical); + sceneManager->setMaxUISceneId(kUIScrollViewTest_ScrollToPercentBothDirection_Bounce); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "PageViewTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIPageViewTest); - pManager->setMinUISceneId(kUIPageViewTest); - pManager->setMaxUISceneId(kUIPageViewTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIPageViewTest); + sceneManager->setMinUISceneId(kUIPageViewTest); + sceneManager->setMaxUISceneId(kUIPageViewTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "ListViewTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIListViewTest_Vertical); - pManager->setMinUISceneId(kUIListViewTest_Vertical); - pManager->setMaxUISceneId(kUIListViewTest_Horizontal); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIListViewTest_Vertical); + sceneManager->setMinUISceneId(kUIListViewTest_Vertical); + sceneManager->setMaxUISceneId(kUIListViewTest_Horizontal); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, - /* - { - "GridViewTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIGridViewTest_Mode_Column); - pManager->setMinUISceneId(kUIGridViewTest_Mode_Column); - pManager->setMaxUISceneId(kUIGridViewTest_Mode_Row); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - }, - */ - /* - { - "PickerViewTest", - [](Ref* sender) - { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIPickerViewTest_Vertical); - pManager->setMinUISceneId(kUIPickerViewTest_Vertical); - pManager->setMaxUISceneId(kUIPickerViewTest_Horizontal); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); - } - }, - */ { "WidgetAddNodeTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIWidgetAddNodeTest); - pManager->setMinUISceneId(kUIWidgetAddNodeTest); - pManager->setMaxUISceneId(kUIWidgetAddNodeTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIWidgetAddNodeTest); + sceneManager->setMinUISceneId(kUIWidgetAddNodeTest); + sceneManager->setMaxUISceneId(kUIWidgetAddNodeTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, { "RichTextTest", [](Ref* sender) { - UISceneManager* pManager = UISceneManager::sharedUISceneManager(); - pManager->setCurrentUISceneId(kUIRichTextTest); - pManager->setMinUISceneId(kUIRichTextTest); - pManager->setMaxUISceneId(kUIRichTextTest); - Scene* pScene = pManager->currentUIScene(); - Director::getInstance()->replaceScene(pScene); + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIRichTextTest); + sceneManager->setMinUISceneId(kUIRichTextTest); + sceneManager->setMaxUISceneId(kUIRichTextTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); } }, From 6f6d233ea5768433641e7b268abd5efb7ad5aa0b Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 14 May 2014 09:52:20 +0000 Subject: [PATCH 066/125] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/LoadingBar.lua | 20 +- .../scripting/lua-bindings/auto/api/Text.lua | 4 +- .../lua-bindings/auto/api/TextAtlas.lua | 25 +- .../lua-bindings/auto/api/TextBMFont.lua | 11 +- .../lua-bindings/auto/api/Widget.lua | 4 - .../auto/lua_cocos2dx_ui_auto.cpp | 502 ++++++++++-------- .../auto/lua_cocos2dx_ui_auto.hpp | 1 + 7 files changed, 310 insertions(+), 257 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/LoadingBar.lua b/cocos/scripting/lua-bindings/auto/api/LoadingBar.lua index b4018d1515..077bdd2c8e 100644 --- a/cocos/scripting/lua-bindings/auto/api/LoadingBar.lua +++ b/cocos/scripting/lua-bindings/auto/api/LoadingBar.lua @@ -4,9 +4,9 @@ -- @extend Widget -------------------------------- --- @function [parent=#LoadingBar] setBarDirection +-- @function [parent=#LoadingBar] setPercent -- @param self --- @param #ccui.LoadingBar::Direction direction +-- @param #float float -------------------------------- -- @function [parent=#LoadingBar] loadTexture @@ -15,9 +15,9 @@ -- @param #ccui.Widget::TextureResType texturerestype -------------------------------- --- @function [parent=#LoadingBar] setPercent +-- @function [parent=#LoadingBar] setDirection -- @param self --- @param #float float +-- @param #ccui.LoadingBar::Direction direction -------------------------------- -- @function [parent=#LoadingBar] setScale9Enabled @@ -30,10 +30,15 @@ -- @param #rect_table rect -------------------------------- --- @function [parent=#LoadingBar] getBarDirection +-- @function [parent=#LoadingBar] getDirection -- @param self -- @return LoadingBar::Direction#LoadingBar::Direction ret (return value: ccui.LoadingBar::Direction) +-------------------------------- +-- @function [parent=#LoadingBar] getCapInsets +-- @param self +-- @return rect_table#rect_table ret (return value: rect_table) + -------------------------------- -- @function [parent=#LoadingBar] isScale9Enabled -- @param self @@ -44,11 +49,6 @@ -- @param self -- @return float#float ret (return value: float) --------------------------------- --- @function [parent=#LoadingBar] getCapInsets --- @param self --- @return rect_table#rect_table ret (return value: rect_table) - -------------------------------- -- overload function: create(string, float) -- diff --git a/cocos/scripting/lua-bindings/auto/api/Text.lua b/cocos/scripting/lua-bindings/auto/api/Text.lua index c1cb540796..c3fe348834 100644 --- a/cocos/scripting/lua-bindings/auto/api/Text.lua +++ b/cocos/scripting/lua-bindings/auto/api/Text.lua @@ -29,12 +29,12 @@ -- @return TextVAlignment#TextVAlignment ret (return value: cc.TextVAlignment) -------------------------------- --- @function [parent=#Text] getStringValue +-- @function [parent=#Text] getString -- @param self -- @return string#string ret (return value: string) -------------------------------- --- @function [parent=#Text] setText +-- @function [parent=#Text] setString -- @param self -- @param #string str diff --git a/cocos/scripting/lua-bindings/auto/api/TextAtlas.lua b/cocos/scripting/lua-bindings/auto/api/TextAtlas.lua index b1cba77fdf..8c5473e18d 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextAtlas.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextAtlas.lua @@ -3,6 +3,21 @@ -- @module TextAtlas -- @extend Widget +-------------------------------- +-- @function [parent=#TextAtlas] getStringLength +-- @param self +-- @return long#long ret (return value: long) + +-------------------------------- +-- @function [parent=#TextAtlas] getString +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#TextAtlas] setString +-- @param self +-- @param #string str + -------------------------------- -- @function [parent=#TextAtlas] setProperty -- @param self @@ -12,20 +27,10 @@ -- @param #int int -- @param #string str --------------------------------- --- @function [parent=#TextAtlas] getStringValue --- @param self --- @return string#string ret (return value: string) - -------------------------------- -- @function [parent=#TextAtlas] adaptRenderers -- @param self --------------------------------- --- @function [parent=#TextAtlas] setStringValue --- @param self --- @param #string str - -------------------------------- -- overload function: create(string, string, int, int, string) -- diff --git a/cocos/scripting/lua-bindings/auto/api/TextBMFont.lua b/cocos/scripting/lua-bindings/auto/api/TextBMFont.lua index c0fe477b96..bf954ed4fe 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextBMFont.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextBMFont.lua @@ -9,15 +9,20 @@ -- @param #string str -------------------------------- --- @function [parent=#TextBMFont] getStringValue +-- @function [parent=#TextBMFont] getStringLength -- @param self --- @return string#string ret (return value: string) +-- @return long#long ret (return value: long) -------------------------------- --- @function [parent=#TextBMFont] setText +-- @function [parent=#TextBMFont] setString -- @param self -- @param #string str +-------------------------------- +-- @function [parent=#TextBMFont] getString +-- @param self +-- @return string#string ret (return value: string) + -------------------------------- -- overload function: create(string, string) -- diff --git a/cocos/scripting/lua-bindings/auto/api/Widget.lua b/cocos/scripting/lua-bindings/auto/api/Widget.lua index 32b63d979f..b7d336bb91 100644 --- a/cocos/scripting/lua-bindings/auto/api/Widget.lua +++ b/cocos/scripting/lua-bindings/auto/api/Widget.lua @@ -127,10 +127,6 @@ -- @param self -- @return vector2_table#vector2_table ret (return value: vector2_table) --------------------------------- --- @function [parent=#Widget] didNotSelectSelf --- @param self - -------------------------------- -- @function [parent=#Widget] setFocused -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index ab138421dc..2baacc9523 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -1893,49 +1893,6 @@ int lua_cocos2dx_ui_Widget_getWorldPosition(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_Widget_didNotSelectSelf(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::Widget* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.Widget",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::Widget*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Widget_didNotSelectSelf'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->didNotSelectSelf(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "didNotSelectSelf",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Widget_didNotSelectSelf'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_Widget_setFocused(lua_State* tolua_S) { int argc = 0; @@ -3540,7 +3497,6 @@ int lua_register_cocos2dx_ui_Widget(lua_State* tolua_S) tolua_function(tolua_S,"isTouchEnabled",lua_cocos2dx_ui_Widget_isTouchEnabled); tolua_function(tolua_S,"getActionTag",lua_cocos2dx_ui_Widget_getActionTag); tolua_function(tolua_S,"getWorldPosition",lua_cocos2dx_ui_Widget_getWorldPosition); - tolua_function(tolua_S,"didNotSelectSelf",lua_cocos2dx_ui_Widget_didNotSelectSelf); tolua_function(tolua_S,"setFocused",lua_cocos2dx_ui_Widget_setFocused); tolua_function(tolua_S,"setTouchEnabled",lua_cocos2dx_ui_Widget_setTouchEnabled); tolua_function(tolua_S,"clone",lua_cocos2dx_ui_Widget_clone); @@ -7837,7 +7793,7 @@ int lua_cocos2dx_ui_Text_getTextVerticalAlignment(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_Text_getStringValue(lua_State* tolua_S) +int lua_cocos2dx_ui_Text_getString(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Text* cobj = nullptr; @@ -7857,7 +7813,7 @@ int lua_cocos2dx_ui_Text_getStringValue(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_getStringValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_getString'", nullptr); return 0; } #endif @@ -7867,21 +7823,21 @@ int lua_cocos2dx_ui_Text_getStringValue(lua_State* tolua_S) { if(!ok) return 0; - const std::string& ret = cobj->getStringValue(); + const std::string& ret = cobj->getString(); tolua_pushcppstring(tolua_S,ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStringValue",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getString",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_getStringValue'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_getString'.",&tolua_err); #endif return 0; } -int lua_cocos2dx_ui_Text_setText(lua_State* tolua_S) +int lua_cocos2dx_ui_Text_setString(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Text* cobj = nullptr; @@ -7901,7 +7857,7 @@ int lua_cocos2dx_ui_Text_setText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setText'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setString'", nullptr); return 0; } #endif @@ -7914,15 +7870,15 @@ int lua_cocos2dx_ui_Text_setText(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); if(!ok) return 0; - cobj->setText(arg0); + cobj->setString(arg0); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setText",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setString",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setText'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setString'.",&tolua_err); #endif return 0; @@ -8464,8 +8420,8 @@ int lua_register_cocos2dx_ui_Text(lua_State* tolua_S) tolua_function(tolua_S,"setTouchScaleChangeEnabled",lua_cocos2dx_ui_Text_setTouchScaleChangeEnabled); tolua_function(tolua_S,"getFontSize",lua_cocos2dx_ui_Text_getFontSize); tolua_function(tolua_S,"getTextVerticalAlignment",lua_cocos2dx_ui_Text_getTextVerticalAlignment); - tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_Text_getStringValue); - tolua_function(tolua_S,"setText",lua_cocos2dx_ui_Text_setText); + tolua_function(tolua_S,"getString",lua_cocos2dx_ui_Text_getString); + tolua_function(tolua_S,"setString",lua_cocos2dx_ui_Text_setString); tolua_function(tolua_S,"getTextHorizontalAlignment",lua_cocos2dx_ui_Text_getTextHorizontalAlignment); tolua_function(tolua_S,"setTextVerticalAlignment",lua_cocos2dx_ui_Text_setTextVerticalAlignment); tolua_function(tolua_S,"getTextAreaSize",lua_cocos2dx_ui_Text_getTextAreaSize); @@ -8485,6 +8441,140 @@ int lua_register_cocos2dx_ui_Text(lua_State* tolua_S) return 1; } +int lua_cocos2dx_ui_TextAtlas_getStringLength(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextAtlas* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_getStringLength'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getStringLength(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStringLength",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_getStringLength'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_TextAtlas_getString(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextAtlas* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_getString'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getString(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getString",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_getString'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_TextAtlas_setString(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextAtlas* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_setString'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setString(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setString",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_setString'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_TextAtlas_setProperty(lua_State* tolua_S) { int argc = 0; @@ -8543,50 +8633,6 @@ int lua_cocos2dx_ui_TextAtlas_setProperty(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextAtlas_getStringValue(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::TextAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_getStringValue'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const std::string& ret = cobj->getStringValue(); - tolua_pushcppstring(tolua_S,ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStringValue",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_getStringValue'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_TextAtlas_adaptRenderers(lua_State* tolua_S) { int argc = 0; @@ -8630,52 +8676,6 @@ int lua_cocos2dx_ui_TextAtlas_adaptRenderers(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextAtlas_setStringValue(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::TextAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_setStringValue'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - if(!ok) - return 0; - cobj->setStringValue(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setStringValue",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_setStringValue'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_TextAtlas_create(lua_State* tolua_S) { int argc = 0; @@ -8810,10 +8810,11 @@ int lua_register_cocos2dx_ui_TextAtlas(lua_State* tolua_S) tolua_cclass(tolua_S,"TextAtlas","ccui.TextAtlas","ccui.Widget",nullptr); tolua_beginmodule(tolua_S,"TextAtlas"); + tolua_function(tolua_S,"getStringLength",lua_cocos2dx_ui_TextAtlas_getStringLength); + tolua_function(tolua_S,"getString",lua_cocos2dx_ui_TextAtlas_getString); + tolua_function(tolua_S,"setString",lua_cocos2dx_ui_TextAtlas_setString); tolua_function(tolua_S,"setProperty",lua_cocos2dx_ui_TextAtlas_setProperty); - tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_TextAtlas_getStringValue); tolua_function(tolua_S,"adaptRenderers",lua_cocos2dx_ui_TextAtlas_adaptRenderers); - tolua_function(tolua_S,"setStringValue",lua_cocos2dx_ui_TextAtlas_setStringValue); tolua_function(tolua_S,"new",lua_cocos2dx_ui_TextAtlas_constructor); tolua_function(tolua_S,"create", lua_cocos2dx_ui_TextAtlas_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_TextAtlas_createInstance); @@ -8824,7 +8825,7 @@ int lua_register_cocos2dx_ui_TextAtlas(lua_State* tolua_S) return 1; } -int lua_cocos2dx_ui_LoadingBar_setBarDirection(lua_State* tolua_S) +int lua_cocos2dx_ui_LoadingBar_setPercent(lua_State* tolua_S) { int argc = 0; cocos2d::ui::LoadingBar* cobj = nullptr; @@ -8844,7 +8845,7 @@ int lua_cocos2dx_ui_LoadingBar_setBarDirection(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_setBarDirection'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_setPercent'", nullptr); return 0; } #endif @@ -8852,20 +8853,20 @@ int lua_cocos2dx_ui_LoadingBar_setBarDirection(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::ui::LoadingBar::Direction arg0; + double arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + ok &= luaval_to_number(tolua_S, 2,&arg0); if(!ok) return 0; - cobj->setBarDirection(arg0); + cobj->setPercent(arg0); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setBarDirection",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setPercent",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_setBarDirection'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_setPercent'.",&tolua_err); #endif return 0; @@ -8929,7 +8930,7 @@ int lua_cocos2dx_ui_LoadingBar_loadTexture(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_LoadingBar_setPercent(lua_State* tolua_S) +int lua_cocos2dx_ui_LoadingBar_setDirection(lua_State* tolua_S) { int argc = 0; cocos2d::ui::LoadingBar* cobj = nullptr; @@ -8949,7 +8950,7 @@ int lua_cocos2dx_ui_LoadingBar_setPercent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_setPercent'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_setDirection'", nullptr); return 0; } #endif @@ -8957,20 +8958,20 @@ int lua_cocos2dx_ui_LoadingBar_setPercent(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; + cocos2d::ui::LoadingBar::Direction arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0); + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); if(!ok) return 0; - cobj->setPercent(arg0); + cobj->setDirection(arg0); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setPercent",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setDirection",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_setPercent'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_setDirection'.",&tolua_err); #endif return 0; @@ -9067,7 +9068,7 @@ int lua_cocos2dx_ui_LoadingBar_setCapInsets(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_LoadingBar_getBarDirection(lua_State* tolua_S) +int lua_cocos2dx_ui_LoadingBar_getDirection(lua_State* tolua_S) { int argc = 0; cocos2d::ui::LoadingBar* cobj = nullptr; @@ -9087,7 +9088,7 @@ int lua_cocos2dx_ui_LoadingBar_getBarDirection(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_getBarDirection'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_getDirection'", nullptr); return 0; } #endif @@ -9097,16 +9098,60 @@ int lua_cocos2dx_ui_LoadingBar_getBarDirection(lua_State* tolua_S) { if(!ok) return 0; - int ret = (int)cobj->getBarDirection(); + int ret = (int)cobj->getDirection(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBarDirection",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDirection",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_getBarDirection'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_getDirection'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_LoadingBar_getCapInsets(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::LoadingBar* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.LoadingBar",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::LoadingBar*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_getCapInsets'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Rect& ret = cobj->getCapInsets(); + rect_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCapInsets",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_getCapInsets'.",&tolua_err); #endif return 0; @@ -9199,50 +9244,6 @@ int lua_cocos2dx_ui_LoadingBar_getPercent(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_LoadingBar_getCapInsets(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ui::LoadingBar* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccui.LoadingBar",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ui::LoadingBar*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_getCapInsets'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const cocos2d::Rect& ret = cobj->getCapInsets(); - rect_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCapInsets",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_getCapInsets'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_ui_LoadingBar_create(lua_State* tolua_S) { int argc = 0; @@ -9381,15 +9382,15 @@ int lua_register_cocos2dx_ui_LoadingBar(lua_State* tolua_S) tolua_cclass(tolua_S,"LoadingBar","ccui.LoadingBar","ccui.Widget",nullptr); tolua_beginmodule(tolua_S,"LoadingBar"); - tolua_function(tolua_S,"setBarDirection",lua_cocos2dx_ui_LoadingBar_setBarDirection); - tolua_function(tolua_S,"loadTexture",lua_cocos2dx_ui_LoadingBar_loadTexture); tolua_function(tolua_S,"setPercent",lua_cocos2dx_ui_LoadingBar_setPercent); + tolua_function(tolua_S,"loadTexture",lua_cocos2dx_ui_LoadingBar_loadTexture); + tolua_function(tolua_S,"setDirection",lua_cocos2dx_ui_LoadingBar_setDirection); tolua_function(tolua_S,"setScale9Enabled",lua_cocos2dx_ui_LoadingBar_setScale9Enabled); tolua_function(tolua_S,"setCapInsets",lua_cocos2dx_ui_LoadingBar_setCapInsets); - tolua_function(tolua_S,"getBarDirection",lua_cocos2dx_ui_LoadingBar_getBarDirection); + tolua_function(tolua_S,"getDirection",lua_cocos2dx_ui_LoadingBar_getDirection); + tolua_function(tolua_S,"getCapInsets",lua_cocos2dx_ui_LoadingBar_getCapInsets); tolua_function(tolua_S,"isScale9Enabled",lua_cocos2dx_ui_LoadingBar_isScale9Enabled); tolua_function(tolua_S,"getPercent",lua_cocos2dx_ui_LoadingBar_getPercent); - tolua_function(tolua_S,"getCapInsets",lua_cocos2dx_ui_LoadingBar_getCapInsets); tolua_function(tolua_S,"new",lua_cocos2dx_ui_LoadingBar_constructor); tolua_function(tolua_S,"create", lua_cocos2dx_ui_LoadingBar_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_LoadingBar_createInstance); @@ -14697,7 +14698,7 @@ int lua_cocos2dx_ui_TextBMFont_setFntFile(lua_State* tolua_S) return 0; } -int lua_cocos2dx_ui_TextBMFont_getStringValue(lua_State* tolua_S) +int lua_cocos2dx_ui_TextBMFont_getStringLength(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextBMFont* cobj = nullptr; @@ -14717,7 +14718,7 @@ int lua_cocos2dx_ui_TextBMFont_getStringValue(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_getStringValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_getStringLength'", nullptr); return 0; } #endif @@ -14727,21 +14728,21 @@ int lua_cocos2dx_ui_TextBMFont_getStringValue(lua_State* tolua_S) { if(!ok) return 0; - const std::string ret = cobj->getStringValue(); - tolua_pushcppstring(tolua_S,ret); + ssize_t ret = cobj->getStringLength(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStringValue",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStringLength",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_getStringValue'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_getStringLength'.",&tolua_err); #endif return 0; } -int lua_cocos2dx_ui_TextBMFont_setText(lua_State* tolua_S) +int lua_cocos2dx_ui_TextBMFont_setString(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextBMFont* cobj = nullptr; @@ -14761,7 +14762,7 @@ int lua_cocos2dx_ui_TextBMFont_setText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_setText'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_setString'", nullptr); return 0; } #endif @@ -14774,15 +14775,59 @@ int lua_cocos2dx_ui_TextBMFont_setText(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); if(!ok) return 0; - cobj->setText(arg0); + cobj->setString(arg0); return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setText",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setString",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_setText'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_setString'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ui_TextBMFont_getString(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::TextBMFont* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.TextBMFont",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::TextBMFont*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_getString'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getString(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getString",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_getString'.",&tolua_err); #endif return 0; @@ -14913,8 +14958,9 @@ int lua_register_cocos2dx_ui_TextBMFont(lua_State* tolua_S) tolua_beginmodule(tolua_S,"TextBMFont"); tolua_function(tolua_S,"setFntFile",lua_cocos2dx_ui_TextBMFont_setFntFile); - tolua_function(tolua_S,"getStringValue",lua_cocos2dx_ui_TextBMFont_getStringValue); - tolua_function(tolua_S,"setText",lua_cocos2dx_ui_TextBMFont_setText); + tolua_function(tolua_S,"getStringLength",lua_cocos2dx_ui_TextBMFont_getStringLength); + tolua_function(tolua_S,"setString",lua_cocos2dx_ui_TextBMFont_setString); + tolua_function(tolua_S,"getString",lua_cocos2dx_ui_TextBMFont_getString); tolua_function(tolua_S,"new",lua_cocos2dx_ui_TextBMFont_constructor); tolua_function(tolua_S,"create", lua_cocos2dx_ui_TextBMFont_create); tolua_function(tolua_S,"createInstance", lua_cocos2dx_ui_TextBMFont_createInstance); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index a9c37dc9c1..35d7fbf2cc 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -383,6 +383,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ From 76cd9911cbf6f6ccecd0769ed90ac6b387a51741 Mon Sep 17 00:00:00 2001 From: "byeonggee.seo" Date: Wed, 14 May 2014 18:58:55 +0900 Subject: [PATCH 067/125] bug fix --- cocos/base/CCEventDispatcher.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index 8eff6c0581..4ddd3599ca 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -292,6 +292,14 @@ void EventDispatcher::pauseEventListenersForTarget(Node* target, bool recursive/ l->setPaused(true); } } + + for (auto addedListenerIter : _toAddedListeners) + { + if (addedListenerIter->getAssociatedNode() == target) + { + addedListenerIter->setPaused(true); + } + } if (recursive) { @@ -314,6 +322,15 @@ void EventDispatcher::resumeEventListenersForTarget(Node* target, bool recursive l->setPaused(false); } } + + for (auto addedListenerIter : _toAddedListeners) + { + if (addedListenerIter->getAssociatedNode() == target) + { + addedListenerIter->setPaused(false); + } + } + setDirtyForNode(target); if (recursive) From a1f1b2f3a1dbe0283f8253474cdadd2b242c1231 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Wed, 14 May 2014 18:47:58 +0800 Subject: [PATCH 068/125] [ci skip],for stupid error in equal (backup_files = current_files = range(1)) --- tools/jenkins-scripts/pull-request-builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 7a5efdd10b..2719d45f63 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -36,7 +36,8 @@ def check_current_3rd_libs(branch): config_file_paths = ['external/config.json','templates/lua-template-runtime/runtime/config.json'] if (branch == 'v2'): config_file_paths = ['external/config.json'] - backup_files = current_files = range(1) + backup_files = range(1) + current_files = range(1) for i, config_file_path in enumerate(config_file_paths): if not os.path.isfile(config_file_path): raise Exception("Could not find 'external/config.json'") From dc711643cd0e7f86dad48515fb64280af3e26914 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 14 May 2014 10:07:09 -0700 Subject: [PATCH 069/125] Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2 --- cocos/2d/CCAction.cpp | 6 +- cocos/2d/CCAction.h | 4 +- cocos/2d/CCActionCamera.cpp | 32 +- cocos/2d/CCActionCamera.h | 18 +- cocos/2d/CCActionCatmullRom.cpp | 90 +-- cocos/2d/CCActionCatmullRom.h | 26 +- cocos/2d/CCActionGrid.cpp | 12 +- cocos/2d/CCActionGrid.h | 20 +- cocos/2d/CCActionGrid3D.cpp | 108 ++-- cocos/2d/CCActionGrid3D.h | 30 +- cocos/2d/CCActionInstant.cpp | 4 +- cocos/2d/CCActionInstant.h | 6 +- cocos/2d/CCActionInterval.cpp | 50 +- cocos/2d/CCActionInterval.h | 46 +- cocos/2d/CCActionPageTurn3D.cpp | 4 +- cocos/2d/CCActionTiledGrid.cpp | 74 +-- cocos/2d/CCActionTiledGrid.h | 14 +- cocos/2d/CCAtlasNode.cpp | 2 +- cocos/2d/CCAtlasNode.h | 2 +- cocos/2d/CCClippingNode.cpp | 8 +- cocos/2d/CCClippingNode.h | 2 +- cocos/2d/CCDrawNode.cpp | 152 ++--- cocos/2d/CCDrawNode.h | 16 +- cocos/2d/CCDrawingPrimitives.cpp | 96 ++-- cocos/2d/CCDrawingPrimitives.h | 28 +- cocos/2d/CCFontAtlasCache.cpp | 2 +- cocos/2d/CCFontAtlasCache.h | 2 +- cocos/2d/CCFontFNT.cpp | 4 +- cocos/2d/CCFontFNT.h | 6 +- cocos/2d/CCGrid.cpp | 58 +- cocos/2d/CCGrid.h | 26 +- cocos/2d/CCLabel.cpp | 28 +- cocos/2d/CCLabel.h | 16 +- cocos/2d/CCLabelAtlas.cpp | 14 +- cocos/2d/CCLabelAtlas.h | 4 +- cocos/2d/CCLabelBMFont.cpp | 24 +- cocos/2d/CCLabelBMFont.h | 10 +- cocos/2d/CCLabelTTF.cpp | 6 +- cocos/2d/CCLabelTTF.h | 2 +- cocos/2d/CCLabelTextFormatter.cpp | 2 +- cocos/2d/CCLayer.cpp | 26 +- cocos/2d/CCLayer.h | 18 +- cocos/2d/CCMenu.cpp | 18 +- cocos/2d/CCMenuItem.cpp | 12 +- cocos/2d/CCMotionStreak.cpp | 22 +- cocos/2d/CCMotionStreak.h | 14 +- cocos/2d/CCNode.cpp | 140 ++--- cocos/2d/CCNode.h | 92 +-- cocos/2d/CCNodeGrid.cpp | 4 +- cocos/2d/CCNodeGrid.h | 2 +- cocos/2d/CCParallaxNode.cpp | 36 +- cocos/2d/CCParallaxNode.h | 8 +- cocos/2d/CCParticleBatchNode.cpp | 6 +- cocos/2d/CCParticleBatchNode.h | 4 +- cocos/2d/CCParticleExamples.cpp | 64 +-- cocos/2d/CCParticleSystem.cpp | 30 +- cocos/2d/CCParticleSystem.h | 28 +- cocos/2d/CCParticleSystemQuad.cpp | 6 +- cocos/2d/CCParticleSystemQuad.h | 4 +- cocos/2d/CCProgressTimer.cpp | 110 ++-- cocos/2d/CCProgressTimer.h | 34 +- cocos/2d/CCRenderTexture.cpp | 18 +- cocos/2d/CCRenderTexture.h | 10 +- cocos/2d/CCScene.cpp | 2 +- cocos/2d/CCSprite.cpp | 56 +- cocos/2d/CCSprite.h | 14 +- cocos/2d/CCSpriteBatchNode.cpp | 6 +- cocos/2d/CCSpriteBatchNode.h | 4 +- cocos/2d/CCSpriteFrame.cpp | 20 +- cocos/2d/CCSpriteFrame.h | 20 +- cocos/2d/CCSpriteFrameCache.cpp | 6 +- cocos/2d/CCTMXLayer.cpp | 60 +- cocos/2d/CCTMXLayer.h | 38 +- cocos/2d/CCTMXObjectGroup.cpp | 2 +- cocos/2d/CCTMXObjectGroup.h | 6 +- cocos/2d/CCTMXXMLParser.cpp | 8 +- cocos/2d/CCTMXXMLParser.h | 2 +- cocos/2d/CCTextFieldTTF.cpp | 2 +- cocos/2d/CCTextFieldTTF.h | 4 +- cocos/2d/CCTexture2D.cpp | 2 +- cocos/2d/CCTexture2D.h | 2 +- cocos/2d/CCTileMapAtlas.cpp | 8 +- cocos/2d/CCTileMapAtlas.h | 8 +- cocos/2d/CCTransition.cpp | 68 +-- cocos/2d/CCTransition.h | 10 +- cocos/2d/CCTransitionPageTurn.cpp | 2 +- cocos/2d/CCTransitionPageTurn.h | 2 +- cocos/2d/CCTransitionProgress.cpp | 46 +- cocos/2d/CCVertex.cpp | 28 +- cocos/2d/CCVertex.h | 2 +- cocos/2d/platform/CCGLViewProtocol.cpp | 6 +- cocos/2d/platform/CCGLViewProtocol.h | 2 +- cocos/2d/platform/desktop/CCGLView.cpp | 2 +- cocos/2d/platform/winrt/CCGLView.cpp | 18 +- cocos/2d/platform/winrt/CCGLView.h | 2 +- cocos/2d/platform/wp8/CCGLView.cpp | 22 +- cocos/2d/platform/wp8/CCGLView.h | 4 +- cocos/2d/platform/wp8/Direct3DBase.cpp | 12 +- cocos/2d/platform/wp8/Direct3DBase.h | 2 +- cocos/base/CCDirector.cpp | 76 +-- cocos/base/CCDirector.h | 19 +- cocos/base/CCNS.cpp | 6 +- cocos/base/CCNS.h | 4 +- cocos/base/CCTouch.cpp | 14 +- cocos/base/CCTouch.h | 20 +- cocos/base/ccConfig.h | 2 +- cocos/base/ccMacros.h | 4 +- cocos/base/ccTypes.h | 38 +- cocos/deprecated/CCDeprecated.cpp | 216 +++---- cocos/deprecated/CCDeprecated.h | 336 +++++------ .../cocosbuilder/CCBAnimationManager.cpp | 4 +- .../cocosbuilder/CCControlButtonLoader.cpp | 2 +- .../cocosbuilder/CCControlButtonLoader.h | 2 +- .../cocosbuilder/CCLayerGradientLoader.cpp | 2 +- .../cocosbuilder/CCLayerGradientLoader.h | 2 +- .../CCNode+CCBRelativePositioning.cpp | 4 +- .../CCNode+CCBRelativePositioning.h | 2 +- .../cocosbuilder/CCNodeLoader.cpp | 24 +- .../cocosbuilder/CCNodeLoader.h | 12 +- .../CCParticleSystemQuadLoader.cpp | 2 +- .../cocosbuilder/CCParticleSystemQuadLoader.h | 2 +- .../cocosbuilder/CCScale9SpriteLoader.h | 2 +- .../cocostudio/CCActionFrame.cpp | 6 +- .../editor-support/cocostudio/CCActionFrame.h | 6 +- .../cocostudio/CCActionNode.cpp | 2 +- .../editor-support/cocostudio/CCArmature.cpp | 26 +- cocos/editor-support/cocostudio/CCArmature.h | 14 +- .../editor-support/cocostudio/CCBatchNode.cpp | 6 +- cocos/editor-support/cocostudio/CCBatchNode.h | 4 +- cocos/editor-support/cocostudio/CCBone.cpp | 6 +- cocos/editor-support/cocostudio/CCBone.h | 6 +- .../cocostudio/CCColliderDetector.cpp | 12 +- .../cocostudio/CCColliderDetector.h | 6 +- .../editor-support/cocostudio/CCComRender.cpp | 2 +- .../cocostudio/CCDataReaderHelper.cpp | 4 +- cocos/editor-support/cocostudio/CCDatas.cpp | 2 +- cocos/editor-support/cocostudio/CCDatas.h | 4 +- .../cocostudio/CCDisplayFactory.cpp | 10 +- .../cocostudio/CCDisplayManager.cpp | 14 +- .../cocostudio/CCDisplayManager.h | 6 +- .../cocostudio/CCSGUIReader.cpp | 18 +- .../cocostudio/CCSSceneReader.cpp | 2 +- cocos/editor-support/cocostudio/CCSkin.cpp | 18 +- cocos/editor-support/cocostudio/CCSkin.h | 8 +- .../cocostudio/CCTransformHelp.cpp | 10 +- .../cocostudio/CCTransformHelp.h | 8 +- .../editor-support/cocostudio/CCUtilMath.cpp | 18 +- cocos/editor-support/cocostudio/CCUtilMath.h | 10 +- .../LayoutReader/LayoutReader.cpp | 2 +- .../cocostudio/WidgetReader/WidgetReader.cpp | 8 +- cocos/editor-support/spine/CCSkeleton.cpp | 20 +- cocos/editor-support/spine/CCSkeleton.h | 4 +- cocos/math/CCAffineTransform.cpp | 30 +- cocos/math/CCAffineTransform.h | 8 +- cocos/math/CCGeometry.cpp | 8 +- cocos/math/CCGeometry.h | 12 +- cocos/math/MathUtil.h | 10 +- cocos/math/MathUtil.inl | 6 +- cocos/math/MathUtilNeon.inl | 6 +- cocos/math/Matrix.cpp | 252 ++++----- cocos/math/Matrix.h | 182 +++--- cocos/math/Matrix.inl | 34 +- cocos/math/Quaternion.cpp | 16 +- cocos/math/Quaternion.h | 18 +- cocos/math/Vector2.cpp | 138 ++--- cocos/math/Vector2.h | 231 ++++---- cocos/math/Vector2.inl | 36 +- cocos/math/Vector3.cpp | 84 +-- cocos/math/Vector3.h | 108 ++-- cocos/math/Vector3.inl | 36 +- cocos/math/Vector4.cpp | 76 +-- cocos/math/Vector4.h | 104 ++-- cocos/math/Vector4.inl | 36 +- cocos/physics/CCPhysicsBody.cpp | 46 +- cocos/physics/CCPhysicsBody.h | 42 +- cocos/physics/CCPhysicsContact.cpp | 6 +- cocos/physics/CCPhysicsContact.h | 10 +- cocos/physics/CCPhysicsJoint.cpp | 54 +- cocos/physics/CCPhysicsJoint.h | 54 +- cocos/physics/CCPhysicsShape.cpp | 78 +-- cocos/physics/CCPhysicsShape.h | 88 +-- cocos/physics/CCPhysicsWorld.cpp | 26 +- cocos/physics/CCPhysicsWorld.h | 16 +- .../chipmunk/CCPhysicsHelper_chipmunk.h | 8 +- .../chipmunk/CCPhysicsWorldInfo_chipmunk.h | 2 +- cocos/renderer/CCBatchCommand.cpp | 2 +- cocos/renderer/CCBatchCommand.h | 4 +- cocos/renderer/CCGLProgram.cpp | 8 +- cocos/renderer/CCGLProgram.h | 2 +- cocos/renderer/CCGLProgramState.cpp | 18 +- cocos/renderer/CCGLProgramState.h | 18 +- cocos/renderer/CCQuadCommand.cpp | 2 +- cocos/renderer/CCQuadCommand.h | 6 +- cocos/renderer/CCRenderer.cpp | 14 +- cocos/renderer/CCRenderer.h | 4 +- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 284 +++++----- .../auto/lua_cocos2dx_extension_auto.cpp | 58 +- .../auto/lua_cocos2dx_physics_auto.cpp | 158 +++--- .../auto/lua_cocos2dx_spine_auto.cpp | 2 +- .../auto/lua_cocos2dx_studio_auto.cpp | 12 +- .../auto/lua_cocos2dx_ui_auto.cpp | 34 +- .../lua-bindings/manual/CCLuaEngine.cpp | 4 +- .../manual/LuaBasicConversions.cpp | 18 +- .../lua-bindings/manual/LuaBasicConversions.h | 30 +- .../lua-bindings/manual/LuaOpengl.cpp | 46 +- .../scripting/lua-bindings/manual/LuaOpengl.h | 4 +- .../manual/lua_cocos2dx_manual.cpp | 16 +- .../manual/lua_cocos2dx_physics_manual.cpp | 74 +-- cocos/ui/CCProtectedNode.cpp | 4 +- cocos/ui/CCProtectedNode.h | 2 +- cocos/ui/UIButton.cpp | 4 +- cocos/ui/UICheckBox.cpp | 10 +- cocos/ui/UILayout.cpp | 82 +-- cocos/ui/UILayout.h | 14 +- cocos/ui/UIListView.cpp | 2 +- cocos/ui/UIListView.h | 2 +- cocos/ui/UILoadingBar.cpp | 18 +- cocos/ui/UIPageView.cpp | 28 +- cocos/ui/UIPageView.h | 12 +- cocos/ui/UIRichText.cpp | 14 +- cocos/ui/UIRichText.h | 4 +- cocos/ui/UIScrollInterface.h | 8 +- cocos/ui/UIScrollView.cpp | 128 ++--- cocos/ui/UIScrollView.h | 36 +- cocos/ui/UISlider.cpp | 14 +- cocos/ui/UISlider.h | 2 +- cocos/ui/UITextField.cpp | 4 +- cocos/ui/UITextField.h | 2 +- cocos/ui/UIVideoPlayer.h | 2 +- cocos/ui/UIVideoPlayerIOS.mm | 6 +- cocos/ui/UIWidget.cpp | 62 +-- cocos/ui/UIWidget.h | 42 +- .../GUI/CCControlExtension/CCControl.cpp | 6 +- extensions/GUI/CCControlExtension/CCControl.h | 2 +- .../CCControlExtension/CCControlButton.cpp | 20 +- .../GUI/CCControlExtension/CCControlButton.h | 2 +- .../CCControlColourPicker.cpp | 8 +- .../CCControlExtension/CCControlHuePicker.cpp | 20 +- .../CCControlExtension/CCControlHuePicker.h | 10 +- .../CCControlPotentiometer.cpp | 22 +- .../CCControlPotentiometer.h | 18 +- .../CCControlSaturationBrightnessPicker.cpp | 22 +- .../CCControlSaturationBrightnessPicker.h | 10 +- .../CCControlExtension/CCControlSlider.cpp | 34 +- .../GUI/CCControlExtension/CCControlSlider.h | 10 +- .../CCControlExtension/CCControlStepper.cpp | 20 +- .../GUI/CCControlExtension/CCControlStepper.h | 2 +- .../CCControlExtension/CCControlSwitch.cpp | 34 +- .../GUI/CCControlExtension/CCControlSwitch.h | 2 +- .../GUI/CCControlExtension/CCControlUtils.cpp | 4 +- .../GUI/CCControlExtension/CCControlUtils.h | 2 +- .../GUI/CCControlExtension/CCScale9Sprite.cpp | 40 +- .../GUI/CCControlExtension/CCScale9Sprite.h | 2 +- extensions/GUI/CCEditBox/CCEditBox.cpp | 8 +- extensions/GUI/CCEditBox/CCEditBox.h | 6 +- extensions/GUI/CCEditBox/CCEditBoxImpl.h | 4 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.cpp | 12 +- .../GUI/CCEditBox/CCEditBoxImplAndroid.h | 4 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.h | 8 +- extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm | 22 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 10 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.mm | 14 +- extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp | 12 +- extensions/GUI/CCEditBox/CCEditBoxImplWin.h | 4 +- extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp | 12 +- extensions/GUI/CCEditBox/CCEditBoxImplWp8.h | 4 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 64 +-- extensions/GUI/CCScrollView/CCScrollView.h | 22 +- extensions/GUI/CCScrollView/CCTableView.cpp | 26 +- extensions/GUI/CCScrollView/CCTableView.h | 8 +- .../physics-nodes/CCPhysicsDebugNode.cpp | 12 +- extensions/physics-nodes/CCPhysicsDebugNode.h | 2 +- extensions/physics-nodes/CCPhysicsSprite.cpp | 20 +- extensions/physics-nodes/CCPhysicsSprite.h | 10 +- .../Classes/HelloWorldScene.cpp | 8 +- .../AccelerometerTest/AccelerometerTest.cpp | 4 +- .../ActionManagerTest/ActionManagerTest.cpp | 12 +- .../ActionsEaseTest/ActionsEaseTest.cpp | 84 +-- .../ActionsProgressTest.cpp | 90 +-- .../Classes/ActionsTest/ActionsTest.cpp | 358 ++++++------ .../Classes/ActionsTest/ActionsTest.h | 38 +- tests/cpp-tests/Classes/BaseTest.cpp | 12 +- .../cpp-tests/Classes/Box2DTest/Box2dTest.cpp | 14 +- tests/cpp-tests/Classes/Box2DTest/Box2dTest.h | 6 +- .../Classes/Box2DTestBed/Box2dView.cpp | 20 +- .../Classes/Box2DTestBed/Box2dView.h | 4 +- tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp | 14 +- tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp | 36 +- tests/cpp-tests/Classes/BugsTest/Bug-350.cpp | 2 +- tests/cpp-tests/Classes/BugsTest/Bug-422.cpp | 2 +- .../Classes/BugsTest/Bug-458/Bug-458.cpp | 2 +- .../Bug-458/QuestionContainerSprite.cpp | 18 +- tests/cpp-tests/Classes/BugsTest/Bug-624.cpp | 4 +- tests/cpp-tests/Classes/BugsTest/Bug-886.cpp | 8 +- tests/cpp-tests/Classes/BugsTest/Bug-899.cpp | 2 +- tests/cpp-tests/Classes/BugsTest/Bug-914.cpp | 8 +- tests/cpp-tests/Classes/BugsTest/BugsTest.cpp | 14 +- tests/cpp-tests/Classes/BugsTest/BugsTest.h | 2 +- .../Classes/ChipmunkTest/ChipmunkTest.cpp | 14 +- .../Classes/ChipmunkTest/ChipmunkTest.h | 2 +- .../ClickAndMoveTest/ClickAndMoveTest.cpp | 6 +- .../ClippingNodeTest/ClippingNodeTest.cpp | 84 +-- .../ClippingNodeTest/ClippingNodeTest.h | 10 +- .../CocosDenshionTest/CocosDenshionTest.cpp | 10 +- tests/cpp-tests/Classes/CurlTest/CurlTest.cpp | 2 +- .../CurrentLanguageTest.cpp | 2 +- .../DataVisitorTest/DataVisitorTest.cpp | 14 +- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 48 +- .../DrawPrimitivesTest/DrawPrimitivesTest.h | 4 +- .../EffectsAdvancedTest.cpp | 24 +- .../Classes/EffectsTest/EffectsTest.cpp | 14 +- .../CocoStudioArmatureTest/ArmatureScene.cpp | 96 ++-- .../CocoStudioArmatureTest/ArmatureScene.h | 12 +- .../ComponentsTestScene.cpp | 6 +- .../EnemyController.cpp | 4 +- .../GameOverScene.cpp | 6 +- .../PlayerController.cpp | 2 +- .../ProjectileController.cpp | 4 +- .../CocoStudioSceneTest/SceneEditorTest.cpp | 24 +- .../CocoStudioSceneTest/SceneEditorTest.h | 2 +- .../CocoStudioSceneTest/TriggerCode/acts.h | 12 +- .../CocoStudioSceneTest/TriggerCode/cons.h | 2 +- .../CCControlButtonTest.cpp | 30 +- .../CCControlColourPickerTest.cpp | 8 +- .../CCControlPotentiometerTest.cpp | 8 +- .../ControlExtensionTest/CCControlScene.cpp | 16 +- .../CCControlSliderTest.cpp | 12 +- .../CCControlStepperTest.cpp | 8 +- .../CCControlSwitchTest.cpp | 8 +- .../EditBoxTest/EditBoxTest.cpp | 18 +- .../Classes/ExtensionsTest/ExtensionsTest.cpp | 18 +- .../Classes/ExtensionsTest/ExtensionsTest.h | 2 +- .../NetworkTest/HttpClientTest.cpp | 20 +- .../NetworkTest/SocketIOTest.cpp | 28 +- .../NetworkTest/WebSocketTest.cpp | 24 +- .../NotificationCenterTest.cpp | 12 +- .../Scale9SpriteTest/Scale9SpriteTest.cpp | 30 +- .../TableViewTest/CustomTableViewCell.cpp | 12 +- .../TableViewTest/CustomTableViewCell.h | 2 +- .../TableViewTest/TableViewTestScene.cpp | 16 +- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 8 +- tests/cpp-tests/Classes/FontTest/FontTest.cpp | 22 +- .../cpp-tests/Classes/InputTest/MouseTest.cpp | 6 +- .../Classes/IntervalTest/IntervalTest.cpp | 18 +- .../Classes/KeyboardTest/KeyboardTest.cpp | 4 +- .../Classes/KeypadTest/KeypadTest.cpp | 4 +- .../cpp-tests/Classes/LabelTest/LabelTest.cpp | 208 +++---- tests/cpp-tests/Classes/LabelTest/LabelTest.h | 12 +- .../Classes/LabelTest/LabelTestNew.cpp | 228 ++++---- .../Classes/LabelTest/LabelTestNew.h | 12 +- .../cpp-tests/Classes/LayerTest/LayerTest.cpp | 104 ++-- tests/cpp-tests/Classes/LayerTest/LayerTest.h | 2 +- tests/cpp-tests/Classes/MenuTest/MenuTest.cpp | 36 +- tests/cpp-tests/Classes/MenuTest/MenuTest.h | 2 +- .../MotionStreakTest/MotionStreakTest.cpp | 16 +- .../MotionStreakTest/MotionStreakTest.h | 2 +- .../Classes/MutiTouchTest/MutiTouchTest.cpp | 14 +- .../NewEventDispatcherTest.cpp | 156 +++--- .../NewEventDispatcherTest.h | 4 +- .../NewRendererTest/NewRendererTest.cpp | 46 +- .../Classes/NewRendererTest/NewRendererTest.h | 6 +- tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 106 ++-- .../Classes/ParallaxTest/ParallaxTest.cpp | 34 +- .../Classes/ParallaxTest/ParallaxTest.h | 2 +- .../Classes/ParticleTest/ParticleTest.cpp | 100 ++-- .../PerformanceTest/PerformanceAllocTest.cpp | 8 +- .../PerformanceCallbackTest.cpp | 4 +- .../PerformanceContainerTest.cpp | 20 +- .../PerformanceEventDispatcherTest.cpp | 20 +- .../PerformanceTest/PerformanceLabelTest.cpp | 20 +- .../PerformanceNodeChildrenTest.cpp | 14 +- .../PerformanceParticleTest.cpp | 42 +- .../PerformanceRendererTest.cpp | 4 +- .../PerformanceScenarioTest.cpp | 34 +- .../PerformanceTest/PerformanceSpriteTest.cpp | 32 +- .../PerformanceTest/PerformanceTest.cpp | 26 +- .../Classes/PerformanceTest/PerformanceTest.h | 4 +- .../PerformanceTextureTest.cpp | 4 +- .../PerformanceTouchesTest.cpp | 8 +- .../Classes/PhysicsTest/PhysicsTest.cpp | 238 ++++---- .../Classes/PhysicsTest/PhysicsTest.h | 10 +- .../ReleasePoolTest/ReleasePoolTest.cpp | 2 +- .../RenderTextureTest/RenderTextureTest.cpp | 52 +- .../RenderTextureTest/RenderTextureTest.h | 6 +- .../RotateWorldTest/RotateWorldTest.cpp | 20 +- .../cpp-tests/Classes/SceneTest/SceneTest.cpp | 6 +- .../Classes/SchedulerTest/SchedulerTest.cpp | 28 +- .../Classes/ShaderTest/ShaderTest.cpp | 54 +- .../cpp-tests/Classes/ShaderTest/ShaderTest.h | 10 +- .../Classes/ShaderTest/ShaderTest2.cpp | 60 +- .../cpp-tests/Classes/SpineTest/SpineTest.cpp | 2 +- .../Classes/SpriteTest/SpriteTest.cpp | 526 +++++++++--------- .../cpp-tests/Classes/SpriteTest/SpriteTest.h | 4 +- .../Classes/TextInputTest/TextInputTest.cpp | 14 +- .../Classes/TextInputTest/TextInputTest.h | 2 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 164 +++--- .../Classes/Texture2dTest/Texture2dTest.h | 8 +- .../TextureCacheTest/TextureCacheTest.cpp | 36 +- .../TextureAtlasEncryptionTest.cpp | 12 +- .../Classes/TileMapTest/TileMapTest.cpp | 136 ++--- .../Classes/TileMapTest/TileMapTest.h | 12 +- tests/cpp-tests/Classes/TouchesTest/Ball.cpp | 10 +- tests/cpp-tests/Classes/TouchesTest/Ball.h | 6 +- .../cpp-tests/Classes/TouchesTest/Paddle.cpp | 2 +- .../Classes/TouchesTest/TouchesTest.cpp | 10 +- .../Classes/TouchesTest/TouchesTest.h | 2 +- .../TransitionsTest/TransitionsTest.cpp | 28 +- .../CocoStudioGUITest/CocoStudioGUITest.cpp | 10 +- .../CocoStudioGUITest/CocoStudioGUITest.h | 2 +- .../CocoStudioGUITest/CocosGUIScene.cpp | 14 +- .../UITest/CocoStudioGUITest/CocosGUIScene.h | 2 +- .../CocoStudioGUITest/CustomGUIScene.cpp | 14 +- .../UITest/CocoStudioGUITest/CustomGUIScene.h | 2 +- .../CustomImageTest/CustomImageTest.cpp | 4 +- .../CustomParticleWidgetTest.cpp | 4 +- .../CustomWidget/CustomParticleWidget.cpp | 4 +- .../CustomWidget/CustomParticleWidget.h | 6 +- .../CocoStudioGUITest/GUIEditorTest.cpp | 14 +- .../UITest/CocoStudioGUITest/GUIEditorTest.h | 2 +- .../UIButtonTest/UIButtonTest.cpp | 32 +- .../UIButtonTest/UIButtonTest_Editor.cpp | 4 +- .../UICheckBoxTest/UICheckBoxTest.cpp | 8 +- .../UICheckBoxTest/UICheckBoxTest_Editor.cpp | 4 +- .../UIFocusTest/UIFocusTest.cpp | 48 +- .../UIImageViewTest/UIImageViewTest.cpp | 8 +- .../UIImageViewTest_Editor.cpp | 2 +- .../UILayoutTest/UILayoutTest.cpp | 66 +-- .../UILayoutTest/UILayoutTest_Editor.cpp | 54 +- .../UIListViewTest/UIListViewTest.cpp | 28 +- .../UIListViewTest/UIListViewTest_Editor.cpp | 12 +- .../UILoadingBarTest/UILoadingBarTest.cpp | 16 +- .../UILoadingBarTest_Editor.cpp | 2 +- .../UIPageViewTest/UIPageViewTest.cpp | 12 +- .../UIPageViewTest/UIPageViewTest_Editor.cpp | 6 +- .../UIRichTextTest/UIRichTextTest.cpp | 6 +- .../UITest/CocoStudioGUITest/UIScene.cpp | 4 +- .../UIScrollViewTest/UIScrollViewTest.cpp | 66 +-- .../UIScrollViewTest_Editor.cpp | 22 +- .../UISliderTest/UISliderTest.cpp | 16 +- .../UISliderTest/UISliderTest_Editor.cpp | 4 +- .../UITextAtlasTest/UITextAtlasTest.cpp | 4 +- .../UITextAtlasTest_Editor.cpp | 2 +- .../UITextBMFontTest/UITextBMFontTest.cpp | 4 +- .../UITextBMFontTest_Editor.cpp | 2 +- .../UITextFieldTest/UITextFieldTest.cpp | 48 +- .../UITextFieldTest_Editor.cpp | 4 +- .../UITextTest/UITextTest.cpp | 20 +- .../UITextTest/UITextTest_Editor.cpp | 2 +- .../UIVideoPlayerTest/UIVideoPlayerTest.cpp | 50 +- .../UIWidgetAddNodeTest.cpp | 6 +- .../UIWidgetAddNodeTest_Editor.cpp | 4 +- .../UserDefaultTest/UserDefaultTest.cpp | 2 +- tests/cpp-tests/Classes/VisibleRect.cpp | 34 +- tests/cpp-tests/Classes/VisibleRect.h | 18 +- .../Classes/ZwoptexTest/ZwoptexTest.cpp | 8 +- tests/cpp-tests/Classes/controller.cpp | 22 +- tests/cpp-tests/Classes/controller.h | 2 +- tests/cpp-tests/Classes/testBasic.cpp | 4 +- 458 files changed, 6048 insertions(+), 6046 deletions(-) diff --git a/cocos/2d/CCAction.cpp b/cocos/2d/CCAction.cpp index 7d2e8c8220..531f5ec94a 100644 --- a/cocos/2d/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -215,7 +215,7 @@ bool Follow::initWithTarget(Node *followedNode, const Rect& rect/* = Rect::ZERO* _boundaryFullyCovered = false; Size winSize = Director::getInstance()->getWinSize(); - _fullScreenSize = Vector2(winSize.width, winSize.height); + _fullScreenSize = Vec2(winSize.width, winSize.height); _halfScreenSize = _fullScreenSize * 0.5f; if (_boundarySet) @@ -257,9 +257,9 @@ void Follow::step(float dt) if(_boundaryFullyCovered) return; - Vector2 tempPos = _halfScreenSize - _followedNode->getPosition(); + Vec2 tempPos = _halfScreenSize - _followedNode->getPosition(); - _target->setPosition(Vector2(clampf(tempPos.x, _leftBoundary, _rightBoundary), + _target->setPosition(Vec2(clampf(tempPos.x, _leftBoundary, _rightBoundary), clampf(tempPos.y, _bottomBoundary, _topBoundary))); } else diff --git a/cocos/2d/CCAction.h b/cocos/2d/CCAction.h index c315fad3b1..2842301b90 100644 --- a/cocos/2d/CCAction.h +++ b/cocos/2d/CCAction.h @@ -277,8 +277,8 @@ protected: bool _boundaryFullyCovered; // fast access to the screen dimensions - Vector2 _halfScreenSize; - Vector2 _fullScreenSize; + Vec2 _halfScreenSize; + Vec2 _fullScreenSize; // world boundaries float _leftBoundary; diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 87d377372c..59657d040d 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -60,12 +60,12 @@ ActionCamera * ActionCamera::reverse() const void ActionCamera::restore() { - _center = Vector3(0, 0, 0); - _eye = Vector3(0, 0, FLT_EPSILON); - _up = Vector3(0, 1, 0); + _center = Vec3(0, 0, 0); + _eye = Vec3(0, 0, FLT_EPSILON); + _up = Vec3(0, 1, 0); } -void ActionCamera::setEye(const Vector3& eye) +void ActionCamera::setEye(const Vec3& eye) { _eye = eye; updateTransform(); @@ -73,17 +73,17 @@ void ActionCamera::setEye(const Vector3& eye) void ActionCamera::setEye(float x, float y, float z) { - _eye = Vector3(x, y, z); + _eye = Vec3(x, y, z); updateTransform(); } -void ActionCamera::setCenter(const Vector3& center) +void ActionCamera::setCenter(const Vec3& center) { _center = center; updateTransform(); } -void ActionCamera::setUp(const Vector3& up) +void ActionCamera::setUp(const Vec3& up) { _up = up; updateTransform(); @@ -91,18 +91,18 @@ void ActionCamera::setUp(const Vector3& up) void ActionCamera::updateTransform() { - Matrix lookupMatrix; - Matrix::createLookAt(_eye.x, _eye.y, _eye.z, _center.x, _center.y, _center.z, _up.x, _up.y, _up.z, &lookupMatrix); + Mat4 lookupMatrix; + Mat4::createLookAt(_eye.x, _eye.y, _eye.z, _center.x, _center.y, _center.z, _up.x, _up.y, _up.z, &lookupMatrix); - Vector2 anchorPoint = _target->getAnchorPointInPoints(); + Vec2 anchorPoint = _target->getAnchorPointInPoints(); - bool needsTranslation = !anchorPoint.equals(Vector2::ZERO); + bool needsTranslation = !anchorPoint.equals(Vec2::ZERO); - Matrix mv = Matrix::IDENTITY; + Mat4 mv = Mat4::IDENTITY; if(needsTranslation) { - Matrix t; - Matrix::createTranslation(anchorPoint.x, anchorPoint.y, 0, &t); + Mat4 t; + Mat4::createTranslation(anchorPoint.x, anchorPoint.y, 0, &t); mv = mv * t; } @@ -110,8 +110,8 @@ void ActionCamera::updateTransform() if(needsTranslation) { - Matrix t; - Matrix::createTranslation(-anchorPoint.x, -anchorPoint.y, 0, &t); + Mat4 t; + Mat4::createTranslation(-anchorPoint.x, -anchorPoint.y, 0, &t); mv = mv * t; } diff --git a/cocos/2d/CCActionCamera.h b/cocos/2d/CCActionCamera.h index 68eb8f4e2b..4a32234511 100644 --- a/cocos/2d/CCActionCamera.h +++ b/cocos/2d/CCActionCamera.h @@ -63,27 +63,27 @@ public: virtual ActionCamera *clone() const override; /* sets the Eye value of the Camera */ - void setEye(const Vector3 &eye); + void setEye(const Vec3 &eye); void setEye(float x, float y, float z); /* returns the Eye value of the Camera */ - const Vector3& getEye() const { return _eye; } + const Vec3& getEye() const { return _eye; } /* sets the Center value of the Camera */ - void setCenter(const Vector3 ¢er); + void setCenter(const Vec3 ¢er); /* returns the Center value of the Camera */ - const Vector3& getCenter() const { return _center; } + const Vec3& getCenter() const { return _center; } /* sets the Up value of the Camera */ - void setUp(const Vector3 &up); + void setUp(const Vec3 &up); /* Returns the Up value of the Camera */ - const Vector3& getUp() const { return _up; } + const Vec3& getUp() const { return _up; } protected: void restore(); void updateTransform(); - Vector3 _center; - Vector3 _eye; - Vector3 _up; + Vec3 _center; + Vec3 _eye; + Vec3 _up; }; /** diff --git a/cocos/2d/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp index 8a8cccffaf..f916b195c7 100644 --- a/cocos/2d/CCActionCatmullRom.cpp +++ b/cocos/2d/CCActionCatmullRom.cpp @@ -62,18 +62,18 @@ PointArray* PointArray::create(ssize_t capacity) bool PointArray::initWithCapacity(ssize_t capacity) { - _controlPoints = new vector(); + _controlPoints = new vector(); return true; } PointArray* PointArray::clone() const { - vector *newArray = new vector(); - vector::iterator iter; + vector *newArray = new vector(); + vector::iterator iter; for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter) { - newArray->push_back(new Vector2((*iter)->x, (*iter)->y)); + newArray->push_back(new Vec2((*iter)->x, (*iter)->y)); } PointArray *points = new PointArray(); @@ -88,7 +88,7 @@ PointArray::~PointArray() { CCLOGINFO("deallocing PointArray: %p", this); - vector::iterator iter; + vector::iterator iter; for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter) { delete *iter; @@ -98,17 +98,17 @@ PointArray::~PointArray() PointArray::PointArray() :_controlPoints(nullptr){} -const std::vector* PointArray::getControlPoints() const +const std::vector* PointArray::getControlPoints() const { return _controlPoints; } -void PointArray::setControlPoints(vector *controlPoints) +void PointArray::setControlPoints(vector *controlPoints) { CCASSERT(controlPoints != nullptr, "control points should not be nullptr"); // delete old points - vector::iterator iter; + vector::iterator iter; for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter) { delete *iter; @@ -118,35 +118,35 @@ void PointArray::setControlPoints(vector *controlPoints) _controlPoints = controlPoints; } -void PointArray::addControlPoint(Vector2 controlPoint) +void PointArray::addControlPoint(Vec2 controlPoint) { - _controlPoints->push_back(new Vector2(controlPoint.x, controlPoint.y)); + _controlPoints->push_back(new Vec2(controlPoint.x, controlPoint.y)); } -void PointArray::insertControlPoint(Vector2 &controlPoint, ssize_t index) +void PointArray::insertControlPoint(Vec2 &controlPoint, ssize_t index) { - Vector2 *temp = new Vector2(controlPoint.x, controlPoint.y); + Vec2 *temp = new Vec2(controlPoint.x, controlPoint.y); _controlPoints->insert(_controlPoints->begin() + index, temp); } -Vector2 PointArray::getControlPointAtIndex(ssize_t index) +Vec2 PointArray::getControlPointAtIndex(ssize_t index) { index = MIN(static_cast(_controlPoints->size())-1, MAX(index, 0)); return *(_controlPoints->at(index)); } -void PointArray::replaceControlPoint(cocos2d::Vector2 &controlPoint, ssize_t index) +void PointArray::replaceControlPoint(cocos2d::Vec2 &controlPoint, ssize_t index) { - Vector2 *temp = _controlPoints->at(index); + Vec2 *temp = _controlPoints->at(index); temp->x = controlPoint.x; temp->y = controlPoint.y; } void PointArray::removeControlPointAtIndex(ssize_t index) { - vector::iterator iter = _controlPoints->begin() + index; - Vector2* removedPoint = *iter; + vector::iterator iter = _controlPoints->begin() + index; + Vec2* removedPoint = *iter; _controlPoints->erase(iter); delete removedPoint; } @@ -158,13 +158,13 @@ ssize_t PointArray::count() const PointArray* PointArray::reverse() const { - vector *newArray = new vector(); - vector::reverse_iterator iter; - Vector2 *point = nullptr; + vector *newArray = new vector(); + vector::reverse_iterator iter; + Vec2 *point = nullptr; for (iter = _controlPoints->rbegin(); iter != _controlPoints->rend(); ++iter) { point = *iter; - newArray->push_back(new Vector2(point->x, point->y)); + newArray->push_back(new Vec2(point->x, point->y)); } PointArray *config = PointArray::create(0); config->setControlPoints(newArray); @@ -175,8 +175,8 @@ PointArray* PointArray::reverse() const void PointArray::reverseInline() { size_t l = _controlPoints->size(); - Vector2 *p1 = nullptr; - Vector2 *p2 = nullptr; + Vec2 *p1 = nullptr; + Vec2 *p2 = nullptr; float x, y; for (size_t i = 0; i < l/2; ++i) { @@ -195,7 +195,7 @@ void PointArray::reverseInline() } // CatmullRom Spline formula: -Vector2 ccCardinalSplineAt(Vector2 &p0, Vector2 &p1, Vector2 &p2, Vector2 &p3, float tension, float t) +Vec2 ccCardinalSplineAt(Vec2 &p0, Vec2 &p1, Vec2 &p2, Vec2 &p3, float tension, float t) { float t2 = t * t; float t3 = t2 * t; @@ -213,7 +213,7 @@ Vector2 ccCardinalSplineAt(Vector2 &p0, Vector2 &p1, Vector2 &p2, Vector2 &p3, f float x = (p0.x*b1 + p1.x*b2 + p2.x*b3 + p3.x*b4); float y = (p0.y*b1 + p1.y*b2 + p2.y*b3 + p3.y*b4); - return Vector2(x,y); + return Vec2(x,y); } /* Implementation of CardinalSplineTo @@ -274,7 +274,7 @@ void CardinalSplineTo::startWithTarget(cocos2d::Node *target) _deltaT = (float) 1 / (_points->count() - 1); _previousPosition = target->getPosition(); - _accumulatedDiff = Vector2::ZERO; + _accumulatedDiff = Vec2::ZERO; } CardinalSplineTo* CardinalSplineTo::clone() const @@ -307,17 +307,17 @@ void CardinalSplineTo::update(float time) } // Interpolate - Vector2 pp0 = _points->getControlPointAtIndex(p-1); - Vector2 pp1 = _points->getControlPointAtIndex(p+0); - Vector2 pp2 = _points->getControlPointAtIndex(p+1); - Vector2 pp3 = _points->getControlPointAtIndex(p+2); + Vec2 pp0 = _points->getControlPointAtIndex(p-1); + Vec2 pp1 = _points->getControlPointAtIndex(p+0); + Vec2 pp2 = _points->getControlPointAtIndex(p+1); + Vec2 pp3 = _points->getControlPointAtIndex(p+2); - Vector2 newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt); + Vec2 newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt); #if CC_ENABLE_STACKABLE_ACTIONS // Support for stacked actions Node *node = _target; - Vector2 diff = node->getPosition() - _previousPosition; + Vec2 diff = node->getPosition() - _previousPosition; if( diff.x !=0 || diff.y != 0 ) { _accumulatedDiff = _accumulatedDiff + diff; newPos = newPos + _accumulatedDiff; @@ -327,7 +327,7 @@ void CardinalSplineTo::update(float time) this->updatePosition(newPos); } -void CardinalSplineTo::updatePosition(cocos2d::Vector2 &newPos) +void CardinalSplineTo::updatePosition(cocos2d::Vec2 &newPos) { _target->setPosition(newPos); _previousPosition = newPos; @@ -365,9 +365,9 @@ CardinalSplineBy::CardinalSplineBy() : _startPosition(0,0) { } -void CardinalSplineBy::updatePosition(cocos2d::Vector2 &newPos) +void CardinalSplineBy::updatePosition(cocos2d::Vec2 &newPos) { - Vector2 p = newPos + _startPosition; + Vec2 p = newPos + _startPosition; _target->setPosition(p); _previousPosition = p; } @@ -379,11 +379,11 @@ CardinalSplineBy* CardinalSplineBy::reverse() const // // convert "absolutes" to "diffs" // - Vector2 p = copyConfig->getControlPointAtIndex(0); + Vec2 p = copyConfig->getControlPointAtIndex(0); for (ssize_t i = 1; i < copyConfig->count(); ++i) { - Vector2 current = copyConfig->getControlPointAtIndex(i); - Vector2 diff = current - p; + Vec2 current = copyConfig->getControlPointAtIndex(i); + Vec2 diff = current - p; copyConfig->replaceControlPoint(diff, i); p = current; @@ -404,9 +404,9 @@ CardinalSplineBy* CardinalSplineBy::reverse() const for (ssize_t i = 1; i < pReverse->count(); ++i) { - Vector2 current = pReverse->getControlPointAtIndex(i); + Vec2 current = pReverse->getControlPointAtIndex(i); current = -current; - Vector2 abs = current + p; + Vec2 abs = current + p; pReverse->replaceControlPoint(abs, i); p = abs; @@ -524,11 +524,11 @@ CatmullRomBy* CatmullRomBy::reverse() const // // convert "absolutes" to "diffs" // - Vector2 p = copyConfig->getControlPointAtIndex(0); + Vec2 p = copyConfig->getControlPointAtIndex(0); for (ssize_t i = 1; i < copyConfig->count(); ++i) { - Vector2 current = copyConfig->getControlPointAtIndex(i); - Vector2 diff = current - p; + Vec2 current = copyConfig->getControlPointAtIndex(i); + Vec2 diff = current - p; copyConfig->replaceControlPoint(diff, i); p = current; @@ -549,9 +549,9 @@ CatmullRomBy* CatmullRomBy::reverse() const for (ssize_t i = 1; i < reverse->count(); ++i) { - Vector2 current = reverse->getControlPointAtIndex(i); + Vec2 current = reverse->getControlPointAtIndex(i); current = -current; - Vector2 abs = current + p; + Vec2 abs = current + p; reverse->replaceControlPoint(abs, i); p = abs; diff --git a/cocos/2d/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h index ec77670cac..bd19201628 100644 --- a/cocos/2d/CCActionCatmullRom.h +++ b/cocos/2d/CCActionCatmullRom.h @@ -80,22 +80,22 @@ public: /** appends a control point * @js NA */ - void addControlPoint(Vector2 controlPoint); + void addControlPoint(Vec2 controlPoint); /** inserts a controlPoint at index * @js NA */ - void insertControlPoint(Vector2 &controlPoint, ssize_t index); + void insertControlPoint(Vec2 &controlPoint, ssize_t index); /** replaces an existing controlPoint at index * @js NA */ - void replaceControlPoint(Vector2 &controlPoint, ssize_t index); + void replaceControlPoint(Vec2 &controlPoint, ssize_t index); /** get the value of a controlPoint at a given index * @js NA */ - Vector2 getControlPointAtIndex(ssize_t index); + Vec2 getControlPointAtIndex(ssize_t index); /** deletes a control point at a given index * @js NA @@ -124,14 +124,14 @@ public: /** * @js NA */ - const std::vector* getControlPoints() const; + const std::vector* getControlPoints() const; /** * @js NA */ - void setControlPoints(std::vector *controlPoints); + void setControlPoints(std::vector *controlPoints); private: /** Array that contains the control points */ - std::vector *_controlPoints; + std::vector *_controlPoints; }; /** Cardinal Spline path. @@ -164,7 +164,7 @@ public: /** initializes the action with a duration and an array of points */ bool initWithDuration(float duration, PointArray* points, float tension); - virtual void updatePosition(Vector2 &newPos); + virtual void updatePosition(Vec2 &newPos); inline PointArray* getPoints() { return _points; } /** @@ -189,8 +189,8 @@ protected: PointArray *_points; float _deltaT; float _tension; - Vector2 _previousPosition; - Vector2 _accumulatedDiff; + Vec2 _previousPosition; + Vec2 _accumulatedDiff; }; /** Cardinal Spline path. @@ -214,12 +214,12 @@ public: // Overrides virtual void startWithTarget(Node *target) override; - virtual void updatePosition(Vector2 &newPos) override; + virtual void updatePosition(Vec2 &newPos) override; virtual CardinalSplineBy *clone() const override; virtual CardinalSplineBy* reverse() const override; protected: - Vector2 _startPosition; + Vec2 _startPosition; }; /** An action that moves the target with a CatmullRom curve to a destination point. @@ -275,7 +275,7 @@ public: }; /** Returns the Cardinal Spline position for a given set of control points, tension and time */ -extern CC_DLL Vector2 ccCardinalSplineAt(Vector2 &p0, Vector2 &p1, Vector2 &p2, Vector2 &p3, float tension, float t); +extern CC_DLL Vec2 ccCardinalSplineAt(Vec2 &p0, Vec2 &p1, Vec2 &p2, Vec2 &p3, float tension, float t); // end of actions group /// @} diff --git a/cocos/2d/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp index 23d0edc6b8..437cbd6178 100644 --- a/cocos/2d/CCActionGrid.cpp +++ b/cocos/2d/CCActionGrid.cpp @@ -103,19 +103,19 @@ GridBase* Grid3DAction::getGrid() return Grid3D::create(_gridSize); } -Vector3 Grid3DAction::getVertex(const Vector2& position) const +Vec3 Grid3DAction::getVertex(const Vec2& position) const { Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid(); return g->getVertex(position); } -Vector3 Grid3DAction::getOriginalVertex(const Vector2& position) const +Vec3 Grid3DAction::getOriginalVertex(const Vec2& position) const { Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid(); return g->getOriginalVertex(position); } -void Grid3DAction::setVertex(const Vector2& position, const Vector3& vertex) +void Grid3DAction::setVertex(const Vec2& position, const Vec3& vertex) { Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid(); g->setVertex(position, vertex); @@ -128,19 +128,19 @@ GridBase* TiledGrid3DAction::getGrid(void) return TiledGrid3D::create(_gridSize); } -Quad3 TiledGrid3DAction::getTile(const Vector2& pos) const +Quad3 TiledGrid3DAction::getTile(const Vec2& pos) const { TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid(); return g->getTile(pos); } -Quad3 TiledGrid3DAction::getOriginalTile(const Vector2& pos) const +Quad3 TiledGrid3DAction::getOriginalTile(const Vec2& pos) const { TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid(); return g->getOriginalTile(pos); } -void TiledGrid3DAction::setTile(const Vector2& pos, const Quad3& coords) +void TiledGrid3DAction::setTile(const Vec2& pos, const Quad3& coords) { TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid(); return g->setTile(pos, coords); diff --git a/cocos/2d/CCActionGrid.h b/cocos/2d/CCActionGrid.h index d0b9c109e1..3630f1b973 100644 --- a/cocos/2d/CCActionGrid.h +++ b/cocos/2d/CCActionGrid.h @@ -82,31 +82,31 @@ public: * @js NA * @lua NA */ - Vector3 getVertex(const Vector2& position) const; + Vec3 getVertex(const Vec2& position) const; /** @deprecated Use getVertex() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE inline Vector3 vertex(const Vector2& position) { return getVertex(position); } + CC_DEPRECATED_ATTRIBUTE inline Vec3 vertex(const Vec2& position) { return getVertex(position); } /** returns the non-transformed vertex than belongs to certain position in the grid * @js NA * @lua NA */ - Vector3 getOriginalVertex(const Vector2& position) const; + Vec3 getOriginalVertex(const Vec2& position) const; /** @deprecated Use getOriginalVertex() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE inline Vector3 originalVertex(const Vector2& position) { return getOriginalVertex(position); } + CC_DEPRECATED_ATTRIBUTE inline Vec3 originalVertex(const Vec2& position) { return getOriginalVertex(position); } /** sets a new vertex to a certain position of the grid * @js NA * @lua NA */ - void setVertex(const Vector2& position, const Vector3& vertex); + void setVertex(const Vec2& position, const Vec3& vertex); // Overrides virtual Grid3DAction * clone() const override = 0; @@ -126,31 +126,31 @@ public: * @js NA * @lua NA */ - Quad3 getTile(const Vector2& position) const; + Quad3 getTile(const Vec2& position) const; /** @deprecated Use getTile() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vector2& position) { return getTile(position); } + CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vec2& position) { return getTile(position); } /** returns the non-transformed tile that belongs to a certain position of the grid * @js NA * @lua NA */ - Quad3 getOriginalTile(const Vector2& position) const; + Quad3 getOriginalTile(const Vec2& position) const; /** @deprecated Use getOriginalTile() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vector2& position) { return getOriginalTile(position); } + CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vec2& position) { return getOriginalTile(position); } /** sets a new tile to a certain position of the grid * @js NA * @lua NA */ - void setTile(const Vector2& position, const Quad3& coords); + void setTile(const Vec2& position, const Quad3& coords); /** returns the grid */ virtual GridBase* getGrid(); diff --git a/cocos/2d/CCActionGrid3D.cpp b/cocos/2d/CCActionGrid3D.cpp index eab703c837..bed68e66aa 100644 --- a/cocos/2d/CCActionGrid3D.cpp +++ b/cocos/2d/CCActionGrid3D.cpp @@ -79,10 +79,10 @@ void Waves3D::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - Vector3 v = getOriginalVertex(Vector2(i ,j)); + Vec3 v = getOriginalVertex(Vec2(i ,j)); v.z += (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * 0.01f) * _amplitude * _amplitudeRate); //CCLOG("v.z offset is %f\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude * _amplitudeRate)); - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } } @@ -142,32 +142,32 @@ void FlipX3D::update(float time) angle = angle / 2.0f; // x calculates degrees from 0 to 90 float mx = cosf(angle); - Vector3 v0, v1, v, diff; + Vec3 v0, v1, v, diff; - v0 = getOriginalVertex(Vector2(1, 1)); - v1 = getOriginalVertex(Vector2(0, 0)); + v0 = getOriginalVertex(Vec2(1, 1)); + v1 = getOriginalVertex(Vec2(0, 0)); float x0 = v0.x; float x1 = v1.x; float x; - Vector2 a, b, c, d; + Vec2 a, b, c, d; if ( x0 > x1 ) { // Normal Grid - a = Vector2(0,0); - b = Vector2(0,1); - c = Vector2(1,0); - d = Vector2(1,1); + a = Vec2(0,0); + b = Vec2(0,1); + c = Vec2(1,0); + d = Vec2(1,1); x = x0; } else { // Reversed Grid - c = Vector2(0,0); - d = Vector2(0,1); - a = Vector2(1,0); - b = Vector2(1,1); + c = Vec2(0,0); + d = Vec2(0,1); + a = Vec2(1,0); + b = Vec2(1,1); x = x1; } @@ -236,32 +236,32 @@ void FlipY3D::update(float time) angle = angle / 2.0f; // x calculates degrees from 0 to 90 float my = cosf(angle); - Vector3 v0, v1, v, diff; + Vec3 v0, v1, v, diff; - v0 = getOriginalVertex(Vector2(1, 1)); - v1 = getOriginalVertex(Vector2(0, 0)); + v0 = getOriginalVertex(Vec2(1, 1)); + v1 = getOriginalVertex(Vec2(0, 0)); float y0 = v0.y; float y1 = v1.y; float y; - Vector2 a, b, c, d; + Vec2 a, b, c, d; if (y0 > y1) { // Normal Grid - a = Vector2(0,0); - b = Vector2(0,1); - c = Vector2(1,0); - d = Vector2(1,1); + a = Vec2(0,0); + b = Vec2(0,1); + c = Vec2(1,0); + d = Vec2(1,1); y = y0; } else { // Reversed Grid - b = Vector2(0,0); - a = Vector2(0,1); - d = Vector2(1,0); - c = Vector2(1,1); + b = Vec2(0,0); + a = Vec2(0,1); + d = Vec2(1,0); + c = Vec2(1,1); y = y1; } @@ -296,7 +296,7 @@ void FlipY3D::update(float time) // implementation of Lens3D -Lens3D* Lens3D::create(float duration, const Size& gridSize, const Vector2& position, float radius) +Lens3D* Lens3D::create(float duration, const Size& gridSize, const Vec2& position, float radius) { Lens3D *action = new Lens3D(); @@ -315,11 +315,11 @@ Lens3D* Lens3D::create(float duration, const Size& gridSize, const Vector2& posi return action; } -bool Lens3D::initWithDuration(float duration, const Size& gridSize, const Vector2& position, float radius) +bool Lens3D::initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius) { if (Grid3DAction::initWithDuration(duration, gridSize)) { - _position = Vector2(-1, -1); + _position = Vec2(-1, -1); setPosition(position); _radius = radius; _lensEffect = 0.7f; @@ -341,7 +341,7 @@ Lens3D* Lens3D::clone() const return a; } -void Lens3D::setPosition(const Vector2& pos) +void Lens3D::setPosition(const Vec2& pos) { if( !pos.equals(_position)) { @@ -361,8 +361,8 @@ void Lens3D::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - Vector3 v = getOriginalVertex(Vector2(i, j)); - Vector2 vect = _position - Vector2(v.x, v.y); + Vec3 v = getOriginalVertex(Vec2(i, j)); + Vec2 vect = _position - Vec2(v.x, v.y); float r = vect.getLength(); if (r < _radius) @@ -380,12 +380,12 @@ void Lens3D::update(float time) if (vect.getLength() > 0) { vect.normalize(); - Vector2 new_vect = vect * new_r; + Vec2 new_vect = vect * new_r; v.z += (_concave ? -1.0f : 1.0f) * new_vect.getLength() * _lensEffect; } } - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } @@ -395,7 +395,7 @@ void Lens3D::update(float time) // implementation of Ripple3D -Ripple3D* Ripple3D::create(float duration, const Size& gridSize, const Vector2& position, float radius, unsigned int waves, float amplitude) +Ripple3D* Ripple3D::create(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude) { Ripple3D *action = new Ripple3D(); @@ -414,7 +414,7 @@ Ripple3D* Ripple3D::create(float duration, const Size& gridSize, const Vector2& return action; } -bool Ripple3D::initWithDuration(float duration, const Size& gridSize, const Vector2& position, float radius, unsigned int waves, float amplitude) +bool Ripple3D::initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude) { if (Grid3DAction::initWithDuration(duration, gridSize)) { @@ -430,7 +430,7 @@ bool Ripple3D::initWithDuration(float duration, const Size& gridSize, const Vect return false; } -void Ripple3D::setPosition(const Vector2& position) +void Ripple3D::setPosition(const Vec2& position) { _position = position; } @@ -453,8 +453,8 @@ void Ripple3D::update(float time) { for (j = 0; j < (_gridSize.height+1); ++j) { - Vector3 v = getOriginalVertex(Vector2(i, j)); - Vector2 vect = _position - Vector2(v.x,v.y); + Vec3 v = getOriginalVertex(Vec2(i, j)); + Vec2 vect = _position - Vec2(v.x,v.y); float r = vect.getLength(); if (r < _radius) @@ -464,7 +464,7 @@ void Ripple3D::update(float time) v.z += (sinf( time*(float)M_PI * _waves * 2 + r * 0.1f) * _amplitude * _amplitudeRate * rate); } - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } } @@ -521,7 +521,7 @@ void Shaky3D::update(float time) { for (j = 0; j < (_gridSize.height+1); ++j) { - Vector3 v = getOriginalVertex(Vector2(i ,j)); + Vec3 v = getOriginalVertex(Vec2(i ,j)); v.x += (rand() % (_randrange*2)) - _randrange; v.y += (rand() % (_randrange*2)) - _randrange; if (_shakeZ) @@ -529,7 +529,7 @@ void Shaky3D::update(float time) v.z += (rand() % (_randrange*2)) - _randrange; } - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } } @@ -586,10 +586,10 @@ void Liquid::update(float time) { for (j = 1; j < _gridSize.height; ++j) { - Vector3 v = getOriginalVertex(Vector2(i, j)); + Vec3 v = getOriginalVertex(Vec2(i, j)); v.x = (v.x + (sinf(time * (float)M_PI * _waves * 2 + v.x * .01f) * _amplitude * _amplitudeRate)); v.y = (v.y + (sinf(time * (float)M_PI * _waves * 2 + v.y * .01f) * _amplitude * _amplitudeRate)); - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } } @@ -648,7 +648,7 @@ void Waves::update(float time) { for (j = 0; j < _gridSize.height + 1; ++j) { - Vector3 v = getOriginalVertex(Vector2(i, j)); + Vec3 v = getOriginalVertex(Vec2(i, j)); if (_vertical) { @@ -660,14 +660,14 @@ void Waves::update(float time) v.y = (v.y + (sinf(time * (float)M_PI * _waves * 2 + v.x * .01f) * _amplitude * _amplitudeRate)); } - setVertex(Vector2(i, j), v); + setVertex(Vec2(i, j), v); } } } // implementation of Twirl -Twirl* Twirl::create(float duration, const Size& gridSize, Vector2 position, unsigned int twirls, float amplitude) +Twirl* Twirl::create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude) { Twirl *action = new Twirl(); @@ -686,7 +686,7 @@ Twirl* Twirl::create(float duration, const Size& gridSize, Vector2 position, uns return action; } -bool Twirl::initWithDuration(float duration, const Size& gridSize, Vector2 position, unsigned int twirls, float amplitude) +bool Twirl::initWithDuration(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude) { if (Grid3DAction::initWithDuration(duration, gridSize)) { @@ -701,7 +701,7 @@ bool Twirl::initWithDuration(float duration, const Size& gridSize, Vector2 posit return false; } -void Twirl::setPosition(const Vector2& position) +void Twirl::setPosition(const Vec2& position) { _position = position; } @@ -718,28 +718,28 @@ Twirl *Twirl::clone() const void Twirl::update(float time) { int i, j; - Vector2 c = _position; + Vec2 c = _position; for (i = 0; i < (_gridSize.width+1); ++i) { for (j = 0; j < (_gridSize.height+1); ++j) { - Vector3 v = getOriginalVertex(Vector2(i ,j)); + Vec3 v = getOriginalVertex(Vec2(i ,j)); - Vector2 avg = Vector2(i-(_gridSize.width/2.0f), j-(_gridSize.height/2.0f)); + Vec2 avg = Vec2(i-(_gridSize.width/2.0f), j-(_gridSize.height/2.0f)); float r = avg.getLength(); float amp = 0.1f * _amplitude * _amplitudeRate; float a = r * cosf( (float)M_PI/2.0f + time * (float)M_PI * _twirls * 2 ) * amp; - Vector2 d = Vector2( + Vec2 d = Vec2( sinf(a) * (v.y-c.y) + cosf(a) * (v.x-c.x), cosf(a) * (v.y-c.y) - sinf(a) * (v.x-c.x)); v.x = c.x + d.x; v.y = c.y + d.y; - setVertex(Vector2(i ,j), v); + setVertex(Vec2(i ,j), v); } } } diff --git a/cocos/2d/CCActionGrid3D.h b/cocos/2d/CCActionGrid3D.h index 375f4fd0b8..89c187cc58 100644 --- a/cocos/2d/CCActionGrid3D.h +++ b/cocos/2d/CCActionGrid3D.h @@ -120,7 +120,7 @@ class CC_DLL Lens3D : public Grid3DAction { public: /** creates the action with center position, radius, a grid size and duration */ - static Lens3D* create(float duration, const Size& gridSize, const Vector2& position, float radius); + static Lens3D* create(float duration, const Size& gridSize, const Vec2& position, float radius); /** Get lens center position */ inline float getLensEffect() const { return _lensEffect; } @@ -129,8 +129,8 @@ public: /** Set whether lens is concave */ inline void setConcave(bool concave) { _concave = concave; } - inline const Vector2& getPosition() const { return _position; } - void setPosition(const Vector2& position); + inline const Vec2& getPosition() const { return _position; } + void setPosition(const Vec2& position); // Overrides virtual Lens3D* clone() const override; @@ -141,11 +141,11 @@ CC_CONSTRUCTOR_ACCESS: virtual ~Lens3D() {} /** initializes the action with center position, radius, a grid size and duration */ - bool initWithDuration(float duration, const Size& gridSize, const Vector2& position, float radius); + bool initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius); protected: /* lens center position */ - Vector2 _position; + Vec2 _position; float _radius; /** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */ float _lensEffect; @@ -163,12 +163,12 @@ class CC_DLL Ripple3D : public Grid3DAction { public: /** creates the action with radius, number of waves, amplitude, a grid size and duration */ - static Ripple3D* create(float duration, const Size& gridSize, const Vector2& position, float radius, unsigned int waves, float amplitude); + static Ripple3D* create(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude); /** get center position */ - inline const Vector2& getPosition() const { return _position; } + inline const Vec2& getPosition() const { return _position; } /** set center position */ - void setPosition(const Vector2& position); + void setPosition(const Vec2& position); inline float getAmplitude() const { return _amplitude; } inline void setAmplitude(float fAmplitude) { _amplitude = fAmplitude; } @@ -185,11 +185,11 @@ CC_CONSTRUCTOR_ACCESS: virtual ~Ripple3D() {} /** initializes the action with radius, number of waves, amplitude, a grid size and duration */ - bool initWithDuration(float duration, const Size& gridSize, const Vector2& position, float radius, unsigned int waves, float amplitude); + bool initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude); protected: /* center position */ - Vector2 _position; + Vec2 _position; float _radius; unsigned int _waves; float _amplitude; @@ -298,12 +298,12 @@ class CC_DLL Twirl : public Grid3DAction { public: /** creates the action with center position, number of twirls, amplitude, a grid size and duration */ - static Twirl* create(float duration, const Size& gridSize, Vector2 position, unsigned int twirls, float amplitude); + static Twirl* create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude); /** get twirl center */ - inline const Vector2& getPosition() const { return _position; } + inline const Vec2& getPosition() const { return _position; } /** set twirl center */ - void setPosition(const Vector2& position); + void setPosition(const Vec2& position); inline float getAmplitude() const { return _amplitude; } inline void setAmplitude(float amplitude) { _amplitude = amplitude; } @@ -321,11 +321,11 @@ CC_CONSTRUCTOR_ACCESS: virtual ~Twirl() {} /** initializes the action with center position, number of twirls, amplitude, a grid size and duration */ - bool initWithDuration(float duration, const Size& gridSize, Vector2 position, unsigned int twirls, float amplitude); + bool initWithDuration(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude); protected: /* twirl center */ - Vector2 _position; + Vec2 _position; unsigned int _twirls; float _amplitude; float _amplitudeRate; diff --git a/cocos/2d/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp index 0db73cf380..6a2a5e4a0b 100644 --- a/cocos/2d/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -278,7 +278,7 @@ FlipY * FlipY::clone() const // Place // -Place* Place::create(const Vector2& pos) +Place* Place::create(const Vec2& pos) { Place *ret = new Place(); @@ -291,7 +291,7 @@ Place* Place::create(const Vector2& pos) return nullptr; } -bool Place::initWithPosition(const Vector2& pos) { +bool Place::initWithPosition(const Vec2& pos) { _position = pos; return true; } diff --git a/cocos/2d/CCActionInstant.h b/cocos/2d/CCActionInstant.h index 1de17f283d..c74d6f0378 100644 --- a/cocos/2d/CCActionInstant.h +++ b/cocos/2d/CCActionInstant.h @@ -228,7 +228,7 @@ class CC_DLL Place : public ActionInstant // public: /** creates a Place action with a position */ - static Place * create(const Vector2& pos); + static Place * create(const Vec2& pos); // // Overrides @@ -242,10 +242,10 @@ CC_CONSTRUCTOR_ACCESS: virtual ~Place(){} /** Initializes a Place action with a position */ - bool initWithPosition(const Vector2& pos); + bool initWithPosition(const Vec2& pos); protected: - Vector2 _position; + Vec2 _position; private: CC_DISALLOW_COPY_AND_ASSIGN(Place); diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index 3bade7d8de..b51b5afc92 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -859,7 +859,7 @@ RotateBy* RotateBy::create(float duration, float deltaAngleX, float deltaAngleY) return rotateBy; } -RotateBy* RotateBy::create(float duration, const Vector3& deltaAngle3D) +RotateBy* RotateBy::create(float duration, const Vec3& deltaAngle3D) { RotateBy *rotateBy = new RotateBy(); rotateBy->initWithDuration(duration, deltaAngle3D); @@ -896,7 +896,7 @@ bool RotateBy::initWithDuration(float duration, float deltaAngleX, float deltaAn return false; } -bool RotateBy::initWithDuration(float duration, const Vector3& deltaAngle3D) +bool RotateBy::initWithDuration(float duration, const Vec3& deltaAngle3D) { if (ActionInterval::initWithDuration(duration)) { @@ -942,7 +942,7 @@ void RotateBy::update(float time) { if(_is3D) { - Vector3 v; + Vec3 v; v.x = _startAngle3D.x + _angle3D.x * time; v.y = _startAngle3D.y + _angle3D.y * time; v.z = _startAngle3D.z + _angle3D.z * time; @@ -960,7 +960,7 @@ RotateBy* RotateBy::reverse() const { if(_is3D) { - Vector3 v; + Vec3 v; v.x = - _angle3D.x; v.y = - _angle3D.y; v.z = - _angle3D.z; @@ -973,7 +973,7 @@ RotateBy* RotateBy::reverse() const // MoveBy // -MoveBy* MoveBy::create(float duration, const Vector2& deltaPosition) +MoveBy* MoveBy::create(float duration, const Vec2& deltaPosition) { MoveBy *ret = new MoveBy(); ret->initWithDuration(duration, deltaPosition); @@ -982,7 +982,7 @@ MoveBy* MoveBy::create(float duration, const Vector2& deltaPosition) return ret; } -bool MoveBy::initWithDuration(float duration, const Vector2& deltaPosition) +bool MoveBy::initWithDuration(float duration, const Vec2& deltaPosition) { if (ActionInterval::initWithDuration(duration)) { @@ -1010,7 +1010,7 @@ void MoveBy::startWithTarget(Node *target) MoveBy* MoveBy::reverse() const { - return MoveBy::create(_duration, Vector2( -_positionDelta.x, -_positionDelta.y)); + return MoveBy::create(_duration, Vec2( -_positionDelta.x, -_positionDelta.y)); } @@ -1019,10 +1019,10 @@ void MoveBy::update(float t) if (_target) { #if CC_ENABLE_STACKABLE_ACTIONS - Vector2 currentPos = _target->getPosition(); - Vector2 diff = currentPos - _previousPosition; + Vec2 currentPos = _target->getPosition(); + Vec2 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; - Vector2 newPos = _startPosition + (_positionDelta * t); + Vec2 newPos = _startPosition + (_positionDelta * t); _target->setPosition(newPos); _previousPosition = newPos; #else @@ -1035,7 +1035,7 @@ void MoveBy::update(float t) // MoveTo // -MoveTo* MoveTo::create(float duration, const Vector2& position) +MoveTo* MoveTo::create(float duration, const Vec2& position) { MoveTo *ret = new MoveTo(); ret->initWithDuration(duration, position); @@ -1044,7 +1044,7 @@ MoveTo* MoveTo::create(float duration, const Vector2& position) return ret; } -bool MoveTo::initWithDuration(float duration, const Vector2& position) +bool MoveTo::initWithDuration(float duration, const Vec2& position) { if (ActionInterval::initWithDuration(duration)) { @@ -1252,7 +1252,7 @@ SkewBy* SkewBy::reverse() const // JumpBy // -JumpBy* JumpBy::create(float duration, const Vector2& position, float height, int jumps) +JumpBy* JumpBy::create(float duration, const Vec2& position, float height, int jumps) { JumpBy *jumpBy = new JumpBy(); jumpBy->initWithDuration(duration, position, height, jumps); @@ -1261,7 +1261,7 @@ JumpBy* JumpBy::create(float duration, const Vector2& position, float height, in return jumpBy; } -bool JumpBy::initWithDuration(float duration, const Vector2& position, float height, int jumps) +bool JumpBy::initWithDuration(float duration, const Vec2& position, float height, int jumps) { CCASSERT(jumps>=0, "Number of jumps must be >= 0"); @@ -1303,24 +1303,24 @@ void JumpBy::update(float t) float x = _delta.x * t; #if CC_ENABLE_STACKABLE_ACTIONS - Vector2 currentPos = _target->getPosition(); + Vec2 currentPos = _target->getPosition(); - Vector2 diff = currentPos - _previousPos; + Vec2 diff = currentPos - _previousPos; _startPosition = diff + _startPosition; - Vector2 newPos = _startPosition + Vector2(x,y); + Vec2 newPos = _startPosition + Vec2(x,y); _target->setPosition(newPos); _previousPos = newPos; #else - _target->setPosition(_startPosition + Vector2(x,y)); + _target->setPosition(_startPosition + Vec2(x,y)); #endif // !CC_ENABLE_STACKABLE_ACTIONS } } JumpBy* JumpBy::reverse() const { - return JumpBy::create(_duration, Vector2(-_delta.x, -_delta.y), + return JumpBy::create(_duration, Vec2(-_delta.x, -_delta.y), _height, _jumps); } @@ -1328,7 +1328,7 @@ JumpBy* JumpBy::reverse() const // JumpTo // -JumpTo* JumpTo::create(float duration, const Vector2& position, float height, int jumps) +JumpTo* JumpTo::create(float duration, const Vec2& position, float height, int jumps) { JumpTo *jumpTo = new JumpTo(); jumpTo->initWithDuration(duration, position, height, jumps); @@ -1355,7 +1355,7 @@ JumpTo* JumpTo::reverse() const void JumpTo::startWithTarget(Node *target) { JumpBy::startWithTarget(target); - _delta = Vector2(_delta.x - _startPosition.x, _delta.y - _startPosition.y); + _delta = Vec2(_delta.x - _startPosition.x, _delta.y - _startPosition.y); } // Bezier cubic formula: @@ -1427,16 +1427,16 @@ void BezierBy::update(float time) float y = bezierat(ya, yb, yc, yd, time); #if CC_ENABLE_STACKABLE_ACTIONS - Vector2 currentPos = _target->getPosition(); - Vector2 diff = currentPos - _previousPosition; + Vec2 currentPos = _target->getPosition(); + Vec2 diff = currentPos - _previousPosition; _startPosition = _startPosition + diff; - Vector2 newPos = _startPosition + Vector2(x,y); + Vec2 newPos = _startPosition + Vec2(x,y); _target->setPosition(newPos); _previousPosition = newPos; #else - _target->setPosition( _startPosition + Vector2(x,y)); + _target->setPosition( _startPosition + Vec2(x,y)); #endif // !CC_ENABLE_STACKABLE_ACTIONS } } diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index cc0f22f4ec..564c24c4d5 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -370,7 +370,7 @@ public: /** creates the action */ static RotateBy* create(float duration, float deltaAngle); static RotateBy* create(float duration, float deltaAngleZ_X, float deltaAngleZ_Y); - static RotateBy* create(float duration, const Vector3& deltaAngle3D); + static RotateBy* create(float duration, const Vec3& deltaAngle3D); // // Override @@ -387,7 +387,7 @@ CC_CONSTRUCTOR_ACCESS: /** initializes the action */ bool initWithDuration(float duration, float deltaAngle); bool initWithDuration(float duration, float deltaAngleZ_X, float deltaAngleZ_Y); - bool initWithDuration(float duration, const Vector3& deltaAngle3D); + bool initWithDuration(float duration, const Vec3& deltaAngle3D); protected: float _angleZ_X; @@ -396,8 +396,8 @@ protected: float _startAngleZ_Y; bool _is3D; - Vector3 _angle3D; - Vector3 _startAngle3D; + Vec3 _angle3D; + Vec3 _startAngle3D; private: CC_DISALLOW_COPY_AND_ASSIGN(RotateBy); @@ -413,7 +413,7 @@ class CC_DLL MoveBy : public ActionInterval { public: /** creates the action */ - static MoveBy* create(float duration, const Vector2& deltaPosition); + static MoveBy* create(float duration, const Vec2& deltaPosition); // // Overrides @@ -428,12 +428,12 @@ CC_CONSTRUCTOR_ACCESS: virtual ~MoveBy() {} /** initializes the action */ - bool initWithDuration(float duration, const Vector2& deltaPosition); + bool initWithDuration(float duration, const Vec2& deltaPosition); protected: - Vector2 _positionDelta; - Vector2 _startPosition; - Vector2 _previousPosition; + Vec2 _positionDelta; + Vec2 _startPosition; + Vec2 _previousPosition; private: CC_DISALLOW_COPY_AND_ASSIGN(MoveBy); @@ -448,7 +448,7 @@ class CC_DLL MoveTo : public MoveBy { public: /** creates the action */ - static MoveTo* create(float duration, const Vector2& position); + static MoveTo* create(float duration, const Vec2& position); // // Overrides @@ -461,10 +461,10 @@ CC_CONSTRUCTOR_ACCESS: virtual ~MoveTo() {} /** initializes the action */ - bool initWithDuration(float duration, const Vector2& position); + bool initWithDuration(float duration, const Vec2& position); protected: - Vector2 _endPosition; + Vec2 _endPosition; private: CC_DISALLOW_COPY_AND_ASSIGN(MoveTo); @@ -539,7 +539,7 @@ class CC_DLL JumpBy : public ActionInterval { public: /** creates the action */ - static JumpBy* create(float duration, const Vector2& position, float height, int jumps); + static JumpBy* create(float duration, const Vec2& position, float height, int jumps); // // Overrides @@ -554,14 +554,14 @@ CC_CONSTRUCTOR_ACCESS: virtual ~JumpBy() {} /** initializes the action */ - bool initWithDuration(float duration, const Vector2& position, float height, int jumps); + bool initWithDuration(float duration, const Vec2& position, float height, int jumps); protected: - Vector2 _startPosition; - Vector2 _delta; + Vec2 _startPosition; + Vec2 _delta; float _height; int _jumps; - Vector2 _previousPos; + Vec2 _previousPos; private: CC_DISALLOW_COPY_AND_ASSIGN(JumpBy); @@ -573,7 +573,7 @@ class CC_DLL JumpTo : public JumpBy { public: /** creates the action */ - static JumpTo* create(float duration, const Vector2& position, float height, int jumps); + static JumpTo* create(float duration, const Vec2& position, float height, int jumps); // // Override @@ -592,11 +592,11 @@ private: */ typedef struct _ccBezierConfig { //! end position of the bezier - Vector2 endPosition; + Vec2 endPosition; //! Bezier control point 1 - Vector2 controlPoint_1; + Vec2 controlPoint_1; //! Bezier control point 2 - Vector2 controlPoint_2; + Vec2 controlPoint_2; } ccBezierConfig; /** @brief An action that moves the target with a cubic Bezier curve by a certain distance. @@ -630,8 +630,8 @@ CC_CONSTRUCTOR_ACCESS: protected: ccBezierConfig _config; - Vector2 _startPosition; - Vector2 _previousPosition; + Vec2 _startPosition; + Vec2 _previousPosition; private: CC_DISALLOW_COPY_AND_ASSIGN(BezierBy); diff --git a/cocos/2d/CCActionPageTurn3D.cpp b/cocos/2d/CCActionPageTurn3D.cpp index 82dc9d0f38..5843efcf68 100644 --- a/cocos/2d/CCActionPageTurn3D.cpp +++ b/cocos/2d/CCActionPageTurn3D.cpp @@ -76,7 +76,7 @@ void PageTurn3D::update(float time) for (int j = 0; j <= _gridSize.height; ++j) { // Get original vertex - Vector3 p = getOriginalVertex(Vector2(i ,j)); + Vec3 p = getOriginalVertex(Vec2(i ,j)); float R = sqrtf((p.x * p.x) + ((p.y - ay) * (p.y - ay))); float r = R * sinTheta; @@ -111,7 +111,7 @@ void PageTurn3D::update(float time) } // Set new coords - setVertex(Vector2(i, j), p); + setVertex(Vec2(i, j), p); } } diff --git a/cocos/2d/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp index 910e17a870..a50cf8eba5 100644 --- a/cocos/2d/CCActionTiledGrid.cpp +++ b/cocos/2d/CCActionTiledGrid.cpp @@ -34,8 +34,8 @@ NS_CC_BEGIN struct Tile { - Vector2 position; - Vector2 startPosition; + Vec2 position; + Vec2 startPosition; Size delta; }; @@ -91,7 +91,7 @@ void ShakyTiles3D::update(float time) { for (j = 0; j < _gridSize.height; ++j) { - Quad3 coords = getOriginalTile(Vector2(i, j)); + Quad3 coords = getOriginalTile(Vec2(i, j)); // X coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; @@ -113,7 +113,7 @@ void ShakyTiles3D::update(float time) coords.tr.z += ( rand() % (_randrange*2) ) - _randrange; } - setTile(Vector2(i, j), coords); + setTile(Vec2(i, j), coords); } } } @@ -173,7 +173,7 @@ void ShatteredTiles3D::update(float time) { for (j = 0; j < _gridSize.height; ++j) { - Quad3 coords = getOriginalTile(Vector2(i ,j)); + Quad3 coords = getOriginalTile(Vec2(i ,j)); // X coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; @@ -195,7 +195,7 @@ void ShatteredTiles3D::update(float time) coords.tr.z += ( rand() % (_randrange*2) ) - _randrange; } - setTile(Vector2(i, j), coords); + setTile(Vec2(i, j), coords); } } @@ -267,7 +267,7 @@ void ShuffleTiles::shuffle(unsigned int *array, unsigned int len) Size ShuffleTiles::getDelta(const Size& pos) const { - Vector2 pos2; + Vec2 pos2; unsigned int idx = pos.width * _gridSize.height + pos.height; @@ -277,11 +277,11 @@ Size ShuffleTiles::getDelta(const Size& pos) const return Size((int)(pos2.x - pos.width), (int)(pos2.y - pos.height)); } -void ShuffleTiles::placeTile(const Vector2& pos, Tile *t) +void ShuffleTiles::placeTile(const Vec2& pos, Tile *t) { Quad3 coords = getOriginalTile(pos); - Vector2 step = _gridNodeTarget->getGrid()->getStep(); + Vec2 step = _gridNodeTarget->getGrid()->getStep(); coords.bl.x += (int)(t->position.x * step.x); coords.bl.y += (int)(t->position.y * step.y); @@ -329,8 +329,8 @@ void ShuffleTiles::startWithTarget(Node *target) { for (j = 0; j < _gridSize.height; ++j) { - tileArray->position = Vector2((float)i, (float)j); - tileArray->startPosition = Vector2((float)i, (float)j); + tileArray->position = Vec2((float)i, (float)j); + tileArray->startPosition = Vec2((float)i, (float)j); tileArray->delta = getDelta(Size(i, j)); ++tileArray; } @@ -347,8 +347,8 @@ void ShuffleTiles::update(float time) { for (j = 0; j < _gridSize.height; ++j) { - tileArray->position = Vector2((float)tileArray->delta.width, (float)tileArray->delta.height) * time; - placeTile(Vector2(i, j), tileArray); + tileArray->position = Vec2((float)tileArray->delta.width, (float)tileArray->delta.height) * time; + placeTile(Vec2(i, j), tileArray); ++tileArray; } } @@ -386,7 +386,7 @@ FadeOutTRTiles* FadeOutTRTiles::clone() const float FadeOutTRTiles::testFunc(const Size& pos, float time) { - Vector2 n = Vector2((float)_gridSize.width, (float)_gridSize.height) * time; + Vec2 n = Vec2((float)_gridSize.width, (float)_gridSize.height) * time; if ((n.x + n.y) == 0.0f) { return 1.0f; @@ -395,22 +395,22 @@ float FadeOutTRTiles::testFunc(const Size& pos, float time) return powf((pos.width + pos.height) / (n.x + n.y), 6); } -void FadeOutTRTiles::turnOnTile(const Vector2& pos) +void FadeOutTRTiles::turnOnTile(const Vec2& pos) { setTile(pos, getOriginalTile(pos)); } -void FadeOutTRTiles::turnOffTile(const Vector2& pos) +void FadeOutTRTiles::turnOffTile(const Vec2& pos) { Quad3 coords; memset(&coords, 0, sizeof(Quad3)); setTile(pos, coords); } -void FadeOutTRTiles::transformTile(const Vector2& pos, float distance) +void FadeOutTRTiles::transformTile(const Vec2& pos, float distance) { Quad3 coords = getOriginalTile(pos); - Vector2 step = _gridNodeTarget->getGrid()->getStep(); + Vec2 step = _gridNodeTarget->getGrid()->getStep(); coords.bl.x += (step.x / 2) * (1.0f - distance); coords.bl.y += (step.y / 2) * (1.0f - distance); @@ -438,15 +438,15 @@ void FadeOutTRTiles::update(float time) float distance = testFunc(Size(i, j), time); if ( distance == 0 ) { - turnOffTile(Vector2(i, j)); + turnOffTile(Vec2(i, j)); } else if (distance < 1) { - transformTile(Vector2(i, j), distance); + transformTile(Vec2(i, j), distance); } else { - turnOnTile(Vector2(i, j)); + turnOnTile(Vec2(i, j)); } } } @@ -484,7 +484,7 @@ FadeOutBLTiles* FadeOutBLTiles::clone() const float FadeOutBLTiles::testFunc(const Size& pos, float time) { - Vector2 n = Vector2((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time); + Vec2 n = Vec2((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time); if ((pos.width + pos.height) == 0) { return 1.0f; @@ -525,7 +525,7 @@ FadeOutUpTiles* FadeOutUpTiles::clone() const float FadeOutUpTiles::testFunc(const Size& pos, float time) { - Vector2 n = Vector2((float)_gridSize.width, (float)_gridSize.height) * time; + Vec2 n = Vec2((float)_gridSize.width, (float)_gridSize.height) * time; if (n.y == 0.0f) { return 1.0f; @@ -534,10 +534,10 @@ float FadeOutUpTiles::testFunc(const Size& pos, float time) return powf(pos.height / n.y, 6); } -void FadeOutUpTiles::transformTile(const Vector2& pos, float distance) +void FadeOutUpTiles::transformTile(const Vec2& pos, float distance) { Quad3 coords = getOriginalTile(pos); - Vector2 step = _gridNodeTarget->getGrid()->getStep(); + Vec2 step = _gridNodeTarget->getGrid()->getStep(); coords.bl.y += (step.y / 2) * (1.0f - distance); coords.br.y += (step.y / 2) * (1.0f - distance); @@ -579,7 +579,7 @@ FadeOutDownTiles* FadeOutDownTiles::clone() const float FadeOutDownTiles::testFunc(const Size& pos, float time) { - Vector2 n = Vector2((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time); + Vec2 n = Vec2((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time); if (pos.height == 0) { return 1.0f; @@ -662,12 +662,12 @@ void TurnOffTiles::shuffle(unsigned int *array, unsigned int len) } } -void TurnOffTiles::turnOnTile(const Vector2& pos) +void TurnOffTiles::turnOnTile(const Vec2& pos) { setTile(pos, getOriginalTile(pos)); } -void TurnOffTiles::turnOffTile(const Vector2& pos) +void TurnOffTiles::turnOffTile(const Vec2& pos) { Quad3 coords; @@ -706,7 +706,7 @@ void TurnOffTiles::update(float time) for( i = 0; i < _tilesCount; i++ ) { t = _tilesOrder[i]; - Vector2 tilePos = Vector2( (unsigned int)(t / _gridSize.height), t % (unsigned int)_gridSize.height ); + Vec2 tilePos = Vec2( (unsigned int)(t / _gridSize.height), t % (unsigned int)_gridSize.height ); if ( i < l ) { @@ -771,7 +771,7 @@ void WavesTiles3D::update(float time) { for( j = 0; j < _gridSize.height; j++ ) { - Quad3 coords = getOriginalTile(Vector2(i, j)); + Quad3 coords = getOriginalTile(Vec2(i, j)); coords.bl.z = (sinf(time * (float)M_PI *_waves * 2 + (coords.bl.y+coords.bl.x) * .01f) * _amplitude * _amplitudeRate ); @@ -779,7 +779,7 @@ void WavesTiles3D::update(float time) coords.tl.z = coords.bl.z; coords.tr.z = coords.bl.z; - setTile(Vector2(i, j), coords); + setTile(Vec2(i, j), coords); } } } @@ -839,7 +839,7 @@ void JumpTiles3D::update(float time) { for( j = 0; j < _gridSize.height; j++ ) { - Quad3 coords = getOriginalTile(Vector2(i, j)); + Quad3 coords = getOriginalTile(Vec2(i, j)); if ( ((i+j) % 2) == 0 ) { @@ -856,7 +856,7 @@ void JumpTiles3D::update(float time) coords.tr.z += sinz2; } - setTile(Vector2(i, j), coords); + setTile(Vec2(i, j), coords); } } } @@ -910,7 +910,7 @@ void SplitRows::update(float time) for (j = 0; j < _gridSize.height; ++j) { - Quad3 coords = getOriginalTile(Vector2(0, j)); + Quad3 coords = getOriginalTile(Vec2(0, j)); float direction = 1; if ( (j % 2 ) == 0 ) @@ -923,7 +923,7 @@ void SplitRows::update(float time) coords.tl.x += direction * _winSize.width * time; coords.tr.x += direction * _winSize.width * time; - setTile(Vector2(0, j), coords); + setTile(Vec2(0, j), coords); } } @@ -975,7 +975,7 @@ void SplitCols::update(float time) for (i = 0; i < _gridSize.width; ++i) { - Quad3 coords = getOriginalTile(Vector2(i, 0)); + Quad3 coords = getOriginalTile(Vec2(i, 0)); float direction = 1; if ( (i % 2 ) == 0 ) @@ -988,7 +988,7 @@ void SplitCols::update(float time) coords.tl.y += direction * _winSize.height * time; coords.tr.y += direction * _winSize.height * time; - setTile(Vector2(i, 0), coords); + setTile(Vec2(i, 0), coords); } } diff --git a/cocos/2d/CCActionTiledGrid.h b/cocos/2d/CCActionTiledGrid.h index c7887d6c1a..9f0b497c95 100644 --- a/cocos/2d/CCActionTiledGrid.h +++ b/cocos/2d/CCActionTiledGrid.h @@ -100,7 +100,7 @@ public: void shuffle(unsigned int *array, unsigned int len); Size getDelta(const Size& pos) const; - void placeTile(const Vector2& pos, Tile *t); + void placeTile(const Vec2& pos, Tile *t); // Overrides virtual void startWithTarget(Node *target) override; @@ -134,9 +134,9 @@ public: static FadeOutTRTiles* create(float duration, const Size& gridSize); virtual float testFunc(const Size& pos, float time); - void turnOnTile(const Vector2& pos); - void turnOffTile(const Vector2& pos); - virtual void transformTile(const Vector2& pos, float distance); + void turnOnTile(const Vec2& pos); + void turnOffTile(const Vec2& pos); + virtual void transformTile(const Vec2& pos, float distance); // Overrides virtual void update(float time) override; @@ -180,7 +180,7 @@ public: /** creates the action with the grid size and the duration */ static FadeOutUpTiles* create(float duration, const Size& gridSize); - virtual void transformTile(const Vector2& pos, float distance); + virtual void transformTile(const Vec2& pos, float distance); // Overrides virtual FadeOutUpTiles* clone() const override; @@ -227,8 +227,8 @@ public: static TurnOffTiles* create(float duration, const Size& gridSize, unsigned int seed); void shuffle(unsigned int *array, unsigned int len); - void turnOnTile(const Vector2& pos); - void turnOffTile(const Vector2& pos); + void turnOnTile(const Vec2& pos); + void turnOffTile(const Vec2& pos); // Overrides virtual TurnOffTiles* clone() const override; diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index 3403bf51e8..8c1ac25ebf 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -133,7 +133,7 @@ void AtlasNode::updateAtlasValues() } // AtlasNode - draw -void AtlasNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void AtlasNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _quadCommand.init( _globalZOrder, diff --git a/cocos/2d/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h index f5273cb72a..cdcda77bc6 100644 --- a/cocos/2d/CCAtlasNode.h +++ b/cocos/2d/CCAtlasNode.h @@ -69,7 +69,7 @@ public: // Overrides - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual Texture2D* getTexture() const override; virtual void setTexture(Texture2D *texture) override; virtual bool isOpacityModifyRGB() const override; diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index f82fa5231d..41d3c971d8 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -196,14 +196,14 @@ void ClippingNode::drawFullScreenQuadClearStencil() director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - DrawPrimitives::drawSolidRect(Vector2(-1,-1), Vector2(1,1), Color4F(1, 1, 1, 1)); + DrawPrimitives::drawSolidRect(Vec2(-1,-1), Vec2(1,1), Color4F(1, 1, 1, 1)); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } -void ClippingNode::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if(!_visible) return; @@ -214,7 +214,7 @@ void ClippingNode::visit(Renderer *renderer, const Matrix &parentTransform, bool _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -382,7 +382,7 @@ void ClippingNode::onBeforeVisit() glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP); // draw a fullscreen solid rectangle to clear the stencil buffer - //ccDrawSolidRect(Vector2::ZERO, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1)); + //ccDrawSolidRect(Vec2::ZERO, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1)); drawFullScreenQuadClearStencil(); /////////////////////////////////// diff --git a/cocos/2d/CCClippingNode.h b/cocos/2d/CCClippingNode.h index a8d603e709..3ca5ab911c 100644 --- a/cocos/2d/CCClippingNode.h +++ b/cocos/2d/CCClippingNode.h @@ -95,7 +95,7 @@ public: * @lua NA */ virtual void onExit() override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; CC_CONSTRUCTOR_ACCESS: ClippingNode(); diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 666cf80d35..108c2eb7cc 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -34,67 +34,67 @@ NS_CC_BEGIN -// Vector2 == CGPoint in 32-bits, but not in 64-bits (OS X) +// Vec2 == CGPoint in 32-bits, but not in 64-bits (OS X) // that's why the "v2f" functions are needed -static Vector2 v2fzero(0.0f,0.0f); +static Vec2 v2fzero(0.0f,0.0f); -static inline Vector2 v2f(float x, float y) +static inline Vec2 v2f(float x, float y) { - Vector2 ret(x, y); + Vec2 ret(x, y); return ret; } -static inline Vector2 v2fadd(const Vector2 &v0, const Vector2 &v1) +static inline Vec2 v2fadd(const Vec2 &v0, const Vec2 &v1) { return v2f(v0.x+v1.x, v0.y+v1.y); } -static inline Vector2 v2fsub(const Vector2 &v0, const Vector2 &v1) +static inline Vec2 v2fsub(const Vec2 &v0, const Vec2 &v1) { return v2f(v0.x-v1.x, v0.y-v1.y); } -static inline Vector2 v2fmult(const Vector2 &v, float s) +static inline Vec2 v2fmult(const Vec2 &v, float s) { return v2f(v.x * s, v.y * s); } -static inline Vector2 v2fperp(const Vector2 &p0) +static inline Vec2 v2fperp(const Vec2 &p0) { return v2f(-p0.y, p0.x); } -static inline Vector2 v2fneg(const Vector2 &p0) +static inline Vec2 v2fneg(const Vec2 &p0) { return v2f(-p0.x, - p0.y); } -static inline float v2fdot(const Vector2 &p0, const Vector2 &p1) +static inline float v2fdot(const Vec2 &p0, const Vec2 &p1) { return p0.x * p1.x + p0.y * p1.y; } -static inline Vector2 v2fforangle(float _a_) +static inline Vec2 v2fforangle(float _a_) { return v2f(cosf(_a_), sinf(_a_)); } -static inline Vector2 v2fnormalize(const Vector2 &p) +static inline Vec2 v2fnormalize(const Vec2 &p) { - Vector2 r = Vector2(p.x, p.y).getNormalized(); + Vec2 r = Vec2(p.x, p.y).getNormalized(); return v2f(r.x, r.y); } -static inline Vector2 __v2f(const Vector2 &v) +static inline Vec2 __v2f(const Vec2 &v) { //#ifdef __LP64__ return v2f(v.x, v.y); // #else -// return * ((Vector2*) &v); +// return * ((Vec2*) &v); // #endif } -static inline Tex2F __t(const Vector2 &v) +static inline Tex2F __t(const Vec2 &v) { return *(Tex2F*)&v; } @@ -205,14 +205,14 @@ bool DrawNode::init() return true; } -void DrawNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void DrawNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(DrawNode::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void DrawNode::onDraw(const Matrix &transform, bool transformUpdated) +void DrawNode::onDraw(const Mat4 &transform, bool transformUpdated) { auto glProgram = getGLProgram(); glProgram->use(); @@ -252,15 +252,15 @@ void DrawNode::onDraw(const Matrix &transform, bool transformUpdated) CHECK_GL_ERROR_DEBUG(); } -void DrawNode::drawDot(const Vector2 &pos, float radius, const Color4F &color) +void DrawNode::drawDot(const Vec2 &pos, float radius, const Color4F &color) { unsigned int vertex_count = 2*3; ensureCapacity(vertex_count); - V2F_C4B_T2F a = {Vector2(pos.x - radius, pos.y - radius), Color4B(color), Tex2F(-1.0, -1.0) }; - V2F_C4B_T2F b = {Vector2(pos.x - radius, pos.y + radius), Color4B(color), Tex2F(-1.0, 1.0) }; - V2F_C4B_T2F c = {Vector2(pos.x + radius, pos.y + radius), Color4B(color), Tex2F( 1.0, 1.0) }; - V2F_C4B_T2F d = {Vector2(pos.x + radius, pos.y - radius), Color4B(color), Tex2F( 1.0, -1.0) }; + V2F_C4B_T2F a = {Vec2(pos.x - radius, pos.y - radius), Color4B(color), Tex2F(-1.0, -1.0) }; + V2F_C4B_T2F b = {Vec2(pos.x - radius, pos.y + radius), Color4B(color), Tex2F(-1.0, 1.0) }; + V2F_C4B_T2F c = {Vec2(pos.x + radius, pos.y + radius), Color4B(color), Tex2F( 1.0, 1.0) }; + V2F_C4B_T2F d = {Vec2(pos.x + radius, pos.y - radius), Color4B(color), Tex2F( 1.0, -1.0) }; V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); V2F_C4B_T2F_Triangle triangle0 = {a, b, c}; @@ -273,28 +273,28 @@ void DrawNode::drawDot(const Vector2 &pos, float radius, const Color4F &color) _dirty = true; } -void DrawNode::drawSegment(const Vector2 &from, const Vector2 &to, float radius, const Color4F &color) +void DrawNode::drawSegment(const Vec2 &from, const Vec2 &to, float radius, const Color4F &color) { unsigned int vertex_count = 6*3; ensureCapacity(vertex_count); - Vector2 a = __v2f(from); - Vector2 b = __v2f(to); + Vec2 a = __v2f(from); + Vec2 b = __v2f(to); - Vector2 n = v2fnormalize(v2fperp(v2fsub(b, a))); - Vector2 t = v2fperp(n); + Vec2 n = v2fnormalize(v2fperp(v2fsub(b, a))); + Vec2 t = v2fperp(n); - Vector2 nw = v2fmult(n, radius); - Vector2 tw = v2fmult(t, radius); - Vector2 v0 = v2fsub(b, v2fadd(nw, tw)); - Vector2 v1 = v2fadd(b, v2fsub(nw, tw)); - Vector2 v2 = v2fsub(b, nw); - Vector2 v3 = v2fadd(b, nw); - Vector2 v4 = v2fsub(a, nw); - Vector2 v5 = v2fadd(a, nw); - Vector2 v6 = v2fsub(a, v2fsub(nw, tw)); - Vector2 v7 = v2fadd(a, v2fadd(nw, tw)); + Vec2 nw = v2fmult(n, radius); + Vec2 tw = v2fmult(t, radius); + Vec2 v0 = v2fsub(b, v2fadd(nw, tw)); + Vec2 v1 = v2fadd(b, v2fsub(nw, tw)); + Vec2 v2 = v2fsub(b, nw); + Vec2 v3 = v2fadd(b, nw); + Vec2 v4 = v2fsub(a, nw); + Vec2 v5 = v2fadd(a, nw); + Vec2 v6 = v2fsub(a, v2fsub(nw, tw)); + Vec2 v7 = v2fadd(a, v2fadd(nw, tw)); V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); @@ -346,24 +346,24 @@ void DrawNode::drawSegment(const Vector2 &from, const Vector2 &to, float radius, _dirty = true; } -void DrawNode::drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor) +void DrawNode::drawPolygon(Vec2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor) { CCASSERT(count >= 0, "invalid count value"); - struct ExtrudeVerts {Vector2 offset, n;}; + struct ExtrudeVerts {Vec2 offset, n;}; struct ExtrudeVerts* extrude = (struct ExtrudeVerts*)malloc(sizeof(struct ExtrudeVerts)*count); memset(extrude, 0, sizeof(struct ExtrudeVerts)*count); for (int i = 0; i < count; i++) { - Vector2 v0 = __v2f(verts[(i-1+count)%count]); - Vector2 v1 = __v2f(verts[i]); - Vector2 v2 = __v2f(verts[(i+1)%count]); + Vec2 v0 = __v2f(verts[(i-1+count)%count]); + Vec2 v1 = __v2f(verts[i]); + Vec2 v2 = __v2f(verts[(i+1)%count]); - Vector2 n1 = v2fnormalize(v2fperp(v2fsub(v1, v0))); - Vector2 n2 = v2fnormalize(v2fperp(v2fsub(v2, v1))); + Vec2 n1 = v2fnormalize(v2fperp(v2fsub(v1, v0))); + Vec2 n2 = v2fnormalize(v2fperp(v2fsub(v2, v1))); - Vector2 offset = v2fmult(v2fadd(n1, n2), 1.0/(v2fdot(n1, n2) + 1.0)); + Vec2 offset = v2fmult(v2fadd(n1, n2), 1.0/(v2fdot(n1, n2) + 1.0)); struct ExtrudeVerts tmp = {offset, n2}; extrude[i] = tmp; } @@ -380,9 +380,9 @@ void DrawNode::drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, float inset = (outline == false ? 0.5 : 0.0); for (int i = 0; i < count-2; i++) { - Vector2 v0 = v2fsub(__v2f(verts[0 ]), v2fmult(extrude[0 ].offset, inset)); - Vector2 v1 = v2fsub(__v2f(verts[i+1]), v2fmult(extrude[i+1].offset, inset)); - Vector2 v2 = v2fsub(__v2f(verts[i+2]), v2fmult(extrude[i+2].offset, inset)); + Vec2 v0 = v2fsub(__v2f(verts[0 ]), v2fmult(extrude[0 ].offset, inset)); + Vec2 v1 = v2fsub(__v2f(verts[i+1]), v2fmult(extrude[i+1].offset, inset)); + Vec2 v2 = v2fsub(__v2f(verts[i+2]), v2fmult(extrude[i+2].offset, inset)); V2F_C4B_T2F_Triangle tmp = { {v0, Color4B(fillColor), __t(v2fzero)}, @@ -396,20 +396,20 @@ void DrawNode::drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, for(int i = 0; i < count; i++) { int j = (i+1)%count; - Vector2 v0 = __v2f(verts[i]); - Vector2 v1 = __v2f(verts[j]); + Vec2 v0 = __v2f(verts[i]); + Vec2 v1 = __v2f(verts[j]); - Vector2 n0 = extrude[i].n; + Vec2 n0 = extrude[i].n; - Vector2 offset0 = extrude[i].offset; - Vector2 offset1 = extrude[j].offset; + Vec2 offset0 = extrude[i].offset; + Vec2 offset1 = extrude[j].offset; if(outline) { - Vector2 inner0 = v2fsub(v0, v2fmult(offset0, borderWidth)); - Vector2 inner1 = v2fsub(v1, v2fmult(offset1, borderWidth)); - Vector2 outer0 = v2fadd(v0, v2fmult(offset0, borderWidth)); - Vector2 outer1 = v2fadd(v1, v2fmult(offset1, borderWidth)); + Vec2 inner0 = v2fsub(v0, v2fmult(offset0, borderWidth)); + Vec2 inner1 = v2fsub(v1, v2fmult(offset1, borderWidth)); + Vec2 outer0 = v2fadd(v0, v2fmult(offset0, borderWidth)); + Vec2 outer1 = v2fadd(v1, v2fmult(offset1, borderWidth)); V2F_C4B_T2F_Triangle tmp1 = { {inner0, Color4B(borderColor), __t(v2fneg(n0))}, @@ -426,10 +426,10 @@ void DrawNode::drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, *cursor++ = tmp2; } else { - Vector2 inner0 = v2fsub(v0, v2fmult(offset0, 0.5)); - Vector2 inner1 = v2fsub(v1, v2fmult(offset1, 0.5)); - Vector2 outer0 = v2fadd(v0, v2fmult(offset0, 0.5)); - Vector2 outer1 = v2fadd(v1, v2fmult(offset1, 0.5)); + Vec2 inner0 = v2fsub(v0, v2fmult(offset0, 0.5)); + Vec2 inner1 = v2fsub(v1, v2fmult(offset1, 0.5)); + Vec2 outer0 = v2fadd(v0, v2fmult(offset0, 0.5)); + Vec2 outer1 = v2fadd(v1, v2fmult(offset1, 0.5)); V2F_C4B_T2F_Triangle tmp1 = { {inner0, Color4B(fillColor), __t(v2fzero)}, @@ -454,15 +454,15 @@ void DrawNode::drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, free(extrude); } -void DrawNode::drawTriangle(const Vector2 &p1, const Vector2 &p2, const Vector2 &p3, const Color4F &color) +void DrawNode::drawTriangle(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Color4F &color) { unsigned int vertex_count = 2*3; ensureCapacity(vertex_count); Color4B col = Color4B(color); - V2F_C4B_T2F a = {Vector2(p1.x, p1.y), col, Tex2F(0.0, 0.0) }; - V2F_C4B_T2F b = {Vector2(p2.x, p2.y), col, Tex2F(0.0, 0.0) }; - V2F_C4B_T2F c = {Vector2(p3.x, p3.y), col, Tex2F(0.0, 0.0) }; + V2F_C4B_T2F a = {Vec2(p1.x, p1.y), col, Tex2F(0.0, 0.0) }; + V2F_C4B_T2F b = {Vec2(p2.x, p2.y), col, Tex2F(0.0, 0.0) }; + V2F_C4B_T2F c = {Vec2(p3.x, p3.y), col, Tex2F(0.0, 0.0) }; V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); V2F_C4B_T2F_Triangle triangle = {a, b, c}; @@ -472,23 +472,23 @@ void DrawNode::drawTriangle(const Vector2 &p1, const Vector2 &p2, const Vector2 _dirty = true; } -void DrawNode::drawCubicBezier(const Vector2& from, const Vector2& control1, const Vector2& control2, const Vector2& to, unsigned int segments, const Color4F &color) +void DrawNode::drawCubicBezier(const Vec2& from, const Vec2& control1, const Vec2& control2, const Vec2& to, unsigned int segments, const Color4F &color) { unsigned int vertex_count = (segments + 1) * 3; ensureCapacity(vertex_count); Tex2F texCoord = Tex2F(0.0, 0.0); Color4B col = Color4B(color); - Vector2 vertex; - Vector2 firstVertex = Vector2(from.x, from.y); - Vector2 lastVertex = Vector2(to.x, to.y); + Vec2 vertex; + Vec2 firstVertex = Vec2(from.x, from.y); + Vec2 lastVertex = Vec2(to.x, to.y); float t = 0; for(unsigned int i = segments + 1; i > 0; i--) { float x = powf(1 - t, 3) * from.x + 3.0f * powf(1 - t, 2) * t * control1.x + 3.0f * (1 - t) * t * t * control2.x + t * t * t * to.x; float y = powf(1 - t, 3) * from.y + 3.0f * powf(1 - t, 2) * t * control1.y + 3.0f * (1 - t) * t * t * control2.y + t * t * t * to.y; - vertex = Vector2(x, y); + vertex = Vec2(x, y); V2F_C4B_T2F a = {firstVertex, col, texCoord }; V2F_C4B_T2F b = {lastVertex, col, texCoord }; @@ -503,23 +503,23 @@ void DrawNode::drawCubicBezier(const Vector2& from, const Vector2& control1, con _dirty = true; } -void DrawNode::drawQuadraticBezier(const Vector2& from, const Vector2& control, const Vector2& to, unsigned int segments, const Color4F &color) +void DrawNode::drawQuadraticBezier(const Vec2& from, const Vec2& control, const Vec2& to, unsigned int segments, const Color4F &color) { unsigned int vertex_count = (segments + 1) * 3; ensureCapacity(vertex_count); Tex2F texCoord = Tex2F(0.0, 0.0); Color4B col = Color4B(color); - Vector2 vertex; - Vector2 firstVertex = Vector2(from.x, from.y); - Vector2 lastVertex = Vector2(to.x, to.y); + Vec2 vertex; + Vec2 firstVertex = Vec2(from.x, from.y); + Vec2 lastVertex = Vec2(to.x, to.y); float t = 0; for(unsigned int i = segments + 1; i > 0; i--) { float x = powf(1 - t, 2) * from.x + 2.0f * (1 - t) * t * control.x + t * t * to.x; float y = powf(1 - t, 2) * from.y + 2.0f * (1 - t) * t * control.y + t * t * to.y; - vertex = Vector2(x, y); + vertex = Vec2(x, y); V2F_C4B_T2F a = {firstVertex, col, texCoord }; V2F_C4B_T2F b = {lastVertex, col, texCoord }; diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 38381053b6..264a1ad78a 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -50,10 +50,10 @@ public: static DrawNode* create(); /** draw a dot at a position, with a given radius and color */ - void drawDot(const Vector2 &pos, float radius, const Color4F &color); + void drawDot(const Vec2 &pos, float radius, const Color4F &color); /** draw a segment with a radius and color */ - void drawSegment(const Vector2 &from, const Vector2 &to, float radius, const Color4F &color); + void drawSegment(const Vec2 &from, const Vec2 &to, float radius, const Color4F &color); /** draw a polygon with a fill color and line color * @code @@ -62,16 +62,16 @@ public: * In lua:local drawPolygon(local pointTable,local tableCount,local fillColor,local width,local borderColor) * @endcode */ - void drawPolygon(Vector2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor); + void drawPolygon(Vec2 *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor); /** draw a triangle with color */ - void drawTriangle(const Vector2 &p1, const Vector2 &p2, const Vector2 &p3, const Color4F &color); + void drawTriangle(const Vec2 &p1, const Vec2 &p2, const Vec2 &p3, const Color4F &color); /** draw a cubic bezier curve with color and number of segments */ - void drawCubicBezier(const Vector2& from, const Vector2& control1, const Vector2& control2, const Vector2& to, unsigned int segments, const Color4F &color); + void drawCubicBezier(const Vec2& from, const Vec2& control1, const Vec2& control2, const Vec2& to, unsigned int segments, const Color4F &color); /** draw a quadratic bezier curve with color and number of segments */ - void drawQuadraticBezier(const Vector2& from, const Vector2& control, const Vector2& to, unsigned int segments, const Color4F &color); + void drawQuadraticBezier(const Vec2& from, const Vec2& control, const Vec2& to, unsigned int segments, const Color4F &color); /** Clear the geometry in the node's buffer. */ void clear(); @@ -89,10 +89,10 @@ public: */ void setBlendFunc(const BlendFunc &blendFunc); - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); // Overrides - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; CC_CONSTRUCTOR_ACCESS: DrawNode(); diff --git a/cocos/2d/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp index 3af2401d45..1505560c44 100644 --- a/cocos/2d/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -123,11 +123,11 @@ void free() s_initialized = false; } -void drawPoint( const Vector2& point ) +void drawPoint( const Vec2& point ) { lazy_init(); - Vector2 p; + Vec2 p; p.x = point.x; p.y = point.y; @@ -150,7 +150,7 @@ void drawPoint( const Vector2& point ) CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,1); } -void drawPoints( const Vector2 *points, unsigned int numberOfPoints ) +void drawPoints( const Vec2 *points, unsigned int numberOfPoints ) { lazy_init(); @@ -161,13 +161,13 @@ void drawPoints( const Vector2 *points, unsigned int numberOfPoints ) s_shader->setUniformLocationWith1f(s_pointSizeLocation, s_pointSize); // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed - Vector2* newPoints = new Vector2[numberOfPoints]; + Vec2* newPoints = new Vec2[numberOfPoints]; // iPhone and 32-bit machines optimization - if( sizeof(Vector2) == sizeof(Vector2) ) + if( sizeof(Vec2) == sizeof(Vec2) ) { #ifdef EMSCRIPTEN - setGLBufferData((void*) points, numberOfPoints * sizeof(Vector2)); + setGLBufferData((void*) points, numberOfPoints * sizeof(Vec2)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, points); @@ -183,7 +183,7 @@ void drawPoints( const Vector2 *points, unsigned int numberOfPoints ) #ifdef EMSCRIPTEN // Suspect Emscripten won't be emitting 64-bit code for a while yet, // but want to make sure this continues to work even if they do. - setGLBufferData(newPoints, numberOfPoints * sizeof(Vector2)); + setGLBufferData(newPoints, numberOfPoints * sizeof(Vec2)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, newPoints); @@ -198,13 +198,13 @@ void drawPoints( const Vector2 *points, unsigned int numberOfPoints ) } -void drawLine( const Vector2& origin, const Vector2& destination ) +void drawLine( const Vec2& origin, const Vec2& destination ) { lazy_init(); - Vector2 vertices[2] = { - Vector2(origin.x, origin.y), - Vector2(destination.x, destination.y) + Vec2 vertices[2] = { + Vec2(origin.x, origin.y), + Vec2(destination.x, destination.y) }; s_shader->use(); @@ -223,27 +223,27 @@ void drawLine( const Vector2& origin, const Vector2& destination ) CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,2); } -void drawRect( Vector2 origin, Vector2 destination ) +void drawRect( Vec2 origin, Vec2 destination ) { - drawLine(Vector2(origin.x, origin.y), Vector2(destination.x, origin.y)); - drawLine(Vector2(destination.x, origin.y), Vector2(destination.x, destination.y)); - drawLine(Vector2(destination.x, destination.y), Vector2(origin.x, destination.y)); - drawLine(Vector2(origin.x, destination.y), Vector2(origin.x, origin.y)); + drawLine(Vec2(origin.x, origin.y), Vec2(destination.x, origin.y)); + drawLine(Vec2(destination.x, origin.y), Vec2(destination.x, destination.y)); + drawLine(Vec2(destination.x, destination.y), Vec2(origin.x, destination.y)); + drawLine(Vec2(origin.x, destination.y), Vec2(origin.x, origin.y)); } -void drawSolidRect( Vector2 origin, Vector2 destination, Color4F color ) +void drawSolidRect( Vec2 origin, Vec2 destination, Color4F color ) { - Vector2 vertices[] = { + Vec2 vertices[] = { origin, - Vector2(destination.x, origin.y), + Vec2(destination.x, origin.y), destination, - Vector2(origin.x, destination.y) + Vec2(origin.x, destination.y) }; drawSolidPoly(vertices, 4, color ); } -void drawPoly( const Vector2 *poli, unsigned int numberOfPoints, bool closePolygon ) +void drawPoly( const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon ) { lazy_init(); @@ -254,10 +254,10 @@ void drawPoly( const Vector2 *poli, unsigned int numberOfPoints, bool closePolyg GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); // iPhone and 32-bit machines optimization - if( sizeof(Vector2) == sizeof(Vector2) ) + if( sizeof(Vec2) == sizeof(Vec2) ) { #ifdef EMSCRIPTEN - setGLBufferData((void*) poli, numberOfPoints * sizeof(Vector2)); + setGLBufferData((void*) poli, numberOfPoints * sizeof(Vec2)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, poli); @@ -272,13 +272,13 @@ void drawPoly( const Vector2 *poli, unsigned int numberOfPoints, bool closePolyg { // Mac on 64-bit // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed - Vector2* newPoli = new Vector2[numberOfPoints]; + Vec2* newPoli = new Vec2[numberOfPoints]; for( unsigned int i=0; igetControlPointAtIndex(p-1); - Vector2 pp1 = config->getControlPointAtIndex(p+0); - Vector2 pp2 = config->getControlPointAtIndex(p+1); - Vector2 pp3 = config->getControlPointAtIndex(p+2); + Vec2 pp0 = config->getControlPointAtIndex(p-1); + Vec2 pp1 = config->getControlPointAtIndex(p+0); + Vec2 pp2 = config->getControlPointAtIndex(p+1); + Vec2 pp3 = config->getControlPointAtIndex(p+2); - Vector2 newPos = ccCardinalSplineAt( pp0, pp1, pp2, pp3, tension, lt); + Vec2 newPos = ccCardinalSplineAt( pp0, pp1, pp2, pp3, tension, lt); vertices[i].x = newPos.x; vertices[i].y = newPos.y; } @@ -514,7 +514,7 @@ void drawCardinalSpline( PointArray *config, float tension, unsigned int segmen GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); #ifdef EMSCRIPTEN - setGLBufferData(vertices, (segments + 1) * sizeof(Vector2)); + setGLBufferData(vertices, (segments + 1) * sizeof(Vec2)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); @@ -525,11 +525,11 @@ void drawCardinalSpline( PointArray *config, float tension, unsigned int segmen CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,segments+1); } -void drawCubicBezier(const Vector2& origin, const Vector2& control1, const Vector2& control2, const Vector2& destination, unsigned int segments) +void drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments) { lazy_init(); - Vector2* vertices = new Vector2[segments + 1]; + Vec2* vertices = new Vec2[segments + 1]; float t = 0; for(unsigned int i = 0; i < segments; i++) @@ -548,7 +548,7 @@ void drawCubicBezier(const Vector2& origin, const Vector2& control1, const Vecto GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); #ifdef EMSCRIPTEN - setGLBufferData(vertices, (segments + 1) * sizeof(Vector2)); + setGLBufferData(vertices, (segments + 1) * sizeof(Vec2)); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); #else glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); diff --git a/cocos/2d/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h index a687302390..2bd69651df 100644 --- a/cocos/2d/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -63,7 +63,7 @@ THE SOFTWARE. - ccPointSize() - glLineWidth() - @warning These functions draws the Line, Vector2, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use DrawNode + @warning These functions draws the Line, Vec2, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use DrawNode */ @@ -85,52 +85,52 @@ namespace DrawPrimitives void free(); /** draws a point given x and y coordinate measured in points */ - void drawPoint( const Vector2& point ); + void drawPoint( const Vec2& point ); /** draws an array of points. @since v0.7.2 */ - void drawPoints( const Vector2 *points, unsigned int numberOfPoints ); + void drawPoints( const Vec2 *points, unsigned int numberOfPoints ); /** draws a line given the origin and destination point measured in points */ - void drawLine( const Vector2& origin, const Vector2& destination ); + void drawLine( const Vec2& origin, const Vec2& destination ); /** draws a rectangle given the origin and destination point measured in points. */ - void drawRect( Vector2 origin, Vector2 destination ); + void drawRect( Vec2 origin, Vec2 destination ); /** draws a solid rectangle given the origin and destination point measured in points. @since 1.1 */ - void drawSolidRect( Vector2 origin, Vector2 destination, Color4F color ); + void drawSolidRect( Vec2 origin, Vec2 destination, Color4F color ); /** draws a polygon given a pointer to point coordinates and the number of vertices measured in points. The polygon can be closed or open */ - void drawPoly( const Vector2 *vertices, unsigned int numOfVertices, bool closePolygon ); + void drawPoly( const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon ); /** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color. */ - void drawSolidPoly( const Vector2 *poli, unsigned int numberOfPoints, Color4F color ); + void drawSolidPoly( const Vec2 *poli, unsigned int numberOfPoints, Color4F color ); /** draws a circle given the center, radius and number of segments. */ - void drawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY); - void drawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter); + void drawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY); + void drawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter); /** draws a solid circle given the center, radius and number of segments. */ - void drawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY); - void drawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments); + void drawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY); + void drawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments); /** draws a quad bezier path @warning This function could be pretty slow. Use it only for debugging purposes. @since v0.8 */ - void drawQuadBezier(const Vector2& origin, const Vector2& control, const Vector2& destination, unsigned int segments); + void drawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments); /** draws a cubic bezier path @warning This function could be pretty slow. Use it only for debugging purposes. @since v0.8 */ - void drawCubicBezier(const Vector2& origin, const Vector2& control1, const Vector2& control2, const Vector2& destination, unsigned int segments); + void drawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments); /** draws a Catmull Rom path. @warning This function could be pretty slow. Use it only for debugging purposes. diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 592c39e327..683f825071 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -90,7 +90,7 @@ FontAtlas * FontAtlasCache::getFontAtlasTTF(const TTFConfig & config) return nullptr; } -FontAtlas * FontAtlasCache::getFontAtlasFNT(const std::string& fontFileName, const Vector2& imageOffset /* = Vector2::ZERO */) +FontAtlas * FontAtlasCache::getFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset /* = Vec2::ZERO */) { std::string atlasName = generateFontName(fontFileName, 0, GlyphCollection::CUSTOM,false); auto it = _atlasMap.find(atlasName); diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index 8b8964456d..800948ba44 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -38,7 +38,7 @@ class CC_DLL FontAtlasCache { public: static FontAtlas * getFontAtlasTTF(const TTFConfig & config); - static FontAtlas * getFontAtlasFNT(const std::string& fontFileName, const Vector2& imageOffset = Vector2::ZERO); + static FontAtlas * getFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset = Vec2::ZERO); static FontAtlas * getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap); static FontAtlas * getFontAtlasCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap); diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 714567cad4..6e7a9f7364 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -665,7 +665,7 @@ void BMFontConfiguration::parseKerningEntry(std::string line) HASH_ADD_INT(_kerningDictionary,key, element); } -FontFNT * FontFNT::create(const std::string& fntFilePath, const Vector2& imageOffset /* = Vector2::ZERO */) +FontFNT * FontFNT::create(const std::string& fntFilePath, const Vec2& imageOffset /* = Vec2::ZERO */) { BMFontConfiguration *newConf = FNTConfigLoadFile(fntFilePath); if (!newConf) @@ -690,7 +690,7 @@ FontFNT * FontFNT::create(const std::string& fntFilePath, const Vector2& imageOf return tempFont; } -FontFNT::FontFNT(BMFontConfiguration *theContfig, const Vector2& imageOffset /* = Vector2::ZERO */) +FontFNT::FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset /* = Vec2::ZERO */) :_configuration(theContfig) ,_imageOffset(CC_POINT_PIXELS_TO_POINTS(imageOffset)) { diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index fb32fbc4fe..945f81c0ac 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -37,7 +37,7 @@ class FontFNT : public Font public: - static FontFNT * create(const std::string& fntFilePath, const Vector2& imageOffset = Vector2::ZERO); + static FontFNT * create(const std::string& fntFilePath, const Vec2& imageOffset = Vec2::ZERO); /** Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary. */ @@ -47,7 +47,7 @@ public: protected: - FontFNT(BMFontConfiguration *theContfig, const Vector2& imageOffset = Vector2::ZERO); + FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset = Vec2::ZERO); /** * @js NA * @lua NA @@ -59,7 +59,7 @@ private: int getHorizontalKerningForChars(unsigned short firstChar, unsigned short secondChar) const; BMFontConfiguration * _configuration; - Vector2 _imageOffset; + Vec2 _imageOffset; }; diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index 96f927363a..dc7b879de9 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -186,8 +186,8 @@ void GridBase::set2DProjection() glViewport(0, 0, (GLsizei)(size.width), (GLsizei)(size.height) ); director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - Matrix orthoMatrix; - Matrix::createOrthographicOffCenter(0, size.width, 0, size.height, -1, 1, &orthoMatrix); + Mat4 orthoMatrix; + Mat4::createOrthographicOffCenter(0, size.width, 0, size.height, -1, 1, &orthoMatrix); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -217,7 +217,7 @@ void GridBase::afterDraw(cocos2d::Node *target) // if (target->getCamera()->isDirty()) // { -// Vector2 offset = target->getAnchorPointInPoints(); +// Vec2 offset = target->getAnchorPointInPoints(); // // // // // XXX: Camera should be applied in the AnchorPoint @@ -326,11 +326,11 @@ void Grid3D::blit(void) unsigned int numOfPoints = (_gridSize.width+1) * (_gridSize.height+1); // position - setGLBufferData(_vertices, numOfPoints * sizeof(Vector3), 0); + setGLBufferData(_vertices, numOfPoints * sizeof(Vec3), 0); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0); // texCoords - setGLBufferData(_texCoordinates, numOfPoints * sizeof(Vector2), 1); + setGLBufferData(_texCoordinates, numOfPoints * sizeof(Vec2), 1); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, 0); setGLIndexData(_indices, n * 12, 0); @@ -361,9 +361,9 @@ void Grid3D::calculateVertexPoints(void) unsigned int numOfPoints = (_gridSize.width+1) * (_gridSize.height+1); - _vertices = malloc(numOfPoints * sizeof(Vector3)); - _originalVertices = malloc(numOfPoints * sizeof(Vector3)); - _texCoordinates = malloc(numOfPoints * sizeof(Vector2)); + _vertices = malloc(numOfPoints * sizeof(Vec3)); + _originalVertices = malloc(numOfPoints * sizeof(Vec3)); + _texCoordinates = malloc(numOfPoints * sizeof(Vec2)); _indices = (GLushort*)malloc(_gridSize.width * _gridSize.height * sizeof(GLushort) * 6); GLfloat *vertArray = (GLfloat*)_vertices; @@ -391,15 +391,15 @@ void Grid3D::calculateVertexPoints(void) memcpy(&idxArray[6*idx], tempidx, 6*sizeof(GLushort)); int l1[4] = {a*3, b*3, c*3, d*3}; - Vector3 e(x1, y1, 0); - Vector3 f(x2, y1, 0); - Vector3 g(x2, y2, 0); - Vector3 h(x1, y2, 0); + Vec3 e(x1, y1, 0); + Vec3 f(x2, y1, 0); + Vec3 g(x2, y2, 0); + Vec3 h(x1, y2, 0); - Vector3 l2[4] = {e, f, g, h}; + Vec3 l2[4] = {e, f, g, h}; int tex1[4] = {a*2, b*2, c*2, d*2}; - Vector2 Tex2F[4] = {Vector2(x1, y1), Vector2(x2, y1), Vector2(x2, y2), Vector2(x1, y2)}; + Vec2 Tex2F[4] = {Vec2(x1, y1), Vec2(x2, y1), Vec2(x2, y2), Vec2(x1, y2)}; for (i = 0; i < 4; ++i) { @@ -420,34 +420,34 @@ void Grid3D::calculateVertexPoints(void) } } - memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vector3)); + memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vec3)); } -Vector3 Grid3D::getVertex(const Vector2& pos) const +Vec3 Grid3D::getVertex(const Vec2& pos) const { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int index = (pos.x * (_gridSize.height+1) + pos.y) * 3; float *vertArray = (float*)_vertices; - Vector3 vert(vertArray[index], vertArray[index+1], vertArray[index+2]); + Vec3 vert(vertArray[index], vertArray[index+1], vertArray[index+2]); return vert; } -Vector3 Grid3D::getOriginalVertex(const Vector2& pos) const +Vec3 Grid3D::getOriginalVertex(const Vec2& pos) const { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int index = (pos.x * (_gridSize.height+1) + pos.y) * 3; float *vertArray = (float*)_originalVertices; - Vector3 vert(vertArray[index], vertArray[index+1], vertArray[index+2]); + Vec3 vert(vertArray[index], vertArray[index+1], vertArray[index+2]); return vert; } -void Grid3D::setVertex(const Vector2& pos, const Vector3& vertex) +void Grid3D::setVertex(const Vec2& pos, const Vec3& vertex) { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int index = (pos.x * (_gridSize.height + 1) + pos.y) * 3; @@ -461,7 +461,7 @@ void Grid3D::reuse(void) { if (_reuseGrid > 0) { - memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vector3)); + memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vec3)); --_reuseGrid; } } @@ -541,11 +541,11 @@ void TiledGrid3D::blit(void) int numQuads = _gridSize.width * _gridSize.height; // position - setGLBufferData(_vertices, (numQuads*4*sizeof(Vector3)), 0); + setGLBufferData(_vertices, (numQuads*4*sizeof(Vec3)), 0); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0); // texCoords - setGLBufferData(_texCoordinates, (numQuads*4*sizeof(Vector2)), 1); + setGLBufferData(_texCoordinates, (numQuads*4*sizeof(Vec2)), 1); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, 0, 0); setGLIndexData(_indices, n * 12, 0); @@ -576,9 +576,9 @@ void TiledGrid3D::calculateVertexPoints(void) CC_SAFE_FREE(_texCoordinates); CC_SAFE_FREE(_indices); - _vertices = malloc(numQuads*4*sizeof(Vector3)); - _originalVertices = malloc(numQuads*4*sizeof(Vector3)); - _texCoordinates = malloc(numQuads*4*sizeof(Vector2)); + _vertices = malloc(numQuads*4*sizeof(Vec3)); + _originalVertices = malloc(numQuads*4*sizeof(Vec3)); + _texCoordinates = malloc(numQuads*4*sizeof(Vec2)); _indices = (GLushort*)malloc(numQuads*6*sizeof(GLushort)); GLfloat *vertArray = (GLfloat*)_vertices; @@ -643,7 +643,7 @@ void TiledGrid3D::calculateVertexPoints(void) memcpy(_originalVertices, _vertices, numQuads * 12 * sizeof(GLfloat)); } -void TiledGrid3D::setTile(const Vector2& pos, const Quad3& coords) +void TiledGrid3D::setTile(const Vec2& pos, const Quad3& coords) { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; @@ -651,7 +651,7 @@ void TiledGrid3D::setTile(const Vector2& pos, const Quad3& coords) memcpy(&vertArray[idx], &coords, sizeof(Quad3)); } -Quad3 TiledGrid3D::getOriginalTile(const Vector2& pos) const +Quad3 TiledGrid3D::getOriginalTile(const Vec2& pos) const { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; @@ -663,7 +663,7 @@ Quad3 TiledGrid3D::getOriginalTile(const Vector2& pos) const return ret; } -Quad3 TiledGrid3D::getTile(const Vector2& pos) const +Quad3 TiledGrid3D::getTile(const Vec2& pos) const { CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , "Numbers must be integers"); int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; diff --git a/cocos/2d/CCGrid.h b/cocos/2d/CCGrid.h index 98d1ee1d1d..9d59f24ce7 100644 --- a/cocos/2d/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -77,8 +77,8 @@ public: inline void setGridSize(const Size& gridSize) { _gridSize = gridSize; } /** pixels between the grids */ - inline const Vector2& getStep(void) const { return _step; } - inline void setStep(const Vector2& step) { _step = step; } + inline const Vec2& getStep(void) const { return _step; } + inline void setStep(const Vec2& step) { _step = step; } /** is texture flipped */ inline bool isTextureFlipped(void) const { return _isTextureFlipped; } @@ -97,7 +97,7 @@ protected: int _reuseGrid; Size _gridSize; Texture2D *_texture; - Vector2 _step; + Vec2 _step; Grabber *_grabber; bool _isTextureFlipped; GLProgram* _shaderProgram; @@ -131,28 +131,28 @@ public: * @js NA * @lua NA */ - Vector3 getVertex(const Vector2& pos) const; + Vec3 getVertex(const Vec2& pos) const; /** @deprecated Use getVertex() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Vector3 vertex(const Vector2& pos) const { return getVertex(pos); } + CC_DEPRECATED_ATTRIBUTE Vec3 vertex(const Vec2& pos) const { return getVertex(pos); } /** returns the original (non-transformed) vertex at a given position * @js NA * @lua NA */ - Vector3 getOriginalVertex(const Vector2& pos) const; + Vec3 getOriginalVertex(const Vec2& pos) const; /** @deprecated Use getOriginalVertex() instead * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Vector3 originalVertex(const Vector2& pos) const { return getOriginalVertex(pos); } + CC_DEPRECATED_ATTRIBUTE Vec3 originalVertex(const Vec2& pos) const { return getOriginalVertex(pos); } /** sets a new vertex at a given position * @js NA * @lua NA */ - void setVertex(const Vector2& pos, const Vector3& vertex); + void setVertex(const Vec2& pos, const Vec3& vertex); // Overrides virtual void blit() override; @@ -194,28 +194,28 @@ public: * @js NA * @lua NA */ - Quad3 getTile(const Vector2& pos) const; + Quad3 getTile(const Vec2& pos) const; /** returns the tile at the given position * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vector2& pos) const { return getTile(pos); } + CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vec2& pos) const { return getTile(pos); } /** returns the original tile (untransformed) at the given position * @js NA * @lua NA */ - Quad3 getOriginalTile(const Vector2& pos) const; + Quad3 getOriginalTile(const Vec2& pos) const; /** returns the original tile (untransformed) at the given position * @js NA * @lua NA */ - CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vector2& pos) const { return getOriginalTile(pos); } + CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vec2& pos) const { return getOriginalTile(pos); } /** sets a new tile * @js NA * @lua NA */ - void setTile(const Vector2& pos, const Quad3& coords); + void setTile(const Vec2& pos, const Quad3& coords); // Overrides virtual void blit() override; diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index e5a2e5863a..0202070200 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -129,7 +129,7 @@ Label* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text, return nullptr; } -Label* Label::createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment /* = TextHAlignment::LEFT */, int maxLineWidth /* = 0 */, const Vector2& imageOffset /* = Vector2::ZERO */) +Label* Label::createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment /* = TextHAlignment::LEFT */, int maxLineWidth /* = 0 */, const Vec2& imageOffset /* = Vec2::ZERO */) { auto ret = new Label(nullptr,alignment); @@ -262,7 +262,7 @@ Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = Te , _insideBounds(true) , _effectColorF(Color4F::BLACK) { - setAnchorPoint(Vector2::ANCHOR_MIDDLE); + setAnchorPoint(Vec2::ANCHOR_MIDDLE); reset(); #if CC_ENABLE_CACHE_TEXTURE_DATA @@ -395,7 +395,7 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false * _reusedLetter = Sprite::createWithTexture(_fontAtlas->getTexture(0)); _reusedLetter->setOpacityModifyRGB(_isOpacityModifyRGB); _reusedLetter->retain(); - _reusedLetter->setAnchorPoint(Vector2::ANCHOR_TOP_LEFT); + _reusedLetter->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); _reusedLetter->setBatchNode(this); } else @@ -454,7 +454,7 @@ bool Label::setTTFConfig(const TTFConfig& ttfConfig) return true; } -bool Label::setBMFontFilePath(const std::string& bmfontFilePath, const Vector2& imageOffset /* = Vector2::ZERO */) +bool Label::setBMFontFilePath(const std::string& bmfontFilePath, const Vec2& imageOffset /* = Vec2::ZERO */) { FontAtlas *newAtlas = FontAtlasCache::getFontAtlasFNT(bmfontFilePath,imageOffset); @@ -597,8 +597,8 @@ void Label::alignText() for (auto index = _batchNodes.size(); index < textures.size(); ++index) { auto batchNode = SpriteBatchNode::createWithTexture(textures[index]); - batchNode->setAnchorPoint(Vector2::ANCHOR_TOP_LEFT); - batchNode->setPosition(Vector2::ZERO); + batchNode->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); + batchNode->setPosition(Vec2::ZERO); Node::addChild(batchNode,0,Node::INVALID_TAG); _batchNodes.push_back(batchNode); } @@ -680,7 +680,7 @@ void Label::updateQuads() } } -bool Label::recordLetterInfo(const cocos2d::Vector2& point,const FontLetterDefinition& letterDef, int spriteIndex) +bool Label::recordLetterInfo(const cocos2d::Vec2& point,const FontLetterDefinition& letterDef, int spriteIndex) { if (static_cast(spriteIndex) >= _lettersInfo.size()) { @@ -809,7 +809,7 @@ void Label::setFontScale(float fontScale) Node::setScale(_fontScale); } -void Label::onDraw(const Matrix& transform, bool transformUpdated) +void Label::onDraw(const Mat4& transform, bool transformUpdated) { CC_PROFILER_START("Label - draw"); @@ -877,7 +877,7 @@ void Label::drawShadowWithoutBlur() setColor(oldColor); } -void Label::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Label::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { // Don't do calculate the culling if the transform was not updated _insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; @@ -897,7 +897,7 @@ void Label::createSpriteWithFontDefinition() texture->initWithString(_originalUTF8String.c_str(),_fontDefinition); _textSprite = Sprite::createWithTexture(texture); - _textSprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _textSprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); this->setContentSize(_textSprite->getContentSize()); texture->release(); if (_blendFuncDirty) @@ -1035,7 +1035,7 @@ void Label::drawTextSprite(Renderer *renderer, bool parentTransformUpdated) { _shadowNode->setBlendFunc(_blendFunc); } - _shadowNode->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _shadowNode->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _shadowNode->setColor(_shadowColor); _shadowNode->setOpacity(_shadowOpacity * _displayedOpacity); _shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height); @@ -1049,7 +1049,7 @@ void Label::drawTextSprite(Renderer *renderer, bool parentTransformUpdated) _textSprite->visit(renderer, _modelViewTransform, parentTransformUpdated); } -void Label::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Label::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (! _visible || _originalUTF8String.empty()) { @@ -1088,7 +1088,7 @@ void Label::visit(Renderer *renderer, const Matrix &parentTransform, bool parent _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1161,7 +1161,7 @@ Sprite * Label::getLetter(int letterIndex) sp = Sprite::createWithTexture(_fontAtlas->getTexture(letter.def.textureID),uvRect); sp->setBatchNode(_batchNodes[letter.def.textureID]); - sp->setPosition(Vector2(letter.position.x + uvRect.size.width / 2, + sp->setPosition(Vec2(letter.position.x + uvRect.size.width / 2, letter.position.y - uvRect.size.height / 2)); sp->setOpacity(_realOpacity); diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index f8c7a1ab77..7af8134507 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -104,7 +104,7 @@ public: /* Creates a label with an FNT file,an initial string,horizontal alignment,max line width and the offset of image*/ static Label* createWithBMFont(const std::string& bmfontFilePath, const std::string& text, const TextHAlignment& alignment = TextHAlignment::LEFT, int maxLineWidth = 0, - const Vector2& imageOffset = Vector2::ZERO); + const Vec2& imageOffset = Vec2::ZERO); static Label * createWithCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap); static Label * createWithCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap); @@ -114,7 +114,7 @@ public: virtual bool setTTFConfig(const TTFConfig& ttfConfig); virtual const TTFConfig& getTTFConfig() const { return _fontConfig;} - virtual bool setBMFontFilePath(const std::string& bmfontFilePath, const Vector2& imageOffset = Vector2::ZERO); + virtual bool setBMFontFilePath(const std::string& bmfontFilePath, const Vec2& imageOffset = Vec2::ZERO); const std::string& getBMFontFilePath() const { return _bmFontPath;} virtual bool setCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap); @@ -237,8 +237,8 @@ public: virtual Rect getBoundingBox() const override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; CC_DEPRECATED_ATTRIBUTE static Label* create(const std::string& text, const std::string& font, float fontSize, const Size& dimensions = Size::ZERO, TextHAlignment hAlignment = TextHAlignment::LEFT, @@ -248,13 +248,13 @@ public: CC_DEPRECATED_ATTRIBUTE const FontDefinition& getFontDefinition() const { return _fontDefinition; } protected: - void onDraw(const Matrix& transform, bool transformUpdated); + void onDraw(const Mat4& transform, bool transformUpdated); struct LetterInfo { FontLetterDefinition def; - Vector2 position; + Vec2 position; Size contentSize; int atlasIndex; }; @@ -279,7 +279,7 @@ protected: virtual void setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled = false, bool useA8Shader = false); - bool recordLetterInfo(const cocos2d::Vector2& point,const FontLetterDefinition& letterDef, int spriteIndex); + bool recordLetterInfo(const cocos2d::Vec2& point,const FontLetterDefinition& letterDef, int spriteIndex); bool recordPlaceholderInfo(int spriteIndex); void setFontScale(float fontScale); @@ -363,7 +363,7 @@ protected: bool _shadowEnabled; Size _shadowOffset; int _shadowBlurRadius; - Matrix _shadowTransform; + Mat4 _shadowTransform; Color3B _shadowColor; float _shadowOpacity; Sprite* _shadowNode; diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index dbdcee017f..ee8b209331 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -249,7 +249,7 @@ void LabelAtlas::updateColor() //CCLabelAtlas - draw #if CC_LABELATLAS_DEBUG_DRAW -void LabelAtlas::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelAtlas::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { AtlasNode::draw(renderer, transform, transformUpdated); @@ -258,7 +258,7 @@ void LabelAtlas::draw(Renderer *renderer, const Matrix &transform, bool transfor renderer->addCommand(&_customDebugDrawCommand); } -void LabelAtlas::drawDebugData(const Matrix& transform, bool transformUpdated) +void LabelAtlas::drawDebugData(const Mat4& transform, bool transformUpdated) { Director* director = Director::getInstance(); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -266,12 +266,12 @@ void LabelAtlas::drawDebugData(const Matrix& transform, bool transformUpdated) auto size = getContentSize(); - Vector2 vertices[4]= + Vec2 vertices[4]= { - Vector2::ZERO, - Vector2(size.width, 0), - Vector2(size.width, size.height), - Vector2(0, size.height) + Vec2::ZERO, + Vec2(size.width, 0), + Vec2(size.width, size.height), + Vec2(0, size.height) }; DrawPrimitives::drawPoly(vertices, 4, true); diff --git a/cocos/2d/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h index c2e11ce0f4..1ef43bec2a 100644 --- a/cocos/2d/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -84,7 +84,7 @@ public: virtual std::string getDescription() const override; #if CC_LABELATLAS_DEBUG_DRAW - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; #endif protected: @@ -100,7 +100,7 @@ protected: #if CC_LABELATLAS_DEBUG_DRAW CustomCommand _customDebugDrawCommand; - void drawDebugData(const Matrix& transform, bool transformUpdated); + void drawDebugData(const Mat4& transform, bool transformUpdated); #endif // string to render diff --git a/cocos/2d/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp index 283030f9f2..7dfe8b846c 100644 --- a/cocos/2d/CCLabelBMFont.cpp +++ b/cocos/2d/CCLabelBMFont.cpp @@ -65,7 +65,7 @@ LabelBMFont * LabelBMFont::create() } //LabelBMFont - Creation & Init -LabelBMFont *LabelBMFont::create(const std::string& str, const std::string& fntFile, float width /* = 0 */, TextHAlignment alignment /* = TextHAlignment::LEFT */,const Vector2& imageOffset /* = Vector2::ZERO */) +LabelBMFont *LabelBMFont::create(const std::string& str, const std::string& fntFile, float width /* = 0 */, TextHAlignment alignment /* = TextHAlignment::LEFT */,const Vec2& imageOffset /* = Vec2::ZERO */) { LabelBMFont *ret = new LabelBMFont(); if(ret && ret->initWithString(str, fntFile, width, alignment,imageOffset)) @@ -77,7 +77,7 @@ LabelBMFont *LabelBMFont::create(const std::string& str, const std::string& fntF return nullptr; } -bool LabelBMFont::initWithString(const std::string& str, const std::string& fntFile, float width /* = 0 */, TextHAlignment alignment /* = TextHAlignment::LEFT */,const Vector2& imageOffset /* = Vector2::ZERO */) +bool LabelBMFont::initWithString(const std::string& str, const std::string& fntFile, float width /* = 0 */, TextHAlignment alignment /* = TextHAlignment::LEFT */,const Vec2& imageOffset /* = Vec2::ZERO */) { if (_label->setBMFontFilePath(fntFile,imageOffset)) { @@ -95,9 +95,9 @@ bool LabelBMFont::initWithString(const std::string& str, const std::string& fntF LabelBMFont::LabelBMFont() { _label = Label::create(); - _label->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); this->addChild(_label); - this->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + this->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _cascadeOpacityEnabled = true; } @@ -152,7 +152,7 @@ void LabelBMFont::setLineBreakWithoutSpace( bool breakWithoutSpace ) } // LabelBMFont - FntFile -void LabelBMFont::setFntFile(const std::string& fntFile, const Vector2& imageOffset /* = Vector2::ZERO */) +void LabelBMFont::setFntFile(const std::string& fntFile, const Vec2& imageOffset /* = Vec2::ZERO */) { if (_fntFile.compare(fntFile) != 0) { @@ -207,7 +207,7 @@ Rect LabelBMFont::getBoundingBox() const return _label->getBoundingBox(); } #if CC_LABELBMFONT_DEBUG_DRAW -void LabelBMFont::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelBMFont::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Node::draw(renderer, transform, transformUpdated); @@ -216,7 +216,7 @@ void LabelBMFont::draw(Renderer *renderer, const Matrix &transform, bool transfo renderer->addCommand(&_customDebugDrawCommand); } -void LabelBMFont::drawDebugData(const Matrix& transform, bool transformUpdated) +void LabelBMFont::drawDebugData(const Mat4& transform, bool transformUpdated) { Director* director = Director::getInstance(); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -224,12 +224,12 @@ void LabelBMFont::drawDebugData(const Matrix& transform, bool transformUpdated) auto size = getContentSize(); - Vector2 vertices[4]= + Vec2 vertices[4]= { - Vector2::ZERO, - Vector2(size.width, 0), - Vector2(size.width, size.height), - Vector2(0, size.height) + Vec2::ZERO, + Vec2(size.width, 0), + Vec2(size.width, size.height), + Vec2(0, size.height) }; DrawPrimitives::drawPoly(vertices, 4, true); diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index 0a9b7bdf04..5479adf0a3 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -85,14 +85,14 @@ public: virtual ~LabelBMFont(); /** creates a bitmap font atlas with an initial string and the FNT file */ - static LabelBMFont * create(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vector2& imageOffset = Vector2::ZERO); + static LabelBMFont * create(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vec2& imageOffset = Vec2::ZERO); /** Creates an label. */ static LabelBMFont * create(); /** init a bitmap font atlas with an initial string and the FNT file */ - bool initWithString(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vector2& imageOffset = Vector2::ZERO); + bool initWithString(const std::string& str, const std::string& fntFile, float width = 0, TextHAlignment alignment = TextHAlignment::LEFT,const Vec2& imageOffset = Vec2::ZERO); // super method virtual void setString(const std::string& newString) override; @@ -107,7 +107,7 @@ public: virtual bool isOpacityModifyRGB() const; virtual void setOpacityModifyRGB(bool isOpacityModifyRGB); - void setFntFile(const std::string& fntFile, const Vector2& imageOffset = Vector2::ZERO); + void setFntFile(const std::string& fntFile, const Vec2& imageOffset = Vec2::ZERO); const std::string& getFntFile() const; virtual void setBlendFunc(const BlendFunc &blendFunc) override; @@ -124,13 +124,13 @@ public: virtual std::string getDescription() const override; #if CC_LABELBMFONT_DEBUG_DRAW - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; #endif private: #if CC_LABELBMFONT_DEBUG_DRAW CustomCommand _customDebugDrawCommand; - void drawDebugData(const Matrix& transform, bool transformUpdated); + void drawDebugData(const Mat4& transform, bool transformUpdated); #endif // name of fntFile diff --git a/cocos/2d/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp index e5ba3b7cb8..adf94e8f3e 100644 --- a/cocos/2d/CCLabelTTF.cpp +++ b/cocos/2d/CCLabelTTF.cpp @@ -39,9 +39,9 @@ NS_CC_BEGIN LabelTTF::LabelTTF() { _renderLabel = Label::create(); - _renderLabel->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _renderLabel->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); this->addChild(_renderLabel); - this->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + this->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _contentDirty = false; _cascadeColorEnabled = true; @@ -262,7 +262,7 @@ void LabelTTF::setFlippedY(bool flippedY) } } -void LabelTTF::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void LabelTTF::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (_contentDirty) { diff --git a/cocos/2d/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h index e5731dc02c..f65992fa99 100644 --- a/cocos/2d/CCLabelTTF.h +++ b/cocos/2d/CCLabelTTF.h @@ -150,7 +150,7 @@ public: * @lua NA */ virtual std::string getDescription() const override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; virtual const Size& getContentSize() const override; protected: Label* _renderLabel; diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 9dfd813039..a64ba30140 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -310,7 +310,7 @@ bool LabelTextFormatter::createStringSprites(Label *theLabel) auto strWhole = theLabel->_currentUTF16String; auto fontAtlas = theLabel->_fontAtlas; FontLetterDefinition tempDefinition; - Vector2 letterPosition; + Vec2 letterPosition; const auto& kernings = theLabel->_horizontalKernings; float clipTop = 0; diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 621012bc2d..de60f31a02 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -65,7 +65,7 @@ Layer::Layer() , _swallowsTouches(true) { _ignoreAnchorPointForPosition = true; - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); } Layer::~Layer() @@ -584,7 +584,7 @@ void LayerColor::updateColor() } } -void LayerColor::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LayerColor::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this, transform, transformUpdated); @@ -592,15 +592,15 @@ void LayerColor::draw(Renderer *renderer, const Matrix &transform, bool transfor for(int i = 0; i < 4; ++i) { - Vector4 pos; + Vec4 pos; pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _positionZ; pos.w = 1; _modelViewTransform.transformVector(&pos); - _noMVPVertices[i] = Vector3(pos.x,pos.y,pos.z)/pos.w; + _noMVPVertices[i] = Vec3(pos.x,pos.y,pos.z)/pos.w; } } -void LayerColor::onDraw(const Matrix& transform, bool transformUpdated) +void LayerColor::onDraw(const Mat4& transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -610,7 +610,7 @@ void LayerColor::onDraw(const Matrix& transform, bool transformUpdated) // Attributes // #ifdef EMSCRIPTEN - setGLBufferData(_noMVPVertices, 4 * sizeof(Vector3), 0); + setGLBufferData(_noMVPVertices, 4 * sizeof(Vec3), 0); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0); setGLBufferData(_squareColors, 4 * sizeof(Color4F), 1); @@ -640,7 +640,7 @@ LayerGradient::LayerGradient() , _endColor(Color4B::BLACK) , _startOpacity(255) , _endOpacity(255) -, _alongVector(Vector2(0, -1)) +, _alongVector(Vec2(0, -1)) , _compressedInterpolation(true) { @@ -662,7 +662,7 @@ LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end) return nullptr; } -LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Vector2& v) +LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Vec2& v) { LayerGradient * layer = new LayerGradient(); if( layer && layer->initWithColor(start, end, v)) @@ -695,10 +695,10 @@ bool LayerGradient::init() bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end) { - return initWithColor(start, end, Vector2(0, -1)); + return initWithColor(start, end, Vec2(0, -1)); } -bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, const Vector2& v) +bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, const Vec2& v) { _endColor.r = end.r; _endColor.g = end.g; @@ -722,7 +722,7 @@ void LayerGradient::updateColor() return; float c = sqrtf(2.0f); - Vector2 u = Vector2(_alongVector.x / h, _alongVector.y / h); + Vec2 u = Vec2(_alongVector.x / h, _alongVector.y / h); // Compressed Interpolation mode if (_compressedInterpolation) @@ -812,13 +812,13 @@ GLubyte LayerGradient::getEndOpacity() const return _endOpacity; } -void LayerGradient::setVector(const Vector2& var) +void LayerGradient::setVector(const Vec2& var) { _alongVector = var; updateColor(); } -const Vector2& LayerGradient::getVector() const +const Vec2& LayerGradient::getVector() const { return _alongVector; } diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index f6e944b57a..363d2aab8e 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -270,7 +270,7 @@ public: // // Overrides // - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void setContentSize(const Size & var) override; /** BlendFunction. Conforms to BlendProtocol protocol */ @@ -299,15 +299,15 @@ CC_CONSTRUCTOR_ACCESS: bool initWithColor(const Color4B& color); protected: - void onDraw(const Matrix& transform, bool transformUpdated); + void onDraw(const Mat4& transform, bool transformUpdated); virtual void updateColor() override; BlendFunc _blendFunc; - Vector2 _squareVertices[4]; + Vec2 _squareVertices[4]; Color4F _squareColors[4]; CustomCommand _customCommand; - Vector3 _noMVPVertices[4]; + Vec3 _noMVPVertices[4]; private: CC_DISALLOW_COPY_AND_ASSIGN(LayerColor); @@ -345,7 +345,7 @@ public: static LayerGradient* create(const Color4B& start, const Color4B& end); /** Creates a full-screen Layer with a gradient between start and end in the direction of v. */ - static LayerGradient* create(const Color4B& start, const Color4B& end, const Vector2& v); + static LayerGradient* create(const Color4B& start, const Color4B& end, const Vec2& v); /** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors Default: true @@ -376,9 +376,9 @@ public: /** Sets the directional vector that will be used for the gradient. The default value is vertical direction (0,-1). */ - void setVector(const Vector2& alongVector); + void setVector(const Vec2& alongVector); /** Returns the directional vector used for the gradient */ - const Vector2& getVector() const; + const Vec2& getVector() const; virtual std::string getDescription() const override; @@ -397,7 +397,7 @@ CC_CONSTRUCTOR_ACCESS: * @js init * @lua init */ - bool initWithColor(const Color4B& start, const Color4B& end, const Vector2& v); + bool initWithColor(const Color4B& start, const Color4B& end, const Vec2& v); protected: virtual void updateColor() override; @@ -406,7 +406,7 @@ protected: Color3B _endColor; GLubyte _startOpacity; GLubyte _endOpacity; - Vector2 _alongVector; + Vec2 _alongVector; bool _compressedInterpolation; }; diff --git a/cocos/2d/CCMenu.cpp b/cocos/2d/CCMenu.cpp index 91bdcba688..8d2fb39307 100644 --- a/cocos/2d/CCMenu.cpp +++ b/cocos/2d/CCMenu.cpp @@ -138,10 +138,10 @@ bool Menu::initWithArray(const Vector& arrayOfItems) Size s = Director::getInstance()->getWinSize(); this->ignoreAnchorPointForPosition(true); - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); this->setContentSize(s); - setPosition(Vector2(s.width/2, s.height/2)); + setPosition(Vec2(s.width/2, s.height/2)); int z=0; @@ -315,7 +315,7 @@ void Menu::alignItemsVerticallyWithPadding(float padding) float y = height / 2.0f; for(const auto &child : _children) { - child->setPosition(Vector2(0, y - child->getContentSize().height * child->getScaleY() / 2.0f)); + child->setPosition(Vec2(0, y - child->getContentSize().height * child->getScaleY() / 2.0f)); y -= child->getContentSize().height * child->getScaleY() + padding; } } @@ -334,7 +334,7 @@ void Menu::alignItemsHorizontallyWithPadding(float padding) float x = -width / 2.0f; for(const auto &child : _children) { - child->setPosition(Vector2(x + child->getContentSize().width * child->getScaleX() / 2.0f, 0)); + child->setPosition(Vec2(x + child->getContentSize().width * child->getScaleX() / 2.0f, 0)); x += child->getContentSize().width * child->getScaleX() + padding; } } @@ -413,7 +413,7 @@ void Menu::alignItemsInColumnsWithArray(const ValueVector& rows) float tmp = child->getContentSize().height; rowHeight = (unsigned int)((rowHeight >= tmp || isnan(tmp)) ? rowHeight : tmp); - child->setPosition(Vector2(x - winSize.width / 2, + child->setPosition(Vec2(x - winSize.width / 2, y - child->getContentSize().height / 2)); x += w; @@ -514,7 +514,7 @@ void Menu::alignItemsInRowsWithArray(const ValueVector& columns) float tmp = child->getContentSize().width; columnWidth = (unsigned int)((columnWidth >= tmp || isnan(tmp)) ? columnWidth : tmp); - child->setPosition(Vector2(x + columnWidths[column] / 2, + child->setPosition(Vec2(x + columnWidths[column] / 2, y - winSize.height / 2)); y -= child->getContentSize().height + 10; @@ -533,7 +533,7 @@ void Menu::alignItemsInRowsWithArray(const ValueVector& columns) MenuItem* Menu::getItemForTouch(Touch *touch) { - Vector2 touchLocation = touch->getLocation(); + Vec2 touchLocation = touch->getLocation(); if (!_children.empty()) { @@ -542,9 +542,9 @@ MenuItem* Menu::getItemForTouch(Touch *touch) MenuItem* child = dynamic_cast(*iter); if (child && child->isVisible() && child->isEnabled()) { - Vector2 local = child->convertToNodeSpace(touchLocation); + Vec2 local = child->convertToNodeSpace(touchLocation); Rect r = child->rect(); - r.origin = Vector2::ZERO; + r.origin = Vec2::ZERO; if (r.containsPoint(local)) { diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index a8ae9bc683..79891fbb9a 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -90,7 +90,7 @@ bool MenuItem::initWithTarget(cocos2d::Ref *target, SEL_MenuHandler selector ) bool MenuItem::initWithCallback(const ccMenuCallback& callback) { - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); _callback = callback; _enabled = true; _selected = false; @@ -179,7 +179,7 @@ void MenuItemLabel::setLabel(Node* var) { if (var) { - var->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + var->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); setContentSize(var->getContentSize()); addChild(var); } @@ -483,7 +483,7 @@ void MenuItemSprite::setNormalImage(Node* image) if (image) { addChild(image, 0, kNormalTag); - image->setAnchorPoint(Vector2(0, 0)); + image->setAnchorPoint(Vec2(0, 0)); } if (_normalImage) @@ -504,7 +504,7 @@ void MenuItemSprite::setSelectedImage(Node* image) if (image) { addChild(image, 0, kSelectedTag); - image->setAnchorPoint(Vector2(0, 0)); + image->setAnchorPoint(Vec2(0, 0)); } if (_selectedImage) @@ -524,7 +524,7 @@ void MenuItemSprite::setDisabledImage(Node* image) if (image) { addChild(image, 0, kDisableTag); - image->setAnchorPoint(Vector2(0, 0)); + image->setAnchorPoint(Vec2(0, 0)); } if (_disabledImage) @@ -935,7 +935,7 @@ void MenuItemToggle::setSelectedIndex(unsigned int index) this->addChild(item, 0, kCurrentItem); Size s = item->getContentSize(); this->setContentSize(s); - item->setPosition( Vector2( s.width/2, s.height/2 ) ); + item->setPosition( Vec2( s.width/2, s.height/2 ) ); } } diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index 3ec2972d44..09fa33dc68 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -41,7 +41,7 @@ MotionStreak::MotionStreak() , _startingPositionInitialized(false) , _texture(nullptr) , _blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED) -, _positionR(Vector2::ZERO) +, _positionR(Vec2::ZERO) , _stroke(0.0f) , _fadeDelta(0.0f) , _minSeg(0.0f) @@ -102,12 +102,12 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Co bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { - Node::setPosition(Vector2::ZERO); - setAnchorPoint(Vector2::ZERO); + Node::setPosition(Vec2::ZERO); + setAnchorPoint(Vec2::ZERO); ignoreAnchorPointForPosition(true); _startingPositionInitialized = false; - _positionR = Vector2::ZERO; + _positionR = Vec2::ZERO; _fastMode = true; _minSeg = (minSeg == -1.0f) ? stroke/5.0f : minSeg; _minSeg *= _minSeg; @@ -118,9 +118,9 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Co _maxPoints = (int)(fade*60.0f)+2; _nuPoints = 0; _pointState = (float *)malloc(sizeof(float) * _maxPoints); - _pointVertexes = (Vector2*)malloc(sizeof(Vector2) * _maxPoints); + _pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints); - _vertices = (Vector2*)malloc(sizeof(Vector2) * _maxPoints * 2); + _vertices = (Vec2*)malloc(sizeof(Vec2) * _maxPoints * 2); _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2); _colorPointer = (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); @@ -137,7 +137,7 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Co return true; } -void MotionStreak::setPosition(const Vector2& position) +void MotionStreak::setPosition(const Vec2& position) { if (!_startingPositionInitialized) { _startingPositionInitialized = true; @@ -154,7 +154,7 @@ void MotionStreak::setPosition(float x, float y) _positionR.y = y; } -const Vector2& MotionStreak::getPosition() const +const Vec2& MotionStreak::getPosition() const { return _positionR; } @@ -373,7 +373,7 @@ void MotionStreak::reset() _nuPoints = 0; } -void MotionStreak::onDraw(const Matrix &transform, bool transformUpdated) +void MotionStreak::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -385,7 +385,7 @@ void MotionStreak::onDraw(const Matrix &transform, bool transformUpdated) #ifdef EMSCRIPTEN // Size calculations from ::initWithFade - setGLBufferData(_vertices, (sizeof(Vector2) * _maxPoints * 2), 0); + setGLBufferData(_vertices, (sizeof(Vec2) * _maxPoints * 2), 0); glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0); setGLBufferData(_texCoords, (sizeof(Tex2F) * _maxPoints * 2), 1); @@ -403,7 +403,7 @@ void MotionStreak::onDraw(const Matrix &transform, bool transformUpdated) CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _nuPoints*2); } -void MotionStreak::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void MotionStreak::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if(_nuPoints <= 1) return; diff --git a/cocos/2d/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h index 295ca3a9ec..20cfcf87ef 100644 --- a/cocos/2d/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -73,9 +73,9 @@ public: } // Overrides - virtual void setPosition(const Vector2& position) override; + virtual void setPosition(const Vec2& position) override; virtual void setPosition(float x, float y) override; - virtual const Vector2& getPosition() const override; + virtual const Vec2& getPosition() const override; virtual void getPosition(float* x, float* y) const override; virtual void setPositionX(float x) override; virtual void setPositionY(float y) override; @@ -85,7 +85,7 @@ public: * @js NA * @lua NA */ - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; /** * @js NA * @lua NA @@ -120,7 +120,7 @@ CC_CONSTRUCTOR_ACCESS: protected: //renderer callback - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); bool _fastMode; bool _startingPositionInitialized; @@ -128,7 +128,7 @@ protected: /** texture used for the motion streak */ Texture2D* _texture; BlendFunc _blendFunc; - Vector2 _positionR; + Vec2 _positionR; float _stroke; float _fadeDelta; @@ -139,11 +139,11 @@ protected: unsigned int _previousNuPoints; /** Pointers */ - Vector2* _pointVertexes; + Vec2* _pointVertexes; float* _pointState; // Opengl - Vector2* _vertices; + Vec2* _vertices; GLubyte* _colorPointer; Tex2F* _texCoords; diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 2d3ba688e9..461550ab50 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -81,11 +81,11 @@ Node::Node(void) , _scaleY(1.0f) , _scaleZ(1.0f) , _positionZ(0.0f) -, _position(Vector2::ZERO) +, _position(Vec2::ZERO) , _skewX(0.0f) , _skewY(0.0f) -, _anchorPointInPoints(Vector2::ZERO) -, _anchorPoint(Vector2::ZERO) +, _anchorPointInPoints(Vec2::ZERO) +, _anchorPoint(Vec2::ZERO) , _contentSize(Size::ZERO) , _useAdditionalTransform(false) , _transformDirty(true) @@ -135,7 +135,7 @@ Node::Node(void) ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); _scriptType = engine != nullptr ? engine->getScriptType() : kScriptTypeNone; #endif - _transform = _inverse = _additionalTransform = Matrix::IDENTITY; + _transform = _inverse = _additionalTransform = Mat4::IDENTITY; } Node::~Node() @@ -277,7 +277,7 @@ float Node::getRotationSkewX() const return _rotationZ_X; } -void Node::setRotation3D(const Vector3& rotation) +void Node::setRotation3D(const Vec3& rotation) { if (_rotationX == rotation.x && _rotationY == rotation.y && @@ -301,12 +301,12 @@ void Node::setRotation3D(const Vector3& rotation) #endif } -Vector3 Node::getRotation3D() const +Vec3 Node::getRotation3D() const { // rotation Z is decomposed in 2 to simulate Skew for Flash animations CCASSERT(_rotationZ_X == _rotationZ_Y, "_rotationZ_X != _rotationZ_Y"); - return Vector3(_rotationX,_rotationY,_rotationZ_X); + return Vec3(_rotationX,_rotationY,_rotationZ_X); } void Node::setRotationSkewX(float rotationX) @@ -410,13 +410,13 @@ void Node::setScaleY(float scaleY) /// position getter -const Vector2& Node::getPosition() const +const Vec2& Node::getPosition() const { return _position; } /// position setter -void Node::setPosition(const Vector2& position) +void Node::setPosition(const Vec2& position) { if (_position.equals(position)) return; @@ -441,18 +441,18 @@ void Node::getPosition(float* x, float* y) const void Node::setPosition(float x, float y) { - setPosition(Vector2(x, y)); + setPosition(Vec2(x, y)); } -void Node::setPosition3D(const Vector3& position) +void Node::setPosition3D(const Vec3& position) { _positionZ = position.z; - setPosition(Vector2(position.x, position.y)); + setPosition(Vec2(position.x, position.y)); } -Vector3 Node::getPosition3D() const +Vec3 Node::getPosition3D() const { - Vector3 ret; + Vec3 ret; ret.x = _position.x; ret.y = _position.y; ret.z = _positionZ; @@ -466,7 +466,7 @@ float Node::getPositionX() const void Node::setPositionX(float x) { - setPosition(Vector2(x, _position.y)); + setPosition(Vec2(x, _position.y)); } float Node::getPositionY() const @@ -476,7 +476,7 @@ float Node::getPositionY() const void Node::setPositionY(float y) { - setPosition(Vector2(_position.x, y)); + setPosition(Vec2(_position.x, y)); } float Node::getPositionZ() const @@ -519,21 +519,21 @@ void Node::setVisible(bool var) } } -const Vector2& Node::getAnchorPointInPoints() const +const Vec2& Node::getAnchorPointInPoints() const { return _anchorPointInPoints; } /// anchorPoint getter -const Vector2& Node::getAnchorPoint() const +const Vec2& Node::getAnchorPoint() const { return _anchorPoint; } -void Node::setAnchorPoint(const Vector2& point) +void Node::setAnchorPoint(const Vec2& point) { #if CC_USE_PHYSICS - if (_physicsBody != nullptr && !point.equals(Vector2::ANCHOR_MIDDLE)) + if (_physicsBody != nullptr && !point.equals(Vec2::ANCHOR_MIDDLE)) { CCLOG("Node warning: This node has a physics body, the anchor must be in the middle, you cann't change this to other value."); return; @@ -543,7 +543,7 @@ void Node::setAnchorPoint(const Vector2& point) if( ! point.equals(_anchorPoint)) { _anchorPoint = point; - _anchorPointInPoints = Vector2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y ); + _anchorPointInPoints = Vec2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y ); _transformUpdated = _transformDirty = _inverseDirty = true; } } @@ -560,7 +560,7 @@ void Node::setContentSize(const Size & size) { _contentSize = size; - _anchorPointInPoints = Vector2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y ); + _anchorPointInPoints = Vec2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y ); _transformUpdated = _transformDirty = _inverseDirty = true; } } @@ -943,18 +943,18 @@ void Node::draw() draw(renderer, _modelViewTransform, true); } -void Node::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) +void Node::draw(Renderer* renderer, const Mat4 &transform, bool transformUpdated) { } void Node::visit() { auto renderer = Director::getInstance()->getRenderer(); - Matrix parentTransform = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + Mat4 parentTransform = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); visit(renderer, parentTransform, true); } -void Node::visit(Renderer* renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Node::visit(Renderer* renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // quick return if not visible. children won't be drawn. if (!_visible) @@ -969,7 +969,7 @@ void Node::visit(Renderer* renderer, const Matrix &parentTransform, bool parentT // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1008,9 +1008,9 @@ void Node::visit(Renderer* renderer, const Matrix &parentTransform, bool parentT director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } -Matrix Node::transform(const Matrix& parentTransform) +Mat4 Node::transform(const Mat4& parentTransform) { - Matrix ret = this->getNodeToParentTransform(); + Mat4 ret = this->getNodeToParentTransform(); ret = parentTransform * ret; return ret; } @@ -1338,7 +1338,7 @@ AffineTransform Node::getNodeToParentAffineTransform() const return ret; } -const Matrix& Node::getNodeToParentTransform() const +const Mat4& Node::getNodeToParentTransform() const { if (_transformDirty) { @@ -1373,7 +1373,7 @@ const Matrix& Node::getNodeToParentTransform() const // optimization: // inline anchor point calculation if skew is not needed // Adjusted transform calculation for rotational skew - if (! needsSkewMatrix && !_anchorPointInPoints.equals(Vector2::ZERO)) + if (! needsSkewMatrix && !_anchorPointInPoints.equals(Vec2::ZERO)) { x += cy * -_anchorPointInPoints.x * _scaleX + -sx * -_anchorPointInPoints.y * _scaleY; y += sy * -_anchorPointInPoints.x * _scaleX + cx * -_anchorPointInPoints.y * _scaleY; @@ -1394,13 +1394,13 @@ const Matrix& Node::getNodeToParentTransform() const // FIX ME: Expensive operation. // FIX ME: It should be done together with the rotationZ if(_rotationY) { - Matrix rotY; - Matrix::createRotationY(CC_DEGREES_TO_RADIANS(_rotationY), &rotY); + Mat4 rotY; + Mat4::createRotationY(CC_DEGREES_TO_RADIANS(_rotationY), &rotY); _transform = _transform * rotY; } if(_rotationX) { - Matrix rotX; - Matrix::createRotationX(CC_DEGREES_TO_RADIANS(_rotationX), &rotX); + Mat4 rotX; + Mat4::createRotationX(CC_DEGREES_TO_RADIANS(_rotationX), &rotX); _transform = _transform * rotX; } @@ -1408,7 +1408,7 @@ const Matrix& Node::getNodeToParentTransform() const // If skew is needed, apply skew and then anchor point if (needsSkewMatrix) { - Matrix skewMatrix(1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0, + Mat4 skewMatrix(1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0, (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); @@ -1416,9 +1416,9 @@ const Matrix& Node::getNodeToParentTransform() const _transform = _transform * skewMatrix; // adjust anchor point - if (!_anchorPointInPoints.equals(Vector2::ZERO)) + if (!_anchorPointInPoints.equals(Vec2::ZERO)) { - // XXX: Argh, Matrix needs a "translate" method. + // XXX: Argh, Mat4 needs a "translate" method. // XXX: Although this is faster than multiplying a vec4 * mat4 _transform.m[12] += _transform.m[0] * -_anchorPointInPoints.x + _transform.m[4] * -_anchorPointInPoints.y; _transform.m[13] += _transform.m[1] * -_anchorPointInPoints.x + _transform.m[5] * -_anchorPointInPoints.y; @@ -1436,7 +1436,7 @@ const Matrix& Node::getNodeToParentTransform() const return _transform; } -void Node::setNodeToParentTransform(const Matrix& transform) +void Node::setNodeToParentTransform(const Mat4& transform) { _transform = transform; _transformDirty = false; @@ -1445,12 +1445,12 @@ void Node::setNodeToParentTransform(const Matrix& transform) void Node::setAdditionalTransform(const AffineTransform& additionalTransform) { - Matrix tmp; + Mat4 tmp; CGAffineToGL(additionalTransform, tmp.m); setAdditionalTransform(&tmp); } -void Node::setAdditionalTransform(Matrix* additionalTransform) +void Node::setAdditionalTransform(Mat4* additionalTransform) { if(additionalTransform == nullptr) { _useAdditionalTransform = false; @@ -1465,13 +1465,13 @@ void Node::setAdditionalTransform(Matrix* additionalTransform) AffineTransform Node::getParentToNodeAffineTransform() const { AffineTransform ret; - Matrix ret4 = getParentToNodeTransform(); + Mat4 ret4 = getParentToNodeTransform(); GLToCGAffine(ret4.m,&ret); return ret; } -const Matrix& Node::getParentToNodeTransform() const +const Mat4& Node::getParentToNodeTransform() const { if ( _inverseDirty ) { _inverse = _transform.getInversed(); @@ -1492,9 +1492,9 @@ AffineTransform Node::getNodeToWorldAffineTransform() const return t; } -Matrix Node::getNodeToWorldTransform() const +Mat4 Node::getNodeToWorldTransform() const { - Matrix t = this->getNodeToParentTransform(); + Mat4 t = this->getNodeToParentTransform(); for (Node *p = _parent; p != nullptr; p = p->getParent()) { @@ -1509,59 +1509,59 @@ AffineTransform Node::getWorldToNodeAffineTransform() const return AffineTransformInvert(this->getNodeToWorldAffineTransform()); } -Matrix Node::getWorldToNodeTransform() const +Mat4 Node::getWorldToNodeTransform() const { return getNodeToWorldTransform().getInversed(); } -Vector2 Node::convertToNodeSpace(const Vector2& worldPoint) const +Vec2 Node::convertToNodeSpace(const Vec2& worldPoint) const { - Matrix tmp = getWorldToNodeTransform(); - Vector3 vec3(worldPoint.x, worldPoint.y, 0); - Vector3 ret; + Mat4 tmp = getWorldToNodeTransform(); + Vec3 vec3(worldPoint.x, worldPoint.y, 0); + Vec3 ret; tmp.transformPoint(vec3,&ret); - return Vector2(ret.x, ret.y); + return Vec2(ret.x, ret.y); } -Vector2 Node::convertToWorldSpace(const Vector2& nodePoint) const +Vec2 Node::convertToWorldSpace(const Vec2& nodePoint) const { - Matrix tmp = getNodeToWorldTransform(); - Vector3 vec3(nodePoint.x, nodePoint.y, 0); - Vector3 ret; + Mat4 tmp = getNodeToWorldTransform(); + Vec3 vec3(nodePoint.x, nodePoint.y, 0); + Vec3 ret; tmp.transformPoint(vec3,&ret); - return Vector2(ret.x, ret.y); + return Vec2(ret.x, ret.y); } -Vector2 Node::convertToNodeSpaceAR(const Vector2& worldPoint) const +Vec2 Node::convertToNodeSpaceAR(const Vec2& worldPoint) const { - Vector2 nodePoint = convertToNodeSpace(worldPoint); + Vec2 nodePoint = convertToNodeSpace(worldPoint); return nodePoint - _anchorPointInPoints; } -Vector2 Node::convertToWorldSpaceAR(const Vector2& nodePoint) const +Vec2 Node::convertToWorldSpaceAR(const Vec2& nodePoint) const { - Vector2 pt = nodePoint + _anchorPointInPoints; + Vec2 pt = nodePoint + _anchorPointInPoints; return convertToWorldSpace(pt); } -Vector2 Node::convertToWindowSpace(const Vector2& nodePoint) const +Vec2 Node::convertToWindowSpace(const Vec2& nodePoint) const { - Vector2 worldPoint = this->convertToWorldSpace(nodePoint); + Vec2 worldPoint = this->convertToWorldSpace(nodePoint); return Director::getInstance()->convertToUI(worldPoint); } -// convenience methods which take a Touch instead of Vector2 -Vector2 Node::convertTouchToNodeSpace(Touch *touch) const +// convenience methods which take a Touch instead of Vec2 +Vec2 Node::convertTouchToNodeSpace(Touch *touch) const { - Vector2 point = touch->getLocation(); + Vec2 point = touch->getLocation(); return this->convertToNodeSpace(point); } -Vector2 Node::convertTouchToNodeSpaceAR(Touch *touch) const +Vec2 Node::convertTouchToNodeSpaceAR(Touch *touch) const { - Vector2 point = touch->getLocation(); + Vec2 point = touch->getLocation(); return this->convertToNodeSpaceAR(point); } @@ -1608,7 +1608,7 @@ void Node::updatePhysicsBodyPosition(Scene* scene) { if (scene != nullptr && scene->getPhysicsWorld() != nullptr) { - Vector2 pos = getParent() == scene ? getPosition() : scene->convertToNodeSpace(_parent->convertToWorldSpace(getPosition())); + Vec2 pos = getParent() == scene ? getPosition() : scene->convertToNodeSpace(_parent->convertToWorldSpace(getPosition())); _physicsBody->setPosition(pos); } else @@ -1647,10 +1647,10 @@ void Node::setPhysicsBody(PhysicsBody* body) // physics rotation based on body position, but node rotation based on node anthor point // it cann't support both of them, so I clear the anthor point to default. - if (!getAnchorPoint().equals(Vector2::ANCHOR_MIDDLE)) + if (!getAnchorPoint().equals(Vec2::ANCHOR_MIDDLE)) { - CCLOG("Node warning: setPhysicsBody sets anchor point to Vector2::ANCHOR_MIDDLE."); - setAnchorPoint(Vector2::ANCHOR_MIDDLE); + CCLOG("Node warning: setPhysicsBody sets anchor point to Vec2::ANCHOR_MIDDLE."); + setAnchorPoint(Vec2::ANCHOR_MIDDLE); } } diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 3f7f20d38c..f8a52ca287 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -273,37 +273,37 @@ public: /** * Sets the position (x,y) of the node in its parent's coordinate system. * - * Usually we use `Vector2(x,y)` to compose Vector2 object. + * Usually we use `Vec2(x,y)` to compose Vec2 object. * This code snippet sets the node in the center of screen. @code Size size = Director::getInstance()->getWinSize(); - node->setPosition( Vector2(size.width/2, size.height/2) ) + node->setPosition( Vec2(size.width/2, size.height/2) ) @endcode * * @param position The position (x,y) of the node in OpenGL coordinates */ - virtual void setPosition(const Vector2 &position); + virtual void setPosition(const Vec2 &position); /** * Gets the position (x,y) of the node in its parent's coordinate system. * - * @see setPosition(const Vector2&) + * @see setPosition(const Vec2&) * * @return The position (x,y) of the node in OpenGL coordinates * @code * In js and lua return value is table which contains x,y * @endcode */ - virtual const Vector2& getPosition() const; + virtual const Vec2& getPosition() const; /** * Sets the position (x,y) of the node in its parent's coordinate system. * - * Passing two numbers (x,y) is much efficient than passing Vector2 object. + * Passing two numbers (x,y) is much efficient than passing Vec2 object. * This method is bound to Lua and JavaScript. * Passing a number is 10 times faster than passing a object from Lua to c++ * @code // sample code in Lua - local pos = node::getPosition() -- returns Vector2 object from C++ + local pos = node::getPosition() -- returns Vec2 object from C++ node:setPosition(x, y) -- pass x, y coordinate to C++ @endcode * @@ -312,7 +312,7 @@ public: */ virtual void setPosition(float x, float y); /** - * Gets position in a more efficient way, returns two number instead of a Vector2 object + * Gets position in a more efficient way, returns two number instead of a Vec2 object * * @see `setPosition(float, float)` * In js,out value not return @@ -330,11 +330,11 @@ public: /** * Sets the position (X, Y, and Z) in its parent's coordinate system */ - virtual void setPosition3D(const Vector3& position); + virtual void setPosition3D(const Vec3& position); /** * returns the position (X,Y,Z) in its parent's coordinate system */ - virtual Vector3 getPosition3D() const; + virtual Vec3 getPosition3D() const; /** * Sets the 'z' coordinate in the position. It is the OpenGL Z vertex value. @@ -419,15 +419,15 @@ public: * * @param anchorPoint The anchor point of node. */ - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); /** * Returns the anchor point in percent. * - * @see `setAnchorPoint(const Vector2&)` + * @see `setAnchorPoint(const Vec2&)` * * @return The anchor point of node. */ - virtual const Vector2& getAnchorPoint() const; + virtual const Vec2& getAnchorPoint() const; /** * Returns the anchorPoint in absolute pixels. * @@ -436,7 +436,7 @@ public: * * @return The anchor point in absolute pixels. */ - virtual const Vector2& getAnchorPointInPoints() const; + virtual const Vec2& getAnchorPointInPoints() const; /** @@ -498,11 +498,11 @@ public: * Sets the rotation (X,Y,Z) in degrees. * Useful for 3d rotations */ - virtual void setRotation3D(const Vector3& rotation); + virtual void setRotation3D(const Vec3& rotation); /** * returns the rotation (X,Y,Z) in degrees. */ - virtual Vector3 getRotation3D() const; + virtual Vec3 getRotation3D() const; /** * Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. @@ -923,13 +923,13 @@ public: * AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE * But if you enable any other GL state, you should disable it after drawing your node. */ - virtual void draw(Renderer *renderer, const Matrix& transform, bool transformUpdated); + virtual void draw(Renderer *renderer, const Mat4& transform, bool transformUpdated); virtual void draw() final; /** * Visits this node's children and draw them recursively. */ - virtual void visit(Renderer *renderer, const Matrix& parentTransform, bool parentTransformUpdated); + virtual void visit(Renderer *renderer, const Mat4& parentTransform, bool parentTransformUpdated); virtual void visit() final; @@ -1194,13 +1194,13 @@ public: * Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates. * The matrix is in Pixels. */ - virtual const Matrix& getNodeToParentTransform() const; + virtual const Mat4& getNodeToParentTransform() const; virtual AffineTransform getNodeToParentAffineTransform() const; /** * Sets the Transformation matrix manually. */ - virtual void setNodeToParentTransform(const Matrix& transform); + virtual void setNodeToParentTransform(const Mat4& transform); /** @deprecated use getNodeToParentTransform() instead */ CC_DEPRECATED_ATTRIBUTE inline virtual AffineTransform nodeToParentTransform() const { return getNodeToParentAffineTransform(); } @@ -1209,7 +1209,7 @@ public: * Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. * The matrix is in Pixels. */ - virtual const Matrix& getParentToNodeTransform() const; + virtual const Mat4& getParentToNodeTransform() const; virtual AffineTransform getParentToNodeAffineTransform() const; /** @deprecated Use getParentToNodeTransform() instead */ @@ -1218,7 +1218,7 @@ public: /** * Returns the world affine transform matrix. The matrix is in Pixels. */ - virtual Matrix getNodeToWorldTransform() const; + virtual Mat4 getNodeToWorldTransform() const; virtual AffineTransform getNodeToWorldAffineTransform() const; /** @deprecated Use getNodeToWorldTransform() instead */ @@ -1227,7 +1227,7 @@ public: /** * Returns the inverse world affine transform matrix. The matrix is in Pixels. */ - virtual Matrix getWorldToNodeTransform() const; + virtual Mat4 getWorldToNodeTransform() const; virtual AffineTransform getWorldToNodeAffineTransform() const; @@ -1241,36 +1241,36 @@ public: /// @name Coordinate Converters /** - * Converts a Vector2 to node (local) space coordinates. The result is in Points. + * Converts a Vec2 to node (local) space coordinates. The result is in Points. */ - Vector2 convertToNodeSpace(const Vector2& worldPoint) const; + Vec2 convertToNodeSpace(const Vec2& worldPoint) const; /** - * Converts a Vector2 to world space coordinates. The result is in Points. + * Converts a Vec2 to world space coordinates. The result is in Points. */ - Vector2 convertToWorldSpace(const Vector2& nodePoint) const; + Vec2 convertToWorldSpace(const Vec2& nodePoint) const; /** - * Converts a Vector2 to node (local) space coordinates. The result is in Points. + * Converts a Vec2 to node (local) space coordinates. The result is in Points. * treating the returned/received node point as anchor relative. */ - Vector2 convertToNodeSpaceAR(const Vector2& worldPoint) const; + Vec2 convertToNodeSpaceAR(const Vec2& worldPoint) const; /** - * Converts a local Vector2 to world space coordinates.The result is in Points. + * Converts a local Vec2 to world space coordinates.The result is in Points. * treating the returned/received node point as anchor relative. */ - Vector2 convertToWorldSpaceAR(const Vector2& nodePoint) const; + Vec2 convertToWorldSpaceAR(const Vec2& nodePoint) const; /** - * convenience methods which take a Touch instead of Vector2 + * convenience methods which take a Touch instead of Vec2 */ - Vector2 convertTouchToNodeSpace(Touch * touch) const; + Vec2 convertTouchToNodeSpace(Touch * touch) const; /** * converts a Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative). */ - Vector2 convertTouchToNodeSpaceAR(Touch * touch) const; + Vec2 convertTouchToNodeSpaceAR(Touch * touch) const; /** * Sets an additional transform matrix to the node. @@ -1280,7 +1280,7 @@ public: * @note The additional transform will be concatenated at the end of getNodeToParentTransform. * It could be used to simulate `parent-child` relationship between two nodes (e.g. one is in BatchNode, another isn't). */ - void setAdditionalTransform(Matrix* additionalTransform); + void setAdditionalTransform(Mat4* additionalTransform); void setAdditionalTransform(const AffineTransform& additionalTransform); /// @} end of Coordinate Converters @@ -1312,7 +1312,7 @@ public: #if CC_USE_PHYSICS /** * set the PhysicsBody that let the sprite effect with physics - * @note This method will set anchor point to Vector2::ANCHOR_MIDDLE if body not null, and you cann't change anchor point if node has a physics body. + * @note This method will set anchor point to Vec2::ANCHOR_MIDDLE if body not null, and you cann't change anchor point if node has a physics body. */ void setPhysicsBody(PhysicsBody* body); @@ -1359,9 +1359,9 @@ protected: void detachChild(Node *child, ssize_t index, bool doCleanup); /// Convert cocos2d coordinates to UI windows coordinate. - Vector2 convertToWindowSpace(const Vector2& nodePoint) const; + Vec2 convertToWindowSpace(const Vec2& nodePoint) const; - Matrix transform(const Matrix &parentTransform); + Mat4 transform(const Mat4 &parentTransform); virtual void updateCascadeOpacity(); virtual void disableCascadeOpacity(); @@ -1385,25 +1385,25 @@ protected: float _scaleY; ///< scaling factor on y-axis float _scaleZ; ///< scaling factor on z-axis - Vector2 _position; ///< position of the node + Vec2 _position; ///< position of the node float _positionZ; ///< OpenGL real Z position float _skewX; ///< skew angle on x-axis float _skewY; ///< skew angle on y-axis - Vector2 _anchorPointInPoints; ///< anchor point in points - Vector2 _anchorPoint; ///< anchor point normalized (NOT in points) + Vec2 _anchorPointInPoints; ///< anchor point in points + Vec2 _anchorPoint; ///< anchor point normalized (NOT in points) Size _contentSize; ///< untransformed size of the node - Matrix _modelViewTransform; ///< ModelView transform of the Node. + Mat4 _modelViewTransform; ///< ModelView transform of the Node. // "cache" variables are allowed to be mutable - mutable Matrix _transform; ///< transform + mutable Mat4 _transform; ///< transform mutable bool _transformDirty; ///< transform dirty flag - mutable Matrix _inverse; ///< inverse transform + mutable Mat4 _inverse; ///< inverse transform mutable bool _inverseDirty; ///< inverse transform dirty flag - mutable Matrix _additionalTransform; ///< transform + mutable Mat4 _additionalTransform; ///< transform bool _useAdditionalTransform; ///< The flag to check whether the additional transform is dirty bool _transformUpdated; ///< Whether or not the Transform object was updated since the last frame @@ -1434,7 +1434,7 @@ protected: bool _visible; ///< is this node visible - bool _ignoreAnchorPointForPosition; ///< true if the Anchor Vector2 will be (0,0) when you position the Node, false otherwise. + bool _ignoreAnchorPointForPosition; ///< true if the Anchor Vec2 will be (0,0) when you position the Node, false otherwise. ///< Used by Layer and Scene. bool _reorderChildDirty; ///< children order dirty flag diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index ca4b7aa105..7d4fbf9385 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -82,7 +82,7 @@ void NodeGrid::onGridEndDraw() } } -void NodeGrid::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // quick return if not visible. children won't be drawn. if (!_visible) @@ -100,7 +100,7 @@ void NodeGrid::visit(Renderer *renderer, const Matrix &parentTransform, bool par _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); diff --git a/cocos/2d/CCNodeGrid.h b/cocos/2d/CCNodeGrid.h index 342553bdf1..d36f39ca7d 100644 --- a/cocos/2d/CCNodeGrid.h +++ b/cocos/2d/CCNodeGrid.h @@ -54,7 +54,7 @@ public: void setTarget(Node *target); // overrides - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; protected: NodeGrid(); diff --git a/cocos/2d/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp index 0db8acdb7a..86f89e867f 100644 --- a/cocos/2d/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -32,7 +32,7 @@ NS_CC_BEGIN class PointObject : public Ref { public: - static PointObject * create(Vector2 ratio, Vector2 offset) + static PointObject * create(Vec2 ratio, Vec2 offset) { PointObject *ret = new PointObject(); ret->initWithPoint(ratio, offset); @@ -40,7 +40,7 @@ public: return ret; } - bool initWithPoint(Vector2 ratio, Vector2 offset) + bool initWithPoint(Vec2 ratio, Vec2 offset) { _ratio = ratio; _offset = offset; @@ -48,25 +48,25 @@ public: return true; } - inline const Vector2& getRatio() const { return _ratio; }; - inline void setRatio(const Vector2& ratio) { _ratio = ratio; }; + inline const Vec2& getRatio() const { return _ratio; }; + inline void setRatio(const Vec2& ratio) { _ratio = ratio; }; - inline const Vector2& getOffset() const { return _offset; }; - inline void setOffset(const Vector2& offset) { _offset = offset; }; + inline const Vec2& getOffset() const { return _offset; }; + inline void setOffset(const Vec2& offset) { _offset = offset; }; inline Node* getChild() const { return _child; }; inline void setChild(Node* child) { _child = child; }; private: - Vector2 _ratio; - Vector2 _offset; + Vec2 _ratio; + Vec2 _offset; Node *_child; // weak ref }; ParallaxNode::ParallaxNode() { _parallaxArray = ccArrayNew(5); - _lastPosition = Vector2(-100,-100); + _lastPosition = Vec2(-100,-100); } ParallaxNode::~ParallaxNode() @@ -93,14 +93,14 @@ void ParallaxNode::addChild(Node * child, int zOrder, int tag) CCASSERT(0,"ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead"); } -void ParallaxNode::addChild(Node *child, int z, const Vector2& ratio, const Vector2& offset) +void ParallaxNode::addChild(Node *child, int z, const Vec2& ratio, const Vec2& offset) { CCASSERT( child != nullptr, "Argument must be non-nil"); PointObject *obj = PointObject::create(ratio, offset); obj->setChild(child); ccArrayAppendObjectWithResize(_parallaxArray, (Ref*)obj); - Vector2 pos = this->absolutePosition(); + Vec2 pos = this->absolutePosition(); pos.x = -pos.x + pos.x * ratio.x + offset.x; pos.y = -pos.y + pos.y * ratio.y + offset.y; child->setPosition(pos); @@ -128,9 +128,9 @@ void ParallaxNode::removeAllChildrenWithCleanup(bool cleanup) Node::removeAllChildrenWithCleanup(cleanup); } -Vector2 ParallaxNode::absolutePosition() +Vec2 ParallaxNode::absolutePosition() { - Vector2 ret = _position; + Vec2 ret = _position; Node *cn = this; while (cn->getParent() != nullptr) { @@ -145,11 +145,11 @@ The positions are updated at visit because: - using a timer is not guaranteed that it will called after all the positions were updated - overriding "draw" will only precise if the children have a z > 0 */ -void ParallaxNode::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void ParallaxNode::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { - // Vector2 pos = position_; - // Vector2 pos = [self convertToWorldSpace:Vector2::ZERO]; - Vector2 pos = this->absolutePosition(); + // Vec2 pos = position_; + // Vec2 pos = [self convertToWorldSpace:Vec2::ZERO]; + Vec2 pos = this->absolutePosition(); if( ! pos.equals(_lastPosition) ) { for( int i=0; i < _parallaxArray->num; i++ ) @@ -157,7 +157,7 @@ void ParallaxNode::visit(Renderer *renderer, const Matrix &parentTransform, bool PointObject *point = (PointObject*)_parallaxArray->arr[i]; float x = -pos.x + pos.x * point->getRatio().x + point->getOffset().x; float y = -pos.y + pos.y * point->getRatio().y + point->getOffset().y; - point->getChild()->setPosition(Vector2(x,y)); + point->getChild()->setPosition(Vec2(x,y)); } _lastPosition = pos; } diff --git a/cocos/2d/CCParallaxNode.h b/cocos/2d/CCParallaxNode.h index 54dc3897dc..66e92b078b 100644 --- a/cocos/2d/CCParallaxNode.h +++ b/cocos/2d/CCParallaxNode.h @@ -53,7 +53,7 @@ public: // prevents compiler warning: "Included function hides overloaded virtual functions" using Node::addChild; - void addChild(Node * child, int z, const Vector2& parallaxRatio, const Vector2& positionOffset); + void addChild(Node * child, int z, const Vec2& parallaxRatio, const Vec2& positionOffset); /** Sets an array of layers for the Parallax node */ void setParallaxArray( struct _ccArray *parallaxArray) { _parallaxArray = parallaxArray; } @@ -67,7 +67,7 @@ public: virtual void addChild(Node * child, int zOrder, int tag) override; virtual void removeChild(Node* child, bool cleanup) override; virtual void removeAllChildrenWithCleanup(bool cleanup) override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; protected: /** Adds a child to the container with a z-order, a parallax ratio and a position offset @@ -82,9 +82,9 @@ protected: */ virtual ~ParallaxNode(); - Vector2 absolutePosition(); + Vec2 absolutePosition(); - Vector2 _lastPosition; + Vec2 _lastPosition; struct _ccArray* _parallaxArray; private: diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 77bca62e7e..9b2177fe28 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -121,7 +121,7 @@ bool ParticleBatchNode::initWithFile(const std::string& fileImage, int capacity) // override visit. // Don't call visit on it's children -void ParticleBatchNode::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // CAREFUL: // This visit is almost identical to Node#visit @@ -141,7 +141,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Matrix &parentTransform, _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -383,7 +383,7 @@ void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup) _textureAtlas->removeAllQuads(); } -void ParticleBatchNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ParticleBatchNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { CC_PROFILER_START("CCParticleBatchNode - draw"); diff --git a/cocos/2d/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h index 530aa483da..2b6d716a94 100644 --- a/cocos/2d/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -91,13 +91,13 @@ public: inline void setTextureAtlas(TextureAtlas* atlas) { _textureAtlas = atlas; }; // Overrides - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; using Node::addChild; virtual void addChild(Node * child, int zOrder, int tag) override; virtual void removeChild(Node* child, bool cleanup) override; virtual void reorderChild(Node * child, int zOrder) override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual Texture2D* getTexture(void) const override; virtual void setTexture(Texture2D *texture) override; /** diff --git a/cocos/2d/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp index 402701cc57..6498740b76 100644 --- a/cocos/2d/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -98,7 +98,7 @@ bool ParticleFire::initWithTotalParticles(int numberOfParticles) this->_emitterMode = Mode::GRAVITY; // Gravity Mode: gravity - this->modeA.gravity = Vector2(0,0); + this->modeA.gravity = Vec2(0,0); // Gravity Mode: radial acceleration this->modeA.radialAccel = 0; @@ -114,8 +114,8 @@ bool ParticleFire::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, 60)); - this->_posVar = Vector2(40, 20); + this->setPosition(Vec2(winSize.width/2, 60)); + this->_posVar = Vec2(40, 20); // life of particles _life = 3; @@ -203,7 +203,7 @@ bool ParticleFireworks::initWithTotalParticles(int numberOfParticles) this->_emitterMode = Mode::GRAVITY; // Gravity Mode: gravity - this->modeA.gravity = Vector2(0,-90); + this->modeA.gravity = Vec2(0,-90); // Gravity Mode: radial this->modeA.radialAccel = 0; @@ -215,7 +215,7 @@ bool ParticleFireworks::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); // angle this->_angle= 90; @@ -307,7 +307,7 @@ bool ParticleSun::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity mode: radial acceleration setRadialAccel(0); @@ -324,8 +324,8 @@ bool ParticleSun::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 1; @@ -411,7 +411,7 @@ bool ParticleGalaxy::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity Mode: speed of particles setSpeed(60); @@ -431,8 +431,8 @@ bool ParticleGalaxy::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 4; @@ -520,7 +520,7 @@ bool ParticleFlower::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity Mode: speed of particles setSpeed(80); @@ -540,8 +540,8 @@ bool ParticleFlower::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 4; @@ -628,7 +628,7 @@ bool ParticleMeteor::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(-200,200)); + setGravity(Vec2(-200,200)); // Gravity Mode: speed of particles setSpeed(15); @@ -648,8 +648,8 @@ bool ParticleMeteor::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 2; @@ -737,7 +737,7 @@ bool ParticleSpiral::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity Mode: speed of particles setSpeed(150); @@ -757,8 +757,8 @@ bool ParticleSpiral::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 12; @@ -845,7 +845,7 @@ bool ParticleExplosion::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity Mode: speed of particles setSpeed(70); @@ -865,8 +865,8 @@ bool ParticleExplosion::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + this->setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles _life = 5.0f; @@ -954,7 +954,7 @@ bool ParticleSmoke::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity Mode: radial acceleration setRadialAccel(0); @@ -970,8 +970,8 @@ bool ParticleSmoke::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, 0)); - setPosVar(Vector2(20, 0)); + this->setPosition(Vec2(winSize.width/2, 0)); + setPosVar(Vec2(20, 0)); // life of particles _life = 4; @@ -1059,7 +1059,7 @@ bool ParticleSnow::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,-1)); + setGravity(Vec2(0,-1)); // Gravity Mode: speed of particles setSpeed(5); @@ -1075,8 +1075,8 @@ bool ParticleSnow::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height + 10)); - setPosVar(Vector2(winSize.width/2, 0)); + this->setPosition(Vec2(winSize.width/2, winSize.height + 10)); + setPosVar(Vec2(winSize.width/2, 0)); // angle _angle = -90; @@ -1166,7 +1166,7 @@ bool ParticleRain::initWithTotalParticles(int numberOfParticles) setEmitterMode(Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(10,-10)); + setGravity(Vec2(10,-10)); // Gravity Mode: radial setRadialAccel(0); @@ -1187,8 +1187,8 @@ bool ParticleRain::initWithTotalParticles(int numberOfParticles) // emitter position Size winSize = Director::getInstance()->getWinSize(); - this->setPosition(Vector2(winSize.width/2, winSize.height)); - setPosVar(Vector2(winSize.width/2, 0)); + this->setPosition(Vec2(winSize.width/2, winSize.height)); + setPosVar(Vec2(winSize.width/2, 0)); // life of particles _life = 4.5f; diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 368e99a582..eafe9e19d0 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -97,8 +97,8 @@ ParticleSystem::ParticleSystem() , _isActive(true) , _particleCount(0) , _duration(0) -, _sourcePosition(Vector2::ZERO) -, _posVar(Vector2::ZERO) +, _sourcePosition(Vec2::ZERO) +, _posVar(Vec2::ZERO) , _life(0) , _lifeVar(0) , _angle(0) @@ -120,7 +120,7 @@ ParticleSystem::ParticleSystem() , _yCoordFlipped(1) , _positionType(PositionType::FREE) { - modeA.gravity = Vector2::ZERO; + modeA.gravity = Vec2::ZERO; modeA.speed = 0; modeA.speedVar = 0; modeA.tangentialAccel = 0; @@ -257,7 +257,7 @@ bool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& // position float x = dictionary["sourcePositionx"].asFloat(); float y = dictionary["sourcePositiony"].asFloat(); - this->setPosition( Vector2(x,y) ); + this->setPosition( Vec2(x,y) ); _posVar.x = dictionary["sourcePositionVariancex"].asFloat(); _posVar.y = dictionary["sourcePositionVariancey"].asFloat(); @@ -560,7 +560,7 @@ void ParticleSystem::initParticle(tParticle* particle) // position if (_positionType == PositionType::FREE) { - particle->startPos = this->convertToWorldSpace(Vector2::ZERO); + particle->startPos = this->convertToWorldSpace(Vec2::ZERO); } else if (_positionType == PositionType::RELATIVE) { @@ -573,7 +573,7 @@ void ParticleSystem::initParticle(tParticle* particle) // Mode Gravity: A if (_emitterMode == Mode::GRAVITY) { - Vector2 v(cosf( a ), sinf( a )); + Vec2 v(cosf( a ), sinf( a )); float s = modeA.speed + modeA.speedVar * CCRANDOM_MINUS1_1(); // direction @@ -679,10 +679,10 @@ void ParticleSystem::update(float dt) _particleIdx = 0; - Vector2 currentPosition = Vector2::ZERO; + Vec2 currentPosition = Vec2::ZERO; if (_positionType == PositionType::FREE) { - currentPosition = this->convertToWorldSpace(Vector2::ZERO); + currentPosition = this->convertToWorldSpace(Vec2::ZERO); } else if (_positionType == PositionType::RELATIVE) { @@ -702,9 +702,9 @@ void ParticleSystem::update(float dt) // Mode A: gravity, direction, tangential accel & radial accel if (_emitterMode == Mode::GRAVITY) { - Vector2 tmp, radial, tangential; + Vec2 tmp, radial, tangential; - radial = Vector2::ZERO; + radial = Vec2::ZERO; // radial acceleration if (p->pos.x || p->pos.y) { @@ -761,11 +761,11 @@ void ParticleSystem::update(float dt) // update values in quad // - Vector2 newPos; + Vec2 newPos; if (_positionType == PositionType::FREE || _positionType == PositionType::RELATIVE) { - Vector2 diff = currentPosition - p->startPos; + Vec2 diff = currentPosition - p->startPos; newPos = p->pos - diff; } else @@ -832,7 +832,7 @@ void ParticleSystem::updateWithNoTime(void) this->update(0.0f); } -void ParticleSystem::updateQuadWithParticle(tParticle* particle, const Vector2& newPosition) +void ParticleSystem::updateQuadWithParticle(tParticle* particle, const Vec2& newPosition) { CC_UNUSED_PARAM(particle); CC_UNUSED_PARAM(newPosition); @@ -967,13 +967,13 @@ bool ParticleSystem::getRotationIsDir() const return modeA.rotationIsDir; } -void ParticleSystem::setGravity(const Vector2& g) +void ParticleSystem::setGravity(const Vec2& g) { CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity"); modeA.gravity = g; } -const Vector2& ParticleSystem::getGravity() +const Vec2& ParticleSystem::getGravity() { CCASSERT(_emitterMode == Mode::GRAVITY, "Particle Mode should be Gravity"); return modeA.gravity; diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index 514ea7ecc7..fc2050b7b4 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -45,8 +45,8 @@ class ParticleBatchNode; Structure that contains the values of each particle */ typedef struct sParticle { - Vector2 pos; - Vector2 startPos; + Vec2 pos; + Vec2 startPos; Color4F color; Color4F deltaColor; @@ -63,7 +63,7 @@ typedef struct sParticle { //! Mode A: gravity, direction, radial accel, tangential accel struct { - Vector2 dir; + Vec2 dir; float radialAccel; float tangentialAccel; } modeA; @@ -78,7 +78,7 @@ typedef struct sParticle { }tParticle; -//typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vector2); +//typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Vec2); class Texture2D; @@ -192,7 +192,7 @@ public: bool isFull(); //! should be overridden by subclasses - virtual void updateQuadWithParticle(tParticle* particle, const Vector2& newPosition); + virtual void updateQuadWithParticle(tParticle* particle, const Vec2& newPosition); //! should be overridden by subclasses virtual void postStep(); @@ -202,8 +202,8 @@ public: virtual void setAutoRemoveOnFinish(bool var); // mode A - virtual const Vector2& getGravity(); - virtual void setGravity(const Vector2& g); + virtual const Vec2& getGravity(); + virtual void setGravity(const Vec2& g); virtual float getSpeed() const; virtual void setSpeed(float speed); virtual float getSpeedVar() const; @@ -256,12 +256,12 @@ public: inline void setDuration(float duration) { _duration = duration; }; /** sourcePosition of the emitter */ - inline const Vector2& getSourcePosition() const { return _sourcePosition; }; - inline void setSourcePosition(const Vector2& pos) { _sourcePosition = pos; }; + inline const Vec2& getSourcePosition() const { return _sourcePosition; }; + inline void setSourcePosition(const Vec2& pos) { _sourcePosition = pos; }; /** Position variance of the emitter */ - inline const Vector2& getPosVar() const { return _posVar; }; - inline void setPosVar(const Vector2& pos) { _posVar = pos; }; + inline const Vec2& getPosVar() const { return _posVar; }; + inline void setPosVar(const Vec2& pos) { _posVar = pos; }; /** life, and life variation of each particle */ inline float getLife() const { return _life; }; @@ -432,7 +432,7 @@ protected: //! Mode A:Gravity + Tangential Accel + Radial Accel struct { /** Gravity value. Only available in 'Gravity' mode. */ - Vector2 gravity; + Vec2 gravity; /** speed of each particle. Only available in 'Gravity' mode. */ float speed; /** speed variance of each particle. Only available in 'Gravity' mode. */ @@ -503,9 +503,9 @@ protected: /** How many seconds the emitter will run. -1 means 'forever' */ float _duration; /** sourcePosition of the emitter */ - Vector2 _sourcePosition; + Vec2 _sourcePosition; /** Position variance of the emitter */ - Vector2 _posVar; + Vec2 _posVar; /** life, and life variation of each particle */ float _life; /** life variance of each particle */ diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 8cf35514b5..fc4f5fd779 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -239,7 +239,7 @@ void ParticleSystemQuad::setTexture(Texture2D* texture) void ParticleSystemQuad::setDisplayFrame(SpriteFrame *spriteFrame) { - CCASSERT(spriteFrame->getOffsetInPixels().equals(Vector2::ZERO), + CCASSERT(spriteFrame->getOffsetInPixels().equals(Vec2::ZERO), "QuadParticle only supports SpriteFrames with no offsets"); // update texture before updating texture rect @@ -265,7 +265,7 @@ void ParticleSystemQuad::initIndices() } } -void ParticleSystemQuad::updateQuadWithParticle(tParticle* particle, const Vector2& newPosition) +void ParticleSystemQuad::updateQuadWithParticle(tParticle* particle, const Vec2& newPosition) { V3F_C4B_T2F_Quad *quad; @@ -368,7 +368,7 @@ void ParticleSystemQuad::postStep() } // overriding draw method -void ParticleSystemQuad::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ParticleSystemQuad::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { CCASSERT( _particleIdx == 0 || _particleIdx == _particleCount, "Abnormal error in particle quad"); //quad command diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index 4566f06e1d..6bd6d4e04f 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -96,7 +96,7 @@ public: * @js NA * @lua NA */ - virtual void updateQuadWithParticle(tParticle* particle, const Vector2& newPosition) override; + virtual void updateQuadWithParticle(tParticle* particle, const Vec2& newPosition) override; /** * @js NA * @lua NA @@ -106,7 +106,7 @@ public: * @js NA * @lua NA */ - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; /** * @js NA diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index f4fc73987f..d3249380fb 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -79,11 +79,11 @@ bool ProgressTimer::initWithSprite(Sprite* sp) _vertexData = nullptr; _vertexDataCount = 0; - setAnchorPoint(Vector2(0.5f,0.5f)); + setAnchorPoint(Vec2(0.5f,0.5f)); _type = Type::RADIAL; _reverseDirection = false; - setMidpoint(Vector2(0.5f, 0.5f)); - setBarChangeRate(Vector2(1,1)); + setMidpoint(Vec2(0.5f, 0.5f)); + setBarChangeRate(Vec2(1,1)); setSprite(sp); // shader state @@ -156,15 +156,15 @@ void ProgressTimer::setReverseProgress(bool reverse) /// // @returns the vertex position from the texture coordinate /// -Tex2F ProgressTimer::textureCoordFromAlphaPoint(Vector2 alpha) +Tex2F ProgressTimer::textureCoordFromAlphaPoint(Vec2 alpha) { Tex2F ret(0.0f, 0.0f); if (!_sprite) { return ret; } V3F_C4B_T2F_Quad quad = _sprite->getQuad(); - Vector2 min = Vector2(quad.bl.texCoords.u,quad.bl.texCoords.v); - Vector2 max = Vector2(quad.tr.texCoords.u,quad.tr.texCoords.v); + Vec2 min = Vec2(quad.bl.texCoords.u,quad.bl.texCoords.v); + Vec2 max = Vec2(quad.tr.texCoords.u,quad.tr.texCoords.v); // Fix bug #1303 so that progress timer handles sprite frame texture rotation if (_sprite->isTextureRectRotated()) { CC_SWAP(alpha.x, alpha.y, float); @@ -172,15 +172,15 @@ Tex2F ProgressTimer::textureCoordFromAlphaPoint(Vector2 alpha) return Tex2F(min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y); } -Vector2 ProgressTimer::vertexFromAlphaPoint(Vector2 alpha) +Vec2 ProgressTimer::vertexFromAlphaPoint(Vec2 alpha) { - Vector2 ret(0.0f, 0.0f); + Vec2 ret(0.0f, 0.0f); if (!_sprite) { return ret; } V3F_C4B_T2F_Quad quad = _sprite->getQuad(); - Vector2 min = Vector2(quad.bl.vertices.x,quad.bl.vertices.y); - Vector2 max = Vector2(quad.tr.vertices.x,quad.tr.vertices.y); + Vec2 min = Vec2(quad.bl.vertices.x,quad.bl.vertices.y); + Vec2 max = Vec2(quad.tr.vertices.x,quad.tr.vertices.y); ret.x = min.x * (1.f - alpha.x) + max.x * alpha.x; ret.y = min.y * (1.f - alpha.y) + max.y * alpha.y; return ret; @@ -217,12 +217,12 @@ void ProgressTimer::updateProgress(void) } } -void ProgressTimer::setAnchorPoint(const Vector2& anchorPoint) +void ProgressTimer::setAnchorPoint(const Vec2& anchorPoint) { Node::setAnchorPoint(anchorPoint); } -Vector2 ProgressTimer::getMidpoint() const +Vec2 ProgressTimer::getMidpoint() const { return _midpoint; } @@ -249,9 +249,9 @@ GLubyte ProgressTimer::getOpacity() const return _sprite->getOpacity(); } -void ProgressTimer::setMidpoint(const Vector2& midPoint) +void ProgressTimer::setMidpoint(const Vec2& midPoint) { - _midpoint = midPoint.getClampPoint(Vector2::ZERO, Vector2(1, 1)); + _midpoint = midPoint.getClampPoint(Vec2::ZERO, Vec2(1, 1)); } /// @@ -275,12 +275,12 @@ void ProgressTimer::updateRadial(void) // We find the vector to do a hit detection based on the percentage // We know the first vector is the one @ 12 o'clock (top,mid) so we rotate // from that by the progress angle around the _midpoint pivot - Vector2 topMid = Vector2(_midpoint.x, 1.f); - Vector2 percentagePt = topMid.rotateByAngle(_midpoint, angle); + Vec2 topMid = Vec2(_midpoint.x, 1.f); + Vec2 percentagePt = topMid.rotateByAngle(_midpoint, angle); int index = 0; - Vector2 hit = Vector2::ZERO; + Vec2 hit = Vec2::ZERO; if (alpha == 0.f) { // More efficient since we don't always need to check intersection @@ -302,8 +302,8 @@ void ProgressTimer::updateRadial(void) for (int i = 0; i <= kProgressTextureCoordsCount; ++i) { int pIndex = (i + (kProgressTextureCoordsCount - 1))%kProgressTextureCoordsCount; - Vector2 edgePtA = boundaryTexCoord(i % kProgressTextureCoordsCount); - Vector2 edgePtB = boundaryTexCoord(pIndex); + Vec2 edgePtA = boundaryTexCoord(i % kProgressTextureCoordsCount); + Vec2 edgePtB = boundaryTexCoord(pIndex); // Remember that the top edge is split in half for the 12 o'clock position // Let's deal with that here by finding the correct endpoints @@ -315,7 +315,7 @@ void ProgressTimer::updateRadial(void) // s and t are returned by ccpLineIntersect float s = 0, t = 0; - if(Vector2::isLineIntersect(edgePtA, edgePtB, _midpoint, percentagePt, &s, &t)) + if(Vec2::isLineIntersect(edgePtA, edgePtB, _midpoint, percentagePt, &s, &t)) { // Since our hit test is on rays we have to deal with the top edge @@ -374,7 +374,7 @@ void ProgressTimer::updateRadial(void) _vertexData[1].vertices = vertexFromAlphaPoint(topMid); for(int i = 0; i < index; ++i){ - Vector2 alphaPoint = boundaryTexCoord(i); + Vec2 alphaPoint = boundaryTexCoord(i); _vertexData[i+2].texCoords = textureCoordFromAlphaPoint(alphaPoint); _vertexData[i+2].vertices = vertexFromAlphaPoint(alphaPoint); } @@ -401,9 +401,9 @@ void ProgressTimer::updateBar(void) return; } float alpha = _percentage / 100.0f; - Vector2 alphaOffset = Vector2(1.0f * (1.0f - _barChangeRate.x) + alpha * _barChangeRate.x, 1.0f * (1.0f - _barChangeRate.y) + alpha * _barChangeRate.y) * 0.5f; - Vector2 min = _midpoint - alphaOffset; - Vector2 max = _midpoint + alphaOffset; + Vec2 alphaOffset = Vec2(1.0f * (1.0f - _barChangeRate.x) + alpha * _barChangeRate.x, 1.0f * (1.0f - _barChangeRate.y) + alpha * _barChangeRate.y) * 0.5f; + Vec2 min = _midpoint - alphaOffset; + Vec2 max = _midpoint + alphaOffset; if (min.x < 0.f) { max.x += -min.x; @@ -433,74 +433,74 @@ void ProgressTimer::updateBar(void) CCASSERT( _vertexData, "CCProgressTimer. Not enough memory"); } // TOPLEFT - _vertexData[0].texCoords = textureCoordFromAlphaPoint(Vector2(min.x,max.y)); - _vertexData[0].vertices = vertexFromAlphaPoint(Vector2(min.x,max.y)); + _vertexData[0].texCoords = textureCoordFromAlphaPoint(Vec2(min.x,max.y)); + _vertexData[0].vertices = vertexFromAlphaPoint(Vec2(min.x,max.y)); // BOTLEFT - _vertexData[1].texCoords = textureCoordFromAlphaPoint(Vector2(min.x,min.y)); - _vertexData[1].vertices = vertexFromAlphaPoint(Vector2(min.x,min.y)); + _vertexData[1].texCoords = textureCoordFromAlphaPoint(Vec2(min.x,min.y)); + _vertexData[1].vertices = vertexFromAlphaPoint(Vec2(min.x,min.y)); // TOPRIGHT - _vertexData[2].texCoords = textureCoordFromAlphaPoint(Vector2(max.x,max.y)); - _vertexData[2].vertices = vertexFromAlphaPoint(Vector2(max.x,max.y)); + _vertexData[2].texCoords = textureCoordFromAlphaPoint(Vec2(max.x,max.y)); + _vertexData[2].vertices = vertexFromAlphaPoint(Vec2(max.x,max.y)); // BOTRIGHT - _vertexData[3].texCoords = textureCoordFromAlphaPoint(Vector2(max.x,min.y)); - _vertexData[3].vertices = vertexFromAlphaPoint(Vector2(max.x,min.y)); + _vertexData[3].texCoords = textureCoordFromAlphaPoint(Vec2(max.x,min.y)); + _vertexData[3].vertices = vertexFromAlphaPoint(Vec2(max.x,min.y)); } else { if(!_vertexData) { _vertexDataCount = 8; _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F)); CCASSERT( _vertexData, "CCProgressTimer. Not enough memory"); // TOPLEFT 1 - _vertexData[0].texCoords = textureCoordFromAlphaPoint(Vector2(0,1)); - _vertexData[0].vertices = vertexFromAlphaPoint(Vector2(0,1)); + _vertexData[0].texCoords = textureCoordFromAlphaPoint(Vec2(0,1)); + _vertexData[0].vertices = vertexFromAlphaPoint(Vec2(0,1)); // BOTLEFT 1 - _vertexData[1].texCoords = textureCoordFromAlphaPoint(Vector2(0,0)); - _vertexData[1].vertices = vertexFromAlphaPoint(Vector2(0,0)); + _vertexData[1].texCoords = textureCoordFromAlphaPoint(Vec2(0,0)); + _vertexData[1].vertices = vertexFromAlphaPoint(Vec2(0,0)); // TOPRIGHT 2 - _vertexData[6].texCoords = textureCoordFromAlphaPoint(Vector2(1,1)); - _vertexData[6].vertices = vertexFromAlphaPoint(Vector2(1,1)); + _vertexData[6].texCoords = textureCoordFromAlphaPoint(Vec2(1,1)); + _vertexData[6].vertices = vertexFromAlphaPoint(Vec2(1,1)); // BOTRIGHT 2 - _vertexData[7].texCoords = textureCoordFromAlphaPoint(Vector2(1,0)); - _vertexData[7].vertices = vertexFromAlphaPoint(Vector2(1,0)); + _vertexData[7].texCoords = textureCoordFromAlphaPoint(Vec2(1,0)); + _vertexData[7].vertices = vertexFromAlphaPoint(Vec2(1,0)); } // TOPRIGHT 1 - _vertexData[2].texCoords = textureCoordFromAlphaPoint(Vector2(min.x,max.y)); - _vertexData[2].vertices = vertexFromAlphaPoint(Vector2(min.x,max.y)); + _vertexData[2].texCoords = textureCoordFromAlphaPoint(Vec2(min.x,max.y)); + _vertexData[2].vertices = vertexFromAlphaPoint(Vec2(min.x,max.y)); // BOTRIGHT 1 - _vertexData[3].texCoords = textureCoordFromAlphaPoint(Vector2(min.x,min.y)); - _vertexData[3].vertices = vertexFromAlphaPoint(Vector2(min.x,min.y)); + _vertexData[3].texCoords = textureCoordFromAlphaPoint(Vec2(min.x,min.y)); + _vertexData[3].vertices = vertexFromAlphaPoint(Vec2(min.x,min.y)); // TOPLEFT 2 - _vertexData[4].texCoords = textureCoordFromAlphaPoint(Vector2(max.x,max.y)); - _vertexData[4].vertices = vertexFromAlphaPoint(Vector2(max.x,max.y)); + _vertexData[4].texCoords = textureCoordFromAlphaPoint(Vec2(max.x,max.y)); + _vertexData[4].vertices = vertexFromAlphaPoint(Vec2(max.x,max.y)); // BOTLEFT 2 - _vertexData[5].texCoords = textureCoordFromAlphaPoint(Vector2(max.x,min.y)); - _vertexData[5].vertices = vertexFromAlphaPoint(Vector2(max.x,min.y)); + _vertexData[5].texCoords = textureCoordFromAlphaPoint(Vec2(max.x,min.y)); + _vertexData[5].vertices = vertexFromAlphaPoint(Vec2(max.x,min.y)); } updateColor(); } -Vector2 ProgressTimer::boundaryTexCoord(char index) +Vec2 ProgressTimer::boundaryTexCoord(char index) { if (index < kProgressTextureCoordsCount) { if (_reverseDirection) { - return Vector2((kProgressTextureCoords>>(7-(index<<1)))&1,(kProgressTextureCoords>>(7-((index<<1)+1)))&1); + return Vec2((kProgressTextureCoords>>(7-(index<<1)))&1,(kProgressTextureCoords>>(7-((index<<1)+1)))&1); } else { - return Vector2((kProgressTextureCoords>>((index<<1)+1))&1,(kProgressTextureCoords>>(index<<1))&1); + return Vec2((kProgressTextureCoords>>((index<<1)+1))&1,(kProgressTextureCoords>>(index<<1))&1); } } - return Vector2::ZERO; + return Vec2::ZERO; } -void ProgressTimer::onDraw(const Matrix &transform, bool transformUpdated) +void ProgressTimer::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); @@ -518,7 +518,7 @@ void ProgressTimer::onDraw(const Matrix &transform, bool transformUpdated) int offset = 0; glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); - offset += sizeof(Vector2); + offset += sizeof(Vec2); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); offset += sizeof(Color4B); @@ -551,7 +551,7 @@ void ProgressTimer::onDraw(const Matrix &transform, bool transformUpdated) } } -void ProgressTimer::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ProgressTimer::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if( ! _vertexData || ! _sprite) return; diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index 2cf8695305..84a4da05b3 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -91,28 +91,28 @@ public: * If you're using radials type then the midpoint changes the center point * If you're using bar type the the midpoint changes the bar growth * it expands from the center but clamps to the sprites edge so: - * you want a left to right then set the midpoint all the way to Vector2(0,y) - * you want a right to left then set the midpoint all the way to Vector2(1,y) - * you want a bottom to top then set the midpoint all the way to Vector2(x,0) - * you want a top to bottom then set the midpoint all the way to Vector2(x,1) + * you want a left to right then set the midpoint all the way to Vec2(0,y) + * you want a right to left then set the midpoint all the way to Vec2(1,y) + * you want a bottom to top then set the midpoint all the way to Vec2(x,0) + * you want a top to bottom then set the midpoint all the way to Vec2(x,1) */ - void setMidpoint(const Vector2& point); + void setMidpoint(const Vec2& point); /** Returns the Midpoint */ - Vector2 getMidpoint() const; + Vec2 getMidpoint() const; /** * This allows the bar type to move the component at a specific rate * Set the component to 0 to make sure it stays at 100%. * For example you want a left to right bar but not have the height stay 100% - * Set the rate to be Vector2(0,1); and set the midpoint to = Vector2(0,.5f); + * Set the rate to be Vec2(0,1); and set the midpoint to = Vec2(0,.5f); */ - inline void setBarChangeRate(const Vector2& barChangeRate ) { _barChangeRate = barChangeRate; } + inline void setBarChangeRate(const Vec2& barChangeRate ) { _barChangeRate = barChangeRate; } /** Returns the BarChangeRate */ - inline Vector2 getBarChangeRate() const { return _barChangeRate; } + inline Vec2 getBarChangeRate() const { return _barChangeRate; } // Overrides - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; - virtual void setAnchorPoint(const Vector2& anchorPoint) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; + virtual void setAnchorPoint(const Vec2& anchorPoint) override; virtual void setColor(const Color3B &color) override; virtual const Color3B& getColor() const override; virtual void setOpacity(GLubyte opacity) override; @@ -133,19 +133,19 @@ CC_CONSTRUCTOR_ACCESS: bool initWithSprite(Sprite* sp); protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); - Tex2F textureCoordFromAlphaPoint(Vector2 alpha); - Vector2 vertexFromAlphaPoint(Vector2 alpha); + Tex2F textureCoordFromAlphaPoint(Vec2 alpha); + Vec2 vertexFromAlphaPoint(Vec2 alpha); void updateProgress(void); void updateBar(void); void updateRadial(void); virtual void updateColor(void) override; - Vector2 boundaryTexCoord(char index); + Vec2 boundaryTexCoord(char index); Type _type; - Vector2 _midpoint; - Vector2 _barChangeRate; + Vec2 _midpoint; + Vec2 _barChangeRate; float _percentage; Sprite *_sprite; int _vertexDataCount; diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 52addc63a4..436e07daa8 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -306,7 +306,7 @@ void RenderTexture::setKeepMatrix(bool keepMatrix) _keepMatrix = keepMatrix; } -void RenderTexture::setVirtualViewport(const Vector2& rtBegin, const Rect& fullRect, const Rect& fullViewport) +void RenderTexture::setVirtualViewport(const Vec2& rtBegin, const Rect& fullRect, const Rect& fullViewport) { _rtTextureRect.origin.x = rtBegin.x; _rtTextureRect.origin.y = rtBegin.y; @@ -383,7 +383,7 @@ void RenderTexture::clearStencil(int stencilValue) glClearStencil(stencilClearValue); } -void RenderTexture::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // override visit. // Don't call visit on its children @@ -401,7 +401,7 @@ void RenderTexture::visit(Renderer *renderer, const Matrix &parentTransform, boo CCASSERT(nullptr != director, "Director is null when seting matrix stack"); // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); @@ -535,7 +535,7 @@ void RenderTexture::onBegin() director->setProjection(director->getProjection()); #if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 - Matrix modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection; director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION,modifiedProjection); #endif @@ -547,8 +547,8 @@ void RenderTexture::onBegin() float widthRatio = size.width / texSize.width; float heightRatio = size.height / texSize.height; - Matrix orthoMatrix; - Matrix::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); + Mat4 orthoMatrix; + Mat4::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); } @@ -654,7 +654,7 @@ void RenderTexture::onClearDepth() glClearDepth(depthClearValue); } -void RenderTexture::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void RenderTexture::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (_autoDraw) { @@ -703,8 +703,8 @@ void RenderTexture::begin() float widthRatio = size.width / texSize.width; float heightRatio = size.height / texSize.height; - Matrix orthoMatrix; - Matrix::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); + Mat4 orthoMatrix; + Mat4::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); } diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 0cbf0da984..d3f7ece158 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -153,8 +153,8 @@ public: }; // Overrides - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; //flag: use stack matrix computed from scene hierarchy or generate new modelView and projection matrix void setKeepMatrix(bool keepMatrix); @@ -163,7 +163,7 @@ public: //fullRect: the total size of screen //fullViewport: the total viewportSize */ - void setVirtualViewport(const Vector2& rtBegin, const Rect& fullRect, const Rect& fullViewport); + void setVirtualViewport(const Vec2& rtBegin, const Rect& fullRect, const Rect& fullViewport); public: // XXX should be procted. @@ -224,8 +224,8 @@ protected: void onSaveToFile(const std::string& fileName); - Matrix _oldTransMatrix, _oldProjMatrix; - Matrix _transformMatrix, _projectionMatrix; + Mat4 _oldTransMatrix, _oldProjMatrix; + Mat4 _transformMatrix, _projectionMatrix; private: CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture); diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index 55fb9bfc82..e4e4c58a4c 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -41,7 +41,7 @@ Scene::Scene() #endif { _ignoreAnchorPointForPosition = true; - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); } Scene::~Scene() diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 4059c1f87a..a5c2049310 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -234,10 +234,10 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated) _flippedX = _flippedY = false; // default transform anchor: center - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); // zwoptex default values - _offsetPosition = Vector2::ZERO; + _offsetPosition = Vec2::ZERO; // clean the Quad memset(&_quad, 0, sizeof(_quad)); @@ -367,7 +367,7 @@ void Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimme setVertexRect(rect); setTextureCoords(rect); - Vector2 relativeOffset = _unflippedOffsetPositionFromCenter; + Vec2 relativeOffset = _unflippedOffsetPositionFromCenter; // issue #732 if (_flippedX) @@ -399,10 +399,10 @@ void Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimme float y2 = y1 + _rect.size.height; // Don't update Z. - _quad.bl.vertices = Vector3(x1, y1, 0); - _quad.br.vertices = Vector3(x2, y1, 0); - _quad.tl.vertices = Vector3(x1, y2, 0); - _quad.tr.vertices = Vector3(x2, y2, 0); + _quad.bl.vertices = Vec3(x1, y1, 0); + _quad.br.vertices = Vec3(x2, y1, 0); + _quad.tl.vertices = Vec3(x1, y2, 0); + _quad.tr.vertices = Vec3(x2, y2, 0); } } @@ -505,7 +505,7 @@ void Sprite::updateTransform(void) // If it is not visible, or one of its ancestors is not visible, then do nothing: if( !_visible || ( _parent && _parent != _batchNode && static_cast(_parent)->_shouldBeHidden) ) { - _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vector3(0,0,0); + _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vec3(0,0,0); _shouldBeHidden = true; } else @@ -519,8 +519,8 @@ void Sprite::updateTransform(void) else { CCASSERT( dynamic_cast(_parent), "Logic error in Sprite. Parent must be a Sprite"); - Matrix nodeToParent = getNodeToParentTransform(); - Matrix parentTransform = static_cast(_parent)->_transformToBatch; + Mat4 nodeToParent = getNodeToParentTransform(); + Mat4 parentTransform = static_cast(_parent)->_transformToBatch; _transformToBatch = parentTransform * nodeToParent; } @@ -554,10 +554,10 @@ void Sprite::updateTransform(void) float dx = x1 * cr - y2 * sr2 + x; float dy = x1 * sr + y2 * cr2 + y; - _quad.bl.vertices = Vector3( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _positionZ ); - _quad.br.vertices = Vector3( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _positionZ ); - _quad.tl.vertices = Vector3( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _positionZ ); - _quad.tr.vertices = Vector3( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _positionZ ); + _quad.bl.vertices = Vec3( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _positionZ ); + _quad.br.vertices = Vec3( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _positionZ ); + _quad.tl.vertices = Vec3( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _positionZ ); + _quad.tr.vertices = Vec3( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _positionZ ); } // MARMALADE CHANGE: ADDED CHECK FOR nullptr, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS @@ -583,7 +583,7 @@ void Sprite::updateTransform(void) // draw -void Sprite::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Sprite::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { // Don't do calculate the culling if the transform was not updated _insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; @@ -604,15 +604,15 @@ void Sprite::drawDebugData() { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldModelView; + Mat4 oldModelView; oldModelView = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); // draw bounding box - Vector2 vertices[4] = { - Vector2( _quad.bl.vertices.x, _quad.bl.vertices.y ), - Vector2( _quad.br.vertices.x, _quad.br.vertices.y ), - Vector2( _quad.tr.vertices.x, _quad.tr.vertices.y ), - Vector2( _quad.tl.vertices.x, _quad.tl.vertices.y ), + Vec2 vertices[4] = { + Vec2( _quad.bl.vertices.x, _quad.bl.vertices.y ), + Vec2( _quad.br.vertices.x, _quad.br.vertices.y ), + Vec2( _quad.tr.vertices.x, _quad.tr.vertices.y ), + Vec2( _quad.tl.vertices.x, _quad.tl.vertices.y ), }; DrawPrimitives::drawPoly(vertices, 4, true); @@ -742,7 +742,7 @@ void Sprite::setDirtyRecursively(bool bValue) } \ } -void Sprite::setPosition(const Vector2& pos) +void Sprite::setPosition(const Vec2& pos) { Node::setPosition(pos); SET_DIRTY_RECURSIVELY(); @@ -815,7 +815,7 @@ void Sprite::setPositionZ(float fVertexZ) SET_DIRTY_RECURSIVELY(); } -void Sprite::setAnchorPoint(const Vector2& anchor) +void Sprite::setAnchorPoint(const Vec2& anchor) { Node::setAnchorPoint(anchor); SET_DIRTY_RECURSIVELY(); @@ -996,15 +996,15 @@ void Sprite::setBatchNode(SpriteBatchNode *spriteBatchNode) float y1 = _offsetPosition.y; float x2 = x1 + _rect.size.width; float y2 = y1 + _rect.size.height; - _quad.bl.vertices = Vector3( x1, y1, 0 ); - _quad.br.vertices = Vector3( x2, y1, 0 ); - _quad.tl.vertices = Vector3( x1, y2, 0 ); - _quad.tr.vertices = Vector3( x2, y2, 0 ); + _quad.bl.vertices = Vec3( x1, y1, 0 ); + _quad.br.vertices = Vec3( x2, y1, 0 ); + _quad.tl.vertices = Vec3( x1, y2, 0 ); + _quad.tr.vertices = Vec3( x2, y2, 0 ); } else { // using batch - _transformToBatch = Matrix::IDENTITY; + _transformToBatch = Mat4::IDENTITY; setTextureAtlas(_batchNode->getTextureAtlas()); // weak ref } } diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 7f401ec5b8..38d826fdb6 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -317,7 +317,7 @@ public: /** * Gets the offset position of the sprite. Calculated automatically by editors like Zwoptex. */ - inline const Vector2& getOffsetPosition(void) const { return _offsetPosition; } + inline const Vec2& getOffsetPosition(void) const { return _offsetPosition; } /** @@ -402,7 +402,7 @@ public: * @js NA * @lua NA */ - virtual void setPosition(const Vector2& pos) override; + virtual void setPosition(const Vec2& pos) override; virtual void setPosition(float x, float y) override; virtual void setRotation(float rotation) override; virtual void setRotationSkewX(float rotationX) override; @@ -417,10 +417,10 @@ public: virtual void sortAllChildren() override; virtual void setScale(float scale) override; virtual void setPositionZ(float positionZ) override; - virtual void setAnchorPoint(const Vector2& anchor) override; + virtual void setAnchorPoint(const Vec2& anchor) override; virtual void ignoreAnchorPointForPosition(bool value) override; virtual void setVisible(bool bVisible) override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void setOpacityModifyRGB(bool modify) override; virtual bool isOpacityModifyRGB(void) const override; /// @} @@ -535,7 +535,7 @@ protected: bool _dirty; /// Whether the sprite needs to be updated bool _recursiveDirty; /// Whether all of the sprite's children needs to be updated bool _shouldBeHidden; /// should not be drawn because one of the ancestors is not visible - Matrix _transformToBatch; + Mat4 _transformToBatch; // // Data used when the sprite is self-rendered @@ -556,8 +556,8 @@ protected: bool _rectRotated; /// Whether the texture is rotated // Offset Position (used by Zwoptex) - Vector2 _offsetPosition; - Vector2 _unflippedOffsetPositionFromCenter; + Vec2 _offsetPosition; + Vec2 _unflippedOffsetPositionFromCenter; // vertex coords, texture coords and color info V3F_C4B_T2F_Quad _quad; diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index b2bfaa4bfb..4c44ae543e 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -132,7 +132,7 @@ SpriteBatchNode::~SpriteBatchNode() // override visit // don't call visit on it's children -void SpriteBatchNode::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { CC_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); @@ -156,7 +156,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Matrix &parentTransform, b _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -356,7 +356,7 @@ void SpriteBatchNode::reorderBatch(bool reorder) _reorderChildDirty=reorder; } -void SpriteBatchNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void SpriteBatchNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { // Optimization: Fast Dispatch if( _textureAtlas->getTotalQuads() == 0 ) diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index 0f3be91dd8..6f59a65ba1 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -134,7 +134,7 @@ public: */ virtual const BlendFunc& getBlendFunc() const override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; using Node::addChild; virtual void addChild(Node * child, int zOrder, int tag) override; @@ -143,7 +143,7 @@ public: virtual void removeChild(Node *child, bool cleanup) override; virtual void removeAllChildrenWithCleanup(bool cleanup) override; virtual void sortAllChildren() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string getDescription() const override; /** Inserts a quad at a certain index into the texture atlas. The Sprite won't be added into the children array. diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index 7301b4af59..86f46dc809 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -50,7 +50,7 @@ SpriteFrame* SpriteFrame::createWithTexture(Texture2D *texture, const Rect& rect return spriteFrame; } -SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize) +SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize) { SpriteFrame *spriteFrame = new SpriteFrame(); spriteFrame->initWithTexture(texture, rect, rotated, offset, originalSize); @@ -59,7 +59,7 @@ SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect return spriteFrame; } -SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize) +SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize) { SpriteFrame *spriteFrame = new SpriteFrame(); spriteFrame->initWithTextureFilename(filename, rect, rotated, offset, originalSize); @@ -71,16 +71,16 @@ SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect) { Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); - return initWithTexture(texture, rectInPixels, false, Vector2::ZERO, rectInPixels.size); + return initWithTexture(texture, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } bool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect) { Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS( rect ); - return initWithTextureFilename(filename, rectInPixels, false, Vector2::ZERO, rectInPixels.size); + return initWithTextureFilename(filename, rectInPixels, false, Vec2::ZERO, rectInPixels.size); } -bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize) +bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize) { _texture = texture; @@ -100,7 +100,7 @@ bool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect, bool rot return true; } -bool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize) +bool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize) { _texture = nullptr; _textureFilename = filename; @@ -143,23 +143,23 @@ void SpriteFrame::setRectInPixels(const Rect& rectInPixels) _rect = CC_RECT_PIXELS_TO_POINTS(rectInPixels); } -const Vector2& SpriteFrame::getOffset() const +const Vec2& SpriteFrame::getOffset() const { return _offset; } -void SpriteFrame::setOffset(const Vector2& offsets) +void SpriteFrame::setOffset(const Vec2& offsets) { _offset = offsets; _offsetInPixels = CC_POINT_POINTS_TO_PIXELS( _offset ); } -const Vector2& SpriteFrame::getOffsetInPixels() const +const Vec2& SpriteFrame::getOffsetInPixels() const { return _offsetInPixels; } -void SpriteFrame::setOffsetInPixels(const Vector2& offsetInPixels) +void SpriteFrame::setOffsetInPixels(const Vec2& offsetInPixels) { _offsetInPixels = offsetInPixels; _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels ); diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index ae64fad5b7..bea7424ba3 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -64,7 +64,7 @@ public: /** Create a SpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. The originalSize is the size in pixels of the frame before being trimmed. */ - static SpriteFrame* create(const std::string& filename, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize); + static SpriteFrame* create(const std::string& filename, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize); /** Create a SpriteFrame with a texture, rect in points. It is assumed that the frame was not trimmed. @@ -74,7 +74,7 @@ public: /** Create a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. The originalSize is the size in points of the frame before being trimmed. */ - static SpriteFrame* createWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize); + static SpriteFrame* createWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize); /** * @js NA * @lua NA @@ -94,14 +94,14 @@ public: /** Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. The originalSize is the size in points of the frame before being trimmed. */ - bool initWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize); + bool initWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize); /** Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. The originalSize is the size in pixels of the frame before being trimmed. @since v1.1 */ - bool initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Vector2& offset, const Size& originalSize); + bool initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Vec2& offset, const Size& originalSize); // attributes @@ -117,9 +117,9 @@ public: void setRect(const Rect& rect); /** get offset of the frame */ - const Vector2& getOffsetInPixels(void) const; + const Vec2& getOffsetInPixels(void) const; /** set offset of the frame */ - void setOffsetInPixels(const Vector2& offsetInPixels); + void setOffsetInPixels(const Vec2& offsetInPixels); /** get original size of the trimmed image */ inline const Size& getOriginalSizeInPixels(void) const { return _originalSizeInPixels; } @@ -136,19 +136,19 @@ public: /** set texture of the frame, the texture is retained */ void setTexture(Texture2D* pobTexture); - const Vector2& getOffset(void) const; - void setOffset(const Vector2& offsets); + const Vec2& getOffset(void) const; + void setOffset(const Vec2& offsets); // Overrides virtual SpriteFrame *clone() const override; protected: - Vector2 _offset; + Vec2 _offset; Size _originalSize; Rect _rectInPixels; bool _rotated; Rect _rect; - Vector2 _offsetInPixels; + Vec2 _offsetInPixels; Size _originalSizeInPixels; Texture2D *_texture; std::string _textureFilename; diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index eeb87fdd32..4f9cedfa9e 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -132,7 +132,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu spriteFrame->initWithTexture(texture, Rect(x, y, w, h), false, - Vector2(ox, oy), + Vec2(ox, oy), Size((float)ow, (float)oh) ); } @@ -147,7 +147,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu rotated = frameDict["rotated"].asBool(); } - Vector2 offset = PointFromString(frameDict["offset"].asString()); + Vec2 offset = PointFromString(frameDict["offset"].asString()); Size sourceSize = SizeFromString(frameDict["sourceSize"].asString()); // create frame @@ -163,7 +163,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu { // get values Size spriteSize = SizeFromString(frameDict["spriteSize"].asString()); - Vector2 spriteOffset = PointFromString(frameDict["spriteOffset"].asString()); + Vec2 spriteOffset = PointFromString(frameDict["spriteOffset"].asString()); Size spriteSourceSize = SizeFromString(frameDict["spriteSourceSize"].asString()); Rect textureRect = RectFromString(frameDict["textureRect"].asString()); bool textureRotated = frameDict["textureRotated"].asBool(); diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index d88dcd4c0e..8a61292f57 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -83,7 +83,7 @@ bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *la _layerOrientation = mapInfo->getOrientation(); // offset (after layer orientation is set); - Vector2 offset = this->calculateLayerOffset(layerInfo->_offset); + Vec2 offset = this->calculateLayerOffset(layerInfo->_offset); this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset)); _atlasIndexArray = ccCArrayNew(totalNumberOfTiles); @@ -176,7 +176,7 @@ void TMXLayer::setupTiles() // XXX: gid == 0 --> empty tile if (gid != 0) { - this->appendTileForGID(gid, Vector2(x, y)); + this->appendTileForGID(gid, Vec2(x, y)); } } } @@ -223,25 +223,25 @@ void TMXLayer::parseInternalProperties() } } -void TMXLayer::setupTileSprite(Sprite* sprite, Vector2 pos, int gid) +void TMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid) { sprite->setPosition(getPositionAt(pos)); sprite->setPositionZ((float)getVertexZForPos(pos)); - sprite->setAnchorPoint(Vector2::ZERO); + sprite->setAnchorPoint(Vec2::ZERO); sprite->setOpacity(_opacity); //issue 1264, flip can be undone as well sprite->setFlippedX(false); sprite->setFlippedY(false); sprite->setRotation(0.0f); - sprite->setAnchorPoint(Vector2(0,0)); + sprite->setAnchorPoint(Vec2(0,0)); // Rotation in tiled is achieved using 3 flipped states, flipping across the horizontal, vertical, and diagonal axes of the tiles. if (gid & kTMXTileDiagonalFlag) { // put the anchor in the middle for ease of rotation. - sprite->setAnchorPoint(Vector2(0.5f,0.5f)); - sprite->setPosition(Vector2(getPositionAt(pos).x + sprite->getContentSize().height/2, + sprite->setAnchorPoint(Vec2(0.5f,0.5f)); + sprite->setPosition(Vec2(getPositionAt(pos).x + sprite->getContentSize().height/2, getPositionAt(pos).y + sprite->getContentSize().width/2 ) ); int flag = gid & (kTMXTileHorizontalFlag | kTMXTileVerticalFlag ); @@ -305,7 +305,7 @@ Sprite* TMXLayer::reusedTileWithRect(Rect rect) } // TMXLayer - obtaining tiles/gids -Sprite * TMXLayer::getTileAt(const Vector2& pos) +Sprite * TMXLayer::getTileAt(const Vec2& pos) { 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"); @@ -329,7 +329,7 @@ Sprite * TMXLayer::getTileAt(const Vector2& pos) tile->setBatchNode(this); tile->setPosition(getPositionAt(pos)); tile->setPositionZ((float)getVertexZForPos(pos)); - tile->setAnchorPoint(Vector2::ZERO); + tile->setAnchorPoint(Vec2::ZERO); tile->setOpacity(_opacity); ssize_t indexForZ = atlasIndexForExistantZ(z); @@ -340,7 +340,7 @@ Sprite * TMXLayer::getTileAt(const Vector2& pos) return tile; } -uint32_t TMXLayer::getTileGIDAt(const Vector2& pos, TMXTileFlags* flags/* = nullptr*/) +uint32_t TMXLayer::getTileGIDAt(const Vec2& pos, TMXTileFlags* flags/* = nullptr*/) { 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"); @@ -359,7 +359,7 @@ uint32_t TMXLayer::getTileGIDAt(const Vector2& pos, TMXTileFlags* flags/* = null } // TMXLayer - adding helper methods -Sprite * TMXLayer::insertTileForGID(uint32_t gid, const Vector2& pos) +Sprite * TMXLayer::insertTileForGID(uint32_t gid, const Vec2& pos) { if (gid != 0 && (static_cast((gid & kTMXFlippedMask)) - _tileSet->_firstGid) >= 0) { @@ -399,7 +399,7 @@ Sprite * TMXLayer::insertTileForGID(uint32_t gid, const Vector2& pos) return nullptr; } -Sprite * TMXLayer::updateTileForGID(uint32_t gid, const Vector2& pos) +Sprite * TMXLayer::updateTileForGID(uint32_t gid, const Vec2& pos) { Rect rect = _tileSet->getRectForGID(gid); rect = Rect(rect.origin.x / _contentScaleFactor, rect.origin.y / _contentScaleFactor, rect.size.width/ _contentScaleFactor, rect.size.height/ _contentScaleFactor); @@ -421,7 +421,7 @@ Sprite * TMXLayer::updateTileForGID(uint32_t gid, const Vector2& pos) // used only when parsing the map. useless after the map was parsed // since lot's of assumptions are no longer true -Sprite * TMXLayer::appendTileForGID(uint32_t gid, const Vector2& pos) +Sprite * TMXLayer::appendTileForGID(uint32_t gid, const Vec2& pos) { if (gid != 0 && (static_cast((gid & kTMXFlippedMask)) - _tileSet->_firstGid) >= 0) { @@ -485,12 +485,12 @@ ssize_t TMXLayer::atlasIndexForNewZ(int z) } // TMXLayer - adding / remove tiles -void TMXLayer::setTileGID(uint32_t gid, const Vector2& pos) +void TMXLayer::setTileGID(uint32_t gid, const Vec2& pos) { setTileGID(gid, pos, (TMXTileFlags)0); } -void TMXLayer::setTileGID(uint32_t gid, const Vector2& pos, TMXTileFlags flags) +void TMXLayer::setTileGID(uint32_t gid, const Vec2& 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"); @@ -564,7 +564,7 @@ void TMXLayer::removeChild(Node* node, bool cleanup) SpriteBatchNode::removeChild(sprite, cleanup); } -void TMXLayer::removeTileAt(const Vector2& pos) +void TMXLayer::removeTileAt(const Vec2& pos) { 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"); @@ -606,28 +606,28 @@ void TMXLayer::removeTileAt(const Vector2& pos) } //CCTMXLayer - obtaining positions, offset -Vector2 TMXLayer::calculateLayerOffset(const Vector2& pos) +Vec2 TMXLayer::calculateLayerOffset(const Vec2& pos) { - Vector2 ret = Vector2::ZERO; + Vec2 ret = Vec2::ZERO; switch (_layerOrientation) { case TMXOrientationOrtho: - ret = Vector2( pos.x * _mapTileSize.width, -pos.y *_mapTileSize.height); + ret = Vec2( pos.x * _mapTileSize.width, -pos.y *_mapTileSize.height); break; case TMXOrientationIso: - ret = Vector2((_mapTileSize.width /2) * (pos.x - pos.y), + ret = Vec2((_mapTileSize.width /2) * (pos.x - pos.y), (_mapTileSize.height /2 ) * (-pos.x - pos.y)); break; case TMXOrientationHex: - CCASSERT(pos.equals(Vector2::ZERO), "offset for hexagonal map not implemented yet"); + CCASSERT(pos.equals(Vec2::ZERO), "offset for hexagonal map not implemented yet"); break; } return ret; } -Vector2 TMXLayer::getPositionAt(const Vector2& pos) +Vec2 TMXLayer::getPositionAt(const Vec2& pos) { - Vector2 ret = Vector2::ZERO; + Vec2 ret = Vec2::ZERO; switch (_layerOrientation) { case TMXOrientationOrtho: @@ -644,19 +644,19 @@ Vector2 TMXLayer::getPositionAt(const Vector2& pos) return ret; } -Vector2 TMXLayer::getPositionForOrthoAt(const Vector2& pos) +Vec2 TMXLayer::getPositionForOrthoAt(const Vec2& pos) { - return Vector2(pos.x * _mapTileSize.width, + return Vec2(pos.x * _mapTileSize.width, (_layerSize.height - pos.y - 1) * _mapTileSize.height); } -Vector2 TMXLayer::getPositionForIsoAt(const Vector2& pos) +Vec2 TMXLayer::getPositionForIsoAt(const Vec2& pos) { - return Vector2(_mapTileSize.width /2 * (_layerSize.width + pos.x - pos.y - 1), + return Vec2(_mapTileSize.width /2 * (_layerSize.width + pos.x - pos.y - 1), _mapTileSize.height /2 * ((_layerSize.height * 2 - pos.x - pos.y) - 2)); } -Vector2 TMXLayer::getPositionForHexAt(const Vector2& pos) +Vec2 TMXLayer::getPositionForHexAt(const Vec2& pos) { float diffY = 0; if ((int)pos.x % 2 == 1) @@ -664,12 +664,12 @@ Vector2 TMXLayer::getPositionForHexAt(const Vector2& pos) diffY = -_mapTileSize.height/2 ; } - Vector2 xy = Vector2(pos.x * _mapTileSize.width*3/4, + Vec2 xy = Vec2(pos.x * _mapTileSize.width*3/4, (_layerSize.height - pos.y - 1) * _mapTileSize.height + diffY); return xy; } -int TMXLayer::getVertexZForPos(const Vector2& pos) +int TMXLayer::getVertexZForPos(const Vec2& pos) { int ret = 0; int maxVal = 0; diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index a59e228d03..58ffa34db4 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -102,16 +102,16 @@ public: The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc. You can remove either by calling: - layer->removeChild(sprite, cleanup); - - or layer->removeTileAt(Vector2(x,y)); + - or layer->removeTileAt(Vec2(x,y)); */ - Sprite* getTileAt(const Vector2& tileCoordinate); - CC_DEPRECATED_ATTRIBUTE Sprite* tileAt(const Vector2& tileCoordinate) { return getTileAt(tileCoordinate); }; + Sprite* getTileAt(const Vec2& tileCoordinate); + CC_DEPRECATED_ATTRIBUTE Sprite* tileAt(const Vec2& tileCoordinate) { return getTileAt(tileCoordinate); }; /** returns the tile gid at a given tile coordinate. It also returns the tile flags. This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]) */ - uint32_t getTileGIDAt(const Vector2& tileCoordinate, TMXTileFlags* flags = nullptr); - CC_DEPRECATED_ATTRIBUTE uint32_t tileGIDAt(const Vector2& tileCoordinate, TMXTileFlags* flags = nullptr){ + uint32_t getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr); + CC_DEPRECATED_ATTRIBUTE uint32_t tileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr){ return getTileGIDAt(tileCoordinate, flags); }; @@ -119,7 +119,7 @@ public: The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. If a tile is already placed at that position, then it will be removed. */ - void setTileGID(uint32_t gid, const Vector2& tileCoordinate); + void setTileGID(uint32_t gid, const Vec2& tileCoordinate); /** sets the tile gid (gid = tile global id) at a given tile coordinate. The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. @@ -128,14 +128,14 @@ public: Use withFlags if the tile flags need to be changed as well */ - void setTileGID(uint32_t gid, const Vector2& tileCoordinate, TMXTileFlags flags); + void setTileGID(uint32_t gid, const Vec2& tileCoordinate, TMXTileFlags flags); /** removes a tile at given tile coordinate */ - void removeTileAt(const Vector2& tileCoordinate); + void removeTileAt(const Vec2& tileCoordinate); /** returns the position in points of a given tile coordinate */ - Vector2 getPositionAt(const Vector2& tileCoordinate); - CC_DEPRECATED_ATTRIBUTE Vector2 positionAt(const Vector2& tileCoordinate) { return getPositionAt(tileCoordinate); }; + Vec2 getPositionAt(const Vec2& tileCoordinate); + CC_DEPRECATED_ATTRIBUTE Vec2 positionAt(const Vec2& tileCoordinate) { return getPositionAt(tileCoordinate); }; /** return the value for the specific property name */ Value getProperty(const std::string& propertyName) const; @@ -193,22 +193,22 @@ public: virtual std::string getDescription() const override; private: - Vector2 getPositionForIsoAt(const Vector2& pos); - Vector2 getPositionForOrthoAt(const Vector2& pos); - Vector2 getPositionForHexAt(const Vector2& pos); + Vec2 getPositionForIsoAt(const Vec2& pos); + Vec2 getPositionForOrthoAt(const Vec2& pos); + Vec2 getPositionForHexAt(const Vec2& pos); - Vector2 calculateLayerOffset(const Vector2& offset); + Vec2 calculateLayerOffset(const Vec2& offset); /* optimization methods */ - Sprite* appendTileForGID(uint32_t gid, const Vector2& pos); - Sprite* insertTileForGID(uint32_t gid, const Vector2& pos); - Sprite* updateTileForGID(uint32_t gid, const Vector2& pos); + Sprite* appendTileForGID(uint32_t gid, const Vec2& pos); + Sprite* insertTileForGID(uint32_t gid, const Vec2& pos); + Sprite* updateTileForGID(uint32_t gid, const Vec2& pos); /* The layer recognizes some special properties, like cc_vertez */ void parseInternalProperties(); - void setupTileSprite(Sprite* sprite, Vector2 pos, int gid); + void setupTileSprite(Sprite* sprite, Vec2 pos, int gid); Sprite* reusedTileWithRect(Rect rect); - int getVertexZForPos(const Vector2& pos); + int getVertexZForPos(const Vec2& pos); // index ssize_t atlasIndexForExistantZ(int z); diff --git a/cocos/2d/CCTMXObjectGroup.cpp b/cocos/2d/CCTMXObjectGroup.cpp index 9d014fa459..6b2a55af32 100644 --- a/cocos/2d/CCTMXObjectGroup.cpp +++ b/cocos/2d/CCTMXObjectGroup.cpp @@ -34,7 +34,7 @@ NS_CC_BEGIN TMXObjectGroup::TMXObjectGroup() : _groupName("") - , _positionOffset(Vector2::ZERO) + , _positionOffset(Vec2::ZERO) { } diff --git a/cocos/2d/CCTMXObjectGroup.h b/cocos/2d/CCTMXObjectGroup.h index e31d39ded0..83d6945a59 100644 --- a/cocos/2d/CCTMXObjectGroup.h +++ b/cocos/2d/CCTMXObjectGroup.h @@ -71,10 +71,10 @@ public: CC_DEPRECATED_ATTRIBUTE ValueMap objectNamed(const std::string& objectName) const { return getObject(objectName); }; /** Gets the offset position of child objects */ - inline const Vector2& getPositionOffset() const { return _positionOffset; }; + inline const Vec2& getPositionOffset() const { return _positionOffset; }; /** Sets the offset position of child objects */ - inline void setPositionOffset(const Vector2& offset) { _positionOffset = offset; }; + inline void setPositionOffset(const Vec2& offset) { _positionOffset = offset; }; /** Gets the list of properties stored in a dictionary */ inline const ValueMap& getProperties() const { return _properties; }; @@ -98,7 +98,7 @@ protected: /** name of the group */ std::string _groupName; /** offset position of child objects */ - Vector2 _positionOffset; + Vec2 _positionOffset; /** list of properties stored in a dictionary */ ValueMap _properties; /** array of the objects */ diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index f07708117a..a2de4100a6 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -45,7 +45,7 @@ TMXLayerInfo::TMXLayerInfo() : _name("") , _tiles(nullptr) , _ownTiles(true) -, _offset(Vector2::ZERO) +, _offset(Vec2::ZERO) { } @@ -348,7 +348,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) float x = attributeDict["x"].asFloat(); float y = attributeDict["y"].asFloat(); - layer->_offset = Vector2(x,y); + layer->_offset = Vec2(x,y); tmxMapInfo->getLayers().pushBack(layer); layer->release(); @@ -361,7 +361,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) { TMXObjectGroup *objectGroup = new TMXObjectGroup(); objectGroup->setGroupName(attributeDict["name"].asString()); - Vector2 positionOffset; + Vec2 positionOffset; positionOffset.x = attributeDict["x"].asFloat() * tmxMapInfo->getTileSize().width; positionOffset.y = attributeDict["y"].asFloat() * tmxMapInfo->getTileSize().height; objectGroup->setPositionOffset(positionOffset); @@ -452,7 +452,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) // Y int y = attributeDict["y"].asInt(); - Vector2 p(x + objectGroup->getPositionOffset().x, _mapSize.height * _tileSize.height - y - objectGroup->getPositionOffset().x - attributeDict["height"].asInt()); + Vec2 p(x + objectGroup->getPositionOffset().x, _mapSize.height * _tileSize.height - y - objectGroup->getPositionOffset().x - attributeDict["height"].asInt()); p = CC_POINT_PIXELS_TO_POINTS(p); dict["x"] = Value(p.x); dict["y"] = Value(p.y); diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index f84f7d8ba8..94621db3b0 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -112,7 +112,7 @@ public: bool _visible; unsigned char _opacity; bool _ownTiles; - Vector2 _offset; + Vec2 _offset; }; /** @brief TMXTilesetInfo contains the information about the tilesets like: diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 44666aab61..9a49232431 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -263,7 +263,7 @@ void TextFieldTTF::setTextColor(const Color4B &color) Label::setTextColor(_colorText); } -void TextFieldTTF::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void TextFieldTTF::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (_delegate && _delegate->onVisit(this,renderer,parentTransform,parentTransformUpdated)) { diff --git a/cocos/2d/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h index 722e3143cb..98b3283492 100644 --- a/cocos/2d/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -86,7 +86,7 @@ public: /** @brief If the sender doesn't want to draw, return true. */ - virtual bool onVisit(TextFieldTTF * sender,Renderer *renderer, const Matrix &transform, bool transformUpdated) + virtual bool onVisit(TextFieldTTF * sender,Renderer *renderer, const Mat4 &transform, bool transformUpdated) { CC_UNUSED_PARAM(sender); return false; @@ -165,7 +165,7 @@ public: virtual void setSecureTextEntry(bool value); virtual bool isSecureTextEntry(); - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp index cd7075b4cd..f6a6df9033 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -1142,7 +1142,7 @@ bool Texture2D::initWithString(const char *text, const FontDefinition& textDefin // implementation Texture2D (Drawing) -void Texture2D::drawAtPoint(const Vector2& point) +void Texture2D::drawAtPoint(const Vec2& point) { GLfloat coordinates[] = { 0.0f, _maxT, diff --git a/cocos/2d/CCTexture2D.h b/cocos/2d/CCTexture2D.h index a2892c99bf..744ae29786 100644 --- a/cocos/2d/CCTexture2D.h +++ b/cocos/2d/CCTexture2D.h @@ -219,7 +219,7 @@ public: These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled. */ /** draws a texture at a given point */ - void drawAtPoint(const Vector2& point); + void drawAtPoint(const Vec2& point); /** draws a texture inside a rect */ void drawInRect(const Rect& rect); diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp index 14e93b6ace..77f4e7d43f 100644 --- a/cocos/2d/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -125,7 +125,7 @@ void TileMapAtlas::loadTGAfile(const std::string& file) } // TileMapAtlas - Atlas generation / updates -void TileMapAtlas::setTile(const Color3B& tile, const Vector2& position) +void TileMapAtlas::setTile(const Color3B& tile, const Vec2& position) { CCASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); CCASSERT(position.x < _TGAInfo->width, "Invalid position.x"); @@ -151,7 +151,7 @@ void TileMapAtlas::setTile(const Color3B& tile, const Vector2& position) } } -Color3B TileMapAtlas::getTileAt(const Vector2& position) const +Color3B TileMapAtlas::getTileAt(const Vec2& position) const { CCASSERT( _TGAInfo != nullptr, "tgaInfo must not be nil"); CCASSERT( position.x < _TGAInfo->width, "Invalid position.x"); @@ -163,7 +163,7 @@ Color3B TileMapAtlas::getTileAt(const Vector2& position) const return value; } -void TileMapAtlas::updateAtlasValueAt(const Vector2& pos, const Color3B& value, int index) +void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int index) { CCASSERT( index >= 0 && index < _textureAtlas->getCapacity(), "updateAtlasValueAt: Invalid index"); @@ -244,7 +244,7 @@ void TileMapAtlas::updateAtlasValues() if( value.r != 0 ) { - this->updateAtlasValueAt(Vector2(x,y), value, total); + this->updateAtlasValueAt(Vec2(x,y), value, total); std::string key = StringUtils::toString(x) + "," + StringUtils::toString(y); _posToAtlasIndex[key] = total; diff --git a/cocos/2d/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h index f38b71239d..7ac9382f3c 100644 --- a/cocos/2d/CCTileMapAtlas.h +++ b/cocos/2d/CCTileMapAtlas.h @@ -78,12 +78,12 @@ public: /** returns a tile from position x,y. For the moment only channel R is used */ - Color3B getTileAt(const Vector2& position) const; - CC_DEPRECATED_ATTRIBUTE Color3B tileAt(const Vector2& position) const { return getTileAt(position); }; + Color3B getTileAt(const Vec2& position) const; + CC_DEPRECATED_ATTRIBUTE Color3B tileAt(const Vec2& position) const { return getTileAt(position); }; /** sets a tile at position x,y. For the moment only channel R is used */ - void setTile(const Color3B& tile, const Vector2& position); + void setTile(const Color3B& tile, const Vec2& position); /** dealloc the map from memory */ void releaseMap(); @@ -93,7 +93,7 @@ public: protected: void loadTGAfile(const std::string& file); void calculateItemsToRender(); - void updateAtlasValueAt(const Vector2& pos, const Color3B& value, int index); + void updateAtlasValueAt(const Vec2& pos, const Color3B& value, int index); void updateAtlasValues(); diff --git a/cocos/2d/CCTransition.cpp b/cocos/2d/CCTransition.cpp index 1c0faf7e1a..492a820ca0 100644 --- a/cocos/2d/CCTransition.cpp +++ b/cocos/2d/CCTransition.cpp @@ -103,7 +103,7 @@ void TransitionScene::sceneOrder() _isInSceneOnTop = true; } -void TransitionScene::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionScene::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Scene::draw(renderer, transform, transformUpdated); @@ -120,13 +120,13 @@ void TransitionScene::finish() { // clean up _inScene->setVisible(true); - _inScene->setPosition(Vector2(0,0)); + _inScene->setPosition(Vec2(0,0)); _inScene->setScale(1.0f); _inScene->setRotation(0.0f); _inScene->setAdditionalTransform(nullptr); _outScene->setVisible(false); - _outScene->setPosition(Vector2(0,0)); + _outScene->setPosition(Vec2(0,0)); _outScene->setScale(1.0f); _outScene->setRotation(0.0f); _outScene->setAdditionalTransform(nullptr); @@ -255,8 +255,8 @@ void TransitionRotoZoom:: onEnter() _inScene->setScale(0.001f); _outScene->setScale(1.0f); - _inScene->setAnchorPoint(Vector2(0.5f, 0.5f)); - _outScene->setAnchorPoint(Vector2(0.5f, 0.5f)); + _inScene->setAnchorPoint(Vec2(0.5f, 0.5f)); + _outScene->setAnchorPoint(Vec2(0.5f, 0.5f)); ActionInterval *rotozoom = (ActionInterval*)(Sequence::create ( @@ -310,11 +310,11 @@ void TransitionJumpZoom::onEnter() Size s = Director::getInstance()->getWinSize(); _inScene->setScale(0.5f); - _inScene->setPosition(Vector2(s.width, 0)); - _inScene->setAnchorPoint(Vector2(0.5f, 0.5f)); - _outScene->setAnchorPoint(Vector2(0.5f, 0.5f)); + _inScene->setPosition(Vec2(s.width, 0)); + _inScene->setAnchorPoint(Vec2(0.5f, 0.5f)); + _outScene->setAnchorPoint(Vec2(0.5f, 0.5f)); - ActionInterval *jump = JumpBy::create(_duration/4, Vector2(-s.width,0), s.width/4, 2); + ActionInterval *jump = JumpBy::create(_duration/4, Vec2(-s.width,0), s.width/4, 2); ActionInterval *scaleIn = ScaleTo::create(_duration/4, 1.0f); ActionInterval *scaleOut = ScaleTo::create(_duration/4, 0.5f); @@ -379,7 +379,7 @@ void TransitionMoveInL::onEnter() ActionInterval* TransitionMoveInL::action() { - return MoveTo::create(_duration, Vector2(0,0)); + return MoveTo::create(_duration, Vec2(0,0)); } ActionInterval* TransitionMoveInL::easeActionWithAction(ActionInterval* action) @@ -391,7 +391,7 @@ ActionInterval* TransitionMoveInL::easeActionWithAction(ActionInterval* action) void TransitionMoveInL::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition(Vector2(-s.width,0)); + _inScene->setPosition(Vec2(-s.width,0)); } // @@ -419,7 +419,7 @@ TransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene) void TransitionMoveInR::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(s.width,0) ); + _inScene->setPosition( Vec2(s.width,0) ); } // @@ -447,7 +447,7 @@ TransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene) void TransitionMoveInT::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(0,s.height) ); + _inScene->setPosition( Vec2(0,s.height) ); } // @@ -475,7 +475,7 @@ TransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene) void TransitionMoveInB::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(0,-s.height) ); + _inScene->setPosition( Vec2(0,-s.height) ); } @@ -523,13 +523,13 @@ void TransitionSlideInL::sceneOrder() void TransitionSlideInL:: initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(-(s.width-ADJUST_FACTOR),0) ); + _inScene->setPosition( Vec2(-(s.width-ADJUST_FACTOR),0) ); } ActionInterval* TransitionSlideInL::action() { Size s = Director::getInstance()->getWinSize(); - return MoveBy::create(_duration, Vector2(s.width-ADJUST_FACTOR,0)); + return MoveBy::create(_duration, Vec2(s.width-ADJUST_FACTOR,0)); } ActionInterval* TransitionSlideInL::easeActionWithAction(ActionInterval* action) @@ -579,14 +579,14 @@ void TransitionSlideInR::sceneOrder() void TransitionSlideInR::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(s.width-ADJUST_FACTOR,0) ); + _inScene->setPosition( Vec2(s.width-ADJUST_FACTOR,0) ); } ActionInterval* TransitionSlideInR:: action() { Size s = Director::getInstance()->getWinSize(); - return MoveBy::create(_duration, Vector2(-(s.width-ADJUST_FACTOR),0)); + return MoveBy::create(_duration, Vec2(-(s.width-ADJUST_FACTOR),0)); } @@ -620,14 +620,14 @@ void TransitionSlideInT::sceneOrder() void TransitionSlideInT::initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(0,s.height-ADJUST_FACTOR) ); + _inScene->setPosition( Vec2(0,s.height-ADJUST_FACTOR) ); } ActionInterval* TransitionSlideInT::action() { Size s = Director::getInstance()->getWinSize(); - return MoveBy::create(_duration, Vector2(0,-(s.height-ADJUST_FACTOR))); + return MoveBy::create(_duration, Vec2(0,-(s.height-ADJUST_FACTOR))); } // @@ -660,14 +660,14 @@ void TransitionSlideInB::sceneOrder() void TransitionSlideInB:: initScenes() { Size s = Director::getInstance()->getWinSize(); - _inScene->setPosition( Vector2(0,-(s.height-ADJUST_FACTOR)) ); + _inScene->setPosition( Vec2(0,-(s.height-ADJUST_FACTOR)) ); } ActionInterval* TransitionSlideInB:: action() { Size s = Director::getInstance()->getWinSize(); - return MoveBy::create(_duration, Vector2(0,s.height-ADJUST_FACTOR)); + return MoveBy::create(_duration, Vec2(0,s.height-ADJUST_FACTOR)); } // @@ -699,8 +699,8 @@ void TransitionShrinkGrow::onEnter() _inScene->setScale(0.001f); _outScene->setScale(1.0f); - _inScene->setAnchorPoint(Vector2(2/3.0f,0.5f)); - _outScene->setAnchorPoint(Vector2(1/3.0f,0.5f)); + _inScene->setAnchorPoint(Vec2(2/3.0f,0.5f)); + _outScene->setAnchorPoint(Vec2(1/3.0f,0.5f)); ActionInterval* scaleOut = ScaleTo::create(_duration, 0.01f); ActionInterval* scaleIn = ScaleTo::create(_duration, 1.0f); @@ -1261,7 +1261,7 @@ TransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene) return nullptr; } -void TransitionCrossFade::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionCrossFade::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { // override draw since both scenes (textures) are rendered in 1 scene } @@ -1284,9 +1284,9 @@ void TransitionCrossFade::onEnter() return; } - inTexture->getSprite()->setAnchorPoint( Vector2(0.5f,0.5f) ); - inTexture->setPosition( Vector2(size.width/2, size.height/2) ); - inTexture->setAnchorPoint( Vector2(0.5f,0.5f) ); + inTexture->getSprite()->setAnchorPoint( Vec2(0.5f,0.5f) ); + inTexture->setPosition( Vec2(size.width/2, size.height/2) ); + inTexture->setAnchorPoint( Vec2(0.5f,0.5f) ); // render inScene to its texturebuffer inTexture->begin(); @@ -1295,9 +1295,9 @@ void TransitionCrossFade::onEnter() // create the second render texture for outScene RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height); - outTexture->getSprite()->setAnchorPoint( Vector2(0.5f,0.5f) ); - outTexture->setPosition( Vector2(size.width/2, size.height/2) ); - outTexture->setAnchorPoint( Vector2(0.5f,0.5f) ); + outTexture->getSprite()->setAnchorPoint( Vec2(0.5f,0.5f) ); + outTexture->setPosition( Vec2(size.width/2, size.height/2) ); + outTexture->setAnchorPoint( Vec2(0.5f,0.5f) ); // render outScene to its texturebuffer outTexture->begin(); @@ -1410,7 +1410,7 @@ void TransitionTurnOffTiles::onExit() TransitionScene::onExit(); } -void TransitionTurnOffTiles::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionTurnOffTiles::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Scene::draw(renderer, transform, transformUpdated); @@ -1490,7 +1490,7 @@ void TransitionSplitCols::switchTargetToInscene() _gridProxy->setTarget(_inScene); } -void TransitionSplitCols::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionSplitCols::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Scene::draw(renderer, transform, transformUpdated); _gridProxy->visit(renderer, transform, transformUpdated); @@ -1606,7 +1606,7 @@ void TransitionFadeTR::onExit() TransitionScene::onExit(); } -void TransitionFadeTR::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionFadeTR::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Scene::draw(renderer, transform, transformUpdated); diff --git a/cocos/2d/CCTransition.h b/cocos/2d/CCTransition.h index 8a42ddc262..1d8cd84eb0 100644 --- a/cocos/2d/CCTransition.h +++ b/cocos/2d/CCTransition.h @@ -91,7 +91,7 @@ public: // // Overrides // - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void onEnter() override; virtual void onExit() override; virtual void cleanup() override; @@ -613,7 +613,7 @@ public : * @js NA * @lua NA */ - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; /** * @js NA * @lua NA @@ -651,7 +651,7 @@ public : virtual void onEnter() override; virtual void onExit() override; virtual ActionInterval * easeActionWithAction(ActionInterval * action) override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: TransitionTurnOffTiles(); @@ -684,7 +684,7 @@ public: virtual void onEnter() override; virtual ActionInterval * easeActionWithAction(ActionInterval * action) override; virtual void onExit() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: TransitionSplitCols(); virtual ~TransitionSplitCols(); @@ -735,7 +735,7 @@ public: virtual void onEnter() override; virtual ActionInterval* easeActionWithAction(ActionInterval * action) override; virtual void onExit() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: TransitionFadeTR(); virtual ~TransitionFadeTR(); diff --git a/cocos/2d/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp index fed9981646..5fc9f40311 100644 --- a/cocos/2d/CCTransitionPageTurn.cpp +++ b/cocos/2d/CCTransitionPageTurn.cpp @@ -92,7 +92,7 @@ void TransitionPageTurn::onDisablePolygonOffset() glPolygonOffset(0, 0); } -void TransitionPageTurn::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TransitionPageTurn::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Scene::draw(renderer, transform, transformUpdated); diff --git a/cocos/2d/CCTransitionPageTurn.h b/cocos/2d/CCTransitionPageTurn.h index 3fdb165a35..c12339418a 100644 --- a/cocos/2d/CCTransitionPageTurn.h +++ b/cocos/2d/CCTransitionPageTurn.h @@ -72,7 +72,7 @@ public: // // Overrides // - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; /** * Creates a base transition with duration and incoming scene. diff --git a/cocos/2d/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp index 1166f7f1f1..867661e247 100644 --- a/cocos/2d/CCTransitionProgress.cpp +++ b/cocos/2d/CCTransitionProgress.cpp @@ -73,9 +73,9 @@ void TransitionProgress::onEnter() // create the second render texture for outScene RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height); - texture->getSprite()->setAnchorPoint(Vector2(0.5f,0.5f)); - texture->setPosition(Vector2(size.width/2, size.height/2)); - texture->setAnchorPoint(Vector2(0.5f,0.5f)); + texture->getSprite()->setAnchorPoint(Vec2(0.5f,0.5f)); + texture->setPosition(Vec2(size.width/2, size.height/2)); + texture->setAnchorPoint(Vec2(0.5f,0.5f)); // render outScene to its texturebuffer texture->beginWithClear(0, 0, 0, 1); @@ -145,8 +145,8 @@ ProgressTimer* TransitionProgressRadialCCW::progressTimerNodeWithRenderTexture(R // Return the radial type that we want to use node->setReverseDirection(false); node->setPercentage(100); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } @@ -189,8 +189,8 @@ ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(Re // Return the radial type that we want to use node->setReverseDirection(true); node->setPercentage(100); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } @@ -218,12 +218,12 @@ ProgressTimer* TransitionProgressHorizontal::progressTimerNodeWithRenderTexture( node->getSprite()->setFlippedY(true); node->setType( ProgressTimer::Type::BAR); - node->setMidpoint(Vector2(1, 0)); - node->setBarChangeRate(Vector2(1,0)); + node->setMidpoint(Vec2(1, 0)); + node->setBarChangeRate(Vec2(1,0)); node->setPercentage(100); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } @@ -251,12 +251,12 @@ ProgressTimer* TransitionProgressVertical::progressTimerNodeWithRenderTexture(Re node->getSprite()->setFlippedY(true); node->setType(ProgressTimer::Type::BAR); - node->setMidpoint(Vector2(0, 0)); - node->setBarChangeRate(Vector2(0,1)); + node->setMidpoint(Vec2(0, 0)); + node->setBarChangeRate(Vec2(0,1)); node->setPercentage(100); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } @@ -297,12 +297,12 @@ ProgressTimer* TransitionProgressInOut::progressTimerNodeWithRenderTexture(Rende node->getSprite()->setFlippedY(true); node->setType( ProgressTimer::Type::BAR); - node->setMidpoint(Vector2(0.5f, 0.5f)); - node->setBarChangeRate(Vector2(1, 1)); + node->setMidpoint(Vec2(0.5f, 0.5f)); + node->setBarChangeRate(Vec2(1, 1)); node->setPercentage(0); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } @@ -331,12 +331,12 @@ ProgressTimer* TransitionProgressOutIn::progressTimerNodeWithRenderTexture(Rende node->getSprite()->setFlippedY(true); node->setType( ProgressTimer::Type::BAR ); - node->setMidpoint(Vector2(0.5f, 0.5f)); - node->setBarChangeRate(Vector2(1, 1)); + node->setMidpoint(Vec2(0.5f, 0.5f)); + node->setBarChangeRate(Vec2(1, 1)); node->setPercentage(100); - node->setPosition(Vector2(size.width/2, size.height/2)); - node->setAnchorPoint(Vector2(0.5f,0.5f)); + node->setPosition(Vec2(size.width/2, size.height/2)); + node->setAnchorPoint(Vec2(0.5f,0.5f)); return node; } diff --git a/cocos/2d/CCVertex.cpp b/cocos/2d/CCVertex.cpp index 3b08383f0e..8a96b2c2ee 100644 --- a/cocos/2d/CCVertex.cpp +++ b/cocos/2d/CCVertex.cpp @@ -29,7 +29,7 @@ NS_CC_BEGIN -void ccVertexLineToPolygon(Vector2 *points, float stroke, Vector2 *vertices, unsigned int offset, unsigned int nuPoints) +void ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints) { nuPoints += offset; if(nuPoints<=1) return; @@ -42,8 +42,8 @@ void ccVertexLineToPolygon(Vector2 *points, float stroke, Vector2 *vertices, uns for(unsigned int i = offset; i1.0f) diff --git a/cocos/2d/CCVertex.h b/cocos/2d/CCVertex.h index fca1ab3b44..a084a7168e 100644 --- a/cocos/2d/CCVertex.h +++ b/cocos/2d/CCVertex.h @@ -38,7 +38,7 @@ NS_CC_BEGIN /** @file CCVertex.h */ /** converts a line to a polygon */ -void CC_DLL ccVertexLineToPolygon(Vector2 *points, float stroke, Vector2 *vertices, unsigned int offset, unsigned int nuPoints); +void CC_DLL ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints); /** returns whether or not the line intersects */ bool CC_DLL ccVertexLineIntersect(float Ax, float Ay, diff --git a/cocos/2d/platform/CCGLViewProtocol.cpp b/cocos/2d/platform/CCGLViewProtocol.cpp index 6090772309..ffd2632bce 100644 --- a/cocos/2d/platform/CCGLViewProtocol.cpp +++ b/cocos/2d/platform/CCGLViewProtocol.cpp @@ -178,16 +178,16 @@ Size GLViewProtocol::getVisibleSize() const } } -Vector2 GLViewProtocol::getVisibleOrigin() const +Vec2 GLViewProtocol::getVisibleOrigin() const { if (_resolutionPolicy == ResolutionPolicy::NO_BORDER) { - return Vector2((_designResolutionSize.width - _screenSize.width/_scaleX)/2, + return Vec2((_designResolutionSize.width - _screenSize.width/_scaleX)/2, (_designResolutionSize.height - _screenSize.height/_scaleY)/2); } else { - return Vector2::ZERO; + return Vec2::ZERO; } } diff --git a/cocos/2d/platform/CCGLViewProtocol.h b/cocos/2d/platform/CCGLViewProtocol.h index aaa795a9e5..3b7404ecd0 100644 --- a/cocos/2d/platform/CCGLViewProtocol.h +++ b/cocos/2d/platform/CCGLViewProtocol.h @@ -113,7 +113,7 @@ public: /** * Get the visible origin point of opengl viewport. */ - virtual Vector2 getVisibleOrigin() const; + virtual Vec2 getVisibleOrigin() const; /** * Get the visible rectangle of opengl viewport. diff --git a/cocos/2d/platform/desktop/CCGLView.cpp b/cocos/2d/platform/desktop/CCGLView.cpp index 4a8783e7a6..30077f7130 100644 --- a/cocos/2d/platform/desktop/CCGLView.cpp +++ b/cocos/2d/platform/desktop/CCGLView.cpp @@ -548,7 +548,7 @@ void GLView::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int if(GLFW_PRESS == action) { _captured = true; - if (this->getViewPortRect().equals(Rect::ZERO) || this->getViewPortRect().containsPoint(Vector2(_mouseX,_mouseY))) + if (this->getViewPortRect().equals(Rect::ZERO) || this->getViewPortRect().containsPoint(Vec2(_mouseX,_mouseY))) { intptr_t id = 0; this->handleTouchesBegin(1, &id, &_mouseX, &_mouseY); diff --git a/cocos/2d/platform/winrt/CCGLView.cpp b/cocos/2d/platform/winrt/CCGLView.cpp index 90a5568562..f78be18d6c 100644 --- a/cocos/2d/platform/winrt/CCGLView.cpp +++ b/cocos/2d/platform/winrt/CCGLView.cpp @@ -165,11 +165,11 @@ void WinRTWindow::ResizeWindow() GLView::sharedOpenGLView()->UpdateForWindowSizeChange(); } -cocos2d::Vector2 WinRTWindow::GetCCPoint(PointerEventArgs^ args) { +cocos2d::Vec2 WinRTWindow::GetCCPoint(PointerEventArgs^ args) { auto p = args->CurrentPoint; float x = getScaledDPIValue(p->Position.X); float y = getScaledDPIValue(p->Position.Y); - Vector2 pt(x, y); + Vec2 pt(x, y); float zoomFactor = GLView::sharedOpenGLView()->getFrameZoomFactor(); @@ -264,7 +264,7 @@ void WinRTWindow::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ ar { float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta; int id = 0; - Vector2 p(0.0f,0.0f); + Vec2 p(0.0f,0.0f); GLView::sharedOpenGLView()->handleTouchesBegin(1, &id, &p.x, &p.y); p.y += direction; GLView::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y); @@ -288,7 +288,7 @@ void GLView::OnPointerPressed(PointerEventArgs^ args) { #if 0 int id = args->CurrentPoint->PointerId; - Vector2 pt = GetPoint(args); + Vec2 pt = GetPoint(args); handleTouchesBegin(1, &id, &pt.x, &pt.y); #endif } @@ -302,7 +302,7 @@ void GLView::OnPointerMoved(PointerEventArgs^ args) if (m_lastPointValid) { int id = args->CurrentPoint->PointerId; - Vector2 p = GetPoint(args); + Vec2 p = GetPoint(args); handleTouchesMove(1, &id, &p.x, &p.y); } m_lastPoint = currentPoint->Position; @@ -319,7 +319,7 @@ void GLView::OnPointerReleased(PointerEventArgs^ args) { #if 0 int id = args->CurrentPoint->PointerId; - Vector2 pt = GetPoint(args); + Vec2 pt = GetPoint(args); handleTouchesEnd(1, &id, &pt.x, &pt.y); #endif // 0 @@ -330,7 +330,7 @@ void GLView::OnPointerReleased(PointerEventArgs^ args) void WinRTWindow::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) { int id = args->CurrentPoint->PointerId; - Vector2 pt = GetCCPoint(args); + Vec2 pt = GetCCPoint(args); GLView::sharedOpenGLView()->handleTouchesBegin(1, &id, &pt.x, &pt.y); } @@ -342,7 +342,7 @@ void WinRTWindow::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) if (m_lastPointValid) { int id = args->CurrentPoint->PointerId; - Vector2 p = GetCCPoint(args); + Vec2 p = GetCCPoint(args); GLView::sharedOpenGLView()->handleTouchesMove(1, &id, &p.x, &p.y); } m_lastPoint = currentPoint->Position; @@ -357,7 +357,7 @@ void WinRTWindow::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) void WinRTWindow::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) { int id = args->CurrentPoint->PointerId; - Vector2 pt = GetCCPoint(args); + Vec2 pt = GetCCPoint(args); GLView::sharedOpenGLView()->handleTouchesEnd(1, &id, &pt.x, &pt.y); } diff --git a/cocos/2d/platform/winrt/CCGLView.h b/cocos/2d/platform/winrt/CCGLView.h index b51e9adf7f..6864805e59 100644 --- a/cocos/2d/platform/winrt/CCGLView.h +++ b/cocos/2d/platform/winrt/CCGLView.h @@ -56,7 +56,7 @@ public: private: - cocos2d::Vector2 GetCCPoint(Windows::UI::Core::PointerEventArgs^ args); + cocos2d::Vec2 GetCCPoint(Windows::UI::Core::PointerEventArgs^ args); void OnTextKeyDown(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); void OnTextKeyUp(Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); diff --git a/cocos/2d/platform/wp8/CCGLView.cpp b/cocos/2d/platform/wp8/CCGLView.cpp index 5716466c59..d89fab28f5 100644 --- a/cocos/2d/platform/wp8/CCGLView.cpp +++ b/cocos/2d/platform/wp8/CCGLView.cpp @@ -190,7 +190,7 @@ void GLView::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) void GLView::OnPointerPressed(PointerEventArgs^ args) { int id = args->CurrentPoint->PointerId; - Vector2 pt = GetPoint(args); + Vec2 pt = GetPoint(args); handleTouchesBegin(1, &id, &pt.x, &pt.y); } @@ -199,7 +199,7 @@ void GLView::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) { float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta; int id = 0; - Vector2 p(0.0f,0.0f); + Vec2 p(0.0f,0.0f); handleTouchesBegin(1, &id, &p.x, &p.y); p.y += direction; handleTouchesMove(1, &id, &p.x, &p.y); @@ -229,7 +229,7 @@ void GLView::OnPointerMoved( PointerEventArgs^ args) if (m_lastPointValid) { int id = args->CurrentPoint->PointerId; - Vector2 p = GetPoint(args); + Vec2 p = GetPoint(args); handleTouchesMove(1, &id, &p.x, &p.y); } m_lastPoint = currentPoint->Position; @@ -249,7 +249,7 @@ void GLView::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) void GLView::OnPointerReleased(PointerEventArgs^ args) { int id = args->CurrentPoint->PointerId; - Vector2 pt = GetPoint(args); + Vec2 pt = GetPoint(args); handleTouchesEnd(1, &id, &pt.x, &pt.y); } @@ -429,9 +429,9 @@ void GLView::UpdateOrientationMatrix() } } -cocos2d::Vector2 GLView::TransformToOrientation(Windows::Foundation::Point p) +cocos2d::Vec2 GLView::TransformToOrientation(Windows::Foundation::Point p) { - cocos2d::Vector2 returnValue; + cocos2d::Vec2 returnValue; float x = p.X; float y = p.Y; @@ -440,16 +440,16 @@ cocos2d::Vector2 GLView::TransformToOrientation(Windows::Foundation::Point p) { case DisplayOrientations::Portrait: default: - returnValue = Vector2(x, y); + returnValue = Vec2(x, y); break; case DisplayOrientations::Landscape: - returnValue = Vector2(y, m_width - x); + returnValue = Vec2(y, m_width - x); break; case DisplayOrientations::PortraitFlipped: - returnValue = Vector2(m_width - x, m_height - y); + returnValue = Vec2(m_width - x, m_height - y); break; case DisplayOrientations::LandscapeFlipped: - returnValue = Vector2(m_height - y, x); + returnValue = Vec2(m_height - y, x); break; } @@ -464,7 +464,7 @@ cocos2d::Vector2 GLView::TransformToOrientation(Windows::Foundation::Point p) return returnValue; } -Vector2 GLView::GetPoint(PointerEventArgs^ args) { +Vec2 GLView::GetPoint(PointerEventArgs^ args) { return TransformToOrientation(args->CurrentPoint->Position); diff --git a/cocos/2d/platform/wp8/CCGLView.h b/cocos/2d/platform/wp8/CCGLView.h index 187c796ad9..9ffa1f9d29 100644 --- a/cocos/2d/platform/wp8/CCGLView.h +++ b/cocos/2d/platform/wp8/CCGLView.h @@ -146,8 +146,8 @@ private: void UpdateWindowSize(); void UpdateOrientationMatrix(); - cocos2d::Vector2 TransformToOrientation(Windows::Foundation::Point point); - cocos2d::Vector2 GetPoint(Windows::UI::Core::PointerEventArgs^ args); + cocos2d::Vec2 TransformToOrientation(Windows::Foundation::Point point); + cocos2d::Vec2 GetPoint(Windows::UI::Core::PointerEventArgs^ args); Windows::Foundation::Rect m_windowBounds; Windows::Foundation::EventRegistrationToken m_eventToken; diff --git a/cocos/2d/platform/wp8/Direct3DBase.cpp b/cocos/2d/platform/wp8/Direct3DBase.cpp index d6e0132f13..f909b07507 100644 --- a/cocos/2d/platform/wp8/Direct3DBase.cpp +++ b/cocos/2d/platform/wp8/Direct3DBase.cpp @@ -330,9 +330,9 @@ void Direct3DBase::ComputeOrientationMatrices() } } -Vector2 Direct3DBase::TransformToOrientation(Vector2 point, bool dipsToPixels) +Vec2 Direct3DBase::TransformToOrientation(Vec2 point, bool dipsToPixels) { - Vector2 returnValue; + Vec2 returnValue; switch (m_orientation) { @@ -340,20 +340,20 @@ Vector2 Direct3DBase::TransformToOrientation(Vector2 point, bool dipsToPixels) returnValue = point; break; case DisplayOrientations::Landscape: - returnValue = Vector2(point.Y, m_windowBounds.Width - point.X); + returnValue = Vec2(point.Y, m_windowBounds.Width - point.X); break; case DisplayOrientations::PortraitFlipped: - returnValue = Vector2(m_windowBounds.Width - point.X, m_windowBounds.Height - point.Y); + returnValue = Vec2(m_windowBounds.Width - point.X, m_windowBounds.Height - point.Y); break; case DisplayOrientations::LandscapeFlipped: - returnValue = Vector2(m_windowBounds.Height -point.Y, point.X); + returnValue = Vec2(m_windowBounds.Height -point.Y, point.X); break; default: throw ref new Platform::FailureException(); break; } - return dipsToPixels ? Vector2(ConvertDipsToPixels(returnValue.X), + return dipsToPixels ? Vec2(ConvertDipsToPixels(returnValue.X), ConvertDipsToPixels(returnValue.Y)) : returnValue; } diff --git a/cocos/2d/platform/wp8/Direct3DBase.h b/cocos/2d/platform/wp8/Direct3DBase.h index a4a61c82e1..dfc4bfd3af 100644 --- a/cocos/2d/platform/wp8/Direct3DBase.h +++ b/cocos/2d/platform/wp8/Direct3DBase.h @@ -24,7 +24,7 @@ public: virtual void Present(); virtual float ConvertDipsToPixels(float dips); virtual void ComputeOrientationMatrices(); - virtual Windows::Foundation::Vector2 TransformToOrientation(Windows::Foundation::Vector2 point, bool dipsToPixels=true); + virtual Windows::Foundation::Vec2 TransformToOrientation(Windows::Foundation::Vec2 point, bool dipsToPixels=true); float getOrientedWindowWidth() {return m_orientedScreenSize.Width;}; float getOrientedWindowHeight() {return m_orientedScreenSize.Height;}; diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 6ef63e5eb5..a70ccabbc7 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -288,14 +288,14 @@ void Director::drawScene() // draw the scene if (_runningScene) { - _runningScene->visit(_renderer, Matrix::IDENTITY, false); + _runningScene->visit(_renderer, Mat4::IDENTITY, false); _eventDispatcher->dispatchEvent(_eventAfterVisit); } // draw the notifications node if (_notificationNode) { - _notificationNode->visit(_renderer, Matrix::IDENTITY, false); + _notificationNode->visit(_renderer, Mat4::IDENTITY, false); } if (_displayStats) @@ -449,9 +449,9 @@ void Director::initMatrixStack() _textureMatrixStack.pop(); } - _modelViewMatrixStack.push(Matrix::IDENTITY); - _projectionMatrixStack.push(Matrix::IDENTITY); - _textureMatrixStack.push(Matrix::IDENTITY); + _modelViewMatrixStack.push(Mat4::IDENTITY); + _projectionMatrixStack.push(Mat4::IDENTITY); + _textureMatrixStack.push(Mat4::IDENTITY); } void Director::resetMatrixStack() @@ -483,15 +483,15 @@ void Director::loadIdentityMatrix(MATRIX_STACK_TYPE type) { if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type) { - _modelViewMatrixStack.top() = Matrix::IDENTITY; + _modelViewMatrixStack.top() = Mat4::IDENTITY; } else if(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION == type) { - _projectionMatrixStack.top() = Matrix::IDENTITY; + _projectionMatrixStack.top() = Mat4::IDENTITY; } else if(MATRIX_STACK_TYPE::MATRIX_STACK_TEXTURE == type) { - _textureMatrixStack.top() = Matrix::IDENTITY; + _textureMatrixStack.top() = Mat4::IDENTITY; } else { @@ -499,7 +499,7 @@ void Director::loadIdentityMatrix(MATRIX_STACK_TYPE type) } } -void Director::loadMatrix(MATRIX_STACK_TYPE type, const Matrix& mat) +void Director::loadMatrix(MATRIX_STACK_TYPE type, const Mat4& mat) { if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type) { @@ -519,7 +519,7 @@ void Director::loadMatrix(MATRIX_STACK_TYPE type, const Matrix& mat) } } -void Director::multiplyMatrix(MATRIX_STACK_TYPE type, const Matrix& mat) +void Director::multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat) { if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type) { @@ -559,9 +559,9 @@ void Director::pushMatrix(MATRIX_STACK_TYPE type) } } -Matrix Director::getMatrix(MATRIX_STACK_TYPE type) +Mat4 Director::getMatrix(MATRIX_STACK_TYPE type) { - Matrix result; + Mat4 result; if(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW == type) { result = _modelViewMatrixStack.top(); @@ -608,8 +608,8 @@ void Director::setProjection(Projection projection) multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, getOpenGLView()->getOrientationMatrix()); } #endif - Matrix orthoMatrix; - Matrix::createOrthographicOffCenter(0, size.width, 0, size.height, -1024, 1024, &orthoMatrix); + Mat4 orthoMatrix; + Mat4::createOrthographicOffCenter(0, size.width, 0, size.height, -1024, 1024, &orthoMatrix); multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); break; @@ -619,7 +619,7 @@ void Director::setProjection(Projection projection) { float zeye = this->getZEye(); - Matrix matrixPerspective, matrixLookup; + Mat4 matrixPerspective, matrixLookup; loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); @@ -632,12 +632,12 @@ void Director::setProjection(Projection projection) } #endif // issue #1334 - Matrix::createPerspective(60, (GLfloat)size.width/size.height, 10, zeye+size.height/2, &matrixPerspective); + Mat4::createPerspective(60, (GLfloat)size.width/size.height, 10, zeye+size.height/2, &matrixPerspective); multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, matrixPerspective); - Vector3 eye(size.width/2, size.height/2, zeye), center(size.width/2, size.height/2, 0.0f), up(0.0f, 1.0f, 0.0f); - Matrix::createLookAt(eye, center, up, &matrixLookup); + Vec3 eye(size.width/2, size.height/2, zeye), center(size.width/2, size.height/2, 0.0f), up(0.0f, 1.0f, 0.0f); + Mat4::createLookAt(eye, center, up, &matrixLookup); multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, matrixLookup); loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -712,14 +712,14 @@ void Director::setDepthTest(bool on) CHECK_GL_ERROR_DEBUG(); } -static void GLToClipTransform(Matrix *transformOut) +static void GLToClipTransform(Mat4 *transformOut) { if(nullptr == transformOut) return; Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix projection; + Mat4 projection; projection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); #if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 @@ -727,44 +727,44 @@ static void GLToClipTransform(Matrix *transformOut) projection = Director::getInstance()->getOpenGLView()->getReverseOrientationMatrix() * projection; #endif - Matrix modelview; + Mat4 modelview; modelview = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); *transformOut = projection * modelview; } -Vector2 Director::convertToGL(const Vector2& uiPoint) +Vec2 Director::convertToGL(const Vec2& uiPoint) { - Matrix transform; + Mat4 transform; GLToClipTransform(&transform); - Matrix transformInv = transform.getInversed(); + Mat4 transformInv = transform.getInversed(); // Calculate z=0 using -> transform*[0, 0, 0, 1]/w float zClip = transform.m[14]/transform.m[15]; Size glSize = _openGLView->getDesignResolutionSize(); - Vector4 clipCoord(2.0f*uiPoint.x/glSize.width - 1.0f, 1.0f - 2.0f*uiPoint.y/glSize.height, zClip, 1); + Vec4 clipCoord(2.0f*uiPoint.x/glSize.width - 1.0f, 1.0f - 2.0f*uiPoint.y/glSize.height, zClip, 1); - Vector4 glCoord; + Vec4 glCoord; //transformInv.transformPoint(clipCoord, &glCoord); transformInv.transformVector(clipCoord, &glCoord); float factor = 1.0/glCoord.w; - return Vector2(glCoord.x * factor, glCoord.y * factor); + return Vec2(glCoord.x * factor, glCoord.y * factor); } -Vector2 Director::convertToUI(const Vector2& glPoint) +Vec2 Director::convertToUI(const Vec2& glPoint) { - Matrix transform; + Mat4 transform; GLToClipTransform(&transform); - Vector4 clipCoord; + Vec4 clipCoord; // Need to calculate the zero depth from the transform. - Vector4 glCoord(glPoint.x, glPoint.y, 0.0, 1); + Vec4 glCoord(glPoint.x, glPoint.y, 0.0, 1); transform.transformVector(glCoord, &clipCoord); Size glSize = _openGLView->getDesignResolutionSize(); float factor = 1.0/glCoord.w; - return Vector2(glSize.width*(clipCoord.x*0.5 + 0.5) * factor, glSize.height*(-clipCoord.y*0.5 + 0.5) * factor); + return Vec2(glSize.width*(clipCoord.x*0.5 + 0.5) * factor, glSize.height*(-clipCoord.y*0.5 + 0.5) * factor); } const Size& Director::getWinSize(void) const @@ -789,7 +789,7 @@ Size Director::getVisibleSize() const } } -Vector2 Director::getVisibleOrigin() const +Vec2 Director::getVisibleOrigin() const { if (_openGLView) { @@ -797,7 +797,7 @@ Vector2 Director::getVisibleOrigin() const } else { - return Vector2::ZERO; + return Vec2::ZERO; } } @@ -1080,7 +1080,7 @@ void Director::showStats() prevVerts = currentVerts; } - Matrix identity = Matrix::IDENTITY; + Mat4 identity = Mat4::IDENTITY; _drawnVerticesLabel->visit(_renderer, identity, false); _drawnBatchesLabel->visit(_renderer, identity, false); @@ -1165,9 +1165,9 @@ void Director::createStatsLabel() Texture2D::setDefaultAlphaPixelFormat(currentFormat); const int height_spacing = 22 / CC_CONTENT_SCALE_FACTOR(); - _drawnVerticesLabel->setPosition(Vector2(0, height_spacing*2) + CC_DIRECTOR_STATS_POSITION); - _drawnBatchesLabel->setPosition(Vector2(0, height_spacing*1) + CC_DIRECTOR_STATS_POSITION); - _FPSLabel->setPosition(Vector2(0, height_spacing*0)+CC_DIRECTOR_STATS_POSITION); + _drawnVerticesLabel->setPosition(Vec2(0, height_spacing*2) + CC_DIRECTOR_STATS_POSITION); + _drawnBatchesLabel->setPosition(Vec2(0, height_spacing*1) + CC_DIRECTOR_STATS_POSITION); + _FPSLabel->setPosition(Vec2(0, height_spacing*0)+CC_DIRECTOR_STATS_POSITION); } void Director::setContentScaleFactor(float scaleFactor) diff --git a/cocos/base/CCDirector.h b/cocos/base/CCDirector.h index 6a69f8c2c1..5505787cb0 100644 --- a/cocos/base/CCDirector.h +++ b/cocos/base/CCDirector.h @@ -94,18 +94,18 @@ enum class MATRIX_STACK_TYPE class CC_DLL Director : public Ref { private: - std::stack _modelViewMatrixStack; - std::stack _projectionMatrixStack; - std::stack _textureMatrixStack; + std::stack _modelViewMatrixStack; + std::stack _projectionMatrixStack; + std::stack _textureMatrixStack; protected: void initMatrixStack(); public: void pushMatrix(MATRIX_STACK_TYPE type); void popMatrix(MATRIX_STACK_TYPE type); void loadIdentityMatrix(MATRIX_STACK_TYPE type); - void loadMatrix(MATRIX_STACK_TYPE type, const Matrix& mat); - void multiplyMatrix(MATRIX_STACK_TYPE type, const Matrix& mat); - Matrix getMatrix(MATRIX_STACK_TYPE type); + void loadMatrix(MATRIX_STACK_TYPE type, const Mat4& mat); + void multiplyMatrix(MATRIX_STACK_TYPE type, const Mat4& mat); + Mat4 getMatrix(MATRIX_STACK_TYPE type); void resetMatrixStack(); public: static const char *EVENT_PROJECTION_CHANGED; @@ -231,17 +231,17 @@ public: /** returns visible origin of the OpenGL view in points. */ - Vector2 getVisibleOrigin() const; + Vec2 getVisibleOrigin() const; /** converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) */ - Vector2 convertToGL(const Vector2& point); + Vec2 convertToGL(const Vec2& point); /** converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor */ - Vector2 convertToUI(const Vector2& point); + Vec2 convertToUI(const Vec2& point); /// XXX: missing description float getZEye() const; @@ -527,6 +527,7 @@ public: DisplayLinkDirector() : _invalid(false) {} + virtual ~DisplayLinkDirector(){} // // Overrides diff --git a/cocos/base/CCNS.cpp b/cocos/base/CCNS.cpp index 112dcdaa4b..452e3a7458 100644 --- a/cocos/base/CCNS.cpp +++ b/cocos/base/CCNS.cpp @@ -144,9 +144,9 @@ Rect RectFromString(const std::string& str) return result; } -Vector2 PointFromString(const std::string& str) +Vec2 PointFromString(const std::string& str) { - Vector2 ret = Vector2::ZERO; + Vec2 ret = Vec2::ZERO; do { @@ -156,7 +156,7 @@ Vector2 PointFromString(const std::string& str) float x = (float) atof(strs[0].c_str()); float y = (float) atof(strs[1].c_str()); - ret = Vector2(x, y); + ret = Vec2(x, y); } while (0); return ret; diff --git a/cocos/base/CCNS.h b/cocos/base/CCNS.h index 7fff7245db..4ee039150a 100644 --- a/cocos/base/CCNS.h +++ b/cocos/base/CCNS.h @@ -55,9 +55,9 @@ Rect CC_DLL RectFromString(const std::string& str); An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma. @return A Core Graphics structure that represents a point. - If the string is not well-formed, the function returns Vector2::ZERO. + If the string is not well-formed, the function returns Vec2::ZERO. */ -Vector2 CC_DLL PointFromString(const std::string& str); +Vec2 CC_DLL PointFromString(const std::string& str); /** @brief Returns a Core Graphics size structure corresponding to the data in a given string. diff --git a/cocos/base/CCTouch.cpp b/cocos/base/CCTouch.cpp index 62798e46d1..1209e222a7 100644 --- a/cocos/base/CCTouch.cpp +++ b/cocos/base/CCTouch.cpp @@ -29,43 +29,43 @@ NS_CC_BEGIN // returns the current touch location in screen coordinates -Vector2 Touch::getLocationInView() const +Vec2 Touch::getLocationInView() const { return _point; } // returns the previous touch location in screen coordinates -Vector2 Touch::getPreviousLocationInView() const +Vec2 Touch::getPreviousLocationInView() const { return _prevPoint; } // returns the start touch location in screen coordinates -Vector2 Touch::getStartLocationInView() const +Vec2 Touch::getStartLocationInView() const { return _startPoint; } // returns the current touch location in OpenGL coordinates -Vector2 Touch::getLocation() const +Vec2 Touch::getLocation() const { return Director::getInstance()->convertToGL(_point); } // returns the previous touch location in OpenGL coordinates -Vector2 Touch::getPreviousLocation() const +Vec2 Touch::getPreviousLocation() const { return Director::getInstance()->convertToGL(_prevPoint); } // returns the start touch location in OpenGL coordinates -Vector2 Touch::getStartLocation() const +Vec2 Touch::getStartLocation() const { return Director::getInstance()->convertToGL(_startPoint); } // returns the delta position between the current location and the previous location in OpenGL coordinates -Vector2 Touch::getDelta() const +Vec2 Touch::getDelta() const { return getLocation() - getPreviousLocation(); } diff --git a/cocos/base/CCTouch.h b/cocos/base/CCTouch.h index 98d37816a8..624016aafd 100644 --- a/cocos/base/CCTouch.h +++ b/cocos/base/CCTouch.h @@ -53,19 +53,19 @@ public: {} /** returns the current touch location in OpenGL coordinates */ - Vector2 getLocation() const; + Vec2 getLocation() const; /** returns the previous touch location in OpenGL coordinates */ - Vector2 getPreviousLocation() const; + Vec2 getPreviousLocation() const; /** returns the start touch location in OpenGL coordinates */ - Vector2 getStartLocation() const; + Vec2 getStartLocation() const; /** returns the delta of 2 current touches locations in screen coordinates */ - Vector2 getDelta() const; + Vec2 getDelta() const; /** returns the current touch location in screen coordinates */ - Vector2 getLocationInView() const; + Vec2 getLocationInView() const; /** returns the previous touch location in screen coordinates */ - Vector2 getPreviousLocationInView() const; + Vec2 getPreviousLocationInView() const; /** returns the start touch location in screen coordinates */ - Vector2 getStartLocationInView() const; + Vec2 getStartLocationInView() const; void setTouchInfo(int id, float x, float y) { @@ -91,9 +91,9 @@ public: private: int _id; bool _startPointCaptured; - Vector2 _startPoint; - Vector2 _point; - Vector2 _prevPoint; + Vec2 _startPoint; + Vec2 _point; + Vec2 _prevPoint; }; // end of input group diff --git a/cocos/base/ccConfig.h b/cocos/base/ccConfig.h index 5727a8944a..5fb3474a7f 100644 --- a/cocos/base/ccConfig.h +++ b/cocos/base/ccConfig.h @@ -109,7 +109,7 @@ To enabled set it to 1. Disabled by default. Default: 0,0 (bottom-left corner) */ #ifndef CC_DIRECTOR_FPS_POSITION -#define CC_DIRECTOR_FPS_POSITION Vector2(0,0) +#define CC_DIRECTOR_FPS_POSITION Vec2(0,0) #endif /** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 917f7329da..476a1e0de7 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -153,13 +153,13 @@ On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1 Converts a rect in pixels to points */ #define CC_POINT_PIXELS_TO_POINTS(__pixels__) \ -Vector2( (__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) +Vec2( (__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) /** @def CC_POINT_POINTS_TO_PIXELS Converts a rect in points to pixels */ #define CC_POINT_POINTS_TO_PIXELS(__points__) \ -Vector2( (__points__).x * CC_CONTENT_SCALE_FACTOR(), (__points__).y * CC_CONTENT_SCALE_FACTOR()) +Vec2( (__points__).x * CC_CONTENT_SCALE_FACTOR(), (__points__).y * CC_CONTENT_SCALE_FACTOR()) /** @def CC_POINT_PIXELS_TO_POINTS Converts a rect in pixels to points diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 2806a74aac..3b884d55a8 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -192,10 +192,10 @@ struct Tex2F { }; -//! Vector2 Sprite component +//! Vec2 Sprite component struct PointSprite { - Vector2 pos; // 8 bytes + Vec2 pos; // 8 bytes Color4B color; // 4 bytes GLfloat size; // 4 bytes }; @@ -203,48 +203,48 @@ struct PointSprite //! A 2D Quad. 4 * 2 floats struct Quad2 { - Vector2 tl; - Vector2 tr; - Vector2 bl; - Vector2 br; + Vec2 tl; + Vec2 tr; + Vec2 bl; + Vec2 br; }; //! A 3D Quad. 4 * 3 floats struct Quad3 { - Vector3 bl; - Vector3 br; - Vector3 tl; - Vector3 tr; + Vec3 bl; + Vec3 br; + Vec3 tl; + Vec3 tr; }; -//! a Vector2 with a vertex point, a tex coord point and a color 4B +//! a Vec2 with a vertex point, a tex coord point and a color 4B struct V2F_C4B_T2F { //! vertices (2F) - Vector2 vertices; + Vec2 vertices; //! colors (4B) Color4B colors; //! tex coords (2F) Tex2F texCoords; }; -//! a Vector2 with a vertex point, a tex coord point and a color 4F +//! a Vec2 with a vertex point, a tex coord point and a color 4F struct V2F_C4F_T2F { //! vertices (2F) - Vector2 vertices; + Vec2 vertices; //! colors (4F) Color4F colors; //! tex coords (2F) Tex2F texCoords; }; -//! a Vector2 with a vertex point, a tex coord point and a color 4B +//! a Vec2 with a vertex point, a tex coord point and a color 4B struct V3F_C4B_T2F { //! vertices (3F) - Vector3 vertices; // 12 bytes + Vec3 vertices; // 12 bytes //! colors (4B) Color4B colors; // 4 bytes @@ -256,11 +256,11 @@ struct V3F_C4B_T2F //! A Triangle of V2F_C4B_T2F struct V2F_C4B_T2F_Triangle { - //! Vector2 A + //! Vec2 A V2F_C4B_T2F a; - //! Vector2 B + //! Vec2 B V2F_C4B_T2F b; - //! Vector2 B + //! Vec2 B V2F_C4B_T2F c; }; diff --git a/cocos/deprecated/CCDeprecated.cpp b/cocos/deprecated/CCDeprecated.cpp index 4c77adebbe..c4bd24010d 100644 --- a/cocos/deprecated/CCDeprecated.cpp +++ b/cocos/deprecated/CCDeprecated.cpp @@ -34,7 +34,7 @@ NS_CC_BEGIN -const Vector2 CCPointZero = Vector2::ZERO; +const Vec2 CCPointZero = Vec2::ZERO; /* The "zero" size -- equivalent to Size(0, 0). */ const Size CCSizeZero = Size::ZERO; @@ -90,67 +90,67 @@ void ccDrawFree() DrawPrimitives::free(); } -void ccDrawPoint( const Vector2& point ) +void ccDrawPoint( const Vec2& point ) { DrawPrimitives::drawPoint(point); } -void ccDrawPoints( const Vector2 *points, unsigned int numberOfPoints ) +void ccDrawPoints( const Vec2 *points, unsigned int numberOfPoints ) { DrawPrimitives::drawPoints(points, numberOfPoints); } -void ccDrawLine( const Vector2& origin, const Vector2& destination ) +void ccDrawLine( const Vec2& origin, const Vec2& destination ) { DrawPrimitives::drawLine(origin, destination); } -void ccDrawRect( Vector2 origin, Vector2 destination ) +void ccDrawRect( Vec2 origin, Vec2 destination ) { DrawPrimitives::drawRect(origin, destination); } -void ccDrawSolidRect( Vector2 origin, Vector2 destination, Color4F color ) +void ccDrawSolidRect( Vec2 origin, Vec2 destination, Color4F color ) { DrawPrimitives::drawSolidRect(origin, destination, color); } -void ccDrawPoly( const Vector2 *vertices, unsigned int numOfVertices, bool closePolygon ) +void ccDrawPoly( const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon ) { DrawPrimitives::drawPoly(vertices, numOfVertices, closePolygon); } -void ccDrawSolidPoly( const Vector2 *poli, unsigned int numberOfPoints, Color4F color ) +void ccDrawSolidPoly( const Vec2 *poli, unsigned int numberOfPoints, Color4F color ) { DrawPrimitives::drawSolidPoly(poli, numberOfPoints, color); } -void ccDrawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY) +void ccDrawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY) { DrawPrimitives::drawCircle(center, radius, angle, segments, drawLineToCenter, scaleX, scaleY); } -void ccDrawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter) +void ccDrawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter) { DrawPrimitives::drawCircle(center, radius, angle, segments, drawLineToCenter); } -void ccDrawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY) +void ccDrawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY) { DrawPrimitives::drawSolidCircle(center, radius, angle, segments, scaleX, scaleY); } -void ccDrawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments) +void ccDrawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments) { DrawPrimitives::drawSolidCircle(center, radius, angle, segments); } -void ccDrawQuadBezier(const Vector2& origin, const Vector2& control, const Vector2& destination, unsigned int segments) +void ccDrawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments) { DrawPrimitives::drawQuadBezier(origin, control, destination, segments); } -void ccDrawCubicBezier(const Vector2& origin, const Vector2& control1, const Vector2& control2, const Vector2& destination, unsigned int segments) +void ccDrawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments) { DrawPrimitives::drawCubicBezier(origin, control1, control2, destination, segments); } @@ -216,38 +216,38 @@ void CC_DLL kmGLLoadIdentity(void) Director::getInstance()->loadIdentityMatrix(currentActiveStackType); } -void CC_DLL kmGLLoadMatrix(const Matrix* pIn) +void CC_DLL kmGLLoadMatrix(const Mat4* pIn) { Director::getInstance()->loadMatrix(currentActiveStackType, *pIn); } -void CC_DLL kmGLMultMatrix(const Matrix* pIn) +void CC_DLL kmGLMultMatrix(const Mat4* pIn) { Director::getInstance()->multiplyMatrix(currentActiveStackType, *pIn); } void CC_DLL kmGLTranslatef(float x, float y, float z) { - Matrix mat; - Matrix::createTranslation(Vector3(x, y, z), &mat); + Mat4 mat; + Mat4::createTranslation(Vec3(x, y, z), &mat); Director::getInstance()->multiplyMatrix(currentActiveStackType, mat); } void CC_DLL kmGLRotatef(float angle, float x, float y, float z) { - Matrix mat; - Matrix::createRotation(Vector3(x, y, z), angle, &mat); + Mat4 mat; + Mat4::createRotation(Vec3(x, y, z), angle, &mat); Director::getInstance()->multiplyMatrix(currentActiveStackType, mat); } void CC_DLL kmGLScalef(float x, float y, float z) { - Matrix mat; - Matrix::createScale(x, y, z, &mat); + Mat4 mat; + Mat4::createScale(x, y, z, &mat); Director::getInstance()->multiplyMatrix(currentActiveStackType, mat); } -void CC_DLL kmGLGetMatrix(unsigned int mode, Matrix* pOut) +void CC_DLL kmGLGetMatrix(unsigned int mode, Mat4* pOut) { if(KM_GL_MODELVIEW == mode) *pOut = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -261,97 +261,97 @@ void CC_DLL kmGLGetMatrix(unsigned int mode, Matrix* pOut) } } -Matrix* kmMat4Fill(Matrix* pOut, const float* pMat) +Mat4* kmMat4Fill(Mat4* pOut, const float* pMat) { pOut->set(pMat); return pOut; } -Matrix* kmMat4Assign(Matrix* pOut, const Matrix* pIn) +Mat4* kmMat4Assign(Mat4* pOut, const Mat4* pIn) { pOut->set(pIn->m); return pOut; } -Matrix* kmMat4Identity(Matrix* pOut) +Mat4* kmMat4Identity(Mat4* pOut) { - *pOut = Matrix::IDENTITY; + *pOut = Mat4::IDENTITY; return pOut; } -Matrix* kmMat4Inverse(Matrix* pOut, const Matrix* pM) +Mat4* kmMat4Inverse(Mat4* pOut, const Mat4* pM) { *pOut = pM->getInversed(); return pOut; } -Matrix* kmMat4Transpose(Matrix* pOut, const Matrix* pIn) +Mat4* kmMat4Transpose(Mat4* pOut, const Mat4* pIn) { *pOut = pIn->getTransposed(); return pOut; } -Matrix* kmMat4Multiply(Matrix* pOut, const Matrix* pM1, const Matrix* pM2) +Mat4* kmMat4Multiply(Mat4* pOut, const Mat4* pM1, const Mat4* pM2) { *pOut = (*pM1) * (*pM2); return pOut; } -Matrix* kmMat4Translation(Matrix* pOut, const float x, const float y, const float z) +Mat4* kmMat4Translation(Mat4* pOut, const float x, const float y, const float z) { - Matrix::createTranslation(x, y, z, pOut); + Mat4::createTranslation(x, y, z, pOut); return pOut; } -Matrix* kmMat4RotationX(Matrix* pOut, const float radians) +Mat4* kmMat4RotationX(Mat4* pOut, const float radians) { - Matrix::createRotationX(radians, pOut); + Mat4::createRotationX(radians, pOut); return pOut; } -Matrix* kmMat4RotationY(Matrix* pOut, const float radians) +Mat4* kmMat4RotationY(Mat4* pOut, const float radians) { - Matrix::createRotationY(radians, pOut); + Mat4::createRotationY(radians, pOut); return pOut; } -Matrix* kmMat4RotationZ(Matrix* pOut, const float radians) +Mat4* kmMat4RotationZ(Mat4* pOut, const float radians) { - Matrix::createRotationZ(radians, pOut); + Mat4::createRotationZ(radians, pOut); return pOut; } -Matrix* kmMat4RotationAxisAngle(Matrix* pOut, const Vector3* axis, float radians) +Mat4* kmMat4RotationAxisAngle(Mat4* pOut, const Vec3* axis, float radians) { - Matrix::createRotation(*axis, radians, pOut); + Mat4::createRotation(*axis, radians, pOut); return pOut; } -Matrix* kmMat4Scaling(Matrix* pOut, const float x, const float y, const float z) +Mat4* kmMat4Scaling(Mat4* pOut, const float x, const float y, const float z) { - Matrix::createScale(x, y, z, pOut); + Mat4::createScale(x, y, z, pOut); return pOut; } -Matrix* kmMat4PerspectiveProjection(Matrix* pOut, float fovY, float aspect, float zNear, float zFar) +Mat4* kmMat4PerspectiveProjection(Mat4* pOut, float fovY, float aspect, float zNear, float zFar) { - Matrix::createPerspective(fovY, aspect, zNear, zFar, pOut); + Mat4::createPerspective(fovY, aspect, zNear, zFar, pOut); return pOut; } -Matrix* kmMat4OrthographicProjection(Matrix* pOut, float left, float right, float bottom, float top, float nearVal, float farVal) +Mat4* kmMat4OrthographicProjection(Mat4* pOut, float left, float right, float bottom, float top, float nearVal, float farVal) { - Matrix::createOrthographicOffCenter(left, right, bottom, top, nearVal, farVal, pOut); + Mat4::createOrthographicOffCenter(left, right, bottom, top, nearVal, farVal, pOut); return pOut; } -Matrix* kmMat4LookAt(Matrix* pOut, const Vector3* pEye, const Vector3* pCenter, const Vector3* pUp) +Mat4* kmMat4LookAt(Mat4* pOut, const Vec3* pEye, const Vec3* pCenter, const Vec3* pUp) { - Matrix::createLookAt(*pEye, *pCenter, *pUp, pOut); + Mat4::createLookAt(*pEye, *pCenter, *pUp, pOut); return pOut; } -Vector3* kmVec3Fill(Vector3* pOut, float x, float y, float z) +Vec3* kmVec3Fill(Vec3* pOut, float x, float y, float z) { pOut->x = x; pOut->y = y; @@ -359,17 +359,17 @@ Vector3* kmVec3Fill(Vector3* pOut, float x, float y, float z) return pOut; } -float kmVec3Length(const Vector3* pIn) +float kmVec3Length(const Vec3* pIn) { return pIn->length(); } -float kmVec3LengthSq(const Vector3* pIn) +float kmVec3LengthSq(const Vec3* pIn) { return pIn->lengthSquared(); } -CC_DLL Vector3* kmVec3Lerp(Vector3* pOut, const Vector3* pV1, const Vector3* pV2, float t) +CC_DLL Vec3* kmVec3Lerp(Vec3* pOut, const Vec3* pV1, const Vec3* pV2, float t) { pOut->x = pV1->x + t * ( pV2->x - pV1->x ); pOut->y = pV1->y + t * ( pV2->y - pV1->y ); @@ -377,160 +377,160 @@ CC_DLL Vector3* kmVec3Lerp(Vector3* pOut, const Vector3* pV1, const Vector3* pV2 return pOut; } -Vector3* kmVec3Normalize(Vector3* pOut, const Vector3* pIn) +Vec3* kmVec3Normalize(Vec3* pOut, const Vec3* pIn) { *pOut = pIn->getNormalized(); return pOut; } -Vector3* kmVec3Cross(Vector3* pOut, const Vector3* pV1, const Vector3* pV2) +Vec3* kmVec3Cross(Vec3* pOut, const Vec3* pV1, const Vec3* pV2) { - Vector3::cross(*pV1, *pV2, pOut); + Vec3::cross(*pV1, *pV2, pOut); return pOut; } -float kmVec3Dot(const Vector3* pV1, const Vector3* pV2) +float kmVec3Dot(const Vec3* pV1, const Vec3* pV2) { - return Vector3::dot(*pV1, *pV2); + return Vec3::dot(*pV1, *pV2); } -Vector3* kmVec3Add(Vector3* pOut, const Vector3* pV1, const Vector3* pV2) +Vec3* kmVec3Add(Vec3* pOut, const Vec3* pV1, const Vec3* pV2) { - Vector3::add(*pV1, *pV2, pOut); + Vec3::add(*pV1, *pV2, pOut); return pOut; } -Vector3* kmVec3Subtract(Vector3* pOut, const Vector3* pV1, const Vector3* pV2) +Vec3* kmVec3Subtract(Vec3* pOut, const Vec3* pV1, const Vec3* pV2) { - Vector3::subtract(*pV1, *pV2, pOut); + Vec3::subtract(*pV1, *pV2, pOut); return pOut; } -Vector3* kmVec3Transform(Vector3* pOut, const Vector3* pV1, const Matrix* pM) +Vec3* kmVec3Transform(Vec3* pOut, const Vec3* pV1, const Mat4* pM) { pM->transformPoint(*pV1, pOut); return pOut; } -Vector3* kmVec3TransformNormal(Vector3* pOut, const Vector3* pV, const Matrix* pM) +Vec3* kmVec3TransformNormal(Vec3* pOut, const Vec3* pV, const Mat4* pM) { pM->transformVector(*pV, pOut); return pOut; } -Vector3* kmVec3TransformCoord(Vector3* pOut, const Vector3* pV, const Matrix* pM) +Vec3* kmVec3TransformCoord(Vec3* pOut, const Vec3* pV, const Mat4* pM) { - Vector4 v(pV->x, pV->y, pV->z, 1); + Vec4 v(pV->x, pV->y, pV->z, 1); pM->transformVector(&v); v = v * (1/v.w); pOut->set(v.x, v.y, v.z); return pOut; } -Vector3* kmVec3Scale(Vector3* pOut, const Vector3* pIn, const float s) +Vec3* kmVec3Scale(Vec3* pOut, const Vec3* pIn, const float s) { *pOut = *pIn * s; return pOut; } -Vector3* kmVec3Assign(Vector3* pOut, const Vector3* pIn) +Vec3* kmVec3Assign(Vec3* pOut, const Vec3* pIn) { *pOut = *pIn; return pOut; } -Vector3* kmVec3Zero(Vector3* pOut) +Vec3* kmVec3Zero(Vec3* pOut) { pOut->set(0, 0, 0); return pOut; } -Vector2* kmVec2Fill(Vector2* pOut, float x, float y) +Vec2* kmVec2Fill(Vec2* pOut, float x, float y) { pOut->set(x, y); return pOut; } -float kmVec2Length(const Vector2* pIn) +float kmVec2Length(const Vec2* pIn) { return pIn->length(); } -float kmVec2LengthSq(const Vector2* pIn) +float kmVec2LengthSq(const Vec2* pIn) { return pIn->lengthSquared(); } -Vector2* kmVec2Normalize(Vector2* pOut, const Vector2* pIn) +Vec2* kmVec2Normalize(Vec2* pOut, const Vec2* pIn) { *pOut = pIn->getNormalized(); return pOut; } -Vector2* kmVec2Lerp(Vector2* pOut, const Vector2* pV1, const Vector2* pV2, float t) +Vec2* kmVec2Lerp(Vec2* pOut, const Vec2* pV1, const Vec2* pV2, float t) { pOut->x = pV1->x + t * ( pV2->x - pV1->x ); pOut->y = pV1->y + t * ( pV2->y - pV1->y ); return pOut; } -Vector2* kmVec2Add(Vector2* pOut, const Vector2* pV1, const Vector2* pV2) +Vec2* kmVec2Add(Vec2* pOut, const Vec2* pV1, const Vec2* pV2) { - Vector2::add(*pV1, *pV2, pOut); + Vec2::add(*pV1, *pV2, pOut); return pOut; } -float kmVec2Dot(const Vector2* pV1, const Vector2* pV2) +float kmVec2Dot(const Vec2* pV1, const Vec2* pV2) { - return Vector2::dot(*pV1, *pV2); + return Vec2::dot(*pV1, *pV2); } -Vector2* kmVec2Subtract(Vector2* pOut, const Vector2* pV1, const Vector2* pV2) +Vec2* kmVec2Subtract(Vec2* pOut, const Vec2* pV1, const Vec2* pV2) { - Vector2::subtract(*pV1, *pV2, pOut); + Vec2::subtract(*pV1, *pV2, pOut); return pOut; } -Vector2* kmVec2Scale(Vector2* pOut, const Vector2* pIn, const float s) +Vec2* kmVec2Scale(Vec2* pOut, const Vec2* pIn, const float s) { *pOut = *pIn * s; return pOut; } -Vector2* kmVec2Assign(Vector2* pOut, const Vector2* pIn) +Vec2* kmVec2Assign(Vec2* pOut, const Vec2* pIn) { *pOut = *pIn; return pOut; } -Vector4* kmVec4Fill(Vector4* pOut, float x, float y, float z, float w) +Vec4* kmVec4Fill(Vec4* pOut, float x, float y, float z, float w) { pOut->set(x, y, z, w); return pOut; } -Vector4* kmVec4Add(Vector4* pOut, const Vector4* pV1, const Vector4* pV2) +Vec4* kmVec4Add(Vec4* pOut, const Vec4* pV1, const Vec4* pV2) { - Vector4::add(*pV1, *pV2, pOut); + Vec4::add(*pV1, *pV2, pOut); return pOut; } -float kmVec4Dot(const Vector4* pV1, const Vector4* pV2) +float kmVec4Dot(const Vec4* pV1, const Vec4* pV2) { - return Vector4::dot(*pV1, *pV2); + return Vec4::dot(*pV1, *pV2); } -float kmVec4Length(const Vector4* pIn) +float kmVec4Length(const Vec4* pIn) { return pIn->length(); } -float kmVec4LengthSq(const Vector4* pIn) +float kmVec4LengthSq(const Vec4* pIn) { return pIn->lengthSquared(); } -Vector4* kmVec4Lerp(Vector4* pOut, const Vector4* pV1, const Vector4* pV2, float t) +Vec4* kmVec4Lerp(Vec4* pOut, const Vec4* pV1, const Vec4* pV2, float t) { pOut->x = pV1->x + t * ( pV2->x - pV1->x ); pOut->y = pV1->y + t * ( pV2->y - pV1->y ); @@ -539,55 +539,55 @@ Vector4* kmVec4Lerp(Vector4* pOut, const Vector4* pV1, const Vector4* pV2, float return pOut; } -Vector4* kmVec4Normalize(Vector4* pOut, const Vector4* pIn) +Vec4* kmVec4Normalize(Vec4* pOut, const Vec4* pIn) { *pOut = pIn->getNormalized(); return pOut; } -Vector4* kmVec4Scale(Vector4* pOut, const Vector4* pIn, const float s) +Vec4* kmVec4Scale(Vec4* pOut, const Vec4* pIn, const float s) { *pOut = *pIn * s; return pOut; } -Vector4* kmVec4Subtract(Vector4* pOut, const Vector4* pV1, const Vector4* pV2) +Vec4* kmVec4Subtract(Vec4* pOut, const Vec4* pV1, const Vec4* pV2) { - Vector4::subtract(*pV1, *pV2, pOut); + Vec4::subtract(*pV1, *pV2, pOut); return pOut; } -Vector4* kmVec4Assign(Vector4* pOut, const Vector4* pIn) +Vec4* kmVec4Assign(Vec4* pOut, const Vec4* pIn) { *pOut = *pIn; return pOut; } -Vector4* kmVec4MultiplyMat4(Vector4* pOut, const Vector4* pV, const Matrix* pM) +Vec4* kmVec4MultiplyMat4(Vec4* pOut, const Vec4* pV, const Mat4* pM) { pM->transformVector(*pV, pOut); return pOut; } -Vector4* kmVec4Transform(Vector4* pOut, const Vector4* pV, const Matrix* pM) +Vec4* kmVec4Transform(Vec4* pOut, const Vec4* pV, const Mat4* pM) { pM->transformVector(*pV, pOut); return pOut; } -const Vector3 KM_VEC3_NEG_Z = Vector3(0, 0, -1); -const Vector3 KM_VEC3_POS_Z = Vector3(0, 0, 1); -const Vector3 KM_VEC3_POS_Y = Vector3(0, 1, 0); -const Vector3 KM_VEC3_NEG_Y = Vector3(0, -1, 0); -const Vector3 KM_VEC3_NEG_X = Vector3(-1, 0, 0); -const Vector3 KM_VEC3_POS_X = Vector3(1, 0, 0); -const Vector3 KM_VEC3_ZERO = Vector3(0, 0, 0); +const Vec3 KM_VEC3_NEG_Z = Vec3(0, 0, -1); +const Vec3 KM_VEC3_POS_Z = Vec3(0, 0, 1); +const Vec3 KM_VEC3_POS_Y = Vec3(0, 1, 0); +const Vec3 KM_VEC3_NEG_Y = Vec3(0, -1, 0); +const Vec3 KM_VEC3_NEG_X = Vec3(-1, 0, 0); +const Vec3 KM_VEC3_POS_X = Vec3(1, 0, 0); +const Vec3 KM_VEC3_ZERO = Vec3(0, 0, 0); -const Vector2 KM_VEC2_POS_Y = Vector2(0, 1); -const Vector2 KM_VEC2_NEG_Y = Vector2(0, -1); -const Vector2 KM_VEC2_NEG_X = Vector2(-1, 0); -const Vector2 KM_VEC2_POS_X = Vector2(1, 0); -const Vector2 KM_VEC2_ZERO = Vector2(0, 0); +const Vec2 KM_VEC2_POS_Y = Vec2(0, 1); +const Vec2 KM_VEC2_NEG_Y = Vec2(0, -1); +const Vec2 KM_VEC2_NEG_X = Vec2(-1, 0); +const Vec2 KM_VEC2_POS_X = Vec2(1, 0); +const Vec2 KM_VEC2_ZERO = Vec2(0, 0); NS_CC_END diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index 7f89021b8c..e8b154e6b5 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -40,66 +40,66 @@ NS_CC_BEGIN * @{ */ -/** Helper macro that creates a Vector2 - @return Vector2 +/** Helper macro that creates a Vec2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE inline Vector2 ccp(float x, float y) +CC_DEPRECATED_ATTRIBUTE inline Vec2 ccp(float x, float y) { - return Vector2(x, y); + return Vec2(x, y); } /** Returns opposite of point. - @return Vector2 + @return Vec2 @since v0.7.2 - @deprecated please use Vector2::-, for example: -v1 + @deprecated please use Vec2::-, for example: -v1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpNeg(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpNeg(const Vec2& v) { return -v; } /** Calculates sum of two points. - @return Vector2 + @return Vec2 @since v0.7.2 - @deprecated please use Vector2::+, for example: v1 + v2 + @deprecated please use Vec2::+, for example: v1 + v2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpAdd(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpAdd(const Vec2& v1, const Vec2& v2) { return v1 + v2; } /** Calculates difference of two points. - @return Vector2 + @return Vec2 @since v0.7.2 - @deprecated please use Vector2::-, for example: v1 - v2 + @deprecated please use Vec2::-, for example: v1 - v2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpSub(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpSub(const Vec2& v1, const Vec2& v2) { return v1 - v2; } /** Returns point multiplied by given factor. - @return Vector2 + @return Vec2 @since v0.7.2 - @deprecated please use Vector2::*, for example: v1 * v2 + @deprecated please use Vec2::*, for example: v1 * v2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpMult(const Vector2& v, const float s) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpMult(const Vec2& v, const float s) { return v * s; } /** Calculates midpoint between two points. - @return Vector2 + @return Vec2 @since v0.7.2 @deprecated please use it like (v1 + v2) / 2.0f */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpMidpoint(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpMidpoint(const Vec2& v1, const Vec2& v2) { return v1.getMidpoint(v2); } @@ -109,7 +109,7 @@ ccpMidpoint(const Vector2& v1, const Vector2& v2) @since v0.7.2 */ CC_DEPRECATED_ATTRIBUTE static inline float -ccpDot(const Vector2& v1, const Vector2& v2) +ccpDot(const Vec2& v1, const Vec2& v2) { return v1.dot(v2); } @@ -119,67 +119,67 @@ ccpDot(const Vector2& v1, const Vector2& v2) @since v0.7.2 */ CC_DEPRECATED_ATTRIBUTE static inline float -ccpCross(const Vector2& v1, const Vector2& v2) +ccpCross(const Vec2& v1, const Vec2& v2) { return v1.cross(v2); } /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpPerp(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpPerp(const Vec2& v) { return v.getPerp(); } /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpRPerp(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpRPerp(const Vec2& v) { return v.getRPerp(); } /** Calculates the projection of v1 over v2. - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpProject(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpProject(const Vec2& v1, const Vec2& v2) { return v1.project(v2); } /** Rotates two points. - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpRotate(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpRotate(const Vec2& v1, const Vec2& v2) { return v1.rotate(v2); } /** Unrotates two points. - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 -ccpUnrotate(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 +ccpUnrotate(const Vec2& v1, const Vec2& v2) { return v1.unrotate(v2); } -/** Calculates the square length of a Vector2 (not calling sqrt() ) +/** Calculates the square length of a Vec2 (not calling sqrt() ) @return float @since v0.7.2 */ CC_DEPRECATED_ATTRIBUTE static inline float -ccpLengthSQ(const Vector2& v) +ccpLengthSQ(const Vec2& v) { return v.getLengthSq(); } @@ -190,7 +190,7 @@ ccpLengthSQ(const Vector2& v) @since v1.1 */ CC_DEPRECATED_ATTRIBUTE static inline float -ccpDistanceSQ(const Vector2 p1, const Vector2 p2) +ccpDistanceSQ(const Vec2 p1, const Vec2 p2) { return (p1 - p2).getLengthSq(); } @@ -200,7 +200,7 @@ ccpDistanceSQ(const Vector2 p1, const Vector2 p2) @return float @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline float ccpLength(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline float ccpLength(const Vec2& v) { return v.getLength(); } @@ -209,34 +209,34 @@ CC_DEPRECATED_ATTRIBUTE static inline float ccpLength(const Vector2& v) @return float @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline float ccpDistance(const Vector2& v1, const Vector2& v2) +CC_DEPRECATED_ATTRIBUTE static inline float ccpDistance(const Vec2& v1, const Vec2& v2) { return v1.getDistance(v2); } /** Returns point multiplied to a length of 1. - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpNormalize(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpNormalize(const Vec2& v) { return v.getNormalized(); } /** Converts radians to a normalized vector. - @return Vector2 + @return Vec2 @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpForAngle(const float a) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpForAngle(const float a) { - return Vector2::forAngle(a); + return Vec2::forAngle(a); } /** Converts a vector to radians. @return float @since v0.7.2 */ -CC_DEPRECATED_ATTRIBUTE static inline float ccpToAngle(const Vector2& v) +CC_DEPRECATED_ATTRIBUTE static inline float ccpToAngle(const Vec2& v) { return v.getAngle(); } @@ -245,17 +245,17 @@ CC_DEPRECATED_ATTRIBUTE static inline float ccpToAngle(const Vector2& v) /** Clamp a point between from and to. @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpClamp(const Vector2& p, const Vector2& from, const Vector2& to) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpClamp(const Vec2& p, const Vec2& from, const Vec2& to) { return p.getClampPoint(from, to); } -/** Quickly convert Size to a Vector2 +/** Quickly convert Size to a Vec2 @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpFromSize(const Size& s) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpFromSize(const Size& s) { - return Vector2(s); + return Vec2(s); } /** Run a math operation function on each point component @@ -265,7 +265,7 @@ CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpFromSize(const Size& s) * ccpCompOp(p,floorf); @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpCompOp(const Vector2& p, float (*opFunc)(float)) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpCompOp(const Vec2& p, float (*opFunc)(float)) { return p.compOp(opFunc); } @@ -277,7 +277,7 @@ CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpCompOp(const Vector2& p, float otherwise a value between a..b @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpLerp(const Vector2& a, const Vector2& b, float alpha) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpLerp(const Vec2& a, const Vec2& b, float alpha) { return a.lerp(b, alpha); } @@ -286,7 +286,7 @@ CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpLerp(const Vector2& a, const Ve /** @returns if points have fuzzy equality which means equal with some degree of variance. @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline bool ccpFuzzyEqual(const Vector2& a, const Vector2& b, float variance) +CC_DEPRECATED_ATTRIBUTE static inline bool ccpFuzzyEqual(const Vec2& a, const Vec2& b, float variance) { return a.fuzzyEquals(b, variance); } @@ -296,15 +296,15 @@ CC_DEPRECATED_ATTRIBUTE static inline bool ccpFuzzyEqual(const Vector2& a, const @returns a component-wise multiplication @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpCompMult(const Vector2& a, const Vector2& b) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpCompMult(const Vec2& a, const Vec2& b) { - return Vector2(a.x * b.x, a.y * b.y); + return Vec2(a.x * b.x, a.y * b.y); } /** @returns the signed angle in radians between two vector directions @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline float ccpAngleSigned(const Vector2& a, const Vector2& b) +CC_DEPRECATED_ATTRIBUTE static inline float ccpAngleSigned(const Vec2& a, const Vec2& b) { return a.getAngle(b); } @@ -312,7 +312,7 @@ CC_DEPRECATED_ATTRIBUTE static inline float ccpAngleSigned(const Vector2& a, con /** @returns the angle in radians between two vector directions @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline float ccpAngle(const Vector2& a, const Vector2& b) +CC_DEPRECATED_ATTRIBUTE static inline float ccpAngle(const Vec2& a, const Vec2& b) { return a.getAngle(b); } @@ -324,7 +324,7 @@ CC_DEPRECATED_ATTRIBUTE static inline float ccpAngle(const Vector2& a, const Vec @returns the rotated point @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpRotateByAngle(const Vector2& v, const Vector2& pivot, float angle) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpRotateByAngle(const Vec2& v, const Vec2& pivot, float angle) { return v.rotateByAngle(pivot, angle); } @@ -350,34 +350,34 @@ CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpRotateByAngle(const Vector2& v, the hit point also is p1 + s * (p2 - p1); @since v0.99.1 */ -CC_DEPRECATED_ATTRIBUTE static inline bool ccpLineIntersect(const Vector2& p1, const Vector2& p2, - const Vector2& p3, const Vector2& p4, +CC_DEPRECATED_ATTRIBUTE static inline bool ccpLineIntersect(const Vec2& p1, const Vec2& p2, + const Vec2& p3, const Vec2& p4, float *s, float *t) { - return Vector2::isLineIntersect(p1, p2, p3, p4, s, t); + return Vec2::isLineIntersect(p1, p2, p3, p4, s, t); } /* ccpSegmentIntersect returns true if Segment A-B intersects with segment C-D @since v1.0.0 */ -CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D) +CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D) { - return Vector2::isSegmentIntersect(A, B, C, D); + return Vec2::isSegmentIntersect(A, B, C, D); } /* ccpIntersectPoint returns the intersection point of line A-B, C-D @since v1.0.0 */ -CC_DEPRECATED_ATTRIBUTE static inline Vector2 ccpIntersectPoint(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 ccpIntersectPoint(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D) { - return Vector2::getIntersectPoint(A, B, C, D); + return Vec2::getIntersectPoint(A, B, C, D); } -CC_DEPRECATED_ATTRIBUTE inline Vector2 CCPointMake(float x, float y) +CC_DEPRECATED_ATTRIBUTE inline Vec2 CCPointMake(float x, float y) { - return Vector2(x, y); + return Vec2(x, y); } CC_DEPRECATED_ATTRIBUTE inline Size CCSizeMake(float width, float height) @@ -391,7 +391,7 @@ CC_DEPRECATED_ATTRIBUTE inline Rect CCRectMake(float x, float y, float width, fl } -CC_DEPRECATED_ATTRIBUTE extern const Vector2 CCPointZero; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 CCPointZero; /* The "zero" size -- equivalent to Size(0, 0). */ CC_DEPRECATED_ATTRIBUTE extern const Size CCSizeZero; @@ -454,15 +454,15 @@ CC_DEPRECATED_ATTRIBUTE static inline bool ccc4FEqual(Color4F a, Color4F b) return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; } -CC_DEPRECATED_ATTRIBUTE static inline Vector2 vertex2(const float x, const float y) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 vertex2(const float x, const float y) { - Vector2 c(x, y); + Vec2 c(x, y); return c; } -CC_DEPRECATED_ATTRIBUTE static inline Vector3 vertex3(const float x, const float y, const float z) +CC_DEPRECATED_ATTRIBUTE static inline Vec3 vertex3(const float x, const float y, const float z) { - Vector3 c(x, y, z); + Vec3 c(x, y, z); return c; } @@ -477,7 +477,7 @@ CC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformMake(floa return AffineTransformMake(a, b, c, d, tx, ty); } -CC_DEPRECATED_ATTRIBUTE static inline Vector2 CCPointApplyAffineTransform(const Vector2& point, const AffineTransform& t) +CC_DEPRECATED_ATTRIBUTE static inline Vec2 CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t) { return PointApplyAffineTransform(point, t); } @@ -770,17 +770,17 @@ CC_DEPRECATED_ATTRIBUTE typedef GLView CCEGLView; CC_DEPRECATED_ATTRIBUTE typedef Component CCComponent; CC_DEPRECATED_ATTRIBUTE typedef AffineTransform CCAffineTransform; -CC_DEPRECATED_ATTRIBUTE typedef Vector2 CCPoint; -CC_DEPRECATED_ATTRIBUTE typedef Vector2 Point; +CC_DEPRECATED_ATTRIBUTE typedef Vec2 CCPoint; +CC_DEPRECATED_ATTRIBUTE typedef Vec2 Point; CC_DEPRECATED_ATTRIBUTE typedef Size CCSize; CC_DEPRECATED_ATTRIBUTE typedef Rect CCRect; CC_DEPRECATED_ATTRIBUTE typedef Color3B ccColor3B; CC_DEPRECATED_ATTRIBUTE typedef Color4F ccColor4F; CC_DEPRECATED_ATTRIBUTE typedef Color4B ccColor4B; -CC_DEPRECATED_ATTRIBUTE typedef Vector2 ccVertex2F; -CC_DEPRECATED_ATTRIBUTE typedef Vector2 Vertex2F; -CC_DEPRECATED_ATTRIBUTE typedef Vector3 ccVertex3F; -CC_DEPRECATED_ATTRIBUTE typedef Vector3 Vertex3F; +CC_DEPRECATED_ATTRIBUTE typedef Vec2 ccVertex2F; +CC_DEPRECATED_ATTRIBUTE typedef Vec2 Vertex2F; +CC_DEPRECATED_ATTRIBUTE typedef Vec3 ccVertex3F; +CC_DEPRECATED_ATTRIBUTE typedef Vec3 Vertex3F; CC_DEPRECATED_ATTRIBUTE typedef Tex2F ccTex2F; CC_DEPRECATED_ATTRIBUTE typedef PointSprite ccPointSprite; CC_DEPRECATED_ATTRIBUTE typedef Quad2 ccQuad2; @@ -991,19 +991,19 @@ CC_DEPRECATED_ATTRIBUTE void CC_DLL CCLog(const char * pszFormat, ...) CC_FORMAT CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawInit(); CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawFree(); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoint( const Vector2& point ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoints( const Vector2 *points, unsigned int numberOfPoints ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawLine( const Vector2& origin, const Vector2& destination ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawRect( Vector2 origin, Vector2 destination ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidRect( Vector2 origin, Vector2 destination, Color4F color ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoly( const Vector2 *vertices, unsigned int numOfVertices, bool closePolygon ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidPoly( const Vector2 *poli, unsigned int numberOfPoints, Color4F color ); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Vector2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Vector2& center, float radius, float angle, unsigned int segments); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawQuadBezier(const Vector2& origin, const Vector2& control, const Vector2& destination, unsigned int segments); -CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCubicBezier(const Vector2& origin, const Vector2& control1, const Vector2& control2, const Vector2& destination, unsigned int segments); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoint( const Vec2& point ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoints( const Vec2 *points, unsigned int numberOfPoints ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawLine( const Vec2& origin, const Vec2& destination ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawRect( Vec2 origin, Vec2 destination ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidRect( Vec2 origin, Vec2 destination, Color4F color ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoly( const Vec2 *vertices, unsigned int numOfVertices, bool closePolygon ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidPoly( const Vec2 *poli, unsigned int numberOfPoints, Color4F color ); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Vec2& center, float radius, float angle, unsigned int segments, bool drawLineToCenter); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Vec2& center, float radius, float angle, unsigned int segments); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawQuadBezier(const Vec2& origin, const Vec2& control, const Vec2& destination, unsigned int segments); +CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCubicBezier(const Vec2& origin, const Vec2& control1, const Vec2& control2, const Vec2& destination, unsigned int segments); CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCatmullRom( PointArray *arrayOfControlPoints, unsigned int segments ); CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCardinalSpline( PointArray *config, float tension, unsigned int segments ); CC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a ); @@ -1057,7 +1057,7 @@ CC_DEPRECATED_ATTRIBUTE typedef __LayerRGBA LayerRGBA; CC_DEPRECATED_ATTRIBUTE typedef float kmScalar; //kmMat4 and kmMat4 stack -CC_DEPRECATED_ATTRIBUTE typedef Matrix kmMat4; +CC_DEPRECATED_ATTRIBUTE typedef Mat4 kmMat4; CC_DEPRECATED_ATTRIBUTE const unsigned int KM_GL_MODELVIEW = 0x1700; CC_DEPRECATED_ATTRIBUTE const unsigned int KM_GL_PROJECTION = 0x1701; CC_DEPRECATED_ATTRIBUTE const unsigned int KM_GL_TEXTURE = 0x1702; @@ -1067,90 +1067,90 @@ CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLPushMatrix(void); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLPopMatrix(void); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLMatrixMode(unsigned int mode); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLLoadIdentity(void); -CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLLoadMatrix(const Matrix* pIn); -CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLMultMatrix(const Matrix* pIn); +CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLLoadMatrix(const Mat4* pIn); +CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLMultMatrix(const Mat4* pIn); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLTranslatef(float x, float y, float z); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLRotatef(float angle, float x, float y, float z); CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLScalef(float x, float y, float z); -CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLGetMatrix(unsigned int mode, Matrix* pOut); +CC_DEPRECATED_ATTRIBUTE void CC_DLL kmGLGetMatrix(unsigned int mode, Mat4* pOut); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Fill(Matrix* pOut, const float* pMat); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Assign(Matrix* pOut, const Matrix* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Identity(Matrix* pOut); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Inverse(Matrix* pOut, const Matrix* pM); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Transpose(Matrix* pOut, const Matrix* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Multiply(Matrix* pOut, const Matrix* pM1, const Matrix* pM2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Translation(Matrix* pOut, const float x, const float y, const float z); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4RotationX(Matrix* pOut, const float radians); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4RotationY(Matrix* pOut, const float radians); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4RotationZ(Matrix* pOut, const float radians); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4RotationAxisAngle(Matrix* pOut, const Vector3* axis, float radians); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4Scaling(Matrix* pOut, const float x, const float y, const float z); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Fill(Mat4* pOut, const float* pMat); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Assign(Mat4* pOut, const Mat4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Identity(Mat4* pOut); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Inverse(Mat4* pOut, const Mat4* pM); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Transpose(Mat4* pOut, const Mat4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Multiply(Mat4* pOut, const Mat4* pM1, const Mat4* pM2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Translation(Mat4* pOut, const float x, const float y, const float z); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4RotationX(Mat4* pOut, const float radians); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4RotationY(Mat4* pOut, const float radians); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4RotationZ(Mat4* pOut, const float radians); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4RotationAxisAngle(Mat4* pOut, const Vec3* axis, float radians); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4Scaling(Mat4* pOut, const float x, const float y, const float z); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4PerspectiveProjection(Matrix* pOut, float fovY, float aspect, float zNear, float zFar); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4OrthographicProjection(Matrix* pOut, float left, float right, float bottom, float top, float nearVal, float farVal); -CC_DEPRECATED_ATTRIBUTE CC_DLL Matrix* kmMat4LookAt(Matrix* pOut, const Vector3* pEye, const Vector3* pCenter, const Vector3* pUp); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4PerspectiveProjection(Mat4* pOut, float fovY, float aspect, float zNear, float zFar); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4OrthographicProjection(Mat4* pOut, float left, float right, float bottom, float top, float nearVal, float farVal); +CC_DEPRECATED_ATTRIBUTE CC_DLL Mat4* kmMat4LookAt(Mat4* pOut, const Vec3* pEye, const Vec3* pCenter, const Vec3* pUp); //kmVec3 -CC_DEPRECATED_ATTRIBUTE typedef Vector3 kmVec3; -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Fill(Vector3* pOut, float x, float y, float z); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3Length(const Vector3* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3LengthSq(const Vector3* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Lerp(Vector3* pOut, const Vector3* pV1, const Vector3* pV2, float t); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Normalize(Vector3* pOut, const Vector3* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Cross(Vector3* pOut, const Vector3* pV1, const Vector3* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3Dot(const Vector3* pV1, const Vector3* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Add(Vector3* pOut, const Vector3* pV1, const Vector3* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Subtract(Vector3* pOut, const Vector3* pV1, const Vector3* pV2); +CC_DEPRECATED_ATTRIBUTE typedef Vec3 kmVec3; +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Fill(Vec3* pOut, float x, float y, float z); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3Length(const Vec3* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3LengthSq(const Vec3* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Lerp(Vec3* pOut, const Vec3* pV1, const Vec3* pV2, float t); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Normalize(Vec3* pOut, const Vec3* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Cross(Vec3* pOut, const Vec3* pV1, const Vec3* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec3Dot(const Vec3* pV1, const Vec3* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Add(Vec3* pOut, const Vec3* pV1, const Vec3* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Subtract(Vec3* pOut, const Vec3* pV1, const Vec3* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Transform(Vector3* pOut, const Vector3* pV1, const Matrix* pM); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3TransformNormal(Vector3* pOut, const Vector3* pV, const Matrix* pM); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3TransformCoord(Vector3* pOut, const Vector3* pV, const Matrix* pM); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Scale(Vector3* pOut, const Vector3* pIn, const float s); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Assign(Vector3* pOut, const Vector3* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector3* kmVec3Zero(Vector3* pOut); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Transform(Vec3* pOut, const Vec3* pV1, const Mat4* pM); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3TransformNormal(Vec3* pOut, const Vec3* pV, const Mat4* pM); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3TransformCoord(Vec3* pOut, const Vec3* pV, const Mat4* pM); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Scale(Vec3* pOut, const Vec3* pIn, const float s); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Assign(Vec3* pOut, const Vec3* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec3* kmVec3Zero(Vec3* pOut); -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_NEG_Z; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_POS_Z; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_POS_Y; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_NEG_Y; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_NEG_X; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_POS_X; -CC_DEPRECATED_ATTRIBUTE extern const Vector3 KM_VEC3_ZERO; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_NEG_Z; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_POS_Z; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_POS_Y; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_NEG_Y; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_NEG_X; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_POS_X; +CC_DEPRECATED_ATTRIBUTE extern const Vec3 KM_VEC3_ZERO; //kmVec2 -CC_DEPRECATED_ATTRIBUTE typedef Vector2 kmVec2; -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Fill(Vector2* pOut, float x, float y); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2Length(const Vector2* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2LengthSq(const Vector2* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Normalize(Vector2* pOut, const Vector2* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Lerp(Vector2* pOut, const Vector2* pV1, const Vector2* pV2, float t); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Add(Vector2* pOut, const Vector2* pV1, const Vector2* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2Dot(const Vector2* pV1, const Vector2* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Subtract(Vector2* pOut, const Vector2* pV1, const Vector2* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Scale(Vector2* pOut, const Vector2* pIn, const float s); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector2* kmVec2Assign(Vector2* pOut, const Vector2* pIn); +CC_DEPRECATED_ATTRIBUTE typedef Vec2 kmVec2; +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Fill(Vec2* pOut, float x, float y); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2Length(const Vec2* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2LengthSq(const Vec2* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Normalize(Vec2* pOut, const Vec2* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Lerp(Vec2* pOut, const Vec2* pV1, const Vec2* pV2, float t); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Add(Vec2* pOut, const Vec2* pV1, const Vec2* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec2Dot(const Vec2* pV1, const Vec2* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Subtract(Vec2* pOut, const Vec2* pV1, const Vec2* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Scale(Vec2* pOut, const Vec2* pIn, const float s); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec2* kmVec2Assign(Vec2* pOut, const Vec2* pIn); -CC_DEPRECATED_ATTRIBUTE extern const Vector2 KM_VEC2_POS_Y; -CC_DEPRECATED_ATTRIBUTE extern const Vector2 KM_VEC2_NEG_Y; -CC_DEPRECATED_ATTRIBUTE extern const Vector2 KM_VEC2_NEG_X; -CC_DEPRECATED_ATTRIBUTE extern const Vector2 KM_VEC2_POS_X; -CC_DEPRECATED_ATTRIBUTE extern const Vector2 KM_VEC2_ZERO; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 KM_VEC2_POS_Y; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 KM_VEC2_NEG_Y; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 KM_VEC2_NEG_X; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 KM_VEC2_POS_X; +CC_DEPRECATED_ATTRIBUTE extern const Vec2 KM_VEC2_ZERO; //kmVec4 -CC_DEPRECATED_ATTRIBUTE typedef Vector4 kmVec4; -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Fill(Vector4* pOut, float x, float y, float z, float w); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Add(Vector4* pOut, const Vector4* pV1, const Vector4* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4Dot(const Vector4* pV1, const Vector4* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4Length(const Vector4* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4LengthSq(const Vector4* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Lerp(Vector4* pOut, const Vector4* pV1, const Vector4* pV2, float t); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Normalize(Vector4* pOut, const Vector4* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Scale(Vector4* pOut, const Vector4* pIn, const float s); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Subtract(Vector4* pOut, const Vector4* pV1, const Vector4* pV2); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Assign(Vector4* pOut, const Vector4* pIn); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4MultiplyMat4(Vector4* pOut, const Vector4* pV, const Matrix* pM); -CC_DEPRECATED_ATTRIBUTE CC_DLL Vector4* kmVec4Transform(Vector4* pOut, const Vector4* pV, const Matrix* pM); +CC_DEPRECATED_ATTRIBUTE typedef Vec4 kmVec4; +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Fill(Vec4* pOut, float x, float y, float z, float w); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Add(Vec4* pOut, const Vec4* pV1, const Vec4* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4Dot(const Vec4* pV1, const Vec4* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4Length(const Vec4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL float kmVec4LengthSq(const Vec4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Lerp(Vec4* pOut, const Vec4* pV1, const Vec4* pV2, float t); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Normalize(Vec4* pOut, const Vec4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Scale(Vec4* pOut, const Vec4* pIn, const float s); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Subtract(Vec4* pOut, const Vec4* pV1, const Vec4* pV2); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Assign(Vec4* pOut, const Vec4* pIn); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4MultiplyMat4(Vec4* pOut, const Vec4* pV, const Mat4* pM); +CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Transform(Vec4* pOut, const Vec4* pV, const Mat4* pM); //end of deprecated attributes and methods for kazMath diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index ff7cb97304..e8efa687fb 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -380,7 +380,7 @@ ActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyfr Size containerSize = getContainerSize(pNode->getParent()); - Vector2 absPos = getAbsolutePosition(Vector2(x,y), type, containerSize, propName); + Vec2 absPos = getAbsolutePosition(Vec2(x,y), type, containerSize, propName); return MoveTo::create(duration, absPos); } @@ -452,7 +452,7 @@ void CCBAnimationManager::setAnimatedProperty(const std::string& propName, Node float x = valueVector[0].asFloat(); float y = valueVector[1].asFloat(); - pNode->setPosition(getAbsolutePosition(Vector2(x,y), type, getContainerSize(pNode->getParent()), propName)); + pNode->setPosition(getAbsolutePosition(Vec2(x,y), type, getContainerSize(pNode->getParent()), propName)); } else if (propName == "scale") { diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp index 5a11278e91..74c6cf37aa 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp @@ -68,7 +68,7 @@ void ControlButtonLoader::onHandlePropTypeFloatScale(Node * pNode, Node * pParen } } -void ControlButtonLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vector2 pPoint, CCBReader * ccbReader) { +void ControlButtonLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vec2 pPoint, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_LABELANCHORPOINT) == 0) { ((ControlButton *)pNode)->setLabelAnchorPoint(pPoint); } else { diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h index 12e591fe62..2259f90470 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h @@ -29,7 +29,7 @@ class ControlButtonLoader : public ControlLoader { virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader); virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vector2 pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vec2 pPoint, CCBReader * ccbReader); virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp index 7b61318474..aaf3eddbce 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp @@ -40,7 +40,7 @@ void LayerGradientLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent } -void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vector2 pPoint, CCBReader * ccbReader) { +void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vec2 pPoint, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_VECTOR) == 0) { ((LayerGradient *)pNode)->setVector(pPoint); diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h index 55569df800..cf4222b0bd 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h @@ -22,7 +22,7 @@ protected: virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vector2 pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vec2 pPoint, CCBReader * ccbReader); virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); }; diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp index 64c6fd353b..633237cd90 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp @@ -5,9 +5,9 @@ using namespace cocos2d; namespace cocosbuilder { -Vector2 getAbsolutePosition(const Vector2 &pt, CCBReader::PositionType type, const Size &containerSize, const std::string& propName) +Vec2 getAbsolutePosition(const Vec2 &pt, CCBReader::PositionType type, const Size &containerSize, const std::string& propName) { - Vector2 absPt = Vector2(0,0); + Vec2 absPt = Vec2(0,0); if (type == CCBReader::PositionType::RELATIVE_BOTTOM_LEFT) { absPt = pt; diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h index 657cbaa963..c451d2bfc2 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h @@ -5,7 +5,7 @@ namespace cocosbuilder { -extern cocos2d::Vector2 getAbsolutePosition(const cocos2d::Vector2 &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const std::string&propName); +extern cocos2d::Vec2 getAbsolutePosition(const cocos2d::Vec2 &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const std::string&propName); extern void setRelativeScale(cocos2d::Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const std::string& propName); diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index 9c2f987e20..f97adba07f 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -110,7 +110,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe { case CCBReader::PropertyType::POSITION: { - Vector2 position = this->parsePropTypePosition(pNode, pParent, ccbReader, propertyName.c_str()); + Vec2 position = this->parsePropTypePosition(pNode, pParent, ccbReader, propertyName.c_str()); if (setProp) { this->onHandlePropTypePosition(pNode, pParent, propertyName.c_str(), position, ccbReader); @@ -119,7 +119,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe } case CCBReader::PropertyType::POINT: { - Vector2 point = this->parsePropTypePoint(pNode, pParent, ccbReader); + Vec2 point = this->parsePropTypePoint(pNode, pParent, ccbReader); if (setProp) { this->onHandlePropTypePoint(pNode, pParent, propertyName.c_str(), point, ccbReader); @@ -128,7 +128,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe } case CCBReader::PropertyType::POINT_LOCK: { - Vector2 pointLock = this->parsePropTypePointLock(pNode, pParent, ccbReader); + Vec2 pointLock = this->parsePropTypePointLock(pNode, pParent, ccbReader); if (setProp) { this->onHandlePropTypePointLock(pNode, pParent, propertyName.c_str(), pointLock, ccbReader); @@ -367,7 +367,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe } } -Vector2 NodeLoader::parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) +Vec2 NodeLoader::parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) { float x = ccbReader->readFloat(); float y = ccbReader->readFloat(); @@ -376,7 +376,7 @@ Vector2 NodeLoader::parsePropTypePosition(Node * pNode, Node * pParent, CCBReade Size containerSize = ccbReader->getAnimationManager()->getContainerSize(pParent); - Vector2 pt = getAbsolutePosition(Vector2(x,y), type, containerSize, pPropertyName); + Vec2 pt = getAbsolutePosition(Vec2(x,y), type, containerSize, pPropertyName); pNode->setPosition(pt); if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end()) @@ -392,19 +392,19 @@ Vector2 NodeLoader::parsePropTypePosition(Node * pNode, Node * pParent, CCBReade return pt; } -Vector2 NodeLoader::parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader) +Vec2 NodeLoader::parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader) { float x = ccbReader->readFloat(); float y = ccbReader->readFloat(); - return Vector2(x, y); + return Vec2(x, y); } -Vector2 NodeLoader::parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader) { +Vec2 NodeLoader::parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader) { float x = ccbReader->readFloat(); float y = ccbReader->readFloat(); - return Vector2(x, y); + return Vec2(x, y); } Size NodeLoader::parsePropTypeSize(Node * pNode, Node * pParent, CCBReader * ccbReader) { @@ -997,7 +997,7 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader -void NodeLoader::onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Vector2 pPosition, CCBReader * ccbReader) { +void NodeLoader::onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Vec2 pPosition, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_POSITION) == 0) { pNode->setPosition(pPosition); } else { @@ -1005,7 +1005,7 @@ void NodeLoader::onHandlePropTypePosition(Node * pNode, Node * pParent, const ch } } -void NodeLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Vector2 pPoint, CCBReader * ccbReader) { +void NodeLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Vec2 pPoint, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_ANCHORPOINT) == 0) { pNode->setAnchorPoint(pPoint); } else { @@ -1013,7 +1013,7 @@ void NodeLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char* } } -void NodeLoader::onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Vector2 pPointLock, CCBReader * ccbReader) { +void NodeLoader::onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Vec2 pPointLock, CCBReader * ccbReader) { ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.h b/cocos/editor-support/cocosbuilder/CCNodeLoader.h index 381a944257..9c31637439 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.h @@ -78,9 +78,9 @@ class NodeLoader : public cocos2d::Ref { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Node); - virtual cocos2d::Vector2 parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual cocos2d::Vector2 parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); - virtual cocos2d::Vector2 parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Vec2 parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Vec2 parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Vec2 parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader); virtual cocos2d::Size parsePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); virtual float * parsePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); virtual float parsePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); @@ -108,9 +108,9 @@ class NodeLoader : public cocos2d::Ref { virtual float * parsePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); - virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Vector2 pPosition, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Vector2 pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Vector2 pPointLock, CCBReader * ccbReader); + virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Vec2 pPosition, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Vec2 pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Vec2 pPointLock, CCBReader * ccbReader); virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); virtual void onHandlePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader); virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader); diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp index d2e94c7103..490703fcdb 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp @@ -35,7 +35,7 @@ void ParticleSystemQuadLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node } } -void ParticleSystemQuadLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vector2 pPoint, CCBReader * ccbReader) { +void ParticleSystemQuadLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Vec2 pPoint, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_POSVAR) == 0) { ((ParticleSystemQuad *)pNode)->setPosVar(pPoint); } else if(strcmp(pPropertyName, PROPERTY_GRAVITY) == 0) { diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h index a3ce7c1265..e509a40f5c 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h @@ -39,7 +39,7 @@ protected: * @js NA * @lua NA */ - virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vector2 pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Vec2 pPoint, CCBReader * ccbReader); /** * @js NA * @lua NA diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h index 39ac673b01..33e13bba18 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h @@ -31,7 +31,7 @@ protected: virtual cocos2d::extension::Scale9Sprite * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { cocos2d::extension::Scale9Sprite* pNode = cocos2d::extension::Scale9Sprite::create(); - pNode->setAnchorPoint(cocos2d::Vector2::ZERO); + pNode->setAnchorPoint(cocos2d::Vec2::ZERO); return pNode; }; diff --git a/cocos/editor-support/cocostudio/CCActionFrame.cpp b/cocos/editor-support/cocostudio/CCActionFrame.cpp index 327ca65ddd..61c6a72ad1 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrame.cpp @@ -221,7 +221,7 @@ ActionInterval* ActionFrame::getEasingAction(ActionInterval* action) ////////////////////////////////////////////////////////////////////////// ActionMoveFrame::ActionMoveFrame() - : _position(Vector2(0.0f,0.0f)) + : _position(Vec2(0.0f,0.0f)) { _frameType = (int)kKeyframeMove; } @@ -229,11 +229,11 @@ ActionMoveFrame::~ActionMoveFrame() { } -void ActionMoveFrame::setPosition(Vector2 pos) +void ActionMoveFrame::setPosition(Vec2 pos) { _position = pos; } -Vector2 ActionMoveFrame::getPosition() +Vec2 ActionMoveFrame::getPosition() { return _position; } diff --git a/cocos/editor-support/cocostudio/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h index f5ef0ba2e4..367aeb59ba 100644 --- a/cocos/editor-support/cocostudio/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -229,14 +229,14 @@ public: * * @param the move action position. */ - void setPosition(cocos2d::Vector2 pos); + void setPosition(cocos2d::Vec2 pos); /** * Gets the move action position. * * @return the move action position. */ - cocos2d::Vector2 getPosition(); + cocos2d::Vec2 getPosition(); /** * Gets the ActionInterval of ActionFrame. @@ -247,7 +247,7 @@ public: */ virtual cocos2d::ActionInterval* getAction(float duration); protected: - cocos2d::Vector2 _position; + cocos2d::Vec2 _position; }; /** diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index 69e81f8b69..f610c0e15f 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -99,7 +99,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root) actionFrame->setFrameIndex(frameInex); actionFrame->setEasingType(frameTweenType); actionFrame->setEasingParameter(frameTweenParameter); - actionFrame->setPosition(Vector2(positionX, positionY)); + actionFrame->setPosition(Vec2(positionX, positionY)); auto cActionArray = _frameArray.at((int)kKeyframeMove); cActionArray->pushBack(actionFrame); actionFrame->release(); diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 43707dd634..6177661b38 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -316,7 +316,7 @@ const cocos2d::Map& Armature::getBoneDic() const return _boneDic; } -const Matrix& Armature::getNodeToParentTransform() const +const Mat4& Armature::getNodeToParentTransform() const { if (_transformDirty) _armatureTransformDirty = true; @@ -329,25 +329,25 @@ void Armature::updateOffsetPoint() // Set contentsize and Calculate anchor point. Rect rect = getBoundingBox(); setContentSize(rect.size); - _offsetPoint = Vector2(-rect.origin.x, -rect.origin.y); + _offsetPoint = Vec2(-rect.origin.x, -rect.origin.y); if (rect.size.width != 0 && rect.size.height != 0) { - setAnchorPoint(Vector2(_offsetPoint.x / rect.size.width, _offsetPoint.y / rect.size.height)); + setAnchorPoint(Vec2(_offsetPoint.x / rect.size.width, _offsetPoint.y / rect.size.height)); } } -void Armature::setAnchorPoint(const Vector2& point) +void Armature::setAnchorPoint(const Vec2& point) { if( ! point.equals(_anchorPoint)) { _anchorPoint = point; - _anchorPointInPoints = Vector2(_contentSize.width * _anchorPoint.x - _offsetPoint.x, _contentSize.height * _anchorPoint.y - _offsetPoint.y); - _realAnchorPointInPoints = Vector2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y); + _anchorPointInPoints = Vec2(_contentSize.width * _anchorPoint.x - _offsetPoint.x, _contentSize.height * _anchorPoint.y - _offsetPoint.y); + _realAnchorPointInPoints = Vec2(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y); _transformDirty = _inverseDirty = true; } } -const Vector2& Armature::getAnchorPointInPoints() const +const Vec2& Armature::getAnchorPointInPoints() const { return _realAnchorPointInPoints; } @@ -378,7 +378,7 @@ void Armature::update(float dt) _armatureTransformDirty = false; } -void Armature::draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Armature::draw(cocos2d::Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (_parentBone == nullptr && _batchNode == nullptr) { @@ -445,7 +445,7 @@ void Armature::onExit() } -void Armature::visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // quick return if not visible. children won't be drawn. if (!_visible) @@ -459,7 +459,7 @@ void Armature::visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -573,13 +573,13 @@ void CCArmature::drawContour() for (auto& object : bodyList) { ColliderBody *body = static_cast(object); - const std::vector &vertexList = body->getCalculatedVertexList(); + const std::vector &vertexList = body->getCalculatedVertexList(); unsigned long length = vertexList.size(); - Vector2 *points = new Vector2[length]; + Vec2 *points = new Vec2[length]; for (unsigned long i = 0; ipopMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } -void BatchNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void BatchNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (_children.empty()) { diff --git a/cocos/editor-support/cocostudio/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h index b32aa2a130..8288506201 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -56,8 +56,8 @@ public: virtual void addChild(cocos2d::Node *pChild, int zOrder) override; virtual void addChild(cocos2d::Node *pChild, int zOrder, int tag) override; virtual void removeChild(cocos2d::Node* child, bool cleanup) override; - virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Matrix &parentTransform, bool parentTransformUpdated) override; - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; + virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Mat4 &parentTransform, bool parentTransformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) override; protected: void generateGroupCommand(); diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index 530cc47089..5c0daf2e79 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -72,7 +72,7 @@ Bone::Bone() _displayManager = nullptr; _ignoreMovementBoneData = false; // _worldTransform = AffineTransformMake(1, 0, 0, 1, 0, 0); - _worldTransform = Matrix::IDENTITY; + _worldTransform = Mat4::IDENTITY; _boneTransformDirty = true; _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; _blendDirty = false; @@ -380,12 +380,12 @@ void Bone::setLocalZOrder(int zOrder) Node::setLocalZOrder(zOrder); } -Matrix Bone::getNodeToArmatureTransform() const +Mat4 Bone::getNodeToArmatureTransform() const { return _worldTransform; } -Matrix Bone::getNodeToWorldTransform() const +Mat4 Bone::getNodeToWorldTransform() const { return TransformConcat(_worldTransform, _armature->getNodeToWorldTransform()); } diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index 8d20281f39..336c3dedb7 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -154,8 +154,8 @@ public: virtual void setTransformDirty(bool dirty) { _boneTransformDirty = dirty; } virtual bool isTransformDirty() { return _boneTransformDirty; } - virtual cocos2d::Matrix getNodeToArmatureTransform() const; - virtual cocos2d::Matrix getNodeToWorldTransform() const override; + virtual cocos2d::Mat4 getNodeToArmatureTransform() const; + virtual cocos2d::Mat4 getNodeToWorldTransform() const override; cocos2d::Node *getDisplayRenderNode(); DisplayType getDisplayRenderNodeType(); @@ -248,7 +248,7 @@ protected: bool _boneTransformDirty; //! Whether or not transform dirty //! self Transform, use this to change display's state - cocos2d::Matrix _worldTransform; + cocos2d::Mat4 _worldTransform; BaseData *_worldInfo; diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/CCColliderDetector.cpp index bcbc82b50d..73e5ad4b18 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/CCColliderDetector.cpp @@ -190,12 +190,12 @@ void ColliderDetector::addContourData(ContourData *contourData) #if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - std::vector &calculatedVertexList = colliderBody->_calculatedVertexList; + std::vector &calculatedVertexList = colliderBody->_calculatedVertexList; unsigned long num = contourData->vertexList.size(); for (unsigned long i = 0; i < num; i++) { - calculatedVertexList.push_back(Vector2()); + calculatedVertexList.push_back(Vec2()); } #endif } @@ -332,9 +332,9 @@ ColliderFilter *ColliderDetector::getColliderFilter() #endif -Vector2 helpPoint; +Vec2 helpPoint; -void ColliderDetector::updateTransform(Matrix &t) +void ColliderDetector::updateTransform(Mat4 &t) { if (!_active) { @@ -361,10 +361,10 @@ void ColliderDetector::updateTransform(Matrix &t) #endif unsigned long num = contourData->vertexList.size(); - std::vector &vs = contourData->vertexList; + std::vector &vs = contourData->vertexList; #if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - std::vector &cvs = colliderBody->_calculatedVertexList; + std::vector &cvs = colliderBody->_calculatedVertexList; #endif for (unsigned long i = 0; i < num; i++) diff --git a/cocos/editor-support/cocostudio/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h index 496f905681..91ed2dc26a 100644 --- a/cocos/editor-support/cocostudio/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -105,7 +105,7 @@ public: virtual void setShape(cpShape *shape) { _shape = shape; } virtual cpShape *getShape() const { return _shape; } #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - virtual const std::vector &getCalculatedVertexList() const { return _calculatedVertexList; } + virtual const std::vector &getCalculatedVertexList() const { return _calculatedVertexList; } #endif private: @@ -117,7 +117,7 @@ private: cpShape *_shape; ColliderFilter *_filter; #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - std::vector _calculatedVertexList; + std::vector _calculatedVertexList; #endif ContourData *_contourData; @@ -155,7 +155,7 @@ public: void removeContourData(ContourData *contourData); void removeAll(); - void updateTransform(cocos2d::Matrix &t); + void updateTransform(cocos2d::Mat4 &t); void setActive(bool active); bool getActive(); diff --git a/cocos/editor-support/cocostudio/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp index 4a26128e39..2037518eee 100644 --- a/cocos/editor-support/cocostudio/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -137,7 +137,7 @@ bool ComRender::serialize(void* r) else if(strcmp(className, "CCParticleSystemQuad") == 0 && filePath.find(".plist") != std::string::npos) { _render = ParticleSystemQuad::create(filePath.c_str()); - _render->setPosition(Vector2(0.0f, 0.0f)); + _render->setPosition(Vec2(0.0f, 0.0f)); _render->retain(); } else if(strcmp(className, "CCArmature") == 0) diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index de6add4016..a2ab0aecf7 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -1166,7 +1166,7 @@ ContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML, D while (vertexDataXML) { - Vector2 vertex; + Vec2 vertex; vertexDataXML->QueryFloatAttribute(A_X, &vertex.x); vertexDataXML->QueryFloatAttribute(A_Y, &vertex.y); @@ -1631,7 +1631,7 @@ ContourData *DataReaderHelper::decodeContour(const rapidjson::Value& json) { const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, VERTEX_POINT, i); - Vector2 vertex; + Vec2 vertex; vertex.x = DICTOOL->getFloatValue_json(dic, A_X); vertex.y = DICTOOL->getFloatValue_json(dic, A_Y); diff --git a/cocos/editor-support/cocostudio/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp index 5e97f43519..deeca68471 100644 --- a/cocos/editor-support/cocostudio/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -389,7 +389,7 @@ bool ContourData::init() return true; } -void ContourData::addVertex(Vector2 &vertex) +void ContourData::addVertex(Vec2 &vertex) { vertexList.push_back(vertex); } diff --git a/cocos/editor-support/cocostudio/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h index bef2714087..84eb57679d 100644 --- a/cocos/editor-support/cocostudio/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -502,9 +502,9 @@ public: ~ContourData(void); virtual bool init(); - virtual void addVertex(cocos2d::Vector2 &vertex); + virtual void addVertex(cocos2d::Vec2 &vertex); public: - std::vector vertexList; //! Save contour vertex info, vertex saved in a Vector2 + std::vector vertexList; //! Save contour vertex info, vertex saved in a Vec2 }; diff --git a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp index 7feec445e0..d995d55c1b 100644 --- a/cocos/editor-support/cocostudio/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -93,7 +93,7 @@ void DisplayFactory::updateDisplay(Bone *bone, float dt, bool dirty) break; default: { - Matrix transform = bone->getNodeToArmatureTransform(); + Mat4 transform = bone->getNodeToArmatureTransform(); display->setAdditionalTransform(&transform); } break; @@ -113,12 +113,12 @@ void DisplayFactory::updateDisplay(Bone *bone, float dt, bool dirty) CC_BREAK_IF(!detector->getBody()); #endif - Matrix displayTransform = display->getNodeToParentTransform(); - Vector2 anchorPoint = display->getAnchorPointInPoints(); + Mat4 displayTransform = display->getNodeToParentTransform(); + Vec2 anchorPoint = display->getAnchorPointInPoints(); anchorPoint = PointApplyTransform(anchorPoint, displayTransform); displayTransform.m[12] = anchorPoint.x; displayTransform.m[13] = anchorPoint.y; - Matrix t = TransformConcat( bone->getArmature()->getNodeToParentTransform(),displayTransform); + Mat4 t = TransformConcat( bone->getArmature()->getNodeToParentTransform(),displayTransform); detector->updateTransform(t); } while (0); @@ -202,7 +202,7 @@ void DisplayFactory::initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDispla if(textureData) { //! Init display anchorPoint, every Texture have a anchor point - skin->setAnchorPoint(Vector2( textureData->pivotX, textureData->pivotY)); + skin->setAnchorPoint(Vec2( textureData->pivotX, textureData->pivotY)); } diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp index dc23678a64..6b8a01c8e8 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -361,7 +361,7 @@ void DisplayManager::initDisplayList(BoneData *boneData) } -bool DisplayManager::containPoint(Vector2 &point) +bool DisplayManager::containPoint(Vec2 &point) { if(!_visible || _displayIndex < 0) { @@ -380,7 +380,7 @@ bool DisplayManager::containPoint(Vector2 &point) * */ - Vector2 outPoint = Vector2(0, 0); + Vec2 outPoint = Vec2(0, 0); Sprite *sprite = (Sprite *)_currentDecoDisplay->getDisplay(); sprite = (Sprite *)sprite->getChildByTag(0); @@ -398,7 +398,7 @@ bool DisplayManager::containPoint(Vector2 &point) bool DisplayManager::containPoint(float x, float y) { - Vector2 p = Vector2(x, y); + Vec2 p = Vec2(x, y); return containPoint(p); } @@ -431,15 +431,15 @@ Rect DisplayManager::getBoundingBox() const } -Vector2 DisplayManager::getAnchorPoint() const +Vec2 DisplayManager::getAnchorPoint() const { - CS_RETURN_IF(!_displayRenderNode) Vector2(0, 0); + CS_RETURN_IF(!_displayRenderNode) Vec2(0, 0); return _displayRenderNode->getAnchorPoint(); } -Vector2 DisplayManager::getAnchorPointInPoints() const +Vec2 DisplayManager::getAnchorPointInPoints() const { - CS_RETURN_IF(!_displayRenderNode) Vector2(0, 0); + CS_RETURN_IF(!_displayRenderNode) Vec2(0, 0); return _displayRenderNode->getAnchorPointInPoints(); } diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index 4ae988699e..b4010c4eac 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -119,13 +119,13 @@ public: cocos2d::Size getContentSize() const; cocos2d::Rect getBoundingBox() const; - cocos2d::Vector2 getAnchorPoint() const; - cocos2d::Vector2 getAnchorPointInPoints() const; + cocos2d::Vec2 getAnchorPoint() const; + cocos2d::Vec2 getAnchorPointInPoints() const; /** * Check if the position is inside the bone. */ - virtual bool containPoint(cocos2d::Vector2 &_point); + virtual bool containPoint(cocos2d::Vec2 &_point); /** * Check if the position is inside the bone. diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index dc30adc143..abb8396d19 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -238,7 +238,7 @@ void WidgetPropertiesReader::setAnchorPointForWidget(cocos2d::ui::Widget *widget } if (isAnchorPointXExists || isAnchorPointYExists) { - widget->setAnchorPoint(Vector2(anchorPointXInFile, anchorPointYInFile)); + widget->setAnchorPoint(Vec2(anchorPointXInFile, anchorPointYInFile)); } } @@ -396,7 +396,7 @@ void WidgetPropertiesReader0250::setPropsForWidgetFromJsonDictionary(Widget*widg widget->setName(widgetName); float x = DICTOOL->getFloatValue_json(options, "x"); float y = DICTOOL->getFloatValue_json(options, "y"); - widget->setPosition(Vector2(x,y)); + widget->setPosition(Vec2(x,y)); bool sx = DICTOOL->checkObjectExist_json(options, "scaleX"); if (sx) { @@ -711,7 +711,7 @@ void WidgetPropertiesReader0250::setPropsForLayoutFromJsonDictionary(Widget*widg float bgcv1 = DICTOOL->getFloatValue_json(options, "vectorX"); float bgcv2 = DICTOOL->getFloatValue_json(options, "vectorY"); - panel->setBackGroundColorVector(Vector2(bgcv1, bgcv2)); + panel->setBackGroundColorVector(Vec2(bgcv1, bgcv2)); int co = DICTOOL->getIntValue_json(options, "bgColorOpacity"); @@ -1135,9 +1135,9 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va { if (child->getPositionType() == ui::Widget::PositionType::PERCENT) { - child->setPositionPercent(Vector2(child->getPositionPercent().x + widget->getAnchorPoint().x, child->getPositionPercent().y + widget->getAnchorPoint().y)); + child->setPositionPercent(Vec2(child->getPositionPercent().x + widget->getAnchorPoint().x, child->getPositionPercent().y + widget->getAnchorPoint().y)); } - child->setPosition(Vector2(child->getPositionX() + widget->getAnchorPointInPoints().x, child->getPositionY() + widget->getAnchorPointInPoints().y)); + child->setPosition(Vec2(child->getPositionX() + widget->getAnchorPointInPoints().x, child->getPositionY() + widget->getAnchorPointInPoints().y)); } widget->addChild(child); } @@ -1158,8 +1158,8 @@ void WidgetPropertiesReader0300::setPropsForWidgetFromJsonDictionary(Widget*widg widget->setSizeType((Widget::SizeType)DICTOOL->getIntValue_json(options, "sizeType")); widget->setPositionType((Widget::PositionType)DICTOOL->getIntValue_json(options, "positionType")); - widget->setSizePercent(Vector2(DICTOOL->getFloatValue_json(options, "sizePercentX"), DICTOOL->getFloatValue_json(options, "sizePercentY"))); - widget->setPositionPercent(Vector2(DICTOOL->getFloatValue_json(options, "positionPercentX"), DICTOOL->getFloatValue_json(options, "positionPercentY"))); + widget->setSizePercent(Vec2(DICTOOL->getFloatValue_json(options, "sizePercentX"), DICTOOL->getFloatValue_json(options, "sizePercentY"))); + widget->setPositionPercent(Vec2(DICTOOL->getFloatValue_json(options, "positionPercentX"), DICTOOL->getFloatValue_json(options, "positionPercentY"))); float w = DICTOOL->getFloatValue_json(options, "width"); float h = DICTOOL->getFloatValue_json(options, "height"); @@ -1173,7 +1173,7 @@ void WidgetPropertiesReader0300::setPropsForWidgetFromJsonDictionary(Widget*widg widget->setName(widgetName); float x = DICTOOL->getFloatValue_json(options, "x"); float y = DICTOOL->getFloatValue_json(options, "y"); - widget->setPosition(Vector2(x,y)); + widget->setPosition(Vec2(x,y)); bool sx = DICTOOL->checkObjectExist_json(options, "scaleX"); if (sx) { @@ -1675,7 +1675,7 @@ void WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widg float bgcv1 = DICTOOL->getFloatValue_json(options, "vectorX"); float bgcv2 = DICTOOL->getFloatValue_json(options, "vectorY"); - panel->setBackGroundColorVector(Vector2(bgcv1, bgcv2)); + panel->setBackGroundColorVector(Vec2(bgcv1, bgcv2)); int co = DICTOOL->getIntValue_json(options, "bgColorOpacity"); diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index e5f89be98c..52adc3e656 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -220,7 +220,7 @@ void SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d: { float x = DICTOOL->getFloatValue_json(root, "x"); float y = DICTOOL->getFloatValue_json(root, "y"); - node->setPosition(Vector2(x, y)); + node->setPosition(Vec2(x, y)); const bool bVisible = (DICTOOL->getIntValue_json(root, "visible", 1) != 0); node->setVisible(bVisible); diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index ea1f678e1d..e1ff9f2521 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -86,7 +86,7 @@ Skin::Skin() , _armature(nullptr) , _displayName("") { - _skinTransform = Matrix::IDENTITY; + _skinTransform = Mat4::IDENTITY; } bool Skin::initWithSpriteFrameName(const std::string& spriteFrameName) @@ -128,7 +128,7 @@ void Skin::setSkinData(const BaseData &var) setScaleY(_skinData.scaleY); setRotationSkewX(CC_RADIANS_TO_DEGREES(_skinData.skewX)); setRotationSkewY(CC_RADIANS_TO_DEGREES(-_skinData.skewY)); - setPosition(Vector2(_skinData.x, _skinData.y)); + setPosition(Vec2(_skinData.x, _skinData.y)); _skinTransform = getNodeToParentTransform(); updateArmatureTransform(); @@ -153,7 +153,7 @@ void Skin::updateTransform() // If it is not visible, or one of its ancestors is not visible, then do nothing: if( !_visible) { - _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vector3(0, 0, 0); + _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vec3(0, 0, 0); } else { @@ -201,15 +201,15 @@ void Skin::updateTransform() } } -Matrix Skin::getNodeToWorldTransform() const +Mat4 Skin::getNodeToWorldTransform() const { return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(), _transform); } -Matrix Skin::getNodeToWorldTransformAR() const +Mat4 Skin::getNodeToWorldTransformAR() const { - Matrix displayTransform = _transform; - Vector2 anchorPoint = _anchorPointInPoints; + Mat4 displayTransform = _transform; + Vec2 anchorPoint = _anchorPointInPoints; anchorPoint = PointApplyTransform(anchorPoint, displayTransform); @@ -219,9 +219,9 @@ Matrix Skin::getNodeToWorldTransformAR() const return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(),displayTransform); } -void Skin::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Skin::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { - Matrix mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); + Mat4 mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); //TODO implement z order _quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, mv); diff --git a/cocos/editor-support/cocostudio/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h index d27ff5fb2c..9bd22850ad 100644 --- a/cocos/editor-support/cocostudio/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -51,10 +51,10 @@ public: void updateArmatureTransform(); void updateTransform() override; - cocos2d::Matrix getNodeToWorldTransform() const override; - cocos2d::Matrix getNodeToWorldTransformAR() const; + cocos2d::Mat4 getNodeToWorldTransform() const override; + cocos2d::Mat4 getNodeToWorldTransformAR() const; - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) override; /** * @js NA @@ -75,7 +75,7 @@ protected: BaseData _skinData; Bone *_bone; Armature *_armature; - cocos2d::Matrix _skinTransform; + cocos2d::Mat4 _skinTransform; std::string _displayName; cocos2d::QuadCommand _quadCommand; // quad command }; diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/CCTransformHelp.cpp index 453331521f..b4c2cb8fe3 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/CCTransformHelp.cpp @@ -32,8 +32,8 @@ namespace cocostudio { AffineTransform TransformHelp::helpMatrix1; AffineTransform TransformHelp::helpMatrix2; -Vector2 TransformHelp::helpPoint1; -Vector2 TransformHelp::helpPoint2; +Vec2 TransformHelp::helpPoint1; +Vec2 TransformHelp::helpPoint2; BaseData helpParentNode; @@ -118,9 +118,9 @@ void TransformHelp::nodeToMatrix(const BaseData &node, AffineTransform &matrix) matrix.ty = node.y; } -void TransformHelp::nodeToMatrix(const BaseData &node, Matrix &matrix) +void TransformHelp::nodeToMatrix(const BaseData &node, Mat4 &matrix) { - matrix = Matrix::IDENTITY; + matrix = Mat4::IDENTITY; if (node.skewX == -node.skewY) { @@ -171,7 +171,7 @@ void TransformHelp::matrixToNode(const AffineTransform &matrix, BaseData &node) node.y = matrix.ty; } -void TransformHelp::matrixToNode(const Matrix &matrix, BaseData &node) +void TransformHelp::matrixToNode(const Mat4 &matrix, BaseData &node) { /* * In as3 language, there is a function called "deltaTransformPoint", it calculate a point used give Transform diff --git a/cocos/editor-support/cocostudio/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h index 5e45890ba3..ec93a2ac55 100644 --- a/cocos/editor-support/cocostudio/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -47,9 +47,9 @@ public: static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode); static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix); - static void nodeToMatrix(const BaseData &node, cocos2d::Matrix &matrix); + static void nodeToMatrix(const BaseData &node, cocos2d::Mat4 &matrix); static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node); - static void matrixToNode(const cocos2d::Matrix &_matrix, BaseData &_node); + static void matrixToNode(const cocos2d::Mat4 &_matrix, BaseData &_node); static void nodeConcat(BaseData &target, BaseData &source); static void nodeSub(BaseData &target, BaseData &source); @@ -57,8 +57,8 @@ public: static cocos2d::AffineTransform helpMatrix1; static cocos2d::AffineTransform helpMatrix2; - static cocos2d::Vector2 helpPoint1; - static cocos2d::Vector2 helpPoint2; + static cocos2d::Vec2 helpPoint1; + static cocos2d::Vec2 helpPoint2; }; } diff --git a/cocos/editor-support/cocostudio/CCUtilMath.cpp b/cocos/editor-support/cocostudio/CCUtilMath.cpp index 37c97fe8db..15c354b8b6 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.cpp +++ b/cocos/editor-support/cocostudio/CCUtilMath.cpp @@ -29,7 +29,7 @@ using namespace cocos2d; namespace cocostudio { -bool isSpriteContainPoint(Sprite *sprite, Vector2 point, Vector2 &outPoint) +bool isSpriteContainPoint(Sprite *sprite, Vec2 point, Vec2 &outPoint) { outPoint = sprite->convertToNodeSpace(point); @@ -39,17 +39,17 @@ bool isSpriteContainPoint(Sprite *sprite, Vector2 point, Vector2 &outPoint) return r.containsPoint(outPoint); } -bool isSpriteContainPoint(Sprite *sprite, Vector2 point) +bool isSpriteContainPoint(Sprite *sprite, Vec2 point) { - Vector2 p = Vector2(0, 0); + Vec2 p = Vec2(0, 0); return isSpriteContainPoint(sprite, point, p); } -Vector2 bezierTo(float t, Vector2 &point1, Vector2 &point2, Vector2 &point3) +Vec2 bezierTo(float t, Vec2 &point1, Vec2 &point2, Vec2 &point3) { - Vector2 p; + Vec2 p; p.x = pow((1 - t), 2) * point1.x + 2 * t * (1 - t) * point2.x + pow(t, 2) * point3.x; p.y = pow((1 - t), 2) * point1.y + 2 * t * (1 - t) * point2.y + pow(t, 2) * point3.y; @@ -57,9 +57,9 @@ Vector2 bezierTo(float t, Vector2 &point1, Vector2 &point2, Vector2 &point3) return p; } -Vector2 bezierTo(float t, Vector2 &point1, Vector2 &point2, Vector2 &point3, Vector2 &point4) +Vec2 bezierTo(float t, Vec2 &point1, Vec2 &point2, Vec2 &point3, Vec2 &point4) { - Vector2 p; + Vec2 p; p.x = point1.x * pow((1 - t), 3) + 3 * t * point2.x * pow((1 - t), 2) + 3 * point3.x * pow(t, 2) * (1 - t) + point4.x * pow(t, 3); p.y = point1.y * pow((1 - t), 3) + 3 * t * point2.y * pow((1 - t), 2) + 3 * point3.y * pow(t, 2) * (1 - t) + point4.y * pow(t, 3); @@ -67,9 +67,9 @@ Vector2 bezierTo(float t, Vector2 &point1, Vector2 &point2, Vector2 &point3, Vec return p; } -Vector2 circleTo(float t, Vector2 ¢er, float radius, float fromRadian, float radianDif) +Vec2 circleTo(float t, Vec2 ¢er, float radius, float fromRadian, float radianDif) { - Vector2 p; + Vec2 p; p.x = center.x + radius * cos(fromRadian + radianDif * t); p.y = center.y + radius * sin(fromRadian + radianDif * t); diff --git a/cocos/editor-support/cocostudio/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h index 3b1760f0b4..5a4827bf44 100644 --- a/cocos/editor-support/cocostudio/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -37,18 +37,18 @@ namespace cocostudio { //! hit test function -bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vector2 point); -bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vector2 point, cocos2d::Vector2 &outPoint); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Vec2 point, cocos2d::Vec2 &outPoint); #define CC_SPRITE_CONTAIN_POINT(sprite, point) isSpriteContainPoint((sprite), (point)) #define CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint) isSpriteContainPoint((sprite), (point), outPoint) //! motion curve function -cocos2d::Vector2 bezierTo(float t, cocos2d::Vector2 &point1, cocos2d::Vector2 &point2, cocos2d::Vector2 &point3); -cocos2d::Vector2 bezierTo(float t, cocos2d::Vector2 &point1, cocos2d::Vector2 &point2, cocos2d::Vector2 &point3, cocos2d::Vector2 &point4); +cocos2d::Vec2 bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3); +cocos2d::Vec2 bezierTo(float t, cocos2d::Vec2 &point1, cocos2d::Vec2 &point2, cocos2d::Vec2 &point3, cocos2d::Vec2 &point4); -cocos2d::Vector2 circleTo(float t, cocos2d::Vector2 ¢er, float radius, float fromRadian, float radianDif); +cocos2d::Vec2 circleTo(float t, cocos2d::Vec2 ¢er, float radius, float fromRadian, float radianDif); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 9c1d3b6ef2..926083f0b5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -72,7 +72,7 @@ namespace cocostudio float bgcv1 = DICTOOL->getFloatValue_json(options, "vectorX"); float bgcv2 = DICTOOL->getFloatValue_json(options, "vectorY"); - panel->setBackGroundColorVector(Vector2(bgcv1, bgcv2)); + panel->setBackGroundColorVector(Vec2(bgcv1, bgcv2)); int co = DICTOOL->getIntValue_json(options, "bgColorOpacity"); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index ae0b63de28..fb45ed7017 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -46,8 +46,8 @@ namespace cocostudio widget->setSizeType((Widget::SizeType)DICTOOL->getIntValue_json(options, "sizeType")); widget->setPositionType((Widget::PositionType)DICTOOL->getIntValue_json(options, "positionType")); - widget->setSizePercent(Vector2(DICTOOL->getFloatValue_json(options, "sizePercentX"), DICTOOL->getFloatValue_json(options, "sizePercentY"))); - widget->setPositionPercent(Vector2(DICTOOL->getFloatValue_json(options, "positionPercentX"), DICTOOL->getFloatValue_json(options, "positionPercentY"))); + widget->setSizePercent(Vec2(DICTOOL->getFloatValue_json(options, "sizePercentX"), DICTOOL->getFloatValue_json(options, "sizePercentY"))); + widget->setPositionPercent(Vec2(DICTOOL->getFloatValue_json(options, "positionPercentX"), DICTOOL->getFloatValue_json(options, "positionPercentY"))); /* adapt screen */ float w = 0, h = 0; @@ -80,7 +80,7 @@ namespace cocostudio widget->setName(widgetName); float x = DICTOOL->getFloatValue_json(options, "x"); float y = DICTOOL->getFloatValue_json(options, "y"); - widget->setPosition(Vector2(x,y)); + widget->setPosition(Vec2(x,y)); bool sx = DICTOOL->checkObjectExist_json(options, "scaleX"); if (sx) { @@ -213,7 +213,7 @@ namespace cocostudio } if (isAnchorPointXExists || isAnchorPointYExists) { - widget->setAnchorPoint(Vector2(anchorPointXInFile, anchorPointYInFile)); + widget->setAnchorPoint(Vec2(anchorPointXInFile, anchorPointYInFile)); } } } diff --git a/cocos/editor-support/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp index f7c6bcf5d6..16d9c4b8c6 100644 --- a/cocos/editor-support/spine/CCSkeleton.cpp +++ b/cocos/editor-support/spine/CCSkeleton.cpp @@ -125,7 +125,7 @@ void Skeleton::update (float deltaTime) { spSkeleton_update(skeleton, deltaTime * timeScale); } -void Skeleton::draw(cocos2d::Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Skeleton::draw(cocos2d::Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); @@ -133,7 +133,7 @@ void Skeleton::draw(cocos2d::Renderer *renderer, const Matrix &transform, bool t renderer->addCommand(&_customCommand); } -void Skeleton::onDraw(const Matrix &transform, bool transformUpdated) +void Skeleton::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -202,17 +202,17 @@ void Skeleton::onDraw(const Matrix &transform, bool transformUpdated) // Slots. DrawPrimitives::setDrawColor4B(0, 0, 255, 255); glLineWidth(1); - Vector2 points[4]; + Vec2 points[4]; V3F_C4B_T2F_Quad tmpQuad; for (int i = 0, n = skeleton->slotCount; i < n; i++) { spSlot* slot = skeleton->drawOrder[i]; if (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue; spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment; spRegionAttachment_updateQuad(attachment, slot, &tmpQuad); - points[0] = Vector2(tmpQuad.bl.vertices.x, tmpQuad.bl.vertices.y); - points[1] = Vector2(tmpQuad.br.vertices.x, tmpQuad.br.vertices.y); - points[2] = Vector2(tmpQuad.tr.vertices.x, tmpQuad.tr.vertices.y); - points[3] = Vector2(tmpQuad.tl.vertices.x, tmpQuad.tl.vertices.y); + points[0] = Vec2(tmpQuad.bl.vertices.x, tmpQuad.bl.vertices.y); + points[1] = Vec2(tmpQuad.br.vertices.x, tmpQuad.br.vertices.y); + points[2] = Vec2(tmpQuad.tr.vertices.x, tmpQuad.tr.vertices.y); + points[3] = Vec2(tmpQuad.tl.vertices.x, tmpQuad.tl.vertices.y); DrawPrimitives::drawPoly(points, 4, true); } } @@ -224,14 +224,14 @@ void Skeleton::onDraw(const Matrix &transform, bool transformUpdated) spBone *bone = skeleton->bones[i]; float x = bone->data->length * bone->m00 + bone->worldX; float y = bone->data->length * bone->m10 + bone->worldY; - DrawPrimitives::drawLine(Vector2(bone->worldX, bone->worldY), Vector2(x, y)); + DrawPrimitives::drawLine(Vec2(bone->worldX, bone->worldY), Vec2(x, y)); } // Bone origins. DrawPrimitives::setPointSize(4); DrawPrimitives::setDrawColor4B(0, 0, 255, 255); // Root bone is blue. for (int i = 0, n = skeleton->boneCount; i < n; i++) { spBone *bone = skeleton->bones[i]; - DrawPrimitives::drawPoint(Vector2(bone->worldX, bone->worldY)); + DrawPrimitives::drawPoint(Vec2(bone->worldX, bone->worldY)); if (i == 0) DrawPrimitives::setDrawColor4B(0, 255, 0, 255); } } @@ -271,7 +271,7 @@ Rect Skeleton::getBoundingBox () const { maxX = max(maxX, vertices[VERTEX_X3] * scaleX); maxY = max(maxY, vertices[VERTEX_Y3] * scaleY); } - Vector2 position = getPosition(); + Vec2 position = getPosition(); return Rect(position.x + minX, position.y + minY, maxX - minX, maxY - minY); } diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index 2ff978ffda..3b44e667df 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -67,8 +67,8 @@ public: virtual ~Skeleton (); virtual void update (float deltaTime) override; - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; - void onDraw(const cocos2d::Matrix &transform, bool transformUpdated); + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) override; + void onDraw(const cocos2d::Mat4 &transform, bool transformUpdated); void onEnter() override; void onExit() override; virtual cocos2d::Rect getBoundingBox () const override; diff --git a/cocos/math/CCAffineTransform.cpp b/cocos/math/CCAffineTransform.cpp index f5df4927b1..f47e09e67e 100644 --- a/cocos/math/CCAffineTransform.cpp +++ b/cocos/math/CCAffineTransform.cpp @@ -40,19 +40,19 @@ AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, floa return t; } -Vector2 __CCPointApplyAffineTransform(const Vector2& point, const AffineTransform& t) +Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t) { - Vector2 p; + Vec2 p; p.x = (float)((double)t.a * point.x + (double)t.c * point.y + t.tx); p.y = (float)((double)t.b * point.x + (double)t.d * point.y + t.ty); return p; } -Vector2 PointApplyTransform(const Vector2& point, const Matrix& transform) +Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform) { - Vector3 vec(point.x, point.y, 0); + Vec3 vec(point.x, point.y, 0); transform.transformPoint(&vec); - return Vector2(vec.x, vec.y); + return Vec2(vec.x, vec.y); } @@ -80,10 +80,10 @@ Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineT float right = rect.getMaxX(); float bottom = rect.getMaxY(); - Vector2 topLeft = PointApplyAffineTransform(Vector2(left, top), anAffineTransform); - Vector2 topRight = PointApplyAffineTransform(Vector2(right, top), anAffineTransform); - Vector2 bottomLeft = PointApplyAffineTransform(Vector2(left, bottom), anAffineTransform); - Vector2 bottomRight = PointApplyAffineTransform(Vector2(right, bottom), anAffineTransform); + Vec2 topLeft = PointApplyAffineTransform(Vec2(left, top), anAffineTransform); + Vec2 topRight = PointApplyAffineTransform(Vec2(right, top), anAffineTransform); + Vec2 bottomLeft = PointApplyAffineTransform(Vec2(left, bottom), anAffineTransform); + Vec2 bottomRight = PointApplyAffineTransform(Vec2(right, bottom), anAffineTransform); float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x)); float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x)); @@ -93,17 +93,17 @@ Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineT return Rect(minX, minY, (maxX - minX), (maxY - minY)); } -Rect RectApplyTransform(const Rect& rect, const Matrix& transform) +Rect RectApplyTransform(const Rect& rect, const Mat4& transform) { float top = rect.getMinY(); float left = rect.getMinX(); float right = rect.getMaxX(); float bottom = rect.getMaxY(); - Vector3 topLeft(left, top, 0); - Vector3 topRight(right, top, 0); - Vector3 bottomLeft(left, bottom, 0); - Vector3 bottomRight(right, bottom, 0); + Vec3 topLeft(left, top, 0); + Vec3 topRight(right, top, 0); + Vec3 bottomLeft(left, bottom, 0); + Vec3 bottomRight(right, bottom, 0); transform.transformPoint(&topLeft); transform.transformPoint(&topRight); transform.transformPoint(&bottomLeft); @@ -151,7 +151,7 @@ AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTra t1.tx * t2.b + t1.ty * t2.d + t2.ty); //ty } -Matrix TransformConcat(const Matrix& t1, const Matrix& t2) +Mat4 TransformConcat(const Mat4& t1, const Mat4& t2) { return t1 * t2; } diff --git a/cocos/math/CCAffineTransform.h b/cocos/math/CCAffineTransform.h index e2f16ef92c..e5a158a946 100644 --- a/cocos/math/CCAffineTransform.h +++ b/cocos/math/CCAffineTransform.h @@ -43,7 +43,7 @@ struct AffineTransform { CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); #define AffineTransformMake __CCAffineTransformMake -CC_DLL Vector2 __CCPointApplyAffineTransform(const Vector2& point, const AffineTransform& t); +CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); #define PointApplyAffineTransform __CCPointApplyAffineTransform CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t); @@ -52,8 +52,8 @@ CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform CC_DLL AffineTransform AffineTransformMakeIdentity(); CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); -CC_DLL Rect RectApplyTransform(const Rect& rect, const Matrix& transform); -CC_DLL Vector2 PointApplyTransform(const Vector2& point, const Matrix& transform); +CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); +CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); @@ -62,7 +62,7 @@ CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const Af CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); -Matrix TransformConcat(const Matrix& t1, const Matrix& t2); +Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); extern CC_DLL const AffineTransform AffineTransformIdentity; diff --git a/cocos/math/CCGeometry.cpp b/cocos/math/CCGeometry.cpp index 6e2c074a6d..b801f8628d 100644 --- a/cocos/math/CCGeometry.cpp +++ b/cocos/math/CCGeometry.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include "base/ccMacros.h" -// implementation of Vector2 +// implementation of Vec2 NS_CC_BEGIN // implementation of Size @@ -45,7 +45,7 @@ Size::Size(const Size& other) : width(other.width), height(other.height) { } -Size::Size(const Vector2& point) : width(point.x), height(point.y) +Size::Size(const Vec2& point) : width(point.x), height(point.y) { } @@ -55,7 +55,7 @@ Size& Size::operator= (const Size& other) return *this; } -Size& Size::operator= (const Vector2& point) +Size& Size::operator= (const Vec2& point) { setSize(point.x, point.y); return *this; @@ -167,7 +167,7 @@ float Rect::getMinY() const return origin.y; } -bool Rect::containsPoint(const Vector2& point) const +bool Rect::containsPoint(const Vec2& point) const { bool bRet = false; diff --git a/cocos/math/CCGeometry.h b/cocos/math/CCGeometry.h index 47be81c1ee..056f6939b9 100644 --- a/cocos/math/CCGeometry.h +++ b/cocos/math/CCGeometry.h @@ -46,9 +46,9 @@ public: float width; float height; public: - operator Vector2() const + operator Vec2() const { - return Vector2(width, height); + return Vec2(width, height); } public: @@ -69,7 +69,7 @@ public: * @js NA * @lua NA */ - explicit Size(const Vector2& point); + explicit Size(const Vec2& point); /** * @js NA * @lua NA @@ -79,7 +79,7 @@ public: * @js NA * @lua NA */ - Size& operator= (const Vector2& point); + Size& operator= (const Vec2& point); /** * @js NA * @lua NA @@ -116,7 +116,7 @@ public: class CC_DLL Rect { public: - Vector2 origin; + Vec2 origin; Size size; public: @@ -174,7 +174,7 @@ public: /** * @js NA */ - bool containsPoint(const Vector2& point) const; + bool containsPoint(const Vec2& point) const; /** * @js NA */ diff --git a/cocos/math/MathUtil.h b/cocos/math/MathUtil.h index 73be6becda..7618650833 100644 --- a/cocos/math/MathUtil.h +++ b/cocos/math/MathUtil.h @@ -32,8 +32,8 @@ NS_CC_MATH_BEGIN */ class MathUtil { - friend class Matrix; - friend class Vector3; + friend class Mat4; + friend class Vec3; public: @@ -82,11 +82,11 @@ private: inline static void transposeMatrix(const float* m, float* dst); - inline static void transformVector4(const float* m, float x, float y, float z, float w, float* dst); + inline static void transformVec4(const float* m, float x, float y, float z, float w, float* dst); - inline static void transformVector4(const float* m, const float* v, float* dst); + inline static void transformVec4(const float* m, const float* v, float* dst); - inline static void crossVector3(const float* v1, const float* v2, float* dst); + inline static void crossVec3(const float* v1, const float* v2, float* dst); MathUtil(); }; diff --git a/cocos/math/MathUtil.inl b/cocos/math/MathUtil.inl index f4be0f98d2..ba19d635e7 100644 --- a/cocos/math/MathUtil.inl +++ b/cocos/math/MathUtil.inl @@ -159,14 +159,14 @@ inline void MathUtil::transposeMatrix(const float* m, float* dst) memcpy(dst, t, MATRIX_SIZE); } -inline void MathUtil::transformVector4(const float* m, float x, float y, float z, float w, float* dst) +inline void MathUtil::transformVec4(const float* m, float x, float y, float z, float w, float* dst) { dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12]; dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13]; dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14]; } -inline void MathUtil::transformVector4(const float* m, const float* v, float* dst) +inline void MathUtil::transformVec4(const float* m, const float* v, float* dst) { // Handle case where v == dst. float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12]; @@ -180,7 +180,7 @@ inline void MathUtil::transformVector4(const float* m, const float* v, float* ds dst[3] = w; } -inline void MathUtil::crossVector3(const float* v1, const float* v2, float* dst) +inline void MathUtil::crossVec3(const float* v1, const float* v2, float* dst) { float x = (v1[1] * v2[2]) - (v1[2] * v2[1]); float y = (v1[2] * v2[0]) - (v1[0] * v2[2]); diff --git a/cocos/math/MathUtilNeon.inl b/cocos/math/MathUtilNeon.inl index 8dfa81804a..f9c73498fd 100644 --- a/cocos/math/MathUtilNeon.inl +++ b/cocos/math/MathUtilNeon.inl @@ -177,7 +177,7 @@ inline void MathUtil::transposeMatrix(const float* m, float* dst) ); } -inline void MathUtil::transformVector4(const float* m, float x, float y, float z, float w, float* dst) +inline void MathUtil::transformVec4(const float* m, float x, float y, float z, float w, float* dst) { asm volatile( "vld1.32 {d0[0]}, [%1] \n\t" // V[x] @@ -200,7 +200,7 @@ inline void MathUtil::transformVector4(const float* m, float x, float y, float z ); } -inline void MathUtil::transformVector4(const float* m, const float* v, float* dst) +inline void MathUtil::transformVec4(const float* m, const float* v, float* dst) { asm volatile ( @@ -220,7 +220,7 @@ inline void MathUtil::transformVector4(const float* m, const float* v, float* ds ); } -inline void MathUtil::crossVector3(const float* v1, const float* v2, float* dst) +inline void MathUtil::crossVec3(const float* v1, const float* v2, float* dst) { asm volatile( "vld1.32 {d1[1]}, [%1] \n\t" // diff --git a/cocos/math/Matrix.cpp b/cocos/math/Matrix.cpp index 5f3503fb3d..c904b758f4 100644 --- a/cocos/math/Matrix.cpp +++ b/cocos/math/Matrix.cpp @@ -25,58 +25,58 @@ NS_CC_MATH_BEGIN -Matrix::Matrix() +Mat4::Mat4() { *this = IDENTITY; } -Matrix::Matrix(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, +Mat4::Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) { set(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44); } -Matrix::Matrix(const float* mat) +Mat4::Mat4(const float* mat) { set(mat); } -Matrix::Matrix(const Matrix& copy) +Mat4::Mat4(const Mat4& copy) { memcpy(m, copy.m, MATRIX_SIZE); } -Matrix::~Matrix() +Mat4::~Mat4() { } -void Matrix::createLookAt(const Vector3& eyePosition, const Vector3& targetPosition, const Vector3& up, Matrix* dst) +void Mat4::createLookAt(const Vec3& eyePosition, const Vec3& targetPosition, const Vec3& up, Mat4* dst) { createLookAt(eyePosition.x, eyePosition.y, eyePosition.z, targetPosition.x, targetPosition.y, targetPosition.z, up.x, up.y, up.z, dst); } -void Matrix::createLookAt(float eyePositionX, float eyePositionY, float eyePositionZ, +void Mat4::createLookAt(float eyePositionX, float eyePositionY, float eyePositionZ, float targetPositionX, float targetPositionY, float targetPositionZ, - float upX, float upY, float upZ, Matrix* dst) + float upX, float upY, float upZ, Mat4* dst) { GP_ASSERT(dst); - Vector3 eye(eyePositionX, eyePositionY, eyePositionZ); - Vector3 target(targetPositionX, targetPositionY, targetPositionZ); - Vector3 up(upX, upY, upZ); + Vec3 eye(eyePositionX, eyePositionY, eyePositionZ); + Vec3 target(targetPositionX, targetPositionY, targetPositionZ); + Vec3 up(upX, upY, upZ); up.normalize(); - Vector3 zaxis; - Vector3::subtract(eye, target, &zaxis); + Vec3 zaxis; + Vec3::subtract(eye, target, &zaxis); zaxis.normalize(); - Vector3 xaxis; - Vector3::cross(up, zaxis, &xaxis); + Vec3 xaxis; + Vec3::cross(up, zaxis, &xaxis); xaxis.normalize(); - Vector3 yaxis; - Vector3::cross(zaxis, xaxis, &yaxis); + Vec3 yaxis; + Vec3::cross(zaxis, xaxis, &yaxis); yaxis.normalize(); dst->m[0] = xaxis.x; @@ -94,14 +94,14 @@ void Matrix::createLookAt(float eyePositionX, float eyePositionY, float eyePosit dst->m[10] = zaxis.z; dst->m[11] = 0.0f; - dst->m[12] = -Vector3::dot(xaxis, eye); - dst->m[13] = -Vector3::dot(yaxis, eye); - dst->m[14] = -Vector3::dot(zaxis, eye); + dst->m[12] = -Vec3::dot(xaxis, eye); + dst->m[13] = -Vec3::dot(yaxis, eye); + dst->m[14] = -Vec3::dot(zaxis, eye); dst->m[15] = 1.0f; } -void Matrix::createPerspective(float fieldOfView, float aspectRatio, - float zNearPlane, float zFarPlane, Matrix* dst) +void Mat4::createPerspective(float fieldOfView, float aspectRatio, + float zNearPlane, float zFarPlane, Mat4* dst) { GP_ASSERT(dst); GP_ASSERT(zFarPlane != zNearPlane); @@ -127,15 +127,15 @@ void Matrix::createPerspective(float fieldOfView, float aspectRatio, dst->m[14] = -2.0f * zFarPlane * zNearPlane * f_n; } -void Matrix::createOrthographic(float width, float height, float zNearPlane, float zFarPlane, Matrix* dst) +void Mat4::createOrthographic(float width, float height, float zNearPlane, float zFarPlane, Mat4* dst) { float halfWidth = width / 2.0f; float halfHeight = height / 2.0f; createOrthographicOffCenter(-halfWidth, halfWidth, -halfHeight, halfHeight, zNearPlane, zFarPlane, dst); } -void Matrix::createOrthographicOffCenter(float left, float right, float bottom, float top, - float zNearPlane, float zFarPlane, Matrix* dst) +void Mat4::createOrthographicOffCenter(float left, float right, float bottom, float top, + float zNearPlane, float zFarPlane, Mat4* dst) { GP_ASSERT(dst); GP_ASSERT(right != left); @@ -153,24 +153,24 @@ void Matrix::createOrthographicOffCenter(float left, float right, float bottom, dst->m[15] = 1; } -void Matrix::createBillboard(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, Matrix* dst) +void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, Mat4* dst) { createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, NULL, dst); } -void Matrix::createBillboard(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, const Vector3& cameraForwardVector, - Matrix* dst) +void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, const Vec3& cameraForwardVector, + Mat4* dst) { createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, &cameraForwardVector, dst); } -void Matrix::createBillboardHelper(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, const Vector3* cameraForwardVector, - Matrix* dst) +void Mat4::createBillboardHelper(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, const Vec3* cameraForwardVector, + Mat4* dst) { - Vector3 delta(objectPosition, cameraPosition); + Vec3 delta(objectPosition, cameraPosition); bool isSufficientDelta = delta.lengthSquared() > MATH_EPSILON; dst->setIdentity(); @@ -182,10 +182,10 @@ void Matrix::createBillboardHelper(const Vector3& objectPosition, const Vector3& // either a safe default or a sufficient distance between object and camera. if (cameraForwardVector || isSufficientDelta) { - Vector3 target = isSufficientDelta ? cameraPosition : (objectPosition - *cameraForwardVector); + Vec3 target = isSufficientDelta ? cameraPosition : (objectPosition - *cameraForwardVector); // A billboard is the inverse of a lookAt rotation - Matrix lookAt; + Mat4 lookAt; createLookAt(objectPosition, target, cameraUpVector, &lookAt); dst->m[0] = lookAt.m[0]; dst->m[1] = lookAt.m[4]; @@ -199,9 +199,9 @@ void Matrix::createBillboardHelper(const Vector3& objectPosition, const Vector3& } } -// void Matrix::createReflection(const Plane& plane, Matrix* dst) +// void Mat4::createReflection(const Plane& plane, Mat4* dst) // { -// Vector3 normal(plane.getNormal()); +// Vec3 normal(plane.getNormal()); // float k = -2.0f * plane.getDistance(); // dst->setIdentity(); @@ -218,7 +218,7 @@ void Matrix::createBillboardHelper(const Vector3& objectPosition, const Vector3& // dst->m[11] = k * normal.z; // } -void Matrix::createScale(const Vector3& scale, Matrix* dst) +void Mat4::createScale(const Vec3& scale, Mat4* dst) { GP_ASSERT(dst); @@ -229,7 +229,7 @@ void Matrix::createScale(const Vector3& scale, Matrix* dst) dst->m[10] = scale.z; } -void Matrix::createScale(float xScale, float yScale, float zScale, Matrix* dst) +void Mat4::createScale(float xScale, float yScale, float zScale, Mat4* dst) { GP_ASSERT(dst); @@ -241,7 +241,7 @@ void Matrix::createScale(float xScale, float yScale, float zScale, Matrix* dst) } -void Matrix::createRotation(const Quaternion& q, Matrix* dst) +void Mat4::createRotation(const Quaternion& q, Mat4* dst) { GP_ASSERT(dst); @@ -280,7 +280,7 @@ void Matrix::createRotation(const Quaternion& q, Matrix* dst) dst->m[15] = 1.0f; } -void Matrix::createRotation(const Vector3& axis, float angle, Matrix* dst) +void Mat4::createRotation(const Vec3& axis, float angle, Mat4* dst) { GP_ASSERT(dst); @@ -339,7 +339,7 @@ void Matrix::createRotation(const Vector3& axis, float angle, Matrix* dst) dst->m[15] = 1.0f; } -void Matrix::createRotationX(float angle, Matrix* dst) +void Mat4::createRotationX(float angle, Mat4* dst) { GP_ASSERT(dst); @@ -354,7 +354,7 @@ void Matrix::createRotationX(float angle, Matrix* dst) dst->m[10] = c; } -void Matrix::createRotationY(float angle, Matrix* dst) +void Mat4::createRotationY(float angle, Mat4* dst) { GP_ASSERT(dst); @@ -369,7 +369,7 @@ void Matrix::createRotationY(float angle, Matrix* dst) dst->m[10] = c; } -void Matrix::createRotationZ(float angle, Matrix* dst) +void Mat4::createRotationZ(float angle, Mat4* dst) { GP_ASSERT(dst); @@ -384,7 +384,7 @@ void Matrix::createRotationZ(float angle, Matrix* dst) dst->m[5] = c; } -void Matrix::createTranslation(const Vector3& translation, Matrix* dst) +void Mat4::createTranslation(const Vec3& translation, Mat4* dst) { GP_ASSERT(dst); @@ -395,7 +395,7 @@ void Matrix::createTranslation(const Vector3& translation, Matrix* dst) dst->m[14] = translation.z; } -void Matrix::createTranslation(float xTranslation, float yTranslation, float zTranslation, Matrix* dst) +void Mat4::createTranslation(float xTranslation, float yTranslation, float zTranslation, Mat4* dst) { GP_ASSERT(dst); @@ -406,31 +406,31 @@ void Matrix::createTranslation(float xTranslation, float yTranslation, float zTr dst->m[14] = zTranslation; } -void Matrix::add(float scalar) +void Mat4::add(float scalar) { add(scalar, this); } -void Matrix::add(float scalar, Matrix* dst) +void Mat4::add(float scalar, Mat4* dst) { GP_ASSERT(dst); MathUtil::addMatrix(m, scalar, dst->m); } -void Matrix::add(const Matrix& mat) +void Mat4::add(const Mat4& mat) { add(*this, mat, this); } -void Matrix::add(const Matrix& m1, const Matrix& m2, Matrix* dst) +void Mat4::add(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::addMatrix(m1.m, m2.m, dst->m); } -bool Matrix::decompose(Vector3* scale, Quaternion* rotation, Vector3* translation) const +bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const { if (translation) { @@ -446,13 +446,13 @@ bool Matrix::decompose(Vector3* scale, Quaternion* rotation, Vector3* translatio // Extract the scale. // This is simply the length of each axis (row/column) in the matrix. - Vector3 xaxis(m[0], m[1], m[2]); + Vec3 xaxis(m[0], m[1], m[2]); float scaleX = xaxis.length(); - Vector3 yaxis(m[4], m[5], m[6]); + Vec3 yaxis(m[4], m[5], m[6]); float scaleY = yaxis.length(); - Vector3 zaxis(m[8], m[9], m[10]); + Vec3 zaxis(m[8], m[9], m[10]); float scaleZ = zaxis.length(); // Determine if we have a negative scale (true if determinant is less than zero). @@ -538,7 +538,7 @@ bool Matrix::decompose(Vector3* scale, Quaternion* rotation, Vector3* translatio return true; } -float Matrix::determinant() const +float Mat4::determinant() const { float a0 = m[0] * m[5] - m[1] * m[4]; float a1 = m[0] * m[6] - m[2] * m[4]; @@ -557,22 +557,22 @@ float Matrix::determinant() const return (a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0); } -void Matrix::getScale(Vector3* scale) const +void Mat4::getScale(Vec3* scale) const { decompose(scale, NULL, NULL); } -bool Matrix::getRotation(Quaternion* rotation) const +bool Mat4::getRotation(Quaternion* rotation) const { return decompose(NULL, rotation, NULL); } -void Matrix::getTranslation(Vector3* translation) const +void Mat4::getTranslation(Vec3* translation) const { decompose(NULL, NULL, translation); } -void Matrix::getUpVector(Vector3* dst) const +void Mat4::getUpVector(Vec3* dst) const { GP_ASSERT(dst); @@ -581,7 +581,7 @@ void Matrix::getUpVector(Vector3* dst) const dst->z = m[6]; } -void Matrix::getDownVector(Vector3* dst) const +void Mat4::getDownVector(Vec3* dst) const { GP_ASSERT(dst); @@ -590,7 +590,7 @@ void Matrix::getDownVector(Vector3* dst) const dst->z = -m[6]; } -void Matrix::getLeftVector(Vector3* dst) const +void Mat4::getLeftVector(Vec3* dst) const { GP_ASSERT(dst); @@ -599,7 +599,7 @@ void Matrix::getLeftVector(Vector3* dst) const dst->z = -m[2]; } -void Matrix::getRightVector(Vector3* dst) const +void Mat4::getRightVector(Vec3* dst) const { GP_ASSERT(dst); @@ -608,7 +608,7 @@ void Matrix::getRightVector(Vector3* dst) const dst->z = m[2]; } -void Matrix::getForwardVector(Vector3* dst) const +void Mat4::getForwardVector(Vec3* dst) const { GP_ASSERT(dst); @@ -617,7 +617,7 @@ void Matrix::getForwardVector(Vector3* dst) const dst->z = -m[10]; } -void Matrix::getBackVector(Vector3* dst) const +void Mat4::getBackVector(Vec3* dst) const { GP_ASSERT(dst); @@ -626,14 +626,14 @@ void Matrix::getBackVector(Vector3* dst) const dst->z = m[10]; } -Matrix Matrix::getInversed() const +Mat4 Mat4::getInversed() const { - Matrix mat(*this); + Mat4 mat(*this); mat.inverse(); return mat; } -bool Matrix::inverse() +bool Mat4::inverse() { float a0 = m[0] * m[5] - m[1] * m[4]; float a1 = m[0] * m[6] - m[2] * m[4]; @@ -656,7 +656,7 @@ bool Matrix::inverse() return false; // Support the case where m == dst. - Matrix inverse; + Mat4 inverse; inverse.m[0] = m[5] * b5 - m[6] * b4 + m[7] * b3; inverse.m[1] = -m[1] * b5 + m[2] * b4 - m[3] * b3; inverse.m[2] = m[13] * a5 - m[14] * a4 + m[15] * a3; @@ -682,145 +682,145 @@ bool Matrix::inverse() return true; } -bool Matrix::isIdentity() const +bool Mat4::isIdentity() const { return (memcmp(m, &IDENTITY, MATRIX_SIZE) == 0); } -void Matrix::multiply(float scalar) +void Mat4::multiply(float scalar) { multiply(scalar, this); } -void Matrix::multiply(float scalar, Matrix* dst) const +void Mat4::multiply(float scalar, Mat4* dst) const { multiply(*this, scalar, dst); } -void Matrix::multiply(const Matrix& m, float scalar, Matrix* dst) +void Mat4::multiply(const Mat4& m, float scalar, Mat4* dst) { GP_ASSERT(dst); MathUtil::multiplyMatrix(m.m, scalar, dst->m); } -void Matrix::multiply(const Matrix& mat) +void Mat4::multiply(const Mat4& mat) { multiply(*this, mat, this); } -void Matrix::multiply(const Matrix& m1, const Matrix& m2, Matrix* dst) +void Mat4::multiply(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::multiplyMatrix(m1.m, m2.m, dst->m); } -void Matrix::negate() +void Mat4::negate() { MathUtil::negateMatrix(m, m); } -Matrix Matrix::getNegated() const +Mat4 Mat4::getNegated() const { - Matrix mat(*this); + Mat4 mat(*this); mat.negate(); return mat; } -void Matrix::rotate(const Quaternion& q) +void Mat4::rotate(const Quaternion& q) { rotate(q, this); } -void Matrix::rotate(const Quaternion& q, Matrix* dst) const +void Mat4::rotate(const Quaternion& q, Mat4* dst) const { - Matrix r; + Mat4 r; createRotation(q, &r); multiply(*this, r, dst); } -void Matrix::rotate(const Vector3& axis, float angle) +void Mat4::rotate(const Vec3& axis, float angle) { rotate(axis, angle, this); } -void Matrix::rotate(const Vector3& axis, float angle, Matrix* dst) const +void Mat4::rotate(const Vec3& axis, float angle, Mat4* dst) const { - Matrix r; + Mat4 r; createRotation(axis, angle, &r); multiply(*this, r, dst); } -void Matrix::rotateX(float angle) +void Mat4::rotateX(float angle) { rotateX(angle, this); } -void Matrix::rotateX(float angle, Matrix* dst) const +void Mat4::rotateX(float angle, Mat4* dst) const { - Matrix r; + Mat4 r; createRotationX(angle, &r); multiply(*this, r, dst); } -void Matrix::rotateY(float angle) +void Mat4::rotateY(float angle) { rotateY(angle, this); } -void Matrix::rotateY(float angle, Matrix* dst) const +void Mat4::rotateY(float angle, Mat4* dst) const { - Matrix r; + Mat4 r; createRotationY(angle, &r); multiply(*this, r, dst); } -void Matrix::rotateZ(float angle) +void Mat4::rotateZ(float angle) { rotateZ(angle, this); } -void Matrix::rotateZ(float angle, Matrix* dst) const +void Mat4::rotateZ(float angle, Mat4* dst) const { - Matrix r; + Mat4 r; createRotationZ(angle, &r); multiply(*this, r, dst); } -void Matrix::scale(float value) +void Mat4::scale(float value) { scale(value, this); } -void Matrix::scale(float value, Matrix* dst) const +void Mat4::scale(float value, Mat4* dst) const { scale(value, value, value, dst); } -void Matrix::scale(float xScale, float yScale, float zScale) +void Mat4::scale(float xScale, float yScale, float zScale) { scale(xScale, yScale, zScale, this); } -void Matrix::scale(float xScale, float yScale, float zScale, Matrix* dst) const +void Mat4::scale(float xScale, float yScale, float zScale, Mat4* dst) const { - Matrix s; + Mat4 s; createScale(xScale, yScale, zScale, &s); multiply(*this, s, dst); } -void Matrix::scale(const Vector3& s) +void Mat4::scale(const Vec3& s) { scale(s.x, s.y, s.z, this); } -void Matrix::scale(const Vector3& s, Matrix* dst) const +void Mat4::scale(const Vec3& s, Mat4* dst) const { scale(s.x, s.y, s.z, dst); } -void Matrix::set(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, +void Mat4::set(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) { m[0] = m11; @@ -841,122 +841,122 @@ void Matrix::set(float m11, float m12, float m13, float m14, float m21, float m2 m[15] = m44; } -void Matrix::set(const float* mat) +void Mat4::set(const float* mat) { GP_ASSERT(mat); memcpy(this->m, mat, MATRIX_SIZE); } -void Matrix::set(const Matrix& mat) +void Mat4::set(const Mat4& mat) { memcpy(this->m, mat.m, MATRIX_SIZE); } -void Matrix::setIdentity() +void Mat4::setIdentity() { memcpy(m, &IDENTITY, MATRIX_SIZE); } -void Matrix::setZero() +void Mat4::setZero() { memset(m, 0, MATRIX_SIZE); } -void Matrix::subtract(const Matrix& mat) +void Mat4::subtract(const Mat4& mat) { subtract(*this, mat, this); } -void Matrix::subtract(const Matrix& m1, const Matrix& m2, Matrix* dst) +void Mat4::subtract(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::subtractMatrix(m1.m, m2.m, dst->m); } -void Matrix::transformPoint(Vector3* point) const +void Mat4::transformPoint(Vec3* point) const { GP_ASSERT(point); transformVector(point->x, point->y, point->z, 1.0f, point); } -void Matrix::transformPoint(const Vector3& point, Vector3* dst) const +void Mat4::transformPoint(const Vec3& point, Vec3* dst) const { transformVector(point.x, point.y, point.z, 1.0f, dst); } -void Matrix::transformVector(Vector3* vector) const +void Mat4::transformVector(Vec3* vector) const { GP_ASSERT(vector); transformVector(vector->x, vector->y, vector->z, 0.0f, vector); } -void Matrix::transformVector(const Vector3& vector, Vector3* dst) const +void Mat4::transformVector(const Vec3& vector, Vec3* dst) const { transformVector(vector.x, vector.y, vector.z, 0.0f, dst); } -void Matrix::transformVector(float x, float y, float z, float w, Vector3* dst) const +void Mat4::transformVector(float x, float y, float z, float w, Vec3* dst) const { GP_ASSERT(dst); - MathUtil::transformVector4(m, x, y, z, w, (float*)dst); + MathUtil::transformVec4(m, x, y, z, w, (float*)dst); } -void Matrix::transformVector(Vector4* vector) const +void Mat4::transformVector(Vec4* vector) const { GP_ASSERT(vector); transformVector(*vector, vector); } -void Matrix::transformVector(const Vector4& vector, Vector4* dst) const +void Mat4::transformVector(const Vec4& vector, Vec4* dst) const { GP_ASSERT(dst); - MathUtil::transformVector4(m, (const float*) &vector, (float*)dst); + MathUtil::transformVec4(m, (const float*) &vector, (float*)dst); } -void Matrix::translate(float x, float y, float z) +void Mat4::translate(float x, float y, float z) { translate(x, y, z, this); } -void Matrix::translate(float x, float y, float z, Matrix* dst) const +void Mat4::translate(float x, float y, float z, Mat4* dst) const { - Matrix t; + Mat4 t; createTranslation(x, y, z, &t); multiply(*this, t, dst); } -void Matrix::translate(const Vector3& t) +void Mat4::translate(const Vec3& t) { translate(t.x, t.y, t.z, this); } -void Matrix::translate(const Vector3& t, Matrix* dst) const +void Mat4::translate(const Vec3& t, Mat4* dst) const { translate(t.x, t.y, t.z, dst); } -void Matrix::transpose() +void Mat4::transpose() { MathUtil::transposeMatrix(m, m); } -Matrix Matrix::getTransposed() const +Mat4 Mat4::getTransposed() const { - Matrix mat(*this); + Mat4 mat(*this); mat.transpose(); return mat; } -const Matrix Matrix::IDENTITY = Matrix( +const Mat4 Mat4::IDENTITY = Mat4( 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); -const Matrix Matrix::ZERO = Matrix( +const Mat4 Mat4::ZERO = Mat4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/cocos/math/Matrix.h b/cocos/math/Matrix.h index 4ee9f927ee..1513599f53 100644 --- a/cocos/math/Matrix.h +++ b/cocos/math/Matrix.h @@ -18,11 +18,11 @@ This file was modified to fit the cocos2d-x project */ -#ifndef MATRIX_H_ -#define MATRIX_H_ +#ifndef MATH_MAT4_H +#define MATH_MAT4_H -#include "Vector3.h" -#include "Vector4.h" +#include "math/Vector3.h" +#include "math/Vector4.h" NS_CC_MATH_BEGIN @@ -59,7 +59,7 @@ NS_CC_MATH_BEGIN * * @see Transform */ -class Matrix +class Mat4 { public: // //temp add conversion @@ -70,7 +70,7 @@ public: // return result; // } - // Matrix(const kmMat4& mat) + // Mat4(const kmMat4& mat) // { // set(mat.mat); // } @@ -87,7 +87,7 @@ public: * 0 0 1 0 * 0 0 0 1 */ - Matrix(); + Mat4(); /** * Constructs a matrix initialized to the specified value. @@ -109,7 +109,7 @@ public: * @param m43 The third element of the fourth row. * @param m44 The fourth element of the fourth row. */ - Matrix(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, + Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44); /** @@ -124,19 +124,19 @@ public: * * @param mat An array containing 16 elements in column-major order. */ - Matrix(const float* mat); + Mat4(const float* mat); /** * Constructs a new matrix by copying the values from the specified matrix. * * @param copy The matrix to copy. */ - Matrix(const Matrix& copy); + Mat4(const Mat4& copy); /** * Destructor. */ - ~Matrix(); + ~Mat4(); /** * Creates a view matrix based on the specified input parameters. @@ -146,7 +146,7 @@ public: * @param up The up vector. * @param dst A matrix to store the result in. */ - static void createLookAt(const Vector3& eyePosition, const Vector3& targetPosition, const Vector3& up, Matrix* dst); + static void createLookAt(const Vec3& eyePosition, const Vec3& targetPosition, const Vec3& up, Mat4* dst); /** * Creates a view matrix based on the specified input parameters. @@ -164,7 +164,7 @@ public: */ static void createLookAt(float eyePositionX, float eyePositionY, float eyePositionZ, float targetCenterX, float targetCenterY, float targetCenterZ, - float upX, float upY, float upZ, Matrix* dst); + float upX, float upY, float upZ, Mat4* dst); /** * Builds a perspective projection matrix based on a field of view and returns by value. @@ -180,7 +180,7 @@ public: * @param zFarPlane The distance to the far view plane. * @param dst A matrix to store the result in. */ - static void createPerspective(float fieldOfView, float aspectRatio, float zNearPlane, float zFarPlane, Matrix* dst); + static void createPerspective(float fieldOfView, float aspectRatio, float zNearPlane, float zFarPlane, Mat4* dst); /** * Creates an orthographic projection matrix. @@ -191,7 +191,7 @@ public: * @param zFarPlane The maximum z-value of the view volume. * @param dst A matrix to store the result in. */ - static void createOrthographic(float width, float height, float zNearPlane, float zFarPlane, Matrix* dst); + static void createOrthographic(float width, float height, float zNearPlane, float zFarPlane, Mat4* dst); /** * Creates an orthographic projection matrix. @@ -222,7 +222,7 @@ public: * @param dst A matrix to store the result in. */ static void createOrthographicOffCenter(float left, float right, float bottom, float top, - float zNearPlane, float zFarPlane, Matrix* dst); + float zNearPlane, float zFarPlane, Mat4* dst); /** * Creates a spherical billboard that rotates around a specified object position. @@ -238,8 +238,8 @@ public: * @param cameraUpVector The up vector of the camera. * @param dst A matrix to store the result in. */ - static void createBillboard(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, Matrix* dst); + static void createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, Mat4* dst); /** * Creates a spherical billboard that rotates around a specified object position with @@ -257,17 +257,17 @@ public: * @param cameraForwardVector The forward vector of the camera, used if the positions are too close. * @param dst A matrix to store the result in. */ - static void createBillboard(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, const Vector3& cameraForwardVector, - Matrix* dst); + static void createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, const Vec3& cameraForwardVector, + Mat4* dst); /** - * Fills in an existing Matrix so that it reflects the coordinate system about a specified Plane. + * Fills in an existing Mat4 so that it reflects the coordinate system about a specified Plane. * * @param plane The Plane about which to create a reflection. * @param dst A matrix to store the result in. */ - //static void createReflection(const Plane& plane, Matrix* dst); + //static void createReflection(const Plane& plane, Mat4* dst); /** * Creates a scale matrix. @@ -275,7 +275,7 @@ public: * @param scale The amount to scale. * @param dst A matrix to store the result in. */ - static void createScale(const Vector3& scale, Matrix* dst); + static void createScale(const Vec3& scale, Mat4* dst); /** * Creates a scale matrix. @@ -285,7 +285,7 @@ public: * @param zScale The amount to scale along the z-axis. * @param dst A matrix to store the result in. */ - static void createScale(float xScale, float yScale, float zScale, Matrix* dst); + static void createScale(float xScale, float yScale, float zScale, Mat4* dst); /** * Creates a rotation matrix from the specified quaternion. @@ -293,7 +293,7 @@ public: * @param quat A quaternion describing a 3D orientation. * @param dst A matrix to store the result in. */ - static void createRotation(const Quaternion& quat, Matrix* dst); + static void createRotation(const Quaternion& quat, Mat4* dst); /** * Creates a rotation matrix from the specified axis and angle. @@ -302,7 +302,7 @@ public: * @param angle The angle (in radians). * @param dst A matrix to store the result in. */ - static void createRotation(const Vector3& axis, float angle, Matrix* dst); + static void createRotation(const Vec3& axis, float angle, Mat4* dst); /** * Creates a matrix describing a rotation around the x-axis. @@ -310,7 +310,7 @@ public: * @param angle The angle of rotation (in radians). * @param dst A matrix to store the result in. */ - static void createRotationX(float angle, Matrix* dst); + static void createRotationX(float angle, Mat4* dst); /** * Creates a matrix describing a rotation around the y-axis. @@ -318,7 +318,7 @@ public: * @param angle The angle of rotation (in radians). * @param dst A matrix to store the result in. */ - static void createRotationY(float angle, Matrix* dst); + static void createRotationY(float angle, Mat4* dst); /** * Creates a matrix describing a rotation around the z-axis. @@ -326,7 +326,7 @@ public: * @param angle The angle of rotation (in radians). * @param dst A matrix to store the result in. */ - static void createRotationZ(float angle, Matrix* dst); + static void createRotationZ(float angle, Mat4* dst); /** * Creates a translation matrix. @@ -334,7 +334,7 @@ public: * @param translation The translation. * @param dst A matrix to store the result in. */ - static void createTranslation(const Vector3& translation, Matrix* dst); + static void createTranslation(const Vec3& translation, Mat4* dst); /** * Creates a translation matrix. @@ -344,7 +344,7 @@ public: * @param zTranslation The translation on the z-axis. * @param dst A matrix to store the result in. */ - static void createTranslation(float xTranslation, float yTranslation, float zTranslation, Matrix* dst); + static void createTranslation(float xTranslation, float yTranslation, float zTranslation, Mat4* dst); /** * Adds a scalar value to each component of this matrix. @@ -359,14 +359,14 @@ public: * @param scalar The scalar value to add. * @param dst A matrix to store the result in. */ - void add(float scalar, Matrix* dst); + void add(float scalar, Mat4* dst); /** * Adds the specified matrix to this matrix. * * @param mat The matrix to add. */ - void add(const Matrix& mat); + void add(const Mat4& mat); /** * Adds the specified matrices and stores the result in dst. @@ -375,7 +375,7 @@ public: * @param m2 The second matrix. * @param dst The destination matrix to add to. */ - static void add(const Matrix& m1, const Matrix& m2, Matrix* dst); + static void add(const Mat4& m1, const Mat4& m2, Mat4* dst); /** * Decomposes the scale, rotation and translation components of this matrix. @@ -384,7 +384,7 @@ public: * @param rotation The rotation. * @param translation The translation. */ - bool decompose(Vector3* scale, Quaternion* rotation, Vector3* translation) const; + bool decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const; /** * Computes the determinant of this matrix. @@ -403,7 +403,7 @@ public: * * @param scale A vector to receive the scale. */ - void getScale(Vector3* scale) const; + void getScale(Vec3* scale) const; /** * Gets the rotational component of this matrix in the specified quaternion. @@ -419,49 +419,49 @@ public: * * @param translation A vector to receive the translation. */ - void getTranslation(Vector3* translation) const; + void getTranslation(Vec3* translation) const; /** * Gets the up vector of this matrix. * * @param dst The destination vector. */ - void getUpVector(Vector3* dst) const; + void getUpVector(Vec3* dst) const; /** * Gets the down vector of this matrix. * * @param dst The destination vector. */ - void getDownVector(Vector3* dst) const; + void getDownVector(Vec3* dst) const; /** * Gets the left vector of this matrix. * * @param dst The destination vector. */ - void getLeftVector(Vector3* dst) const; + void getLeftVector(Vec3* dst) const; /** * Gets the right vector of this matrix. * * @param dst The destination vector. */ - void getRightVector(Vector3* dst) const; + void getRightVector(Vec3* dst) const; /** * Gets the forward vector of this matrix. * * @param dst The destination vector. */ - void getForwardVector(Vector3* dst) const; + void getForwardVector(Vec3* dst) const; /** * Gets the backward vector of this matrix. * * @param dst The destination vector. */ - void getBackVector(Vector3* dst) const; + void getBackVector(Vec3* dst) const; /** * Inverts this matrix. @@ -477,7 +477,7 @@ public: * * @return true if the the matrix can be inverted, false otherwise. */ - Matrix getInversed() const; + Mat4 getInversed() const; /** * Determines if this matrix is equal to the identity matrix. @@ -499,7 +499,7 @@ public: * @param scalar The scalar value. * @param dst A matrix to store the result in. */ - void multiply(float scalar, Matrix* dst) const; + void multiply(float scalar, Mat4* dst) const; /** * Multiplies the components of the specified matrix by a scalar and stores the result in dst. @@ -508,14 +508,14 @@ public: * @param scalar The scalar value. * @param dst A matrix to store the result in. */ - static void multiply(const Matrix& mat, float scalar, Matrix* dst); + static void multiply(const Mat4& mat, float scalar, Mat4* dst); /** * Multiplies this matrix by the specified one. * * @param mat The matrix to multiply. */ - void multiply(const Matrix& mat); + void multiply(const Mat4& mat); /** * Multiplies m1 by m2 and stores the result in dst. @@ -524,7 +524,7 @@ public: * @param m2 The second matrix to multiply. * @param dst A matrix to store the result in. */ - static void multiply(const Matrix& m1, const Matrix& m2, Matrix* dst); + static void multiply(const Mat4& m1, const Mat4& m2, Mat4* dst); /** * Negates this matrix. @@ -536,7 +536,7 @@ public: * * @param dst A matrix to store the result in. */ - Matrix getNegated() const; + Mat4 getNegated() const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -553,7 +553,7 @@ public: * @param q The quaternion to rotate by. * @param dst A matrix to store the result in. */ - void rotate(const Quaternion& q, Matrix* dst) const; + void rotate(const Quaternion& q, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -562,7 +562,7 @@ public: * @param axis The axis to rotate about. * @param angle The angle (in radians). */ - void rotate(const Vector3& axis, float angle); + void rotate(const Vec3& axis, float angle); /** * Post-multiplies this matrix by the matrix corresponding to the specified @@ -572,7 +572,7 @@ public: * @param angle The angle (in radians). * @param dst A matrix to store the result in. */ - void rotate(const Vector3& axis, float angle, Matrix* dst) const; + void rotate(const Vec3& axis, float angle, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -589,7 +589,7 @@ public: * @param angle The angle (in radians). * @param dst A matrix to store the result in. */ - void rotateX(float angle, Matrix* dst) const; + void rotateX(float angle, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -606,7 +606,7 @@ public: * @param angle The angle (in radians). * @param dst A matrix to store the result in. */ - void rotateY(float angle, Matrix* dst) const; + void rotateY(float angle, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -623,7 +623,7 @@ public: * @param angle The angle (in radians). * @param dst A matrix to store the result in. */ - void rotateZ(float angle, Matrix* dst) const; + void rotateZ(float angle, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -640,7 +640,7 @@ public: * @param value The amount to scale along all axes. * @param dst A matrix to store the result in. */ - void scale(float value, Matrix* dst) const; + void scale(float value, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -661,7 +661,7 @@ public: * @param zScale The amount to scale along the z-axis. * @param dst A matrix to store the result in. */ - void scale(float xScale, float yScale, float zScale, Matrix* dst) const; + void scale(float xScale, float yScale, float zScale, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -669,7 +669,7 @@ public: * * @param s The scale values along the x, y and z axes. */ - void scale(const Vector3& s); + void scale(const Vec3& s); /** * Post-multiplies this matrix by the matrix corresponding to the @@ -678,7 +678,7 @@ public: * @param s The scale values along the x, y and z axes. * @param dst A matrix to store the result in. */ - void scale(const Vector3& s, Matrix* dst) const; + void scale(const Vec3& s, Mat4* dst) const; /** * Sets the values of this matrix. @@ -715,7 +715,7 @@ public: * * @param mat The source matrix. */ - void set(const Matrix& mat); + void set(const Mat4& mat); /** * Sets this matrix to the identity matrix. @@ -732,7 +732,7 @@ public: * * @param mat The matrix to subtract. */ - void subtract(const Matrix& mat); + void subtract(const Mat4& mat); /** * Subtracts the specified matrix from the current matrix. @@ -741,7 +741,7 @@ public: * @param m2 The second matrix. * @param dst A matrix to store the result in. */ - static void subtract(const Matrix& m1, const Matrix& m2, Matrix* dst); + static void subtract(const Mat4& m1, const Mat4& m2, Mat4* dst); /** * Transforms the specified point by this matrix. @@ -750,7 +750,7 @@ public: * * @param point The point to transform and also a vector to hold the result in. */ - void transformPoint(Vector3* point) const; + void transformPoint(Vec3* point) const; /** * Transforms the specified point by this matrix, and stores @@ -759,7 +759,7 @@ public: * @param point The point to transform. * @param dst A vector to store the transformed point in. */ - void transformPoint(const Vector3& point, Vector3* dst) const; + void transformPoint(const Vec3& point, Vec3* dst) const; /** * Transforms the specified vector by this matrix by @@ -769,7 +769,7 @@ public: * * @param vector The vector to transform and also a vector to hold the result in. */ - void transformVector(Vector3* vector) const; + void transformVector(Vec3* vector) const; /** * Transforms the specified vector by this matrix by @@ -779,7 +779,7 @@ public: * @param vector The vector to transform. * @param dst A vector to store the transformed vector in. */ - void transformVector(const Vector3& vector, Vector3* dst) const; + void transformVector(const Vec3& vector, Vec3* dst) const; /** * Transforms the specified vector by this matrix. @@ -790,7 +790,7 @@ public: * @param w The vector w-coordinate to transform by. * @param dst A vector to store the transformed point in. */ - void transformVector(float x, float y, float z, float w, Vector3* dst) const; + void transformVector(float x, float y, float z, float w, Vec3* dst) const; /** * Transforms the specified vector by this matrix. @@ -799,7 +799,7 @@ public: * * @param vector The vector to transform. */ - void transformVector(Vector4* vector) const; + void transformVector(Vec4* vector) const; /** * Transforms the specified vector by this matrix. @@ -807,7 +807,7 @@ public: * @param vector The vector to transform. * @param dst A vector to store the transformed point in. */ - void transformVector(const Vector4& vector, Vector4* dst) const; + void transformVector(const Vec4& vector, Vec4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -828,7 +828,7 @@ public: * @param z The amount to translate along the z-axis. * @param dst A matrix to store the result in. */ - void translate(float x, float y, float z, Matrix* dst) const; + void translate(float x, float y, float z, Mat4* dst) const; /** * Post-multiplies this matrix by the matrix corresponding to the @@ -836,7 +836,7 @@ public: * * @param t The translation values along the x, y and z axes. */ - void translate(const Vector3& t); + void translate(const Vec3& t); /** * Post-multiplies this matrix by the matrix corresponding to the @@ -845,7 +845,7 @@ public: * @param t The translation values along the x, y and z axes. * @param dst A matrix to store the result in. */ - void translate(const Vector3& t, Matrix* dst) const; + void translate(const Vec3& t, Mat4* dst) const; /** * Transposes this matrix. @@ -857,7 +857,7 @@ public: * * @param dst A matrix to store the result in. */ - Matrix getTransposed() const; + Mat4 getTransposed() const; /** * Calculates the sum of this matrix with the given matrix. @@ -867,7 +867,7 @@ public: * @param mat The matrix to add. * @return The matrix sum. */ - inline const Matrix operator+(const Matrix& mat) const; + inline const Mat4 operator+(const Mat4& mat) const; /** * Adds the given matrix to this matrix. @@ -875,7 +875,7 @@ public: * @param mat The matrix to add. * @return This matrix, after the addition occurs. */ - inline Matrix& operator+=(const Matrix& mat); + inline Mat4& operator+=(const Mat4& mat); /** * Calculates the difference of this matrix with the given matrix. @@ -885,7 +885,7 @@ public: * @param mat The matrix to subtract. * @return The matrix difference. */ - inline const Matrix operator-(const Matrix& mat) const; + inline const Mat4 operator-(const Mat4& mat) const; /** * Subtracts the given matrix from this matrix. @@ -893,7 +893,7 @@ public: * @param mat The matrix to subtract. * @return This matrix, after the subtraction occurs. */ - inline Matrix& operator-=(const Matrix& mat); + inline Mat4& operator-=(const Mat4& mat); /** * Calculates the negation of this matrix. @@ -902,7 +902,7 @@ public: * * @return The negation of this matrix. */ - inline const Matrix operator-() const; + inline const Mat4 operator-() const; /** * Calculates the matrix product of this matrix with the given matrix. @@ -912,7 +912,7 @@ public: * @param mat The matrix to multiply by. * @return The matrix product. */ - inline const Matrix operator*(const Matrix& mat) const; + inline const Mat4 operator*(const Mat4& mat) const; /** * Right-multiplies this matrix by the given matrix. @@ -920,18 +920,18 @@ public: * @param mat The matrix to multiply by. * @return This matrix, after the multiplication occurs. */ - inline Matrix& operator*=(const Matrix& mat); + inline Mat4& operator*=(const Mat4& mat); /** equals to a matrix full of zeros */ - static const Matrix ZERO; + static const Mat4 ZERO; /** equals to the identity matrix */ - static const Matrix IDENTITY; + static const Mat4 IDENTITY; private: - static void createBillboardHelper(const Vector3& objectPosition, const Vector3& cameraPosition, - const Vector3& cameraUpVector, const Vector3* cameraForwardVector, - Matrix* dst); + static void createBillboardHelper(const Vec3& objectPosition, const Vec3& cameraPosition, + const Vec3& cameraUpVector, const Vec3* cameraForwardVector, + Mat4* dst); }; /** @@ -943,7 +943,7 @@ private: * @param m The matrix to transform by. * @return This vector, after the transformation occurs. */ -inline Vector3& operator*=(Vector3& v, const Matrix& m); +inline Vec3& operator*=(Vec3& v, const Mat4& m); /** * Transforms the given vector by the given matrix. @@ -954,7 +954,7 @@ inline Vector3& operator*=(Vector3& v, const Matrix& m); * @param v The vector to transform. * @return The resulting transformed vector. */ -inline const Vector3 operator*(const Matrix& m, const Vector3& v); +inline const Vec3 operator*(const Mat4& m, const Vec3& v); /** * Transforms the given vector by the given matrix. @@ -965,7 +965,7 @@ inline const Vector3 operator*(const Matrix& m, const Vector3& v); * @param m The matrix to transform by. * @return This vector, after the transformation occurs. */ -inline Vector4& operator*=(Vector4& v, const Matrix& m); +inline Vec4& operator*=(Vec4& v, const Mat4& m); /** * Transforms the given vector by the given matrix. @@ -976,10 +976,10 @@ inline Vector4& operator*=(Vector4& v, const Matrix& m); * @param v The vector to transform. * @return The resulting transformed vector. */ -inline const Vector4 operator*(const Matrix& m, const Vector4& v); +inline const Vec4 operator*(const Mat4& m, const Vec4& v); NS_CC_MATH_END #include "Matrix.inl" -#endif +#endif // MATH_MAT4_H diff --git a/cocos/math/Matrix.inl b/cocos/math/Matrix.inl index 44e305e666..3ae3fc8c2d 100644 --- a/cocos/math/Matrix.inl +++ b/cocos/math/Matrix.inl @@ -22,74 +22,74 @@ NS_CC_MATH_BEGIN -inline const Matrix Matrix::operator+(const Matrix& mat) const +inline const Mat4 Mat4::operator+(const Mat4& mat) const { - Matrix result(*this); + Mat4 result(*this); result.add(mat); return result; } -inline Matrix& Matrix::operator+=(const Matrix& mat) +inline Mat4& Mat4::operator+=(const Mat4& mat) { add(mat); return *this; } -inline const Matrix Matrix::operator-(const Matrix& mat) const +inline const Mat4 Mat4::operator-(const Mat4& mat) const { - Matrix result(*this); + Mat4 result(*this); result.subtract(mat); return result; } -inline Matrix& Matrix::operator-=(const Matrix& mat) +inline Mat4& Mat4::operator-=(const Mat4& mat) { subtract(mat); return *this; } -inline const Matrix Matrix::operator-() const +inline const Mat4 Mat4::operator-() const { - Matrix mat(*this); + Mat4 mat(*this); mat.negate(); return mat; } -inline const Matrix Matrix::operator*(const Matrix& mat) const +inline const Mat4 Mat4::operator*(const Mat4& mat) const { - Matrix result(*this); + Mat4 result(*this); result.multiply(mat); return result; } -inline Matrix& Matrix::operator*=(const Matrix& mat) +inline Mat4& Mat4::operator*=(const Mat4& mat) { multiply(mat); return *this; } -inline Vector3& operator*=(Vector3& v, const Matrix& m) +inline Vec3& operator*=(Vec3& v, const Mat4& m) { m.transformVector(&v); return v; } -inline const Vector3 operator*(const Matrix& m, const Vector3& v) +inline const Vec3 operator*(const Mat4& m, const Vec3& v) { - Vector3 x; + Vec3 x; m.transformVector(v, &x); return x; } -inline Vector4& operator*=(Vector4& v, const Matrix& m) +inline Vec4& operator*=(Vec4& v, const Mat4& m) { m.transformVector(&v); return v; } -inline const Vector4 operator*(const Matrix& m, const Vector4& v) +inline const Vec4 operator*(const Mat4& m, const Vec4& v) { - Vector4 x; + Vec4 x; m.transformVector(v, &x); return x; } diff --git a/cocos/math/Quaternion.cpp b/cocos/math/Quaternion.cpp index da96e294d4..36089ee011 100644 --- a/cocos/math/Quaternion.cpp +++ b/cocos/math/Quaternion.cpp @@ -38,12 +38,12 @@ Quaternion::Quaternion(float* array) set(array); } -Quaternion::Quaternion(const Matrix& m) +Quaternion::Quaternion(const Mat4& m) { set(m); } -Quaternion::Quaternion(const Vector3& axis, float angle) +Quaternion::Quaternion(const Vec3& axis, float angle) { set(axis, angle); } @@ -79,19 +79,19 @@ bool Quaternion::isZero() const return x == 0.0f && y == 0.0f && z == 0.0f && w == 0.0f; } -void Quaternion::createFromRotationMatrix(const Matrix& m, Quaternion* dst) +void Quaternion::createFromRotationMatrix(const Mat4& m, Quaternion* dst) { m.getRotation(dst); } -void Quaternion::createFromAxisAngle(const Vector3& axis, float angle, Quaternion* dst) +void Quaternion::createFromAxisAngle(const Vec3& axis, float angle, Quaternion* dst) { GP_ASSERT(dst); float halfAngle = angle * 0.5f; float sinHalfAngle = sinf(halfAngle); - Vector3 normal(axis); + Vec3 normal(axis); normal.normalize(); dst->x = normal.x * sinHalfAngle; dst->y = normal.y * sinHalfAngle; @@ -212,12 +212,12 @@ void Quaternion::set(float* array) w = array[3]; } -void Quaternion::set(const Matrix& m) +void Quaternion::set(const Mat4& m) { Quaternion::createFromRotationMatrix(m, this); } -void Quaternion::set(const Vector3& axis, float angle) +void Quaternion::set(const Vec3& axis, float angle) { Quaternion::createFromAxisAngle(axis, angle, this); } @@ -238,7 +238,7 @@ void Quaternion::setIdentity() w = 1.0f; } -float Quaternion::toAxisAngle(Vector3* axis) const +float Quaternion::toAxisAngle(Vec3* axis) const { GP_ASSERT(axis); diff --git a/cocos/math/Quaternion.h b/cocos/math/Quaternion.h index 502b99bf1b..73a7163807 100644 --- a/cocos/math/Quaternion.h +++ b/cocos/math/Quaternion.h @@ -27,7 +27,7 @@ NS_CC_MATH_BEGIN -class Matrix; +class Mat4; /** * Defines a 4-element quaternion that represents the orientation of an object in space. @@ -108,7 +108,7 @@ public: * * @param m The matrix. */ - Quaternion(const Matrix& m); + Quaternion(const Mat4& m); /** * Constructs a quaternion equal to the rotation from the specified axis and angle. @@ -116,7 +116,7 @@ public: * @param axis A vector describing the axis of rotation. * @param angle The angle of rotation (in radians). */ - Quaternion(const Vector3& axis, float angle); + Quaternion(const Vec3& axis, float angle); /** * Constructs a new quaternion that is a copy of the specified one. @@ -165,7 +165,7 @@ public: * @param m The matrix. * @param dst A quaternion to store the conjugate in. */ - static void createFromRotationMatrix(const Matrix& m, Quaternion* dst); + static void createFromRotationMatrix(const Mat4& m, Quaternion* dst); /** * Creates this quaternion equal to the rotation from the specified axis and angle @@ -175,7 +175,7 @@ public: * @param angle The angle of rotation (in radians). * @param dst A quaternion to store the conjugate in. */ - static void createFromAxisAngle(const Vector3& axis, float angle, Quaternion* dst); + static void createFromAxisAngle(const Vec3& axis, float angle, Quaternion* dst); /** * Sets this quaternion to the conjugate of itself. @@ -272,7 +272,7 @@ public: * * @param m The matrix. */ - void set(const Matrix& m); + void set(const Mat4& m); /** * Sets the quaternion equal to the rotation from the specified axis and angle. @@ -280,7 +280,7 @@ public: * @param axis The axis of rotation. * @param angle The angle of rotation (in radians). */ - void set(const Vector3& axis, float angle); + void set(const Vec3& axis, float angle); /** * Sets the elements of this quaternion to a copy of the specified quaternion. @@ -297,11 +297,11 @@ public: /** * Converts this Quaternion4f to axis-angle notation. The axis is normalized. * - * @param e The Vector3f which stores the axis. + * @param e The Vec3f which stores the axis. * * @return The angle (in radians). */ - float toAxisAngle(Vector3* e) const; + float toAxisAngle(Vec3* e) const; /** * Interpolates between two quaternions using linear interpolation. diff --git a/cocos/math/Vector2.cpp b/cocos/math/Vector2.cpp index 3cde513e31..0b0df415cd 100644 --- a/cocos/math/Vector2.cpp +++ b/cocos/math/Vector2.cpp @@ -18,9 +18,9 @@ This file was modified to fit the cocos2d-x project */ -#include "Vector2.h" +#include "math/Vector2.h" +#include "math/MathUtil.h" #include "base/ccMacros.h" -#include "MathUtil.h" NS_CC_MATH_BEGIN @@ -62,63 +62,63 @@ bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, } // cross procuct of 2 vector. A->B X C->D -float crossProduct2Vector(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D) +float crossProduct2Vector(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); } -Vector2::Vector2() +Vec2::Vec2() : x(0.0f), y(0.0f) { } -Vector2::Vector2(float xx, float yy) +Vec2::Vec2(float xx, float yy) : x(xx), y(yy) { } -Vector2::Vector2(const float* array) +Vec2::Vec2(const float* array) { set(array); } -Vector2::Vector2(const Vector2& p1, const Vector2& p2) +Vec2::Vec2(const Vec2& p1, const Vec2& p2) { set(p1, p2); } -Vector2::Vector2(const Vector2& copy) +Vec2::Vec2(const Vec2& copy) { set(copy); } -Vector2::~Vector2() +Vec2::~Vec2() { } -bool Vector2::isZero() const +bool Vec2::isZero() const { return x == 0.0f && y == 0.0f; } -bool Vector2::isOne() const +bool Vec2::isOne() const { return x == 1.0f && y == 1.0f; } -float Vector2::angle(const Vector2& v1, const Vector2& v2) +float Vec2::angle(const Vec2& v1, const Vec2& v2) { float dz = v1.x * v2.y - v1.y * v2.x; return atan2f(fabsf(dz) + MATH_FLOAT_SMALL, dot(v1, v2)); } -void Vector2::add(const Vector2& v) +void Vec2::add(const Vec2& v) { x += v.x; y += v.y; } -void Vector2::add(const Vector2& v1, const Vector2& v2, Vector2* dst) +void Vec2::add(const Vec2& v1, const Vec2& v2, Vec2* dst) { GP_ASSERT(dst); @@ -126,7 +126,7 @@ void Vector2::add(const Vector2& v1, const Vector2& v2, Vector2* dst) dst->y = v1.y + v2.y; } -void Vector2::clamp(const Vector2& min, const Vector2& max) +void Vec2::clamp(const Vec2& min, const Vec2& max) { GP_ASSERT(!(min.x > max.x || min.y > max.y )); @@ -143,7 +143,7 @@ void Vector2::clamp(const Vector2& min, const Vector2& max) y = max.y; } -void Vector2::clamp(const Vector2& v, const Vector2& min, const Vector2& max, Vector2* dst) +void Vec2::clamp(const Vec2& v, const Vec2& min, const Vec2& max, Vec2* dst) { GP_ASSERT(dst); GP_ASSERT(!(min.x > max.x || min.y > max.y )); @@ -163,7 +163,7 @@ void Vector2::clamp(const Vector2& v, const Vector2& min, const Vector2& max, Ve dst->y = max.y; } -float Vector2::distance(const Vector2& v) const +float Vec2::distance(const Vec2& v) const { float dx = v.x - x; float dy = v.y - y; @@ -171,40 +171,40 @@ float Vector2::distance(const Vector2& v) const return sqrt(dx * dx + dy * dy); } -float Vector2::distanceSquared(const Vector2& v) const +float Vec2::distanceSquared(const Vec2& v) const { float dx = v.x - x; float dy = v.y - y; return (dx * dx + dy * dy); } -float Vector2::dot(const Vector2& v) const +float Vec2::dot(const Vec2& v) const { return (x * v.x + y * v.y); } -float Vector2::dot(const Vector2& v1, const Vector2& v2) +float Vec2::dot(const Vec2& v1, const Vec2& v2) { return (v1.x * v2.x + v1.y * v2.y); } -float Vector2::length() const +float Vec2::length() const { return sqrt(x * x + y * y); } -float Vector2::lengthSquared() const +float Vec2::lengthSquared() const { return (x * x + y * y); } -void Vector2::negate() +void Vec2::negate() { x = -x; y = -y; } -void Vector2::normalize() +void Vec2::normalize() { float n = x * x + y * y; // Already normalized. @@ -221,26 +221,26 @@ void Vector2::normalize() y *= n; } -Vector2 Vector2::getNormalized() const +Vec2 Vec2::getNormalized() const { - Vector2 v(*this); + Vec2 v(*this); v.normalize(); return v; } -void Vector2::scale(float scalar) +void Vec2::scale(float scalar) { x *= scalar; y *= scalar; } -void Vector2::scale(const Vector2& scale) +void Vec2::scale(const Vec2& scale) { x *= scale.x; y *= scale.y; } -void Vector2::rotate(const Vector2& point, float angle) +void Vec2::rotate(const Vec2& point, float angle) { double sinAngle = sin(angle); double cosAngle = cos(angle); @@ -261,13 +261,13 @@ void Vector2::rotate(const Vector2& point, float angle) } } -void Vector2::set(float xx, float yy) +void Vec2::set(float xx, float yy) { this->x = xx; this->y = yy; } -void Vector2::set(const float* array) +void Vec2::set(const float* array) { GP_ASSERT(array); @@ -275,25 +275,25 @@ void Vector2::set(const float* array) y = array[1]; } -void Vector2::set(const Vector2& v) +void Vec2::set(const Vec2& v) { this->x = v.x; this->y = v.y; } -void Vector2::set(const Vector2& p1, const Vector2& p2) +void Vec2::set(const Vec2& p1, const Vec2& p2) { x = p2.x - p1.x; y = p2.y - p1.y; } -void Vector2::subtract(const Vector2& v) +void Vec2::subtract(const Vec2& v) { x -= v.x; y -= v.y; } -void Vector2::subtract(const Vector2& v1, const Vector2& v2, Vector2* dst) +void Vec2::subtract(const Vec2& v1, const Vec2& v2, Vec2* dst) { GP_ASSERT(dst); @@ -301,7 +301,7 @@ void Vector2::subtract(const Vector2& v1, const Vector2& v2, Vector2* dst) dst->y = v1.y - v2.y; } -void Vector2::smooth(const Vector2& target, float elapsedTime, float responseTime) +void Vec2::smooth(const Vec2& target, float elapsedTime, float responseTime) { if (elapsedTime > 0) { @@ -309,19 +309,19 @@ void Vector2::smooth(const Vector2& target, float elapsedTime, float responseTim } } -void Vector2::setPoint(float xx, float yy) +void Vec2::setPoint(float xx, float yy) { this->x = xx; this->y = yy; } -bool Vector2::equals(const Vector2& target) const +bool Vec2::equals(const Vec2& target) const { return (fabs(this->x - target.x) < FLT_EPSILON) && (fabs(this->y - target.y) < FLT_EPSILON); } -bool Vector2::fuzzyEquals(const Vector2& b, float var) const +bool Vec2::fuzzyEquals(const Vec2& b, float var) const { if(x - var <= b.x && b.x <= x + var) if(y - var <= b.y && b.y <= y + var) @@ -329,22 +329,22 @@ bool Vector2::fuzzyEquals(const Vector2& b, float var) const return false; } -float Vector2::getAngle(const Vector2& other) const +float Vec2::getAngle(const Vec2& other) const { - Vector2 a2 = getNormalized(); - Vector2 b2 = other.getNormalized(); + Vec2 a2 = getNormalized(); + Vec2 b2 = other.getNormalized(); float angle = atan2f(a2.cross(b2), a2.dot(b2)); if( fabs(angle) < FLT_EPSILON ) return 0.f; return angle; } -Vector2 Vector2::rotateByAngle(const Vector2& pivot, float angle) const +Vec2 Vec2::rotateByAngle(const Vec2& pivot, float angle) const { - return pivot + (*this - pivot).rotate(Vector2::forAngle(angle)); + return pivot + (*this - pivot).rotate(Vec2::forAngle(angle)); } -bool Vector2::isLineIntersect(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D, +bool Vec2::isLineIntersect(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D, float *S, float *T) { // FAIL: Line undefined @@ -367,8 +367,8 @@ bool Vector2::isLineIntersect(const Vector2& A, const Vector2& B, return true; } -bool Vector2::isLineParallel(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D) +bool Vec2::isLineParallel(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D) { // FAIL: Line undefined if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) @@ -390,8 +390,8 @@ bool Vector2::isLineParallel(const Vector2& A, const Vector2& B, return false; } -bool Vector2::isLineOverlap(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D) +bool Vec2::isLineOverlap(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D) { // FAIL: Line undefined if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) @@ -408,7 +408,7 @@ bool Vector2::isLineOverlap(const Vector2& A, const Vector2& B, return false; } -bool Vector2::isSegmentOverlap(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D, Vector2* S, Vector2* E) +bool Vec2::isSegmentOverlap(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D, Vec2* S, Vec2* E) { if (isLineOverlap(A, B, C, D)) @@ -420,7 +420,7 @@ bool Vector2::isSegmentOverlap(const Vector2& A, const Vector2& B, const Vector2 return false; } -bool Vector2::isSegmentIntersect(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D) +bool Vec2::isSegmentIntersect(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D) { float S, T; @@ -433,34 +433,34 @@ bool Vector2::isSegmentIntersect(const Vector2& A, const Vector2& B, const Vecto return false; } -Vector2 Vector2::getIntersectPoint(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D) +Vec2 Vec2::getIntersectPoint(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D) { float S, T; if (isLineIntersect(A, B, C, D, &S, &T)) { - // Vector2 of intersection - Vector2 P; + // Vec2 of intersection + Vec2 P; P.x = A.x + S * (B.x - A.x); P.y = A.y + S * (B.y - A.y); return P; } - return Vector2::ZERO; + return Vec2::ZERO; } -const Vector2 Vector2::ZERO = Vector2(0.0f, 0.0f); -const Vector2 Vector2::ONE = Vector2(1.0f, 1.0f); -const Vector2 Vector2::UNIT_X = Vector2(1.0f, 0.0f); -const Vector2 Vector2::UNIT_Y = Vector2(0.0f, 1.0f); -const Vector2 Vector2::ANCHOR_MIDDLE = Vector2(0.5f, 0.5f); -const Vector2 Vector2::ANCHOR_BOTTOM_LEFT = Vector2(0.0f, 0.0f); -const Vector2 Vector2::ANCHOR_TOP_LEFT = Vector2(0.0f, 1.0f); -const Vector2 Vector2::ANCHOR_BOTTOM_RIGHT = Vector2(1.0f, 0.0f); -const Vector2 Vector2::ANCHOR_TOP_RIGHT = Vector2(1.0f, 1.0f); -const Vector2 Vector2::ANCHOR_MIDDLE_RIGHT = Vector2(1.0f, 0.5f); -const Vector2 Vector2::ANCHOR_MIDDLE_LEFT = Vector2(0.0f, 0.5f); -const Vector2 Vector2::ANCHOR_MIDDLE_TOP = Vector2(0.5f, 1.0f); -const Vector2 Vector2::ANCHOR_MIDDLE_BOTTOM = Vector2(0.5f, 0.0f); +const Vec2 Vec2::ZERO = Vec2(0.0f, 0.0f); +const Vec2 Vec2::ONE = Vec2(1.0f, 1.0f); +const Vec2 Vec2::UNIT_X = Vec2(1.0f, 0.0f); +const Vec2 Vec2::UNIT_Y = Vec2(0.0f, 1.0f); +const Vec2 Vec2::ANCHOR_MIDDLE = Vec2(0.5f, 0.5f); +const Vec2 Vec2::ANCHOR_BOTTOM_LEFT = Vec2(0.0f, 0.0f); +const Vec2 Vec2::ANCHOR_TOP_LEFT = Vec2(0.0f, 1.0f); +const Vec2 Vec2::ANCHOR_BOTTOM_RIGHT = Vec2(1.0f, 0.0f); +const Vec2 Vec2::ANCHOR_TOP_RIGHT = Vec2(1.0f, 1.0f); +const Vec2 Vec2::ANCHOR_MIDDLE_RIGHT = Vec2(1.0f, 0.5f); +const Vec2 Vec2::ANCHOR_MIDDLE_LEFT = Vec2(0.0f, 0.5f); +const Vec2 Vec2::ANCHOR_MIDDLE_TOP = Vec2(0.5f, 1.0f); +const Vec2 Vec2::ANCHOR_MIDDLE_BOTTOM = Vec2(0.5f, 0.0f); NS_CC_MATH_END diff --git a/cocos/math/Vector2.h b/cocos/math/Vector2.h index 731d19e04e..0b5d9cb9c7 100644 --- a/cocos/math/Vector2.h +++ b/cocos/math/Vector2.h @@ -18,12 +18,13 @@ This file was modified to fit the cocos2d-x project */ -#ifndef VECTOR2_H_ -#define VECTOR2_H_ +#ifndef MATH_VEC2_H +#define MATH_VEC2_H -#include "CCMathBase.h" -#include "base/CCPlatformMacros.h" -#include "base/ccMacros.h" +#include +#include +#include +#include "math/CCMathBase.h" NS_CC_MATH_BEGIN @@ -33,17 +34,17 @@ NS_CC_MATH_BEGIN inline float clampf(float value, float min_inclusive, float max_inclusive) { if (min_inclusive > max_inclusive) { - CC_SWAP(min_inclusive, max_inclusive, float); + std::swap(min_inclusive, max_inclusive); } return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive; } -class Matrix; +class Mat4; /** * Defines a 2-element floating point vector. */ -class Vector2 +class Vec2 { public: @@ -60,7 +61,7 @@ public: /** * Constructs a new vector initialized to all zeros. */ - Vector2(); + Vec2(); /** * Constructs a new vector initialized to the specified values. @@ -68,14 +69,14 @@ public: * @param xx The x coordinate. * @param yy The y coordinate. */ - Vector2(float xx, float yy); + Vec2(float xx, float yy); /** * Constructs a new vector from the values in the specified array. * * @param array An array containing the elements of the vector in the order x, y. */ - Vector2(const float* array); + Vec2(const float* array); /** * Constructs a vector that describes the direction between the specified points. @@ -83,19 +84,19 @@ public: * @param p1 The first point. * @param p2 The second point. */ - Vector2(const Vector2& p1, const Vector2& p2); + Vec2(const Vec2& p1, const Vec2& p2); /** * Constructs a new vector that is a copy of the specified vector. * * @param copy The vector to copy. */ - Vector2(const Vector2& copy); + Vec2(const Vec2& copy); /** * Destructor. */ - ~Vector2(); + ~Vec2(); /** * Indicates whether this vector contains all zeros. @@ -119,14 +120,14 @@ public: * * @return The angle between the two vectors (in radians). */ - static float angle(const Vector2& v1, const Vector2& v2); + static float angle(const Vec2& v1, const Vec2& v2); /** * Adds the elements of the specified vector to this one. * * @param v The vector to add. */ - void add(const Vector2& v); + void add(const Vec2& v); /** * Adds the specified vectors and stores the result in dst. @@ -135,7 +136,7 @@ public: * @param v2 The second vector. * @param dst A vector to store the result in. */ - static void add(const Vector2& v1, const Vector2& v2, Vector2* dst); + static void add(const Vec2& v1, const Vec2& v2, Vec2* dst); /** * Clamps this vector within the specified range. @@ -143,7 +144,7 @@ public: * @param min The minimum value. * @param max The maximum value. */ - void clamp(const Vector2& min, const Vector2& max); + void clamp(const Vec2& min, const Vec2& max); /** * Clamps the specified vector within the specified range and returns it in dst. @@ -153,7 +154,7 @@ public: * @param max The maximum value. * @param dst A vector to store the result in. */ - static void clamp(const Vector2& v, const Vector2& min, const Vector2& max, Vector2* dst); + static void clamp(const Vec2& v, const Vec2& min, const Vec2& max, Vec2* dst); /** * Returns the distance between this vector and v. @@ -164,7 +165,7 @@ public: * * @see distanceSquared */ - float distance(const Vector2& v) const; + float distance(const Vec2& v) const; /** * Returns the squared distance between this vector and v. @@ -180,7 +181,7 @@ public: * * @see distance */ - float distanceSquared(const Vector2& v) const; + float distanceSquared(const Vec2& v) const; /** * Returns the dot product of this vector and the specified vector. @@ -189,7 +190,7 @@ public: * * @return The dot product. */ - float dot(const Vector2& v) const; + float dot(const Vec2& v) const; /** * Returns the dot product between the specified vectors. @@ -199,7 +200,7 @@ public: * * @return The dot product between the vectors. */ - static float dot(const Vector2& v1, const Vector2& v2); + static float dot(const Vec2& v1, const Vec2& v2); /** * Computes the length of this vector. @@ -232,7 +233,7 @@ public: /** * Normalizes this vector. * - * This method normalizes this Vector2 so that it is of + * This method normalizes this Vec2 so that it is of * unit length (in other words, the length of the vector * after calling this method will be 1.0f). If the vector * already has unit length or if the length of the vector @@ -251,7 +252,7 @@ public: * * @param dst The destination vector. */ - Vector2 getNormalized() const; + Vec2 getNormalized() const; /** * Scales all elements of this vector by the specified value. @@ -265,7 +266,7 @@ public: * * @param scale The vector to scale by. */ - void scale(const Vector2& scale); + void scale(const Vec2& scale); /** * Rotates this vector by angle (specified in radians) around the given point. @@ -273,7 +274,7 @@ public: * @param point The point to rotate around. * @param angle The angle to rotate by (in radians). */ - void rotate(const Vector2& point, float angle); + void rotate(const Vec2& point, float angle); /** * Sets the elements of this vector to the specified values. @@ -295,7 +296,7 @@ public: * * @param v The vector to copy. */ - void set(const Vector2& v); + void set(const Vec2& v); /** * Sets this vector to the directional vector between the specified points. @@ -303,7 +304,7 @@ public: * @param p1 The first point. * @param p2 The second point. */ - void set(const Vector2& p1, const Vector2& p2); + void set(const Vec2& p1, const Vec2& p2); /** * Subtracts this vector and the specified vector as (this - v) @@ -311,7 +312,7 @@ public: * * @param v The vector to subtract. */ - void subtract(const Vector2& v); + void subtract(const Vec2& v); /** * Subtracts the specified vectors and stores the result in dst. @@ -321,7 +322,7 @@ public: * @param v2 The second vector. * @param dst The destination vector. */ - static void subtract(const Vector2& v1, const Vector2& v2, Vector2* dst); + static void subtract(const Vec2& v1, const Vec2& v2, Vec2* dst); /** * Updates this vector towards the given target using a smoothing function. @@ -334,7 +335,7 @@ public: * @param elapsedTime elapsed time between calls. * @param responseTime response time (in the same units as elapsedTime). */ - void smooth(const Vector2& target, float elapsedTime, float responseTime); + void smooth(const Vec2& target, float elapsedTime, float responseTime); /** * Calculates the sum of this vector with the given vector. @@ -344,7 +345,7 @@ public: * @param v The vector to add. * @return The vector sum. */ - inline const Vector2 operator+(const Vector2& v) const; + inline const Vec2 operator+(const Vec2& v) const; /** * Adds the given vector to this vector. @@ -352,7 +353,7 @@ public: * @param v The vector to add. * @return This vector, after the addition occurs. */ - inline Vector2& operator+=(const Vector2& v); + inline Vec2& operator+=(const Vec2& v); /** * Calculates the sum of this vector with the given vector. @@ -362,7 +363,7 @@ public: * @param v The vector to add. * @return The vector sum. */ - inline const Vector2 operator-(const Vector2& v) const; + inline const Vec2 operator-(const Vec2& v) const; /** * Subtracts the given vector from this vector. @@ -370,7 +371,7 @@ public: * @param v The vector to subtract. * @return This vector, after the subtraction occurs. */ - inline Vector2& operator-=(const Vector2& v); + inline Vec2& operator-=(const Vec2& v); /** * Calculates the negation of this vector. @@ -379,7 +380,7 @@ public: * * @return The negation of this vector. */ - inline const Vector2 operator-() const; + inline const Vec2 operator-() const; /** * Calculates the scalar product of this vector with the given value. @@ -389,7 +390,7 @@ public: * @param s The value to scale by. * @return The scaled vector. */ - inline const Vector2 operator*(float s) const; + inline const Vec2 operator*(float s) const; /** * Scales this vector by the given value. @@ -397,7 +398,7 @@ public: * @param s The value to scale by. * @return This vector, after the scale occurs. */ - inline Vector2& operator*=(float s); + inline Vec2& operator*=(float s); /** * Returns the components of this vector divided by the given constant @@ -407,7 +408,7 @@ public: * @param s the constant to divide this vector with * @return a smaller vector */ - inline const Vector2 operator/(float s) const; + inline const Vec2 operator/(float s) const; /** * Determines if this vector is less than the given vector. @@ -416,7 +417,7 @@ public: * * @return True if this vector is less than the given vector, false otherwise. */ - inline bool operator<(const Vector2& v) const; + inline bool operator<(const Vec2& v) const; /** * Determines if this vector is equal to the given vector. @@ -425,7 +426,7 @@ public: * * @return True if this vector is equal to the given vector, false otherwise. */ - inline bool operator==(const Vector2& v) const; + inline bool operator==(const Vec2& v) const; /** * Determines if this vector is not equal to the given vector. @@ -434,7 +435,7 @@ public: * * @return True if this vector is not equal to the given vector, false otherwise. */ - inline bool operator!=(const Vector2& v) const; + inline bool operator!=(const Vec2& v) const; //code added compatible for Point public: @@ -446,14 +447,14 @@ public: /** * @js NA */ - bool equals(const Vector2& target) const; + bool equals(const Vec2& target) const; /** @returns if points have fuzzy equality which means equal with some degree of variance. @since v2.1.4 * @js NA * @lua NA */ - bool fuzzyEquals(const Vector2& target, float variance) const; + bool fuzzyEquals(const Vec2& target, float variance) const; /** Calculates distance between point an origin @return float @@ -465,7 +466,7 @@ public: return sqrtf(x*x + y*y); }; - /** Calculates the square length of a Vector2 (not calling sqrt() ) + /** Calculates the square length of a Vec2 (not calling sqrt() ) @return float @since v2.1.4 * @js NA @@ -481,7 +482,7 @@ public: * @js NA * @lua NA */ - inline float getDistanceSq(const Vector2& other) const { + inline float getDistanceSq(const Vec2& other) const { return (*this - other).getLengthSq(); }; @@ -491,7 +492,7 @@ public: * @js NA * @lua NA */ - inline float getDistance(const Vector2& other) const { + inline float getDistance(const Vec2& other) const { return (*this - other).getLength(); }; @@ -509,7 +510,7 @@ public: * @js NA * @lua NA */ - float getAngle(const Vector2& other) const; + float getAngle(const Vec2& other) const; /** Calculates cross product of two points. @return float @@ -517,29 +518,29 @@ public: * @js NA * @lua NA */ - inline float cross(const Vector2& other) const { + inline float cross(const Vec2& other) const { return x*other.y - y*other.x; }; /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 - @return Vector2 + @return Vec2 @since v2.1.4 * @js NA * @lua NA */ - inline Vector2 getPerp() const { - return Vector2(-y, x); + inline Vec2 getPerp() const { + return Vec2(-y, x); }; /** Calculates midpoint between two points. - @return Vector2 + @return Vec2 @since v3.0 * @js NA * @lua NA */ - inline Vector2 getMidpoint(const Vector2& other) const + inline Vec2 getMidpoint(const Vec2& other) const { - return Vector2((x + other.x) / 2.0f, (y + other.y) / 2.0f); + return Vec2((x + other.x) / 2.0f, (y + other.y) / 2.0f); } /** Clamp a point between from and to. @@ -547,9 +548,9 @@ public: * @js NA * @lua NA */ - inline Vector2 getClampPoint(const Vector2& min_inclusive, const Vector2& max_inclusive) const + inline Vec2 getClampPoint(const Vec2& min_inclusive, const Vec2& max_inclusive) const { - return Vector2(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y)); + return Vec2(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y)); } /** Run a math operation function on each point component @@ -561,51 +562,51 @@ public: * @js NA * @lua NA */ - inline Vector2 compOp(std::function function) const + inline Vec2 compOp(std::function function) const { - return Vector2(function(x), function(y)); + return Vec2(function(x), function(y)); } /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 - @return Vector2 + @return Vec2 @since v2.1.4 * @js NA * @lua NA */ - inline Vector2 getRPerp() const { - return Vector2(y, -x); + inline Vec2 getRPerp() const { + return Vec2(y, -x); }; /** Calculates the projection of this over other. - @return Vector2 + @return Vec2 @since v2.1.4 * @js NA * @lua NA */ - inline Vector2 project(const Vector2& other) const { + inline Vec2 project(const Vec2& other) const { return other * (dot(other)/other.dot(other)); }; /** Complex multiplication of two points ("rotates" two points). - @return Vector2 vector with an angle of this.getAngle() + other.getAngle(), + @return Vec2 vector with an angle of this.getAngle() + other.getAngle(), and a length of this.getLength() * other.getLength(). @since v2.1.4 * @js NA * @lua NA */ - inline Vector2 rotate(const Vector2& other) const { - return Vector2(x*other.x - y*other.y, x*other.y + y*other.x); + inline Vec2 rotate(const Vec2& other) const { + return Vec2(x*other.x - y*other.y, x*other.y + y*other.x); }; /** Unrotates two points. - @return Vector2 vector with an angle of this.getAngle() - other.getAngle(), + @return Vec2 vector with an angle of this.getAngle() - other.getAngle(), and a length of this.getLength() * other.getLength(). @since v2.1.4 * @js NA * @lua NA */ - inline Vector2 unrotate(const Vector2& other) const { - return Vector2(x*other.x + y*other.y, y*other.x - x*other.y); + inline Vec2 unrotate(const Vec2& other) const { + return Vec2(x*other.x + y*other.y, y*other.x - x*other.y); }; /** Linear Interpolation between two points a and b @@ -617,7 +618,7 @@ public: * @js NA * @lua NA */ - inline Vector2 lerp(const Vector2& other, float alpha) const { + inline Vec2 lerp(const Vec2& other, float alpha) const { return *this * (1.f - alpha) + other * alpha; }; @@ -629,15 +630,15 @@ public: * @js NA * @lua NA */ - Vector2 rotateByAngle(const Vector2& pivot, float angle) const; + Vec2 rotateByAngle(const Vec2& pivot, float angle) const; /** * @js NA * @lua NA */ - static inline Vector2 forAngle(const float a) + static inline Vec2 forAngle(const float a) { - return Vector2(cosf(a), sinf(a)); + return Vec2(cosf(a), sinf(a)); } /** A general line-line intersection test @@ -657,8 +658,8 @@ public: * @js NA * @lua NA */ - static bool isLineIntersect(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D, + static bool isLineIntersect(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D, float *S = nullptr, float *T = nullptr); /** @@ -667,8 +668,8 @@ public: * @js NA * @lua NA */ - static bool isLineOverlap(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D); + static bool isLineOverlap(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D); /** returns true if Line A-B parallel with segment C-D @@ -676,8 +677,8 @@ public: * @js NA * @lua NA */ - static bool isLineParallel(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D); + static bool isLineParallel(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D); /** returns true if Segment A-B overlap with segment C-D @@ -685,9 +686,9 @@ public: * @js NA * @lua NA */ - static bool isSegmentOverlap(const Vector2& A, const Vector2& B, - const Vector2& C, const Vector2& D, - Vector2* S = nullptr, Vector2* E = nullptr); + static bool isSegmentOverlap(const Vec2& A, const Vec2& B, + const Vec2& C, const Vec2& D, + Vec2* S = nullptr, Vec2* E = nullptr); /** returns true if Segment A-B intersects with segment C-D @@ -695,7 +696,7 @@ public: * @js NA * @lua NA */ - static bool isSegmentIntersect(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D); + static bool isSegmentIntersect(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D); /** returns the intersection point of line A-B, C-D @@ -703,34 +704,34 @@ public: * @js NA * @lua NA */ - static Vector2 getIntersectPoint(const Vector2& A, const Vector2& B, const Vector2& C, const Vector2& D); + static Vec2 getIntersectPoint(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D); - /** equals to Vector2(0,0) */ - static const Vector2 ZERO; - /** equals to Vector2(1,1) */ - static const Vector2 ONE; - /** equals to Vector2(1,0) */ - static const Vector2 UNIT_X; - /** equals to Vector2(0,1) */ - static const Vector2 UNIT_Y; - /** equals to Vector2(0.5, 0.5) */ - static const Vector2 ANCHOR_MIDDLE; - /** equals to Vector2(0, 0) */ - static const Vector2 ANCHOR_BOTTOM_LEFT; - /** equals to Vector2(0, 1) */ - static const Vector2 ANCHOR_TOP_LEFT; - /** equals to Vector2(1, 0) */ - static const Vector2 ANCHOR_BOTTOM_RIGHT; - /** equals to Vector2(1, 1) */ - static const Vector2 ANCHOR_TOP_RIGHT; - /** equals to Vector2(1, 0.5) */ - static const Vector2 ANCHOR_MIDDLE_RIGHT; - /** equals to Vector2(0, 0.5) */ - static const Vector2 ANCHOR_MIDDLE_LEFT; - /** equals to Vector2(0.5, 1) */ - static const Vector2 ANCHOR_MIDDLE_TOP; - /** equals to Vector2(0.5, 0) */ - static const Vector2 ANCHOR_MIDDLE_BOTTOM; + /** equals to Vec2(0,0) */ + static const Vec2 ZERO; + /** equals to Vec2(1,1) */ + static const Vec2 ONE; + /** equals to Vec2(1,0) */ + static const Vec2 UNIT_X; + /** equals to Vec2(0,1) */ + static const Vec2 UNIT_Y; + /** equals to Vec2(0.5, 0.5) */ + static const Vec2 ANCHOR_MIDDLE; + /** equals to Vec2(0, 0) */ + static const Vec2 ANCHOR_BOTTOM_LEFT; + /** equals to Vec2(0, 1) */ + static const Vec2 ANCHOR_TOP_LEFT; + /** equals to Vec2(1, 0) */ + static const Vec2 ANCHOR_BOTTOM_RIGHT; + /** equals to Vec2(1, 1) */ + static const Vec2 ANCHOR_TOP_RIGHT; + /** equals to Vec2(1, 0.5) */ + static const Vec2 ANCHOR_MIDDLE_RIGHT; + /** equals to Vec2(0, 0.5) */ + static const Vec2 ANCHOR_MIDDLE_LEFT; + /** equals to Vec2(0.5, 1) */ + static const Vec2 ANCHOR_MIDDLE_TOP; + /** equals to Vec2(0.5, 0) */ + static const Vec2 ANCHOR_MIDDLE_BOTTOM; }; /** @@ -740,12 +741,12 @@ public: * @param v The vector to scale. * @return The scaled vector. */ -inline const Vector2 operator*(float x, const Vector2& v); +inline const Vec2 operator*(float x, const Vec2& v); -typedef Vector2 Point2; +typedef Vec2 Point2; NS_CC_MATH_END #include "Vector2.inl" -#endif +#endif // MATH_VEC2_H diff --git a/cocos/math/Vector2.inl b/cocos/math/Vector2.inl index 5576b976cc..9108765efc 100644 --- a/cocos/math/Vector2.inl +++ b/cocos/math/Vector2.inl @@ -22,58 +22,58 @@ NS_CC_MATH_BEGIN -inline const Vector2 Vector2::operator+(const Vector2& v) const +inline const Vec2 Vec2::operator+(const Vec2& v) const { - Vector2 result(*this); + Vec2 result(*this); result.add(v); return result; } -inline Vector2& Vector2::operator+=(const Vector2& v) +inline Vec2& Vec2::operator+=(const Vec2& v) { add(v); return *this; } -inline const Vector2 Vector2::operator-(const Vector2& v) const +inline const Vec2 Vec2::operator-(const Vec2& v) const { - Vector2 result(*this); + Vec2 result(*this); result.subtract(v); return result; } -inline Vector2& Vector2::operator-=(const Vector2& v) +inline Vec2& Vec2::operator-=(const Vec2& v) { subtract(v); return *this; } -inline const Vector2 Vector2::operator-() const +inline const Vec2 Vec2::operator-() const { - Vector2 result(*this); + Vec2 result(*this); result.negate(); return result; } -inline const Vector2 Vector2::operator*(float s) const +inline const Vec2 Vec2::operator*(float s) const { - Vector2 result(*this); + Vec2 result(*this); result.scale(s); return result; } -inline Vector2& Vector2::operator*=(float s) +inline Vec2& Vec2::operator*=(float s) { scale(s); return *this; } -inline const Vector2 Vector2::operator/(const float s) const +inline const Vec2 Vec2::operator/(const float s) const { - return Vector2(this->x / s, this->y / s); + return Vec2(this->x / s, this->y / s); } -inline bool Vector2::operator<(const Vector2& v) const +inline bool Vec2::operator<(const Vec2& v) const { if (x == v.x) { @@ -82,19 +82,19 @@ inline bool Vector2::operator<(const Vector2& v) const return x < v.x; } -inline bool Vector2::operator==(const Vector2& v) const +inline bool Vec2::operator==(const Vec2& v) const { return x==v.x && y==v.y; } -inline bool Vector2::operator!=(const Vector2& v) const +inline bool Vec2::operator!=(const Vec2& v) const { return x!=v.x || y!=v.y; } -inline const Vector2 operator*(float x, const Vector2& v) +inline const Vec2 operator*(float x, const Vec2& v) { - Vector2 result(v); + Vec2 result(v); result.scale(x); return result; } diff --git a/cocos/math/Vector3.cpp b/cocos/math/Vector3.cpp index 96656e62fc..766aa822e3 100644 --- a/cocos/math/Vector3.cpp +++ b/cocos/math/Vector3.cpp @@ -24,32 +24,32 @@ NS_CC_MATH_BEGIN -Vector3::Vector3() +Vec3::Vec3() : x(0.0f), y(0.0f), z(0.0f) { } -Vector3::Vector3(float xx, float yy, float zz) +Vec3::Vec3(float xx, float yy, float zz) : x(xx), y(yy), z(zz) { } -Vector3::Vector3(const float* array) +Vec3::Vec3(const float* array) { set(array); } -Vector3::Vector3(const Vector3& p1, const Vector3& p2) +Vec3::Vec3(const Vec3& p1, const Vec3& p2) { set(p1, p2); } -Vector3::Vector3(const Vector3& copy) +Vec3::Vec3(const Vec3& copy) { set(copy); } -Vector3 Vector3::fromColor(unsigned int color) +Vec3 Vec3::fromColor(unsigned int color) { float components[3]; int componentIndex = 0; @@ -60,25 +60,25 @@ Vector3 Vector3::fromColor(unsigned int color) components[componentIndex++] = static_cast(component) / 255.0f; } - Vector3 value(components); + Vec3 value(components); return value; } -Vector3::~Vector3() +Vec3::~Vec3() { } -bool Vector3::isZero() const +bool Vec3::isZero() const { return x == 0.0f && y == 0.0f && z == 0.0f; } -bool Vector3::isOne() const +bool Vec3::isOne() const { return x == 1.0f && y == 1.0f && z == 1.0f; } -float Vector3::angle(const Vector3& v1, const Vector3& v2) +float Vec3::angle(const Vec3& v1, const Vec3& v2) { float dx = v1.y * v2.z - v1.z * v2.y; float dy = v1.z * v2.x - v1.x * v2.z; @@ -87,14 +87,14 @@ float Vector3::angle(const Vector3& v1, const Vector3& v2) return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2)); } -void Vector3::add(const Vector3& v) +void Vec3::add(const Vec3& v) { x += v.x; y += v.y; z += v.z; } -void Vector3::add(const Vector3& v1, const Vector3& v2, Vector3* dst) +void Vec3::add(const Vec3& v1, const Vec3& v2, Vec3* dst) { GP_ASSERT(dst); @@ -103,7 +103,7 @@ void Vector3::add(const Vector3& v1, const Vector3& v2, Vector3* dst) dst->z = v1.z + v2.z; } -void Vector3::clamp(const Vector3& min, const Vector3& max) +void Vec3::clamp(const Vec3& min, const Vec3& max) { GP_ASSERT(!(min.x > max.x || min.y > max.y || min.z > max.z)); @@ -126,7 +126,7 @@ void Vector3::clamp(const Vector3& min, const Vector3& max) z = max.z; } -void Vector3::clamp(const Vector3& v, const Vector3& min, const Vector3& max, Vector3* dst) +void Vec3::clamp(const Vec3& v, const Vec3& min, const Vec3& max, Vec3* dst) { GP_ASSERT(dst); GP_ASSERT(!(min.x > max.x || min.y > max.y || min.z > max.z)); @@ -153,22 +153,22 @@ void Vector3::clamp(const Vector3& v, const Vector3& min, const Vector3& max, Ve dst->z = max.z; } -void Vector3::cross(const Vector3& v) +void Vec3::cross(const Vec3& v) { cross(*this, v, this); } -void Vector3::cross(const Vector3& v1, const Vector3& v2, Vector3* dst) +void Vec3::cross(const Vec3& v1, const Vec3& v2, Vec3* dst) { GP_ASSERT(dst); - // NOTE: This code assumes Vector3 struct members are contiguous floats in memory. + // NOTE: This code assumes Vec3 struct members are contiguous floats in memory. // We might want to revisit this (and other areas of code that make this assumption) // later to guarantee 100% safety/compatibility. - MathUtil::crossVector3(&v1.x, &v2.x, &dst->x); + MathUtil::crossVec3(&v1.x, &v2.x, &dst->x); } -float Vector3::distance(const Vector3& v) const +float Vec3::distance(const Vec3& v) const { float dx = v.x - x; float dy = v.y - y; @@ -177,7 +177,7 @@ float Vector3::distance(const Vector3& v) const return sqrt(dx * dx + dy * dy + dz * dz); } -float Vector3::distanceSquared(const Vector3& v) const +float Vec3::distanceSquared(const Vec3& v) const { float dx = v.x - x; float dy = v.y - y; @@ -186,34 +186,34 @@ float Vector3::distanceSquared(const Vector3& v) const return (dx * dx + dy * dy + dz * dz); } -float Vector3::dot(const Vector3& v) const +float Vec3::dot(const Vec3& v) const { return (x * v.x + y * v.y + z * v.z); } -float Vector3::dot(const Vector3& v1, const Vector3& v2) +float Vec3::dot(const Vec3& v1, const Vec3& v2) { return (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z); } -float Vector3::length() const +float Vec3::length() const { return sqrt(x * x + y * y + z * z); } -float Vector3::lengthSquared() const +float Vec3::lengthSquared() const { return (x * x + y * y + z * z); } -void Vector3::negate() +void Vec3::negate() { x = -x; y = -y; z = -z; } -void Vector3::normalize() +void Vec3::normalize() { float n = x * x + y * y + z * z; // Already normalized. @@ -231,28 +231,28 @@ void Vector3::normalize() z *= n; } -Vector3 Vector3::getNormalized() const +Vec3 Vec3::getNormalized() const { - Vector3 v(*this); + Vec3 v(*this); v.normalize(); return v; } -void Vector3::scale(float scalar) +void Vec3::scale(float scalar) { x *= scalar; y *= scalar; z *= scalar; } -void Vector3::set(float xx, float yy, float zz) +void Vec3::set(float xx, float yy, float zz) { this->x = xx; this->y = yy; this->z = zz; } -void Vector3::set(const float* array) +void Vec3::set(const float* array) { GP_ASSERT(array); @@ -261,28 +261,28 @@ void Vector3::set(const float* array) z = array[2]; } -void Vector3::set(const Vector3& v) +void Vec3::set(const Vec3& v) { this->x = v.x; this->y = v.y; this->z = v.z; } -void Vector3::set(const Vector3& p1, const Vector3& p2) +void Vec3::set(const Vec3& p1, const Vec3& p2) { x = p2.x - p1.x; y = p2.y - p1.y; z = p2.z - p1.z; } -void Vector3::subtract(const Vector3& v) +void Vec3::subtract(const Vec3& v) { x -= v.x; y -= v.y; z -= v.z; } -void Vector3::subtract(const Vector3& v1, const Vector3& v2, Vector3* dst) +void Vec3::subtract(const Vec3& v1, const Vec3& v2, Vec3* dst) { GP_ASSERT(dst); @@ -291,7 +291,7 @@ void Vector3::subtract(const Vector3& v1, const Vector3& v2, Vector3* dst) dst->z = v1.z - v2.z; } -void Vector3::smooth(const Vector3& target, float elapsedTime, float responseTime) +void Vec3::smooth(const Vec3& target, float elapsedTime, float responseTime) { if (elapsedTime > 0) { @@ -299,10 +299,10 @@ void Vector3::smooth(const Vector3& target, float elapsedTime, float responseTim } } -const Vector3 Vector3::ZERO = Vector3(0.0f, 0.0f, 0.0f); -const Vector3 Vector3::ONE = Vector3(1.0f, 1.0f, 1.0f); -const Vector3 Vector3::UNIT_X = Vector3(1.0f, 0.0f, 0.0f); -const Vector3 Vector3::UNIT_Y = Vector3(0.0f, 1.0f, 0.0f); -const Vector3 Vector3::UNIT_Z = Vector3(0.0f, 0.0f, 1.0f); +const Vec3 Vec3::ZERO = Vec3(0.0f, 0.0f, 0.0f); +const Vec3 Vec3::ONE = Vec3(1.0f, 1.0f, 1.0f); +const Vec3 Vec3::UNIT_X = Vec3(1.0f, 0.0f, 0.0f); +const Vec3 Vec3::UNIT_Y = Vec3(0.0f, 1.0f, 0.0f); +const Vec3 Vec3::UNIT_Z = Vec3(0.0f, 0.0f, 1.0f); NS_CC_MATH_END diff --git a/cocos/math/Vector3.h b/cocos/math/Vector3.h index 0e1f0a5969..2ebfa8fd88 100644 --- a/cocos/math/Vector3.h +++ b/cocos/math/Vector3.h @@ -18,14 +18,14 @@ This file was modified to fit the cocos2d-x project */ -#ifndef VECTOR3_H_ -#define VECTOR3_H_ +#ifndef MATH_VEC3_H +#define MATH_VEC3_H -#include "CCMathBase.h" +#include "math/CCMathBase.h" NS_CC_MATH_BEGIN -class Matrix; +class Mat4; class Quaternion; /** @@ -37,7 +37,7 @@ class Quaternion; * the magnitude of the vector intact. When used as a point, * the elements of the vector represent a position in 3D space. */ -class Vector3 +class Vec3 { public: @@ -59,7 +59,7 @@ public: /** * Constructs a new vector initialized to all zeros. */ - Vector3(); + Vec3(); /** * Constructs a new vector initialized to the specified values. @@ -68,14 +68,14 @@ public: * @param yy The y coordinate. * @param zz The z coordinate. */ - Vector3(float xx, float yy, float zz); + Vec3(float xx, float yy, float zz); /** * Constructs a new vector from the values in the specified array. * * @param array An array containing the elements of the vector in the order x, y, z. */ - Vector3(const float* array); + Vec3(const float* array); /** * Constructs a vector that describes the direction between the specified points. @@ -83,14 +83,14 @@ public: * @param p1 The first point. * @param p2 The second point. */ - Vector3(const Vector3& p1, const Vector3& p2); + Vec3(const Vec3& p1, const Vec3& p2); /** * Constructs a new vector that is a copy of the specified vector. * * @param copy The vector to copy. */ - Vector3(const Vector3& copy); + Vec3(const Vec3& copy); /** * Creates a new vector from an integer interpreted as an RGB value. @@ -100,12 +100,12 @@ public: * * @return A vector corresponding to the interpreted RGB color. */ - static Vector3 fromColor(unsigned int color); + static Vec3 fromColor(unsigned int color); /** * Destructor. */ - ~Vector3(); + ~Vec3(); /** * Indicates whether this vector contains all zeros. @@ -129,7 +129,7 @@ public: * * @return The angle between the two vectors (in radians). */ - static float angle(const Vector3& v1, const Vector3& v2); + static float angle(const Vec3& v1, const Vec3& v2); /** @@ -137,7 +137,7 @@ public: * * @param v The vector to add. */ - void add(const Vector3& v); + void add(const Vec3& v); /** * Adds the specified vectors and stores the result in dst. @@ -146,7 +146,7 @@ public: * @param v2 The second vector. * @param dst A vector to store the result in. */ - static void add(const Vector3& v1, const Vector3& v2, Vector3* dst); + static void add(const Vec3& v1, const Vec3& v2, Vec3* dst); /** * Clamps this vector within the specified range. @@ -154,7 +154,7 @@ public: * @param min The minimum value. * @param max The maximum value. */ - void clamp(const Vector3& min, const Vector3& max); + void clamp(const Vec3& min, const Vec3& max); /** * Clamps the specified vector within the specified range and returns it in dst. @@ -164,14 +164,14 @@ public: * @param max The maximum value. * @param dst A vector to store the result in. */ - static void clamp(const Vector3& v, const Vector3& min, const Vector3& max, Vector3* dst); + static void clamp(const Vec3& v, const Vec3& min, const Vec3& max, Vec3* dst); /** * Sets this vector to the cross product between itself and the specified vector. * * @param v The vector to compute the cross product with. */ - void cross(const Vector3& v); + void cross(const Vec3& v); /** * Computes the cross product of the specified vectors and stores the result in dst. @@ -180,7 +180,7 @@ public: * @param v2 The second vector. * @param dst A vector to store the result in. */ - static void cross(const Vector3& v1, const Vector3& v2, Vector3* dst); + static void cross(const Vec3& v1, const Vec3& v2, Vec3* dst); /** * Returns the distance between this vector and v. @@ -191,7 +191,7 @@ public: * * @see distanceSquared */ - float distance(const Vector3& v) const; + float distance(const Vec3& v) const; /** * Returns the squared distance between this vector and v. @@ -207,7 +207,7 @@ public: * * @see distance */ - float distanceSquared(const Vector3& v) const; + float distanceSquared(const Vec3& v) const; /** * Returns the dot product of this vector and the specified vector. @@ -216,7 +216,7 @@ public: * * @return The dot product. */ - float dot(const Vector3& v) const; + float dot(const Vec3& v) const; /** * Returns the dot product between the specified vectors. @@ -226,7 +226,7 @@ public: * * @return The dot product between the vectors. */ - static float dot(const Vector3& v1, const Vector3& v2); + static float dot(const Vec3& v1, const Vec3& v2); /** * Computes the length of this vector. @@ -259,7 +259,7 @@ public: /** * Normalizes this vector. * - * This method normalizes this Vector3 so that it is of + * This method normalizes this Vect3 so that it is of * unit length (in other words, the length of the vector * after calling this method will be 1.0f). If the vector * already has unit length or if the length of the vector @@ -278,7 +278,7 @@ public: * * @param dst The destination vector. */ - Vector3 getNormalized() const; + Vec3 getNormalized() const; /** * Scales all elements of this vector by the specified value. @@ -308,12 +308,12 @@ public: * * @param v The vector to copy. */ - void set(const Vector3& v); + void set(const Vec3& v); /** * Sets this vector to the directional vector between the specified points. */ - void set(const Vector3& p1, const Vector3& p2); + void set(const Vec3& p1, const Vec3& p2); /** * Subtracts this vector and the specified vector as (this - v) @@ -321,7 +321,7 @@ public: * * @param v The vector to subtract. */ - void subtract(const Vector3& v); + void subtract(const Vec3& v); /** * Subtracts the specified vectors and stores the result in dst. @@ -331,7 +331,7 @@ public: * @param v2 The second vector. * @param dst The destination vector. */ - static void subtract(const Vector3& v1, const Vector3& v2, Vector3* dst); + static void subtract(const Vec3& v1, const Vec3& v2, Vec3* dst); /** * Updates this vector towards the given target using a smoothing function. @@ -344,7 +344,7 @@ public: * @param elapsedTime elapsed time between calls. * @param responseTime response time (in the same units as elapsedTime). */ - void smooth(const Vector3& target, float elapsedTime, float responseTime); + void smooth(const Vec3& target, float elapsedTime, float responseTime); /** * Calculates the sum of this vector with the given vector. @@ -354,7 +354,7 @@ public: * @param v The vector to add. * @return The vector sum. */ - inline const Vector3 operator+(const Vector3& v) const; + inline const Vec3 operator+(const Vec3& v) const; /** * Adds the given vector to this vector. @@ -362,7 +362,7 @@ public: * @param v The vector to add. * @return This vector, after the addition occurs. */ - inline Vector3& operator+=(const Vector3& v); + inline Vec3& operator+=(const Vec3& v); /** * Calculates the difference of this vector with the given vector. @@ -372,7 +372,7 @@ public: * @param v The vector to subtract. * @return The vector difference. */ - inline const Vector3 operator-(const Vector3& v) const; + inline const Vec3 operator-(const Vec3& v) const; /** * Subtracts the given vector from this vector. @@ -380,7 +380,7 @@ public: * @param v The vector to subtract. * @return This vector, after the subtraction occurs. */ - inline Vector3& operator-=(const Vector3& v); + inline Vec3& operator-=(const Vec3& v); /** * Calculates the negation of this vector. @@ -389,7 +389,7 @@ public: * * @return The negation of this vector. */ - inline const Vector3 operator-() const; + inline const Vec3 operator-() const; /** * Calculates the scalar product of this vector with the given value. @@ -399,7 +399,7 @@ public: * @param s The value to scale by. * @return The scaled vector. */ - inline const Vector3 operator*(float s) const; + inline const Vec3 operator*(float s) const; /** * Scales this vector by the given value. @@ -407,7 +407,7 @@ public: * @param s The value to scale by. * @return This vector, after the scale occurs. */ - inline Vector3& operator*=(float s); + inline Vec3& operator*=(float s); /** * Returns the components of this vector divided by the given constant @@ -417,7 +417,7 @@ public: * @param s the constant to divide this vector with * @return a smaller vector */ - inline const Vector3 operator/(float s) const; + inline const Vec3 operator/(float s) const; /** * Determines if this vector is less than the given vector. @@ -426,7 +426,7 @@ public: * * @return True if this vector is less than the given vector, false otherwise. */ - inline bool operator<(const Vector3& v) const; + inline bool operator<(const Vec3& v) const; /** * Determines if this vector is equal to the given vector. @@ -435,7 +435,7 @@ public: * * @return True if this vector is equal to the given vector, false otherwise. */ - inline bool operator==(const Vector3& v) const; + inline bool operator==(const Vec3& v) const; /** * Determines if this vector is not equal to the given vector. @@ -444,18 +444,18 @@ public: * * @return True if this vector is not equal to the given vector, false otherwise. */ - inline bool operator!=(const Vector3& v) const; + inline bool operator!=(const Vec3& v) const; - /** equals to Vector3(0,0,0) */ - static const Vector3 ZERO; - /** equals to Vector3(1,1,1) */ - static const Vector3 ONE; - /** equals to Vector3(1,0,0) */ - static const Vector3 UNIT_X; - /** equals to Vector3(0,1,0) */ - static const Vector3 UNIT_Y; - /** equals to Vector3(0,0,1) */ - static const Vector3 UNIT_Z; + /** equals to Vec3(0,0,0) */ + static const Vec3 ZERO; + /** equals to Vec3(1,1,1) */ + static const Vec3 ONE; + /** equals to Vec3(1,0,0) */ + static const Vec3 UNIT_X; + /** equals to Vec3(0,1,0) */ + static const Vec3 UNIT_Y; + /** equals to Vec3(0,0,1) */ + static const Vec3 UNIT_Z; }; /** @@ -465,12 +465,12 @@ public: * @param v The vector to scale. * @return The scaled vector. */ -inline const Vector3 operator*(float x, const Vector3& v); +inline const Vec3 operator*(float x, const Vec3& v); -typedef Vector3 Point3; +typedef Vec3 Point3; NS_CC_MATH_END #include "Vector3.inl" -#endif +#endif // MATH_VEC3_H diff --git a/cocos/math/Vector3.inl b/cocos/math/Vector3.inl index 07de9320b6..8bd30d61c0 100644 --- a/cocos/math/Vector3.inl +++ b/cocos/math/Vector3.inl @@ -23,58 +23,58 @@ NS_CC_MATH_BEGIN -inline const Vector3 Vector3::operator+(const Vector3& v) const +inline const Vec3 Vec3::operator+(const Vec3& v) const { - Vector3 result(*this); + Vec3 result(*this); result.add(v); return result; } -inline Vector3& Vector3::operator+=(const Vector3& v) +inline Vec3& Vec3::operator+=(const Vec3& v) { add(v); return *this; } -inline const Vector3 Vector3::operator-(const Vector3& v) const +inline const Vec3 Vec3::operator-(const Vec3& v) const { - Vector3 result(*this); + Vec3 result(*this); result.subtract(v); return result; } -inline Vector3& Vector3::operator-=(const Vector3& v) +inline Vec3& Vec3::operator-=(const Vec3& v) { subtract(v); return *this; } -inline const Vector3 Vector3::operator-() const +inline const Vec3 Vec3::operator-() const { - Vector3 result(*this); + Vec3 result(*this); result.negate(); return result; } -inline const Vector3 Vector3::operator*(float s) const +inline const Vec3 Vec3::operator*(float s) const { - Vector3 result(*this); + Vec3 result(*this); result.scale(s); return result; } -inline Vector3& Vector3::operator*=(float s) +inline Vec3& Vec3::operator*=(float s) { scale(s); return *this; } -inline const Vector3 Vector3::operator/(const float s) const +inline const Vec3 Vec3::operator/(const float s) const { - return Vector3(this->x / s, this->y / s, this->z / s); + return Vec3(this->x / s, this->y / s, this->z / s); } -inline bool Vector3::operator<(const Vector3& v) const +inline bool Vec3::operator<(const Vec3& v) const { if (x == v.x) { @@ -87,19 +87,19 @@ inline bool Vector3::operator<(const Vector3& v) const return x < v.x; } -inline bool Vector3::operator==(const Vector3& v) const +inline bool Vec3::operator==(const Vec3& v) const { return x==v.x && y==v.y && z==v.z; } -inline bool Vector3::operator!=(const Vector3& v) const +inline bool Vec3::operator!=(const Vec3& v) const { return x!=v.x || y!=v.y || z!=v.z; } -inline const Vector3 operator*(float x, const Vector3& v) +inline const Vec3 operator*(float x, const Vec3& v) { - Vector3 result(v); + Vec3 result(v); result.scale(x); return result; } diff --git a/cocos/math/Vector4.cpp b/cocos/math/Vector4.cpp index 7abeb10979..3c8f8223c1 100644 --- a/cocos/math/Vector4.cpp +++ b/cocos/math/Vector4.cpp @@ -24,32 +24,32 @@ NS_CC_MATH_BEGIN -Vector4::Vector4() +Vec4::Vec4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f) { } -Vector4::Vector4(float xx, float yy, float zz, float ww) +Vec4::Vec4(float xx, float yy, float zz, float ww) : x(xx), y(yy), z(zz), w(ww) { } -Vector4::Vector4(const float* src) +Vec4::Vec4(const float* src) { set(src); } -Vector4::Vector4(const Vector4& p1, const Vector4& p2) +Vec4::Vec4(const Vec4& p1, const Vec4& p2) { set(p1, p2); } -Vector4::Vector4(const Vector4& copy) +Vec4::Vec4(const Vec4& copy) { set(copy); } -Vector4 Vector4::fromColor(unsigned int color) +Vec4 Vec4::fromColor(unsigned int color) { float components[4]; int componentIndex = 0; @@ -60,25 +60,25 @@ Vector4 Vector4::fromColor(unsigned int color) components[componentIndex++] = static_cast(component) / 255.0f; } - Vector4 value(components); + Vec4 value(components); return value; } -Vector4::~Vector4() +Vec4::~Vec4() { } -bool Vector4::isZero() const +bool Vec4::isZero() const { return x == 0.0f && y == 0.0f && z == 0.0f && w == 0.0f; } -bool Vector4::isOne() const +bool Vec4::isOne() const { return x == 1.0f && y == 1.0f && z == 1.0f && w == 1.0f; } -float Vector4::angle(const Vector4& v1, const Vector4& v2) +float Vec4::angle(const Vec4& v1, const Vec4& v2) { float dx = v1.w * v2.x - v1.x * v2.w - v1.y * v2.z + v1.z * v2.y; float dy = v1.w * v2.y - v1.y * v2.w - v1.z * v2.x + v1.x * v2.z; @@ -87,7 +87,7 @@ float Vector4::angle(const Vector4& v1, const Vector4& v2) return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2)); } -void Vector4::add(const Vector4& v) +void Vec4::add(const Vec4& v) { x += v.x; y += v.y; @@ -95,7 +95,7 @@ void Vector4::add(const Vector4& v) w += v.w; } -void Vector4::add(const Vector4& v1, const Vector4& v2, Vector4* dst) +void Vec4::add(const Vec4& v1, const Vec4& v2, Vec4* dst) { GP_ASSERT(dst); @@ -105,7 +105,7 @@ void Vector4::add(const Vector4& v1, const Vector4& v2, Vector4* dst) dst->w = v1.w + v2.w; } -void Vector4::clamp(const Vector4& min, const Vector4& max) +void Vec4::clamp(const Vec4& min, const Vec4& max) { GP_ASSERT(!(min.x > max.x || min.y > max.y || min.z > max.z || min.w > max.w)); @@ -134,7 +134,7 @@ void Vector4::clamp(const Vector4& min, const Vector4& max) w = max.w; } -void Vector4::clamp(const Vector4& v, const Vector4& min, const Vector4& max, Vector4* dst) +void Vec4::clamp(const Vec4& v, const Vec4& min, const Vec4& max, Vec4* dst) { GP_ASSERT(dst); GP_ASSERT(!(min.x > max.x || min.y > max.y || min.z > max.z || min.w > max.w)); @@ -168,7 +168,7 @@ void Vector4::clamp(const Vector4& v, const Vector4& min, const Vector4& max, Ve dst->w = max.w; } -float Vector4::distance(const Vector4& v) const +float Vec4::distance(const Vec4& v) const { float dx = v.x - x; float dy = v.y - y; @@ -178,7 +178,7 @@ float Vector4::distance(const Vector4& v) const return sqrt(dx * dx + dy * dy + dz * dz + dw * dw); } -float Vector4::distanceSquared(const Vector4& v) const +float Vec4::distanceSquared(const Vec4& v) const { float dx = v.x - x; float dy = v.y - y; @@ -188,28 +188,28 @@ float Vector4::distanceSquared(const Vector4& v) const return (dx * dx + dy * dy + dz * dz + dw * dw); } -float Vector4::dot(const Vector4& v) const +float Vec4::dot(const Vec4& v) const { return (x * v.x + y * v.y + z * v.z + w * v.w); } -float Vector4::dot(const Vector4& v1, const Vector4& v2) +float Vec4::dot(const Vec4& v1, const Vec4& v2) { return (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w); } -float Vector4::length() const +float Vec4::length() const { return sqrt(x * x + y * y + z * z + w * w); } -float Vector4::lengthSquared() const +float Vec4::lengthSquared() const { return (x * x + y * y + z * z + w * w); } -void Vector4::negate() +void Vec4::negate() { x = -x; y = -y; @@ -217,7 +217,7 @@ void Vector4::negate() w = -w; } -void Vector4::normalize() +void Vec4::normalize() { float n = x * x + y * y + z * z + w * w; // Already normalized. @@ -236,14 +236,14 @@ void Vector4::normalize() w *= n; } -Vector4 Vector4::getNormalized() const +Vec4 Vec4::getNormalized() const { - Vector4 v(*this); + Vec4 v(*this); v.normalize(); return v; } -void Vector4::scale(float scalar) +void Vec4::scale(float scalar) { x *= scalar; y *= scalar; @@ -251,7 +251,7 @@ void Vector4::scale(float scalar) w *= scalar; } -void Vector4::set(float xx, float yy, float zz, float ww) +void Vec4::set(float xx, float yy, float zz, float ww) { this->x = xx; this->y = yy; @@ -259,7 +259,7 @@ void Vector4::set(float xx, float yy, float zz, float ww) this->w = ww; } -void Vector4::set(const float* array) +void Vec4::set(const float* array) { GP_ASSERT(array); @@ -269,7 +269,7 @@ void Vector4::set(const float* array) w = array[3]; } -void Vector4::set(const Vector4& v) +void Vec4::set(const Vec4& v) { this->x = v.x; this->y = v.y; @@ -277,7 +277,7 @@ void Vector4::set(const Vector4& v) this->w = v.w; } -void Vector4::set(const Vector4& p1, const Vector4& p2) +void Vec4::set(const Vec4& p1, const Vec4& p2) { x = p2.x - p1.x; y = p2.y - p1.y; @@ -285,7 +285,7 @@ void Vector4::set(const Vector4& p1, const Vector4& p2) w = p2.w - p1.w; } -void Vector4::subtract(const Vector4& v) +void Vec4::subtract(const Vec4& v) { x -= v.x; y -= v.y; @@ -293,7 +293,7 @@ void Vector4::subtract(const Vector4& v) w -= v.w; } -void Vector4::subtract(const Vector4& v1, const Vector4& v2, Vector4* dst) +void Vec4::subtract(const Vec4& v1, const Vec4& v2, Vec4* dst) { GP_ASSERT(dst); @@ -303,11 +303,11 @@ void Vector4::subtract(const Vector4& v1, const Vector4& v2, Vector4* dst) dst->w = v1.w - v2.w; } -const Vector4 Vector4::ZERO = Vector4(0.0f, 0.0f, 0.0f, 0.0f); -const Vector4 Vector4::ONE = Vector4(1.0f, 1.0f, 1.0f, 1.0f); -const Vector4 Vector4::UNIT_X = Vector4(1.0f, 0.0f, 0.0f, 0.0f); -const Vector4 Vector4::UNIT_Y = Vector4(0.0f, 1.0f, 0.0f, 0.0f); -const Vector4 Vector4::UNIT_Z = Vector4(0.0f, 0.0f, 1.0f, 0.0f); -const Vector4 Vector4::UNIT_W = Vector4(0.0f, 0.0f, 0.0f, 1.0f); +const Vec4 Vec4::ZERO = Vec4(0.0f, 0.0f, 0.0f, 0.0f); +const Vec4 Vec4::ONE = Vec4(1.0f, 1.0f, 1.0f, 1.0f); +const Vec4 Vec4::UNIT_X = Vec4(1.0f, 0.0f, 0.0f, 0.0f); +const Vec4 Vec4::UNIT_Y = Vec4(0.0f, 1.0f, 0.0f, 0.0f); +const Vec4 Vec4::UNIT_Z = Vec4(0.0f, 0.0f, 1.0f, 0.0f); +const Vec4 Vec4::UNIT_W = Vec4(0.0f, 0.0f, 0.0f, 1.0f); NS_CC_MATH_END diff --git a/cocos/math/Vector4.h b/cocos/math/Vector4.h index 616ae3094a..ce12686b92 100644 --- a/cocos/math/Vector4.h +++ b/cocos/math/Vector4.h @@ -18,19 +18,19 @@ This file was modified to fit the cocos2d-x project */ -#ifndef VECTOR4_H_ -#define VECTOR4_H_ +#ifndef MATH_VEC4_H +#define MATH_VEC4_H -#include "CCMathBase.h" +#include "math/CCMathBase.h" NS_CC_MATH_BEGIN -class Matrix; +class Mat4; /** * Defines 4-element floating point vector. */ -class Vector4 +class Vec4 { public: @@ -57,7 +57,7 @@ public: /** * Constructs a new vector initialized to all zeros. */ - Vector4(); + Vec4(); /** * Constructs a new vector initialized to the specified values. @@ -67,14 +67,14 @@ public: * @param zz The z coordinate. * @param ww The w coordinate. */ - Vector4(float xx, float yy, float zz, float ww); + Vec4(float xx, float yy, float zz, float ww); /** * Constructs a new vector from the values in the specified array. * * @param array An array containing the elements of the vector in the order x, y, z, w. */ - Vector4(const float* array); + Vec4(const float* array); /** * Constructs a vector that describes the direction between the specified points. @@ -82,7 +82,7 @@ public: * @param p1 The first point. * @param p2 The second point. */ - Vector4(const Vector4& p1, const Vector4& p2); + Vec4(const Vec4& p1, const Vec4& p2); /** * Constructor. @@ -91,7 +91,7 @@ public: * * @param copy The vector to copy. */ - Vector4(const Vector4& copy); + Vec4(const Vec4& copy); /** * Creates a new vector from an integer interpreted as an RGBA value. @@ -101,12 +101,12 @@ public: * * @return A vector corresponding to the interpreted RGBA color. */ - static Vector4 fromColor(unsigned int color); + static Vec4 fromColor(unsigned int color); /** * Destructor. */ - ~Vector4(); + ~Vec4(); /** * Indicates whether this vector contains all zeros. @@ -130,14 +130,14 @@ public: * * @return The angle between the two vectors (in radians). */ - static float angle(const Vector4& v1, const Vector4& v2); + static float angle(const Vec4& v1, const Vec4& v2); /** * Adds the elements of the specified vector to this one. * * @param v The vector to add. */ - void add(const Vector4& v); + void add(const Vec4& v); /** * Adds the specified vectors and stores the result in dst. @@ -146,7 +146,7 @@ public: * @param v2 The second vector. * @param dst A vector to store the result in. */ - static void add(const Vector4& v1, const Vector4& v2, Vector4* dst); + static void add(const Vec4& v1, const Vec4& v2, Vec4* dst); /** * Clamps this vector within the specified range. @@ -154,7 +154,7 @@ public: * @param min The minimum value. * @param max The maximum value. */ - void clamp(const Vector4& min, const Vector4& max); + void clamp(const Vec4& min, const Vec4& max); /** * Clamps the specified vector within the specified range and returns it in dst. @@ -164,7 +164,7 @@ public: * @param max The maximum value. * @param dst A vector to store the result in. */ - static void clamp(const Vector4& v, const Vector4& min, const Vector4& max, Vector4* dst); + static void clamp(const Vec4& v, const Vec4& min, const Vec4& max, Vec4* dst); /** * Returns the distance between this vector and v. @@ -175,7 +175,7 @@ public: * * @see distanceSquared */ - float distance(const Vector4& v) const; + float distance(const Vec4& v) const; /** * Returns the squared distance between this vector and v. @@ -191,7 +191,7 @@ public: * * @see distance */ - float distanceSquared(const Vector4& v) const; + float distanceSquared(const Vec4& v) const; /** * Returns the dot product of this vector and the specified vector. @@ -200,7 +200,7 @@ public: * * @return The dot product. */ - float dot(const Vector4& v) const; + float dot(const Vec4& v) const; /** * Returns the dot product between the specified vectors. @@ -210,7 +210,7 @@ public: * * @return The dot product between the vectors. */ - static float dot(const Vector4& v1, const Vector4& v2); + static float dot(const Vec4& v1, const Vec4& v2); /** * Computes the length of this vector. @@ -243,7 +243,7 @@ public: /** * Normalizes this vector. * - * This method normalizes this Vector4 so that it is of + * This method normalizes this Vec4 so that it is of * unit length (in other words, the length of the vector * after calling this method will be 1.0f). If the vector * already has unit length or if the length of the vector @@ -262,7 +262,7 @@ public: * * @param dst The destination vector. */ - Vector4 getNormalized() const; + Vec4 getNormalized() const; /** * Scales all elements of this vector by the specified value. @@ -293,7 +293,7 @@ public: * * @param v The vector to copy. */ - void set(const Vector4& v); + void set(const Vec4& v); /** * Sets this vector to the directional vector between the specified points. @@ -301,7 +301,7 @@ public: * @param p1 The first point. * @param p2 The second point. */ - void set(const Vector4& p1, const Vector4& p2); + void set(const Vec4& p1, const Vec4& p2); /** * Subtracts this vector and the specified vector as (this - v) @@ -309,7 +309,7 @@ public: * * @param v The vector to subtract. */ - void subtract(const Vector4& v); + void subtract(const Vec4& v); /** * Subtracts the specified vectors and stores the result in dst. @@ -319,7 +319,7 @@ public: * @param v2 The second vector. * @param dst The destination vector. */ - static void subtract(const Vector4& v1, const Vector4& v2, Vector4* dst); + static void subtract(const Vec4& v1, const Vec4& v2, Vec4* dst); /** * Calculates the sum of this vector with the given vector. @@ -329,7 +329,7 @@ public: * @param v The vector to add. * @return The vector sum. */ - inline const Vector4 operator+(const Vector4& v) const; + inline const Vec4 operator+(const Vec4& v) const; /** * Adds the given vector to this vector. @@ -337,7 +337,7 @@ public: * @param v The vector to add. * @return This vector, after the addition occurs. */ - inline Vector4& operator+=(const Vector4& v); + inline Vec4& operator+=(const Vec4& v); /** * Calculates the sum of this vector with the given vector. @@ -347,7 +347,7 @@ public: * @param v The vector to add. * @return The vector sum. */ - inline const Vector4 operator-(const Vector4& v) const; + inline const Vec4 operator-(const Vec4& v) const; /** * Subtracts the given vector from this vector. @@ -355,7 +355,7 @@ public: * @param v The vector to subtract. * @return This vector, after the subtraction occurs. */ - inline Vector4& operator-=(const Vector4& v); + inline Vec4& operator-=(const Vec4& v); /** * Calculates the negation of this vector. @@ -364,7 +364,7 @@ public: * * @return The negation of this vector. */ - inline const Vector4 operator-() const; + inline const Vec4 operator-() const; /** * Calculates the scalar product of this vector with the given value. @@ -374,7 +374,7 @@ public: * @param s The value to scale by. * @return The scaled vector. */ - inline const Vector4 operator*(float s) const; + inline const Vec4 operator*(float s) const; /** * Scales this vector by the given value. @@ -382,7 +382,7 @@ public: * @param s The value to scale by. * @return This vector, after the scale occurs. */ - inline Vector4& operator*=(float s); + inline Vec4& operator*=(float s); /** * Returns the components of this vector divided by the given constant @@ -392,7 +392,7 @@ public: * @param s the constant to divide this vector with * @return a smaller vector */ - inline const Vector4 operator/(float s) const; + inline const Vec4 operator/(float s) const; /** * Determines if this vector is less than the given vector. @@ -401,7 +401,7 @@ public: * * @return True if this vector is less than the given vector, false otherwise. */ - inline bool operator<(const Vector4& v) const; + inline bool operator<(const Vec4& v) const; /** * Determines if this vector is equal to the given vector. @@ -410,7 +410,7 @@ public: * * @return True if this vector is equal to the given vector, false otherwise. */ - inline bool operator==(const Vector4& v) const; + inline bool operator==(const Vec4& v) const; /** * Determines if this vector is not equal to the given vector. @@ -419,20 +419,20 @@ public: * * @return True if this vector is not equal to the given vector, false otherwise. */ - inline bool operator!=(const Vector4& v) const; + inline bool operator!=(const Vec4& v) const; - /** equals to Vector4(0,0,0,0) */ - static const Vector4 ZERO; - /** equals to Vector4(1,1,1,1) */ - static const Vector4 ONE; - /** equals to Vector4(1,0,0,0) */ - static const Vector4 UNIT_X; - /** equals to Vector4(0,1,0,0) */ - static const Vector4 UNIT_Y; - /** equals to Vector4(0,0,1,0) */ - static const Vector4 UNIT_Z; - /** equals to Vector4(0,0,0,1) */ - static const Vector4 UNIT_W; + /** equals to Vec4(0,0,0,0) */ + static const Vec4 ZERO; + /** equals to Vec4(1,1,1,1) */ + static const Vec4 ONE; + /** equals to Vec4(1,0,0,0) */ + static const Vec4 UNIT_X; + /** equals to Vec4(0,1,0,0) */ + static const Vec4 UNIT_Y; + /** equals to Vec4(0,0,1,0) */ + static const Vec4 UNIT_Z; + /** equals to Vec4(0,0,0,1) */ + static const Vec4 UNIT_W; }; /** @@ -442,10 +442,10 @@ public: * @param v The vector to scale. * @return The scaled vector. */ -inline const Vector4 operator*(float x, const Vector4& v); +inline const Vec4 operator*(float x, const Vec4& v); NS_CC_MATH_END #include "Vector4.inl" -#endif +#endif // MATH_VEC4_H diff --git a/cocos/math/Vector4.inl b/cocos/math/Vector4.inl index 98b51f4b34..9bdd7a9920 100644 --- a/cocos/math/Vector4.inl +++ b/cocos/math/Vector4.inl @@ -23,58 +23,58 @@ NS_CC_MATH_BEGIN -inline const Vector4 Vector4::operator+(const Vector4& v) const +inline const Vec4 Vec4::operator+(const Vec4& v) const { - Vector4 result(*this); + Vec4 result(*this); result.add(v); return result; } -inline Vector4& Vector4::operator+=(const Vector4& v) +inline Vec4& Vec4::operator+=(const Vec4& v) { add(v); return *this; } -inline const Vector4 Vector4::operator-(const Vector4& v) const +inline const Vec4 Vec4::operator-(const Vec4& v) const { - Vector4 result(*this); + Vec4 result(*this); result.subtract(v); return result; } -inline Vector4& Vector4::operator-=(const Vector4& v) +inline Vec4& Vec4::operator-=(const Vec4& v) { subtract(v); return *this; } -inline const Vector4 Vector4::operator-() const +inline const Vec4 Vec4::operator-() const { - Vector4 result(*this); + Vec4 result(*this); result.negate(); return result; } -inline const Vector4 Vector4::operator*(float s) const +inline const Vec4 Vec4::operator*(float s) const { - Vector4 result(*this); + Vec4 result(*this); result.scale(s); return result; } -inline Vector4& Vector4::operator*=(float s) +inline Vec4& Vec4::operator*=(float s) { scale(s); return *this; } -inline const Vector4 Vector4::operator/(const float s) const +inline const Vec4 Vec4::operator/(const float s) const { - return Vector4(this->x / s, this->y / s, this->z / s, this->w / s); + return Vec4(this->x / s, this->y / s, this->z / s, this->w / s); } -inline bool Vector4::operator<(const Vector4& v) const +inline bool Vec4::operator<(const Vec4& v) const { if (x == v.x) { @@ -94,19 +94,19 @@ inline bool Vector4::operator<(const Vector4& v) const return x < v.x; } -inline bool Vector4::operator==(const Vector4& v) const +inline bool Vec4::operator==(const Vec4& v) const { return x==v.x && y==v.y && z==v.z && w==v.w; } -inline bool Vector4::operator!=(const Vector4& v) const +inline bool Vec4::operator!=(const Vec4& v) const { return x!=v.x || y!=v.y || z!=v.z || w!=v.w; } -inline const Vector4 operator*(float x, const Vector4& v) +inline const Vec4 operator*(float x, const Vec4& v) { - Vector4 result(v); + Vec4 result(v); result.scale(x); return result; } diff --git a/cocos/physics/CCPhysicsBody.cpp b/cocos/physics/CCPhysicsBody.cpp index 46f1306a4c..477d177a78 100644 --- a/cocos/physics/CCPhysicsBody.cpp +++ b/cocos/physics/CCPhysicsBody.cpp @@ -145,7 +145,7 @@ PhysicsBody* PhysicsBody::create(float mass, float moment) } -PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Vector2& offset) +PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Vec2& offset) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -159,7 +159,7 @@ PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& mate return nullptr; } -PhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& material, const Vector2& offset) +PhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& material, const Vec2& offset) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -173,7 +173,7 @@ PhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& mat return nullptr; } -PhysicsBody* PhysicsBody::createPolygon(const Vector2* points, int count, const PhysicsMaterial& material, const Vector2& offset) +PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, int count, const PhysicsMaterial& material, const Vec2& offset) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -187,7 +187,7 @@ PhysicsBody* PhysicsBody::createPolygon(const Vector2* points, int count, const return nullptr; } -PhysicsBody* PhysicsBody::createEdgeSegment(const Vector2& a, const Vector2& b, const PhysicsMaterial& material, float border/* = 1*/) +PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, const Vec2& b, const PhysicsMaterial& material, float border/* = 1*/) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -202,7 +202,7 @@ PhysicsBody* PhysicsBody::createEdgeSegment(const Vector2& a, const Vector2& b, return nullptr; } -PhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& material, float border/* = 1*/, const Vector2& offset) +PhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& material, float border/* = 1*/, const Vec2& offset) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -218,7 +218,7 @@ PhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& return nullptr; } -PhysicsBody* PhysicsBody::createEdgePolygon(const Vector2* points, int count, const PhysicsMaterial& material, float border/* = 1*/) +PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -234,7 +234,7 @@ PhysicsBody* PhysicsBody::createEdgePolygon(const Vector2* points, int count, co return nullptr; } -PhysicsBody* PhysicsBody::createEdgeChain(const Vector2* points, int count, const PhysicsMaterial& material, float border/* = 1*/) +PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/) { PhysicsBody* body = new PhysicsBody(); if (body && body->init()) @@ -345,7 +345,7 @@ void PhysicsBody::setGravityEnable(bool enable) } } -void PhysicsBody::setPosition(Vector2 position) +void PhysicsBody::setPosition(Vec2 position) { cpBodySetPos(_info->getBody(), PhysicsHelper::point2cpv(position + _positionOffset)); } @@ -355,7 +355,7 @@ void PhysicsBody::setRotation(float rotation) cpBodySetAngle(_info->getBody(), -PhysicsHelper::float2cpfloat((rotation + _rotationOffset) * (M_PI / 180.0f))); } -Vector2 PhysicsBody::getPosition() const +Vec2 PhysicsBody::getPosition() const { cpVect vec = cpBodyGetPos(_info->getBody()); return PhysicsHelper::cpv2point(vec) - _positionOffset; @@ -402,10 +402,10 @@ PhysicsShape* PhysicsBody::addShape(PhysicsShape* shape, bool addMassAndMoment/* void PhysicsBody::applyForce(const Vect& force) { - applyForce(force, Vector2::ZERO); + applyForce(force, Vec2::ZERO); } -void PhysicsBody::applyForce(const Vect& force, const Vector2& offset) +void PhysicsBody::applyForce(const Vect& force, const Vec2& offset) { if (_dynamic && _mass != PHYSICS_INFINITY) { @@ -426,10 +426,10 @@ void PhysicsBody::resetForces() void PhysicsBody::applyImpulse(const Vect& impulse) { - applyImpulse(impulse, Vector2()); + applyImpulse(impulse, Vec2()); } -void PhysicsBody::applyImpulse(const Vect& impulse, const Vector2& offset) +void PhysicsBody::applyImpulse(const Vect& impulse, const Vec2& offset) { cpBodyApplyImpulse(_info->getBody(), PhysicsHelper::point2cpv(impulse), PhysicsHelper::point2cpv(offset)); } @@ -563,7 +563,7 @@ void PhysicsBody::addMoment(float moment) } } -void PhysicsBody::setVelocity(const Vector2& velocity) +void PhysicsBody::setVelocity(const Vec2& velocity) { if (!_dynamic) { @@ -574,17 +574,17 @@ void PhysicsBody::setVelocity(const Vector2& velocity) cpBodySetVel(_info->getBody(), PhysicsHelper::point2cpv(velocity)); } -Vector2 PhysicsBody::getVelocity() +Vec2 PhysicsBody::getVelocity() { return PhysicsHelper::cpv2point(cpBodyGetVel(_info->getBody())); } -Vector2 PhysicsBody::getVelocityAtLocalPoint(const Vector2& point) +Vec2 PhysicsBody::getVelocityAtLocalPoint(const Vec2& point) { return PhysicsHelper::cpv2point(cpBodyGetVelAtLocalPoint(_info->getBody(), PhysicsHelper::point2cpv(point))); } -Vector2 PhysicsBody::getVelocityAtWorldPoint(const Vector2& point) +Vec2 PhysicsBody::getVelocityAtWorldPoint(const Vec2& point) { return PhysicsHelper::cpv2point(cpBodyGetVelAtWorldPoint(_info->getBody(), PhysicsHelper::point2cpv(point))); } @@ -766,7 +766,7 @@ void PhysicsBody::update(float delta) Node* parent = _node->getParent(); Scene* scene = &_world->getScene(); - Vector2 position = parent != scene ? parent->convertToNodeSpace(scene->convertToWorldSpace(getPosition())) : getPosition(); + Vec2 position = parent != scene ? parent->convertToNodeSpace(scene->convertToWorldSpace(getPosition())) : getPosition(); float rotation = getRotation(); for (; parent != scene; parent = parent->getParent()) { @@ -828,17 +828,17 @@ void PhysicsBody::setGroup(int group) } } -void PhysicsBody::setPositionOffset(const Vector2& position) +void PhysicsBody::setPositionOffset(const Vec2& position) { if (!_positionOffset.equals(position)) { - Vector2 pos = getPosition(); + Vec2 pos = getPosition(); _positionOffset = position; setPosition(pos); } } -Vector2 PhysicsBody::getPositionOffset() const +Vec2 PhysicsBody::getPositionOffset() const { return _positionOffset; } @@ -858,12 +858,12 @@ float PhysicsBody::getRotationOffset() const return _rotationOffset; } -Vector2 PhysicsBody::world2Local(const Vector2& point) +Vec2 PhysicsBody::world2Local(const Vec2& point) { return PhysicsHelper::cpv2point(cpBodyWorld2Local(_info->getBody(), PhysicsHelper::point2cpv(point))); } -Vector2 PhysicsBody::local2World(const Vector2& point) +Vec2 PhysicsBody::local2World(const Vec2& point) { return PhysicsHelper::cpv2point(cpBodyLocal2World(_info->getBody(), PhysicsHelper::point2cpv(point))); } diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index e23bdd59ad..148c103b81 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -41,7 +41,7 @@ class PhysicsWorld; class PhysicsJoint; class PhysicsBodyInfo; -typedef Vector2 Vect; +typedef Vec2 Vect; const PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.1f, 0.5f, 0.5f); @@ -63,23 +63,23 @@ public: /** create a body with mass and moment. */ static PhysicsBody* create(float mass, float moment); /** Create a body contains a circle shape. */ - static PhysicsBody* createCircle(float radius, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + static PhysicsBody* createCircle(float radius, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); /** Create a body contains a box shape. */ - static PhysicsBody* createBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + static PhysicsBody* createBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); /** * @brief Create a body contains a polygon shape. - * points is an array of Vector2 structs defining a convex hull with a clockwise winding. + * points is an array of Vec2 structs defining a convex hull with a clockwise winding. */ - static PhysicsBody* createPolygon(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + static PhysicsBody* createPolygon(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); /** Create a body contains a EdgeSegment shape. */ - static PhysicsBody* createEdgeSegment(const Vector2& a, const Vector2& b, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); + static PhysicsBody* createEdgeSegment(const Vec2& a, const Vec2& b, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); /** Create a body contains a EdgeBox shape. */ - static PhysicsBody* createEdgeBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1, const Vector2& offset = Vector2::ZERO); + static PhysicsBody* createEdgeBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1, const Vec2& offset = Vec2::ZERO); /** Create a body contains a EdgePolygon shape. */ - static PhysicsBody* createEdgePolygon(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); + static PhysicsBody* createEdgePolygon(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); /** Create a body contains a EdgeChain shape. */ - static PhysicsBody* createEdgeChain(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); + static PhysicsBody* createEdgeChain(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1); /* * @brief add a shape to body @@ -111,26 +111,26 @@ public: /** Applies a immediate force to body. */ virtual void applyForce(const Vect& force); /** Applies a immediate force to body. */ - virtual void applyForce(const Vect& force, const Vector2& offset); + virtual void applyForce(const Vect& force, const Vec2& offset); /** reset all the force applied to body. */ virtual void resetForces(); /** Applies a continuous force to body. */ virtual void applyImpulse(const Vect& impulse); /** Applies a continuous force to body. */ - virtual void applyImpulse(const Vect& impulse, const Vector2& offset); + virtual void applyImpulse(const Vect& impulse, const Vec2& offset); /** Applies a torque force to body. */ virtual void applyTorque(float torque); /** set the velocity of a body */ virtual void setVelocity(const Vect& velocity); /** get the velocity of a body */ - virtual Vector2 getVelocity(); + virtual Vec2 getVelocity(); /** set the angular velocity of a body */ virtual void setAngularVelocity(float velocity); /** get the angular velocity of a body at a local point */ - virtual Vector2 getVelocityAtLocalPoint(const Vector2& point); + virtual Vec2 getVelocityAtLocalPoint(const Vec2& point); /** get the angular velocity of a body at a world point */ - virtual Vector2 getVelocityAtWorldPoint(const Vector2& point); + virtual Vec2 getVelocityAtWorldPoint(const Vec2& point); /** get the angular velocity of a body */ virtual float getAngularVelocity(); /** set the max of velocity */ @@ -188,14 +188,14 @@ public: inline int getGroup() const { return _group; } /** get the body position. */ - Vector2 getPosition() const; + Vec2 getPosition() const; /** get the body rotation. */ float getRotation() const; /** set body position offset, it's the position witch relative to node */ - void setPositionOffset(const Vector2& position); + void setPositionOffset(const Vec2& position); /** get body position offset. */ - Vector2 getPositionOffset() const; + Vec2 getPositionOffset() const; /** set body rotation offset, it's the rotation witch relative to node */ void setRotationOffset(float rotation); /** set the body rotation offset */ @@ -293,15 +293,15 @@ public: inline void setTag(int tag) { _tag = tag; } /** convert the world point to local */ - Vector2 world2Local(const Vector2& point); + Vec2 world2Local(const Vec2& point); /** convert the local point to world */ - Vector2 local2World(const Vector2& point); + Vec2 local2World(const Vec2& point); protected: bool init(); - virtual void setPosition(Vector2 position); + virtual void setPosition(Vec2 position); virtual void setRotation(float rotation); void update(float delta); @@ -342,7 +342,7 @@ protected: bool _positionResetTag; /// To avoid reset the body position when body invoke Node::setPosition(). bool _rotationResetTag; /// To avoid reset the body rotation when body invoke Node::setRotation(). - Vector2 _positionOffset; + Vec2 _positionOffset; float _rotationOffset; friend class PhysicsWorld; diff --git a/cocos/physics/CCPhysicsContact.cpp b/cocos/physics/CCPhysicsContact.cpp index b8b52b9831..77d09087c0 100644 --- a/cocos/physics/CCPhysicsContact.cpp +++ b/cocos/physics/CCPhysicsContact.cpp @@ -106,7 +106,7 @@ void PhysicsContact::generateContactData() _contactData->points[i] = PhysicsHelper::cpv2point(cpArbiterGetPoint(arb, i)); } - _contactData->normal = _contactData->count > 0 ? PhysicsHelper::cpv2point(cpArbiterGetNormal(arb, 0)) : Vector2::ZERO; + _contactData->normal = _contactData->count > 0 ? PhysicsHelper::cpv2point(cpArbiterGetNormal(arb, 0)) : Vec2::ZERO; } // PhysicsContactPreSolve implementation @@ -129,7 +129,7 @@ float PhysicsContactPreSolve::getFriction() const return static_cast(_contactInfo)->u; } -Vector2 PhysicsContactPreSolve::getSurfaceVelocity() const +Vec2 PhysicsContactPreSolve::getSurfaceVelocity() const { return PhysicsHelper::cpv2point(static_cast(_contactInfo)->surface_vr); } @@ -176,7 +176,7 @@ float PhysicsContactPostSolve::getFriction() const return static_cast(_contactInfo)->u; } -Vector2 PhysicsContactPostSolve::getSurfaceVelocity() const +Vec2 PhysicsContactPostSolve::getSurfaceVelocity() const { return PhysicsHelper::cpv2point(static_cast(_contactInfo)->surface_vr); } diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index 44f120d034..b67510cf9e 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -42,14 +42,14 @@ class PhysicsWorld; class PhysicsContactInfo; -typedef Vector2 Vect; +typedef Vec2 Vect; typedef struct PhysicsContactData { static const int POINT_MAX = 4; - Vector2 points[POINT_MAX]; + Vec2 points[POINT_MAX]; int count; - Vector2 normal; + Vec2 normal; PhysicsContactData() : count(0) @@ -137,7 +137,7 @@ public: /** get friction between two bodies*/ float getFriction() const; /** get surface velocity between two bodies*/ - Vector2 getSurfaceVelocity() const; + Vec2 getSurfaceVelocity() const; /** set the restitution*/ void setRestitution(float restitution); /** set the friction*/ @@ -168,7 +168,7 @@ public: /** get friction between two bodies*/ float getFriction() const; /** get surface velocity between two bodies*/ - Vector2 getSurfaceVelocity() const; + Vec2 getSurfaceVelocity() const; private: PhysicsContactPostSolve(void* contactInfo); diff --git a/cocos/physics/CCPhysicsJoint.cpp b/cocos/physics/CCPhysicsJoint.cpp index 5a5aaec1ae..bb5eb31766 100644 --- a/cocos/physics/CCPhysicsJoint.cpp +++ b/cocos/physics/CCPhysicsJoint.cpp @@ -162,7 +162,7 @@ float PhysicsJoint::getMaxForce() const return PhysicsHelper::cpfloat2float(_info->getJoints().front()->maxForce); } -PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr) +PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr) { PhysicsJointFixed* joint = new PhysicsJointFixed(); @@ -175,7 +175,7 @@ PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, return nullptr; } -bool PhysicsJointFixed::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr) +bool PhysicsJointFixed::init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr) { do { @@ -203,7 +203,7 @@ bool PhysicsJointFixed::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anch return false; } -PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr) +PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr) { PhysicsJointPin* joint = new PhysicsJointPin(); @@ -216,7 +216,7 @@ PhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, cons return nullptr; } -bool PhysicsJointPin::init(PhysicsBody *a, PhysicsBody *b, const Vector2& anchr) +bool PhysicsJointPin::init(PhysicsBody *a, PhysicsBody *b, const Vec2& anchr) { do { @@ -234,7 +234,7 @@ bool PhysicsJointPin::init(PhysicsBody *a, PhysicsBody *b, const Vector2& anchr) return false; } -PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float min, float max) +PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float min, float max) { PhysicsJointLimit* joint = new PhysicsJointLimit(); @@ -247,12 +247,12 @@ PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, return nullptr; } -PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2) +PhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2) { return construct(a, b, anchr1, anchr2, 0, b->local2World(anchr1).getDistance(a->local2World(anchr2))); } -bool PhysicsJointLimit::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float min, float max) +bool PhysicsJointLimit::init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float min, float max) { do { @@ -294,27 +294,27 @@ void PhysicsJointLimit::setMax(float max) cpSlideJointSetMax(_info->getJoints().front(), PhysicsHelper::float2cpfloat(max)); } -Vector2 PhysicsJointLimit::getAnchr1() const +Vec2 PhysicsJointLimit::getAnchr1() const { return PhysicsHelper::cpv2point(cpSlideJointGetAnchr1(_info->getJoints().front())); } -void PhysicsJointLimit::setAnchr1(const Vector2& anchr) +void PhysicsJointLimit::setAnchr1(const Vec2& anchr) { cpSlideJointSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr)); } -Vector2 PhysicsJointLimit::getAnchr2() const +Vec2 PhysicsJointLimit::getAnchr2() const { return PhysicsHelper::cpv2point(cpSlideJointGetAnchr2(_info->getJoints().front())); } -void PhysicsJointLimit::setAnchr2(const Vector2& anchr) +void PhysicsJointLimit::setAnchr2(const Vec2& anchr) { cpSlideJointSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr)); } -PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2) +PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2) { PhysicsJointDistance* joint = new PhysicsJointDistance(); @@ -327,7 +327,7 @@ PhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, PhysicsBod return nullptr; } -bool PhysicsJointDistance::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2) +bool PhysicsJointDistance::init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2) { do { @@ -358,7 +358,7 @@ void PhysicsJointDistance::setDistance(float distance) cpPinJointSetDist(_info->getJoints().front(), PhysicsHelper::float2cpfloat(distance)); } -PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float stiffness, float damping) +PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float stiffness, float damping) { PhysicsJointSpring* joint = new PhysicsJointSpring(); @@ -371,7 +371,7 @@ PhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, PhysicsBody* b return nullptr; } -bool PhysicsJointSpring::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float stiffness, float damping) +bool PhysicsJointSpring::init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float stiffness, float damping) { do { CC_BREAK_IF(!PhysicsJoint::init(a, b)); @@ -394,22 +394,22 @@ bool PhysicsJointSpring::init(PhysicsBody* a, PhysicsBody* b, const Vector2& anc return false; } -Vector2 PhysicsJointSpring::getAnchr1() const +Vec2 PhysicsJointSpring::getAnchr1() const { return PhysicsHelper::cpv2point(cpDampedSpringGetAnchr1(_info->getJoints().front())); } -void PhysicsJointSpring::setAnchr1(const Vector2& anchr) +void PhysicsJointSpring::setAnchr1(const Vec2& anchr) { cpDampedSpringSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr)); } -Vector2 PhysicsJointSpring::getAnchr2() const +Vec2 PhysicsJointSpring::getAnchr2() const { return PhysicsHelper::cpv2point(cpDampedSpringGetAnchr2(_info->getJoints().front())); } -void PhysicsJointSpring::setAnchr2(const Vector2& anchr) +void PhysicsJointSpring::setAnchr2(const Vec2& anchr) { cpDampedSpringSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr)); } @@ -444,7 +444,7 @@ void PhysicsJointSpring::setDamping(float damping) cpDampedSpringSetDamping(_info->getJoints().front(), PhysicsHelper::float2cpfloat(damping)); } -PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, PhysicsBody* b, const Vector2& grooveA, const Vector2& grooveB, const Vector2& anchr2) +PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& grooveA, const Vec2& grooveB, const Vec2& anchr2) { PhysicsJointGroove* joint = new PhysicsJointGroove(); @@ -457,7 +457,7 @@ PhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, PhysicsBody* b return nullptr; } -bool PhysicsJointGroove::init(PhysicsBody* a, PhysicsBody* b, const Vector2& grooveA, const Vector2& grooveB, const Vector2& anchr2) +bool PhysicsJointGroove::init(PhysicsBody* a, PhysicsBody* b, const Vec2& grooveA, const Vec2& grooveB, const Vec2& anchr2) { do { CC_BREAK_IF(!PhysicsJoint::init(a, b)); @@ -478,32 +478,32 @@ bool PhysicsJointGroove::init(PhysicsBody* a, PhysicsBody* b, const Vector2& gro return false; } -Vector2 PhysicsJointGroove::getGrooveA() const +Vec2 PhysicsJointGroove::getGrooveA() const { return PhysicsHelper::cpv2point(cpGrooveJointGetGrooveA(_info->getJoints().front())); } -void PhysicsJointGroove::setGrooveA(const Vector2& grooveA) +void PhysicsJointGroove::setGrooveA(const Vec2& grooveA) { cpGrooveJointSetGrooveA(_info->getJoints().front(), PhysicsHelper::point2cpv(grooveA)); } -Vector2 PhysicsJointGroove::getGrooveB() const +Vec2 PhysicsJointGroove::getGrooveB() const { return PhysicsHelper::cpv2point(cpGrooveJointGetGrooveB(_info->getJoints().front())); } -void PhysicsJointGroove::setGrooveB(const Vector2& grooveB) +void PhysicsJointGroove::setGrooveB(const Vec2& grooveB) { cpGrooveJointSetGrooveB(_info->getJoints().front(), PhysicsHelper::point2cpv(grooveB)); } -Vector2 PhysicsJointGroove::getAnchr2() const +Vec2 PhysicsJointGroove::getAnchr2() const { return PhysicsHelper::cpv2point(cpGrooveJointGetAnchr2(_info->getJoints().front())); } -void PhysicsJointGroove::setAnchr2(const Vector2& anchr2) +void PhysicsJointGroove::setAnchr2(const Vec2& anchr2) { cpGrooveJointSetAnchr2(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr2)); } diff --git a/cocos/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h index 085990c884..e892b29032 100644 --- a/cocos/physics/CCPhysicsJoint.h +++ b/cocos/physics/CCPhysicsJoint.h @@ -100,10 +100,10 @@ protected: class PhysicsJointFixed : public PhysicsJoint { public: - static PhysicsJointFixed* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr); + static PhysicsJointFixed* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); protected: PhysicsJointFixed() {} @@ -116,20 +116,20 @@ protected: class PhysicsJointLimit : public PhysicsJoint { public: - static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2); - static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float min, float max); + static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2); + static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float min, float max); - Vector2 getAnchr1() const; - void setAnchr1(const Vector2& anchr1); - Vector2 getAnchr2() const; - void setAnchr2(const Vector2& anchr2); + Vec2 getAnchr1() const; + void setAnchr1(const Vec2& anchr1); + Vec2 getAnchr2() const; + void setAnchr2(const Vec2& anchr2); float getMin() const; void setMin(float min); float getMax() const; void setMax(float max); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float min, float max); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float min, float max); protected: PhysicsJointLimit() {} @@ -142,10 +142,10 @@ protected: class PhysicsJointPin : public PhysicsJoint { public: - static PhysicsJointPin* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr); + static PhysicsJointPin* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr); protected: PhysicsJointPin() {} @@ -156,13 +156,13 @@ protected: class PhysicsJointDistance : public PhysicsJoint { public: - static PhysicsJointDistance* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2); + static PhysicsJointDistance* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2); float getDistance() const; void setDistance(float distance); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2); protected: PhysicsJointDistance() {} @@ -173,11 +173,11 @@ protected: class PhysicsJointSpring : public PhysicsJoint { public: - static PhysicsJointSpring* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float stiffness, float damping); - Vector2 getAnchr1() const; - void setAnchr1(const Vector2& anchr1); - Vector2 getAnchr2() const; - void setAnchr2(const Vector2& anchr2); + static PhysicsJointSpring* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float stiffness, float damping); + Vec2 getAnchr1() const; + void setAnchr1(const Vec2& anchr1); + Vec2 getAnchr2() const; + void setAnchr2(const Vec2& anchr2); float getRestLength() const; void setRestLength(float restLength); float getStiffness() const; @@ -186,7 +186,7 @@ public: void setDamping(float damping); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& anchr1, const Vector2& anchr2, float stiffness, float damping); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr1, const Vec2& anchr2, float stiffness, float damping); protected: PhysicsJointSpring() {} @@ -197,17 +197,17 @@ protected: class PhysicsJointGroove : public PhysicsJoint { public: - static PhysicsJointGroove* construct(PhysicsBody* a, PhysicsBody* b, const Vector2& grooveA, const Vector2& grooveB, const Vector2& anchr2); + static PhysicsJointGroove* construct(PhysicsBody* a, PhysicsBody* b, const Vec2& grooveA, const Vec2& grooveB, const Vec2& anchr2); - Vector2 getGrooveA() const; - void setGrooveA(const Vector2& grooveA); - Vector2 getGrooveB() const; - void setGrooveB(const Vector2& grooveB); - Vector2 getAnchr2() const; - void setAnchr2(const Vector2& anchr2); + Vec2 getGrooveA() const; + void setGrooveA(const Vec2& grooveA); + Vec2 getGrooveB() const; + void setGrooveB(const Vec2& grooveB); + Vec2 getAnchr2() const; + void setAnchr2(const Vec2& anchr2); protected: - bool init(PhysicsBody* a, PhysicsBody* b, const Vector2& grooveA, const Vector2& grooveB, const Vector2& anchr); + bool init(PhysicsBody* a, PhysicsBody* b, const Vec2& grooveA, const Vec2& grooveB, const Vec2& anchr); protected: PhysicsJointGroove() {} diff --git a/cocos/physics/CCPhysicsShape.cpp b/cocos/physics/CCPhysicsShape.cpp index 60171cbec0..d4e74c92e7 100644 --- a/cocos/physics/CCPhysicsShape.cpp +++ b/cocos/physics/CCPhysicsShape.cpp @@ -229,14 +229,14 @@ void PhysicsShape::setFriction(float friction) } -void PhysicsShape::recenterPoints(Vector2* points, int count, const Vector2& center) +void PhysicsShape::recenterPoints(Vec2* points, int count, const Vec2& center) { cpVect* cpvs = new cpVect[count]; cpRecenterPoly(count, PhysicsHelper::points2cpvs(points, cpvs, count)); PhysicsHelper::cpvs2points(cpvs, points, count); delete[] cpvs; - if (center != Vector2::ZERO) + if (center != Vec2::ZERO) { for (int i = 0; i < count; ++i) { @@ -245,7 +245,7 @@ void PhysicsShape::recenterPoints(Vector2* points, int count, const Vector2& cen } } -Vector2 PhysicsShape::getPolyonCenter(const Vector2* points, int count) +Vec2 PhysicsShape::getPolyonCenter(const Vec2* points, int count) { cpVect* cpvs = new cpVect[count]; cpVect center = cpCentroidForPoly(count, PhysicsHelper::points2cpvs(points, cpvs, count)); @@ -279,7 +279,7 @@ void PhysicsShape::setBody(PhysicsBody *body) } // PhysicsShapeCircle -PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset/* = Vector2(0, 0)*/) +PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset/* = Vec2(0, 0)*/) { PhysicsShapeCircle* shape = new PhysicsShapeCircle(); if (shape && shape->init(radius, material, offset)) @@ -292,7 +292,7 @@ PhysicsShapeCircle* PhysicsShapeCircle::create(float radius, const PhysicsMateri return nullptr; } -bool PhysicsShapeCircle::init(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset /*= Vector2(0, 0)*/) +bool PhysicsShapeCircle::init(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset /*= Vec2(0, 0)*/) { do { @@ -320,7 +320,7 @@ float PhysicsShapeCircle::calculateArea(float radius) return PhysicsHelper::cpfloat2float(cpAreaForCircle(0, radius)); } -float PhysicsShapeCircle::calculateMoment(float mass, float radius, const Vector2& offset) +float PhysicsShapeCircle::calculateMoment(float mass, float radius, const Vec2& offset) { return mass == PHYSICS_INFINITY ? PHYSICS_INFINITY : PhysicsHelper::cpfloat2float(cpMomentForCircle(PhysicsHelper::float2cpfloat(mass), @@ -350,13 +350,13 @@ float PhysicsShapeCircle::getRadius() const return PhysicsHelper::cpfloat2float(cpCircleShapeGetRadius(_info->getShapes().front())); } -Vector2 PhysicsShapeCircle::getOffset() +Vec2 PhysicsShapeCircle::getOffset() { return PhysicsHelper::cpv2point(cpCircleShapeGetOffset(_info->getShapes().front())); } // PhysicsShapeEdgeSegment -PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vector2& a, const Vector2& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vec2& a, const Vec2& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { PhysicsShapeEdgeSegment* shape = new PhysicsShapeEdgeSegment(); if (shape && shape->init(a, b, material, border)) @@ -369,7 +369,7 @@ PhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Vector2& a, const return nullptr; } -bool PhysicsShapeEdgeSegment::init(const Vector2& a, const Vector2& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +bool PhysicsShapeEdgeSegment::init(const Vec2& a, const Vec2& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { do { @@ -397,23 +397,23 @@ bool PhysicsShapeEdgeSegment::init(const Vector2& a, const Vector2& b, const Phy return false; } -Vector2 PhysicsShapeEdgeSegment::getPointA() const +Vec2 PhysicsShapeEdgeSegment::getPointA() const { return PhysicsHelper::cpv2point(((cpSegmentShape*)(_info->getShapes().front()))->ta); } -Vector2 PhysicsShapeEdgeSegment::getPointB() const +Vec2 PhysicsShapeEdgeSegment::getPointB() const { return PhysicsHelper::cpv2point(((cpSegmentShape*)(_info->getShapes().front()))->tb); } -Vector2 PhysicsShapeEdgeSegment::getCenter() +Vec2 PhysicsShapeEdgeSegment::getCenter() { return _center; } // PhysicsShapeBox -PhysicsShapeBox* PhysicsShapeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset/* = Vector2(0, 0)*/) +PhysicsShapeBox* PhysicsShapeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset/* = Vec2(0, 0)*/) { PhysicsShapeBox* shape = new PhysicsShapeBox(); if (shape && shape->init(size, material, offset)) @@ -426,7 +426,7 @@ PhysicsShapeBox* PhysicsShapeBox::create(const Size& size, const PhysicsMaterial return nullptr; } -bool PhysicsShapeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset /*= Vector2(0, 0)*/) +bool PhysicsShapeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset /*= Vec2(0, 0)*/) { do { @@ -467,7 +467,7 @@ float PhysicsShapeBox::calculateArea(const Size& size) return PhysicsHelper::cpfloat2float(cpAreaForPoly(4, vec)); } -float PhysicsShapeBox::calculateMoment(float mass, const Size& size, const Vector2& offset) +float PhysicsShapeBox::calculateMoment(float mass, const Size& size, const Vec2& offset) { cpVect wh = PhysicsHelper::size2cpv(size); cpVect vec[4] = @@ -495,7 +495,7 @@ float PhysicsShapeBox::calculateDefaultMoment() : PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, ((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts, cpvzero)); } -void PhysicsShapeBox::getPoints(Vector2* points) const +void PhysicsShapeBox::getPoints(Vec2* points) const { cpShape* shape = _info->getShapes().front(); PhysicsHelper::cpvs2points(((cpPolyShape*)shape)->verts, points, ((cpPolyShape*)shape)->numVerts); @@ -509,7 +509,7 @@ Size PhysicsShapeBox::getSize() const } // PhysicsShapePolygon -PhysicsShapePolygon* PhysicsShapePolygon::create(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset/* = Vector2(0, 0)*/) +PhysicsShapePolygon* PhysicsShapePolygon::create(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset/* = Vec2(0, 0)*/) { PhysicsShapePolygon* shape = new PhysicsShapePolygon(); if (shape && shape->init(points, count, material, offset)) @@ -522,7 +522,7 @@ PhysicsShapePolygon* PhysicsShapePolygon::create(const Vector2* points, int coun return nullptr; } -bool PhysicsShapePolygon::init(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Vector2& offset/* = Vector2(0, 0)*/) +bool PhysicsShapePolygon::init(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Vec2& offset/* = Vec2(0, 0)*/) { do { @@ -550,7 +550,7 @@ bool PhysicsShapePolygon::init(const Vector2* points, int count, const PhysicsMa return false; } -float PhysicsShapePolygon::calculateArea(const Vector2* points, int count) +float PhysicsShapePolygon::calculateArea(const Vec2* points, int count) { cpVect* vecs = new cpVect[count]; PhysicsHelper::points2cpvs(points, vecs, count); @@ -560,7 +560,7 @@ float PhysicsShapePolygon::calculateArea(const Vector2* points, int count) return area; } -float PhysicsShapePolygon::calculateMoment(float mass, const Vector2* points, int count, const Vector2& offset) +float PhysicsShapePolygon::calculateMoment(float mass, const Vec2* points, int count, const Vec2& offset) { cpVect* vecs = new cpVect[count]; PhysicsHelper::points2cpvs(points, vecs, count); @@ -584,12 +584,12 @@ float PhysicsShapePolygon::calculateDefaultMoment() : PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, ((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts, cpvzero)); } -Vector2 PhysicsShapePolygon::getPoint(int i) const +Vec2 PhysicsShapePolygon::getPoint(int i) const { return PhysicsHelper::cpv2point(cpPolyShapeGetVert(_info->getShapes().front(), i)); } -void PhysicsShapePolygon::getPoints(Vector2* outPoints) const +void PhysicsShapePolygon::getPoints(Vec2* outPoints) const { cpShape* shape = _info->getShapes().front(); PhysicsHelper::cpvs2points(((cpPolyShape*)shape)->verts, outPoints, ((cpPolyShape*)shape)->numVerts); @@ -600,13 +600,13 @@ int PhysicsShapePolygon::getPointsCount() const return ((cpPolyShape*)_info->getShapes().front())->numVerts; } -Vector2 PhysicsShapePolygon::getCenter() +Vec2 PhysicsShapePolygon::getCenter() { return _center; } // PhysicsShapeEdgeBox -PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Vector2& offset/* = Vector2(0, 0)*/) +PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Vec2& offset/* = Vec2(0, 0)*/) { PhysicsShapeEdgeBox* shape = new PhysicsShapeEdgeBox(); if (shape && shape->init(size, material, border, offset)) @@ -619,17 +619,17 @@ PhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Size& size, const Physics return nullptr; } -bool PhysicsShapeEdgeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Vector2& offset/*= Vector2(0, 0)*/) +bool PhysicsShapeEdgeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Vec2& offset/*= Vec2(0, 0)*/) { do { CC_BREAK_IF(!PhysicsShape::init(Type::EDGEBOX)); cpVect vec[4] = {}; - vec[0] = PhysicsHelper::point2cpv(Vector2(-size.width/2+offset.x, -size.height/2+offset.y)); - vec[1] = PhysicsHelper::point2cpv(Vector2(+size.width/2+offset.x, -size.height/2+offset.y)); - vec[2] = PhysicsHelper::point2cpv(Vector2(+size.width/2+offset.x, +size.height/2+offset.y)); - vec[3] = PhysicsHelper::point2cpv(Vector2(-size.width/2+offset.x, +size.height/2+offset.y)); + vec[0] = PhysicsHelper::point2cpv(Vec2(-size.width/2+offset.x, -size.height/2+offset.y)); + vec[1] = PhysicsHelper::point2cpv(Vec2(+size.width/2+offset.x, -size.height/2+offset.y)); + vec[2] = PhysicsHelper::point2cpv(Vec2(+size.width/2+offset.x, +size.height/2+offset.y)); + vec[3] = PhysicsHelper::point2cpv(Vec2(-size.width/2+offset.x, +size.height/2+offset.y)); int i = 0; for (; i < 4; ++i) @@ -653,7 +653,7 @@ bool PhysicsShapeEdgeBox::init(const Size& size, const PhysicsMaterial& material return false; } -void PhysicsShapeEdgeBox::getPoints(cocos2d::Vector2 *outPoints) const +void PhysicsShapeEdgeBox::getPoints(cocos2d::Vec2 *outPoints) const { int i = 0; for(auto shape : _info->getShapes()) @@ -663,7 +663,7 @@ void PhysicsShapeEdgeBox::getPoints(cocos2d::Vector2 *outPoints) const } // PhysicsShapeEdgeBox -PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { PhysicsShapeEdgePolygon* shape = new PhysicsShapeEdgePolygon(); if (shape && shape->init(points, count, material, border)) @@ -676,7 +676,7 @@ PhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Vector2* points, return nullptr; } -bool PhysicsShapeEdgePolygon::init(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +bool PhysicsShapeEdgePolygon::init(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { cpVect* vec = nullptr; do @@ -714,12 +714,12 @@ bool PhysicsShapeEdgePolygon::init(const Vector2* points, int count, const Physi return false; } -Vector2 PhysicsShapeEdgePolygon::getCenter() +Vec2 PhysicsShapeEdgePolygon::getCenter() { return _center; } -void PhysicsShapeEdgePolygon::getPoints(cocos2d::Vector2 *outPoints) const +void PhysicsShapeEdgePolygon::getPoints(cocos2d::Vec2 *outPoints) const { int i = 0; for(auto shape : _info->getShapes()) @@ -734,7 +734,7 @@ int PhysicsShapeEdgePolygon::getPointsCount() const } // PhysicsShapeEdgeChain -PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { PhysicsShapeEdgeChain* shape = new PhysicsShapeEdgeChain(); if (shape && shape->init(points, count, material, border)) @@ -747,7 +747,7 @@ PhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Vector2* points, int return nullptr; } -bool PhysicsShapeEdgeChain::init(const Vector2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) +bool PhysicsShapeEdgeChain::init(const Vec2* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/) { cpVect* vec = nullptr; do @@ -784,12 +784,12 @@ bool PhysicsShapeEdgeChain::init(const Vector2* points, int count, const Physics return false; } -Vector2 PhysicsShapeEdgeChain::getCenter() +Vec2 PhysicsShapeEdgeChain::getCenter() { return _center; } -void PhysicsShapeEdgeChain::getPoints(Vector2* outPoints) const +void PhysicsShapeEdgeChain::getPoints(Vec2* outPoints) const { int i = 0; for(auto shape : _info->getShapes()) @@ -818,7 +818,7 @@ void PhysicsShape::setGroup(int group) _group = group; } -bool PhysicsShape::containsPoint(const Vector2& point) const +bool PhysicsShape::containsPoint(const Vec2& point) const { for (auto shape : _info->getShapes()) { diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index f8a4f4e988..e677692fc0 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -107,16 +107,16 @@ public: /** Calculate the default moment value */ virtual float calculateDefaultMoment() { return 0.0f; } /** Get offset */ - virtual Vector2 getOffset() { return Vector2::ZERO; } + virtual Vec2 getOffset() { return Vec2::ZERO; } /** Get center of this shape */ - virtual Vector2 getCenter() { return getOffset(); } + virtual Vec2 getCenter() { return getOffset(); } /** Test point is in shape or not */ - bool containsPoint(const Vector2& point) const; + bool containsPoint(const Vec2& point) const; /** move the points to the center */ - static void recenterPoints(Vector2* points, int count, const Vector2& center = Vector2::ZERO); + static void recenterPoints(Vec2* points, int count, const Vec2& center = Vec2::ZERO); /** get center of the polyon points */ - static Vector2 getPolyonCenter(const Vector2* points, int count); + static Vec2 getPolyonCenter(const Vec2* points, int count); /** * A mask that defines which categories this physics body belongs to. @@ -184,16 +184,16 @@ protected: class PhysicsShapeCircle : public PhysicsShape { public: - static PhysicsShapeCircle* create(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2(0, 0)); + static PhysicsShapeCircle* create(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2(0, 0)); static float calculateArea(float radius); - static float calculateMoment(float mass, float radius, const Vector2& offset = Vector2::ZERO); + static float calculateMoment(float mass, float radius, const Vec2& offset = Vec2::ZERO); virtual float calculateDefaultMoment() override; float getRadius() const; - virtual Vector2 getOffset() override; + virtual Vec2 getOffset() override; protected: - bool init(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + bool init(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); virtual float calculateArea() override; protected: @@ -205,19 +205,19 @@ protected: class PhysicsShapeBox : public PhysicsShape { public: - static PhysicsShapeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + static PhysicsShapeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); static float calculateArea(const Size& size); - static float calculateMoment(float mass, const Size& size, const Vector2& offset = Vector2::ZERO); + static float calculateMoment(float mass, const Size& size, const Vec2& offset = Vec2::ZERO); virtual float calculateDefaultMoment() override; - void getPoints(Vector2* outPoints) const; + void getPoints(Vec2* outPoints) const; int getPointsCount() const { return 4; } Size getSize() const; - virtual Vector2 getOffset() override { return _offset; } + virtual Vec2 getOffset() override { return _offset; } protected: - bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); virtual float calculateArea() override; protected: @@ -225,25 +225,25 @@ protected: virtual ~PhysicsShapeBox(); protected: - Vector2 _offset; + Vec2 _offset; }; /** A polygon shape */ class PhysicsShapePolygon : public PhysicsShape { public: - static PhysicsShapePolygon* create(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); - static float calculateArea(const Vector2* points, int count); - static float calculateMoment(float mass, const Vector2* points, int count, const Vector2& offset = Vector2::ZERO); + static PhysicsShapePolygon* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); + static float calculateArea(const Vec2* points, int count); + static float calculateMoment(float mass, const Vec2* points, int count, const Vec2& offset = Vec2::ZERO); float calculateDefaultMoment() override; - Vector2 getPoint(int i) const; - void getPoints(Vector2* outPoints) const; + Vec2 getPoint(int i) const; + void getPoints(Vec2* outPoints) const; int getPointsCount() const; - virtual Vector2 getCenter() override; + virtual Vec2 getCenter() override; protected: - bool init(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vector2& offset = Vector2::ZERO); + bool init(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Vec2& offset = Vec2::ZERO); float calculateArea() override; protected: @@ -251,28 +251,28 @@ protected: virtual ~PhysicsShapePolygon(); protected: - Vector2 _center; + Vec2 _center; }; /** A segment shape */ class PhysicsShapeEdgeSegment : public PhysicsShape { public: - static PhysicsShapeEdgeSegment* create(const Vector2& a, const Vector2& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + static PhysicsShapeEdgeSegment* create(const Vec2& a, const Vec2& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); - Vector2 getPointA() const; - Vector2 getPointB() const; - virtual Vector2 getCenter() override; + Vec2 getPointA() const; + Vec2 getPointB() const; + virtual Vec2 getCenter() override; protected: - bool init(const Vector2& a, const Vector2& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + bool init(const Vec2& a, const Vec2& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); protected: PhysicsShapeEdgeSegment(); virtual ~PhysicsShapeEdgeSegment(); protected: - Vector2 _center; + Vec2 _center; friend class PhysicsBody; }; @@ -281,20 +281,20 @@ protected: class PhysicsShapeEdgeBox : public PhysicsShape { public: - static PhysicsShapeEdgeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 0, const Vector2& offset = Vector2::ZERO); - virtual Vector2 getOffset() override { return _offset; } - void getPoints(Vector2* outPoints) const; + static PhysicsShapeEdgeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 0, const Vec2& offset = Vec2::ZERO); + virtual Vec2 getOffset() override { return _offset; } + void getPoints(Vec2* outPoints) const; int getPointsCount() const { return 4; } protected: - bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1, const Vector2& offset = Vector2::ZERO); + bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1, const Vec2& offset = Vec2::ZERO); protected: PhysicsShapeEdgeBox(); virtual ~PhysicsShapeEdgeBox(); protected: - Vector2 _offset; + Vec2 _offset; friend class PhysicsBody; }; @@ -303,13 +303,13 @@ protected: class PhysicsShapeEdgePolygon : public PhysicsShape { public: - static PhysicsShapeEdgePolygon* create(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); - virtual Vector2 getCenter() override; - void getPoints(Vector2* outPoints) const; + static PhysicsShapeEdgePolygon* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + virtual Vec2 getCenter() override; + void getPoints(Vec2* outPoints) const; int getPointsCount() const; protected: - bool init(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + bool init(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); protected: PhysicsShapeEdgePolygon(); @@ -318,27 +318,27 @@ protected: friend class PhysicsBody; protected: - Vector2 _center; + Vec2 _center; }; /** a chain shape */ class PhysicsShapeEdgeChain : public PhysicsShape { public: - static PhysicsShapeEdgeChain* create(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); - virtual Vector2 getCenter() override; - void getPoints(Vector2* outPoints) const; + static PhysicsShapeEdgeChain* create(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + virtual Vec2 getCenter() override; + void getPoints(Vec2* outPoints) const; int getPointsCount() const; protected: - bool init(const Vector2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); + bool init(const Vec2* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1); protected: PhysicsShapeEdgeChain(); virtual ~PhysicsShapeEdgeChain(); protected: - Vector2 _center; + Vec2 _center; friend class PhysicsBody; }; diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index 2420b59297..f62a715b63 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -66,8 +66,8 @@ namespace { PhysicsWorld* world; PhysicsRayCastCallbackFunc func; - Vector2 p1; - Vector2 p2; + Vec2 p1; + Vec2 p2; void* data; }RayCastCallbackInfo; @@ -153,8 +153,8 @@ void PhysicsWorldCallback::rayCastCallbackFunc(cpShape *shape, cpFloat t, cpVect it->second->getShape(), info->p1, info->p2, - Vector2(info->p1.x+(info->p2.x-info->p1.x)*t, info->p1.y+(info->p2.y-info->p1.y)*t), - Vector2(n.x, n.y), + Vec2(info->p1.x+(info->p2.x-info->p1.x)*t, info->p1.y+(info->p2.y-info->p1.y)*t), + Vec2(n.x, n.y), (float)t, }; @@ -334,7 +334,7 @@ void PhysicsWorld::collisionSeparateCallback(PhysicsContact& contact) _scene->getEventDispatcher()->dispatchEvent(&contact); } -void PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Vector2& point1, const Vector2& point2, void* data) +void PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Vec2& point1, const Vec2& point2, void* data) { CCASSERT(func != nullptr, "func shouldn't be nullptr"); @@ -371,7 +371,7 @@ void PhysicsWorld::queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect } } -void PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Vector2& point, void* data) +void PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Vec2& point, void* data) { CCASSERT(func != nullptr, "func shouldn't be nullptr"); @@ -390,7 +390,7 @@ void PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Vector2& } } -Vector PhysicsWorld::getShapes(const Vector2& point) const +Vector PhysicsWorld::getShapes(const Vec2& point) const { Vector arr; cpSpaceNearestPointQuery(this->_info->getSpace(), @@ -404,7 +404,7 @@ Vector PhysicsWorld::getShapes(const Vector2& point) const return arr; } -PhysicsShape* PhysicsWorld::getShape(const Vector2& point) const +PhysicsShape* PhysicsWorld::getShape(const Vec2& point) const { cpShape* shape = cpSpaceNearestPointQueryNearest(this->_info->getSpace(), PhysicsHelper::point2cpv(point), @@ -905,7 +905,7 @@ void PhysicsWorld::update(float delta) } PhysicsWorld::PhysicsWorld() -: _gravity(Vector2(0.0f, -98.0f)) +: _gravity(Vec2(0.0f, -98.0f)) , _speed(1.0f) , _updateRate(1) , _updateRateCount(0) @@ -965,16 +965,16 @@ void PhysicsDebugDraw::drawShape(PhysicsShape& shape) case CP_CIRCLE_SHAPE: { float radius = PhysicsHelper::cpfloat2float(cpCircleShapeGetRadius(subShape)); - Vector2 centre = PhysicsHelper::cpv2point(cpBodyGetPos(cpShapeGetBody(subShape))) + Vec2 centre = PhysicsHelper::cpv2point(cpBodyGetPos(cpShapeGetBody(subShape))) + PhysicsHelper::cpv2point(cpCircleShapeGetOffset(subShape)); static const int CIRCLE_SEG_NUM = 12; - Vector2 seg[CIRCLE_SEG_NUM] = {}; + Vec2 seg[CIRCLE_SEG_NUM] = {}; for (int i = 0; i < CIRCLE_SEG_NUM; ++i) { float angle = (float)i * M_PI / (float)CIRCLE_SEG_NUM * 2.0f; - Vector2 d(radius * cosf(angle), radius * sinf(angle)); + Vec2 d(radius * cosf(angle), radius * sinf(angle)); seg[i] = centre + d; } _drawNode->drawPolygon(seg, CIRCLE_SEG_NUM, fillColor, 1, outlineColor); @@ -992,7 +992,7 @@ void PhysicsDebugDraw::drawShape(PhysicsShape& shape) { cpPolyShape* poly = (cpPolyShape*)subShape; int num = poly->numVerts; - Vector2* seg = new Vector2[num]; + Vec2* seg = new Vec2[num]; PhysicsHelper::cpvs2points(poly->tVerts, seg, num); diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index 3c7d80b9d4..e091017426 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -42,7 +42,7 @@ class PhysicsWorldInfo; class PhysicsShape; class PhysicsContact; -typedef Vector2 Vect; +typedef Vec2 Vect; class Node; class Sprite; @@ -55,9 +55,9 @@ class PhysicsWorld; typedef struct PhysicsRayCastInfo { PhysicsShape* shape; - Vector2 start; - Vector2 end; //< in lua, it's name is "ended" - Vector2 contact; + Vec2 start; + Vec2 end; //< in lua, it's name is "ended" + Vec2 contact; Vect normal; float fraction; void* data; @@ -105,15 +105,15 @@ public: virtual void removeAllBodies(); /** Searches for physics shapes that intersects the ray. */ - void rayCast(PhysicsRayCastCallbackFunc func, const Vector2& start, const Vector2& end, void* data); + void rayCast(PhysicsRayCastCallbackFunc func, const Vec2& start, const Vec2& end, void* data); /** Searches for physics shapes that contains in the rect. */ void queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect, void* data); /** Searches for physics shapes that contains the point. */ - void queryPoint(PhysicsQueryPointCallbackFunc func, const Vector2& point, void* data); + void queryPoint(PhysicsQueryPointCallbackFunc func, const Vec2& point, void* data); /** Get phsyics shapes that contains the point. */ - Vector getShapes(const Vector2& point) const; + Vector getShapes(const Vec2& point) const; /** return physics shape that contains the point. */ - PhysicsShape* getShape(const Vector2& point) const; + PhysicsShape* getShape(const Vec2& point) const; /** Get all the bodys that in the physics world. */ const Vector& getAllBodies() const; /** Get body by tag */ diff --git a/cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h index 8a3ffcdef1..fde230ad1f 100644 --- a/cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h @@ -37,8 +37,8 @@ NS_CC_BEGIN class PhysicsHelper { public: - static Vector2 cpv2point(const cpVect& vec) { return Vector2(vec.x, vec.y); } - static cpVect point2cpv(const Vector2& point) { return cpv(point.x, point.y); } + static Vec2 cpv2point(const cpVect& vec) { return Vec2(vec.x, vec.y); } + static cpVect point2cpv(const Vec2& point) { return cpv(point.x, point.y); } static Size cpv2size(const cpVect& vec) { return Size(vec.x, vec.y); } static cpVect size2cpv(const Size& size) { return cpv(size.width, size.height); } static float cpfloat2float(cpFloat f) { return f; } @@ -46,7 +46,7 @@ public: static cpBB rect2cpbb(const Rect& rect) { return cpBBNew(rect.origin.x, rect.origin.y, rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); } static Rect cpbb2rect(const cpBB& bb) { return Rect(bb.l, bb.b, bb.r - bb.l, bb.t - bb.b); } - static Vector2* cpvs2points(const cpVect* cpvs, Vector2* out, int count) + static Vec2* cpvs2points(const cpVect* cpvs, Vec2* out, int count) { for (int i = 0; i < count; ++i) { @@ -56,7 +56,7 @@ public: return out; } - static cpVect* points2cpvs(const Vector2* points, cpVect* out, int count) + static cpVect* points2cpvs(const Vec2* points, cpVect* out, int count) { for (int i = 0; i < count; ++i) { diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h index 87ce0fdacd..f5e885b86d 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h @@ -33,7 +33,7 @@ #include "base/CCPlatformMacros.h" #include "math/CCGeometry.h" NS_CC_BEGIN -typedef Vector2 Vect; +typedef Vec2 Vect; class PhysicsBodyInfo; class PhysicsJointInfo; class PhysicsShapeInfo; diff --git a/cocos/renderer/CCBatchCommand.cpp b/cocos/renderer/CCBatchCommand.cpp index ce7dd90a6c..8cd92c148d 100644 --- a/cocos/renderer/CCBatchCommand.cpp +++ b/cocos/renderer/CCBatchCommand.cpp @@ -39,7 +39,7 @@ BatchCommand::BatchCommand() _shader = nullptr; } -void BatchCommand::init(float globalOrder, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Matrix& modelViewTransform) +void BatchCommand::init(float globalOrder, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Mat4& modelViewTransform) { CCASSERT(shader, "shader cannot be nill"); CCASSERT(textureAtlas, "textureAtlas cannot be nill"); diff --git a/cocos/renderer/CCBatchCommand.h b/cocos/renderer/CCBatchCommand.h index ed3e9abcd1..d5920b369b 100644 --- a/cocos/renderer/CCBatchCommand.h +++ b/cocos/renderer/CCBatchCommand.h @@ -40,7 +40,7 @@ public: BatchCommand(); ~BatchCommand(); - void init(float depth, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Matrix& modelViewTransform); + void init(float depth, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const Mat4& modelViewTransform); void execute(); @@ -54,7 +54,7 @@ protected: TextureAtlas *_textureAtlas; // ModelView transform - Matrix _mv; + Mat4 _mv; }; NS_CC_END diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 4fb7b16895..fb4d42e334 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -808,15 +808,15 @@ void GLProgram::setUniformsForBuiltins() Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix matrixMV; + Mat4 matrixMV; matrixMV = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); setUniformsForBuiltins(matrixMV); } -void GLProgram::setUniformsForBuiltins(const Matrix &matrixMV) +void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV) { - Matrix matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + Mat4 matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); if(_flags.usesP) setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_P_MATRIX], matrixP.m, 1); @@ -825,7 +825,7 @@ void GLProgram::setUniformsForBuiltins(const Matrix &matrixMV) setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_MV_MATRIX], matrixMV.m, 1); if(_flags.usesMVP) { - Matrix matrixMVP = matrixP * matrixMV; + Mat4 matrixMVP = matrixP * matrixMV; setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_MVP_MATRIX], matrixMVP.m, 1); } diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index fe403872d9..d77847e5a4 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -274,7 +274,7 @@ public: /** will update the builtin uniforms if they are different than the previous call for this same shader program. */ void setUniformsForBuiltins(); - void setUniformsForBuiltins(const Matrix &modelView); + void setUniformsForBuiltins(const Mat4 &modelView); // Attribute diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index d1965dd256..6f7f05e88e 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -141,28 +141,28 @@ void UniformValue::setInt(int value) _useCallback = false; } -void UniformValue::setVec2(const Vector2& value) +void UniformValue::setVec2(const Vec2& value) { CCASSERT (_uniform->type == GL_FLOAT_VEC2, ""); memcpy(_value.v2Value, &value, sizeof(_value.v2Value)); _useCallback = false; } -void UniformValue::setVec3(const Vector3& value) +void UniformValue::setVec3(const Vec3& value) { CCASSERT (_uniform->type == GL_FLOAT_VEC3, ""); memcpy(_value.v3Value, &value, sizeof(_value.v3Value)); _useCallback = false; } -void UniformValue::setVec4(const Vector4& value) +void UniformValue::setVec4(const Vec4& value) { CCASSERT (_uniform->type == GL_FLOAT_VEC4, ""); memcpy(_value.v4Value, &value, sizeof(_value.v4Value)); _useCallback = false; } -void UniformValue::setMat4(const Matrix& value) +void UniformValue::setMat4(const Mat4& value) { CCASSERT(_uniform->type == GL_FLOAT_MAT4, ""); memcpy(_value.matrixValue, &value, sizeof(_value.matrixValue)); @@ -305,7 +305,7 @@ void GLProgramState::resetGLProgram() _textureUnitIndex = 1; } -void GLProgramState::apply(const Matrix& modelView) +void GLProgramState::apply(const Mat4& modelView) { CCASSERT(_glprogram, "invalid glprogram"); @@ -413,7 +413,7 @@ void GLProgramState::setUniformInt(const std::string &uniformName, int value) CCLOG("cocos2d: warning: Uniform not found: %s", uniformName.c_str()); } -void GLProgramState::setUniformVec2(const std::string &uniformName, const Vector2& value) +void GLProgramState::setUniformVec2(const std::string &uniformName, const Vec2& value) { auto v = getUniformValue(uniformName); if (v) @@ -422,7 +422,7 @@ void GLProgramState::setUniformVec2(const std::string &uniformName, const Vector CCLOG("cocos2d: warning: Uniform not found: %s", uniformName.c_str()); } -void GLProgramState::setUniformVec3(const std::string &uniformName, const Vector3& value) +void GLProgramState::setUniformVec3(const std::string &uniformName, const Vec3& value) { auto v = getUniformValue(uniformName); if (v) @@ -431,7 +431,7 @@ void GLProgramState::setUniformVec3(const std::string &uniformName, const Vector CCLOG("cocos2d: warning: Uniform not found: %s", uniformName.c_str()); } -void GLProgramState::setUniformVec4(const std::string &uniformName, const Vector4& value) +void GLProgramState::setUniformVec4(const std::string &uniformName, const Vec4& value) { auto v = getUniformValue(uniformName); if (v) @@ -440,7 +440,7 @@ void GLProgramState::setUniformVec4(const std::string &uniformName, const Vector CCLOG("cocos2d: warning: Uniform not found: %s", uniformName.c_str()); } -void GLProgramState::setUniformMat4(const std::string &uniformName, const Matrix& value) +void GLProgramState::setUniformMat4(const std::string &uniformName, const Mat4& value) { auto v = getUniformValue(uniformName); if (v) diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index 5a71bc7f53..fb117a9eed 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -56,10 +56,10 @@ public: void setFloat(float value); void setInt(int value); - void setVec2(const Vector2& value); - void setVec3(const Vector3& value); - void setVec4(const Vector4& value); - void setMat4(const Matrix& value); + void setVec2(const Vec2& value); + void setVec3(const Vec3& value); + void setVec4(const Vec4& value); + void setMat4(const Mat4& value); void setCallback(const std::function &callback); void setTexture(GLuint textureId, GLuint activeTexture); @@ -155,7 +155,7 @@ public: /** gets-or-creates an instance of GLProgramState for a given GLProgramName */ static GLProgramState* getOrCreateWithGLProgramName(const std::string &glProgramName ); - void apply(const Matrix& modelView); + void apply(const Mat4& modelView); void setGLProgram(GLProgram* glprogram); GLProgram* getGLProgram() const { return _glprogram; } @@ -170,10 +170,10 @@ public: ssize_t getUniformCount() const { return _uniforms.size(); } void setUniformInt(const std::string &uniformName, int value); void setUniformFloat(const std::string &uniformName, float value); - void setUniformVec2(const std::string &uniformName, const Vector2& value); - void setUniformVec3(const std::string &uniformName, const Vector3& value); - void setUniformVec4(const std::string &uniformName, const Vector4& value); - void setUniformMat4(const std::string &uniformName, const Matrix& value); + void setUniformVec2(const std::string &uniformName, const Vec2& value); + void setUniformVec3(const std::string &uniformName, const Vec3& value); + void setUniformVec4(const std::string &uniformName, const Vec4& value); + void setUniformMat4(const std::string &uniformName, const Mat4& value); void setUniformCallback(const std::string &uniformName, const std::function &callback); void setUniformTexture(const std::string &uniformName, Texture2D *texture); void setUniformTexture(const std::string &uniformName, GLuint textureId); diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index 9eb8cc19cb..1aae065718 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -43,7 +43,7 @@ QuadCommand::QuadCommand() _type = RenderCommand::Type::QUAD_COMMAND; } -void QuadCommand::init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, ssize_t quadCount, const Matrix &mv) +void QuadCommand::init(float globalOrder, GLuint textureID, GLProgramState* glProgramState, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, ssize_t quadCount, const Mat4 &mv) { CCASSERT(glProgramState, "Invalid GLProgramState"); CCASSERT(glProgramState->getVertexAttribsFlags() == 0, "No custom attributes are supported in QuadCommand"); diff --git a/cocos/renderer/CCQuadCommand.h b/cocos/renderer/CCQuadCommand.h index c838f2bc32..8f3d3622f1 100644 --- a/cocos/renderer/CCQuadCommand.h +++ b/cocos/renderer/CCQuadCommand.h @@ -43,7 +43,7 @@ public: /** Initializes the command with a globalZOrder, a texture ID, a `GLProgram`, a blending function, a pointer to quads, * quantity of quads, and the Model View transform to be used for the quads */ void init(float globalOrder, GLuint texutreID, GLProgramState* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quads, ssize_t quadCount, - const Matrix& mv); + const Mat4& mv); void useMaterial() const; @@ -54,7 +54,7 @@ public: inline ssize_t getQuadCount() const { return _quadsCount; } inline GLProgramState* getGLProgramState() const { return _glProgramState; } inline BlendFunc getBlendType() const { return _blendType; } - inline const Matrix& getModelView() const { return _mv; } + inline const Mat4& getModelView() const { return _mv; } protected: @@ -66,7 +66,7 @@ protected: BlendFunc _blendType; V3F_C4B_T2F_Quad* _quads; ssize_t _quadsCount; - Matrix _mv; + Mat4 _mv; }; NS_CC_END diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index 5246f6efb5..f090b2e941 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -371,7 +371,7 @@ void Renderer::clean() _lastMaterialID = 0; } -void Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Matrix& modelView) +void Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Mat4& modelView) { // kmMat4 matrixP, mvp; // kmGLGetMatrix(KM_GL_PROJECTION, &matrixP); @@ -379,16 +379,16 @@ void Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quanti for(ssize_t i=0; ibl.vertices; + Vec3 *vec1 = (Vec3*)&q->bl.vertices; modelView.transformPoint(vec1); - Vector3 *vec2 = (Vector3*)&q->br.vertices; + Vec3 *vec2 = (Vec3*)&q->br.vertices; modelView.transformPoint(vec2); - Vector3 *vec3 = (Vector3*)&q->tr.vertices; + Vec3 *vec3 = (Vec3*)&q->tr.vertices; modelView.transformPoint(vec3); - Vector3 *vec4 = (Vector3*)&q->tl.vertices; + Vec3 *vec4 = (Vec3*)&q->tl.vertices; modelView.transformPoint(vec4); } } @@ -505,7 +505,7 @@ void Renderer::flush() // helpers -bool Renderer::checkVisibility(const Matrix &transform, const Size &size) +bool Renderer::checkVisibility(const Mat4 &transform, const Size &size) { // half size of the screen Size screen_half = Director::getInstance()->getWinSize(); @@ -515,7 +515,7 @@ bool Renderer::checkVisibility(const Matrix &transform, const Size &size) float hSizeX = size.width/2; float hSizeY = size.height/2; - Vector4 v4world, v4local; + Vec4 v4world, v4local; v4local.set(hSizeX, hSizeY, 0, 1); transform.transformVector(v4local, &v4world); diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index 94c9da4794..cadb5acd4e 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -115,7 +115,7 @@ public: inline GroupCommandManager* getGroupCommandManager() const { return _groupCommandManager; }; /** returns whether or not a rectangle is visible or not */ - bool checkVisibility(const Matrix& transform, const Size& size); + bool checkVisibility(const Mat4& transform, const Size& size); protected: @@ -133,7 +133,7 @@ protected: void visitRenderQueue(const RenderQueue& queue); - void convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Matrix& modelView); + void convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const Mat4& modelView); std::stack _commandGroupStack; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 28426f2430..b28e1ed4aa 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -1557,7 +1557,7 @@ int lua_cocos2dx_Touch_getPreviousLocationInView(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPreviousLocationInView(); + cocos2d::Vec2 ret = cobj->getPreviousLocationInView(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1601,7 +1601,7 @@ int lua_cocos2dx_Touch_getLocation(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getLocation(); + cocos2d::Vec2 ret = cobj->getLocation(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1645,7 +1645,7 @@ int lua_cocos2dx_Touch_getDelta(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getDelta(); + cocos2d::Vec2 ret = cobj->getDelta(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1689,7 +1689,7 @@ int lua_cocos2dx_Touch_getStartLocationInView(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getStartLocationInView(); + cocos2d::Vec2 ret = cobj->getStartLocationInView(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1733,7 +1733,7 @@ int lua_cocos2dx_Touch_getStartLocation(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getStartLocation(); + cocos2d::Vec2 ret = cobj->getStartLocation(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1873,7 +1873,7 @@ int lua_cocos2dx_Touch_getLocationInView(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getLocationInView(); + cocos2d::Vec2 ret = cobj->getLocationInView(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1917,7 +1917,7 @@ int lua_cocos2dx_Touch_getPreviousLocation(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPreviousLocation(); + cocos2d::Vec2 ret = cobj->getPreviousLocation(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -3357,7 +3357,7 @@ int lua_cocos2dx_Texture2D_drawAtPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -4156,12 +4156,12 @@ int lua_cocos2dx_Node_convertToWorldSpaceAR(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToWorldSpaceAR(arg0); + cocos2d::Vec2 ret = cobj->convertToWorldSpaceAR(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4702,7 +4702,7 @@ int lua_cocos2dx_Node_getNodeToWorldTransform(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Matrix ret = cobj->getNodeToWorldTransform(); + cocos2d::Mat4 ret = cobj->getNodeToWorldTransform(); matrix_to_luaval(tolua_S, ret); return 1; } @@ -4746,8 +4746,8 @@ int lua_cocos2dx_Node_getPosition3D(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector3 ret = cobj->getPosition3D(); - vector3_to_luaval(tolua_S, ret); + cocos2d::Vec3 ret = cobj->getPosition3D(); + Vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition3D",argc, 0); @@ -4847,12 +4847,12 @@ int lua_cocos2dx_Node_convertToWorldSpace(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToWorldSpace(arg0); + cocos2d::Vec2 ret = cobj->convertToWorldSpace(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5123,7 +5123,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertTouchToNodeSpace(arg0); + cocos2d::Vec2 ret = cobj->convertTouchToNodeSpace(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5350,8 +5350,8 @@ int lua_cocos2dx_Node_getRotation3D(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector3 ret = cobj->getRotation3D(); - vector3_to_luaval(tolua_S, ret); + cocos2d::Vec3 ret = cobj->getRotation3D(); + Vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getRotation3D",argc, 0); @@ -5394,7 +5394,7 @@ int lua_cocos2dx_Node_getNodeToParentTransform(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Matrix& ret = cobj->getNodeToParentTransform(); + const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); matrix_to_luaval(tolua_S, ret); return 1; } @@ -5441,7 +5441,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertTouchToNodeSpaceAR(arg0); + cocos2d::Vec2 ret = cobj->convertTouchToNodeSpaceAR(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5483,12 +5483,12 @@ int lua_cocos2dx_Node_convertToNodeSpace(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToNodeSpace(arg0); + cocos2d::Vec2 ret = cobj->convertToNodeSpace(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5627,7 +5627,7 @@ int lua_cocos2dx_Node_setPosition(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } @@ -5907,9 +5907,9 @@ int lua_cocos2dx_Node_setRotation3D(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector3 arg0; + cocos2d::Vec3 arg0; - ok &= luaval_to_vector3(tolua_S, 2, &arg0); + ok &= luaval_to_Vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setRotation3D(arg0); @@ -5999,7 +5999,7 @@ int lua_cocos2dx_Node_setNodeToParentTransform(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Matrix arg0; + cocos2d::Mat4 arg0; ok &= luaval_to_matrix(tolua_S, 2, &arg0); if(!ok) @@ -6047,7 +6047,7 @@ int lua_cocos2dx_Node_getAnchorPoint(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getAnchorPoint(); + const cocos2d::Vec2& ret = cobj->getAnchorPoint(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6264,12 +6264,12 @@ int lua_cocos2dx_Node_convertToNodeSpaceAR(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToNodeSpaceAR(arg0); + cocos2d::Vec2 ret = cobj->convertToNodeSpaceAR(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6448,7 +6448,7 @@ int lua_cocos2dx_Node_getAnchorPointInPoints(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getAnchorPointInPoints(); + const cocos2d::Vec2& ret = cobj->getAnchorPointInPoints(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6855,8 +6855,8 @@ int lua_cocos2dx_Node_setAdditionalTransform(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Matrix* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Matrix",&arg0); + cocos2d::Mat4* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Matrix",&arg0); if (!ok) { break; } cobj->setAdditionalTransform(arg0); @@ -7683,7 +7683,7 @@ int lua_cocos2dx_Node_getParentToNodeTransform(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Matrix& ret = cobj->getParentToNodeTransform(); + const cocos2d::Mat4& ret = cobj->getParentToNodeTransform(); matrix_to_luaval(tolua_S, ret); return 1; } @@ -8553,7 +8553,7 @@ int lua_cocos2dx_Node_draw(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Renderer",&arg0); if (!ok) { break; } - cocos2d::Matrix arg1; + cocos2d::Mat4 arg1; ok &= luaval_to_matrix(tolua_S, 3, &arg1); if (!ok) { break; } @@ -8699,9 +8699,9 @@ int lua_cocos2dx_Node_setPosition3D(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector3 arg0; + cocos2d::Vec3 arg0; - ok &= luaval_to_vector3(tolua_S, 2, &arg0); + ok &= luaval_to_Vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosition3D(arg0); @@ -8836,7 +8836,7 @@ int lua_cocos2dx_Node_getWorldToNodeTransform(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Matrix ret = cobj->getWorldToNodeTransform(); + cocos2d::Mat4 ret = cobj->getWorldToNodeTransform(); matrix_to_luaval(tolua_S, ret); return 1; } @@ -10612,7 +10612,7 @@ int lua_cocos2dx_Director_loadMatrix(lua_State* tolua_S) if (argc == 2) { cocos2d::MATRIX_STACK_TYPE arg0; - cocos2d::Matrix arg1; + cocos2d::Mat4 arg1; ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); @@ -10838,7 +10838,7 @@ int lua_cocos2dx_Director_getVisibleOrigin(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getVisibleOrigin(); + cocos2d::Vec2 ret = cobj->getVisibleOrigin(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -11057,12 +11057,12 @@ int lua_cocos2dx_Director_convertToUI(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToUI(arg0); + cocos2d::Vec2 ret = cobj->convertToUI(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -11722,12 +11722,12 @@ int lua_cocos2dx_Director_convertToGL(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->convertToGL(arg0); + cocos2d::Vec2 ret = cobj->convertToGL(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -12040,7 +12040,7 @@ int lua_cocos2dx_Director_getMatrix(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); if(!ok) return 0; - cocos2d::Matrix ret = cobj->getMatrix(arg0); + cocos2d::Mat4 ret = cobj->getMatrix(arg0); matrix_to_luaval(tolua_S, ret); return 1; } @@ -12711,7 +12711,7 @@ int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S) if (argc == 2) { cocos2d::MATRIX_STACK_TYPE arg0; - cocos2d::Matrix arg1; + cocos2d::Mat4 arg1; ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); @@ -16299,7 +16299,7 @@ int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } @@ -16501,7 +16501,7 @@ int lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -16727,7 +16727,7 @@ int lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -16775,7 +16775,7 @@ int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getOffset(); + const cocos2d::Vec2& ret = cobj->getOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -16868,7 +16868,7 @@ int lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } @@ -16984,7 +16984,7 @@ int lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getOffsetInPixels(); + const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -17069,7 +17069,7 @@ int lua_cocos2dx_SpriteFrame_create(lua_State* tolua_S) bool arg2; ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -17132,7 +17132,7 @@ int lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S) bool arg2; ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -19002,8 +19002,8 @@ int lua_cocos2dx_RotateBy_create(lua_State* tolua_S) double arg0; ok &= luaval_to_number(tolua_S, 2,&arg0); if (!ok) { break; } - cocos2d::Vector3 arg1; - ok &= luaval_to_vector3(tolua_S, 3, &arg1); + cocos2d::Vec3 arg1; + ok &= luaval_to_Vec3(tolua_S, 3, &arg1); if (!ok) { break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); object_to_luaval(tolua_S, "cc.RotateBy",(cocos2d::RotateBy*)ret); @@ -19057,7 +19057,7 @@ int lua_cocos2dx_MoveBy_create(lua_State* tolua_S) if (argc == 2) { double arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -19112,7 +19112,7 @@ int lua_cocos2dx_MoveTo_create(lua_State* tolua_S) if (argc == 2) { double arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -19281,7 +19281,7 @@ int lua_cocos2dx_JumpBy_create(lua_State* tolua_S) if (argc == 4) { double arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); @@ -19340,7 +19340,7 @@ int lua_cocos2dx_JumpTo_create(lua_State* tolua_S) if (argc == 4) { double arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); @@ -20438,8 +20438,8 @@ int lua_cocos2dx_ActionCamera_setEye(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Vector3 arg0; - ok &= luaval_to_vector3(tolua_S, 2, &arg0); + cocos2d::Vec3 arg0; + ok &= luaval_to_Vec3(tolua_S, 2, &arg0); if (!ok) { break; } cobj->setEye(arg0); @@ -20487,8 +20487,8 @@ int lua_cocos2dx_ActionCamera_getEye(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector3& ret = cobj->getEye(); - vector3_to_luaval(tolua_S, ret); + const cocos2d::Vec3& ret = cobj->getEye(); + Vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getEye",argc, 0); @@ -20529,9 +20529,9 @@ int lua_cocos2dx_ActionCamera_setUp(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector3 arg0; + cocos2d::Vec3 arg0; - ok &= luaval_to_vector3(tolua_S, 2, &arg0); + ok &= luaval_to_Vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setUp(arg0); @@ -20577,8 +20577,8 @@ int lua_cocos2dx_ActionCamera_getCenter(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector3& ret = cobj->getCenter(); - vector3_to_luaval(tolua_S, ret); + const cocos2d::Vec3& ret = cobj->getCenter(); + Vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCenter",argc, 0); @@ -20619,9 +20619,9 @@ int lua_cocos2dx_ActionCamera_setCenter(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector3 arg0; + cocos2d::Vec3 arg0; - ok &= luaval_to_vector3(tolua_S, 2, &arg0); + ok &= luaval_to_Vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setCenter(arg0); @@ -20667,8 +20667,8 @@ int lua_cocos2dx_ActionCamera_getUp(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector3& ret = cobj->getUp(); - vector3_to_luaval(tolua_S, ret); + const cocos2d::Vec3& ret = cobj->getUp(); + Vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getUp",argc, 0); @@ -24065,7 +24065,7 @@ int lua_cocos2dx_Place_create(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; @@ -24929,7 +24929,7 @@ int lua_cocos2dx_Lens3D_setPosition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -25069,7 +25069,7 @@ int lua_cocos2dx_Lens3D_getPosition(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPosition(); + const cocos2d::Vec2& ret = cobj->getPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -25146,7 +25146,7 @@ int lua_cocos2dx_Lens3D_create(lua_State* tolua_S) { double arg0; cocos2d::Size arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; double arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); @@ -25399,7 +25399,7 @@ int lua_cocos2dx_Ripple3D_setPosition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -25447,7 +25447,7 @@ int lua_cocos2dx_Ripple3D_getPosition(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPosition(); + const cocos2d::Vec2& ret = cobj->getPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -25480,7 +25480,7 @@ int lua_cocos2dx_Ripple3D_create(lua_State* tolua_S) { double arg0; cocos2d::Size arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; double arg3; unsigned int arg4; double arg5; @@ -26287,7 +26287,7 @@ int lua_cocos2dx_Twirl_setPosition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -26335,7 +26335,7 @@ int lua_cocos2dx_Twirl_getPosition(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPosition(); + const cocos2d::Vec2& ret = cobj->getPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -26368,7 +26368,7 @@ int lua_cocos2dx_Twirl_create(lua_State* tolua_S) { double arg0; cocos2d::Size arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; unsigned int arg3; double arg4; ok &= luaval_to_number(tolua_S, 2,&arg0); @@ -26729,7 +26729,7 @@ int lua_cocos2dx_ShuffleTiles_placeTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; cocos2d::Tile* arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -26934,7 +26934,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOnTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -26980,7 +26980,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOffTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -27026,7 +27026,7 @@ int lua_cocos2dx_FadeOutTRTiles_transformTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; double arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -27239,7 +27239,7 @@ int lua_cocos2dx_FadeOutUpTiles_transformTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; double arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -27399,7 +27399,7 @@ int lua_cocos2dx_TurnOffTiles_turnOnTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -27445,7 +27445,7 @@ int lua_cocos2dx_TurnOffTiles_turnOffTile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -28319,7 +28319,7 @@ int lua_cocos2dx_CardinalSplineTo_updatePosition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -28668,9 +28668,9 @@ int lua_cocos2dx_DrawNode_drawQuadraticBezier(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 5) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; + cocos2d::Vec2 arg2; unsigned int arg3; cocos2d::Color4F arg4; @@ -28726,7 +28726,7 @@ int lua_cocos2dx_DrawNode_onDraw(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Matrix arg0; + cocos2d::Mat4 arg0; bool arg1; ok &= luaval_to_matrix(tolua_S, 2, &arg0); @@ -28818,9 +28818,9 @@ int lua_cocos2dx_DrawNode_drawTriangle(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 4) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; + cocos2d::Vec2 arg2; cocos2d::Color4F arg3; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -28873,7 +28873,7 @@ int lua_cocos2dx_DrawNode_drawDot(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 3) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; double arg1; cocos2d::Color4F arg2; @@ -28925,10 +28925,10 @@ int lua_cocos2dx_DrawNode_drawCubicBezier(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 6) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; unsigned int arg4; cocos2d::Color4F arg5; @@ -28986,8 +28986,8 @@ int lua_cocos2dx_DrawNode_drawSegment(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 4) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; double arg2; cocos2d::Color4F arg3; @@ -30998,7 +30998,7 @@ int lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; do{ if (argc == 1) { - cocos2d::Matrix arg0; + cocos2d::Mat4 arg0; ok &= luaval_to_matrix(tolua_S, 2, &arg0); if (!ok) { break; } @@ -33601,7 +33601,7 @@ int lua_cocos2dx_Label_setBMFontFilePath(lua_State* tolua_S) if (argc == 2) { std::string arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_std_string(tolua_S, 2,&arg0); @@ -34834,7 +34834,7 @@ int lua_cocos2dx_Label_createWithBMFont(lua_State* tolua_S) std::string arg1; cocos2d::TextHAlignment arg2; int arg3; - cocos2d::Vector2 arg4; + cocos2d::Vec2 arg4; ok &= luaval_to_std_string(tolua_S, 2,&arg0); ok &= luaval_to_std_string(tolua_S, 3,&arg1); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); @@ -35518,7 +35518,7 @@ int lua_cocos2dx_LabelBMFont_initWithString(lua_State* tolua_S) std::string arg1; double arg2; cocos2d::TextHAlignment arg3; - cocos2d::Vector2 arg4; + cocos2d::Vec2 arg4; ok &= luaval_to_std_string(tolua_S, 2,&arg0); @@ -35674,7 +35674,7 @@ int lua_cocos2dx_LabelBMFont_setFntFile(lua_State* tolua_S) if (argc == 2) { std::string arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_std_string(tolua_S, 2,&arg0); @@ -35883,7 +35883,7 @@ int lua_cocos2dx_LabelBMFont_create(lua_State* tolua_S) cocos2d::TextHAlignment arg3; ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if (!ok) { break; } - cocos2d::Vector2 arg4; + cocos2d::Vec2 arg4; ok &= luaval_to_vector2(tolua_S, 6, &arg4); if (!ok) { break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4); @@ -36407,7 +36407,7 @@ int lua_cocos2dx_LayerGradient_setVector(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -36593,7 +36593,7 @@ int lua_cocos2dx_LayerGradient_getVector(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getVector(); + const cocos2d::Vec2& ret = cobj->getVector(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -36837,7 +36837,7 @@ int lua_cocos2dx_LayerGradient_create(lua_State* tolua_S) cocos2d::Color4B arg1; ok &=luaval_to_color4b(tolua_S, 3, &arg1); if (!ok) { break; } - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_vector2(tolua_S, 4, &arg2); if (!ok) { break; } cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2); @@ -43428,7 +43428,7 @@ int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getOffsetPosition(); + const cocos2d::Vec2& ret = cobj->getOffsetPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -44587,7 +44587,7 @@ int lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -44811,7 +44811,7 @@ int lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -44859,7 +44859,7 @@ int lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getBarChangeRate(); + cocos2d::Vec2 ret = cobj->getBarChangeRate(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -44956,7 +44956,7 @@ int lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getMidpoint(); + cocos2d::Vec2 ret = cobj->getMidpoint(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -45769,7 +45769,7 @@ int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 3) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; cocos2d::Rect arg1; cocos2d::Rect arg2; @@ -48088,7 +48088,7 @@ int lua_cocos2dx_ParticleSystem_setPosVar(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -48724,7 +48724,7 @@ int lua_cocos2dx_ParticleSystem_getGravity(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getGravity(); + const cocos2d::Vec2& ret = cobj->getGravity(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -49130,7 +49130,7 @@ int lua_cocos2dx_ParticleSystem_getPosVar(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPosVar(); + const cocos2d::Vec2& ret = cobj->getPosVar(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -49394,7 +49394,7 @@ int lua_cocos2dx_ParticleSystem_getSourcePosition(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getSourcePosition(); + const cocos2d::Vec2& ret = cobj->getSourcePosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -49575,7 +49575,7 @@ int lua_cocos2dx_ParticleSystem_updateQuadWithParticle(lua_State* tolua_S) if (argc == 2) { cocos2d::sParticle* arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; #pragma warning NO CONVERSION TO NATIVE FOR sParticle*; @@ -50432,7 +50432,7 @@ int lua_cocos2dx_ParticleSystem_setSourcePosition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -51292,7 +51292,7 @@ int lua_cocos2dx_ParticleSystem_setGravity(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -53920,7 +53920,7 @@ int lua_cocos2dx_GridBase_getStep(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getStep(); + const cocos2d::Vec2& ret = cobj->getStep(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -54005,7 +54005,7 @@ int lua_cocos2dx_GridBase_setStep(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -55381,7 +55381,7 @@ int lua_cocos2dx_GLViewProtocol_getVisibleOrigin(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getVisibleOrigin(); + cocos2d::Vec2 ret = cobj->getVisibleOrigin(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -58315,8 +58315,8 @@ int lua_cocos2dx_ParallaxNode_addChild(lua_State* tolua_S) { cocos2d::Node* arg0; int arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); @@ -58514,7 +58514,7 @@ int lua_cocos2dx_TMXObjectGroup_setPositionOffset(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -58609,7 +58609,7 @@ int lua_cocos2dx_TMXObjectGroup_getPositionOffset(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPositionOffset(); + const cocos2d::Vec2& ret = cobj->getPositionOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -60905,7 +60905,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -60916,7 +60916,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; cocos2d::TMXTileFlags_* arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -60966,12 +60966,12 @@ int lua_cocos2dx_TMXLayer_getPositionAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPositionAt(arg0); + cocos2d::Vec2 ret = cobj->getPositionAt(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -61374,7 +61374,7 @@ int lua_cocos2dx_TMXLayer_removeTileAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -61515,7 +61515,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) ok &= luaval_to_uint32(tolua_S, 2,&arg0); if (!ok) { break; } - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 3, &arg1); if (!ok) { break; } @@ -61534,7 +61534,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) ok &= luaval_to_uint32(tolua_S, 2,&arg0); if (!ok) { break; } - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 3, &arg1); if (!ok) { break; } @@ -61899,7 +61899,7 @@ int lua_cocos2dx_TMXLayer_getTileAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -62855,7 +62855,7 @@ int lua_cocos2dx_TileMapAtlas_getTileAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -62903,7 +62903,7 @@ int lua_cocos2dx_TileMapAtlas_setTile(lua_State* tolua_S) if (argc == 2) { cocos2d::Color3B arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_color3b(tolua_S, 2, &arg0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp index b6bce1338b..6ca6cda628 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp @@ -2027,7 +2027,7 @@ int lua_cocos2dx_extension_Control_getTouchLocation(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getTouchLocation(arg0); + cocos2d::Vec2 ret = cobj->getTouchLocation(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2506,7 +2506,7 @@ int lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -2554,7 +2554,7 @@ int lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getLabelAnchorPoint(); + const cocos2d::Vec2& ret = cobj->getLabelAnchorPoint(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4170,7 +4170,7 @@ int lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(lua_State* tolu if (argc == 2) { cocos2d::Node* arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); @@ -4267,7 +4267,7 @@ int lua_cocos2dx_extension_ControlHuePicker_getStartPos(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getStartPos(); + cocos2d::Vec2 ret = cobj->getStartPos(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4613,7 +4613,7 @@ int lua_cocos2dx_extension_ControlHuePicker_create(lua_State* tolua_S) if (argc == 2) { cocos2d::Node* arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -4769,7 +4769,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPo if (argc == 2) { cocos2d::Node* arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); @@ -4820,7 +4820,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(lua_Sta { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getStartPos(); + cocos2d::Vec2 ret = cobj->getStartPos(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5118,7 +5118,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create(lua_State* t if (argc == 2) { cocos2d::Node* arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -5828,7 +5828,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(lua_State* t argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -6008,10 +6008,10 @@ int lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoi argc = lua_gettop(tolua_S)-1; if (argc == 4) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -6064,7 +6064,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(lua_State* to argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -6292,7 +6292,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(lua_State* t { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPreviousLocation(); + cocos2d::Vec2 ret = cobj->getPreviousLocation(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6334,8 +6334,8 @@ int lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(lua argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -6384,7 +6384,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(lua_State* to argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -6619,7 +6619,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(lua_State* to argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -6824,7 +6824,7 @@ int lua_cocos2dx_extension_ControlSlider_locationFromTouch(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->locationFromTouch(arg0); + cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -8249,7 +8249,7 @@ int lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(lua_Sta argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -9374,7 +9374,7 @@ int lua_cocos2dx_extension_ControlSwitch_locationFromTouch(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 2, "cc.Touch",&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->locationFromTouch(arg0); + cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9688,7 +9688,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration(lua_State* tolu argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; double arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -10253,7 +10253,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -10263,7 +10263,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; bool arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -10541,7 +10541,7 @@ int lua_cocos2dx_extension_ScrollView_getContentOffset(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getContentOffset(); + cocos2d::Vec2 ret = cobj->getContentOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -10816,7 +10816,7 @@ int lua_cocos2dx_extension_ScrollView_maxContainerOffset(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->maxContainerOffset(); + cocos2d::Vec2 ret = cobj->maxContainerOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -11001,7 +11001,7 @@ int lua_cocos2dx_extension_ScrollView_minContainerOffset(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->minContainerOffset(); + cocos2d::Vec2 ret = cobj->minContainerOffset(); vector2_to_luaval(tolua_S, ret); return 1; } diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index 39f5662b2b..dcb96d7212 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -35,7 +35,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getGravity(); + cocos2d::Vec2 ret = cobj->getGravity(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -121,7 +121,7 @@ int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -413,7 +413,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -513,7 +513,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShape(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -1335,7 +1335,7 @@ int lua_cocos2dx_physics_PhysicsShape_containsPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -1516,7 +1516,7 @@ int lua_cocos2dx_physics_PhysicsShape_getCenter(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getCenter(); + cocos2d::Vec2 ret = cobj->getCenter(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1828,7 +1828,7 @@ int lua_cocos2dx_physics_PhysicsShape_getOffset(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getOffset(); + cocos2d::Vec2 ret = cobj->getOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2293,7 +2293,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_create(lua_State* tolua_S) { double arg0; cocos2d::PhysicsMaterial arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -2375,7 +2375,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment(lua_State* tolua_S) { double arg0; double arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -2545,7 +2545,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_create(lua_State* tolua_S) { cocos2d::Size arg0; cocos2d::PhysicsMaterial arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -2627,7 +2627,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment(lua_State* tolua_S) { double arg0; cocos2d::Size arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -2746,7 +2746,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoint(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPoint(arg0); + cocos2d::Vec2 ret = cobj->getPoint(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2811,7 +2811,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPointB(); + cocos2d::Vec2 ret = cobj->getPointB(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2855,7 +2855,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPointA(); + cocos2d::Vec2 ret = cobj->getPointA(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2886,8 +2886,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) if (argc == 2) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -2898,8 +2898,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; ok &= luaval_to_vector2(tolua_S, 2, &arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); @@ -2912,8 +2912,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) } if (argc == 4) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -3056,7 +3056,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_create(lua_State* tolua_S) cocos2d::Size arg0; cocos2d::PhysicsMaterial arg1; double arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); @@ -3644,11 +3644,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; do{ if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 3, &arg1); if (!ok) { break; } @@ -3659,7 +3659,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } @@ -3747,11 +3747,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; do{ if (argc == 2) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 3, &arg1); if (!ok) { break; } @@ -3762,7 +3762,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } @@ -4008,7 +4008,7 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocity(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getVelocity(); + cocos2d::Vec2 ret = cobj->getVelocity(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4287,7 +4287,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPositionOffset(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPositionOffset(); + cocos2d::Vec2 ret = cobj->getPositionOffset(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4465,7 +4465,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPosition(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getPosition(); + cocos2d::Vec2 ret = cobj->getPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4733,12 +4733,12 @@ int lua_cocos2dx_physics_PhysicsBody_local2World(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->local2World(arg0); + cocos2d::Vec2 ret = cobj->local2World(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5048,12 +5048,12 @@ int lua_cocos2dx_physics_PhysicsBody_world2Local(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->world2Local(arg0); + cocos2d::Vec2 ret = cobj->world2Local(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5314,7 +5314,7 @@ int lua_cocos2dx_physics_PhysicsBody_setVelocity(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -5452,7 +5452,7 @@ int lua_cocos2dx_physics_PhysicsBody_setPositionOffset(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -5632,12 +5632,12 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getVelocityAtLocalPoint(arg0); + cocos2d::Vec2 ret = cobj->getVelocityAtLocalPoint(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -5862,12 +5862,12 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getVelocityAtWorldPoint(arg0); + cocos2d::Vec2 ret = cobj->getVelocityAtWorldPoint(arg0); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6099,7 +6099,7 @@ int lua_cocos2dx_physics_PhysicsBody_createBox(lua_State* tolua_S) { cocos2d::Size arg0; cocos2d::PhysicsMaterial arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -6134,8 +6134,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) if (argc == 2) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; ok &= luaval_to_vector2(tolua_S, 2, &arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); if(!ok) @@ -6146,8 +6146,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; ok &= luaval_to_vector2(tolua_S, 2, &arg0); ok &= luaval_to_vector2(tolua_S, 3, &arg1); @@ -6160,8 +6160,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) } if (argc == 4) { - cocos2d::Vector2 arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg0; + cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; ok &= luaval_to_vector2(tolua_S, 2, &arg0); @@ -6299,7 +6299,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeBox(lua_State* tolua_S) cocos2d::Size arg0; cocos2d::PhysicsMaterial arg1; double arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); @@ -6359,7 +6359,7 @@ int lua_cocos2dx_physics_PhysicsBody_createCircle(lua_State* tolua_S) { double arg0; cocos2d::PhysicsMaterial arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -6913,7 +6913,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity(lua_State* to { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getSurfaceVelocity(); + cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6955,7 +6955,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity(lua_State* to argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -7119,7 +7119,7 @@ int lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity(lua_State* t { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getSurfaceVelocity(); + cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -8184,7 +8184,7 @@ int lua_cocos2dx_physics_PhysicsJointFixed_construct(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -8250,7 +8250,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -8296,7 +8296,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -8390,7 +8390,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchr2(); + cocos2d::Vec2 ret = cobj->getAnchr2(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -8434,7 +8434,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchr1(); + cocos2d::Vec2 ret = cobj->getAnchr1(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -8606,10 +8606,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_vector2(tolua_S, 4, &arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } double arg4; @@ -8634,10 +8634,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) cocos2d::PhysicsBody* arg1; ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_vector2(tolua_S, 4, &arg2); if (!ok) { break; } - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_vector2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::PhysicsJointLimit* ret = cocos2d::PhysicsJointLimit::construct(arg0, arg1, arg2, arg3); @@ -8701,7 +8701,7 @@ int lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -8848,8 +8848,8 @@ int lua_cocos2dx_physics_PhysicsJointDistance_construct(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); @@ -8918,7 +8918,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -8964,7 +8964,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -9146,7 +9146,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchr2(); + cocos2d::Vec2 ret = cobj->getAnchr2(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9190,7 +9190,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchr1(); + cocos2d::Vec2 ret = cobj->getAnchr1(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9359,8 +9359,8 @@ int lua_cocos2dx_physics_PhysicsJointSpring_construct(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; double arg4; double arg5; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); @@ -9441,7 +9441,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -9487,7 +9487,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -9533,7 +9533,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -9581,7 +9581,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getGrooveA(); + cocos2d::Vec2 ret = cobj->getGrooveA(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9625,7 +9625,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getGrooveB(); + cocos2d::Vec2 ret = cobj->getGrooveB(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9669,7 +9669,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchr2(); + cocos2d::Vec2 ret = cobj->getAnchr2(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9702,9 +9702,9 @@ int lua_cocos2dx_physics_PhysicsJointGroove_construct(lua_State* tolua_S) { cocos2d::PhysicsBody* arg0; cocos2d::PhysicsBody* arg1; - cocos2d::Vector2 arg2; - cocos2d::Vector2 arg3; - cocos2d::Vector2 arg4; + cocos2d::Vec2 arg2; + cocos2d::Vec2 arg3; + cocos2d::Vec2 arg4; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); ok &= luaval_to_vector2(tolua_S, 4, &arg2); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp index e06e9d847e..7a3c4ab0d6 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp @@ -122,7 +122,7 @@ int lua_cocos2dx_spine_Skeleton_onDraw(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::Matrix arg0; + cocos2d::Mat4 arg0; bool arg1; ok &= luaval_to_matrix(tolua_S, 2, &arg0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp index d912d49a5e..b236889cd1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -3026,7 +3026,7 @@ int lua_cocos2dx_studio_ContourData_addVertex(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -3813,7 +3813,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(lua_State* tolua_S { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchorPointInPoints(); + cocos2d::Vec2 ret = cobj->getAnchorPointInPoints(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -4198,7 +4198,7 @@ int lua_cocos2dx_studio_DisplayManager_containPoint(lua_State* tolua_S) ok = true; do{ if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if (!ok) { break; } @@ -4434,7 +4434,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPoint(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getAnchorPoint(); + cocos2d::Vec2 ret = cobj->getAnchorPoint(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -6051,7 +6051,7 @@ int lua_cocos2dx_studio_Bone_getNodeToArmatureTransform(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Matrix ret = cobj->getNodeToArmatureTransform(); + cocos2d::Mat4 ret = cobj->getNodeToArmatureTransform(); matrix_to_luaval(tolua_S, ret); return 1; } @@ -9615,7 +9615,7 @@ int lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Matrix ret = cobj->getNodeToWorldTransformAR(); + cocos2d::Mat4 ret = cobj->getNodeToWorldTransformAR(); matrix_to_luaval(tolua_S, ret); return 1; } diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 2baacc9523..0017040254 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -841,7 +841,7 @@ int lua_cocos2dx_ui_Widget_setSizePercent(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -1069,7 +1069,7 @@ int lua_cocos2dx_ui_Widget_getTouchEndPos(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getTouchEndPos(); + const cocos2d::Vec2& ret = cobj->getTouchEndPos(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -1111,7 +1111,7 @@ int lua_cocos2dx_ui_Widget_setPositionPercent(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -1879,7 +1879,7 @@ int lua_cocos2dx_ui_Widget_getWorldPosition(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::Vector2 ret = cobj->getWorldPosition(); + cocos2d::Vec2 ret = cobj->getWorldPosition(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2059,7 +2059,7 @@ int lua_cocos2dx_ui_Widget_getTouchMovePos(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getTouchMovePos(); + const cocos2d::Vec2& ret = cobj->getTouchMovePos(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2331,7 +2331,7 @@ int lua_cocos2dx_ui_Widget_getSizePercent(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getSizePercent(); + const cocos2d::Vec2& ret = cobj->getSizePercent(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2375,7 +2375,7 @@ int lua_cocos2dx_ui_Widget_getTouchStartPos(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getTouchStartPos(); + const cocos2d::Vec2& ret = cobj->getTouchStartPos(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -2553,7 +2553,7 @@ int lua_cocos2dx_ui_Widget_clippingParentAreaContainPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -3013,7 +3013,7 @@ int lua_cocos2dx_ui_Widget_getPositionPercent(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getPositionPercent(); + const cocos2d::Vec2& ret = cobj->getPositionPercent(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -3055,7 +3055,7 @@ int lua_cocos2dx_ui_Widget_hitTest(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -3238,7 +3238,7 @@ int lua_cocos2dx_ui_Widget_checkChildInfo(lua_State* tolua_S) { int arg0; cocos2d::ui::Widget* arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); @@ -3567,7 +3567,7 @@ int lua_cocos2dx_ui_Layout_setBackGroundColorVector(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -3799,7 +3799,7 @@ int lua_cocos2dx_ui_Layout_getBackGroundColorVector(lua_State* tolua_S) { if(!ok) return 0; - const cocos2d::Vector2& ret = cobj->getBackGroundColorVector(); + const cocos2d::Vec2& ret = cobj->getBackGroundColorVector(); vector2_to_luaval(tolua_S, ret); return 1; } @@ -9574,7 +9574,7 @@ int lua_cocos2dx_ui_ScrollView_scrollToPercentBothDirection(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 3) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; double arg1; bool arg2; @@ -10533,7 +10533,7 @@ int lua_cocos2dx_ui_ScrollView_jumpToPercentBothDirection(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -14325,7 +14325,7 @@ int lua_cocos2dx_ui_TextField_hitTest(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) @@ -16388,7 +16388,7 @@ int lua_cocos2dx_ui_RichText_setAnchorPoint(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Vector2 arg0; + cocos2d::Vec2 arg0; ok &= luaval_to_vector2(tolua_S, 2, &arg0); if(!ok) diff --git a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp index 5e60eb4e1d..f224315b62 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp @@ -493,7 +493,7 @@ int LuaEngine::handleTouchEvent(void* data) Touch* touch = touchScriptData->touch; if (NULL != touch) { - const cocos2d::Vector2 pt = Director::getInstance()->convertToGL(touch->getLocationInView()); + const cocos2d::Vec2 pt = Director::getInstance()->convertToGL(touch->getLocationInView()); _stack->pushFloat(pt.x); _stack->pushFloat(pt.y); ret = _stack->executeFunctionByHandler(handler, 3); @@ -546,7 +546,7 @@ int LuaEngine::handleTouchesEvent(void* data) int i = 1; for (auto& touch : touchesScriptData->touches) { - cocos2d::Vector2 pt = pDirector->convertToGL(touch->getLocationInView()); + cocos2d::Vec2 pt = pDirector->convertToGL(touch->getLocationInView()); lua_pushnumber(L, pt.x); lua_rawseti(L, -2, i++); lua_pushnumber(L, pt.y); diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index 16e69a0273..b782746e51 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -271,7 +271,7 @@ bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue) return ok; } -bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue) +bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue) { if (nullptr == L || nullptr == outValue) return false; @@ -303,7 +303,7 @@ bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue) return ok; } -bool luaval_to_vector3(lua_State* L,int lo,cocos2d::Vector3* outValue) +bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue) { if (nullptr == L || nullptr == outValue) return false; @@ -903,7 +903,7 @@ bool luaval_to_ttfconfig(lua_State* L,int lo, cocos2d::TTFConfig* outValue) return false; } -bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Matrix* outValue ) +bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Mat4* outValue ) { if (nullptr == L || nullptr == outValue) return false; @@ -1145,7 +1145,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue) return ok; } -bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints) +bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints) { if (NULL == L) return false; @@ -1167,7 +1167,7 @@ bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, i size_t len = lua_objlen(L, lo); if (len > 0) { - cocos2d::Vector2* array = (cocos2d::Vector2*) new Vector2[len]; + cocos2d::Vec2* array = (cocos2d::Vec2*) new Vec2[len]; if (NULL == array) return false; for (uint32_t i = 0; i < len; ++i) @@ -1697,7 +1697,7 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector* ret) return ok; } -void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count) +void vector2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { if (NULL == L) return; @@ -1710,7 +1710,7 @@ void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int co } } -void vector2_to_luaval(lua_State* L,const cocos2d::Vector2& vec2) +void vector2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2) { if (NULL == L) return; @@ -1724,7 +1724,7 @@ void vector2_to_luaval(lua_State* L,const cocos2d::Vector2& vec2) } -void vector3_to_luaval(lua_State* L,const cocos2d::Vector3& vec3) +void Vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) { if (NULL == L) return; @@ -2406,7 +2406,7 @@ void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue) } } -void matrix_to_luaval(lua_State* L, const cocos2d::Matrix& mat) +void matrix_to_luaval(lua_State* L, const cocos2d::Mat4& mat) { if (nullptr == L) return; diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 791d169194..f5f7a44570 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -58,8 +58,8 @@ extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue); extern bool luaval_to_long(lua_State* L,int lo, long* outValue); extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue); -extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue); -extern bool luaval_to_vector3(lua_State* L,int lo,cocos2d::Vector3* outValue); +extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue); +extern bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); extern bool luaval_to_size(lua_State* L,int lo,Size* outValue); extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue); @@ -69,27 +69,27 @@ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue); extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue); extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue); extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue ); -extern bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Matrix* outValue ); +extern bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Mat4* outValue ); extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue); extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue); -extern bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints); +extern bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints); extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret); extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret); -extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue); -extern bool luaval_to_vector3(lua_State* L,int lo,cocos2d::Vector3* outValue); +extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue); +extern bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue); extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outValue); -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vector2* outValue) +CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vec2* outValue) { return luaval_to_vector2(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, cocos2d::Matrix* outValue ) +CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, cocos2d::Mat4* outValue ) { return luaval_to_matrix(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints) +CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints) { return luaval_to_array_of_vector2(L, lo, points, numPoints); } @@ -234,9 +234,9 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) // from native -extern void vector2_to_luaval(lua_State* L,const cocos2d::Vector2& vec2); -extern void vector3_to_luaval(lua_State* L,const cocos2d::Vector3& vec3); -extern void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count); +extern void vector2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); +extern void Vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3); +extern void vector2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count); extern void size_to_luaval(lua_State* L,const Size& sz); extern void rect_to_luaval(lua_State* L,const Rect& rt); extern void color3b_to_luaval(lua_State* L,const Color3B& cc); @@ -249,16 +249,16 @@ extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValu extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue); extern void array_to_luaval(lua_State* L, __Array* inValue); extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict); -extern void matrix_to_luaval(lua_State* L, const cocos2d::Matrix& mat); +extern void matrix_to_luaval(lua_State* L, const cocos2d::Mat4& mat); extern void blendfunc_to_luaval(lua_State* L, const cocos2d::BlendFunc& func); extern void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config); -CC_DEPRECATED_ATTRIBUTE static inline void point_to_luaval(lua_State* L,const cocos2d::Vector2& pt) +CC_DEPRECATED_ATTRIBUTE static inline void point_to_luaval(lua_State* L,const cocos2d::Vec2& pt) { vector2_to_luaval(L, pt); } -CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count) +CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { vector2_array_to_luaval(L, points, count); } diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp index 91cb42cd38..80d41b1cf0 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp @@ -38,14 +38,14 @@ using namespace cocos2d::extension; -void GLNode::draw(Renderer *renderer, const cocos2d::Matrix& transform, bool transformUpdated) +void GLNode::draw(Renderer *renderer, const cocos2d::Mat4& transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(GLNode::onDraw, this, transform, transformUpdated); renderer->addCommand(&_renderCmd); } -void GLNode::onDraw(const cocos2d::Matrix &transform, bool transformUpdated) +void GLNode::onDraw(const cocos2d::Mat4 &transform, bool transformUpdated) { int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::GL_NODE_DRAW); if (0 != handler) @@ -4403,7 +4403,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoint00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 vec2; + cocos2d::Vec2 vec2; if(luaval_to_vector2(tolua_S, 1, &vec2)) { DrawPrimitives::drawPoint(vec2); @@ -4437,7 +4437,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoints00(lua_State* tolua_S) if (numberOfPoints > 0) { - cocos2d::Vector2* points = new cocos2d::Vector2[numberOfPoints]; + cocos2d::Vec2* points = new cocos2d::Vec2[numberOfPoints]; if (NULL == points) return 0; @@ -4486,11 +4486,11 @@ static int tolua_cocos2d_DrawPrimitives_drawLine00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 origin; + cocos2d::Vec2 origin; if (!luaval_to_vector2(tolua_S, 1, &origin)) return 0; - cocos2d::Vector2 destination; + cocos2d::Vec2 destination; if (!luaval_to_vector2(tolua_S, 2, &destination)) return 0; @@ -4519,11 +4519,11 @@ static int tolua_cocos2d_DrawPrimitives_drawRect00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 origin; + cocos2d::Vec2 origin; if (!luaval_to_vector2(tolua_S, 1, &origin)) return 0; - cocos2d::Vector2 destination; + cocos2d::Vec2 destination; if (!luaval_to_vector2(tolua_S, 2, &destination)) return 0; @@ -4554,11 +4554,11 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidRect00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 origin; + cocos2d::Vec2 origin; if (!luaval_to_vector2(tolua_S, 1, &origin)) return 0; - cocos2d::Vector2 destination; + cocos2d::Vec2 destination; if (!luaval_to_vector2(tolua_S, 2, &destination)) return 0; @@ -4599,7 +4599,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoly00(lua_State* tolua_S) if (numOfVertices > 0) { - cocos2d::Vector2* points = new cocos2d::Vector2[numOfVertices]; + cocos2d::Vec2* points = new cocos2d::Vec2[numOfVertices]; if (NULL == points) return 0; @@ -4653,7 +4653,7 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidPoly00(lua_State* tolua_S) unsigned int numberOfPoints = ((unsigned int) tolua_tonumber(tolua_S,2,0)); if (numberOfPoints > 0) { - cocos2d::Vector2* points = new cocos2d::Vector2[numberOfPoints]; + cocos2d::Vec2* points = new cocos2d::Vec2[numberOfPoints]; if (NULL == points) return 0; @@ -4716,7 +4716,7 @@ static int tolua_cocos2d_DrawPrimitives_drawCircle00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 center; + cocos2d::Vec2 center; if (!luaval_to_vector2(tolua_S, 1, ¢er)) return 0; @@ -4757,7 +4757,7 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidCircle00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 center; + cocos2d::Vec2 center; if (!luaval_to_vector2(tolua_S, 1, ¢er)) return 0; float radius = ((float) tolua_tonumber(tolua_S,2,0)); @@ -4794,15 +4794,15 @@ static int tolua_cocos2d_DrawPrimitives_drawQuadBezier00(lua_State* tolua_S) else #endif { - cocos2d::Vector2 origin; + cocos2d::Vec2 origin; if (!luaval_to_vector2(tolua_S, 1, &origin)) return 0; - cocos2d::Vector2 control; + cocos2d::Vec2 control; if (!luaval_to_vector2(tolua_S, 2, &control)) return 0; - cocos2d::Vector2 destination; + cocos2d::Vec2 destination; if (!luaval_to_vector2(tolua_S, 3, &destination)) return 0; @@ -4837,19 +4837,19 @@ static int tolua_cocos2d_DrawPrimitives_drawCubicBezier00(lua_State* tolua_S) #endif { - cocos2d::Vector2 origin; + cocos2d::Vec2 origin; if (!luaval_to_vector2(tolua_S, 1, &origin)) return 0; - cocos2d::Vector2 control1; + cocos2d::Vec2 control1; if (!luaval_to_vector2(tolua_S, 2, &control1)) return 0; - cocos2d::Vector2 control2; + cocos2d::Vec2 control2; if (!luaval_to_vector2(tolua_S, 3, &control2)) return 0; - cocos2d::Vector2 destination; + cocos2d::Vec2 destination; if (!luaval_to_vector2(tolua_S, 4, &destination)) return 0; @@ -4881,7 +4881,7 @@ int tolua_cocos2d_DrawPrimitives_drawCatmullRom00(lua_State* tolua_S) #endif { int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; if (!luaval_to_array_of_vector2(tolua_S, 1, &arr, &num)) return 0; @@ -4928,7 +4928,7 @@ int tolua_cocos2d_DrawPrimitives_drawCardinalSpline00(lua_State* tolua_S) #endif { int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; if (!luaval_to_array_of_vector2(tolua_S, 1, &arr, &num)) return 0; diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.h b/cocos/scripting/lua-bindings/manual/LuaOpengl.h index 950201fd78..606b99ae16 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.h +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.h @@ -39,10 +39,10 @@ class GLNode:public cocos2d::Node { public: virtual ~GLNode(){} - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix& transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4& transform, bool transformUpdated) override; protected: cocos2d::CustomCommand _renderCmd; - void onDraw(const cocos2d::Matrix &transform, bool transformUpdated); + void onDraw(const cocos2d::Mat4 &transform, bool transformUpdated); }; TOLUA_API int tolua_opengl_open(lua_State* tolua_S); diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index 42daac3c56..61bc38a2d8 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -2125,7 +2125,7 @@ int tolua_cocos2d_Node_setAnchorPoint(lua_State* tolua_S) if (1 == argc) { - cocos2d::Vector2 pt; + cocos2d::Vec2 pt; ok &= luaval_to_vector2(tolua_S, 2, &pt); if (!ok) return 0; @@ -2147,7 +2147,7 @@ int tolua_cocos2d_Node_setAnchorPoint(lua_State* tolua_S) if (!ok) return 0; - cobj->setAnchorPoint(cocos2d::Vector2(x,y)); + cobj->setAnchorPoint(cocos2d::Vec2(x,y)); return 0; } @@ -2291,7 +2291,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) return 0; int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2363,7 +2363,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) return 0; int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2427,7 +2427,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) return 0; int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2491,7 +2491,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) return 0; int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2551,7 +2551,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) return 0; int num = 0; - cocos2d::Vector2 *arr = NULL; + cocos2d::Vec2 *arr = NULL; ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2626,7 +2626,7 @@ static int tolua_cocos2d_DrawNode_drawPolygon(lua_State* tolua_S) size_t size = lua_tonumber(tolua_S, 3); if ( size > 0 ) { - cocos2d::Vector2* points = new cocos2d::Vector2[size]; + cocos2d::Vec2* points = new cocos2d::Vec2[size]; if (NULL == points) return 0; diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp index 52fed99e00..1998631dfa 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp @@ -162,8 +162,8 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S) if (argc == 3) { std::function arg0; - cocos2d::Vector2 arg1; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg1; + cocos2d::Vec2 arg2; LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0); do { arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool @@ -278,7 +278,7 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S) if (argc == 2) { std::function arg0; - cocos2d::Vector2 arg1; + cocos2d::Vec2 arg1; LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0); do { arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool @@ -325,7 +325,7 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0 = nullptr; + cocos2d::Vec2* arg0 = nullptr; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -355,7 +355,7 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { @@ -388,10 +388,10 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ @@ -446,7 +446,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -476,7 +476,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; cocos2d::PhysicsMaterial arg2; do { @@ -508,7 +508,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; cocos2d::PhysicsMaterial arg2; double arg3; @@ -566,7 +566,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -596,7 +596,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; cocos2d::PhysicsMaterial arg2; do { @@ -628,7 +628,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1; cocos2d::PhysicsMaterial arg2; double arg3; @@ -686,7 +686,7 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -706,9 +706,9 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; - cocos2d::Vector2 arg2; + cocos2d::Vec2 arg2; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ @@ -751,7 +751,7 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -763,7 +763,7 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S) CC_SAFE_FREE(arg0); return 0; } - cocos2d::Vector2 ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1); + cocos2d::Vec2 ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1); CC_SAFE_FREE(arg0); vector2_to_luaval(tolua_S, ret); return 1; @@ -803,7 +803,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cocos2d::Vector2 arg0[4]; + cocos2d::Vec2 arg0[4]; cobj->getPoints(arg0); vector2_array_to_luaval(tolua_S, arg0, 4); return 0; @@ -846,7 +846,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) if (argc == 0) { int count = cobj->getPointsCount(); - cocos2d::Vector2* arg0 = new cocos2d::Vector2[count]; + cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vector2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); @@ -880,7 +880,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -900,7 +900,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { @@ -921,10 +921,10 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ @@ -967,7 +967,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -1010,7 +1010,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) if (argc == 2) { double arg0; - cocos2d::Vector2* arg1; + cocos2d::Vec2* arg1; int arg2 = 0; ok &= luaval_to_number(tolua_S, 2,&arg0); do { @@ -1031,9 +1031,9 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) if (argc == 2) { double arg0; - cocos2d::Vector2* arg1; + cocos2d::Vec2* arg1; int arg2 = 0; - cocos2d::Vector2 arg3; + cocos2d::Vec2 arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); do { ok = luaval_to_array_of_vector2(tolua_S, 3, &arg1, &arg2); @@ -1087,7 +1087,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) if (argc == 0) { int count = cobj->getPointsCount(); - cocos2d::Vector2* arg0 = new cocos2d::Vector2[count]; + cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vector2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); @@ -1131,7 +1131,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) if (argc == 0) { int count = cobj->getPointsCount(); - cocos2d::Vector2* arg0 = new cocos2d::Vector2[count]; + cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vector2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); @@ -1175,7 +1175,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) if (argc == 0) { int count = cobj->getPointsCount(); - cocos2d::Vector2* arg0 = new cocos2d::Vector2[count]; + cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vector2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); @@ -1313,7 +1313,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -1332,7 +1332,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { @@ -1353,7 +1353,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; double arg3; @@ -1400,7 +1400,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) if (argc == 1) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; do { ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); @@ -1419,7 +1419,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) } if (argc == 2) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { @@ -1440,7 +1440,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) } if (argc == 3) { - cocos2d::Vector2* arg0; + cocos2d::Vec2* arg0; int arg1 = 0; cocos2d::PhysicsMaterial arg2; double arg3; diff --git a/cocos/ui/CCProtectedNode.cpp b/cocos/ui/CCProtectedNode.cpp index 45dc3e9dc8..6162e57846 100644 --- a/cocos/ui/CCProtectedNode.cpp +++ b/cocos/ui/CCProtectedNode.cpp @@ -268,7 +268,7 @@ void ProtectedNode::reorderProtectedChild(cocos2d::Node *child, int localZOrder) child->_setLocalZOrder(localZOrder); } -void ProtectedNode::visit(Renderer* renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // quick return if not visible. children won't be drawn. if (!_visible) @@ -283,7 +283,7 @@ void ProtectedNode::visit(Renderer* renderer, const Matrix &parentTransform, boo // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); diff --git a/cocos/ui/CCProtectedNode.h b/cocos/ui/CCProtectedNode.h index 22fbc8e10a..d49c690699 100644 --- a/cocos/ui/CCProtectedNode.h +++ b/cocos/ui/CCProtectedNode.h @@ -127,7 +127,7 @@ public: /// @} end of Children and Parent - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool transformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool transformUpdated) override; virtual void cleanup() override; diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index b54c7816bd..6b64134a45 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -135,7 +135,7 @@ void Button::initRenderer() _buttonClickedRenderer = Sprite::create(); _buttonDisableRenderer = Sprite::create(); _titleRenderer = Label::create(); - _titleRenderer->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + _titleRenderer->setAnchorPoint(Vec2::ANCHOR_MIDDLE); addProtectedChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1); addProtectedChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1); @@ -520,7 +520,7 @@ void Button::updateFlippedY() void Button::updateTitleLocation() { - _titleRenderer->setPosition(Vector2(_contentSize.width * 0.5f, _contentSize.height * 0.5f)); + _titleRenderer->setPosition(Vec2(_contentSize.width * 0.5f, _contentSize.height * 0.5f)); } void Button::onSizeChanged() diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 9b59671e6b..6ec19c02fb 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -477,7 +477,7 @@ void CheckBox::backGroundTextureScaleChangedWithSize() _backGroundBoxRenderer->setScaleX(scaleX); _backGroundBoxRenderer->setScaleY(scaleY); } - _backGroundBoxRenderer->setPosition(Vector2(_contentSize.width / 2, _contentSize.height / 2)); + _backGroundBoxRenderer->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); } void CheckBox::backGroundSelectedTextureScaleChangedWithSize() @@ -499,7 +499,7 @@ void CheckBox::backGroundSelectedTextureScaleChangedWithSize() _backGroundSelectedBoxRenderer->setScaleX(scaleX); _backGroundSelectedBoxRenderer->setScaleY(scaleY); } - _backGroundSelectedBoxRenderer->setPosition(Vector2(_contentSize.width / 2, _contentSize.height / 2)); + _backGroundSelectedBoxRenderer->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); } void CheckBox::frontCrossTextureScaleChangedWithSize() @@ -521,7 +521,7 @@ void CheckBox::frontCrossTextureScaleChangedWithSize() _frontCrossRenderer->setScaleX(scaleX); _frontCrossRenderer->setScaleY(scaleY); } - _frontCrossRenderer->setPosition(Vector2(_contentSize.width / 2, _contentSize.height / 2)); + _frontCrossRenderer->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); } void CheckBox::backGroundDisabledTextureScaleChangedWithSize() @@ -543,7 +543,7 @@ void CheckBox::backGroundDisabledTextureScaleChangedWithSize() _backGroundBoxDisabledRenderer->setScaleX(scaleX); _backGroundBoxDisabledRenderer->setScaleY(scaleY); } - _backGroundBoxDisabledRenderer->setPosition(Vector2(_contentSize.width / 2, _contentSize.height / 2)); + _backGroundBoxDisabledRenderer->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); } void CheckBox::frontCrossDisabledTextureScaleChangedWithSize() @@ -565,7 +565,7 @@ void CheckBox::frontCrossDisabledTextureScaleChangedWithSize() _frontCrossDisabledRenderer->setScaleX(scaleX); _frontCrossDisabledRenderer->setScaleY(scaleY); } - _frontCrossDisabledRenderer->setPosition(Vector2(_contentSize.width / 2, _contentSize.height / 2)); + _frontCrossDisabledRenderer->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); } std::string CheckBox::getDescription() const diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 22a7f8fed2..be628e30f9 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -135,7 +135,7 @@ void LinearVerticalLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, Ve if (layoutParameter) { LinearLayoutParameter::LinearGravity childGravity = layoutParameter->getGravity(); - Vector2 ap = child->getAnchorPoint(); + Vec2 ap = child->getAnchorPoint(); Size cs = child->getSize(); float finalPosX = ap.x * cs.width; float finalPosY = topBoundary - ((1.0f-ap.y) * cs.height); @@ -156,7 +156,7 @@ void LinearVerticalLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, Ve Margin mg = layoutParameter->getMargin(); finalPosX += mg.left; finalPosY -= mg.top; - child->setPosition(Vector2(finalPosX, finalPosY)); + child->setPosition(Vec2(finalPosX, finalPosY)); topBoundary = child->getBottomInParent() - mg.bottom; } } @@ -175,7 +175,7 @@ void LinearHorizontalLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, if (layoutParameter) { LinearLayoutParameter::LinearGravity childGravity = layoutParameter->getGravity(); - Vector2 ap = child->getAnchorPoint(); + Vec2 ap = child->getAnchorPoint(); Size cs = child->getSize(); float finalPosX = leftBoundary + (ap.x * cs.width); float finalPosY = layoutSize.height - (1.0f - ap.y) * cs.height; @@ -196,7 +196,7 @@ void LinearHorizontalLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, Margin mg = layoutParameter->getMargin(); finalPosX += mg.left; finalPosY -= mg.top; - child->setPosition(Vector2(finalPosX, finalPosY)); + child->setPosition(Vec2(finalPosX, finalPosY)); leftBoundary = child->getRightInParent() + mg.right; } } @@ -231,7 +231,7 @@ void RelativeLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, VectorgetAnchorPoint(); + Vec2 ap = child->getAnchorPoint(); Size cs = child->getSize(); RelativeLayoutParameter::RelativeAlign align = layoutParameter->getAlign(); const std::string relativeName = layoutParameter->getRelativeToWidgetName(); @@ -549,7 +549,7 @@ void RelativeLayoutExecutant::doLayout(const cocos2d::Size &layoutSize, VectorsetPosition(Vector2(finalPosX, finalPosY)); + child->setPosition(Vec2(finalPosX, finalPosY)); layoutParameter->_put = true; unlayoutChildCount--; } @@ -579,7 +579,7 @@ _gradientRender(nullptr), _cColor(Color3B::WHITE), _gStartColor(Color3B::WHITE), _gEndColor(Color3B::WHITE), -_alongVector(Vector2(0.0f, -1.0f)), +_alongVector(Vec2(0.0f, -1.0f)), _cOpacity(255), _backGroundImageTextureSize(Size::ZERO), _layoutType(Type::ABSOLUTE), @@ -609,7 +609,7 @@ _passFocusToChild(true), _loopFocus(false) { onPassFocusToChild = CC_CALLBACK_2(Layout::findNearestChildWidgetIndex, this); - this->setAnchorPoint(Vector2::ZERO); + this->setAnchorPoint(Vec2::ZERO); } Layout::~Layout() @@ -658,7 +658,7 @@ bool Layout::init() setBright(true); ignoreContentAdaptWithSize(false); setSize(Size::ZERO); - setAnchorPoint(Vector2::ZERO); + setAnchorPoint(Vec2::ZERO); return true; } return false; @@ -703,7 +703,7 @@ bool Layout::isClippingEnabled() return _clippingEnabled; } -void Layout::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Layout::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (!_enabled) { @@ -736,7 +736,7 @@ void Layout::sortAllChildren() doLayout(); } -void Layout::stencilClippingVisit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Layout::stencilClippingVisit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if(!_visible) return; @@ -747,7 +747,7 @@ void Layout::stencilClippingVisit(Renderer *renderer, const Matrix &parentTransf _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -853,7 +853,7 @@ void Layout::onBeforeVisitStencil() director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadIdentityMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - DrawPrimitives::drawSolidRect(Vector2(-1,-1), Vector2(1,1), Color4F(1, 1, 1, 1)); + DrawPrimitives::drawSolidRect(Vec2(-1,-1), Vec2(1,1), Color4F(1, 1, 1, 1)); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -894,7 +894,7 @@ void Layout::onAfterVisitScissor() glDisable(GL_SCISSOR_TEST); } -void Layout::scissorClippingVisit(Renderer *renderer, const Matrix& parentTransform, bool parentTransformUpdated) +void Layout::scissorClippingVisit(Renderer *renderer, const Mat4& parentTransform, bool parentTransformUpdated) { _beforeVisitCmdScissor.init(_globalZOrder); _beforeVisitCmdScissor.func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this); @@ -973,11 +973,11 @@ void Layout::setStencilClippingSize(const Size &size) { if (_clippingEnabled && _clippingType == ClippingType::STENCIL) { - Vector2 rect[4]; - rect[0] = Vector2::ZERO; - rect[1] = Vector2(_size.width, 0); - rect[2] = Vector2(_size.width, _size.height); - rect[3] = Vector2(0, _size.height); + Vec2 rect[4]; + rect[0] = Vec2::ZERO; + rect[1] = Vec2(_size.width, 0); + rect[2] = Vec2(_size.width, _size.height); + rect[3] = Vec2(0, _size.height); Color4F green(0, 1, 0, 1); _clippingStencil->clear(); _clippingStencil->drawPolygon(rect, 4, green, 0, green); @@ -988,7 +988,7 @@ const Rect& Layout::getClippingRect() { if (_clippingRectDirty) { - Vector2 worldPos = convertToWorldSpace(Vector2::ZERO); + Vec2 worldPos = convertToWorldSpace(Vec2::ZERO); AffineTransform t = getNodeToWorldAffineTransform(); float scissorWidth = _size.width*t.a; float scissorHeight = _size.height*t.d; @@ -1071,7 +1071,7 @@ void Layout::onSizeChanged() _clippingRectDirty = true; if (_backGroundImage) { - _backGroundImage->setPosition(Vector2(_size.width/2.0f, _size.height/2.0f)); + _backGroundImage->setPosition(Vec2(_size.width/2.0f, _size.height/2.0f)); if (_backGroundScale9Enabled && _backGroundImage) { static_cast(_backGroundImage)->setPreferredSize(_size); @@ -1149,7 +1149,7 @@ void Layout::setBackGroundImage(const std::string& fileName,TextureResType texTy } } _backGroundImageTextureSize = _backGroundImage->getContentSize(); - _backGroundImage->setPosition(Vector2(_size.width/2.0f, _size.height/2.0f)); + _backGroundImage->setPosition(Vec2(_size.width/2.0f, _size.height/2.0f)); updateBackGroundImageRGBA(); } @@ -1214,7 +1214,7 @@ void Layout::addBackGroundImage() _backGroundImage = Sprite::create(); addProtectedChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1); } - _backGroundImage->setPosition(Vector2(_size.width/2.0f, _size.height/2.0f)); + _backGroundImage->setPosition(Vec2(_size.width/2.0f, _size.height/2.0f)); } void Layout::removeBackGroundImage() @@ -1358,7 +1358,7 @@ GLubyte Layout::getBackGroundColorOpacity() return _cOpacity; } -void Layout::setBackGroundColorVector(const Vector2 &vector) +void Layout::setBackGroundColorVector(const Vec2 &vector) { _alongVector = vector; if (_gradientRender) @@ -1367,7 +1367,7 @@ void Layout::setBackGroundColorVector(const Vector2 &vector) } } -const Vector2& Layout::getBackGroundColorVector() +const Vec2& Layout::getBackGroundColorVector() { return _alongVector; } @@ -1576,20 +1576,20 @@ Size Layout::getLayoutContentSize()const return layoutSize; } -Vector2 Layout::getWorldCenterPoint(Widget* widget) +Vec2 Layout::getWorldCenterPoint(Widget* widget) { Layout *layout = dynamic_cast(widget); //FIXEDME: we don't need to calculate the content size of layout anymore Size widgetSize = layout ? layout->getLayoutContentSize() : widget->getSize(); // CCLOG("contnet size : width = %f, height = %f", widgetSize.width, widgetSize.height); - return widget->convertToWorldSpace(Vector2(widgetSize.width/2, widgetSize.height/2)); + return widget->convertToWorldSpace(Vec2(widgetSize.width/2, widgetSize.height/2)); } float Layout::caculateNearestDistance(Widget* baseWidget) { float distance = FLT_MAX; - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); for (Node* node : _children) { Layout *layout = dynamic_cast(node); @@ -1601,7 +1601,7 @@ float Layout::caculateNearestDistance(Widget* baseWidget) { Widget* w = dynamic_cast(node); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); length = (wPosition - widgetPosition).length(); } else { @@ -1622,7 +1622,7 @@ float Layout::caculateFarestDistance(cocos2d::ui::Widget *baseWidget) { float distance = -FLT_MAX; - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); for (Node* node : _children) { Layout *layout = dynamic_cast(node); @@ -1634,7 +1634,7 @@ float Layout::caculateFarestDistance(cocos2d::ui::Widget *baseWidget) { Widget* w = dynamic_cast(node); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); length = (wPosition - widgetPosition).length(); } else { @@ -1677,13 +1677,13 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi int found = 0; if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT) { - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) { Widget *w = dynamic_cast(this->getChildren().at(index)); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); float length; Layout *layout = dynamic_cast(w); if (layout) @@ -1710,13 +1710,13 @@ int Layout::findNearestChildWidgetIndex(FocusDirection direction, Widget* baseWi found = 0; distance = FLT_MAX; if (direction == FocusDirection::DOWN || direction == FocusDirection::UP) { - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) { Widget *w = dynamic_cast(this->getChildren().at(index)); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); float length; Layout *layout = dynamic_cast(w); if (layout) @@ -1756,13 +1756,13 @@ int Layout::findFarestChildWidgetIndex(FocusDirection direction, cocos2d::ui::Wi int found = 0; if (direction == FocusDirection::LEFT || direction == FocusDirection::RIGHT) { - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) { Widget *w = dynamic_cast(this->getChildren().at(index)); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); float length; Layout *layout = dynamic_cast(w); if (layout) @@ -1789,13 +1789,13 @@ int Layout::findFarestChildWidgetIndex(FocusDirection direction, cocos2d::ui::Wi found = 0; distance = -FLT_MAX; if (direction == FocusDirection::DOWN || direction == FocusDirection::UP) { - Vector2 widgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 widgetPosition = this->getWorldCenterPoint(baseWidget); while (index < count) { Widget *w = dynamic_cast(this->getChildren().at(index)); if (w && w->isFocusEnabled()) { - Vector2 wPosition = this->getWorldCenterPoint(w); + Vec2 wPosition = this->getWorldCenterPoint(w); float length; Layout *layout = dynamic_cast(w); if (layout) @@ -1869,9 +1869,9 @@ void Layout::findProperSearchingFunctor(FocusDirection dir, Widget* baseWidget) return; } - Vector2 previousWidgetPosition = this->getWorldCenterPoint(baseWidget); + Vec2 previousWidgetPosition = this->getWorldCenterPoint(baseWidget); - Vector2 layoutPosition = this->getWorldCenterPoint(this->findFirstNonLayoutWidget()); + Vec2 layoutPosition = this->getWorldCenterPoint(this->findFirstNonLayoutWidget()); if (dir == FocusDirection::LEFT) { if (previousWidgetPosition.x > layoutPosition.x) { diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 2a1e63d7e0..f9f5eab81d 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -153,9 +153,9 @@ public: * * @param vector */ - void setBackGroundColorVector(const Vector2 &vector); + void setBackGroundColorVector(const Vec2 &vector); - const Vector2& getBackGroundColorVector(); + const Vec2& getBackGroundColorVector(); void setBackGroundImageColor(const Color3B& color); @@ -228,7 +228,7 @@ public: */ virtual void addChild(Node* child, int zOrder, int tag) override; - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; virtual void removeChild(Node* child, bool cleanup = true) override; @@ -308,8 +308,8 @@ protected: virtual void copySpecialProperties(Widget* model) override; virtual void copyClonedWidgetChildren(Widget* model) override; - void stencilClippingVisit(Renderer *renderer, const Matrix& parentTransform, bool parentTransformUpdated); - void scissorClippingVisit(Renderer *renderer, const Matrix& parentTransform, bool parentTransformUpdated); + void stencilClippingVisit(Renderer *renderer, const Mat4& parentTransform, bool parentTransformUpdated); + void scissorClippingVisit(Renderer *renderer, const Mat4& parentTransform, bool parentTransformUpdated); void setStencilClippingSize(const Size& size); const Rect& getClippingRect(); @@ -386,7 +386,7 @@ protected: /** * get the center point of a widget in world space */ - Vector2 getWorldCenterPoint(Widget* node); + Vec2 getWorldCenterPoint(Widget* node); /** * this method is called internally by nextFocusedWidget. When the dir is Right/Down, then this method will be called @@ -445,7 +445,7 @@ protected: Color3B _cColor; Color3B _gStartColor; Color3B _gEndColor; - Vector2 _alongVector; + Vec2 _alongVector; GLubyte _cOpacity; Size _backGroundImageTextureSize; Type _layoutType; diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index dd3f8ee01a..d61af9d837 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -444,7 +444,7 @@ void ListView::selectedItemEvent(int state) } -void ListView::interceptTouchEvent(int handleState, Widget *sender, const Vector2 &touchPoint) +void ListView::interceptTouchEvent(int handleState, Widget *sender, const Vec2 &touchPoint) { ScrollView::interceptTouchEvent(handleState, sender, touchPoint); if (handleState != 1) diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index 8394c340ef..5407dd4b41 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -205,7 +205,7 @@ protected: virtual void copySpecialProperties(Widget* model) override; virtual void copyClonedWidgetChildren(Widget* model) override; void selectedItemEvent(int state); - virtual void interceptTouchEvent(int handleState,Widget* sender,const Vector2 &touchPoint) override; + virtual void interceptTouchEvent(int handleState,Widget* sender,const Vec2 &touchPoint) override; protected: Widget* _model; diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index 56e6f0b8ac..fd4395487b 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -82,7 +82,7 @@ void LoadingBar::initRenderer() { _barRenderer = Sprite::create(); addProtectedChild(_barRenderer, BAR_RENDERER_Z, -1); - _barRenderer->setAnchorPoint(Vector2(0.0,0.5)); + _barRenderer->setAnchorPoint(Vec2(0.0,0.5)); } @@ -97,16 +97,16 @@ void LoadingBar::setDirection(cocos2d::ui::LoadingBar::Direction direction) switch (_direction) { case Direction::LEFT: - _barRenderer->setAnchorPoint(Vector2(0.0f,0.5f)); - _barRenderer->setPosition(Vector2(-_totalLength*0.5f,0.0f)); + _barRenderer->setAnchorPoint(Vec2(0.0f,0.5f)); + _barRenderer->setPosition(Vec2(-_totalLength*0.5f,0.0f)); if (!_scale9Enabled) { static_cast(_barRenderer)->setFlippedX(false); } break; case Direction::RIGHT: - _barRenderer->setAnchorPoint(Vector2(1.0f,0.5f)); - _barRenderer->setPosition(Vector2(_totalLength*0.5f,0.0f)); + _barRenderer->setAnchorPoint(Vec2(1.0f,0.5f)); + _barRenderer->setPosition(Vec2(_totalLength*0.5f,0.0f)); if (!_scale9Enabled) { static_cast(_barRenderer)->setFlippedX(true); @@ -165,14 +165,14 @@ LoadingBar::Direction LoadingBar::getDirection()const switch (_direction) { case Direction::LEFT: - _barRenderer->setAnchorPoint(Vector2(0.0f,0.5f)); + _barRenderer->setAnchorPoint(Vec2(0.0f,0.5f)); if (!_scale9Enabled) { static_cast(_barRenderer)->setFlippedX(false); } break; case Direction::RIGHT: - _barRenderer->setAnchorPoint(Vector2(1.0f,0.5f)); + _barRenderer->setAnchorPoint(Vec2(1.0f,0.5f)); if (!_scale9Enabled) { static_cast(_barRenderer)->setFlippedX(true); @@ -337,10 +337,10 @@ void LoadingBar::barRendererScaleChangedWithSize() switch (_direction) { case Direction::LEFT: - _barRenderer->setPosition(Vector2(0.0f, _contentSize.height / 2.0f)); + _barRenderer->setPosition(Vec2(0.0f, _contentSize.height / 2.0f)); break; case Direction::RIGHT: - _barRenderer->setPosition(Vector2(_totalLength, _contentSize.height / 2.0f)); + _barRenderer->setPosition(Vec2(_totalLength, _contentSize.height / 2.0f)); break; default: break; diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index ae65a9036f..4a69fa7aba 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -35,7 +35,7 @@ _curPageIdx(0), _touchMoveDir(TouchDirection::LEFT), _touchStartLocation(0.0f), _touchMoveStartLocation(0.0f), -_movePagePoint(Vector2::ZERO), +_movePagePoint(Vec2::ZERO), _leftChild(nullptr), _rightChild(nullptr), _leftBoundary(0.0f), @@ -143,7 +143,7 @@ void PageView::addPage(Layout* page) CCLOG("page size does not match pageview size, it will be force sized!"); page->setSize(pvSize); } - page->setPosition(Vector2(getPositionXByIndex(_pages.size()), 0)); + page->setPosition(Vec2(getPositionXByIndex(_pages.size()), 0)); _pages.pushBack(page); addChild(page); updateBoundaryPages(); @@ -173,7 +173,7 @@ void PageView::insertPage(Layout* page, int idx) else { _pages.insert(idx, page); - page->setPosition(Vector2(getPositionXByIndex(idx), 0)); + page->setPosition(Vec2(getPositionXByIndex(idx), 0)); addChild(page); Size pSize = page->getSize(); Size pvSize = getSize(); @@ -185,8 +185,8 @@ void PageView::insertPage(Layout* page, int idx) ssize_t length = _pages.size(); for (ssize_t i=(idx+1); igetPosition(); - behindPage->setPosition(Vector2(formerPos.x+getSize().width, 0)); + Vec2 formerPos = behindPage->getPosition(); + behindPage->setPosition(Vec2(formerPos.x+getSize().width, 0)); } updateBoundaryPages(); } @@ -292,7 +292,7 @@ void PageView::updateChildrenPosition() for (int i=0; isetPosition(Vector2((i-_curPageIdx)*pageWidth, 0)); + page->setPosition(Vec2((i-_curPageIdx)*pageWidth, 0)); } } @@ -459,16 +459,16 @@ bool PageView::scrollPages(float touchOffset) return true; } -void PageView::handlePressLogic(const Vector2 &touchPoint) +void PageView::handlePressLogic(const Vec2 &touchPoint) { - Vector2 nsp = convertToNodeSpace(touchPoint); + Vec2 nsp = convertToNodeSpace(touchPoint); _touchMoveStartLocation = nsp.x; _touchStartLocation = nsp.x; } -void PageView::handleMoveLogic(const Vector2 &touchPoint) +void PageView::handleMoveLogic(const Vec2 &touchPoint) { - Vector2 nsp = convertToNodeSpace(touchPoint); + Vec2 nsp = convertToNodeSpace(touchPoint); float offset = 0.0; float moveX = nsp.x; offset = moveX - _touchMoveStartLocation; @@ -484,7 +484,7 @@ void PageView::handleMoveLogic(const Vector2 &touchPoint) scrollPages(offset); } -void PageView::handleReleaseLogic(const Vector2 &touchPoint) +void PageView::handleReleaseLogic(const Vec2 &touchPoint) { if (_pages.size() <= 0) { @@ -493,7 +493,7 @@ void PageView::handleReleaseLogic(const Vector2 &touchPoint) Widget* curPage = _pages.at(_curPageIdx); if (curPage) { - Vector2 curPagePos = curPage->getPosition(); + Vec2 curPagePos = curPage->getPosition(); ssize_t pageCount = _pages.size(); float curPageLocation = curPagePos.x; float pageWidth = getSize().width; @@ -527,12 +527,12 @@ void PageView::handleReleaseLogic(const Vector2 &touchPoint) } } -void PageView::checkChildInfo(int handleState,Widget* sender, const Vector2 &touchPoint) +void PageView::checkChildInfo(int handleState,Widget* sender, const Vec2 &touchPoint) { interceptTouchEvent(handleState, sender, touchPoint); } -void PageView::interceptTouchEvent(int handleState, Widget *sender, const Vector2 &touchPoint) +void PageView::interceptTouchEvent(int handleState, Widget *sender, const Vec2 &touchPoint) { switch (handleState) { diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 8d6f9b4728..75153408a4 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -189,11 +189,11 @@ virtual Widget* getChildByName(const std::string& name) override {return Widget: Layout* createPage(); float getPositionXByIndex(ssize_t idx); void updateBoundaryPages(); - virtual void handlePressLogic(const Vector2 &touchPoint) override; - virtual void handleMoveLogic(const Vector2 &touchPoint) override; - virtual void handleReleaseLogic(const Vector2 &touchPoint) override; - virtual void interceptTouchEvent(int handleState, Widget* sender, const Vector2 &touchPoint) override; - virtual void checkChildInfo(int handleState, Widget* sender, const Vector2 &touchPoint) override; + virtual void handlePressLogic(const Vec2 &touchPoint) override; + virtual void handleMoveLogic(const Vec2 &touchPoint) override; + virtual void handleReleaseLogic(const Vec2 &touchPoint) override; + virtual void interceptTouchEvent(int handleState, Widget* sender, const Vec2 &touchPoint) override; + virtual void checkChildInfo(int handleState, Widget* sender, const Vec2 &touchPoint) override; virtual bool scrollPages(float touchOffset); void movePages(float offset); void pageTurningEvent(); @@ -211,7 +211,7 @@ protected: TouchDirection _touchMoveDir; float _touchStartLocation; float _touchMoveStartLocation; - Vector2 _movePagePoint; + Vec2 _movePagePoint; Widget* _leftChild; Widget* _rightChild; float _leftBoundary; diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 1c96d9e50b..e0436e594f 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -162,7 +162,7 @@ bool RichText::init() void RichText::initRenderer() { _elementRenderersContainer = Node::create(); - _elementRenderersContainer->setAnchorPoint(Vector2(0.5f, 0.5f)); + _elementRenderersContainer->setAnchorPoint(Vec2(0.5f, 0.5f)); addProtectedChild(_elementRenderersContainer, 0, -1); } @@ -367,8 +367,8 @@ void RichText::formarRenderers() for (ssize_t j=0; jsize(); j++) { Node* l = row->at(j); - l->setAnchorPoint(Vector2::ZERO); - l->setPosition(Vector2(nextPosX, 0.0f)); + l->setAnchorPoint(Vec2::ZERO); + l->setPosition(Vec2(nextPosX, 0.0f)); _elementRenderersContainer->addChild(l, 1, (int)j); Size iSize = l->getContentSize(); newContentSizeWidth += iSize.width; @@ -406,8 +406,8 @@ void RichText::formarRenderers() for (ssize_t j=0; jsize(); j++) { Node* l = row->at(j); - l->setAnchorPoint(Vector2::ZERO); - l->setPosition(Vector2(nextPosX, nextPosY)); + l->setAnchorPoint(Vec2::ZERO); + l->setPosition(Vec2(nextPosX, nextPosY)); _elementRenderersContainer->addChild(l, 1, (int)(i*10 + j)); nextPosX += l->getContentSize().width; } @@ -447,7 +447,7 @@ void RichText::pushToContainer(cocos2d::Node *renderer) _elementRenders[_elementRenders.size()-1]->pushBack(renderer); } -void RichText::visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void RichText::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (_enabled) { @@ -461,7 +461,7 @@ void RichText::setVerticalSpace(float space) _verticalSpace = space; } -void RichText::setAnchorPoint(const Vector2 &pt) +void RichText::setAnchorPoint(const Vec2 &pt) { Widget::setAnchorPoint(pt); _elementRenderersContainer->setAnchorPoint(pt); diff --git a/cocos/ui/UIRichText.h b/cocos/ui/UIRichText.h index b65ee42053..b3893bef12 100644 --- a/cocos/ui/UIRichText.h +++ b/cocos/ui/UIRichText.h @@ -102,9 +102,9 @@ public: void pushBackElement(RichElement* element); void removeElement(int index); void removeElement(RichElement* element); - virtual void visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; void setVerticalSpace(float space); - virtual void setAnchorPoint(const Vector2 &pt); + virtual void setAnchorPoint(const Vec2 &pt); virtual const Size& getVirtualRendererSize() const override; void formatText(); virtual void ignoreContentAdaptWithSize(bool ignore); diff --git a/cocos/ui/UIScrollInterface.h b/cocos/ui/UIScrollInterface.h index 68e7187c8e..f4ba00dc00 100644 --- a/cocos/ui/UIScrollInterface.h +++ b/cocos/ui/UIScrollInterface.h @@ -37,10 +37,10 @@ public: virtual ~UIScrollInterface() {} protected: - virtual void handlePressLogic(const Vector2 &touchPoint) = 0; - virtual void handleMoveLogic(const Vector2 &touchPoint) = 0; - virtual void handleReleaseLogic(const Vector2 &touchPoint) = 0; - virtual void interceptTouchEvent(int handleState, Widget* sender, const Vector2 &touchPoint) = 0; + virtual void handlePressLogic(const Vec2 &touchPoint) = 0; + virtual void handleMoveLogic(const Vec2 &touchPoint) = 0; + virtual void handleReleaseLogic(const Vec2 &touchPoint) = 0; + virtual void interceptTouchEvent(int handleState, Widget* sender, const Vec2 &touchPoint) = 0; }; } diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 3d904cda8a..ae1313aa9e 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -65,21 +65,21 @@ const Size& ScrollInnerContainer::getLayoutSize() static const float AUTOSCROLLMAXSPEED = 1000.0f; -const Vector2 SCROLLDIR_UP = Vector2(0.0f, 1.0f); -const Vector2 SCROLLDIR_DOWN = Vector2(0.0f, -1.0f); -const Vector2 SCROLLDIR_LEFT = Vector2(-1.0f, 0.0f); -const Vector2 SCROLLDIR_RIGHT = Vector2(1.0f, 0.0f); +const Vec2 SCROLLDIR_UP = Vec2(0.0f, 1.0f); +const Vec2 SCROLLDIR_DOWN = Vec2(0.0f, -1.0f); +const Vec2 SCROLLDIR_LEFT = Vec2(-1.0f, 0.0f); +const Vec2 SCROLLDIR_RIGHT = Vec2(1.0f, 0.0f); IMPLEMENT_CLASS_GUI_INFO(ScrollView) ScrollView::ScrollView(): _innerContainer(nullptr), _direction(Direction::VERTICAL), -_touchBeganPoint(Vector2::ZERO), -_touchMovedPoint(Vector2::ZERO), -_touchEndedPoint(Vector2::ZERO), -_touchMovingPoint(Vector2::ZERO), -_autoScrollDir(Vector2::ZERO), +_touchBeganPoint(Vec2::ZERO), +_touchMovedPoint(Vec2::ZERO), +_touchEndedPoint(Vec2::ZERO), +_touchMovingPoint(Vec2::ZERO), +_autoScrollDir(Vec2::ZERO), _topBoundary(0.0f), _bottomBoundary(0.0f), _leftBoundary(0.0f), @@ -94,10 +94,10 @@ _autoScrollOriginalSpeed(0.0f), _autoScrollAcceleration(-1000.0f), _isAutoScrollSpeedAttenuated(false), _needCheckAutoScrollDestination(false), -_autoScrollDestination(Vector2::ZERO), +_autoScrollDestination(Vec2::ZERO), _bePressed(false), _slidTime(0.0f), -_moveChildPoint(Vector2::ZERO), +_moveChildPoint(Vec2::ZERO), _childFocusCancelOffset(5.0f), _leftBounceNeeded(false), _topBounceNeeded(false), @@ -105,7 +105,7 @@ _rightBounceNeeded(false), _bottomBounceNeeded(false), _bounceEnabled(false), _bouncing(false), -_bounceDir(Vector2::ZERO), +_bounceDir(Vec2::ZERO), _bounceOriginalSpeed(0.0f), _inertiaScrollEnabled(true), _scrollViewEventListener(nullptr), @@ -174,7 +174,7 @@ void ScrollView::onSizeChanged() float innerSizeWidth = MAX(orginInnerSizeWidth, _size.width); float innerSizeHeight = MAX(orginInnerSizeHeight, _size.height); _innerContainer->setSize(Size(innerSizeWidth, innerSizeHeight)); - _innerContainer->setPosition(Vector2(0, _size.height - _innerContainer->getSize().height)); + _innerContainer->setPosition(Vec2(0, _size.height - _innerContainer->getSize().height)); } void ScrollView::setInnerContainerSize(const Size &size) @@ -236,19 +236,19 @@ void ScrollView::setInnerContainerSize(const Size &size) } if (_innerContainer->getLeftInParent() > 0.0f) { - _innerContainer->setPosition(Vector2(_innerContainer->getAnchorPoint().x * _innerContainer->getSize().width, _innerContainer->getPosition().y)); + _innerContainer->setPosition(Vec2(_innerContainer->getAnchorPoint().x * _innerContainer->getSize().width, _innerContainer->getPosition().y)); } if (_innerContainer->getRightInParent() < _size.width) { - _innerContainer->setPosition(Vector2(_size.width - ((1.0f - _innerContainer->getAnchorPoint().x) * _innerContainer->getSize().width), _innerContainer->getPosition().y)); + _innerContainer->setPosition(Vec2(_size.width - ((1.0f - _innerContainer->getAnchorPoint().x) * _innerContainer->getSize().width), _innerContainer->getPosition().y)); } if (_innerContainer->getPosition().y > 0.0f) { - _innerContainer->setPosition(Vector2(_innerContainer->getPosition().x, _innerContainer->getAnchorPoint().y * _innerContainer->getSize().height)); + _innerContainer->setPosition(Vec2(_innerContainer->getPosition().x, _innerContainer->getAnchorPoint().y * _innerContainer->getSize().height)); } if (_innerContainer->getTopInParent() < _size.height) { - _innerContainer->setPosition(Vector2(_innerContainer->getPosition().x, _size.height - (1.0f - _innerContainer->getAnchorPoint().y) * _innerContainer->getSize().height)); + _innerContainer->setPosition(Vec2(_innerContainer->getPosition().x, _size.height - (1.0f - _innerContainer->getAnchorPoint().y) * _innerContainer->getSize().height)); } } @@ -314,7 +314,7 @@ Widget* ScrollView::getChildByName(const std::string& name) void ScrollView::moveChildren(float offsetX, float offsetY) { - _moveChildPoint = _innerContainer->getPosition() + Vector2(offsetX, offsetY); + _moveChildPoint = _innerContainer->getPosition() + Vec2(offsetX, offsetY); _innerContainer->setPosition(_moveChildPoint); } @@ -391,56 +391,56 @@ bool ScrollView::checkNeedBounce() { if (_topBounceNeeded && _leftBounceNeeded) { - Vector2 scrollVector = Vector2(0.0f, _size.height) - Vector2(_innerContainer->getLeftInParent(), _innerContainer->getTopInParent()); + Vec2 scrollVector = Vec2(0.0f, _size.height) - Vec2(_innerContainer->getLeftInParent(), _innerContainer->getTopInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_topBounceNeeded && _rightBounceNeeded) { - Vector2 scrollVector = Vector2(_size.width, _size.height) - Vector2(_innerContainer->getRightInParent(), _innerContainer->getTopInParent()); + Vec2 scrollVector = Vec2(_size.width, _size.height) - Vec2(_innerContainer->getRightInParent(), _innerContainer->getTopInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_bottomBounceNeeded && _leftBounceNeeded) { - Vector2 scrollVector = Vector2::ZERO - Vector2(_innerContainer->getLeftInParent(), _innerContainer->getBottomInParent()); + Vec2 scrollVector = Vec2::ZERO - Vec2(_innerContainer->getLeftInParent(), _innerContainer->getBottomInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_bottomBounceNeeded && _rightBounceNeeded) { - Vector2 scrollVector = Vector2(_size.width, 0.0f) - Vector2(_innerContainer->getRightInParent(), _innerContainer->getBottomInParent()); + Vec2 scrollVector = Vec2(_size.width, 0.0f) - Vec2(_innerContainer->getRightInParent(), _innerContainer->getBottomInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_topBounceNeeded) { - Vector2 scrollVector = Vector2(0.0f, _size.height) - Vector2(0.0f, _innerContainer->getTopInParent()); + Vec2 scrollVector = Vec2(0.0f, _size.height) - Vec2(0.0f, _innerContainer->getTopInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_bottomBounceNeeded) { - Vector2 scrollVector = Vector2::ZERO - Vector2(0.0f, _innerContainer->getBottomInParent()); + Vec2 scrollVector = Vec2::ZERO - Vec2(0.0f, _innerContainer->getBottomInParent()); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_leftBounceNeeded) { - Vector2 scrollVector = Vector2::ZERO - Vector2(_innerContainer->getLeftInParent(), 0.0f); + Vec2 scrollVector = Vec2::ZERO - Vec2(_innerContainer->getLeftInParent(), 0.0f); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); } else if (_rightBounceNeeded) { - Vector2 scrollVector = Vector2(_size.width, 0.0f) - Vector2(_innerContainer->getRightInParent(), 0.0f); + Vec2 scrollVector = Vec2(_size.width, 0.0f) - Vec2(_innerContainer->getRightInParent(), 0.0f); float orSpeed = scrollVector.getLength()/(0.2f); _bounceDir = scrollVector.getNormalized(); startBounceChildren(orSpeed); @@ -510,7 +510,7 @@ void ScrollView::stopBounceChildren() _bottomBounceNeeded = false; } -void ScrollView::startAutoScrollChildrenWithOriginalSpeed(const Vector2& dir, float v, bool attenuated, float acceleration) +void ScrollView::startAutoScrollChildrenWithOriginalSpeed(const Vec2& dir, float v, bool attenuated, float acceleration) { stopAutoScrollChildren(); _autoScrollDir = dir; @@ -520,12 +520,12 @@ void ScrollView::startAutoScrollChildrenWithOriginalSpeed(const Vector2& dir, fl _autoScrollAcceleration = acceleration; } -void ScrollView::startAutoScrollChildrenWithDestination(const Vector2& des, float time, bool attenuated) +void ScrollView::startAutoScrollChildrenWithDestination(const Vec2& des, float time, bool attenuated) { _needCheckAutoScrollDestination = false; _autoScrollDestination = des; - Vector2 dis = des - _innerContainer->getPosition(); - Vector2 dir = dis.getNormalized(); + Vec2 dis = des - _innerContainer->getPosition(); + Vec2 dir = dis.getNormalized(); float orSpeed = 0.0f; float acceleration = -1000.0f; if (attenuated) @@ -541,7 +541,7 @@ void ScrollView::startAutoScrollChildrenWithDestination(const Vector2& des, floa startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, attenuated, acceleration); } -void ScrollView::jumpToDestination(const Vector2 &des) +void ScrollView::jumpToDestination(const Vec2 &des) { float finalOffsetX = des.x; float finalOffsetY = des.y; @@ -572,7 +572,7 @@ void ScrollView::jumpToDestination(const Vector2 &des) default: break; } - _innerContainer->setPosition(Vector2(finalOffsetX, finalOffsetY)); + _innerContainer->setPosition(Vec2(finalOffsetX, finalOffsetY)); } void ScrollView::stopAutoScrollChildren() @@ -1194,22 +1194,22 @@ bool ScrollView::scrollChildren(float touchOffsetX, float touchOffsetY) void ScrollView::scrollToBottom(float time, bool attenuated) { - startAutoScrollChildrenWithDestination(Vector2(_innerContainer->getPosition().x, 0.0f), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_innerContainer->getPosition().x, 0.0f), time, attenuated); } void ScrollView::scrollToTop(float time, bool attenuated) { - startAutoScrollChildrenWithDestination(Vector2(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height), time, attenuated); } void ScrollView::scrollToLeft(float time, bool attenuated) { - startAutoScrollChildrenWithDestination(Vector2(0.0f, _innerContainer->getPosition().y), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(0.0f, _innerContainer->getPosition().y), time, attenuated); } void ScrollView::scrollToRight(float time, bool attenuated) { - startAutoScrollChildrenWithDestination(Vector2(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y), time, attenuated); } void ScrollView::scrollToTopLeft(float time, bool attenuated) @@ -1219,7 +1219,7 @@ void ScrollView::scrollToTopLeft(float time, bool attenuated) CCLOG("Scroll diretion is not both!"); return; } - startAutoScrollChildrenWithDestination(Vector2(0.0f, _size.height - _innerContainer->getSize().height), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(0.0f, _size.height - _innerContainer->getSize().height), time, attenuated); } void ScrollView::scrollToTopRight(float time, bool attenuated) @@ -1229,7 +1229,7 @@ void ScrollView::scrollToTopRight(float time, bool attenuated) CCLOG("Scroll diretion is not both!"); return; } - startAutoScrollChildrenWithDestination(Vector2(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height), time, attenuated); } void ScrollView::scrollToBottomLeft(float time, bool attenuated) @@ -1239,7 +1239,7 @@ void ScrollView::scrollToBottomLeft(float time, bool attenuated) CCLOG("Scroll diretion is not both!"); return; } - startAutoScrollChildrenWithDestination(Vector2::ZERO, time, attenuated); + startAutoScrollChildrenWithDestination(Vec2::ZERO, time, attenuated); } void ScrollView::scrollToBottomRight(float time, bool attenuated) @@ -1249,23 +1249,23 @@ void ScrollView::scrollToBottomRight(float time, bool attenuated) CCLOG("Scroll diretion is not both!"); return; } - startAutoScrollChildrenWithDestination(Vector2(_size.width - _innerContainer->getSize().width, 0.0f), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_size.width - _innerContainer->getSize().width, 0.0f), time, attenuated); } void ScrollView::scrollToPercentVertical(float percent, float time, bool attenuated) { float minY = _size.height - _innerContainer->getSize().height; float h = - minY; - startAutoScrollChildrenWithDestination(Vector2(_innerContainer->getPosition().x, minY + percent * h / 100.0f), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(_innerContainer->getPosition().x, minY + percent * h / 100.0f), time, attenuated); } void ScrollView::scrollToPercentHorizontal(float percent, float time, bool attenuated) { float w = _innerContainer->getSize().width - _size.width; - startAutoScrollChildrenWithDestination(Vector2(-(percent * w / 100.0f), _innerContainer->getPosition().y), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(-(percent * w / 100.0f), _innerContainer->getPosition().y), time, attenuated); } -void ScrollView::scrollToPercentBothDirection(const Vector2& percent, float time, bool attenuated) +void ScrollView::scrollToPercentBothDirection(const Vec2& percent, float time, bool attenuated) { if (_direction != Direction::BOTH) { @@ -1274,27 +1274,27 @@ void ScrollView::scrollToPercentBothDirection(const Vector2& percent, float time float minY = _size.height - _innerContainer->getSize().height; float h = - minY; float w = _innerContainer->getSize().width - _size.width; - startAutoScrollChildrenWithDestination(Vector2(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f), time, attenuated); + startAutoScrollChildrenWithDestination(Vec2(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f), time, attenuated); } void ScrollView::jumpToBottom() { - jumpToDestination(Vector2(_innerContainer->getPosition().x, 0.0f)); + jumpToDestination(Vec2(_innerContainer->getPosition().x, 0.0f)); } void ScrollView::jumpToTop() { - jumpToDestination(Vector2(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height)); + jumpToDestination(Vec2(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height)); } void ScrollView::jumpToLeft() { - jumpToDestination(Vector2(0.0f, _innerContainer->getPosition().y)); + jumpToDestination(Vec2(0.0f, _innerContainer->getPosition().y)); } void ScrollView::jumpToRight() { - jumpToDestination(Vector2(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y)); + jumpToDestination(Vec2(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y)); } void ScrollView::jumpToTopLeft() @@ -1304,7 +1304,7 @@ void ScrollView::jumpToTopLeft() CCLOG("Scroll diretion is not both!"); return; } - jumpToDestination(Vector2(0.0f, _size.height - _innerContainer->getSize().height)); + jumpToDestination(Vec2(0.0f, _size.height - _innerContainer->getSize().height)); } void ScrollView::jumpToTopRight() @@ -1314,7 +1314,7 @@ void ScrollView::jumpToTopRight() CCLOG("Scroll diretion is not both!"); return; } - jumpToDestination(Vector2(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height)); + jumpToDestination(Vec2(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height)); } void ScrollView::jumpToBottomLeft() @@ -1324,7 +1324,7 @@ void ScrollView::jumpToBottomLeft() CCLOG("Scroll diretion is not both!"); return; } - jumpToDestination(Vector2::ZERO); + jumpToDestination(Vec2::ZERO); } void ScrollView::jumpToBottomRight() @@ -1334,23 +1334,23 @@ void ScrollView::jumpToBottomRight() CCLOG("Scroll diretion is not both!"); return; } - jumpToDestination(Vector2(_size.width - _innerContainer->getSize().width, 0.0f)); + jumpToDestination(Vec2(_size.width - _innerContainer->getSize().width, 0.0f)); } void ScrollView::jumpToPercentVertical(float percent) { float minY = _size.height - _innerContainer->getSize().height; float h = - minY; - jumpToDestination(Vector2(_innerContainer->getPosition().x, minY + percent * h / 100.0f)); + jumpToDestination(Vec2(_innerContainer->getPosition().x, minY + percent * h / 100.0f)); } void ScrollView::jumpToPercentHorizontal(float percent) { float w = _innerContainer->getSize().width - _size.width; - jumpToDestination(Vector2(-(percent * w / 100.0f), _innerContainer->getPosition().y)); + jumpToDestination(Vec2(-(percent * w / 100.0f), _innerContainer->getPosition().y)); } -void ScrollView::jumpToPercentBothDirection(const Vector2& percent) +void ScrollView::jumpToPercentBothDirection(const Vec2& percent) { if (_direction != Direction::BOTH) { @@ -1359,7 +1359,7 @@ void ScrollView::jumpToPercentBothDirection(const Vector2& percent) float minY = _size.height - _innerContainer->getSize().height; float h = - minY; float w = _innerContainer->getSize().width - _size.width; - jumpToDestination(Vector2(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f)); + jumpToDestination(Vec2(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f)); } void ScrollView::startRecordSlidAction() @@ -1384,7 +1384,7 @@ void ScrollView::endRecordSlidAction() return; } float totalDis = 0.0f; - Vector2 dir; + Vec2 dir; switch (_direction) { case Direction::VERTICAL: @@ -1411,7 +1411,7 @@ void ScrollView::endRecordSlidAction() break; case Direction::BOTH: { - Vector2 subVector = _touchEndedPoint - _touchBeganPoint; + Vec2 subVector = _touchEndedPoint - _touchBeganPoint; totalDis = subVector.getLength(); dir = subVector.getNormalized(); break; @@ -1425,7 +1425,7 @@ void ScrollView::endRecordSlidAction() } } -void ScrollView::handlePressLogic(const Vector2 &touchPoint) +void ScrollView::handlePressLogic(const Vec2 &touchPoint) { _touchBeganPoint = convertToNodeSpace(touchPoint); _touchMovingPoint = _touchBeganPoint; @@ -1433,10 +1433,10 @@ void ScrollView::handlePressLogic(const Vector2 &touchPoint) _bePressed = true; } -void ScrollView::handleMoveLogic(const Vector2 &touchPoint) +void ScrollView::handleMoveLogic(const Vec2 &touchPoint) { _touchMovedPoint = convertToNodeSpace(touchPoint); - Vector2 delta = _touchMovedPoint - _touchMovingPoint; + Vec2 delta = _touchMovedPoint - _touchMovingPoint; _touchMovingPoint = _touchMovedPoint; switch (_direction) { @@ -1460,7 +1460,7 @@ void ScrollView::handleMoveLogic(const Vector2 &touchPoint) } } -void ScrollView::handleReleaseLogic(const Vector2 &touchPoint) +void ScrollView::handleReleaseLogic(const Vec2 &touchPoint) { _touchEndedPoint = convertToNodeSpace(touchPoint); endRecordSlidAction(); @@ -1516,7 +1516,7 @@ void ScrollView::recordSlidTime(float dt) } } -void ScrollView::interceptTouchEvent(int handleState, Widget *sender, const Vector2 &touchPoint) +void ScrollView::interceptTouchEvent(int handleState, Widget *sender, const Vec2 &touchPoint) { switch (handleState) { @@ -1545,7 +1545,7 @@ void ScrollView::interceptTouchEvent(int handleState, Widget *sender, const Vect } } -void ScrollView::checkChildInfo(int handleState,Widget* sender,const Vector2 &touchPoint) +void ScrollView::checkChildInfo(int handleState,Widget* sender,const Vec2 &touchPoint) { interceptTouchEvent(handleState, sender, touchPoint); } diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index 96e68d9e7b..2f986dfdeb 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -180,7 +180,7 @@ public: /** * Scroll inner container to both direction percent position of scrollview. */ - void scrollToPercentBothDirection(const Vector2& percent, float time, bool attenuated); + void scrollToPercentBothDirection(const Vec2& percent, float time, bool attenuated); /** * Move inner container to bottom boundary of scrollview. @@ -235,7 +235,7 @@ public: /** * Move inner container to both direction percent position of scrollview. */ - void jumpToPercentBothDirection(const Vector2& percent); + void jumpToPercentBothDirection(const Vec2& percent); /** * Changes inner container size of scrollview. @@ -350,9 +350,9 @@ protected: void bounceChildren(float dt); void checkBounceBoundary(); bool checkNeedBounce(); - void startAutoScrollChildrenWithOriginalSpeed(const Vector2& dir, float v, bool attenuated, float acceleration); - void startAutoScrollChildrenWithDestination(const Vector2& des, float time, bool attenuated); - void jumpToDestination(const Vector2& des); + void startAutoScrollChildrenWithOriginalSpeed(const Vec2& dir, float v, bool attenuated, float acceleration); + void startAutoScrollChildrenWithDestination(const Vec2& des, float time, bool attenuated); + void jumpToDestination(const Vec2& des); void stopAutoScrollChildren(); void startBounceChildren(float v); void stopBounceChildren(); @@ -361,11 +361,11 @@ protected: bool bounceScrollChildren(float touchOffsetX, float touchOffsetY); void startRecordSlidAction(); virtual void endRecordSlidAction(); - virtual void handlePressLogic(const Vector2 &touchPoint) override; - virtual void handleMoveLogic(const Vector2 &touchPoint) override; - virtual void handleReleaseLogic(const Vector2 &touchPoint) override; - virtual void interceptTouchEvent(int handleState,Widget* sender,const Vector2 &touchPoint) override; - virtual void checkChildInfo(int handleState,Widget* sender,const Vector2 &touchPoint) override; + virtual void handlePressLogic(const Vec2 &touchPoint) override; + virtual void handleMoveLogic(const Vec2 &touchPoint) override; + virtual void handleReleaseLogic(const Vec2 &touchPoint) override; + virtual void interceptTouchEvent(int handleState,Widget* sender,const Vec2 &touchPoint) override; + virtual void checkChildInfo(int handleState,Widget* sender,const Vec2 &touchPoint) override; void recordSlidTime(float dt); void scrollToTopEvent(); void scrollToBottomEvent(); @@ -387,11 +387,11 @@ protected: Direction _direction; - Vector2 _touchBeganPoint; - Vector2 _touchMovedPoint; - Vector2 _touchEndedPoint; - Vector2 _touchMovingPoint; - Vector2 _autoScrollDir; + Vec2 _touchBeganPoint; + Vec2 _touchMovedPoint; + Vec2 _touchEndedPoint; + Vec2 _touchMovingPoint; + Vec2 _autoScrollDir; float _topBoundary; float _bottomBoundary; @@ -411,11 +411,11 @@ protected: float _autoScrollAcceleration; bool _isAutoScrollSpeedAttenuated; bool _needCheckAutoScrollDestination; - Vector2 _autoScrollDestination; + Vec2 _autoScrollDestination; bool _bePressed; float _slidTime; - Vector2 _moveChildPoint; + Vec2 _moveChildPoint; float _childFocusCancelOffset; bool _leftBounceNeeded; @@ -425,7 +425,7 @@ protected: bool _bounceEnabled; bool _bouncing; - Vector2 _bounceDir; + Vec2 _bounceDir; float _bounceOriginalSpeed; bool _inertiaScrollEnabled; diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index cc7c26d6ee..09fd5d23e7 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -99,7 +99,7 @@ void Slider::initRenderer() { _barRenderer = Sprite::create(); _progressBarRenderer = Sprite::create(); - _progressBarRenderer->setAnchorPoint(Vector2(0.0f, 0.5f)); + _progressBarRenderer->setAnchorPoint(Vec2(0.0f, 0.5f)); addProtectedChild(_barRenderer, BASEBAR_RENDERER_Z, -1); addProtectedChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1); _slidBallNormalRenderer = Sprite::create(); @@ -187,7 +187,7 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType break; } updateRGBAToRenderer(_progressBarRenderer); - _progressBarRenderer->setAnchorPoint(Vector2(0.0f, 0.5f)); + _progressBarRenderer->setAnchorPoint(Vec2(0.0f, 0.5f)); _progressBarTextureSize = _progressBarRenderer->getContentSize(); _progressBarRendererDirty = true; } @@ -368,7 +368,7 @@ void Slider::setPercent(int percent) _percent = percent; float res = percent / 100.0f; float dis = _barLength * res; - _slidBallRenderer->setPosition(Vector2(dis, _contentSize.height / 2.0f)); + _slidBallRenderer->setPosition(Vec2(dis, _contentSize.height / 2.0f)); if (_scale9Enabled) { static_cast(_progressBarRenderer)->setPreferredSize(Size(dis,_progressBarTextureSize.height)); @@ -382,9 +382,9 @@ void Slider::setPercent(int percent) } } -bool Slider::hitTest(const cocos2d::Vector2 &pt) +bool Slider::hitTest(const cocos2d::Vec2 &pt) { - Vector2 nsp = this->_slidBallNormalRenderer->convertToNodeSpace(pt); + Vec2 nsp = this->_slidBallNormalRenderer->convertToNodeSpace(pt); Size ballSize = this->_slidBallNormalRenderer->getContentSize(); Rect ballRect = Rect(0,0, ballSize.width, ballSize.height); if (ballRect.containsPoint(nsp)) { @@ -398,7 +398,7 @@ bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) bool pass = Widget::onTouchBegan(touch, unusedEvent); if (_hitted) { - Vector2 nsp = convertToNodeSpace(_touchStartPos); + Vec2 nsp = convertToNodeSpace(_touchStartPos); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); } @@ -408,7 +408,7 @@ bool Slider::onTouchBegan(Touch *touch, Event *unusedEvent) void Slider::onTouchMoved(Touch *touch, Event *unusedEvent) { _touchMovePos = touch->getLocation(); - Vector2 nsp = convertToNodeSpace(_touchMovePos); + Vec2 nsp = convertToNodeSpace(_touchMovePos); setPercent(getPercentWithBallPos(nsp.x)); percentChangedEvent(); } diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index 3472266a8f..fc2e9af290 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -199,7 +199,7 @@ public: virtual void ignoreContentAdaptWithSize(bool ignore) override; //override the widget's hitTest function to perfom its own - virtual bool hitTest(const Vector2 &pt) override; + virtual bool hitTest(const Vec2 &pt) override; /** * Returns the "class name" of widget. */ diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index e77e7f6420..e75b6cc881 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -437,11 +437,11 @@ void TextField::setTouchAreaEnabled(bool enable) _useTouchArea = enable; } -bool TextField::hitTest(const Vector2 &pt) +bool TextField::hitTest(const Vec2 &pt) { if (_useTouchArea) { - Vector2 nsp = convertToNodeSpace(pt); + Vec2 nsp = convertToNodeSpace(pt); Rect bb = Rect(-_touchWidth * _anchorPoint.x, -_touchHeight * _anchorPoint.y, _touchWidth, _touchHeight); if (nsp.x >= bb.origin.x && nsp.x <= bb.origin.x + bb.size.width && nsp.y >= bb.origin.y && nsp.y <= bb.origin.y + bb.size.height) { diff --git a/cocos/ui/UITextField.h b/cocos/ui/UITextField.h index 1279304531..95cc9ca650 100644 --- a/cocos/ui/UITextField.h +++ b/cocos/ui/UITextField.h @@ -125,7 +125,7 @@ public: void setTouchSize(const Size &size); Size getTouchSize(); void setTouchAreaEnabled(bool enable); - virtual bool hitTest(const Vector2 &pt); + virtual bool hitTest(const Vec2 &pt); void setText(const std::string& text); void setPlaceHolder(const std::string& value); const std::string& getPlaceHolder(); diff --git a/cocos/ui/UIVideoPlayer.h b/cocos/ui/UIVideoPlayer.h index 24558c6b60..5f30281b47 100644 --- a/cocos/ui/UIVideoPlayer.h +++ b/cocos/ui/UIVideoPlayer.h @@ -74,7 +74,7 @@ namespace experimental{ virtual void addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback); virtual void onPlayEvent(VideoPlayer::EventType event); - virtual void draw(Renderer *renderer, const Matrix& transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4& transform, bool transformUpdated) override; protected: VideoPlayer(); diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index ed54eb2ecc..dfc1c3021a 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -312,7 +312,7 @@ void VideoPlayer::setURL(const std::string& videoUrl) [((UIVideoViewWrapperIos*)_videoView) setURL:(int)_videoSource :_videoURL]; } -void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) +void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, bool transformUpdated) { cocos2d::ui::Widget::draw(renderer,transform,transformUpdated); @@ -325,8 +325,8 @@ void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transfo auto winSize = directorInstance->getWinSize(); - auto leftBottom = convertToWorldSpace(Vector2::ZERO); - auto rightTop = convertToWorldSpace(Vector2(_contentSize.width,_contentSize.height)); + auto leftBottom = convertToWorldSpace(Vec2::ZERO); + auto rightTop = convertToWorldSpace(Vec2(_contentSize.width,_contentSize.height)); auto uiLeft = (frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX()) / scaleFactor; auto uiTop = (frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY()) / scaleFactor; diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index 2c74761008..c2164c6ab8 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -40,9 +40,9 @@ _touchEnabled(false), _touchPassedEnabled(false), _highlight(false), _brightStyle(BrightStyle::NONE), -_touchStartPos(Vector2::ZERO), -_touchMovePos(Vector2::ZERO), -_touchEndPos(Vector2::ZERO), +_touchStartPos(Vec2::ZERO), +_touchMovePos(Vec2::ZERO), +_touchEndPos(Vec2::ZERO), _touchEventListener(nullptr), _touchEventSelector(nullptr), _name("default"), @@ -52,9 +52,9 @@ _customSize(Size::ZERO), _ignoreSize(false), _affectByClipping(false), _sizeType(SizeType::ABSOLUTE), -_sizePercent(Vector2::ZERO), +_sizePercent(Vec2::ZERO), _positionType(PositionType::ABSOLUTE), -_positionPercent(Vector2::ZERO), +_positionPercent(Vec2::ZERO), _reorderWidgetChildDirty(true), _hitted(false), _touchListener(nullptr), @@ -67,7 +67,7 @@ _focusEnabled(true) { onFocusChanged = CC_CALLBACK_2(Widget::onFocusChange,this); onNextFocusedWidget = nullptr; - this->setAnchorPoint(Vector2(0.5f, 0.5f)); + this->setAnchorPoint(Vec2(0.5f, 0.5f)); } Widget::~Widget() @@ -102,7 +102,7 @@ bool Widget::init() initRenderer(); setBright(true); ignoreContentAdaptWithSize(true); - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); return true; } return false; @@ -120,7 +120,7 @@ void Widget::onExit() ProtectedNode::onExit(); } -void Widget::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Widget::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if (_enabled) { @@ -218,12 +218,12 @@ void Widget::setSize(const Size &size) { spy = _customSize.height / pSize.height; } - _sizePercent = Vector2(spx, spy); + _sizePercent = Vec2(spx, spy); } onSizeChanged(); } -void Widget::setSizePercent(const Vector2 &percent) +void Widget::setSizePercent(const Vec2 &percent) { _sizePercent = percent; Size cSize = _customSize; @@ -290,7 +290,7 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize) { spy = _customSize.height / parentSize.height; } - _sizePercent = Vector2(spx, spy); + _sizePercent = Vec2(spx, spy); break; } case SizeType::PERCENT: @@ -311,24 +311,24 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize) break; } onSizeChanged(); - Vector2 absPos = getPosition(); + Vec2 absPos = getPosition(); switch (_positionType) { case PositionType::ABSOLUTE: { if (parentSize.width <= 0.0f || parentSize.height <= 0.0f) { - _positionPercent = Vector2::ZERO; + _positionPercent = Vec2::ZERO; } else { - _positionPercent = Vector2(absPos.x / parentSize.width, absPos.y / parentSize.height); + _positionPercent = Vec2(absPos.x / parentSize.width, absPos.y / parentSize.height); } break; } case PositionType::PERCENT: { - absPos = Vector2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y); + absPos = Vec2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y); break; } default: @@ -381,14 +381,14 @@ const Size& Widget::getCustomSize() const return _customSize; } -const Vector2& Widget::getSizePercent() const +const Vec2& Widget::getSizePercent() const { return _sizePercent; } -Vector2 Widget::getWorldPosition() +Vec2 Widget::getWorldPosition() { - return convertToWorldSpace(Vector2(_anchorPoint.x * _contentSize.width, _anchorPoint.y * _contentSize.height)); + return convertToWorldSpace(Vec2(_anchorPoint.x * _contentSize.width, _anchorPoint.y * _contentSize.height)); } Node* Widget::getVirtualRenderer() @@ -661,9 +661,9 @@ void Widget::addTouchEventListener(Widget::ccWidgetTouchCallback callback) this->_touchEventCallback = callback; } -bool Widget::hitTest(const Vector2 &pt) +bool Widget::hitTest(const Vec2 &pt) { - Vector2 nsp = convertToNodeSpace(pt); + Vec2 nsp = convertToNodeSpace(pt); Rect bb; bb.size = _contentSize; if (bb.containsPoint(nsp)) @@ -673,7 +673,7 @@ bool Widget::hitTest(const Vector2 &pt) return false; } -bool Widget::clippingParentAreaContainPoint(const Vector2 &pt) +bool Widget::clippingParentAreaContainPoint(const Vec2 &pt) { _affectByClipping = false; Widget* parent = getWidgetParent(); @@ -715,7 +715,7 @@ bool Widget::clippingParentAreaContainPoint(const Vector2 &pt) return true; } -void Widget::checkChildInfo(int handleState, Widget *sender, const Vector2 &touchPoint) +void Widget::checkChildInfo(int handleState, Widget *sender, const Vec2 &touchPoint) { Widget* widgetParent = getWidgetParent(); if (widgetParent) @@ -724,7 +724,7 @@ void Widget::checkChildInfo(int handleState, Widget *sender, const Vector2 &touc } } -void Widget::setPosition(const Vector2 &pos) +void Widget::setPosition(const Vec2 &pos) { if (_running) { @@ -734,18 +734,18 @@ void Widget::setPosition(const Vector2 &pos) Size pSize = widgetParent->getSize(); if (pSize.width <= 0.0f || pSize.height <= 0.0f) { - _positionPercent = Vector2::ZERO; + _positionPercent = Vec2::ZERO; } else { - _positionPercent = Vector2(pos.x / pSize.width, pos.y / pSize.height); + _positionPercent = Vec2(pos.x / pSize.width, pos.y / pSize.height); } } } ProtectedNode::setPosition(pos); } -void Widget::setPositionPercent(const Vector2 &percent) +void Widget::setPositionPercent(const Vec2 &percent) { _positionPercent = percent; if (_running) @@ -754,13 +754,13 @@ void Widget::setPositionPercent(const Vector2 &percent) if (widgetParent) { Size parentSize = widgetParent->getSize(); - Vector2 absPos = Vector2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y); + Vec2 absPos = Vec2(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y); setPosition(absPos); } } } -const Vector2& Widget::getPositionPercent() +const Vec2& Widget::getPositionPercent() { return _positionPercent; } @@ -805,17 +805,17 @@ float Widget::getTopInParent() return getBottomInParent() + _size.height; } -const Vector2& Widget::getTouchStartPos() +const Vec2& Widget::getTouchStartPos() { return _touchStartPos; } -const Vector2& Widget::getTouchMovePos() +const Vec2& Widget::getTouchMovePos() { return _touchMovePos; } -const Vector2& Widget::getTouchEndPos() +const Vec2& Widget::getTouchEndPos() { return _touchEndPos; } diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 517adda8af..b95d4a7d7b 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -231,7 +231,7 @@ public: */ virtual Widget* getChildByName(const std::string& name); - virtual void visit(cocos2d::Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; /** * Sets the touch event target/selector of the menu item @@ -244,31 +244,31 @@ public: /** * Changes the position (x,y) of the widget in OpenGL coordinates * - * Usually we use p(x,y) to compose Vector2 object. + * Usually we use p(x,y) to compose Vec2 object. * The original point (0,0) is at the left-bottom corner of screen. * * @param position The position (x,y) of the widget in OpenGL coordinates */ - virtual void setPosition(const Vector2 &pos) override; + virtual void setPosition(const Vec2 &pos) override; /** * Changes the position (x,y) of the widget in OpenGL coordinates * - * Usually we use p(x,y) to compose Vector2 object. + * Usually we use p(x,y) to compose Vec2 object. * The original point (0,0) is at the left-bottom corner of screen. * * @param percent The percent (x,y) of the widget in OpenGL coordinates */ - void setPositionPercent(const Vector2 &percent); + void setPositionPercent(const Vec2 &percent); /** * Gets the percent (x,y) of the widget in OpenGL coordinates * - * @see setPosition(const Vector2&) + * @see setPosition(const Vec2&) * * @return The percent (x,y) of the widget in OpenGL coordinates */ - const Vector2& getPositionPercent(); + const Vec2& getPositionPercent(); /** * Changes the position type of the widget @@ -350,33 +350,33 @@ public: * * @return true if the point is in parent's area, flase otherwise. */ - bool clippingParentAreaContainPoint(const Vector2 &pt); + bool clippingParentAreaContainPoint(const Vec2 &pt); /* * Sends the touch event to widget's parent */ - virtual void checkChildInfo(int handleState,Widget* sender,const Vector2 &touchPoint); + virtual void checkChildInfo(int handleState,Widget* sender,const Vec2 &touchPoint); /* * Gets the touch began point of widget when widget is selected. * * @return the touch began point. */ - const Vector2& getTouchStartPos(); + const Vec2& getTouchStartPos(); /* * Gets the touch move point of widget when widget is selected. * * @return the touch move point. */ - const Vector2& getTouchMovePos(); + const Vec2& getTouchMovePos(); /* * Gets the touch end point of widget when widget is selected. * * @return the touch end point. */ - const Vector2& getTouchEndPos(); + const Vec2& getTouchEndPos(); /** * Changes the name that is used to identify the widget easily. @@ -406,7 +406,7 @@ public: * * @param percent that is widget's percent size */ - virtual void setSizePercent(const Vector2 &percent); + virtual void setSizePercent(const Vec2 &percent); /** * Changes the size type of widget. @@ -442,7 +442,7 @@ public: * * @return size percent */ - const Vector2& getSizePercent() const; + const Vec2& getSizePercent() const; /** * Checks a point if is in widget's space @@ -451,7 +451,7 @@ public: * * @return true if the point is in widget's space, flase otherwise. */ - virtual bool hitTest(const Vector2 &pt); + virtual bool hitTest(const Vec2 &pt); virtual bool onTouchBegan(Touch *touch, Event *unusedEvent); virtual void onTouchMoved(Touch *touch, Event *unusedEvent); @@ -499,7 +499,7 @@ public: * * @return world position of widget. */ - Vector2 getWorldPosition(); + Vec2 getWorldPosition(); /** * Gets the Virtual Renderer of widget. @@ -636,9 +636,9 @@ protected: bool _touchPassedEnabled; ///< is the touch event should be passed bool _highlight; ///< is the widget on focus BrightStyle _brightStyle; ///< bright style - Vector2 _touchStartPos; ///< touch began point - Vector2 _touchMovePos; ///< touch moved point - Vector2 _touchEndPos; ///< touch ended point + Vec2 _touchStartPos; ///< touch began point + Vec2 _touchMovePos; ///< touch moved point + Vec2 _touchEndPos; ///< touch ended point //if use the old API, we must retain the _touchEventListener Ref* _touchEventListener; @@ -665,9 +665,9 @@ protected: bool _ignoreSize; bool _affectByClipping; SizeType _sizeType; - Vector2 _sizePercent; + Vec2 _sizePercent; PositionType _positionType; - Vector2 _positionPercent; + Vec2 _positionPercent; bool _reorderWidgetChildDirty; bool _hitted; EventListenerTouchOneByOne* _touchListener; diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index e40c11b694..128443fa5f 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -240,9 +240,9 @@ bool Control::isOpacityModifyRGB() const } -Vector2 Control::getTouchLocation(Touch* touch) +Vec2 Control::getTouchLocation(Touch* touch) { - Vector2 touchLocation = touch->getLocation(); // Get the touch position + Vec2 touchLocation = touch->getLocation(); // Get the touch position touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class return touchLocation; @@ -250,7 +250,7 @@ Vector2 Control::getTouchLocation(Touch* touch) bool Control::isTouchInside(Touch* touch) { - Vector2 touchLocation = touch->getLocation(); // Get the touch position + Vec2 touchLocation = touch->getLocation(); // Get the touch position touchLocation = this->getParent()->convertToNodeSpace(touchLocation); Rect bBox = getBoundingBox(); return bBox.containsPoint(touchLocation); diff --git a/extensions/GUI/CCControlExtension/CCControl.h b/extensions/GUI/CCControlExtension/CCControl.h index e81a94e7e9..cf6efa865d 100644 --- a/extensions/GUI/CCControlExtension/CCControl.h +++ b/extensions/GUI/CCControlExtension/CCControl.h @@ -152,7 +152,7 @@ public: * control space coordinates. * @param touch A Touch object that represents a touch. */ - virtual Vector2 getTouchLocation(Touch* touch); + virtual Vec2 getTouchLocation(Touch* touch); virtual bool onTouchBegan(Touch *touch, Event *event) { return false; }; virtual void onTouchMoved(Touch *touch, Event *event) {}; diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index c3754aaa18..69617309c0 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -89,7 +89,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b // Set the default anchor point ignoreAnchorPointForPosition(false); - setAnchorPoint(Vector2::ANCHOR_MIDDLE); + setAnchorPoint(Vec2::ANCHOR_MIDDLE); // Set the nodes setTitleLabel(node); @@ -107,7 +107,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b setTitleLabelForState(node, Control::State::NORMAL); setBackgroundSpriteForState(backgroundSprite, Control::State::NORMAL); - setLabelAnchorPoint(Vector2::ANCHOR_MIDDLE); + setLabelAnchorPoint(Vec2::ANCHOR_MIDDLE); // Layout update needsLayout(); @@ -250,12 +250,12 @@ bool ControlButton::doesAdjustBackgroundImage() return _doesAdjustBackgroundImage; } -const Vector2& ControlButton::getLabelAnchorPoint() const +const Vec2& ControlButton::getLabelAnchorPoint() const { return this->_labelAnchorPoint; } -void ControlButton::setLabelAnchorPoint(const Vector2& labelAnchorPoint) +void ControlButton::setLabelAnchorPoint(const Vec2& labelAnchorPoint) { this->_labelAnchorPoint = labelAnchorPoint; if (_titleLabel != nullptr) @@ -348,7 +348,7 @@ void ControlButton::setTitleLabelForState(Node* titleLabel, State state) _titleLabelDispatchTable.insert((int)state, titleLabel); titleLabel->setVisible(false); - titleLabel->setAnchorPoint(Vector2(0.5f, 0.5f)); + titleLabel->setAnchorPoint(Vec2(0.5f, 0.5f)); addChild(titleLabel, 1); // If the current state if equal to the given state we update the layout @@ -447,7 +447,7 @@ void ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State stat _backgroundSpriteDispatchTable.insert((int)state, sprite); sprite->setVisible(false); - sprite->setAnchorPoint(Vector2(0.5f, 0.5f)); + sprite->setAnchorPoint(Vec2(0.5f, 0.5f)); addChild(sprite); if (this->_preferredSize.width != 0 || this->_preferredSize.height != 0) @@ -509,14 +509,14 @@ void ControlButton::needsLayout() } if (_titleLabel != nullptr) { - _titleLabel->setPosition(Vector2 (getContentSize().width / 2, getContentSize().height / 2)); + _titleLabel->setPosition(Vec2 (getContentSize().width / 2, getContentSize().height / 2)); } // Update the background sprite this->setBackgroundSprite(this->getBackgroundSpriteForState(_state)); if (_backgroundSprite != nullptr) { - _backgroundSprite->setPosition(Vector2 (getContentSize().width / 2, getContentSize().height / 2)); + _backgroundSprite->setPosition(Vec2 (getContentSize().width / 2, getContentSize().height / 2)); } // Get the title label size @@ -571,14 +571,14 @@ void ControlButton::needsLayout() if (_titleLabel != nullptr) { - _titleLabel->setPosition(Vector2(getContentSize().width/2, getContentSize().height/2)); + _titleLabel->setPosition(Vec2(getContentSize().width/2, getContentSize().height/2)); // Make visible the background and the label _titleLabel->setVisible(true); } if (_backgroundSprite != nullptr) { - _backgroundSprite->setPosition(Vector2(getContentSize().width/2, getContentSize().height/2)); + _backgroundSprite->setPosition(Vec2(getContentSize().width/2, getContentSize().height/2)); _backgroundSprite->setVisible(true); } } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 4db682ed51..f471cc039c 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -231,7 +231,7 @@ protected: /** Scale ratio button on touchdown. Default value 1.1f */ CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio); - CC_PROPERTY_PASS_BY_REF(Vector2, _labelAnchorPoint, LabelAnchorPoint); + CC_PROPERTY_PASS_BY_REF(Vec2, _labelAnchorPoint, LabelAnchorPoint); std::unordered_map _titleDispatchTable; std::unordered_map _titleColorDispatchTable; diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index e4d0076717..36a2c6ec31 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -76,19 +76,19 @@ bool ControlColourPicker::init() _hsv.v = 0; // Add image - _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("menuColourPanelBackground.png", spriteSheet, Vector2::ZERO, Vector2(0.5f, 0.5f)); + _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("menuColourPanelBackground.png", spriteSheet, Vec2::ZERO, Vec2(0.5f, 0.5f)); CC_SAFE_RETAIN(_background); - Vector2 backgroundPointZero = _background->getPosition() - Vector2(_background->getContentSize().width / 2, _background->getContentSize().height / 2); + Vec2 backgroundPointZero = _background->getPosition() - Vec2(_background->getContentSize().width / 2, _background->getContentSize().height / 2); // Setup panels float hueShift = 8; float colourShift = 28; _huePicker = new ControlHuePicker(); - _huePicker->initWithTargetAndPos(spriteSheet, Vector2(backgroundPointZero.x + hueShift, backgroundPointZero.y + hueShift)); + _huePicker->initWithTargetAndPos(spriteSheet, Vec2(backgroundPointZero.x + hueShift, backgroundPointZero.y + hueShift)); _colourPicker = new ControlSaturationBrightnessPicker(); - _colourPicker->initWithTargetAndPos(spriteSheet, Vector2(backgroundPointZero.x + colourShift, backgroundPointZero.y + colourShift)); + _colourPicker->initWithTargetAndPos(spriteSheet, Vec2(backgroundPointZero.x + colourShift, backgroundPointZero.y + colourShift)); // Setup events _huePicker->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlColourPicker::hueSliderValueChanged), Control::EventType::VALUE_CHANGED); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index 289a755dae..9850aacff8 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp @@ -49,7 +49,7 @@ ControlHuePicker::~ControlHuePicker() CC_SAFE_RELEASE(_slider); } -ControlHuePicker* ControlHuePicker::create(Node* target, Vector2 pos) +ControlHuePicker* ControlHuePicker::create(Node* target, Vec2 pos) { ControlHuePicker *pRet = new ControlHuePicker(); pRet->initWithTargetAndPos(target, pos); @@ -58,15 +58,15 @@ ControlHuePicker* ControlHuePicker::create(Node* target, Vector2 pos) } -bool ControlHuePicker::initWithTargetAndPos(Node* target, Vector2 pos) +bool ControlHuePicker::initWithTargetAndPos(Node* target, Vec2 pos) { if (Control::init()) { // Add background and slider sprites - this->setBackground(ControlUtils::addSpriteToTargetWithPosAndAnchor("huePickerBackground.png", target, pos, Vector2(0.0f, 0.0f))); - this->setSlider(ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vector2(0.5f, 0.5f))); + this->setBackground(ControlUtils::addSpriteToTargetWithPosAndAnchor("huePickerBackground.png", target, pos, Vec2(0.0f, 0.0f))); + this->setSlider(ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vec2(0.5f, 0.5f))); - _slider->setPosition(Vector2(pos.x, pos.y + _background->getBoundingBox().size.height * 0.5f)); + _slider->setPosition(Vec2(pos.x, pos.y + _background->getBoundingBox().size.height * 0.5f)); _startPos=pos; // Sets the default value @@ -111,7 +111,7 @@ void ControlHuePicker::setHuePercentage(float hueValueInPercent) // Set new position of the slider float x = centerX + limit * cosf(angle); float y = centerY + limit * sinf(angle); - _slider->setPosition(Vector2(x, y)); + _slider->setPosition(Vec2(x, y)); } @@ -124,7 +124,7 @@ void ControlHuePicker::setEnabled(bool enabled) } } -void ControlHuePicker::updateSliderPosition(Vector2 location) +void ControlHuePicker::updateSliderPosition(Vec2 location) { // Clamp the position of the icon within the circle @@ -149,7 +149,7 @@ void ControlHuePicker::updateSliderPosition(Vector2 location) sendActionsForControlEvents(Control::EventType::VALUE_CHANGED); } -bool ControlHuePicker::checkSliderPosition(Vector2 location) +bool ControlHuePicker::checkSliderPosition(Vec2 location) { // compute the distance between the current location and the center double distance = sqrt(pow (location.x + 10, 2) + pow(location.y, 2)); @@ -171,7 +171,7 @@ bool ControlHuePicker::onTouchBegan(Touch* touch, Event* event) } // Get the touch location - Vector2 touchLocation=getTouchLocation(touch); + Vec2 touchLocation=getTouchLocation(touch); // Check the touch position on the slider return checkSliderPosition(touchLocation); @@ -181,7 +181,7 @@ bool ControlHuePicker::onTouchBegan(Touch* touch, Event* event) void ControlHuePicker::onTouchMoved(Touch* touch, Event* event) { // Get the touch location - Vector2 touchLocation=getTouchLocation(touch); + Vec2 touchLocation=getTouchLocation(touch); //small modification: this allows changing of the colour, even if the touch leaves the bounding area // updateSliderPosition(touchLocation); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/extensions/GUI/CCControlExtension/CCControlHuePicker.h index c60fe3db51..896e452618 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -48,7 +48,7 @@ NS_CC_EXT_BEGIN class ControlHuePicker : public Control { public: - static ControlHuePicker* create(Node* target, Vector2 pos); + static ControlHuePicker* create(Node* target, Vec2 pos); /** * @js ctor */ @@ -58,7 +58,7 @@ public: * @lua NA */ virtual ~ControlHuePicker(); - virtual bool initWithTargetAndPos(Node* target, Vector2 pos); + virtual bool initWithTargetAndPos(Node* target, Vec2 pos); virtual void setEnabled(bool enabled); @@ -67,8 +67,8 @@ public: virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override; protected: - void updateSliderPosition(Vector2 location); - bool checkSliderPosition(Vector2 location); + void updateSliderPosition(Vec2 location); + bool checkSliderPosition(Vec2 location); //maunally put in the setters CC_SYNTHESIZE_READONLY(float, _hue, Hue); @@ -79,7 +79,7 @@ protected: //not sure if these need to be there actually. I suppose someone might want to access the sprite? CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background); CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vector2, _startPos, StartPos); + CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index 083f979d95..13698bcbdf 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -167,7 +167,7 @@ float ControlPotentiometer::getMaximumValue() bool ControlPotentiometer::isTouchInside(Touch * touch) { - Vector2 touchLocation = this->getTouchLocation(touch); + Vec2 touchLocation = this->getTouchLocation(touch); float distance = this->distanceBetweenPointAndPoint(_progressTimer->getPosition(), touchLocation); @@ -190,17 +190,17 @@ bool ControlPotentiometer::onTouchBegan(Touch *pTouch, Event *pEvent) void ControlPotentiometer::onTouchMoved(Touch *pTouch, Event *pEvent) { - Vector2 location = this->getTouchLocation(pTouch); + Vec2 location = this->getTouchLocation(pTouch); this->potentiometerMoved(location); } void ControlPotentiometer::onTouchEnded(Touch *pTouch, Event *pEvent) { - this->potentiometerEnded(Vector2::ZERO); + this->potentiometerEnded(Vec2::ZERO); } -float ControlPotentiometer::distanceBetweenPointAndPoint(Vector2 point1, Vector2 point2) +float ControlPotentiometer::distanceBetweenPointAndPoint(Vec2 point1, Vec2 point2) { float dx = point1.x - point2.x; float dy = point1.y - point2.y; @@ -208,10 +208,10 @@ float ControlPotentiometer::distanceBetweenPointAndPoint(Vector2 point1, Vector2 } float ControlPotentiometer::angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( - Vector2 beginLineA, - Vector2 endLineA, - Vector2 beginLineB, - Vector2 endLineB) + Vec2 beginLineA, + Vec2 endLineA, + Vec2 beginLineB, + Vec2 endLineB) { float a = endLineA.x - beginLineA.x; float b = endLineA.y - beginLineA.y; @@ -225,13 +225,13 @@ float ControlPotentiometer::angleInDegreesBetweenLineFromPoint_toPoint_toLineFro return (atanA - atanB) * 180 / M_PI; } -void ControlPotentiometer::potentiometerBegan(Vector2 location) +void ControlPotentiometer::potentiometerBegan(Vec2 location) { setSelected(true); getThumbSprite()->setColor(Color3B::GRAY); } -void ControlPotentiometer::potentiometerMoved(Vector2 location) +void ControlPotentiometer::potentiometerMoved(Vec2 location) { float angle = this->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( _progressTimer->getPosition(), @@ -254,7 +254,7 @@ void ControlPotentiometer::potentiometerMoved(Vector2 location) _previousLocation = location; } -void ControlPotentiometer::potentiometerEnded(Vector2 location) +void ControlPotentiometer::potentiometerEnded(Vec2 location) { getThumbSprite()->setColor(Color3B::WHITE); setSelected(false); diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h index bf238ac2c0..fc8156a8b8 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.h +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.h @@ -82,18 +82,18 @@ public: virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override; /** Factorize the event dispath into these methods. */ - void potentiometerBegan(Vector2 location); - void potentiometerMoved(Vector2 location); - void potentiometerEnded(Vector2 location); + void potentiometerBegan(Vec2 location); + void potentiometerMoved(Vec2 location); + void potentiometerEnded(Vec2 location); /** Returns the distance between the point1 and point2. */ - float distanceBetweenPointAndPoint(Vector2 point1, Vector2 point2); + float distanceBetweenPointAndPoint(Vec2 point1, Vec2 point2); /** Returns the angle in degree between line1 and line2. */ float angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint( - Vector2 beginLineA, - Vector2 endLineA, - Vector2 beginLineB, - Vector2 endLineB); + Vec2 beginLineA, + Vec2 endLineA, + Vec2 beginLineB, + Vec2 endLineB); protected: /** Contains the receiver’s current value. */ @@ -107,7 +107,7 @@ protected: CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite) CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer) - CC_SYNTHESIZE(Vector2, _previousLocation, PreviousLocation) + CC_SYNTHESIZE(Vec2, _previousLocation, PreviousLocation) }; // end of GUI group diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp index 8b452a39ff..d23eba4ab2 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp @@ -56,15 +56,15 @@ ControlSaturationBrightnessPicker::~ControlSaturationBrightnessPicker() _slider = NULL; } -bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Vector2 pos) +bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Vec2 pos) { if (Control::init()) { // Add background and slider sprites - _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerBackground.png", target, pos, Vector2(0.0f, 0.0f)); - _overlay=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerOverlay.png", target, pos, Vector2(0.0f, 0.0f)); - _shadow=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerShadow.png", target, pos, Vector2(0.0f, 0.0f)); - _slider=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vector2(0.5f, 0.5f)); + _background=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerBackground.png", target, pos, Vec2(0.0f, 0.0f)); + _overlay=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerOverlay.png", target, pos, Vec2(0.0f, 0.0f)); + _shadow=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPickerShadow.png", target, pos, Vec2(0.0f, 0.0f)); + _slider=ControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", target, pos, Vec2(0.5f, 0.5f)); _startPos=pos; // starting position of the colour picker boxPos = 35; // starting position of the virtual box area for picking a colour @@ -77,7 +77,7 @@ bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Vecto } } -ControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Node* target, Vector2 pos) +ControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Node* target, Vec2 pos) { ControlSaturationBrightnessPicker *pRet = new ControlSaturationBrightnessPicker(); pRet->initWithTargetAndPos(target, pos); @@ -108,14 +108,14 @@ void ControlSaturationBrightnessPicker::updateWithHSV(HSV hsv) void ControlSaturationBrightnessPicker::updateDraggerWithHSV(HSV hsv) { // Set the position of the slider to the correct saturation and brightness - Vector2 pos = Vector2(_startPos.x + boxPos + (boxSize*(1 - hsv.s)), + Vec2 pos = Vec2(_startPos.x + boxPos + (boxSize*(1 - hsv.s)), _startPos.y + boxPos + (boxSize*hsv.v)); // update updateSliderPosition(pos); } -void ControlSaturationBrightnessPicker::updateSliderPosition(Vector2 sliderPosition) +void ControlSaturationBrightnessPicker::updateSliderPosition(Vec2 sliderPosition) { // Clamp the position of the icon within the circle @@ -156,7 +156,7 @@ void ControlSaturationBrightnessPicker::updateSliderPosition(Vector2 sliderPosit _brightness = fabs((_startPos.y + (float)boxPos - sliderPosition.y)/(float)boxSize); } -bool ControlSaturationBrightnessPicker::checkSliderPosition(Vector2 location) +bool ControlSaturationBrightnessPicker::checkSliderPosition(Vec2 location) { // Clamp the position of the icon within the circle @@ -188,7 +188,7 @@ bool ControlSaturationBrightnessPicker::onTouchBegan(Touch* touch, Event* event) } // Get the touch location - Vector2 touchLocation=getTouchLocation(touch); + Vec2 touchLocation=getTouchLocation(touch); // Check the touch position on the slider return checkSliderPosition(touchLocation); @@ -198,7 +198,7 @@ bool ControlSaturationBrightnessPicker::onTouchBegan(Touch* touch, Event* event) void ControlSaturationBrightnessPicker::onTouchMoved(Touch* touch, Event* event) { // Get the touch location - Vector2 touchLocation=getTouchLocation(touch); + Vec2 touchLocation=getTouchLocation(touch); //small modification: this allows changing of the colour, even if the touch leaves the bounding area // updateSliderPosition(touchLocation); diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index d22276f792..0ae9cbeaa1 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -57,7 +57,7 @@ class ControlSaturationBrightnessPicker : public Control CC_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay); CC_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow); CC_SYNTHESIZE_READONLY(Sprite*, _slider, Slider); - CC_SYNTHESIZE_READONLY(Vector2, _startPos, StartPos); + CC_SYNTHESIZE_READONLY(Vec2, _startPos, StartPos); protected: int boxPos; @@ -73,9 +73,9 @@ public: * @lua NA */ virtual ~ControlSaturationBrightnessPicker(); - virtual bool initWithTargetAndPos(Node* target, Vector2 pos); + virtual bool initWithTargetAndPos(Node* target, Vec2 pos); - static ControlSaturationBrightnessPicker* create(Node* target, Vector2 pos); + static ControlSaturationBrightnessPicker* create(Node* target, Vec2 pos); virtual void setEnabled(bool enabled); /** @@ -90,8 +90,8 @@ public: virtual void updateDraggerWithHSV(HSV hsv); protected: - void updateSliderPosition(Vector2 location); - bool checkSliderPosition(Vector2 location); + void updateSliderPosition(Vec2 location); + bool checkSliderPosition(Vec2 location); virtual bool onTouchBegan(Touch* touch, Event* pEvent); virtual void onTouchMoved(Touch *pTouch, Event *pEvent); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 9bbe28f8e5..42cf2dae6a 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -135,20 +135,20 @@ bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressS setContentSize(Size(maxRect.size.width, maxRect.size.height)); // Add the slider background - _backgroundSprite->setAnchorPoint(Vector2(0.5f, 0.5f)); - _backgroundSprite->setPosition(Vector2(this->getContentSize().width / 2, this->getContentSize().height / 2)); + _backgroundSprite->setAnchorPoint(Vec2(0.5f, 0.5f)); + _backgroundSprite->setPosition(Vec2(this->getContentSize().width / 2, this->getContentSize().height / 2)); addChild(_backgroundSprite); // Add the progress bar - _progressSprite->setAnchorPoint(Vector2(0.0f, 0.5f)); - _progressSprite->setPosition(Vector2(0.0f, this->getContentSize().height / 2)); + _progressSprite->setAnchorPoint(Vec2(0.0f, 0.5f)); + _progressSprite->setPosition(Vec2(0.0f, this->getContentSize().height / 2)); addChild(_progressSprite); // Add the slider thumb - _thumbSprite->setPosition(Vector2(0.0f, this->getContentSize().height / 2)); + _thumbSprite->setPosition(Vec2(0.0f, this->getContentSize().height / 2)); addChild(_thumbSprite); - _selectedThumbSprite->setPosition(Vector2(0.0f, this->getContentSize().height / 2)); + _selectedThumbSprite->setPosition(Vec2(0.0f, this->getContentSize().height / 2)); _selectedThumbSprite->setVisible(false); addChild(_selectedThumbSprite); @@ -219,7 +219,7 @@ void ControlSlider::setEnabled(bool enabled) bool ControlSlider::isTouchInside(Touch * touch) { - Vector2 touchLocation = touch->getLocation(); + Vec2 touchLocation = touch->getLocation(); touchLocation = this->getParent()->convertToNodeSpace(touchLocation); Rect rect = this->getBoundingBox(); @@ -229,9 +229,9 @@ bool ControlSlider::isTouchInside(Touch * touch) return rect.containsPoint(touchLocation); } -Vector2 ControlSlider::locationFromTouch(Touch* touch) +Vec2 ControlSlider::locationFromTouch(Touch* touch) { - Vector2 touchLocation = touch->getLocation(); // Get the touch position + Vec2 touchLocation = touch->getLocation(); // Get the touch position touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class if (touchLocation.x < 0) @@ -253,20 +253,20 @@ bool ControlSlider::onTouchBegan(Touch* touch, Event* pEvent) return false; } - Vector2 location = locationFromTouch(touch); + Vec2 location = locationFromTouch(touch); sliderBegan(location); return true; } void ControlSlider::onTouchMoved(Touch *pTouch, Event *pEvent) { - Vector2 location = locationFromTouch(pTouch); + Vec2 location = locationFromTouch(pTouch); sliderMoved(location); } void ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent) { - sliderEnded(Vector2::ZERO); + sliderEnded(Vec2::ZERO); } void ControlSlider::needsLayout() @@ -279,7 +279,7 @@ void ControlSlider::needsLayout() // Update thumb position for new value float percent = (_value - _minimumValue) / (_maximumValue - _minimumValue); - Vector2 pos = _thumbSprite->getPosition(); + Vec2 pos = _thumbSprite->getPosition(); pos.x = percent * _backgroundSprite->getContentSize().width; _thumbSprite->setPosition(pos); _selectedThumbSprite->setPosition(pos); @@ -290,7 +290,7 @@ void ControlSlider::needsLayout() _progressSprite->setTextureRect(textureRect, _progressSprite->isTextureRectRotated(), textureRect.size); } -void ControlSlider::sliderBegan(Vector2 location) +void ControlSlider::sliderBegan(Vec2 location) { this->setSelected(true); _thumbSprite->setVisible(false); @@ -298,12 +298,12 @@ void ControlSlider::sliderBegan(Vector2 location) setValue(valueForLocation(location)); } -void ControlSlider::sliderMoved(Vector2 location) +void ControlSlider::sliderMoved(Vec2 location) { setValue(valueForLocation(location)); } -void ControlSlider::sliderEnded(Vector2 location) +void ControlSlider::sliderEnded(Vec2 location) { if (this->isSelected()) { @@ -314,7 +314,7 @@ void ControlSlider::sliderEnded(Vector2 location) this->setSelected(false); } -float ControlSlider::valueForLocation(Vector2 location) +float ControlSlider::valueForLocation(Vec2 location) { float percent = location.x/ _backgroundSprite->getContentSize().width; return MAX(MIN(_minimumValue + percent * (_maximumValue - _minimumValue), _maximumAllowedValue), _minimumAllowedValue); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 63800b1eec..eeca322c25 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -111,21 +111,21 @@ public: virtual void setMaximumValue(float val); virtual void setEnabled(bool enabled); virtual bool isTouchInside(Touch * touch); - Vector2 locationFromTouch(Touch* touch); + Vec2 locationFromTouch(Touch* touch); virtual void setValue(float val); virtual void setMinimumValue(float val); protected: - void sliderBegan(Vector2 location); - void sliderMoved(Vector2 location); - void sliderEnded(Vector2 location); + void sliderBegan(Vec2 location); + void sliderMoved(Vec2 location); + void sliderEnded(Vec2 location); virtual bool onTouchBegan(Touch* touch, Event* pEvent); virtual void onTouchMoved(Touch *pTouch, Event *pEvent); virtual void onTouchEnded(Touch *pTouch, Event *pEvent); /** Returns the value for the given location. */ - float valueForLocation(Vector2 location); + float valueForLocation(Vec2 location); //maunally put in the setters /** Contains the receiver's current value. */ diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index 3477a4b5e9..f96d27496d 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -86,25 +86,25 @@ bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprit // Add the minus components this->setMinusSprite(minusSprite); - _minusSprite->setPosition( Vector2(minusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) ); + _minusSprite->setPosition( Vec2(minusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) ); this->addChild(_minusSprite); this->setMinusLabel( Label::createWithSystemFont("-", ControlStepperLabelFont, 40)); _minusLabel->setColor(ControlStepperLabelColorDisabled); - _minusLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE); - _minusLabel->setPosition(Vector2(_minusSprite->getContentSize().width / 2, _minusSprite->getContentSize().height / 2) ); + _minusLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _minusLabel->setPosition(Vec2(_minusSprite->getContentSize().width / 2, _minusSprite->getContentSize().height / 2) ); _minusSprite->addChild(_minusLabel); // Add the plus components this->setPlusSprite( plusSprite ); - _plusSprite->setPosition( Vector2(minusSprite->getContentSize().width + plusSprite->getContentSize().width / 2, + _plusSprite->setPosition( Vec2(minusSprite->getContentSize().width + plusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) ); this->addChild(_plusSprite); this->setPlusLabel( Label::createWithSystemFont("+", ControlStepperLabelFont, 40 )); _plusLabel->setColor( ControlStepperLabelColorEnabled ); - _plusLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE); - _plusLabel->setPosition( Vector2(_plusSprite->getContentSize().width / 2, _plusSprite->getContentSize().height / 2) ); + _plusLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _plusLabel->setPosition( Vec2(_plusSprite->getContentSize().width / 2, _plusSprite->getContentSize().height / 2) ); _plusSprite->addChild(_plusLabel); // Defines the content size @@ -248,7 +248,7 @@ void ControlStepper::update(float dt) //// ControlStepper Private Methods -void ControlStepper::updateLayoutUsingTouchLocation(Vector2 location) +void ControlStepper::updateLayoutUsingTouchLocation(Vec2 location) { if (location.x < _minusSprite->getContentSize().width && _value > _minimumValue) @@ -281,7 +281,7 @@ bool ControlStepper::onTouchBegan(Touch *pTouch, Event *pEvent) return false; } - Vector2 location = this->getTouchLocation(pTouch); + Vec2 location = this->getTouchLocation(pTouch); this->updateLayoutUsingTouchLocation(location); _touchInsideFlag = true; @@ -298,7 +298,7 @@ void ControlStepper::onTouchMoved(Touch *pTouch, Event *pEvent) { if (this->isTouchInside(pTouch)) { - Vector2 location = this->getTouchLocation(pTouch); + Vec2 location = this->getTouchLocation(pTouch); this->updateLayoutUsingTouchLocation(location); if (!_touchInsideFlag) @@ -339,7 +339,7 @@ void ControlStepper::onTouchEnded(Touch *pTouch, Event *pEvent) if (this->isTouchInside(pTouch)) { - Vector2 location = this->getTouchLocation(pTouch); + Vec2 location = this->getTouchLocation(pTouch); this->setValue(_value + ((location.x < _minusSprite->getContentSize().width) ? (0.0-_stepValue) : _stepValue)); } diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.h b/extensions/GUI/CCControlExtension/CCControlStepper.h index 92b4009794..1b45a497f6 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.h +++ b/extensions/GUI/CCControlExtension/CCControlStepper.h @@ -81,7 +81,7 @@ public: void update(float dt); /** Update the layout of the stepper with the given touch location. */ - void updateLayoutUsingTouchLocation(Vector2 location); + void updateLayoutUsingTouchLocation(Vec2 location); /** Start the autorepeat increment/decrement. */ void startAutorepeat(); diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index a11a849541..d8b73a587e 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -218,26 +218,26 @@ void ControlSwitchSprite::updateTweenAction(float value, const std::string& key) void ControlSwitchSprite::needsLayout() { - _onSprite->setPosition(Vector2(_onSprite->getContentSize().width / 2 + _sliderXPosition, + _onSprite->setPosition(Vec2(_onSprite->getContentSize().width / 2 + _sliderXPosition, _onSprite->getContentSize().height / 2)); - _offSprite->setPosition(Vector2(_onSprite->getContentSize().width + _offSprite->getContentSize().width / 2 + _sliderXPosition, + _offSprite->setPosition(Vec2(_onSprite->getContentSize().width + _offSprite->getContentSize().width / 2 + _sliderXPosition, _offSprite->getContentSize().height / 2)); - _thumbSprite->setPosition(Vector2(_onSprite->getContentSize().width + _sliderXPosition, + _thumbSprite->setPosition(Vec2(_onSprite->getContentSize().width + _sliderXPosition, _maskTexture->getContentSize().height / 2)); - _clipperStencil->setPosition(Vector2(_maskTexture->getContentSize().width/2, + _clipperStencil->setPosition(Vec2(_maskTexture->getContentSize().width/2, _maskTexture->getContentSize().height / 2)); if (_onLabel) { - _onLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE); - _onLabel->setPosition(Vector2(_onSprite->getPosition().x - _thumbSprite->getContentSize().width / 6, + _onLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _onLabel->setPosition(Vec2(_onSprite->getPosition().x - _thumbSprite->getContentSize().width / 6, _onSprite->getContentSize().height / 2)); } if (_offLabel) { - _offLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE); - _offLabel->setPosition(Vector2(_offSprite->getPosition().x + _thumbSprite->getContentSize().width / 6, + _offLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _offLabel->setPosition(Vec2(_offSprite->getPosition().x + _thumbSprite->getContentSize().width / 6, _offSprite->getContentSize().height / 2)); } @@ -326,11 +326,11 @@ bool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sp onLabel, offLabel); _switchSprite->retain(); - _switchSprite->setPosition(Vector2(_switchSprite->getContentSize().width / 2, _switchSprite->getContentSize().height / 2)); + _switchSprite->setPosition(Vec2(_switchSprite->getContentSize().width / 2, _switchSprite->getContentSize().height / 2)); addChild(_switchSprite); ignoreAnchorPointForPosition(false); - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); setContentSize(_switchSprite->getContentSize()); return true; } @@ -388,9 +388,9 @@ void ControlSwitch::setEnabled(bool enabled) } } -Vector2 ControlSwitch::locationFromTouch(Touch* pTouch) +Vec2 ControlSwitch::locationFromTouch(Touch* pTouch) { - Vector2 touchLocation = pTouch->getLocation(); // Get the touch position + Vec2 touchLocation = pTouch->getLocation(); // Get the touch position touchLocation = this->convertToNodeSpace(touchLocation); // Convert to the node space of this class return touchLocation; @@ -405,7 +405,7 @@ bool ControlSwitch::onTouchBegan(Touch *pTouch, Event *pEvent) _moved = false; - Vector2 location = this->locationFromTouch(pTouch); + Vec2 location = this->locationFromTouch(pTouch); _initialTouchXPosition = location.x - _switchSprite->getSliderXPosition(); @@ -417,8 +417,8 @@ bool ControlSwitch::onTouchBegan(Touch *pTouch, Event *pEvent) void ControlSwitch::onTouchMoved(Touch *pTouch, Event *pEvent) { - Vector2 location = this->locationFromTouch(pTouch); - location = Vector2(location.x - _initialTouchXPosition, 0); + Vec2 location = this->locationFromTouch(pTouch); + location = Vec2(location.x - _initialTouchXPosition, 0); _moved = true; @@ -427,7 +427,7 @@ void ControlSwitch::onTouchMoved(Touch *pTouch, Event *pEvent) void ControlSwitch::onTouchEnded(Touch *pTouch, Event *pEvent) { - Vector2 location = this->locationFromTouch(pTouch); + Vec2 location = this->locationFromTouch(pTouch); _switchSprite->getThumbSprite()->setColor(Color3B::WHITE); @@ -443,7 +443,7 @@ void ControlSwitch::onTouchEnded(Touch *pTouch, Event *pEvent) void ControlSwitch::onTouchCancelled(Touch *pTouch, Event *pEvent) { - Vector2 location = this->locationFromTouch(pTouch); + Vec2 location = this->locationFromTouch(pTouch); _switchSprite->getThumbSprite()->setColor(Color3B::WHITE); diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index 24d5d1bcef..6575937e13 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -82,7 +82,7 @@ public: bool hasMoved() const { return _moved; } virtual void setEnabled(bool enabled); - Vector2 locationFromTouch(Touch* touch); + Vec2 locationFromTouch(Touch* touch); // Overrides virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override; diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/extensions/GUI/CCControlExtension/CCControlUtils.cpp index f3954f9677..414e43bd86 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ b/extensions/GUI/CCControlExtension/CCControlUtils.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. NS_CC_EXT_BEGIN -Sprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Vector2 pos, Vector2 anchor) +Sprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Vec2 pos, Vec2 anchor) { Sprite *sprite =Sprite::createWithSpriteFrameName(spriteName); @@ -163,7 +163,7 @@ Rect ControlUtils::RectUnion(const Rect& src1, const Rect& src2) float x2 = MAX(src1.getMaxX(), src2.getMaxX()); float y2 = MAX(src1.getMaxY(), src2.getMaxY()); - result.origin=Vector2(x1,y1); + result.origin=Vec2(x1,y1); result.size=Size(x2-x1, y2-y1); return result; } diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 078ed505b7..f927822f10 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -80,7 +80,7 @@ public: * @js NA * @lua NA */ - static Sprite* addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Vector2 pos, Vector2 anchor); + static Sprite* addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Vec2 pos, Vec2 anchor); /** * @js NA * @lua NA diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index 32398db39b..8501d097a8 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -99,7 +99,7 @@ bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rec this->updateWithBatchNode(batchnode, rect, rotated, capInsets); } - this->setAnchorPoint(Vector2(0.5f, 0.5f)); + this->setAnchorPoint(Vec2(0.5f, 0.5f)); this->_positionsAreDirty = true; return true; @@ -428,34 +428,34 @@ void Scale9Sprite::updatePositions() float leftWidth = _bottomLeft->getContentSize().width; float bottomHeight = _bottomLeft->getContentSize().height; - _bottomLeft->setAnchorPoint(Vector2(0,0)); - _bottomRight->setAnchorPoint(Vector2(0,0)); - _topLeft->setAnchorPoint(Vector2(0,0)); - _topRight->setAnchorPoint(Vector2(0,0)); - _left->setAnchorPoint(Vector2(0,0)); - _right->setAnchorPoint(Vector2(0,0)); - _top->setAnchorPoint(Vector2(0,0)); - _bottom->setAnchorPoint(Vector2(0,0)); - _centre->setAnchorPoint(Vector2(0,0)); + _bottomLeft->setAnchorPoint(Vec2(0,0)); + _bottomRight->setAnchorPoint(Vec2(0,0)); + _topLeft->setAnchorPoint(Vec2(0,0)); + _topRight->setAnchorPoint(Vec2(0,0)); + _left->setAnchorPoint(Vec2(0,0)); + _right->setAnchorPoint(Vec2(0,0)); + _top->setAnchorPoint(Vec2(0,0)); + _bottom->setAnchorPoint(Vec2(0,0)); + _centre->setAnchorPoint(Vec2(0,0)); // Position corners - _bottomLeft->setPosition(Vector2(0,0)); - _bottomRight->setPosition(Vector2(leftWidth+rescaledWidth,0)); - _topLeft->setPosition(Vector2(0, bottomHeight+rescaledHeight)); - _topRight->setPosition(Vector2(leftWidth+rescaledWidth, bottomHeight+rescaledHeight)); + _bottomLeft->setPosition(Vec2(0,0)); + _bottomRight->setPosition(Vec2(leftWidth+rescaledWidth,0)); + _topLeft->setPosition(Vec2(0, bottomHeight+rescaledHeight)); + _topRight->setPosition(Vec2(leftWidth+rescaledWidth, bottomHeight+rescaledHeight)); // Scale and position borders - _left->setPosition(Vector2(0, bottomHeight)); + _left->setPosition(Vec2(0, bottomHeight)); _left->setScaleY(verticalScale); - _right->setPosition(Vector2(leftWidth+rescaledWidth,bottomHeight)); + _right->setPosition(Vec2(leftWidth+rescaledWidth,bottomHeight)); _right->setScaleY(verticalScale); - _bottom->setPosition(Vector2(leftWidth,0)); + _bottom->setPosition(Vec2(leftWidth,0)); _bottom->setScaleX(horizontalScale); - _top->setPosition(Vector2(leftWidth,bottomHeight+rescaledHeight)); + _top->setPosition(Vec2(leftWidth,bottomHeight+rescaledHeight)); _top->setScaleX(horizontalScale); // Position centre - _centre->setPosition(Vector2(leftWidth, bottomHeight)); + _centre->setPosition(Vec2(leftWidth, bottomHeight)); } bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets) @@ -764,7 +764,7 @@ void Scale9Sprite::setInsetBottom(float insetBottom) this->updateCapInset(); } -void Scale9Sprite::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void Scale9Sprite::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { if(this->_positionsAreDirty) { diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index 9497d932ae..da66186462 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -261,7 +261,7 @@ public: * @js NA * @lua NA */ - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; virtual void setOpacityModifyRGB(bool bValue) override; virtual bool isOpacityModifyRGB(void) const override; virtual void setOpacity(GLubyte opacity) override; diff --git a/extensions/GUI/CCEditBox/CCEditBox.cpp b/extensions/GUI/CCEditBox/CCEditBox.cpp index deb4f3ccd4..97b4b6c629 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.cpp +++ b/extensions/GUI/CCEditBox/CCEditBox.cpp @@ -97,7 +97,7 @@ bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pP this->setZoomOnTouchDown(false); this->setPreferredSize(size); - this->setPosition(Vector2(0, 0)); + this->setPosition(Vec2(0, 0)); this->addTargetWithActionForControlEvent(this, cccontrol_selector(EditBox::touchDownAction), Control::EventType::TOUCH_UP_INSIDE); return true; @@ -282,7 +282,7 @@ void EditBox::setReturnType(EditBox::KeyboardReturnType returnType) } /* override function */ -void EditBox::setPosition(const Vector2& pos) +void EditBox::setPosition(const Vec2& pos) { ControlButton::setPosition(pos); if (_editBoxImpl != NULL) @@ -309,7 +309,7 @@ void EditBox::setContentSize(const Size& size) } } -void EditBox::setAnchorPoint(const Vector2& anchorPoint) +void EditBox::setAnchorPoint(const Vec2& anchorPoint) { ControlButton::setAnchorPoint(anchorPoint); if (_editBoxImpl != NULL) @@ -318,7 +318,7 @@ void EditBox::setAnchorPoint(const Vector2& anchorPoint) } } -void EditBox::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void EditBox::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { ControlButton::visit(renderer, parentTransform, parentTransformUpdated); if (_editBoxImpl != NULL) diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index 48bab4d589..d666528d18 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -371,15 +371,15 @@ public: void setReturnType(EditBox::KeyboardReturnType returnType); /* override functions */ - virtual void setPosition(const Vector2& pos) override; + virtual void setPosition(const Vec2& pos) override; virtual void setVisible(bool visible) override; virtual void setContentSize(const Size& size) override; - virtual void setAnchorPoint(const Vector2& anchorPoint) override; + virtual void setAnchorPoint(const Vec2& anchorPoint) override; /** * @js NA * @lua NA */ - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; /** * @js NA * @lua NA diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h index b10c812778..44118c1c0b 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -65,10 +65,10 @@ public: virtual void openKeyboard() = 0; virtual void closeKeyboard() = 0; - virtual void setPosition(const Vector2& pos) = 0; + virtual void setPosition(const Vec2& pos) = 0; virtual void setVisible(bool visible) = 0; virtual void setContentSize(const Size& size) = 0; - virtual void setAnchorPoint(const Vector2& anchorPoint) = 0; + virtual void setAnchorPoint(const Vec2& anchorPoint) = 0; /** * check the editbox's position, update it when needed diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp index 2931a51efc..e610819d17 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp @@ -71,16 +71,16 @@ bool EditBoxImplAndroid::initWithSize(const Size& size) _label = Label::create(); _label->setSystemFontSize(size.height-12); // align the text vertically center - _label->setAnchorPoint(Vector2(0, 0.5f)); - _label->setPosition(Vector2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); _label->setColor(_colText); _editBox->addChild(_label); _labelPlaceHolder = Label::create(); _labelPlaceHolder->setSystemFontSize(size.height-12); // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vector2(0, 0.5f)); - _labelPlaceHolder->setPosition(Vector2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); _labelPlaceHolder->setVisible(false); _labelPlaceHolder->setColor(_colPlaceHolder); _editBox->addChild(_labelPlaceHolder); @@ -215,7 +215,7 @@ void EditBoxImplAndroid::setPlaceHolder(const char* pText) } } -void EditBoxImplAndroid::setPosition(const Vector2& pos) +void EditBoxImplAndroid::setPosition(const Vec2& pos) { // don't need to be implemented on android platform. } @@ -230,7 +230,7 @@ void EditBoxImplAndroid::setContentSize(const Size& size) } -void EditBoxImplAndroid::setAnchorPoint(const Vector2& anchorPoint) +void EditBoxImplAndroid::setAnchorPoint(const Vec2& anchorPoint) { // don't need to be implemented on android platform. } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h index 908ac57fc6..8f4d6a1e95 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h @@ -65,10 +65,10 @@ public: virtual void setText(const char* pText); virtual const char* getText(void); virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vector2& pos); + virtual void setPosition(const Vec2& pos); virtual void setVisible(bool visible); virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); /** * @js NA * @lua NA diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h index 575f32a3de..0e666ee6ed 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h @@ -97,10 +97,10 @@ public: virtual const char* getText(void); virtual void refreshInactiveText(); virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vector2& pos); + virtual void setPosition(const Vec2& pos); virtual void setVisible(bool visible); virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); virtual void updatePosition(float dt) override; /** * @js NA @@ -126,8 +126,8 @@ private: Label* _label; Label* _labelPlaceHolder; Size _contentSize; - Vector2 _position; - Vector2 _anchorPoint; + Vec2 _position; + Vec2 _anchorPoint; CCEditBoxImplIOS_objc* _systemControl; int _maxTextLength; bool _inRetinaMode; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index 49f7013396..edab22c826 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -270,7 +270,7 @@ EditBoxImplIOS::EditBoxImplIOS(EditBox* pEditText) : EditBoxImpl(pEditText) , _label(nullptr) , _labelPlaceHolder(nullptr) -, _anchorPoint(Vector2(0.5f, 0.5f)) +, _anchorPoint(Vec2(0.5f, 0.5f)) , _systemControl(nullptr) , _maxTextLength(-1) { @@ -323,14 +323,14 @@ void EditBoxImplIOS::initInactiveLabels(const Size& size) const char* pDefaultFontName = [[_systemControl.textField.font fontName] UTF8String]; _label = Label::create(); - _label->setAnchorPoint(Vector2(0, 0.5f)); + _label->setAnchorPoint(Vec2(0, 0.5f)); _label->setColor(Color3B::WHITE); _label->setVisible(false); _editBox->addChild(_label, kLabelZOrder); _labelPlaceHolder = Label::create(); // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vector2(0, 0.5f)); + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); _labelPlaceHolder->setColor(Color3B::GRAY); _editBox->addChild(_labelPlaceHolder, kLabelZOrder); @@ -340,8 +340,8 @@ void EditBoxImplIOS::initInactiveLabels(const Size& size) void EditBoxImplIOS::placeInactiveLabels() { - _label->setPosition(Vector2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); - _labelPlaceHolder->setPosition(Vector2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); + _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); + _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); } void EditBoxImplIOS::setInactiveText(const char* pText) @@ -550,15 +550,15 @@ void EditBoxImplIOS::setPlaceHolder(const char* pText) _labelPlaceHolder->setString(pText); } -static CGPoint convertDesignCoordToScreenCoord(const Vector2& designCoord, bool bInRetinaMode) +static CGPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) { auto glview = cocos2d::Director::getInstance()->getOpenGLView(); CCEAGLView *eaglview = (CCEAGLView *) glview->getEAGLView(); float viewH = (float)[eaglview getHeight]; - Vector2 visiblePos = Vector2(designCoord.x * glview->getScaleX(), designCoord.y * glview->getScaleY()); - Vector2 screenGLPos = visiblePos + glview->getViewPortRect().origin; + Vec2 visiblePos = Vec2(designCoord.x * glview->getScaleX(), designCoord.y * glview->getScaleY()); + Vec2 screenGLPos = visiblePos + glview->getViewPortRect().origin; CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y); @@ -571,7 +571,7 @@ static CGPoint convertDesignCoordToScreenCoord(const Vector2& designCoord, bool return screenPos; } -void EditBoxImplIOS::setPosition(const Vector2& pos) +void EditBoxImplIOS::setPosition(const Vec2& pos) { _position = pos; adjustTextFieldPosition(); @@ -598,7 +598,7 @@ void EditBoxImplIOS::setContentSize(const Size& size) [_systemControl setContentSize:controlSize]; } -void EditBoxImplIOS::setAnchorPoint(const Vector2& anchorPoint) +void EditBoxImplIOS::setAnchorPoint(const Vec2& anchorPoint) { CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); _anchorPoint = anchorPoint; @@ -633,7 +633,7 @@ void EditBoxImplIOS::adjustTextFieldPosition() Rect rect = Rect(0, 0, contentSize.width, contentSize.height); rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); - Vector2 designCoord = Vector2(rect.origin.x, rect.origin.y + rect.size.height); + Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); [_systemControl setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index 5578219bde..651e2927c6 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -96,10 +96,10 @@ public: virtual void setText(const char* pText); virtual const char* getText(void); virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vector2& pos); + virtual void setPosition(const Vec2& pos); virtual void setVisible(bool visible); virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); /** * @js NA * @lua NA @@ -115,11 +115,11 @@ public: */ virtual void onEnter(void); private: - NSPoint convertDesignCoordToScreenCoord(const Vector2& designCoord, bool bInRetinaMode); + NSPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode); void adjustTextFieldPosition(); Size _contentSize; - Vector2 _position; - Vector2 _anchorPoint; + Vec2 _position; + Vec2 _anchorPoint; int _maxTextLength; bool _inRetinaMode; CCEditBoxImplMac* _sysEdit; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm index e9502ca908..dfc3b6d0d0 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm @@ -258,7 +258,7 @@ EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) EditBoxImplMac::EditBoxImplMac(EditBox* pEditText) : EditBoxImpl(pEditText) -, _anchorPoint(Vector2(0.5f, 0.5f)) +, _anchorPoint(Vec2(0.5f, 0.5f)) , _maxTextLength(-1) , _sysEdit(nullptr) { @@ -388,15 +388,15 @@ void EditBoxImplMac::setPlaceHolder(const char* pText) [as release]; } -NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vector2& designCoord, bool bInRetinaMode) +NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) { NSRect frame = [_sysEdit.textField frame]; CGFloat height = frame.size.height; GLViewProtocol* eglView = Director::getInstance()->getOpenGLView(); - Vector2 visiblePos = Vector2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); - Vector2 screenGLPos = visiblePos + eglView->getViewPortRect().origin; + Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); + Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin; //TODO: I don't know why here needs to substract `height`. NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height); @@ -425,11 +425,11 @@ void EditBoxImplMac::adjustTextFieldPosition() rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); - Vector2 designCoord = Vector2(rect.origin.x, rect.origin.y + rect.size.height); + Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); [_sysEdit setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; } -void EditBoxImplMac::setPosition(const Vector2& pos) +void EditBoxImplMac::setPosition(const Vec2& pos) { _position = pos; adjustTextFieldPosition(); @@ -446,7 +446,7 @@ void EditBoxImplMac::setContentSize(const Size& size) CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); } -void EditBoxImplMac::setAnchorPoint(const Vector2& anchorPoint) +void EditBoxImplMac::setAnchorPoint(const Vec2& anchorPoint) { CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); _anchorPoint = anchorPoint; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp index 1609c721cf..d98082746f 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp @@ -73,16 +73,16 @@ bool EditBoxImplWin::initWithSize(const Size& size) _label = Label::create(); _label->setSystemFontSize(size.height-12); // align the text vertically center - _label->setAnchorPoint(Vector2(0, 0.5f)); - _label->setPosition(Vector2(5, size.height / 2.0f)); + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setPosition(Vec2(5, size.height / 2.0f)); _label->setColor(_colText); _editBox->addChild(_label); _labelPlaceHolder = Label::create(); _labelPlaceHolder->setSystemFontSize(size.height-12); // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vector2(0, 0.5f)); - _labelPlaceHolder->setPosition(Vector2(5, size.height / 2.0f)); + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setPosition(Vec2(5, size.height / 2.0f)); _labelPlaceHolder->setVisible(false); _labelPlaceHolder->setColor(_colPlaceHolder); _editBox->addChild(_labelPlaceHolder); @@ -211,7 +211,7 @@ void EditBoxImplWin::setPlaceHolder(const char* pText) } } -void EditBoxImplWin::setPosition(const Vector2& pos) +void EditBoxImplWin::setPosition(const Vec2& pos) { //_label->setPosition(pos); //_labelPlaceHolder->setPosition(pos); @@ -225,7 +225,7 @@ void EditBoxImplWin::setContentSize(const Size& size) { } -void EditBoxImplWin::setAnchorPoint(const Vector2& anchorPoint) +void EditBoxImplWin::setAnchorPoint(const Vec2& anchorPoint) { // don't need to be implemented on win32 platform. } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 7972364b58..7b29251644 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -65,10 +65,10 @@ public: virtual void setText(const char* pText); virtual const char* getText(void); virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vector2& pos); + virtual void setPosition(const Vec2& pos); virtual void setVisible(bool visible); virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); /** * @js NA * @lua NA diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp index 1b0c4f68e9..e43d85d746 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp @@ -97,15 +97,15 @@ bool CCEditBoxImplWp8::initWithSize( const Size& size ) //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); m_pLabel = Label::createWithSystemFont("", "", size.height-12); // align the text vertically center - m_pLabel->setAnchorPoint(Vector2(0.0f, 0.5f)); - m_pLabel->setPosition(Vector2(5.0, size.height / 2.0f)); + m_pLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabel->setPosition(Vec2(5.0, size.height / 2.0f)); m_pLabel->setColor(m_colText); _editBox->addChild(m_pLabel); m_pLabelPlaceHolder = Label::createWithSystemFont("", "", size.height-12); // align the text vertically center - m_pLabelPlaceHolder->setAnchorPoint(Vector2(0.0f, 0.5f)); - m_pLabelPlaceHolder->setPosition(Vector2(5.0f, size.height / 2.0f)); + m_pLabelPlaceHolder->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabelPlaceHolder->setPosition(Vec2(5.0f, size.height / 2.0f)); m_pLabelPlaceHolder->setVisible(false); m_pLabelPlaceHolder->setColor(m_colPlaceHolder); _editBox->addChild(m_pLabelPlaceHolder); @@ -234,7 +234,7 @@ void CCEditBoxImplWp8::setPlaceHolder( const char* pText ) } } -void CCEditBoxImplWp8::setPosition( const Vector2& pos ) +void CCEditBoxImplWp8::setPosition( const Vec2& pos ) { } @@ -249,7 +249,7 @@ void CCEditBoxImplWp8::setContentSize( const Size& size ) } -void CCEditBoxImplWp8::setAnchorPoint( const Vector2& anchorPoint ) +void CCEditBoxImplWp8::setAnchorPoint( const Vec2& anchorPoint ) { } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h index 20bb1d8df2..7f1cbb4947 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h @@ -52,10 +52,10 @@ public: virtual void setText(const char* pText); virtual const char* getText(void); virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vector2& pos); + virtual void setPosition(const Vec2& pos); virtual void setVisible(bool visible); virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vector2& anchorPoint); + virtual void setAnchorPoint(const Vec2& anchorPoint); virtual void visit(void); virtual void doAnimationWhenKeyboardMove(float duration, float distance); virtual void openKeyboard(); diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index f69031daa8..020b775a92 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -114,7 +114,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) { _container = Layer::create(); _container->ignoreAnchorPointForPosition(false); - _container->setAnchorPoint(Vector2(0.0f, 0.0f)); + _container->setAnchorPoint(Vec2(0.0f, 0.0f)); } this->setViewSize(size); @@ -128,7 +128,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) _clippingToBounds = true; //_container->setContentSize(Size::ZERO); _direction = Direction::BOTH; - _container->setPosition(Vector2(0.0f, 0.0f)); + _container->setPosition(Vec2(0.0f, 0.0f)); _touchLength = 0.0f; this->addChild(_container); @@ -147,7 +147,7 @@ bool ScrollView::init() bool ScrollView::isNodeVisible(Node* node) { - const Vector2 offset = this->getContentOffset(); + const Vec2 offset = this->getContentOffset(); const Size size = this->getViewSize(); const float scale = this->getZoomScale(); @@ -206,7 +206,7 @@ void ScrollView::setTouchEnabled(bool enabled) } } -void ScrollView::setContentOffset(Vector2 offset, bool animated/* = false*/) +void ScrollView::setContentOffset(Vec2 offset, bool animated/* = false*/) { if (animated) { //animate scrolling @@ -216,8 +216,8 @@ void ScrollView::setContentOffset(Vector2 offset, bool animated/* = false*/) { //set the container position directly if (!_bounceable) { - const Vector2 minOffset = this->minContainerOffset(); - const Vector2 maxOffset = this->maxContainerOffset(); + const Vec2 minOffset = this->minContainerOffset(); + const Vec2 maxOffset = this->maxContainerOffset(); offset.x = MAX(minOffset.x, MIN(maxOffset.x, offset.x)); offset.y = MAX(minOffset.y, MIN(maxOffset.y, offset.y)); @@ -232,7 +232,7 @@ void ScrollView::setContentOffset(Vector2 offset, bool animated/* = false*/) } } -void ScrollView::setContentOffsetInDuration(Vector2 offset, float dt) +void ScrollView::setContentOffsetInDuration(Vec2 offset, float dt) { FiniteTimeAction *scroll, *expire; @@ -242,7 +242,7 @@ void ScrollView::setContentOffsetInDuration(Vector2 offset, float dt) this->schedule(schedule_selector(ScrollView::performedAnimatedScroll)); } -Vector2 ScrollView::getContentOffset() +Vec2 ScrollView::getContentOffset() { return _container->getPosition(); } @@ -251,12 +251,12 @@ void ScrollView::setZoomScale(float s) { if (_container->getScale() != s) { - Vector2 oldCenter, newCenter; - Vector2 center; + Vec2 oldCenter, newCenter; + Vec2 center; if (_touchLength == 0.0f) { - center = Vector2(_viewSize.width*0.5f, _viewSize.height*0.5f); + center = Vec2(_viewSize.width*0.5f, _viewSize.height*0.5f); center = this->convertToWorldSpace(center); } else @@ -268,7 +268,7 @@ void ScrollView::setZoomScale(float s) _container->setScale(MAX(_minScale, MIN(_maxScale, s))); newCenter = _container->convertToWorldSpace(oldCenter); - const Vector2 offset = center - newCenter; + const Vec2 offset = center - newCenter; if (_delegate != NULL) { _delegate->scrollViewDidZoom(this); @@ -338,7 +338,7 @@ void ScrollView::setContainer(Node * pContainer) this->_container = pContainer; this->_container->ignoreAnchorPointForPosition(false); - this->_container->setAnchorPoint(Vector2(0.0f, 0.0f)); + this->_container->setAnchorPoint(Vec2(0.0f, 0.0f)); this->addChild(this->_container); @@ -347,7 +347,7 @@ void ScrollView::setContainer(Node * pContainer) void ScrollView::relocateContainer(bool animated) { - Vector2 oldPoint, min, max; + Vec2 oldPoint, min, max; float newX, newY; min = this->minContainerOffset(); @@ -371,18 +371,18 @@ void ScrollView::relocateContainer(bool animated) if (newY != oldPoint.y || newX != oldPoint.x) { - this->setContentOffset(Vector2(newX, newY), animated); + this->setContentOffset(Vec2(newX, newY), animated); } } -Vector2 ScrollView::maxContainerOffset() +Vec2 ScrollView::maxContainerOffset() { - return Vector2(0.0f, 0.0f); + return Vec2(0.0f, 0.0f); } -Vector2 ScrollView::minContainerOffset() +Vec2 ScrollView::minContainerOffset() { - return Vector2(_viewSize.width - _container->getContentSize().width*_container->getScaleX(), + return Vec2(_viewSize.width - _container->getContentSize().width*_container->getScaleX(), _viewSize.height - _container->getContentSize().height*_container->getScaleY()); } @@ -395,7 +395,7 @@ void ScrollView::deaccelerateScrolling(float dt) } float newX, newY; - Vector2 maxInset, minInset; + Vec2 maxInset, minInset; _container->setPosition(_container->getPosition() + _scrollDistance); @@ -414,7 +414,7 @@ void ScrollView::deaccelerateScrolling(float dt) newY = _container->getPosition().y; _scrollDistance = _scrollDistance * SCROLL_DEACCEL_RATE; - this->setContentOffset(Vector2(newX,newY)); + this->setContentOffset(Vec2(newX,newY)); if ((fabsf(_scrollDistance.x) <= SCROLL_DEACCEL_DIST && fabsf(_scrollDistance.y) <= SCROLL_DEACCEL_DIST) || @@ -470,10 +470,10 @@ void ScrollView::updateInset() if (this->getContainer() != NULL) { _maxInset = this->maxContainerOffset(); - _maxInset = Vector2(_maxInset.x + _viewSize.width * INSET_RATIO, + _maxInset = Vec2(_maxInset.x + _viewSize.width * INSET_RATIO, _maxInset.y + _viewSize.height * INSET_RATIO); _minInset = this->minContainerOffset(); - _minInset = Vector2(_minInset.x - _viewSize.width * INSET_RATIO, + _minInset = Vec2(_minInset.x - _viewSize.width * INSET_RATIO, _minInset.y - _viewSize.height * INSET_RATIO); } } @@ -553,7 +553,7 @@ void ScrollView::onAfterDraw() } } -void ScrollView::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) +void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) { // quick return if not visible if (!isVisible()) @@ -567,7 +567,7 @@ void ScrollView::visit(Renderer *renderer, const Matrix &parentTransform, bool p _transformUpdated = false; // IMPORTANT: - // To ease the migration to v3.0, we still support the Matrix stack, + // To ease the migration to v3.0, we still support the Mat4 stack, // but it is deprecated and your code should not rely on it Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -642,7 +642,7 @@ bool ScrollView::onTouchBegan(Touch* touch, Event* event) _touchPoint = this->convertTouchToNodeSpace(touch); _touchMoved = false; _dragging = true; //dragging started - _scrollDistance = Vector2(0.0f, 0.0f); + _scrollDistance = Vec2(0.0f, 0.0f); _touchLength = 0.0f; } else if (_touches.size() == 2) @@ -669,7 +669,7 @@ void ScrollView::onTouchMoved(Touch* touch, Event* event) { if (_touches.size() == 1 && _dragging) { // scrolling - Vector2 moveDistance, newPoint; + Vec2 moveDistance, newPoint; Rect frame; float newX, newY; @@ -718,7 +718,7 @@ void ScrollView::onTouchMoved(Touch* touch, Event* event) if (!_touchMoved) { - moveDistance = Vector2::ZERO; + moveDistance = Vec2::ZERO; } _touchPoint = newPoint; @@ -729,10 +729,10 @@ void ScrollView::onTouchMoved(Touch* touch, Event* event) switch (_direction) { case Direction::VERTICAL: - moveDistance = Vector2(0.0f, moveDistance.y); + moveDistance = Vec2(0.0f, moveDistance.y); break; case Direction::HORIZONTAL: - moveDistance = Vector2(moveDistance.x, 0.0f); + moveDistance = Vec2(moveDistance.x, 0.0f); break; default: break; @@ -742,7 +742,7 @@ void ScrollView::onTouchMoved(Touch* touch, Event* event) newY = _container->getPosition().y + moveDistance.y; _scrollDistance = moveDistance; - this->setContentOffset(Vector2(newX, newY)); + this->setContentOffset(Vec2(newX, newY)); } } else if (_touches.size() == 2 && !_dragging) @@ -798,7 +798,7 @@ void ScrollView::onTouchCancelled(Touch* touch, Event* event) Rect ScrollView::getViewRect() { - Vector2 screenPos = this->convertToWorldSpace(Vector2::ZERO); + Vec2 screenPos = this->convertToWorldSpace(Vec2::ZERO); float scaleX = this->getScaleX(); float scaleY = this->getScaleY(); diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index 8bd7a5b092..a232833ab0 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -116,8 +116,8 @@ public: * @param offset The new offset. * @param animated If true, the view will scroll to the new offset. */ - void setContentOffset(Vector2 offset, bool animated = false); - Vector2 getContentOffset(); + void setContentOffset(Vec2 offset, bool animated = false); + Vec2 getContentOffset(); /** * Sets a new content offset. It ignores max/min offset. It just sets what's given. (just like UIKit's UIScrollView) * You can override the animation duration with this method. @@ -125,7 +125,7 @@ public: * @param offset The new offset. * @param dt The animation duration. */ - void setContentOffsetInDuration(Vector2 offset, float dt); + void setContentOffsetInDuration(Vec2 offset, float dt); void setZoomScale(float s); /** @@ -148,11 +148,11 @@ public: /** * Returns the current container's minimum offset. You may want this while you animate scrolling by yourself */ - Vector2 minContainerOffset(); + Vec2 minContainerOffset(); /** * Returns the current container's maximum offset. You may want this while you animate scrolling by yourself */ - Vector2 maxContainerOffset(); + Vec2 maxContainerOffset(); /** * Determines if a given node's bounding box is in visible bounds * @@ -225,7 +225,7 @@ public: * @js NA * @lua NA */ - virtual void visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) override; + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, bool parentTransformUpdated) override; using Node::addChild; virtual void addChild(Node * child, int zOrder, int tag) override; @@ -300,7 +300,7 @@ protected: /** * Content offset. Note that left-bottom point is the origin */ - Vector2 _contentOffset; + Vec2 _contentOffset; /** * Container holds scroll view contents, Sets the scrollable container object of the scroll view @@ -313,11 +313,11 @@ protected: /** * max inset point to limit scrolling by touch */ - Vector2 _maxInset; + Vec2 _maxInset; /** * min inset point to limit scrolling by touch */ - Vector2 _minInset; + Vec2 _minInset; /** * Determines whether the scroll view is allowed to bounce or not. */ @@ -328,11 +328,11 @@ protected: /** * scroll speed */ - Vector2 _scrollDistance; + Vec2 _scrollDistance; /** * Touch point */ - Vector2 _touchPoint; + Vec2 _touchPoint; /** * length between two fingers */ diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 86861e276d..3ba3c9c216 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -289,20 +289,20 @@ void TableView::_updateContentSize() { if (_direction == Direction::HORIZONTAL) { - this->setContentOffset(Vector2(0,0)); + this->setContentOffset(Vec2(0,0)); } else { - this->setContentOffset(Vector2(0,this->minContainerOffset().y)); + this->setContentOffset(Vec2(0,this->minContainerOffset().y)); } _oldDirection = _direction; } } -Vector2 TableView::_offsetFromIndex(ssize_t index) +Vec2 TableView::_offsetFromIndex(ssize_t index) { - Vector2 offset = this->__offsetFromIndex(index); + Vec2 offset = this->__offsetFromIndex(index); const Size cellSize = _dataSource->tableCellSizeForIndex(this, index); if (_vordering == VerticalFillOrder::TOP_DOWN) @@ -312,25 +312,25 @@ Vector2 TableView::_offsetFromIndex(ssize_t index) return offset; } -Vector2 TableView::__offsetFromIndex(ssize_t index) +Vec2 TableView::__offsetFromIndex(ssize_t index) { - Vector2 offset; + Vec2 offset; Size cellSize; switch (this->getDirection()) { case Direction::HORIZONTAL: - offset = Vector2(_vCellsPositions[index], 0.0f); + offset = Vec2(_vCellsPositions[index], 0.0f); break; default: - offset = Vector2(0.0f, _vCellsPositions[index]); + offset = Vec2(0.0f, _vCellsPositions[index]); break; } return offset; } -long TableView::_indexFromOffset(Vector2 offset) +long TableView::_indexFromOffset(Vec2 offset) { long index = 0; const long maxIdx = _dataSource->numberOfCellsInTableView(this) - 1; @@ -352,7 +352,7 @@ long TableView::_indexFromOffset(Vector2 offset) return index; } -long TableView::__indexFromOffset(Vector2 offset) +long TableView::__indexFromOffset(Vec2 offset) { long low = 0; long high = _dataSource->numberOfCellsInTableView(this) - 1; @@ -415,7 +415,7 @@ void TableView::_moveCellOutOfSight(TableViewCell *cell) void TableView::_setIndexForCell(ssize_t index, TableViewCell *cell) { - cell->setAnchorPoint(Vector2(0.0f, 0.0f)); + cell->setAnchorPoint(Vec2(0.0f, 0.0f)); cell->setPosition(this->_offsetFromIndex(index)); cell->setIdx(index); } @@ -469,7 +469,7 @@ void TableView::scrollViewDidScroll(ScrollView* view) } ssize_t startIdx = 0, endIdx = 0, idx = 0, maxIdx = 0; - Vector2 offset = this->getContentOffset() * -1; + Vec2 offset = this->getContentOffset() * -1; maxIdx = MAX(countOfItems-1, 0); if (_vordering == VerticalFillOrder::TOP_DOWN) @@ -601,7 +601,7 @@ bool TableView::onTouchBegan(Touch *pTouch, Event *pEvent) if(_touches.size() == 1) { long index; - Vector2 point; + Vec2 point; point = this->getContainer()->convertTouchToNodeSpace(pTouch); diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index 304948bdac..c4d89b33a9 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -273,10 +273,10 @@ public: virtual void onTouchCancelled(Touch *pTouch, Event *pEvent) override; protected: - long __indexFromOffset(Vector2 offset); - long _indexFromOffset(Vector2 offset); - Vector2 __offsetFromIndex(ssize_t index); - Vector2 _offsetFromIndex(ssize_t index); + long __indexFromOffset(Vec2 offset); + long _indexFromOffset(Vec2 offset); + Vec2 __offsetFromIndex(ssize_t index); + Vec2 _offsetFromIndex(ssize_t index); void _moveCellOutOfSight(TableViewCell *cell); void _setIndexForCell(ssize_t index, TableViewCell *cell); diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index e5da44c451..672895e9ef 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -63,15 +63,15 @@ static Color4F ColorForBody(cpBody *body) } } -static Vector2 cpVert2Point(const cpVect &vert) +static Vec2 cpVert2Point(const cpVect &vert) { - return Vector2(vert.x, vert.y); + return Vec2(vert.x, vert.y); } -static Vector2* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count) +static Vec2* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count) { if (count == 0) return NULL; - Vector2* pPoints = new Vector2[count]; + Vec2* pPoints = new Vec2[count]; for (unsigned int i = 0; i < count; ++i) { @@ -108,7 +108,7 @@ static void DrawShape(cpShape *shape, DrawNode *renderer) cpPolyShape *poly = (cpPolyShape *)shape; Color4F line = color; line.a = cpflerp(color.a, 1.0, 0.5); - Vector2* pPoints = cpVertArray2ccpArrayN(poly->tVerts, poly->numVerts); + Vec2* pPoints = cpVertArray2ccpArrayN(poly->tVerts, poly->numVerts); renderer->drawPolygon(pPoints, poly->numVerts, color, 1.0, line); CC_SAFE_DELETE_ARRAY(pPoints); } @@ -182,7 +182,7 @@ static void DrawConstraint(cpConstraint *constraint, DrawNode *renderer) // implementation of PhysicsDebugNode -void PhysicsDebugNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void PhysicsDebugNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (! _spacePtr) { diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 8981cd8ff9..300e796c50 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -61,7 +61,7 @@ public: void setSpace(cpSpace *space); // Overrides - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: cpSpace *_spacePtr; diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index ac57b234a3..4ee1644382 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -165,7 +165,7 @@ void PhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation) } // Override the setters and getters to always reflect the body's properties. -const Vector2& PhysicsSprite::getPosition() const +const Vec2& PhysicsSprite::getPosition() const { return getPosFromPhysics(); } @@ -175,7 +175,7 @@ void PhysicsSprite::getPosition(float* x, float* y) const if (x == NULL || y == NULL) { return; } - const Vector2& pos = getPosFromPhysics(); + const Vec2& pos = getPosFromPhysics(); *x = pos.x; *y = pos.y; } @@ -257,25 +257,25 @@ void PhysicsSprite::setPTMRatio(float fRatio) // Common to Box2d and Chipmunk // -const Vector2& PhysicsSprite::getPosFromPhysics() const +const Vec2& PhysicsSprite::getPosFromPhysics() const { - static Vector2 s_physicPosion; + static Vec2 s_physicPosion; #if CC_ENABLE_CHIPMUNK_INTEGRATION cpVect cpPos = cpBodyGetPos(_CPBody); - s_physicPosion = Vector2(cpPos.x, cpPos.y); + s_physicPosion = Vec2(cpPos.x, cpPos.y); #elif CC_ENABLE_BOX2D_INTEGRATION b2Vec2 pos = _pB2Body->GetPosition(); float x = pos.x * _PTMRatio; float y = pos.y * _PTMRatio; - s_physicPosion = Vector2(x,y); + s_physicPosion = Vec2(x,y); #endif return s_physicPosion; } -void PhysicsSprite::setPosition(const Vector2 &pos) +void PhysicsSprite::setPosition(const Vec2 &pos) { #if CC_ENABLE_CHIPMUNK_INTEGRATION @@ -372,7 +372,7 @@ void PhysicsSprite::syncPhysicsTransform() const float c = cosf(radians); float s = sinf(radians); - if (!_anchorPointInPoints.equals(Vector2::ZERO)) + if (!_anchorPointInPoints.equals(Vec2::ZERO)) { x += ((c * -_anchorPointInPoints.x * _scaleX) + (-s * -_anchorPointInPoints.y * _scaleY)); y += ((s * -_anchorPointInPoints.x * _scaleX) + (c * -_anchorPointInPoints.y * _scaleY)); @@ -390,14 +390,14 @@ void PhysicsSprite::syncPhysicsTransform() const } // returns the transform matrix according the Chipmunk Body values -const Matrix& PhysicsSprite::getNodeToParentTransform() const +const Mat4& PhysicsSprite::getNodeToParentTransform() const { syncPhysicsTransform(); return _transform; } -void PhysicsSprite::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void PhysicsSprite::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (isDirty()) { diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index ed817473a4..3f87247deb 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -106,20 +106,20 @@ public: void setPTMRatio(float fPTMRatio); // overrides - virtual const Vector2& getPosition() const override; + virtual const Vec2& getPosition() const override; virtual void getPosition(float* x, float* y) const override; virtual float getPositionX() const override; virtual float getPositionY() const override; - virtual void setPosition(const Vector2 &position) override; + virtual void setPosition(const Vec2 &position) override; virtual float getRotation() const override; virtual void setRotation(float fRotation) override; virtual void syncPhysicsTransform() const; - virtual const Matrix& getNodeToParentTransform() const override; + virtual const Mat4& getNodeToParentTransform() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: - const Vector2& getPosFromPhysics() const; + const Vec2& getPosFromPhysics() const; protected: bool _ignoreBodyRotation; diff --git a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp index 6e4154a626..2750a78bed 100644 --- a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp +++ b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp @@ -42,11 +42,11 @@ bool HelloWorld::init() "CloseSelected.png", CC_CALLBACK_1(HelloWorld::menuCloseCallback,this)); - closeItem->setPosition(origin + Vector2(visibleSize) - Vector2(closeItem->getContentSize() / 2)); + closeItem->setPosition(origin + Vec2(visibleSize) - Vec2(closeItem->getContentSize() / 2)); // create menu, it's an autorelease object auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Vector2::ZERO); + menu->setPosition(Vec2::ZERO); this->addChild(menu, 1); ///////////////////////////// @@ -58,7 +58,7 @@ bool HelloWorld::init() auto label = LabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE); // position the label on the center of the screen - label->setPosition(Vector2(origin.x + visibleSize.width/2, + label->setPosition(Vec2(origin.x + visibleSize.width/2, origin.y + visibleSize.height - label->getContentSize().height)); // add the label as a child to this layer @@ -68,7 +68,7 @@ bool HelloWorld::init() auto sprite = Sprite::create("HelloWorld.png"); // position the sprite on the center of the screen - sprite->setPosition(Vector2(visibleSize / 2) + origin); + sprite->setPosition(Vec2(visibleSize / 2) + origin); // add the sprite as a child to this layer this->addChild(sprite); diff --git a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp index cd0f1f88d6..b352c5df50 100644 --- a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp +++ b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp @@ -39,10 +39,10 @@ void AccelerometerTest::onEnter() auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32.0f); addChild(label, 1); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y-50) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y-50) ); _ball = Sprite::create("Images/ball.png"); - _ball->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y)); + _ball->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y)); addChild(_ball); _ball->retain(); diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index ac6a6f55ba..0ae621cd24 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -166,7 +166,7 @@ void LogicTest::onEnter() grossini->setPosition(VisibleRect::center()); grossini->runAction( Sequence::create( - MoveBy::create(1, Vector2(150,0)), + MoveBy::create(1, Vec2(150,0)), CallFuncN::create(CC_CALLBACK_1(LogicTest::bugMe,this)), NULL) ); @@ -200,7 +200,7 @@ void PauseTest::onEnter() auto l = Label::createWithTTF("After 5 seconds grossini should move", "fonts/Thonburi.ttf", 16.0f); addChild(l); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y-75) ); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y-75) ); // @@ -210,7 +210,7 @@ void PauseTest::onEnter() addChild(grossini, 0, kTagGrossini); grossini->setPosition(VisibleRect::center() ); - auto action = MoveBy::create(1, Vector2(150,0)); + auto action = MoveBy::create(1, Vec2(150,0)); auto director = Director::getInstance(); director->getActionManager()->addAction(action, grossini, true); @@ -242,9 +242,9 @@ void StopActionTest::onEnter() auto l = Label::createWithTTF("Should not crash", "fonts/Thonburi.ttf", 16.0f); addChild(l); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 75) ); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 75) ); - auto pMove = MoveBy::create(2, Vector2(200, 0)); + auto pMove = MoveBy::create(2, Vec2(200, 0)); auto pCallback = CallFunc::create(CC_CALLBACK_0(StopActionTest::stopAction,this)); auto pSequence = Sequence::create(pMove, pCallback, NULL); pSequence->setTag(kTagSequence); @@ -283,7 +283,7 @@ void ResumeTest::onEnter() auto l = Label::createWithTTF("Grossini only rotate/scale in 3 seconds", "fonts/Thonburi.ttf", 16.0f); addChild(l); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 75)); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 75)); auto pGrossini = Sprite::create(s_pathGrossini); addChild(pGrossini, 0, kTagGrossini); diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp index c689ed692e..7b58bfc1c9 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -55,19 +55,19 @@ void EaseSpriteDemo::centerSprites(unsigned int numberOfSprites) { _tamara->setVisible(false); _kathia->setVisible(false); - _grossini->setPosition(Vector2(s.width/2, s.height/2)); + _grossini->setPosition(Vec2(s.width/2, s.height/2)); } else if( numberOfSprites == 2 ) { - _kathia->setPosition( Vector2(s.width/3, s.height/2)); - _tamara->setPosition( Vector2(2*s.width/3, s.height/2)); + _kathia->setPosition( Vec2(s.width/3, s.height/2)); + _tamara->setPosition( Vec2(2*s.width/3, s.height/2)); _grossini->setVisible(false); } else if( numberOfSprites == 3 ) { - _grossini->setPosition( Vector2(s.width/2, s.height/2)); - _tamara->setPosition( Vector2(s.width/4, s.height/2)); - _kathia->setPosition( Vector2(3 * s.width/4, s.height/2)); + _grossini->setPosition( Vec2(s.width/2, s.height/2)); + _tamara->setPosition( Vec2(s.width/4, s.height/2)); + _kathia->setPosition( Vec2(3 * s.width/4, s.height/2)); } } @@ -82,7 +82,7 @@ void SpriteEase::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130,0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130,0)); auto move_back = move->reverse(); auto move_ease_in = EaseIn::create(move->clone(), 2.5f); @@ -135,7 +135,7 @@ void SpriteEaseInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130,0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130,0)); // id move_back = move->reverse(); auto move_ease_inout1 = EaseInOut::create(move->clone(), 0.65f); @@ -174,7 +174,7 @@ void SpriteEaseExponential::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130,0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130,0)); auto move_back = move->reverse(); auto move_ease_in = EaseExponentialIn::create(move->clone()); @@ -210,7 +210,7 @@ void SpriteEaseExponentialInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseExponentialInOut::create(move->clone() ); @@ -243,7 +243,7 @@ void SpriteEaseSine::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseSineIn::create(move->clone() ); @@ -280,7 +280,7 @@ void SpriteEaseSineInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130,0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130,0)); auto move_back = move->reverse(); auto move_ease = EaseSineInOut::create(move->clone() ); @@ -312,7 +312,7 @@ void SpriteEaseElastic::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseElasticIn::create(move->clone() ); @@ -348,7 +348,7 @@ void SpriteEaseElasticInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_ease_inout1 = EaseElasticInOut::create(move->clone(), 0.3f); auto move_ease_inout_back1 = move_ease_inout1->reverse(); @@ -387,7 +387,7 @@ void SpriteEaseBounce::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseBounceIn::create(move->clone() ); @@ -424,7 +424,7 @@ void SpriteEaseBounceInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseBounceInOut::create(move->clone() ); @@ -457,7 +457,7 @@ void SpriteEaseBack::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseBackIn::create(move->clone()); @@ -493,7 +493,7 @@ void SpriteEaseBackInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseBackInOut::create(move->clone() ); @@ -537,9 +537,9 @@ void SpriteEaseBezier::onEnter() // sprite 1 ccBezierConfig bezier; - bezier.controlPoint_1 = Vector2(0, s.height/2); - bezier.controlPoint_2 = Vector2(300, -s.height/2); - bezier.endPosition = Vector2(300,100); + bezier.controlPoint_1 = Vec2(0, s.height/2); + bezier.controlPoint_2 = Vec2(300, -s.height/2); + bezier.endPosition = Vec2(300,100); auto bezierForward = BezierBy::create(3, bezier); auto bezierEaseForward = EaseBezierAction::create(bezierForward); @@ -550,18 +550,18 @@ void SpriteEaseBezier::onEnter() // sprite 2 - _tamara->setPosition(Vector2(80,160)); + _tamara->setPosition(Vec2(80,160)); ccBezierConfig bezier2; - bezier2.controlPoint_1 = Vector2(100, s.height/2); - bezier2.controlPoint_2 = Vector2(200, -s.height/2); - bezier2.endPosition = Vector2(240,160); + bezier2.controlPoint_1 = Vec2(100, s.height/2); + bezier2.controlPoint_2 = Vec2(200, -s.height/2); + bezier2.endPosition = Vec2(240,160); auto bezierTo1 = BezierTo::create(2, bezier2); auto bezierEaseTo1 = EaseBezierAction::create(bezierTo1); bezierEaseTo1->setBezierParamer(0.5, 0.5, 1.0, 1.0); // sprite 3 - _kathia->setPosition(Vector2(400,160)); + _kathia->setPosition(Vec2(400,160)); auto bezierTo2 = BezierTo::create(2, bezier2); auto bezierEaseTo2 = EaseBezierAction::create(bezierTo2); bezierEaseTo2->setBezierParamer(0.0, 0.5, -5.0, 1.0); @@ -588,7 +588,7 @@ void SpriteEaseQuadratic::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseQuadraticActionIn::create(move->clone() ); @@ -623,7 +623,7 @@ void SpriteEaseQuadraticInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseQuadraticActionInOut::create(move->clone() ); @@ -656,7 +656,7 @@ void SpriteEaseQuartic::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseQuarticActionIn::create(move->clone() ); @@ -691,7 +691,7 @@ void SpriteEaseQuarticInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseQuarticActionInOut::create(move->clone() ); @@ -723,7 +723,7 @@ void SpriteEaseQuintic::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseQuinticActionIn::create(move->clone() ); @@ -759,7 +759,7 @@ void SpriteEaseQuinticInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseQuinticActionInOut::create(move->clone() ); @@ -791,7 +791,7 @@ void SpriteEaseCircle::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseCircleActionIn::create(move->clone() ); @@ -827,7 +827,7 @@ void SpriteEaseCircleInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseCircleActionInOut::create(move->clone() ); @@ -859,7 +859,7 @@ void SpriteEaseCubic::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease_in = EaseCubicActionIn::create(move->clone() ); @@ -895,7 +895,7 @@ void SpriteEaseCubicInOut::onEnter() { EaseSpriteDemo::onEnter(); - auto move = MoveBy::create(3, Vector2(VisibleRect::right().x-130, 0)); + auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130, 0)); auto move_back = move->reverse(); auto move_ease = EaseCubicActionInOut::create(move->clone() ); @@ -929,7 +929,7 @@ void SpeedTest::onEnter() auto s = Director::getInstance()->getWinSize(); // rotate and jump - auto jump1 = JumpBy::create(4, Vector2(-s.width+80, 0), 100, 4); + auto jump1 = JumpBy::create(4, Vec2(-s.width+80, 0), 100, 4); auto jump2 = jump1->reverse(); auto rot1 = RotateBy::create(4, 360*2); auto rot2 = rot1->reverse(); @@ -1066,8 +1066,8 @@ EaseSpriteDemo::~EaseSpriteDemo(void) void EaseSpriteDemo::positionForTwo() { - _grossini->setPosition(Vector2(VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*1/5)); - _tamara->setPosition(Vector2( VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*4/5)); + _grossini->setPosition(Vec2(VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*1/5)); + _tamara->setPosition(Vec2( VisibleRect::left().x+60, VisibleRect::bottom().y + VisibleRect::getVisibleRect().size.height*4/5)); _kathia->setVisible(false); } @@ -1090,9 +1090,9 @@ void EaseSpriteDemo::onEnter() addChild( _kathia, 2); addChild( _tamara, 1); - _grossini->setPosition(Vector2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*1/5)); - _kathia->setPosition(Vector2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2.5f/5)); - _tamara->setPosition(Vector2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*4/5)); + _grossini->setPosition(Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*1/5)); + _kathia->setPosition(Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2.5f/5)); + _tamara->setPosition(Vec2(VisibleRect::left().x + 60, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*4/5)); } void EaseSpriteDemo::restartCallback(Ref* sender) diff --git a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 750f886b38..763b7ea587 100644 --- a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -163,7 +163,7 @@ void SpriteProgressToRadial::onEnter() auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType( ProgressTimer::Type::RADIAL ); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction( RepeatForever::create(to1)); auto right = ProgressTimer::create(Sprite::create(s_pathBlock)); @@ -171,7 +171,7 @@ void SpriteProgressToRadial::onEnter() // Makes the ridial CCW right->setReverseProgress(true); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction( RepeatForever::create(to2)); } @@ -198,21 +198,21 @@ void SpriteProgressToHorizontal::onEnter() auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the left since the midpoint is 0 for the x - left->setMidpoint(Vector2(0,0)); + left->setMidpoint(Vec2(0,0)); // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change - left->setBarChangeRate(Vector2(1, 0)); + left->setBarChangeRate(Vec2(1, 0)); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction( RepeatForever::create(to1)); auto right = ProgressTimer::create(Sprite::create(s_pathSister2)); right->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the left since the midpoint is 1 for the x - right->setMidpoint(Vector2(1, 0)); + right->setMidpoint(Vec2(1, 0)); // Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change - right->setBarChangeRate(Vector2(1, 0)); + right->setBarChangeRate(Vec2(1, 0)); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction( RepeatForever::create(to2)); } @@ -239,21 +239,21 @@ void SpriteProgressToVertical::onEnter() left->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidpoint(Vector2(0,0)); + left->setMidpoint(Vec2(0,0)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Vector2(0, 1)); + left->setBarChangeRate(Vec2(0, 1)); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction( RepeatForever::create(to1)); auto right = ProgressTimer::create(Sprite::create(s_pathSister2)); right->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidpoint(Vector2(0, 1)); + right->setMidpoint(Vec2(0, 1)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Vector2(0, 1)); + right->setBarChangeRate(Vec2(0, 1)); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction( RepeatForever::create(to2)); } @@ -281,8 +281,8 @@ void SpriteProgressToRadialMidpointChanged::onEnter() auto left = ProgressTimer::create(Sprite::create(s_pathBlock)); left->setType(ProgressTimer::Type::RADIAL); addChild(left); - left->setMidpoint(Vector2(0.25f, 0.75f)); - left->setPosition(Vector2(100, s.height/2)); + left->setMidpoint(Vec2(0.25f, 0.75f)); + left->setPosition(Vec2(100, s.height/2)); left->runAction(RepeatForever::create(action->clone())); /** @@ -290,14 +290,14 @@ void SpriteProgressToRadialMidpointChanged::onEnter() */ auto right = ProgressTimer::create(Sprite::create(s_pathBlock)); right->setType(ProgressTimer::Type::RADIAL); - right->setMidpoint(Vector2(0.75f, 0.25f)); + right->setMidpoint(Vec2(0.75f, 0.25f)); /** * Note the reverse property (default=NO) is only added to the right image. That's how * we get a counter clockwise progress. */ addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction(RepeatForever::create(action->clone())); } @@ -323,31 +323,31 @@ void SpriteProgressBarVarious::onEnter() left->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidpoint(Vector2(0.5f, 0.5f)); + left->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Vector2(1, 0)); + left->setBarChangeRate(Vec2(1, 0)); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction(RepeatForever::create(to->clone())); auto middle = ProgressTimer::create(Sprite::create(s_pathSister2)); middle->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidpoint(Vector2(0.5f, 0.5f)); + middle->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Vector2(1,1)); + middle->setBarChangeRate(Vec2(1,1)); addChild(middle); - middle->setPosition(Vector2(s.width/2, s.height/2)); + middle->setPosition(Vec2(s.width/2, s.height/2)); middle->runAction(RepeatForever::create(to->clone())); auto right = ProgressTimer::create(Sprite::create(s_pathSister2)); right->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidpoint(Vector2(0.5f, 0.5f)); + right->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Vector2(0, 1)); + right->setBarChangeRate(Vec2(0, 1)); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction(RepeatForever::create(to->clone())); } @@ -380,11 +380,11 @@ void SpriteProgressBarTintAndFade::onEnter() left->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidpoint(Vector2(0.5f, 0.5f)); + left->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Vector2(1, 0)); + left->setBarChangeRate(Vec2(1, 0)); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction(RepeatForever::create(to->clone())); left->runAction(RepeatForever::create(tint->clone())); @@ -393,11 +393,11 @@ void SpriteProgressBarTintAndFade::onEnter() auto middle = ProgressTimer::create(Sprite::create(s_pathSister2)); middle->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidpoint(Vector2(0.5f, 0.5f)); + middle->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Vector2(1, 1)); + middle->setBarChangeRate(Vec2(1, 1)); addChild(middle); - middle->setPosition(Vector2(s.width/2, s.height/2)); + middle->setPosition(Vec2(s.width/2, s.height/2)); middle->runAction(RepeatForever::create(to->clone())); middle->runAction(RepeatForever::create(fade->clone())); @@ -406,11 +406,11 @@ void SpriteProgressBarTintAndFade::onEnter() auto right = ProgressTimer::create(Sprite::create(s_pathSister2)); right->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidpoint(Vector2(0.5f, 0.5f)); + right->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Vector2(0, 1)); + right->setBarChangeRate(Vec2(0, 1)); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction(RepeatForever::create(to->clone())); right->runAction(RepeatForever::create(tint->clone())); right->runAction(RepeatForever::create(fade->clone())); @@ -441,31 +441,31 @@ void SpriteProgressWithSpriteFrame::onEnter() auto left = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_01.png")); left->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - left->setMidpoint(Vector2(0.5f, 0.5f)); + left->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - left->setBarChangeRate(Vector2(1, 0)); + left->setBarChangeRate(Vec2(1, 0)); addChild(left); - left->setPosition(Vector2(100, s.height/2)); + left->setPosition(Vec2(100, s.height/2)); left->runAction(RepeatForever::create(to->clone())); auto middle = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_02.png")); middle->setType(ProgressTimer::Type::BAR); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - middle->setMidpoint(Vector2(0.5f, 0.5f)); + middle->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - middle->setBarChangeRate(Vector2(1, 1)); + middle->setBarChangeRate(Vec2(1, 1)); addChild(middle); - middle->setPosition(Vector2(s.width/2, s.height/2)); + middle->setPosition(Vec2(s.width/2, s.height/2)); middle->runAction(RepeatForever::create(to->clone())); auto right = ProgressTimer::create(Sprite::createWithSpriteFrameName("grossini_dance_03.png")); right->setType(ProgressTimer::Type::RADIAL); // Setup for a bar starting from the bottom since the midpoint is 0 for the y - right->setMidpoint(Vector2(0.5f, 0.5f)); + right->setMidpoint(Vec2(0.5f, 0.5f)); // Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change - right->setBarChangeRate(Vector2(0, 1)); + right->setBarChangeRate(Vec2(0, 1)); addChild(right); - right->setPosition(Vector2(s.width-100, s.height/2)); + right->setPosition(Vec2(s.width-100, s.height/2)); right->runAction(RepeatForever::create(to->clone())); } diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index ad0cd4c39a..952404bddb 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -150,9 +150,9 @@ void ActionsDemo::onEnter() addChild(_tamara, 2); addChild(_kathia, 3); - _grossini->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/3)); - _tamara->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2/3)); - _kathia->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/2)); + _grossini->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/3)); + _tamara->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height*2/3)); + _kathia->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+VisibleRect::getVisibleRect().size.height/2)); } void ActionsDemo::onExit() @@ -202,19 +202,19 @@ void ActionsDemo::centerSprites(unsigned int numberOfSprites) { _tamara->setVisible(false); _kathia->setVisible(false); - _grossini->setPosition(Vector2(s.width/2, s.height/2)); + _grossini->setPosition(Vec2(s.width/2, s.height/2)); } else if( numberOfSprites == 2 ) { - _kathia->setPosition( Vector2(s.width/3, s.height/2)); - _tamara->setPosition( Vector2(2*s.width/3, s.height/2)); + _kathia->setPosition( Vec2(s.width/3, s.height/2)); + _tamara->setPosition( Vec2(2*s.width/3, s.height/2)); _grossini->setVisible(false); } else if( numberOfSprites == 3 ) { - _grossini->setPosition( Vector2(s.width/2, s.height/2)); - _tamara->setPosition( Vector2(s.width/4, s.height/2)); - _kathia->setPosition( Vector2(3 * s.width/4, s.height/2)); + _grossini->setPosition( Vec2(s.width/2, s.height/2)); + _tamara->setPosition( Vec2(s.width/4, s.height/2)); + _kathia->setPosition( Vec2(3 * s.width/4, s.height/2)); } } @@ -226,19 +226,19 @@ void ActionsDemo::alignSpritesLeft(unsigned int numberOfSprites) { _tamara->setVisible(false); _kathia->setVisible(false); - _grossini->setPosition(Vector2(60, s.height/2)); + _grossini->setPosition(Vec2(60, s.height/2)); } else if( numberOfSprites == 2 ) { - _kathia->setPosition( Vector2(60, s.height/3)); - _tamara->setPosition( Vector2(60, 2*s.height/3)); + _kathia->setPosition( Vec2(60, s.height/3)); + _tamara->setPosition( Vec2(60, 2*s.height/3)); _grossini->setVisible( false ); } else if( numberOfSprites == 3 ) { - _grossini->setPosition( Vector2(60, s.height/2)); - _tamara->setPosition( Vector2(60, 2*s.height/3)); - _kathia->setPosition( Vector2(60, s.height/3)); + _grossini->setPosition( Vec2(60, s.height/2)); + _tamara->setPosition( Vec2(60, 2*s.height/3)); + _kathia->setPosition( Vec2(60, s.height/3)); } } @@ -255,14 +255,14 @@ void ActionManual::onEnter() _tamara->setScaleX( 2.5f); _tamara->setScaleY( -1.0f); - _tamara->setPosition( Vector2(100,70) ); + _tamara->setPosition( Vec2(100,70) ); _tamara->setOpacity( 128); _grossini->setRotation( 120); - _grossini->setPosition( Vector2(s.width/2, s.height/2)); + _grossini->setPosition( Vec2(s.width/2, s.height/2)); _grossini->setColor( Color3B( 255,0,0)); - _kathia->setPosition( Vector2(s.width-100, s.height/2)); + _kathia->setPosition( Vec2(s.width-100, s.height/2)); _kathia->setColor( Color3B::BLUE); } @@ -284,13 +284,13 @@ void ActionMove::onEnter() auto s = Director::getInstance()->getWinSize(); - auto actionTo = MoveTo::create(2, Vector2(s.width-40, s.height-40)); - auto actionBy = MoveBy::create(2, Vector2(80,80)); + auto actionTo = MoveTo::create(2, Vec2(s.width-40, s.height-40)); + auto actionBy = MoveBy::create(2, Vec2(80,80)); auto actionByBack = actionBy->reverse(); _tamara->runAction( actionTo); _grossini->runAction( Sequence::create(actionBy, actionByBack, NULL)); - _kathia->runAction(MoveTo::create(1, Vector2(40,40))); + _kathia->runAction(MoveTo::create(1, Vec2(40,40))); } std::string ActionMove::subtitle() const @@ -392,14 +392,14 @@ void ActionRotationalSkewVSStandardSkew::onEnter() Size boxSize(100.0f, 100.0f); auto box = LayerColor::create(Color4B(255,255,0,255)); - box->setAnchorPoint(Vector2(0.5,0.5)); + box->setAnchorPoint(Vec2(0.5,0.5)); box->setContentSize( boxSize ); box->ignoreAnchorPointForPosition(false); - box->setPosition(Vector2(s.width/2, s.height - 100 - box->getContentSize().height/2)); + box->setPosition(Vec2(s.width/2, s.height - 100 - box->getContentSize().height/2)); this->addChild(box); auto label = Label::createWithTTF("Standard cocos2d Skew", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2(s.width/2, s.height - 100 + label->getContentSize().height)); + label->setPosition(Vec2(s.width/2, s.height - 100 + label->getContentSize().height)); this->addChild(label); auto actionTo = SkewBy::create(2, 360, 0); @@ -408,14 +408,14 @@ void ActionRotationalSkewVSStandardSkew::onEnter() box->runAction(Sequence::create(actionTo, actionToBack, NULL)); box = LayerColor::create(Color4B(255,255,0,255)); - box->setAnchorPoint(Vector2(0.5,0.5)); + box->setAnchorPoint(Vec2(0.5,0.5)); box->setContentSize(boxSize); box->ignoreAnchorPointForPosition(false); - box->setPosition(Vector2(s.width/2, s.height - 250 - box->getContentSize().height/2)); + box->setPosition(Vec2(s.width/2, s.height - 250 - box->getContentSize().height/2)); this->addChild(box); label = Label::createWithTTF("Rotational Skew", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2(s.width/2, s.height - 250 + label->getContentSize().height/2)); + label->setPosition(Vec2(s.width/2, s.height - 250 + label->getContentSize().height/2)); this->addChild(label); auto actionTo2 = RotateBy::create(2, 360, 0); auto actionToBack2 = RotateBy::create(2, -360, 0); @@ -438,22 +438,22 @@ void ActionSkewRotateScale::onEnter() Size boxSize(100.0f, 100.0f); auto box = LayerColor::create(Color4B(255, 255, 0, 255)); - box->setAnchorPoint(Vector2(0, 0)); - box->setPosition(Vector2(190, 110)); + box->setAnchorPoint(Vec2(0, 0)); + box->setPosition(Vec2(190, 110)); box->setContentSize(boxSize); static float markrside = 10.0f; auto uL = LayerColor::create(Color4B(255, 0, 0, 255)); box->addChild(uL); uL->setContentSize(Size(markrside, markrside)); - uL->setPosition(Vector2(0.f, boxSize.height - markrside)); - uL->setAnchorPoint(Vector2(0, 0)); + uL->setPosition(Vec2(0.f, boxSize.height - markrside)); + uL->setAnchorPoint(Vec2(0, 0)); auto uR = LayerColor::create(Color4B(0, 0, 255, 255)); box->addChild(uR); uR->setContentSize(Size(markrside, markrside)); - uR->setPosition(Vector2(boxSize.width - markrside, boxSize.height - markrside)); - uR->setAnchorPoint(Vector2(0, 0)); + uR->setPosition(Vec2(boxSize.width - markrside, boxSize.height - markrside)); + uR->setAnchorPoint(Vec2(0, 0)); addChild(box); auto actionTo = SkewTo::create(2, 0.f, 2.f); @@ -513,9 +513,9 @@ void ActionRotateBy3D::onEnter() centerSprites(3); - auto actionBy1 = RotateBy::create(4, Vector3(360, 0, 0)); - auto actionBy2 = RotateBy::create(4, Vector3(0, 360, 0)); - auto actionBy3 = RotateBy::create(4 ,Vector3(0, 0, 360)); + auto actionBy1 = RotateBy::create(4, Vec3(360, 0, 0)); + auto actionBy2 = RotateBy::create(4, Vec3(0, 360, 0)); + auto actionBy3 = RotateBy::create(4 ,Vec3(0, 0, 360)); _tamara->runAction( Sequence::create(actionBy1, actionBy1->reverse(), nullptr)); _grossini->runAction( Sequence::create(actionBy2, actionBy2->reverse(), nullptr)); @@ -538,9 +538,9 @@ void ActionJump::onEnter() centerSprites(3); - auto actionTo = JumpTo::create(2, Vector2(300,300), 50, 4); - auto actionBy = JumpBy::create(2, Vector2(300,0), 50, 4); - auto actionUp = JumpBy::create(2, Vector2(0,0), 80, 4); + auto actionTo = JumpTo::create(2, Vec2(300,300), 50, 4); + auto actionBy = JumpBy::create(2, Vec2(300,0), 50, 4); + auto actionUp = JumpBy::create(2, Vec2(0,0), 80, 4); auto actionByBack = actionBy->reverse(); _tamara->runAction( actionTo); @@ -572,9 +572,9 @@ void ActionBezier::onEnter() // sprite 1 ccBezierConfig bezier; - bezier.controlPoint_1 = Vector2(0, s.height/2); - bezier.controlPoint_2 = Vector2(300, -s.height/2); - bezier.endPosition = Vector2(300,100); + bezier.controlPoint_1 = Vec2(0, s.height/2); + bezier.controlPoint_2 = Vec2(300, -s.height/2); + bezier.endPosition = Vec2(300,100); auto bezierForward = BezierBy::create(3, bezier); auto bezierBack = bezierForward->reverse(); @@ -582,16 +582,16 @@ void ActionBezier::onEnter() // sprite 2 - _tamara->setPosition(Vector2(80,160)); + _tamara->setPosition(Vec2(80,160)); ccBezierConfig bezier2; - bezier2.controlPoint_1 = Vector2(100, s.height/2); - bezier2.controlPoint_2 = Vector2(200, -s.height/2); - bezier2.endPosition = Vector2(240,160); + bezier2.controlPoint_1 = Vec2(100, s.height/2); + bezier2.controlPoint_2 = Vec2(200, -s.height/2); + bezier2.endPosition = Vec2(240,160); auto bezierTo1 = BezierTo::create(2, bezier2); // sprite 3 - _kathia->setPosition(Vector2(400,160)); + _kathia->setPosition(Vec2(400,160)); auto bezierTo2 = BezierTo::create(2, bezier2); _grossini->runAction( rep); @@ -771,7 +771,7 @@ void ActionSequence::onEnter() alignSpritesLeft(1); auto action = Sequence::create( - MoveBy::create( 2, Vector2(240,0)), + MoveBy::create( 2, Vec2(240,0)), RotateBy::create( 2, 540), NULL); @@ -797,9 +797,9 @@ void ActionSequence2::onEnter() _grossini->setVisible(false); auto action = Sequence::create( - Place::create(Vector2(200,200)), + Place::create(Vec2(200,200)), Show::create(), - MoveBy::create(1, Vector2(100,0)), + MoveBy::create(1, Vec2(100,0)), CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback1,this)), CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback2,this,_grossini)), CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback3,this,_grossini,0xbebabeba)), @@ -812,7 +812,7 @@ void ActionSequence2::callback1() { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 1 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*1,s.height/2)); + label->setPosition(Vec2( s.width/4*1,s.height/2)); addChild(label); } @@ -821,7 +821,7 @@ void ActionSequence2::callback2(Node* sender) { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 2 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*2,s.height/2)); + label->setPosition(Vec2( s.width/4*2,s.height/2)); addChild(label); } @@ -830,7 +830,7 @@ void ActionSequence2::callback3(Node* sender, long data) { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 3 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*3,s.height/2)); + label->setPosition(Vec2( s.width/4*3,s.height/2)); addChild(label); } @@ -852,7 +852,7 @@ void ActionCallFuncN::onEnter() centerSprites(1); auto action = Sequence::create( - MoveBy::create(2.0f, Vector2(150,0)), + MoveBy::create(2.0f, Vec2(150,0)), CallFuncN::create( CC_CALLBACK_1(ActionCallFuncN::callback, this)), NULL); @@ -871,7 +871,7 @@ std::string ActionCallFuncN::subtitle() const void ActionCallFuncN::callback(Node* sender ) { - auto a = JumpBy::create(5, Vector2(0,0), 100, 5); + auto a = JumpBy::create(5, Vec2(0,0), 100, 5); sender->runAction(a); } //------------------------------------------------------------------ @@ -887,7 +887,7 @@ void ActionCallFuncND::onEnter() centerSprites(1); auto action = Sequence::create( - MoveBy::create(2.0f, Vector2(200,0)), + MoveBy::create(2.0f, Vec2(200,0)), CallFuncN::create( CC_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), NULL); @@ -922,7 +922,7 @@ void ActionCallFuncO::onEnter() centerSprites(1); auto action = Sequence::create( - MoveBy::create(2.0f, Vector2(200,0)), + MoveBy::create(2.0f, Vec2(200,0)), CallFunc::create( CC_CALLBACK_0(ActionCallFuncO::callback, this, _grossini, true)), NULL); _grossini->runAction(action); @@ -956,14 +956,14 @@ void ActionCallFunction::onEnter() auto action1 = Sequence::create( - MoveBy::create(2, Vector2(200,0)), + MoveBy::create(2, Vec2(200,0)), CallFunc::create( std::bind(&ActionCallFunction::callback1, this) ), CallFunc::create( // lambda [&](){ auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("called:lambda callback", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*1,s.height/2-40)); + label->setPosition(Vec2( s.width/4*1,s.height/2-40)); this->addChild(label); } ), NULL); @@ -990,7 +990,7 @@ void ActionCallFunction::callback1() { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 1 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*1,s.height/2)); + label->setPosition(Vec2( s.width/4*1,s.height/2)); addChild(label); } @@ -999,7 +999,7 @@ void ActionCallFunction::callback2(Node* sender) { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 2 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*2,s.height/2)); + label->setPosition(Vec2( s.width/4*2,s.height/2)); addChild(label); @@ -1010,7 +1010,7 @@ void ActionCallFunction::callback3(Node* sender, long data) { auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("callback 3 called", "fonts/Marker Felt.ttf", 16.0f); - label->setPosition(Vector2( s.width/4*3,s.height/2)); + label->setPosition(Vec2( s.width/4*3,s.height/2)); addChild(label); CCLOG("target is: %p, data is: %ld", sender, data); @@ -1033,7 +1033,7 @@ void ActionSpawn::onEnter() alignSpritesLeft(1); auto action = Spawn::create( - JumpBy::create(2, Vector2(300,0), 50, 4), + JumpBy::create(2, Vec2(300,0), 50, 4), RotateBy::create( 2, 720), NULL); @@ -1144,7 +1144,7 @@ void ActionReverse::onEnter() alignSpritesLeft(1); - auto jump = JumpBy::create(2, Vector2(300,0), 50, 4); + auto jump = JumpBy::create(2, Vec2(300,0), 50, 4); auto action = Sequence::create( jump, jump->reverse(), NULL); _grossini->runAction(action); @@ -1167,7 +1167,7 @@ void ActionDelayTime::onEnter() alignSpritesLeft(1); - auto move = MoveBy::create(1, Vector2(150,0)); + auto move = MoveBy::create(1, Vec2(150,0)); auto action = Sequence::create( move, DelayTime::create(2), move, NULL); _grossini->runAction(action); @@ -1190,8 +1190,8 @@ void ActionReverseSequence::onEnter() alignSpritesLeft(1); - auto move1 = MoveBy::create(1, Vector2(250,0)); - auto move2 = MoveBy::create(1, Vector2(0,50)); + auto move1 = MoveBy::create(1, Vec2(250,0)); + auto move2 = MoveBy::create(1, Vec2(0,50)); auto seq = Sequence::create( move1, move2, move1->reverse(), NULL); auto action = Sequence::create( seq, seq->reverse(), NULL); @@ -1218,8 +1218,8 @@ void ActionReverseSequence2::onEnter() // Test: // Sequence should work both with IntervalAction and InstantActions - auto move1 = MoveBy::create(1, Vector2(250,0)); - auto move2 = MoveBy::create(1, Vector2(0,50)); + auto move1 = MoveBy::create(1, Vec2(250,0)); + auto move2 = MoveBy::create(1, Vec2(0,50)); auto tog1 = ToggleVisibility::create(); auto tog2 = ToggleVisibility::create(); auto seq = Sequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL); @@ -1230,8 +1230,8 @@ void ActionReverseSequence2::onEnter() // Also test that the reverse of Hide is Show, and vice-versa _kathia->runAction(action); - auto move_tamara = MoveBy::create(1, Vector2(100,0)); - auto move_tamara2 = MoveBy::create(1, Vector2(50,0)); + auto move_tamara = MoveBy::create(1, Vec2(100,0)); + auto move_tamara2 = MoveBy::create(1, Vec2(50,0)); auto hide = Hide::create(); auto seq_tamara = Sequence::create( move_tamara, hide, move_tamara2, NULL); auto seq_back = seq_tamara->reverse(); @@ -1254,9 +1254,9 @@ void ActionRepeat::onEnter() alignSpritesLeft(2); - auto a1 = MoveBy::create(1, Vector2(150,0)); + auto a1 = MoveBy::create(1, Vec2(150,0)); auto action1 = Repeat::create( - Sequence::create( Place::create(Vector2(60,60)), a1, NULL) , + Sequence::create( Place::create(Vec2(60,60)), a1, NULL) , 3); auto action2 = RepeatForever::create( Sequence::create(a1->clone(), a1->reverse(), NULL) @@ -1305,7 +1305,7 @@ void ActionOrbit::onEnter() _tamara->runAction(RepeatForever::create(action2)); _grossini->runAction(RepeatForever::create(action3)); - auto move = MoveBy::create(3, Vector2(100,-100)); + auto move = MoveBy::create(3, Vec2(100,-100)); auto move_back = move->reverse(); auto seq = Sequence::create(move, move_back, NULL); auto rfe = RepeatForever::create(seq); @@ -1338,8 +1338,8 @@ void ActionFollow::onEnter() centerSprites(1); auto s = Director::getInstance()->getWinSize(); - _grossini->setPosition(Vector2(-200, s.height / 2)); - auto move = MoveBy::create(2, Vector2(s.width * 3, 0)); + _grossini->setPosition(Vec2(-200, s.height / 2)); + auto move = MoveBy::create(2, Vec2(s.width * 3, 0)); auto move_back = move->reverse(); auto seq = Sequence::create(move, move_back, NULL); auto rep = RepeatForever::create(seq); @@ -1349,7 +1349,7 @@ void ActionFollow::onEnter() this->runAction(Follow::create(_grossini, Rect(0, 0, s.width * 2 - 100, s.height))); } -void ActionFollow::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ActionFollow::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(ActionFollow::onDraw, this, transform, transformUpdated); @@ -1357,7 +1357,7 @@ void ActionFollow::draw(Renderer *renderer, const Matrix &transform, bool transf renderer->addCommand(&_customCommand); } -void ActionFollow::onDraw(const Matrix &transform, bool transformUpdated) +void ActionFollow::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1369,7 +1369,7 @@ void ActionFollow::onDraw(const Matrix &transform, bool transformUpdated) float x = winSize.width*2 - 100; float y = winSize.height; - Vector2 vertices[] = { Vector2(5,5), Vector2(x-5,5), Vector2(x-5,y-5), Vector2(5,y-5) }; + Vec2 vertices[] = { Vec2(5,5), Vec2(x-5,5), Vec2(x-5,y-5), Vec2(5,y-5) }; DrawPrimitives::drawPoly(vertices, 4, true); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -1386,7 +1386,7 @@ void ActionTargeted::onEnter() centerSprites(2); - auto jump1 = JumpBy::create(2,Vector2::ZERO,100,3); + auto jump1 = JumpBy::create(2,Vec2::ZERO,100,3); auto jump2 = jump1->clone(); auto rot1 = RotateBy::create(1, 360); auto rot2 = rot1->clone(); @@ -1417,7 +1417,7 @@ void ActionTargetedReverse::onEnter() centerSprites(2); - auto jump1 = JumpBy::create(2,Vector2::ZERO,100,3); + auto jump1 = JumpBy::create(2,Vec2::ZERO,100,3); auto jump2 = jump1->clone(); auto rot1 = RotateBy::create(1, 360); auto rot2 = rot1->clone(); @@ -1454,10 +1454,10 @@ void ActionStacked::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); - this->addNewSpriteWithCoords(Vector2(s.width/2, s.height/2)); + this->addNewSpriteWithCoords(Vec2(s.width/2, s.height/2)); } -void ActionStacked::addNewSpriteWithCoords(Vector2 p) +void ActionStacked::addNewSpriteWithCoords(Vec2 p) { int idx = CCRANDOM_0_1() * 1400 / 100; int x = (idx%5) * 85; @@ -1503,11 +1503,11 @@ void ActionMoveStacked::runActionsInSprite(Sprite *sprite) sprite->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,10)), - MoveBy::create(0.05f, Vector2(-10,-10)), + MoveBy::create(0.05f, Vec2(10,10)), + MoveBy::create(0.05f, Vec2(-10,-10)), NULL))); - auto action = MoveBy::create(2.0f, Vector2(400,0)); + auto action = MoveBy::create(2.0f, Vec2(400,0)); auto action_back = action->reverse(); sprite->runAction( @@ -1529,11 +1529,11 @@ void ActionMoveJumpStacked::runActionsInSprite(Sprite *sprite) sprite->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,2)), - MoveBy::create(0.05f, Vector2(-10,-2)), + MoveBy::create(0.05f, Vec2(10,2)), + MoveBy::create(0.05f, Vec2(-10,-2)), NULL))); - auto jump = JumpBy::create(2.0f, Vector2(400,0), 100, 5); + auto jump = JumpBy::create(2.0f, Vec2(400,0), 100, 5); auto jump_back = jump->reverse(); sprite->runAction( @@ -1555,9 +1555,9 @@ void ActionMoveBezierStacked::runActionsInSprite(Sprite *sprite) // sprite 1 ccBezierConfig bezier; - bezier.controlPoint_1 = Vector2(0, s.height/2); - bezier.controlPoint_2 = Vector2(300, -s.height/2); - bezier.endPosition = Vector2(300,100); + bezier.controlPoint_1 = Vec2(0, s.height/2); + bezier.controlPoint_2 = Vec2(300, -s.height/2); + bezier.endPosition = Vec2(300,100); auto bezierForward = BezierBy::create(3, bezier); auto bezierBack = bezierForward->reverse(); @@ -1568,8 +1568,8 @@ void ActionMoveBezierStacked::runActionsInSprite(Sprite *sprite) sprite->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,0)), - MoveBy::create(0.05f, Vector2(-10,0)), + MoveBy::create(0.05f, Vec2(10,0)), + MoveBy::create(0.05f, Vec2(-10,0)), NULL))); } @@ -1596,17 +1596,17 @@ void ActionCatmullRomStacked::onEnter() // is relative to the Catmull Rom curve, it is better to start with (0,0). // - _tamara->setPosition(Vector2(50,50)); + _tamara->setPosition(Vec2(50,50)); auto array = PointArray::create(20); - array->addControlPoint(Vector2(0,0)); - array->addControlPoint(Vector2(80,80)); - array->addControlPoint(Vector2(s.width-80,80)); - array->addControlPoint(Vector2(s.width-80,s.height-80)); - array->addControlPoint(Vector2(80,s.height-80)); - array->addControlPoint(Vector2(80,80)); - array->addControlPoint(Vector2(s.width/2, s.height/2)); + array->addControlPoint(Vec2(0,0)); + array->addControlPoint(Vec2(80,80)); + array->addControlPoint(Vec2(s.width-80,80)); + array->addControlPoint(Vec2(s.width-80,s.height-80)); + array->addControlPoint(Vec2(80,s.height-80)); + array->addControlPoint(Vec2(80,80)); + array->addControlPoint(Vec2(s.width/2, s.height/2)); auto action = CatmullRomBy::create(3, array); auto reverse = action->reverse(); @@ -1618,8 +1618,8 @@ void ActionCatmullRomStacked::onEnter() _tamara->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,0)), - MoveBy::create(0.05f, Vector2(-10,0)), + MoveBy::create(0.05f, Vec2(10,0)), + MoveBy::create(0.05f, Vec2(-10,0)), NULL))); // @@ -1631,11 +1631,11 @@ void ActionCatmullRomStacked::onEnter() auto array2 = PointArray::create(20); - array2->addControlPoint(Vector2(s.width/2, 30)); - array2->addControlPoint(Vector2(s.width-80,30)); - array2->addControlPoint(Vector2(s.width-80,s.height-80)); - array2->addControlPoint(Vector2(s.width/2,s.height-80)); - array2->addControlPoint(Vector2(s.width/2, 30)); + array2->addControlPoint(Vec2(s.width/2, 30)); + array2->addControlPoint(Vec2(s.width-80,30)); + array2->addControlPoint(Vec2(s.width-80,s.height-80)); + array2->addControlPoint(Vec2(s.width/2,s.height-80)); + array2->addControlPoint(Vec2(s.width/2, 30)); auto action2 = CatmullRomTo::create(3, array2); auto reverse2 = action2->reverse(); @@ -1647,8 +1647,8 @@ void ActionCatmullRomStacked::onEnter() _kathia->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,0)), - MoveBy::create(0.05f, Vector2(-10,0)), + MoveBy::create(0.05f, Vec2(10,0)), + MoveBy::create(0.05f, Vec2(-10,0)), NULL))); array->retain(); @@ -1663,7 +1663,7 @@ ActionCatmullRomStacked::~ActionCatmullRomStacked() CC_SAFE_RELEASE(_array2); } -void ActionCatmullRomStacked::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ActionCatmullRomStacked::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { ActionsDemo::draw(renderer, transform, transformUpdated); @@ -1672,10 +1672,10 @@ void ActionCatmullRomStacked::draw(Renderer *renderer, const Matrix &transform, CCASSERT(nullptr != director, "Director is null when seting matrix stack"); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - Matrix translation; + Mat4 translation; //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(50, 50, 0, &translation); + Mat4::createTranslation(50, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV1 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -1687,12 +1687,12 @@ void ActionCatmullRomStacked::draw(Renderer *renderer, const Matrix &transform, renderer->addCommand(&_customCommand); } -void ActionCatmullRomStacked::onDraw(const Matrix &transform, bool transformUpdated) +void ActionCatmullRomStacked::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldMat; + Mat4 oldMat; oldMat = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewMV1); DrawPrimitives::drawCatmullRom(_array1,50); @@ -1724,11 +1724,11 @@ void ActionCardinalSplineStacked::onEnter() auto array = PointArray::create(20); - array->addControlPoint(Vector2(0, 0)); - array->addControlPoint(Vector2(s.width/2-30,0)); - array->addControlPoint(Vector2(s.width/2-30,s.height-80)); - array->addControlPoint(Vector2(0, s.height-80)); - array->addControlPoint(Vector2(0, 0)); + array->addControlPoint(Vec2(0, 0)); + array->addControlPoint(Vec2(s.width/2-30,0)); + array->addControlPoint(Vec2(s.width/2-30,s.height-80)); + array->addControlPoint(Vec2(0, s.height-80)); + array->addControlPoint(Vec2(0, 0)); // @@ -1742,14 +1742,14 @@ void ActionCardinalSplineStacked::onEnter() auto seq = Sequence::create(action, reverse, NULL); - _tamara->setPosition(Vector2(50,50)); + _tamara->setPosition(Vec2(50,50)); _tamara->runAction(seq); _tamara->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,0)), - MoveBy::create(0.05f, Vector2(-10,0)), + MoveBy::create(0.05f, Vec2(10,0)), + MoveBy::create(0.05f, Vec2(-10,0)), NULL))); // @@ -1763,15 +1763,15 @@ void ActionCardinalSplineStacked::onEnter() auto seq2 = Sequence::create(action2, reverse2, NULL); - _kathia->setPosition(Vector2(s.width/2,50)); + _kathia->setPosition(Vec2(s.width/2,50)); _kathia->runAction(seq2); _kathia->runAction( RepeatForever::create( Sequence::create( - MoveBy::create(0.05f, Vector2(10,0)), - MoveBy::create(0.05f, Vector2(-10,0)), + MoveBy::create(0.05f, Vec2(10,0)), + MoveBy::create(0.05f, Vec2(-10,0)), NULL))); array->retain(); @@ -1783,7 +1783,7 @@ ActionCardinalSplineStacked::~ActionCardinalSplineStacked() CC_SAFE_RELEASE(_array); } -void ActionCardinalSplineStacked::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ActionCardinalSplineStacked::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { ActionsDemo::draw(renderer, transform, transformUpdated); @@ -1792,10 +1792,10 @@ void ActionCardinalSplineStacked::draw(Renderer *renderer, const Matrix &transfo CCASSERT(nullptr != director, "Director is null when seting matrix stack"); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - Matrix translation; + Mat4 translation; //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(50, 50, 0, &translation); + Mat4::createTranslation(50, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV1 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -1806,7 +1806,7 @@ void ActionCardinalSplineStacked::draw(Renderer *renderer, const Matrix &transfo director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(s.width/2, 50, 0, &translation); + Mat4::createTranslation(s.width/2, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV2 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -1817,12 +1817,12 @@ void ActionCardinalSplineStacked::draw(Renderer *renderer, const Matrix &transfo renderer->addCommand(&_customCommand); } -void ActionCardinalSplineStacked::onDraw(const Matrix &transform, bool transformUpdated) +void ActionCardinalSplineStacked::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldMat; + Mat4 oldMat; oldMat = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewMV1); DrawPrimitives::drawCardinalSpline(_array, 0, 100); @@ -1874,7 +1874,7 @@ void Issue1305::onExit() void Issue1305::addSprite(float dt) { - _spriteTmp->setPosition(Vector2(250,250)); + _spriteTmp->setPosition(Vec2(250,250)); addChild(_spriteTmp); } @@ -1894,34 +1894,34 @@ void Issue1305_2::onEnter() centerSprites(0); auto spr = Sprite::create("Images/grossini.png"); - spr->setPosition(Vector2(200,200)); + spr->setPosition(Vec2(200,200)); addChild(spr); - auto act1 = MoveBy::create(2 ,Vector2(0, 100)); + auto act1 = MoveBy::create(2 ,Vec2(0, 100)); /* c++ can't support block, so we use CallFuncN instead. id act2 = [CallBlock actionWithBlock:^{ NSLog(@"1st block"); }); - id act3 = [MoveBy create:2, Vector2(0, -100)); + id act3 = [MoveBy create:2, Vec2(0, -100)); id act4 = [CallBlock actionWithBlock:^{ NSLog(@"2nd block"); }); - id act5 = [MoveBy create:2, Vector2(100, -100)); + id act5 = [MoveBy create:2, Vec2(100, -100)); id act6 = [CallBlock actionWithBlock:^{ NSLog(@"3rd block"); }); - id act7 = [MoveBy create:2, Vector2(-100, 0)); + id act7 = [MoveBy create:2, Vec2(-100, 0)); id act8 = [CallBlock actionWithBlock:^{ NSLog(@"4th block"); }); */ auto act2 = CallFunc::create( std::bind( &Issue1305_2::printLog1, this)); - auto act3 = MoveBy::create(2, Vector2(0, -100)); + auto act3 = MoveBy::create(2, Vec2(0, -100)); auto act4 = CallFunc::create( std::bind( &Issue1305_2::printLog2, this)); - auto act5 = MoveBy::create(2, Vector2(100, -100)); + auto act5 = MoveBy::create(2, Vec2(100, -100)); auto act6 = CallFunc::create( std::bind( &Issue1305_2::printLog3, this)); - auto act7 = MoveBy::create(2, Vector2(-100, 0)); + auto act7 = MoveBy::create(2, Vec2(-100, 0)); auto act8 = CallFunc::create( std::bind( &Issue1305_2::printLog4, this)); auto actF = Sequence::create(act1, act2, act3, act4, act5, act6, act7, act8, NULL); @@ -1967,10 +1967,10 @@ void Issue1288::onEnter() centerSprites(0); auto spr = Sprite::create("Images/grossini.png"); - spr->setPosition(Vector2(100, 100)); + spr->setPosition(Vec2(100, 100)); addChild(spr); - auto act1 = MoveBy::create(0.5, Vector2(100, 0)); + auto act1 = MoveBy::create(0.5, Vec2(100, 0)); auto act2 = act1->reverse(); auto act3 = Sequence::create(act1, act2, NULL); auto act4 = Repeat::create(act3, 2); @@ -1994,10 +1994,10 @@ void Issue1288_2::onEnter() centerSprites(0); auto spr = Sprite::create("Images/grossini.png"); - spr->setPosition(Vector2(100, 100)); + spr->setPosition(Vec2(100, 100)); addChild(spr); - auto act1 = MoveBy::create(0.5, Vector2(100, 0)); + auto act1 = MoveBy::create(0.5, Vec2(100, 0)); spr->runAction(Repeat::create(act1, 1)); } @@ -2018,7 +2018,7 @@ void Issue1327::onEnter() centerSprites(0); auto spr = Sprite::create("Images/grossini.png"); - spr->setPosition(Vector2(100, 100)); + spr->setPosition(Vec2(100, 100)); addChild(spr); auto act1 = CallFunc::create( std::bind(&Issue1327::logSprRotation, this, spr)); @@ -2111,17 +2111,17 @@ void ActionCatmullRom::onEnter() // is relative to the Catmull Rom curve, it is better to start with (0,0). // - _tamara->setPosition(Vector2(50, 50)); + _tamara->setPosition(Vec2(50, 50)); auto array = PointArray::create(20); - array->addControlPoint(Vector2(0, 0)); - array->addControlPoint(Vector2(80, 80)); - array->addControlPoint(Vector2(s.width - 80, 80)); - array->addControlPoint(Vector2(s.width - 80, s.height - 80)); - array->addControlPoint(Vector2(80, s.height - 80)); - array->addControlPoint(Vector2(80, 80)); - array->addControlPoint(Vector2(s.width / 2, s.height / 2)); + array->addControlPoint(Vec2(0, 0)); + array->addControlPoint(Vec2(80, 80)); + array->addControlPoint(Vec2(s.width - 80, 80)); + array->addControlPoint(Vec2(s.width - 80, s.height - 80)); + array->addControlPoint(Vec2(80, s.height - 80)); + array->addControlPoint(Vec2(80, 80)); + array->addControlPoint(Vec2(s.width / 2, s.height / 2)); auto action = CatmullRomBy::create(3, array); auto reverse = action->reverse(); @@ -2140,11 +2140,11 @@ void ActionCatmullRom::onEnter() auto array2 = PointArray::create(20); - array2->addControlPoint(Vector2(s.width / 2, 30)); - array2->addControlPoint(Vector2(s.width -80, 30)); - array2->addControlPoint(Vector2(s.width - 80, s.height - 80)); - array2->addControlPoint(Vector2(s.width / 2, s.height - 80)); - array2->addControlPoint(Vector2(s.width / 2, 30)); + array2->addControlPoint(Vec2(s.width / 2, 30)); + array2->addControlPoint(Vec2(s.width -80, 30)); + array2->addControlPoint(Vec2(s.width - 80, s.height - 80)); + array2->addControlPoint(Vec2(s.width / 2, s.height - 80)); + array2->addControlPoint(Vec2(s.width / 2, 30)); auto action2 = CatmullRomTo::create(3, array2); auto reverse2 = action2->reverse(); @@ -2165,7 +2165,7 @@ ActionCatmullRom::~ActionCatmullRom() _array2->release(); } -void ActionCatmullRom::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ActionCatmullRom::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { ActionsDemo::draw(renderer, transform, transformUpdated); @@ -2174,10 +2174,10 @@ void ActionCatmullRom::draw(Renderer *renderer, const Matrix &transform, bool tr CCASSERT(nullptr != director, "Director is null when seting matrix stack"); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - Matrix translation; + Mat4 translation; //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(50, 50, 0, &translation); + Mat4::createTranslation(50, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV1 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -2190,12 +2190,12 @@ void ActionCatmullRom::draw(Renderer *renderer, const Matrix &transform, bool tr } -void ActionCatmullRom::onDraw(const Matrix &transform, bool transformUpdated) +void ActionCatmullRom::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldMat; + Mat4 oldMat; oldMat = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewMV1); DrawPrimitives::drawCatmullRom(_array1, 50); @@ -2227,11 +2227,11 @@ void ActionCardinalSpline::onEnter() auto array = PointArray::create(20); - array->addControlPoint(Vector2(0, 0)); - array->addControlPoint(Vector2(s.width/2-30, 0)); - array->addControlPoint(Vector2(s.width/2-30, s.height-80)); - array->addControlPoint(Vector2(0, s.height-80)); - array->addControlPoint(Vector2(0, 0)); + array->addControlPoint(Vec2(0, 0)); + array->addControlPoint(Vec2(s.width/2-30, 0)); + array->addControlPoint(Vec2(s.width/2-30, s.height-80)); + array->addControlPoint(Vec2(0, s.height-80)); + array->addControlPoint(Vec2(0, 0)); // // sprite 1 (By) @@ -2244,7 +2244,7 @@ void ActionCardinalSpline::onEnter() auto seq = Sequence::create(action, reverse, NULL); - _tamara->setPosition(Vector2(50, 50)); + _tamara->setPosition(Vec2(50, 50)); _tamara->runAction(seq); // @@ -2258,7 +2258,7 @@ void ActionCardinalSpline::onEnter() auto seq2 = Sequence::create(action2, reverse2, NULL); - _kathia->setPosition(Vector2(s.width/2, 50)); + _kathia->setPosition(Vec2(s.width/2, 50)); _kathia->runAction(seq2); _array = array; @@ -2270,7 +2270,7 @@ ActionCardinalSpline::~ActionCardinalSpline() _array->release(); } -void ActionCardinalSpline::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ActionCardinalSpline::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { ActionsDemo::draw(renderer, transform, transformUpdated); @@ -2279,10 +2279,10 @@ void ActionCardinalSpline::draw(Renderer *renderer, const Matrix &transform, boo CCASSERT(nullptr != director, "Director is null when seting matrix stack"); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - Matrix translation; + Mat4 translation; //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(50, 50, 0, &translation); + Mat4::createTranslation(50, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV1 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -2292,7 +2292,7 @@ void ActionCardinalSpline::draw(Renderer *renderer, const Matrix &transform, boo director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); //Create a rotation matrix using the axis and the angle - Matrix::createTranslation(s.width/2, 50, 0, &translation); + Mat4::createTranslation(s.width/2, 50, 0, &translation); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, translation); _modelViewMV2 = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); @@ -2302,12 +2302,12 @@ void ActionCardinalSpline::draw(Renderer *renderer, const Matrix &transform, boo renderer->addCommand(&_customCommand); } -void ActionCardinalSpline::onDraw(const Matrix &transform, bool transformUpdated) +void ActionCardinalSpline::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldMat; + Mat4 oldMat; oldMat = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewMV1); DrawPrimitives::drawCardinalSpline(_array, 0, 100); @@ -2391,7 +2391,7 @@ void ActionRemoveSelf::onEnter() alignSpritesLeft(1); auto action = Sequence::create( - MoveBy::create( 2, Vector2(240,0)), + MoveBy::create( 2, Vec2(240,0)), RotateBy::create( 2, 540), ScaleTo::create(1,0.1f), RemoveSelf::create(), diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h index 9b6a77e9be..7aa1de92ca 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.h @@ -379,11 +379,11 @@ public: CREATE_FUNC(ActionFollow); virtual void onEnter() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string subtitle() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _customCommand; }; @@ -416,7 +416,7 @@ public: virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void addNewSpriteWithCoords(Vector2 p); + virtual void addNewSpriteWithCoords(Vec2 p); virtual void runActionsInSprite(Sprite* sprite); void onTouchesEnded(const std::vector& touches, Event* event); }; @@ -454,17 +454,17 @@ public: CREATE_FUNC(ActionCatmullRomStacked); virtual ~ActionCatmullRomStacked(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); //cached data and callback - Matrix _modelViewMV1; - Matrix _modelViewMV2; + Mat4 _modelViewMV1; + Mat4 _modelViewMV2; PointArray* _array1; PointArray* _array2; CustomCommand _customCommand; @@ -476,16 +476,16 @@ public: CREATE_FUNC(ActionCardinalSplineStacked); virtual ~ActionCardinalSplineStacked(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated); virtual void onEnter() override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); - Matrix _modelViewMV1; - Matrix _modelViewMV2; + Mat4 _modelViewMV1; + Mat4 _modelViewMV2; CustomCommand _customCommand; PointArray* _array; }; @@ -572,15 +572,15 @@ public: ~ActionCatmullRom(); virtual void onEnter() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string subtitle() const override; virtual std::string title() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); - Matrix _modelViewMV1; - Matrix _modelViewMV2; + Mat4 _modelViewMV1; + Mat4 _modelViewMV2; CustomCommand _customCommand; PointArray *_array1; PointArray *_array2; @@ -594,16 +594,16 @@ public: ~ActionCardinalSpline(); virtual void onEnter() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string subtitle() const override; virtual std::string title() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); PointArray *_array; - Matrix _modelViewMV1; - Matrix _modelViewMV2; + Mat4 _modelViewMV1; + Mat4 _modelViewMV2; CustomCommand _customCommand; }; diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index 10b59ed403..75c4bc275a 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -40,7 +40,7 @@ void BaseTest::onEnter() TTFConfig ttfConfig("fonts/arial.ttf", 32); auto label = Label::createWithTTF(ttfConfig,pTitle); addChild(label, 9999); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 30) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 30) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) @@ -49,7 +49,7 @@ void BaseTest::onEnter() ttfConfig.fontSize = 16; auto l = Label::createWithTTF(ttfConfig,strSubtitle.c_str()); addChild(l, 9999); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 60) ); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } // add menu @@ -60,10 +60,10 @@ void BaseTest::onEnter() auto menu = Menu::create(item1, item2, item3, NULL); - menu->setPosition(Vector2::ZERO); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + menu->setPosition(Vec2::ZERO); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 9999); } diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index 44cb115fd5..dafd39c8d4 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -46,7 +46,7 @@ Box2DTestLayer::Box2DTestLayer() auto label = Label::createWithTTF("Tap screen", "fonts/Marker Felt.ttf", 32.0f); addChild(label, 0); label->setColor(Color3B(0,0,255)); - label->setPosition(Vector2( VisibleRect::center().x, VisibleRect::top().y-50)); + label->setPosition(Vec2( VisibleRect::center().x, VisibleRect::top().y-50)); scheduleUpdate(); #else @@ -54,7 +54,7 @@ Box2DTestLayer::Box2DTestLayer() "fonts/arial.ttf", 18); auto size = Director::getInstance()->getWinSize(); - label->setPosition(Vector2(size.width/2, size.height/2)); + label->setPosition(Vec2(size.width/2, size.height/2)); addChild(label); #endif @@ -132,12 +132,12 @@ void Box2DTestLayer::createResetButton() auto menu = Menu::create(reset, NULL); - menu->setPosition(Vector2(VisibleRect::bottom().x, VisibleRect::bottom().y + 30)); + menu->setPosition(Vec2(VisibleRect::bottom().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); } -void Box2DTestLayer::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Box2DTestLayer::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { // // IMPORTANT: @@ -168,7 +168,7 @@ void Box2DTestLayer::onDraw() Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); - Matrix oldMV; + Mat4 oldMV; oldMV = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewMV); world->DrawDebugData(); @@ -176,7 +176,7 @@ void Box2DTestLayer::onDraw() } #endif -void Box2DTestLayer::addNewSpriteAtPosition(Vector2 p) +void Box2DTestLayer::addNewSpriteAtPosition(Vec2 p) { CCLOG("Add sprite %0.2f x %02.f",p.x,p.y); @@ -210,7 +210,7 @@ void Box2DTestLayer::addNewSpriteAtPosition(Vector2 p) parent->addChild(sprite); sprite->setB2Body(body); sprite->setPTMRatio(PTM_RATIO); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); #endif } diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h index d64d2096aa..1109577a04 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.h @@ -17,15 +17,15 @@ public: void initPhysics(); void createResetButton(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; - void addNewSpriteAtPosition(Vector2 p); + void addNewSpriteAtPosition(Vec2 p); void update(float dt); void onTouchesEnded(const std::vector& touches, Event* event); #if CC_ENABLE_BOX2D_INTEGRATION protected: - Matrix _modelViewMV; + Mat4 _modelViewMV; void onDraw(); CustomCommand _customCommand; #endif diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp index b27a9996d8..28e0540835 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp @@ -49,7 +49,7 @@ MenuLayer* MenuLayer::menuWithEntryID(int entryId) bool MenuLayer::initWithEntryID(int entryId) { auto director = Director::getInstance(); - Vector2 visibleOrigin = director->getVisibleOrigin(); + Vec2 visibleOrigin = director->getVisibleOrigin(); Size visibleSize = director->getVisibleSize(); m_entryID = entryId; @@ -57,11 +57,11 @@ bool MenuLayer::initWithEntryID(int entryId) Box2DView* view = Box2DView::viewWithEntryID( entryId ); addChild(view, 0, kTagBox2DNode); view->setScale(15); - view->setAnchorPoint( Vector2(0,0) ); - view->setPosition( Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/3) ); + view->setAnchorPoint( Vec2(0,0) ); + view->setPosition( Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/3) ); auto label = Label::createWithTTF(view->title().c_str(), "fonts/arial.ttf", 28); addChild(label, 1); - label->setPosition( Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height-50) ); + label->setPosition( Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height-50) ); auto item1 = MenuItemImage::create("Images/b1.png", "Images/b2.png", CC_CALLBACK_1(MenuLayer::backCallback, this) ); auto item2 = MenuItemImage::create("Images/r1.png","Images/r2.png", CC_CALLBACK_1( MenuLayer::restartCallback, this) ); @@ -69,10 +69,10 @@ bool MenuLayer::initWithEntryID(int entryId) auto menu = Menu::create(item1, item2, item3, NULL); - menu->setPosition( Vector2::ZERO ); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + menu->setPosition( Vec2::ZERO ); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); @@ -202,7 +202,7 @@ std::string Box2DView::title() const return std::string(m_entry->name); } -void Box2DView::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Box2DView::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Layer::draw(renderer, transform, transformUpdated); @@ -211,7 +211,7 @@ void Box2DView::draw(Renderer *renderer, const Matrix &transform, bool transform renderer->addCommand(&_customCmd); } -void Box2DView::onDraw(const Matrix &transform, bool transformUpdated) +void Box2DView::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.h b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.h index 8c1b4470ce..23446adbc9 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.h +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.h @@ -42,7 +42,7 @@ public: bool initWithEntryID(int entryId); std::string title() const; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; // virtual void registerWithTouchDispatcher(); bool onTouchBegan(Touch* touch, Event* event); @@ -55,7 +55,7 @@ public: static Box2DView* viewWithEntryID(int entryId); protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _customCmd; }; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp index f12eba9f68..2a6ef994e9 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp @@ -29,25 +29,25 @@ bool Bug1159Layer::init() addChild(background); auto sprite_a = LayerColor::create(Color4B(255, 0, 0, 255), 700, 700); - sprite_a->setAnchorPoint(Vector2(0.5f, 0.5f)); + sprite_a->setAnchorPoint(Vec2(0.5f, 0.5f)); sprite_a->ignoreAnchorPointForPosition(false); - sprite_a->setPosition(Vector2(0.0f, s.height/2)); + sprite_a->setPosition(Vec2(0.0f, s.height/2)); addChild(sprite_a); sprite_a->runAction(RepeatForever::create(Sequence::create( - MoveTo::create(1.0f, Vector2(1024.0f, 384.0f)), - MoveTo::create(1.0f, Vector2(0.0f, 384.0f)), + MoveTo::create(1.0f, Vec2(1024.0f, 384.0f)), + MoveTo::create(1.0f, Vec2(0.0f, 384.0f)), NULL))); auto sprite_b = LayerColor::create(Color4B(0, 0, 255, 255), 400, 400); - sprite_b->setAnchorPoint(Vector2(0.5f, 0.5f)); + sprite_b->setAnchorPoint(Vec2(0.5f, 0.5f)); sprite_b->ignoreAnchorPointForPosition(false); - sprite_b->setPosition(Vector2(s.width/2, s.height/2)); + sprite_b->setPosition(Vec2(s.width/2, s.height/2)); addChild(sprite_b); auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), CC_CALLBACK_1(Bug1159Layer::callBack, this) ); auto menu = Menu::create(label, NULL); - menu->setPosition(Vector2(s.width - 200.0f, 50.0f)); + menu->setPosition(Vec2(s.width - 200.0f, 50.0f)); addChild(menu); return true; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp index 70aca61a40..051607f2ce 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1174.cpp @@ -5,9 +5,9 @@ #include "Bug-1174.h" -int check_for_error( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float s, float t ); +int check_for_error( Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t ); -int check_for_error( Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float s, float t ) +int check_for_error( Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t ) { // the hit point is p3 + t * (p4 - p3); // the hit point also is p1 + s * (p2 - p1); @@ -37,7 +37,7 @@ bool Bug1174Layer::init() // // seed // srand(0); - Vector2 A,B,C,D,p1,p2,p3,p4; + Vec2 A,B,C,D,p1,p2,p3,p4; float s,t; int err=0; @@ -73,11 +73,11 @@ bool Bug1174Layer::init() float cx = CCRANDOM_0_1() * -5000; float cy = CCRANDOM_0_1() * -5000; - A = Vector2(ax,ay); - B = Vector2(bx,by); - C = Vector2(cx,cy); - D = Vector2(dx,dy); - if( Vector2::isLineIntersect( A, D, B, C, &s, &t) ) { + A = Vec2(ax,ay); + B = Vec2(bx,by); + C = Vec2(cx,cy); + D = Vec2(dx,dy); + if( Vec2::isLineIntersect( A, D, B, C, &s, &t) ) { if( check_for_error(A, D, B, C, s, t) ) err++; else @@ -91,13 +91,13 @@ bool Bug1174Layer::init() // log("Test2 - Start"); - p1 = Vector2(220,480); - p2 = Vector2(304,325); - p3 = Vector2(264,416); - p4 = Vector2(186,416); + p1 = Vec2(220,480); + p2 = Vec2(304,325); + p3 = Vec2(264,416); + p4 = Vec2(186,416); s = 0.0f; t = 0.0f; - if( Vector2::isLineIntersect(p1, p2, p3, p4, &s, &t) ) + if( Vec2::isLineIntersect(p1, p2, p3, p4, &s, &t) ) check_for_error(p1, p2, p3, p4, s,t ); log("Test2 - End"); @@ -117,14 +117,14 @@ bool Bug1174Layer::init() // c | d float ax = CCRANDOM_0_1() * -500; float ay = CCRANDOM_0_1() * 500; - p1 = Vector2(ax,ay); + p1 = Vec2(ax,ay); // a | b // ----- // c | D float dx = CCRANDOM_0_1() * 500; float dy = CCRANDOM_0_1() * -500; - p2 = Vector2(dx,dy); + p2 = Vec2(dx,dy); ////// @@ -135,17 +135,17 @@ bool Bug1174Layer::init() // ----- // C | d float cx = CCRANDOM_0_1() * -500; - p3 = Vector2(cx,y); + p3 = Vec2(cx,y); // a | B // ----- // c | d float bx = CCRANDOM_0_1() * 500; - p4 = Vector2(bx,y); + p4 = Vec2(bx,y); s = 0.0f; t = 0.0f; - if( Vector2::isLineIntersect(p1, p2, p3, p4, &s, &t) ) { + if( Vec2::isLineIntersect(p1, p2, p3, p4, &s, &t) ) { if( check_for_error(p1, p2, p3, p4, s,t ) ) err++; else diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-350.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-350.cpp index 124da50dd6..e210c643b8 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-350.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-350.cpp @@ -11,7 +11,7 @@ bool Bug350Layer::init() { auto size = Director::getInstance()->getWinSize(); auto background = Sprite::create("Hello.png"); - background->setPosition(Vector2(size.width/2, size.height/2)); + background->setPosition(Vec2(size.width/2, size.height/2)); addChild(background); return true; } diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp index 9d6c01f05a..70897f806d 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp @@ -39,7 +39,7 @@ void Bug422Layer::reset() float x = CCRANDOM_0_1() * 50; float y = CCRANDOM_0_1() * 50; - menu->setPosition(menu->getPosition() + Vector2(x,y)); + menu->setPosition(menu->getPosition() + Vec2(x,y)); addChild(menu, 0, localtag); //[self check:self]; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp index 2c63d3dc68..46d61358cc 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp @@ -30,7 +30,7 @@ bool Bug458Layer::init() auto sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) ); auto menu = Menu::create(sprite, sprite2, NULL); menu->alignItemsVerticallyWithPadding(100); - menu->setPosition(Vector2(size.width / 2, size.height / 2)); + menu->setPosition(Vec2(size.width / 2, size.height / 2)); // add the label as a child to this Layer addChild(menu); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp index 855444bbde..5924628790 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp @@ -19,7 +19,7 @@ bool QuestionContainerSprite::init() int width = size.width * 0.9f - (corner->getContentSize().width * 2); int height = size.height * 0.15f - (corner->getContentSize().height * 2); auto layer = LayerColor::create(Color4B(255, 255, 255, 255 * .75), width, height); - layer->setPosition(Vector2(-width / 2, -height / 2)); + layer->setPosition(Vec2(-width / 2, -height / 2)); //First button is blue, //Second is red @@ -36,46 +36,46 @@ bool QuestionContainerSprite::init() a++; addChild(layer); - corner->setPosition(Vector2(-(width / 2 + corner->getContentSize().width / 2), -(height / 2 + corner->getContentSize().height / 2))); + corner->setPosition(Vec2(-(width / 2 + corner->getContentSize().width / 2), -(height / 2 + corner->getContentSize().height / 2))); addChild(corner); auto corner2 = Sprite::create("Images/bugs/corner.png"); - corner2->setPosition(Vector2(-corner->getPosition().x, corner->getPosition().y)); + corner2->setPosition(Vec2(-corner->getPosition().x, corner->getPosition().y)); corner2->setFlippedX(true); addChild(corner2); auto corner3 = Sprite::create("Images/bugs/corner.png"); - corner3->setPosition(Vector2(corner->getPosition().x, -corner->getPosition().y)); + corner3->setPosition(Vec2(corner->getPosition().x, -corner->getPosition().y)); corner3->setFlippedY(true); addChild(corner3); auto corner4 = Sprite::create("Images/bugs/corner.png"); - corner4->setPosition(Vector2(corner2->getPosition().x, -corner2->getPosition().y)); + corner4->setPosition(Vec2(corner2->getPosition().x, -corner2->getPosition().y)); corner4->setFlippedX(true); corner4->setFlippedY(true); addChild(corner4); auto edge = Sprite::create("Images/bugs/edge.png"); edge->setScaleX(width); - edge->setPosition(Vector2(corner->getPosition().x + (corner->getContentSize().width / 2) + (width / 2), corner->getPosition().y)); + edge->setPosition(Vec2(corner->getPosition().x + (corner->getContentSize().width / 2) + (width / 2), corner->getPosition().y)); addChild(edge); auto edge2 = Sprite::create("Images/bugs/edge.png"); edge2->setScaleX(width); - edge2->setPosition(Vector2(corner->getPosition().x + (corner->getContentSize().width / 2) + (width / 2), -corner->getPosition().y)); + edge2->setPosition(Vec2(corner->getPosition().x + (corner->getContentSize().width / 2) + (width / 2), -corner->getPosition().y)); edge2->setFlippedY(true); addChild(edge2); auto edge3 = Sprite::create("Images/bugs/edge.png"); edge3->setRotation(90); edge3->setScaleX(height); - edge3->setPosition(Vector2(corner->getPosition().x, corner->getPosition().y + (corner->getContentSize().height / 2) + (height / 2))); + edge3->setPosition(Vec2(corner->getPosition().x, corner->getPosition().y + (corner->getContentSize().height / 2) + (height / 2))); addChild(edge3); auto edge4 = Sprite::create("Images/bugs/edge.png"); edge4->setRotation(270); edge4->setScaleX(height); - edge4->setPosition(Vector2(-corner->getPosition().x, corner->getPosition().y + (corner->getContentSize().height / 2) + (height / 2))); + edge4->setPosition(Vec2(-corner->getPosition().x, corner->getPosition().y + (corner->getContentSize().height / 2) + (height / 2))); addChild(edge4); addChild(label); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp index 074d7864eb..b7509953e6 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp @@ -22,7 +22,7 @@ bool Bug624Layer::init() auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("Layer1", "fonts/Marker Felt.ttf", 36.0f); - label->setPosition(Vector2(size.width/2, size.height/2)); + label->setPosition(Vec2(size.width/2, size.height/2)); addChild(label); Device::setAccelerometerEnabled(true); @@ -68,7 +68,7 @@ bool Bug624Layer2::init() auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("Layer2", "fonts/Marker Felt.ttf", 36.0f); - label->setPosition(Vector2(size.width/2, size.height/2)); + label->setPosition(Vec2(size.width/2, size.height/2)); addChild(label); Device::setAccelerometerEnabled(true); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-886.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-886.cpp index 58c1420c2f..23cae12f1b 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-886.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-886.cpp @@ -13,15 +13,15 @@ bool Bug886Layer::init() // auto size = [[Director sharedDirector] winSize]; auto sprite = Sprite::create("Images/bugs/bug886.jpg"); - sprite->setAnchorPoint(Vector2::ZERO); - sprite->setPosition(Vector2::ZERO); + sprite->setAnchorPoint(Vec2::ZERO); + sprite->setPosition(Vec2::ZERO); sprite->setScaleX(0.6f); addChild(sprite); auto sprite2 = Sprite::create("Images/bugs/bug886.png"); - sprite2->setAnchorPoint(Vector2::ZERO); + sprite2->setAnchorPoint(Vec2::ZERO); sprite2->setScaleX(0.6f); - sprite2->setPosition(Vector2(sprite->getContentSize().width * 0.6f + 10, 0)); + sprite2->setPosition(Vec2(sprite->getContentSize().width * 0.6f + 10, 0)); addChild(sprite2); return true; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-899.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-899.cpp index 812e9e5861..80179ae490 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-899.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-899.cpp @@ -14,7 +14,7 @@ bool Bug899Layer::init() { auto bg = Sprite::create("Images/bugs/RetinaDisplay.jpg"); addChild(bg, 0); - bg->setAnchorPoint(Vector2::ZERO); + bg->setAnchorPoint(Vec2::ZERO); return true; } diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp index 83e3533c87..75c601d90f 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp @@ -42,8 +42,8 @@ bool Bug914Layer::init() { layer = LayerColor::create(Color4B(i*20, i*20, i*20,255)); layer->setContentSize(Size(i*100, i*100)); - layer->setPosition(Vector2(size.width/2, size.height/2)); - layer->setAnchorPoint(Vector2(0.5f, 0.5f)); + layer->setPosition(Vec2(size.width/2, size.height/2)); + layer->setAnchorPoint(Vec2(0.5f, 0.5f)); layer->ignoreAnchorPointForPosition(false); addChild(layer, -1-i); } @@ -54,11 +54,11 @@ bool Bug914Layer::init() auto menu = Menu::create(item1, NULL); menu->alignItemsVertically(); - menu->setPosition(Vector2(size.width/2, 100)); + menu->setPosition(Vec2(size.width/2, 100)); addChild(menu); // position the label on the center of the screen - label->setPosition(Vector2( size.width /2 , size.height/2 )); + label->setPosition(Vec2( size.width /2 , size.height/2 )); // add the label as a child to this Layer addChild(label); diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index 17c89890db..63ed76bcc5 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -26,7 +26,7 @@ enum kItemTagBasic = 5432, }; -static Vector2 s_tCurPos = Vector2::ZERO; +static Vec2 s_tCurPos = Vec2::ZERO; struct { const char *test_name; @@ -63,7 +63,7 @@ void BugsTestMainLayer::onEnter() for (int i = 0; i < g_maxitems; ++i) { auto pItem = MenuItemFont::create(g_bugs[i].test_name, g_bugs[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itmeMenu->addChild(pItem, kItemTagBasic + i); } @@ -88,17 +88,17 @@ void BugsTestMainLayer::onTouchesMoved(const std::vector& touches, Event float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itmeMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); auto winSize = Director::getInstance()->getWinSize(); if (nextPos.y < 0.0f) { - _itmeMenu->setPosition(Vector2::ZERO); + _itmeMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_maxitems + 1)* LINE_SPACE - winSize.height)) { - _itmeMenu->setPosition(Vector2(0, ((g_maxitems + 1)* LINE_SPACE - winSize.height))); + _itmeMenu->setPosition(Vec2(0, ((g_maxitems + 1)* LINE_SPACE - winSize.height))); return; } @@ -119,9 +119,9 @@ void BugsTestBaseLayer::onEnter() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTestBaseLayer::backCallback, this)); - pMainItem->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + pMainItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menu = Menu::create(pMainItem, NULL); - menu->setPosition( Vector2::ZERO ); + menu->setPosition( Vec2::ZERO ); addChild(menu); } diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.h b/tests/cpp-tests/Classes/BugsTest/BugsTest.h index e23f25155b..4ec70a54c6 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.h +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.h @@ -12,7 +12,7 @@ public: void onTouchesMoved(const std::vector&touches, Event *event); protected: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itmeMenu; }; diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index d1267f5cbb..6db9ab2492 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -32,7 +32,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() // title auto label = Label::createWithTTF("Multi touch the screen", "fonts/Marker Felt.ttf", 36.0f); - label->setPosition(cocos2d::Vector2( VisibleRect::center().x, VisibleRect::top().y - 30)); + label->setPosition(cocos2d::Vec2( VisibleRect::center().x, VisibleRect::top().y - 30)); this->addChild(label, -1); // reset button @@ -52,7 +52,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() #endif addChild(parent, 0, kTagParentNode); - addNewSpriteAtPosition(cocos2d::Vector2(200,200)); + addNewSpriteAtPosition(cocos2d::Vec2(200,200)); // menu for debug layer MenuItemFont::setFontSize(18); @@ -60,7 +60,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(cocos2d::Vector2(VisibleRect::right().x-100, VisibleRect::top().y-60)); + menu->setPosition(cocos2d::Vec2(VisibleRect::right().x-100, VisibleRect::top().y-60)); scheduleUpdate(); #else @@ -68,7 +68,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() "fonts/arial.ttf", 18); auto size = Director::getInstance()->getWinSize(); - label->setPosition(Vector2(size.width/2, size.height/2)); + label->setPosition(Vec2(size.width/2, size.height/2)); addChild(label); @@ -160,7 +160,7 @@ void ChipmunkTestLayer::createResetButton() auto menu = Menu::create(reset, NULL); - menu->setPosition(cocos2d::Vector2(VisibleRect::center().x, VisibleRect::bottom().y + 30)); + menu->setPosition(cocos2d::Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); } @@ -174,7 +174,7 @@ void ChipmunkTestLayer::reset(Ref* sender) s->release(); } -void ChipmunkTestLayer::addNewSpriteAtPosition(cocos2d::Vector2 pos) +void ChipmunkTestLayer::addNewSpriteAtPosition(cocos2d::Vec2 pos) { #if CC_ENABLE_CHIPMUNK_INTEGRATION int posx, posy; @@ -242,7 +242,7 @@ void ChipmunkTestLayer::onAcceleration(Acceleration* acc, Event* event) prevX = accelX; prevY = accelY; - auto v = cocos2d::Vector2( accelX, accelY); + auto v = cocos2d::Vec2( accelX, accelY); v = v * 200; _space->gravity = cpv(v.x, v.y); } diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h index eebc2ccba7..3d9a8c589a 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.h @@ -21,7 +21,7 @@ public: void createResetButton(); void reset(Ref* sender); - void addNewSpriteAtPosition(cocos2d::Vector2 p); + void addNewSpriteAtPosition(cocos2d::Vec2 p); void update(float dt); void toggleDebugCallback(Ref* sender); void onTouchesEnded(const std::vector& touches, Event* event); diff --git a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index 1dc6cddc1d..aadceb2063 100644 --- a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -28,9 +28,9 @@ MainLayer::MainLayer() addChild(layer, -1); addChild(sprite, 0, kTagSprite); - sprite->setPosition( Vector2(20,150) ); + sprite->setPosition( Vec2(20,150) ); - sprite->runAction( JumpTo::create(4, Vector2(300,48), 100, 4) ); + sprite->runAction( JumpTo::create(4, Vec2(300,48), 100, 4) ); layer->runAction( RepeatForever::create( Sequence::create( @@ -51,7 +51,7 @@ void MainLayer::onTouchEnded(Touch* touch, Event *event) auto s = getChildByTag(kTagSprite); s->stopAllActions(); - s->runAction( MoveTo::create(1, Vector2(location.x, location.y) ) ); + s->runAction( MoveTo::create(1, Vec2(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/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 27fcede20a..c6ca186378 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -75,8 +75,8 @@ bool BaseClippingNodeTest::init() if (BaseTest::init()) { auto background = Sprite::create(s_back3); - background->setAnchorPoint( Vector2::ZERO ); - background->setPosition( Vector2::ZERO ); + background->setAnchorPoint( Vec2::ZERO ); + background->setPosition( Vec2::ZERO ); this->addChild(background, -1); this->setup(); @@ -148,17 +148,17 @@ void BasicTest::setup() auto stencil = this->stencil(); stencil->setTag( kTagStencilNode ); - stencil->setPosition( Vector2(50, 50) ); + stencil->setPosition( Vec2(50, 50) ); auto clipper = this->clipper(); clipper->setTag( kTagClipperNode ); - clipper->setAnchorPoint(Vector2(0.5, 0.5)); - clipper->setPosition( Vector2(s.width / 2 - 50, s.height / 2 - 50) ); + clipper->setAnchorPoint(Vec2(0.5, 0.5)); + clipper->setPosition( Vec2(s.width / 2 - 50, s.height / 2 - 50) ); clipper->setStencil(stencil); this->addChild(clipper); auto content = this->content(); - content->setPosition( Vector2(50, 50) ); + content->setPosition( Vec2(50, 50) ); clipper->addChild(content); } @@ -176,10 +176,10 @@ Action* BasicTest::actionScale() DrawNode* BasicTest::shape() { auto shape = DrawNode::create(); - static Vector2 triangle[3]; - triangle[0] = Vector2(-100, -100); - triangle[1] = Vector2(100, -100); - triangle[2] = Vector2(0, 100); + static Vec2 triangle[3]; + triangle[0] = Vec2(-100, -100); + triangle[1] = Vec2(100, -100); + triangle[2] = Vec2(0, 100); static Color4F green(0, 1, 0, 1); shape->drawPolygon(triangle, 3, green, 0, green); @@ -351,16 +351,16 @@ void NestedTest::setup() auto clipper = ClippingNode::create(); clipper->setContentSize(Size(size, size)); - clipper->setAnchorPoint(Vector2(0.5, 0.5)); - clipper->setPosition( Vector2(parent->getContentSize().width / 2, parent->getContentSize().height / 2) ); + clipper->setAnchorPoint(Vec2(0.5, 0.5)); + clipper->setPosition( Vec2(parent->getContentSize().width / 2, parent->getContentSize().height / 2) ); clipper->setAlphaThreshold(0.05f); clipper->runAction(RepeatForever::create(RotateBy::create(i % 3 ? 1.33 : 1.66, i % 2 ? 90 : -90))); parent->addChild(clipper); auto stencil = Sprite::create(s_pathGrossini); stencil->setScale( 2.5 - (i * (2.5 / depth)) ); - stencil->setAnchorPoint( Vector2(0.5, 0.5) ); - stencil->setPosition( Vector2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); + stencil->setAnchorPoint( Vec2(0.5, 0.5) ); + stencil->setPosition( Vec2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); stencil->setVisible(false); stencil->runAction(Sequence::createWithTwoActions(DelayTime::create(i), Show::create())); clipper->setStencil(stencil); @@ -394,7 +394,7 @@ std::string HoleDemo::subtitle() const void HoleDemo::setup() { auto target = Sprite::create(s_pathBlock); - target->setAnchorPoint(Vector2::ZERO); + target->setAnchorPoint(Vec2::ZERO); target->setScale(3); _outerClipper = ClippingNode::create(); @@ -403,8 +403,8 @@ void HoleDemo::setup() tranform = AffineTransformScale(tranform, target->getScale(), target->getScale()); _outerClipper->setContentSize( SizeApplyAffineTransform(target->getContentSize(), tranform)); - _outerClipper->setAnchorPoint( Vector2(0.5, 0.5) ); - _outerClipper->setPosition(Vector2(this->getContentSize()) * 0.5f); + _outerClipper->setAnchorPoint( Vec2(0.5, 0.5) ); + _outerClipper->setPosition(Vec2(this->getContentSize()) * 0.5f); _outerClipper->runAction(RepeatForever::create(RotateBy::create(1, 45))); _outerClipper->setStencil( target ); @@ -434,7 +434,7 @@ void HoleDemo::setup() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); } -void HoleDemo::pokeHoleAtPoint(Vector2 point) +void HoleDemo::pokeHoleAtPoint(Vec2 point) { float scale = CCRANDOM_0_1() * 0.2 + 0.9; float rotation = CCRANDOM_0_1() * 360; @@ -461,7 +461,7 @@ void HoleDemo::pokeHoleAtPoint(Vector2 point) void HoleDemo::onTouchesBegan(const std::vector& touches, Event* event) { Touch *touch = (Touch *)touches[0]; - Vector2 point = _outerClipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); + Vec2 point = _outerClipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); auto rect = Rect(0, 0, _outerClipper->getContentSize().width, _outerClipper->getContentSize().height); if (!rect.containsPoint(point)) return; this->pokeHoleAtPoint(point); @@ -484,17 +484,17 @@ void ScrollViewDemo::setup() auto clipper = ClippingNode::create(); clipper->setTag( kTagClipperNode ); clipper->setContentSize( Size(200, 200) ); - clipper->setAnchorPoint( Vector2(0.5, 0.5) ); - clipper->setPosition( Vector2(this->getContentSize().width / 2, this->getContentSize().height / 2) ); + clipper->setAnchorPoint( Vec2(0.5, 0.5) ); + clipper->setPosition( Vec2(this->getContentSize().width / 2, this->getContentSize().height / 2) ); clipper->runAction(RepeatForever::create(RotateBy::create(1, 45))); this->addChild(clipper); auto stencil = DrawNode::create(); - Vector2 rectangle[4]; - rectangle[0] = Vector2(0, 0); - rectangle[1] = Vector2(clipper->getContentSize().width, 0); - rectangle[2] = Vector2(clipper->getContentSize().width, clipper->getContentSize().height); - rectangle[3] = Vector2(0, clipper->getContentSize().height); + Vec2 rectangle[4]; + rectangle[0] = Vec2(0, 0); + rectangle[1] = Vec2(clipper->getContentSize().width, 0); + rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height); + rectangle[3] = Vec2(0, clipper->getContentSize().height); Color4F white(1, 1, 1, 1); stencil->drawPolygon(rectangle, 4, white, 1, white); @@ -502,8 +502,8 @@ void ScrollViewDemo::setup() auto content = Sprite::create(s_back2); content->setTag( kTagContentNode ); - content->setAnchorPoint( Vector2(0.5, 0.5) ); - content->setPosition( Vector2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); + content->setAnchorPoint( Vec2(0.5, 0.5) ); + content->setPosition( Vec2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); clipper->addChild(content); _scrolling = false; @@ -519,7 +519,7 @@ void ScrollViewDemo::onTouchesBegan(const std::vector& touches, Event * { Touch *touch = touches[0]; auto clipper = this->getChildByTag(kTagClipperNode); - Vector2 point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); + Vec2 point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); auto rect = Rect(0, 0, clipper->getContentSize().width, clipper->getContentSize().height); _scrolling = rect.containsPoint(point); _lastPoint = point; @@ -531,7 +531,7 @@ void ScrollViewDemo::onTouchesMoved(const std::vector& touches, Event * Touch *touch = touches[0]; auto clipper = this->getChildByTag(kTagClipperNode); auto point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); - Vector2 diff = point - _lastPoint; + Vec2 diff = point - _lastPoint; auto content = clipper->getChildByTag(kTagContentNode); content->setPosition(content->getPosition() + diff); _lastPoint = point; @@ -588,12 +588,12 @@ void RawStencilBufferTest::setup() for(int i = 0; i < _planeCount; ++i) { Sprite* sprite = Sprite::create(s_pathGrossini); - sprite->setAnchorPoint( Vector2(0.5, 0) ); + sprite->setAnchorPoint( Vec2(0.5, 0) ); sprite->setScale( 2.5f ); _sprites.pushBack(sprite); Sprite* sprite2 = Sprite::create(s_pathGrossini); - sprite2->setAnchorPoint( Vector2(0.5, 0) ); + sprite2->setAnchorPoint( Vec2(0.5, 0) ); sprite2->setScale( 2.5f ); _spritesStencil.pushBack(sprite2); } @@ -601,9 +601,9 @@ void RawStencilBufferTest::setup() Director::getInstance()->setAlphaBlending(true); } -void RawStencilBufferTest::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void RawStencilBufferTest::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { - auto winPoint = Vector2(Director::getInstance()->getWinSize()); + auto winPoint = Vec2(Director::getInstance()->getWinSize()); auto planeSize = winPoint * (1.0 / _planeCount); @@ -672,19 +672,19 @@ void RawStencilBufferTest::onDisableStencil() CHECK_GL_ERROR_DEBUG(); } -void RawStencilBufferTest::onBeforeDrawClip(int planeIndex, const Vector2& pt) +void RawStencilBufferTest::onBeforeDrawClip(int planeIndex, const Vec2& pt) { this->setupStencilForClippingOnPlane(planeIndex); CHECK_GL_ERROR_DEBUG(); - DrawPrimitives::drawSolidRect(Vector2::ZERO, pt, Color4F(1, 1, 1, 1)); + DrawPrimitives::drawSolidRect(Vec2::ZERO, pt, Color4F(1, 1, 1, 1)); } -void RawStencilBufferTest::onBeforeDrawSprite(int planeIndex, const Vector2& pt) +void RawStencilBufferTest::onBeforeDrawSprite(int planeIndex, const Vec2& pt) { this->setupStencilForDrawingOnPlane(planeIndex); CHECK_GL_ERROR_DEBUG(); - DrawPrimitives::drawSolidRect(Vector2::ZERO, pt, _planeColor[planeIndex]); + DrawPrimitives::drawSolidRect(Vec2::ZERO, pt, _planeColor[planeIndex]); } void RawStencilBufferTest::setupStencilForClippingOnPlane(GLint plane) @@ -831,7 +831,7 @@ void RawStencilBufferTest6::setup() { RawStencilBufferTestAlphaTest::setup(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - auto winPoint = Vector2(Director::getInstance()->getWinSize()); + auto winPoint = Vec2(Director::getInstance()->getWinSize()); //by default, glReadPixels will pack data with 4 bytes allignment unsigned char bits[4] = {0,0,0,0}; glStencilMask(~0); @@ -840,7 +840,7 @@ void RawStencilBufferTest6::setup() glFlush(); glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &bits); auto clearToZeroLabel = Label::createWithTTF(String::createWithFormat("00=%02x", bits[0])->getCString(), "fonts/arial.ttf", 20); - clearToZeroLabel->setPosition( Vector2((winPoint.x / 3) * 1, winPoint.y - 10) ); + clearToZeroLabel->setPosition( Vec2((winPoint.x / 3) * 1, winPoint.y - 10) ); this->addChild(clearToZeroLabel); glStencilMask(0x0F); glClearStencil(0xAA); @@ -848,7 +848,7 @@ void RawStencilBufferTest6::setup() glFlush(); glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &bits); auto clearToMaskLabel = Label::createWithTTF(String::createWithFormat("0a=%02x", bits[0])->getCString(), "fonts/arial.ttf", 20); - clearToMaskLabel->setPosition( Vector2((winPoint.x / 3) * 2, winPoint.y - 10) ); + clearToMaskLabel->setPosition( Vec2((winPoint.x / 3) * 2, winPoint.y - 10) ); this->addChild(clearToMaskLabel); #endif glStencilMask(~0); @@ -860,7 +860,7 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane) glStencilMask(planeMask); glStencilFunc(GL_NEVER, 0, planeMask); glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); - DrawPrimitives::drawSolidRect(Vector2::ZERO, Vector2(Director::getInstance()->getWinSize()), Color4F(1, 1, 1, 1)); + DrawPrimitives::drawSolidRect(Vec2::ZERO, Vec2(Director::getInstance()->getWinSize()), Color4F(1, 1, 1, 1)); glStencilFunc(GL_NEVER, planeMask, planeMask); glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); glDisable(GL_DEPTH_TEST); diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h index f5b7dcbb8a..df93852059 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.h @@ -117,7 +117,7 @@ public: virtual void setup(); virtual std::string title() const override; virtual std::string subtitle() const override; - void pokeHoleAtPoint(Vector2 point); + void pokeHoleAtPoint(Vec2 point); void onTouchesBegan(const std::vector& touches, Event *event); private: ClippingNode* _outerClipper; @@ -138,7 +138,7 @@ public: void onTouchesEnded(const std::vector& touches, Event *event); private: bool _scrolling; - Vector2 _lastPoint; + Vec2 _lastPoint; }; //#if COCOS2D_DEBUG > 1 @@ -153,7 +153,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void setup(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void setupStencilForClippingOnPlane(GLint plane); virtual void setupStencilForDrawingOnPlane(GLint plane); @@ -162,8 +162,8 @@ protected: std::list _renderCmds; void onEnableStencil(); void onDisableStencil(); - void onBeforeDrawClip(int planeIndex, const Vector2& pt); - void onBeforeDrawSprite(int planeIndex, const Vector2& pt); + void onBeforeDrawClip(int planeIndex, const Vec2& pt); + void onBeforeDrawSprite(int planeIndex, const Vec2& pt); protected: Vector _sprites; Vector _spritesStencil; diff --git a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 8c856ce437..7e81abb0db 100644 --- a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -174,9 +174,9 @@ public: _lblMinValue = Label::createWithTTF(buffer, "fonts/arial.ttf", 8); addChild(_lblMinValue); if (_direction == Vertical) - _lblMinValue->setPosition(Vector2(12.0, -50.0)); + _lblMinValue->setPosition(Vec2(12.0, -50.0)); else - _lblMinValue->setPosition(Vector2(-50, 12.0)); + _lblMinValue->setPosition(Vec2(-50, 12.0)); } else { _lblMinValue->setString(buffer); } @@ -186,9 +186,9 @@ public: _lblMaxValue = Label::createWithTTF(buffer, "fonts/arial.ttf", 8); addChild(_lblMaxValue); if (_direction == Vertical) - _lblMaxValue->setPosition(Vector2(12.0, 50.0)); + _lblMaxValue->setPosition(Vec2(12.0, 50.0)); else - _lblMaxValue->setPosition(Vector2(50, 12.0)); + _lblMaxValue->setPosition(Vec2(50, 12.0)); } else { _lblMaxValue->setString(buffer); } @@ -397,7 +397,7 @@ void CocosDenshionTest::addSliders() void CocosDenshionTest::addChildAt(Node *node, float percentageX, float percentageY) { const Size size = VisibleRect::getVisibleRect().size; - node->setPosition(Vector2(percentageX * size.width, percentageY * size.height)); + node->setPosition(Vec2(percentageX * size.width, percentageY * size.height)); addChild(node); } diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp index 7a3f9d4803..0da3d1df6d 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp @@ -7,7 +7,7 @@ CurlTest::CurlTest() { auto label = Label::createWithTTF("Curl Test", "fonts/arial.ttf", 28); addChild(label, 0); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y-50) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y-50) ); auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesEnded = CC_CALLBACK_2(CurlTest::onTouchesEnded, this); diff --git a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp index ba32ed421e..24e8047356 100644 --- a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp +++ b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp @@ -4,7 +4,7 @@ CurrentLanguageTest::CurrentLanguageTest() { auto label = Label::createWithTTF("Current language Test", "fonts/arial.ttf", 28); addChild(label, 0); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y-50) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y-50) ); auto labelLanguage = Label::createWithTTF("", "fonts/arial.ttf", 20); labelLanguage->setPosition(VisibleRect::center()); diff --git a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp index 0af7397268..00d2b7b044 100644 --- a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp +++ b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp @@ -21,11 +21,11 @@ void PrettyPrinterDemo::addSprite() auto s4 = Sprite::create("Images/grossini_dance_03.png"); auto s5 = Sprite::create("Images/grossini_dance_04.png"); - s1->setPosition(Vector2(50, 50)); - s2->setPosition(Vector2(60, 50)); - s3->setPosition(Vector2(70, 50)); - s4->setPosition(Vector2(80, 50)); - s5->setPosition(Vector2(90, 50)); + s1->setPosition(Vec2(50, 50)); + s2->setPosition(Vec2(60, 50)); + s3->setPosition(Vec2(70, 50)); + s4->setPosition(Vec2(80, 50)); + s5->setPosition(Vec2(90, 50)); this->addChild(s1); this->addChild(s2); @@ -40,14 +40,14 @@ void PrettyPrinterDemo::onEnter() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 28); - label->setPosition( Vector2(s.width/2, s.height * 4/5) ); + label->setPosition( Vec2(s.width/2, s.height * 4/5) ); this->addChild(label, 1); std::string strSubtitle = subtitle(); if(strSubtitle.empty() == false) { auto subLabel = Label::createWithTTF(strSubtitle.c_str(), "fonts/Thonburi.ttf", 16); - subLabel->setPosition( Vector2(s.width/2, s.height * 3/5) ); + subLabel->setPosition( Vec2(s.width/2, s.height * 3/5) ); this->addChild(subLabel, 1); } diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 4e5e4a100c..5687d00818 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -114,14 +114,14 @@ DrawPrimitivesTest::DrawPrimitivesTest() { } -void DrawPrimitivesTest::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void DrawPrimitivesTest::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(DrawPrimitivesTest::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void DrawPrimitivesTest::onDraw(const Matrix &transform, bool transformUpdated) +void DrawPrimitivesTest::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -165,7 +165,7 @@ void DrawPrimitivesTest::onDraw(const Matrix &transform, bool transformUpdated) CHECK_GL_ERROR_DEBUG(); // draw 4 small points - Vector2 points[] = { Vector2(60,60), Vector2(70,70), Vector2(60,70), Vector2(70,60) }; + Vec2 points[] = { Vec2(60,60), Vec2(70,70), Vec2(60,70), Vec2(70,60) }; DrawPrimitives::setPointSize(4); DrawPrimitives::setDrawColor4B(0,255,255,255); DrawPrimitives::drawPoints( points, 4); @@ -189,28 +189,28 @@ void DrawPrimitivesTest::onDraw(const Matrix &transform, bool transformUpdated) // draw a pink solid circle with 50 segments glLineWidth(2); DrawPrimitives::setDrawColor4B(255, 0, 255, 255); - DrawPrimitives::drawSolidCircle( VisibleRect::center() + Vector2(140,0), 40, CC_DEGREES_TO_RADIANS(90), 50, 1.0f, 1.0f); + DrawPrimitives::drawSolidCircle( VisibleRect::center() + Vec2(140,0), 40, CC_DEGREES_TO_RADIANS(90), 50, 1.0f, 1.0f); CHECK_GL_ERROR_DEBUG(); // open yellow poly DrawPrimitives::setDrawColor4B(255, 255, 0, 255); glLineWidth(10); - Vector2 vertices[] = { Vector2(0,0), Vector2(50,50), Vector2(100,50), Vector2(100,100), Vector2(50,100) }; + Vec2 vertices[] = { Vec2(0,0), Vec2(50,50), Vec2(100,50), Vec2(100,100), Vec2(50,100) }; DrawPrimitives::drawPoly( vertices, 5, false); CHECK_GL_ERROR_DEBUG(); // filled poly glLineWidth(1); - Vector2 filledVertices[] = { Vector2(0,120), Vector2(50,120), Vector2(50,170), Vector2(25,200), Vector2(0,170) }; + Vec2 filledVertices[] = { Vec2(0,120), Vec2(50,120), Vec2(50,170), Vec2(25,200), Vec2(0,170) }; DrawPrimitives::drawSolidPoly(filledVertices, 5, Color4F(0.5f, 0.5f, 1, 1 ) ); // closed purble poly DrawPrimitives::setDrawColor4B(255, 0, 255, 255); glLineWidth(2); - Vector2 vertices2[] = { Vector2(30,130), Vector2(30,230), Vector2(50,200) }; + Vec2 vertices2[] = { Vec2(30,130), Vec2(30,230), Vec2(50,200) }; DrawPrimitives::drawPoly( vertices2, 3, true); CHECK_GL_ERROR_DEBUG(); @@ -221,12 +221,12 @@ void DrawPrimitivesTest::onDraw(const Matrix &transform, bool transformUpdated) CHECK_GL_ERROR_DEBUG(); // draw cubic bezier path - DrawPrimitives::drawCubicBezier(VisibleRect::center(), Vector2(VisibleRect::center().x+30,VisibleRect::center().y+50), Vector2(VisibleRect::center().x+60,VisibleRect::center().y-50),VisibleRect::right(),100); + DrawPrimitives::drawCubicBezier(VisibleRect::center(), Vec2(VisibleRect::center().x+30,VisibleRect::center().y+50), Vec2(VisibleRect::center().x+60,VisibleRect::center().y-50),VisibleRect::right(),100); CHECK_GL_ERROR_DEBUG(); //draw a solid polygon - Vector2 vertices3[] = {Vector2(60,160), Vector2(70,190), Vector2(100,190), Vector2(90,160)}; + Vec2 vertices3[] = {Vec2(60,160), Vec2(70,190), Vec2(100,190), Vec2(90,160)}; DrawPrimitives::drawSolidPoly( vertices3, 4, Color4F(1,1,0,1) ); // restore original values @@ -261,11 +261,11 @@ DrawNodeTest::DrawNodeTest() // Draw 10 circles for( int i=0; i < 10; i++) { - draw->drawDot(Vector2(s.width/2, s.height/2), 10*(10-i), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); + draw->drawDot(Vec2(s.width/2, s.height/2), 10*(10-i), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); } // Draw polygons - Vector2 points[] = { Vector2(s.height/4,0), Vector2(s.width,s.height/5), Vector2(s.width/3*2,s.height) }; + Vec2 points[] = { Vec2(s.height/4,0), Vec2(s.width,s.height/5), Vec2(s.width/3*2,s.height) }; draw->drawPolygon(points, sizeof(points)/sizeof(points[0]), Color4F(1,0,0,0.5), 4, Color4F(0,0,1,1)); // star poly (triggers buggs) @@ -273,9 +273,9 @@ DrawNodeTest::DrawNodeTest() const float o=80; const float w=20; const float h=50; - Vector2 star[] = { - Vector2(o+w,o-h), Vector2(o+w*2, o), // lower spike - Vector2(o + w*2 + h, o+w ), Vector2(o + w*2, o+w*2), // right spike + Vec2 star[] = { + Vec2(o+w,o-h), Vec2(o+w*2, o), // lower spike + Vec2(o + w*2 + h, o+w ), Vec2(o + w*2, o+w*2), // right spike // {o +w, o+w*2+h}, {o,o+w*2}, // top spike // {o -h, o+w}, {o,o}, // left spike }; @@ -288,11 +288,11 @@ DrawNodeTest::DrawNodeTest() const float o=180; const float w=20; const float h=50; - Vector2 star[] = { - Vector2(o,o), Vector2(o+w,o-h), Vector2(o+w*2, o), // lower spike - Vector2(o + w*2 + h, o+w ), Vector2(o + w*2, o+w*2), // right spike - Vector2(o +w, o+w*2+h), Vector2(o,o+w*2), // top spike - Vector2(o -h, o+w), // left spike + Vec2 star[] = { + Vec2(o,o), Vec2(o+w,o-h), Vec2(o+w*2, o), // lower spike + Vec2(o + w*2 + h, o+w ), Vec2(o + w*2, o+w*2), // right spike + Vec2(o +w, o+w*2+h), Vec2(o,o+w*2), // top spike + Vec2(o -h, o+w), // left spike }; draw->drawPolygon(star, sizeof(star)/sizeof(star[0]), Color4F(1,0,0,0.5), 1, Color4F(0,0,1,1)); @@ -300,17 +300,17 @@ DrawNodeTest::DrawNodeTest() // Draw segment - draw->drawSegment(Vector2(20,s.height), Vector2(20,s.height/2), 10, Color4F(0, 1, 0, 1)); + draw->drawSegment(Vec2(20,s.height), Vec2(20,s.height/2), 10, Color4F(0, 1, 0, 1)); - draw->drawSegment(Vector2(10,s.height/2), Vector2(s.width/2, s.height/2), 40, Color4F(1, 0, 1, 0.5)); + draw->drawSegment(Vec2(10,s.height/2), Vec2(s.width/2, s.height/2), 40, Color4F(1, 0, 1, 0.5)); // Draw triangle - draw->drawTriangle(Vector2(10, 10), Vector2(70, 30), Vector2(100, 140), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); + draw->drawTriangle(Vec2(10, 10), Vec2(70, 30), Vec2(100, 140), Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); // Draw some beziers - draw->drawQuadraticBezier(Vector2(s.width - 150, s.height - 150), Vector2(s.width - 70, s.height - 10), Vector2(s.width - 10, s.height - 10), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); + draw->drawQuadraticBezier(Vec2(s.width - 150, s.height - 150), Vec2(s.width - 70, s.height - 10), Vec2(s.width - 10, s.height - 10), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); - draw->drawCubicBezier(Vector2(s.width - 250, 40), Vector2(s.width - 70, 100), Vector2(s.width - 30, 250), Vector2(s.width - 10, s.height - 50), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); + draw->drawCubicBezier(Vec2(s.width - 250, 40), Vec2(s.width - 70, 100), Vec2(s.width - 30, 250), Vec2(s.width - 10, s.height - 50), 10, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 0.5)); } string DrawNodeTest::title() const diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h index 0e1980f05f..a5c0041204 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.h @@ -27,10 +27,10 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _customCommand; }; diff --git a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp index 7af5898df7..f6b936ac1a 100644 --- a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp +++ b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp @@ -28,7 +28,7 @@ void Effect1::onEnter() // Waves3D is Grid3D and it's size is (15,10) auto size = Director::getInstance()->getWinSize(); - auto lens = Lens3D::create(0.0f, Size(15,10), Vector2(size.width/2,size.height/2), 240); + auto lens = Lens3D::create(0.0f, Size(15,10), Vec2(size.width/2,size.height/2), 240); auto waves = Waves3D::create(10, Size(15,10), 18, 15); auto reuse = ReuseGrid::create(1); @@ -106,7 +106,7 @@ void Effect3::onEnter() _target2->runAction( RepeatForever::create( shaky ) ); // moving background. Testing issue #244 - auto move = MoveBy::create(3, Vector2(200,0) ); + auto move = MoveBy::create(3, Vec2(200,0) ); _bgNode->runAction(RepeatForever::create( Sequence::create(move, move->reverse(), NULL) )); } @@ -125,12 +125,12 @@ std::string Effect3::title() const class Lens3DTarget : public Node { public: - virtual void setPosition(const Vector2& var) + virtual void setPosition(const Vec2& var) { _lens3D->setPosition(var); } - virtual const Vector2& getPosition() const + virtual const Vec2& getPosition() const { return _lens3D->getPosition(); } @@ -156,8 +156,8 @@ void Effect4::onEnter() EffectAdvanceTextLayer::onEnter(); //Node* gridNode = NodeGrid::create(); - auto lens = Lens3D::create(10, Size(32,24), Vector2(100,180), 150); - auto move = JumpBy::create(5, Vector2(380,0), 100, 4); + auto lens = Lens3D::create(10, Size(32,24), Vec2(100,180), 150); + auto move = JumpBy::create(5, Vec2(380,0), 100, 4); auto move_back = move->reverse(); auto seq = Sequence::create( move, move_back, NULL); @@ -238,7 +238,7 @@ void Issue631::onEnter() auto layer = LayerColor::create( Color4B(255,0,0,255) ); addChild(layer, -10); auto sprite = Sprite::create("Images/grossini.png"); - sprite->setPosition( Vector2(50,80) ); + sprite->setPosition( Vec2(50,80) ); layer->addChild(sprite, 10); // foreground @@ -339,7 +339,7 @@ void EffectAdvanceTextLayer::onEnter(void) BaseTest::onEnter(); _bgNode = NodeGrid::create(); - _bgNode->setAnchorPoint(Vector2(0.5,0.5)); + _bgNode->setAnchorPoint(Vec2(0.5,0.5)); addChild(_bgNode); //_bgNode->setPosition( VisibleRect::center() ); auto bg = Sprite::create("Images/background3.png"); @@ -349,22 +349,22 @@ void EffectAdvanceTextLayer::onEnter(void) _bgNode->addChild(bg); _target1 = NodeGrid::create(); - _target1->setAnchorPoint(Vector2(0.5,0.5)); + _target1->setAnchorPoint(Vec2(0.5,0.5)); auto grossini = Sprite::create("Images/grossinis_sister2.png"); _target1->addChild(grossini); _bgNode->addChild(_target1); - _target1->setPosition( Vector2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3.0f, VisibleRect::bottom().y+ 200) ); + _target1->setPosition( Vec2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3.0f, VisibleRect::bottom().y+ 200) ); auto sc = ScaleBy::create(2, 5); auto sc_back = sc->reverse(); _target1->runAction( RepeatForever::create(Sequence::create(sc, sc_back, NULL) ) ); _target2 = NodeGrid::create(); - _target2->setAnchorPoint(Vector2(0.5,0.5)); + _target2->setAnchorPoint(Vec2(0.5,0.5)); auto tamara = Sprite::create("Images/grossinis_sister1.png"); _target2->addChild(tamara); _bgNode->addChild(_target2); - _target2->setPosition( Vector2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3.0f,VisibleRect::bottom().y+200) ); + _target2->setPosition( Vec2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3.0f,VisibleRect::bottom().y+200) ); auto sc2 = ScaleBy::create(2, 5); auto sc2_back = sc2->reverse(); _target2->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, NULL) ) ); diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index ec12291ef7..4ef67521fe 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -86,7 +86,7 @@ public: static ActionInterval* create(float t) { auto size = Director::getInstance()->getWinSize(); - return Lens3D::create(t, Size(15,10), Vector2(size.width/2,size.height/2), 240); + return Lens3D::create(t, Size(15,10), Vec2(size.width/2,size.height/2), 240); } }; @@ -97,7 +97,7 @@ public: static ActionInterval* create(float t) { auto size = Director::getInstance()->getWinSize(); - return Ripple3D::create(t, Size(32,24), Vector2(size.width/2,size.height/2), 240, 4, 160); + return Ripple3D::create(t, Size(32,24), Vec2(size.width/2,size.height/2), 240, 4, 160); } }; @@ -128,7 +128,7 @@ public: static ActionInterval* create(float t) { auto size = Director::getInstance()->getWinSize(); - return Twirl::create(t, Size(12,8), Vector2(size.width/2, size.height/2), 1, 2.5f); + return Twirl::create(t, Size(12,8), Vec2(size.width/2, size.height/2), 1, 2.5f); } }; @@ -349,26 +349,26 @@ TextLayer::TextLayer(void) auto bg = Sprite::create(s_back3); _gridNodeTarget->addChild(bg, 0); -// bg->setAnchorPoint( Vector2::ZERO ); +// bg->setAnchorPoint( Vec2::ZERO ); bg->setPosition(VisibleRect::center()); auto grossini = Sprite::create(s_pathSister2); _gridNodeTarget->addChild(grossini, 1); - grossini->setPosition( Vector2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); + grossini->setPosition( Vec2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); auto sc = ScaleBy::create(2, 5); auto sc_back = sc->reverse(); grossini->runAction( RepeatForever::create(Sequence::create(sc, sc_back, NULL) ) ); auto tamara = Sprite::create(s_pathSister1); _gridNodeTarget->addChild(tamara, 1); - tamara->setPosition( Vector2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); + tamara->setPosition( Vec2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); auto sc2 = ScaleBy::create(2, 5); auto sc2_back = sc2->reverse(); tamara->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, NULL)) ); auto label = Label::createWithTTF((effectsList[actionIdx]).c_str(), "fonts/Marker Felt.ttf", 32); - label->setPosition( Vector2(VisibleRect::center().x,VisibleRect::top().y-80) ); + label->setPosition( Vec2(VisibleRect::center().x,VisibleRect::top().y-80) ); addChild(label); label->setTag( kTagLabel ); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index ee8705c9e2..03c7d031a1 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -160,7 +160,7 @@ void ArmatureTestLayer::onEnter() auto label = Label::createWithTTF(pTitle, "fonts/arial.ttf", 18); label->setColor(Color3B::BLACK); addChild(label, 1, 10000); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 30) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 30) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) @@ -168,7 +168,7 @@ void ArmatureTestLayer::onEnter() auto l = Label::createWithTTF(strSubtitle.c_str(), "fonts/arial.ttf", 18); l->setColor(Color3B::BLACK); addChild(l, 1, 10001); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 60) ); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } // add menu @@ -178,10 +178,10 @@ void ArmatureTestLayer::onEnter() Menu *menu = Menu::create(backItem, restartItem, nextItem, nullptr); - menu->setPosition(Vector2::ZERO); - backItem->setPosition(Vector2(VisibleRect::center().x - restartItem->getContentSize().width * 2, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); - restartItem->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); - nextItem->setPosition(Vector2(VisibleRect::center().x + restartItem->getContentSize().width * 2, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + menu->setPosition(Vec2::ZERO); + backItem->setPosition(Vec2(VisibleRect::center().x - restartItem->getContentSize().width * 2, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + restartItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + nextItem->setPosition(Vec2(VisibleRect::center().x + restartItem->getContentSize().width * 2, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); addChild(menu, 100); @@ -303,7 +303,7 @@ void TestDirectLoading::onEnter() Armature *armature = Armature::create("bear"); armature->getAnimation()->playWithIndex(0); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y)); addChild(armature); } std::string TestDirectLoading::title() const @@ -320,7 +320,7 @@ void TestCSWithSkeleton::onEnter() armature->getAnimation()->playWithIndex(0); armature->setScale(0.2f); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); addChild(armature); } @@ -370,7 +370,7 @@ void TestPerformance::onEnter() Menu *menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(VisibleRect::getVisibleRect().size.width/2, VisibleRect::getVisibleRect().size.height-100)); + menu->setPosition(Vec2(VisibleRect::getVisibleRect().size.width/2, VisibleRect::getVisibleRect().size.height-100)); addChild(menu, 10000); armatureCount = frames = times = lastTimes = 0; @@ -468,7 +468,7 @@ void TestChangeZorder::onEnter() armature = Armature::create("Knight_f/Knight"); armature->getAnimation()->playWithIndex(0); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y - 100)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y - 100)); ++currentTag; armature->setScale(0.6f); addChild(armature, currentTag, currentTag); @@ -476,13 +476,13 @@ void TestChangeZorder::onEnter() armature = Armature::create("Cowboy"); armature->getAnimation()->playWithIndex(0); armature->setScale(0.24f); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y - 100)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y - 100)); ++currentTag; addChild(armature, currentTag, currentTag); armature = Armature::create("Dragon"); armature->getAnimation()->playWithIndex(0); - armature->setPosition(Vector2(VisibleRect::center().x , VisibleRect::center().y - 100)); + armature->setPosition(Vec2(VisibleRect::center().x , VisibleRect::center().y - 100)); ++currentTag; armature->setScale(0.6f); addChild(armature, currentTag, currentTag); @@ -516,7 +516,7 @@ void TestAnimationEvent::onEnter() armature->getAnimation()->play("Fire"); armature->setScaleX(-0.24f); armature->setScaleY(0.24f); - armature->setPosition(Vector2(VisibleRect::left().x + 50, VisibleRect::left().y)); + armature->setPosition(Vec2(VisibleRect::left().x + 50, VisibleRect::left().y)); /* * Set armature's movement event callback function @@ -535,14 +535,14 @@ void TestAnimationEvent::animationEvent(Armature *armature, MovementEventType mo { if (movementID == "Fire") { - ActionInterval *actionToRight = MoveTo::create(2, Vector2(VisibleRect::right().x - 50, VisibleRect::right().y)); + ActionInterval *actionToRight = MoveTo::create(2, Vec2(VisibleRect::right().x - 50, VisibleRect::right().y)); armature->stopAllActions(); armature->runAction(Sequence::create(actionToRight, CallFunc::create( CC_CALLBACK_0(TestAnimationEvent::callback1, this)), nullptr)); armature->getAnimation()->play("Walk"); } else if (movementID == "FireMax") { - ActionInterval *actionToLeft = MoveTo::create(2, Vector2(VisibleRect::left().x + 50, VisibleRect::left().y)); + ActionInterval *actionToLeft = MoveTo::create(2, Vec2(VisibleRect::left().x + 50, VisibleRect::left().y)); armature->stopAllActions(); armature->runAction(Sequence::create(actionToLeft, CallFunc::create( CC_CALLBACK_0(TestAnimationEvent::callback2, this)), nullptr)); armature->getAnimation()->play("Walk"); @@ -571,7 +571,7 @@ void TestFrameEvent::onEnter() Armature *armature = Armature::create("HeroAnimation"); armature->getAnimation()->play("attack"); armature->getAnimation()->setSpeedScale(0.5); - armature->setPosition(Vector2(VisibleRect::center().x - 50, VisibleRect::center().y -100)); + armature->setPosition(Vec2(VisibleRect::center().x - 50, VisibleRect::center().y -100)); /* * Set armature's frame event callback function @@ -681,7 +681,7 @@ void TestUseMutiplePicture::onEnter() armature = Armature::create("Knight_f/Knight"); armature->getAnimation()->playWithIndex(0); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::left().y)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::left().y)); armature->setScale(1.2f); addChild(armature); @@ -701,7 +701,7 @@ void TestUseMutiplePicture::onEnter() // } auto l = Label::createWithTTF("This is a weapon!", "fonts/arial.ttf", 18); - l->setAnchorPoint(Vector2(0.2f, 0.5f)); + l->setAnchorPoint(Vec2(0.2f, 0.5f)); armature->getBone("weapon")->addDisplay(l, 7); } @@ -741,7 +741,7 @@ void TestColliderDetector::onEnter() armature->getAnimation()->setSpeedScale(0.2f); armature->setScaleX(-0.2f); armature->setScaleY(0.2f); - armature->setPosition(Vector2(VisibleRect::left().x + 70, VisibleRect::left().y)); + armature->setPosition(Vec2(VisibleRect::left().x + 70, VisibleRect::left().y)); /* * Set armature's frame event callback function @@ -754,7 +754,7 @@ void TestColliderDetector::onEnter() armature2->getAnimation()->play("Walk"); armature2->setScaleX(-0.2f); armature2->setScaleY(0.2f); - armature2->setPosition(Vector2(VisibleRect::right().x - 60, VisibleRect::left().y)); + armature2->setPosition(Vec2(VisibleRect::right().x - 60, VisibleRect::left().y)); addChild(armature2); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT @@ -780,11 +780,11 @@ void TestColliderDetector::onFrameEvent(Bone *bone, const std::string& evt, int * frame event may be delay emit, so originFrameIndex may be different from currentFrameIndex. */ - Vector2 p = armature->getBone("Layer126")->getDisplayRenderNode()->convertToWorldSpaceAR(Vector2(0, 0)); - bullet->setPosition(Vector2(p.x + 60, p.y)); + Vec2 p = armature->getBone("Layer126")->getDisplayRenderNode()->convertToWorldSpaceAR(Vec2(0, 0)); + bullet->setPosition(Vec2(p.x + 60, p.y)); bullet->stopAllActions(); - bullet->runAction(CCMoveBy::create(1.5f, Vector2(350, 0))); + bullet->runAction(CCMoveBy::create(1.5f, Vec2(350, 0))); } @@ -842,7 +842,7 @@ void TestColliderDetector::onExit() ArmatureTestLayer::onExit(); } -void TestColliderDetector::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TestColliderDetector::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION ); Director* director = Director::getInstance(); @@ -909,7 +909,7 @@ void TestColliderDetector::initWorld() bullet->setB2Body(body); bullet->setPTMRatio(PT_RATIO); - bullet->setPosition( Vector2( -100, -100) ); + bullet->setPosition( Vec2( -100, -100) ); body = world->CreateBody(&bodyDef); armature2->setBody(body); @@ -1036,13 +1036,13 @@ void TestColliderDetector::update(float delta) for (const auto& object : bodyList) { ColliderBody *body = static_cast(object); - const std::vector &vertexList = body->getCalculatedVertexList(); + const std::vector &vertexList = body->getCalculatedVertexList(); float minx = 0, miny = 0, maxx = 0, maxy = 0; size_t length = vertexList.size(); for (size_t i = 0; iaddCommand(&_customCommand); } -void TestColliderDetector::onDraw(const Matrix &transform, bool transformUpdated) +void TestColliderDetector::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1106,7 +1106,7 @@ std::string TestBoundingBox::title() const { return "Test BoundingBox"; } -void TestBoundingBox::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TestBoundingBox::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(TestBoundingBox::onDraw, this, transform, transformUpdated); @@ -1114,7 +1114,7 @@ void TestBoundingBox::draw(Renderer *renderer, const Matrix &transform, bool tra } -void TestBoundingBox::onDraw(const Matrix &transform, bool transformUpdated) +void TestBoundingBox::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -1122,7 +1122,7 @@ void TestBoundingBox::onDraw(const Matrix &transform, bool transformUpdated) rect = armature->getBoundingBox(); DrawPrimitives::setDrawColor4B(100, 100, 100, 255); - DrawPrimitives::drawRect(rect.origin, Vector2(rect.getMaxX(), rect.getMaxY())); + DrawPrimitives::drawRect(rect.origin, Vec2(rect.getMaxX(), rect.getMaxY())); } void TestAnchorPoint::onEnter() @@ -1138,11 +1138,11 @@ void TestAnchorPoint::onEnter() addChild(armature, 0, i); } - getChildByTag(0)->setAnchorPoint(Vector2(0, 0)); - getChildByTag(1)->setAnchorPoint(Vector2(0, 1)); - getChildByTag(2)->setAnchorPoint(Vector2(1, 0)); - getChildByTag(3)->setAnchorPoint(Vector2(1, 1)); - getChildByTag(4)->setAnchorPoint(Vector2(0.5, 0.5)); + getChildByTag(0)->setAnchorPoint(Vec2(0, 0)); + getChildByTag(1)->setAnchorPoint(Vec2(0, 1)); + getChildByTag(2)->setAnchorPoint(Vec2(1, 0)); + getChildByTag(3)->setAnchorPoint(Vec2(1, 1)); + getChildByTag(4)->setAnchorPoint(Vec2(0.5, 0.5)); } std::string TestAnchorPoint::title() const @@ -1247,7 +1247,7 @@ void Hero::changeMount(Armature *armature) bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); - setPosition(Vector2(0,0)); + setPosition(Vec2(0,0)); //Change animation playWithIndex(1); @@ -1282,8 +1282,8 @@ void TestArmatureNesting2::onEnter() Menu* pMenu =Menu::create(pMenuItem, nullptr); - pMenu->setPosition( Vector2() ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 67, VisibleRect::bottom().y + 50) ); + pMenu->setPosition( Vec2() ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 67, VisibleRect::bottom().y + 50) ); addChild(pMenu, 2); @@ -1291,16 +1291,16 @@ void TestArmatureNesting2::onEnter() hero = Hero::create("hero"); hero->setLayer(this); hero->playWithIndex(0); - hero->setPosition(Vector2(VisibleRect::left().x + 20, VisibleRect::left().y)); + hero->setPosition(Vec2(VisibleRect::left().x + 20, VisibleRect::left().y)); addChild(hero); //Create 3 mount horse = createMount("horse", VisibleRect::center()); - horse2 = createMount("horse", Vector2(120, 200)); + horse2 = createMount("horse", Vec2(120, 200)); horse2->setOpacity(200); - bear = createMount("bear", Vector2(300,70)); + bear = createMount("bear", Vec2(300,70)); } void TestArmatureNesting2::onExit() { @@ -1316,7 +1316,7 @@ std::string TestArmatureNesting2::subtitle() const } void TestArmatureNesting2::onTouchesEnded(const std::vector& touches, Event* event) { - Vector2 point = touches[0]->getLocation(); + Vec2 point = touches[0]->getLocation(); Armature *armature = hero->getMount() == nullptr ? hero : hero->getMount(); @@ -1360,7 +1360,7 @@ void TestArmatureNesting2::changeMountCallback(Ref* pSender) } } -Armature * TestArmatureNesting2::createMount(const char *name, Vector2 position) +Armature * TestArmatureNesting2::createMount(const char *name, Vec2 position) { Armature *armature = Armature::create(name); armature->getAnimation()->playWithIndex(0); @@ -1390,7 +1390,7 @@ void TestPlaySeveralMovement::onEnter() // armature->getAnimation()->playWithIndexes(indexes); armature->setScale(0.2f); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); addChild(armature); } std::string TestPlaySeveralMovement::title() const @@ -1418,7 +1418,7 @@ void TestEasing::onEnter() armature->getAnimation()->playWithIndex(0); armature->setScale(0.8f); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y)); addChild(armature); updateSubTitle(); @@ -1460,7 +1460,7 @@ void TestChangeAnimationInternal::onEnter() armature->getAnimation()->playWithIndex(0); armature->setScale(0.2f); - armature->setPosition(Vector2(VisibleRect::center().x, VisibleRect::center().y)); + armature->setPosition(Vec2(VisibleRect::center().x, VisibleRect::center().y)); addChild(armature); } void TestChangeAnimationInternal::onExit() diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index a084255f0e..7d939d594a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -211,7 +211,7 @@ public: virtual void onEnter() override; virtual void onExit() override; virtual std::string title() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual void update(float delta); void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); @@ -270,8 +270,8 @@ public: virtual void onEnter() override; virtual std::string title() const override; virtual void update(float delta); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; - void onDraw(const Matrix &transform, bool transformUpdated); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; + void onDraw(const Mat4 &transform, bool transformUpdated); void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); @@ -293,13 +293,13 @@ class TestBoundingBox : public ArmatureTestLayer public: virtual void onEnter() override; virtual std::string title() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; cocostudio::Armature *armature; Rect rect; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _customCommand; }; @@ -346,7 +346,7 @@ public: void onTouchesEnded(const std::vector& touches, Event* event); void changeMountCallback(Ref* pSender); - virtual cocostudio::Armature *createMount(const char *name, Vector2 position); + virtual cocostudio::Armature *createMount(const char *name, Vec2 position); private: Hero *hero; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp index 644d792173..b30693dff6 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp @@ -73,7 +73,7 @@ cocos2d::Node* ComponentsTestLayer::createGameScene() auto player = Sprite::create("components/Player.png", Rect(0, 0, 27, 40) ); - player->setPosition( Vector2(origin.x + player->getContentSize().width/2, + player->setPosition( Vec2(origin.x + player->getContentSize().width/2, origin.y + visibleSize.height/2) ); root = cocos2d::Node::create(); @@ -87,9 +87,9 @@ cocos2d::Node* ComponentsTestLayer::createGameScene() }); itemBack->setColor(Color3B(0, 0, 0)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menuBack = Menu::create(itemBack, nullptr); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); }while (0); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp index f36c884d0e..43bfdb1fd1 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp @@ -32,7 +32,7 @@ void EnemyController::onEnter() // Create the target slightly off-screen along the right edge, // and along a random position along the Y axis as calculated _owner->setPosition( - Vector2(winSize.width + (getOwner()->getContentSize().width/2), + Vec2(winSize.width + (getOwner()->getContentSize().width/2), Director::getInstance()->getVisibleOrigin().y + actualY) ); @@ -45,7 +45,7 @@ void EnemyController::onEnter() // Create the actions FiniteTimeAction* actionMove = MoveTo::create( actualDuration, - Vector2(0 - getOwner()->getContentSize().width/2, actualY) ); + Vec2(0 - getOwner()->getContentSize().width/2, actualY) ); FiniteTimeAction* actionMoveDone = CallFuncN::create( CC_CALLBACK_1(SceneController::spriteMoveFinished, static_cast( getOwner()->getParent()->getComponent("SceneController") ))); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp index 0aee850835..b3fdffb35c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp @@ -63,7 +63,7 @@ bool GameOverLayer::init() this->_label = Label::createWithTTF("","fonts/arial.ttf", 32); _label->retain(); _label->setColor( Color3B(0, 0, 0) ); - _label->setPosition( Vector2(winSize.width/2, winSize.height/2) ); + _label->setPosition( Vec2(winSize.width/2, winSize.height/2) ); this->addChild(_label); this->runAction( Sequence::create( @@ -79,9 +79,9 @@ bool GameOverLayer::init() }); itemBack->setColor(Color3B(0, 0, 0)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menuBack = Menu::create(itemBack, nullptr); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); return true; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp index fb9df333e9..4eb202ee0e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp @@ -40,7 +40,7 @@ void PlayerController::onTouchesEnded(const std::vector& touches, Event { // Choose one of the touches to work with Touch* touch = touches[0]; - Vector2 location = touch->getLocation(); + Vec2 location = touch->getLocation(); Sprite *projectile = Sprite::create("components/Projectile.png", Rect(0, 0, 20, 20)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp index bf9ffaf9b3..8953849118 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp @@ -24,7 +24,7 @@ void ProjectileController::onEnter() ComController::onEnter(); auto winSize = Director::getInstance()->getVisibleSize(); auto origin = Director::getInstance()->getVisibleOrigin(); - _owner->setPosition( Vector2(origin.x+20, origin.y+winSize.height/2) ); + _owner->setPosition( Vec2(origin.x+20, origin.y+winSize.height/2) ); _owner->setTag(3); auto com = _owner->getParent()->getComponent("SceneController"); static_cast(com)->getProjectiles().pushBack(_owner); @@ -113,7 +113,7 @@ void ProjectileController::move(float flocationX, float flocationY) float realX = origin.x + winSize.width + (_owner->getContentSize().width/2); float ratio = offY / offX; float realY = (realX * ratio) + _owner->getPosition().y; - Vector2 realDest = Vector2(realX, realY); + Vec2 realDest = Vec2(realX, realY); // Determine the length of how far we're shooting float offRealX = realX - _owner->getPosition().x; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index db2c88bb4f..6a7cf9c5fd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -117,7 +117,7 @@ void SceneEditorTestLayer::onEnter() auto label = Label::createWithTTF(pTitle, "fonts/arial.ttf", 18); label->setTextColor(Color4B::WHITE); addChild(label, 1, 10000); - label->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 30) ); + label->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 30) ); std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) @@ -125,7 +125,7 @@ void SceneEditorTestLayer::onEnter() auto l = Label::createWithTTF(strSubtitle.c_str(), "fonts/arial.ttf", 18); l->setTextColor(Color4B::BLACK); addChild(l, 1, 10001); - l->setPosition(Vector2(VisibleRect::center().x, VisibleRect::top().y - 60) ); + l->setPosition(Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } // add menu @@ -138,14 +138,14 @@ void SceneEditorTestLayer::onEnter() float fScale = 0.5f; - menu->setPosition(Vector2(0, 0)); - backItem->setPosition(Vector2(VisibleRect::center().x - restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + menu->setPosition(Vec2(0, 0)); + backItem->setPosition(Vec2(VisibleRect::center().x - restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); backItem->setScale(fScale); - restartItem->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + restartItem->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); restartItem->setScale(fScale); - nextItem->setPosition(Vector2(VisibleRect::center().x + restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); + nextItem->setPosition(Vec2(VisibleRect::center().x + restartItem->getContentSize().width * 2 * fScale, VisibleRect::bottom().y + restartItem->getContentSize().height / 2)); nextItem->setScale(fScale); addChild(menu, 100); @@ -194,7 +194,7 @@ void SceneEditorTestLayer::backCallback(Ref *pSender) s->release(); } -void SceneEditorTestLayer::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void SceneEditorTestLayer::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { Layer::draw(renderer, transform, transformUpdated); } @@ -344,10 +344,10 @@ cocos2d::Node* ArmatureComponentTest::createGameScene() return nullptr; } ComRender *pBlowFish = static_cast(node->getChildByTag(10007)->getComponent("CCArmature")); - pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vector2(-1000.0f, 0))); + pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); ComRender *pButterflyfish = static_cast(node->getChildByTag(10008)->getComponent("CCArmature")); - pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vector2(-1000.0f, 0))); + pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); return node; } @@ -412,10 +412,10 @@ void UIComponentTest::touchEvent(Ref *pSender, ui::Widget::TouchEventType type) case ui::Widget::TouchEventType::BEGAN: { ComRender *pBlowFish = static_cast(_node->getChildByTag(10010)->getComponent("CCArmature")); - pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vector2(-1000.0f, 0))); + pBlowFish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); ComRender *pButterflyfish = static_cast(_node->getChildByTag(10011)->getComponent("CCArmature")); - pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vector2(-1000.0f, 0))); + pButterflyfish->getNode()->runAction(CCMoveBy::create(10.0f, Vec2(-1000.0f, 0))); } break; default: @@ -523,7 +523,7 @@ cocos2d::Node* ParticleComponentTest::createGameScene() } ComRender* Particle = static_cast(node->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); - ActionInterval* jump = JumpBy::create(5, Vector2(-500,0), 50, 4); + ActionInterval* jump = JumpBy::create(5, Vec2(-500,0), 50, 4); FiniteTimeAction* action = Sequence::create( jump, jump->reverse(), nullptr); Particle->getNode()->runAction(action); return node; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 3b3704e474..76a5ceedfa 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -43,7 +43,7 @@ public: virtual void nextCallback(cocos2d::Ref* pSender); virtual void backCallback(cocos2d::Ref* pSender); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: MenuItemImage *restartItem; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h index ed3512efde..08ffae0b2a 100755 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.h @@ -36,7 +36,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _pos; + cocos2d::Vec2 _pos; }; @@ -54,7 +54,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _pos; + cocos2d::Vec2 _pos; bool _reverse; }; @@ -110,7 +110,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _scale; + cocos2d::Vec2 _scale; }; @@ -128,7 +128,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _scale; + cocos2d::Vec2 _scale; bool _reverse; }; @@ -148,7 +148,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _skew; + cocos2d::Vec2 _skew; }; @@ -166,7 +166,7 @@ public: private: int _tag; float _duration; - cocos2d::Vector2 _skew; + cocos2d::Vec2 _skew; bool _reverse; }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h index a7400d0c20..6fb23a0195 100755 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.h @@ -59,7 +59,7 @@ public: virtual void removeAll(); private: int _tag; - cocos2d::Vector2 _origin; + cocos2d::Vec2 _origin; cocos2d::Size _size; }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp index 818e96e25e..73cda0fae7 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp @@ -65,7 +65,7 @@ bool ControlButtonTest_HelloVariableSize::init() button->setColor(Color3B(0, 0, 255)); } - button->setPosition(Vector2 (total_width + button->getContentSize().width / 2, button->getContentSize().height / 2)); + button->setPosition(Vec2 (total_width + button->getContentSize().width / 2, button->getContentSize().height / 2)); layer->addChild(button); // Compute the size of the layer @@ -74,14 +74,14 @@ bool ControlButtonTest_HelloVariableSize::init() i++; } - layer->setAnchorPoint(Vector2 (0.5, 0.5)); + layer->setAnchorPoint(Vec2 (0.5, 0.5)); layer->setContentSize(Size(total_width, height)); - layer->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + layer->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); // Add the black background auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(total_width + 14, height + 14)); - background->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + background->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); addChild(background); return true; } @@ -126,13 +126,13 @@ bool ControlButtonTest_Event::init() // Add a label in which the button events will be displayed setDisplayValueLabel(Label::createWithTTF("No Event", "fonts/Marker Felt.ttf", 32)); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); addChild(_displayValueLabel, 1); setDisplayBitmaskLabel(Label::createWithTTF("No bitmask event", "fonts/Marker Felt.ttf", 24)); - _displayBitmaskLabel->setAnchorPoint(Vector2(0.5f, -1)); - Vector2 bitmaskLabelPos = _displayValueLabel->getPosition() - Vector2(0, _displayBitmaskLabel->getBoundingBox().size.height); + _displayBitmaskLabel->setAnchorPoint(Vec2(0.5f, -1)); + Vec2 bitmaskLabelPos = _displayValueLabel->getPosition() - Vec2(0, _displayBitmaskLabel->getBoundingBox().size.height); _displayBitmaskLabel->setPosition(bitmaskLabelPos); addChild(_displayBitmaskLabel, 1); @@ -148,14 +148,14 @@ bool ControlButtonTest_Event::init() controlButton->setBackgroundSpriteForState(backgroundHighlightedButton, Control::State::HIGH_LIGHTED); controlButton->setTitleColorForState(Color3B::WHITE, Control::State::HIGH_LIGHTED); - controlButton->setAnchorPoint(Vector2(0.5f, 1)); - controlButton->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + controlButton->setAnchorPoint(Vec2(0.5f, 1)); + controlButton->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); addChild(controlButton, 1); // Add the black background auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(300, 170)); - background->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + background->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); addChild(background); // Sets up event handlers @@ -244,7 +244,7 @@ bool ControlButtonTest_Styling::init() ControlButton *button = standardButtonWithTitle(String::createWithFormat("%d",rand() % 30)->getCString()); button->setAdjustBackgroundImage(false); // Tells the button that the background image must not be adjust // It'll use the prefered size of the background image - button->setPosition(Vector2(button->getContentSize().width / 2 + (button->getContentSize().width + space) * i, + button->setPosition(Vec2(button->getContentSize().width / 2 + (button->getContentSize().width + space) * i, button->getContentSize().height / 2 + (button->getContentSize().height + space) * j)); layer->addChild(button); @@ -253,14 +253,14 @@ bool ControlButtonTest_Styling::init() } } - layer->setAnchorPoint(Vector2(0.5, 0.5)); + layer->setAnchorPoint(Vec2(0.5, 0.5)); layer->setContentSize(Size(max_w, max_h)); - layer->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + layer->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); // Add the black background auto backgroundButton = Scale9Sprite::create("extensions/buttonBackground.png"); backgroundButton->setContentSize(Size(max_w + 14, max_h + 14)); - backgroundButton->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + backgroundButton->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); addChild(backgroundButton); return true; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp index 7efc9fe23d..5a53c8c1ab 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp @@ -39,7 +39,7 @@ bool ControlColourPickerTest::init() auto screenSize = Director::getInstance()->getWinSize(); auto layer = Node::create(); - layer->setPosition(Vector2 (screenSize.width / 2, screenSize.height / 2)); + layer->setPosition(Vec2 (screenSize.width / 2, screenSize.height / 2)); addChild(layer, 1); double layer_width = 0; @@ -47,7 +47,7 @@ bool ControlColourPickerTest::init() // Create the colour picker ControlColourPicker *colourPicker = ControlColourPicker::create(); colourPicker->setColor(Color3B(37, 46, 252)); - colourPicker->setPosition(Vector2 (colourPicker->getContentSize().width / 2, 0)); + colourPicker->setPosition(Vec2 (colourPicker->getContentSize().width / 2, 0)); // Add it to the layer layer->addChild(colourPicker); @@ -61,7 +61,7 @@ bool ControlColourPickerTest::init() // Add the black background for the text auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(150, 50)); - background->setPosition(Vector2(layer_width + background->getContentSize().width / 2.0f, 0)); + background->setPosition(Vec2(layer_width + background->getContentSize().width / 2.0f, 0)); layer->addChild(background); layer_width += background->getContentSize().width; @@ -74,7 +74,7 @@ bool ControlColourPickerTest::init() // Set the layer size layer->setContentSize(Size(layer_width, 0)); - layer->setAnchorPoint(Vector2 (0.5f, 0.5f)); + layer->setAnchorPoint(Vec2 (0.5f, 0.5f)); // Update the color text colourValueChanged(colourPicker, Control::EventType::VALUE_CHANGED); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp index ca499c4562..2c69b440b0 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp @@ -42,7 +42,7 @@ bool ControlPotentiometerTest::init() auto screenSize = Director::getInstance()->getWinSize(); auto layer = Node::create(); - layer->setPosition(Vector2(screenSize.width / 2, screenSize.height / 2)); + layer->setPosition(Vec2(screenSize.width / 2, screenSize.height / 2)); this->addChild(layer, 1); double layer_width = 0; @@ -50,7 +50,7 @@ bool ControlPotentiometerTest::init() // Add the black background for the text auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(80, 50)); - background->setPosition(Vector2(layer_width + background->getContentSize().width / 2.0f, 0)); + background->setPosition(Vec2(layer_width + background->getContentSize().width / 2.0f, 0)); layer->addChild(background); layer_width += background->getContentSize().width; @@ -64,7 +64,7 @@ bool ControlPotentiometerTest::init() ControlPotentiometer *potentiometer = ControlPotentiometer::create("extensions/potentiometerTrack.png" ,"extensions/potentiometerProgress.png" ,"extensions/potentiometerButton.png"); - potentiometer->setPosition(Vector2(layer_width + 10 + potentiometer->getContentSize().width / 2, 0)); + potentiometer->setPosition(Vec2(layer_width + 10 + potentiometer->getContentSize().width / 2, 0)); // When the value of the slider will change, the given selector will be call potentiometer->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlPotentiometerTest::valueChanged), Control::EventType::VALUE_CHANGED); @@ -75,7 +75,7 @@ bool ControlPotentiometerTest::init() // Set the layer size layer->setContentSize(Size(layer_width, 0)); - layer->setAnchorPoint(Vector2(0.5f, 0.5f)); + layer->setAnchorPoint(Vec2(0.5f, 0.5f)); // Update the value label this->valueChanged(potentiometer, Control::EventType::VALUE_CHANGED); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp index f4275160f9..53f0a9028c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp @@ -43,9 +43,9 @@ bool ControlScene::init() if (Layer::init()) { auto pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(ControlScene::toExtensionsMainLayer, this)); - pBackItem->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + pBackItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto pBackMenu = Menu::create(pBackItem, NULL); - pBackMenu->setPosition( Vector2::ZERO ); + pBackMenu->setPosition( Vec2::ZERO ); addChild(pBackMenu, 10); // Add the generated background @@ -56,12 +56,12 @@ bool ControlScene::init() // Add the ribbon auto ribbon = Scale9Sprite::create("extensions/ribbon.png", Rect(1, 1, 48, 55)); ribbon->setContentSize(Size(VisibleRect::getVisibleRect().size.width, 57)); - ribbon->setPosition(Vector2(VisibleRect::center().x, VisibleRect::top().y - ribbon->getContentSize().height / 2.0f)); + ribbon->setPosition(Vec2(VisibleRect::center().x, VisibleRect::top().y - ribbon->getContentSize().height / 2.0f)); addChild(ribbon); // Add the title setSceneTitleLabel(Label::createWithTTF("Title", "fonts/arial.ttf", 12)); - _sceneTitleLabel->setPosition(Vector2 (VisibleRect::center().x, VisibleRect::top().y - _sceneTitleLabel->getContentSize().height / 2 - 5)); + _sceneTitleLabel->setPosition(Vec2 (VisibleRect::center().x, VisibleRect::top().y - _sceneTitleLabel->getContentSize().height / 2 - 5)); addChild(_sceneTitleLabel, 1); // Add the menu @@ -70,10 +70,10 @@ bool ControlScene::init() auto item3 = MenuItemImage::create("Images/f1.png", "Images/f2.png", CC_CALLBACK_1(ControlScene::nextCallback, this)); auto menu = Menu::create(item1, item3, item2, NULL); - menu->setPosition(Vector2::ZERO); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + menu->setPosition(Vec2::ZERO); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu ,1); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp index 0cdfad7b9b..57383bab4d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp @@ -45,29 +45,29 @@ bool ControlSliderTest::init() // Add a label in which the slider value will be displayed _displayValueLabel = Label::createWithTTF("Move the slider thumb!\nThe lower slider is restricted." ,"fonts/Marker Felt.ttf", 32); _displayValueLabel->retain(); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(screenSize.width / 1.7f, screenSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(screenSize.width / 1.7f, screenSize.height / 2.0f)); addChild(_displayValueLabel); // Add the slider ControlSlider *slider = ControlSlider::create("extensions/sliderTrack.png","extensions/sliderProgress.png" ,"extensions/sliderThumb.png"); - slider->setAnchorPoint(Vector2(0.5f, 1.0f)); + slider->setAnchorPoint(Vec2(0.5f, 1.0f)); slider->setMinimumValue(0.0f); // Sets the min value of range slider->setMaximumValue(5.0f); // Sets the max value of range - slider->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + 16)); + slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + 16)); slider->setTag(1); // When the value of the slider will change, the given selector will be call slider->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlSliderTest::valueChanged), Control::EventType::VALUE_CHANGED); ControlSlider *restrictSlider = ControlSlider::create("extensions/sliderTrack.png","extensions/sliderProgress.png" ,"extensions/sliderThumb.png"); - restrictSlider->setAnchorPoint(Vector2(0.5f, 1.0f)); + restrictSlider->setAnchorPoint(Vec2(0.5f, 1.0f)); restrictSlider->setMinimumValue(0.0f); // Sets the min value of range restrictSlider->setMaximumValue(5.0f); // Sets the max value of range restrictSlider->setMaximumAllowedValue(4.0f); restrictSlider->setMinimumAllowedValue(1.5f); restrictSlider->setValue(3.0f); - restrictSlider->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f - 24)); + restrictSlider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f - 24)); restrictSlider->setTag(2); //same with restricted diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp index 33fa3e2f20..51b8a9723c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp @@ -43,7 +43,7 @@ bool ControlStepperTest::init() auto screenSize = Director::getInstance()->getWinSize(); auto layer = Node::create(); - layer->setPosition(Vector2 (screenSize.width / 2, screenSize.height / 2)); + layer->setPosition(Vec2 (screenSize.width / 2, screenSize.height / 2)); this->addChild(layer, 1); double layer_width = 0; @@ -51,7 +51,7 @@ bool ControlStepperTest::init() // Add the black background for the text auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(100, 50)); - background->setPosition(Vector2(layer_width + background->getContentSize().width / 2.0f, 0)); + background->setPosition(Vec2(layer_width + background->getContentSize().width / 2.0f, 0)); layer->addChild(background); this->setDisplayValueLabel(Label::createWithSystemFont("0", "HelveticaNeue-Bold", 30)); @@ -62,7 +62,7 @@ bool ControlStepperTest::init() layer_width += background->getContentSize().width; ControlStepper *stepper = this->makeControlStepper(); - stepper->setPosition(Vector2(layer_width + 10 + stepper->getContentSize().width / 2, 0)); + stepper->setPosition(Vec2(layer_width + 10 + stepper->getContentSize().width / 2, 0)); stepper->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlStepperTest::valueChanged), Control::EventType::VALUE_CHANGED); layer->addChild(stepper); @@ -70,7 +70,7 @@ bool ControlStepperTest::init() // Set the layer size layer->setContentSize(Size(layer_width, 0)); - layer->setAnchorPoint(Vector2(0.5f, 0.5f)); + layer->setAnchorPoint(Vec2(0.5f, 0.5f)); // Update the value label this->valueChanged(stepper, Control::EventType::VALUE_CHANGED); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp index 95bed9d8c0..7b4f03e288 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp @@ -38,7 +38,7 @@ bool ControlSwitchTest::init() auto screenSize = Director::getInstance()->getWinSize(); auto layer = Node::create(); - layer->setPosition(Vector2(screenSize.width / 2, screenSize.height / 2)); + layer->setPosition(Vec2(screenSize.width / 2, screenSize.height / 2)); addChild(layer, 1); double layer_width = 0; @@ -46,7 +46,7 @@ bool ControlSwitchTest::init() // Add the black background for the text auto background = Scale9Sprite::create("extensions/buttonBackground.png"); background->setContentSize(Size(80, 50)); - background->setPosition(Vector2(layer_width + background->getContentSize().width / 2.0f, 0)); + background->setPosition(Vec2(layer_width + background->getContentSize().width / 2.0f, 0)); layer->addChild(background); layer_width += background->getContentSize().width; @@ -67,14 +67,14 @@ bool ControlSwitchTest::init() Label::createWithSystemFont("On", "Arial-BoldMT", 16), Label::createWithSystemFont("Off", "Arial-BoldMT", 16) ); - switchControl->setPosition(Vector2(layer_width + 10 + switchControl->getContentSize().width / 2, 0)); + switchControl->setPosition(Vec2(layer_width + 10 + switchControl->getContentSize().width / 2, 0)); layer->addChild(switchControl); switchControl->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlSwitchTest::valueChanged), Control::EventType::VALUE_CHANGED); // Set the layer size layer->setContentSize(Size(layer_width, 0)); - layer->setAnchorPoint(Vector2(0.5f, 0.5f)); + layer->setAnchorPoint(Vec2(0.5f, 0.5f)); // Update the value label valueChanged(switchControl, Control::EventType::VALUE_CHANGED); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index c5a132f706..8d465d6390 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -20,25 +20,25 @@ EditBoxTest::EditBoxTest() auto visibleSize = glview->getVisibleSize(); auto pBg = Sprite::create("Images/HelloWorld.png"); - pBg->setPosition(Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); + pBg->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); addChild(pBg); _TTFShowEditReturn = Label::createWithSystemFont("No edit control return!", "", 30); - _TTFShowEditReturn->setPosition(Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y + visibleSize.height - 50)); + _TTFShowEditReturn->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y + visibleSize.height - 50)); addChild(_TTFShowEditReturn); // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(EditBoxTest::toExtensionsMainLayer, this)); - itemBack->setPosition(Vector2(visibleOrigin.x+visibleSize.width - 50, visibleOrigin.y+25)); + itemBack->setPosition(Vec2(visibleOrigin.x+visibleSize.width - 50, visibleOrigin.y+25)); auto menuBack = Menu::create(itemBack, NULL); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); auto editBoxSize = Size(visibleSize.width - 100, 60); // top _editName = EditBox::create(editBoxSize, Scale9Sprite::create("extensions/green_edit.png")); - _editName->setPosition(Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); + _editName->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); _editName->setFontName("Paint Boy"); _editName->setFontSize(25); _editName->setFontColor(Color3B::RED); @@ -51,7 +51,7 @@ EditBoxTest::EditBoxTest() // middle _editPassword = EditBox::create(editBoxSize, Scale9Sprite::create("extensions/orange_edit.png")); - _editPassword->setPosition(Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); + _editPassword->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) _editPassword->setFont("American Typewriter", 30); #else @@ -68,14 +68,14 @@ EditBoxTest::EditBoxTest() // bottom _editEmail = EditBox::create(Size(editBoxSize.width, editBoxSize.height), Scale9Sprite::create("extensions/yellow_edit.png")); - _editEmail->setPosition(Vector2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4)); - _editEmail->setAnchorPoint(Vector2(0.5, 1.0f)); + _editEmail->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4)); + _editEmail->setAnchorPoint(Vec2(0.5, 1.0f)); _editEmail->setPlaceHolder("Email:"); _editEmail->setInputMode(EditBox::InputMode::EMAIL_ADDRESS); _editEmail->setDelegate(this); addChild(_editEmail); - this->setPosition(Vector2(10, 20)); + this->setPosition(Vec2(10, 20)); } EditBoxTest::~EditBoxTest() diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp index 0052503d2a..0f1d1dd795 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -89,7 +89,7 @@ static struct { static const int g_maxTests = sizeof(g_extensionsTests) / sizeof(g_extensionsTests[0]); -static Vector2 s_tCurPos = Vector2::ZERO; +static Vec2 s_tCurPos = Vec2::ZERO; //////////////////////////////////////////////////////// // @@ -103,13 +103,13 @@ void ExtensionsMainLayer::onEnter() auto s = Director::getInstance()->getWinSize(); _itemMenu = Menu::create(); - _itemMenu->setPosition( Vector2::ZERO ); + _itemMenu->setPosition( Vec2::ZERO ); MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); for (int i = 0; i < g_maxTests; ++i) { auto pItem = MenuItemFont::create(g_extensionsTests[i].name, g_extensionsTests[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -143,17 +143,17 @@ void ExtensionsMainLayer::onTouchesMoved(const std::vector& touches, Eve float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -168,17 +168,17 @@ void ExtensionsMainLayer::onMouseScroll(Event* event) float nMoveY = mouseEvent->getScrollY() * 6; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.h index 0b30b1a886..de785ce3ca 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.h @@ -11,7 +11,7 @@ public: void onTouchesBegan(const std::vector& touches, Event *event); void onTouchesMoved(const std::vector& touches, Event *event); - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; int _testcount; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 9aa98f9213..e2d1187fc9 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -15,53 +15,53 @@ HttpClientTest::HttpClientTest() const int SPACE = 35; auto label = Label::createWithTTF("Http Request Test", "fonts/arial.ttf", 28); - label->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN)); + label->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN)); addChild(label, 0); auto menuRequest = Menu::create(); - menuRequest->setPosition(Vector2::ZERO); + menuRequest->setPosition(Vec2::ZERO); addChild(menuRequest); // Get auto labelGet = Label::createWithTTF("Test Get", "fonts/arial.ttf", 22); auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this)); - itemGet->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - SPACE)); + itemGet->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - SPACE)); menuRequest->addChild(itemGet); // Post auto labelPost = Label::createWithTTF("Test Post", "fonts/arial.ttf", 22); auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this)); - itemPost->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE)); + itemPost->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE)); menuRequest->addChild(itemPost); // Post Binary auto labelPostBinary = Label::createWithTTF("Test Post Binary", "fonts/arial.ttf", 22); auto itemPostBinary = MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this)); - itemPostBinary->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 3 * SPACE)); + itemPostBinary->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 3 * SPACE)); menuRequest->addChild(itemPostBinary); // Put auto labelPut = Label::createWithTTF("Test Put", "fonts/arial.ttf", 22); auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this)); - itemPut->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 4 * SPACE)); + itemPut->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 4 * SPACE)); menuRequest->addChild(itemPut); // Delete auto labelDelete = Label::createWithTTF("Test Delete", "fonts/arial.ttf", 22); auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this)); - itemDelete->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 5 * SPACE)); + itemDelete->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 5 * SPACE)); menuRequest->addChild(itemDelete); // Response Code Label _labelStatusCode = Label::createWithTTF("HTTP Status Code", "fonts/arial.ttf", 22); - _labelStatusCode->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE)); + _labelStatusCode->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE)); addChild(_labelStatusCode); // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(HttpClientTest::toExtensionsMainLayer, this)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menuBack = Menu::create(itemBack, NULL); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 5efafb8a26..8d6688c96f 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -26,72 +26,72 @@ SocketIOTestLayer::SocketIOTestLayer(void) const int SPACE = 35; auto label = Label::createWithTTF("SocketIO Extension Test", "fonts/arial.ttf", 28); - label->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN)); + label->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN)); addChild(label, 0); auto menuRequest = Menu::create(); - menuRequest->setPosition(Vector2::ZERO); + menuRequest->setPosition(Vec2::ZERO); addChild(menuRequest); // Test to create basic client in the default namespace auto labelSIOClient = Label::createWithTTF("Open SocketIO Client", "fonts/arial.ttf", 22); auto itemSIOClient = MenuItemLabel::create(labelSIOClient, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOClientClicked, this)); - itemSIOClient->setPosition(Vector2(VisibleRect::left().x + labelSIOClient->getContentSize().width / 2 + 5, winSize.height - MARGIN - SPACE)); + itemSIOClient->setPosition(Vec2(VisibleRect::left().x + labelSIOClient->getContentSize().width / 2 + 5, winSize.height - MARGIN - SPACE)); menuRequest->addChild(itemSIOClient); // Test to create a client at the endpoint '/testpoint' auto labelSIOEndpoint = Label::createWithTTF("Open SocketIO Endpoint", "fonts/arial.ttf", 22); auto itemSIOEndpoint = MenuItemLabel::create(labelSIOEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOEndpointClicked, this)); - itemSIOEndpoint->setPosition(Vector2(VisibleRect::right().x - labelSIOEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - SPACE)); + itemSIOEndpoint->setPosition(Vec2(VisibleRect::right().x - labelSIOEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - SPACE)); menuRequest->addChild(itemSIOEndpoint); // Test sending message to default namespace auto labelTestMessage = Label::createWithTTF("Send Test Message", "fonts/arial.ttf", 22); auto itemTestMessage = MenuItemLabel::create(labelTestMessage, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageClicked, this)); - itemTestMessage->setPosition(Vector2(VisibleRect::left().x + labelTestMessage->getContentSize().width / 2 + 5, winSize.height - MARGIN - 2 * SPACE)); + itemTestMessage->setPosition(Vec2(VisibleRect::left().x + labelTestMessage->getContentSize().width / 2 + 5, winSize.height - MARGIN - 2 * SPACE)); menuRequest->addChild(itemTestMessage); // Test sending message to the endpoint '/testpoint' auto labelTestMessageEndpoint = Label::createWithTTF("Test Endpoint Message", "fonts/arial.ttf", 22); auto itemTestMessageEndpoint = MenuItemLabel::create(labelTestMessageEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageEndpointClicked, this)); - itemTestMessageEndpoint->setPosition(Vector2(VisibleRect::right().x - labelTestMessageEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 2 * SPACE)); + itemTestMessageEndpoint->setPosition(Vec2(VisibleRect::right().x - labelTestMessageEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 2 * SPACE)); menuRequest->addChild(itemTestMessageEndpoint); // Test sending event 'echotest' to default namespace auto labelTestEvent = Label::createWithTTF("Send Test Event", "fonts/arial.ttf", 22); auto itemTestEvent = MenuItemLabel::create(labelTestEvent, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventClicked, this)); - itemTestEvent->setPosition(Vector2(VisibleRect::left().x + labelTestEvent->getContentSize().width / 2 + 5, winSize.height - MARGIN - 3 * SPACE)); + itemTestEvent->setPosition(Vec2(VisibleRect::left().x + labelTestEvent->getContentSize().width / 2 + 5, winSize.height - MARGIN - 3 * SPACE)); menuRequest->addChild(itemTestEvent); // Test sending event 'echotest' to the endpoint '/testpoint' auto labelTestEventEndpoint = Label::createWithTTF("Test Endpoint Event", "fonts/arial.ttf", 22); auto itemTestEventEndpoint = MenuItemLabel::create(labelTestEventEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventEndpointClicked, this)); - itemTestEventEndpoint->setPosition(Vector2(VisibleRect::right().x - labelTestEventEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 3 * SPACE)); + itemTestEventEndpoint->setPosition(Vec2(VisibleRect::right().x - labelTestEventEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 3 * SPACE)); menuRequest->addChild(itemTestEventEndpoint); // Test disconnecting basic client auto labelTestClientDisconnect = Label::createWithTTF("Disconnect Socket", "fonts/arial.ttf", 22); auto itemClientDisconnect = MenuItemLabel::create(labelTestClientDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestClientDisconnectClicked, this)); - itemClientDisconnect->setPosition(Vector2(VisibleRect::left().x + labelTestClientDisconnect->getContentSize().width / 2 + 5, winSize.height - MARGIN - 4 * SPACE)); + itemClientDisconnect->setPosition(Vec2(VisibleRect::left().x + labelTestClientDisconnect->getContentSize().width / 2 + 5, winSize.height - MARGIN - 4 * SPACE)); menuRequest->addChild(itemClientDisconnect); // Test disconnecting the endpoint '/testpoint' auto labelTestEndpointDisconnect = Label::createWithTTF("Disconnect Endpoint", "fonts/arial.ttf", 22); auto itemTestEndpointDisconnect = MenuItemLabel::create(labelTestEndpointDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEndpointDisconnectClicked, this)); - itemTestEndpointDisconnect->setPosition(Vector2(VisibleRect::right().x - labelTestEndpointDisconnect->getContentSize().width / 2 - 5, winSize.height - MARGIN - 4 * SPACE)); + itemTestEndpointDisconnect->setPosition(Vec2(VisibleRect::right().x - labelTestEndpointDisconnect->getContentSize().width / 2 - 5, winSize.height - MARGIN - 4 * SPACE)); menuRequest->addChild(itemTestEndpointDisconnect); // Sahred Status Label _sioClientStatus = Label::createWithTTF("Not connected...", "fonts/arial.ttf", 14, Size(320, 100), TextHAlignment::LEFT); - _sioClientStatus->setAnchorPoint(Vector2(0, 0)); - _sioClientStatus->setPosition(Vector2(VisibleRect::left().x, VisibleRect::rightBottom().y)); + _sioClientStatus->setAnchorPoint(Vec2(0, 0)); + _sioClientStatus->setPosition(Vec2(VisibleRect::left().x, VisibleRect::rightBottom().y)); this->addChild(_sioClientStatus); // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SocketIOTestLayer::toExtensionsMainLayer, this)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menuBack = Menu::create(itemBack, NULL); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index fb7757c31a..b33ddc961d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -28,49 +28,49 @@ WebSocketTestLayer::WebSocketTestLayer() const int SPACE = 35; auto label = Label::createWithTTF("WebSocket Test", "fonts/arial.ttf", 28); - label->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN)); + label->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN)); addChild(label, 0); auto menuRequest = Menu::create(); - menuRequest->setPosition(Vector2::ZERO); + menuRequest->setPosition(Vec2::ZERO); addChild(menuRequest); // Send Text auto labelSendText = Label::createWithTTF("Send Text", "fonts/arial.ttf", 22); auto itemSendText = MenuItemLabel::create(labelSendText, CC_CALLBACK_1(WebSocketTestLayer::onMenuSendTextClicked, this)); - itemSendText->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - SPACE)); + itemSendText->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - SPACE)); menuRequest->addChild(itemSendText); // Send Binary auto labelSendBinary = Label::createWithTTF("Send Binary", "fonts/arial.ttf", 22); auto itemSendBinary = MenuItemLabel::create(labelSendBinary, CC_CALLBACK_1(WebSocketTestLayer::onMenuSendBinaryClicked, this)); - itemSendBinary->setPosition(Vector2(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE)); + itemSendBinary->setPosition(Vec2(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE)); menuRequest->addChild(itemSendBinary); // Send Text Status Label _sendTextStatus = Label::createWithTTF("Send Text WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); - _sendTextStatus->setAnchorPoint(Vector2(0, 0)); - _sendTextStatus->setPosition(Vector2(VisibleRect::left().x, VisibleRect::rightBottom().y + 25)); + _sendTextStatus->setAnchorPoint(Vec2(0, 0)); + _sendTextStatus->setPosition(Vec2(VisibleRect::left().x, VisibleRect::rightBottom().y + 25)); this->addChild(_sendTextStatus); // Send Binary Status Label _sendBinaryStatus = Label::createWithTTF("Send Binary WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); - _sendBinaryStatus->setAnchorPoint(Vector2(0, 0)); - _sendBinaryStatus->setPosition(Vector2(VisibleRect::left().x + 160, VisibleRect::rightBottom().y + 25)); + _sendBinaryStatus->setAnchorPoint(Vec2(0, 0)); + _sendBinaryStatus->setPosition(Vec2(VisibleRect::left().x + 160, VisibleRect::rightBottom().y + 25)); this->addChild(_sendBinaryStatus); // Error Label _errorStatus = Label::createWithTTF("Error WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); - _errorStatus->setAnchorPoint(Vector2(0, 0)); - _errorStatus->setPosition(Vector2(VisibleRect::left().x + 320, VisibleRect::rightBottom().y + 25)); + _errorStatus->setAnchorPoint(Vec2(0, 0)); + _errorStatus->setPosition(Vec2(VisibleRect::left().x + 320, VisibleRect::rightBottom().y + 25)); this->addChild(_errorStatus); // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(WebSocketTestLayer::toExtensionsMainLayer, this)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menuBack = Menu::create(itemBack, NULL); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); _wsiSendText = new network::WebSocket(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index d5b2fcc3d4..1a37df2876 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -82,9 +82,9 @@ NotificationCenterTest::NotificationCenterTest() auto s = Director::getInstance()->getWinSize(); auto pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(NotificationCenterTest::toExtensionsMainLayer, this)); - pBackItem->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + pBackItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto pBackMenu = Menu::create(pBackItem, NULL); - pBackMenu->setPosition( Vector2::ZERO ); + pBackMenu->setPosition( Vec2::ZERO ); addChild(pBackMenu); auto label1 = Label::createWithTTF("switch off", "fonts/Marker Felt.ttf", 26); @@ -95,18 +95,18 @@ NotificationCenterTest::NotificationCenterTest() // turn on item->setSelectedIndex(1); auto menu = Menu::create(item, NULL); - menu->setPosition(Vector2(s.width/2+100, s.height/2)); + menu->setPosition(Vec2(s.width/2+100, s.height/2)); addChild(menu); auto menuConnect = Menu::create(); - menuConnect->setPosition(Vector2::ZERO); + menuConnect->setPosition(Vec2::ZERO); addChild(menuConnect); for (int i = 1; i <= 3; i++) { Light* light = Light::lightWithFile("Images/Pea.png"); light->setTag(kTagLight+i); - light->setPosition(Vector2(100, s.height/4*i)); + light->setPosition(Vec2(100, s.height/4*i)); addChild(light); auto label1 = Label::createWithTTF("not connected", "fonts/Marker Felt.ttf", 26); @@ -115,7 +115,7 @@ NotificationCenterTest::NotificationCenterTest() auto item2 = MenuItemLabel::create(label2); auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::connectToSwitch, this), item1, item2, NULL); item->setTag(kTagConnect+i); - item->setPosition(Vector2(light->getPosition().x, light->getPosition().y+50)); + item->setPosition(Vec2(light->getPosition().x, light->getPosition().y+50)); menuConnect->addChild(item, 0); if (i == 2) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp index d324c0fa91..07982e6498 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp @@ -144,7 +144,7 @@ void S9BatchNodeBasic::onEnter() blocks->updateWithBatchNode(batchNode, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); log("... updateWithBatchNode"); - blocks->setPosition(Vector2(x, y)); + blocks->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks); @@ -178,7 +178,7 @@ void S9FrameNameSpriteSheet::onEnter() auto blocks = Scale9Sprite::createWithSpriteFrameName("blocks9.png"); log("... created"); - blocks->setPosition(Vector2(x, y)); + blocks->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks); @@ -212,7 +212,7 @@ void S9FrameNameSpriteSheetRotated::onEnter() auto blocks = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); log("... created"); - blocks->setPosition(Vector2(x, y)); + blocks->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks); @@ -253,7 +253,7 @@ void S9BatchNodeScaledNoInsets::onEnter() blocks_scaled->updateWithBatchNode(batchNode_scaled, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); log("... updateWithBatchNode"); - blocks_scaled->setPosition(Vector2(x, y)); + blocks_scaled->setPosition(Vec2(x, y)); log("... setPosition"); blocks_scaled->setContentSize(Size(96 * 4, 96*2)); @@ -291,7 +291,7 @@ void S9FrameNameSpriteSheetScaledNoInsets::onEnter() auto blocks_scaled = Scale9Sprite::createWithSpriteFrameName("blocks9.png"); log("... created"); - blocks_scaled->setPosition(Vector2(x, y)); + blocks_scaled->setPosition(Vec2(x, y)); log("... setPosition"); blocks_scaled->setContentSize(Size(96 * 4, 96*2)); @@ -330,7 +330,7 @@ void S9FrameNameSpriteSheetRotatedScaledNoInsets::onEnter() auto blocks_scaled = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); log("... created"); - blocks_scaled->setPosition(Vector2(x, y)); + blocks_scaled->setPosition(Vec2(x, y)); log("... setPosition"); blocks_scaled->setContentSize(Size(96 * 4, 96*2)); @@ -378,7 +378,7 @@ void S9BatchNodeScaleWithCapInsets::onEnter() blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); log("... setContentSize"); - blocks_scaled_with_insets->setPosition(Vector2(x, y)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_scaled_with_insets); @@ -413,7 +413,7 @@ void S9FrameNameSpriteSheetInsets::onEnter() auto blocks_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); log("... created"); - blocks_with_insets->setPosition(Vector2(x, y)); + blocks_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_with_insets); @@ -450,7 +450,7 @@ void S9FrameNameSpriteSheetInsetsScaled::onEnter() blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); log("... setContentSize"); - blocks_scaled_with_insets->setPosition(Vector2(x, y)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_scaled_with_insets); @@ -484,7 +484,7 @@ void S9FrameNameSpriteSheetRotatedInsets::onEnter() auto blocks_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png", Rect(32, 32, 32, 32)); log("... created"); - blocks_with_insets->setPosition(Vector2(x, y)); + blocks_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_with_insets); @@ -521,7 +521,7 @@ void S9_TexturePacker::onEnter() auto s = Scale9Sprite::createWithSpriteFrameName("button_normal.png"); log("... created"); - s->setPosition(Vector2(x, y)); + s->setPosition(Vec2(x, y)); log("... setPosition"); s->setContentSize(Size(14 * 16, 10 * 16)); @@ -535,7 +535,7 @@ void S9_TexturePacker::onEnter() auto s2 = Scale9Sprite::createWithSpriteFrameName("button_actived.png"); log("... created"); - s2->setPosition(Vector2(x, y)); + s2->setPosition(Vec2(x, y)); log("... setPosition"); s2->setContentSize(Size(14 * 16, 10 * 16)); @@ -576,7 +576,7 @@ void S9FrameNameSpriteSheetRotatedInsetsScaled::onEnter() blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); log("... setContentSize"); - blocks_scaled_with_insets->setPosition(Vector2(x, y)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_scaled_with_insets); @@ -615,7 +615,7 @@ void S9FrameNameSpriteSheetRotatedSetCapInsetLater::onEnter() blocks_scaled_with_insets->setInsetRight(32); blocks_scaled_with_insets->setPreferredSize(Size(32*5.5f, 32*4)); - blocks_scaled_with_insets->setPosition(Vector2(x, y)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); this->addChild(blocks_scaled_with_insets); @@ -654,7 +654,7 @@ void S9CascadeOpacityAndColor::onEnter() auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); log("... created"); - blocks_scaled_with_insets->setPosition(Vector2(x, y)); + blocks_scaled_with_insets->setPosition(Vec2(x, y)); log("... setPosition"); rgba->addChild(blocks_scaled_with_insets); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp index ed4d5c3069..346395690b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp @@ -2,17 +2,17 @@ USING_NS_CC; -void CustomTableViewCell::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void CustomTableViewCell::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { TableViewCell::draw(renderer, transform, transformUpdated); // draw bounding box // auto pos = getPosition(); // auto size = Size(178, 200); -// Vector2 vertices[4]={ -// Vector2(pos.x+1, pos.y+1), -// Vector2(pos.x+size.width-1, pos.y+1), -// Vector2(pos.x+size.width-1, pos.y+size.height-1), -// Vector2(pos.x+1, pos.y+size.height-1), +// Vec2 vertices[4]={ +// Vec2(pos.x+1, pos.y+1), +// Vec2(pos.x+size.width-1, pos.y+1), +// Vec2(pos.x+size.width-1, pos.y+size.height-1), +// Vec2(pos.x+1, pos.y+size.height-1), // }; // DrawPrimitives::drawColor4B(0, 0, 255, 255); // DrawPrimitives::drawPoly(vertices, 4, true); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h index ca63419f98..303a3b40bc 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -7,7 +7,7 @@ class CustomTableViewCell : public cocos2d::extension::TableViewCell { public: - virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Matrix &transform, bool transformUpdated) override; + virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) override; }; #endif /* __CUSTOMTABELVIEWCELL_H__ */ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index 71ec024fb7..0bf1dc7681 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -25,14 +25,14 @@ bool TableViewTestLayer::init() TableView* tableView = TableView::create(this, Size(250, 60)); tableView->setDirection(ScrollView::Direction::HORIZONTAL); - tableView->setPosition(Vector2(20,winSize.height/2-30)); + tableView->setPosition(Vec2(20,winSize.height/2-30)); tableView->setDelegate(this); this->addChild(tableView); tableView->reloadData(); tableView = TableView::create(this, Size(60, 250)); tableView->setDirection(ScrollView::Direction::VERTICAL); - tableView->setPosition(Vector2(winSize.width-150,winSize.height/2-120)); + tableView->setPosition(Vec2(winSize.width-150,winSize.height/2-120)); tableView->setDelegate(this); tableView->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN); this->addChild(tableView); @@ -40,9 +40,9 @@ bool TableViewTestLayer::init() // Back Menu MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(TableViewTestLayer::toExtensionsMainLayer, this)); - itemBack->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); Menu *menuBack = Menu::create(itemBack, NULL); - menuBack->setPosition(Vector2::ZERO); + menuBack->setPosition(Vec2::ZERO); addChild(menuBack); return true; @@ -76,13 +76,13 @@ TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, ssize_t id cell = new CustomTableViewCell(); cell->autorelease(); auto sprite = Sprite::create("Images/Icon.png"); - sprite->setAnchorPoint(Vector2::ZERO); - sprite->setPosition(Vector2(0, 0)); + sprite->setAnchorPoint(Vec2::ZERO); + sprite->setPosition(Vec2(0, 0)); cell->addChild(sprite); auto label = Label::createWithSystemFont(string->getCString(), "Helvetica", 20.0); - label->setPosition(Vector2::ZERO); - label->setAnchorPoint(Vector2::ZERO); + label->setPosition(Vec2::ZERO); + label->setAnchorPoint(Vec2::ZERO); label->setTag(123); cell->addChild(label); } diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index a14dd6cdd1..cec7fdc3fb 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -244,7 +244,7 @@ void TestFilenameLookup::onEnter() this->addChild(sprite); auto s = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); } void TestFilenameLookup::onExit() @@ -277,12 +277,12 @@ void TestIsFileExist::onEnter() isExist = sharedFileUtils->isFileExist("Images/grossini.png"); pTTF = Label::createWithSystemFont(isExist ? "Images/grossini.png exists" : "Images/grossini.png doesn't exist", "", 20); - pTTF->setPosition(Vector2(s.width/2, s.height/3)); + pTTF->setPosition(Vec2(s.width/2, s.height/3)); this->addChild(pTTF); isExist = sharedFileUtils->isFileExist("Images/grossini.xcf"); pTTF = Label::createWithSystemFont(isExist ? "Images/grossini.xcf exists" : "Images/grossini.xcf doesn't exist", "", 20); - pTTF->setPosition(Vector2(s.width/2, s.height/3*2)); + pTTF->setPosition(Vec2(s.width/2, s.height/3*2)); this->addChild(pTTF); } @@ -366,7 +366,7 @@ void TextWritePlist::onEnter() auto label = Label::createWithTTF(fullPath.c_str(), "fonts/Thonburi.ttf", 6); this->addChild(label); auto winSize = Director::getInstance()->getWinSize(); - label->setPosition(Vector2(winSize.width/2, winSize.height/3)); + label->setPosition(Vec2(winSize.width/2, winSize.height/3)); auto loadDict = __Dictionary::createWithContentsOfFile(fullPath.c_str()); auto loadDictInDict = (__Dictionary*)loadDict->objectForKey("dictInDict, Hello World"); diff --git a/tests/cpp-tests/Classes/FontTest/FontTest.cpp b/tests/cpp-tests/Classes/FontTest/FontTest.cpp index 29165fb665..dd6a1662d1 100644 --- a/tests/cpp-tests/Classes/FontTest/FontTest.cpp +++ b/tests/cpp-tests/Classes/FontTest/FontTest.cpp @@ -114,20 +114,20 @@ void FontTest::showFont(const char *pFont) rightColor->ignoreAnchorPointForPosition(false); - top->setAnchorPoint(Vector2(0.5, 1)); - left->setAnchorPoint(Vector2(0,0.5)); - leftColor->setAnchorPoint(Vector2(0,0.5)); - center->setAnchorPoint(Vector2(0,0.5)); - centerColor->setAnchorPoint(Vector2(0,0.5)); - right->setAnchorPoint(Vector2(0,0.5)); - rightColor->setAnchorPoint(Vector2(0,0.5)); + top->setAnchorPoint(Vec2(0.5, 1)); + left->setAnchorPoint(Vec2(0,0.5)); + leftColor->setAnchorPoint(Vec2(0,0.5)); + center->setAnchorPoint(Vec2(0,0.5)); + centerColor->setAnchorPoint(Vec2(0,0.5)); + right->setAnchorPoint(Vec2(0,0.5)); + rightColor->setAnchorPoint(Vec2(0,0.5)); - top->setPosition(Vector2(s.width/2,s.height-20)); - left->setPosition(Vector2(0,s.height/2)); + top->setPosition(Vec2(s.width/2,s.height-20)); + left->setPosition(Vec2(0,s.height/2)); leftColor->setPosition(left->getPosition()); - center->setPosition(Vector2(blockSize.width, s.height/2)); + center->setPosition(Vec2(blockSize.width, s.height/2)); centerColor->setPosition(center->getPosition()); - right->setPosition(Vector2(blockSize.width*2, s.height/2)); + right->setPosition(Vec2(blockSize.width*2, s.height/2)); rightColor->setPosition(right->getPosition()); this->addChild(leftColor, -1, kTagColor1); diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp index 4c0a900283..12512dafae 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp @@ -5,16 +5,16 @@ MouseTest::MouseTest() auto s = Director::getInstance()->getWinSize(); auto title = Label::createWithTTF("Mouse Test", "fonts/arial.ttf", 28); addChild(title, 0); - title->setPosition( Vector2(s.width/2, s.height-50) ); + title->setPosition( Vec2(s.width/2, s.height-50) ); //Create a label to display the mouse action _labelAction = Label::createWithTTF("Click mouse button and see this change", "fonts/arial.ttf", 22); - _labelAction->setPosition(Vector2(s.width/2, s.height*2/3)); + _labelAction->setPosition(Vec2(s.width/2, s.height*2/3)); addChild(_labelAction, 0); //Create a label to display the mouse position _labelPosition = Label::createWithTTF("Mouse not supported on this device", "fonts/arial.ttf", 22); - _labelPosition->setPosition(Vector2(s.width/2, s.height/3)); + _labelPosition->setPosition(Vec2(s.width/2, s.height/3)); addChild(_labelPosition); diff --git a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp index 105132e7ef..5a84b24595 100644 --- a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp +++ b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp @@ -17,7 +17,7 @@ IntervalLayer::IntervalLayer() // sun auto sun = ParticleSun::create(); sun->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); - sun->setPosition( Vector2(VisibleRect::rightTop().x-32,VisibleRect::rightTop().y-32) ); + sun->setPosition( Vec2(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); - _label0->setPosition(Vector2(s.width*1/6, s.height/2)); - _label1->setPosition(Vector2(s.width*2/6, s.height/2)); - _label2->setPosition(Vector2(s.width*3/6, s.height/2)); - _label3->setPosition(Vector2(s.width*4/6, s.height/2)); - _label4->setPosition(Vector2(s.width*5/6, s.height/2)); + _label0->setPosition(Vec2(s.width*1/6, s.height/2)); + _label1->setPosition(Vec2(s.width*2/6, s.height/2)); + _label2->setPosition(Vec2(s.width*3/6, s.height/2)); + _label3->setPosition(Vec2(s.width*4/6, s.height/2)); + _label4->setPosition(Vec2(s.width*5/6, s.height/2)); addChild(_label0); addChild(_label1); @@ -50,9 +50,9 @@ IntervalLayer::IntervalLayer() // Sprite auto sprite = Sprite::create(s_pathGrossini); - sprite->setPosition( Vector2(VisibleRect::left().x + 40, VisibleRect::bottom().y + 50) ); + sprite->setPosition( Vec2(VisibleRect::left().x + 40, VisibleRect::bottom().y + 50) ); - auto jump = JumpBy::create(3, Vector2(s.width-80,0), 50, 4); + auto jump = JumpBy::create(3, Vec2(s.width-80,0), 50, 4); addChild(sprite); sprite->runAction( RepeatForever::create(Sequence::create(jump, jump->reverse(), NULL) )); @@ -64,7 +64,7 @@ IntervalLayer::IntervalLayer() Director::getInstance()->pause(); }); auto menu = Menu::create(item1, NULL); - menu->setPosition( Vector2(s.width/2, s.height-50) ); + menu->setPosition( Vec2(s.width/2, s.height-50) ); addChild( menu ); } diff --git a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp index c3f9e0223e..10b2eaebf1 100644 --- a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp +++ b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp @@ -5,7 +5,7 @@ KeyboardTest::KeyboardTest() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("Keyboard Test", "fonts/arial.ttf", 28); addChild(label, 0); - label->setPosition( Vector2(s.width/2, s.height-50) ); + label->setPosition( Vec2(s.width/2, s.height-50) ); auto listener = EventListenerKeyboard::create(); listener->onKeyPressed = CC_CALLBACK_2(KeyboardTest::onKeyPressed, this); @@ -15,7 +15,7 @@ KeyboardTest::KeyboardTest() // create a label to display the tip string _label = Label::createWithTTF("Please press any key and see console log...", "fonts/arial.ttf", 22); - _label->setPosition(Vector2(s.width / 2, s.height / 2)); + _label->setPosition(Vec2(s.width / 2, s.height / 2)); addChild(_label, 0); _label->retain(); diff --git a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp index 289befe0d6..4bac8b0ba4 100644 --- a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp +++ b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp @@ -5,7 +5,7 @@ KeypadTest::KeypadTest() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("Keypad Test", "fonts/arial.ttf", 28); addChild(label, 0); - label->setPosition( Vector2(s.width/2, s.height-50) ); + label->setPosition( Vec2(s.width/2, s.height-50) ); auto listener = EventListenerKeyboard::create(); listener->onKeyReleased = CC_CALLBACK_2(KeypadTest::onKeyReleased, this); @@ -14,7 +14,7 @@ KeypadTest::KeypadTest() // create a label to display the tip string _label = Label::createWithTTF("Please press any key...", "fonts/arial.ttf", 22); - _label->setPosition(Vector2(s.width / 2, s.height / 2)); + _label->setPosition(Vec2(s.width / 2, s.height / 2)); addChild(_label, 0); _label->retain(); diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp index 812fd1c13f..331e262d60 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp @@ -180,23 +180,23 @@ Atlas1::Atlas1() V3F_C4B_T2F_Quad quads[] = { { - {Vector3(0,0,0),Color4B(0,0,255,255),Tex2F(0.0f,1.0f),}, // bottom left - {Vector3(s.width,0,0),Color4B(0,0,255,0),Tex2F(1.0f,1.0f),}, // bottom right - {Vector3(0,s.height,0),Color4B(0,0,255,0),Tex2F(0.0f,0.0f),}, // top left - {Vector3(s.width,s.height,0),Color4B(0,0,255,255),Tex2F(1.0f,0.0f),}, // top right + {Vec3(0,0,0),Color4B(0,0,255,255),Tex2F(0.0f,1.0f),}, // bottom left + {Vec3(s.width,0,0),Color4B(0,0,255,0),Tex2F(1.0f,1.0f),}, // bottom right + {Vec3(0,s.height,0),Color4B(0,0,255,0),Tex2F(0.0f,0.0f),}, // top left + {Vec3(s.width,s.height,0),Color4B(0,0,255,255),Tex2F(1.0f,0.0f),}, // top right }, { - {Vector3(40,40,0),Color4B(255,255,255,255),Tex2F(0.0f,0.2f),}, // bottom left - {Vector3(120,80,0),Color4B(255,0,0,255),Tex2F(0.5f,0.2f),}, // bottom right - {Vector3(40,160,0),Color4B(255,255,255,255),Tex2F(0.0f,0.0f),}, // top left - {Vector3(160,160,0),Color4B(0,255,0,255),Tex2F(0.5f,0.0f),}, // top right + {Vec3(40,40,0),Color4B(255,255,255,255),Tex2F(0.0f,0.2f),}, // bottom left + {Vec3(120,80,0),Color4B(255,0,0,255),Tex2F(0.5f,0.2f),}, // bottom right + {Vec3(40,160,0),Color4B(255,255,255,255),Tex2F(0.0f,0.0f),}, // top left + {Vec3(160,160,0),Color4B(0,255,0,255),Tex2F(0.5f,0.0f),}, // top right }, { - {Vector3(s.width/2,40,0),Color4B(255,0,0,255),Tex2F(0.0f,1.0f),}, // bottom left - {Vector3(s.width,40,0),Color4B(0,255,0,255),Tex2F(1.0f,1.0f),}, // bottom right - {Vector3(s.width/2-50,200,0),Color4B(0,0,255,255),Tex2F(0.0f,0.0f),}, // top left - {Vector3(s.width,100,0),Color4B(255,255,0,255),Tex2F(1.0f,0.0f),}, // top right + {Vec3(s.width/2,40,0),Color4B(255,0,0,255),Tex2F(0.0f,1.0f),}, // bottom left + {Vec3(s.width,40,0),Color4B(0,255,0,255),Tex2F(1.0f,1.0f),}, // bottom right + {Vec3(s.width/2-50,200,0),Color4B(0,0,255,255),Tex2F(0.0f,0.0f),}, // top left + {Vec3(s.width,100,0),Color4B(255,255,0,255),Tex2F(1.0f,0.0f),}, // top right }, }; @@ -213,14 +213,14 @@ Atlas1::~Atlas1() _textureAtlas->release(); } -void Atlas1::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Atlas1::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(Atlas1::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void Atlas1::onDraw(const Matrix &transform, bool transformUpdated) +void Atlas1::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -249,12 +249,12 @@ LabelAtlasTest::LabelAtlasTest() auto label1 = LabelAtlas::create("123 Test", "fonts/tuffy_bold_italic-charmap.plist"); addChild(label1, 0, kTagSprite1); - label1->setPosition( Vector2(10,100) ); + label1->setPosition( Vec2(10,100) ); label1->setOpacity( 200 ); auto label2 = LabelAtlas::create("0123456789", "fonts/tuffy_bold_italic-charmap.plist"); addChild(label2, 0, kTagSprite2); - label2->setPosition( Vector2(10,200) ); + label2->setPosition( Vec2(10,200) ); label2->setOpacity( 32 ); schedule(schedule_selector(LabelAtlasTest::step)); @@ -296,12 +296,12 @@ LabelAtlasColorTest::LabelAtlasColorTest() { auto label1 = LabelAtlas::create("123 Test", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label1, 0, kTagSprite1); - label1->setPosition( Vector2(10,100) ); + label1->setPosition( Vec2(10,100) ); label1->setOpacity( 200 ); auto label2 = LabelAtlas::create("0123456789", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label2, 0, kTagSprite2); - label2->setPosition( Vector2(10,200) ); + label2->setPosition( Vec2(10,200) ); label2->setColor( Color3B::RED ); auto fade = FadeOut::create(1.0f); @@ -358,20 +358,20 @@ LabelTTFAlignment::LabelTTFAlignment() auto ttf0 = LabelTTF::create("Alignment 0\nnew line", "Helvetica", 12, Size(256, 32), TextHAlignment::LEFT); - ttf0->setPosition(Vector2(s.width/2,(s.height/6)*2)); - ttf0->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + ttf0->setPosition(Vec2(s.width/2,(s.height/6)*2)); + ttf0->setAnchorPoint(Vec2::ANCHOR_MIDDLE); this->addChild(ttf0); auto ttf1 = LabelTTF::create("Alignment 1\nnew line", "Helvetica", 12, Size(245, 32), TextHAlignment::CENTER); - ttf1->setPosition(Vector2(s.width/2,(s.height/6)*3)); - ttf1->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + ttf1->setPosition(Vec2(s.width/2,(s.height/6)*3)); + ttf1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); this->addChild(ttf1); auto ttf2 = LabelTTF::create("Alignment 2\nnew line", "Helvetica", 12, Size(245, 32), TextHAlignment::RIGHT); - ttf2->setPosition(Vector2(s.width/2,(s.height/6)*4)); - ttf2->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + ttf2->setPosition(Vec2(s.width/2,(s.height/6)*4)); + ttf2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); this->addChild(ttf2); } @@ -405,7 +405,7 @@ Atlas3::Atlas3() auto label1 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); // testing anchors - label1->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + label1->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); addChild(label1, 0, kTagBitmapAtlas1); auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); @@ -420,7 +420,7 @@ Atlas3::Atlas3() // Of course, you can also tell XCode not to compress PNG images, but I think it doesn't work as expected auto label2 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); // testing anchors - label2->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label2->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); label2->setColor( Color3B::RED ); addChild(label2, 0, kTagBitmapAtlas2); auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), @@ -431,7 +431,7 @@ Atlas3::Atlas3() auto label3 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); // testing anchors - label3->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + label3->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); addChild(label3, 0, kTagBitmapAtlas3); label1->setPosition( VisibleRect::leftBottom() ); @@ -490,8 +490,8 @@ Atlas4::Atlas4() auto s = Director::getInstance()->getWinSize(); - label->setPosition( Vector2(s.width/2, s.height/2) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, s.height/2) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); auto BChar = (Sprite*) label->getChildByTag(0); @@ -507,7 +507,7 @@ Atlas4::Atlas4() auto scale_seq = Sequence::create(scale, scale_back,NULL); auto scale_4ever = RepeatForever::create(scale_seq); - auto jump = JumpBy::create(0.5f, Vector2::ZERO, 60, 1); + auto jump = JumpBy::create(0.5f, Vec2::ZERO, 60, 1); auto jump_4ever = RepeatForever::create(jump); auto fade_out = FadeOut::create(1); @@ -524,7 +524,7 @@ Atlas4::Atlas4() // Bottom Label auto label2 = LabelBMFont::create("00.0", "fonts/bitmapFontTest.fnt"); addChild(label2, 0, kTagBitmapAtlas2); - label2->setPosition( Vector2(s.width/2.0f, 80) ); + label2->setPosition( Vec2(s.width/2.0f, 80) ); auto lastChar = (Sprite*) label2->getChildByTag(3); lastChar->runAction( rot_4ever->clone() ); @@ -532,14 +532,14 @@ Atlas4::Atlas4() schedule( schedule_selector(Atlas4::step), 0.1f); } -void Atlas4::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void Atlas4::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(Atlas4::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void Atlas4::onDraw(const Matrix &transform, bool transformUpdated) +void Atlas4::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -547,8 +547,8 @@ void Atlas4::onDraw(const Matrix &transform, bool transformUpdated) director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform); auto s = Director::getInstance()->getWinSize(); - DrawPrimitives::drawLine( Vector2(0, s.height/2), Vector2(s.width, s.height/2) ); - DrawPrimitives::drawLine( Vector2(s.width/2, 0), Vector2(s.width/2, s.height) ); + DrawPrimitives::drawLine( Vec2(0, s.height/2), Vec2(s.width, s.height/2) ); + DrawPrimitives::drawLine( Vec2(s.width/2, 0), Vec2(s.width/2, s.height) ); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } @@ -594,8 +594,8 @@ Atlas5::Atlas5() auto s = Director::getInstance()->getWinSize(); - label->setPosition( Vector2(s.width/2, s.height/2) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, s.height/2) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); } std::string Atlas5::title() const @@ -626,18 +626,18 @@ Atlas6::Atlas6() LabelBMFont* label = NULL; label = LabelBMFont::create("FaFeFiFoFu", "fonts/bitmapFontTest5.fnt"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2+50) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ) ; + label->setPosition( Vec2(s.width/2, s.height/2+50) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ) ; label = LabelBMFont::create("fafefifofu", "fonts/bitmapFontTest5.fnt"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, s.height/2) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); label = LabelBMFont::create("aeiou", "fonts/bitmapFontTest5.fnt"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2-50) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, s.height/2-50) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); } std::string Atlas6::title() const @@ -669,19 +669,19 @@ AtlasBitmapColor::AtlasBitmapColor() label = LabelBMFont::create("Blue", "fonts/bitmapFontTest5.fnt"); label->setColor( Color3B::BLUE ); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/4) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, s.height/4) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); label = LabelBMFont::create("Red", "fonts/bitmapFontTest5.fnt"); addChild(label); - label->setPosition( Vector2(s.width/2, 2*s.height/4) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, 2*s.height/4) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); label->setColor( Color3B::RED ); label = LabelBMFont::create("G", "fonts/bitmapFontTest5.fnt"); addChild(label); - label->setPosition( Vector2(s.width/2, 3*s.height/4) ); - label->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + label->setPosition( Vec2(s.width/2, 3*s.height/4) ); + label->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); label->setColor( Color3B::GREEN ); label->setString("Green"); } @@ -720,9 +720,9 @@ AtlasFastBitmap::AtlasFastBitmap() auto s = Director::getInstance()->getWinSize(); - auto p = Vector2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); label->setPosition( p ); - label->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + label->setAnchorPoint(Vec2::ANCHOR_MIDDLE); } } @@ -753,7 +753,7 @@ BitmapFontMultiLine::BitmapFontMultiLine() // Left auto label1 = LabelBMFont::create(" Multi line\nLeft", "fonts/bitmapFontTest3.fnt"); - label1->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + label1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); addChild(label1, 0, kTagBitmapAtlas1); s = label1->getContentSize(); @@ -762,7 +762,7 @@ BitmapFontMultiLine::BitmapFontMultiLine() // Center auto label2 = LabelBMFont::create("Multi line\nCenter", "fonts/bitmapFontTest3.fnt"); - label2->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + label2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); addChild(label2, 0, kTagBitmapAtlas2); s= label2->getContentSize(); @@ -770,7 +770,7 @@ BitmapFontMultiLine::BitmapFontMultiLine() // right auto label3 = LabelBMFont::create("Multi line\nRight\nThree lines Three", "fonts/bitmapFontTest3.fnt"); - label3->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + label3->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); addChild(label3, 0, kTagBitmapAtlas3); s = label3->getContentSize(); @@ -803,17 +803,17 @@ LabelsEmpty::LabelsEmpty() // LabelBMFont auto label1 = LabelBMFont::create("", "fonts/bitmapFontTest3.fnt"); addChild(label1, 0, kTagBitmapAtlas1); - label1->setPosition(Vector2(s.width/2, s.height-100)); + label1->setPosition(Vec2(s.width/2, s.height-100)); // LabelTTF auto label2 = LabelTTF::create("", "Arial", 24); addChild(label2, 0, kTagBitmapAtlas2); - label2->setPosition(Vector2(s.width/2, s.height/2)); + label2->setPosition(Vec2(s.width/2, s.height/2)); // LabelAtlas auto label3 = LabelAtlas::create("", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label3, 0, kTagBitmapAtlas3); - label3->setPosition(Vector2(s.width/2, 0+100)); + label3->setPosition(Vec2(s.width/2, 0+100)); schedule(schedule_selector(LabelsEmpty::updateStrings), 1.0f); @@ -866,7 +866,7 @@ LabelBMFontHD::LabelBMFontHD() // LabelBMFont auto label1 = LabelBMFont::create("TESTING RETINA DISPLAY", "fonts/konqa32.fnt"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelBMFontHD::title() const @@ -890,10 +890,10 @@ LabelAtlasHD::LabelAtlasHD() // LabelBMFont auto label1 = LabelAtlas::create("TESTING RETINA DISPLAY", "fonts/larabie-16.plist"); - label1->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + label1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelAtlasHD::title() const @@ -921,7 +921,7 @@ LabelGlyphDesigner::LabelGlyphDesigner() // LabelBMFont auto label1 = LabelBMFont::create("Testing Glyph Designer", "fonts/futura-48.fnt"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelGlyphDesigner::title() const @@ -954,8 +954,8 @@ LabelTTFTest::LabelTTFTest() auto s = Director::getInstance()->getWinSize(); auto colorLayer = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height); - colorLayer->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - colorLayer->setPosition(Vector2((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2)); + colorLayer->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + colorLayer->setPosition(Vec2((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2)); this->addChild(colorLayer); @@ -966,7 +966,7 @@ LabelTTFTest::LabelTTFTest() MenuItemFont::create("Right", CC_CALLBACK_1(LabelTTFTest::setAlignmentRight, this)), NULL); menu->alignItemsVerticallyWithPadding(4); - menu->setPosition(Vector2(50, s.height / 2 - 20)); + menu->setPosition(Vec2(50, s.height / 2 - 20)); this->addChild(menu); menu = Menu::create( @@ -975,7 +975,7 @@ LabelTTFTest::LabelTTFTest() MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelTTFTest::setAlignmentBottom, this)), NULL); menu->alignItemsVerticallyWithPadding(4); - menu->setPosition(Vector2(s.width - 50, s.height / 2 - 20)); + menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); this->addChild(menu); _label = nullptr; @@ -1006,8 +1006,8 @@ void LabelTTFTest::updateAlignment() blockSize, _horizAlign, _vertAlign); _label->retain(); - _label->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - _label->setPosition(Vector2((s.width - blockSize.width) / 2, (s.height - blockSize.height)/2 )); + _label->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + _label->setPosition(Vec2((s.width - blockSize.width) / 2, (s.height - blockSize.height)/2 )); this->addChild(_label); } @@ -1099,7 +1099,7 @@ LabelTTFMultiline::LabelTTFMultiline() TextHAlignment::CENTER, TextVAlignment::TOP); - center->setPosition(Vector2(s.width / 2, 150)); + center->setPosition(Vec2(s.width / 2, 150)); addChild(center); } @@ -1118,7 +1118,7 @@ LabelTTFChinese::LabelTTFChinese() { auto size = Director::getInstance()->getWinSize(); auto label = LabelTTF::create("中国", "Marker Felt", 30); - label->setPosition(Vector2(size.width / 2, size.height /2)); + label->setPosition(Vec2(size.width / 2, size.height /2)); this->addChild(label); } @@ -1131,7 +1131,7 @@ LabelBMFontChinese::LabelBMFontChinese() { auto size = Director::getInstance()->getWinSize(); auto label = LabelBMFont::create("中国", "fonts/bitmapFontChinese.fnt"); - label->setPosition(Vector2(size.width / 2, size.height /2)); + label->setPosition(Vec2(size.width / 2, size.height /2)); this->addChild(label); } @@ -1208,18 +1208,18 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment() right->setTag(RightAlign); // position the label on the center of the screen - _labelShouldRetain->setPosition(Vector2(size.width/2, size.height/2)); + _labelShouldRetain->setPosition(Vec2(size.width/2, size.height/2)); _arrowsBarShouldRetain->setVisible(false); float arrowsWidth = (ArrowsMax - ArrowsMin) * size.width; _arrowsBarShouldRetain->setScaleX(arrowsWidth / this->_arrowsBarShouldRetain->getContentSize().width); - _arrowsBarShouldRetain->setPosition(Vector2(((ArrowsMax + ArrowsMin) / 2) * size.width, this->_labelShouldRetain->getPosition().y)); + _arrowsBarShouldRetain->setPosition(Vec2(((ArrowsMax + ArrowsMin) / 2) * size.width, this->_labelShouldRetain->getPosition().y)); this->snapArrowsToEdge(); - stringMenu->setPosition(Vector2(size.width/2, size.height - menuItemPaddingCenter)); - alignmentMenu->setPosition(Vector2(size.width/2, menuItemPaddingCenter+15)); + stringMenu->setPosition(Vec2(size.width/2, size.height - menuItemPaddingCenter)); + alignmentMenu->setPosition(Vec2(size.width/2, menuItemPaddingCenter+15)); addChild(_labelShouldRetain); addChild(_arrowsBarShouldRetain); @@ -1329,7 +1329,7 @@ void BitmapFontMultiLineAlignment::onTouchesMoved(const std::vector& tou auto winSize = Director::getInstance()->getWinSize(); - this->_arrowsShouldRetain->setPosition(Vector2(MAX(MIN(location.x, ArrowsMax*winSize.width), ArrowsMin*winSize.width), + this->_arrowsShouldRetain->setPosition(Vec2(MAX(MIN(location.x, ArrowsMax*winSize.width), ArrowsMin*winSize.width), this->_arrowsShouldRetain->getPosition().y)); float labelWidth = fabs(this->_arrowsShouldRetain->getPosition().x - this->_labelShouldRetain->getPosition().x) * 2; @@ -1339,7 +1339,7 @@ void BitmapFontMultiLineAlignment::onTouchesMoved(const std::vector& tou void BitmapFontMultiLineAlignment::snapArrowsToEdge() { - this->_arrowsShouldRetain->setPosition(Vector2(this->_labelShouldRetain->getPosition().x + this->_labelShouldRetain->getContentSize().width/2, + this->_arrowsShouldRetain->setPosition(Vec2(this->_labelShouldRetain->getPosition().x + this->_labelShouldRetain->getContentSize().width/2, this->_labelShouldRetain->getPosition().y)); } @@ -1355,7 +1355,7 @@ LabelTTFA8Test::LabelTTFA8Test() auto label1 = LabelTTF::create("Testing A8 Format", "Marker Felt", 48); addChild(label1); label1->setColor(Color3B::RED); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); auto fadeOut = FadeOut::create(2); auto fadeIn = FadeIn::create(2); @@ -1381,11 +1381,11 @@ BMFontOneAtlas::BMFontOneAtlas() auto label1 = LabelBMFont::create("This is Helvetica", "fonts/helvetica-32.fnt"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/3*2)); + label1->setPosition(Vec2(s.width/2, s.height/3*2)); - auto label2 = LabelBMFont::create("And this is Geneva", "fonts/geneva-32.fnt", 0, TextHAlignment::LEFT, Vector2(0, 128)); + auto label2 = LabelBMFont::create("And this is Geneva", "fonts/geneva-32.fnt", 0, TextHAlignment::LEFT, Vec2(0, 128)); addChild(label2); - label2->setPosition(Vector2(s.width/2, s.height/3*1)); + label2->setPosition(Vec2(s.width/2, s.height/3*1)); } std::string BMFontOneAtlas::title() const @@ -1411,19 +1411,19 @@ BMFontUnicode::BMFontUnicode() auto label1 = LabelBMFont::create(spanish, "fonts/arial-unicode-26.fnt", 200, TextHAlignment::LEFT); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/5*4)); + label1->setPosition(Vec2(s.width/2, s.height/5*4)); auto label2 = LabelBMFont::create(chinese, "fonts/arial-unicode-26.fnt"); addChild(label2); - label2->setPosition(Vector2(s.width/2, s.height/5*3)); + label2->setPosition(Vec2(s.width/2, s.height/5*3)); auto label3 = LabelBMFont::create(russian, "fonts/arial-26-en-ru.fnt"); addChild(label3); - label3->setPosition(Vector2(s.width/2, s.height/5*2)); + label3->setPosition(Vec2(s.width/2, s.height/5*2)); auto label4 = LabelBMFont::create(japanese, "fonts/arial-unicode-26.fnt"); addChild(label4); - label4->setPosition(Vector2(s.width/2, s.height/5*1)); + label4->setPosition(Vec2(s.width/2, s.height/5*1)); } std::string BMFontUnicode::title() const @@ -1447,7 +1447,7 @@ BMFontInit::BMFontInit() bmFont->setFntFile("fonts/helvetica-32.fnt"); bmFont->setString("It is working!"); this->addChild(bmFont); - bmFont->setPosition(Vector2(s.width/2,s.height/4*2)); + bmFont->setPosition(Vec2(s.width/2,s.height/4*2)); } std::string BMFontInit::title() const @@ -1472,7 +1472,7 @@ TTFFontInit::TTFFontInit() font->setFontSize(48); font->setString("It is working!"); this->addChild(font); - font->setPosition(Vector2(s.width/2,s.height/4*2)); + font->setPosition(Vec2(s.width/2,s.height/4*2)); } std::string TTFFontInit::title() const @@ -1515,7 +1515,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // add label to the scene this->addChild(fontShadow); - fontShadow->setPosition(Vector2(s.width/2,s.height/4*2.5)); + fontShadow->setPosition(Vec2(s.width/2,s.height/4*2.5)); // create the stroke only label @@ -1534,7 +1534,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // add label to the scene this->addChild(fontStroke); - fontStroke->setPosition(Vector2(s.width/2,s.height/4*1.8)); + fontStroke->setPosition(Vec2(s.width/2,s.height/4*1.8)); @@ -1564,10 +1564,10 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // add label to the scene this->addChild(fontStrokeAndShadow); - fontStrokeAndShadow->setPosition(Vector2(s.width/2,s.height/4*1.1)); + fontStrokeAndShadow->setPosition(Vec2(s.width/2,s.height/4*1.1)); auto buttonBG = MenuItemImage::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - buttonBG->setAnchorPoint(Vector2::ANCHOR_MIDDLE_LEFT); + buttonBG->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); buttonBG->setPosition(VisibleRect::left()); // create the label stroke and shadow @@ -1590,11 +1590,11 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // add label to the scene buttonBG->addChild(fontStrokeAndShadow); - fontStrokeAndShadow->setPosition(Vector2(buttonBG->getContentSize().width/2, buttonBG->getContentSize().height/2)); + fontStrokeAndShadow->setPosition(Vec2(buttonBG->getContentSize().width/2, buttonBG->getContentSize().height/2)); auto menu = Menu::create(buttonBG, nullptr); - menu->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - menu->setPosition(Vector2::ZERO); + menu->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + menu->setPosition(Vec2::ZERO); addChild(menu); } @@ -1623,7 +1623,7 @@ Issue1343::Issue1343() this->addChild(bmFont); bmFont->setScale(0.3f); - bmFont->setPosition(Vector2(s.width/2,s.height/4*2)); + bmFont->setPosition(Vec2(s.width/2,s.height/4*2)); } std::string Issue1343::title() const @@ -1647,7 +1647,7 @@ LabelBMFontBounds::LabelBMFontBounds() label1 = LabelBMFont::create("Testing Glyph Designer", "fonts/boundsTestFont.fnt"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelBMFontBounds::title() const @@ -1660,14 +1660,14 @@ std::string LabelBMFontBounds::subtitle() const return "You should see string enclosed by a box"; } -void LabelBMFontBounds::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelBMFontBounds::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(LabelBMFontBounds::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void LabelBMFontBounds::onDraw(const Matrix &transform, bool transformUpdated) +void LabelBMFontBounds::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1680,12 +1680,12 @@ void LabelBMFontBounds::onDraw(const Matrix &transform, bool transformUpdated) origin.width = origin.width / 2 - (labelSize.width / 2); origin.height = origin.height / 2 - (labelSize.height / 2); - Vector2 vertices[4]= + Vec2 vertices[4]= { - Vector2(origin.width, origin.height), - Vector2(labelSize.width + origin.width, origin.height), - Vector2(labelSize.width + origin.width, labelSize.height + origin.height), - Vector2(origin.width, labelSize.height + origin.height) + Vec2(origin.width, origin.height), + Vec2(labelSize.width + origin.width, origin.height), + Vec2(labelSize.width + origin.width, labelSize.height + origin.height), + Vec2(origin.width, labelSize.height + origin.height) }; DrawPrimitives::drawPoly(vertices, 4, true); @@ -1711,7 +1711,7 @@ void LabelBMFontCrashTest::onEnter() // Create a new label and add it (then crashes) auto label2 = LabelBMFont::create("test 2", "fonts/bitmapFontTest.fnt"); - label2->setPosition(Vector2(winSize.width/2, winSize.height/2)); + label2->setPosition(Vec2(winSize.width/2, winSize.height/2)); this->addChild(label2); } @@ -1735,7 +1735,7 @@ LabelBMFontBinaryFormat::LabelBMFontBinaryFormat() bmFont->setFntFile("fonts/Roboto.bmf.fnt"); bmFont->setString("It is working!"); this->addChild(bmFont); - bmFont->setPosition(Vector2(s.width/2,s.height/4*2)); + bmFont->setPosition(Vec2(s.width/2,s.height/4*2)); } std::string LabelBMFontBinaryFormat::title() const diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.h b/tests/cpp-tests/Classes/LabelTest/LabelTest.h index 6b3bd33291..40b2e74aee 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.h +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.h @@ -41,9 +41,9 @@ public: ~Atlas1(); virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); protected: CustomCommand _customCommand; }; @@ -108,12 +108,12 @@ public: Atlas4(); virtual void step(float dt); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); protected: CustomCommand _customCommand; }; @@ -383,11 +383,11 @@ public: LabelBMFontBounds(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); private: LabelBMFont *label1; CustomCommand _customCommand; diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index a1d681f92a..1d8ee072f9 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -173,15 +173,15 @@ LabelTTFAlignmentNew::LabelTTFAlignmentNew() TTFConfig config("fonts/tahoma.ttf",16); auto ttf0 = Label::createWithTTF(config,"Alignment 0\nnew line",TextHAlignment::LEFT); - ttf0->setPosition(Vector2(s.width/2,(s.height/6)*2 - 30)); + ttf0->setPosition(Vec2(s.width/2,(s.height/6)*2 - 30)); this->addChild(ttf0); auto ttf1 = Label::createWithTTF(config,"Alignment 1\nnew line",TextHAlignment::CENTER); - ttf1->setPosition(Vector2(s.width/2,(s.height/6)*3 - 30)); + ttf1->setPosition(Vec2(s.width/2,(s.height/6)*3 - 30)); this->addChild(ttf1); auto ttf2 = Label::createWithTTF(config,"Alignment 2\nnew line",TextHAlignment::RIGHT); - ttf2->setPosition(Vector2(s.width/2,(s.height/6)*4 - 30)); + ttf2->setPosition(Vec2(s.width/2,(s.height/6)*4 - 30)); this->addChild(ttf2); } @@ -204,7 +204,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() auto label1 = Label::createWithBMFont("fonts/bitmapFontTest2.fnt", "Test"); - label1->setAnchorPoint( Vector2(0,0) ); + label1->setAnchorPoint( Vec2(0,0) ); addChild(label1, 0, kTagBitmapAtlas1); auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); @@ -222,7 +222,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() label2->runAction( RepeatForever::create(tint) ); auto label3 = Label::createWithBMFont("fonts/bitmapFontTest2.fnt", "Test"); - label3->setAnchorPoint( Vector2(1,1) ); + label3->setAnchorPoint( Vec2(1,1) ); addChild(label3, 0, kTagBitmapAtlas3); label1->setPosition( VisibleRect::leftBottom() ); @@ -268,7 +268,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto s = Director::getInstance()->getWinSize(); - label->setPosition( Vector2(s.width/2, s.height/2) ); + label->setPosition( Vec2(s.width/2, s.height/2) ); auto BChar = (Sprite*) label->getLetter(0); auto FChar = (Sprite*) label->getLetter(7); @@ -283,7 +283,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto scale_seq = Sequence::create(scale, scale_back,NULL); auto scale_4ever = RepeatForever::create(scale_seq); - auto jump = JumpBy::create(0.5f, Vector2::ZERO, 60, 1); + auto jump = JumpBy::create(0.5f, Vec2::ZERO, 60, 1); auto jump_4ever = RepeatForever::create(jump); auto fade_out = FadeOut::create(1); @@ -300,7 +300,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() // Bottom Label auto label2 = Label::createWithBMFont("fonts/bitmapFontTest.fnt", "00.0"); addChild(label2, 0, kTagBitmapAtlas2); - label2->setPosition( Vector2(s.width/2.0f, 80) ); + label2->setPosition( Vec2(s.width/2.0f, 80) ); auto lastChar = (Sprite*) label2->getLetter(3); lastChar->runAction( rot_4ever->clone() ); @@ -308,7 +308,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() schedule( schedule_selector(LabelFNTSpriteActions::step), 0.1f); } -void LabelFNTSpriteActions::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelFNTSpriteActions::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(LabelFNTSpriteActions::onDraw, this, transform, transformUpdated); @@ -316,7 +316,7 @@ void LabelFNTSpriteActions::draw(Renderer *renderer, const Matrix &transform, bo } -void LabelFNTSpriteActions::onDraw(const Matrix &transform, bool transformUpdated) +void LabelFNTSpriteActions::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -324,8 +324,8 @@ void LabelFNTSpriteActions::onDraw(const Matrix &transform, bool transformUpdate director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform); auto s = Director::getInstance()->getWinSize(); - DrawPrimitives::drawLine( Vector2(0, s.height/2), Vector2(s.width, s.height/2) ); - DrawPrimitives::drawLine( Vector2(s.width/2, 0), Vector2(s.width/2, s.height) ); + DrawPrimitives::drawLine( Vec2(0, s.height/2), Vec2(s.width, s.height/2) ); + DrawPrimitives::drawLine( Vec2(s.width/2, 0), Vec2(s.width/2, s.height) ); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } @@ -356,7 +356,7 @@ LabelFNTPadding::LabelFNTPadding() auto s = Director::getInstance()->getWinSize(); - label->setPosition( Vector2(s.width/2, s.height/2) ); + label->setPosition( Vec2(s.width/2, s.height/2) ); } std::string LabelFNTPadding::title() const @@ -376,15 +376,15 @@ LabelFNTOffset::LabelFNTOffset() Label* label = nullptr; label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "FaFeFiFoFu"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2+50) ); + label->setPosition( Vec2(s.width/2, s.height/2+50) ); label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "fafefifofu"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2) ); + label->setPosition( Vec2(s.width/2, s.height/2) ); label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "aeiou"); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/2-50) ); + label->setPosition( Vec2(s.width/2, s.height/2-50) ); } std::string LabelFNTOffset::title() const @@ -405,16 +405,16 @@ LabelFNTColor::LabelFNTColor() label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "Blue"); label->setColor( Color3B::BLUE ); addChild(label); - label->setPosition( Vector2(s.width/2, s.height/4) ); + label->setPosition( Vec2(s.width/2, s.height/4) ); label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "Red"); addChild(label); - label->setPosition( Vector2(s.width/2, 2*s.height/4) ); + label->setPosition( Vec2(s.width/2, 2*s.height/4) ); label->setColor( Color3B::RED ); label = Label::createWithBMFont("fonts/bitmapFontTest5.fnt", "Green"); addChild(label); - label->setPosition( Vector2(s.width/2, 3*s.height/4) ); + label->setPosition( Vec2(s.width/2, 3*s.height/4) ); label->setColor( Color3B::GREEN ); label->setString("Green"); } @@ -441,7 +441,7 @@ LabelFNTHundredLabels::LabelFNTHundredLabels() auto s = Director::getInstance()->getWinSize(); - auto p = Vector2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); label->setPosition( p ); } } @@ -462,7 +462,7 @@ LabelFNTMultiLine::LabelFNTMultiLine() // Left auto label1 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", " Multi line\nLeft"); - label1->setAnchorPoint(Vector2(0,0)); + label1->setAnchorPoint(Vec2(0,0)); addChild(label1, 0, kTagBitmapAtlas1); s = label1->getContentSize(); @@ -478,7 +478,7 @@ LabelFNTMultiLine::LabelFNTMultiLine() // right auto label3 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "Multi line\nRight\nThree lines Three"); - label3->setAnchorPoint(Vector2(1, 1)); + label3->setAnchorPoint(Vec2(1, 1)); addChild(label3, 0, kTagBitmapAtlas3); s = label3->getContentSize(); @@ -506,17 +506,17 @@ LabelFNTandTTFEmpty::LabelFNTandTTFEmpty() // LabelBMFont auto label1 = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", "", TextHAlignment::CENTER, s.width); addChild(label1, 0, kTagBitmapAtlas1); - label1->setPosition(Vector2(s.width/2, s.height - 100)); + label1->setPosition(Vec2(s.width/2, s.height - 100)); // LabelTTF TTFConfig ttfConfig("fonts/arial.ttf",24); auto label2 = Label::createWithTTF(ttfConfig,"", TextHAlignment::CENTER,s.width); addChild(label2, 0, kTagBitmapAtlas2); - label2->setPosition(Vector2(s.width/2, s.height / 2)); + label2->setPosition(Vec2(s.width/2, s.height / 2)); auto label3 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label3, 0, kTagBitmapAtlas3); - label3->setPosition(Vector2(s.width/2, 100)); + label3->setPosition(Vec2(s.width/2, 100)); schedule(schedule_selector(LabelFNTandTTFEmpty::updateStrings), 1.0f); @@ -564,7 +564,7 @@ LabelFNTRetina::LabelFNTRetina() // LabelBMFont auto label1 = Label::createWithBMFont("fonts/konqa32.fnt", "TESTING RETINA DISPLAY"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelFNTRetina::title() const @@ -587,7 +587,7 @@ LabelFNTGlyphDesigner::LabelFNTGlyphDesigner() // LabelBMFont auto label1 = Label::createWithBMFont("fonts/futura-48.fnt", "Testing Glyph Designer"); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelFNTGlyphDesigner::title() const @@ -607,7 +607,7 @@ LabelTTFUnicodeChinese::LabelTTFUnicodeChinese() // like "Error 3 error C2146: syntax error : missing ')' before identifier 'label'"; TTFConfig ttfConfig("fonts/wt021.ttf",28,GlyphCollection::CUSTOM, "美好的一天啊"); auto label = Label::createWithTTF(ttfConfig,"美好的一天啊", TextHAlignment::CENTER, size.width); - label->setPosition(Vector2(size.width / 2, size.height /2)); + label->setPosition(Vec2(size.width / 2, size.height /2)); this->addChild(label); } @@ -625,7 +625,7 @@ LabelFNTUnicodeChinese::LabelFNTUnicodeChinese() { auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithBMFont("fonts/bitmapFontChinese.fnt", "中国"); - label->setPosition(Vector2(size.width / 2, size.height /2)); + label->setPosition(Vec2(size.width / 2, size.height /2)); this->addChild(label); } @@ -708,18 +708,18 @@ LabelFNTMultiLineAlignment::LabelFNTMultiLineAlignment() right->setTag(RightAlign); // position the label on the center of the screen - this->_labelShouldRetain->setPosition(Vector2(size.width/2, size.height/2)); + this->_labelShouldRetain->setPosition(Vec2(size.width/2, size.height/2)); this->_arrowsBarShouldRetain->setVisible(false); float arrowsWidth = (ArrowsMax - ArrowsMin) * size.width; this->_arrowsBarShouldRetain->setScaleX(arrowsWidth / this->_arrowsBarShouldRetain->getContentSize().width); - this->_arrowsBarShouldRetain->setPosition(Vector2(((ArrowsMax + ArrowsMin) / 2) * size.width, this->_labelShouldRetain->getPosition().y)); + this->_arrowsBarShouldRetain->setPosition(Vec2(((ArrowsMax + ArrowsMin) / 2) * size.width, this->_labelShouldRetain->getPosition().y)); this->snapArrowsToEdge(); - stringMenu->setPosition(Vector2(size.width/2, size.height - menuItemPaddingCenter)); - alignmentMenu->setPosition(Vector2(size.width/2, menuItemPaddingCenter+15)); + stringMenu->setPosition(Vec2(size.width/2, size.height - menuItemPaddingCenter)); + alignmentMenu->setPosition(Vec2(size.width/2, menuItemPaddingCenter+15)); this->addChild(this->_labelShouldRetain); this->addChild(this->_arrowsBarShouldRetain); @@ -829,7 +829,7 @@ void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector& touch auto winSize = Director::getInstance()->getWinSize(); - this->_arrowsShouldRetain->setPosition(Vector2(MAX(MIN(location.x, ArrowsMax*winSize.width), ArrowsMin*winSize.width), + this->_arrowsShouldRetain->setPosition(Vec2(MAX(MIN(location.x, ArrowsMax*winSize.width), ArrowsMin*winSize.width), this->_arrowsShouldRetain->getPosition().y)); float labelWidth = fabs(this->_arrowsShouldRetain->getPosition().x - this->_labelShouldRetain->getPosition().x) * 2; @@ -839,7 +839,7 @@ void LabelFNTMultiLineAlignment::onTouchesMoved(const std::vector& touch void LabelFNTMultiLineAlignment::snapArrowsToEdge() { - this->_arrowsShouldRetain->setPosition(Vector2(this->_labelShouldRetain->getPosition().x + this->_labelShouldRetain->getContentSize().width/2, + this->_arrowsShouldRetain->setPosition(Vec2(this->_labelShouldRetain->getPosition().x + this->_labelShouldRetain->getContentSize().width/2, this->_labelShouldRetain->getPosition().y)); } @@ -856,19 +856,19 @@ LabelFNTUNICODELanguages::LabelFNTUNICODELanguages() auto label1 = Label::createWithBMFont("fonts/arial-unicode-26.fnt", spanish, TextHAlignment::CENTER, 200); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/5*3)); + label1->setPosition(Vec2(s.width/2, s.height/5*3)); auto label2 = Label::createWithBMFont("fonts/arial-unicode-26.fnt", chinese); addChild(label2); - label2->setPosition(Vector2(s.width/2, s.height/5*2.5)); + label2->setPosition(Vec2(s.width/2, s.height/5*2.5)); auto label3 = Label::createWithBMFont("fonts/arial-26-en-ru.fnt", russian); addChild(label3); - label3->setPosition(Vector2(s.width/2, s.height/5*2)); + label3->setPosition(Vec2(s.width/2, s.height/5*2)); auto label4 = Label::createWithBMFont("fonts/arial-unicode-26.fnt", japanese); addChild(label4); - label4->setPosition(Vector2(s.width/2, s.height/5*1.5)); + label4->setPosition(Vec2(s.width/2, s.height/5*1.5)); } std::string LabelFNTUNICODELanguages::title() const @@ -891,7 +891,7 @@ LabelFNTBounds::LabelFNTBounds() // LabelBMFont label1 = Label::createWithBMFont("fonts/boundsTestFont.fnt", "Testing Glyph Designer", TextHAlignment::CENTER,s.width); addChild(label1); - label1->setPosition(Vector2(s.width/2, s.height/2)); + label1->setPosition(Vec2(s.width/2, s.height/2)); } std::string LabelFNTBounds::title() const @@ -904,14 +904,14 @@ std::string LabelFNTBounds::subtitle() const return "You should see string enclosed by a box"; } -void LabelFNTBounds::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelFNTBounds::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(LabelFNTBounds::onDraw, this, transform, transformUpdated); renderer->addCommand(&_renderCmd); } -void LabelFNTBounds::onDraw(const Matrix &transform, bool transformUpdated) +void LabelFNTBounds::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -924,12 +924,12 @@ void LabelFNTBounds::onDraw(const Matrix &transform, bool transformUpdated) origin.width = origin.width / 2 - (labelSize.width / 2); origin.height = origin.height / 2 - (labelSize.height / 2); - Vector2 vertices[4]= + Vec2 vertices[4]= { - Vector2(origin.width, origin.height), - Vector2(labelSize.width + origin.width, origin.height), - Vector2(labelSize.width + origin.width, labelSize.height + origin.height), - Vector2(origin.width, labelSize.height + origin.height) + Vec2(origin.width, origin.height), + Vec2(labelSize.width + origin.width, origin.height), + Vec2(labelSize.width + origin.width, labelSize.height + origin.height), + Vec2(origin.width, labelSize.height + origin.height) }; DrawPrimitives::drawPoly(vertices, 4, true); @@ -943,8 +943,8 @@ LabelTTFLongLineWrapping::LabelTTFLongLineWrapping() // Long sentence TTFConfig ttfConfig("fonts/arial.ttf", 14); auto label1 = Label::createWithTTF(ttfConfig, LongSentencesExample, TextHAlignment::CENTER,size.width); - label1->setPosition( Vector2(size.width/2, size.height/2) ); - label1->setAnchorPoint(Vector2(0.5, 1.0)); + label1->setPosition( Vec2(size.width/2, size.height/2) ); + label1->setAnchorPoint(Vec2(0.5, 1.0)); addChild(label1); } @@ -966,7 +966,7 @@ LabelTTFLargeText::LabelTTFLargeText() TTFConfig ttfConfig("fonts/wt021.ttf",18,GlyphCollection::DYNAMIC); std::string text = FileUtils::getInstance()->getStringFromFile("commonly_used_words.txt"); auto label = Label::createWithTTF(ttfConfig,text, TextHAlignment::CENTER, size.width); - label->setPosition( Vector2(size.width/2, size.height/2) ); + label->setPosition( Vec2(size.width/2, size.height/2) ); addChild(label); } @@ -987,19 +987,19 @@ LabelTTFColor::LabelTTFColor() TTFConfig ttfConfig("fonts/arial.ttf", 18); // Green auto label1 = Label::createWithTTF(ttfConfig,"Green", TextHAlignment::CENTER, size.width); - label1->setPosition( Vector2(size.width/2, size.height * 0.3f) ); + label1->setPosition( Vec2(size.width/2, size.height * 0.3f) ); label1->setTextColor( Color4B::GREEN ); addChild(label1); // Red auto label2 = Label::createWithTTF(ttfConfig,"Red", TextHAlignment::CENTER, size.width); - label2->setPosition( Vector2(size.width/2, size.height * 0.4f) ); + label2->setPosition( Vec2(size.width/2, size.height * 0.4f) ); label2->setTextColor( Color4B::RED ); addChild(label2); // Blue auto label3 = Label::createWithTTF(ttfConfig,"Blue", TextHAlignment::CENTER, size.width); - label3->setPosition( Vector2(size.width/2, size.height * 0.5f) ); + label3->setPosition( Vec2(size.width/2, size.height * 0.5f) ); label3->setTextColor( Color4B::BLUE ); addChild(label3); } @@ -1019,7 +1019,7 @@ LabelTTFDynamicAlignment::LabelTTFDynamicAlignment() auto size = Director::getInstance()->getWinSize(); TTFConfig ttfConfig("fonts/arial.ttf", 23); _label = Label::createWithTTF(ttfConfig,LongSentencesExample, TextHAlignment::CENTER, size.width); - _label->setPosition( Vector2(size.width/2, size.height/2) ); + _label->setPosition( Vec2(size.width/2, size.height/2) ); auto menu = Menu::create( MenuItemFont::create("Left", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), @@ -1028,7 +1028,7 @@ LabelTTFDynamicAlignment::LabelTTFDynamicAlignment() NULL); menu->alignItemsVerticallyWithPadding(4); - menu->setPosition(Vector2(50, size.height / 4 )); + menu->setPosition(Vec2(50, size.height / 4 )); addChild(_label); this->addChild(menu); @@ -1078,34 +1078,34 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() auto size = Director::getInstance()->getWinSize(); auto drawNode = DrawNode::create(); - drawNode->setAnchorPoint(Vector2(0, 0)); + drawNode->setAnchorPoint(Vec2(0, 0)); this->addChild(drawNode); drawNode->drawSegment( - Vector2(size.width * 0.1, size.height * 0.8), - Vector2(size.width * 0.1, 0), 1, Color4F(1, 0, 0, 1)); + Vec2(size.width * 0.1, size.height * 0.8), + Vec2(size.width * 0.1, 0), 1, Color4F(1, 0, 0, 1)); drawNode->drawSegment( - Vector2(size.width * 0.85, size.height * 0.8), - Vector2(size.width * 0.85, 0), 1, Color4F(1, 0, 0, 1)); + Vec2(size.width * 0.85, size.height * 0.8), + Vec2(size.width * 0.85, 0), 1, Color4F(1, 0, 0, 1)); TTFConfig ttfConfig("fonts/wt021.ttf", 25, GlyphCollection::DYNAMIC); auto label1 = Label::createWithTTF(ttfConfig, "你好,Cocos2d-x v3的New Label.", TextHAlignment::LEFT, size.width * 0.75); label1->setTextColor(Color4B(128, 255, 255, 255)); - label1->setPosition(Vector2(size.width * 0.1, size.height * 0.6)); - label1->setAnchorPoint(Vector2(0, 0.5)); + label1->setPosition(Vec2(size.width * 0.1, size.height * 0.6)); + label1->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label1); auto label2 = Label::createWithTTF(ttfConfig, "早上好,Cocos2d-x v3的New Label.", TextHAlignment::LEFT, size.width * 0.75); label2->setTextColor(Color4B(255, 128, 255, 255)); - label2->setPosition(Vector2(size.width * 0.1, size.height * 0.4)); - label2->setAnchorPoint(Vector2(0, 0.5)); + label2->setPosition(Vec2(size.width * 0.1, size.height * 0.4)); + label2->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label2); auto label3 = Label::createWithTTF(ttfConfig, "美好的一天啊美好的一天啊美好的一天啊", TextHAlignment::LEFT, size.width * 0.75); label3->setTextColor(Color4B(255, 255, 128, 255)); - label3->setPosition(Vector2(size.width * 0.1, size.height * 0.2)); - label3->setAnchorPoint(Vector2(0, 0.5)); + label3->setPosition(Vec2(size.width * 0.1, size.height * 0.2)); + label3->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label3); } @@ -1140,12 +1140,12 @@ LabelTTFUnicodeNew::LabelTTFUnicodeNew() TTFConfig ttfConfig("fonts/arial.ttf", 23,GlyphCollection::ASCII); // Spanish auto label1 = Label::createWithTTF(ttfConfig,"Buen día, ¿cómo te llamas?", TextHAlignment::CENTER, size.width); - label1->setPosition( Vector2(size.width/2, vSize - (vStep * 4.5)) ); + label1->setPosition( Vec2(size.width/2, vSize - (vStep * 4.5)) ); addChild(label1); // German auto label2 = Label::createWithTTF(ttfConfig,"In welcher Straße haben Sie gelebt?", TextHAlignment::CENTER,size.width); - label2->setPosition( Vector2(size.width/2, vSize - (vStep * 5.5)) ); + label2->setPosition( Vec2(size.width/2, vSize - (vStep * 5.5)) ); addChild(label2); // chinese @@ -1153,7 +1153,7 @@ LabelTTFUnicodeNew::LabelTTFUnicodeNew() ttfConfig.glyphs = GlyphCollection::CUSTOM; ttfConfig.customGlyphs = chinese.c_str(); auto label3 = Label::createWithTTF(ttfConfig,chinese, TextHAlignment::CENTER,size.width); - label3->setPosition( Vector2(size.width/2, vSize - (vStep * 6.5)) ); + label3->setPosition( Vec2(size.width/2, vSize - (vStep * 6.5)) ); addChild(label3); } @@ -1186,7 +1186,7 @@ LabelTTFFontsTestNew::LabelTTFFontsTestNew() ttfConfig.fontFilePath = ttfpaths[i]; auto label = Label::createWithTTF(ttfConfig, ttfpaths[i], TextHAlignment::CENTER,0); if( label ) { - label->setPosition( Vector2(size.width/2, ((size.height * 0.6)/arraysize(ttfpaths) * i) + (size.height/5))); + label->setPosition( Vec2(size.width/2, ((size.height * 0.6)/arraysize(ttfpaths) * i) + (size.height/5))); addChild(label); } else { log("ERROR: Cannot load: %s", ttfpaths[i]); @@ -1209,7 +1209,7 @@ LabelBMFontTestNew::LabelBMFontTestNew() auto size = Director::getInstance()->getWinSize(); auto label1 = Label::createWithBMFont("fonts/bitmapFontTest2.fnt", "Hello World, this is testing the new Label using fnt file", TextHAlignment::CENTER, size.width); - label1->setPosition( Vector2(size.width/2, size.height/2) ); + label1->setPosition( Vec2(size.width/2, size.height/2) ); addChild(label1); } @@ -1229,7 +1229,7 @@ LabelTTFDistanceField::LabelTTFDistanceField() TTFConfig ttfConfig("fonts/arial.ttf", 40, GlyphCollection::DYNAMIC,nullptr,true); auto label1 = Label::createWithTTF(ttfConfig,"Distance Field",TextHAlignment::CENTER,size.width); - label1->setPosition( Vector2(size.width/2, size.height * 0.6f) ); + label1->setPosition( Vec2(size.width/2, size.height * 0.6f) ); label1->setTextColor( Color4B::GREEN ); addChild(label1); @@ -1241,7 +1241,7 @@ LabelTTFDistanceField::LabelTTFDistanceField() label1->runAction(RepeatForever::create(action)); auto label2 = Label::createWithTTF(ttfConfig,"Distance Field",TextHAlignment::CENTER,size.width); - label2->setPosition( Vector2(size.width/2, size.height * 0.3f) ); + label2->setPosition( Vec2(size.width/2, size.height * 0.3f) ); label2->setTextColor( Color4B::RED ); addChild(label2); } @@ -1266,28 +1266,28 @@ LabelOutlineAndGlowTest::LabelOutlineAndGlowTest() TTFConfig ttfConfig("fonts/arial.ttf", 40, GlyphCollection::DYNAMIC,nullptr,true); auto label1 = Label::createWithTTF(ttfConfig,"Glow", TextHAlignment::CENTER, size.width); - label1->setPosition( Vector2(size.width/2, size.height*0.7) ); + label1->setPosition( Vec2(size.width/2, size.height*0.7) ); label1->setTextColor( Color4B::GREEN ); label1->enableGlow(Color4B::YELLOW); addChild(label1); ttfConfig.outlineSize = 1; auto label2 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width); - label2->setPosition( Vector2(size.width/2, size.height*0.6) ); + label2->setPosition( Vec2(size.width/2, size.height*0.6) ); label2->setTextColor( Color4B::RED ); label2->enableOutline(Color4B::BLUE); addChild(label2); ttfConfig.outlineSize = 2; auto label3 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width); - label3->setPosition( Vector2(size.width/2, size.height*0.48) ); + label3->setPosition( Vec2(size.width/2, size.height*0.48) ); label3->setTextColor( Color4B::RED ); label3->enableOutline(Color4B::BLUE); addChild(label3); ttfConfig.outlineSize = 3; auto label4 = Label::createWithTTF(ttfConfig,"Outline", TextHAlignment::CENTER, size.width); - label4->setPosition( Vector2(size.width/2, size.height*0.36) ); + label4->setPosition( Vec2(size.width/2, size.height*0.36) ); label4->setTextColor( Color4B::RED ); label4->enableOutline(Color4B::BLUE); addChild(label4); @@ -1313,20 +1313,20 @@ LabelShadowTest::LabelShadowTest() TTFConfig ttfConfig("fonts/arial.ttf", 40, GlyphCollection::DYNAMIC,nullptr,true); shadowLabelTTF = Label::createWithTTF(ttfConfig,"TTF:Shadow"); - shadowLabelTTF->setPosition( Vector2(size.width/2, size.height*0.65f) ); + shadowLabelTTF->setPosition( Vec2(size.width/2, size.height*0.65f) ); shadowLabelTTF->setTextColor( Color4B::RED ); shadowLabelTTF->enableShadow(Color4B::BLACK); addChild(shadowLabelTTF); shadowLabelOutline = Label::createWithTTF(ttfConfig,"TTF:Shadow"); - shadowLabelOutline->setPosition( Vector2(size.width/2, size.height*0.5f) ); + shadowLabelOutline->setPosition( Vec2(size.width/2, size.height*0.5f) ); shadowLabelOutline->setTextColor( Color4B::RED ); shadowLabelOutline->enableOutline(Color4B::YELLOW,1); shadowLabelOutline->enableShadow(Color4B::BLACK); addChild(shadowLabelOutline); shadowLabelBMFont = Label::createWithBMFont("fonts/bitmapFontTest.fnt", "BMFont:Shadow"); - shadowLabelBMFont->setPosition( Vector2(size.width/2, size.height*0.35f) ); + shadowLabelBMFont->setPosition( Vec2(size.width/2, size.height*0.35f) ); shadowLabelBMFont->setColor( Color3B::RED ); shadowLabelBMFont->enableShadow(Color4B::GREEN); addChild(shadowLabelBMFont); @@ -1337,7 +1337,7 @@ LabelShadowTest::LabelShadowTest() slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); - slider->setPosition(Vector2(size.width / 2.0f, size.height * 0.15f + slider->getSize().height * 2.0f)); + slider->setPosition(Vec2(size.width / 2.0f, size.height * 0.15f + slider->getSize().height * 2.0f)); slider->setPercent(52); slider->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); addChild(slider); @@ -1348,7 +1348,7 @@ LabelShadowTest::LabelShadowTest() slider2->loadBarTexture("cocosui/sliderTrack.png"); slider2->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider2->loadProgressBarTexture("cocosui/sliderProgress.png"); - slider2->setPosition(Vector2(size.width * 0.15f, size.height / 2.0)); + slider2->setPosition(Vec2(size.width * 0.15f, size.height / 2.0)); slider2->setRotation(90); slider2->setPercent(52); slider2->addEventListener(CC_CALLBACK_2(LabelShadowTest::sliderEvent, this)); @@ -1385,14 +1385,14 @@ LabelCharMapTest::LabelCharMapTest() auto label1 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.plist"); addChild(label1, 0, kTagSprite1); - label1->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - label1->setPosition( Vector2(10,100) ); + label1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + label1->setPosition( Vec2(10,100) ); label1->setOpacity( 200 ); auto label2 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.plist"); addChild(label2, 0, kTagSprite2); - label2->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - label2->setPosition( Vector2(10,200) ); + label2->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + label2->setPosition( Vec2(10,200) ); label2->setOpacity( 32 ); schedule(schedule_selector(LabelCharMapTest::step)); @@ -1431,14 +1431,14 @@ LabelCharMapColorTest::LabelCharMapColorTest() { auto label1 = Label::createWithCharMap( "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label1, 0, kTagSprite1); - label1->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - label1->setPosition( Vector2(10,100) ); + label1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + label1->setPosition( Vec2(10,100) ); label1->setOpacity( 200 ); auto label2 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.png", 48, 64, ' '); addChild(label2, 0, kTagSprite2); - label2->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - label2->setPosition( Vector2(10,200) ); + label2->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + label2->setPosition( Vec2(10,200) ); label2->setColor( Color3B::RED ); auto fade = FadeOut::create(1.0f); @@ -1488,7 +1488,7 @@ LabelCrashTest::LabelCrashTest() TTFConfig ttfConfig("fonts/arial.ttf", 40, GlyphCollection::DYNAMIC,nullptr,true); auto label1 = Label::createWithTTF(ttfConfig,"Test崩溃123", TextHAlignment::CENTER, size.width); - label1->setPosition( Vector2(size.width/2, size.height/2) ); + label1->setPosition( Vec2(size.width/2, size.height/2) ); addChild(label1); } @@ -1509,16 +1509,16 @@ LabelTTFOldNew::LabelTTFOldNew() auto label1 = Label::createWithSystemFont("Cocos2d-x Label Test", "arial", 24); addChild(label1, 0, kTagBitmapAtlas1); - label1->setPosition(Vector2(s.width/2, delta * 2)); + label1->setPosition(Vec2(s.width/2, delta * 2)); label1->setColor(Color3B::RED); TTFConfig ttfConfig("fonts/arial.ttf", 24); auto label2 = Label::createWithTTF(ttfConfig, "Cocos2d-x Label Test"); addChild(label2, 0, kTagBitmapAtlas2); - label2->setPosition(Vector2(s.width/2, delta * 2)); + label2->setPosition(Vec2(s.width/2, delta * 2)); } -void LabelTTFOldNew::onDraw(const Matrix &transform, bool transformUpdated) +void LabelTTFOldNew::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1532,12 +1532,12 @@ void LabelTTFOldNew::onDraw(const Matrix &transform, bool transformUpdated) origin.width = origin.width / 2 - (labelSize.width / 2); origin.height = origin.height / 2 - (labelSize.height / 2); - Vector2 vertices[4]= + Vec2 vertices[4]= { - Vector2(origin.width, origin.height), - Vector2(labelSize.width + origin.width, origin.height), - Vector2(labelSize.width + origin.width, labelSize.height + origin.height), - Vector2(origin.width, labelSize.height + origin.height) + Vec2(origin.width, origin.height), + Vec2(labelSize.width + origin.width, origin.height), + Vec2(labelSize.width + origin.width, labelSize.height + origin.height), + Vec2(origin.width, labelSize.height + origin.height) }; DrawPrimitives::setDrawColor4B(Color4B::RED.r,Color4B::RED.g,Color4B::RED.b,Color4B::RED.a); DrawPrimitives::drawPoly(vertices, 4, true); @@ -1549,12 +1549,12 @@ void LabelTTFOldNew::onDraw(const Matrix &transform, bool transformUpdated) origin.width = origin.width / 2 - (labelSize.width / 2); origin.height = origin.height / 2 - (labelSize.height / 2); - Vector2 vertices2[4]= + Vec2 vertices2[4]= { - Vector2(origin.width, origin.height), - Vector2(labelSize.width + origin.width, origin.height), - Vector2(labelSize.width + origin.width, labelSize.height + origin.height), - Vector2(origin.width, labelSize.height + origin.height) + Vec2(origin.width, origin.height), + Vec2(labelSize.width + origin.width, origin.height), + Vec2(labelSize.width + origin.width, labelSize.height + origin.height), + Vec2(origin.width, labelSize.height + origin.height) }; DrawPrimitives::setDrawColor4B(Color4B::WHITE.r,Color4B::WHITE.g,Color4B::WHITE.b,Color4B::WHITE.a); DrawPrimitives::drawPoly(vertices2, 4, true); @@ -1562,7 +1562,7 @@ void LabelTTFOldNew::onDraw(const Matrix &transform, bool transformUpdated) director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } -void LabelTTFOldNew::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void LabelTTFOldNew::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(LabelTTFOldNew::onDraw, this, transform, transformUpdated); @@ -1585,11 +1585,11 @@ LabelFontNameTest::LabelFontNameTest() auto label1 = Label::create(); label1->setString("Default Font"); - label1->setPosition( Vector2(size.width/2, size.height * 0.7) ); + label1->setPosition( Vec2(size.width/2, size.height * 0.7) ); addChild(label1); auto label3 = Label::createWithSystemFont("Marker Felt","Marker Felt",32); - label3->setPosition( Vector2(size.width/2, size.height * 0.5) ); + label3->setPosition( Vec2(size.width/2, size.height * 0.5) ); addChild(label3); } @@ -1608,9 +1608,9 @@ LabelAlignmentTest::LabelAlignmentTest() auto blockSize = Size(200, 160); auto s = Director::getInstance()->getWinSize(); - auto pos = Vector2((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2); + auto pos = Vec2((s.width - blockSize.width) / 2, (s.height - blockSize.height) / 2); auto colorLayer = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height); - colorLayer->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + colorLayer->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); colorLayer->setPosition(pos); this->addChild(colorLayer); @@ -1622,7 +1622,7 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::create("Right", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), NULL); menu->alignItemsVerticallyWithPadding(4); - menu->setPosition(Vector2(50, s.height / 2 - 20)); + menu->setPosition(Vec2(50, s.height / 2 - 20)); this->addChild(menu); menu = Menu::create( @@ -1631,7 +1631,7 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), NULL); menu->alignItemsVerticallyWithPadding(4); - menu->setPosition(Vector2(s.width - 50, s.height / 2 - 20)); + menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); this->addChild(menu); _horizAlign = TextHAlignment::LEFT; @@ -1643,7 +1643,7 @@ LabelAlignmentTest::LabelAlignmentTest() _label->setAlignment(_horizAlign,_vertAlign); _label->setTTFConfig(ttfConfig); _label->setString(getCurrentAlignment()); - _label->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _label->setPosition(pos); addChild(_label); @@ -1741,8 +1741,8 @@ LabelIssue4428Test::LabelIssue4428Test() auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithBMFont( "fonts/bitmapFontTest3.fnt", "123\n456"); - label->setPosition(Vector2(size.width /2.0f, size.height / 2.0f)); - label->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + label->setPosition(Vec2(size.width /2.0f, size.height / 2.0f)); + label->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); addChild(label); int len = label->getStringLength(); diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h index cdd08e520d..834d6fd5ff 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.h @@ -58,14 +58,14 @@ public: LabelFNTSpriteActions(); virtual void step(float dt); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); }; class LabelFNTPadding : public AtlasDemoNew @@ -224,13 +224,13 @@ public: LabelFNTBounds(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); Label *label1; }; @@ -430,14 +430,14 @@ public: LabelTTFOldNew(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string title() const override; virtual std::string subtitle() const override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); }; class LabelTTFLargeText : public AtlasDemoNew diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index f3a6c6df4b..431daeba67 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -141,9 +141,9 @@ void LayerTestCascadingOpacityA::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, s.height/2)); - sister2->setPosition( Vector2( s.width*2/3, s.height/2)); - label->setPosition( Vector2( s.width/2, s.height/2)); + sister1->setPosition( Vec2( s.width*1/3, s.height/2)); + sister2->setPosition( Vec2( s.width*2/3, s.height/2)); + label->setPosition( Vec2( s.width/2, s.height/2)); layer1->runAction( RepeatForever::create( @@ -182,7 +182,7 @@ void LayerTestCascadingOpacityB::onEnter() auto layer1 = LayerColor::create(Color4B(192, 0, 0, 255), s.width, s.height/2); layer1->setCascadeColorEnabled(false); - layer1->setPosition( Vector2(0, s.height/2)); + layer1->setPosition( Vec2(0, s.height/2)); auto sister1 = Sprite::create("Images/grossinis_sister1.png"); auto sister2 = Sprite::create("Images/grossinis_sister2.png"); @@ -193,9 +193,9 @@ void LayerTestCascadingOpacityB::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, 0)); - sister2->setPosition( Vector2( s.width*2/3, 0)); - label->setPosition( Vector2( s.width/2, 0)); + sister1->setPosition( Vec2( s.width*1/3, 0)); + sister2->setPosition( Vec2( s.width*2/3, 0)); + label->setPosition( Vec2( s.width/2, 0)); layer1->runAction( RepeatForever::create( @@ -235,7 +235,7 @@ void LayerTestCascadingOpacityC::onEnter() layer1->setCascadeColorEnabled(false); layer1->setCascadeOpacityEnabled(false); - layer1->setPosition( Vector2(0, s.height/2)); + layer1->setPosition( Vec2(0, s.height/2)); auto sister1 = Sprite::create("Images/grossinis_sister1.png"); auto sister2 = Sprite::create("Images/grossinis_sister2.png"); @@ -246,9 +246,9 @@ void LayerTestCascadingOpacityC::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, 0)); - sister2->setPosition( Vector2( s.width*2/3, 0)); - label->setPosition( Vector2( s.width/2, 0)); + sister1->setPosition( Vec2( s.width*1/3, 0)); + sister2->setPosition( Vec2( s.width*2/3, 0)); + label->setPosition( Vec2( s.width/2, 0)); layer1->runAction( RepeatForever::create( @@ -294,9 +294,9 @@ void LayerTestCascadingColorA::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, s.height/2)); - sister2->setPosition( Vector2( s.width*2/3, s.height/2)); - label->setPosition( Vector2( s.width/2, s.height/2)); + sister1->setPosition( Vec2( s.width*1/3, s.height/2)); + sister2->setPosition( Vec2( s.width*2/3, s.height/2)); + label->setPosition( Vec2( s.width/2, s.height/2)); layer1->runAction( RepeatForever::create( @@ -336,7 +336,7 @@ void LayerTestCascadingColorB::onEnter() auto s = Director::getInstance()->getWinSize(); auto layer1 = LayerColor::create(Color4B(255, 255, 255, 255), s.width, s.height/2); - layer1->setPosition( Vector2(0, s.height/2)); + layer1->setPosition( Vec2(0, s.height/2)); auto sister1 = Sprite::create("Images/grossinis_sister1.png"); auto sister2 = Sprite::create("Images/grossinis_sister2.png"); @@ -347,9 +347,9 @@ void LayerTestCascadingColorB::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, 0)); - sister2->setPosition( Vector2( s.width*2/3, 0)); - label->setPosition( Vector2( s.width/2, 0)); + sister1->setPosition( Vec2( s.width*1/3, 0)); + sister2->setPosition( Vec2( s.width*2/3, 0)); + label->setPosition( Vec2( s.width/2, 0)); layer1->runAction( RepeatForever::create( @@ -388,7 +388,7 @@ void LayerTestCascadingColorC::onEnter() auto s = Director::getInstance()->getWinSize(); auto layer1 = LayerColor::create(Color4B(255, 255, 255, 255), s.width, s.height/2); layer1->setCascadeColorEnabled(false); - layer1->setPosition( Vector2(0, s.height/2)); + layer1->setPosition( Vec2(0, s.height/2)); auto sister1 = Sprite::create("Images/grossinis_sister1.png"); auto sister2 = Sprite::create("Images/grossinis_sister2.png"); @@ -399,9 +399,9 @@ void LayerTestCascadingColorC::onEnter() layer1->addChild(label); this->addChild( layer1, 0, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, 0)); - sister2->setPosition( Vector2( s.width*2/3, 0)); - label->setPosition( Vector2( s.width/2, 0)); + sister1->setPosition( Vec2( s.width*1/3, 0)); + sister2->setPosition( Vec2( s.width*2/3, 0)); + label->setPosition( Vec2( s.width/2, 0)); layer1->runAction( RepeatForever::create( @@ -449,11 +449,11 @@ void LayerTest1::onEnter() auto layer = LayerColor::create( Color4B(0xFF, 0x00, 0x00, 0x80), 200, 200); layer->ignoreAnchorPointForPosition(false); - layer->setPosition( Vector2(s.width/2, s.height/2) ); + layer->setPosition( Vec2(s.width/2, s.height/2) ); addChild(layer, 1, kTagLayer); } -void LayerTest1::updateSize(Vector2 &touchLocation) +void LayerTest1::updateSize(Vec2 &touchLocation) { auto s = Director::getInstance()->getWinSize(); @@ -497,12 +497,12 @@ void LayerTest2::onEnter() auto s = Director::getInstance()->getWinSize(); auto layer1 = LayerColor::create( Color4B(255, 255, 0, 80), 100, 300); - layer1->setPosition(Vector2(s.width/3, s.height/2)); + layer1->setPosition(Vec2(s.width/3, s.height/2)); layer1->ignoreAnchorPointForPosition(false); addChild(layer1, 1); auto layer2 = LayerColor::create( Color4B(0, 0, 255, 255), 100, 300); - layer2->setPosition(Vector2((s.width/3)*2, s.height/2)); + layer2->setPosition(Vec2((s.width/3)*2, s.height/2)); layer2->ignoreAnchorPointForPosition(false); addChild(layer2, 1); @@ -540,8 +540,8 @@ LayerTestBlend::LayerTestBlend() addChild(sister2); addChild(layer1, 100, kTagLayer); - sister1->setPosition( Vector2( s.width*1/3, s.height/2) ); - sister2->setPosition( Vector2( s.width*2/3, s.height/2) ); + sister1->setPosition( Vec2( s.width*1/3, s.height/2) ); + sister2->setPosition( Vec2( s.width*2/3, s.height/2) ); schedule( schedule_selector(LayerTestBlend::newBlend), 1.0f); } @@ -581,7 +581,7 @@ std::string LayerTestBlend::subtitle() const //------------------------------------------------------------------ LayerGradientTest::LayerGradientTest() { - auto layer1 = LayerGradient::create(Color4B(255,0,0,255), Color4B(0,255,0,255), Vector2(0.9f, 0.9f)); + auto layer1 = LayerGradient::create(Color4B(255,0,0,255), Color4B(0,255,0,255), Vec2(0.9f, 0.9f)); addChild(layer1, 0, kTagLayer); auto listener = EventListenerTouchAllAtOnce::create(); @@ -597,7 +597,7 @@ LayerGradientTest::LayerGradientTest() auto menu = Menu::create(item, NULL); addChild(menu); auto s = Director::getInstance()->getWinSize(); - menu->setPosition(Vector2(s.width / 2, 100)); + menu->setPosition(Vec2(s.width / 2, 100)); } void LayerGradientTest::toggleItem(Ref *sender) @@ -613,7 +613,7 @@ void LayerGradientTest::onTouchesMoved(const std::vector& touches, Event auto touch = touches[0]; auto start = touch->getLocation(); - auto diff = Vector2(s.width/2,s.height/2) - start; + auto diff = Vec2(s.width/2,s.height/2) - start; diff = diff.getNormalized(); auto gradient = static_cast( getChildByTag(1) ); @@ -685,10 +685,10 @@ void LayerIgnoreAnchorPointPos::onEnter() auto l = LayerColor::create(Color4B(255, 0, 0, 255), 150, 150); - l->setAnchorPoint(Vector2(0.5f, 0.5f)); - l->setPosition(Vector2( s.width/2, s.height/2)); + l->setAnchorPoint(Vec2(0.5f, 0.5f)); + l->setPosition(Vec2( s.width/2, s.height/2)); - auto move = MoveBy::create(2, Vector2(100,2)); + auto move = MoveBy::create(2, Vec2(100,2)); auto back = (MoveBy *)move->reverse(); auto seq = Sequence::create(move, back, NULL); l->runAction(RepeatForever::create(seq)); @@ -697,14 +697,14 @@ void LayerIgnoreAnchorPointPos::onEnter() auto child = Sprite::create("Images/grossini.png"); l->addChild(child); auto lsize = l->getContentSize(); - child->setPosition(Vector2(lsize.width/2, lsize.height/2)); + child->setPosition(Vec2(lsize.width/2, lsize.height/2)); auto item = MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } void LayerIgnoreAnchorPointPos::onToggle(Ref* pObject) @@ -721,7 +721,7 @@ std::string LayerIgnoreAnchorPointPos::title() const std::string LayerIgnoreAnchorPointPos::subtitle() const { - return "Ignoring Anchor Vector2 for position"; + return "Ignoring Anchor Vec2 for position"; } // LayerIgnoreAnchorPointRot @@ -733,8 +733,8 @@ void LayerIgnoreAnchorPointRot::onEnter() auto l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200); - l->setAnchorPoint(Vector2(0.5f, 0.5f)); - l->setPosition(Vector2( s.width/2, s.height/2)); + l->setAnchorPoint(Vec2(0.5f, 0.5f)); + l->setPosition(Vec2( s.width/2, s.height/2)); this->addChild(l, 0, kLayerIgnoreAnchorPoint); @@ -745,14 +745,14 @@ void LayerIgnoreAnchorPointRot::onEnter() auto child = Sprite::create("Images/grossini.png"); l->addChild(child); auto lsize = l->getContentSize(); - child->setPosition(Vector2(lsize.width/2, lsize.height/2)); + child->setPosition(Vec2(lsize.width/2, lsize.height/2)); auto item = MenuItemFont::create("Toogle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } void LayerIgnoreAnchorPointRot::onToggle(Ref* pObject) @@ -769,7 +769,7 @@ std::string LayerIgnoreAnchorPointRot::title() const std::string LayerIgnoreAnchorPointRot::subtitle() const { - return "Ignoring Anchor Vector2 for rotations"; + return "Ignoring Anchor Vec2 for rotations"; } // LayerIgnoreAnchorPointScale @@ -781,8 +781,8 @@ void LayerIgnoreAnchorPointScale::onEnter() auto l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200); - l->setAnchorPoint(Vector2(0.5f, 1.0f)); - l->setPosition(Vector2( s.width/2, s.height/2)); + l->setAnchorPoint(Vec2(0.5f, 1.0f)); + l->setPosition(Vec2( s.width/2, s.height/2)); auto scale = ScaleBy::create(2, 2); @@ -796,14 +796,14 @@ void LayerIgnoreAnchorPointScale::onEnter() auto child = Sprite::create("Images/grossini.png"); l->addChild(child); auto lsize = l->getContentSize(); - child->setPosition(Vector2(lsize.width/2, lsize.height/2)); + child->setPosition(Vec2(lsize.width/2, lsize.height/2)); auto item = MenuItemFont::create("Toogle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } void LayerIgnoreAnchorPointScale::onToggle(Ref* pObject) @@ -820,7 +820,7 @@ std::string LayerIgnoreAnchorPointScale::title() const std::string LayerIgnoreAnchorPointScale::subtitle() const { - return "Ignoring Anchor Vector2 for scale"; + return "Ignoring Anchor Vec2 for scale"; } void LayerTestScene::runThisTest() @@ -836,17 +836,17 @@ LayerExtendedBlendOpacityTest::LayerExtendedBlendOpacityTest() { auto layer1 = LayerGradient::create(Color4B(255, 0, 0, 255), Color4B(255, 0, 255, 255)); layer1->setContentSize(Size(80, 80)); - layer1->setPosition(Vector2(50,50)); + layer1->setPosition(Vec2(50,50)); addChild(layer1); auto layer2 = LayerGradient::create(Color4B(0, 0, 0, 127), Color4B(255, 255, 255, 127)); layer2->setContentSize(Size(80, 80)); - layer2->setPosition(Vector2(100,90)); + layer2->setPosition(Vec2(100,90)); addChild(layer2); auto layer3 = LayerGradient::create(); layer3->setContentSize(Size(80, 80)); - layer3->setPosition(Vector2(150,140)); + layer3->setPosition(Vec2(150,140)); layer3->setStartColor(Color3B(255, 0, 0)); layer3->setEndColor(Color3B(255, 0, 255)); layer3->setStartOpacity(255); @@ -879,7 +879,7 @@ void LayerBug3162A::onEnter() { _layer[i] = LayerColor::create(color[i]); _layer[i]->setContentSize(size); - _layer[i]->setPosition(Vector2(size.width/2, size.height/2) - Vector2(20, 20)); + _layer[i]->setPosition(Vec2(size.width/2, size.height/2) - Vec2(20, 20)); _layer[i]->setOpacity(150); _layer[i]->setCascadeOpacityEnabled(true); if (i > 0) @@ -922,7 +922,7 @@ void LayerBug3162B::onEnter() { _layer[i] = LayerColor::create(color[i]); _layer[i]->setContentSize(size); - _layer[i]->setPosition(Vector2(size.width/2, size.height/2) - Vector2(20, 20)); + _layer[i]->setPosition(Vec2(size.width/2, size.height/2) - Vec2(20, 20)); //_layer[i]->setOpacity(150); if (i > 0) { diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.h b/tests/cpp-tests/Classes/LayerTest/LayerTest.h index 0bfbf729e1..62cd4cdca7 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.h +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.h @@ -80,7 +80,7 @@ public: virtual void onEnter() override; virtual std::string subtitle() const override; - void updateSize(Vector2 &touchLocation); + void updateSize(Vec2 &touchLocation); void onTouchesBegan(const std::vector& touches, Event *event); void onTouchesMoved(const std::vector& touches, Event *event); diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index c5b75e6366..bb00913264 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -119,9 +119,9 @@ MenuLayerMainMenu::MenuLayerMainMenu() if( i % 2 == 0) offset = -offset; - child->setPosition( Vector2( dstPoint.x + offset, dstPoint.y) ); + child->setPosition( Vec2( dstPoint.x + offset, dstPoint.y) ); child->runAction( - EaseElasticOut::create(MoveBy::create(2, Vector2(dstPoint.x - offset,0)), 0.35f) + EaseElasticOut::create(MoveBy::create(2, Vec2(dstPoint.x - offset,0)), 0.35f) ); i++; } @@ -130,7 +130,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() _disabledItem->setEnabled( false ); addChild(menu); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); menu->setScale(0); menu->runAction(ScaleTo::create(1,1)); } @@ -224,7 +224,7 @@ MenuLayer2::MenuLayer2() auto menu = Menu::create(item1, item2, item3, NULL); auto s = Director::getInstance()->getWinSize(); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); menu->setTag( kTagMenu ); @@ -252,7 +252,7 @@ void MenuLayer2::alignMenusH() // TIP: if no padding, padding = 5 menu->alignItemsHorizontally(); auto p = menu->getPosition(); - menu->setPosition(p + Vector2(0,30)); + menu->setPosition(p + Vec2(0,30)); } else @@ -260,7 +260,7 @@ void MenuLayer2::alignMenusH() // TIP: but padding is configurable menu->alignItemsHorizontallyWithPadding(40); auto p = menu->getPosition(); - menu->setPosition(p - Vector2(0,30)); + menu->setPosition(p - Vec2(0,30)); } } } @@ -276,14 +276,14 @@ void MenuLayer2::alignMenusV() // TIP: if no padding, padding = 5 menu->alignItemsVertically(); auto p = menu->getPosition(); - menu->setPosition(p + Vector2(100,0)); + menu->setPosition(p + Vec2(100,0)); } else { // TIP: but padding is configurable menu->alignItemsVerticallyWithPadding(40); auto p = menu->getPosition(); - menu->setPosition(p - Vector2(100,0)); + menu->setPosition(p - Vec2(100,0)); } } } @@ -345,15 +345,15 @@ MenuLayer3::MenuLayer3() _disabledItem->setEnabled( false ); auto menu = Menu::create( item1, item2, item3, NULL); - menu->setPosition( Vector2(0,0) ); + menu->setPosition( Vec2(0,0) ); auto s = Director::getInstance()->getWinSize(); - item1->setPosition( Vector2(s.width/2 - 150, s.height/2) ); - item2->setPosition( Vector2(s.width/2 - 200, s.height/2) ); - item3->setPosition( Vector2(s.width/2, s.height/2 - 100) ); + item1->setPosition( Vec2(s.width/2 - 150, s.height/2) ); + item2->setPosition( Vec2(s.width/2 - 200, s.height/2) ); + item3->setPosition( Vec2(s.width/2, s.height/2 - 100) ); - auto jump = JumpBy::create(3, Vector2(400,0), 50, 4); + auto jump = JumpBy::create(3, Vec2(400,0), 50, 4); item2->runAction( RepeatForever::create(Sequence::create( jump, jump->reverse(), NULL))); auto spin1 = RotateBy::create(3, 360); @@ -366,7 +366,7 @@ MenuLayer3::MenuLayer3() addChild( menu ); - menu->setPosition(Vector2(0,0)); + menu->setPosition(Vec2(0,0)); } MenuLayer3::~MenuLayer3() @@ -450,7 +450,7 @@ MenuLayer4::MenuLayer4() addChild( menu ); auto s = Director::getInstance()->getWinSize(); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } MenuLayer4::~MenuLayer4() @@ -479,7 +479,7 @@ BugsTest::BugsTest() menu->alignItemsVertically(); auto s = Director::getInstance()->getWinSize(); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } void BugsTest::issue1410MenuCallback(Ref *sender) @@ -510,7 +510,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("click item and move, should not crash", "fonts/arial.ttf", 20); - label->setPosition(Vector2(s.width/2, s.height - 30)); + label->setPosition(Vec2(s.width/2, s.height - 30)); addChild(label); item = MenuItemFont::create("item 1"); @@ -522,7 +522,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() addChild(menu); menu->alignItemsVertically(); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); // Register Touch Event _touchListener = EventListenerTouchOneByOne::create(); diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.h b/tests/cpp-tests/Classes/MenuTest/MenuTest.h index 89820ed3a6..e676b9fe98 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.h +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.h @@ -61,7 +61,7 @@ public: class MenuLayer2 : public Layer { protected: - Vector2 _centeredMenu; + Vec2 _centeredMenu; bool _alignedH; void alignMenusH(); diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp index 66db64aea0..233603da5d 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -62,12 +62,12 @@ void MotionStreakTest1::onEnter() // the root object just rotates around _root = Sprite::create(s_pathR1); addChild(_root, 1); - _root->setPosition(Vector2(s.width/2, s.height/2)); + _root->setPosition(Vec2(s.width/2, s.height/2)); // the target object is offset from root, and the streak is moved to follow it _target = Sprite::create(s_pathR1); _root->addChild(_target); - _target->setPosition(Vector2(s.width/4, 0)); + _target->setPosition(Vec2(s.width/4, 0)); // create the streak object and add it to the scene streak = MotionStreak::create(2, 3, 32, Color3B::GREEN, s_streak); @@ -78,7 +78,7 @@ void MotionStreakTest1::onEnter() auto a1 = RotateBy::create(2, 360); auto action1 = RepeatForever::create(a1); - auto motion = MoveBy::create(2, Vector2(100,0) ); + auto motion = MoveBy::create(2, Vec2(100,0) ); _root->runAction( RepeatForever::create(Sequence::create(motion, motion->reverse(), NULL) ) ); _root->runAction( action1 ); @@ -97,7 +97,7 @@ void MotionStreakTest1::onEnter() void MotionStreakTest1::onUpdate(float delta) { - streak->setPosition( _target->convertToWorldSpace(Vector2::ZERO) ); + streak->setPosition( _target->convertToWorldSpace(Vec2::ZERO) ); } std::string MotionStreakTest1::title() const @@ -125,7 +125,7 @@ void MotionStreakTest2::onEnter() streak = MotionStreak::create(3, 3, 64, Color3B::WHITE, s_streak ); addChild(streak); - streak->setPosition( Vector2(s.width/2, s.height/2) ); + streak->setPosition( Vec2(s.width/2, s.height/2) ); } void MotionStreakTest2::onTouchesMoved(const std::vector& touches, Event* event) @@ -157,7 +157,7 @@ void Issue1358::onEnter() addChild(streak); - _center = Vector2(size.width/2, size.height/2); + _center = Vec2(size.width/2, size.height/2); _radius = size.width/3; _angle = 0.0f; @@ -167,7 +167,7 @@ void Issue1358::onEnter() void Issue1358::update(float dt) { _angle += 1.0f; - streak->setPosition(Vector2(_center.x + cosf(_angle/180 * M_PI)*_radius, + streak->setPosition(Vec2(_center.x + cosf(_angle/180 * M_PI)*_radius, _center.y + sinf(_angle/ 180 * M_PI)*_radius)); } @@ -219,7 +219,7 @@ void MotionStreakTest::onEnter() auto menuMode = Menu::create(itemMode, NULL); addChild(menuMode); - menuMode->setPosition(Vector2(s.width/2, s.height/4)); + menuMode->setPosition(Vec2(s.width/2, s.height/4)); } void MotionStreakTest::modeCallback(Ref *pSender) diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h index ee4f9fcc39..cd3864a7db 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.h @@ -61,7 +61,7 @@ public: virtual void onEnter() override; virtual void update(float dt); private: - Vector2 _center; + Vec2 _center; float _radius; float _angle; }; diff --git a/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp b/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp index 848293b58e..2dd971a644 100644 --- a/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp +++ b/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp @@ -17,18 +17,18 @@ public: setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); } - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { DrawPrimitives::setDrawColor4B(_touchColor.r, _touchColor.g, _touchColor.b, 255); glLineWidth(10); - DrawPrimitives::drawLine( Vector2(0, _touchPoint.y), Vector2(getContentSize().width, _touchPoint.y) ); - DrawPrimitives::drawLine( Vector2(_touchPoint.x, 0), Vector2(_touchPoint.x, getContentSize().height) ); + DrawPrimitives::drawLine( Vec2(0, _touchPoint.y), Vec2(getContentSize().width, _touchPoint.y) ); + DrawPrimitives::drawLine( Vec2(_touchPoint.x, 0), Vec2(_touchPoint.x, getContentSize().height) ); glLineWidth(1); DrawPrimitives::setPointSize(30); DrawPrimitives::drawPoint(_touchPoint); } - void setTouchPos(const Vector2& pt) + void setTouchPos(const Vec2& pt) { _touchPoint = pt; } @@ -42,13 +42,13 @@ public: { auto pRet = new TouchPoint(); pRet->setContentSize(pParent->getContentSize()); - pRet->setAnchorPoint(Vector2(0.0f, 0.0f)); + pRet->setAnchorPoint(Vec2(0.0f, 0.0f)); pRet->autorelease(); return pRet; } private: - Vector2 _touchPoint; + Vec2 _touchPoint; Color3B _touchColor; }; @@ -63,7 +63,7 @@ bool MutiTouchTestLayer::init() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto title = Label::createWithSystemFont("Please touch the screen!", "", 24); - title->setPosition(VisibleRect::top()+Vector2(0, -40)); + title->setPosition(VisibleRect::top()+Vec2(0, -40)); addChild(title); return true; diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 4b12b7447f..0355b21751 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -127,21 +127,21 @@ void TouchableSpriteTest::onEnter() { EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto containerForSprite1 = Node::create(); auto sprite1 = Sprite::create("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2) + Vector2(-80, 80)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2) + Vec2(-80, 80)); containerForSprite1->addChild(sprite1); addChild(containerForSprite1, 10); auto sprite2 = Sprite::create("Images/MagentaSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite2, 20); auto sprite3 = Sprite::create("Images/YellowSquare.png"); - sprite3->setPosition(Vector2(0, 0)); + sprite3->setPosition(Vec2(0, 0)); sprite2->addChild(sprite3, 1); // Make sprite1 touchable @@ -151,7 +151,7 @@ void TouchableSpriteTest::onEnter() listener1->onTouchBegan = [](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); - Vector2 locationInNode = target->convertToNodeSpace(touch->getLocation()); + Vec2 locationInNode = target->convertToNodeSpace(touch->getLocation()); Size s = target->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -199,20 +199,20 @@ void TouchableSpriteTest::onEnter() }); nextItem->setFontSizeObj(16); - nextItem->setPosition(VisibleRect::right() + Vector2(-100, -30)); + nextItem->setPosition(VisibleRect::right() + Vec2(-100, -30)); auto menu2 = Menu::create(nextItem, NULL); - menu2->setPosition(Vector2(0, 0)); - menu2->setAnchorPoint(Vector2(0, 0)); + menu2->setPosition(Vec2(0, 0)); + menu2->setAnchorPoint(Vec2(0, 0)); this->addChild(menu2); }); removeAllTouchItem->setFontSizeObj(16); - removeAllTouchItem->setPosition(VisibleRect::right() + Vector2(-100, 0)); + removeAllTouchItem->setPosition(VisibleRect::right() + Vec2(-100, 0)); auto menu = Menu::create(removeAllTouchItem, nullptr); - menu->setPosition(Vector2(0, 0)); - menu->setAnchorPoint(Vector2(0, 0)); + menu->setPosition(Vec2(0, 0)); + menu->setAnchorPoint(Vec2(0, 0)); addChild(menu); } @@ -263,7 +263,7 @@ public: listener->onTouchBegan = [=](Touch* touch, Event* event){ - Vector2 locationInNode = this->convertToNodeSpace(touch->getLocation()); + Vec2 locationInNode = this->convertToNodeSpace(touch->getLocation()); Size s = this->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -317,22 +317,22 @@ void FixedPriorityTest::onEnter() { EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto sprite1 = TouchableSprite::create(30); sprite1->setTexture("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2) + Vector2(-80, 40)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2) + Vec2(-80, 40)); addChild(sprite1, 10); auto sprite2 = TouchableSprite::create(20); sprite2->setTexture("Images/MagentaSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite2, 20); auto sprite3 = TouchableSprite::create(10); sprite3->setTexture("Images/YellowSquare.png"); - sprite3->setPosition(Vector2(0, 0)); + sprite3->setPosition(Vec2(0, 0)); sprite2->addChild(sprite3, 1); } @@ -352,11 +352,11 @@ void RemoveListenerWhenDispatching::onEnter() { EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto sprite1 = Sprite::create("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite1, 10); // Make sprite1 touchable @@ -367,7 +367,7 @@ void RemoveListenerWhenDispatching::onEnter() std::shared_ptr firstClick(new bool(true)); listener1->onTouchBegan = [=](Touch* touch, Event* event){ - Vector2 locationInNode = sprite1->convertToNodeSpace(touch->getLocation()); + Vec2 locationInNode = sprite1->convertToNodeSpace(touch->getLocation()); Size s = sprite1->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -386,7 +386,7 @@ void RemoveListenerWhenDispatching::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, sprite1); auto statusLabel = Label::createWithSystemFont("The sprite could be touched!", "", 20); - statusLabel->setPosition(origin + Vector2(size.width/2, size.height-90)); + statusLabel->setPosition(origin + Vec2(size.width/2, size.height-90)); addChild(statusLabel); std::shared_ptr enable(new bool(true)); // Enable/Disable item @@ -407,10 +407,10 @@ void RemoveListenerWhenDispatching::onEnter() } }, MenuItemFont::create("Enabled"), MenuItemFont::create("Disabled"), NULL); - toggleItem->setPosition(origin + Vector2(size.width/2, 80)); + toggleItem->setPosition(origin + Vec2(size.width/2, 80)); auto menu = Menu::create(toggleItem, nullptr); - menu->setPosition(Vector2(0, 0)); - menu->setAnchorPoint(Vector2(0, 0)); + menu->setPosition(Vec2(0, 0)); + menu->setAnchorPoint(Vec2(0, 0)); addChild(menu, -1); } @@ -429,13 +429,13 @@ void CustomEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); MenuItemFont::setFontSize(20); auto statusLabel = Label::createWithSystemFont("No custom event 1 received!", "", 20); - statusLabel->setPosition(origin + Vector2(size.width/2, size.height-90)); + statusLabel->setPosition(origin + Vec2(size.width/2, size.height-90)); addChild(statusLabel); _listener = EventListenerCustom::create("game_custom_event1", [=](EventCustom* event){ @@ -458,10 +458,10 @@ void CustomEventTest::onEnter() _eventDispatcher->dispatchEvent(&event); CC_SAFE_DELETE_ARRAY(buf); }); - sendItem->setPosition(origin + Vector2(size.width/2, size.height/2)); + sendItem->setPosition(origin + Vec2(size.width/2, size.height/2)); auto statusLabel2 = Label::createWithSystemFont("No custom event 2 received!", "", 20); - statusLabel2->setPosition(origin + Vector2(size.width/2, size.height-120)); + statusLabel2->setPosition(origin + Vec2(size.width/2, size.height-120)); addChild(statusLabel2); _listener2 = EventListenerCustom::create("game_custom_event2", [=](EventCustom* event){ @@ -484,11 +484,11 @@ void CustomEventTest::onEnter() _eventDispatcher->dispatchEvent(&event); CC_SAFE_DELETE_ARRAY(buf); }); - sendItem2->setPosition(origin + Vector2(size.width/2, size.height/2 - 40)); + sendItem2->setPosition(origin + Vec2(size.width/2, size.height/2 - 40)); auto menu = Menu::create(sendItem, sendItem2, nullptr); - menu->setPosition(Vector2(0, 0)); - menu->setAnchorPoint(Vector2(0, 0)); + menu->setPosition(Vec2(0, 0)); + menu->setAnchorPoint(Vec2(0, 0)); addChild(menu, -1); } @@ -514,11 +514,11 @@ void LabelKeyboardEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto statusLabel = Label::createWithSystemFont("No keyboard event received!", "", 20); - statusLabel->setPosition(origin + Vector2(size.width/2, size.height/2)); + statusLabel->setPosition(origin + Vec2(size.width/2, size.height/2)); addChild(statusLabel); auto listener = EventListenerKeyboard::create(); @@ -560,13 +560,13 @@ _pos = _max; \ EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); Device::setAccelerometerEnabled(true); auto sprite = Sprite::create(s_Ball); - sprite->setPosition(origin + Vector2(size.width/2, size.height/2)); + sprite->setPosition(origin + Vec2(size.width/2, size.height/2)); addChild(sprite); auto listener = EventListenerAcceleration::create([=](Acceleration* acc, Event* event){ @@ -610,11 +610,11 @@ void RemoveAndRetainNodeTest::onEnter() EventDispatcherTestDemo::onEnter(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); _sprite = Sprite::create("Images/CyanSquare.png"); - _sprite->setPosition(origin+Vector2(size.width/2, size.height/2)); + _sprite->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(_sprite, 10); // Make sprite1 touchable @@ -624,7 +624,7 @@ void RemoveAndRetainNodeTest::onEnter() listener1->onTouchBegan = [](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); - Vector2 locationInNode = target->convertToNodeSpace(touch->getLocation()); + Vec2 locationInNode = target->convertToNodeSpace(touch->getLocation()); Size s = target->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -701,17 +701,17 @@ void RemoveListenerAfterAddingTest::onEnter() _eventDispatcher->removeEventListener(listener); }); - item1->setPosition(VisibleRect::center() + Vector2(0, 80)); + item1->setPosition(VisibleRect::center() + Vec2(0, 80)); auto addNextButton = [this](){ auto next = MenuItemFont::create("Please Click Me To Reset!", [this](Ref* sender){ this->restartCallback(nullptr); }); - next->setPosition(VisibleRect::center() + Vector2(0, -40)); + next->setPosition(VisibleRect::center() + Vec2(0, -40)); auto menu = Menu::create(next, nullptr); menu->setPosition(VisibleRect::leftBottom()); - menu->setAnchorPoint(Vector2::ZERO); + menu->setAnchorPoint(Vec2::ZERO); this->addChild(menu); }; @@ -728,7 +728,7 @@ void RemoveListenerAfterAddingTest::onEnter() addNextButton(); }); - item2->setPosition(VisibleRect::center() + Vector2(0, 40)); + item2->setPosition(VisibleRect::center() + Vec2(0, 40)); auto item3 = MenuItemFont::create("Click Me 3", [=](Ref* sender){ auto listener = EventListenerTouchOneByOne::create(); @@ -747,7 +747,7 @@ void RemoveListenerAfterAddingTest::onEnter() auto menu = Menu::create(item1, item2, item3, nullptr); menu->setPosition(VisibleRect::leftBottom()); - menu->setAnchorPoint(Vector2::ZERO); + menu->setAnchorPoint(Vec2::ZERO); addChild(menu); } @@ -789,23 +789,23 @@ void DirectorEventTest::onEnter() TTFConfig ttfConfig("fonts/arial.ttf", 20); _label1 = Label::createWithTTF(ttfConfig, "Update: 0"); - _label1->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _label1->setPosition(30,s.height/2 + 60); this->addChild(_label1); _label2 = Label::createWithTTF(ttfConfig, "Visit: 0"); - _label2->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label2->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _label2->setPosition(30,s.height/2 + 20); this->addChild(_label2); _label3 = Label::createWithTTF(ttfConfig, "Draw: 0"); - _label3->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label3->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _label3->setPosition(30,30); _label3->setPosition(30,s.height/2 - 20); this->addChild(_label3); _label4 = Label::createWithTTF(ttfConfig, "Projection: 0"); - _label4->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + _label4->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); _label4->setPosition(30,30); _label4->setPosition(30,s.height/2 - 60); this->addChild(_label4); @@ -899,7 +899,7 @@ GlobalZTouchTest::GlobalZTouchTest() listener->onTouchBegan = [](Touch* touch, Event* event){ auto target = static_cast(event->getCurrentTarget()); - Vector2 locationInNode = target->convertToNodeSpace(touch->getLocation()); + Vec2 locationInNode = target->convertToNodeSpace(touch->getLocation()); Size s = target->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -1082,9 +1082,9 @@ StopPropagationTest::StopPropagationTest() } } -bool StopPropagationTest::isPointInNode(Vector2 pt, Node* node) +bool StopPropagationTest::isPointInNode(Vec2 pt, Node* node) { - Vector2 locationInNode = node->convertToNodeSpace(pt); + Vec2 locationInNode = node->convertToNodeSpace(pt); Size s = node->getContentSize(); Rect rect = Rect(0, 0, s.width, s.height); @@ -1095,7 +1095,7 @@ bool StopPropagationTest::isPointInNode(Vector2 pt, Node* node) return false; } -bool StopPropagationTest::isPointInTopHalfAreaOfScreen(Vector2 pt) +bool StopPropagationTest::isPointInTopHalfAreaOfScreen(Vec2 pt) { Size winSize = Director::getInstance()->getWinSize(); @@ -1119,22 +1119,22 @@ std::string StopPropagationTest::subtitle() const // PauseResumeTargetTest PauseResumeTargetTest::PauseResumeTargetTest() { - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto sprite1 = TouchableSprite::create(); sprite1->setTexture("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2) + Vector2(-80, 40)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2) + Vec2(-80, 40)); addChild(sprite1, -10); auto sprite2 = TouchableSprite::create(); sprite2->setTexture("Images/MagentaSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite2, -20); auto sprite3 = TouchableSprite::create(100); // Sprite3 uses fixed priority listener sprite3->setTexture("Images/YellowSquare.png"); - sprite3->setPosition(Vector2(0, 0)); + sprite3->setPosition(Vec2(0, 0)); sprite2->addChild(sprite3, -1); auto popup = MenuItemFont::create("Popup", [=](Ref* sender){ @@ -1154,18 +1154,18 @@ PauseResumeTargetTest::PauseResumeTargetTest() closeItem->setPosition(VisibleRect::center()); auto closeMenu = Menu::create(closeItem, NULL); - closeMenu->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - closeMenu->setPosition(Vector2::ZERO); + closeMenu->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + closeMenu->setPosition(Vec2::ZERO); colorLayer->addChild(closeMenu); }); - popup->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); + popup->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); popup->setPosition(VisibleRect::right()); auto menu = Menu::create(popup, nullptr); - menu->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - menu->setPosition(Vector2::ZERO); + menu->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + menu->setPosition(Vec2::ZERO); addChild(menu); } @@ -1191,8 +1191,8 @@ Issue4129::Issue4129() _customlistener = _eventDispatcher->addCustomEventListener(EVENT_COME_TO_BACKGROUND, [this](EventCustom* event){ auto label = Label::createWithSystemFont("Yeah, this issue was fixed.", "", 20); - label->setAnchorPoint(Vector2(0, 0.5f)); - label->setPosition(Vector2(VisibleRect::left())); + label->setAnchorPoint(Vec2(0, 0.5f)); + label->setPosition(Vec2(VisibleRect::left())); this->addChild(label); // After test, remove it. @@ -1214,11 +1214,11 @@ Issue4129::Issue4129() }); nextItem->setFontSizeObj(16); - nextItem->setPosition(VisibleRect::right() + Vector2(-100, -30)); + nextItem->setPosition(VisibleRect::right() + Vec2(-100, -30)); auto menu2 = Menu::create(nextItem, NULL); - menu2->setPosition(Vector2(0, 0)); - menu2->setAnchorPoint(Vector2(0, 0)); + menu2->setPosition(Vec2(0, 0)); + menu2->setAnchorPoint(Vec2(0, 0)); this->addChild(menu2); // Simulate to dispatch 'come to background' event @@ -1226,11 +1226,11 @@ Issue4129::Issue4129() }); removeAllTouchItem->setFontSizeObj(16); - removeAllTouchItem->setPosition(VisibleRect::right() + Vector2(-100, 0)); + removeAllTouchItem->setPosition(VisibleRect::right() + Vec2(-100, 0)); auto menu = Menu::create(removeAllTouchItem, nullptr); - menu->setPosition(Vector2(0, 0)); - menu->setAnchorPoint(Vector2(0, 0)); + menu->setPosition(Vec2(0, 0)); + menu->setAnchorPoint(Vec2(0, 0)); addChild(menu); } @@ -1255,23 +1255,23 @@ std::string Issue4129::subtitle() const // Issue4160 Issue4160::Issue4160() { - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto sprite1 = TouchableSprite::create(-30); sprite1->setTexture("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2) + Vector2(-80, 40)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2) + Vec2(-80, 40)); addChild(sprite1, -10); auto sprite2 = TouchableSprite::create(-20); sprite2->setTexture("Images/MagentaSquare.png"); sprite2->removeListenerOnTouchEnded(true); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite2, -20); auto sprite3 = TouchableSprite::create(-10); sprite3->setTexture("Images/YellowSquare.png"); - sprite3->setPosition(Vector2(0, 0)); + sprite3->setPosition(Vec2(0, 0)); sprite2->addChild(sprite3, -1); } @@ -1361,7 +1361,7 @@ DanglingNodePointersTest::DanglingNodePointersTest() { #if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto callback2 = [](DanglingNodePointersTestSprite * sprite2) @@ -1380,18 +1380,18 @@ DanglingNodePointersTest::DanglingNodePointersTest() // Recreate sprite 1 again sprite2 = DanglingNodePointersTestSprite::create(callback2); sprite2->setTexture("Images/MagentaSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); sprite1->addChild(sprite2, -20); }; auto sprite1 = DanglingNodePointersTestSprite::create(callback1); // Sprite 1 will receive touch before sprite 2 sprite1->setTexture("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite1, -10); auto sprite2 = DanglingNodePointersTestSprite::create(callback2); // Sprite 2 will be removed when sprite 1 is touched, should never receive an event. sprite2->setTexture("Images/MagentaSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); sprite1->addChild(sprite2, -20); #endif @@ -1420,7 +1420,7 @@ std::string DanglingNodePointersTest::subtitle() const RegisterAndUnregisterWhileEventHanldingTest::RegisterAndUnregisterWhileEventHanldingTest() { - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); auto callback1 = [=](DanglingNodePointersTestSprite * sprite) @@ -1435,7 +1435,7 @@ RegisterAndUnregisterWhileEventHanldingTest::RegisterAndUnregisterWhileEventHanl auto sprite2 = DanglingNodePointersTestSprite::create(callback2); sprite2->setTexture("Images/CyanSquare.png"); - sprite2->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite2->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite2, 0); removeChild(sprite2); @@ -1444,7 +1444,7 @@ RegisterAndUnregisterWhileEventHanldingTest::RegisterAndUnregisterWhileEventHanl auto sprite1 = DanglingNodePointersTestSprite::create(callback1); sprite1->setTexture("Images/CyanSquare.png"); - sprite1->setPosition(origin+Vector2(size.width/2, size.height/2)); + sprite1->setPosition(origin+Vec2(size.width/2, size.height/2)); addChild(sprite1, -10); } diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h index 58a78898ab..8118f2619e 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h @@ -161,8 +161,8 @@ public: virtual std::string subtitle() const override; protected: - bool isPointInNode(Vector2 pt, Node* node); - bool isPointInTopHalfAreaOfScreen(Vector2 pt); + bool isPointInNode(Vec2 pt, Node* node); + bool isPointInTopHalfAreaOfScreen(Vec2 pt); }; class PauseResumeTargetTest : public EventDispatcherTestDemo diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index 6149b386f6..eda32322af 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -230,7 +230,7 @@ protected: public: static SpriteInGroupCommand* create(const std::string& filename); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; }; SpriteInGroupCommand* SpriteInGroupCommand::create(const std::string &filename) @@ -241,7 +241,7 @@ SpriteInGroupCommand* SpriteInGroupCommand::create(const std::string &filename) return sprite; } -void SpriteInGroupCommand::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void SpriteInGroupCommand::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { CCASSERT(renderer, "Render is null"); _spriteWrapperCommand.init(_globalZOrder); @@ -309,7 +309,7 @@ void NewSpriteBatchTest::onTouchesEnded(const std::vector &touches, Eve } } -void NewSpriteBatchTest::addNewSpriteWithCoords(Vector2 p) +void NewSpriteBatchTest::addNewSpriteWithCoords(Vec2 p) { auto BatchNode = static_cast( getChildByTag(kTagSpriteBatchNode) ); @@ -321,7 +321,7 @@ void NewSpriteBatchTest::addNewSpriteWithCoords(Vector2 p) auto sprite = Sprite::createWithTexture(BatchNode->getTexture(), Rect(x,y,85,121)); BatchNode->addChild(sprite); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -350,19 +350,19 @@ NewClippingNodeTest::NewClippingNodeTest() auto clipper = ClippingNode::create(); clipper->setTag( kTagClipperNode ); clipper->setContentSize( Size(200, 200) ); - clipper->setAnchorPoint( Vector2(0.5, 0.5) ); - clipper->setPosition( Vector2(s.width / 2, s.height / 2) ); + clipper->setAnchorPoint( Vec2(0.5, 0.5) ); + clipper->setPosition( Vec2(s.width / 2, s.height / 2) ); clipper->runAction(RepeatForever::create(RotateBy::create(1, 45))); this->addChild(clipper); //TODO Fix draw node as clip node // auto stencil = NewDrawNode::create(); -// Vector2 rectangle[4]; -// rectangle[0] = Vector2(0, 0); -// rectangle[1] = Vector2(clipper->getContentSize().width, 0); -// rectangle[2] = Vector2(clipper->getContentSize().width, clipper->getContentSize().height); -// rectangle[3] = Vector2(0, clipper->getContentSize().height); +// Vec2 rectangle[4]; +// rectangle[0] = Vec2(0, 0); +// rectangle[1] = Vec2(clipper->getContentSize().width, 0); +// rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height); +// rectangle[3] = Vec2(0, clipper->getContentSize().height); // // Color4F white(1, 1, 1, 1); // stencil->drawPolygon(rectangle, 4, white, 1, white); @@ -376,8 +376,8 @@ NewClippingNodeTest::NewClippingNodeTest() auto content = Sprite::create("Images/background2.png"); content->setTag( kTagContentNode ); - content->setAnchorPoint( Vector2(0.5, 0.5) ); - content->setPosition( Vector2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); + content->setAnchorPoint( Vec2(0.5, 0.5) ); + content->setPosition( Vec2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) ); clipper->addChild(content); _scrolling = false; @@ -408,7 +408,7 @@ void NewClippingNodeTest::onTouchesBegan(const std::vector &touches, Ev { Touch *touch = touches[0]; auto clipper = this->getChildByTag(kTagClipperNode); - Vector2 point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); + Vec2 point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); auto rect = Rect(0, 0, clipper->getContentSize().width, clipper->getContentSize().height); _scrolling = rect.containsPoint(point); _lastPoint = point; @@ -420,7 +420,7 @@ void NewClippingNodeTest::onTouchesMoved(const std::vector &touches, Ev Touch *touch = touches[0]; auto clipper = this->getChildByTag(kTagClipperNode); auto point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView())); - Vector2 diff = point - _lastPoint; + Vec2 diff = point - _lastPoint; auto content = clipper->getChildByTag(kTagContentNode); content->setPosition(content->getPosition() + diff); _lastPoint = point; @@ -444,11 +444,11 @@ NewDrawNodeTest::NewDrawNodeTest() addChild(parent); auto rectNode = DrawNode::create(); - Vector2 rectangle[4]; - rectangle[0] = Vector2(-50, -50); - rectangle[1] = Vector2(50, -50); - rectangle[2] = Vector2(50, 50); - rectangle[3] = Vector2(-50, 50); + Vec2 rectangle[4]; + rectangle[0] = Vec2(-50, -50); + rectangle[1] = Vec2(50, -50); + rectangle[2] = Vec2(50, 50); + rectangle[3] = Vec2(-50, 50); Color4F white(1, 1, 1, 1); rectNode->drawPolygon(rectangle, 4, white, 1, white); @@ -475,13 +475,13 @@ NewCullingTest::NewCullingTest() Size size = Director::getInstance()->getWinSize(); auto sprite = Sprite::create("Images/btn-about-normal-vertical.png"); sprite->setRotation(5); - sprite->setPosition(Vector2(size.width/2,size.height/3)); + sprite->setPosition(Vec2(size.width/2,size.height/3)); sprite->setScale(2); addChild(sprite); auto sprite2 = Sprite::create("Images/btn-about-normal-vertical.png"); sprite2->setRotation(-85); - sprite2->setPosition(Vector2(size.width/2,size.height * 2/3)); + sprite2->setPosition(Vec2(size.width/2,size.height * 2/3)); sprite2->setScale(2); addChild(sprite2); @@ -540,7 +540,7 @@ VBOFullTest::VBOFullTest() for (int i=0; isetPosition(Vector2(0,0)); + sprite->setPosition(Vec2(0,0)); parent->addChild(sprite); } } diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h index 5d657b4a70..428440feaf 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.h @@ -78,7 +78,7 @@ public: virtual std::string subtitle() const override; void onTouchesEnded(const std::vector& touches, Event* event); - void addNewSpriteWithCoords(Vector2 p); + void addNewSpriteWithCoords(Vec2 p); protected: NewSpriteBatchTest(); @@ -102,7 +102,7 @@ protected: virtual ~NewClippingNodeTest(); bool _scrolling; - Vector2 _lastPoint; + Vec2 _lastPoint; }; class NewDrawNodeTest : public MultiSceneTest @@ -131,7 +131,7 @@ protected: virtual ~NewCullingTest(); bool onTouchBegan(Touch* touch, Event *event); void onTouchMoved(Touch* touch, Event *event); - Vector2 _lastPos; + Vec2 _lastPos; }; class VBOFullTest : public MultiSceneTest diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 0f082167c7..868f9a6c57 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -165,8 +165,8 @@ void Test2::onEnter() auto sp3 = Sprite::create(s_pathSister1); auto sp4 = Sprite::create(s_pathSister2); - sp1->setPosition(Vector2(100, s.height /2 )); - sp2->setPosition(Vector2(380, s.height /2 )); + sp1->setPosition(Vec2(100, s.height /2 )); + sp2->setPosition(Vec2(380, s.height /2 )); addChild(sp1); addChild(sp2); @@ -187,7 +187,7 @@ void Test2::onEnter() NULL) ); - sp2->setAnchorPoint(Vector2(0,0)); + sp2->setAnchorPoint(Vec2(0,0)); sp1->runAction(action1); sp2->runAction(action2); @@ -212,8 +212,8 @@ Test4::Test4() auto sp1 = Sprite::create(s_pathSister1); auto sp2 = Sprite::create(s_pathSister2); - sp1->setPosition( Vector2(100,160) ); - sp2->setPosition( Vector2(380,160) ); + sp1->setPosition( Vec2(100,160) ); + sp2->setPosition( Vec2(380,160) ); addChild(sp1, 0, 2); addChild(sp2, 0, 3); @@ -251,8 +251,8 @@ Test5::Test5() auto sp1 = Sprite::create(s_pathSister1); auto sp2 = Sprite::create(s_pathSister2); - sp1->setPosition(Vector2(100,160)); - sp2->setPosition(Vector2(380,160)); + sp1->setPosition(Vec2(100,160)); + sp2->setPosition(Vec2(380,160)); auto rot = RotateBy::create(2, 360); auto rot_back = rot->reverse(); @@ -306,8 +306,8 @@ Test6::Test6() auto sp2 = Sprite::create(s_pathSister2); auto sp21 = Sprite::create(s_pathSister2); - sp1->setPosition(Vector2(100,160)); - sp2->setPosition(Vector2(380,160)); + sp1->setPosition(Vec2(100,160)); + sp2->setPosition(Vec2(380,160)); auto rot = RotateBy::create(2, 360); auto rot_back = rot->reverse(); @@ -367,7 +367,7 @@ StressTest1::StressTest1() auto sp1 = Sprite::create(s_pathSister1); addChild(sp1, 0, kTagSprite1); - sp1->setPosition( Vector2(s.width/2, s.height/2) ); + sp1->setPosition( Vec2(s.width/2, s.height/2) ); schedule( schedule_selector(StressTest1::shouldNotCrash), 1.0f); } @@ -385,7 +385,7 @@ void StressTest1::shouldNotCrash(float dt) // if it doesn't, it works Ok. // auto explosion = [Sprite create:@"grossinis_sister2.png"); - explosion->setPosition( Vector2(s.width/2, s.height/2) ); + explosion->setPosition( Vec2(s.width/2, s.height/2) ); runAction( Sequence::create( RotateBy::create(2, 360), @@ -420,9 +420,9 @@ StressTest2::StressTest2() auto sublayer = Layer::create(); auto sp1 = Sprite::create(s_pathSister1); - sp1->setPosition( Vector2(80, s.height/2) ); + sp1->setPosition( Vec2(80, s.height/2) ); - auto move = MoveBy::create(3, Vector2(350,0)); + auto move = MoveBy::create(3, Vec2(350,0)); auto move_ease_inout3 = EaseInOut::create(move->clone(), 2.0f); auto move_ease_inout_back3 = move_ease_inout3->reverse(); auto seq3 = Sequence::create( move_ease_inout3, move_ease_inout_back3, NULL); @@ -431,7 +431,7 @@ StressTest2::StressTest2() auto fire = ParticleFire::create(); fire->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); - fire->setPosition( Vector2(80, s.height/2-50) ); + fire->setPosition( Vec2(80, s.height/2-50) ); auto copy_seq3 = seq3->clone(); @@ -500,20 +500,20 @@ NodeToWorld::NodeToWorld() auto back = Sprite::create(s_back3); addChild( back, -10); - back->setAnchorPoint( Vector2(0,0) ); + back->setAnchorPoint( Vec2(0,0) ); auto backSize = back->getContentSize(); auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); auto menu = Menu::create(item, NULL); menu->alignItemsVertically(); - menu->setPosition( Vector2(backSize.width/2, backSize.height/2)); + menu->setPosition( Vec2(backSize.width/2, backSize.height/2)); back->addChild(menu); auto rot = RotateBy::create(5, 360); auto fe = RepeatForever::create( rot); item->runAction( fe ); - auto move = MoveBy::create(3, Vector2(200,0)); + auto move = MoveBy::create(3, Vec2(200,0)); auto move_back = move->reverse(); auto seq = Sequence::create( move, move_back, NULL); auto fe2 = RepeatForever::create(seq); @@ -540,26 +540,26 @@ NodeToWorld3D::NodeToWorld3D() Size s = Director::getInstance()->getWinSize(); auto parent = Node::create(); parent->setContentSize(s); - parent->setAnchorPoint(Vector2(0.5, 0.5)); + parent->setAnchorPoint(Vec2(0.5, 0.5)); parent->setPosition(s.width/2, s.height/2); this->addChild(parent); auto back = Sprite::create(s_back3); parent->addChild( back, -10); - back->setAnchorPoint( Vector2(0,0) ); + back->setAnchorPoint( Vec2(0,0) ); auto backSize = back->getContentSize(); auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); auto menu = Menu::create(item, NULL); menu->alignItemsVertically(); - menu->setPosition( Vector2(backSize.width/2, backSize.height/2)); + menu->setPosition( Vec2(backSize.width/2, backSize.height/2)); back->addChild(menu); auto rot = RotateBy::create(5, 360); auto fe = RepeatForever::create( rot); item->runAction( fe ); - auto move = MoveBy::create(3, Vector2(200,0)); + auto move = MoveBy::create(3, Vec2(200,0)); auto move_back = move->reverse(); auto seq = Sequence::create( move, move_back, NULL); auto fe2 = RepeatForever::create(seq); @@ -601,7 +601,7 @@ CameraOrbitTest::CameraOrbitTest() auto p = Sprite::create(s_back3); addChild( p, 0); - p->setPosition( Vector2(s.width/2, s.height/2) ); + p->setPosition( Vec2(s.width/2, s.height/2) ); p->setOpacity( 128 ); Sprite* sprite; @@ -613,7 +613,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = Sprite::create(s_pathGrossini); sprite->setScale(0.5f); p->addChild(sprite, 0); - sprite->setPosition( Vector2(s.width/4*1, s.height/2) ); + sprite->setPosition( Vec2(s.width/4*1, s.height/2) ); orbit = OrbitCamera::create(2, 1, 0, 0, 360, 0, 0); sprite->runAction( RepeatForever::create( orbit ) ); @@ -621,7 +621,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = Sprite::create(s_pathGrossini); sprite->setScale( 1.0f ); p->addChild(sprite, 0); - sprite->setPosition( Vector2(s.width/4*2, s.height/2) ); + sprite->setPosition( Vec2(s.width/4*2, s.height/2) ); orbit = OrbitCamera::create(2, 1, 0, 0, 360, 45, 0); sprite->runAction( RepeatForever::create( orbit ) ); @@ -630,7 +630,7 @@ CameraOrbitTest::CameraOrbitTest() sprite = Sprite::create(s_pathGrossini); sprite->setScale( 2.0f ); p->addChild(sprite, 0); - sprite->setPosition( Vector2(s.width/4*3, s.height/2) ); + sprite->setPosition( Vec2(s.width/4*3, s.height/2) ); ss = sprite->getContentSize(); orbit = OrbitCamera::create(2, 1, 0, 0, 360, 90, -45), sprite->runAction( RepeatForever::create(orbit) ); @@ -677,7 +677,7 @@ CameraZoomTest::CameraZoomTest() // LEFT sprite = Sprite::create(s_pathGrossini); addChild( sprite, 0); - sprite->setPosition( Vector2(s.width/4*1, s.height/2) ); + sprite->setPosition( Vec2(s.width/4*1, s.height/2) ); // cam = sprite->getCamera(); // cam->setEye(0, 0, 415/2); // cam->setCenter(0, 0, 0); @@ -685,12 +685,12 @@ CameraZoomTest::CameraZoomTest() // CENTER sprite = Sprite::create(s_pathGrossini); addChild( sprite, 0, 40); - sprite->setPosition(Vector2(s.width/4*2, s.height/2)); + sprite->setPosition(Vec2(s.width/4*2, s.height/2)); // RIGHT sprite = Sprite::create(s_pathGrossini); addChild( sprite, 0, 20); - sprite->setPosition(Vector2(s.width/4*3, s.height/2)); + sprite->setPosition(Vec2(s.width/4*3, s.height/2)); _z = 0; scheduleUpdate(); @@ -745,19 +745,19 @@ CameraCenterTest::CameraCenterTest() // LEFT-TOP sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0); - sprite->setPosition(Vector2(s.width/5*1, s.height/5*1)); + sprite->setPosition(Vec2(s.width/5*1, s.height/5*1)); sprite->setColor(Color3B::RED); sprite->setTextureRect(Rect(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); sprite->runAction(RepeatForever::create( orbit )); -// [sprite setAnchorPoint: Vector2(0,1)); +// [sprite setAnchorPoint: Vec2(0,1)); // LEFT-BOTTOM sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(Vector2(s.width/5*1, s.height/5*4)); + sprite->setPosition(Vec2(s.width/5*1, s.height/5*4)); sprite->setColor(Color3B::BLUE); sprite->setTextureRect(Rect(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -767,7 +767,7 @@ CameraCenterTest::CameraCenterTest() // RIGHT-TOP sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0); - sprite->setPosition(Vector2(s.width/5*4, s.height/5*1)); + sprite->setPosition(Vec2(s.width/5*4, s.height/5*1)); sprite->setColor(Color3B::YELLOW); sprite->setTextureRect(Rect(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -777,7 +777,7 @@ CameraCenterTest::CameraCenterTest() // RIGHT-BOTTOM sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(Vector2(s.width/5*4, s.height/5*4)); + sprite->setPosition(Vec2(s.width/5*4, s.height/5*4)); sprite->setColor(Color3B::GREEN); sprite->setTextureRect(Rect(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -786,7 +786,7 @@ CameraCenterTest::CameraCenterTest() // CENTER sprite = Sprite::create("Images/white-512x512.png"); addChild( sprite, 0, 40); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); sprite->setColor(Color3B::WHITE); sprite->setTextureRect(Rect(0, 0, 120, 50)); orbit = OrbitCamera::create(10, 1, 0, 0, 360, 0, 0); @@ -821,7 +821,7 @@ ConvertToNode::ConvertToNode() for(int i = 0; i < 3; i++) { auto sprite = Sprite::create("Images/grossini.png"); - sprite->setPosition(Vector2( s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2( s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -831,13 +831,13 @@ ConvertToNode::ConvertToNode() switch(i) { case 0: - sprite->setAnchorPoint(Vector2::ZERO); + sprite->setAnchorPoint(Vec2::ZERO); break; case 1: - sprite->setAnchorPoint(Vector2(0.5f, 0.5f)); + sprite->setAnchorPoint(Vec2(0.5f, 0.5f)); break; case 2: - sprite->setAnchorPoint(Vector2(1,1)); + sprite->setAnchorPoint(Vec2(1,1)); break; } @@ -857,7 +857,7 @@ void ConvertToNode::onTouchesEnded(const std::vector& touches, Event *ev for( int i = 0; i < 3; i++) { auto node = getChildByTag(100+i); - Vector2 p1, p2; + Vec2 p1, p2; p1 = node->convertToNodeSpaceAR(location); p2 = node->convertToNodeSpace(location); @@ -887,7 +887,7 @@ NodeOpaqueTest::NodeOpaqueTest() { background = Sprite::create("Images/background1.png"); background->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED ); - background->setAnchorPoint(Vector2::ZERO); + background->setAnchorPoint(Vec2::ZERO); addChild(background); } } @@ -912,7 +912,7 @@ NodeNonOpaqueTest::NodeNonOpaqueTest() { background = Sprite::create("Images/background1.jpg"); background->setBlendFunc(BlendFunc::DISABLE); - background->setAnchorPoint(Vector2::ZERO); + background->setAnchorPoint(Vec2::ZERO); addChild(background); } } @@ -993,22 +993,22 @@ public: sprite->setGLProgramState(shaderState); return sprite; } - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; - void onDraw(const Matrix &transform, bool transformUpdated); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; + void onDraw(const Mat4 &transform, bool transformUpdated); protected: CustomCommand _customCommand; }; -void MySprite::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void MySprite::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(MySprite::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void MySprite::onDraw(const Matrix &transform, bool transformUpdated) +void MySprite::onDraw(const Mat4 &transform, bool transformUpdated) { getGLProgram()->use(); getGLProgram()->setUniformsForBuiltins(transform); @@ -1065,12 +1065,12 @@ CameraTest1::CameraTest1() _sprite1 = MySprite::create(s_back3); addChild( _sprite1 ); - _sprite1->setPosition( Vector2(1*s.width/4, s.height/2) ); + _sprite1->setPosition( Vec2(1*s.width/4, s.height/2) ); _sprite1->setScale(0.5); _sprite2 = Sprite::create(s_back3); addChild( _sprite2 ); - _sprite2->setPosition( Vector2(3*s.width/4, s.height/2) ); + _sprite2->setPosition( Vec2(3*s.width/4, s.height/2) ); _sprite2->setScale(0.5); auto camera = OrbitCamera::create(10, 0, 1, 0, 360, 0, 0); @@ -1113,20 +1113,20 @@ CameraTest2::CameraTest2() _sprite1 = MySprite::create(s_back3); addChild( _sprite1 ); - _sprite1->setPosition( Vector2(1*s.width/4, s.height/2) ); + _sprite1->setPosition( Vec2(1*s.width/4, s.height/2) ); _sprite1->setScale(0.5); _sprite2 = Sprite::create(s_back3); addChild( _sprite2 ); - _sprite2->setPosition( Vector2(3*s.width/4, s.height/2) ); + _sprite2->setPosition( Vec2(3*s.width/4, s.height/2) ); _sprite2->setScale(0.5); - Vector3 eye(150, 0, 200), center(0, 0, 0), up(0, 1, 0); + Vec3 eye(150, 0, 200), center(0, 0, 0), up(0, 1, 0); - Matrix lookupMatrix; - Matrix::createLookAt(eye, center, up, &lookupMatrix); + Mat4 lookupMatrix; + Mat4::createLookAt(eye, center, up, &lookupMatrix); - Matrix lookupMatrix2 = lookupMatrix; + Mat4 lookupMatrix2 = lookupMatrix; _sprite1->setAdditionalTransform(&lookupMatrix2); _sprite2->setAdditionalTransform(&lookupMatrix2); diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp index 088edc92a1..2e650c23d2 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp @@ -24,7 +24,7 @@ Parallax1::Parallax1() // scale the image (optional) cocosImage->setScale( 2.5f ); // change the transform anchor point to 0,0 (optional) - cocosImage->setAnchorPoint( Vector2(0,0) ); + cocosImage->setAnchorPoint( Vec2(0,0) ); // Middle layer: a Tile map atlas @@ -32,7 +32,7 @@ Parallax1::Parallax1() tilemap->releaseMap(); // change the transform anchor to 0,0 (optional) - tilemap->setAnchorPoint( Vector2(0, 0) ); + tilemap->setAnchorPoint( Vec2(0, 0) ); // Anti Aliased images tilemap->getTexture()->setAntiAliasTexParameters(); @@ -43,7 +43,7 @@ Parallax1::Parallax1() // scale the image (optional) background->setScale( 1.5f ); // change the transform anchor point (optional) - background->setAnchorPoint( Vector2(0,0) ); + background->setAnchorPoint( Vec2(0,0) ); // create a void node, a parent node @@ -52,21 +52,21 @@ Parallax1::Parallax1() // NOW add the 3 layers to the 'void' node // background image is moved at a ratio of 0.4x, 0.5y - voidNode->addChild(background, -1, Vector2(0.4f,0.5f), Vector2::ZERO); + voidNode->addChild(background, -1, Vec2(0.4f,0.5f), Vec2::ZERO); // tiles are moved at a ratio of 2.2x, 1.0y - voidNode->addChild(tilemap, 1, Vector2(2.2f,1.0f), Vector2(0,-200) ); + voidNode->addChild(tilemap, 1, Vec2(2.2f,1.0f), Vec2(0,-200) ); // top image is moved at a ratio of 3.0x, 2.5y - voidNode->addChild(cocosImage, 2, Vector2(3.0f,2.5f), Vector2(200,800) ); + voidNode->addChild(cocosImage, 2, Vec2(3.0f,2.5f), Vec2(200,800) ); // now create some actions that will move the 'void' node // and the children of the 'void' node will move at different // speed, thus, simulation the 3D environment - auto goUp = MoveBy::create(4, Vector2(0,-500) ); + auto goUp = MoveBy::create(4, Vec2(0,-500) ); auto goDown = goUp->reverse(); - auto go = MoveBy::create(8, Vector2(-1000,0) ); + auto go = MoveBy::create(8, Vec2(-1000,0) ); auto goBack = go->reverse(); auto seq = Sequence::create(goUp, go, goDown, goBack, NULL); voidNode->runAction( (RepeatForever::create(seq) )); @@ -96,7 +96,7 @@ Parallax2::Parallax2() // scale the image (optional) cocosImage->setScale( 2.5f ); // change the transform anchor point to 0,0 (optional) - cocosImage->setAnchorPoint( Vector2(0,0) ); + cocosImage->setAnchorPoint( Vec2(0,0) ); // Middle layer: a Tile map atlas @@ -104,7 +104,7 @@ Parallax2::Parallax2() tilemap->releaseMap(); // change the transform anchor to 0,0 (optional) - tilemap->setAnchorPoint( Vector2(0, 0) ); + tilemap->setAnchorPoint( Vec2(0, 0) ); // Anti Aliased images tilemap->getTexture()->setAntiAliasTexParameters(); @@ -115,7 +115,7 @@ Parallax2::Parallax2() // scale the image (optional) background->setScale( 1.5f ); // change the transform anchor point (optional) - background->setAnchorPoint( Vector2(0,0) ); + background->setAnchorPoint( Vec2(0,0) ); // create a void node, a parent node @@ -124,13 +124,13 @@ Parallax2::Parallax2() // NOW add the 3 layers to the 'void' node // background image is moved at a ratio of 0.4x, 0.5y - voidNode->addChild(background, -1, Vector2(0.4f,0.5f), Vector2::ZERO); + voidNode->addChild(background, -1, Vec2(0.4f,0.5f), Vec2::ZERO); // tiles are moved at a ratio of 1.0, 1.0y - voidNode->addChild(tilemap, 1, Vector2(1.0f,1.0f), Vector2(0,-200) ); + voidNode->addChild(tilemap, 1, Vec2(1.0f,1.0f), Vec2(0,-200) ); // top image is moved at a ratio of 3.0x, 2.5y - voidNode->addChild( cocosImage, 2, Vector2(3.0f,2.5f), Vector2(200,1000) ); + voidNode->addChild( cocosImage, 2, Vec2(3.0f,2.5f), Vec2(200,1000) ); addChild(voidNode, 0, kTagNode); } @@ -161,7 +161,7 @@ Issue2572::Issue2572() { _addChildStep = 1.0f; _wholeMoveTime = 3.0f; - _wholeMoveSize = Vector2(-300, 0); + _wholeMoveSize = Vec2(-300, 0); // create a parallax node, a parent node _paraNode = ParallaxNode::create(); @@ -186,8 +186,8 @@ void Issue2572::update(float dt) auto child = Sprite::create("Images/Icon.png"); Size viewSize = Director::getInstance()->getVisibleSize(); - Vector2 offset = Vector2(viewSize.width / 2, viewSize.height/2); - _paraNode->addChild(child, 1, Vector2( 1, 0 ), offset ); + Vec2 offset = Vec2(viewSize.width / 2, viewSize.height/2); + _paraNode->addChild(child, 1, Vec2( 1, 0 ), offset ); _childList.pushBack(child); } diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h index 15f343cc5a..e7fcd82934 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.h @@ -60,7 +60,7 @@ protected: float _addChildStep; float _wholeMoveTime; - Vector2 _wholeMoveSize; + Vec2 _wholeMoveSize; virtual void update(float dt) override; diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index 570c7fa72b..d96cecd29b 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -48,7 +48,7 @@ void DemoFire::onEnter() _emitter->setTexture( Director::getInstance()->getTextureCache()->addImage(s_fire) );//.pvr"); auto p = _emitter->getPosition(); - _emitter->setPosition( Vector2(p.x, 100) ); + _emitter->setPosition( Vec2(p.x, 100) ); setEmitterPosition(); } @@ -145,7 +145,7 @@ void DemoBigFlower::onEnter() _emitter->setDuration(-1); // gravity - _emitter->setGravity(Vector2::ZERO); + _emitter->setGravity(Vec2::ZERO); // angle _emitter->setAngle(90); @@ -164,8 +164,8 @@ void DemoBigFlower::onEnter() _emitter->setTangentialAccelVar(0); // emitter position - _emitter->setPosition( Vector2(160,240) ); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition( Vec2(160,240) ); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(4); @@ -229,7 +229,7 @@ void DemoRotFlower::onEnter() _emitter->setDuration(-1); // gravity - _emitter->setGravity(Vector2::ZERO); + _emitter->setGravity(Vec2::ZERO); // angle _emitter->setAngle(90); @@ -248,8 +248,8 @@ void DemoRotFlower::onEnter() _emitter->setTangentialAccelVar(0); // emitter position - _emitter->setPosition( Vector2(160,240) ); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition( Vec2(160,240) ); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(3); @@ -379,7 +379,7 @@ void DemoSmoke::onEnter() _emitter->setTexture( Director::getInstance()->getTextureCache()->addImage(s_fire) ); auto p = _emitter->getPosition(); - _emitter->setPosition( Vector2( p.x, 100) ); + _emitter->setPosition( Vec2( p.x, 100) ); setEmitterPosition(); } @@ -403,12 +403,12 @@ void DemoSnow::onEnter() _background->addChild(_emitter, 10); auto p = _emitter->getPosition(); - _emitter->setPosition( Vector2( p.x, p.y-110) ); + _emitter->setPosition( Vec2( p.x, p.y-110) ); _emitter->setLife(3); _emitter->setLifeVar(1); // gravity - _emitter->setGravity(Vector2(0,-10)); + _emitter->setGravity(Vec2(0,-10)); // speed of particles _emitter->setSpeed(130); @@ -451,7 +451,7 @@ void DemoRain::onEnter() _background->addChild(_emitter, 10); auto p = _emitter->getPosition(); - _emitter->setPosition( Vector2( p.x, p.y-100) ); + _emitter->setPosition( Vec2( p.x, p.y-100) ); _emitter->setLife(4); _emitter->setTexture( Director::getInstance()->getTextureCache()->addImage(s_fire) ); @@ -487,7 +487,7 @@ void DemoModernArt::onEnter() _emitter->setDuration(-1); // gravity - _emitter->setGravity(Vector2(0,0)); + _emitter->setGravity(Vec2(0,0)); // angle _emitter->setAngle(0); @@ -506,8 +506,8 @@ void DemoModernArt::onEnter() _emitter->setSpeedVar(10); // emitter position - _emitter->setPosition( Vector2( s.width/2, s.height/2) ); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition( Vec2( s.width/2, s.height/2) ); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(2.0f); @@ -596,21 +596,21 @@ void ParallaxParticle::onEnter() auto p1 = Sprite::create(s_back3); auto p2 = Sprite::create(s_back3); - p->addChild( p1, 1, Vector2(0.5f,1), Vector2(0,250) ); - p->addChild(p2, 2, Vector2(1.5f,1), Vector2(0,50) ); + p->addChild( p1, 1, Vec2(0.5f,1), Vec2(0,250) ); + p->addChild(p2, 2, Vec2(1.5f,1), Vec2(0,50) ); _emitter = ParticleFlower::create(); _emitter->retain(); _emitter->setTexture( Director::getInstance()->getTextureCache()->addImage(s_fire) ); p1->addChild(_emitter, 10); - _emitter->setPosition( Vector2(250,200) ); + _emitter->setPosition( Vec2(250,200) ); auto par = ParticleSun::create(); p2->addChild(par, 10); par->setTexture( Director::getInstance()->getTextureCache()->addImage(s_fire) ); - auto move = MoveBy::create(4, Vector2(300,0)); + auto move = MoveBy::create(4, Vec2(300,0)); auto move_back = move->reverse(); auto seq = Sequence::create( move, move_back, NULL); p->runAction(RepeatForever::create(seq)); @@ -662,8 +662,8 @@ void RadiusMode1::onEnter() // emitter position auto size = Director::getInstance()->getWinSize(); - _emitter->setPosition(Vector2(size.width/2, size.height/2)); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition(Vec2(size.width/2, size.height/2)); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(5); @@ -746,8 +746,8 @@ void RadiusMode2::onEnter() // emitter position auto size = Director::getInstance()->getWinSize(); - _emitter->setPosition(Vector2(size.width/2, size.height/2)); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition(Vec2(size.width/2, size.height/2)); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(4); @@ -830,8 +830,8 @@ void Issue704::onEnter() // emitter position auto size = Director::getInstance()->getWinSize(); - _emitter->setPosition(Vector2(size.width/2, size.height/2)); - _emitter->setPosVar(Vector2::ZERO); + _emitter->setPosition(Vec2(size.width/2, size.height/2)); + _emitter->setPosVar(Vec2::ZERO); // life of particles _emitter->setLife(5); @@ -1083,22 +1083,22 @@ void ParticleDemo::onEnter(void) auto menu = Menu::create(item4, NULL); - menu->setPosition( Vector2::ZERO ); - item4->setPosition( Vector2( VisibleRect::left().x, VisibleRect::bottom().y+ 100) ); - item4->setAnchorPoint( Vector2(0,0) ); + menu->setPosition( Vec2::ZERO ); + item4->setPosition( Vec2( VisibleRect::left().x, VisibleRect::bottom().y+ 100) ); + item4->setAnchorPoint( Vec2(0,0) ); addChild( menu, 100 ); auto labelAtlas = LabelAtlas::create("0000", "fps_images.png", 12, 32, '.'); addChild(labelAtlas, 100, kTagParticleCount); - labelAtlas->setPosition(Vector2(s.width-66,50)); + labelAtlas->setPosition(Vec2(s.width-66,50)); // moving background _background = Sprite::create(s_back3); addChild(_background, 5); - _background->setPosition( Vector2(s.width/2, s.height-180) ); + _background->setPosition( Vec2(s.width/2, s.height-180) ); - auto move = MoveBy::create(4, Vector2(300,0) ); + auto move = MoveBy::create(4, Vec2(300,0) ); auto move_back = move->reverse(); auto seq = Sequence::create( move, move_back, NULL); _background->runAction( RepeatForever::create(seq) ); @@ -1133,10 +1133,10 @@ void ParticleDemo::onTouchesEnded(const std::vector& touches, Event *ev auto location = touch->getLocation(); - auto pos = Vector2::ZERO; + auto pos = Vec2::ZERO; if (_background) { - pos = _background->convertToWorldSpace(Vector2::ZERO); + pos = _background->convertToWorldSpace(Vec2::ZERO); } if (_emitter != NULL) @@ -1198,7 +1198,7 @@ void ParticleDemo::setEmitterPosition() auto s = Director::getInstance()->getWinSize(); if (_emitter != NULL) { - _emitter->setPosition( Vector2(s.width / 2, s.height / 2) ); + _emitter->setPosition( Vec2(s.width / 2, s.height / 2) ); } } @@ -1269,9 +1269,9 @@ void ParticleBatchMultipleEmitters::onEnter() auto s = Director::getInstance()->getWinSize(); - emitter1->setPosition(Vector2( s.width/1.25f, s.height/1.25f)); - emitter2->setPosition(Vector2( s.width/2, s.height/2)); - emitter3->setPosition(Vector2( s.width/4, s.height/4)); + emitter1->setPosition(Vec2( s.width/1.25f, s.height/1.25f)); + emitter2->setPosition(Vec2( s.width/2, s.height/2)); + emitter3->setPosition(Vec2( s.width/4, s.height/4)); auto batch = ParticleBatchNode::createWithTexture(emitter1->getTexture()); @@ -1326,9 +1326,9 @@ void ParticleReorder::onEnter() int neg = (i==0 ? 1 : -1 ); - emitter1->setPosition(Vector2( s.width/2-30, s.height/2+60*neg)); - emitter2->setPosition(Vector2( s.width/2, s.height/2+60*neg)); - emitter3->setPosition(Vector2( s.width/2+30, s.height/2+60*neg)); + emitter1->setPosition(Vec2( s.width/2-30, s.height/2+60*neg)); + emitter2->setPosition(Vec2( s.width/2, s.height/2+60*neg)); + emitter3->setPosition(Vec2( s.width/2+30, s.height/2+60*neg)); parent->addChild(emitter1, 0, 1); parent->addChild(emitter2, 0, 2); @@ -1406,7 +1406,7 @@ bool RainbowEffect::initWithTotalParticles(int numberOfParticles) setEmitterMode(ParticleSystem::Mode::GRAVITY); // Gravity Mode: gravity - setGravity(Vector2(0,0)); + setGravity(Vec2(0,0)); // Gravity mode: radial acceleration setRadialAccel(0); @@ -1423,8 +1423,8 @@ bool RainbowEffect::initWithTotalParticles(int numberOfParticles) // emitter position auto winSize = Director::getInstance()->getWinSize(); - setPosition(Vector2(winSize.width/2, winSize.height/2)); - setPosVar(Vector2::ZERO); + setPosition(Vec2(winSize.width/2, winSize.height/2)); + setPosVar(Vec2::ZERO); // life of particles setLife(0.5f); @@ -1480,7 +1480,7 @@ void Issue1201::onEnter() auto s = Director::getInstance()->getWinSize(); - particle->setPosition(Vector2(s.width/2, s.height/2)); + particle->setPosition(Vec2(s.width/2, s.height/2)); _emitter = particle; } @@ -1508,7 +1508,7 @@ void MultipleParticleSystems::onEnter() for (int i = 0; i<5; i++) { auto particleSystem = ParticleSystemQuad::create("Particles/SpinningPeas.plist"); - particleSystem->setPosition(Vector2(i*50 ,i*50)); + particleSystem->setPosition(Vec2(i*50 ,i*50)); particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED); addChild(particleSystem); @@ -1566,7 +1566,7 @@ void MultipleParticleSystemsBatched::onEnter() auto particleSystem = ParticleSystemQuad::create("Particles/SpinningPeas.plist"); particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED); - particleSystem->setPosition(Vector2(i*50 ,i*50)); + particleSystem->setPosition(Vec2(i*50 ,i*50)); batchNode->setTexture(particleSystem->getTexture()); batchNode->addChild(particleSystem); @@ -1628,7 +1628,7 @@ void AddAndDeleteParticleSystems::onEnter() particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED); particleSystem->setTotalParticles(200); - particleSystem->setPosition(Vector2(i*15 +100,i*15+100)); + particleSystem->setPosition(Vec2(i*15 +100,i*15+100)); unsigned int randZ = rand() % 100; _batchNode->addChild(particleSystem, randZ, -1); @@ -1655,7 +1655,7 @@ void AddAndDeleteParticleSystems::removeSystem(float dt) particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED); particleSystem->setTotalParticles(200); - particleSystem->setPosition(Vector2(rand() % 300 ,rand() % 400)); + particleSystem->setPosition(Vec2(rand() % 300 ,rand() % 400)); CCLOG("add a new system"); unsigned int randZ = rand() % 100; @@ -1737,7 +1737,7 @@ void ReorderParticleSystems::onEnter() particleSystem->setAngleVar(0); // emitter position - particleSystem->setPosVar(Vector2::ZERO); + particleSystem->setPosVar(Vec2::ZERO); // life of particles particleSystem->setLife(4); @@ -1774,7 +1774,7 @@ void ReorderParticleSystems::onEnter() // additive - particleSystem->setPosition(Vector2(i*10+120 ,200)); + particleSystem->setPosition(Vec2(i*10+120 ,200)); _batchNode->addChild(particleSystem); @@ -1989,7 +1989,7 @@ void ParticleAutoBatching::onEnter() for(int i=0; i<10; i++) { auto particle = ParticleSystemQuad::create("Particles/SmallSun.plist"); particle->setTotalParticles(100); - particle->setPosition(Vector2(i*s.width/11, s.height/2)); + particle->setPosition(Vec2(i*s.width/11, s.height/2)); this->addChild(particle ,10); } } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp index 5568b796b0..b7ba926f88 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -96,7 +96,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -104,7 +104,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } lastRenderedCount = 0; @@ -139,12 +139,12 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height/2+15)); + menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height/2-15)); + infoLabel->setPosition(Vec2(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); auto menuLayer = new AllocBasicLayer(true, MAX_LAYER, g_curCase); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceCallbackTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceCallbackTest.cpp index 7c10f87806..82655b256c 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceCallbackTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceCallbackTest.cpp @@ -89,7 +89,7 @@ void PerformanceCallbackScene::onEnter() // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -97,7 +97,7 @@ void PerformanceCallbackScene::onEnter() { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } getScheduler()->schedule(schedule_selector(PerformanceCallbackScene::onUpdate), this, 0.0f, false); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp index c41e1a05a4..b56c156732 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp @@ -98,7 +98,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1, TAG_TITLE); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -106,7 +106,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1, TAG_SUBTITLE); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } lastRenderedCount = 0; @@ -144,12 +144,12 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height/2+15)); + menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height/2-15)); + infoLabel->setPosition(Vec2(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); auto menuLayer = new ContainerBasicLayer(true, MAX_LAYER, g_curCase); @@ -181,7 +181,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) this->updateProfilerName(); }, toggleItems); - toggle->setAnchorPoint(Vector2::ANCHOR_MIDDLE_LEFT); + toggle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); toggle->setPosition(VisibleRect::left()); _toggle = toggle; @@ -200,8 +200,8 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) this->_increase->setEnabled(false); this->_decrease->setEnabled(false); }); - start->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - start->setPosition(VisibleRect::right() + Vector2(0, 40)); + start->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + start->setPosition(VisibleRect::right() + Vec2(0, 40)); _startItem = start; auto stop = MenuItemFont::create("stop", [this](Ref* sender){ @@ -219,12 +219,12 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) }); stop->setEnabled(false); - stop->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - stop->setPosition(VisibleRect::right() + Vector2(0, -40)); + stop->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + stop->setPosition(VisibleRect::right() + Vec2(0, -40)); _stopItem = stop; auto menu2 = Menu::create(toggle, start, stop, NULL); - menu2->setPosition(Vector2::ZERO); + menu2->setPosition(Vec2::ZERO); addChild(menu2); MenuItemFont::setFontSize(oldFontSize); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp index 5274712764..3eb36c686f 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp @@ -96,7 +96,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1, TAG_TITLE); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -104,7 +104,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1, TAG_SUBTITLE); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } _lastRenderedCount = 0; @@ -142,12 +142,12 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height/2+15)); + menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 listeners", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height/2-15)); + infoLabel->setPosition(Vec2(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); auto menuLayer = new EventDispatcherBasicLayer(true, MAX_LAYER, g_curCase); @@ -196,7 +196,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode reset(); }, toggleItems); - toggle->setAnchorPoint(Vector2::ANCHOR_MIDDLE_LEFT); + toggle->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); toggle->setPosition(VisibleRect::left()); _toggle = toggle; @@ -215,8 +215,8 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode this->_increase->setEnabled(false); this->_decrease->setEnabled(false); }); - start->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - start->setPosition(VisibleRect::right() + Vector2(0, 40)); + start->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + start->setPosition(VisibleRect::right() + Vec2(0, 40)); _startItem = start; auto stop = MenuItemFont::create("stop", [=](Ref* sender){ @@ -236,12 +236,12 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode }); stop->setEnabled(false); - stop->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - stop->setPosition(VisibleRect::right() + Vector2(0, -40)); + stop->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + stop->setPosition(VisibleRect::right() + Vec2(0, -40)); _stopItem = stop; auto menu2 = Menu::create(toggle, start, stop, NULL); - menu2->setPosition(Vector2::ZERO); + menu2->setPosition(Vec2::ZERO); addChild(menu2); MenuItemFont::setFontSize(oldFontSize); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp index bd85ecbe25..a384b31d2f 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -99,12 +99,12 @@ void LabelMainScene::initWithSubTest(int nodes) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height-65)); + menu->setPosition(Vec2(s.width/2, s.height-65)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height-90)); + infoLabel->setPosition(Vec2(s.width/2, s.height-90)); addChild(infoLabel, 1, kTagInfoLayer); // add menu @@ -117,7 +117,7 @@ void LabelMainScene::initWithSubTest(int nodes) */ auto menuAutoTest = Menu::create(); - menuAutoTest->setPosition( Vector2::ZERO ); + menuAutoTest->setPosition( Vec2::ZERO ); MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); @@ -131,14 +131,14 @@ void LabelMainScene::initWithSubTest(int nodes) autoTestItem = MenuItemFont::create("Auto Test Off",CC_CALLBACK_1(LabelMainScene::onAutoTest, this)); } autoTestItem->setTag(1); - autoTestItem->setPosition(Vector2( s.width - 90, s.height / 2)); + autoTestItem->setPosition(Vec2( s.width - 90, s.height / 2)); autoTestItem->setColor(Color3B::RED); menuAutoTest->addChild(autoTestItem); addChild( menuAutoTest, 3, kTagAutoTestMenu ); _title = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(_title, 1); - _title->setPosition(Vector2(s.width/2, s.height-50)); + _title->setPosition(Vec2(s.width/2, s.height-50)); while(_quantityNodes < nodes) onIncrease(this); @@ -195,7 +195,7 @@ void LabelMainScene::onIncrease(Ref* sender) for( int i=0;i< kNodesIncrease;i++) { auto label = Label::createWithSystemFont("LabelTTF", "Marker Felt", 30); - label->setPosition(Vector2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); + label->setPosition(Vec2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); _labelContainer->addChild(label, 1, _quantityNodes); _quantityNodes++; @@ -205,7 +205,7 @@ void LabelMainScene::onIncrease(Ref* sender) for( int i=0;i< kNodesIncrease;i++) { auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt","LabelBMFont"); - label->setPosition(Vector2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); + label->setPosition(Vec2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); _labelContainer->addChild(label, 1, _quantityNodes); _quantityNodes++; @@ -217,7 +217,7 @@ void LabelMainScene::onIncrease(Ref* sender) for( int i=0;i< kNodesIncrease;i++) { auto label = Label::createWithTTF(ttfConfig, "Label", TextHAlignment::LEFT); - label->setPosition(Vector2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); + label->setPosition(Vec2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); _labelContainer->addChild(label, 1, _quantityNodes); _quantityNodes++; @@ -228,7 +228,7 @@ void LabelMainScene::onIncrease(Ref* sender) for( int i=0;i< kNodesIncrease;i++) { auto label = Label::createWithBMFont("fonts/bitmapFontTest3.fnt", LongSentencesExample); - label->setPosition(Vector2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); + label->setPosition(Vec2((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); _labelContainer->addChild(label, 1, _quantityNodes); _quantityNodes++; @@ -240,7 +240,7 @@ void LabelMainScene::onIncrease(Ref* sender) for( int i=0;i< kNodesIncrease;i++) { auto label = Label::createWithTTF(ttfConfig, LongSentencesExample, TextHAlignment::CENTER, size.width); - label->setPosition(Vector2((rand() % 50), rand()%((int)size.height/3))); + label->setPosition(Vec2((rand() % 50), rand()%((int)size.height/3))); _labelContainer->addChild(label, 1, _quantityNodes); _quantityNodes++; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index 5785518285..f7835b201c 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -125,7 +125,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -133,7 +133,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } lastRenderedCount = 0; @@ -168,12 +168,12 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height/2+15)); + menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height/2-15)); + infoLabel->setPosition(Vec2(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); auto menuLayer = new NodeChildrenMenuLayer(true, MAX_LAYER, g_curCase); @@ -240,7 +240,7 @@ void IterateSpriteSheet::updateQuantityOfNodes() auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(0, 0, 32, 32)); batchNode->addChild(sprite); sprite->setVisible(false); - sprite->setPosition(Vector2(-1000,-1000)); + sprite->setPosition(Vec2(-1000,-1000)); } } @@ -450,7 +450,7 @@ void AddRemoveSpriteSheet::updateQuantityOfNodes() { auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(0, 0, 32, 32)); batchNode->addChild(sprite); - sprite->setPosition(Vector2( CCRANDOM_0_1()*s.width, CCRANDOM_0_1()*s.height)); + sprite->setPosition(Vec2( CCRANDOM_0_1()*s.width, CCRANDOM_0_1()*s.height)); sprite->setVisible(false); } } @@ -926,7 +926,7 @@ void VisitSceneGraph::updateQuantityOfNodes() auto node = Node::create(); this->addChild(node); node->setVisible(true); - node->setPosition(Vector2(-1000,-1000)); + node->setPosition(Vec2(-1000,-1000)); node->setTag(1000 + currentQuantityOfNodes + i ); } } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp index 7ec1ebfd0f..b001e31f5d 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -100,18 +100,18 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height/2+15)); + menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height - 90)); + infoLabel->setPosition(Vec2(s.width/2, s.height - 90)); addChild(infoLabel, 1, kTagInfoLayer); // particles on stage auto labelAtlas = LabelAtlas::create("0000", "fps_images.png", 12, 32, '.'); addChild(labelAtlas, 0, kTagLabelAtlas); - labelAtlas->setPosition(Vector2(s.width-66,50)); + labelAtlas->setPosition(Vec2(s.width-66,50)); // Next Prev Test auto menuLayer = new ParticleMenuLayer(true, TEST_COUNT, s_nParCurIdx); @@ -139,12 +139,12 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) } } pSubMenu->alignItemsHorizontally(); - pSubMenu->setPosition(Vector2(s.width/2, 80)); + pSubMenu->setPosition(Vec2(s.width/2, 80)); addChild(pSubMenu, 2); auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); updateQuantityLabel(); createParticleSystem(); @@ -173,10 +173,10 @@ void ParticleMainScene::createParticleSystem() /* * Tests: - * 1: Vector2 Particle System using 32-bit textures (PNG) - * 2: Vector2 Particle System using 16-bit textures (PNG) - * 3: Vector2 Particle System using 8-bit textures (PNG) - * 4: Vector2 Particle System using 4-bit textures (PVRTC) + * 1: Vec2 Particle System using 32-bit textures (PNG) + * 2: Vec2 Particle System using 16-bit textures (PNG) + * 3: Vec2 Particle System using 8-bit textures (PNG) + * 4: Vec2 Particle System using 4-bit textures (PVRTC) * 5: Quad Particle System using 32-bit textures (PNG) * 6: Quad Particle System using 16-bit textures (PNG) @@ -289,7 +289,7 @@ void ParticlePerformTest1::doTest() particleSystem->setDuration(-1); // gravity - particleSystem->setGravity(Vector2(0,-90)); + particleSystem->setGravity(Vec2(0,-90)); // angle particleSystem->setAngle(90); @@ -304,8 +304,8 @@ void ParticlePerformTest1::doTest() particleSystem->setSpeedVar(50); // emitter position - particleSystem->setPosition(Vector2(s.width/2, 100)); - particleSystem->setPosVar(Vector2(s.width/2,0)); + particleSystem->setPosition(Vec2(s.width/2, 100)); + particleSystem->setPosVar(Vec2(s.width/2,0)); // life of particles particleSystem->setLife(2.0f); @@ -359,7 +359,7 @@ void ParticlePerformTest2::doTest() particleSystem->setDuration(-1); // gravity - particleSystem->setGravity(Vector2(0,-90)); + particleSystem->setGravity(Vec2(0,-90)); // angle particleSystem->setAngle(90); @@ -374,8 +374,8 @@ void ParticlePerformTest2::doTest() particleSystem->setSpeedVar(50); // emitter position - particleSystem->setPosition(Vector2(s.width/2, 100)); - particleSystem->setPosVar(Vector2(s.width/2,0)); + particleSystem->setPosition(Vec2(s.width/2, 100)); + particleSystem->setPosVar(Vec2(s.width/2,0)); // life of particles particleSystem->setLife(2.0f); @@ -429,7 +429,7 @@ void ParticlePerformTest3::doTest() particleSystem->setDuration(-1); // gravity - particleSystem->setGravity(Vector2(0,-90)); + particleSystem->setGravity(Vec2(0,-90)); // angle particleSystem->setAngle(90); @@ -444,8 +444,8 @@ void ParticlePerformTest3::doTest() particleSystem->setSpeedVar(50); // emitter position - particleSystem->setPosition(Vector2(s.width/2, 100)); - particleSystem->setPosVar(Vector2(s.width/2,0)); + particleSystem->setPosition(Vec2(s.width/2, 100)); + particleSystem->setPosVar(Vec2(s.width/2,0)); // life of particles particleSystem->setLife(2.0f); @@ -499,7 +499,7 @@ void ParticlePerformTest4::doTest() particleSystem->setDuration(-1); // gravity - particleSystem->setGravity(Vector2(0,-90)); + particleSystem->setGravity(Vec2(0,-90)); // angle particleSystem->setAngle(90); @@ -514,8 +514,8 @@ void ParticlePerformTest4::doTest() particleSystem->setSpeedVar(50); // emitter position - particleSystem->setPosition(Vector2(s.width/2, 100)); - particleSystem->setPosVar(Vector2(s.width/2,0)); + particleSystem->setPosition(Vec2(s.width/2, 100)); + particleSystem->setPosVar(Vec2(s.width/2,0)); // life of particles particleSystem->setLife(2.0f); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceRendererTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceRendererTest.cpp index 177a7da236..206e45d265 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceRendererTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceRendererTest.cpp @@ -39,8 +39,8 @@ void RenderTestLayer::onEnter() addChild(map,-1); - //map->setAnchorPoint( Vector2(0, 0) ); - //map->setPosition( Vector2(-20,-200) ); + //map->setAnchorPoint( Vec2(0, 0) ); + //map->setPosition( Vec2(-20,-200) ); } void RenderTestLayer::showCurrentTest() diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp index e9753583a8..0fdeac4065 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp @@ -40,7 +40,7 @@ void ScenarioMenuLayer::onEnter() // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -48,7 +48,7 @@ void ScenarioMenuLayer::onEnter() { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } performTests(); @@ -90,12 +90,12 @@ void ScenarioTest::performTests() // add tile map _map1 = TMXTiledMap::create("TileMaps/iso-test.tmx"); - _map1->setAnchorPoint( Vector2(0.5, 0.5) ); + _map1->setAnchorPoint( Vec2(0.5, 0.5) ); _map1->setPosition(origin); this->addChild(_map1); _map2 = TMXTiledMap::create("TileMaps/iso-test2.tmx"); - _map2->setAnchorPoint( Vector2(0.5, 0.5) ); + _map2->setAnchorPoint( Vec2(0.5, 0.5) ); _map2->setPosition(origin); this->addChild(_map2); @@ -106,8 +106,8 @@ void ScenarioTest::performTests() MenuItemFont::create( "Add/Remove Particle"), MenuItemFont::create( "Add/Remove Particle System"), NULL); - _itemToggle->setAnchorPoint(Vector2(0.0f, 0.5f)); - _itemToggle->setPosition(Vector2(origin.x, origin.y + s.height / 2)); + _itemToggle->setAnchorPoint(Vec2(0.0f, 0.5f)); + _itemToggle->setPosition(Vec2(origin.x, origin.y + s.height / 2)); // add decrease & increase menu item MenuItemFont::setFontSize(65); @@ -127,7 +127,7 @@ void ScenarioTest::performTests() break; } }); - decrease->setPosition(Vector2(origin.x + s.width / 2 - 80, origin.y + 80)); + decrease->setPosition(Vec2(origin.x + s.width / 2 - 80, origin.y + 80)); decrease->setColor(Color3B(0,200,20)); auto increase = MenuItemFont::create(" + ", [&](Ref *sender) { int idx = _itemToggle->getSelectedIndex(); @@ -146,30 +146,30 @@ void ScenarioTest::performTests() } }); increase->setColor(Color3B(0,200,20)); - increase->setPosition(Vector2(origin.x + s.width / 2 + 80, origin.y + 80)); + increase->setPosition(Vec2(origin.x + s.width / 2 + 80, origin.y + 80)); auto menu = Menu::create(_itemToggle, decrease, increase, NULL); - menu->setPosition(Vector2(0.0f, 0.0f)); + menu->setPosition(Vec2(0.0f, 0.0f)); addChild(menu, 10); // add tip labels _spriteLabel = Label::createWithTTF("Sprites : 0", "fonts/arial.ttf", 15); - _spriteLabel->setAnchorPoint(Vector2(0.0f, 0.5f)); + _spriteLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); addChild(_spriteLabel, 10); - _spriteLabel->setPosition(Vector2(origin.x, origin.y + s.height/2 + 70)); + _spriteLabel->setPosition(Vec2(origin.x, origin.y + s.height/2 + 70)); char str[32] = { 0 }; sprintf(str, "Particles : %d", _particleNumber); _particleLabel = Label::createWithTTF(str, "fonts/arial.ttf", 15); - _particleLabel->setAnchorPoint(Vector2(0.0f, 0.5f)); + _particleLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); addChild(_particleLabel, 10); - _particleLabel->setPosition(Vector2(origin.x, origin.y + s.height/2 + 45)); + _particleLabel->setPosition(Vec2(origin.x, origin.y + s.height/2 + 45)); _parsysLabel = Label::createWithTTF("Particle System : 0", "fonts/arial.ttf", 15); - _parsysLabel->setAnchorPoint(Vector2(0.0f, 0.5f)); + _parsysLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); addChild(_parsysLabel, 10); - _parsysLabel->setPosition(Vector2(origin.x, origin.y + s.height/2 + 20)); + _parsysLabel->setPosition(Vec2(origin.x, origin.y + s.height/2 + 20)); // add sprites addNewSprites(_initSpriteNum); @@ -236,7 +236,7 @@ void ScenarioTest::addNewSprites(int num) float randomx = CCRANDOM_0_1(); float randomy = CCRANDOM_0_1(); - sprite->setPosition(origin + Vector2(randomx * s.width, randomy * s.height)); + sprite->setPosition(origin + Vec2(randomx * s.width, randomy * s.height)); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -310,7 +310,7 @@ void ScenarioTest::addParticleSystem(int num) float randomx = CCRANDOM_0_1(); float randomy = CCRANDOM_0_1(); - par->setPosition(origin + Vector2(s.width * randomx, s.height * randomy)); + par->setPosition(origin + Vec2(s.width * randomx, s.height * randomy)); par->setTotalParticles(_particleNumber); addChild(par, 9); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 453edff62e..8625056b41 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -388,12 +388,12 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) auto menu = Menu::create(decrease, increase, NULL); menu->alignItemsHorizontally(); - menu->setPosition(Vector2(s.width/2, s.height-65)); + menu->setPosition(Vec2(s.width/2, s.height-65)); addChild(menu, 1); auto infoLabel = Label::createWithTTF("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); - infoLabel->setPosition(Vector2(s.width/2, s.height-90)); + infoLabel->setPosition(Vec2(s.width/2, s.height-90)); addChild(infoLabel, 1, kTagInfoLayer); // add menu @@ -406,7 +406,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) */ auto menuAutoTest = Menu::create(); - menuAutoTest->setPosition( Vector2::ZERO ); + menuAutoTest->setPosition( Vec2::ZERO ); MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); @@ -420,7 +420,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) autoTestItem = MenuItemFont::create("Auto Test Off",CC_CALLBACK_1(SpriteMainScene::onAutoTest, this)); } autoTestItem->setTag(1); - autoTestItem->setPosition(Vector2( s.width - 90, s.height / 2)); + autoTestItem->setPosition(Vec2( s.width - 90, s.height / 2)); menuAutoTest->addChild(autoTestItem); addChild( menuAutoTest, 3, kTagAutoTestMenu ); @@ -446,13 +446,13 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) } subMenu->alignItemsHorizontally(); - subMenu->setPosition(Vector2(s.width/2, 80)); + subMenu->setPosition(Vec2(s.width/2, 80)); addChild(subMenu, 2); // add title label auto label = Label::createWithTTF(title(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // subtitle @@ -461,7 +461,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) { auto l = Label::createWithTTF(strSubtitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 9999); - l->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - 60) ); + l->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - 60) ); } while(quantityNodes < nNodes) @@ -755,7 +755,7 @@ void SpriteMainScene::onAutoTest(Ref* sender) void performanceActions(Sprite* sprite) { auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); float period = 0.5f + (rand() % 1000) / 500.0f; auto rot = RotateBy::create(period, 360.0f * CCRANDOM_0_1()); @@ -773,9 +773,9 @@ void performanceActions20(Sprite* sprite) { auto size = Director::getInstance()->getWinSize(); if( CCRANDOM_0_1() < 0.2f ) - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); else - sprite->setPosition(Vector2( -1000, -1000)); + sprite->setPosition(Vec2( -1000, -1000)); float period = 0.5f + (rand() % 1000) / 500.0f; auto rot = RotateBy::create(period, 360.0f * CCRANDOM_0_1()); @@ -792,7 +792,7 @@ void performanceActions20(Sprite* sprite) void performanceRotationScale(Sprite* sprite) { auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); sprite->setRotation(CCRANDOM_0_1() * 360); sprite->setScale(CCRANDOM_0_1() * 2); } @@ -800,7 +800,7 @@ void performanceRotationScale(Sprite* sprite) void performancePosition(Sprite* sprite) { auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); } void performanceout20(Sprite* sprite) @@ -808,20 +808,20 @@ void performanceout20(Sprite* sprite) auto size = Director::getInstance()->getWinSize(); if( CCRANDOM_0_1() < 0.2f ) - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); else - sprite->setPosition(Vector2( -1000, -1000)); + sprite->setPosition(Vec2( -1000, -1000)); } void performanceOut100(Sprite* sprite) { - sprite->setPosition(Vector2( -1000, -1000)); + sprite->setPosition(Vec2( -1000, -1000)); } void performanceScale(Sprite* sprite) { auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2((rand() % (int)size.width), (rand() % (int)size.height))); + sprite->setPosition(Vec2((rand() % (int)size.width), (rand() % (int)size.height))); sprite->setScale(CCRANDOM_0_1() * 100 / 50); } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp index 691707cac7..914bd46a87 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp @@ -40,7 +40,7 @@ struct { static const int g_testMax = sizeof(g_testsName)/sizeof(g_testsName[0]); -Vector2 PerformanceMainLayer::_CurrentPos = Vector2::ZERO; +Vec2 PerformanceMainLayer::_CurrentPos = Vec2::ZERO; //////////////////////////////////////////////////////// // @@ -60,7 +60,7 @@ void PerformanceMainLayer::onEnter() for (int i = 0; i < g_testMax; ++i) { auto pItem = MenuItemFont::create(g_testsName[i].name, g_testsName[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -91,17 +91,17 @@ void PerformanceMainLayer::onTouchMoved(Touch* touches, Event *event) float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -116,17 +116,17 @@ void PerformanceMainLayer::onMouseScroll(Event *event) float nMoveY = mouseEvent->getScrollY() * 6; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -154,18 +154,18 @@ void PerformBasicLayer::onEnter() MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(PerformBasicLayer::toMainLayer, this)); - pMainItem->setPosition(Vector2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); + pMainItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); auto menu = Menu::create(pMainItem, NULL); - menu->setPosition( Vector2::ZERO ); + menu->setPosition( Vec2::ZERO ); if (_controlMenuVisible) { auto item1 = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(PerformBasicLayer::backCallback, this)); auto item2 = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(PerformBasicLayer::restartCallback, this)); auto item3 = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(PerformBasicLayer::nextCallback, this)); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); menu->addChild(item1, kItemTagBasic); menu->addChild(item2, kItemTagBasic); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.h b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.h index be79a0a2d6..45fb299acf 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.h +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.h @@ -13,10 +13,10 @@ public: void onMouseScroll(Event *event); protected: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; - static Vector2 _CurrentPos; + static Vec2 _CurrentPos; }; class PerformBasicLayer : public Layer diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp index 6132bf508c..fe02765945 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp @@ -50,7 +50,7 @@ void TextureMenuLayer::onEnter() // Title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); // Subtitle std::string strSubTitle = subtitle(); @@ -58,7 +58,7 @@ void TextureMenuLayer::onEnter() { auto l = Label::createWithTTF(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); - l->setPosition(Vector2(s.width/2, s.height-80)); + l->setPosition(Vec2(s.width/2, s.height-80)); } performTests(); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp index ca4d53e945..cb3f16091b 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp @@ -75,12 +75,12 @@ void TouchesMainScene::onEnter() // add title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); scheduleUpdate(); _plabel = Label::createWithBMFont("fonts/arial16.fnt","00.0"); - _plabel->setPosition(Vector2(s.width/2, s.height/2)); + _plabel->setPosition(Vec2(s.width/2, s.height/2)); addChild(_plabel); elapsedTime = 0; @@ -225,7 +225,7 @@ void TouchesPerformTest3::onEnter() // add title auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); #define TOUCH_PROFILER_NAME "TouchProfileName" #define TOUCHABLE_NODE_NUM 1000 @@ -282,7 +282,7 @@ void TouchesPerformTest3::onEnter() } }); - menuItem->setPosition(Vector2(0, -20)); + menuItem->setPosition(Vec2(0, -20)); auto menu = Menu::create(menuItem, NULL); addChild(menu); } diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index 8240019fed..8dd67b948a 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -90,7 +90,7 @@ void PhysicsDemoDisabled::onEnter() "fonts/arial.ttf", 18); auto size = Director::getInstance()->getWinSize(); - label->setPosition(Vector2(size.width/2, size.height/2)); + label->setPosition(Vec2(size.width/2, size.height/2)); addChild(label); } @@ -156,10 +156,10 @@ void PhysicsDemo::onEnter() auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(Vector2(VisibleRect::right().x-50, VisibleRect::top().y-10)); + menu->setPosition(Vec2(VisibleRect::right().x-50, VisibleRect::top().y-10)); } -Sprite* PhysicsDemo::addGrossiniAtPosition(Vector2 p, float scale/* = 1.0*/) +Sprite* PhysicsDemo::addGrossiniAtPosition(Vec2 p, float scale/* = 1.0*/) { CCLOG("Add sprite %0.2f x %02.f",p.x,p.y); @@ -243,7 +243,7 @@ void PhysicsDemoClickAdd::onAcceleration(Acceleration* acc, Event* event) prevX = accelX; prevY = accelY; - auto v = Vector2( accelX, accelY); + auto v = Vec2( accelX, accelY); v = v * 200; if(_scene != nullptr) @@ -305,7 +305,7 @@ namespace } } -Sprite* PhysicsDemo::makeBall(Vector2 point, float radius, PhysicsMaterial material) +Sprite* PhysicsDemo::makeBall(Vec2 point, float radius, PhysicsMaterial material) { Sprite* ball = nullptr; if (_ball != nullptr) @@ -320,12 +320,12 @@ Sprite* PhysicsDemo::makeBall(Vector2 point, float radius, PhysicsMaterial mater auto body = PhysicsBody::createCircle(radius, material); ball->setPhysicsBody(body); - ball->setPosition(Vector2(point.x, point.y)); + ball->setPosition(Vec2(point.x, point.y)); return ball; } -Sprite* PhysicsDemo::makeBox(Vector2 point, Size size, int color, PhysicsMaterial material) +Sprite* PhysicsDemo::makeBox(Vec2 point, Size size, int color, PhysicsMaterial material) { bool yellow = false; if (color == 0) @@ -343,12 +343,12 @@ Sprite* PhysicsDemo::makeBox(Vector2 point, Size size, int color, PhysicsMateria auto body = PhysicsBody::createBox(size, material); box->setPhysicsBody(body); - box->setPosition(Vector2(point.x, point.y)); + box->setPosition(Vec2(point.x, point.y)); return box; } -Sprite* PhysicsDemo::makeTriangle(Vector2 point, Size size, int color, PhysicsMaterial material) +Sprite* PhysicsDemo::makeTriangle(Vec2 point, Size size, int color, PhysicsMaterial material) { bool yellow = false; if (color == 0) @@ -370,11 +370,11 @@ Sprite* PhysicsDemo::makeTriangle(Vector2 point, Size size, int color, PhysicsMa triangle->setScaleY(size.height/43.5f); } - Vector2 vers[] = { Vector2(0, size.height/2), Vector2(size.width/2, -size.height/2), Vector2(-size.width/2, -size.height/2)}; + Vec2 vers[] = { Vec2(0, size.height/2), Vec2(size.width/2, -size.height/2), Vec2(-size.width/2, -size.height/2)}; auto body = PhysicsBody::createPolygon(vers, 3, material); triangle->setPhysicsBody(body); - triangle->setPosition(Vector2(point.x, point.y)); + triangle->setPosition(Vec2(point.x, point.y)); return triangle; } @@ -438,7 +438,7 @@ void PhysicsDemoLogoSmash::onEnter() { PhysicsDemo::onEnter(); - _scene->getPhysicsWorld()->setGravity(Vector2(0, 0)); + _scene->getPhysicsWorld()->setGravity(Vec2(0, 0)); _scene->getPhysicsWorld()->setUpdateRate(5.0f); _ball = SpriteBatchNode::create("Images/ball.png", sizeof(logo_image)/sizeof(logo_image[0])); @@ -452,7 +452,7 @@ void PhysicsDemoLogoSmash::onEnter() float x_jitter = 0.05*frand(); float y_jitter = 0.05*frand(); - Node* ball = makeBall(Vector2(2*(x - logo_width/2 + x_jitter) + VisibleRect::getVisibleRect().size.width/2, + Node* ball = makeBall(Vec2(2*(x - logo_width/2 + x_jitter) + VisibleRect::getVisibleRect().size.width/2, 2*(logo_height-y + y_jitter) + VisibleRect::getVisibleRect().size.height/2 - logo_height/2), 0.95f, PhysicsMaterial(0.01f, 0.0f, 0.0f)); @@ -466,10 +466,10 @@ void PhysicsDemoLogoSmash::onEnter() } - auto bullet = makeBall(Vector2(400, 0), 10, PhysicsMaterial(PHYSICS_INFINITY, 0, 0)); - bullet->getPhysicsBody()->setVelocity(Vector2(200, 0)); + auto bullet = makeBall(Vec2(400, 0), 10, PhysicsMaterial(PHYSICS_INFINITY, 0, 0)); + bullet->getPhysicsBody()->setVelocity(Vec2(200, 0)); - bullet->setPosition(Vector2(-500, VisibleRect::getVisibleRect().size.height/2)); + bullet->setPosition(Vec2(-500, VisibleRect::getVisibleRect().size.height/2)); _ball->addChild(bullet); } @@ -499,7 +499,7 @@ void PhysicsDemoPyramidStack::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto node = Node::create(); - node->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vector2(0, 50), VisibleRect::rightBottom() + Vector2(0, 50))); + node->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vec2(0, 50), VisibleRect::rightBottom() + Vec2(0, 50))); this->addChild(node); auto ball = Sprite::create("Images/ball.png"); @@ -507,7 +507,7 @@ void PhysicsDemoPyramidStack::onEnter() ball->setTag(100); ball->setPhysicsBody(PhysicsBody::createCircle(10)); ball->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - ball->setPosition(VisibleRect::bottom() + Vector2(0, 60)); + ball->setPosition(VisibleRect::bottom() + Vec2(0, 60)); this->addChild(ball); scheduleOnce(schedule_selector(PhysicsDemoPyramidStack::updateOnce), 3.0); @@ -516,7 +516,7 @@ void PhysicsDemoPyramidStack::onEnter() { for(int j=0; j<=i; j++) { - auto sp = addGrossiniAtPosition(VisibleRect::bottom() + Vector2((i/2 - j) * 11, (14 - i) * 23 + 100), 0.2f); + auto sp = addGrossiniAtPosition(VisibleRect::bottom() + Vec2((i/2 - j) * 11, (14 - i) * 23 + 100), 0.2f); sp->getPhysicsBody()->setTag(DRAG_BODYS_TAG); } } @@ -543,8 +543,8 @@ void PhysicsDemoRayCast::onEnter() _scene->getPhysicsWorld()->setGravity(Point::ZERO); auto node = DrawNode::create(); - node->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vector2(0, 50), VisibleRect::rightBottom() + Vector2(0, 50))); - node->drawSegment(VisibleRect::leftBottom() + Vector2(0, 50), VisibleRect::rightBottom() + Vector2(0, 50), 1, STATIC_COLOR); + node->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vec2(0, 50), VisibleRect::rightBottom() + Vec2(0, 50))); + node->drawSegment(VisibleRect::leftBottom() + Vec2(0, 50), VisibleRect::rightBottom() + Vec2(0, 50), 1, STATIC_COLOR); this->addChild(node); MenuItemFont::setFontSize(18); @@ -552,7 +552,7 @@ void PhysicsDemoRayCast::onEnter() auto menu = Menu::create(item, NULL); this->addChild(menu); - menu->setPosition(Vector2(VisibleRect::left().x+100, VisibleRect::top().y-10)); + menu->setPosition(Vec2(VisibleRect::left().x+100, VisibleRect::top().y-10)); scheduleUpdate(); } @@ -580,16 +580,16 @@ void PhysicsDemoRayCast::changeModeCallback(Ref* sender) bool PhysicsDemoRayCast::anyRay(PhysicsWorld& world, const PhysicsRayCastInfo& info, void* data) { - *((Vector2*)data) = info.contact; + *((Vec2*)data) = info.contact; return false; } void PhysicsDemoRayCast::update(float delta) { float L = 150.0f; - Vector2 point1 = VisibleRect::center(); - Vector2 d(L * cosf(_angle), L * sinf(_angle)); - Vector2 point2 = point1 + d; + Vec2 point1 = VisibleRect::center(); + Vec2 d(L * cosf(_angle), L * sinf(_angle)); + Vec2 point2 = point1 + d; removeChild(_node); _node = DrawNode::create(); @@ -597,7 +597,7 @@ void PhysicsDemoRayCast::update(float delta) { case 0: { - Vector2 point3 = point2; + Vec2 point3 = point2; auto func = CC_CALLBACK_3(PhysicsDemoRayCast::anyRay, this); _scene->getPhysicsWorld()->rayCast(func, point1, point2, &point3); @@ -613,7 +613,7 @@ void PhysicsDemoRayCast::update(float delta) } case 1: { - Vector2 point3 = point2; + Vec2 point3 = point2; float friction = 1.0f; PhysicsRayCastCallbackFunc func = [&point3, &friction](PhysicsWorld& world, const PhysicsRayCastInfo& info, void* data)->bool { @@ -640,7 +640,7 @@ void PhysicsDemoRayCast::update(float delta) case 2: { #define MAX_MULTI_RAYCAST_NUM 5 - Vector2 points[MAX_MULTI_RAYCAST_NUM]; + Vec2 points[MAX_MULTI_RAYCAST_NUM]; int num = 0; PhysicsRayCastCallbackFunc func = [&points, &num](PhysicsWorld& world, const PhysicsRayCastInfo& info, void* data)->bool @@ -729,16 +729,16 @@ void PhysicsDemoJoints::onEnter() { for (int j = 0; j < 4; ++j) { - Vector2 offset(VisibleRect::leftBottom().x + 5 + j * width + width/2, VisibleRect::leftBottom().y + 50 + i * height + height/2); + Vec2 offset(VisibleRect::leftBottom().x + 5 + j * width + width/2, VisibleRect::leftBottom().y + 50 + i * height + height/2); box->addShape(PhysicsShapeEdgeBox::create(Size(width, height), PHYSICSSHAPE_MATERIAL_DEFAULT, 1, offset)); switch (i*4 + j) { case 0: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBall(offset + Vector2(30, 0), 10); + auto sp2 = makeBall(offset + Vec2(30, 0), 10); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); PhysicsJointPin* joint = PhysicsJointPin::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), offset); @@ -751,9 +751,9 @@ void PhysicsDemoJoints::onEnter() case 1: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); PhysicsJointFixed* joint = PhysicsJointFixed::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), offset); @@ -766,9 +766,9 @@ void PhysicsDemoJoints::onEnter() case 2: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); PhysicsJointDistance* joint = PhysicsJointDistance::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), Point::ZERO, Point::ZERO); @@ -780,9 +780,9 @@ void PhysicsDemoJoints::onEnter() } case 3: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); PhysicsJointLimit* joint = PhysicsJointLimit::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), Point::ZERO, Point::ZERO, 30.0f, 60.0f); @@ -794,9 +794,9 @@ void PhysicsDemoJoints::onEnter() } case 4: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); PhysicsJointSpring* joint = PhysicsJointSpring::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), Point::ZERO, Point::ZERO, 500.0f, 0.3f); @@ -808,12 +808,12 @@ void PhysicsDemoJoints::onEnter() } case 5: { - auto sp1 = makeBall(offset - Vector2(30, 0), 10); + auto sp1 = makeBall(offset - Vec2(30, 0), 10); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - PhysicsJointGroove* joint = PhysicsJointGroove::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), Vector2(30, 15), Vector2(30, -15), Vector2(-30, 0)); + PhysicsJointGroove* joint = PhysicsJointGroove::construct(sp1->getPhysicsBody(), sp2->getPhysicsBody(), Vec2(30, 15), Vec2(30, -15), Vec2(-30, 0)); _scene->getPhysicsWorld()->addJoint(joint); this->addChild(sp1); @@ -822,9 +822,9 @@ void PhysicsDemoJoints::onEnter() } case 6: { - auto sp1 = makeBox(offset - Vector2(30, 0), Size(30, 10)); + auto sp1 = makeBox(offset - Vec2(30, 0), Size(30, 10)); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); @@ -838,9 +838,9 @@ void PhysicsDemoJoints::onEnter() } case 7: { - auto sp1 = makeBox(offset - Vector2(30, 0), Size(30, 10)); + auto sp1 = makeBox(offset - Vec2(30, 0), Size(30, 10)); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); @@ -854,9 +854,9 @@ void PhysicsDemoJoints::onEnter() } case 8: { - auto sp1 = makeBox(offset - Vector2(30, 0), Size(30, 10)); + auto sp1 = makeBox(offset - Vec2(30, 0), Size(30, 10)); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); @@ -870,9 +870,9 @@ void PhysicsDemoJoints::onEnter() } case 9: { - auto sp1 = makeBox(offset - Vector2(30, 0), Size(30, 10)); + auto sp1 = makeBox(offset - Vec2(30, 0), Size(30, 10)); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); @@ -886,9 +886,9 @@ void PhysicsDemoJoints::onEnter() } case 10: { - auto sp1 = makeBox(offset - Vector2(30, 0), Size(30, 10)); + auto sp1 = makeBox(offset - Vec2(30, 0), Size(30, 10)); sp1->getPhysicsBody()->setTag(DRAG_BODYS_TAG); - auto sp2 = makeBox(offset + Vector2(30, 0), Size(30, 10)); + auto sp2 = makeBox(offset + Vec2(30, 0), Size(30, 10)); sp2->getPhysicsBody()->setTag(DRAG_BODYS_TAG); _scene->getPhysicsWorld()->addJoint(PhysicsJointPin::construct(sp1->getPhysicsBody(), box, sp1->getPosition())); @@ -928,15 +928,15 @@ void PhysicsDemoActions::onEnter() this->addChild(node); Sprite* sp1 = addGrossiniAtPosition(VisibleRect::center()); - Sprite* sp2 = addGrossiniAtPosition(VisibleRect::left() + Vector2(50, 0)); - Sprite* sp3 = addGrossiniAtPosition(VisibleRect::right() - Vector2(20, 0)); - Sprite* sp4 = addGrossiniAtPosition(VisibleRect::leftTop() + Vector2(50, -50)); + Sprite* sp2 = addGrossiniAtPosition(VisibleRect::left() + Vec2(50, 0)); + Sprite* sp3 = addGrossiniAtPosition(VisibleRect::right() - Vec2(20, 0)); + Sprite* sp4 = addGrossiniAtPosition(VisibleRect::leftTop() + Vec2(50, -50)); sp4->getPhysicsBody()->setGravityEnable(false); - auto actionTo = JumpTo::create(2, Vector2(100,100), 50, 4); - auto actionBy = JumpBy::create(2, Vector2(300,0), 50, 4); - auto actionUp = JumpBy::create(2, Vector2(0,50), 80, 4); + auto actionTo = JumpTo::create(2, Vec2(100,100), 50, 4); + auto actionBy = JumpBy::create(2, Vec2(300,0), 50, 4); + auto actionUp = JumpBy::create(2, Vec2(0,50), 80, 4); auto actionByBack = actionBy->reverse(); sp1->runAction(RepeatForever::create(actionUp)); @@ -969,20 +969,20 @@ void PhysicsDemoPump::onEnter() body->setDynamic(false); PhysicsMaterial staticMaterial(PHYSICS_INFINITY, 0, 0.5f); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(50, 0), VisibleRect::leftTop() + Vector2(50, -130), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(190, 0), VisibleRect::leftTop() + Vector2(100, -50), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(100, -50), VisibleRect::leftTop() + Vector2(100, -90), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(50, -130), VisibleRect::leftTop() + Vector2(100, -145), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(100, -145), VisibleRect::leftBottom() + Vector2(100, 80), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(150, -80), VisibleRect::leftBottom() + Vector2(150, 80), staticMaterial, 2.0f)); - body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vector2(150, -80), VisibleRect::rightTop() + Vector2(-100, -150), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(50, 0), VisibleRect::leftTop() + Vec2(50, -130), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(190, 0), VisibleRect::leftTop() + Vec2(100, -50), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(100, -50), VisibleRect::leftTop() + Vec2(100, -90), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(50, -130), VisibleRect::leftTop() + Vec2(100, -145), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(100, -145), VisibleRect::leftBottom() + Vec2(100, 80), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(150, -80), VisibleRect::leftBottom() + Vec2(150, 80), staticMaterial, 2.0f)); + body->addShape(PhysicsShapeEdgeSegment::create(VisibleRect::leftTop() + Vec2(150, -80), VisibleRect::rightTop() + Vec2(-100, -150), staticMaterial, 2.0f)); body->setCategoryBitmask(0x01); // balls for (int i = 0; i < 6; ++i) { - auto ball = makeBall(VisibleRect::leftTop() + Vector2(75 + CCRANDOM_0_1() * 90, 0), 22, PhysicsMaterial(0.05f, 0.0f, 0.1f)); + auto ball = makeBall(VisibleRect::leftTop() + Vec2(75 + CCRANDOM_0_1() * 90, 0), 22, PhysicsMaterial(0.05f, 0.0f, 0.1f)); ball->getPhysicsBody()->setTag(DRAG_BODYS_TAG); addChild(ball); } @@ -990,12 +990,12 @@ void PhysicsDemoPump::onEnter() node->setPhysicsBody(body); this->addChild(node); - Vector2 vec[4] = + Vec2 vec[4] = { - VisibleRect::leftTop() + Vector2(102, -148), - VisibleRect::leftTop() + Vector2(148, -161), - VisibleRect::leftBottom() + Vector2(148, 20), - VisibleRect::leftBottom() + Vector2(102, 20) + VisibleRect::leftTop() + Vec2(102, -148), + VisibleRect::leftTop() + Vec2(148, -161), + VisibleRect::leftBottom() + Vec2(148, 20), + VisibleRect::leftBottom() + Vec2(102, 20) }; auto _world = _scene->getPhysicsWorld(); @@ -1004,7 +1004,7 @@ void PhysicsDemoPump::onEnter() auto sgear = Node::create(); auto sgearB = PhysicsBody::createCircle(44); sgear->setPhysicsBody(sgearB); - sgear->setPosition(VisibleRect::leftBottom() + Vector2(125, 0)); + sgear->setPosition(VisibleRect::leftBottom() + Vec2(125, 0)); this->addChild(sgear); sgearB->setCategoryBitmask(0x04); sgearB->setCollisionBitmask(0x04); @@ -1016,7 +1016,7 @@ void PhysicsDemoPump::onEnter() auto bgear = Node::create(); auto bgearB = PhysicsBody::createCircle(100); bgear->setPhysicsBody(bgearB); - bgear->setPosition(VisibleRect::leftBottom() + Vector2(275, 0)); + bgear->setPosition(VisibleRect::leftBottom() + Vec2(275, 0)); this->addChild(bgear); bgearB->setCategoryBitmask(0x04); _world->addJoint(PhysicsJointPin::construct(body, bgearB, bgearB->getPosition())); @@ -1031,11 +1031,11 @@ void PhysicsDemoPump::onEnter() this->addChild(pump); pumpB->setCategoryBitmask(0x02); pumpB->setGravityEnable(false); - _world->addJoint(PhysicsJointDistance::construct(pumpB, sgearB, Vector2(0, 0), Vector2(0, -44))); + _world->addJoint(PhysicsJointDistance::construct(pumpB, sgearB, Vec2(0, 0), Vec2(0, -44))); // plugger - Vector2 seg[] = {VisibleRect::leftTop() + Vector2(75, -120), VisibleRect::leftBottom() + Vector2(75, -100)}; - Vector2 segCenter = (seg[1] + seg[0])/2; + Vec2 seg[] = {VisibleRect::leftTop() + Vec2(75, -120), VisibleRect::leftBottom() + Vec2(75, -100)}; + Vec2 segCenter = (seg[1] + seg[0])/2; seg[1] -= segCenter; seg[0] -= segCenter; auto plugger = Node::create(); @@ -1048,8 +1048,8 @@ void PhysicsDemoPump::onEnter() this->addChild(plugger); pluggerB->setCategoryBitmask(0x02); sgearB->setCollisionBitmask(0x04 | 0x01); - _world->addJoint(PhysicsJointPin::construct(body, pluggerB, VisibleRect::leftBottom() + Vector2(75, -90))); - _world->addJoint(PhysicsJointDistance::construct(pluggerB, sgearB, pluggerB->world2Local(VisibleRect::leftBottom() + Vector2(75, 0)), Vector2(44, 0))); + _world->addJoint(PhysicsJointPin::construct(body, pluggerB, VisibleRect::leftBottom() + Vec2(75, -90))); + _world->addJoint(PhysicsJointDistance::construct(pluggerB, sgearB, pluggerB->world2Local(VisibleRect::leftBottom() + Vec2(75, 0)), Vec2(44, 0))); } void PhysicsDemoPump::update(float delta) @@ -1058,8 +1058,8 @@ void PhysicsDemoPump::update(float delta) { if (body->getTag() == DRAG_BODYS_TAG && body->getPosition().y < 0.0f) { - body->getNode()->setPosition(VisibleRect::leftTop() + Vector2(75 + CCRANDOM_0_1() * 90, 0)); - body->setVelocity(Vector2(0, 0)); + body->getNode()->setPosition(VisibleRect::leftTop() + Vec2(75 + CCRANDOM_0_1() * 90, 0)); + body->setVelocity(Vec2(0, 0)); } } @@ -1124,7 +1124,7 @@ void PhysicsDemoOneWayPlatform::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); - ground->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vector2(0, 50), VisibleRect::rightBottom() + Vector2(0, 50))); + ground->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vec2(0, 50), VisibleRect::rightBottom() + Vec2(0, 50))); this->addChild(ground); auto platform = makeBox(VisibleRect::center(), Size(200, 50)); @@ -1132,8 +1132,8 @@ void PhysicsDemoOneWayPlatform::onEnter() platform->getPhysicsBody()->setContactTestBitmask(0xFFFFFFFF); this->addChild(platform); - auto ball = makeBall(VisibleRect::center() - Vector2(0, 50), 20); - ball->getPhysicsBody()->setVelocity(Vector2(0, 150)); + auto ball = makeBall(VisibleRect::center() - Vec2(0, 50), 20); + ball->getPhysicsBody()->setVelocity(Vec2(0, 150)); ball->getPhysicsBody()->setTag(DRAG_BODYS_TAG); ball->getPhysicsBody()->setMass(1.0f); ball->getPhysicsBody()->setContactTestBitmask(0xFFFFFFFF); @@ -1167,11 +1167,11 @@ void PhysicsDemoSlice::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); auto ground = Node::create(); - ground->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vector2(0, 50), VisibleRect::rightBottom() + Vector2(0, 50))); + ground->setPhysicsBody(PhysicsBody::createEdgeSegment(VisibleRect::leftBottom() + Vec2(0, 50), VisibleRect::rightBottom() + Vec2(0, 50))); this->addChild(ground); auto box = Node::create(); - Vector2 points[4] = {Vector2(-100, -100), Vector2(-100, 100), Vector2(100, 100), Vector2(100, -100)}; + Vec2 points[4] = {Vec2(-100, -100), Vec2(-100, 100), Vec2(100, 100), Vec2(100, -100)}; box->setPhysicsBody(PhysicsBody::createPolygon(points, 4)); box->setPosition(VisibleRect::center()); box->getPhysicsBody()->setTag(_sliceTag); @@ -1187,7 +1187,7 @@ bool PhysicsDemoSlice::slice(PhysicsWorld &world, const PhysicsRayCastInfo& info if (!info.shape->containsPoint(info.start) && !info.shape->containsPoint(info.end)) { - Vector2 normal = info.end - info.start; + Vec2 normal = info.end - info.start; normal = normal.getPerp().getNormalized(); float dist = info.start.dot(normal); @@ -1200,16 +1200,16 @@ bool PhysicsDemoSlice::slice(PhysicsWorld &world, const PhysicsRayCastInfo& info return true; } -void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vector2 normal, float distance) +void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float distance) { PhysicsBody* body = shape->getBody(); int count = shape->getPointsCount(); int pointsCount = 0; - Vector2* points = new Vector2[count + 1]; + Vec2* points = new Vec2[count + 1]; for (int i=0, j=count-1; ilocal2World(shape->getPoint(j)); + Vec2 a = body->local2World(shape->getPoint(j)); float aDist = a.dot(normal) - distance; if (aDist < 0.0f) @@ -1218,7 +1218,7 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vector2 normal, floa ++pointsCount; } - Vector2 b = body->local2World(shape->getPoint(i)); + Vec2 b = body->local2World(shape->getPoint(i)); float bDist = b.dot(normal) - distance; if (aDist*bDist < 0.0f) @@ -1229,7 +1229,7 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vector2 normal, floa } } - Vector2 center = PhysicsShape::getPolyonCenter(points, pointsCount); + Vec2 center = PhysicsShape::getPolyonCenter(points, pointsCount); Node* node = Node::create(); PhysicsBody* polyon = PhysicsBody::createPolygon(points, pointsCount, PHYSICSBODY_MATERIAL_DEFAULT, -center); node->setPosition(center); @@ -1266,11 +1266,11 @@ void PhysicsDemoBug3988::onEnter() _scene->getPhysicsWorld()->setGravity(Vect::ZERO); auto ball = Sprite::create("Images/YellowSquare.png"); - ball->setPosition(VisibleRect::center() - Vector2(100, 0)); + ball->setPosition(VisibleRect::center() - Vec2(100, 0)); ball->setRotation(30.0f); this->addChild(ball); - auto physicsBall = makeBox(VisibleRect::center() + Vector2(100, 0), Size(100, 100)); + auto physicsBall = makeBox(VisibleRect::center() + Vec2(100, 0), Size(100, 100)); physicsBall->setRotation(30.0f); this->addChild(physicsBall); } @@ -1307,12 +1307,12 @@ void PhysicsContactTest::onEnter() auto menu1 = Menu::create(decrease1, increase1, NULL); menu1->alignItemsHorizontally(); - menu1->setPosition(Vector2(s.width/2, s.height-50)); + menu1->setPosition(Vec2(s.width/2, s.height-50)); addChild(menu1, 1); auto label = Label::createWithTTF("yellow box", "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2 - 150, s.height-50)); + label->setPosition(Vec2(s.width/2 - 150, s.height-50)); auto decrease2 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease2->setColor(Color3B(0,200,20)); @@ -1323,12 +1323,12 @@ void PhysicsContactTest::onEnter() auto menu2 = Menu::create(decrease2, increase2, NULL); menu2->alignItemsHorizontally(); - menu2->setPosition(Vector2(s.width/2, s.height-90)); + menu2->setPosition(Vec2(s.width/2, s.height-90)); addChild(menu2, 1); label = Label::createWithTTF("blue box", "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2 - 150, s.height-90)); + label->setPosition(Vec2(s.width/2 - 150, s.height-90)); auto decrease3 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease3->setColor(Color3B(0,200,20)); @@ -1339,12 +1339,12 @@ void PhysicsContactTest::onEnter() auto menu3 = Menu::create(decrease3, increase3, NULL); menu3->alignItemsHorizontally(); - menu3->setPosition(Vector2(s.width/2, s.height-130)); + menu3->setPosition(Vec2(s.width/2, s.height-130)); addChild(menu3, 1); label = Label::createWithTTF("yellow triangle", "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2 - 150, s.height-130)); + label->setPosition(Vec2(s.width/2 - 150, s.height-130)); auto decrease4 = MenuItemFont::create(" - ", CC_CALLBACK_1(PhysicsContactTest::onDecrease, this)); decrease4->setColor(Color3B(0,200,20)); @@ -1355,12 +1355,12 @@ void PhysicsContactTest::onEnter() auto menu4 = Menu::create(decrease4, increase4, NULL); menu4->alignItemsHorizontally(); - menu4->setPosition(Vector2(s.width/2, s.height-170)); + menu4->setPosition(Vec2(s.width/2, s.height-170)); addChild(menu4, 1); label = Label::createWithTTF("blue triangle", "fonts/arial.ttf", 32); addChild(label, 1); - label->setPosition(Vector2(s.width/2 - 150, s.height-170)); + label->setPosition(Vec2(s.width/2 - 150, s.height-170)); resetTest(); } @@ -1427,22 +1427,22 @@ void PhysicsContactTest::resetTest() sprintf(buffer, "%d", _yellowBoxNum); auto label = Label::createWithTTF(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-50)); + label->setPosition(Vec2(s.width/2, s.height-50)); sprintf(buffer, "%d", _blueBoxNum); label = Label::createWithTTF(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-90)); + label->setPosition(Vec2(s.width/2, s.height-90)); sprintf(buffer, "%d", _yellowTriangleNum); label = Label::createWithTTF(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-130)); + label->setPosition(Vec2(s.width/2, s.height-130)); sprintf(buffer, "%d", _blueTriangleNum); label = Label::createWithTTF(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); - label->setPosition(Vector2(s.width/2, s.height-170)); + label->setPosition(Vec2(s.width/2, s.height-170)); auto wall = Node::create(); wall->setPhysicsBody(PhysicsBody::createEdgeBox(VisibleRect::getVisibleRect().size, PhysicsMaterial(0.1f, 1, 0.0f))); @@ -1458,10 +1458,10 @@ void PhysicsContactTest::resetTest() { Size size(10 + CCRANDOM_0_1()*10, 10 + CCRANDOM_0_1()*10); Size winSize = VisibleRect::getVisibleRect().size; - Vector2 position = Vector2(winSize.width, winSize.height) - Vector2(size.width, size.height); + Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); position.x = position.x * CCRANDOM_0_1(); position.y = position.y * CCRANDOM_0_1(); - position = VisibleRect::leftBottom() + position + Vector2(size.width/2, size.height/2); + position = VisibleRect::leftBottom() + position + Vec2(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.1f, 1, 0.0f)); box->getPhysicsBody()->setVelocity(velocity); @@ -1476,10 +1476,10 @@ void PhysicsContactTest::resetTest() { Size size(10 + CCRANDOM_0_1()*10, 10 + CCRANDOM_0_1()*10); Size winSize = VisibleRect::getVisibleRect().size; - Vector2 position = Vector2(winSize.width, winSize.height) - Vector2(size.width, size.height); + Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); position.x = position.x * CCRANDOM_0_1(); position.y = position.y * CCRANDOM_0_1(); - position = VisibleRect::leftBottom() + position + Vector2(size.width/2, size.height/2); + position = VisibleRect::leftBottom() + position + Vec2(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.1f, 1, 0.0f)); box->getPhysicsBody()->setVelocity(velocity); @@ -1494,10 +1494,10 @@ void PhysicsContactTest::resetTest() { Size size(10 + CCRANDOM_0_1()*10, 10 + CCRANDOM_0_1()*10); Size winSize = VisibleRect::getVisibleRect().size; - Vector2 position = Vector2(winSize.width, winSize.height) - Vector2(size.width, size.height); + Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); position.x = position.x * CCRANDOM_0_1(); position.y = position.y * CCRANDOM_0_1(); - position = VisibleRect::leftBottom() + position + Vector2(size.width/2, size.height/2); + position = VisibleRect::leftBottom() + position + Vec2(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.1f, 1, 0.0f)); triangle->getPhysicsBody()->setVelocity(velocity); @@ -1512,10 +1512,10 @@ void PhysicsContactTest::resetTest() { Size size(10 + CCRANDOM_0_1()*10, 10 + CCRANDOM_0_1()*10); Size winSize = VisibleRect::getVisibleRect().size; - Vector2 position = Vector2(winSize.width, winSize.height) - Vector2(size.width, size.height); + Vec2 position = Vec2(winSize.width, winSize.height) - Vec2(size.width, size.height); position.x = position.x * CCRANDOM_0_1(); position.y = position.y * CCRANDOM_0_1(); - position = VisibleRect::leftBottom() + position + Vector2(size.width/2, size.height/2); + position = VisibleRect::leftBottom() + position + Vec2(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.1f, 1, 0.0f)); triangle->getPhysicsBody()->setVelocity(velocity); @@ -1566,7 +1566,7 @@ void PhysicsPositionRotationTest::onEnter() // anchor test auto anchorNode = Sprite::create("Images/YellowSquare.png"); - anchorNode->setAnchorPoint(Vector2(0.1f, 0.9f)); + anchorNode->setAnchorPoint(Vec2(0.1f, 0.9f)); anchorNode->setPosition(100, 100); anchorNode->setScale(0.25); anchorNode->setPhysicsBody(PhysicsBody::createBox(anchorNode->getContentSize()*anchorNode->getScale())); @@ -1592,7 +1592,7 @@ void PhysicsPositionRotationTest::onEnter() auto offsetPosNode = Sprite::create("Images/YellowSquare.png"); offsetPosNode->setPosition(100, 200); offsetPosNode->setPhysicsBody(PhysicsBody::createBox(offsetPosNode->getContentSize()/2)); - offsetPosNode->getPhysicsBody()->setPositionOffset(-Vector2(offsetPosNode->getContentSize()/2)); + offsetPosNode->getPhysicsBody()->setPositionOffset(-Vec2(offsetPosNode->getContentSize()/2)); offsetPosNode->getPhysicsBody()->setRotationOffset(45); offsetPosNode->getPhysicsBody()->setTag(DRAG_BODYS_TAG); addChild(offsetPosNode); @@ -1623,17 +1623,17 @@ void PhysicsSetGravityEnableTest::onEnter() addChild(wall); // common box - auto commonBox = makeBox(Vector2(100, 100), Size(50, 50), 1); + auto commonBox = makeBox(Vec2(100, 100), Size(50, 50), 1); commonBox->getPhysicsBody()->setTag(DRAG_BODYS_TAG); addChild(commonBox); - auto box = makeBox(Vector2(200, 100), Size(50, 50), 2); + auto box = makeBox(Vec2(200, 100), Size(50, 50), 2); box->getPhysicsBody()->setMass(20); box->getPhysicsBody()->setTag(DRAG_BODYS_TAG); box->getPhysicsBody()->setGravityEnable(false); addChild(box); - auto ball = makeBall(Vector2(200, 200), 50); + auto ball = makeBall(Vec2(200, 200), 50); ball->setTag(2); ball->getPhysicsBody()->setTag(DRAG_BODYS_TAG); ball->getPhysicsBody()->setGravityEnable(false); diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h index 78e26297e6..9e8fc8f01b 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.h @@ -49,10 +49,10 @@ public: void backCallback(Ref* sender); void toggleDebugCallback(Ref* sender); - Sprite* addGrossiniAtPosition(Vector2 p, float scale = 1.0); - Sprite* makeBall(Vector2 point, float radius, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); - Sprite* makeBox(Vector2 point, Size size, int color = 0, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); - Sprite* makeTriangle(Vector2 point, Size size, int color = 0, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); + Sprite* addGrossiniAtPosition(Vec2 p, float scale = 1.0); + Sprite* makeBall(Vec2 point, float radius, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); + Sprite* makeBox(Vec2 point, Size size, int color = 0, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); + Sprite* makeTriangle(Vec2 point, Size size, int color = 0, PhysicsMaterial material = PHYSICSBODY_MATERIAL_DEFAULT); bool onTouchBegan(Touch* touch, Event* event); void onTouchMoved(Touch* touch, Event* event); @@ -177,7 +177,7 @@ public: virtual std::string subtitle() const override; bool slice(PhysicsWorld& world, const PhysicsRayCastInfo& info, void* data); - void clipPoly(PhysicsShapePolygon* shape, Vector2 normal, float distance); + void clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float distance); void onTouchEnded(Touch *touch, Event *event); diff --git a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp index d4213b54ff..14e9b8dc6a 100644 --- a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp +++ b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp @@ -27,7 +27,7 @@ void ReleasePoolTestScene::runThisTest() // title auto label = Label::createWithTTF("AutoreasePool Test", "fonts/arial.ttf", 32); addChild(label, 9999); - label->setPosition(Vector2(VisibleRect::center().x, VisibleRect::top().y - 30)); + label->setPosition(Vec2(VisibleRect::center().x, VisibleRect::top().y - 30)); // reference count should be added when added into auto release pool diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 8170f8921c..b86d503ba8 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -94,7 +94,7 @@ RenderTextureSave::RenderTextureSave() // create a render texture, this is what we are going to draw into _target = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA8888); _target->retain(); - _target->setPosition(Vector2(s.width / 2, s.height / 2)); + _target->setPosition(Vec2(s.width / 2, s.height / 2)); // note that the render texture is a Node, and contains a sprite of its texture for convience, // so we can just parent it to the scene like any other Node @@ -111,7 +111,7 @@ RenderTextureSave::RenderTextureSave() auto menu = Menu::create(item1, item2, NULL); this->addChild(menu); menu->alignItemsVertically(); - menu->setPosition(Vector2(VisibleRect::rightTop().x - 80, VisibleRect::rightTop().y - 30)); + menu->setPosition(Vec2(VisibleRect::rightTop().x - 80, VisibleRect::rightTop().y - 30)); } std::string RenderTextureSave::title() const @@ -148,7 +148,7 @@ void RenderTextureSave::saveImage(cocos2d::Ref *sender) auto sprite = Sprite::create(fileName); addChild(sprite); sprite->setScale(0.3f); - sprite->setPosition(Vector2(40, 40)); + sprite->setPosition(Vec2(40, 40)); sprite->setRotation(counter * 3); }; runAction(Sequence::create(action1, CallFunc::create(func), NULL)); @@ -192,7 +192,7 @@ void RenderTextureSave::onTouchesMoved(const std::vector& touches, Event float difx = end.x - start.x; float dify = end.y - start.y; float delta = (float)i / distance; - _brushs.at(i)->setPosition(Vector2(start.x + (difx * delta), start.y + (dify * delta))); + _brushs.at(i)->setPosition(Vec2(start.x + (difx * delta), start.y + (dify * delta))); _brushs.at(i)->setRotation(rand() % 360); float r = (float)(rand() % 50 / 50.f) + 0.25f; _brushs.at(i)->setScale(r); @@ -231,10 +231,10 @@ RenderTextureIssue937::RenderTextureIssue937() auto s = Director::getInstance()->getWinSize(); auto spr_premulti = Sprite::create("Images/fire.png"); - spr_premulti->setPosition(Vector2(s.width/2-16, s.height/2+16)); + spr_premulti->setPosition(Vec2(s.width/2-16, s.height/2+16)); auto spr_nonpremulti = Sprite::create("Images/fire.png"); - spr_nonpremulti->setPosition(Vector2(s.width/2-16, s.height/2-16)); + spr_nonpremulti->setPosition(Vec2(s.width/2-16, s.height/2-16)); /* A2 & B2 setup */ auto rend = RenderTexture::create(32, 64, Texture2D::PixelFormat::RGBA8888); @@ -247,7 +247,7 @@ RenderTextureIssue937::RenderTextureIssue937() auto spr_size = spr_premulti->getContentSize(); rend->setKeepMatrix(true); Size pixelSize = Director::getInstance()->getWinSizeInPixels(); - rend->setVirtualViewport(Vector2(s.width/2-32, s.height/2-32),Rect(0,0,s.width,s.height),Rect(0,0,pixelSize.width,pixelSize.height)); + rend->setVirtualViewport(Vec2(s.width/2-32, s.height/2-32),Rect(0,0,s.width,s.height),Rect(0,0,pixelSize.width,pixelSize.height)); // It's possible to modify the RenderTexture blending function by // [[rend sprite] setBlendFunc:(BlendFunc) {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; @@ -256,7 +256,7 @@ RenderTextureIssue937::RenderTextureIssue937() spr_nonpremulti->visit(); rend->end(); - rend->setPosition(Vector2(s.width/2+16, s.height/2)); + rend->setPosition(Vec2(s.width/2+16, s.height/2)); addChild(spr_nonpremulti); addChild(spr_premulti); @@ -295,15 +295,15 @@ RenderTextureZbuffer::RenderTextureZbuffer() auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("vertexZ = 50", "fonts/Marker Felt.ttf", 64); - label->setPosition(Vector2(size.width / 2, size.height * 0.25f)); + label->setPosition(Vec2(size.width / 2, size.height * 0.25f)); this->addChild(label); auto label2 = Label::createWithTTF("vertexZ = 0", "fonts/Marker Felt.ttf", 64); - label2->setPosition(Vector2(size.width / 2, size.height * 0.5f)); + label2->setPosition(Vec2(size.width / 2, size.height * 0.5f)); this->addChild(label2); auto label3 = Label::createWithTTF("vertexZ = -50", "fonts/Marker Felt.ttf", 64); - label3->setPosition(Vector2(size.width / 2, size.height * 0.75f)); + label3->setPosition(Vec2(size.width / 2, size.height * 0.75f)); this->addChild(label3); label->setPositionZ(50); @@ -417,7 +417,7 @@ void RenderTextureZbuffer::renderScreenShot() auto sprite = Sprite::createWithTexture(texture->getSprite()->getTexture()); - sprite->setPosition(Vector2(256, 256)); + sprite->setPosition(Vec2(256, 256)); sprite->setOpacity(182); sprite->setFlippedY(1); this->addChild(sprite, 999999); @@ -451,7 +451,7 @@ RenderTexturePartTest::RenderTexturePartTest() _rend->retain(); _rend->setKeepMatrix(true); Size pixelSize = Director::getInstance()->getWinSizeInPixels(); - _rend->setVirtualViewport(Vector2(size.width/2-150, size.height/2-150),Rect(0,0,size.width,size.height),Rect(0,0,pixelSize.width,pixelSize.height)); + _rend->setVirtualViewport(Vec2(size.width/2-150, size.height/2-150),Rect(0,0,size.width,size.height),Rect(0,0,pixelSize.width,pixelSize.height)); _rend->beginWithClear(1, 0, 0, 1); sprite1->visit(); @@ -461,7 +461,7 @@ RenderTexturePartTest::RenderTexturePartTest() _rend->end(); _spriteDraw = Sprite::createWithTexture(_rend->getSprite()->getTexture()); - FiniteTimeAction* baseAction = MoveBy::create(1, Vector2(size.width,0)); + FiniteTimeAction* baseAction = MoveBy::create(1, Vec2(size.width,0)); _spriteDraw->setPosition(0,size.height/2); _spriteDraw->setScaleY(-1); _spriteDraw->runAction(RepeatForever::create(Sequence::create @@ -492,19 +492,19 @@ RenderTextureTestDepthStencil::RenderTextureTestDepthStencil() _spriteDS = Sprite::create("Images/fire.png"); _spriteDS->retain(); - _spriteDS->setPosition(Vector2(s.width * 0.25f, 0)); + _spriteDS->setPosition(Vec2(s.width * 0.25f, 0)); _spriteDS->setScale(10); _spriteDraw = Sprite::create("Images/fire.png"); _spriteDraw->retain(); - _spriteDraw->setPosition(Vector2(s.width * 0.25f, 0)); + _spriteDraw->setPosition(Vec2(s.width * 0.25f, 0)); _spriteDraw->setScale(10); //! move sprite half width and height, and draw only where not marked - _spriteDraw->setPosition(_spriteDraw->getPosition() + Vector2(_spriteDraw->getContentSize().width * _spriteDraw->getScale() * 0.5, _spriteDraw->getContentSize().height * _spriteDraw->getScale() * 0.5)); + _spriteDraw->setPosition(_spriteDraw->getPosition() + Vec2(_spriteDraw->getContentSize().width * _spriteDraw->getScale() * 0.5, _spriteDraw->getContentSize().height * _spriteDraw->getScale() * 0.5)); _rend = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444, GL_DEPTH24_STENCIL8); - _rend->setPosition(Vector2(s.width * 0.5f, s.height * 0.5f)); + _rend->setPosition(Vec2(s.width * 0.5f, s.height * 0.5f)); this->addChild(_rend); } @@ -515,7 +515,7 @@ RenderTextureTestDepthStencil::~RenderTextureTestDepthStencil() CC_SAFE_RELEASE(_spriteDS); } -void RenderTextureTestDepthStencil::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void RenderTextureTestDepthStencil::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmds[0].init(_globalZOrder); _renderCmds[0].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeClear, this); @@ -605,7 +605,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() auto renderTexture = RenderTexture::create(s.width, s.height, Texture2D::PixelFormat::RGBA4444); this->renderTexture = renderTexture; - renderTexture->setPosition(Vector2(s.width/2, s.height/2)); + renderTexture->setPosition(Vec2(s.width/2, s.height/2)); // renderTexture->setScale(2.0f); /* add the sprites to the render texture */ @@ -626,7 +626,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() auto menu = Menu::create(item, NULL); addChild(menu); - menu->setPosition(Vector2(s.width/2, s.height/2)); + menu->setPosition(Vec2(s.width/2, s.height/2)); } void RenderTextureTargetNode::touched(Ref* sender) @@ -646,8 +646,8 @@ void RenderTextureTargetNode::update(float dt) { static float time = 0; float r = 80; - sprite1->setPosition(Vector2(cosf(time * 2) * r, sinf(time * 2) * r)); - sprite2->setPosition(Vector2(sinf(time * 2) * r, cosf(time * 2) * r)); + sprite1->setPosition(Vec2(cosf(time * 2) * r, sinf(time * 2) * r)); + sprite2->setPosition(Vec2(sinf(time * 2) * r, cosf(time * 2) * r)); time += dt; } @@ -685,7 +685,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::SimpleSprite::crea return sprite; } -void SpriteRenderTextureBug::SimpleSprite::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void SpriteRenderTextureBug::SimpleSprite::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { if (_rt == nullptr) { @@ -707,10 +707,10 @@ SpriteRenderTextureBug::SpriteRenderTextureBug() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); - addNewSpriteWithCoords(Vector2(s.width/2, s.height/2)); + addNewSpriteWithCoords(Vec2(s.width/2, s.height/2)); } -SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCoords(const Vector2& p) +SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCoords(const Vec2& p) { int idx = CCRANDOM_0_1() * 1400 / 100; int x = (idx%5) * 85; diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h index 07e5c8a7ef..dc2fd9db86 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h @@ -85,7 +85,7 @@ public: virtual ~RenderTextureTestDepthStencil(); virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; private: CustomCommand _renderCmds[4]; void onBeforeClear(); @@ -139,7 +139,7 @@ public: static SimpleSprite* create(const char* filename, const Rect &rect); SimpleSprite(); ~SimpleSprite(); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated); public: RenderTexture *_rt; }; @@ -152,7 +152,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - SimpleSprite* addNewSpriteWithCoords(const Vector2& p); + SimpleSprite* addNewSpriteWithCoords(const Vec2& p); }; #endif diff --git a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp index 0a44175ea4..e031b10f92 100644 --- a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp +++ b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp @@ -21,7 +21,7 @@ void TestLayer::onEnter() // NSLog( s ); auto label = Label::createWithSystemFont("cocos2d", "Tahoma", 64); - label->setPosition( Vector2(x/2,y/2) ); + label->setPosition( Vec2(x/2,y/2) ); addChild(label); } @@ -49,9 +49,9 @@ void SpriteLayer::onEnter() spriteSister1->setScale(1.5f); spriteSister2->setScale(1.5f); - sprite->setPosition(Vector2(x/2,y/2)); - spriteSister1->setPosition(Vector2(40,y/2)); - spriteSister2->setPosition(Vector2(x-40,y/2)); + sprite->setPosition(Vec2(x/2,y/2)); + spriteSister1->setPosition(Vec2(40,y/2)); + spriteSister2->setPosition(Vec2(x-40,y/2)); auto rot = RotateBy::create(16, -3600); @@ -61,7 +61,7 @@ void SpriteLayer::onEnter() sprite->runAction(rot); - auto jump1 = JumpBy::create(4, Vector2(-400,0), 100, 4); + auto jump1 = JumpBy::create(4, Vec2(-400,0), 100, 4); auto jump2 = jump1->reverse(); auto rot1 = RotateBy::create(4, 360*2); @@ -96,20 +96,20 @@ void RotateWorldMainLayer::onEnter() auto white = LayerColor::create(Color4B(255,255,255,255)); blue->setScale(0.5f); - blue->setPosition(Vector2(-x/4,-y/4)); + blue->setPosition(Vec2(-x/4,-y/4)); blue->addChild( SpriteLayer::create() ); red->setScale(0.5f); - red->setPosition(Vector2(x/4,-y/4)); + red->setPosition(Vec2(x/4,-y/4)); green->setScale(0.5f); - green->setPosition(Vector2(-x/4,y/4)); + green->setPosition(Vec2(-x/4,y/4)); green->addChild(TestLayer::create()); white->setScale(0.5f); - white->setPosition(Vector2(x/4,y/4)); + white->setPosition(Vec2(x/4,y/4)); white->ignoreAnchorPointForPosition(false); - white->setPosition(Vector2(x/4*3,y/4*3)); + white->setPosition(Vec2(x/4*3,y/4*3)); addChild(blue, -1); addChild(white); diff --git a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp index 11c458bf00..273fcf30c5 100644 --- a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp +++ b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp @@ -30,7 +30,7 @@ SceneTestLayer1::SceneTestLayer1() auto s = Director::getInstance()->getWinSize(); auto sprite = Sprite::create(s_pathGrossini); addChild(sprite); - sprite->setPosition( Vector2(s.width-40, s.height/2) ); + sprite->setPosition( Vec2(s.width-40, s.height/2) ); auto rotate = RotateBy::create(2, 360); auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); @@ -115,7 +115,7 @@ SceneTestLayer2::SceneTestLayer2() auto s = Director::getInstance()->getWinSize(); auto sprite = Sprite::create(s_pathGrossini); addChild(sprite); - sprite->setPosition( Vector2(s.width-40, s.height/2) ); + sprite->setPosition( Vec2(s.width-40, s.height/2) ); auto rotate = RotateBy::create(2, 360); auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); @@ -184,7 +184,7 @@ bool SceneTestLayer3::init() auto sprite = Sprite::create(s_pathGrossini); addChild(sprite); - sprite->setPosition( Vector2(s.width/2, 40) ); + sprite->setPosition( Vec2(s.width/2, 40) ); auto rotate = RotateBy::create(2, 360); auto repeat = RepeatForever::create(rotate); sprite->runAction(repeat); diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp index 2706384a6a..cf62c50397 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp @@ -295,7 +295,7 @@ void SchedulerPauseResumeAllUser::onEnter() auto s = Director::getInstance()->getWinSize(); auto sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0, 360))); @@ -413,7 +413,7 @@ void SchedulerUnscheduleAllHard::onEnter() auto s = Director::getInstance()->getWinSize(); auto sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0, 360))); @@ -485,7 +485,7 @@ void SchedulerUnscheduleAllUserLevel::onEnter() auto s = Director::getInstance()->getWinSize(); auto sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); this->addChild(sprite); sprite->runAction(RepeatForever::create(RotateBy::create(3.0, 360))); @@ -846,7 +846,7 @@ void SchedulerTimeScale::onEnter() auto s = Director::getInstance()->getWinSize(); // rotate and jump - auto jump1 = JumpBy::create(4, Vector2(-s.width+80,0), 100, 4); + auto jump1 = JumpBy::create(4, Vec2(-s.width+80,0), 100, 4); auto jump2 = jump1->reverse(); auto rot1 = RotateBy::create(4, 360*2); auto rot2 = rot1->reverse(); @@ -863,9 +863,9 @@ void SchedulerTimeScale::onEnter() auto tamara = Sprite::create("Images/grossinis_sister1.png"); auto kathia = Sprite::create("Images/grossinis_sister2.png"); - grossini->setPosition(Vector2(40,80)); - tamara->setPosition(Vector2(40,80)); - kathia->setPosition(Vector2(40,80)); + grossini->setPosition(Vec2(40,80)); + tamara->setPosition(Vec2(40,80)); + kathia->setPosition(Vec2(40,80)); addChild(grossini); addChild(tamara); @@ -880,7 +880,7 @@ void SchedulerTimeScale::onEnter() addChild(emitter); _sliderCtl = sliderCtl(); - _sliderCtl->setPosition(Vector2(s.width / 2.0f, s.height / 3.0f)); + _sliderCtl->setPosition(Vec2(s.width / 2.0f, s.height / 3.0f)); addChild(_sliderCtl); } @@ -942,7 +942,7 @@ void TwoSchedulers::onEnter() auto s = Director::getInstance()->getWinSize(); // rotate and jump - auto jump1 = JumpBy::create(4, Vector2(0,0), 100, 4); + auto jump1 = JumpBy::create(4, Vec2(0,0), 100, 4); auto jump2 = jump1->reverse(); auto seq = Sequence::create(jump2, jump1, NULL); @@ -953,7 +953,7 @@ void TwoSchedulers::onEnter() // auto grossini = Sprite::create("Images/grossini.png"); addChild(grossini); - grossini->setPosition(Vector2(s.width/2,100)); + grossini->setPosition(Vec2(s.width/2,100)); grossini->runAction(action->clone()); auto defaultScheduler = Director::getInstance()->getScheduler(); @@ -979,7 +979,7 @@ void TwoSchedulers::onEnter() sprite->setActionManager(actionManager1); addChild(sprite); - sprite->setPosition(Vector2(30+15*i,100)); + sprite->setPosition(Vec2(30+15*i,100)); sprite->runAction(action->clone()); } @@ -1004,7 +1004,7 @@ void TwoSchedulers::onEnter() sprite->setActionManager(actionManager2); addChild(sprite); - sprite->setPosition(Vector2(s.width-30-15*i,100)); + sprite->setPosition(Vec2(s.width-30-15*i,100)); sprite->runAction(action->clone()); } @@ -1012,12 +1012,12 @@ void TwoSchedulers::onEnter() sliderCtl1 = sliderCtl(); addChild(sliderCtl1); sliderCtl1->retain(); - sliderCtl1->setPosition(Vector2(s.width / 4.0f, VisibleRect::top().y - 20)); + sliderCtl1->setPosition(Vec2(s.width / 4.0f, VisibleRect::top().y - 20)); sliderCtl2 = sliderCtl(); addChild(sliderCtl2); sliderCtl2->retain(); - sliderCtl2->setPosition(Vector2(s.width / 4.0f*3.0f, VisibleRect::top().y-20)); + sliderCtl2->setPosition(Vec2(s.width / 4.0f*3.0f, VisibleRect::top().y-20)); } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 27dad3df56..c27c9510ab 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -110,8 +110,8 @@ enum }; ShaderNode::ShaderNode() -:_center(Vector2(0.0f, 0.0f)) -,_resolution(Vector2(0.0f, 0.0f)) +:_center(Vec2(0.0f, 0.0f)) +,_resolution(Vec2(0.0f, 0.0f)) ,_time(0.0f) { } @@ -146,13 +146,13 @@ bool ShaderNode::initWithVertex(const std::string &vert, const std::string &frag loadShaderVertex(vert, frag); _time = 0; - _resolution = Vector2(SIZE_X, SIZE_Y); + _resolution = Vec2(SIZE_X, SIZE_Y); getGLProgramState()->setUniformVec2("resolution", _resolution); scheduleUpdate(); setContentSize(Size(SIZE_X, SIZE_Y)); - setAnchorPoint(Vector2(0.5f, 0.5f)); + setAnchorPoint(Vec2(0.5f, 0.5f)); return true; @@ -185,22 +185,22 @@ void ShaderNode::update(float dt) _time += dt; } -void ShaderNode::setPosition(const Vector2 &newPosition) +void ShaderNode::setPosition(const Vec2 &newPosition) { Node::setPosition(newPosition); auto position = getPosition(); - _center = Vector2(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); + _center = Vec2(position.x * CC_CONTENT_SCALE_FACTOR(), position.y * CC_CONTENT_SCALE_FACTOR()); getGLProgramState()->setUniformVec2("center", _center); } -void ShaderNode::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void ShaderNode::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _customCommand.init(_globalZOrder); _customCommand.func = CC_CALLBACK_0(ShaderNode::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } -void ShaderNode::onDraw(const Matrix &transform, bool transformUpdated) +void ShaderNode::onDraw(const Mat4 &transform, bool transformUpdated) { float w = SIZE_X, h = SIZE_Y; GLfloat vertices[12] = {0,0, w,0, w,h, 0,0, 0,h, w,h}; @@ -228,7 +228,7 @@ bool ShaderMonjori::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Monjori.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -262,7 +262,7 @@ bool ShaderMandelbrot::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Mandelbrot.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -295,7 +295,7 @@ bool ShaderJulia::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Julia.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -329,7 +329,7 @@ bool ShaderHeart::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Heart.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -362,7 +362,7 @@ bool ShaderFlower::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Flower.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -395,7 +395,7 @@ bool ShaderPlasma::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/example_Plasma.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); addChild(sn); @@ -430,7 +430,7 @@ public: protected: int _blurRadius; - Vector2 _pixelSize; + Vec2 _pixelSize; int _samplingRadius; //gaussian = cons * exp( (dx*dx + dy*dy) * scale); @@ -474,7 +474,7 @@ bool SpriteBlur::initWithTexture(Texture2D* texture, const Rect& rect) auto s = getTexture()->getContentSizeInPixels(); - _pixelSize = Vector2(1/s.width, 1/s.height); + _pixelSize = Vec2(1/s.width, 1/s.height); _samplingRadius = 0; this->initGLProgram(); @@ -531,7 +531,7 @@ void SpriteBlur::setBlurSize(float f) } log("_blurRadius:%d",_blurRadius); - getGLProgramState()->setUniformVec4("gaussianCoefficient", Vector4(_samplingRadius, _scale, _cons, _weightSum)); + getGLProgramState()->setUniformVec4("gaussianCoefficient", Vec4(_samplingRadius, _scale, _cons, _weightSum)); } // ShaderBlur @@ -556,11 +556,11 @@ ControlSlider* ShaderBlur::createSliderCtl() auto screenSize = Director::getInstance()->getWinSize(); ControlSlider *slider = ControlSlider::create("extensions/sliderTrack.png","extensions/sliderProgress.png" ,"extensions/sliderThumb.png"); - slider->setAnchorPoint(Vector2(0.5f, 1.0f)); + slider->setAnchorPoint(Vec2(0.5f, 1.0f)); slider->setMinimumValue(0.0f); // Sets the min value of range slider->setMaximumValue(25.0f); // Sets the max value of range - slider->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 3.0f)); + slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 3.0f)); // When the value of the slider will change, the given selector will be call slider->addTargetWithActionForControlEvents(this, cccontrol_selector(ShaderBlur::sliderAction), Control::EventType::VALUE_CHANGED); @@ -579,8 +579,8 @@ bool ShaderBlur::init() auto sprite = Sprite::create("Images/grossini.png"); auto s = Director::getInstance()->getWinSize(); - _blurSprite->setPosition(Vector2(s.width/3, s.height/2)); - sprite->setPosition(Vector2(2*s.width/3, s.height/2)); + _blurSprite->setPosition(Vec2(s.width/3, s.height/2)); + sprite->setPosition(Vec2(2*s.width/3, s.height/2)); addChild(_blurSprite); addChild(sprite); @@ -620,10 +620,10 @@ bool ShaderRetroEffect::init() auto s = director->getWinSize(); _label = Label::createWithBMFont("fonts/west_england-64.fnt","RETRO EFFECT"); - _label->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + _label->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _label->setGLProgram(p); - _label->setPosition(Vector2(s.width/2,s.height/2)); + _label->setPosition(Vec2(s.width/2,s.height/2)); addChild(_label); @@ -642,7 +642,7 @@ void ShaderRetroEffect::update(float dt) { auto sprite = _label->getLetter(i); auto oldPosition = sprite->getPosition(); - sprite->setPosition(Vector2( oldPosition.x, sinf( _accum * 2 + i/2.0) * 20 )); + sprite->setPosition(Vec2( oldPosition.x, sinf( _accum * 2 + i/2.0) * 20 )); // add fabs() to prevent negative scaling float scaleY = ( sinf( _accum * 2 + i/2.0 + 0.707) ); @@ -684,7 +684,7 @@ bool ShaderLensFlare::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/shadertoy_LensFlare.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); sn->setContentSize(Size(s.width/2,s.height/2)); addChild(sn); @@ -719,7 +719,7 @@ bool ShaderGlow::init() auto sn = ShaderNode::shaderNodeWithVertex("", "Shaders/shadertoy_Glow.fsh"); auto s = Director::getInstance()->getWinSize(); - sn->setPosition(Vector2(s.width/2, s.height/2)); + sn->setPosition(Vec2(s.width/2, s.height/2)); sn->setContentSize(Size(s.width/2,s.height/2)); addChild(sn); @@ -758,7 +758,7 @@ bool ShaderMultiTexture::init() addChild(sprite); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); auto glprogram = GLProgram::createWithFilenames("Shaders/example_MultiTexture.vsh", "Shaders/example_MultiTexture.fsh"); auto glprogramstate = GLProgramState::getOrCreateWithGLProgram(glprogram); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index 3a58be9ed8..1c55fd4b3b 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -116,8 +116,8 @@ public: static ShaderNode* shaderNodeWithVertex(const std::string &vert, const std::string &frag); virtual void update(float dt); - virtual void setPosition(const Vector2 &newPosition); - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void setPosition(const Vec2 &newPosition); + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: ShaderNode(); @@ -126,10 +126,10 @@ protected: bool initWithVertex(const std::string &vert, const std::string &frag); void loadShaderVertex(const std::string &vert, const std::string &frag); - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); - Vector2 _center; - Vector2 _resolution; + Vec2 _center; + Vec2 _resolution; float _time; std::string _vertFileName; std::string _fragFileName; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 73d4bce1d9..0ce1c8b22b 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -170,7 +170,7 @@ protected: bool init(float blurSize); int _blurRadius; - Vector2 _pixelSize; + Vec2 _pixelSize; int _samplingRadius; float _scale; @@ -196,13 +196,13 @@ bool EffectBlur::init(float blurSize) auto s = Size(100,100); _blurRadius = 0; - _pixelSize = Vector2(1/s.width, 1/s.height); + _pixelSize = Vec2(1/s.width, 1/s.height); _samplingRadius = 0; setBlurSize(blurSize); _glprogramstate->setUniformVec2("onePixelSize", _pixelSize); - _glprogramstate->setUniformVec4("gaussianCoefficient", Vector4(_samplingRadius, _scale, _cons, _weightSum)); + _glprogramstate->setUniformVec4("gaussianCoefficient", Vec4(_samplingRadius, _scale, _cons, _weightSum)); return true; } @@ -380,7 +380,7 @@ protected: virtual void setCustomUniforms() override; int _blurRadius; - Vector2 _pixelSize; + Vec2 _pixelSize; int _samplingRadius; float _scale; @@ -397,14 +397,14 @@ void BlurSprite::setCustomUniforms() { auto s = getTexture()->getContentSizeInPixels(); _blurRadius = 0; - _pixelSize = Vector2(1/s.width, 1/s.height); + _pixelSize = Vec2(1/s.width, 1/s.height); _samplingRadius = 0; setBlurSize(3.0f); auto programState = getGLProgramState(); programState->setUniformVec2("onePixelSize", _pixelSize); - programState->setUniformVec4("gaussianCoefficient", Vector4(_samplingRadius, _scale, _cons, _weightSum)); + programState->setUniformVec4("gaussianCoefficient", Vec4(_samplingRadius, _scale, _cons, _weightSum)); } void BlurSprite::setBlurSize(float f) @@ -463,7 +463,7 @@ void NoiseSprite::setCustomUniforms() { _resolution[0] = getTexture()->getContentSizeInPixels().width; _resolution[1] = getTexture()->getContentSizeInPixels().height; - getGLProgramState()->setUniformVec2("resolution", Vector2(_resolution[0],_resolution[1])); + getGLProgramState()->setUniformVec2("resolution", Vec2(_resolution[0],_resolution[1])); } class EdgeDetectionSprite : public ShaderSprite, public ShaderSpriteCreator @@ -490,7 +490,7 @@ void EdgeDetectionSprite::setCustomUniforms() _resolution[0] = getContentSize().width; _resolution[1] = getContentSize().height; - programState->setUniformVec2("resolution", Vector2(_resolution[0], _resolution[1])); + programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); } class BloomSprite : public ShaderSprite, public ShaderSpriteCreator @@ -538,7 +538,7 @@ void CelShadingSprite::setCustomUniforms() _resolution[0] = getContentSize().width; _resolution[1] = getContentSize().height; - programState->setUniformVec2("resolution", Vector2(_resolution[0], _resolution[1])); + programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); } class LensFlareSprite : public ShaderSprite, public ShaderSpriteCreator @@ -568,8 +568,8 @@ void LensFlareSprite::setCustomUniforms() _resolution[0] = getContentSize().width; _resolution[1] = getContentSize().height; - programState->setUniformVec2("resolution", Vector2(_resolution[0], _resolution[1])); - programState->setUniformVec2("textureResolution", Vector2(_textureResolution[0], _textureResolution[1])); + programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); + programState->setUniformVec2("textureResolution", Vec2(_textureResolution[0], _textureResolution[1])); } NormalSpriteTest::NormalSpriteTest() @@ -578,7 +578,7 @@ NormalSpriteTest::NormalSpriteTest() { auto s = Director::getInstance()->getWinSize(); NormalSprite* sprite = NormalSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vector2(s.width/2, s.height/2)); + sprite->setPosition(Vec2(s.width/2, s.height/2)); addChild(sprite); } @@ -590,9 +590,9 @@ GreyScaleSpriteTest::GreyScaleSpriteTest() { auto s = Director::getInstance()->getWinSize(); GreyScaleSprite* sprite = GreyScaleSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -605,9 +605,9 @@ BlurSpriteTest::BlurSpriteTest() { auto s = Director::getInstance()->getWinSize(); BlurSprite* sprite = BlurSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -620,9 +620,9 @@ NoiseSpriteTest::NoiseSpriteTest() { auto s = Director::getInstance()->getWinSize(); NoiseSprite* sprite = NoiseSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -634,9 +634,9 @@ EdgeDetectionSpriteTest::EdgeDetectionSpriteTest() { auto s = Director::getInstance()->getWinSize(); EdgeDetectionSprite* sprite = EdgeDetectionSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -648,9 +648,9 @@ BloomSpriteTest::BloomSpriteTest() { auto s = Director::getInstance()->getWinSize(); BloomSprite* sprite = BloomSprite::createSprite("Images/stone.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/stone.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -662,9 +662,9 @@ CelShadingSpriteTest::CelShadingSpriteTest() { auto s = Director::getInstance()->getWinSize(); CelShadingSprite* sprite = CelShadingSprite::createSprite("Images/stone.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/stone.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -678,7 +678,7 @@ LensFlareSpriteTest::LensFlareSpriteTest() LensFlareSprite* sprite = LensFlareSprite::createSprite("Images/noise.png"); Rect rect = Rect::ZERO; rect.size = Size(480,320); - sprite->setPosition(Vector2(s.width * 0.5, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.5, s.height/2)); addChild(sprite); } } @@ -704,7 +704,7 @@ OutlineSprite::OutlineSprite() void OutlineSprite::setCustomUniforms() { - Vector3 color(1.0, 0.2, 0.3); + Vec3 color(1.0, 0.2, 0.3); GLfloat radius = 0.01; GLfloat threshold = 1.75; @@ -721,9 +721,9 @@ OutlineShadingSpriteTest::OutlineShadingSpriteTest() if (ShaderTestDemo2::init()) { auto s = Director::getInstance()->getWinSize(); OutlineSprite* sprite = OutlineSprite::createSprite("Images/grossini_dance_10.png"); - sprite->setPosition(Vector2(s.width * 0.75, s.height/2)); + sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); auto sprite2 = Sprite::create("Images/grossini_dance_10.png"); - sprite2->setPosition(Vector2(s.width * 0.25, s.height/2)); + sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); addChild(sprite); addChild(sprite2); } @@ -735,10 +735,10 @@ EffectSprite_Blur::EffectSprite_Blur() if (ShaderTestDemo2::init()) { auto s = Director::getInstance()->getWinSize(); EffectSprite* sprite = EffectSprite::create("Images/grossini.png"); - sprite->setPosition(Vector2(0, s.height/2)); + sprite->setPosition(Vec2(0, s.height/2)); addChild(sprite); - auto jump = JumpBy::create(4, Vector2(s.width,0), 100, 4); + auto jump = JumpBy::create(4, Vec2(s.width,0), 100, 4); auto rot = RotateBy::create(4, 720); auto spawn = Spawn::create(jump, rot, NULL); auto rev = spawn->reverse(); diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp index 5e2a0940be..4b57f848f4 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp @@ -70,7 +70,7 @@ bool SpineTestLayer::init () { NULL))); Size windowSize = Director::getInstance()->getWinSize(); - skeletonNode->setPosition(Vector2(windowSize.width / 2, 20)); + skeletonNode->setPosition(Vec2(windowSize.width / 2, 20)); addChild(skeletonNode); scheduleUpdate(); diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index cee3b33ac0..adb3919372 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -230,10 +230,10 @@ Sprite1::Sprite1() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto s = Director::getInstance()->getWinSize(); - addNewSpriteWithCoords( Vector2(s.width/2, s.height/2) ); + addNewSpriteWithCoords( Vec2(s.width/2, s.height/2) ); } -void Sprite1::addNewSpriteWithCoords(Vector2 p) +void Sprite1::addNewSpriteWithCoords(Vec2 p) { int idx = (int)(CCRANDOM_0_1() * 1400.0f / 100.0f); int x = (idx%5) * 85; @@ -243,7 +243,7 @@ void Sprite1::addNewSpriteWithCoords(Vector2 p) auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(x,y,85,121) ); addChild( sprite ); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -300,10 +300,10 @@ SpriteBatchNode1::SpriteBatchNode1() addChild(BatchNode, 0, kTagSpriteBatchNode); auto s = Director::getInstance()->getWinSize(); - addNewSpriteWithCoords( Vector2(s.width/2, s.height/2) ); + addNewSpriteWithCoords( Vec2(s.width/2, s.height/2) ); } -void SpriteBatchNode1::addNewSpriteWithCoords(Vector2 p) +void SpriteBatchNode1::addNewSpriteWithCoords(Vec2 p) { auto BatchNode = static_cast( getChildByTag(kTagSpriteBatchNode) ); @@ -315,7 +315,7 @@ void SpriteBatchNode1::addNewSpriteWithCoords(Vector2 p) auto sprite = Sprite::createWithTexture(BatchNode->getTexture(), Rect(x,y,85,121)); BatchNode->addChild(sprite); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -378,14 +378,14 @@ SpriteColorOpacity::SpriteColorOpacity() auto sprite8 = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*3, 121*1, 85, 121)); auto s = Director::getInstance()->getWinSize(); - sprite1->setPosition( Vector2( (s.width/5)*1, (s.height/3)*1) ); - sprite2->setPosition( Vector2( (s.width/5)*2, (s.height/3)*1) ); - sprite3->setPosition( Vector2( (s.width/5)*3, (s.height/3)*1) ); - sprite4->setPosition( Vector2( (s.width/5)*4, (s.height/3)*1) ); - sprite5->setPosition( Vector2( (s.width/5)*1, (s.height/3)*2) ); - sprite6->setPosition( Vector2( (s.width/5)*2, (s.height/3)*2) ); - sprite7->setPosition( Vector2( (s.width/5)*3, (s.height/3)*2) ); - sprite8->setPosition( Vector2( (s.width/5)*4, (s.height/3)*2) ); + sprite1->setPosition( Vec2( (s.width/5)*1, (s.height/3)*1) ); + sprite2->setPosition( Vec2( (s.width/5)*2, (s.height/3)*1) ); + sprite3->setPosition( Vec2( (s.width/5)*3, (s.height/3)*1) ); + sprite4->setPosition( Vec2( (s.width/5)*4, (s.height/3)*1) ); + sprite5->setPosition( Vec2( (s.width/5)*1, (s.height/3)*2) ); + sprite6->setPosition( Vec2( (s.width/5)*2, (s.height/3)*2) ); + sprite7->setPosition( Vec2( (s.width/5)*3, (s.height/3)*2) ); + sprite8->setPosition( Vec2( (s.width/5)*4, (s.height/3)*2) ); auto action = FadeIn::create(2); auto action_back = action->reverse(); @@ -469,14 +469,14 @@ SpriteBatchNodeColorOpacity::SpriteBatchNodeColorOpacity() auto s = Director::getInstance()->getWinSize(); - sprite1->setPosition( Vector2( (s.width/5)*1, (s.height/3)*1) ); - sprite2->setPosition( Vector2( (s.width/5)*2, (s.height/3)*1) ); - sprite3->setPosition( Vector2( (s.width/5)*3, (s.height/3)*1) ); - sprite4->setPosition( Vector2( (s.width/5)*4, (s.height/3)*1) ); - sprite5->setPosition( Vector2( (s.width/5)*1, (s.height/3)*2) ); - sprite6->setPosition( Vector2( (s.width/5)*2, (s.height/3)*2) ); - sprite7->setPosition( Vector2( (s.width/5)*3, (s.height/3)*2) ); - sprite8->setPosition( Vector2( (s.width/5)*4, (s.height/3)*2) ); + sprite1->setPosition( Vec2( (s.width/5)*1, (s.height/3)*1) ); + sprite2->setPosition( Vec2( (s.width/5)*2, (s.height/3)*1) ); + sprite3->setPosition( Vec2( (s.width/5)*3, (s.height/3)*1) ); + sprite4->setPosition( Vec2( (s.width/5)*4, (s.height/3)*1) ); + sprite5->setPosition( Vec2( (s.width/5)*1, (s.height/3)*2) ); + sprite6->setPosition( Vec2( (s.width/5)*2, (s.height/3)*2) ); + sprite7->setPosition( Vec2( (s.width/5)*3, (s.height/3)*2) ); + sprite8->setPosition( Vec2( (s.width/5)*4, (s.height/3)*2) ); auto action = FadeIn::create(2); auto action_back = action->reverse(); @@ -556,20 +556,20 @@ SpriteZOrder::SpriteZOrder() for(int i=0;i<5;i++) { auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*0, 121*1, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); addChild(sprite, i); } for(int i=5;i<10;i++) { auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*0, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); addChild(sprite, 14-i); } auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*3, 121*0, 85, 121)); addChild(sprite, -1, kTagSprite1); - sprite->setPosition( Vector2(s.width/2, s.height/2 - 20) ); + sprite->setPosition( Vec2(s.width/2, s.height/2 - 20) ); sprite->setScaleX( 6 ); sprite->setColor(Color3B::RED); @@ -624,20 +624,20 @@ SpriteBatchNodeZOrder::SpriteBatchNodeZOrder() for(int i=0;i<5;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*0, 121*1, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); batch->addChild(sprite, i); } for(int i=5;i<10;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*0, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); batch->addChild(sprite, 14-i); } auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*3, 121*0, 85, 121)); batch->addChild(sprite, -1, kTagSprite1); - sprite->setPosition( Vector2(s.width/2, s.height/2 - 20) ); + sprite->setPosition( Vec2(s.width/2, s.height/2 - 20) ); sprite->setScaleX( 6 ); sprite->setColor(Color3B::RED); @@ -748,7 +748,7 @@ SpriteBatchNodeReorderIssue744::SpriteBatchNodeReorderIssue744() addChild(batch, 0, kTagSpriteBatchNode); auto sprite = Sprite::createWithTexture(batch->getTexture(),Rect(0, 0, 85, 121)); - sprite->setPosition( Vector2(s.width/2, s.height/2) ); + sprite->setPosition( Vec2(s.width/2, s.height/2) ); batch->addChild(sprite, 3); batch->reorderChild(sprite, 1); } @@ -799,13 +799,13 @@ SpriteBatchNodeReorderIssue766::SpriteBatchNodeReorderIssue766() addChild(batchNode, 1, 0); sprite1 = makeSpriteZ(2); - sprite1->setPosition(Vector2(200,160)); + sprite1->setPosition(Vec2(200,160)); sprite2 = makeSpriteZ(3); - sprite2->setPosition(Vector2(264,160)); + sprite2->setPosition(Vec2(264,160)); sprite3 = makeSpriteZ(4); - sprite3->setPosition(Vector2(328,160)); + sprite3->setPosition(Vec2(328,160)); schedule(schedule_selector(SpriteBatchNodeReorderIssue766::reorderSprite), 2); } @@ -841,20 +841,20 @@ SpriteBatchNodeReorderIssue767::SpriteBatchNodeReorderIssue767() // parent l1 = Sprite::createWithSpriteFrameName("father.gif"); - l1->setPosition(Vector2( s.width/2, s.height/2)); + l1->setPosition(Vec2( s.width/2, s.height/2)); aParent->addChild(l1, 0, kTagSprite2); auto l1Size = l1->getContentSize(); // child left l2a = Sprite::createWithSpriteFrameName("sister1.gif"); - l2a->setPosition(Vector2( -25 + l1Size.width/2, 0 + l1Size.height/2)); + l2a->setPosition(Vec2( -25 + l1Size.width/2, 0 + l1Size.height/2)); l1->addChild(l2a, -1, kTagSpriteLeft); auto l2aSize = l2a->getContentSize(); // child right l2b = Sprite::createWithSpriteFrameName("sister2.gif"); - l2b->setPosition(Vector2( +25 + l1Size.width/2, 0 + l1Size.height/2)); + l2b->setPosition(Vec2( +25 + l1Size.width/2, 0 + l1Size.height/2)); l1->addChild(l2b, 1, kTagSpriteRight); auto l2bSize = l2a->getContentSize(); @@ -862,25 +862,25 @@ SpriteBatchNodeReorderIssue767::SpriteBatchNodeReorderIssue767() // child left bottom l3a1 = Sprite::createWithSpriteFrameName("child1.gif"); l3a1->setScale(0.65f); - l3a1->setPosition(Vector2(0+l2aSize.width/2,-50+l2aSize.height/2)); + l3a1->setPosition(Vec2(0+l2aSize.width/2,-50+l2aSize.height/2)); l2a->addChild(l3a1, -1); // child left top l3a2 = Sprite::createWithSpriteFrameName("child1.gif"); l3a2->setScale(0.65f); - l3a2->setPosition(Vector2(0+l2aSize.width/2,+50+l2aSize.height/2)); + l3a2->setPosition(Vec2(0+l2aSize.width/2,+50+l2aSize.height/2)); l2a->addChild(l3a2, 1); // child right bottom l3b1 = Sprite::createWithSpriteFrameName("child1.gif"); l3b1->setScale(0.65f); - l3b1->setPosition(Vector2(0+l2bSize.width/2,-50+l2bSize.height/2)); + l3b1->setPosition(Vec2(0+l2bSize.width/2,-50+l2bSize.height/2)); l2b->addChild(l3b1, -1); // child right top l3b2 = Sprite::createWithSpriteFrameName("child1.gif"); l3b2->setScale(0.65f); - l3b2->setPosition(Vector2(0+l2bSize.width/2,+50+l2bSize.height/2)); + l3b2->setPosition(Vec2(0+l2bSize.width/2,+50+l2bSize.height/2)); l2b->addChild(l3b2, 1); schedule(schedule_selector(SpriteBatchNodeReorderIssue767::reorderSprites), 1); @@ -965,15 +965,15 @@ SpriteZVertex::SpriteZVertex() auto node = Node::create(); // camera uses the center of the image as the pivoting point node->setContentSize( Size(s.width,s.height) ); - node->setAnchorPoint( Vector2::ANCHOR_MIDDLE); - node->setPosition( Vector2(s.width/2, s.height/2)); + node->setAnchorPoint( Vec2::ANCHOR_MIDDLE); + node->setPosition( Vec2(s.width/2, s.height/2)); addChild(node, 0); for(int i=0;i<5;i++) { auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*0, 121*1, 85, 121)); - sprite->setPosition( Vector2((i+1)*step, s.height/2) ); + sprite->setPosition( Vec2((i+1)*step, s.height/2) ); sprite->setPositionZ( 10 + i*40 ); sprite->setGLProgram(alphaTestShader); node->addChild(sprite, 0); @@ -983,7 +983,7 @@ SpriteZVertex::SpriteZVertex() for(int i=5;i<11;i++) { auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*0, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); sprite->setPositionZ( 10 + (10-i)*40 ); sprite->setGLProgram(alphaTestShader); node->addChild(sprite, 0); @@ -1053,8 +1053,8 @@ SpriteBatchNodeZVertex::SpriteBatchNodeZVertex() auto batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 1); // camera uses the center of the image as the pivoting point batch->setContentSize( Size(s.width,s.height)); - batch->setAnchorPoint( Vector2::ANCHOR_MIDDLE); - batch->setPosition( Vector2(s.width/2, s.height/2)); + batch->setAnchorPoint( Vec2::ANCHOR_MIDDLE); + batch->setPosition( Vec2(s.width/2, s.height/2)); batch->setGLProgram(alphaTestShader); addChild(batch, 0, kTagSpriteBatchNode); @@ -1062,7 +1062,7 @@ SpriteBatchNodeZVertex::SpriteBatchNodeZVertex() for(int i=0;i<5;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*0, 121*1, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); sprite->setPositionZ( 10 + i*40 ); batch->addChild(sprite, 0); @@ -1070,7 +1070,7 @@ SpriteBatchNodeZVertex::SpriteBatchNodeZVertex() for(int i=5;i<11;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*0, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); sprite->setPositionZ( 10 + (10-i)*40 ); batch->addChild(sprite, 0); } @@ -1105,7 +1105,7 @@ SpriteAnchorPoint::SpriteAnchorPoint() for(int i=0;i<3;i++) { auto sprite = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*i, 121*1, 85, 121) ); - sprite->setPosition( Vector2( s.width/4*(i+1), s.height/2) ); + sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2) ); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -1115,13 +1115,13 @@ SpriteAnchorPoint::SpriteAnchorPoint() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -1162,7 +1162,7 @@ SpriteBatchNodeAnchorPoint::SpriteBatchNodeAnchorPoint() for(int i=0;i<3;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*i, 121*1, 85, 121)); - sprite->setPosition( Vector2( s.width/4*(i+1), s.height/2) ); + sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2) ); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -1172,13 +1172,13 @@ SpriteBatchNodeAnchorPoint::SpriteBatchNodeAnchorPoint() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -1216,7 +1216,7 @@ Sprite6::Sprite6() auto s = Director::getInstance()->getWinSize(); - batch->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + batch->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); batch->setContentSize( Size(s.width, s.height) ); @@ -1239,7 +1239,7 @@ Sprite6::Sprite6() for(int i=0;i<3;i++) { auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*i, 121*1, 85, 121)); - sprite->setPosition( Vector2( (i+1)*step, s.height/2) ); + sprite->setPosition( Vec2( (i+1)*step, s.height/2) ); sprite->runAction( action->clone()); batch->addChild(sprite, i); @@ -1264,11 +1264,11 @@ SpriteFlip::SpriteFlip() auto s = Director::getInstance()->getWinSize(); auto sprite1 = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*1, 85, 121)); - sprite1->setPosition( Vector2( s.width/2 - 100, s.height/2 ) ); + sprite1->setPosition( Vec2( s.width/2 - 100, s.height/2 ) ); addChild(sprite1, 0, kTagSprite1); auto sprite2 = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*1, 85, 121)); - sprite2->setPosition( Vector2( s.width/2 + 100, s.height/2 ) ); + sprite2->setPosition( Vec2( s.width/2 + 100, s.height/2 ) ); addChild(sprite2, 0, kTagSprite2); schedule( schedule_selector(SpriteFlip::flipSprites), 1); @@ -1312,11 +1312,11 @@ SpriteBatchNodeFlip::SpriteBatchNodeFlip() auto s = Director::getInstance()->getWinSize(); auto sprite1 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121)); - sprite1->setPosition( Vector2( s.width/2 - 100, s.height/2 ) ); + sprite1->setPosition( Vec2( s.width/2 - 100, s.height/2 ) ); batch->addChild(sprite1, 0, kTagSprite1); auto sprite2 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121)); - sprite2->setPosition( Vector2( s.width/2 + 100, s.height/2 ) ); + sprite2->setPosition( Vec2( s.width/2 + 100, s.height/2 ) ); batch->addChild(sprite2, 0, kTagSprite2); schedule( schedule_selector(SpriteBatchNodeFlip::flipSprites), 1); @@ -1359,11 +1359,11 @@ SpriteAliased::SpriteAliased() auto s = Director::getInstance()->getWinSize(); auto sprite1 = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*1, 85, 121)); - sprite1->setPosition( Vector2( s.width/2 - 100, s.height/2 ) ); + sprite1->setPosition( Vec2( s.width/2 - 100, s.height/2 ) ); addChild(sprite1, 0, kTagSprite1); auto sprite2 = Sprite::create("Images/grossini_dance_atlas.png", Rect(85*1, 121*1, 85, 121)); - sprite2->setPosition( Vector2( s.width/2 + 100, s.height/2 ) ); + sprite2->setPosition( Vec2( s.width/2 + 100, s.height/2 ) ); addChild(sprite2, 0, kTagSprite2); auto scale = ScaleBy::create(2, 5); @@ -1424,11 +1424,11 @@ SpriteBatchNodeAliased::SpriteBatchNodeAliased() auto s = Director::getInstance()->getWinSize(); auto sprite1 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121)); - sprite1->setPosition( Vector2( s.width/2 - 100, s.height/2 ) ); + sprite1->setPosition( Vec2( s.width/2 - 100, s.height/2 ) ); batch->addChild(sprite1, 0, kTagSprite1); auto sprite2 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121)); - sprite2->setPosition( Vector2( s.width/2 + 100, s.height/2 ) ); + sprite2->setPosition( Vec2( s.width/2 + 100, s.height/2 ) ); batch->addChild(sprite2, 0, kTagSprite2); auto scale = ScaleBy::create(2, 5); @@ -1504,7 +1504,7 @@ void SpriteNewTexture::addNewSprite() { auto s = Director::getInstance()->getWinSize(); - auto p = Vector2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); int idx = CCRANDOM_0_1() * 1400 / 100; int x = (idx%5) * 85; @@ -1515,7 +1515,7 @@ void SpriteNewTexture::addNewSprite() auto sprite = Sprite::createWithTexture(_texture1, Rect(x,y,85,121)); node->addChild(sprite); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -1609,7 +1609,7 @@ void SpriteBatchNodeNewTexture::addNewSprite() { auto s = Director::getInstance()->getWinSize(); - auto p = Vector2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); + auto p = Vec2( CCRANDOM_0_1() * s.width, CCRANDOM_0_1() * s.height); auto batch = static_cast( getChildByTag( kTagSpriteBatchNode ) ); @@ -1621,7 +1621,7 @@ void SpriteBatchNodeNewTexture::addNewSprite() auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(x,y,85,121)); batch->addChild(sprite); - sprite->setPosition( Vector2( p.x, p.y) ); + sprite->setPosition( Vec2( p.x, p.y) ); ActionInterval* action; float random = CCRANDOM_0_1(); @@ -1686,7 +1686,7 @@ void SpriteFrameTest::onEnter() // Animation using Sprite BatchNode // _sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - _sprite1->setPosition( Vector2( s.width/2-80, s.height/2) ); + _sprite1->setPosition( Vec2( s.width/2-80, s.height/2) ); auto spritebatch = SpriteBatchNode::create("animations/grossini.png"); spritebatch->addChild(_sprite1); @@ -1713,7 +1713,7 @@ void SpriteFrameTest::onEnter() // Animation using standard Sprite // _sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - _sprite2->setPosition( Vector2( s.width/2 + 80, s.height/2) ); + _sprite2->setPosition( Vec2( s.width/2 + 80, s.height/2) ); addChild(_sprite2); @@ -1842,7 +1842,7 @@ void SpriteFrameAliasNameTest::onEnter() // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width * 0.5f, s.height * 0.5f)); + sprite->setPosition(Vec2(s.width * 0.5f, s.height * 0.5f)); auto spriteBatch = SpriteBatchNode::create("animations/grossini-aliases.png"); spriteBatch->addChild(sprite); @@ -1897,7 +1897,7 @@ SpriteOffsetAnchorRotation::SpriteOffsetAnchorRotation() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2( s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2( s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -1907,13 +1907,13 @@ SpriteOffsetAnchorRotation::SpriteOffsetAnchorRotation() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -1979,7 +1979,7 @@ SpriteBatchNodeOffsetAnchorRotation::SpriteBatchNodeOffsetAnchorRotation() // Animation using Sprite BatchNode // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition( Vector2( s.width/4*(i+1), s.height/2)); + sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -1989,13 +1989,13 @@ SpriteBatchNodeOffsetAnchorRotation::SpriteBatchNodeOffsetAnchorRotation() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -2058,7 +2058,7 @@ SpriteOffsetAnchorScale::SpriteOffsetAnchorScale() // Animation using Sprite BatchNode // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition( Vector2( s.width/4*(i+1), s.height/2) ); + sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2) ); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -2068,13 +2068,13 @@ SpriteOffsetAnchorScale::SpriteOffsetAnchorScale() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -2141,7 +2141,7 @@ SpriteBatchNodeOffsetAnchorScale::SpriteBatchNodeOffsetAnchorScale() // Animation using Sprite BatchNode // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition( Vector2( s.width/4*(i+1), s.height/2) ); + sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2) ); auto point = Sprite::create("Images/r1.png"); point->setScale( 0.25f ); @@ -2150,13 +2150,13 @@ SpriteBatchNodeOffsetAnchorScale::SpriteBatchNodeOffsetAnchorScale() switch(i) { case 0: - sprite->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); break; case 1: - sprite->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); break; case 2: - sprite->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -2227,7 +2227,7 @@ SpriteAnimationSplit::SpriteAnimationSplit() // Animation using Sprite BatchNode // auto sprite = Sprite::createWithSpriteFrame(frame0); - sprite->setPosition( Vector2( s.width/2-80, s.height/2) ); + sprite->setPosition( Vec2( s.width/2-80, s.height/2) ); addChild(sprite); Vector animFrames(6); @@ -2301,7 +2301,7 @@ SpriteHybrid::SpriteHybrid() x = CCRANDOM_0_1() * s.width; y = CCRANDOM_0_1() * s.height; } - sprite->setPosition( Vector2(x,y) ); + sprite->setPosition( Vec2(x,y) ); auto action = RotateBy::create(4, 360); sprite->runAction( RepeatForever::create(action) ); @@ -2369,13 +2369,13 @@ SpriteBatchNodeChildren::SpriteBatchNodeChildren() SpriteFrameCache::getInstance()->addSpriteFramesWithFile("animations/grossini.plist"); auto sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2( s.width/3, s.height/2)); + sprite1->setPosition(Vec2( s.width/3, s.height/2)); auto sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(50,50)); + sprite2->setPosition(Vec2(50,50)); auto sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-50,-50)); + sprite3->setPosition(Vec2(-50,-50)); batch->addChild(sprite1); sprite1->addChild(sprite2); @@ -2395,7 +2395,7 @@ SpriteBatchNodeChildren::SpriteBatchNodeChildren() sprite1->runAction(RepeatForever::create( Animate::create(animation) ) ); // END NEW CODE - auto action = MoveBy::create(2, Vector2(200,0)); + auto action = MoveBy::create(2, Vec2(200,0)); auto action_back = action->reverse(); auto action_rot = RotateBy::create(2, 360); auto action_s = ScaleBy::create(2, 2); @@ -2442,13 +2442,13 @@ SpriteBatchNodeChildrenZ::SpriteBatchNodeChildrenZ() addChild(batch, 0, kTagSpriteBatchNode); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2( s.width/3, s.height/2)); + sprite1->setPosition(Vec2( s.width/3, s.height/2)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); batch->addChild(sprite1); sprite1->addChild(sprite2, 2); @@ -2459,13 +2459,13 @@ SpriteBatchNodeChildrenZ::SpriteBatchNodeChildrenZ() addChild(batch, 0, kTagSpriteBatchNode); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2( 2*s.width/3, s.height/2)); + sprite1->setPosition(Vec2( 2*s.width/3, s.height/2)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); batch->addChild(sprite1); sprite1->addChild(sprite2, -2); @@ -2476,13 +2476,13 @@ SpriteBatchNodeChildrenZ::SpriteBatchNodeChildrenZ() addChild(batch, 0, kTagSpriteBatchNode); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2( s.width/2 - 90, s.height/4)); + sprite1->setPosition(Vec2( s.width/2 - 90, s.height/4)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2( s.width/2 - 60,s.height/4)); + sprite2->setPosition(Vec2( s.width/2 - 60,s.height/4)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2( s.width/2 - 30, s.height/4)); + sprite3->setPosition(Vec2( s.width/2 - 30, s.height/4)); batch->addChild(sprite1, 10); batch->addChild(sprite2, -10); @@ -2493,13 +2493,13 @@ SpriteBatchNodeChildrenZ::SpriteBatchNodeChildrenZ() addChild(batch, 0, kTagSpriteBatchNode); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2( s.width/2 +30, s.height/4)); + sprite1->setPosition(Vec2( s.width/2 +30, s.height/4)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2( s.width/2 +60,s.height/4)); + sprite2->setPosition(Vec2( s.width/2 +60,s.height/4)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2( s.width/2 +90, s.height/4)); + sprite3->setPosition(Vec2( s.width/2 +90, s.height/4)); batch->addChild(sprite1, -10); batch->addChild(sprite2, -5); @@ -2536,19 +2536,19 @@ SpriteChildrenVisibility::SpriteChildrenVisibility() // // parents aParent = SpriteBatchNode::create("animations/grossini.png", 50); - aParent->setPosition( Vector2(s.width/3, s.height/2) ); + aParent->setPosition( Vec2(s.width/3, s.height/2) ); addChild(aParent, 0); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2(0,0)); + sprite1->setPosition(Vec2(0,0)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); aParent->addChild(sprite1); sprite1->addChild(sprite2, -2); @@ -2560,17 +2560,17 @@ SpriteChildrenVisibility::SpriteChildrenVisibility() // Sprite // aParent = Node::create(); - aParent->setPosition( Vector2(2*s.width/3, s.height/2) ); + aParent->setPosition( Vec2(2*s.width/3, s.height/2) ); addChild(aParent, 0); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2(0,0)); + sprite1->setPosition(Vec2(0,0)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); aParent->addChild(sprite1); sprite1->addChild(sprite2, -2); @@ -2608,17 +2608,17 @@ SpriteChildrenVisibilityIssue665::SpriteChildrenVisibilityIssue665() // // parents aParent = SpriteBatchNode::create("animations/grossini.png", 50); - aParent->setPosition(Vector2(s.width/3, s.height/2)); + aParent->setPosition(Vec2(s.width/3, s.height/2)); addChild(aParent, 0); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2(0,0)); + sprite1->setPosition(Vec2(0,0)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); // test issue #665 sprite1->setVisible(false); @@ -2631,17 +2631,17 @@ SpriteChildrenVisibilityIssue665::SpriteChildrenVisibilityIssue665() // Sprite // aParent = Node::create(); - aParent->setPosition(Vector2(2*s.width/3, s.height/2)); + aParent->setPosition(Vec2(2*s.width/3, s.height/2)); addChild(aParent, 0); sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite1->setPosition(Vector2(0,0)); + sprite1->setPosition(Vec2(0,0)); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); // test issue #665 sprite1->setVisible(false); @@ -2689,18 +2689,18 @@ SpriteChildrenAnchorPoint::SpriteChildrenAnchorPoint() // anchor (0,0) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/4,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite1->setPosition(Vec2(s.width/4,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); @@ -2717,17 +2717,17 @@ SpriteChildrenAnchorPoint::SpriteChildrenAnchorPoint() // anchor (0.5, 0.5) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/2,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite1->setPosition(Vec2(s.width/2,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); aParent->addChild(sprite1); @@ -2743,18 +2743,18 @@ SpriteChildrenAnchorPoint::SpriteChildrenAnchorPoint() // anchor (1,1) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/2+s.width/4,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite1->setPosition(Vec2(s.width/2+s.width/4,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); aParent->addChild(sprite1); @@ -2807,17 +2807,17 @@ SpriteBatchNodeChildrenAnchorPoint::SpriteBatchNodeChildrenAnchorPoint() // anchor (0,0) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/4,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_BOTTOM_LEFT ); + sprite1->setPosition(Vec2(s.width/4,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); aParent->addChild(sprite1); @@ -2833,17 +2833,17 @@ SpriteBatchNodeChildrenAnchorPoint::SpriteBatchNodeChildrenAnchorPoint() // anchor (0.5, 0.5) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/2,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_MIDDLE ); + sprite1->setPosition(Vec2(s.width/2,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_MIDDLE ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); aParent->addChild(sprite1); @@ -2859,17 +2859,17 @@ SpriteBatchNodeChildrenAnchorPoint::SpriteBatchNodeChildrenAnchorPoint() // anchor (1,1) sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_08.png"); - sprite1->setPosition(Vector2(s.width/2+s.width/4,s.height/2)); - sprite1->setAnchorPoint( Vector2::ANCHOR_TOP_RIGHT ); + sprite1->setPosition(Vec2(s.width/2+s.width/4,s.height/2)); + sprite1->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT ); sprite2 = Sprite::createWithSpriteFrameName("grossini_dance_02.png"); - sprite2->setPosition(Vector2(20,30)); + sprite2->setPosition(Vec2(20,30)); sprite3 = Sprite::createWithSpriteFrameName("grossini_dance_03.png"); - sprite3->setPosition(Vector2(-20,30)); + sprite3->setPosition(Vec2(-20,30)); sprite4 = Sprite::createWithSpriteFrameName("grossini_dance_04.png"); - sprite4->setPosition(Vector2(0,0)); + sprite4->setPosition(Vec2(0,0)); sprite4->setScale( 0.5f ); aParent->addChild(sprite1); @@ -2922,14 +2922,14 @@ SpriteBatchNodeChildrenScale::SpriteBatchNodeChildrenScale() // aParent = Node::create(); sprite1 = Sprite::createWithSpriteFrameName("grossinis_sister1.png"); - sprite1->setPosition( Vector2( s.width/4, s.height/4) ); + sprite1->setPosition( Vec2( s.width/4, s.height/4) ); sprite1->setScaleX( -0.5f ); sprite1->setScaleY( 2.0f ); sprite1->runAction(seq); sprite2 = Sprite::createWithSpriteFrameName("grossinis_sister2.png"); - sprite2->setPosition( Vector2( 50,0) ); + sprite2->setPosition( Vec2( 50,0) ); addChild(aParent); aParent->addChild(sprite1); @@ -2943,13 +2943,13 @@ SpriteBatchNodeChildrenScale::SpriteBatchNodeChildrenScale() aParent = SpriteBatchNode::create("animations/grossini_family.png"); sprite1 = Sprite::createWithSpriteFrameName("grossinis_sister1.png"); - sprite1->setPosition( Vector2( 3*s.width/4, s.height/4) ); + sprite1->setPosition( Vec2( 3*s.width/4, s.height/4) ); sprite1->setScaleX( -0.5f ); sprite1->setScaleY( 2.0f ); sprite1->runAction( seq->clone() ); sprite2 = Sprite::createWithSpriteFrameName("grossinis_sister2.png"); - sprite2->setPosition( Vector2( 50,0) ); + sprite2->setPosition( Vec2( 50,0) ); addChild(aParent); aParent->addChild(sprite1); @@ -2963,13 +2963,13 @@ SpriteBatchNodeChildrenScale::SpriteBatchNodeChildrenScale() aParent = Node::create(); sprite1 = Sprite::createWithSpriteFrameName("grossinis_sister1.png"); - sprite1->setPosition( Vector2( s.width/4, 2*s.height/3) ); + sprite1->setPosition( Vec2( s.width/4, 2*s.height/3) ); sprite1->setScaleX( 1.5f ); sprite1->setScaleY( -0.5f ); sprite1->runAction( seq->clone() ); sprite2 = Sprite::createWithSpriteFrameName("grossinis_sister2.png"); - sprite2->setPosition( Vector2( 50,0) ); + sprite2->setPosition( Vec2( 50,0) ); addChild(aParent); aParent->addChild(sprite1); @@ -2982,13 +2982,13 @@ SpriteBatchNodeChildrenScale::SpriteBatchNodeChildrenScale() aParent = SpriteBatchNode::create("animations/grossini_family.png"); sprite1 = Sprite::createWithSpriteFrameName("grossinis_sister1.png"); - sprite1->setPosition( Vector2( 3*s.width/4, 2*s.height/3) ); + sprite1->setPosition( Vec2( 3*s.width/4, 2*s.height/3) ); sprite1->setScaleX( 1.5f ); sprite1->setScaleY( -0.5f); sprite1->runAction( seq->clone() ); sprite2 = Sprite::createWithSpriteFrameName("grossinis_sister2.png"); - sprite2->setPosition( Vector2( 50,0) ); + sprite2->setPosition( Vec2( 50,0) ); addChild(aParent); aParent->addChild(sprite1); @@ -3034,14 +3034,14 @@ SpriteChildrenChildren::SpriteChildrenChildren() // parent l1 = Sprite::createWithSpriteFrameName("father.gif"); - l1->setPosition( Vector2( s.width/2, s.height/2) ); + l1->setPosition( Vec2( s.width/2, s.height/2) ); l1->runAction( seq->clone() ); aParent->addChild(l1); auto l1Size = l1->getContentSize(); // child left l2a = Sprite::createWithSpriteFrameName("sister1.gif"); - l2a->setPosition( Vector2( -50 + l1Size.width/2, 0 + l1Size.height/2) ); + l2a->setPosition( Vec2( -50 + l1Size.width/2, 0 + l1Size.height/2) ); l2a->runAction( rot_back_fe->clone() ); l1->addChild(l2a); auto l2aSize = l2a->getContentSize(); @@ -3049,7 +3049,7 @@ SpriteChildrenChildren::SpriteChildrenChildren() // child right l2b = Sprite::createWithSpriteFrameName("sister2.gif"); - l2b->setPosition( Vector2( +50 + l1Size.width/2, 0 + l1Size.height/2) ); + l2b->setPosition( Vec2( +50 + l1Size.width/2, 0 + l1Size.height/2) ); l2b->runAction( rot_back_fe->clone() ); l1->addChild(l2b); auto l2bSize = l2a->getContentSize(); @@ -3058,27 +3058,27 @@ SpriteChildrenChildren::SpriteChildrenChildren() // child left bottom l3a1 = Sprite::createWithSpriteFrameName("child1.gif"); l3a1->setScale( 0.45f ); - l3a1->setPosition( Vector2(0+l2aSize.width/2,-100+l2aSize.height/2) ); + l3a1->setPosition( Vec2(0+l2aSize.width/2,-100+l2aSize.height/2) ); l2a->addChild(l3a1); // child left top l3a2 = Sprite::createWithSpriteFrameName("child1.gif"); l3a2->setScale( 0.45f ); - l3a1->setPosition( Vector2(0+l2aSize.width/2,+100+l2aSize.height/2) ); + l3a1->setPosition( Vec2(0+l2aSize.width/2,+100+l2aSize.height/2) ); l2a->addChild(l3a2); // child right bottom l3b1 = Sprite::createWithSpriteFrameName("child1.gif"); l3b1->setScale( 0.45f); l3b1->setFlippedY( true ); - l3b1->setPosition( Vector2(0+l2bSize.width/2,-100+l2bSize.height/2) ); + l3b1->setPosition( Vec2(0+l2bSize.width/2,-100+l2bSize.height/2) ); l2b->addChild(l3b1); // child right top l3b2 = Sprite::createWithSpriteFrameName("child1.gif"); l3b2->setScale( 0.45f ); l3b2->setFlippedY( true ); - l3b1->setPosition( Vector2(0+l2bSize.width/2,+100+l2bSize.height/2) ); + l3b1->setPosition( Vec2(0+l2bSize.width/2,+100+l2bSize.height/2) ); l2b->addChild(l3b2); } @@ -3123,14 +3123,14 @@ SpriteBatchNodeChildrenChildren::SpriteBatchNodeChildrenChildren() // parent l1 = Sprite::createWithSpriteFrameName("father.gif"); - l1->setPosition( Vector2( s.width/2, s.height/2) ); + l1->setPosition( Vec2( s.width/2, s.height/2) ); l1->runAction( seq->clone() ); aParent->addChild(l1); auto l1Size = l1->getContentSize(); // child left l2a = Sprite::createWithSpriteFrameName("sister1.gif"); - l2a->setPosition( Vector2( -50 + l1Size.width/2, 0 + l1Size.height/2) ); + l2a->setPosition( Vec2( -50 + l1Size.width/2, 0 + l1Size.height/2) ); l2a->runAction( rot_back_fe->clone() ); l1->addChild(l2a); auto l2aSize = l2a->getContentSize(); @@ -3138,7 +3138,7 @@ SpriteBatchNodeChildrenChildren::SpriteBatchNodeChildrenChildren() // child right l2b = Sprite::createWithSpriteFrameName("sister2.gif"); - l2b->setPosition( Vector2( +50 + l1Size.width/2, 0 + l1Size.height/2) ); + l2b->setPosition( Vec2( +50 + l1Size.width/2, 0 + l1Size.height/2) ); l2b->runAction( rot_back_fe->clone() ); l1->addChild(l2b); auto l2bSize = l2a->getContentSize(); @@ -3147,27 +3147,27 @@ SpriteBatchNodeChildrenChildren::SpriteBatchNodeChildrenChildren() // child left bottom l3a1 = Sprite::createWithSpriteFrameName("child1.gif"); l3a1->setScale( 0.45f ); - l3a1->setPosition( Vector2(0+l2aSize.width/2,-100+l2aSize.height/2) ); + l3a1->setPosition( Vec2(0+l2aSize.width/2,-100+l2aSize.height/2) ); l2a->addChild(l3a1); // child left top l3a2 = Sprite::createWithSpriteFrameName("child1.gif"); l3a2->setScale( 0.45f ); - l3a1->setPosition( Vector2(0+l2aSize.width/2,+100+l2aSize.height/2) ); + l3a1->setPosition( Vec2(0+l2aSize.width/2,+100+l2aSize.height/2) ); l2a->addChild(l3a2); // child right bottom l3b1 = Sprite::createWithSpriteFrameName("child1.gif"); l3b1->setScale( 0.45f ); l3b1->setFlippedY( true ); - l3b1->setPosition( Vector2(0+l2bSize.width/2,-100+l2bSize.height/2) ); + l3b1->setPosition( Vec2(0+l2bSize.width/2,-100+l2bSize.height/2) ); l2b->addChild(l3b1); // child right top l3b2 = Sprite::createWithSpriteFrameName("child1.gif"); l3b2->setScale( 0.45f ); l3b2->setFlippedY( true ); - l3b1->setPosition( Vector2(0+l2bSize.width/2,+100+l2bSize.height/2) ); + l3b1->setPosition( Vec2(0+l2bSize.width/2,+100+l2bSize.height/2) ); l2b->addChild(l3b2); } @@ -3201,7 +3201,7 @@ SpriteBatchNodeSkewNegativeScaleChildren::SpriteBatchNodeSkewNegativeScaleChildr for(int i=0;i<2;i++) { auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2( s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2( s.width/4*(i+1), s.height/2)); // Skew auto skewX = SkewBy::create(2, 45, 0); @@ -3218,7 +3218,7 @@ SpriteBatchNodeSkewNegativeScaleChildren::SpriteBatchNodeSkewNegativeScaleChildr sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - child1->setPosition(Vector2(sprite->getContentSize().width / 2.0f, sprite->getContentSize().height / 2.0f)); + child1->setPosition(Vec2(sprite->getContentSize().width / 2.0f, sprite->getContentSize().height / 2.0f)); child1->setScale(0.8f); @@ -3260,7 +3260,7 @@ SpriteSkewNegativeScaleChildren::SpriteSkewNegativeScaleChildren() for(int i=0;i<2;i++) { auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2( s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2( s.width/4*(i+1), s.height/2)); // Skew auto skewX = SkewBy::create(2, 45, 0); @@ -3277,7 +3277,7 @@ SpriteSkewNegativeScaleChildren::SpriteSkewNegativeScaleChildren() sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - child1->setPosition(Vector2(sprite->getContentSize().width / 2.0f, sprite->getContentSize().height / 2.0f)); + child1->setPosition(Vec2(sprite->getContentSize().width / 2.0f, sprite->getContentSize().height / 2.0f)); sprite->addChild(child1); @@ -3322,14 +3322,14 @@ SpriteNilTexture::SpriteNilTexture() sprite->setTextureRect( Rect(0, 0, 300,300) ); sprite->setColor(Color3B::RED); sprite->setOpacity(128); - sprite->setPosition(Vector2(3*s.width/4, s.height/2)); + sprite->setPosition(Vec2(3*s.width/4, s.height/2)); addChild(sprite, 100); sprite = Sprite::create(); sprite->setTextureRect(Rect(0, 0, 300,300)); sprite->setColor(Color3B::BLUE); sprite->setOpacity(128); - sprite->setPosition(Vector2(1*s.width/4, s.height/2)); + sprite->setPosition(Vec2(1*s.width/4, s.height/2)); addChild(sprite, 100); } @@ -3389,14 +3389,14 @@ SpriteSubclass::SpriteSubclass() // MySprite1 MySprite1 *sprite = MySprite1::createWithSpriteFrameName("father.gif"); - sprite->setPosition(Vector2( s.width/4*1, s.height/2)); + sprite->setPosition(Vec2( s.width/4*1, s.height/2)); aParent->addChild(sprite); addChild(aParent); // MySprite2 MySprite2 *sprite2 = MySprite2::create("Images/grossini.png"); addChild(sprite2); - sprite2->setPosition(Vector2(s.width/4*3, s.height/2)); + sprite2->setPosition(Vec2(s.width/4*3, s.height/2)); } std::string SpriteSubclass::title() const @@ -3481,15 +3481,15 @@ SpriteDoubleResolution::SpriteDoubleResolution() // there is no HD resolution file of grossini_dance_08. auto spriteSD = DoubleSprite::create("Images/grossini_dance_08.png"); addChild(spriteSD); - spriteSD->setPosition(Vector2(s.width/4*1,s.height/2)); + spriteSD->setPosition(Vec2(s.width/4*1,s.height/2)); auto child1_left = DoubleSprite::create("Images/grossini_dance_08.png"); spriteSD->addChild(child1_left); - child1_left->setPosition(Vector2(-30,0)); + child1_left->setPosition(Vec2(-30,0)); auto child1_right = Sprite::create("Images/grossini.png"); spriteSD->addChild(child1_right); - child1_left->setPosition(Vector2( spriteSD->getContentSize().height, 0)); + child1_left->setPosition(Vec2( spriteSD->getContentSize().height, 0)); @@ -3499,15 +3499,15 @@ SpriteDoubleResolution::SpriteDoubleResolution() // there is an HD version of grossini.png auto spriteHD = Sprite::create("Images/grossini.png"); addChild(spriteHD); - spriteHD->setPosition(Vector2(s.width/4*3,s.height/2)); + spriteHD->setPosition(Vec2(s.width/4*3,s.height/2)); auto child2_left = DoubleSprite::create("Images/grossini_dance_08.png"); spriteHD->addChild(child2_left); - child2_left->setPosition(Vector2(-30,0)); + child2_left->setPosition(Vec2(-30,0)); auto child2_right = Sprite::create("Images/grossini.png"); spriteHD->addChild(child2_right); - child2_left->setPosition(Vector2( spriteHD->getContentSize().height, 0)); + child2_left->setPosition(Vec2( spriteHD->getContentSize().height, 0)); @@ -3618,7 +3618,7 @@ AnimationCacheTest::AnimationCacheTest() grossini->setSpriteFrame(frame); auto winSize = Director::getInstance()->getWinSize(); - grossini->setPosition(Vector2(winSize.width/2, winSize.height/2)); + grossini->setPosition(Vec2(winSize.width/2, winSize.height/2)); addChild(grossini); // run the animation @@ -3676,7 +3676,7 @@ AnimationCacheFile::AnimationCacheFile() auto winSize = Director::getInstance()->getWinSize(); - grossini->setPosition(Vector2(winSize.width/2, winSize.height/2)); + grossini->setPosition(Vec2(winSize.width/2, winSize.height/2)); addChild(grossini); @@ -3709,11 +3709,11 @@ SpriteBatchBug1217::SpriteBatchBug1217() s2->setColor(Color3B(0, 255, 0)); s3->setColor(Color3B(0, 0, 255)); - s1->setPosition(Vector2(20,200)); - s2->setPosition(Vector2(100,0)); - s3->setPosition(Vector2(100,0)); + s1->setPosition(Vec2(20,200)); + s2->setPosition(Vec2(100,0)); + s3->setPosition(Vec2(100,0)); - bn->setPosition(Vector2(0,0)); + bn->setPosition(Vec2(0,0)); //!!!!! s1->addChild(s2); @@ -3759,7 +3759,7 @@ SpriteOffsetAnchorSkew::SpriteOffsetAnchorSkew() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -3769,13 +3769,13 @@ SpriteOffsetAnchorSkew::SpriteOffsetAnchorSkew() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); break; } @@ -3842,7 +3842,7 @@ SpriteBatchNodeOffsetAnchorSkew::SpriteBatchNodeOffsetAnchorSkew() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -3852,13 +3852,13 @@ SpriteBatchNodeOffsetAnchorSkew::SpriteBatchNodeOffsetAnchorSkew() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -3922,7 +3922,7 @@ SpriteOffsetAnchorSkewScale::SpriteOffsetAnchorSkewScale() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -3932,13 +3932,13 @@ SpriteOffsetAnchorSkewScale::SpriteOffsetAnchorSkewScale() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -4011,7 +4011,7 @@ SpriteBatchNodeOffsetAnchorSkewScale::SpriteBatchNodeOffsetAnchorSkewScale() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -4021,13 +4021,13 @@ SpriteBatchNodeOffsetAnchorSkewScale::SpriteBatchNodeOffsetAnchorSkewScale() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -4099,7 +4099,7 @@ SpriteOffsetAnchorFlip::SpriteOffsetAnchorFlip() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -4109,13 +4109,13 @@ SpriteOffsetAnchorFlip::SpriteOffsetAnchorFlip() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -4181,7 +4181,7 @@ SpriteBatchNodeOffsetAnchorFlip::SpriteBatchNodeOffsetAnchorFlip() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width / 4 * (i + 1), s.height / 2)); + sprite->setPosition(Vec2(s.width / 4 * (i + 1), s.height / 2)); auto point = Sprite::create("Images/r1.png"); point->setScale(0.25f); @@ -4191,13 +4191,13 @@ SpriteBatchNodeOffsetAnchorFlip::SpriteBatchNodeOffsetAnchorFlip() switch (i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT ); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT ); break; } @@ -4251,23 +4251,23 @@ NodeSort::NodeSort() addChild(_node, 0, 0); _sprite1 = Sprite::create("Images/piece.png", Rect(128, 0, 64, 64)); - _sprite1->setPosition(Vector2(100, 160)); + _sprite1->setPosition(Vec2(100, 160)); _node->addChild(_sprite1, -6, 1); _sprite2 = Sprite::create("Images/piece.png", Rect(128, 0, 64, 64)); - _sprite2->setPosition(Vector2(164, 160)); + _sprite2->setPosition(Vec2(164, 160)); _node->addChild(_sprite2, -6, 2); _sprite4 = Sprite::create("Images/piece.png", Rect(128, 0, 64, 64)); - _sprite4->setPosition(Vector2(292, 160)); + _sprite4->setPosition(Vec2(292, 160)); _node->addChild(_sprite4, -3, 4); _sprite3 = Sprite::create("Images/piece.png", Rect(128, 0, 64, 64)); - _sprite3->setPosition(Vector2(228, 160)); + _sprite3->setPosition(Vec2(228, 160)); _node->addChild(_sprite3, -4, 3); _sprite5 = Sprite::create("Images/piece.png", Rect(128, 0, 64, 64)); - _sprite5->setPosition(Vector2(356, 160)); + _sprite5->setPosition(Vec2(356, 160)); _node->addChild(_sprite5, -3, 5); schedule(schedule_selector(NodeSort::reorderSprite)); @@ -4312,23 +4312,23 @@ SpriteBatchNodeReorderSameIndex::SpriteBatchNodeReorderSameIndex() addChild(_batchNode, 1, 0); _sprite1 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128,0,64,64)); - _sprite1->setPosition(Vector2(100,160)); + _sprite1->setPosition(Vec2(100,160)); _batchNode->addChild(_sprite1, 3, 1); _sprite2= Sprite::createWithTexture(_batchNode->getTexture(), Rect(128,0,64,64)); - _sprite2->setPosition(Vector2(164,160)); + _sprite2->setPosition(Vec2(164,160)); _batchNode->addChild(_sprite2, 4, 2); _sprite3 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128,0,64,64)); - _sprite3->setPosition(Vector2(228,160)); + _sprite3->setPosition(Vec2(228,160)); _batchNode->addChild(_sprite3, 4, 3); _sprite4 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128,0,64,64)); - _sprite4->setPosition(Vector2(292,160)); + _sprite4->setPosition(Vec2(292,160)); _batchNode->addChild(_sprite4, 5, 4); _sprite5 = Sprite::createWithTexture(_batchNode->getTexture(), Rect(128,0,64,64)); - _sprite5->setPosition(Vector2(356,160)); + _sprite5->setPosition(Vec2(356,160)); _batchNode->addChild(_sprite5, 6, 5); @@ -4380,14 +4380,14 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() // parent l1 = Sprite::createWithSpriteFrameName("father.gif"); - l1->setPosition(Vector2( s.width/2, s.height/2)); + l1->setPosition(Vec2( s.width/2, s.height/2)); aParent->addChild(l1); auto l1Size = l1->getContentSize(); // child left l2a = Sprite::createWithSpriteFrameName("sister1.gif"); - l2a->setPosition(Vector2( -10 + l1Size.width/2, 0 + l1Size.height/2)); + l2a->setPosition(Vec2( -10 + l1Size.width/2, 0 + l1Size.height/2)); l1->addChild(l2a, 1); auto l2aSize = l2a->getContentSize(); @@ -4395,7 +4395,7 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() // child right l2b = Sprite::createWithSpriteFrameName("sister2.gif"); - l2b->setPosition(Vector2( +50 + l1Size.width/2, 0 + l1Size.height/2)); + l2b->setPosition(Vec2( +50 + l1Size.width/2, 0 + l1Size.height/2)); l1->addChild(l2b, 2); auto l2bSize = l2a->getContentSize(); @@ -4404,13 +4404,13 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() // child left bottom l3a1 = Sprite::createWithSpriteFrameName("child1.gif"); l3a1->setScale(0.45f); - l3a1->setPosition(Vector2(0+l2aSize.width/2,-50+l2aSize.height/2)); + l3a1->setPosition(Vec2(0+l2aSize.width/2,-50+l2aSize.height/2)); l2a->addChild(l3a1, 1); // child left top l3a2 = Sprite::createWithSpriteFrameName("child1.gif"); l3a2->setScale(0.45f); - l3a2->setPosition(Vector2(0+l2aSize.width/2,+50+l2aSize.height/2)); + l3a2->setPosition(Vec2(0+l2aSize.width/2,+50+l2aSize.height/2)); l2a->addChild(l3a2, 2); _reorderSprite = l2a; @@ -4419,14 +4419,14 @@ SpriteBatchNodeReorderOneChild::SpriteBatchNodeReorderOneChild() l3b1 = Sprite::createWithSpriteFrameName("child1.gif"); l3b1->setScale(0.45f); l3b1->setFlippedY(true); - l3b1->setPosition(Vector2(0+l2bSize.width/2,-50+l2bSize.height/2)); + l3b1->setPosition(Vec2(0+l2bSize.width/2,-50+l2bSize.height/2)); l2b->addChild(l3b1); // child right top l3b2 = Sprite::createWithSpriteFrameName("child1.gif"); l3b2->setScale(0.45f); l3b2->setFlippedY(true); - l3b2->setPosition(Vector2(0+l2bSize.width/2,+50+l2bSize.height/2)); + l3b2->setPosition(Vec2(0+l2bSize.width/2,+50+l2bSize.height/2)); l2b->addChild(l3b2); scheduleOnce(schedule_selector(SpriteBatchNodeReorderOneChild::reorderSprite), 2.0f); @@ -4463,7 +4463,7 @@ SpriteOffsetAnchorRotationalSkew::SpriteOffsetAnchorRotationalSkew() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4474,13 +4474,13 @@ SpriteOffsetAnchorRotationalSkew::SpriteOffsetAnchorRotationalSkew() switch(i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); break; } @@ -4546,7 +4546,7 @@ SpriteBatchNodeOffsetAnchorRotationalSkew::SpriteBatchNodeOffsetAnchorRotational // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4557,13 +4557,13 @@ SpriteBatchNodeOffsetAnchorRotationalSkew::SpriteBatchNodeOffsetAnchorRotational switch(i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); break; } @@ -4626,7 +4626,7 @@ SpriteOffsetAnchorRotationalSkewScale::SpriteOffsetAnchorRotationalSkewScale() // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4637,13 +4637,13 @@ SpriteOffsetAnchorRotationalSkewScale::SpriteOffsetAnchorRotationalSkewScale() switch(i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); break; } @@ -4714,7 +4714,7 @@ SpriteBatchNodeOffsetAnchorRotationalSkewScale::SpriteBatchNodeOffsetAnchorRotat // Animation using Sprite batch // auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4725,13 +4725,13 @@ SpriteBatchNodeOffsetAnchorRotationalSkewScale::SpriteBatchNodeOffsetAnchorRotat switch(i) { case 0: - sprite->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); + sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); break; case 1: - sprite->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + sprite->setAnchorPoint(Vec2::ANCHOR_MIDDLE); break; case 2: - sprite->setAnchorPoint(Vector2::ANCHOR_TOP_RIGHT); + sprite->setAnchorPoint(Vec2::ANCHOR_TOP_RIGHT); break; } @@ -4801,7 +4801,7 @@ SpriteRotationalSkewNegativeScaleChildren::SpriteRotationalSkewNegativeScaleChil for(int i=0;i<2;i++) { auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4824,7 +4824,7 @@ SpriteRotationalSkewNegativeScaleChildren::SpriteRotationalSkewNegativeScaleChil sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::create("Images/grossini_dance_01.png"); - child1->setPosition(Vector2(sprite->getContentSize().width/2.0f, sprite->getContentSize().height/2.0f)); + child1->setPosition(Vec2(sprite->getContentSize().width/2.0f, sprite->getContentSize().height/2.0f)); sprite->addChild(child1); @@ -4868,7 +4868,7 @@ SpriteBatchNodeRotationalSkewNegativeScaleChildren::SpriteBatchNodeRotationalSke for(int i=0;i<2;i++) { auto sprite = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); - sprite->setPosition(Vector2(s.width/4*(i+1), s.height/2)); + sprite->setPosition(Vec2(s.width/4*(i+1), s.height/2)); auto point = Sprite::create("Images/r1.png"); @@ -4891,7 +4891,7 @@ SpriteBatchNodeRotationalSkewNegativeScaleChildren::SpriteBatchNodeRotationalSke sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::create("Images/grossini_dance_01.png"); - child1->setPosition(Vector2(sprite->getContentSize().width/2.0f, sprite->getContentSize().height/2.0f)); + child1->setPosition(Vec2(sprite->getContentSize().width/2.0f, sprite->getContentSize().height/2.0f)); sprite->addChild(child1); @@ -4930,13 +4930,13 @@ SpriteCullTest1::SpriteCullTest1() grossini->setPosition(s.width/2, s.height/2); - auto right = MoveBy::create(3, Vector2(s.width*2,0)); + auto right = MoveBy::create(3, Vec2(s.width*2,0)); auto back1 = right->reverse(); - auto left = MoveBy::create(3, Vector2(-s.width*2,0)); + auto left = MoveBy::create(3, Vec2(-s.width*2,0)); auto back2 = left->reverse(); - auto up = MoveBy::create(3, Vector2(0,s.height*2)); + auto up = MoveBy::create(3, Vec2(0,s.height*2)); auto back3 = up->reverse(); - auto down = MoveBy::create(3, Vector2(0,-s.height*2)); + auto down = MoveBy::create(3, Vec2(0,-s.height*2)); auto back4 = down->reverse(); auto seq = Sequence::create(right, back1, left, back2, up, back3, down, back4, nullptr); @@ -4969,13 +4969,13 @@ SpriteCullTest2::SpriteCullTest2() grossini->setPosition(s.width/2, s.height/2); - auto right = MoveBy::create(3, Vector2(s.width*2,0)); + auto right = MoveBy::create(3, Vec2(s.width*2,0)); auto back1 = right->reverse(); - auto left = MoveBy::create(3, Vector2(-s.width*2,0)); + auto left = MoveBy::create(3, Vec2(-s.width*2,0)); auto back2 = left->reverse(); - auto up = MoveBy::create(3, Vector2(0,s.height*2)); + auto up = MoveBy::create(3, Vec2(0,s.height*2)); auto back3 = up->reverse(); - auto down = MoveBy::create(3, Vector2(0,-s.height*2)); + auto down = MoveBy::create(3, Vec2(0,-s.height*2)); auto back4 = down->reverse(); grossini->setScale(0.1f); diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h index 0616050e94..e02b16082f 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h @@ -57,7 +57,7 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; - void addNewSpriteWithCoords(Vector2 p); + void addNewSpriteWithCoords(Vec2 p); void onTouchesEnded(const std::vector& touches, Event* event); }; @@ -66,7 +66,7 @@ class SpriteBatchNode1: public SpriteTestDemo public: CREATE_FUNC(SpriteBatchNode1); SpriteBatchNode1(); - void addNewSpriteWithCoords(Vector2 p); + void addNewSpriteWithCoords(Vec2 p); void onTouchesEnded(const std::vector& touches, Event* event); virtual std::string title() const override; virtual std::string subtitle() const override; diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp index 8b19a72467..92aacdd67c 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp @@ -167,7 +167,7 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in auto& children = getChildren(); Node * node = 0; ssize_t count = children.size(); - Vector2 pos; + Vec2 pos; for (int i = 0; i < count; ++i) { node = children.at(i); @@ -258,9 +258,9 @@ void TextFieldTTFDefaultTest::onEnter() #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position to make it visable - pTextField->setPosition(Vector2(s.width / 2, s.height/2 + 50)); + pTextField->setPosition(Vec2(s.width / 2, s.height/2 + 50)); #else - pTextField->setPosition(Vector2(s.width / 2, s.height / 2)); + pTextField->setPosition(Vec2(s.width / 2, s.height / 2)); #endif _trackNode = pTextField; @@ -320,9 +320,9 @@ void TextFieldTTFActionTest::onEnter() #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) // on android, TextFieldTTF cannot auto adjust its position when soft-keyboard pop up // so we had to set a higher position - _textField->setPosition(Vector2(s.width / 2, s.height/2 + 50)); + _textField->setPosition(Vec2(s.width / 2, s.height/2 + 50)); #else - _textField->setPosition(Vector2(s.width / 2, s.height / 2)); + _textField->setPosition(Vec2(s.width / 2, s.height / 2)); #endif _trackNode = _textField; @@ -383,7 +383,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const endPos.x += sender->getContentSize().width / 2; } auto inputTextSize = label->getContentSize(); - Vector2 beginPos(endPos.x, Director::getInstance()->getWinSize().height - inputTextSize.height * 2); + Vec2 beginPos(endPos.x, Director::getInstance()->getWinSize().height - inputTextSize.height * 2); float duration = 0.5; label->setPosition(beginPos); @@ -414,7 +414,7 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * sender, co beginPos.x += (textfieldSize.width - labelSize.width) / 2.0f; auto winSize = Director::getInstance()->getWinSize(); - Vector2 endPos(- winSize.width / 4.0f, winSize.height * (0.5 + (float)rand() / (2.0f * RAND_MAX))); + Vec2 endPos(- winSize.width / 4.0f, winSize.height * (0.5 + (float)rand() / (2.0f * RAND_MAX))); float duration = 1; float rotateDuration = 0.2f; diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h index c029af1326..6b3cfc415f 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.h @@ -45,7 +45,7 @@ public: protected: Node * _trackNode; - Vector2 _beginPos; + Vec2 _beginPos; }; ////////////////////////////////////////////////////////////////////////// diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index c1ee3b2d87..d7a0e0eef4 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -212,7 +212,7 @@ void TextureTIFF::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image.tiff"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); this->addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); @@ -236,7 +236,7 @@ void TextureTGA::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("TileMaps/levelmap.tga"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); this->addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -258,7 +258,7 @@ void TexturePNG::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image.png"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -279,7 +279,7 @@ void TextureJPEG::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image.jpeg"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -300,7 +300,7 @@ void TextureWEBP::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image.webp"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -329,12 +329,12 @@ void TextureMipMap::onEnter() auto img0 = Sprite::createWithTexture(texture0); img0->setTextureRect(Rect(85, 121, 85, 121)); - img0->setPosition(Vector2( s.width/3.0f, s.height/2.0f)); + img0->setPosition(Vec2( s.width/3.0f, s.height/2.0f)); addChild(img0); auto img1 = Sprite::createWithTexture(texture1); img1->setTextureRect(Rect(85, 121, 85, 121)); - img1->setPosition(Vector2( 2*s.width/3.0f, s.height/2.0f)); + img1->setPosition(Vec2( 2*s.width/3.0f, s.height/2.0f)); addChild(img1); @@ -374,7 +374,7 @@ void TexturePVRMipMap::onEnter() auto imgMipMap = Sprite::create("Images/logo-mipmap.pvr"); if( imgMipMap ) { - imgMipMap->setPosition(Vector2( s.width/2.0f-100, s.height/2.0f)); + imgMipMap->setPosition(Vec2( s.width/2.0f-100, s.height/2.0f)); addChild(imgMipMap); // support mipmap filtering @@ -385,7 +385,7 @@ void TexturePVRMipMap::onEnter() auto img = Sprite::create("Images/logo-nomipmap.pvr"); if( img ) { - img->setPosition(Vector2( s.width/2.0f+100, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f+100, s.height/2.0f)); addChild(img); auto scale1 = EaseOut::create(ScaleBy::create(4, 0.01f), 3); @@ -420,7 +420,7 @@ void TexturePVRMipMap2::onEnter() auto s = Director::getInstance()->getWinSize(); auto imgMipMap = Sprite::create("Images/test_image_rgba4444_mipmap.pvr"); - imgMipMap->setPosition(Vector2( s.width/2.0f-100, s.height/2.0f)); + imgMipMap->setPosition(Vec2( s.width/2.0f-100, s.height/2.0f)); addChild(imgMipMap); // support mipmap filtering @@ -428,7 +428,7 @@ void TexturePVRMipMap2::onEnter() imgMipMap->getTexture()->setTexParameters(texParams); auto img = Sprite::create("Images/test_image.png"); - img->setPosition(Vector2( s.width/2.0f+100, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f+100, s.height/2.0f)); addChild(img); auto scale1 = EaseOut::create(ScaleBy::create(4, 0.01f), 3); @@ -468,7 +468,7 @@ void TexturePVR2BPP::onEnter() if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); @@ -495,7 +495,7 @@ void TexturePVRTest::onEnter() if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -527,7 +527,7 @@ void TexturePVR4BPP::onEnter() if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -555,7 +555,7 @@ void TexturePVRRGBA8888::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgba8888.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -580,7 +580,7 @@ void TexturePVRBGRA8888::onEnter() auto img = Sprite::create("Images/test_image_bgra8888.pvr"); if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -608,7 +608,7 @@ void TexturePVRRGBA5551::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgba5551.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -631,7 +631,7 @@ void TexturePVRRGBA4444::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgba4444.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -659,7 +659,7 @@ void TexturePVRRGBA4444GZ::onEnter() #else auto img = Sprite::create("Images/test_image_rgba4444.pvr.gz"); #endif - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -687,7 +687,7 @@ void TexturePVRRGBA4444CCZ::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgba4444.pvr.ccz"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -715,7 +715,7 @@ void TexturePVRRGB565::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgb565.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -736,7 +736,7 @@ void TexturePVRRGB888::onEnter() auto img = Sprite::create("Images/test_image_rgb888.pvr"); if (img != NULL) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -761,7 +761,7 @@ void TexturePVRA8::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_a8.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); @@ -785,7 +785,7 @@ void TexturePVRI8::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_i8.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -808,7 +808,7 @@ void TexturePVRAI88::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_ai88.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -828,7 +828,7 @@ void TexturePVR2BPPv3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -855,7 +855,7 @@ void TexturePVRII2BPPv3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -882,7 +882,7 @@ void TexturePVR4BPPv3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -917,7 +917,7 @@ void TexturePVRII4BPPv3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -948,7 +948,7 @@ void TexturePVRRGBA8888v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -975,7 +975,7 @@ void TexturePVRBGRA8888v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } else @@ -1006,7 +1006,7 @@ void TexturePVRRGBA5551v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1033,7 +1033,7 @@ void TexturePVRRGBA4444v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1060,7 +1060,7 @@ void TexturePVRRGB565v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1087,7 +1087,7 @@ void TexturePVRRGB888v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1114,7 +1114,7 @@ void TexturePVRA8v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1141,7 +1141,7 @@ void TexturePVRI8v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1168,7 +1168,7 @@ void TexturePVRAI88v3::onEnter() if (img) { - img->setPosition(Vector2(s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2(s.width/2.0f, s.height/2.0f)); addChild(img); } @@ -1200,7 +1200,7 @@ void TexturePVRBadEncoding::onEnter() auto img = Sprite::create("Images/test_image-bad_encoding.pvr"); if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } } @@ -1226,7 +1226,7 @@ void TexturePVRNonSquare::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/grossini_128x256_mipmap.pvr"); - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -1254,7 +1254,7 @@ void TexturePVRNPOT4444::onEnter() auto img = Sprite::create("Images/grossini_pvr_rgba4444.pvr"); if ( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); @@ -1283,7 +1283,7 @@ void TexturePVRNPOT8888::onEnter() auto img = Sprite::create("Images/grossini_pvr_rgba8888.pvr"); if( img ) { - img->setPosition(Vector2( s.width/2.0f, s.height/2.0f)); + img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); } log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); @@ -1315,7 +1315,7 @@ void TextureAlias::onEnter() // Default filter is GL_LINEAR auto sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2( s.width/3.0f, s.height/2.0f)); + sprite->setPosition(Vec2( s.width/3.0f, s.height/2.0f)); addChild(sprite); // this is the default filterting @@ -1326,7 +1326,7 @@ void TextureAlias::onEnter() // auto sprite2 = Sprite::create("Images/grossinis_sister2.png"); - sprite2->setPosition(Vector2( 2*s.width/3.0f, s.height/2.0f)); + sprite2->setPosition(Vec2( 2*s.width/3.0f, s.height/2.0f)); addChild(sprite2); // Use Nearest in this one @@ -1377,7 +1377,7 @@ void TexturePixelFormat::onEnter() // RGBA 8888 image (32-bit) Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888); auto sprite1 = Sprite::create("Images/test-rgba1.png"); - sprite1->setPosition(Vector2(1*s.width/7, s.height/2+32)); + sprite1->setPosition(Vec2(1*s.width/7, s.height/2+32)); addChild(sprite1, 0); // remove texture from texture manager @@ -1386,7 +1386,7 @@ void TexturePixelFormat::onEnter() // RGBA 4444 image (16-bit) Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444); auto sprite2 = Sprite::create("Images/test-rgba1.png"); - sprite2->setPosition(Vector2(2*s.width/7, s.height/2-32)); + sprite2->setPosition(Vec2(2*s.width/7, s.height/2-32)); addChild(sprite2, 0); // remove texture from texture manager @@ -1395,7 +1395,7 @@ void TexturePixelFormat::onEnter() // RGB5A1 image (16-bit) Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1); auto sprite3 = Sprite::create("Images/test-rgba1.png"); - sprite3->setPosition(Vector2(3*s.width/7, s.height/2+32)); + sprite3->setPosition(Vec2(3*s.width/7, s.height/2+32)); addChild(sprite3, 0); // remove texture from texture manager @@ -1404,7 +1404,7 @@ void TexturePixelFormat::onEnter() // RGB888 image Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB888); auto sprite4 = Sprite::create("Images/test-rgba1.png"); - sprite4->setPosition(Vector2(4*s.width/7, s.height/2-32)); + sprite4->setPosition(Vec2(4*s.width/7, s.height/2-32)); addChild(sprite4, 0); // remove texture from texture manager @@ -1413,7 +1413,7 @@ void TexturePixelFormat::onEnter() // RGB565 image (16-bit) Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB565); auto sprite5 = Sprite::create("Images/test-rgba1.png"); - sprite5->setPosition(Vector2(5*s.width/7, s.height/2+32)); + sprite5->setPosition(Vec2(5*s.width/7, s.height/2+32)); addChild(sprite5, 0); // remove texture from texture manager @@ -1422,7 +1422,7 @@ void TexturePixelFormat::onEnter() // A8 image (8-bit) Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::A8); auto sprite6 = Sprite::create("Images/test-rgba1.png"); - sprite6->setPosition(Vector2(6*s.width/7, s.height/2-32)); + sprite6->setPosition(Vec2(6*s.width/7, s.height/2-32)); addChild(sprite6, 0); // remove texture from texture manager @@ -1473,14 +1473,14 @@ void TextureBlend::onEnter() // they use by default GL_ONE, GL_ONE_MINUS_SRC_ALPHA auto cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 100+i); - cloud->setPosition(Vector2(50+25*i, 80)); + cloud->setPosition(Vec2(50+25*i, 80)); cloud->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED ); // CENTER sprites have also alpha pre-multiplied // they use by default GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 200+i); - cloud->setPosition(Vector2(50+25*i, 160)); + cloud->setPosition(Vec2(50+25*i, 160)); BlendFunc blendFunc2 = { GL_ONE_MINUS_DST_COLOR, GL_ZERO }; cloud->setBlendFunc(blendFunc2); @@ -1488,7 +1488,7 @@ void TextureBlend::onEnter() // You can set any blend function to your sprites cloud = Sprite::create("Images/test_blend.png"); addChild(cloud, i+1, 200+i); - cloud->setPosition(Vector2(50+25*i, 320-80)); + cloud->setPosition(Vec2(50+25*i, 320-80)); BlendFunc blendFunc3 = { GL_SRC_ALPHA, GL_ONE }; cloud->setBlendFunc(blendFunc3); // additive blending } @@ -1520,7 +1520,7 @@ void TextureAsync::onEnter() auto size = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("Loading...", "fonts/Marker Felt.ttf", 32); - label->setPosition(Vector2( size.width/2, size.height/2)); + label->setPosition(Vec2( size.width/2, size.height/2)); addChild(label, 10); auto scale = ScaleBy::create(0.3f, 2); @@ -1565,12 +1565,12 @@ void TextureAsync::imageLoaded(Texture2D* texture) // This test just creates a sprite based on the Texture auto sprite = Sprite::createWithTexture(texture); - sprite->setAnchorPoint(Vector2(0,0)); + sprite->setAnchorPoint(Vec2(0,0)); addChild(sprite, -1); auto size = director->getWinSize(); int i = _imageOffset * 32; - sprite->setPosition(Vector2( i % (int)size.width, (i / (int)size.width) * 32 )); + sprite->setPosition(Vec2( i % (int)size.width, (i / (int)size.width) * 32 )); _imageOffset++; @@ -1603,7 +1603,7 @@ void TextureGlClamp::onEnter() // eg: 32x64, 512x128, 256x1024, 64x64, etc.. auto sprite = Sprite::create("Images/pattern1.png", Rect(0,0,512,256)); addChild(sprite, -1, kTagSprite1); - sprite->setPosition(Vector2(size.width/2,size.height/2)); + sprite->setPosition(Vec2(size.width/2,size.height/2)); Texture2D::TexParams params = {GL_LINEAR,GL_LINEAR,GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE}; sprite->getTexture()->setTexParameters(params); @@ -1640,7 +1640,7 @@ void TextureGlRepeat::onEnter() // eg: 32x64, 512x128, 256x1024, 64x64, etc.. auto sprite = Sprite::create("Images/pattern1.png", Rect(0, 0, 4096, 4096)); addChild(sprite, -1, kTagSprite1); - sprite->setPosition(Vector2(size.width/2,size.height/2)); + sprite->setPosition(Vec2(size.width/2,size.height/2)); Texture2D::TexParams params = {GL_LINEAR,GL_LINEAR,GL_REPEAT,GL_REPEAT}; sprite->getTexture()->setTexParameters(params); @@ -1725,7 +1725,7 @@ void TextureCache1::onEnter() Sprite *sprite; sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2(s.width/5*1, s.height/2)); + sprite->setPosition(Vec2(s.width/5*1, s.height/2)); sprite->getTexture()->setAliasTexParameters(); sprite->setScale(2); addChild(sprite); @@ -1733,7 +1733,7 @@ void TextureCache1::onEnter() Director::getInstance()->getTextureCache()->removeTexture(sprite->getTexture()); sprite = Sprite::create("Images/grossinis_sister1.png"); - sprite->setPosition(Vector2(s.width/5*2, s.height/2)); + sprite->setPosition(Vec2(s.width/5*2, s.height/2)); sprite->getTexture()->setAntiAliasTexParameters(); sprite->setScale(2); addChild(sprite); @@ -1741,7 +1741,7 @@ void TextureCache1::onEnter() // 2nd set of sprites sprite = Sprite::create("Images/grossinis_sister2.png"); - sprite->setPosition(Vector2(s.width/5*3, s.height/2)); + sprite->setPosition(Vec2(s.width/5*3, s.height/2)); sprite->getTexture()->setAliasTexParameters(); sprite->setScale(2); addChild(sprite); @@ -1749,7 +1749,7 @@ void TextureCache1::onEnter() Director::getInstance()->getTextureCache()->removeTextureForKey("Images/grossinis_sister2.png"); sprite = Sprite::create("Images/grossinis_sister2.png"); - sprite->setPosition(Vector2(s.width/5*4, s.height/2)); + sprite->setPosition(Vec2(s.width/5*4, s.height/2)); sprite->getTexture()->setAntiAliasTexParameters(); sprite->setScale(2); addChild(sprite); @@ -1793,7 +1793,7 @@ std::string TextureDrawAtPoint::subtitle() const return "draws 2 textures using drawAtPoint"; } -void TextureDrawAtPoint::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TextureDrawAtPoint::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { TextureDemo::draw(renderer, transform, transformUpdated); @@ -1803,7 +1803,7 @@ void TextureDrawAtPoint::draw(Renderer *renderer, const Matrix &transform, bool } -void TextureDrawAtPoint::onDraw(const Matrix &transform, bool transformUpdated) +void TextureDrawAtPoint::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1812,8 +1812,8 @@ void TextureDrawAtPoint::onDraw(const Matrix &transform, bool transformUpdated) auto s = Director::getInstance()->getWinSize(); - _tex1->drawAtPoint(Vector2(s.width/2-50, s.height/2 - 50)); - _Tex2F->drawAtPoint(Vector2(s.width/2+50, s.height/2 - 50)); + _tex1->drawAtPoint(Vec2(s.width/2-50, s.height/2 - 50)); + _Tex2F->drawAtPoint(Vec2(s.width/2+50, s.height/2 - 50)); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } @@ -1836,7 +1836,7 @@ TextureDrawInRect::~TextureDrawInRect() _Tex2F->release(); } -void TextureDrawInRect::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TextureDrawInRect::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { TextureDemo::draw(renderer, transform, transformUpdated); @@ -1845,7 +1845,7 @@ void TextureDrawInRect::draw(Renderer *renderer, const Matrix &transform, bool t renderer->addCommand(&_renderCmd); } -void TextureDrawInRect::onDraw(const Matrix &transform, bool transformUpdated) +void TextureDrawInRect::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1926,7 +1926,7 @@ void TextureMemoryAlloc::onEnter() addChild(menu2); auto s = Director::getInstance()->getWinSize(); - menu2->setPosition(Vector2(s.width/2, s.height/4)); + menu2->setPosition(Vec2(s.width/2, s.height/4)); } void TextureMemoryAlloc::changeBackgroundVisible(cocos2d::Ref *sender) @@ -1989,7 +1989,7 @@ void TextureMemoryAlloc::updateImage(cocos2d::Ref *sender) _background->setVisible(false); auto s = Director::getInstance()->getWinSize(); - _background->setPosition(Vector2(s.width/2, s.height/2)); + _background->setPosition(Vec2(s.width/2, s.height/2)); } std::string TextureMemoryAlloc::title() const @@ -2014,13 +2014,13 @@ TexturePVRv3Premult::TexturePVRv3Premult() // PVR premultiplied auto pvr1 = Sprite::create("Images/grossinis_sister1-testalpha_premult.pvr"); addChild(pvr1, 0); - pvr1->setPosition(Vector2(size.width/4*1, size.height/2)); + pvr1->setPosition(Vec2(size.width/4*1, size.height/2)); transformSprite(pvr1); // PVR non-premultiplied auto pvr2 = Sprite::create("Images/grossinis_sister1-testalpha_nopremult.pvr"); addChild(pvr2, 0); - pvr2->setPosition(Vector2(size.width/4*2, size.height/2)); + pvr2->setPosition(Vec2(size.width/4*2, size.height/2)); transformSprite(pvr2); // PNG @@ -2028,7 +2028,7 @@ TexturePVRv3Premult::TexturePVRv3Premult() Director::getInstance()->getTextureCache()->removeTextureForKey("Images/grossinis_sister1-testalpha.png"); auto png = Sprite::create("Images/grossinis_sister1-testalpha.png"); addChild(png, 0); - png->setPosition(Vector2(size.width/4*3, size.height/2)); + png->setPosition(Vec2(size.width/4*3, size.height/2)); transformSprite(png); } @@ -2070,7 +2070,7 @@ TextureETC1::TextureETC1() auto sprite = Sprite::create("Images/ETC1.pkm"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width/2, size.height/2)); + sprite->setPosition(Vec2(size.width/2, size.height/2)); addChild(sprite); } @@ -2091,7 +2091,7 @@ TextureS3TCDxt1::TextureS3TCDxt1() auto sprite = Sprite::create("Images/test_256x256_s3tc_dxt1_mipmaps.dds"); //auto sprite = Sprite::create("Images/water_2_dxt1.dds"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2110,7 +2110,7 @@ TextureS3TCDxt3::TextureS3TCDxt3() auto sprite = Sprite::create("Images/test_256x256_s3tc_dxt3_mipmaps.dds"); //auto sprite = Sprite::create("Images/water_2_dxt3.dds"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2129,7 +2129,7 @@ TextureS3TCDxt5::TextureS3TCDxt5() auto sprite = Sprite::create("Images/test_256x256_s3tc_dxt5_mipmaps.dds"); //auto sprite = Sprite::create("Images/water_2_dxt5.dds"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2147,7 +2147,7 @@ TextureS3TCWithNoMipmaps::TextureS3TCWithNoMipmaps() { auto sprite = Sprite::create("Images/test_512x512_s3tc_dxt5_with_no_mipmaps.dds"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2162,7 +2162,7 @@ TextureATITCRGB::TextureATITCRGB() auto sprite = Sprite::create("Images/test_256x256_ATC_RGB_mipmaps.ktx"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2180,7 +2180,7 @@ TextureATITCExplicit::TextureATITCExplicit() auto sprite = Sprite::create("Images/test_256x256_ATC_RGBA_Explicit_mipmaps.ktx"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height / 2)); + sprite->setPosition(Vec2(size.width / 2, size.height / 2)); addChild(sprite); } @@ -2198,7 +2198,7 @@ TextureATITCInterpolated::TextureATITCInterpolated() auto sprite = Sprite::create("Images/test_256x256_ATC_RGBA_Interpolated_mipmaps.ktx"); auto size = Director::getInstance()->getWinSize(); - sprite->setPosition(Vector2(size.width / 2, size.height /2)); + sprite->setPosition(Vec2(size.width / 2, size.height /2)); addChild(sprite); } @@ -2215,7 +2215,7 @@ static void addImageToDemo(TextureDemo& demo, float x, float y, const char* path { Texture2D::setDefaultAlphaPixelFormat(format); auto sprite = Sprite::create(path); - sprite->setPosition(Vector2(x, y)); + sprite->setPosition(Vec2(x, y)); demo.addChild(sprite, 0); //remove texture from texture manager diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h index 218af02427..814b2f01ba 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.h @@ -465,9 +465,9 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _renderCmd; Texture2D* _tex1, *_Tex2F; @@ -481,9 +481,9 @@ public: virtual std::string title() const override; virtual std::string subtitle() const override; virtual void onEnter() override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); CustomCommand _renderCmd; Texture2D* _tex1, *_Tex2F; diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp index 1c91e8f766..52b3e5d864 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -15,8 +15,8 @@ TextureCacheTest::TextureCacheTest() _labelLoading = Label::createWithTTF("loading...", "fonts/arial.ttf", 15); _labelPercent = Label::createWithTTF("%0", "fonts/arial.ttf", 15); - _labelLoading->setPosition(Vector2(size.width / 2, size.height / 2 - 20)); - _labelPercent->setPosition(Vector2(size.width / 2, size.height / 2 + 20)); + _labelLoading->setPosition(Vec2(size.width / 2, size.height / 2 - 20)); + _labelPercent->setPosition(Vec2(size.width / 2, size.height / 2 + 20)); this->addChild(_labelLoading); this->addChild(_labelPercent); @@ -66,7 +66,7 @@ void TextureCacheTest::addSprite() // create sprites auto bg = Sprite::create("Images/HelloWorld.png"); - bg->setPosition(Vector2(size.width / 2, size.height / 2)); + bg->setPosition(Vec2(size.width / 2, size.height / 2)); auto s1 = Sprite::create("Images/grossini.png"); auto s2 = Sprite::create("Images/grossini_dance_01.png"); @@ -90,23 +90,23 @@ void TextureCacheTest::addSprite() Sprite::create("Images/background3.png"); Sprite::create("Images/blocks.png"); - s1->setPosition(Vector2(50, 50)); - s2->setPosition(Vector2(60, 50)); - s3->setPosition(Vector2(70, 50)); - s4->setPosition(Vector2(80, 50)); - s5->setPosition(Vector2(90, 50)); - s6->setPosition(Vector2(100, 50)); + s1->setPosition(Vec2(50, 50)); + s2->setPosition(Vec2(60, 50)); + s3->setPosition(Vec2(70, 50)); + s4->setPosition(Vec2(80, 50)); + s5->setPosition(Vec2(90, 50)); + s6->setPosition(Vec2(100, 50)); - s7->setPosition(Vector2(50, 180)); - s8->setPosition(Vector2(60, 180)); - s9->setPosition(Vector2(70, 180)); - s10->setPosition(Vector2(80, 180)); - s11->setPosition(Vector2(90, 180)); - s12->setPosition(Vector2(100, 180)); + s7->setPosition(Vec2(50, 180)); + s8->setPosition(Vec2(60, 180)); + s9->setPosition(Vec2(70, 180)); + s10->setPosition(Vec2(80, 180)); + s11->setPosition(Vec2(90, 180)); + s12->setPosition(Vec2(100, 180)); - s13->setPosition(Vector2(50, 270)); - s14->setPosition(Vector2(60, 270)); - s15->setPosition(Vector2(70, 270)); + s13->setPosition(Vec2(50, 270)); + s14->setPosition(Vec2(60, 270)); + s15->setPosition(Vec2(70, 270)); this->addChild(bg); diff --git a/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp index aa5579a850..7e1d939990 100644 --- a/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp +++ b/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp @@ -18,14 +18,14 @@ void TextureAtlasEncryptionDemo::onEnter() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF(title().c_str(), "fonts/arial.ttf", 28); - label->setPosition( Vector2(s.width/2, s.height * 0.75f) ); + label->setPosition( Vec2(s.width/2, s.height * 0.75f) ); this->addChild(label, 1); std::string strSubtitle = subtitle(); if(strSubtitle.empty() == false) { auto subLabel = Label::createWithTTF(strSubtitle.c_str(), "fonts/Thonburi.ttf", 16); - subLabel->setPosition( Vector2(s.width/2, s.height-80) ); + subLabel->setPosition( Vec2(s.width/2, s.height-80) ); this->addChild(subLabel, 1); } @@ -34,11 +34,11 @@ void TextureAtlasEncryptionDemo::onEnter() // Create a sprite from the non-encrypted atlas auto nonencryptedSprite = Sprite::createWithSpriteFrameName("Icon.png"); - nonencryptedSprite->setPosition(Vector2(s.width * 0.25f, s.height * 0.5f)); + nonencryptedSprite->setPosition(Vec2(s.width * 0.25f, s.height * 0.5f)); this->addChild(nonencryptedSprite); auto nonencryptedSpriteLabel = Label::createWithTTF("non-encrypted", "fonts/arial.ttf", 28); - nonencryptedSpriteLabel->setPosition(Vector2(s.width * 0.25f, nonencryptedSprite->getBoundingBox().getMinY() - nonencryptedSprite->getContentSize().height/2)); + nonencryptedSpriteLabel->setPosition(Vec2(s.width * 0.25f, nonencryptedSprite->getBoundingBox().getMinY() - nonencryptedSprite->getContentSize().height/2)); this->addChild(nonencryptedSpriteLabel, 1); // Load the encrypted atlas @@ -61,11 +61,11 @@ void TextureAtlasEncryptionDemo::onEnter() // 3) Create a sprite from the encrypted atlas auto encryptedSprite = Sprite::createWithSpriteFrameName("powered.png"); - encryptedSprite->setPosition(Vector2(s.width * 0.75f, s.height * 0.5f)); + encryptedSprite->setPosition(Vec2(s.width * 0.75f, s.height * 0.5f)); this->addChild(encryptedSprite); auto encryptedSpriteLabel = Label::createWithTTF("encrypted", "fonts/arial.ttf", 28); - encryptedSpriteLabel->setPosition(Vector2(s.width * 0.75f, encryptedSprite->getBoundingBox().getMinY() - encryptedSpriteLabel->getContentSize().height/2)); + encryptedSpriteLabel->setPosition(Vec2(s.width * 0.75f, encryptedSprite->getBoundingBox().getMinY() - encryptedSpriteLabel->getContentSize().height/2)); this->addChild(encryptedSpriteLabel, 1); } diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp index e079a94206..8a129a3f93 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -190,7 +190,7 @@ TileMapTest::TileMapTest() addChild(map, 0, kTagTileMap); - map->setAnchorPoint( Vector2(0, 0.5f) ); + map->setAnchorPoint( Vec2(0, 0.5f) ); auto scale = ScaleBy::create(4, 0.8f); auto scaleBack = scale->reverse(); @@ -226,8 +226,8 @@ TileMapEditTest::TileMapEditTest() addChild(map, 0, kTagTileMap); - map->setAnchorPoint( Vector2(0, 0) ); - map->setPosition( Vector2(-20,-200) ); + map->setAnchorPoint( Vec2(0, 0) ); + map->setPosition( Vec2(-20,-200) ); } void TileMapEditTest::updateMap(float dt) @@ -252,14 +252,14 @@ void TileMapEditTest::updateMap(float dt) // } // NEW since v0.7 - Color3B c = tilemap->getTileAt(Vector2(13,21)); + Color3B c = tilemap->getTileAt(Vec2(13,21)); c.r++; c.r %= 50; if( c.r==0) c.r=1; // NEW since v0.7 - tilemap->setTile(c, Vector2(13,21) ); + tilemap->setTile(c, Vec2(13,21) ); } std::string TileMapEditTest::title() const @@ -369,7 +369,7 @@ TMXOrthoTest3::TMXOrthoTest3() } map->setScale(0.2f); - map->setAnchorPoint( Vector2(0.5f, 0.5f) ); + map->setAnchorPoint( Vec2(0.5f, 0.5f) ); } std::string TMXOrthoTest3::title() const @@ -399,19 +399,19 @@ TMXOrthoTest4::TMXOrthoTest4() child->getTexture()->setAntiAliasTexParameters(); } - map->setAnchorPoint(Vector2(0, 0)); + map->setAnchorPoint(Vec2(0, 0)); auto layer = map->getLayer("Layer 0"); auto s = layer->getLayerSize(); Sprite* sprite; - sprite = layer->getTileAt(Vector2(0,0)); + sprite = layer->getTileAt(Vec2(0,0)); sprite->setScale(2); - sprite = layer->getTileAt(Vector2(s.width-1,0)); + sprite = layer->getTileAt(Vec2(s.width-1,0)); sprite->setScale(2); - sprite = layer->getTileAt(Vector2(0,s.height-1)); + sprite = layer->getTileAt(Vec2(0,s.height-1)); sprite->setScale(2); - sprite = layer->getTileAt(Vector2(s.width-1,s.height-1)); + sprite = layer->getTileAt(Vec2(s.width-1,s.height-1)); sprite->setScale(2); schedule( schedule_selector(TMXOrthoTest4::removeSprite), 2 ); @@ -426,10 +426,10 @@ void TMXOrthoTest4::removeSprite(float dt) auto layer = map->getLayer("Layer 0"); auto s = layer->getLayerSize(); - auto sprite = layer->getTileAt( Vector2(s.width-1,0) ); - auto sprite2 = layer->getTileAt(Vector2(s.width-1, s.height-1)); + auto sprite = layer->getTileAt( Vec2(s.width-1,0) ); + auto sprite2 = layer->getTileAt(Vec2(s.width-1, s.height-1)); layer->removeChild(sprite, true); - auto sprite3 = layer->getTileAt(Vector2(2, s.height-1)); + auto sprite3 = layer->getTileAt(Vec2(2, s.height-1)); layer->removeChild(sprite3, true); layer->removeChild(sprite2, true); } @@ -467,16 +467,16 @@ TMXReadWriteTest::TMXReadWriteTest() map->setScale( 1 ); - auto tile0 = layer->getTileAt(Vector2(1,63)); - auto tile1 = layer->getTileAt(Vector2(2,63)); - auto tile2 = layer->getTileAt(Vector2(3,62));//Vector2(1,62)); - auto tile3 = layer->getTileAt(Vector2(2,62)); - tile0->setAnchorPoint( Vector2(0.5f, 0.5f) ); - tile1->setAnchorPoint( Vector2(0.5f, 0.5f) ); - tile2->setAnchorPoint( Vector2(0.5f, 0.5f) ); - tile3->setAnchorPoint( Vector2(0.5f, 0.5f) ); + auto tile0 = layer->getTileAt(Vec2(1,63)); + auto tile1 = layer->getTileAt(Vec2(2,63)); + auto tile2 = layer->getTileAt(Vec2(3,62));//Vec2(1,62)); + auto tile3 = layer->getTileAt(Vec2(2,62)); + tile0->setAnchorPoint( Vec2(0.5f, 0.5f) ); + tile1->setAnchorPoint( Vec2(0.5f, 0.5f) ); + tile2->setAnchorPoint( Vec2(0.5f, 0.5f) ); + tile3->setAnchorPoint( Vec2(0.5f, 0.5f) ); - auto move = MoveBy::create(0.5f, Vector2(0,160)); + auto move = MoveBy::create(0.5f, Vec2(0,160)); auto rotate = RotateBy::create(2, 360); auto scale = ScaleBy::create(2, 5); auto opacity = FadeOut::create(2); @@ -494,7 +494,7 @@ TMXReadWriteTest::TMXReadWriteTest() tile3->runAction(seq3); - _gid = layer->getTileGIDAt(Vector2(0,63)); + _gid = layer->getTileGIDAt(Vec2(0,63)); ////----CCLOG("Tile GID at:(0,63) is: %d", _gid); schedule(schedule_selector(TMXReadWriteTest::updateCol), 2.0f); @@ -533,7 +533,7 @@ void TMXReadWriteTest::updateCol(float dt) for( int y=0; y< s.height; y++ ) { - layer->setTileGID(_gid2, Vector2((float)3, (float)y)); + layer->setTileGID(_gid2, Vec2((float)3, (float)y)); } _gid2 = (_gid2 + 1) % 80; @@ -550,8 +550,8 @@ void TMXReadWriteTest::repaintWithGID(float dt) for( int x=0; xgetTileGIDAt( Vector2((float)x, (float)y) ); - layer->setTileGID(tmpgid+1, Vector2((float)x, (float)y)); + unsigned int tmpgid = layer->getTileGIDAt( Vec2((float)x, (float)y) ); + layer->setTileGID(tmpgid+1, Vec2((float)x, (float)y)); } } @@ -565,7 +565,7 @@ void TMXReadWriteTest::removeTiles(float dt) for( int y=0; y< s.height; y++ ) { - layer->removeTileAt( Vector2(5.0, (float)y) ); + layer->removeTileAt( Vec2(5.0, (float)y) ); } } @@ -614,7 +614,7 @@ TMXIsoTest::TMXIsoTest() // move map to the center of the screen auto ms = map->getMapSize(); auto ts = map->getTileSize(); - map->runAction( MoveTo::create(1.0f, Vector2( -ms.width * ts.width/2, -ms.height * ts.height/2 )) ); + map->runAction( MoveTo::create(1.0f, Vec2( -ms.width * ts.width/2, -ms.height * ts.height/2 )) ); } std::string TMXIsoTest::title() const @@ -638,7 +638,7 @@ TMXIsoTest1::TMXIsoTest1() Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width,s.height); - map->setAnchorPoint(Vector2(0.5f, 0.5f)); + map->setAnchorPoint(Vec2(0.5f, 0.5f)); } std::string TMXIsoTest1::title() const @@ -665,7 +665,7 @@ TMXIsoTest2::TMXIsoTest2() // move map to the center of the screen auto ms = map->getMapSize(); auto ts = map->getTileSize(); - map->runAction( MoveTo::create(1.0f, Vector2( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )); + map->runAction( MoveTo::create(1.0f, Vec2( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )); } std::string TMXIsoTest2::title() const @@ -692,7 +692,7 @@ TMXUncompressedTest::TMXUncompressedTest() // move map to the center of the screen auto ms = map->getMapSize(); auto ts = map->getTileSize(); - map->runAction(MoveTo::create(1.0f, Vector2( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )); + map->runAction(MoveTo::create(1.0f, Vec2( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )); // testing release map TMXLayer* layer; @@ -759,14 +759,14 @@ TMXOrthoObjectsTest::TMXOrthoObjectsTest() CCLOG("%s", objectsVal.getDescription().c_str()); } -void TMXOrthoObjectsTest::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TMXOrthoObjectsTest::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(TMXOrthoObjectsTest::onDraw, this, transform, transformUpdated); renderer->addCommand(&_renderCmd); } -void TMXOrthoObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) +void TMXOrthoObjectsTest::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -790,10 +790,10 @@ void TMXOrthoObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) glLineWidth(3); - DrawPrimitives::drawLine( pos + Vector2(x, y), pos + Vector2((x+width), y) ); - DrawPrimitives::drawLine( pos + Vector2((x+width), y), pos + Vector2((x+width), (y+height)) ); - DrawPrimitives::drawLine( pos + Vector2((x+width), (y+height)), pos + Vector2(x, (y+height)) ); - DrawPrimitives::drawLine( pos + Vector2(x, (y+height)), pos + Vector2(x, y) ); + DrawPrimitives::drawLine( pos + Vec2(x, y), pos + Vec2((x+width), y) ); + DrawPrimitives::drawLine( pos + Vec2((x+width), y), pos + Vec2((x+width), (y+height)) ); + DrawPrimitives::drawLine( pos + Vec2((x+width), (y+height)), pos + Vec2(x, (y+height)) ); + DrawPrimitives::drawLine( pos + Vec2(x, (y+height)), pos + Vec2(x, y) ); glLineWidth(1); } @@ -834,14 +834,14 @@ TMXIsoObjectsTest::TMXIsoObjectsTest() CCLOG("%s", objectsVal.getDescription().c_str()); } -void TMXIsoObjectsTest::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TMXIsoObjectsTest::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(TMXIsoObjectsTest::onDraw, this, transform, transformUpdated); renderer->addCommand(&_renderCmd); } -void TMXIsoObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) +void TMXIsoObjectsTest::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -863,10 +863,10 @@ void TMXIsoObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) glLineWidth(3); - DrawPrimitives::drawLine( pos + Vector2(x,y), pos + Vector2(x+width,y) ); - DrawPrimitives::drawLine( pos + Vector2(x+width,y), pos + Vector2(x+width,y+height) ); - DrawPrimitives::drawLine( pos + Vector2(x+width,y+height), pos + Vector2(x,y+height) ); - DrawPrimitives::drawLine( pos + Vector2(x,y+height), pos + Vector2(x,y) ); + DrawPrimitives::drawLine( pos + Vec2(x,y), pos + Vec2(x+width,y) ); + DrawPrimitives::drawLine( pos + Vec2(x+width,y), pos + Vec2(x+width,y+height) ); + DrawPrimitives::drawLine( pos + Vec2(x+width,y+height), pos + Vec2(x,y+height) ); + DrawPrimitives::drawLine( pos + Vec2(x,y+height), pos + Vec2(x,y) ); glLineWidth(1); } @@ -907,7 +907,7 @@ TMXResizeTest::TMXResizeTest() { for (unsigned int x = 0; x < ls.width; x++) { - layer->setTileGID(1, Vector2( x, y ) ); + layer->setTileGID(1, Vec2( x, y ) ); } } } @@ -935,17 +935,17 @@ TMXIsoZorder::TMXIsoZorder() auto s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width,s.height); - map->setPosition(Vector2(-s.width/2,0)); + map->setPosition(Vec2(-s.width/2,0)); _tamara = Sprite::create(s_pathSister1); map->addChild(_tamara, (int)map->getChildren().size() ); _tamara->retain(); int mapWidth = map->getMapSize().width * map->getTileSize().width; - _tamara->setPosition(CC_POINT_PIXELS_TO_POINTS(Vector2( mapWidth/2,0))); - _tamara->setAnchorPoint(Vector2(0.5f,0)); + _tamara->setPosition(CC_POINT_PIXELS_TO_POINTS(Vec2( mapWidth/2,0))); + _tamara->setAnchorPoint(Vec2(0.5f,0)); - auto move = MoveBy::create(10, Vector2(300,250)); + auto move = MoveBy::create(10, Vec2(300,250)); auto back = move->reverse(); auto seq = Sequence::create(move, back,NULL); _tamara->runAction( RepeatForever::create(seq) ); @@ -1008,10 +1008,10 @@ TMXOrthoZorder::TMXOrthoZorder() _tamara = Sprite::create(s_pathSister1); map->addChild(_tamara, (int)map->getChildren().size()); _tamara->retain(); - _tamara->setAnchorPoint(Vector2(0.5f,0)); + _tamara->setAnchorPoint(Vec2(0.5f,0)); - auto move = MoveBy::create(10, Vector2(400,450)); + auto move = MoveBy::create(10, Vec2(400,450)); auto back = move->reverse(); auto seq = Sequence::create(move, back,NULL); _tamara->runAction( RepeatForever::create(seq)); @@ -1064,16 +1064,16 @@ TMXIsoVertexZ::TMXIsoVertexZ() addChild(map, 0, kTagTileMap); auto s = map->getContentSize(); - map->setPosition( Vector2(-s.width/2,0) ); + map->setPosition( Vec2(-s.width/2,0) ); CCLOG("ContentSize: %f, %f", s.width,s.height); // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you // can use any Sprite and it will work OK. auto layer = map->getLayer("Trees"); - _tamara = layer->getTileAt( Vector2(29,29) ); + _tamara = layer->getTileAt( Vec2(29,29) ); _tamara->retain(); - auto move = MoveBy::create(10, Vector2(300,250) * (1/CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(300,250) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back,NULL); _tamara->runAction( RepeatForever::create(seq) ); @@ -1141,11 +1141,11 @@ TMXOrthoVertexZ::TMXOrthoVertexZ() // because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you // can use any Sprite and it will work OK. auto layer = map->getLayer("trees"); - _tamara = layer->getTileAt(Vector2(0,11)); + _tamara = layer->getTileAt(Vec2(0,11)); CCLOG("%p vertexZ: %f", _tamara, _tamara->getPositionZ()); _tamara->retain(); - auto move = MoveBy::create(10, Vector2(400,450) * (1/CC_CONTENT_SCALE_FACTOR())); + auto move = MoveBy::create(10, Vec2(400,450) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); auto seq = Sequence::create(move, back,NULL); _tamara->runAction( RepeatForever::create(seq)); @@ -1206,7 +1206,7 @@ TMXIsoMoveLayer::TMXIsoMoveLayer() auto map = TMXTiledMap::create("TileMaps/iso-test-movelayer.tmx"); addChild(map, 0, kTagTileMap); - map->setPosition(Vector2(-700,-50)); + map->setPosition(Vec2(-700,-50)); Size CC_UNUSED s = map->getContentSize(); CCLOG("ContentSize: %f, %f", s.width,s.height); @@ -1347,7 +1347,7 @@ void TMXOrthoFlipRunTimeTest::flipIt(float dt) auto layer = map->getLayer("Layer 0"); //blue diamond - auto tileCoord = Vector2(1,10); + auto tileCoord = Vec2(1,10); int flags; unsigned int GID = layer->getTileGIDAt(tileCoord, (TMXTileFlags*)&flags); // Vertical @@ -1358,7 +1358,7 @@ void TMXOrthoFlipRunTimeTest::flipIt(float dt) layer->setTileGID(GID ,tileCoord, (TMXTileFlags)flags); - tileCoord = Vector2(1,8); + tileCoord = Vec2(1,8); GID = layer->getTileGIDAt(tileCoord, (TMXTileFlags*)&flags); // Vertical if( flags & kTMXTileVerticalFlag ) @@ -1368,7 +1368,7 @@ void TMXOrthoFlipRunTimeTest::flipIt(float dt) layer->setTileGID(GID ,tileCoord, (TMXTileFlags)flags); - tileCoord = Vector2(2,8); + tileCoord = Vec2(2,8); GID = layer->getTileGIDAt(tileCoord, (TMXTileFlags*)&flags); // Horizontal if( flags & kTMXTileHorizontalFlag ) @@ -1467,9 +1467,9 @@ TMXBug987::TMXBug987() node->getTexture()->setAntiAliasTexParameters(); } - map->setAnchorPoint(Vector2(0, 0)); + map->setAnchorPoint(Vec2(0, 0)); auto layer = map->getLayer("Tile Layer 1"); - layer->setTileGID(3, Vector2(2,2)); + layer->setTileGID(3, Vec2(2,2)); } std::string TMXBug987::title() const @@ -1523,14 +1523,14 @@ TMXGIDObjectsTest::TMXGIDObjectsTest() } -void TMXGIDObjectsTest::draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) +void TMXGIDObjectsTest::draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) { _renderCmd.init(_globalZOrder); _renderCmd.func = CC_CALLBACK_0(TMXGIDObjectsTest::onDraw, this, transform, transformUpdated); renderer->addCommand(&_renderCmd); } -void TMXGIDObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) +void TMXGIDObjectsTest::onDraw(const Mat4 &transform, bool transformUpdated) { Director* director = Director::getInstance(); CCASSERT(nullptr != director, "Director is null when seting matrix stack"); @@ -1553,10 +1553,10 @@ void TMXGIDObjectsTest::onDraw(const Matrix &transform, bool transformUpdated) glLineWidth(3); - DrawPrimitives::drawLine(pos + Vector2(x, y), pos + Vector2(x + width, y)); - DrawPrimitives::drawLine(pos + Vector2(x + width, y), pos + Vector2(x + width, y + height)); - DrawPrimitives::drawLine(pos + Vector2(x + width,y + height), pos + Vector2(x,y + height)); - DrawPrimitives::drawLine(pos + Vector2(x,y + height), pos + Vector2(x,y)); + DrawPrimitives::drawLine(pos + Vec2(x, y), pos + Vec2(x + width, y)); + DrawPrimitives::drawLine(pos + Vec2(x + width, y), pos + Vec2(x + width, y + height)); + DrawPrimitives::drawLine(pos + Vec2(x + width,y + height), pos + Vec2(x,y + height)); + DrawPrimitives::drawLine(pos + Vec2(x,y + height), pos + Vec2(x,y)); glLineWidth(1); } diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.h b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.h index 6c886af030..be8f3ec5ab 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.h +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.h @@ -134,11 +134,11 @@ public: TMXOrthoObjectsTest(void); virtual std::string title() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string subtitle() const override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); }; class TMXIsoObjectsTest : public TileDemo @@ -147,11 +147,11 @@ public: TMXIsoObjectsTest(void); virtual std::string title() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; virtual std::string subtitle() const override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); }; class TMXResizeTest : public TileDemo @@ -292,11 +292,11 @@ public: TMXGIDObjectsTest(); virtual std::string title() const override; virtual std::string subtitle() const override; - virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override; + virtual void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override; protected: CustomCommand _renderCmd; - void onDraw(const Matrix &transform, bool transformUpdated); + void onDraw(const Mat4 &transform, bool transformUpdated); }; diff --git a/tests/cpp-tests/Classes/TouchesTest/Ball.cpp b/tests/cpp-tests/Classes/TouchesTest/Ball.cpp index bb827430cc..6dddfc50f0 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Ball.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/Ball.cpp @@ -30,12 +30,12 @@ void Ball::move(float delta) if (getPosition().x > VisibleRect::right().x - radius()) { - setPosition( Vector2( VisibleRect::right().x - radius(), getPosition().y) ); + setPosition( Vec2( VisibleRect::right().x - radius(), getPosition().y) ); _velocity.x *= -1; } else if (getPosition().x < VisibleRect::left().x + radius()) { - setPosition( Vector2(VisibleRect::left().x + radius(), getPosition().y) ); + setPosition( Vec2(VisibleRect::left().x + radius(), getPosition().y) ); _velocity.x *= -1; } } @@ -60,13 +60,13 @@ void Ball::collideWithPaddle(Paddle* paddle) if (getPosition().y > midY && getPosition().y <= highY + radius()) { - setPosition( Vector2(getPosition().x, highY + radius()) ); + setPosition( Vec2(getPosition().x, highY + radius()) ); hit = true; angleOffset = (float)M_PI / 2; } else if (getPosition().y < midY && getPosition().y >= lowY - radius()) { - setPosition( Vector2(getPosition().x, lowY - radius()) ); + setPosition( Vec2(getPosition().x, lowY - radius()) ); hit = true; angleOffset = -(float)M_PI / 2; } @@ -78,7 +78,7 @@ void Ball::collideWithPaddle(Paddle* paddle) float scalarVelocity = _velocity.getLength() * 1.05f; float velocityAngle = -_velocity.getAngle() + 0.5f * hitAngle; - _velocity = Vector2::forAngle(velocityAngle) * scalarVelocity; + _velocity = Vec2::forAngle(velocityAngle) * scalarVelocity; } } } diff --git a/tests/cpp-tests/Classes/TouchesTest/Ball.h b/tests/cpp-tests/Classes/TouchesTest/Ball.h index 1f95ff75ee..18356e4315 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Ball.h +++ b/tests/cpp-tests/Classes/TouchesTest/Ball.h @@ -9,7 +9,7 @@ USING_NS_CC; class Ball : public Sprite { - Vector2 _velocity; + Vec2 _velocity; public: Ball(void); virtual ~Ball(void); @@ -22,8 +22,8 @@ public: public: - void setVelocity(Vector2 velocity){_velocity = velocity;} - Vector2 getVelocity(){return _velocity;} + void setVelocity(Vec2 velocity){_velocity = velocity;} + Vec2 getVelocity(){return _velocity;} public: static Ball* ballWithTexture(Texture2D* aTexture); diff --git a/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp b/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp index 9abd3ae98e..b173580d75 100644 --- a/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/Paddle.cpp @@ -87,7 +87,7 @@ void Paddle::onTouchMoved(Touch* touch, Event* event) auto touchPoint = touch->getLocation(); - setPosition( Vector2(touchPoint.x, getPosition().y) ); + setPosition( Vec2(touchPoint.x, getPosition().y) ); } Paddle* Paddle::clone() const diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp index 526ab86056..a752f6d8c8 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp @@ -37,7 +37,7 @@ PongScene::PongScene() //------------------------------------------------------------------ PongLayer::PongLayer() { - _ballStartingVelocity = Vector2(20.0f, -100.0f); + _ballStartingVelocity = Vec2(20.0f, -100.0f); _ball = Ball::ballWithTexture( Director::getInstance()->getTextureCache()->addImage(s_Ball) ); _ball->setPosition( VisibleRect::center() ); @@ -49,19 +49,19 @@ PongLayer::PongLayer() Vector paddlesM(4); Paddle* paddle = Paddle::createWithTexture(paddleTexture); - paddle->setPosition( Vector2(VisibleRect::center().x, VisibleRect::bottom().y + 15) ); + paddle->setPosition( Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 15) ); paddlesM.pushBack( paddle ); paddle = Paddle::createWithTexture( paddleTexture ); - paddle->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 15) ); + paddle->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 15) ); paddlesM.pushBack( paddle ); paddle = Paddle::createWithTexture( paddleTexture ); - paddle->setPosition( Vector2(VisibleRect::center().x, VisibleRect::bottom().y + 100) ); + paddle->setPosition( Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 100) ); paddlesM.pushBack( paddle ); paddle = Paddle::createWithTexture( paddleTexture ); - paddle->setPosition( Vector2(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 100) ); + paddle->setPosition( Vec2(VisibleRect::center().x, VisibleRect::top().y - kStatusBarHeight - 100) ); paddlesM.pushBack( paddle ); _paddles = paddlesM; diff --git a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h index bca0f1d393..873ced2c58 100644 --- a/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h +++ b/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h @@ -21,7 +21,7 @@ class PongLayer : public Layer private: Ball* _ball; Vector _paddles; - Vector2 _ballStartingVelocity; + Vec2 _ballStartingVelocity; public: PongLayer(); ~PongLayer(); diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp index 6050745eb9..5091bc29a5 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp @@ -262,17 +262,17 @@ TestLayer1::TestLayer1(void) y = size.height; auto bg1 = Sprite::create(s_back1); - bg1->setPosition( Vector2(size.width/2, size.height/2) ); + bg1->setPosition( Vec2(size.width/2, size.height/2) ); addChild(bg1, -1); auto title = Label::createWithTTF( (transitions[s_nSceneIdx]).name, "fonts/Thonburi.ttf", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); - title->setPosition( Vector2(x/2, y-100) ); + title->setPosition( Vec2(x/2, y-100) ); auto label = Label::createWithTTF("SCENE 1", "fonts/Marker Felt.ttf", 38); label->setColor( Color3B(16,16,255)); - label->setPosition( Vector2(x/2,y/2)); + label->setPosition( Vec2(x/2,y/2)); addChild( label); // menu @@ -282,10 +282,10 @@ TestLayer1::TestLayer1(void) auto menu = Menu::create(item1, item2, item3, NULL); - menu->setPosition( Vector2::ZERO ); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + menu->setPosition( Vec2::ZERO ); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); @@ -392,17 +392,17 @@ TestLayer2::TestLayer2() y = size.height; auto bg1 = Sprite::create(s_back2); - bg1->setPosition( Vector2(size.width/2, size.height/2) ); + bg1->setPosition( Vec2(size.width/2, size.height/2) ); addChild(bg1, -1); auto title = Label::createWithTTF((transitions[s_nSceneIdx]).name, "fonts/Thonburi.ttf", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); - title->setPosition( Vector2(x/2, y-100) ); + title->setPosition( Vec2(x/2, y-100) ); auto label = Label::createWithTTF("SCENE 2", "fonts/Marker Felt.ttf", 38); label->setColor( Color3B(16,16,255)); - label->setPosition( Vector2(x/2,y/2)); + label->setPosition( Vec2(x/2,y/2)); addChild( label); // menu @@ -412,10 +412,10 @@ TestLayer2::TestLayer2() auto menu = Menu::create(item1, item2, item3, NULL); - menu->setPosition( Vector2::ZERO ); - item1->setPosition(Vector2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(Vector2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(Vector2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + menu->setPosition( Vec2::ZERO ); + item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); + item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); addChild(menu, 1); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp index 1a2a14b52e..8b4538ea94 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp @@ -58,7 +58,7 @@ static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); // //////////////////////////////////////////////////////// -static Vector2 _curPos = Vector2::ZERO; +static Vec2 _curPos = Vec2::ZERO; void CocoStudioGUIMainLayer::onEnter() { @@ -69,13 +69,13 @@ void CocoStudioGUIMainLayer::onEnter() Size s = Director::getInstance()->getWinSize(); _itemMenu = CCMenu::create(); - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); CCMenuItemFont::setFontName("fonts/arial.ttf"); CCMenuItemFont::setFontSize(24); for (int i = 0; i < g_maxTests; ++i) { auto pItem = MenuItemFont::create(g_guisTests[i].name, g_guisTests[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height / 4 * 3 - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height / 4 * 3 - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -111,8 +111,8 @@ void CocoStudioGUITestScene::onEnter() Menu* pMenu = Menu::create(pMenuItem, NULL); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.h index 4c0bcb4fc3..88ae14ef3d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.h @@ -13,7 +13,7 @@ public: // void onTouchesMoved(const std::vector& touches, Event *event); private: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 708adbc641..4575ca7505 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -228,7 +228,7 @@ g_guisTests[] = static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); -static Vector2 s_tCurPos = Vector2::ZERO; +static Vec2 s_tCurPos = Vec2::ZERO; //////////////////////////////////////////////////////// // @@ -248,7 +248,7 @@ void CocosGUITestMainLayer::onEnter() for (int i = 0; i < g_maxTests; ++i) { auto pItem = MenuItemFont::create(g_guisTests[i].name, g_guisTests[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -276,17 +276,17 @@ void CocosGUITestMainLayer::onTouchesMoved(const std::vector& touches, E float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -311,8 +311,8 @@ void CocosGUITestScene::onEnter() Menu* pMenu =Menu::create(pMenuItem, NULL); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h index 2c9d57ccde..c8dd312d8e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h @@ -42,7 +42,7 @@ public: void onTouchesBegan(const std::vector& touches, Event *event); void onTouchesMoved(const std::vector& touches, Event *event); - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; int _testcount; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp index 95a1c5c73a..ab993ab32f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp @@ -47,7 +47,7 @@ static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); // //////////////////////////////////////////////////////// -static Vector2 _curPos = Vector2::ZERO; +static Vec2 _curPos = Vec2::ZERO; void CustomGUITestMainLayer::onEnter() @@ -63,8 +63,8 @@ void CustomGUITestMainLayer::onEnter() for (int i = 0; i < g_maxTests; ++i) { auto pItem = MenuItemFont::create(g_guisTests[i].name, g_guisTests[i].callback); -// pItem->setPosition(Vector2(s.width / 2, s.height / 2)); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); +// pItem->setPosition(Vec2(s.width / 2, s.height / 2)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -93,8 +93,8 @@ void CustomGUITestMainLayer::onTouchesMoved(const std::vector &touches, float nMoveY = touchLocation.y - _beginPos.y; - Vector2 curPos = _itemMenu->getPosition(); - Vector2 nextPos = ccp(curPos.x, curPos.y + nMoveY); + Vec2 curPos = _itemMenu->getPosition(); + Vec2 nextPos = ccp(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { @@ -124,8 +124,8 @@ void CustomGUITestScene::onEnter() Menu* pMenu = Menu::create(pMenuItem, NULL); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.h index b685b6b1d5..366f5f24d8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.h @@ -22,7 +22,7 @@ public: void touchEvent(Ref* pSender, Widget::TouchEventType type); private: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp index e1428bf3d0..0bd735b7b4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp @@ -42,8 +42,8 @@ void CustomImageScene::onEnter() Menu* pMenu = Menu::create(pMenuItem, NULL); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp index 75a40bef2b..ea7463c809 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp @@ -56,8 +56,8 @@ void CustomParticleWidgetScene::onEnter() Menu* pMenu = Menu::create(pMenuItem, NULL); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp index ede108fd62..cfc0dee635 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp @@ -82,14 +82,14 @@ const char* CustomParticleWidget::getParticlePlist() const return _emitterPlist; } -void CustomParticleWidget::setParticlePosition(const Vector2 &pos) +void CustomParticleWidget::setParticlePosition(const Vec2 &pos) { _emitter->setPosition(pos); _emitterPostion = pos; } -const Vector2& CustomParticleWidget::getParticlePosition() const +const Vec2& CustomParticleWidget::getParticlePosition() const { return _emitterPostion; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.h index 22e2f9047f..1714e04a8a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.h @@ -24,8 +24,8 @@ public: void setParticlePlist(const char* plist); const char* getParticlePlist() const; - void setParticlePosition(const cocos2d::Vector2& pos); - const cocos2d::Vector2& getParticlePosition() const; + void setParticlePosition(const cocos2d::Vec2& pos); + const cocos2d::Vec2& getParticlePosition() const; void playParticle(); @@ -40,7 +40,7 @@ protected: protected: cocos2d::ParticleSystem* _emitter; const char* _emitterPlist; - cocos2d::Vector2 _emitterPostion; + cocos2d::Vec2 _emitterPostion; }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp index 07ce30fe5d..3eaef33bb4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp @@ -256,7 +256,7 @@ g_guisTests[] = static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); -static Vector2 s_tCurPos = Vector2::ZERO; +static Vec2 s_tCurPos = Vec2::ZERO; //////////////////////////////////////////////////////// // @@ -276,7 +276,7 @@ void GUIEditorMainLayer::onEnter() for (int i = 0; i < g_maxTests; ++i) { auto pItem = MenuItemFont::create(g_guisTests[i].name, g_guisTests[i].callback); - pItem->setPosition(Vector2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); _itemMenu->addChild(pItem, kItemTagBasic + i); } @@ -304,17 +304,17 @@ void GUIEditorMainLayer::onTouchesMoved(const std::vector& touches, Even float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_maxTests + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -339,8 +339,8 @@ void GUIEditorTestScene::onEnter() Menu* pMenu =CCMenu::create(pMenuItem, nullptr); - pMenu->setPosition( Vector2::ZERO ); - pMenuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(pMenu, 1); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.h index 7a6e6a2d7c..48fa4a31cb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/GUIEditorTest.h @@ -13,7 +13,7 @@ public: void onTouchesBegan(const std::vector& touches, Event *event); void onTouchesMoved(const std::vector& touches, Event *event); private: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; int _testcount; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 51904b8368..9e4d5f9bef 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -22,15 +22,15 @@ bool UIButtonTest::init() // Add a label in which the button events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("Button","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); @@ -38,7 +38,7 @@ bool UIButtonTest::init() // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest::touchEvent, this)); _uiLayer->addChild(button); @@ -94,14 +94,14 @@ bool UIButtonTest_Scale9::init() // Add a label in which the button events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("Button scale9 render", "fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); @@ -109,7 +109,7 @@ bool UIButtonTest_Scale9::init() Button* button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); // open scale9 render button->setScale9Enabled(true); - button->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setSize(Size(150, 70)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest_Scale9::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); @@ -163,15 +163,15 @@ bool UIButtonTest_PressedAction::init() // Add a label in which the button events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("Button Pressed Action", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); @@ -179,7 +179,7 @@ bool UIButtonTest_PressedAction::init() // Create the button Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPressedActionEnabled(true); - button->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest_PressedAction::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); _uiLayer->addChild(button); @@ -233,14 +233,14 @@ bool UIButtonTest_Title::init() // Add a label in which the text button events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("Button with title", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); @@ -248,7 +248,7 @@ bool UIButtonTest_Title::init() // Create the button with title Button* button = Button::create("cocosui/backtotoppressed.png", "cocosui/backtotopnormal.png"); button->setTitleText("Title Button"); - button->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); // button->addTouchEventListener(this, toucheventselector(UIButtonTest_Title::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); _uiLayer->addChild(button); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp index 73c41acc5d..92f99b224d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp @@ -24,7 +24,7 @@ bool UIButtonTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -51,7 +51,7 @@ bool UIButtonTest_Editor::init() _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); _displayValueLabel->setString("No event"); - _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, + _displayValueLabel->setPosition(Vec2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index a91cce09f5..a8741a1ae8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -22,14 +22,14 @@ bool UICheckBoxTest::init() // Add a label in which the checkbox events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("CheckBox","fonts/Marker Felt.ttf",30 ); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the checkbox @@ -38,7 +38,7 @@ bool UICheckBoxTest::init() "cocosui/check_box_active.png", "cocosui/check_box_normal_disable.png", "cocosui/check_box_active_disable.png"); - checkBox->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + checkBox->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); checkBox->addEventListener(CC_CALLBACK_2(UICheckBoxTest::selectedEvent, this)); _uiLayer->addChild(checkBox); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp index 283105c988..5ea65d689a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp @@ -24,7 +24,7 @@ bool UICheckBoxTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -41,7 +41,7 @@ bool UICheckBoxTest_Editor::init() _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); _displayValueLabel->setString("No event"); - _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, + _displayValueLabel->setPosition(Vec2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index 585c4f39e6..5cf01a629c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -30,23 +30,23 @@ bool UIFocusTestBase::init() auto winSize = Director::getInstance()->getVisibleSize(); auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this)); - leftItem->setPosition(Vector2(winSize.width - 100, winSize.height/2)); + leftItem->setPosition(Vec2(winSize.width - 100, winSize.height/2)); _dpadMenu->addChild(leftItem); auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this)); - rightItem->setPosition(Vector2(winSize.width - 30, winSize.height/2)); + rightItem->setPosition(Vec2(winSize.width - 30, winSize.height/2)); _dpadMenu->addChild(rightItem); auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this)); - upItem->setPosition(Vector2(winSize.width - 60, winSize.height/2 + 50)); + upItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 + 50)); _dpadMenu->addChild(upItem); auto downItem = MenuItemFont::create("Down", CC_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this)); - downItem->setPosition(Vector2(winSize.width - 60, winSize.height/2 - 50)); + downItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 - 50)); _dpadMenu->addChild(downItem); - _dpadMenu->setPosition(Vector2::ZERO); + _dpadMenu->setPosition(Vec2::ZERO); _uiLayer->addChild(_dpadMenu); _eventListener = EventListenerFocus::create(); @@ -153,7 +153,7 @@ bool UIFocusTestHorizontal::init() Size winSize = Director::getInstance()->getVisibleSize(); _horizontalLayout = HBox::create(); - _horizontalLayout->setPosition(Vector2(20, winSize.height/2 + 40)); + _horizontalLayout->setPosition(Vec2(20, winSize.height/2 + 40)); _uiLayer->addChild(_horizontalLayout); _horizontalLayout->setFocused(true); @@ -171,13 +171,13 @@ bool UIFocusTestHorizontal::init() } _loopText = Text::create("loop enabled", "Airal", 20); - _loopText->setPosition(Vector2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); auto btn = Button::create("cocosui/switch-mask.png"); btn->setTitleText("Toggle Loop"); - btn->setPosition(Vector2(60, winSize.height - 50)); + btn->setPosition(Vec2(60, winSize.height - 50)); btn->setTitleColor(Color3B::RED); btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop,this)); this->addChild(btn); @@ -222,7 +222,7 @@ bool UIFocusTestVertical::init() Size winSize = Director::getInstance()->getVisibleSize(); _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vector2(winSize.width/2 - 100, winSize.height - 70)); + _verticalLayout->setPosition(Vec2(winSize.width/2 - 100, winSize.height - 70)); _uiLayer->addChild(_verticalLayout); _verticalLayout->setTag(100); _verticalLayout->setScale(0.5); @@ -244,13 +244,13 @@ bool UIFocusTestVertical::init() } _loopText = Text::create("loop enabled", "Airal", 20); - _loopText->setPosition(Vector2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); auto btn = Button::create("cocosui/switch-mask.png"); btn->setTitleText("Toggle Loop"); - btn->setPosition(Vector2(60, winSize.height - 50)); + btn->setPosition(Vec2(60, winSize.height - 50)); btn->setTitleColor(Color3B::RED); btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this)); this->addChild(btn); @@ -292,7 +292,7 @@ bool UIFocusTestNestedLayout1::init() Size winSize = Director::getInstance()->getVisibleSize(); _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vector2(winSize.width/2 - 80, winSize.height - 70)); + _verticalLayout->setPosition(Vec2(winSize.width/2 - 80, winSize.height - 70)); _uiLayer->addChild(_verticalLayout); _verticalLayout->setScale(0.5); @@ -304,7 +304,7 @@ bool UIFocusTestNestedLayout1::init() int count1 = 1; for (int i=0; isetAnchorPoint(Vector2::ZERO); + w->setAnchorPoint(Vec2::ZERO); w->setTouchEnabled(true); w->setScaleX(2.5); w->setTag(i+count1); @@ -321,7 +321,7 @@ bool UIFocusTestNestedLayout1::init() int count2 = 2; for (int i=0; i < count2; ++i) { ImageView *w = ImageView::create("cocosui/scrollviewbg.png"); - w->setAnchorPoint(Vector2(0,1)); + w->setAnchorPoint(Vec2(0,1)); w->setScaleY(2.0); w->setTouchEnabled(true); w->setTag(i+count1+count2); @@ -346,13 +346,13 @@ bool UIFocusTestNestedLayout1::init() } _loopText = Text::create("loop enabled", "Airal", 20); - _loopText->setPosition(Vector2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); auto btn = Button::create("cocosui/switch-mask.png"); btn->setTitleText("Toggle Loop"); - btn->setPosition(Vector2(60, winSize.height - 50)); + btn->setPosition(Vec2(60, winSize.height - 50)); btn->setTitleColor(Color3B::RED); btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this)); this->addChild(btn); @@ -394,7 +394,7 @@ bool UIFocusTestNestedLayout2::init() Size winSize = Director::getInstance()->getVisibleSize(); _horizontalLayout = HBox::create(); - _horizontalLayout->setPosition(Vector2(winSize.width/2 - 200, winSize.height - 70)); + _horizontalLayout->setPosition(Vec2(winSize.width/2 - 200, winSize.height - 70)); _uiLayer->addChild(_horizontalLayout); _horizontalLayout->setScale(0.6); @@ -406,7 +406,7 @@ bool UIFocusTestNestedLayout2::init() int count1 = 2; for (int i=0; isetAnchorPoint(Vector2(0,1)); + w->setAnchorPoint(Vec2(0,1)); w->setTouchEnabled(true); w->setTag(i+count1); w->setScaleY(2.4); @@ -423,7 +423,7 @@ bool UIFocusTestNestedLayout2::init() int count2 = 2; for (int i=0; i < count2; ++i) { ImageView *w = ImageView::create("cocosui/scrollviewbg.png"); - w->setAnchorPoint(Vector2(0,1)); + w->setAnchorPoint(Vec2(0,1)); w->setScaleX(2.0); w->setTouchEnabled(true); w->setTag(i+count1+count2); @@ -448,13 +448,13 @@ bool UIFocusTestNestedLayout2::init() } _loopText = Text::create("loop enabled", "Airal", 20); - _loopText->setPosition(Vector2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); auto btn = Button::create("cocosui/switch-mask.png"); btn->setTitleText("Toggle Loop"); - btn->setPosition(Vector2(60, winSize.height - 50)); + btn->setPosition(Vec2(60, winSize.height - 50)); btn->setTitleColor(Color3B::RED); btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this)); this->addChild(btn); @@ -496,7 +496,7 @@ bool UIFocusTestNestedLayout3::init() Size winSize = Director::getInstance()->getVisibleSize(); _verticalLayout = VBox::create(); - _verticalLayout->setPosition(Vector2(40, winSize.height - 70)); + _verticalLayout->setPosition(Vec2(40, winSize.height - 70)); _uiLayer->addChild(_verticalLayout); _verticalLayout->setScale(0.8); @@ -558,13 +558,13 @@ bool UIFocusTestNestedLayout3::init() _loopText = Text::create("loop enabled", "Airal", 20); - _loopText->setPosition(Vector2(winSize.width/2, winSize.height - 50)); + _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50)); _loopText->setColor(Color3B::GREEN); this->addChild(_loopText); auto btn = Button::create("cocosui/switch-mask.png"); btn->setTitleText("Toggle Loop"); - btn->setPosition(Vector2(60, winSize.height - 50)); + btn->setPosition(Vec2(60, winSize.height - 50)); btn->setTitleColor(Color3B::RED); btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this)); this->addChild(btn); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index b5ac88cc59..57159b104a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -13,14 +13,14 @@ bool UIImageViewTest::init() Text* alert = Text::create("ImageView", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the imageview ImageView* imageView = ImageView::create("cocosui/ccicon.png"); - imageView->setPosition(Vector2(widgetSize.width / 2.0f, + imageView->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(imageView); @@ -43,7 +43,7 @@ bool UIImageViewTest_Scale9::init() Text* alert = Text::create("ImageView scale9 render", "fonts/Marker Felt.ttf", 26); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.125f)); _uiLayer->addChild(alert); @@ -52,7 +52,7 @@ bool UIImageViewTest_Scale9::init() ImageView* imageView = ImageView::create("cocosui/buttonHighlighted.png"); imageView->setScale9Enabled(true); imageView->setSize(Size(300, 115)); - imageView->setPosition(Vector2(widgetSize.width / 2.0f, + imageView->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(imageView); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp index c0cf97ad2e..c0e9f0ba16 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp @@ -13,7 +13,7 @@ bool UIImageViewTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index 9d0d26090e..3f84b98642 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -22,7 +22,7 @@ bool UILayoutTest::init() // Add the alert Text* alert = Text::create("Layout", "fonts/Marker Felt.ttf", 30 ); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); @@ -35,26 +35,26 @@ bool UILayoutTest::init() Layout* layout = Layout::create(); layout->setSize(Size(280, 150)); Size backgroundSize = background->getSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); _uiLayer->addChild(layout); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, layout->getSize().height - button->getSize().height / 2.0f)); layout->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + titleButton->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(layout->getSize().width - button_scale9->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(layout->getSize().width - button_scale9->getSize().width / 2.0f, button_scale9->getSize().height / 2.0f)); layout->addChild(button_scale9); @@ -84,7 +84,7 @@ bool UILayoutTest_Color::init() // Add the alert Text* alert = Text::create("Layout color render", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); @@ -99,27 +99,27 @@ bool UILayoutTest_Color::init() layout->setBackGroundColor(Color3B(128, 128, 128)); layout->setSize(Size(280, 150)); Size backgroundSize = background->getContentSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); _uiLayer->addChild(layout); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, layout->getSize().height - button->getSize().height / 2.0f)); layout->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + titleButton->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(layout->getSize().width - button_scale9->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(layout->getSize().width - button_scale9->getSize().width / 2.0f, button_scale9->getSize().height / 2.0f)); layout->addChild(button_scale9); @@ -148,7 +148,7 @@ bool UILayoutTest_Gradient::init() // Add the alert Text* alert = Text::create("Layout gradient render", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); @@ -163,27 +163,27 @@ bool UILayoutTest_Gradient::init() layout->setBackGroundColor(Color3B(64, 64, 64), Color3B(192, 192, 192)); layout->setSize(Size(280, 150)); Size backgroundSize = background->getContentSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); _uiLayer->addChild(layout); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, layout->getSize().height - button->getSize().height / 2.0f)); layout->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + titleButton->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(layout->getSize().width - button_scale9->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(layout->getSize().width - button_scale9->getSize().width / 2.0f, button_scale9->getSize().height / 2.0f)); layout->addChild(button_scale9); @@ -212,7 +212,7 @@ bool UILayoutTest_BackGroundImage::init() // Add the alert Text* alert = Text::create("Layout background image", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -225,26 +225,26 @@ bool UILayoutTest_BackGroundImage::init() layout->setBackGroundImage("cocosui/Hello.png"); layout->setSize(Size(280, 150)); Size backgroundSize = background->getContentSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); _uiLayer->addChild(layout); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, layout->getSize().height - button->getSize().height / 2.0f)); layout->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + titleButton->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(layout->getSize().width - button_scale9->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(layout->getSize().width - button_scale9->getSize().width / 2.0f, button_scale9->getSize().height / 2.0f)); layout->addChild(button_scale9); @@ -273,7 +273,7 @@ bool UILayoutTest_BackGroundImage_Scale9::init() // Add the alert Text* alert = Text::create("Layout background image scale9", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -286,27 +286,27 @@ bool UILayoutTest_BackGroundImage_Scale9::init() layout->setBackGroundImage("cocosui/green_edit.png"); layout->setSize(Size(280, 150)); Size backgroundSize = background->getContentSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); _uiLayer->addChild(layout); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, layout->getSize().height - button->getSize().height / 2.0f)); layout->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + titleButton->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(layout->getSize().width - button_scale9->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(layout->getSize().width - button_scale9->getSize().width / 2.0f, button_scale9->getSize().height / 2.0f)); layout->addChild(button_scale9); @@ -334,7 +334,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init() // Add the alert Text* alert = Text::create("Layout Linear Vertical", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); @@ -348,7 +348,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init() layout->setLayoutType(LayoutType::VERTICAL); layout->setSize(Size(280, 150)); Size backgroundSize = background->getSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); @@ -410,7 +410,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init() // Add the alert Text* alert = Text::create("Layout Linear Horizontal", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -423,7 +423,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init() layout->setClippingEnabled(true); layout->setSize(Size(280, 150)); Size backgroundSize = background->getSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); @@ -484,7 +484,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init() // Add the alert Text* alert = Text::create("Layout Relative Align Parent", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -498,7 +498,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init() layout->setBackGroundColorType(Layout::BackGroundColorType::SOLID); layout->setBackGroundColor(Color3B::GREEN); Size backgroundSize = background->getSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); @@ -619,7 +619,7 @@ bool UILayoutTest_Layout_Relative_Location::init() // Add the alert Text* alert = Text::create("Layout Relative Location", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -631,7 +631,7 @@ bool UILayoutTest_Layout_Relative_Location::init() layout->setLayoutType(LayoutType::RELATIVE); layout->setSize(Size(280, 150)); Size backgroundSize = background->getSize(); - layout->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + layout->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - layout->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - layout->getSize().height) / 2.0f)); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp index 73bb29be55..792ed2b36a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp @@ -23,7 +23,7 @@ bool UILayoutTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -35,7 +35,7 @@ bool UILayoutTest_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -44,7 +44,7 @@ bool UILayoutTest_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -78,7 +78,7 @@ bool UILayoutTest_Color_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -90,7 +90,7 @@ bool UILayoutTest_Color_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -99,7 +99,7 @@ bool UILayoutTest_Color_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -133,7 +133,7 @@ bool UILayoutTest_Gradient_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -145,7 +145,7 @@ bool UILayoutTest_Gradient_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -154,7 +154,7 @@ bool UILayoutTest_Gradient_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -188,7 +188,7 @@ bool UILayoutTest_BackGroundImage_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -200,7 +200,7 @@ bool UILayoutTest_BackGroundImage_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -209,7 +209,7 @@ bool UILayoutTest_BackGroundImage_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -243,7 +243,7 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -255,7 +255,7 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -264,7 +264,7 @@ bool UILayoutTest_BackGroundImage_Scale9_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -298,7 +298,7 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -310,7 +310,7 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -319,7 +319,7 @@ bool UILayoutTest_Layout_Linear_Vertical_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -353,7 +353,7 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -365,7 +365,7 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -374,7 +374,7 @@ bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -409,7 +409,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -421,7 +421,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -430,7 +430,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -464,7 +464,7 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -476,7 +476,7 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -485,7 +485,7 @@ bool UILayoutTest_Layout_Relative_Location_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 7420215b41..f99d14485e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -25,15 +25,15 @@ bool UIListViewTest_Vertical::init() Size widgetSize = _widget->getSize(); _displayValueLabel = Text::create("Move by vertical direction", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); Text* alert = Text::create("ListView vertical", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); @@ -62,7 +62,7 @@ bool UIListViewTest_Vertical::init() listView->setBackGroundImage("cocosui/green_edit.png"); listView->setBackGroundImageScale9Enabled(true); listView->setSize(Size(240, 130)); - listView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + listView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - listView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - listView->getSize().height) / 2.0f)); @@ -77,7 +77,7 @@ bool UIListViewTest_Vertical::init() Layout* default_item = Layout::create(); default_item->setTouchEnabled(true); default_item->setSize(default_button->getSize()); - default_button->setPosition(Vector2(default_item->getSize().width / 2.0f, + default_button->setPosition(Vec2(default_item->getSize().width / 2.0f, default_item->getSize().height / 2.0f)); default_item->addChild(default_button); @@ -106,7 +106,7 @@ bool UIListViewTest_Vertical::init() Layout *custom_item = Layout::create(); custom_item->setSize(custom_button->getSize()); - custom_button->setPosition(Vector2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); + custom_button->setPosition(Vec2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); custom_item->addChild(custom_button); listView->pushBackCustomItem(custom_item); @@ -123,7 +123,7 @@ bool UIListViewTest_Vertical::init() Layout *custom_item = Layout::create(); custom_item->setSize(custom_button->getSize()); - custom_button->setPosition(Vector2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); + custom_button->setPosition(Vec2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); custom_item->addChild(custom_button); listView->insertCustomItem(custom_item, items_count); @@ -201,8 +201,8 @@ bool UIListViewTest_Horizontal::init() Size widgetSize = _widget->getSize(); _displayValueLabel = Text::create("Move by horizontal direction", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); @@ -211,7 +211,7 @@ bool UIListViewTest_Horizontal::init() Text* alert = Text::create("ListView horizontal", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -239,7 +239,7 @@ bool UIListViewTest_Horizontal::init() listView->setBackGroundImage("cocosui/green_edit.png"); listView->setBackGroundImageScale9Enabled(true); listView->setSize(Size(240, 130)); - listView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + listView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - listView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - listView->getSize().height) / 2.0f)); @@ -254,7 +254,7 @@ bool UIListViewTest_Horizontal::init() Layout *default_item = Layout::create(); default_item->setTouchEnabled(true); default_item->setSize(default_button->getSize()); - default_button->setPosition(Vector2(default_item->getSize().width / 2.0f, default_item->getSize().height / 2.0f)); + default_button->setPosition(Vec2(default_item->getSize().width / 2.0f, default_item->getSize().height / 2.0f)); default_item->addChild(default_button); // set model @@ -282,7 +282,7 @@ bool UIListViewTest_Horizontal::init() Layout* custom_item = Layout::create(); custom_item->setSize(custom_button->getSize()); - custom_button->setPosition(Vector2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); + custom_button->setPosition(Vec2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); custom_item->addChild(custom_button); listView->pushBackCustomItem(custom_item); @@ -299,7 +299,7 @@ bool UIListViewTest_Horizontal::init() Layout* custom_item = Layout::create(); custom_item->setSize(custom_button->getSize()); - custom_button->setPosition(Vector2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); + custom_button->setPosition(Vec2(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f)); custom_item->addChild(custom_button); listView->insertCustomItem(custom_item, items_count); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp index a1ac86f748..15f5f5567a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp @@ -23,7 +23,7 @@ bool UIListViewTest_Vertical_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -38,7 +38,7 @@ bool UIListViewTest_Vertical_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); @@ -49,7 +49,7 @@ bool UIListViewTest_Vertical_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -84,7 +84,7 @@ bool UIListViewTest_Horizontal_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -96,7 +96,7 @@ bool UIListViewTest_Horizontal_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); @@ -105,7 +105,7 @@ bool UIListViewTest_Horizontal_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 7722f2e3b5..97fe852f1e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -27,13 +27,13 @@ bool UILoadingBarTest_Left::init() // Add the alert Text* alert = Text::create("LoadingBar left", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the loading bar LoadingBar* loadingBar = LoadingBar::create("cocosui/sliderProgress.png"); loadingBar->setTag(0); - loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, + loadingBar->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); _uiLayer->addChild(loadingBar); @@ -105,7 +105,7 @@ bool UILoadingBarTest_Right::init() // Add the alert Text *alert = Text::create("LoadingBar right", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the loading bar @@ -113,7 +113,7 @@ bool UILoadingBarTest_Right::init() loadingBar->setTag(0); loadingBar->setDirection(LoadingBar::Direction::RIGHT); - loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, + loadingBar->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); _uiLayer->addChild(loadingBar); @@ -185,7 +185,7 @@ bool UILoadingBarTest_Left_Scale9::init() // Add the alert Text* alert = Text::create("LoadingBar left scale9 render", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f)); _uiLayer->addChild(alert); // Create the loading bar @@ -195,7 +195,7 @@ bool UILoadingBarTest_Left_Scale9::init() loadingBar->setCapInsets(Rect(0, 0, 0, 0)); loadingBar->setSize(Size(300, 13)); - loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, + loadingBar->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); _uiLayer->addChild(loadingBar); @@ -267,7 +267,7 @@ bool UILoadingBarTest_Right_Scale9::init() // Add the alert Text *alert = Text::create("LoadingBar right scale9 render", "fonts/Marker Felt.ttf", 20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f)); _uiLayer->addChild(alert); // Create the loading bar @@ -278,7 +278,7 @@ bool UILoadingBarTest_Right_Scale9::init() loadingBar->setSize(Size(300, 13)); loadingBar->setDirection(LoadingBar::Direction::RIGHT); - loadingBar->setPosition(Vector2(widgetSize.width / 2.0f, + loadingBar->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + loadingBar->getSize().height / 4.0f)); _uiLayer->addChild(loadingBar); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp index 7e5b0e9d75..63c0c15386 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp @@ -25,7 +25,7 @@ bool UILoadingBarTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 6fa60775b1..55364c7fbb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -22,8 +22,8 @@ bool UIPageViewTest::init() // Add a label in which the dragpanel events will be displayed _displayValueLabel = Text::create("Move by horizontal direction", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5)); _uiLayer->addChild(_displayValueLabel); @@ -31,7 +31,7 @@ bool UIPageViewTest::init() // Add the black background Text* alert = Text::create("PageView", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -42,7 +42,7 @@ bool UIPageViewTest::init() PageView* pageView = PageView::create(); pageView->setSize(Size(240.0f, 130.0f)); Size backgroundSize = background->getContentSize(); - pageView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + pageView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - pageView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - pageView->getSize().height) / 2.0f)); @@ -55,12 +55,12 @@ bool UIPageViewTest::init() ImageView* imageView = ImageView::create("cocosui/scrollviewbg.png"); imageView->setScale9Enabled(true); imageView->setSize(Size(240, 130)); - imageView->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + imageView->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(imageView); Text* label = Text::create(StringUtils::format("page %d",(i+1)), "fonts/Marker Felt.ttf", 30); label->setColor(Color3B(192, 192, 192)); - label->setPosition(Vector2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); + label->setPosition(Vec2(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f)); layout->addChild(label); pageView->addPage(layout); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp index 2e672da0ed..cec0c535f9 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp @@ -24,7 +24,7 @@ bool UIPageViewTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -36,7 +36,7 @@ bool UIPageViewTest_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -45,7 +45,7 @@ bool UIPageViewTest_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index c2de04c2ba..455dd43d4d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -23,14 +23,14 @@ bool UIRichTextTest::init() // Add the alert Text *alert = Text::create("RichText", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.125)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.125)); _widget->addChild(alert); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setTouchEnabled(true); button->setTitleText("switch"); - button->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + button->getSize().height * 2.5)); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + button->getSize().height * 2.5)); // button->addTouchEventListener(this, toucheventselector(UIRichTextTest::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIRichTextTest::touchEvent, this)); button->setLocalZOrder(10); @@ -65,7 +65,7 @@ bool UIRichTextTest::init() _richText->pushBackElement(recustom); _richText->pushBackElement(re6); - _richText->setPosition(Vector2(widgetSize.width / 2, widgetSize.height / 2)); + _richText->setPosition(Vec2(widgetSize.width / 2, widgetSize.height / 2)); _richText->setLocalZOrder(10); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.cpp index 5f95948878..7d739ba69a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.cpp @@ -31,7 +31,7 @@ bool UIScene::init() Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _widget->getSize(); - _uiLayer->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _uiLayer->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -55,7 +55,7 @@ bool UIScene::init() mainMenuLabel->setText("MainMenu"); mainMenuLabel->setFontSize(20); mainMenuLabel->setTouchScaleChangeEnabled(true); - mainMenuLabel->setPosition(Vector2(430,30)); + mainMenuLabel->setPosition(Vec2(430,30)); mainMenuLabel->setTouchEnabled(true); mainMenuLabel->addTouchEventListener(this, toucheventselector(UIScene::menuCloseCallback)); _uiLayer->addWidget(mainMenuLabel); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index 14948b75f5..cec7e6ca6f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -22,15 +22,15 @@ bool UIScrollViewTest_Vertical::init() // Add a label in which the scrollview alert will be displayed _displayValueLabel = Text::create("Move by vertical direction", "fonts/Marker Felt.ttf", 32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("ScrollView vertical", "fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -41,7 +41,7 @@ bool UIScrollViewTest_Vertical::init() ui::ScrollView* scrollView = ui::ScrollView::create(); scrollView->setSize(Size(280.0f, 150.0f)); Size backgroundSize = background->getContentSize(); - scrollView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + scrollView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - scrollView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - scrollView->getSize().height) / 2.0f)); @@ -55,21 +55,21 @@ bool UIScrollViewTest_Vertical::init() scrollView->setInnerContainerSize(Size(innerWidth, innerHeight)); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(innerWidth / 2.0f, scrollView->getInnerContainerSize().height - button->getSize().height / 2.0f)); + button->setPosition(Vec2(innerWidth / 2.0f, scrollView->getInnerContainerSize().height - button->getSize().height / 2.0f)); scrollView->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(innerWidth / 2.0f, button->getBottomInParent() - button->getSize().height)); + titleButton->setPosition(Vec2(innerWidth / 2.0f, button->getBottomInParent() - button->getSize().height)); scrollView->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(innerWidth / 2.0f, titleButton->getBottomInParent() - titleButton->getSize().height)); + button_scale9->setPosition(Vec2(innerWidth / 2.0f, titleButton->getBottomInParent() - titleButton->getSize().height)); scrollView->addChild(button_scale9); - imageView->setPosition(Vector2(innerWidth / 2.0f, imageView->getSize().height / 2.0f)); + imageView->setPosition(Vec2(innerWidth / 2.0f, imageView->getSize().height / 2.0f)); scrollView->addChild(imageView); return true; @@ -97,13 +97,13 @@ bool UIScrollViewTest_Horizontal::init() // Add a label in which the scrollview alert will be displayed _displayValueLabel = Text::create("Move by horizontal direction","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); Text* alert = Text::create("ScrollView horizontal","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -117,7 +117,7 @@ bool UIScrollViewTest_Horizontal::init() scrollView->setSize(Size(280.0f, 150.0f)); scrollView->setInnerContainerSize(scrollView->getSize()); Size backgroundSize = background->getContentSize(); - scrollView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + scrollView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - scrollView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - scrollView->getSize().height) / 2.0f)); @@ -131,24 +131,24 @@ bool UIScrollViewTest_Horizontal::init() scrollView->setInnerContainerSize(Size(innerWidth, innerHeight)); Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); - button->setPosition(Vector2(button->getSize().width / 2.0f, + button->setPosition(Vec2(button->getSize().width / 2.0f, scrollView->getInnerContainerSize().height - button->getSize().height / 2.0f)); scrollView->addChild(button); Button* titleButton = Button::create("cocosui/backtotopnormal.png", "cocosui/backtotoppressed.png"); titleButton->setTitleText("Title Button"); - titleButton->setPosition(Vector2(button->getRightInParent() + button->getSize().width / 2.0f, + titleButton->setPosition(Vec2(button->getRightInParent() + button->getSize().width / 2.0f, button->getBottomInParent() - button->getSize().height / 2.0f)); scrollView->addChild(titleButton); Button* button_scale9 = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); button_scale9->setScale9Enabled(true); button_scale9->setSize(Size(100.0f, button_scale9->getVirtualRendererSize().height)); - button_scale9->setPosition(Vector2(titleButton->getRightInParent() + titleButton->getSize().width / 2.0f, + button_scale9->setPosition(Vec2(titleButton->getRightInParent() + titleButton->getSize().width / 2.0f, titleButton->getBottomInParent() - titleButton->getSize().height / 2.0f)); scrollView->addChild(button_scale9); - imageView->setPosition(Vector2(innerWidth - imageView->getSize().width / 2.0f, + imageView->setPosition(Vec2(innerWidth - imageView->getSize().width / 2.0f, button_scale9->getBottomInParent() - button_scale9->getSize().height / 2.0f)); scrollView->addChild(imageView); @@ -177,14 +177,14 @@ bool UIScrollViewTest_Both::init() // Add a label in which the dragpanel events will be displayed _displayValueLabel = Text::create("Move by any direction","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("ScrollView both","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -200,7 +200,7 @@ bool UIScrollViewTest_Both::init() scrollView->setBackGroundImage("cocosui/green_edit.png"); scrollView->setSize(Size(210, 122.5)); Size backgroundSize = background->getContentSize(); - scrollView->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + scrollView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - scrollView->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - scrollView->getSize().height) / 2.0f)); @@ -209,7 +209,7 @@ bool UIScrollViewTest_Both::init() scrollView->setInnerContainerSize(imageView->getContentSize()); Size innerSize = scrollView->getInnerContainerSize(); - imageView->setPosition(Vector2(innerSize.width / 2.0f, innerSize.height / 2.0f)); + imageView->setPosition(Vec2(innerSize.width / 2.0f, innerSize.height / 2.0f)); _uiLayer->addChild(scrollView); @@ -238,14 +238,14 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init() // Add a label in which the dragpanel events will be displayed _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",30); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("ScrollView scroll to percent both directrion","fonts/Marker Felt.ttf",20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -259,13 +259,13 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init() sc->setInnerContainerSize(Size(480, 320)); sc->setSize(Size(100,100)); Size backgroundSize = background->getContentSize(); - sc->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + sc->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - sc->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - sc->getSize().height) / 2.0f)); - sc->scrollToPercentBothDirection(Vector2(50, 50), 1, true); + sc->scrollToPercentBothDirection(Vec2(50, 50), 1, true); ImageView* iv = ImageView::create("cocosui/Hello.png"); - iv->setPosition(Vector2(240, 160)); + iv->setPosition(Vec2(240, 160)); sc->addChild(iv); _uiLayer->addChild(sc); @@ -293,14 +293,14 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init() // Add a label in which the dragpanel events will be displayed _displayValueLabel = Text::create("No Event","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("ScrollView scroll to percent both directrion bounce","fonts/Marker Felt.ttf",20); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5)); _uiLayer->addChild(alert); Layout* root = static_cast(_uiLayer->getChildByTag(81)); @@ -315,13 +315,13 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init() sc->setInnerContainerSize(Size(480, 320)); sc->setSize(Size(100,100)); Size backgroundSize = background->getContentSize(); - sc->setPosition(Vector2((widgetSize.width - backgroundSize.width) / 2.0f + + sc->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - sc->getSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + (backgroundSize.height - sc->getSize().height) / 2.0f)); - sc->scrollToPercentBothDirection(Vector2(50, 50), 1, true); + sc->scrollToPercentBothDirection(Vec2(50, 50), 1, true); ImageView* iv = ImageView::create("cocosui/Hello.png"); - iv->setPosition(Vector2(240, 160)); + iv->setPosition(Vec2(240, 160)); sc->addChild(iv); _uiLayer->addChild(sc); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp index 44b4a3f5d2..dc7584afe9 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp @@ -23,7 +23,7 @@ bool UIScrollViewTest_Vertical_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -35,7 +35,7 @@ bool UIScrollViewTest_Vertical_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -44,7 +44,7 @@ bool UIScrollViewTest_Vertical_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -78,7 +78,7 @@ bool UIScrollViewTest_Horizontal_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -90,7 +90,7 @@ bool UIScrollViewTest_Horizontal_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -99,7 +99,7 @@ bool UIScrollViewTest_Horizontal_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -133,7 +133,7 @@ bool UIScrollViewTest_Both_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -145,7 +145,7 @@ bool UIScrollViewTest_Both_Editor::init() Button* left_button = Button::create(); left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vector2(_layout->getSize().width / 2 - left_button->getSize().width, + left_button->setPosition(Vec2(_layout->getSize().width / 2 - left_button->getSize().width, left_button->getSize().height * 0.625)); left_button->setTouchEnabled(true); left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); @@ -154,7 +154,7 @@ bool UIScrollViewTest_Both_Editor::init() Button* right_button = Button::create(); right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vector2(_layout->getSize().width / 2 + right_button->getSize().width, + right_button->setPosition(Vec2(_layout->getSize().width / 2 + right_button->getSize().width, right_button->getSize().height * 0.625)); right_button->setTouchEnabled(true); right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); @@ -188,7 +188,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -234,7 +234,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index 1dafc7582d..04ab088cc5 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -23,14 +23,14 @@ bool UISliderTest::init() // Add a label in which the slider alert will be displayed _displayValueLabel = Text::create("Move the slider thumb","Move the slider thumb",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("Slider","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the slider @@ -38,7 +38,7 @@ bool UISliderTest::init() slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); - slider->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f/* + slider->getSize().height * 2.0f*/)); + slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f/* + slider->getSize().height * 2.0f*/)); slider->addEventListener(CC_CALLBACK_2(UISliderTest::sliderEvent, this)); _uiLayer->addChild(slider); @@ -78,14 +78,14 @@ bool UISliderTest_Scale9::init() // Add a label in which the slider alert will be displayed _displayValueLabel = Text::create("Move the slider thumb","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text *alert = Text::create("Slider scale9 render","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the slider @@ -96,7 +96,7 @@ bool UISliderTest_Scale9::init() slider->setScale9Enabled(true); slider->setCapInsets(Rect(0, 0, 0, 0)); slider->setSize(Size(250.0f, 19)); - slider->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f/* + slider->getSize().height * 3.0f*/)); + slider->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f/* + slider->getSize().height * 3.0f*/)); slider->addEventListener(CC_CALLBACK_2(UISliderTest_Scale9::sliderEvent, this)); _uiLayer->addChild(slider); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp index 69bb9273e0..c6d0e0ea45 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp @@ -24,7 +24,7 @@ bool UISliderTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -46,7 +46,7 @@ bool UISliderTest_Editor::init() _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); _displayValueLabel->setString("No event"); - _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, + _displayValueLabel->setPosition(Vec2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index 2d0998723c..1bf5bee405 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -14,12 +14,12 @@ bool UITextAtlasTest::init() // Add the alert Text* alert = Text::create("TextAtlas","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the text atlas TextAtlas* textAtlas = TextAtlas::create("1234567890", "cocosui/labelatlas.png", 17, 22, "0"); - textAtlas->setPosition(Vector2((widgetSize.width) / 2, widgetSize.height / 2.0f)); + textAtlas->setPosition(Vec2((widgetSize.width) / 2, widgetSize.height / 2.0f)); _uiLayer->addChild(textAtlas); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp index 6077d19e18..396337a5eb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp @@ -12,7 +12,7 @@ bool UITextAtlasTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index 3501d4f860..916ba0efbf 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -13,12 +13,12 @@ bool UITextBMFontTest::init() Text* alert = Text::create("TextBMFont","TextBMFont",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the TextBMFont TextBMFont* textBMFont = TextBMFont::create("BMFont", "cocosui/bitmapFontTest2.fnt"); - textBMFont->setPosition(Vector2(widgetSize.width / 2, widgetSize.height / 2.0f + textBMFont->getSize().height / 8.0f)); + textBMFont->setPosition(Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + textBMFont->getSize().height / 8.0f)); _uiLayer->addChild(textBMFont); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp index b053f267b4..5b2bdcee10 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp @@ -13,7 +13,7 @@ bool UITextBMFontTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index 6f40044104..f67469e9cb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -21,20 +21,20 @@ bool UITextFieldTest::init() // Add a label in which the textfield events will be displayed _displayValueLabel = Text::create("No Event","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text* alert = Text::create("TextField","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); // Create the textfield TextField* textField = TextField::create("input words here","fonts/Marker Felt.ttf",30); - textField->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); textField->addEventListener(CC_CALLBACK_2(UITextFieldTest::textFieldEvent, this)); _uiLayer->addChild(textField); @@ -53,7 +53,7 @@ void UITextFieldTest::textFieldEvent(Ref *pSender, TextField::EventType type) TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, - Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); + Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("attach with IME")->getCString()); } break; @@ -62,7 +62,7 @@ void UITextFieldTest::textFieldEvent(Ref *pSender, TextField::EventType type) { TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); - textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); + textField->runAction(CCMoveTo::create(0.175f, Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("detach with IME")->getCString()); } break; @@ -99,21 +99,21 @@ bool UITextFieldTest_MaxLength::init() // Add a label in which the textfield events will be displayed _displayValueLabel = Text::create("No Event","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text *alert = Text::create("TextField max length","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); // Create the textfield TextField* textField = TextField::create("input words here","fonts/Marker Felt.ttf",30); textField->setMaxLengthEnabled(true); textField->setMaxLength(3); - textField->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_MaxLength::textFieldEvent, this)); _uiLayer->addChild(textField); @@ -131,7 +131,7 @@ void UITextFieldTest_MaxLength::textFieldEvent(Ref *pSender, TextField::EventTyp TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, - Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); + Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("attach with IME max length %d", textField->getMaxLength())->getCString()); } break; @@ -140,7 +140,7 @@ void UITextFieldTest_MaxLength::textFieldEvent(Ref *pSender, TextField::EventTyp { TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); - textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); + textField->runAction(CCMoveTo::create(0.175f, Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("detach with IME max length %d", textField->getMaxLength())->getCString()); } break; @@ -183,21 +183,21 @@ bool UITextFieldTest_Password::init() // Add a label in which the textfield events will be displayed _displayValueLabel = Text::create("No Event","fonts/Marker Felt.ttf",32); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1.0f)); - _displayValueLabel->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text *alert = Text::create("TextField password","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f)); + alert->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f)); _uiLayer->addChild(alert); // Create the textfield TextField* textField = TextField::create("input password here","fonts/Marker Felt.ttf",30); textField->setPasswordEnabled(true); textField->setPasswordStyleText("*"); - textField->setPosition(Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f)); + textField->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f)); textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_Password::textFieldEvent, this)); _uiLayer->addChild(textField); @@ -215,7 +215,7 @@ void UITextFieldTest_Password::textFieldEvent(Ref *pSender, TextField::EventType TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); textField->runAction(CCMoveTo::create(0.225f, - Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); + Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f + textField->getContentSize().height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("attach with IME password")->getCString()); } break; @@ -224,7 +224,7 @@ void UITextFieldTest_Password::textFieldEvent(Ref *pSender, TextField::EventType { TextField* textField = dynamic_cast(pSender); Size screenSize = CCDirector::getInstance()->getWinSize(); - textField->runAction(CCMoveTo::create(0.175f, Vector2(screenSize.width / 2.0f, screenSize.height / 2.0f))); + textField->runAction(CCMoveTo::create(0.175f, Vec2(screenSize.width / 2.0f, screenSize.height / 2.0f))); _displayValueLabel->setString(String::createWithFormat("detach with IME password")->getCString()); } break; @@ -262,14 +262,14 @@ bool UITextFieldTest_LineWrap::init() // Add a label in which the textfield events will be displayed _displayValueLabel = Text::create("No Event","fonts/Marker Felt.ttf",30); - _displayValueLabel->setAnchorPoint(Vector2(0.5f, -1)); - _displayValueLabel->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5)); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5)); _uiLayer->addChild(_displayValueLabel); // Add the alert Text *alert = Text::create("TextField line wrap","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075)); _uiLayer->addChild(alert); // Create the textfield @@ -278,7 +278,7 @@ bool UITextFieldTest_LineWrap::init() textField->setSize(Size(240, 160)); textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); - textField->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + textField->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); textField->addEventListener(CC_CALLBACK_2(UITextFieldTest_LineWrap::textFieldEvent, this)); _uiLayer->addChild(textField); @@ -296,7 +296,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextField::EventType TextField* textField = dynamic_cast(pSender); Size widgetSize = _widget->getSize(); textField->runAction(CCMoveTo::create(0.225f, - Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + textField->getContentSize().height / 2))); + Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + textField->getContentSize().height / 2))); textField->setTextHorizontalAlignment(TextHAlignment::LEFT); textField->setTextVerticalAlignment(TextVAlignment::TOP); @@ -308,7 +308,7 @@ void UITextFieldTest_LineWrap::textFieldEvent(Ref *pSender, TextField::EventType { TextField* textField = dynamic_cast(pSender); Size widgetSize = _widget->getSize(); - textField->runAction(CCMoveTo::create(0.175f, Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f))); + textField->runAction(CCMoveTo::create(0.175f, Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f))); textField->setTextHorizontalAlignment(TextHAlignment::CENTER); textField->setTextVerticalAlignment(TextVAlignment::CENTER); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp index ee13dd3969..fe9bc0f924 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp @@ -24,7 +24,7 @@ bool UITextFieldTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -47,7 +47,7 @@ bool UITextFieldTest_Editor::init() _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); _displayValueLabel->setFontSize(30); _displayValueLabel->setString("No event"); - _displayValueLabel->setPosition(Vector2(_layout->getSize().width / 2, + _displayValueLabel->setPosition(Vec2(_layout->getSize().width / 2, _layout->getSize().height - _displayValueLabel->getSize().height * 1.75f)); _touchGroup->addChild(_displayValueLabel); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp index 3aaddc3059..d64ba12a10 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest.cpp @@ -13,12 +13,12 @@ bool UITextTest::init() Text* alert = Text::create("Text","fonts/Marker Felt.ttf", 30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the text Text* text = Text::create("Text", "AmericanTypewriter", 30); - text->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + text->getSize().height / 4.0f)); + text->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + text->getSize().height / 4.0f)); _uiLayer->addChild(text); return true; @@ -36,7 +36,7 @@ bool UITextTest_LineWrap::init() Text* alert = Text::create("Text line wrap","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the line wrap @@ -44,7 +44,7 @@ bool UITextTest_LineWrap::init() text->ignoreContentAdaptWithSize(false); text->setSize(Size(280, 150)); text->setTextHorizontalAlignment(TextHAlignment::CENTER); - text->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - text->getSize().height / 8.0f)); + text->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - text->getSize().height / 8.0f)); _uiLayer->addChild(text); return true; @@ -66,7 +66,7 @@ bool UILabelTest_Effect::init() alert->setFontName("fonts/Marker Felt.ttf"); alert->setFontSize(30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.05f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.05f)); _uiLayer->addChild(alert); @@ -88,7 +88,7 @@ bool UILabelTest_Effect::init() shadow_label->setTextDefinition(shadowTextDef); shadow_label->setText("Shadow"); - shadow_label->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + shadow_label->getSize().height)); + shadow_label->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + shadow_label->getSize().height)); _uiLayer->addChild(shadow_label); @@ -111,7 +111,7 @@ bool UILabelTest_Effect::init() stroke_label->setTextDefinition(strokeTextDef); stroke_label->setText("Stroke"); - stroke_label->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + stroke_label->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(stroke_label); @@ -140,7 +140,7 @@ bool UILabelTest_Effect::init() strokeAndShadow_label->setTextDefinition(strokeShaodwTextDef); // strokeAndShadow_label->setFontFillColor(tintColorRed); strokeAndShadow_label->setText("Stroke and Shadow"); - strokeAndShadow_label->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - shadow_label->getSize().height)); + strokeAndShadow_label->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - shadow_label->getSize().height)); _uiLayer->addChild(strokeAndShadow_label); @@ -161,12 +161,12 @@ bool UITextTest_TTF::init() Text* alert = Text::create("Text set TTF font","fonts/Marker Felt.ttf",30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f)); _uiLayer->addChild(alert); // Create the text, and set font with .ttf Text* text = Text::create("Text","fonts/A Damn Mess.ttf",30); - text->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + text->getSize().height / 4.0f)); + text->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + text->getSize().height / 4.0f)); _uiLayer->addChild(text); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp index effd3883e3..e8ef5acf1b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp @@ -15,7 +15,7 @@ bool UITextTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp index cdaaceac7b..f6d3a05ff7 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIVideoPlayerTest/UIVideoPlayerTest.cpp @@ -15,45 +15,45 @@ bool VideoPlayerTest::init() MenuItemFont::setFontSize(16); auto fullSwitch = MenuItemFont::create("FullScreenSwitch", CC_CALLBACK_1(VideoPlayerTest::menuFullScreenCallback, this)); - fullSwitch->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - fullSwitch->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 50)); + fullSwitch->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + fullSwitch->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 50)); auto pauseItem = MenuItemFont::create("Pause", CC_CALLBACK_1(VideoPlayerTest::menuPauseCallback, this)); - pauseItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - pauseItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 100)); + pauseItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + pauseItem->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 100)); auto resumeItem = MenuItemFont::create("Resume", CC_CALLBACK_1(VideoPlayerTest::menuResumeCallback, this)); - resumeItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - resumeItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 150)); + resumeItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + resumeItem->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 150)); auto stopItem = MenuItemFont::create("Stop", CC_CALLBACK_1(VideoPlayerTest::menuStopCallback, this)); - stopItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - stopItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 200)); + stopItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + stopItem->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 200)); auto hintItem = MenuItemFont::create("Hint", CC_CALLBACK_1(VideoPlayerTest::menuHintCallback, this)); - hintItem->setAnchorPoint(Vector2::ANCHOR_BOTTOM_LEFT); - hintItem->setPosition(Vector2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 250)); + hintItem->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + hintItem->setPosition(Vec2(_visibleRect.origin.x + 10,_visibleRect.origin.y + 250)); //------------------------------------------------------------------------------------------------------------------- auto resourceVideo = MenuItemFont::create("Play resource video", CC_CALLBACK_1(VideoPlayerTest::menuResourceVideoCallback, this)); - resourceVideo->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - resourceVideo->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 50)); + resourceVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + resourceVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 50)); auto onlineVideo = MenuItemFont::create("Play online video", CC_CALLBACK_1(VideoPlayerTest::menuOnlineVideoCallback, this)); - onlineVideo->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - onlineVideo->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 100)); + onlineVideo->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + onlineVideo->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 100)); auto ratioSwitch = MenuItemFont::create("KeepRatioSwitch", CC_CALLBACK_1(VideoPlayerTest::menuRatioCallback, this)); - ratioSwitch->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - ratioSwitch->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 150)); + ratioSwitch->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + ratioSwitch->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 150)); auto menu = Menu::create(resourceVideo,onlineVideo,ratioSwitch,fullSwitch,pauseItem,resumeItem,stopItem,hintItem,nullptr); - menu->setPosition(Vector2::ZERO); + menu->setPosition(Vec2::ZERO); _uiLayer->addChild(menu); _videoStateLabel = Label::createWithSystemFont("IDLE","Arial",16); - _videoStateLabel->setAnchorPoint(Vector2::ANCHOR_MIDDLE_RIGHT); - _videoStateLabel->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 200)); + _videoStateLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT); + _videoStateLabel->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width - 10,_visibleRect.origin.y + 200)); _uiLayer->addChild(_videoStateLabel); createVideo(); @@ -137,13 +137,13 @@ void VideoPlayerTest::menuHintCallback(Ref* sender) void VideoPlayerTest::createVideo() { - auto centerPos = Vector2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2); + auto centerPos = Vec2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2); auto widgetSize = _widget->getSize(); _videoPlayer = VideoPlayer::create(); _videoPlayer->setPosition(centerPos); - _videoPlayer->setAnchorPoint(Vector2::ANCHOR_MIDDLE); + _videoPlayer->setAnchorPoint(Vec2::ANCHOR_MIDDLE); _videoPlayer->setContentSize(Size(widgetSize.width * 0.4f,widgetSize.height * 0.4f)); _uiLayer->addChild(_videoPlayer); @@ -152,14 +152,14 @@ void VideoPlayerTest::createVideo() void VideoPlayerTest::createSlider() { - auto centerPos = Vector2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2); + auto centerPos = Vec2(_visibleRect.origin.x + _visibleRect.size.width / 2,_visibleRect.origin.y + _visibleRect.size.height /2); auto hSlider = ui::Slider::create(); hSlider->setTouchEnabled(true); hSlider->loadBarTexture("cocosui/sliderTrack.png"); hSlider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); hSlider->loadProgressBarTexture("cocosui/sliderProgress.png"); - hSlider->setPosition(Vector2(centerPos.x, _visibleRect.origin.y + _visibleRect.size.height * 0.15f)); + hSlider->setPosition(Vec2(centerPos.x, _visibleRect.origin.y + _visibleRect.size.height * 0.15f)); hSlider->setPercent(50); hSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); _uiLayer->addChild(hSlider,0,1); @@ -169,7 +169,7 @@ void VideoPlayerTest::createSlider() vSlider->loadBarTexture("cocosui/sliderTrack.png"); vSlider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); vSlider->loadProgressBarTexture("cocosui/sliderProgress.png"); - vSlider->setPosition(Vector2(_visibleRect.origin.x + _visibleRect.size.width * 0.15f, centerPos.y)); + vSlider->setPosition(Vec2(_visibleRect.origin.x + _visibleRect.size.width * 0.15f, centerPos.y)); vSlider->setRotation(90); vSlider->setPercent(50); vSlider->addEventListener(CC_CALLBACK_2(VideoPlayerTest::sliderCallback, this)); @@ -186,7 +186,7 @@ void VideoPlayerTest::sliderCallback(Ref *sender, ui::Slider::EventType eventTyp auto newPosX = _visibleRect.origin.x + _visibleRect.size.width / 2 + hSlider->getPercent() - 50; auto newPosY = _visibleRect.origin.y + _visibleRect.size.height / 2 + 50 - vSlider->getPercent(); - _videoPlayer->setPosition(Vector2(newPosX,newPosY)); + _videoPlayer->setPosition(Vec2(newPosX,newPosY)); } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp index cf7ad6e7ea..ce6f6b36ed 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp @@ -26,16 +26,16 @@ bool UIWidgetAddNodeTest::init() alert->setFontName("fonts/Marker Felt.ttf"); alert->setFontSize(30); alert->setColor(Color3B(159, 168, 176)); - alert->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75)); _uiLayer->addChild(alert); // Create the ui node container Widget* widget = Widget::create(); - widget->setPosition(Vector2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + widget->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); _uiLayer->addChild(widget); Sprite* sprite = Sprite::create("cocosui/ccicon.png"); - sprite->setPosition(Vector2(0, sprite->getBoundingBox().size.height / 4)); + sprite->setPosition(Vec2(0, sprite->getBoundingBox().size.height / 4)); widget->addChild(sprite); return true; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp index cb91a6dad4..31d176084d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp @@ -23,7 +23,7 @@ bool UIWidgetAddNodeTest_Editor::init() _touchGroup->addChild(_layout); Size screenSize = CCDirector::getInstance()->getWinSize(); Size rootSize = _layout->getSize(); - _touchGroup->setPosition(Vector2((screenSize.width - rootSize.width) / 2, + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, (screenSize.height - rootSize.height) / 2)); Layout* root = static_cast(_layout->getChildByName("root_Panel")); @@ -36,7 +36,7 @@ bool UIWidgetAddNodeTest_Editor::init() // Create the ui widget Widget* widget = Widget::create(); - widget->setPosition(Vector2(rootSize.width / 2.0f, rootSize.height / 2.0f)); + widget->setPosition(Vec2(rootSize.width / 2.0f, rootSize.height / 2.0f)); widget->setLocalZOrder(_layout->getLocalZOrder() + 1); _layout->addChild(widget); diff --git a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp index a6f187c374..05011cef6a 100644 --- a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp +++ b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp @@ -10,7 +10,7 @@ UserDefaultTest::UserDefaultTest() auto s = Director::getInstance()->getWinSize(); auto label = Label::createWithTTF("CCUserDefault test see log", "fonts/arial.ttf", 28); addChild(label, 0); - label->setPosition( Vector2(s.width/2, s.height-50) ); + label->setPosition( Vec2(s.width/2, s.height-50) ); doTest(); } diff --git a/tests/cpp-tests/Classes/VisibleRect.cpp b/tests/cpp-tests/Classes/VisibleRect.cpp index 6010c559e3..639aac8ed7 100644 --- a/tests/cpp-tests/Classes/VisibleRect.cpp +++ b/tests/cpp-tests/Classes/VisibleRect.cpp @@ -41,56 +41,56 @@ Rect VisibleRect::getVisibleRect() return s_visibleRect; } -Vector2 VisibleRect::left() +Vec2 VisibleRect::left() { lazyInit(); - return Vector2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height/2); + return Vec2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height/2); } -Vector2 VisibleRect::right() +Vec2 VisibleRect::right() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height/2); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height/2); } -Vector2 VisibleRect::top() +Vec2 VisibleRect::top() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height); } -Vector2 VisibleRect::bottom() +Vec2 VisibleRect::bottom() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y); } -Vector2 VisibleRect::center() +Vec2 VisibleRect::center() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height/2); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width/2, s_visibleRect.origin.y+s_visibleRect.size.height/2); } -Vector2 VisibleRect::leftTop() +Vec2 VisibleRect::leftTop() { lazyInit(); - return Vector2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height); + return Vec2(s_visibleRect.origin.x, s_visibleRect.origin.y+s_visibleRect.size.height); } -Vector2 VisibleRect::rightTop() +Vec2 VisibleRect::rightTop() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y+s_visibleRect.size.height); } -Vector2 VisibleRect::leftBottom() +Vec2 VisibleRect::leftBottom() { lazyInit(); return s_visibleRect.origin; } -Vector2 VisibleRect::rightBottom() +Vec2 VisibleRect::rightBottom() { lazyInit(); - return Vector2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y); + return Vec2(s_visibleRect.origin.x+s_visibleRect.size.width, s_visibleRect.origin.y); } diff --git a/tests/cpp-tests/Classes/VisibleRect.h b/tests/cpp-tests/Classes/VisibleRect.h index 1eeef0dbd1..625f7c3f5f 100644 --- a/tests/cpp-tests/Classes/VisibleRect.h +++ b/tests/cpp-tests/Classes/VisibleRect.h @@ -8,15 +8,15 @@ class VisibleRect public: static cocos2d::Rect getVisibleRect(); - static cocos2d::Vector2 left(); - static cocos2d::Vector2 right(); - static cocos2d::Vector2 top(); - static cocos2d::Vector2 bottom(); - static cocos2d::Vector2 center(); - static cocos2d::Vector2 leftTop(); - static cocos2d::Vector2 rightTop(); - static cocos2d::Vector2 leftBottom(); - static cocos2d::Vector2 rightBottom(); + static cocos2d::Vec2 left(); + static cocos2d::Vec2 right(); + static cocos2d::Vec2 top(); + static cocos2d::Vec2 bottom(); + static cocos2d::Vec2 center(); + static cocos2d::Vec2 leftTop(); + static cocos2d::Vec2 rightTop(); + static cocos2d::Vec2 leftBottom(); + static cocos2d::Vec2 rightBottom(); private: static void lazyInit(); static cocos2d::Rect s_visibleRect; diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 85f34a2b1b..333a0c0f8b 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -107,22 +107,22 @@ void ZwoptexGenericTest::onEnter() SpriteFrameCache::getInstance()->addSpriteFramesWithFile("zwoptex/grossini-generic.plist"); auto layer1 = LayerColor::create(Color4B(255, 0, 0, 255), 85, 121); - layer1->setPosition(Vector2(s.width/2-80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); + layer1->setPosition(Vec2(s.width/2-80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer1); sprite1 = Sprite::createWithSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("grossini_dance_01.png")); - sprite1->setPosition(Vector2( s.width/2-80, s.height/2)); + sprite1->setPosition(Vec2( s.width/2-80, s.height/2)); addChild(sprite1); sprite1->setFlippedX(false); sprite1->setFlippedY(false); auto layer2 = LayerColor::create(Color4B(255, 0, 0, 255), 85, 121); - layer2->setPosition(Vector2(s.width/2+80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); + layer2->setPosition(Vec2(s.width/2+80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer2); sprite2 = Sprite::createWithSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("grossini_dance_generic_01.png")); - sprite2->setPosition(Vector2( s.width/2 + 80, s.height/2)); + sprite2->setPosition(Vec2( s.width/2 + 80, s.height/2)); addChild(sprite2); sprite2->setFlippedX(false); diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index aa46f47eda..2eb8c52ce7 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -112,7 +112,7 @@ static int g_testCount = sizeof(g_aTestNames) / sizeof(g_aTestNames[0]); static Controller *currentController = nullptr; #define LINE_SPACE 40 -static Vector2 s_tCurPos = Vector2::ZERO; +static Vec2 s_tCurPos = Vec2::ZERO; //sleep for t seconds static void wait(int t) @@ -122,14 +122,14 @@ static void wait(int t) } TestController::TestController() -: _beginPos(Vector2::ZERO) +: _beginPos(Vec2::ZERO) { // add close menu auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, CC_CALLBACK_1(TestController::closeCallback, this) ); auto menu =Menu::create(closeItem, NULL); - menu->setPosition( Vector2::ZERO ); - closeItem->setPosition(Vector2( VisibleRect::right().x - 30, VisibleRect::top().y - 30)); + menu->setPosition( Vec2::ZERO ); + closeItem->setPosition(Vec2( VisibleRect::right().x - 30, VisibleRect::top().y - 30)); // add menu items for tests TTFConfig ttfConfig("fonts/arial.ttf", 24); @@ -140,7 +140,7 @@ TestController::TestController() auto menuItem = MenuItemLabel::create(label, CC_CALLBACK_1(TestController::menuCallback, this)); _itemMenu->addChild(menuItem, i + 10000); - menuItem->setPosition( Vector2( VisibleRect::center().x, (VisibleRect::top().y - (i + 1) * LINE_SPACE) )); + menuItem->setPosition( Vec2( VisibleRect::center().x, (VisibleRect::top().y - (i + 1) * LINE_SPACE) )); } _itemMenu->setContentSize(Size(VisibleRect::getVisibleRect().size.width, (g_testCount + 1) * (LINE_SPACE))); @@ -210,17 +210,17 @@ void TestController::onTouchMoved(Touch* touch, Event *event) float nMoveY = touchLocation.y - _beginPos.y; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } @@ -235,17 +235,17 @@ void TestController::onMouseScroll(Event *event) float nMoveY = mouseEvent->getScrollY() * 6; auto curPos = _itemMenu->getPosition(); - auto nextPos = Vector2(curPos.x, curPos.y + nMoveY); + auto nextPos = Vec2(curPos.x, curPos.y + nMoveY); if (nextPos.y < 0.0f) { - _itemMenu->setPosition(Vector2::ZERO); + _itemMenu->setPosition(Vec2::ZERO); return; } if (nextPos.y > ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)) { - _itemMenu->setPosition(Vector2(0, ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); + _itemMenu->setPosition(Vec2(0, ((g_testCount + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))); return; } diff --git a/tests/cpp-tests/Classes/controller.h b/tests/cpp-tests/Classes/controller.h index f5139cd61e..136dd0cccc 100644 --- a/tests/cpp-tests/Classes/controller.h +++ b/tests/cpp-tests/Classes/controller.h @@ -23,7 +23,7 @@ public: void startAutoRun(); ssize_t readline(int fd, char* ptr, size_t maxlen); private: - Vector2 _beginPos; + Vec2 _beginPos; Menu* _itemMenu; }; diff --git a/tests/cpp-tests/Classes/testBasic.cpp b/tests/cpp-tests/Classes/testBasic.cpp index 05f46a7fc9..9c0ea38104 100644 --- a/tests/cpp-tests/Classes/testBasic.cpp +++ b/tests/cpp-tests/Classes/testBasic.cpp @@ -43,8 +43,8 @@ void TestScene::onEnter() auto menuItem = MenuItemLabel::create(label, testScene_callback ); auto menu = Menu::create(menuItem, NULL); - menu->setPosition( Vector2::ZERO ); - menuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + menu->setPosition( Vec2::ZERO ); + menuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); addChild(menu, 1); } From 7b45fc90a843021b1bff70514f949a0f3247873a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 14 May 2014 17:16:02 +0000 Subject: [PATCH 070/125] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/ActionCamera.lua | 12 +- .../lua-bindings/auto/api/Armature.lua | 8 +- .../lua-bindings/auto/api/AtlasNode.lua | 2 +- .../lua-bindings/auto/api/BatchNode.lua | 2 +- .../scripting/lua-bindings/auto/api/Bone.lua | 4 +- .../auto/api/CardinalSplineBy.lua | 2 +- .../auto/api/CardinalSplineTo.lua | 2 +- .../lua-bindings/auto/api/ContourData.lua | 2 +- .../lua-bindings/auto/api/Control.lua | 2 +- .../lua-bindings/auto/api/ControlButton.lua | 4 +- .../auto/api/ControlHuePicker.lua | 6 +- .../auto/api/ControlPotentiometer.lua | 22 +- .../api/ControlSaturationBrightnessPicker.lua | 6 +- .../lua-bindings/auto/api/ControlSlider.lua | 2 +- .../lua-bindings/auto/api/ControlStepper.lua | 2 +- .../lua-bindings/auto/api/ControlSwitch.lua | 2 +- .../lua-bindings/auto/api/Director.lua | 16 +- .../lua-bindings/auto/api/DisplayManager.lua | 6 +- .../lua-bindings/auto/api/DrawNode.lua | 30 +- .../lua-bindings/auto/api/EditBox.lua | 4 +- .../lua-bindings/auto/api/FadeOutTRTiles.lua | 6 +- .../lua-bindings/auto/api/FadeOutUpTiles.lua | 2 +- .../lua-bindings/auto/api/GLProgram.lua | 4 +- .../lua-bindings/auto/api/GLViewProtocol.lua | 2 +- .../lua-bindings/auto/api/GridBase.lua | 4 +- .../lua-bindings/auto/api/JumpBy.lua | 2 +- .../lua-bindings/auto/api/JumpTo.lua | 2 +- .../scripting/lua-bindings/auto/api/Label.lua | 6 +- .../lua-bindings/auto/api/LabelBMFont.lua | 8 +- .../lua-bindings/auto/api/LayerColor.lua | 2 +- .../lua-bindings/auto/api/LayerGradient.lua | 8 +- .../lua-bindings/auto/api/Layout.lua | 4 +- .../lua-bindings/auto/api/Lens3D.lua | 6 +- .../lua-bindings/auto/api/MotionStreak.lua | 2 +- .../lua-bindings/auto/api/MoveBy.lua | 2 +- .../lua-bindings/auto/api/MoveTo.lua | 2 +- .../scripting/lua-bindings/auto/api/Node.lua | 52 ++-- .../lua-bindings/auto/api/ParallaxNode.lua | 4 +- .../auto/api/ParticleBatchNode.lua | 2 +- .../lua-bindings/auto/api/ParticleSystem.lua | 14 +- .../lua-bindings/auto/api/PhysicsBody.lua | 52 ++-- .../auto/api/PhysicsContactPostSolve.lua | 2 +- .../auto/api/PhysicsContactPreSolve.lua | 4 +- .../auto/api/PhysicsJointDistance.lua | 4 +- .../auto/api/PhysicsJointFixed.lua | 2 +- .../auto/api/PhysicsJointGroove.lua | 18 +- .../auto/api/PhysicsJointLimit.lua | 16 +- .../lua-bindings/auto/api/PhysicsJointPin.lua | 2 +- .../auto/api/PhysicsJointSpring.lua | 12 +- .../lua-bindings/auto/api/PhysicsShape.lua | 6 +- .../lua-bindings/auto/api/PhysicsShapeBox.lua | 6 +- .../auto/api/PhysicsShapeCircle.lua | 6 +- .../auto/api/PhysicsShapeEdgeBox.lua | 4 +- .../auto/api/PhysicsShapeEdgeChain.lua | 2 +- .../auto/api/PhysicsShapeEdgePolygon.lua | 2 +- .../auto/api/PhysicsShapeEdgeSegment.lua | 10 +- .../auto/api/PhysicsShapePolygon.lua | 4 +- .../lua-bindings/auto/api/PhysicsWorld.lua | 8 +- .../scripting/lua-bindings/auto/api/Place.lua | 2 +- .../lua-bindings/auto/api/ProgressTimer.lua | 12 +- .../lua-bindings/auto/api/RenderTexture.lua | 4 +- .../lua-bindings/auto/api/RichText.lua | 2 +- .../lua-bindings/auto/api/Ripple3D.lua | 6 +- .../lua-bindings/auto/api/RotateBy.lua | 2 +- .../lua-bindings/auto/api/ScrollView.lua | 4 +- .../lua-bindings/auto/api/ShuffleTiles.lua | 2 +- .../lua-bindings/auto/api/Skeleton.lua | 2 +- .../scripting/lua-bindings/auto/api/Skin.lua | 6 +- .../lua-bindings/auto/api/Slider.lua | 2 +- .../lua-bindings/auto/api/Sprite.lua | 6 +- .../lua-bindings/auto/api/SpriteBatchNode.lua | 2 +- .../lua-bindings/auto/api/SpriteFrame.lua | 24 +- .../lua-bindings/auto/api/TMXLayer.lua | 16 +- .../lua-bindings/auto/api/TMXObjectGroup.lua | 4 +- .../lua-bindings/auto/api/TextField.lua | 2 +- .../lua-bindings/auto/api/Texture2D.lua | 2 +- .../lua-bindings/auto/api/TileMapAtlas.lua | 4 +- .../scripting/lua-bindings/auto/api/Touch.lua | 14 +- .../auto/api/TransitionCrossFade.lua | 2 +- .../auto/api/TransitionFadeTR.lua | 2 +- .../auto/api/TransitionPageTurn.lua | 2 +- .../lua-bindings/auto/api/TransitionScene.lua | 2 +- .../auto/api/TransitionSplitCols.lua | 2 +- .../auto/api/TransitionTurnOffTiles.lua | 2 +- .../lua-bindings/auto/api/TurnOffTiles.lua | 4 +- .../scripting/lua-bindings/auto/api/Twirl.lua | 6 +- .../lua-bindings/auto/api/Widget.lua | 24 +- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 260 +++++++++--------- .../auto/lua_cocos2dx_extension_auto.cpp | 58 ++-- .../auto/lua_cocos2dx_physics_auto.cpp | 158 +++++------ .../auto/lua_cocos2dx_spine_auto.cpp | 2 +- .../auto/lua_cocos2dx_studio_auto.cpp | 12 +- .../auto/lua_cocos2dx_ui_auto.cpp | 34 +-- 93 files changed, 559 insertions(+), 559 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/api/ActionCamera.lua b/cocos/scripting/lua-bindings/auto/api/ActionCamera.lua index 78fa52fdeb..cf2d776718 100644 --- a/cocos/scripting/lua-bindings/auto/api/ActionCamera.lua +++ b/cocos/scripting/lua-bindings/auto/api/ActionCamera.lua @@ -6,7 +6,7 @@ -------------------------------- -- overload function: setEye(float, float, float) -- --- overload function: setEye(vector3_table) +-- overload function: setEye(cc.Vec3) -- -- @function [parent=#ActionCamera] setEye -- @param self @@ -17,27 +17,27 @@ -------------------------------- -- @function [parent=#ActionCamera] getEye -- @param self --- @return vector3_table#vector3_table ret (return value: vector3_table) +-- @return Vec3#Vec3 ret (return value: cc.Vec3) -------------------------------- -- @function [parent=#ActionCamera] setUp -- @param self --- @param #vector3_table array +-- @param #cc.Vec3 vec3 -------------------------------- -- @function [parent=#ActionCamera] getCenter -- @param self --- @return vector3_table#vector3_table ret (return value: vector3_table) +-- @return Vec3#Vec3 ret (return value: cc.Vec3) -------------------------------- -- @function [parent=#ActionCamera] setCenter -- @param self --- @param #vector3_table array +-- @param #cc.Vec3 vec3 -------------------------------- -- @function [parent=#ActionCamera] getUp -- @param self --- @return vector3_table#vector3_table ret (return value: vector3_table) +-- @return Vec3#Vec3 ret (return value: cc.Vec3) -------------------------------- -- @function [parent=#ActionCamera] startWithTarget diff --git a/cocos/scripting/lua-bindings/auto/api/Armature.lua b/cocos/scripting/lua-bindings/auto/api/Armature.lua index 695a07327d..b05ff17956 100644 --- a/cocos/scripting/lua-bindings/auto/api/Armature.lua +++ b/cocos/scripting/lua-bindings/auto/api/Armature.lua @@ -141,19 +141,19 @@ -------------------------------- -- @function [parent=#Armature] setAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Armature] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- -- @function [parent=#Armature] getAnchorPointInPoints -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Armature] update @@ -163,7 +163,7 @@ -------------------------------- -- @function [parent=#Armature] getNodeToParentTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Armature] getBoundingBox diff --git a/cocos/scripting/lua-bindings/auto/api/AtlasNode.lua b/cocos/scripting/lua-bindings/auto/api/AtlasNode.lua index 4b895602db..bb2a6d25d7 100644 --- a/cocos/scripting/lua-bindings/auto/api/AtlasNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/AtlasNode.lua @@ -50,7 +50,7 @@ -- @function [parent=#AtlasNode] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/BatchNode.lua b/cocos/scripting/lua-bindings/auto/api/BatchNode.lua index 43e201ca00..ba80531bb7 100644 --- a/cocos/scripting/lua-bindings/auto/api/BatchNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/BatchNode.lua @@ -30,7 +30,7 @@ -- @function [parent=#BatchNode] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Bone.lua b/cocos/scripting/lua-bindings/auto/api/Bone.lua index ce56baf22c..4b2ac439f1 100644 --- a/cocos/scripting/lua-bindings/auto/api/Bone.lua +++ b/cocos/scripting/lua-bindings/auto/api/Bone.lua @@ -162,7 +162,7 @@ -------------------------------- -- @function [parent=#Bone] getNodeToArmatureTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Bone] getDisplayManager @@ -202,7 +202,7 @@ -------------------------------- -- @function [parent=#Bone] getNodeToWorldTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Bone] update diff --git a/cocos/scripting/lua-bindings/auto/api/CardinalSplineBy.lua b/cocos/scripting/lua-bindings/auto/api/CardinalSplineBy.lua index 307d52ecb1..a9c0b0445d 100644 --- a/cocos/scripting/lua-bindings/auto/api/CardinalSplineBy.lua +++ b/cocos/scripting/lua-bindings/auto/api/CardinalSplineBy.lua @@ -16,7 +16,7 @@ -------------------------------- -- @function [parent=#CardinalSplineBy] updatePosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#CardinalSplineBy] reverse diff --git a/cocos/scripting/lua-bindings/auto/api/CardinalSplineTo.lua b/cocos/scripting/lua-bindings/auto/api/CardinalSplineTo.lua index c32bd94523..c943bfb62f 100644 --- a/cocos/scripting/lua-bindings/auto/api/CardinalSplineTo.lua +++ b/cocos/scripting/lua-bindings/auto/api/CardinalSplineTo.lua @@ -11,7 +11,7 @@ -------------------------------- -- @function [parent=#CardinalSplineTo] updatePosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#CardinalSplineTo] initWithDuration diff --git a/cocos/scripting/lua-bindings/auto/api/ContourData.lua b/cocos/scripting/lua-bindings/auto/api/ContourData.lua index 0e52073164..e58b3f2bcc 100644 --- a/cocos/scripting/lua-bindings/auto/api/ContourData.lua +++ b/cocos/scripting/lua-bindings/auto/api/ContourData.lua @@ -11,7 +11,7 @@ -------------------------------- -- @function [parent=#ContourData] addVertex -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ContourData] create diff --git a/cocos/scripting/lua-bindings/auto/api/Control.lua b/cocos/scripting/lua-bindings/auto/api/Control.lua index 263898c5d9..8d14218d27 100644 --- a/cocos/scripting/lua-bindings/auto/api/Control.lua +++ b/cocos/scripting/lua-bindings/auto/api/Control.lua @@ -82,7 +82,7 @@ -- @function [parent=#Control] getTouchLocation -- @param self -- @param #cc.Touch touch --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Control] isHighlighted diff --git a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua index c2188cec37..a8ac2f0373 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua @@ -43,12 +43,12 @@ -------------------------------- -- @function [parent=#ControlButton] setLabelAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlButton] getLabelAnchorPoint -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ControlButton] getTitleTTFSizeForState diff --git a/cocos/scripting/lua-bindings/auto/api/ControlHuePicker.lua b/cocos/scripting/lua-bindings/auto/api/ControlHuePicker.lua index 1cd38bb25c..8a71a41cbf 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlHuePicker.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlHuePicker.lua @@ -12,7 +12,7 @@ -- @function [parent=#ControlHuePicker] initWithTargetAndPos -- @param self -- @param #cc.Node node --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -23,7 +23,7 @@ -------------------------------- -- @function [parent=#ControlHuePicker] getStartPos -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ControlHuePicker] getHue @@ -64,7 +64,7 @@ -- @function [parent=#ControlHuePicker] create -- @param self -- @param #cc.Node node --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return ControlHuePicker#ControlHuePicker ret (return value: cc.ControlHuePicker) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/ControlPotentiometer.lua b/cocos/scripting/lua-bindings/auto/api/ControlPotentiometer.lua index 40f9228399..2fb1278c5c 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlPotentiometer.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlPotentiometer.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#ControlPotentiometer] setPreviousLocation -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlPotentiometer] setValue @@ -26,16 +26,16 @@ -------------------------------- -- @function [parent=#ControlPotentiometer] angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint -- @param self --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#ControlPotentiometer] potentiometerBegan -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlPotentiometer] setMaximumValue @@ -60,19 +60,19 @@ -------------------------------- -- @function [parent=#ControlPotentiometer] getPreviousLocation -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ControlPotentiometer] distanceBetweenPointAndPoint -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#ControlPotentiometer] potentiometerEnded -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlPotentiometer] setProgressTimer @@ -100,7 +100,7 @@ -------------------------------- -- @function [parent=#ControlPotentiometer] potentiometerMoved -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlPotentiometer] create diff --git a/cocos/scripting/lua-bindings/auto/api/ControlSaturationBrightnessPicker.lua b/cocos/scripting/lua-bindings/auto/api/ControlSaturationBrightnessPicker.lua index e19d124639..2d8a2830b3 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlSaturationBrightnessPicker.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlSaturationBrightnessPicker.lua @@ -12,13 +12,13 @@ -- @function [parent=#ControlSaturationBrightnessPicker] initWithTargetAndPos -- @param self -- @param #cc.Node node --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- -- @function [parent=#ControlSaturationBrightnessPicker] getStartPos -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ControlSaturationBrightnessPicker] getOverlay @@ -54,7 +54,7 @@ -- @function [parent=#ControlSaturationBrightnessPicker] create -- @param self -- @param #cc.Node node --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return ControlSaturationBrightnessPicker#ControlSaturationBrightnessPicker ret (return value: cc.ControlSaturationBrightnessPicker) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/ControlSlider.lua b/cocos/scripting/lua-bindings/auto/api/ControlSlider.lua index ddcaefb0cd..65d1396b56 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlSlider.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlSlider.lua @@ -12,7 +12,7 @@ -- @function [parent=#ControlSlider] locationFromTouch -- @param self -- @param #cc.Touch touch --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ControlSlider] setSelectedThumbSprite diff --git a/cocos/scripting/lua-bindings/auto/api/ControlStepper.lua b/cocos/scripting/lua-bindings/auto/api/ControlStepper.lua index 442182a7df..e672dabeff 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlStepper.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlStepper.lua @@ -31,7 +31,7 @@ -------------------------------- -- @function [parent=#ControlStepper] updateLayoutUsingTouchLocation -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ControlStepper] setValueWithSendingEvent diff --git a/cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua b/cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua index e4b2db3479..ff48208b4c 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua @@ -47,7 +47,7 @@ -- @function [parent=#ControlSwitch] locationFromTouch -- @param self -- @param #cc.Touch touch --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- overload function: create(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite) diff --git a/cocos/scripting/lua-bindings/auto/api/Director.lua b/cocos/scripting/lua-bindings/auto/api/Director.lua index 1b7b572392..cade93cd6c 100644 --- a/cocos/scripting/lua-bindings/auto/api/Director.lua +++ b/cocos/scripting/lua-bindings/auto/api/Director.lua @@ -58,7 +58,7 @@ -- @function [parent=#Director] loadMatrix -- @param self -- @param #cc.MATRIX_STACK_TYPE matrix_stack_type --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -------------------------------- -- @function [parent=#Director] getNotificationNode @@ -83,7 +83,7 @@ -------------------------------- -- @function [parent=#Director] getVisibleOrigin -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Director] mainLoop @@ -107,8 +107,8 @@ -------------------------------- -- @function [parent=#Director] convertToUI -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Director] setDefaultValues @@ -177,8 +177,8 @@ -------------------------------- -- @function [parent=#Director] convertToGL -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Director] purgeCachedData @@ -212,7 +212,7 @@ -- @function [parent=#Director] getMatrix -- @param self -- @param #cc.MATRIX_STACK_TYPE matrix_stack_type --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Director] popScene @@ -286,7 +286,7 @@ -- @function [parent=#Director] multiplyMatrix -- @param self -- @param #cc.MATRIX_STACK_TYPE matrix_stack_type --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -------------------------------- -- @function [parent=#Director] getActionManager diff --git a/cocos/scripting/lua-bindings/auto/api/DisplayManager.lua b/cocos/scripting/lua-bindings/auto/api/DisplayManager.lua index d4614625f8..d2b6c515ce 100644 --- a/cocos/scripting/lua-bindings/auto/api/DisplayManager.lua +++ b/cocos/scripting/lua-bindings/auto/api/DisplayManager.lua @@ -11,7 +11,7 @@ -------------------------------- -- @function [parent=#DisplayManager] getAnchorPointInPoints -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#DisplayManager] getDisplayRenderNodeType @@ -57,7 +57,7 @@ -------------------------------- -- overload function: containPoint(float, float) -- --- overload function: containPoint(vector2_table) +-- overload function: containPoint(cc.Vec2) -- -- @function [parent=#DisplayManager] containPoint -- @param self @@ -90,7 +90,7 @@ -------------------------------- -- @function [parent=#DisplayManager] getAnchorPoint -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#DisplayManager] getDecorativeDisplayList diff --git a/cocos/scripting/lua-bindings/auto/api/DrawNode.lua b/cocos/scripting/lua-bindings/auto/api/DrawNode.lua index 37665f9ec6..9de490a46a 100644 --- a/cocos/scripting/lua-bindings/auto/api/DrawNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/DrawNode.lua @@ -6,16 +6,16 @@ -------------------------------- -- @function [parent=#DrawNode] drawQuadraticBezier -- @param self --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #unsigned int int -- @param #color4f_table color4f -------------------------------- -- @function [parent=#DrawNode] onDraw -- @param self --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- @@ -25,33 +25,33 @@ -------------------------------- -- @function [parent=#DrawNode] drawTriangle -- @param self --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #color4f_table color4f -------------------------------- -- @function [parent=#DrawNode] drawDot -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #color4f_table color4f -------------------------------- -- @function [parent=#DrawNode] drawCubicBezier -- @param self --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #unsigned int int -- @param #color4f_table color4f -------------------------------- -- @function [parent=#DrawNode] drawSegment -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #color4f_table color4f @@ -64,7 +64,7 @@ -- @function [parent=#DrawNode] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool return nil diff --git a/cocos/scripting/lua-bindings/auto/api/EditBox.lua b/cocos/scripting/lua-bindings/auto/api/EditBox.lua index c53e8a7daa..9dafe578e0 100644 --- a/cocos/scripting/lua-bindings/auto/api/EditBox.lua +++ b/cocos/scripting/lua-bindings/auto/api/EditBox.lua @@ -109,12 +109,12 @@ -------------------------------- -- @function [parent=#EditBox] setAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#EditBox] setPosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#EditBox] setVisible diff --git a/cocos/scripting/lua-bindings/auto/api/FadeOutTRTiles.lua b/cocos/scripting/lua-bindings/auto/api/FadeOutTRTiles.lua index a7286cf64a..46432ff7e2 100644 --- a/cocos/scripting/lua-bindings/auto/api/FadeOutTRTiles.lua +++ b/cocos/scripting/lua-bindings/auto/api/FadeOutTRTiles.lua @@ -6,17 +6,17 @@ -------------------------------- -- @function [parent=#FadeOutTRTiles] turnOnTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#FadeOutTRTiles] turnOffTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#FadeOutTRTiles] transformTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/FadeOutUpTiles.lua b/cocos/scripting/lua-bindings/auto/api/FadeOutUpTiles.lua index 2b3f539ded..bee4704cd2 100644 --- a/cocos/scripting/lua-bindings/auto/api/FadeOutUpTiles.lua +++ b/cocos/scripting/lua-bindings/auto/api/FadeOutUpTiles.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#FadeOutUpTiles] transformTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/GLProgram.lua b/cocos/scripting/lua-bindings/auto/api/GLProgram.lua index 8ffd3739df..847100703b 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLProgram.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLProgram.lua @@ -51,13 +51,13 @@ -- @return Uniform#Uniform ret (return value: cc.Uniform) -------------------------------- --- overload function: setUniformsForBuiltins(matrix_table) +-- overload function: setUniformsForBuiltins(cc.Mat4) -- -- overload function: setUniformsForBuiltins() -- -- @function [parent=#GLProgram] setUniformsForBuiltins -- @param self --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -------------------------------- -- @function [parent=#GLProgram] setUniformLocationWith3i diff --git a/cocos/scripting/lua-bindings/auto/api/GLViewProtocol.lua b/cocos/scripting/lua-bindings/auto/api/GLViewProtocol.lua index c9d86148e2..103ed48321 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLViewProtocol.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLViewProtocol.lua @@ -53,7 +53,7 @@ -------------------------------- -- @function [parent=#GLViewProtocol] getVisibleOrigin -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#GLViewProtocol] getFrameSize diff --git a/cocos/scripting/lua-bindings/auto/api/GridBase.lua b/cocos/scripting/lua-bindings/auto/api/GridBase.lua index 44787b64a8..6a950b10cf 100644 --- a/cocos/scripting/lua-bindings/auto/api/GridBase.lua +++ b/cocos/scripting/lua-bindings/auto/api/GridBase.lua @@ -34,7 +34,7 @@ -------------------------------- -- @function [parent=#GridBase] getStep -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#GridBase] set2DProjection @@ -43,7 +43,7 @@ -------------------------------- -- @function [parent=#GridBase] setStep -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#GridBase] setTextureFlipped diff --git a/cocos/scripting/lua-bindings/auto/api/JumpBy.lua b/cocos/scripting/lua-bindings/auto/api/JumpBy.lua index b94e2d7304..c8cd091182 100644 --- a/cocos/scripting/lua-bindings/auto/api/JumpBy.lua +++ b/cocos/scripting/lua-bindings/auto/api/JumpBy.lua @@ -7,7 +7,7 @@ -- @function [parent=#JumpBy] create -- @param self -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #int int -- @return JumpBy#JumpBy ret (return value: cc.JumpBy) diff --git a/cocos/scripting/lua-bindings/auto/api/JumpTo.lua b/cocos/scripting/lua-bindings/auto/api/JumpTo.lua index 30257a00a9..3ce1864eea 100644 --- a/cocos/scripting/lua-bindings/auto/api/JumpTo.lua +++ b/cocos/scripting/lua-bindings/auto/api/JumpTo.lua @@ -7,7 +7,7 @@ -- @function [parent=#JumpTo] create -- @param self -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #int int -- @return JumpTo#JumpTo ret (return value: cc.JumpTo) diff --git a/cocos/scripting/lua-bindings/auto/api/Label.lua b/cocos/scripting/lua-bindings/auto/api/Label.lua index e50bfb44b8..5807c058d6 100644 --- a/cocos/scripting/lua-bindings/auto/api/Label.lua +++ b/cocos/scripting/lua-bindings/auto/api/Label.lua @@ -82,7 +82,7 @@ -- @function [parent=#Label] setBMFontFilePath -- @param self -- @param #string str --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -228,7 +228,7 @@ -- @param #string str -- @param #cc.TextHAlignment texthalignment -- @param #int int --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return Label#Label ret (return value: cc.Label) -------------------------------- @@ -266,7 +266,7 @@ -- @function [parent=#Label] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/LabelBMFont.lua b/cocos/scripting/lua-bindings/auto/api/LabelBMFont.lua index 87ec6373d8..6bee8d227e 100644 --- a/cocos/scripting/lua-bindings/auto/api/LabelBMFont.lua +++ b/cocos/scripting/lua-bindings/auto/api/LabelBMFont.lua @@ -46,7 +46,7 @@ -- @param #string str -- @param #float float -- @param #cc.TextHAlignment texthalignment --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -63,7 +63,7 @@ -- @function [parent=#LabelBMFont] setFntFile -- @param self -- @param #string str --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#LabelBMFont] setAlignment @@ -78,7 +78,7 @@ -------------------------------- -- overload function: create() -- --- overload function: create(string, string, float, cc.TextHAlignment, vector2_table) +-- overload function: create(string, string, float, cc.TextHAlignment, cc.Vec2) -- -- @function [parent=#LabelBMFont] create -- @param self @@ -86,7 +86,7 @@ -- @param #string str -- @param #float float -- @param #cc.TextHAlignment texthalignment --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return LabelBMFont#LabelBMFont ret (retunr value: cc.LabelBMFont) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/LayerColor.lua b/cocos/scripting/lua-bindings/auto/api/LayerColor.lua index 8b555df12b..3477ca4bad 100644 --- a/cocos/scripting/lua-bindings/auto/api/LayerColor.lua +++ b/cocos/scripting/lua-bindings/auto/api/LayerColor.lua @@ -37,7 +37,7 @@ -- @function [parent=#LayerColor] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua b/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua index f02f0133bb..d486363575 100644 --- a/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua +++ b/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua @@ -21,7 +21,7 @@ -------------------------------- -- @function [parent=#LayerGradient] setVector -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#LayerGradient] setStartOpacity @@ -41,7 +41,7 @@ -------------------------------- -- @function [parent=#LayerGradient] getVector -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#LayerGradient] setEndColor @@ -68,13 +68,13 @@ -- -- overload function: create() -- --- overload function: create(color4b_table, color4b_table, vector2_table) +-- overload function: create(color4b_table, color4b_table, cc.Vec2) -- -- @function [parent=#LayerGradient] create -- @param self -- @param #color4b_table color4b -- @param #color4b_table color4b --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return LayerGradient#LayerGradient ret (retunr value: cc.LayerGradient) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Layout.lua b/cocos/scripting/lua-bindings/auto/api/Layout.lua index e3910d6f76..025ed662ee 100644 --- a/cocos/scripting/lua-bindings/auto/api/Layout.lua +++ b/cocos/scripting/lua-bindings/auto/api/Layout.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#Layout] setBackGroundColorVector -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Layout] setClippingType @@ -31,7 +31,7 @@ -------------------------------- -- @function [parent=#Layout] getBackGroundColorVector -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Layout] getClippingType diff --git a/cocos/scripting/lua-bindings/auto/api/Lens3D.lua b/cocos/scripting/lua-bindings/auto/api/Lens3D.lua index 5d968b4330..64515c4cde 100644 --- a/cocos/scripting/lua-bindings/auto/api/Lens3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Lens3D.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#Lens3D] setPosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Lens3D] setConcave @@ -21,7 +21,7 @@ -------------------------------- -- @function [parent=#Lens3D] getPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Lens3D] getLensEffect @@ -33,7 +33,7 @@ -- @param self -- @param #float float -- @param #size_table size --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @return Lens3D#Lens3D ret (return value: cc.Lens3D) diff --git a/cocos/scripting/lua-bindings/auto/api/MotionStreak.lua b/cocos/scripting/lua-bindings/auto/api/MotionStreak.lua index 8b0553ae90..e855e7bf85 100644 --- a/cocos/scripting/lua-bindings/auto/api/MotionStreak.lua +++ b/cocos/scripting/lua-bindings/auto/api/MotionStreak.lua @@ -99,7 +99,7 @@ -------------------------------- -- overload function: setPosition(float, float) -- --- overload function: setPosition(vector2_table) +-- overload function: setPosition(cc.Vec2) -- -- @function [parent=#MotionStreak] setPosition -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/MoveBy.lua b/cocos/scripting/lua-bindings/auto/api/MoveBy.lua index 837c15c792..a5cc8b69fa 100644 --- a/cocos/scripting/lua-bindings/auto/api/MoveBy.lua +++ b/cocos/scripting/lua-bindings/auto/api/MoveBy.lua @@ -7,7 +7,7 @@ -- @function [parent=#MoveBy] create -- @param self -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return MoveBy#MoveBy ret (return value: cc.MoveBy) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/MoveTo.lua b/cocos/scripting/lua-bindings/auto/api/MoveTo.lua index 569a3f6c61..42a9a667d3 100644 --- a/cocos/scripting/lua-bindings/auto/api/MoveTo.lua +++ b/cocos/scripting/lua-bindings/auto/api/MoveTo.lua @@ -7,7 +7,7 @@ -- @function [parent=#MoveTo] create -- @param self -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return MoveTo#MoveTo ret (return value: cc.MoveTo) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Node.lua b/cocos/scripting/lua-bindings/auto/api/Node.lua index 59d2257b5d..c4c3985ad1 100644 --- a/cocos/scripting/lua-bindings/auto/api/Node.lua +++ b/cocos/scripting/lua-bindings/auto/api/Node.lua @@ -63,8 +63,8 @@ -------------------------------- -- @function [parent=#Node] convertToWorldSpaceAR -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] isIgnoreAnchorPointForPosition @@ -123,12 +123,12 @@ -------------------------------- -- @function [parent=#Node] getNodeToWorldTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Node] getPosition3D -- @param self --- @return vector3_table#vector3_table ret (return value: vector3_table) +-- @return Vec3#Vec3 ret (return value: cc.Vec3) -------------------------------- -- @function [parent=#Node] removeChild @@ -139,8 +139,8 @@ -------------------------------- -- @function [parent=#Node] convertToWorldSpace -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] getScene @@ -171,7 +171,7 @@ -- @function [parent=#Node] convertTouchToNodeSpace -- @param self -- @param #cc.Touch touch --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- overload function: removeAllChildrenWithCleanup(bool) @@ -200,24 +200,24 @@ -------------------------------- -- @function [parent=#Node] getRotation3D -- @param self --- @return vector3_table#vector3_table ret (return value: vector3_table) +-- @return Vec3#Vec3 ret (return value: cc.Vec3) -------------------------------- -- @function [parent=#Node] getNodeToParentTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Node] convertTouchToNodeSpaceAR -- @param self -- @param #cc.Touch touch --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] convertToNodeSpace -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] resume @@ -231,7 +231,7 @@ -------------------------------- -- overload function: setPosition(float, float) -- --- overload function: setPosition(vector2_table) +-- overload function: setPosition(cc.Vec2) -- -- @function [parent=#Node] setPosition -- @param self @@ -267,7 +267,7 @@ -------------------------------- -- @function [parent=#Node] setRotation3D -- @param self --- @param #vector3_table array +-- @param #cc.Vec3 vec3 -------------------------------- -- @function [parent=#Node] setPositionX @@ -277,12 +277,12 @@ -------------------------------- -- @function [parent=#Node] setNodeToParentTransform -- @param self --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -------------------------------- -- @function [parent=#Node] getAnchorPoint -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] getNumberOfRunningActions @@ -306,8 +306,8 @@ -------------------------------- -- @function [parent=#Node] convertToNodeSpaceAR -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] addComponent @@ -328,7 +328,7 @@ -------------------------------- -- @function [parent=#Node] getAnchorPointInPoints -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Node] runAction @@ -374,11 +374,11 @@ -------------------------------- -- overload function: setAdditionalTransform(cc.AffineTransform) -- --- overload function: setAdditionalTransform(matrix_table) +-- overload function: setAdditionalTransform(cc.Mat4) -- -- @function [parent=#Node] setAdditionalTransform -- @param self --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -------------------------------- -- @function [parent=#Node] getDisplayedOpacity @@ -477,7 +477,7 @@ -------------------------------- -- @function [parent=#Node] getParentToNodeTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Node] setGlobalZOrder @@ -578,12 +578,12 @@ -------------------------------- -- overload function: draw() -- --- overload function: draw(cc.Renderer, matrix_table, bool) +-- overload function: draw(cc.Renderer, cc.Mat4, bool) -- -- @function [parent=#Node] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- @@ -603,7 +603,7 @@ -------------------------------- -- @function [parent=#Node] setPosition3D -- @param self --- @param #vector3_table array +-- @param #cc.Vec3 vec3 -------------------------------- -- @function [parent=#Node] update @@ -617,7 +617,7 @@ -------------------------------- -- @function [parent=#Node] getWorldToNodeTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Node] setGLProgram diff --git a/cocos/scripting/lua-bindings/auto/api/ParallaxNode.lua b/cocos/scripting/lua-bindings/auto/api/ParallaxNode.lua index 69a1488cdd..b58ba189a0 100644 --- a/cocos/scripting/lua-bindings/auto/api/ParallaxNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/ParallaxNode.lua @@ -8,8 +8,8 @@ -- @param self -- @param #cc.Node node -- @param #int int --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ParallaxNode] removeAllChildrenWithCleanup diff --git a/cocos/scripting/lua-bindings/auto/api/ParticleBatchNode.lua b/cocos/scripting/lua-bindings/auto/api/ParticleBatchNode.lua index aa310eae54..7880c00c57 100644 --- a/cocos/scripting/lua-bindings/auto/api/ParticleBatchNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/ParticleBatchNode.lua @@ -70,7 +70,7 @@ -- @function [parent=#ParticleBatchNode] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua b/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua index de3905dc84..f9614f5cb4 100644 --- a/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua +++ b/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua @@ -36,7 +36,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] setPosVar -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ParticleSystem] getEndSpin @@ -106,7 +106,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] getGravity -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ParticleSystem] getTangentialAccel @@ -151,7 +151,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] getPosVar -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ParticleSystem] updateWithNoTime @@ -179,7 +179,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] getSourcePosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ParticleSystem] setLifeVar @@ -200,7 +200,7 @@ -- @function [parent=#ParticleSystem] updateQuadWithParticle -- @param self -- @param #cc.sParticle sparticle --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ParticleSystem] getAtlasIndex @@ -294,7 +294,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] setSourcePosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ParticleSystem] getEndSpinVar @@ -389,7 +389,7 @@ -------------------------------- -- @function [parent=#ParticleSystem] setGravity -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ParticleSystem] postStep diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsBody.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsBody.lua index b1be555484..318953e654 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsBody.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsBody.lua @@ -48,14 +48,14 @@ -- @return float#float ret (return value: float) -------------------------------- --- overload function: applyImpulse(vector2_table, vector2_table) +-- overload function: applyImpulse(cc.Vec2, cc.Vec2) -- --- overload function: applyImpulse(vector2_table) +-- overload function: applyImpulse(cc.Vec2) -- -- @function [parent=#PhysicsBody] applyImpulse -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsBody] setRotationOffset @@ -63,14 +63,14 @@ -- @param #float float -------------------------------- --- overload function: applyForce(vector2_table, vector2_table) +-- overload function: applyForce(cc.Vec2, cc.Vec2) -- --- overload function: applyForce(vector2_table) +-- overload function: applyForce(cc.Vec2) -- -- @function [parent=#PhysicsBody] applyForce -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsBody] addShape @@ -97,7 +97,7 @@ -------------------------------- -- @function [parent=#PhysicsBody] getVelocity -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] getLinearDamping @@ -126,7 +126,7 @@ -------------------------------- -- @function [parent=#PhysicsBody] getPositionOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] setCategoryBitmask @@ -146,7 +146,7 @@ -------------------------------- -- @function [parent=#PhysicsBody] getPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] setEnable @@ -176,8 +176,8 @@ -------------------------------- -- @function [parent=#PhysicsBody] local2World -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] getCategoryBitmask @@ -212,8 +212,8 @@ -------------------------------- -- @function [parent=#PhysicsBody] world2Local -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] isEnabled @@ -243,7 +243,7 @@ -------------------------------- -- @function [parent=#PhysicsBody] setVelocity -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsBody] setLinearDamping @@ -258,7 +258,7 @@ -------------------------------- -- @function [parent=#PhysicsBody] setPositionOffset -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsBody] setRotationEnable @@ -278,8 +278,8 @@ -------------------------------- -- @function [parent=#PhysicsBody] getVelocityAtLocalPoint -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] isResting @@ -305,8 +305,8 @@ -------------------------------- -- @function [parent=#PhysicsBody] getVelocityAtWorldPoint -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsBody] setContactTestBitmask @@ -332,14 +332,14 @@ -- @param self -- @param #size_table size -- @param #cc.PhysicsMaterial physicsmaterial --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) -------------------------------- -- @function [parent=#PhysicsBody] createEdgeSegment -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #cc.PhysicsMaterial physicsmaterial -- @param #float float -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) @@ -363,7 +363,7 @@ -- @param #size_table size -- @param #cc.PhysicsMaterial physicsmaterial -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) -------------------------------- @@ -371,7 +371,7 @@ -- @param self -- @param #float float -- @param #cc.PhysicsMaterial physicsmaterial --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsContactPostSolve.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsContactPostSolve.lua index 07f45c1197..bfe726c1ae 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsContactPostSolve.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsContactPostSolve.lua @@ -10,7 +10,7 @@ -------------------------------- -- @function [parent=#PhysicsContactPostSolve] getSurfaceVelocity -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsContactPostSolve] getRestitution diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsContactPreSolve.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsContactPreSolve.lua index 892baaa0a1..85596ea89f 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsContactPreSolve.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsContactPreSolve.lua @@ -24,12 +24,12 @@ -------------------------------- -- @function [parent=#PhysicsContactPreSolve] getSurfaceVelocity -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsContactPreSolve] setSurfaceVelocity -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsContactPreSolve] setRestitution diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointDistance.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointDistance.lua index 6f40c2dcba..efca88e08a 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointDistance.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointDistance.lua @@ -18,8 +18,8 @@ -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @return PhysicsJointDistance#PhysicsJointDistance ret (return value: cc.PhysicsJointDistance) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointFixed.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointFixed.lua index 57a6d4d79c..acfb75279a 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointFixed.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointFixed.lua @@ -8,7 +8,7 @@ -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsJointFixed#PhysicsJointFixed ret (return value: cc.PhysicsJointFixed) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointGroove.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointGroove.lua index d206386932..be58fc9dfa 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointGroove.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointGroove.lua @@ -6,41 +6,41 @@ -------------------------------- -- @function [parent=#PhysicsJointGroove] setAnchr2 -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointGroove] setGrooveA -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointGroove] setGrooveB -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointGroove] getGrooveA -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointGroove] getGrooveB -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointGroove] getAnchr2 -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointGroove] construct -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @return PhysicsJointGroove#PhysicsJointGroove ret (return value: cc.PhysicsJointGroove) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointLimit.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointLimit.lua index f0bb61c2ac..c508cba0e7 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointLimit.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointLimit.lua @@ -6,12 +6,12 @@ -------------------------------- -- @function [parent=#PhysicsJointLimit] setAnchr2 -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointLimit] setAnchr1 -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointLimit] setMax @@ -21,12 +21,12 @@ -------------------------------- -- @function [parent=#PhysicsJointLimit] getAnchr2 -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointLimit] getAnchr1 -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointLimit] getMin @@ -44,16 +44,16 @@ -- @param #float float -------------------------------- --- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, vector2_table, vector2_table, float, float) +-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, cc.Vec2, cc.Vec2, float, float) -- --- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, vector2_table, vector2_table) +-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, cc.Vec2, cc.Vec2) -- -- @function [parent=#PhysicsJointLimit] construct -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #float float -- @return PhysicsJointLimit#PhysicsJointLimit ret (retunr value: cc.PhysicsJointLimit) diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointPin.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointPin.lua index 16b6f66bd8..152e175fbe 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointPin.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointPin.lua @@ -8,7 +8,7 @@ -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsJointPin#PhysicsJointPin ret (return value: cc.PhysicsJointPin) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsJointSpring.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsJointSpring.lua index 4b51d70f2a..1cf6b4795f 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsJointSpring.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsJointSpring.lua @@ -6,12 +6,12 @@ -------------------------------- -- @function [parent=#PhysicsJointSpring] setAnchr2 -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointSpring] setAnchr1 -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsJointSpring] getDamping @@ -31,12 +31,12 @@ -------------------------------- -- @function [parent=#PhysicsJointSpring] getAnchr2 -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointSpring] getAnchr1 -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsJointSpring] getStiffness @@ -58,8 +58,8 @@ -- @param self -- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #float float -- @return PhysicsJointSpring#PhysicsJointSpring ret (return value: cc.PhysicsJointSpring) diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShape.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShape.lua index 400a7a3db7..9b1786396d 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShape.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShape.lua @@ -56,7 +56,7 @@ -------------------------------- -- @function [parent=#PhysicsShape] containsPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -77,7 +77,7 @@ -------------------------------- -- @function [parent=#PhysicsShape] getCenter -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShape] getDensity @@ -112,7 +112,7 @@ -------------------------------- -- @function [parent=#PhysicsShape] getOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShape] getRestitution diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeBox.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeBox.lua index 3bb6f81e08..81b50c3daf 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeBox.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeBox.lua @@ -18,7 +18,7 @@ -- @param self -- @param #size_table size -- @param #cc.PhysicsMaterial physicsmaterial --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsShapeBox#PhysicsShapeBox ret (return value: cc.PhysicsShapeBox) -------------------------------- @@ -32,13 +32,13 @@ -- @param self -- @param #float float -- @param #size_table size --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#PhysicsShapeBox] getOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShapeBox] calculateDefaultMoment diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeCircle.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeCircle.lua index 0276a6deed..3b6ff2f69c 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeCircle.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeCircle.lua @@ -13,7 +13,7 @@ -- @param self -- @param #float float -- @param #cc.PhysicsMaterial physicsmaterial --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsShapeCircle#PhysicsShapeCircle ret (return value: cc.PhysicsShapeCircle) -------------------------------- @@ -27,13 +27,13 @@ -- @param self -- @param #float float -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#PhysicsShapeCircle] getOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShapeCircle] calculateDefaultMoment diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeBox.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeBox.lua index 6cb94825bd..5036735233 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeBox.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeBox.lua @@ -14,12 +14,12 @@ -- @param #size_table size -- @param #cc.PhysicsMaterial physicsmaterial -- @param #float float --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsShapeEdgeBox#PhysicsShapeEdgeBox ret (return value: cc.PhysicsShapeEdgeBox) -------------------------------- -- @function [parent=#PhysicsShapeEdgeBox] getOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeChain.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeChain.lua index 3b8ec67729..270ecd679a 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeChain.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeChain.lua @@ -11,6 +11,6 @@ -------------------------------- -- @function [parent=#PhysicsShapeEdgeChain] getCenter -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgePolygon.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgePolygon.lua index 0f65e53c2f..f0e1cbb272 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgePolygon.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgePolygon.lua @@ -11,6 +11,6 @@ -------------------------------- -- @function [parent=#PhysicsShapeEdgePolygon] getCenter -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeSegment.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeSegment.lua index f1f8a6939c..46b65a0317 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeSegment.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapeEdgeSegment.lua @@ -6,18 +6,18 @@ -------------------------------- -- @function [parent=#PhysicsShapeEdgeSegment] getPointB -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShapeEdgeSegment] getPointA -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShapeEdgeSegment] create -- @param self --- @param #vector2_table array --- @param #vector2_table array +-- @param #cc.Vec2 vec2 +-- @param #cc.Vec2 vec2 -- @param #cc.PhysicsMaterial physicsmaterial -- @param #float float -- @return PhysicsShapeEdgeSegment#PhysicsShapeEdgeSegment ret (return value: cc.PhysicsShapeEdgeSegment) @@ -25,6 +25,6 @@ -------------------------------- -- @function [parent=#PhysicsShapeEdgeSegment] getCenter -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua index 73f5f9ee0f..082fc658ba 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsShapePolygon.lua @@ -12,7 +12,7 @@ -- @function [parent=#PhysicsShapePolygon] getPoint -- @param self -- @param #int int --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsShapePolygon] calculateDefaultMoment @@ -22,6 +22,6 @@ -------------------------------- -- @function [parent=#PhysicsShapePolygon] getCenter -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua index c574f44609..d05988fecd 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsWorld.lua @@ -5,7 +5,7 @@ -------------------------------- -- @function [parent=#PhysicsWorld] getGravity -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#PhysicsWorld] getAllBodies @@ -15,7 +15,7 @@ -------------------------------- -- @function [parent=#PhysicsWorld] setGravity -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#PhysicsWorld] getSpeed @@ -50,7 +50,7 @@ -------------------------------- -- @function [parent=#PhysicsWorld] getShapes -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return array_table#array_table ret (return value: array_table) -------------------------------- @@ -60,7 +60,7 @@ -------------------------------- -- @function [parent=#PhysicsWorld] getShape -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Place.lua b/cocos/scripting/lua-bindings/auto/api/Place.lua index acfa221588..1c7763fb31 100644 --- a/cocos/scripting/lua-bindings/auto/api/Place.lua +++ b/cocos/scripting/lua-bindings/auto/api/Place.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#Place] create -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return Place#Place ret (return value: cc.Place) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua b/cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua index 2b9b8915ac..d8a28dfd2b 100644 --- a/cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua +++ b/cocos/scripting/lua-bindings/auto/api/ProgressTimer.lua @@ -11,7 +11,7 @@ -------------------------------- -- @function [parent=#ProgressTimer] setBarChangeRate -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ProgressTimer] getPercentage @@ -36,12 +36,12 @@ -------------------------------- -- @function [parent=#ProgressTimer] setMidpoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ProgressTimer] getBarChangeRate -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- overload function: setReverseDirection(bool) @@ -55,7 +55,7 @@ -------------------------------- -- @function [parent=#ProgressTimer] getMidpoint -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#ProgressTimer] setPercentage @@ -76,13 +76,13 @@ -------------------------------- -- @function [parent=#ProgressTimer] setAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ProgressTimer] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua b/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua index 6316f226b2..41c187bef3 100644 --- a/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua +++ b/cocos/scripting/lua-bindings/auto/api/RenderTexture.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#RenderTexture] setVirtualViewport -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #rect_table rect -- @param #rect_table rect @@ -169,7 +169,7 @@ -- @function [parent=#RenderTexture] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/RichText.lua b/cocos/scripting/lua-bindings/auto/api/RichText.lua index de7d915621..bec3d6dfc0 100644 --- a/cocos/scripting/lua-bindings/auto/api/RichText.lua +++ b/cocos/scripting/lua-bindings/auto/api/RichText.lua @@ -12,7 +12,7 @@ -------------------------------- -- @function [parent=#RichText] setAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#RichText] pushBackElement diff --git a/cocos/scripting/lua-bindings/auto/api/Ripple3D.lua b/cocos/scripting/lua-bindings/auto/api/Ripple3D.lua index 8f8bb5de9b..4fa51ed11c 100644 --- a/cocos/scripting/lua-bindings/auto/api/Ripple3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Ripple3D.lua @@ -26,19 +26,19 @@ -------------------------------- -- @function [parent=#Ripple3D] setPosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Ripple3D] getPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Ripple3D] create -- @param self -- @param #float float -- @param #size_table size --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #unsigned int int -- @param #float float diff --git a/cocos/scripting/lua-bindings/auto/api/RotateBy.lua b/cocos/scripting/lua-bindings/auto/api/RotateBy.lua index 6ce7b86d82..fe21b9ed09 100644 --- a/cocos/scripting/lua-bindings/auto/api/RotateBy.lua +++ b/cocos/scripting/lua-bindings/auto/api/RotateBy.lua @@ -8,7 +8,7 @@ -- -- overload function: create(float, float) -- --- overload function: create(float, vector3_table) +-- overload function: create(float, cc.Vec3) -- -- @function [parent=#RotateBy] create -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/ScrollView.lua b/cocos/scripting/lua-bindings/auto/api/ScrollView.lua index 9f9fa2735c..abe043c75a 100644 --- a/cocos/scripting/lua-bindings/auto/api/ScrollView.lua +++ b/cocos/scripting/lua-bindings/auto/api/ScrollView.lua @@ -24,7 +24,7 @@ -------------------------------- -- @function [parent=#ScrollView] scrollToPercentBothDirection -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #float float -- @param #bool bool @@ -128,7 +128,7 @@ -------------------------------- -- @function [parent=#ScrollView] jumpToPercentBothDirection -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#ScrollView] scrollToPercentVertical diff --git a/cocos/scripting/lua-bindings/auto/api/ShuffleTiles.lua b/cocos/scripting/lua-bindings/auto/api/ShuffleTiles.lua index c955115690..db4824e555 100644 --- a/cocos/scripting/lua-bindings/auto/api/ShuffleTiles.lua +++ b/cocos/scripting/lua-bindings/auto/api/ShuffleTiles.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#ShuffleTiles] placeTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #cc.Tile tile -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Skeleton.lua b/cocos/scripting/lua-bindings/auto/api/Skeleton.lua index d94a0647e7..3c59d34262 100644 --- a/cocos/scripting/lua-bindings/auto/api/Skeleton.lua +++ b/cocos/scripting/lua-bindings/auto/api/Skeleton.lua @@ -15,7 +15,7 @@ -------------------------------- -- @function [parent=#Skeleton] onDraw -- @param self --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Skin.lua b/cocos/scripting/lua-bindings/auto/api/Skin.lua index 5a2a6dc30a..b15fe4a84e 100644 --- a/cocos/scripting/lua-bindings/auto/api/Skin.lua +++ b/cocos/scripting/lua-bindings/auto/api/Skin.lua @@ -11,7 +11,7 @@ -------------------------------- -- @function [parent=#Skin] getNodeToWorldTransformAR -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Skin] initWithFile @@ -62,13 +62,13 @@ -------------------------------- -- @function [parent=#Skin] getNodeToWorldTransform -- @param self --- @return matrix_table#matrix_table ret (return value: matrix_table) +-- @return Mat4#Mat4 ret (return value: cc.Mat4) -------------------------------- -- @function [parent=#Skin] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Slider.lua b/cocos/scripting/lua-bindings/auto/api/Slider.lua index d2887e3b99..5da92bb6ed 100644 --- a/cocos/scripting/lua-bindings/auto/api/Slider.lua +++ b/cocos/scripting/lua-bindings/auto/api/Slider.lua @@ -119,7 +119,7 @@ -------------------------------- -- @function [parent=#Slider] hitTest -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite.lua b/cocos/scripting/lua-bindings/auto/api/Sprite.lua index 0774209628..6df11fed4e 100644 --- a/cocos/scripting/lua-bindings/auto/api/Sprite.lua +++ b/cocos/scripting/lua-bindings/auto/api/Sprite.lua @@ -44,7 +44,7 @@ -------------------------------- -- @function [parent=#Sprite] getOffsetPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Sprite] removeAllChildrenWithCleanup @@ -184,7 +184,7 @@ -- @function [parent=#Sprite] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- @@ -217,7 +217,7 @@ -------------------------------- -- @function [parent=#Sprite] setAnchorPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Sprite] setRotationSkewX diff --git a/cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua b/cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua index fa0afd485a..1b3f5fce98 100644 --- a/cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/SpriteBatchNode.lua @@ -118,7 +118,7 @@ -- @function [parent=#SpriteBatchNode] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua index 294d610b65..ebd679be95 100644 --- a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua +++ b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua @@ -19,7 +19,7 @@ -- @param #cc.Texture2D texture2d -------------------------------- --- overload function: initWithTexture(cc.Texture2D, rect_table, bool, vector2_table, size_table) +-- overload function: initWithTexture(cc.Texture2D, rect_table, bool, cc.Vec2, size_table) -- -- overload function: initWithTexture(cc.Texture2D, rect_table) -- @@ -28,7 +28,7 @@ -- @param #cc.Texture2D texture2d -- @param #rect_table rect -- @param #bool bool --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #size_table size -- @return bool#bool ret (retunr value: bool) @@ -50,7 +50,7 @@ -------------------------------- -- @function [parent=#SpriteFrame] setOffsetInPixels -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#SpriteFrame] getRectInPixels @@ -75,12 +75,12 @@ -------------------------------- -- @function [parent=#SpriteFrame] setOffset -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#SpriteFrame] getOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#SpriteFrame] isRotated @@ -88,7 +88,7 @@ -- @return bool#bool ret (return value: bool) -------------------------------- --- overload function: initWithTextureFilename(string, rect_table, bool, vector2_table, size_table) +-- overload function: initWithTextureFilename(string, rect_table, bool, cc.Vec2, size_table) -- -- overload function: initWithTextureFilename(string, rect_table) -- @@ -97,7 +97,7 @@ -- @param #string str -- @param #rect_table rect -- @param #bool bool --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #size_table size -- @return bool#bool ret (retunr value: bool) @@ -109,7 +109,7 @@ -------------------------------- -- @function [parent=#SpriteFrame] getOffsetInPixels -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#SpriteFrame] getOriginalSize @@ -117,7 +117,7 @@ -- @return size_table#size_table ret (return value: size_table) -------------------------------- --- overload function: create(string, rect_table, bool, vector2_table, size_table) +-- overload function: create(string, rect_table, bool, cc.Vec2, size_table) -- -- overload function: create(string, rect_table) -- @@ -126,12 +126,12 @@ -- @param #string str -- @param #rect_table rect -- @param #bool bool --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #size_table size -- @return SpriteFrame#SpriteFrame ret (retunr value: cc.SpriteFrame) -------------------------------- --- overload function: createWithTexture(cc.Texture2D, rect_table, bool, vector2_table, size_table) +-- overload function: createWithTexture(cc.Texture2D, rect_table, bool, cc.Vec2, size_table) -- -- overload function: createWithTexture(cc.Texture2D, rect_table) -- @@ -140,7 +140,7 @@ -- @param #cc.Texture2D texture2d -- @param #rect_table rect -- @param #bool bool --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #size_table size -- @return SpriteFrame#SpriteFrame ret (retunr value: cc.SpriteFrame) diff --git a/cocos/scripting/lua-bindings/auto/api/TMXLayer.lua b/cocos/scripting/lua-bindings/auto/api/TMXLayer.lua index f66e717b33..95bb80d249 100644 --- a/cocos/scripting/lua-bindings/auto/api/TMXLayer.lua +++ b/cocos/scripting/lua-bindings/auto/api/TMXLayer.lua @@ -6,15 +6,15 @@ -------------------------------- -- @function [parent=#TMXLayer] getTileGIDAt -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #cc.TMXTileFlags_ tmxtileflags_ -- @return unsigned int#unsigned int ret (return value: unsigned int) -------------------------------- -- @function [parent=#TMXLayer] getPositionAt -- @param self --- @param #vector2_table array --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @param #cc.Vec2 vec2 +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#TMXLayer] setLayerOrientation @@ -58,7 +58,7 @@ -------------------------------- -- @function [parent=#TMXLayer] removeTileAt -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#TMXLayer] initWithTilesetInfo @@ -73,14 +73,14 @@ -- @param self -------------------------------- --- overload function: setTileGID(unsigned int, vector2_table, cc.TMXTileFlags_) +-- overload function: setTileGID(unsigned int, cc.Vec2, cc.TMXTileFlags_) -- --- overload function: setTileGID(unsigned int, vector2_table) +-- overload function: setTileGID(unsigned int, cc.Vec2) -- -- @function [parent=#TMXLayer] setTileGID -- @param self -- @param #unsigned int int --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #cc.TMXTileFlags_ tmxtileflags_ -------------------------------- @@ -126,7 +126,7 @@ -------------------------------- -- @function [parent=#TMXLayer] getTileAt -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return Sprite#Sprite ret (return value: cc.Sprite) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/TMXObjectGroup.lua b/cocos/scripting/lua-bindings/auto/api/TMXObjectGroup.lua index f89f66e842..e69279aae2 100644 --- a/cocos/scripting/lua-bindings/auto/api/TMXObjectGroup.lua +++ b/cocos/scripting/lua-bindings/auto/api/TMXObjectGroup.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#TMXObjectGroup] setPositionOffset -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#TMXObjectGroup] getProperty @@ -17,7 +17,7 @@ -------------------------------- -- @function [parent=#TMXObjectGroup] getPositionOffset -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#TMXObjectGroup] getObject diff --git a/cocos/scripting/lua-bindings/auto/api/TextField.lua b/cocos/scripting/lua-bindings/auto/api/TextField.lua index 7d84a20b54..8cbfe77802 100644 --- a/cocos/scripting/lua-bindings/auto/api/TextField.lua +++ b/cocos/scripting/lua-bindings/auto/api/TextField.lua @@ -154,7 +154,7 @@ -------------------------------- -- @function [parent=#TextField] hitTest -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua index 19fb7416a0..538e1efe30 100644 --- a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua @@ -144,7 +144,7 @@ -------------------------------- -- @function [parent=#Texture2D] drawAtPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Texture2D] getGLProgram diff --git a/cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua b/cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua index 04f6683ba1..c1ec36fe11 100644 --- a/cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua +++ b/cocos/scripting/lua-bindings/auto/api/TileMapAtlas.lua @@ -19,14 +19,14 @@ -------------------------------- -- @function [parent=#TileMapAtlas] getTileAt -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return color3b_table#color3b_table ret (return value: color3b_table) -------------------------------- -- @function [parent=#TileMapAtlas] setTile -- @param self -- @param #color3b_table color3b --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#TileMapAtlas] setTGAInfo diff --git a/cocos/scripting/lua-bindings/auto/api/Touch.lua b/cocos/scripting/lua-bindings/auto/api/Touch.lua index 13cd6ae294..a7717df0e6 100644 --- a/cocos/scripting/lua-bindings/auto/api/Touch.lua +++ b/cocos/scripting/lua-bindings/auto/api/Touch.lua @@ -6,27 +6,27 @@ -------------------------------- -- @function [parent=#Touch] getPreviousLocationInView -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getLocation -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getDelta -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getStartLocationInView -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getStartLocation -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getID @@ -43,12 +43,12 @@ -------------------------------- -- @function [parent=#Touch] getLocationInView -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] getPreviousLocation -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Touch] Touch diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionCrossFade.lua b/cocos/scripting/lua-bindings/auto/api/TransitionCrossFade.lua index e5e4ca60a5..2f2976e17c 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionCrossFade.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionCrossFade.lua @@ -14,7 +14,7 @@ -- @function [parent=#TransitionCrossFade] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool return nil diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionFadeTR.lua b/cocos/scripting/lua-bindings/auto/api/TransitionFadeTR.lua index cada7a2e53..48e1ed10ae 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionFadeTR.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionFadeTR.lua @@ -26,7 +26,7 @@ -- @function [parent=#TransitionFadeTR] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool return nil diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionPageTurn.lua b/cocos/scripting/lua-bindings/auto/api/TransitionPageTurn.lua index 38faa66cfe..a6c2c68d5a 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionPageTurn.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionPageTurn.lua @@ -29,7 +29,7 @@ -- @function [parent=#TransitionPageTurn] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionScene.lua b/cocos/scripting/lua-bindings/auto/api/TransitionScene.lua index f6a76963cf..15b33cbbe1 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionScene.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionScene.lua @@ -22,7 +22,7 @@ -- @function [parent=#TransitionScene] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionSplitCols.lua b/cocos/scripting/lua-bindings/auto/api/TransitionSplitCols.lua index 21a7b1afae..2b01b108fe 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionSplitCols.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionSplitCols.lua @@ -25,7 +25,7 @@ -- @function [parent=#TransitionSplitCols] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool return nil diff --git a/cocos/scripting/lua-bindings/auto/api/TransitionTurnOffTiles.lua b/cocos/scripting/lua-bindings/auto/api/TransitionTurnOffTiles.lua index 14e6f4574d..4ebec40ccf 100644 --- a/cocos/scripting/lua-bindings/auto/api/TransitionTurnOffTiles.lua +++ b/cocos/scripting/lua-bindings/auto/api/TransitionTurnOffTiles.lua @@ -20,7 +20,7 @@ -- @function [parent=#TransitionTurnOffTiles] draw -- @param self -- @param #cc.Renderer renderer --- @param #matrix_table matrix +-- @param #cc.Mat4 mat4 -- @param #bool bool return nil diff --git a/cocos/scripting/lua-bindings/auto/api/TurnOffTiles.lua b/cocos/scripting/lua-bindings/auto/api/TurnOffTiles.lua index 104734b689..ec7d2bc57e 100644 --- a/cocos/scripting/lua-bindings/auto/api/TurnOffTiles.lua +++ b/cocos/scripting/lua-bindings/auto/api/TurnOffTiles.lua @@ -6,12 +6,12 @@ -------------------------------- -- @function [parent=#TurnOffTiles] turnOnTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#TurnOffTiles] turnOffTile -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#TurnOffTiles] shuffle diff --git a/cocos/scripting/lua-bindings/auto/api/Twirl.lua b/cocos/scripting/lua-bindings/auto/api/Twirl.lua index 8b3afd531c..a5c55569bf 100644 --- a/cocos/scripting/lua-bindings/auto/api/Twirl.lua +++ b/cocos/scripting/lua-bindings/auto/api/Twirl.lua @@ -26,19 +26,19 @@ -------------------------------- -- @function [parent=#Twirl] setPosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Twirl] getPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Twirl] create -- @param self -- @param #float float -- @param #size_table size --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @param #unsigned int int -- @param #float float -- @return Twirl#Twirl ret (return value: cc.Twirl) diff --git a/cocos/scripting/lua-bindings/auto/api/Widget.lua b/cocos/scripting/lua-bindings/auto/api/Widget.lua index b7d336bb91..aba6a759a2 100644 --- a/cocos/scripting/lua-bindings/auto/api/Widget.lua +++ b/cocos/scripting/lua-bindings/auto/api/Widget.lua @@ -6,7 +6,7 @@ -------------------------------- -- @function [parent=#Widget] setSizePercent -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Widget] getCustomSize @@ -31,12 +31,12 @@ -------------------------------- -- @function [parent=#Widget] getTouchEndPos -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] setPositionPercent -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Widget] getLayoutSize @@ -125,7 +125,7 @@ -------------------------------- -- @function [parent=#Widget] getWorldPosition -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] setFocused @@ -145,7 +145,7 @@ -------------------------------- -- @function [parent=#Widget] getTouchMovePos -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] setEnabled @@ -175,12 +175,12 @@ -------------------------------- -- @function [parent=#Widget] getSizePercent -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] getTouchStartPos -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] setFocusEnabled @@ -200,7 +200,7 @@ -------------------------------- -- @function [parent=#Widget] clippingParentAreaContainPoint -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -255,12 +255,12 @@ -------------------------------- -- @function [parent=#Widget] getPositionPercent -- @param self --- @return vector2_table#vector2_table ret (return value: vector2_table) +-- @return Vec2#Vec2 ret (return value: cc.Vec2) -------------------------------- -- @function [parent=#Widget] hitTest -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -- @return bool#bool ret (return value: bool) -------------------------------- @@ -283,7 +283,7 @@ -- @param self -- @param #int int -- @param #ccui.Widget widget --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Widget] setSize @@ -328,7 +328,7 @@ -------------------------------- -- @function [parent=#Widget] setPosition -- @param self --- @param #vector2_table array +-- @param #cc.Vec2 vec2 -------------------------------- -- @function [parent=#Widget] getDescription diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index b28e1ed4aa..272d2f038c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -1558,7 +1558,7 @@ int lua_cocos2dx_Touch_getPreviousLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocationInView(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocationInView",argc, 0); @@ -1602,7 +1602,7 @@ int lua_cocos2dx_Touch_getLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getLocation(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLocation",argc, 0); @@ -1646,7 +1646,7 @@ int lua_cocos2dx_Touch_getDelta(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getDelta(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDelta",argc, 0); @@ -1690,7 +1690,7 @@ int lua_cocos2dx_Touch_getStartLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartLocationInView(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartLocationInView",argc, 0); @@ -1734,7 +1734,7 @@ int lua_cocos2dx_Touch_getStartLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartLocation(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartLocation",argc, 0); @@ -1874,7 +1874,7 @@ int lua_cocos2dx_Touch_getLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getLocationInView(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLocationInView",argc, 0); @@ -1918,7 +1918,7 @@ int lua_cocos2dx_Touch_getPreviousLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocation(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocation",argc, 0); @@ -3359,7 +3359,7 @@ int lua_cocos2dx_Texture2D_drawAtPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->drawAtPoint(arg0); @@ -4158,11 +4158,11 @@ int lua_cocos2dx_Node_convertToWorldSpaceAR(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToWorldSpaceAR(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToWorldSpaceAR",argc, 1); @@ -4703,7 +4703,7 @@ int lua_cocos2dx_Node_getNodeToWorldTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToWorldTransform(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToWorldTransform",argc, 0); @@ -4747,7 +4747,7 @@ int lua_cocos2dx_Node_getPosition3D(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec3 ret = cobj->getPosition3D(); - Vec3_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition3D",argc, 0); @@ -4849,11 +4849,11 @@ int lua_cocos2dx_Node_convertToWorldSpace(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToWorldSpace(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToWorldSpace",argc, 1); @@ -5124,7 +5124,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertTouchToNodeSpace(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertTouchToNodeSpace",argc, 1); @@ -5351,7 +5351,7 @@ int lua_cocos2dx_Node_getRotation3D(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec3 ret = cobj->getRotation3D(); - Vec3_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getRotation3D",argc, 0); @@ -5395,7 +5395,7 @@ int lua_cocos2dx_Node_getNodeToParentTransform(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToParentTransform",argc, 0); @@ -5442,7 +5442,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertTouchToNodeSpaceAR(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertTouchToNodeSpaceAR",argc, 1); @@ -5485,11 +5485,11 @@ int lua_cocos2dx_Node_convertToNodeSpace(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToNodeSpace(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToNodeSpace",argc, 1); @@ -5628,7 +5628,7 @@ int lua_cocos2dx_Node_setPosition(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } cobj->setPosition(arg0); @@ -5909,7 +5909,7 @@ int lua_cocos2dx_Node_setRotation3D(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_Vec3(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); if(!ok) return 0; cobj->setRotation3D(arg0); @@ -6001,7 +6001,7 @@ int lua_cocos2dx_Node_setNodeToParentTransform(lua_State* tolua_S) { cocos2d::Mat4 arg0; - ok &= luaval_to_matrix(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); if(!ok) return 0; cobj->setNodeToParentTransform(arg0); @@ -6048,7 +6048,7 @@ int lua_cocos2dx_Node_getAnchorPoint(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getAnchorPoint(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPoint",argc, 0); @@ -6266,11 +6266,11 @@ int lua_cocos2dx_Node_convertToNodeSpaceAR(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToNodeSpaceAR(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToNodeSpaceAR",argc, 1); @@ -6449,7 +6449,7 @@ int lua_cocos2dx_Node_getAnchorPointInPoints(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getAnchorPointInPoints(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPointInPoints",argc, 0); @@ -6856,7 +6856,7 @@ int lua_cocos2dx_Node_setAdditionalTransform(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Mat4* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Matrix",&arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); if (!ok) { break; } cobj->setAdditionalTransform(arg0); @@ -7684,7 +7684,7 @@ int lua_cocos2dx_Node_getParentToNodeTransform(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Mat4& ret = cobj->getParentToNodeTransform(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getParentToNodeTransform",argc, 0); @@ -8554,7 +8554,7 @@ int lua_cocos2dx_Node_draw(lua_State* tolua_S) if (!ok) { break; } cocos2d::Mat4 arg1; - ok &= luaval_to_matrix(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); if (!ok) { break; } bool arg2; @@ -8701,7 +8701,7 @@ int lua_cocos2dx_Node_setPosition3D(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_Vec3(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); if(!ok) return 0; cobj->setPosition3D(arg0); @@ -8837,7 +8837,7 @@ int lua_cocos2dx_Node_getWorldToNodeTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getWorldToNodeTransform(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWorldToNodeTransform",argc, 0); @@ -10616,7 +10616,7 @@ int lua_cocos2dx_Director_loadMatrix(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); - ok &= luaval_to_matrix(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); if(!ok) return 0; cobj->loadMatrix(arg0, arg1); @@ -10839,7 +10839,7 @@ int lua_cocos2dx_Director_getVisibleOrigin(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVisibleOrigin(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVisibleOrigin",argc, 0); @@ -11059,11 +11059,11 @@ int lua_cocos2dx_Director_convertToUI(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToUI(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToUI",argc, 1); @@ -11724,11 +11724,11 @@ int lua_cocos2dx_Director_convertToGL(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToGL(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToGL",argc, 1); @@ -12041,7 +12041,7 @@ int lua_cocos2dx_Director_getMatrix(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getMatrix(arg0); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMatrix",argc, 1); @@ -12715,7 +12715,7 @@ int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); - ok &= luaval_to_matrix(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); if(!ok) return 0; cobj->multiplyMatrix(arg0, arg1); @@ -16300,7 +16300,7 @@ int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -16503,7 +16503,7 @@ int lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setOffsetInPixels(arg0); @@ -16729,7 +16729,7 @@ int lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setOffset(arg0); @@ -16776,7 +16776,7 @@ int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); @@ -16869,7 +16869,7 @@ int lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -16985,7 +16985,7 @@ int lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffsetInPixels",argc, 0); @@ -17070,7 +17070,7 @@ int lua_cocos2dx_SpriteFrame_create(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } cocos2d::Size arg4; ok &= luaval_to_size(tolua_S, 6, &arg4); @@ -17133,7 +17133,7 @@ int lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } cocos2d::Size arg4; ok &= luaval_to_size(tolua_S, 6, &arg4); @@ -19003,7 +19003,7 @@ int lua_cocos2dx_RotateBy_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0); if (!ok) { break; } cocos2d::Vec3 arg1; - ok &= luaval_to_Vec3(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec3",&arg1); if (!ok) { break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); object_to_luaval(tolua_S, "cc.RotateBy",(cocos2d::RotateBy*)ret); @@ -19059,7 +19059,7 @@ int lua_cocos2dx_MoveBy_create(lua_State* tolua_S) double arg0; cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1); @@ -19114,7 +19114,7 @@ int lua_cocos2dx_MoveTo_create(lua_State* tolua_S) double arg0; cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1); @@ -19285,7 +19285,7 @@ int lua_cocos2dx_JumpBy_create(lua_State* tolua_S) double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if(!ok) @@ -19344,7 +19344,7 @@ int lua_cocos2dx_JumpTo_create(lua_State* tolua_S) double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if(!ok) @@ -20439,7 +20439,7 @@ int lua_cocos2dx_ActionCamera_setEye(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec3 arg0; - ok &= luaval_to_Vec3(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); if (!ok) { break; } cobj->setEye(arg0); @@ -20488,7 +20488,7 @@ int lua_cocos2dx_ActionCamera_getEye(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getEye(); - Vec3_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getEye",argc, 0); @@ -20531,7 +20531,7 @@ int lua_cocos2dx_ActionCamera_setUp(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_Vec3(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); if(!ok) return 0; cobj->setUp(arg0); @@ -20578,7 +20578,7 @@ int lua_cocos2dx_ActionCamera_getCenter(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getCenter(); - Vec3_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCenter",argc, 0); @@ -20621,7 +20621,7 @@ int lua_cocos2dx_ActionCamera_setCenter(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_Vec3(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); if(!ok) return 0; cobj->setCenter(arg0); @@ -20668,7 +20668,7 @@ int lua_cocos2dx_ActionCamera_getUp(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getUp(); - Vec3_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getUp",argc, 0); @@ -24066,7 +24066,7 @@ int lua_cocos2dx_Place_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Place* ret = cocos2d::Place::create(arg0); @@ -24931,7 +24931,7 @@ int lua_cocos2dx_Lens3D_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -25070,7 +25070,7 @@ int lua_cocos2dx_Lens3D_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -25150,7 +25150,7 @@ int lua_cocos2dx_Lens3D_create(lua_State* tolua_S) double arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) return 0; @@ -25401,7 +25401,7 @@ int lua_cocos2dx_Ripple3D_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -25448,7 +25448,7 @@ int lua_cocos2dx_Ripple3D_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -25486,7 +25486,7 @@ int lua_cocos2dx_Ripple3D_create(lua_State* tolua_S) double arg5; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); ok &= luaval_to_uint32(tolua_S, 6,&arg4); ok &= luaval_to_number(tolua_S, 7,&arg5); @@ -26289,7 +26289,7 @@ int lua_cocos2dx_Twirl_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -26336,7 +26336,7 @@ int lua_cocos2dx_Twirl_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -26373,7 +26373,7 @@ int lua_cocos2dx_Twirl_create(lua_State* tolua_S) double arg4; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); ok &= luaval_to_uint32(tolua_S, 5,&arg3); ok &= luaval_to_number(tolua_S, 6,&arg4); if(!ok) @@ -26732,7 +26732,7 @@ int lua_cocos2dx_ShuffleTiles_placeTile(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Tile* arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); #pragma warning NO CONVERSION TO NATIVE FOR Tile*; if(!ok) @@ -26936,7 +26936,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOnTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->turnOnTile(arg0); @@ -26982,7 +26982,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOffTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->turnOffTile(arg0); @@ -27029,7 +27029,7 @@ int lua_cocos2dx_FadeOutTRTiles_transformTile(lua_State* tolua_S) cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -27242,7 +27242,7 @@ int lua_cocos2dx_FadeOutUpTiles_transformTile(lua_State* tolua_S) cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -27401,7 +27401,7 @@ int lua_cocos2dx_TurnOffTiles_turnOnTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->turnOnTile(arg0); @@ -27447,7 +27447,7 @@ int lua_cocos2dx_TurnOffTiles_turnOffTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->turnOffTile(arg0); @@ -28321,7 +28321,7 @@ int lua_cocos2dx_CardinalSplineTo_updatePosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->updatePosition(arg0); @@ -28674,11 +28674,11 @@ int lua_cocos2dx_DrawNode_drawQuadraticBezier(lua_State* tolua_S) unsigned int arg3; cocos2d::Color4F arg4; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); ok &= luaval_to_uint32(tolua_S, 5,&arg3); @@ -28729,7 +28729,7 @@ int lua_cocos2dx_DrawNode_onDraw(lua_State* tolua_S) cocos2d::Mat4 arg0; bool arg1; - ok &= luaval_to_matrix(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) @@ -28823,11 +28823,11 @@ int lua_cocos2dx_DrawNode_drawTriangle(lua_State* tolua_S) cocos2d::Vec2 arg2; cocos2d::Color4F arg3; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); ok &=luaval_to_color4f(tolua_S, 5, &arg3); if(!ok) @@ -28877,7 +28877,7 @@ int lua_cocos2dx_DrawNode_drawDot(lua_State* tolua_S) double arg1; cocos2d::Color4F arg2; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); @@ -28932,13 +28932,13 @@ int lua_cocos2dx_DrawNode_drawCubicBezier(lua_State* tolua_S) unsigned int arg4; cocos2d::Color4F arg5; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); ok &= luaval_to_uint32(tolua_S, 6,&arg4); @@ -28991,9 +28991,9 @@ int lua_cocos2dx_DrawNode_drawSegment(lua_State* tolua_S) double arg2; cocos2d::Color4F arg3; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); @@ -30999,7 +30999,7 @@ int lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Mat4 arg0; - ok &= luaval_to_matrix(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); if (!ok) { break; } cobj->setUniformsForBuiltins(arg0); @@ -33605,7 +33605,7 @@ int lua_cocos2dx_Label_setBMFontFilePath(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; bool ret = cobj->setBMFontFilePath(arg0, arg1); @@ -34839,7 +34839,7 @@ int lua_cocos2dx_Label_createWithBMFont(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 3,&arg1); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); - ok &= luaval_to_vector2(tolua_S, 6, &arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); if(!ok) return 0; cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3, arg4); @@ -35528,7 +35528,7 @@ int lua_cocos2dx_LabelBMFont_initWithString(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); - ok &= luaval_to_vector2(tolua_S, 6, &arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); if(!ok) return 0; bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); @@ -35678,7 +35678,7 @@ int lua_cocos2dx_LabelBMFont_setFntFile(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cobj->setFntFile(arg0, arg1); @@ -35884,7 +35884,7 @@ int lua_cocos2dx_LabelBMFont_create(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if (!ok) { break; } cocos2d::Vec2 arg4; - ok &= luaval_to_vector2(tolua_S, 6, &arg4); + ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); if (!ok) { break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4); object_to_luaval(tolua_S, "cc.LabelBMFont",(cocos2d::LabelBMFont*)ret); @@ -36409,7 +36409,7 @@ int lua_cocos2dx_LayerGradient_setVector(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setVector(arg0); @@ -36594,7 +36594,7 @@ int lua_cocos2dx_LayerGradient_getVector(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getVector(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVector",argc, 0); @@ -36838,7 +36838,7 @@ int lua_cocos2dx_LayerGradient_create(lua_State* tolua_S) ok &=luaval_to_color4b(tolua_S, 3, &arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if (!ok) { break; } cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2); object_to_luaval(tolua_S, "cc.LayerGradient",(cocos2d::LayerGradient*)ret); @@ -43429,7 +43429,7 @@ int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffsetPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffsetPosition",argc, 0); @@ -44589,7 +44589,7 @@ int lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setBarChangeRate(arg0); @@ -44813,7 +44813,7 @@ int lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setMidpoint(arg0); @@ -44860,7 +44860,7 @@ int lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getBarChangeRate(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBarChangeRate",argc, 0); @@ -44957,7 +44957,7 @@ int lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getMidpoint(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMidpoint",argc, 0); @@ -45773,7 +45773,7 @@ int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) cocos2d::Rect arg1; cocos2d::Rect arg2; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_rect(tolua_S, 3, &arg1); @@ -48090,7 +48090,7 @@ int lua_cocos2dx_ParticleSystem_setPosVar(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPosVar(arg0); @@ -48725,7 +48725,7 @@ int lua_cocos2dx_ParticleSystem_getGravity(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getGravity(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGravity",argc, 0); @@ -49131,7 +49131,7 @@ int lua_cocos2dx_ParticleSystem_getPosVar(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosVar(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosVar",argc, 0); @@ -49395,7 +49395,7 @@ int lua_cocos2dx_ParticleSystem_getSourcePosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getSourcePosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSourcePosition",argc, 0); @@ -49579,7 +49579,7 @@ int lua_cocos2dx_ParticleSystem_updateQuadWithParticle(lua_State* tolua_S) #pragma warning NO CONVERSION TO NATIVE FOR sParticle*; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cobj->updateQuadWithParticle(arg0, arg1); @@ -50434,7 +50434,7 @@ int lua_cocos2dx_ParticleSystem_setSourcePosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setSourcePosition(arg0); @@ -51294,7 +51294,7 @@ int lua_cocos2dx_ParticleSystem_setGravity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setGravity(arg0); @@ -53921,7 +53921,7 @@ int lua_cocos2dx_GridBase_getStep(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getStep(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStep",argc, 0); @@ -54007,7 +54007,7 @@ int lua_cocos2dx_GridBase_setStep(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setStep(arg0); @@ -55382,7 +55382,7 @@ int lua_cocos2dx_GLViewProtocol_getVisibleOrigin(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVisibleOrigin(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVisibleOrigin",argc, 0); @@ -58322,9 +58322,9 @@ int lua_cocos2dx_ParallaxNode_addChild(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if(!ok) return 0; cobj->addChild(arg0, arg1, arg2, arg3); @@ -58516,7 +58516,7 @@ int lua_cocos2dx_TMXObjectGroup_setPositionOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPositionOffset(arg0); @@ -58610,7 +58610,7 @@ int lua_cocos2dx_TMXObjectGroup_getPositionOffset(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPositionOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionOffset",argc, 0); @@ -60907,7 +60907,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; unsigned int ret = cobj->getTileGIDAt(arg0); @@ -60919,7 +60919,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::TMXTileFlags_* arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); #pragma warning NO CONVERSION TO NATIVE FOR TMXTileFlags_*; if(!ok) @@ -60968,11 +60968,11 @@ int lua_cocos2dx_TMXLayer_getPositionAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPositionAt(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionAt",argc, 1); @@ -61376,7 +61376,7 @@ int lua_cocos2dx_TMXLayer_removeTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->removeTileAt(arg0); @@ -61516,7 +61516,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if (!ok) { break; } cocos2d::TMXTileFlags_ arg2; @@ -61535,7 +61535,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if (!ok) { break; } cobj->setTileGID(arg0, arg1); @@ -61901,7 +61901,7 @@ int lua_cocos2dx_TMXLayer_getTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Sprite* ret = cobj->getTileAt(arg0); @@ -62857,7 +62857,7 @@ int lua_cocos2dx_TileMapAtlas_getTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Color3B ret = cobj->getTileAt(arg0); @@ -62907,7 +62907,7 @@ int lua_cocos2dx_TileMapAtlas_setTile(lua_State* tolua_S) ok &= luaval_to_color3b(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cobj->setTile(arg0, arg1); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp index 6ca6cda628..97d71ef5c0 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp @@ -2028,7 +2028,7 @@ int lua_cocos2dx_extension_Control_getTouchLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getTouchLocation(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchLocation",argc, 1); @@ -2508,7 +2508,7 @@ int lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setLabelAnchorPoint(arg0); @@ -2555,7 +2555,7 @@ int lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getLabelAnchorPoint(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLabelAnchorPoint",argc, 0); @@ -4174,7 +4174,7 @@ int lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(lua_State* tolu ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; bool ret = cobj->initWithTargetAndPos(arg0, arg1); @@ -4268,7 +4268,7 @@ int lua_cocos2dx_extension_ControlHuePicker_getStartPos(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartPos(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartPos",argc, 0); @@ -4615,7 +4615,7 @@ int lua_cocos2dx_extension_ControlHuePicker_create(lua_State* tolua_S) cocos2d::Node* arg0; cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); @@ -4773,7 +4773,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPo ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; bool ret = cobj->initWithTargetAndPos(arg0, arg1); @@ -4821,7 +4821,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(lua_Sta if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartPos(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartPos",argc, 0); @@ -5120,7 +5120,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create(lua_State* t cocos2d::Node* arg0; cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); @@ -5830,7 +5830,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(lua_State* t { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPreviousLocation(arg0); @@ -6013,13 +6013,13 @@ int lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoi cocos2d::Vec2 arg2; cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if(!ok) return 0; double ret = cobj->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(arg0, arg1, arg2, arg3); @@ -6066,7 +6066,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->potentiometerBegan(arg0); @@ -6293,7 +6293,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(lua_State* t if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocation(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocation",argc, 0); @@ -6337,9 +6337,9 @@ int lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(lua cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; double ret = cobj->distanceBetweenPointAndPoint(arg0, arg1); @@ -6386,7 +6386,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->potentiometerEnded(arg0); @@ -6621,7 +6621,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->potentiometerMoved(arg0); @@ -6825,7 +6825,7 @@ int lua_cocos2dx_extension_ControlSlider_locationFromTouch(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "locationFromTouch",argc, 1); @@ -8251,7 +8251,7 @@ int lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(lua_Sta { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->updateLayoutUsingTouchLocation(arg0); @@ -9375,7 +9375,7 @@ int lua_cocos2dx_extension_ControlSwitch_locationFromTouch(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "locationFromTouch",argc, 1); @@ -9691,7 +9691,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration(lua_State* tolu cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -10255,7 +10255,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setContentOffset(arg0); @@ -10266,7 +10266,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) cocos2d::Vec2 arg0; bool arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) @@ -10542,7 +10542,7 @@ int lua_cocos2dx_extension_ScrollView_getContentOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getContentOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getContentOffset",argc, 0); @@ -10817,7 +10817,7 @@ int lua_cocos2dx_extension_ScrollView_maxContainerOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->maxContainerOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "maxContainerOffset",argc, 0); @@ -11002,7 +11002,7 @@ int lua_cocos2dx_extension_ScrollView_minContainerOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->minContainerOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "minContainerOffset",argc, 0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index dcb96d7212..f0d527be73 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -36,7 +36,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGravity(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGravity",argc, 0); @@ -123,7 +123,7 @@ int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setGravity(arg0); @@ -415,7 +415,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vector ret = cobj->getShapes(arg0); @@ -515,7 +515,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShape(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::PhysicsShape* ret = cobj->getShape(arg0); @@ -1337,7 +1337,7 @@ int lua_cocos2dx_physics_PhysicsShape_containsPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; bool ret = cobj->containsPoint(arg0); @@ -1517,7 +1517,7 @@ int lua_cocos2dx_physics_PhysicsShape_getCenter(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getCenter(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCenter",argc, 0); @@ -1829,7 +1829,7 @@ int lua_cocos2dx_physics_PhysicsShape_getOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); @@ -2296,7 +2296,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_create(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsShapeCircle* ret = cocos2d::PhysicsShapeCircle::create(arg0, arg1, arg2); @@ -2378,7 +2378,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; double ret = cocos2d::PhysicsShapeCircle::calculateMoment(arg0, arg1, arg2); @@ -2548,7 +2548,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_create(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsShapeBox* ret = cocos2d::PhysicsShapeBox::create(arg0, arg1, arg2); @@ -2630,7 +2630,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; double ret = cocos2d::PhysicsShapeBox::calculateMoment(arg0, arg1, arg2); @@ -2747,7 +2747,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPoint(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoint",argc, 1); @@ -2812,7 +2812,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPointB(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPointB",argc, 0); @@ -2856,7 +2856,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPointA(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPointA",argc, 0); @@ -2888,8 +2888,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) { cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::PhysicsShapeEdgeSegment* ret = cocos2d::PhysicsShapeEdgeSegment::create(arg0, arg1); @@ -2901,8 +2901,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); if(!ok) return 0; @@ -2916,8 +2916,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) @@ -3060,7 +3060,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if(!ok) return 0; cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0, arg1, arg2, arg3); @@ -3645,11 +3645,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if (!ok) { break; } cobj->applyImpulse(arg0, arg1); @@ -3660,7 +3660,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } cobj->applyImpulse(arg0); @@ -3748,11 +3748,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if (!ok) { break; } cobj->applyForce(arg0, arg1); @@ -3763,7 +3763,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } cobj->applyForce(arg0); @@ -4009,7 +4009,7 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocity(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocity(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocity",argc, 0); @@ -4288,7 +4288,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPositionOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPositionOffset(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionOffset",argc, 0); @@ -4466,7 +4466,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPosition(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -4735,11 +4735,11 @@ int lua_cocos2dx_physics_PhysicsBody_local2World(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->local2World(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "local2World",argc, 1); @@ -5050,11 +5050,11 @@ int lua_cocos2dx_physics_PhysicsBody_world2Local(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->world2Local(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "world2Local",argc, 1); @@ -5316,7 +5316,7 @@ int lua_cocos2dx_physics_PhysicsBody_setVelocity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setVelocity(arg0); @@ -5454,7 +5454,7 @@ int lua_cocos2dx_physics_PhysicsBody_setPositionOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPositionOffset(arg0); @@ -5634,11 +5634,11 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocityAtLocalPoint(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocityAtLocalPoint",argc, 1); @@ -5864,11 +5864,11 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocityAtWorldPoint(arg0); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocityAtWorldPoint",argc, 1); @@ -6102,7 +6102,7 @@ int lua_cocos2dx_physics_PhysicsBody_createBox(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createBox(arg0, arg1, arg2); @@ -6136,8 +6136,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) { cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeSegment(arg0, arg1); @@ -6149,8 +6149,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); if(!ok) return 0; @@ -6164,8 +6164,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) @@ -6303,7 +6303,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeBox(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0, arg1, arg2, arg3); @@ -6362,7 +6362,7 @@ int lua_cocos2dx_physics_PhysicsBody_createCircle(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createCircle(arg0, arg1, arg2); @@ -6914,7 +6914,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity(lua_State* to if(!ok) return 0; cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSurfaceVelocity",argc, 0); @@ -6957,7 +6957,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setSurfaceVelocity(arg0); @@ -7120,7 +7120,7 @@ int lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity(lua_State* t if(!ok) return 0; cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSurfaceVelocity",argc, 0); @@ -8187,7 +8187,7 @@ int lua_cocos2dx_physics_PhysicsJointFixed_construct(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsJointFixed* ret = cocos2d::PhysicsJointFixed::construct(arg0, arg1, arg2); @@ -8252,7 +8252,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -8298,7 +8298,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchr1(arg0); @@ -8391,7 +8391,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -8435,7 +8435,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr1(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr1",argc, 0); @@ -8607,10 +8607,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } double arg4; ok &= luaval_to_number(tolua_S, 6,&arg4); @@ -8635,10 +8635,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if (!ok) { break; } cocos2d::PhysicsJointLimit* ret = cocos2d::PhysicsJointLimit::construct(arg0, arg1, arg2, arg3); object_to_luaval(tolua_S, "cc.PhysicsJointLimit",(cocos2d::PhysicsJointLimit*)ret); @@ -8704,7 +8704,7 @@ int lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cocos2d::PhysicsJointPin* ret = cocos2d::PhysicsJointPin::construct(arg0, arg1, arg2); @@ -8852,8 +8852,8 @@ int lua_cocos2dx_physics_PhysicsJointDistance_construct(lua_State* tolua_S) cocos2d::Vec2 arg3; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); if(!ok) return 0; cocos2d::PhysicsJointDistance* ret = cocos2d::PhysicsJointDistance::construct(arg0, arg1, arg2, arg3); @@ -8920,7 +8920,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -8966,7 +8966,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchr1(arg0); @@ -9147,7 +9147,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -9191,7 +9191,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr1(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr1",argc, 0); @@ -9365,8 +9365,8 @@ int lua_cocos2dx_physics_PhysicsJointSpring_construct(lua_State* tolua_S) double arg5; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); ok &= luaval_to_number(tolua_S, 6,&arg4); ok &= luaval_to_number(tolua_S, 7,&arg5); if(!ok) @@ -9443,7 +9443,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -9489,7 +9489,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setGrooveA(arg0); @@ -9535,7 +9535,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setGrooveB(arg0); @@ -9582,7 +9582,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGrooveA(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGrooveA",argc, 0); @@ -9626,7 +9626,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGrooveB(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGrooveB",argc, 0); @@ -9670,7 +9670,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -9707,9 +9707,9 @@ int lua_cocos2dx_physics_PhysicsJointGroove_construct(lua_State* tolua_S) cocos2d::Vec2 arg4; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); - ok &= luaval_to_vector2(tolua_S, 5, &arg3); - ok &= luaval_to_vector2(tolua_S, 6, &arg4); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); if(!ok) return 0; cocos2d::PhysicsJointGroove* ret = cocos2d::PhysicsJointGroove::construct(arg0, arg1, arg2, arg3, arg4); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp index 7a3c4ab0d6..d130ae9500 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp @@ -125,7 +125,7 @@ int lua_cocos2dx_spine_Skeleton_onDraw(lua_State* tolua_S) cocos2d::Mat4 arg0; bool arg1; - ok &= luaval_to_matrix(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp index b236889cd1..e7b3ad85e2 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -3028,7 +3028,7 @@ int lua_cocos2dx_studio_ContourData_addVertex(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->addVertex(arg0); @@ -3814,7 +3814,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(lua_State* tolua_S if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchorPointInPoints(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPointInPoints",argc, 0); @@ -4199,7 +4199,7 @@ int lua_cocos2dx_studio_DisplayManager_containPoint(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if (!ok) { break; } bool ret = cobj->containPoint(arg0); @@ -4435,7 +4435,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchorPoint(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPoint",argc, 0); @@ -6052,7 +6052,7 @@ int lua_cocos2dx_studio_Bone_getNodeToArmatureTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToArmatureTransform(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToArmatureTransform",argc, 0); @@ -9616,7 +9616,7 @@ int lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToWorldTransformAR(); - matrix_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToWorldTransformAR",argc, 0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 0017040254..399b2caba4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -843,7 +843,7 @@ int lua_cocos2dx_ui_Widget_setSizePercent(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setSizePercent(arg0); @@ -1070,7 +1070,7 @@ int lua_cocos2dx_ui_Widget_getTouchEndPos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchEndPos(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchEndPos",argc, 0); @@ -1113,7 +1113,7 @@ int lua_cocos2dx_ui_Widget_setPositionPercent(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setPositionPercent(arg0); @@ -1880,7 +1880,7 @@ int lua_cocos2dx_ui_Widget_getWorldPosition(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getWorldPosition(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWorldPosition",argc, 0); @@ -2060,7 +2060,7 @@ int lua_cocos2dx_ui_Widget_getTouchMovePos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchMovePos(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchMovePos",argc, 0); @@ -2332,7 +2332,7 @@ int lua_cocos2dx_ui_Widget_getSizePercent(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getSizePercent(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSizePercent",argc, 0); @@ -2376,7 +2376,7 @@ int lua_cocos2dx_ui_Widget_getTouchStartPos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchStartPos(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchStartPos",argc, 0); @@ -2555,7 +2555,7 @@ int lua_cocos2dx_ui_Widget_clippingParentAreaContainPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; bool ret = cobj->clippingParentAreaContainPoint(arg0); @@ -3014,7 +3014,7 @@ int lua_cocos2dx_ui_Widget_getPositionPercent(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPositionPercent(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionPercent",argc, 0); @@ -3057,7 +3057,7 @@ int lua_cocos2dx_ui_Widget_hitTest(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; bool ret = cobj->hitTest(arg0); @@ -3244,7 +3244,7 @@ int lua_cocos2dx_ui_Widget_checkChildInfo(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); if(!ok) return 0; cobj->checkChildInfo(arg0, arg1, arg2); @@ -3569,7 +3569,7 @@ int lua_cocos2dx_ui_Layout_setBackGroundColorVector(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setBackGroundColorVector(arg0); @@ -3800,7 +3800,7 @@ int lua_cocos2dx_ui_Layout_getBackGroundColorVector(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getBackGroundColorVector(); - vector2_to_luaval(tolua_S, ret); + object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBackGroundColorVector",argc, 0); @@ -9578,7 +9578,7 @@ int lua_cocos2dx_ui_ScrollView_scrollToPercentBothDirection(lua_State* tolua_S) double arg1; bool arg2; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); @@ -10535,7 +10535,7 @@ int lua_cocos2dx_ui_ScrollView_jumpToPercentBothDirection(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->jumpToPercentBothDirection(arg0); @@ -14327,7 +14327,7 @@ int lua_cocos2dx_ui_TextField_hitTest(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; bool ret = cobj->hitTest(arg0); @@ -16390,7 +16390,7 @@ int lua_cocos2dx_ui_RichText_setAnchorPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_vector2(tolua_S, 2, &arg0); + ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); if(!ok) return 0; cobj->setAnchorPoint(arg0); From 146c9da102ed1fbc384c1a143e8c06ec752fd183 Mon Sep 17 00:00:00 2001 From: NatWeiss Date: Wed, 14 May 2014 10:29:11 -0700 Subject: [PATCH 071/125] Fix compilation error using arch i386 Adding a member variable to hold the `placeholderAttributes` property fixes a compilation error regarding synthesis when building with ARCH=i386. --- extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index 651e2927c6..cbb0a9a00b 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -47,6 +47,7 @@ CCCustomNSTextField* textField_; void* editBox_; BOOL editState_; + NSMutableDictionary* placeholderAttributes_; } @property(nonatomic, retain) NSTextField* textField; From 839170c147395b5ecffe3936c83d5c083313c7e6 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 14 May 2014 13:09:33 -0700 Subject: [PATCH 072/125] Improvments on the shader2 tests --- CHANGELOG | 4 + cocos/cocos2d.cpp | 2 +- .../Classes/ShaderTest/ShaderTest2.cpp | 477 +++++------------- .../Classes/ShaderTest/ShaderTest2.h | 77 +-- 4 files changed, 168 insertions(+), 392 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d119acf01d..0eb752316a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +cocos2d-x-3.1-rc0 May.16 2014 + [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 + [FIX] GLProgramState: Supports multitexturing + cocos2d-x-3.1-alpha1 May.9 2014 [NEW] Animate: Dispatch a custom event after an animation frame is displayed [NEW] GLProgram: Easy to customize uniforms and attributes by using the new class GLProgramState diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index 22251fb170..c614bba1e8 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -31,7 +31,7 @@ NS_CC_BEGIN const char* cocos2dVersion() { - return "cocos2d-x 3.1alpha1"; + return "cocos2d-x 3.1rc0"; } NS_CC_END diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 0ce1c8b22b..54a279836f 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -32,17 +32,11 @@ namespace ShaderTest2 { static std::function createFunctions[] = { - CL(NormalSpriteTest), - CL(GreyScaleSpriteTest), - CL(BlurSpriteTest), - CL(NoiseSpriteTest), - CL(EdgeDetectionSpriteTest), + CL(EffectSpriteTest), + CL(BloomSpriteTest), CL(CelShadingSpriteTest), CL(LensFlareSpriteTest), - CL(OutlineShadingSpriteTest), - - CL(EffectSprite_Blur), }; static unsigned int TEST_CASE_COUNT = sizeof(ShaderTest2::createFunctions) / sizeof(ShaderTest2::createFunctions[0]); @@ -129,21 +123,42 @@ public: } }; + +// +// EffectSprite +// +class Effect; +class EffectSprite : public Sprite +{ +public: + static EffectSprite *create(const std::string& filename) { + auto ret = new (std::nothrow) EffectSprite; + if(ret && ret->initWithFile(filename)) { + ret->autorelease(); + return ret; + } + CC_SAFE_RELEASE(ret); + return nullptr; + } + + void setEffect(Effect *effect) { + if(_effect != effect) { + effect->setTarget(this); + + CC_SAFE_RELEASE(_effect); + _effect = effect; + CC_SAFE_RETAIN(_effect); + setGLProgramState(_effect->getGLProgramState()); + } + } +protected: + EffectSprite() : _effect(nullptr) {} + Effect *_effect; +}; + // // Effect // -class Effect : public Ref -{ -public: - GLProgramState* getGLProgramState() const { return _glprogramstate; } - -protected: - bool initGLProgramState(const std::string &fragmentFilename); - Effect() : _glprogramstate(nullptr) - {} - virtual ~Effect() {} - GLProgramState *_glprogramstate; -}; bool Effect::initGLProgramState(const std::string &fragmentFilename) { @@ -158,16 +173,20 @@ bool Effect::initGLProgramState(const std::string &fragmentFilename) return _glprogramstate != nullptr; } +// Blur class EffectBlur : public Effect { public: - static EffectBlur *create(float blurSize); + CREATE_FUNC(EffectBlur); + + virtual void setTarget(EffectSprite *sprite) override; + void setGaussian(float value); void setCustomUniforms(); void setBlurSize(float f); protected: - bool init(float blurSize); + bool init(float blurSize=3.0); int _blurRadius; Vec2 _pixelSize; @@ -178,21 +197,16 @@ protected: float _weightSum; }; -EffectBlur *EffectBlur::create(float blurSize) +void EffectBlur::setTarget(EffectSprite *sprite) { - auto ret = new (std::nothrow) EffectBlur; - if(ret && ret->init(blurSize)) { - ret->autorelease(); - return ret; - } - CC_SAFE_RELEASE(ret); - return nullptr; + Size s = sprite->getTexture()->getContentSizeInPixels(); + _pixelSize = Vec2(1/s.width, 1/s.height); + _glprogramstate->setUniformVec2("onePixelSize", _pixelSize); } bool EffectBlur::init(float blurSize) { initGLProgramState("Shaders/example_Blur.fsh"); -// auto s = getTexture()->getContentSizeInPixels(); auto s = Size(100,100); _blurRadius = 0; @@ -240,34 +254,76 @@ void EffectBlur::setBlurSize(float f) } } - -// -// EffectSprite -// -class EffectSprite : public Sprite +// Outline +class EffectOutline : public Effect { public: - static EffectSprite *create(const std::string& filename) { - auto ret = new (std::nothrow) EffectSprite; - if(ret && ret->initWithFile(filename)) { - ret->autorelease(); - return ret; - } - CC_SAFE_RELEASE(ret); - return nullptr; + CREATE_FUNC(EffectOutline); + + bool init() + { + initGLProgramState("Shaders/example_outline.fsh"); + + Vec3 color(1.0, 0.2, 0.3); + GLfloat radius = 0.01; + GLfloat threshold = 1.75; + + _glprogramstate->setUniformVec3("u_outlineColor", color); + _glprogramstate->setUniformFloat("u_radius", radius); + _glprogramstate->setUniformFloat("u_threshold", threshold); + return true; + } +}; + +// Noise +class EffectNoise : public Effect +{ +public: + CREATE_FUNC(EffectNoise); + +protected: + bool init() { + initGLProgramState("Shaders/example_Noisy.fsh"); + return true; } - void setEffect(Effect *effect) { - if(_effect != effect) { - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - setGLProgramState(_effect->getGLProgramState()); - } + void setTarget(EffectSprite* sprite) override + { + auto s = sprite->getTexture()->getContentSizeInPixels(); + getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); } +}; + +// Edge Detect +class EffectEdgeDetect : public Effect +{ +public: + CREATE_FUNC(EffectEdgeDetect); + protected: - EffectSprite() : _effect(nullptr) {} - Effect *_effect; + bool init() { + initGLProgramState("Shaders/example_edgeDetection.fsh"); + return true; + } + + void setTarget(EffectSprite* sprite) override + { + auto s = sprite->getTexture()->getContentSizeInPixels(); + getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); + } +}; + +// Grey +class EffectGreyScale : public Effect +{ +public: + CREATE_FUNC(EffectGreyScale); + +protected: + bool init() { + initGLProgramState("Shaders/example_greyScale.fsh"); + return true; + } }; // @@ -281,7 +337,6 @@ public: virtual void initShader(); void setBackgroundNotification(); - void listenBackToForeground(Ref *obj); protected: @@ -331,168 +386,6 @@ void ShaderSprite::initShader() setCustomUniforms(); } -class NormalSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(NormalSprite); - NormalSprite(); - -protected: - virtual void setCustomUniforms() override; -}; - -NormalSprite::NormalSprite() -{ - _fragSourceFile = "Shaders/example_normal.fsh"; -} - -void NormalSprite::setCustomUniforms() -{ -} - -class GreyScaleSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(GreyScaleSprite); - GreyScaleSprite(); - -protected: - virtual void setCustomUniforms() override; -}; - -GreyScaleSprite::GreyScaleSprite() -{ - _fragSourceFile = "Shaders/example_greyScale.fsh"; -} - -void GreyScaleSprite::setCustomUniforms() -{ -} - -class BlurSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(BlurSprite); - BlurSprite(); - void setBlurSize(float f); - -protected: - virtual void setCustomUniforms() override; - - int _blurRadius; - Vec2 _pixelSize; - - int _samplingRadius; - float _scale; - float _cons; - float _weightSum; -}; - -BlurSprite::BlurSprite() -{ - _fragSourceFile = "Shaders/example_Blur.fsh"; -} - -void BlurSprite::setCustomUniforms() -{ - auto s = getTexture()->getContentSizeInPixels(); - _blurRadius = 0; - _pixelSize = Vec2(1/s.width, 1/s.height); - _samplingRadius = 0; - - setBlurSize(3.0f); - - auto programState = getGLProgramState(); - programState->setUniformVec2("onePixelSize", _pixelSize); - programState->setUniformVec4("gaussianCoefficient", Vec4(_samplingRadius, _scale, _cons, _weightSum)); -} - -void BlurSprite::setBlurSize(float f) -{ - if(_blurRadius == (int)f) - return; - _blurRadius = (int)f; - - _samplingRadius = _blurRadius; - if (_samplingRadius > 10) - { - _samplingRadius = 10; - } - if (_blurRadius > 0) - { - float sigma = _blurRadius / 2.0f; - _scale = -0.5f / (sigma * sigma); - _cons = -1.0f * _scale / 3.141592f; - _weightSum = -_cons; - - float weight; - int squareX; - for(int dx = 0; dx <= _samplingRadius; ++dx) - { - squareX = dx * dx; - weight = _cons * exp(squareX * _scale); - _weightSum += 2.0 * weight; - for (int dy = 1; dy <= _samplingRadius; ++dy) - { - weight = _cons * exp((squareX + dy * dy) * _scale); - _weightSum += 4.0 * weight; - } - } - } - log("_blurRadius:%d",_blurRadius); -} - -class NoiseSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(NoiseSprite); - NoiseSprite(); - -protected: - virtual void setCustomUniforms() override; - - GLfloat _resolution[2]; -}; - -NoiseSprite::NoiseSprite() -{ - _fragSourceFile = "Shaders/example_Noisy.fsh"; -} - -void NoiseSprite::setCustomUniforms() -{ - _resolution[0] = getTexture()->getContentSizeInPixels().width; - _resolution[1] = getTexture()->getContentSizeInPixels().height; - getGLProgramState()->setUniformVec2("resolution", Vec2(_resolution[0],_resolution[1])); -} - -class EdgeDetectionSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(EdgeDetectionSprite); - EdgeDetectionSprite(); - -protected: - virtual void setCustomUniforms() override; - - GLfloat _resolution[2]; -}; - -EdgeDetectionSprite::EdgeDetectionSprite() -{ - _fragSourceFile = "Shaders/example_edgeDetection.fsh"; -} - -void EdgeDetectionSprite::setCustomUniforms() -{ - auto programState = getGLProgramState(); - - _resolution[0] = getContentSize().width; - _resolution[1] = getContentSize().height; - - programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); -} - class BloomSprite : public ShaderSprite, public ShaderSpriteCreator { public: @@ -572,76 +465,6 @@ void LensFlareSprite::setCustomUniforms() programState->setUniformVec2("textureResolution", Vec2(_textureResolution[0], _textureResolution[1])); } -NormalSpriteTest::NormalSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - NormalSprite* sprite = NormalSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vec2(s.width/2, s.height/2)); - addChild(sprite); - } - -} - -GreyScaleSpriteTest::GreyScaleSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - GreyScaleSprite* sprite = GreyScaleSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } - -} - -BlurSpriteTest::BlurSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - BlurSprite* sprite = BlurSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } - -} - -NoiseSpriteTest::NoiseSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - NoiseSprite* sprite = NoiseSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } -} - -EdgeDetectionSpriteTest::EdgeDetectionSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - EdgeDetectionSprite* sprite = EdgeDetectionSprite::createSprite("Images/powered.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/powered.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } -} - BloomSpriteTest::BloomSpriteTest() { if (ShaderTestDemo2::init()) @@ -683,60 +506,29 @@ LensFlareSpriteTest::LensFlareSpriteTest() } } - -class OutlineSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(OutlineSprite); - OutlineSprite(); - -protected: - virtual void setCustomUniforms() override; -}; - - -OutlineSprite::OutlineSprite() -{ - _fragSourceFile = "Shaders/example_outline.fsh"; - _vertSourceFile = ""; //"Shaders/example_outline.vsh"; - _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; -} - -void OutlineSprite::setCustomUniforms() -{ - Vec3 color(1.0, 0.2, 0.3); - GLfloat radius = 0.01; - GLfloat threshold = 1.75; - - auto programState = getGLProgramState(); - - programState->setUniformVec3("u_outlineColor", color); - programState->setUniformFloat("u_radius", radius); - programState->setUniformFloat("u_threshold", threshold); -} - - -OutlineShadingSpriteTest::OutlineShadingSpriteTest() +EffectSpriteTest::EffectSpriteTest() { if (ShaderTestDemo2::init()) { - auto s = Director::getInstance()->getWinSize(); - OutlineSprite* sprite = OutlineSprite::createSprite("Images/grossini_dance_10.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/grossini_dance_10.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } -} - -EffectSprite_Blur::EffectSprite_Blur() -{ - if (ShaderTestDemo2::init()) { auto s = Director::getInstance()->getWinSize(); - EffectSprite* sprite = EffectSprite::create("Images/grossini.png"); - sprite->setPosition(Vec2(0, s.height/2)); - addChild(sprite); + + auto item = MenuItemImage::create("Images/r1.png", "Images/r2.png", + [&](Ref *sender) { + _vectorIndex++; + if(_vectorIndex>=_effects.size()) + _vectorIndex = 0; + _sprite->setEffect(_effects.at(_vectorIndex)); + }); + item->setPosition(Vec2(40,40)); + item->setScale(0.5); + + auto menu = Menu::create(item, NULL); + menu->setPosition(Vec2(0,0)); + addChild(menu); + + _sprite = EffectSprite::create("Images/grossini.png"); + _sprite->setPosition(Vec2(0, s.height/2)); + addChild(_sprite); auto jump = JumpBy::create(4, Vec2(s.width,0), 100, 4); auto rot = RotateBy::create(4, 720); @@ -744,10 +536,17 @@ EffectSprite_Blur::EffectSprite_Blur() auto rev = spawn->reverse(); auto seq = Sequence::create(spawn, rev, NULL); auto repeat = RepeatForever::create(seq); - sprite->runAction(repeat); + _sprite->runAction(repeat); - auto effect = EffectBlur::create(3.0); - sprite->setEffect(effect); + // set the Effects + _effects.pushBack(EffectBlur::create()); + _effects.pushBack(EffectOutline::create()); + _effects.pushBack(EffectNoise::create()); + _effects.pushBack(EffectEdgeDetect::create()); + _effects.pushBack(EffectGreyScale::create()); + + _vectorIndex = 0; + _sprite->setEffect( _effects.at(_vectorIndex) ); } } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index 3b851b1493..fd42a052f1 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -23,50 +23,6 @@ public: virtual void runThisTest(); }; -class NormalSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(NormalSpriteTest); - NormalSpriteTest(); - - virtual std::string subtitle() const {return "NormalSpriteTest";} -}; - -class GreyScaleSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(GreyScaleSpriteTest); - GreyScaleSpriteTest(); - - virtual std::string subtitle() const {return "GreyScaleSpriteTest";} -}; - -class BlurSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(BlurSpriteTest); - BlurSpriteTest(); - - virtual std::string subtitle() const {return "BlurSpriteTest";} -}; - -class NoiseSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(NoiseSpriteTest); - NoiseSpriteTest(); - virtual std::string subtitle() const {return "NoiseSpriteTest";} -}; - -class EdgeDetectionSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(EdgeDetectionSpriteTest); - - EdgeDetectionSpriteTest(); - virtual std::string subtitle() const {return "EdgeDetectionSpriteTest";} -}; - class BloomSpriteTest : public ShaderTestDemo2 { public: @@ -94,20 +50,37 @@ public: virtual std::string subtitle() const {return "CelShadingSpriteTest";} }; -class OutlineShadingSpriteTest : public ShaderTestDemo2 + +// +// Effect +// +class EffectSprite; + +class Effect : public Ref { public: - CREATE_FUNC(OutlineShadingSpriteTest); - OutlineShadingSpriteTest(); - virtual std::string subtitle() const {return "OutlineShadingSpriteTest";} + GLProgramState* getGLProgramState() const { return _glprogramstate; } + virtual void setTarget(EffectSprite *sprite){} + +protected: + bool initGLProgramState(const std::string &fragmentFilename); + Effect() : _glprogramstate(nullptr) + {} + virtual ~Effect() {} + GLProgramState *_glprogramstate; }; -class EffectSprite_Blur : public ShaderTestDemo2 +class EffectSpriteTest : public ShaderTestDemo2 { public: - CREATE_FUNC(EffectSprite_Blur); - EffectSprite_Blur(); - virtual std::string subtitle() const {return "Blur Effect on Sprite";} + CREATE_FUNC(EffectSpriteTest); + EffectSpriteTest(); + virtual std::string subtitle() const {return "Cycle different effects on the sprite";} + +protected: + ssize_t _vectorIndex; + cocos2d::Vector _effects; + EffectSprite *_sprite; }; From 287b10f070cc6d55af9bf37686f95ec235c8e941 Mon Sep 17 00:00:00 2001 From: zifter Date: Wed, 14 May 2014 23:28:47 +0300 Subject: [PATCH 073/125] Fixed double calling onExit method. --- cocos/base/CCDirector.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 6ef63e5eb5..7a1f048669 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -887,6 +887,13 @@ void Director::popToSceneStackLevel(int level) if (level >= c) return; + auto currentRunningScene = _scenesStack.back(); + if (currentRunningScene == _runningScene) + { + _scenesStack.popBack(); + --c; + } + // pop stack until reaching desired level while (c > level) { @@ -903,7 +910,7 @@ void Director::popToSceneStackLevel(int level) } _nextScene = _scenesStack.back(); - _sendCleanupToScene = false; + _sendCleanupToScene = true; } void Director::end() From 1c13f901ae76b2d387d77d9b21970e8c96208cdd Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Wed, 14 May 2014 16:55:57 -0700 Subject: [PATCH 074/125] Even better shader test --- .../Classes/ShaderTest/ShaderTest2.cpp | 267 +++++------------- .../Classes/ShaderTest/ShaderTest2.h | 31 +- .../Resources/Shaders/example_sepia.fsh | 19 ++ 3 files changed, 99 insertions(+), 218 deletions(-) create mode 100644 tests/cpp-tests/Resources/Shaders/example_sepia.fsh diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 54a279836f..77178ef72d 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -33,10 +33,6 @@ namespace ShaderTest2 static std::function createFunctions[] = { CL(EffectSpriteTest), - - CL(BloomSpriteTest), - CL(CelShadingSpriteTest), - CL(LensFlareSpriteTest), }; static unsigned int TEST_CASE_COUNT = sizeof(ShaderTest2::createFunctions) / sizeof(ShaderTest2::createFunctions[0]); @@ -109,21 +105,6 @@ void ShaderTestScene2::runThisTest() Director::getInstance()->replaceScene(this); } -template -class ShaderSpriteCreator -{ -public: - static spriteType* createSprite(const std::string& filename) - { - spriteType* ret = spriteType::create(); - ret->setTexture(filename); - ret->initShader(); - ret->setBackgroundNotification(); - return ret; - } -}; - - // // EffectSprite // @@ -287,7 +268,7 @@ protected: return true; } - void setTarget(EffectSprite* sprite) override + virtual void setTarget(EffectSprite* sprite) override { auto s = sprite->getTexture()->getContentSizeInPixels(); getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); @@ -306,7 +287,7 @@ protected: return true; } - void setTarget(EffectSprite* sprite) override + virtual void setTarget(EffectSprite* sprite) override { auto s = sprite->getTexture()->getContentSizeInPixels(); getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); @@ -326,185 +307,80 @@ protected: } }; -// -// ShaderSprite -// -class ShaderSprite : public Sprite +// Sepia +class EffectSepia : public Effect { public: - ShaderSprite(); - ~ShaderSprite(); + CREATE_FUNC(EffectSepia); - virtual void initShader(); - void setBackgroundNotification(); - void listenBackToForeground(Ref *obj); - protected: - virtual void setCustomUniforms() = 0; - - std::string _fragSourceFile; - std::string _vertSourceFile; + bool init() { + initGLProgramState("Shaders/example_sepia.fsh"); + return true; + } }; -ShaderSprite::ShaderSprite() -:_vertSourceFile("") +// bloom +class EffectBloom : public Effect { -} +public: + CREATE_FUNC(EffectBloom); -ShaderSprite::~ShaderSprite() -{ -} - -void ShaderSprite::setBackgroundNotification() -{ -#if CC_ENABLE_CACHE_TEXTURE_DATA - auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ - this->setGLProgramState(nullptr); - this->initShader(); - }); - _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); -#endif -} - -void ShaderSprite::initShader() -{ - auto fileUtiles = FileUtils::getInstance(); - auto fragmentFilePath = fileUtiles->fullPathForFilename(_fragSourceFile); - auto fragSource = fileUtiles->getStringFromFile(fragmentFilePath); - std::string vertSource; - if (_vertSourceFile.empty()) { - vertSource = ccPositionTextureColor_noMVP_vert; - }else{ - std::string vertexFilePath = fileUtiles->fullPathForFilename(_vertSourceFile); - vertSource = fileUtiles->getStringFromFile(vertexFilePath); +protected: + bool init() { + initGLProgramState("Shaders/example_bloom.fsh"); + return true; } - auto glprogram = GLProgram::createWithByteArrays(vertSource.c_str(), fragSource.c_str()); - auto glprogramState = GLProgramState::getOrCreateWithGLProgram(glprogram); - this->setGLProgramState(glprogramState); - - setCustomUniforms(); -} - -class BloomSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(BloomSprite); - BloomSprite(); - -protected: - virtual void setCustomUniforms() override; - - GLfloat _resolution[2]; -}; - -BloomSprite::BloomSprite() -{ - _fragSourceFile = "Shaders/example_bloom.fsh"; -} - -void BloomSprite::setCustomUniforms() -{ -} - -class CelShadingSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(CelShadingSprite); - CelShadingSprite(); - -protected: - virtual void setCustomUniforms() override; - - GLfloat _resolution[2]; -}; - -CelShadingSprite::CelShadingSprite() -{ - _fragSourceFile = "Shaders/example_celShading.fsh"; -} - -void CelShadingSprite::setCustomUniforms() -{ - auto programState = getGLProgramState(); - - _resolution[0] = getContentSize().width; - _resolution[1] = getContentSize().height; - - programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); -} - -class LensFlareSprite : public ShaderSprite, public ShaderSpriteCreator -{ -public: - CREATE_FUNC(LensFlareSprite); - LensFlareSprite(); - -protected: - virtual void setCustomUniforms() override; - - GLfloat _resolution[2]; - GLfloat _textureResolution[2]; -}; - -LensFlareSprite::LensFlareSprite() -{ - _fragSourceFile = "Shaders/example_lensFlare.fsh"; -} - -void LensFlareSprite::setCustomUniforms() -{ - auto programState = getGLProgramState(); - - _textureResolution[0] = getTexture()->getContentSizeInPixels().width; - _textureResolution[1] = getTexture()->getContentSizeInPixels().height; - _resolution[0] = getContentSize().width; - _resolution[1] = getContentSize().height; - - programState->setUniformVec2("resolution", Vec2(_resolution[0], _resolution[1])); - programState->setUniformVec2("textureResolution", Vec2(_textureResolution[0], _textureResolution[1])); -} - -BloomSpriteTest::BloomSpriteTest() -{ - if (ShaderTestDemo2::init()) + virtual void setTarget(EffectSprite* sprite) override { - auto s = Director::getInstance()->getWinSize(); - BloomSprite* sprite = BloomSprite::createSprite("Images/stone.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/stone.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); + auto s = sprite->getTexture()->getContentSizeInPixels(); + getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); } -} +}; -CelShadingSpriteTest::CelShadingSpriteTest() +// cel shading +class EffectCelShading : public Effect { - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - CelShadingSprite* sprite = CelShadingSprite::createSprite("Images/stone.png"); - sprite->setPosition(Vec2(s.width * 0.75, s.height/2)); - auto sprite2 = Sprite::create("Images/stone.png"); - sprite2->setPosition(Vec2(s.width * 0.25, s.height/2)); - addChild(sprite); - addChild(sprite2); - } -} +public: + CREATE_FUNC(EffectCelShading); -LensFlareSpriteTest::LensFlareSpriteTest() -{ - if (ShaderTestDemo2::init()) - { - auto s = Director::getInstance()->getWinSize(); - LensFlareSprite* sprite = LensFlareSprite::createSprite("Images/noise.png"); - Rect rect = Rect::ZERO; - rect.size = Size(480,320); - sprite->setPosition(Vec2(s.width * 0.5, s.height/2)); - addChild(sprite); +protected: + bool init() { + initGLProgramState("Shaders/example_celShading.fsh"); + return true; } -} + + virtual void setTarget(EffectSprite* sprite) override + { + auto s = sprite->getTexture()->getContentSizeInPixels(); + getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); + } +}; + +// Lens Flare +class EffectLensFlare : public Effect +{ +public: + CREATE_FUNC(EffectLensFlare); + +protected: + bool init() { + initGLProgramState("Shaders/example_lensFlare.fsh"); + return true; + } + + virtual void setTarget(EffectSprite* sprite) override + { + auto s = sprite->getTexture()->getContentSizeInPixels(); + getGLProgramState()->setUniformVec2("textureResolution", Vec2(s.width, s.height)); + + s = Director::getInstance()->getWinSize(); + getGLProgramState()->setUniformVec2("resolution", Vec2(s.width, s.height)); + + } +}; + EffectSpriteTest::EffectSpriteTest() { @@ -512,18 +388,27 @@ EffectSpriteTest::EffectSpriteTest() auto s = Director::getInstance()->getWinSize(); - auto item = MenuItemImage::create("Images/r1.png", "Images/r2.png", + auto itemPrev = MenuItemImage::create("Images/b1.png", "Images/b2.png", + [&](Ref *sender) { + _vectorIndex--; + if(_vectorIndex<0) + _vectorIndex = _effects.size()-1; + _sprite->setEffect(_effects.at(_vectorIndex)); + }); + + auto itemNext = MenuItemImage::create("Images/f1.png", "Images/f2.png", [&](Ref *sender) { _vectorIndex++; if(_vectorIndex>=_effects.size()) _vectorIndex = 0; _sprite->setEffect(_effects.at(_vectorIndex)); }); - item->setPosition(Vec2(40,40)); - item->setScale(0.5); - auto menu = Menu::create(item, NULL); - menu->setPosition(Vec2(0,0)); + auto menu = Menu::create(itemPrev, itemNext, NULL); + menu->alignItemsHorizontally(); + menu->setScale(0.5); + menu->setAnchorPoint(Vec2(0,0)); + menu->setPosition(Vec2(s.width/2,70)); addChild(menu); _sprite = EffectSprite::create("Images/grossini.png"); @@ -544,6 +429,10 @@ EffectSpriteTest::EffectSpriteTest() _effects.pushBack(EffectNoise::create()); _effects.pushBack(EffectEdgeDetect::create()); _effects.pushBack(EffectGreyScale::create()); + _effects.pushBack(EffectSepia::create()); + _effects.pushBack(EffectBloom::create()); + _effects.pushBack(EffectCelShading::create()); + _effects.pushBack(EffectLensFlare::create()); _vectorIndex = 0; _sprite->setEffect( _effects.at(_vectorIndex) ); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h index fd42a052f1..2d7421fa80 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.h @@ -10,7 +10,7 @@ class ShaderTestDemo2 : public BaseTest { public: ShaderTestDemo2(void); - virtual std::string title() const { return "Shader Sprite!";} + virtual std::string title() const { return "Effects on Sprites";} void restartCallback(Ref* sender); void nextCallback(Ref* sender); void backCallback(Ref* sender); @@ -23,33 +23,6 @@ public: virtual void runThisTest(); }; -class BloomSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(BloomSpriteTest); - - BloomSpriteTest(); - virtual std::string subtitle() const {return "BloomSpriteTest";} -}; - -class LensFlareSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(LensFlareSpriteTest); - - LensFlareSpriteTest(); - virtual std::string subtitle() const {return "LensFlareSpriteTest";} -}; - -class CelShadingSpriteTest : public ShaderTestDemo2 -{ -public: - CREATE_FUNC(CelShadingSpriteTest); - - CelShadingSpriteTest(); - virtual std::string subtitle() const {return "CelShadingSpriteTest";} -}; - // // Effect @@ -75,7 +48,7 @@ class EffectSpriteTest : public ShaderTestDemo2 public: CREATE_FUNC(EffectSpriteTest); EffectSpriteTest(); - virtual std::string subtitle() const {return "Cycle different effects on the sprite";} + virtual std::string subtitle() const {return "Different effects on Sprite";} protected: ssize_t _vectorIndex; diff --git a/tests/cpp-tests/Resources/Shaders/example_sepia.fsh b/tests/cpp-tests/Resources/Shaders/example_sepia.fsh new file mode 100644 index 0000000000..394198137b --- /dev/null +++ b/tests/cpp-tests/Resources/Shaders/example_sepia.fsh @@ -0,0 +1,19 @@ +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 v_fragmentColor; +varying vec2 v_texCoord; + +uniform sampler2D CC_Texture0; + +void main(void) +{ + vec4 c = texture2D(CC_Texture0, v_texCoord); + vec4 final = c; + final.r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189); + final.g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168); + final.b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131); + + gl_FragColor = final; +} \ No newline at end of file From c6f2a2aeb341c8811e97b975561edaae30c0075e Mon Sep 17 00:00:00 2001 From: "byeonggee.seo" Date: Thu, 15 May 2014 10:19:59 +0900 Subject: [PATCH 075/125] name fix --- cocos/base/CCEventDispatcher.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index 4ddd3599ca..5ee33beaa5 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -293,11 +293,11 @@ void EventDispatcher::pauseEventListenersForTarget(Node* target, bool recursive/ } } - for (auto addedListenerIter : _toAddedListeners) + for (auto& listener : _toAddedListeners) { - if (addedListenerIter->getAssociatedNode() == target) + if (listener->getAssociatedNode() == target) { - addedListenerIter->setPaused(true); + listener->setPaused(true); } } @@ -323,11 +323,11 @@ void EventDispatcher::resumeEventListenersForTarget(Node* target, bool recursive } } - for (auto addedListenerIter : _toAddedListeners) + for (auto& listener : _toAddedListeners) { - if (addedListenerIter->getAssociatedNode() == target) + if (listener->getAssociatedNode() == target) { - addedListenerIter->setPaused(false); + listener->setPaused(false); } } From 354566d782729a2ce12dfee1853cacb1b8f0ba8d Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 15 May 2014 09:56:26 +0800 Subject: [PATCH 076/125] use RGBA8 as default pixel format --- .../cpp-template-default/proj.ios_mac/ios/AppController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm b/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm index e1e807c39d..94f112f4ca 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm +++ b/templates/cpp-template-default/proj.ios_mac/ios/AppController.mm @@ -45,7 +45,7 @@ static AppDelegate s_sharedApplication; // Init the CCEAGLView CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] - pixelFormat: kEAGLColorFormatRGB565 + pixelFormat: kEAGLColorFormatRGBA8 depthFormat: GL_DEPTH24_STENCIL8_OES preserveBackbuffer: NO sharegroup: nil From 39e5619f3ff586f13c29dd2ef478581eced62b18 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Thu, 15 May 2014 10:36:01 +0800 Subject: [PATCH 077/125] modify /merge to /head in pull-request-build. --- tools/jenkins-scripts/pull-request-builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 2719d45f63..ff238ce440 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -117,7 +117,7 @@ def main(): print "Before checkout: git clean -xdf -f" os.system("git clean -xdf -f") #fetch pull request to local repo - git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/merge" + git_fetch_pr = "git fetch origin pull/" + str(pr_num) + "/head" ret = os.system(git_fetch_pr) if(ret != 0): return(2) From 2eafb3c39f41e7750286f75a0ff1ae029ef206fc Mon Sep 17 00:00:00 2001 From: zhangbin Date: Thu, 15 May 2014 10:37:06 +0800 Subject: [PATCH 078/125] Update the reference of submodule cocos2d-console. --- tools/cocos2d-console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 7876808788..9f8d41077f 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 7876808788c0666d5f4510ea214e97e10eeaa9a8 +Subproject commit 9f8d41077f67a81928acaa9bca4fea1c705b9104 From 67f809e223c5b0f99a99cf4778a0e859f508f6b4 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 15 May 2014 11:09:17 +0800 Subject: [PATCH 079/125] Matrix -> Mat4 --- cocos/ui/UIVideoPlayerAndroid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/ui/UIVideoPlayerAndroid.cpp b/cocos/ui/UIVideoPlayerAndroid.cpp index 02ffbc1432..c91afe3bf9 100644 --- a/cocos/ui/UIVideoPlayerAndroid.cpp +++ b/cocos/ui/UIVideoPlayerAndroid.cpp @@ -195,7 +195,7 @@ void VideoPlayer::setURL(const std::string& videoUrl) setVideoURLJNI(_videoPlayerIndex,(int)Source::URL,_videoURL); } -void VideoPlayer::draw(Renderer* renderer, const Matrix &transform, bool transformUpdated) +void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, bool transformUpdated) { cocos2d::ui::Widget::draw(renderer,transform,transformUpdated); From fc8d286fcbaea601efc609808d88dd0daca17c4e Mon Sep 17 00:00:00 2001 From: andyque Date: Thu, 15 May 2014 12:02:42 +0800 Subject: [PATCH 080/125] closed #5188, fixed android NULL pointer exception --- .../cocos2dx/lib/Cocos2dxTextInputWraper.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java index bbf2a038a7..682661600b 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java @@ -123,25 +123,30 @@ public class Cocos2dxTextInputWraper implements TextWatcher, OnEditorActionListe public boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) { if (this.mCocos2dxGLSurfaceView.getCocos2dxEditText() == pTextView && this.isFullScreenEdit()) { // user press the action button, delete all old text and insert new text - for (int i = this.mOriginText.length(); i > 0; i--) { - this.mCocos2dxGLSurfaceView.deleteBackward(); - /* - if (BuildConfig.DEBUG) { - Log.d(TAG, "deleteBackward"); + if (null != mOriginText) { + for (int i = this.mOriginText.length(); i > 0; i--) { + this.mCocos2dxGLSurfaceView.deleteBackward(); + /* + if (BuildConfig.DEBUG) { + Log.d(TAG, "deleteBackward"); + } + */ } - */ } + String text = pTextView.getText().toString(); + + if (text != null) { + /* If user input nothing, translate "\n" to engine. */ + if ( text.compareTo("") == 0) { + text = "\n"; + } - /* If user input nothing, translate "\n" to engine. */ - if (text.compareTo("") == 0) { - text = "\n"; + if ( '\n' != text.charAt(text.length() - 1)) { + text += '\n'; + } } - - if ('\n' != text.charAt(text.length() - 1)) { - text += '\n'; - } - + final String insertText = text; this.mCocos2dxGLSurfaceView.insertText(insertText); /* From c8a1004a4da39fe7172bb7c854c0407812068490 Mon Sep 17 00:00:00 2001 From: zifter Date: Thu, 15 May 2014 09:43:18 +0300 Subject: [PATCH 081/125] Little refactor. --- cocos/base/CCDirector.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 7a1f048669..8a13ad53eb 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -887,8 +887,8 @@ void Director::popToSceneStackLevel(int level) if (level >= c) return; - auto currentRunningScene = _scenesStack.back(); - if (currentRunningScene == _runningScene) + auto fisrtOnStackScene = _scenesStack.back(); + if (fisrtOnStackScene == _runningScene) { _scenesStack.popBack(); --c; @@ -910,6 +910,8 @@ void Director::popToSceneStackLevel(int level) } _nextScene = _scenesStack.back(); + + // cleanup running scene _sendCleanupToScene = true; } From 5a14b1d67baee0ec1b39b66f8c5fe4b72b8753f7 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 15 May 2014 15:39:15 +0800 Subject: [PATCH 082/125] fix compile error and synchronizate the UI change for Lua --- .../manual/LuaBasicConversions.cpp | 32 +-- .../lua-bindings/manual/LuaBasicConversions.h | 30 ++- .../lua-bindings/manual/LuaOpengl.cpp | 42 ++-- .../manual/lua_cocos2dx_manual.cpp | 14 +- .../manual/lua_cocos2dx_physics_manual.cpp | 78 +++---- .../lua-bindings/script/Deprecated.lua | 48 ++++ .../lua-bindings/script/DeprecatedEnum.lua | 26 ++- .../lua-bindings/script/GuiConstants.lua | 18 +- .../CocoStudioGUITest/CocoStudioGUITest.lua | 210 +++++++++--------- tools/bindings-generator | 2 +- 10 files changed, 273 insertions(+), 227 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index b782746e51..ba90a32049 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -271,7 +271,7 @@ bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue) return ok; } -bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue) +bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue) { if (nullptr == L || nullptr == outValue) return false; @@ -303,7 +303,7 @@ bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue) return ok; } -bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue) +bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue) { if (nullptr == L || nullptr == outValue) return false; @@ -903,7 +903,7 @@ bool luaval_to_ttfconfig(lua_State* L,int lo, cocos2d::TTFConfig* outValue) return false; } -bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Mat4* outValue ) +bool luaval_to_mat4(lua_State* L, int lo, cocos2d::Mat4* outValue ) { if (nullptr == L || nullptr == outValue) return false; @@ -1145,7 +1145,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue) return ok; } -bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints) +bool luaval_to_array_of_vec2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints) { if (NULL == L) return false; @@ -1183,7 +1183,7 @@ bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vec2 **points, int CC_SAFE_DELETE_ARRAY(array); return false; } - ok &= luaval_to_vector2(L, lua_gettop(L), &array[i]); + ok &= luaval_to_vec2(L, lua_gettop(L), &array[i]); if (!ok) { lua_pop(L, 1); @@ -1697,7 +1697,7 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector* ret) return ok; } -void vector2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) +void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { if (NULL == L) return; @@ -1705,12 +1705,12 @@ void vector2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count for (int i = 1; i <= count; ++i) { lua_pushnumber(L, i); - vector2_to_luaval(L, points[i-1]); + vec2_to_luaval(L, points[i-1]); lua_rawset(L, -3); } } -void vector2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2) +void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2) { if (NULL == L) return; @@ -1724,7 +1724,7 @@ void vector2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2) } -void Vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) +void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) { if (NULL == L) return; @@ -1778,19 +1778,19 @@ void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info) lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "start"); /* L: table key */ - vector2_to_luaval(L, info.start); + vec2_to_luaval(L, info.start); lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "ended"); /* L: table key */ - vector2_to_luaval(L, info.end); + vec2_to_luaval(L, info.end); lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "contact"); /* L: table key */ - vector2_to_luaval(L, info.contact); + vec2_to_luaval(L, info.contact); lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "normal"); /* L: table key */ - vector2_to_luaval(L, info.normal); + vec2_to_luaval(L, info.normal); lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "fraction"); /* L: table key */ @@ -1806,11 +1806,11 @@ void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data) lua_newtable(L); /* L: table */ lua_pushstring(L, "points"); - vector2_array_to_luaval(L, data->points, data->count); + vec2_array_to_luaval(L, data->points, data->count); lua_rawset(L, -3); lua_pushstring(L, "normal"); - vector2_to_luaval(L, data->normal); + vec2_to_luaval(L, data->normal); lua_rawset(L, -3); lua_pushstring(L, "POINT_MAX"); @@ -2406,7 +2406,7 @@ void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue) } } -void matrix_to_luaval(lua_State* L, const cocos2d::Mat4& mat) +void mat4_to_luaval(lua_State* L, const cocos2d::Mat4& mat) { if (nullptr == L) return; diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index f5f7a44570..6394ff5a6b 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -57,10 +57,6 @@ extern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue); extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue); extern bool luaval_to_long(lua_State* L,int lo, long* outValue); extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue); - -extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue); -extern bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); - extern bool luaval_to_size(lua_State* L,int lo,Size* outValue); extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue); extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue); @@ -69,29 +65,29 @@ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue); extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue); extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue); extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue ); -extern bool luaval_to_matrix(lua_State* L, int lo, cocos2d::Mat4* outValue ); +extern bool luaval_to_mat4(lua_State* L, int lo, cocos2d::Mat4* outValue ); extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue); extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue); -extern bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints); +extern bool luaval_to_array_of_vec2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints); extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret); extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret); -extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vec2* outValue); -extern bool luaval_to_Vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); +extern bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue); +extern bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue); extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue); extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outValue); CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vec2* outValue) { - return luaval_to_vector2(L, lo, outValue); + return luaval_to_vec2(L, lo, outValue); } CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, cocos2d::Mat4* outValue ) { - return luaval_to_matrix(L, lo, outValue); + return luaval_to_mat4(L, lo, outValue); } CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints) { - return luaval_to_array_of_vector2(L, lo, points, numPoints); + return luaval_to_array_of_vec2(L, lo, points, numPoints); } @@ -234,9 +230,9 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) // from native -extern void vector2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); -extern void Vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3); -extern void vector2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count); +extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); +extern void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3); +extern void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count); extern void size_to_luaval(lua_State* L,const Size& sz); extern void rect_to_luaval(lua_State* L,const Rect& rt); extern void color3b_to_luaval(lua_State* L,const Color3B& cc); @@ -249,18 +245,18 @@ extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValu extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue); extern void array_to_luaval(lua_State* L, __Array* inValue); extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict); -extern void matrix_to_luaval(lua_State* L, const cocos2d::Mat4& mat); +extern void mat4_to_luaval(lua_State* L, const cocos2d::Mat4& mat); extern void blendfunc_to_luaval(lua_State* L, const cocos2d::BlendFunc& func); extern void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config); CC_DEPRECATED_ATTRIBUTE static inline void point_to_luaval(lua_State* L,const cocos2d::Vec2& pt) { - vector2_to_luaval(L, pt); + vec2_to_luaval(L, pt); } CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { - vector2_array_to_luaval(L, points, count); + vec2_array_to_luaval(L, points, count); } template diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp index 80d41b1cf0..dd2ee1b0de 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp @@ -4404,7 +4404,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoint00(lua_State* tolua_S) #endif { cocos2d::Vec2 vec2; - if(luaval_to_vector2(tolua_S, 1, &vec2)) + if(luaval_to_vec2(tolua_S, 1, &vec2)) { DrawPrimitives::drawPoint(vec2); } @@ -4451,7 +4451,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoints00(lua_State* tolua_S) goto tolua_lerror; } - if(!luaval_to_vector2(tolua_S, lua_gettop(tolua_S), &points[i])) + if(!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i])) { lua_pop(tolua_S, 1); CC_SAFE_DELETE_ARRAY(points); @@ -4487,11 +4487,11 @@ static int tolua_cocos2d_DrawPrimitives_drawLine00(lua_State* tolua_S) #endif { cocos2d::Vec2 origin; - if (!luaval_to_vector2(tolua_S, 1, &origin)) + if (!luaval_to_vec2(tolua_S, 1, &origin)) return 0; cocos2d::Vec2 destination; - if (!luaval_to_vector2(tolua_S, 2, &destination)) + if (!luaval_to_vec2(tolua_S, 2, &destination)) return 0; DrawPrimitives::drawLine(origin,destination); @@ -4520,11 +4520,11 @@ static int tolua_cocos2d_DrawPrimitives_drawRect00(lua_State* tolua_S) #endif { cocos2d::Vec2 origin; - if (!luaval_to_vector2(tolua_S, 1, &origin)) + if (!luaval_to_vec2(tolua_S, 1, &origin)) return 0; cocos2d::Vec2 destination; - if (!luaval_to_vector2(tolua_S, 2, &destination)) + if (!luaval_to_vec2(tolua_S, 2, &destination)) return 0; DrawPrimitives::drawRect(origin,destination); @@ -4555,11 +4555,11 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidRect00(lua_State* tolua_S) #endif { cocos2d::Vec2 origin; - if (!luaval_to_vector2(tolua_S, 1, &origin)) + if (!luaval_to_vec2(tolua_S, 1, &origin)) return 0; cocos2d::Vec2 destination; - if (!luaval_to_vector2(tolua_S, 2, &destination)) + if (!luaval_to_vec2(tolua_S, 2, &destination)) return 0; Color4F color; @@ -4613,7 +4613,7 @@ static int tolua_cocos2d_DrawPrimitives_drawPoly00(lua_State* tolua_S) goto tolua_lerror; } - if(!luaval_to_vector2(tolua_S, lua_gettop(tolua_S), &points[i])) + if(!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i])) { lua_pop(tolua_S, 1); CC_SAFE_DELETE_ARRAY(points); @@ -4667,7 +4667,7 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidPoly00(lua_State* tolua_S) goto tolua_lerror; } - if(!luaval_to_vector2(tolua_S, lua_gettop(tolua_S), &points[i])) + if(!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i])) { lua_pop(tolua_S, 1); CC_SAFE_DELETE_ARRAY(points); @@ -4717,7 +4717,7 @@ static int tolua_cocos2d_DrawPrimitives_drawCircle00(lua_State* tolua_S) #endif { cocos2d::Vec2 center; - if (!luaval_to_vector2(tolua_S, 1, ¢er)) + if (!luaval_to_vec2(tolua_S, 1, ¢er)) return 0; float radius = ((float) tolua_tonumber(tolua_S,2,0)); @@ -4758,7 +4758,7 @@ static int tolua_cocos2d_DrawPrimitives_drawSolidCircle00(lua_State* tolua_S) #endif { cocos2d::Vec2 center; - if (!luaval_to_vector2(tolua_S, 1, ¢er)) + if (!luaval_to_vec2(tolua_S, 1, ¢er)) return 0; float radius = ((float) tolua_tonumber(tolua_S,2,0)); float angle = ((float) tolua_tonumber(tolua_S,3,0)); @@ -4795,15 +4795,15 @@ static int tolua_cocos2d_DrawPrimitives_drawQuadBezier00(lua_State* tolua_S) #endif { cocos2d::Vec2 origin; - if (!luaval_to_vector2(tolua_S, 1, &origin)) + if (!luaval_to_vec2(tolua_S, 1, &origin)) return 0; cocos2d::Vec2 control; - if (!luaval_to_vector2(tolua_S, 2, &control)) + if (!luaval_to_vec2(tolua_S, 2, &control)) return 0; cocos2d::Vec2 destination; - if (!luaval_to_vector2(tolua_S, 3, &destination)) + if (!luaval_to_vec2(tolua_S, 3, &destination)) return 0; unsigned int segments = ((unsigned int) tolua_tonumber(tolua_S,4,0)); @@ -4838,19 +4838,19 @@ static int tolua_cocos2d_DrawPrimitives_drawCubicBezier00(lua_State* tolua_S) { cocos2d::Vec2 origin; - if (!luaval_to_vector2(tolua_S, 1, &origin)) + if (!luaval_to_vec2(tolua_S, 1, &origin)) return 0; cocos2d::Vec2 control1; - if (!luaval_to_vector2(tolua_S, 2, &control1)) + if (!luaval_to_vec2(tolua_S, 2, &control1)) return 0; cocos2d::Vec2 control2; - if (!luaval_to_vector2(tolua_S, 3, &control2)) + if (!luaval_to_vec2(tolua_S, 3, &control2)) return 0; cocos2d::Vec2 destination; - if (!luaval_to_vector2(tolua_S, 4, &destination)) + if (!luaval_to_vec2(tolua_S, 4, &destination)) return 0; unsigned int segments = ((unsigned int) tolua_tonumber(tolua_S,5,0)); @@ -4882,7 +4882,7 @@ int tolua_cocos2d_DrawPrimitives_drawCatmullRom00(lua_State* tolua_S) { int num = 0; cocos2d::Vec2 *arr = NULL; - if (!luaval_to_array_of_vector2(tolua_S, 1, &arr, &num)) + if (!luaval_to_array_of_vec2(tolua_S, 1, &arr, &num)) return 0; @@ -4929,7 +4929,7 @@ int tolua_cocos2d_DrawPrimitives_drawCardinalSpline00(lua_State* tolua_S) { int num = 0; cocos2d::Vec2 *arr = NULL; - if (!luaval_to_array_of_vector2(tolua_S, 1, &arr, &num)) + if (!luaval_to_array_of_vec2(tolua_S, 1, &arr, &num)) return 0; diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index 61bc38a2d8..d4c924e57d 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -2126,7 +2126,7 @@ int tolua_cocos2d_Node_setAnchorPoint(lua_State* tolua_S) if (1 == argc) { cocos2d::Vec2 pt; - ok &= luaval_to_vector2(tolua_S, 2, &pt); + ok &= luaval_to_vec2(tolua_S, 2, &pt); if (!ok) return 0; @@ -2292,7 +2292,7 @@ int lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S) int num = 0; cocos2d::Vec2 *arr = NULL; - ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); + ok &= luaval_to_array_of_vec2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2364,7 +2364,7 @@ int tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S) int num = 0; cocos2d::Vec2 *arr = NULL; - ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); + ok &= luaval_to_array_of_vec2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2428,7 +2428,7 @@ int tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S) int num = 0; cocos2d::Vec2 *arr = NULL; - ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); + ok &= luaval_to_array_of_vec2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2492,7 +2492,7 @@ int tolua_cocos2d_BezierBy_create(lua_State* tolua_S) int num = 0; cocos2d::Vec2 *arr = NULL; - ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); + ok &= luaval_to_array_of_vec2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2552,7 +2552,7 @@ int tolua_cocos2d_BezierTo_create(lua_State* tolua_S) int num = 0; cocos2d::Vec2 *arr = NULL; - ok &= luaval_to_array_of_vector2(tolua_S, 3, &arr, &num); + ok &= luaval_to_array_of_vec2(tolua_S, 3, &arr, &num); if (!ok) return 0; @@ -2642,7 +2642,7 @@ static int tolua_cocos2d_DrawNode_drawPolygon(lua_State* tolua_S) #endif } - if(!luaval_to_vector2(tolua_S, lua_gettop(tolua_S), &points[i])) + if(!luaval_to_vec2(tolua_S, lua_gettop(tolua_S), &points[i])) { lua_pop(tolua_S, 1); CC_SAFE_DELETE_ARRAY(points); diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp index 1998631dfa..2a02e89c6a 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp @@ -174,8 +174,8 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S) }; } while(0); - ok &= luaval_to_vector2(tolua_S, 3, &arg1); - ok &= luaval_to_vector2(tolua_S, 4, &arg2); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cobj->rayCast(arg0, arg1, arg2, nullptr); @@ -290,7 +290,7 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S) assert(false); } while(0) ; - ok &= luaval_to_vector2(tolua_S, 3, &arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cobj->queryPoint(arg0, arg1, nullptr); @@ -328,7 +328,7 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) cocos2d::Vec2* arg0 = nullptr; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -359,7 +359,7 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -393,12 +393,12 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; cocos2d::Vec2 arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); ok &= luaval_to_physics_material(tolua_S, 3, &arg2); - ok &= luaval_to_vector2(tolua_S, 4, &arg3); + ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { CC_SAFE_FREE(arg0); @@ -449,7 +449,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -480,7 +480,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) int arg1; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -513,7 +513,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; double arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -569,7 +569,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -600,7 +600,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) int arg1; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -633,7 +633,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; double arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -689,7 +689,7 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -699,7 +699,7 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) return 0; } cocos2d::PhysicsShape::recenterPoints(arg0, arg1); - vector2_array_to_luaval(tolua_S, arg0, arg1); + vec2_array_to_luaval(tolua_S, arg0, arg1); CC_SAFE_FREE(arg0); return 0; @@ -710,18 +710,18 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) int arg1 = 0; cocos2d::Vec2 arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); - ok &= luaval_to_vector2(tolua_S, 3, &arg2); + ok &= luaval_to_vec2(tolua_S, 3, &arg2); if(!ok) { CC_SAFE_FREE(arg0); return 0; } cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2); - vector2_array_to_luaval(tolua_S, arg0, arg1); + vec2_array_to_luaval(tolua_S, arg0, arg1); CC_SAFE_FREE(arg0); return 0; } @@ -754,7 +754,7 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -765,7 +765,7 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S) } cocos2d::Vec2 ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1); CC_SAFE_FREE(arg0); - vector2_to_luaval(tolua_S, ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getPolyonCenter",argc, 2); @@ -805,7 +805,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S) { cocos2d::Vec2 arg0[4]; cobj->getPoints(arg0); - vector2_array_to_luaval(tolua_S, arg0, 4); + vec2_array_to_luaval(tolua_S, arg0, 4); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); @@ -848,7 +848,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) int count = cobj->getPointsCount(); cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); - vector2_array_to_luaval(tolua_S, arg0, count); + vec2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); return 0; } @@ -883,7 +883,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -904,7 +904,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -926,12 +926,12 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; cocos2d::Vec2 arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); ok &= luaval_to_physics_material(tolua_S, 3, &arg2); - ok &= luaval_to_vector2(tolua_S, 4, &arg3); + ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { CC_SAFE_FREE(arg0); @@ -970,7 +970,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1014,7 +1014,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) int arg2 = 0; ok &= luaval_to_number(tolua_S, 2,&arg0); do { - ok = luaval_to_array_of_vector2(tolua_S, 3, &arg1, &arg2); + ok = luaval_to_array_of_vec2(tolua_S, 3, &arg1, &arg2); if (nullptr == arg1){ LUA_PRECONDITION( arg1, "Invalid Native Object"); }} while (0); @@ -1036,11 +1036,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) cocos2d::Vec2 arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); do { - ok = luaval_to_array_of_vector2(tolua_S, 3, &arg1, &arg2); + ok = luaval_to_array_of_vec2(tolua_S, 3, &arg1, &arg2); if (nullptr == arg1){ LUA_PRECONDITION( arg1, "Invalid Native Object"); }} while (0); - ok &= luaval_to_vector2(tolua_S, 4, &arg3); + ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { CC_SAFE_FREE(arg1); @@ -1089,7 +1089,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) int count = cobj->getPointsCount(); cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); - vector2_array_to_luaval(tolua_S, arg0, count); + vec2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); return 0; } @@ -1133,7 +1133,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) int count = cobj->getPointsCount(); cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); - vector2_array_to_luaval(tolua_S, arg0, count); + vec2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); return 0; } @@ -1177,7 +1177,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) int count = cobj->getPointsCount(); cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); - vector2_array_to_luaval(tolua_S, arg0, count); + vec2_array_to_luaval(tolua_S, arg0, count); CC_SAFE_FREE(arg0); return 0; } @@ -1316,7 +1316,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1336,7 +1336,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1358,7 +1358,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; double arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1403,7 +1403,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) cocos2d::Vec2* arg0; int arg1 = 0; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1423,7 +1423,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) int arg1 = 0; cocos2d::PhysicsMaterial arg2; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); @@ -1445,7 +1445,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) cocos2d::PhysicsMaterial arg2; double arg3; do { - ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1); + ok = luaval_to_array_of_vec2(tolua_S, 2, &arg0, &arg1); if (nullptr == arg0){ LUA_PRECONDITION( arg0, "Invalid Native Object"); }} while (0); diff --git a/cocos/scripting/lua-bindings/script/Deprecated.lua b/cocos/scripting/lua-bindings/script/Deprecated.lua index 44523bd242..33d26b6241 100644 --- a/cocos/scripting/lua-bindings/script/Deprecated.lua +++ b/cocos/scripting/lua-bindings/script/Deprecated.lua @@ -1147,4 +1147,52 @@ end rawset(cc.GLProgram,"addAttribute", GLProgram.addAttribute) --functions of cc.GLProgram will be deprecated end +--functions of ccui.Text will be deprecated begin +local TextDeprecated = { } +function TextDeprecated.setText(self, str) + deprecatedTip("ccui.Text:setText","ccui.Text:setString") + return self:setString(str) +end +rawset(ccui.Text,"setText", TextDeprecated.setText) + +function TextDeprecated.getStringValue(self) + deprecatedTip("ccui.Text:getStringValue","ccui.Text:getString") + return self:getString() +end +rawset(ccui.Text,"getStringValue", TextDeprecated.getStringValue) + +--functions of ccui.Text will be deprecated begin + +--functions of ccui.TextAtlas will be deprecated begin +local TextAtlasDeprecated = { } +function TextAtlasDeprecated.setStringValue(self, str) + deprecatedTip("ccui.TextAtlas:setStringValue","ccui.TextAtlas:setString") + return self:setString(str) +end +rawset(ccui.TextAtlas,"setStringValue", TextAtlasDeprecated.setStringValue) + +function TextAtlasDeprecated.getStringValue(self) + deprecatedTip("ccui.TextAtlas:getStringValue","ccui.TextAtlas:getString") + return self:getString() +end +rawset(ccui.TextAtlas,"getStringValue", TextAtlasDeprecated.getStringValue) + +--functions of ccui.TextAtlas will be deprecated begin + + +--functions of ccui.TextBMFont will be deprecated begin +local TextBMFontDeprecated = { } +function TextBMFontDeprecated.setText(self, str) + deprecatedTip("ccui.TextBMFont:setText","ccui.TextBMFont:setString") + return self:setString(str) +end +rawset(ccui.TextBMFont,"setText", TextBMFontDeprecated.setText) + +function TextBMFontDeprecated.getStringValue(self) + deprecatedTip("ccui.Text:getStringValue","ccui.TextBMFont:getString") + return self:getString() +end +rawset(ccui.Text,"getStringValue", TextBMFontDeprecated.getStringValue) +--functions of ccui.TextBMFont will be deprecated begin + diff --git a/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua b/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua index c74ad2ffbe..f27bf8ea92 100644 --- a/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua +++ b/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua @@ -402,18 +402,15 @@ _G.LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none _G.LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid _G.LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient -_G.LAYOUT_ABSOLUTE = ccui.LayoutType.absolute -_G.LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.linearVertical -_G.LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.linearHorizontal -_G.LAYOUT_RELATIVE = ccui.LayoutType.relative +_G.LAYOUT_ABSOLUTE = ccui.Type.ABSOLUTE +_G.LAYOUT_LINEAR_VERTICAL = ccui.Type.VERTICAL +_G.LAYOUT_LINEAR_HORIZONTAL = ccui.Type.HORIZONTAL +_G.LAYOUT_RELATIVE = ccui.Type.RELATIVE _G.BRIGHT_NONE = ccui.BrightStyle.none _G.BRIGHT_NORMAL = ccui.BrightStyle.normal _G.BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight -_G.WidgetTypeWidget = ccui.WidgetType.widget -_G.WidgetTypeContainer = ccui.WidgetType.container - _G.UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType _G.UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType @@ -434,8 +431,8 @@ _G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected _G.CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected _G.CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected -_G.LoadingBarTypeLeft = ccui.LoadingBarType.left -_G.LoadingBarTypeRight = ccui.LoadingBarType.right +_G.LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT +_G.LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT _G.LoadingBarTypeRight = ccui.SliderEventType.percent_changed @@ -485,3 +482,14 @@ _G.kCCScrollViewDirectionHorizontal = cc.SCROLLVIEW_DIRECTION_HORIZONTAL _G.kCCScrollViewDirectionVertical = cc.SCROLLVIEW_DIRECTION_VERTICAL _G.kCCTableViewFillTopDown = cc.TABLEVIEW_FILL_TOPDOWN _G.kCCTableViewFillBottomUp = cc.TABLEVIEW_FILL_BOTTOMUP + +ccui.LoadingBarType = ccui.LoadingBarDirection +ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT +ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT + +ccui.LayoutType = ccui.Type +ccui.LayoutType.absolute = ccui.Type.ABSOLUTE +ccui.LayoutType.linearVertical = ccui.Type.VERTICAL +ccui.LayoutType.linearHorizontal = ccui.Type.HORIZONTAL +ccui.LayoutType.relative = ccui.Type.RELATIVE + diff --git a/cocos/scripting/lua-bindings/script/GuiConstants.lua b/cocos/scripting/lua-bindings/script/GuiConstants.lua index 028f8d9778..6fea411a49 100644 --- a/cocos/scripting/lua-bindings/script/GuiConstants.lua +++ b/cocos/scripting/lua-bindings/script/GuiConstants.lua @@ -7,12 +7,6 @@ ccui.BrightStyle = highlight = 1, } -ccui.WidgetType = -{ - widget = 0, --control - container = 1, --container -} - ccui.TextureResType = { localType = 0, @@ -59,12 +53,12 @@ ccui.LayoutBackGroundColorType = gradient = 2, } -ccui.LayoutType = +ccui.Type = { - absolute = 0, - linearVertical = 1, - linearHorizontal = 2, - relative = 3, + ABSOLUTE = 0, + VERTICAL = 1, + HORIZONTAL = 2, + RELATIVE = 3, } ccui.LayoutParameterType = @@ -113,7 +107,7 @@ ccui.RelativeAlign = ccui.SliderEventType = {percentChanged = 0} -ccui.LoadingBarType = { left = 0, right = 1} +ccui.LoadingBarDirection = { LEFT = 0, RIGHT = 1} ccui.ScrollViewDir = { none = 0, diff --git a/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua b/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua index cd9c6d8737..d12e7d5370 100644 --- a/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua +++ b/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua @@ -72,7 +72,7 @@ function UIScene:init() end local backMenuLabel = ccui.Text:create() - backMenuLabel:setText("Back") + backMenuLabel:setString("Back") backMenuLabel:setFontSize(20) backMenuLabel:setTouchScaleChangeEnabled(true) backMenuLabel:setPosition(cc.p(430,30)) @@ -109,7 +109,7 @@ function UIButtonTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -117,7 +117,7 @@ function UIButtonTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("Button") + alert:setString("Button") alert:setFontName(font_UIButtonTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -127,13 +127,13 @@ function UIButtonTest:initExtend() local function touchEvent(sender,eventType) if eventType == ccui.TouchEventType.began then - self._displayValueLabel:setText("Touch Down") + self._displayValueLabel:setString("Touch Down") elseif eventType == ccui.TouchEventType.moved then - self._displayValueLabel:setText("Touch Move") + self._displayValueLabel:setString("Touch Move") elseif eventType == ccui.TouchEventType.ended then - self._displayValueLabel:setText("Touch Up") + self._displayValueLabel:setString("Touch Up") elseif eventType == ccui.TouchEventType.canceled then - self._displayValueLabel:setText("Touch Cancelled") + self._displayValueLabel:setString("Touch Cancelled") end end local button = ccui.Button:create() @@ -173,7 +173,7 @@ function UIButtonScale9Test:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -181,7 +181,7 @@ function UIButtonScale9Test:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("Button scale9 render") + alert:setString("Button scale9 render") alert:setFontName(font_UIButtonTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -190,13 +190,13 @@ function UIButtonScale9Test:initExtend() local function touchEvent(sender,eventType) if eventType == ccui.TouchEventType.began then - self._displayValueLabel:setText("Touch Down") + self._displayValueLabel:setString("Touch Down") elseif eventType == ccui.TouchEventType.moved then - self._displayValueLabel:setText("Touch Move") + self._displayValueLabel:setString("Touch Move") elseif eventType == ccui.TouchEventType.ended then - self._displayValueLabel:setText("Touch Up") + self._displayValueLabel:setString("Touch Up") elseif eventType == ccui.TouchEventType.canceled then - self._displayValueLabel:setText("Touch Cancelled") + self._displayValueLabel:setString("Touch Cancelled") end end @@ -239,7 +239,7 @@ function UIButtonPressedActionTest:initExtend() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -247,7 +247,7 @@ function UIButtonPressedActionTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("Button Pressed Action") + alert:setString("Button Pressed Action") alert:setFontName(font_UIButtonTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -256,13 +256,13 @@ function UIButtonPressedActionTest:initExtend() local function touchEvent(sender,eventType) if eventType == ccui.TouchEventType.began then - self._displayValueLabel:setText("Touch Down") + self._displayValueLabel:setString("Touch Down") elseif eventType == ccui.TouchEventType.moved then - self._displayValueLabel:setText("Touch Move") + self._displayValueLabel:setString("Touch Move") elseif eventType == ccui.TouchEventType.ended then - self._displayValueLabel:setText("Touch Up") + self._displayValueLabel:setString("Touch Up") elseif eventType == ccui.TouchEventType.canceled then - self._displayValueLabel:setText("Touch Cancelled") + self._displayValueLabel:setString("Touch Cancelled") end end @@ -304,7 +304,7 @@ function UITextButtonTest:initExtend() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -312,7 +312,7 @@ function UITextButtonTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("TextButton") + alert:setString("TextButton") alert:setFontName(font_UIButtonTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -321,13 +321,13 @@ function UITextButtonTest:initExtend() local function touchEvent(sender,eventType) if eventType == ccui.TouchEventType.began then - self._displayValueLabel:setText("Touch Down") + self._displayValueLabel:setString("Touch Down") elseif eventType == ccui.TouchEventType.moved then - self._displayValueLabel:setText("Touch Move") + self._displayValueLabel:setString("Touch Move") elseif eventType == ccui.TouchEventType.ended then - self._displayValueLabel:setText("Touch Up") + self._displayValueLabel:setString("Touch Up") elseif eventType == ccui.TouchEventType.canceled then - self._displayValueLabel:setText("Touch Cancelled") + self._displayValueLabel:setString("Touch Cancelled") end end @@ -368,7 +368,7 @@ function UITextButtonScale9Test:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -376,7 +376,7 @@ function UITextButtonScale9Test:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("TextButton scale9 render") + alert:setString("TextButton scale9 render") alert:setFontName(font_UIButtonTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -385,13 +385,13 @@ function UITextButtonScale9Test:initExtend() local function touchEvent(sender,eventType) if eventType == ccui.TouchEventType.began then - self._displayValueLabel:setText("Touch Down") + self._displayValueLabel:setString("Touch Down") elseif eventType == ccui.TouchEventType.moved then - self._displayValueLabel:setText("Touch Move") + self._displayValueLabel:setString("Touch Move") elseif eventType == ccui.TouchEventType.ended then - self._displayValueLabel:setText("Touch Up") + self._displayValueLabel:setString("Touch Up") elseif eventType == ccui.TouchEventType.canceled then - self._displayValueLabel:setText("Touch Cancelled") + self._displayValueLabel:setString("Touch Cancelled") end end @@ -434,7 +434,7 @@ function UICheckBoxTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIButtonTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -442,7 +442,7 @@ function UICheckBoxTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("CheckBox") + alert:setString("CheckBox") alert:setFontName(font_UICheckBoxTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -451,9 +451,9 @@ function UICheckBoxTest:initExtend() local function selectedEvent(sender,eventType) if eventType == ccui.CheckBoxEventType.selected then - self._displayValueLabel:setText("Selected") + self._displayValueLabel:setString("Selected") elseif eventType == ccui.CheckBoxEventType.unselected then - self._displayValueLabel:setText("Unselected") + self._displayValueLabel:setString("Unselected") end end @@ -499,7 +499,7 @@ function UISliderTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move the slider thumb") + self._displayValueLabel:setString("Move the slider thumb") self._displayValueLabel:setFontName(font_UISliderTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -507,7 +507,7 @@ function UISliderTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("Slider") + alert:setString("Slider") alert:setFontName(font_UISliderTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -518,7 +518,7 @@ function UISliderTest:initExtend() if eventType == ccui.SliderEventType.percentChanged then local slider = sender local percent = "Percent " .. slider:getPercent() - self._displayValueLabel:setText(percent) + self._displayValueLabel:setString(percent) end end @@ -561,7 +561,7 @@ function UISliderScale9Test:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move the slider thumb") + self._displayValueLabel:setString("Move the slider thumb") self._displayValueLabel:setFontName(font_UISliderTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -569,7 +569,7 @@ function UISliderScale9Test:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("Slider scale9 render") + alert:setString("Slider scale9 render") alert:setFontName(font_UISliderTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -580,7 +580,7 @@ function UISliderScale9Test:initExtend() if eventType == ccui.SliderEventType.percentChanged then local slider = sender local percent = "Percent " .. slider:getPercent() - self._displayValueLabel:setText(percent) + self._displayValueLabel:setString(percent) end end @@ -625,7 +625,7 @@ function UIImageViewTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("ImageView") + alert:setString("ImageView") alert:setFontName(font_UIImageViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -666,7 +666,7 @@ function UIImageViewScale9Test:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("ImageView scale9 render") + alert:setString("ImageView scale9 render") alert:setFontName(font_UIImageViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -719,7 +719,7 @@ function UILoadingBarLeftTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LoadingBar") + alert:setString("LoadingBar") alert:setFontName(font_UILoadingBarTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -802,7 +802,7 @@ function UILoadingBarLeftTest:initExtend() end local mainMenuLabel = ccui.Text:create() - mainMenuLabel:setText("Back") + mainMenuLabel:setString("Back") mainMenuLabel:setFontSize(20) mainMenuLabel:setTouchScaleChangeEnabled(true) mainMenuLabel:setPosition(cc.p(430,30)) @@ -849,7 +849,7 @@ function UILoadingBarRightTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LoadingBar") + alert:setString("LoadingBar") alert:setFontName(font_UILoadingBarTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -860,7 +860,7 @@ function UILoadingBarRightTest:initExtend() loadingBar:setTag(0) loadingBar:setName("LoadingBar") loadingBar:loadTexture("cocosui/sliderProgress.png") - loadingBar:setDirection(ccui.LoadingBarType.right) + loadingBar:setDirection(ccui.LoadingBarDirection.RIGHT) loadingBar:setPercent(0) loadingBar:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + loadingBar:getSize().height / 4.0)) @@ -933,7 +933,7 @@ function UILoadingBarRightTest:initExtend() end local mainMenuLabel = ccui.Text:create() - mainMenuLabel:setText("Back") + mainMenuLabel:setString("Back") mainMenuLabel:setFontSize(20) mainMenuLabel:setTouchScaleChangeEnabled(true) mainMenuLabel:setPosition(cc.p(430,30)) @@ -980,7 +980,7 @@ function UILoadingBarLeftScale9Test:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LoadingBar Scale9 Render") + alert:setString("LoadingBar Scale9 Render") alert:setFontName(font_UILoadingBarTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1066,7 +1066,7 @@ function UILoadingBarLeftScale9Test:initExtend() end local mainMenuLabel = ccui.Text:create() - mainMenuLabel:setText("Back") + mainMenuLabel:setString("Back") mainMenuLabel:setFontSize(20) mainMenuLabel:setTouchScaleChangeEnabled(true) mainMenuLabel:setPosition(cc.p(430,30)) @@ -1113,7 +1113,7 @@ function UILoadingBarRightScale9Test:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LoadingBar Scale9 Render") + alert:setString("LoadingBar Scale9 Render") alert:setFontName(font_UILoadingBarTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1127,7 +1127,7 @@ function UILoadingBarRightScale9Test:initExtend() loadingBar:setScale9Enabled(true) loadingBar:setCapInsets(cc.rect(0, 0, 0, 0)) loadingBar:setSize(cc.size(300, 30)) - loadingBar:setDirection(ccui.LoadingBarType.right) + loadingBar:setDirection(ccui.LoadingBarDirection.LEFT) loadingBar:setPercent(0) loadingBar:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + loadingBar:getSize().height / 4.0)) @@ -1200,7 +1200,7 @@ function UILoadingBarRightScale9Test:initExtend() end local mainMenuLabel = ccui.Text:create() - mainMenuLabel:setText("Back") + mainMenuLabel:setString("Back") mainMenuLabel:setFontSize(20) mainMenuLabel:setTouchScaleChangeEnabled(true) mainMenuLabel:setPosition(cc.p(430,30)) @@ -1235,7 +1235,7 @@ function UILabelAtlasTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LabelAtlas") + alert:setString("LabelAtlas") alert:setFontName(font_UILabelAtlasTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1276,7 +1276,7 @@ function UILabelBMFontTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("LabelBMFont") + alert:setString("LabelBMFont") alert:setFontName(font_UILabelBMFontTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1286,7 +1286,7 @@ function UILabelBMFontTest:initExtend() local labelBMFont = ccui.TextBMFont:create() labelBMFont:setFntFile("cocosui/bitmapFontTest2.fnt") - labelBMFont:setText("BMFont") + labelBMFont:setString("BMFont") labelBMFont:setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2.0 + labelBMFont:getSize().height / 8.0)) self._uiLayer:addChild(labelBMFont) @@ -1318,7 +1318,7 @@ function UILabelTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Label") + alert:setString("Label") alert:setFontName(font_UILabelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1326,7 +1326,7 @@ function UILabelTest:initExtend() self._uiLayer:addChild(alert) local label = ccui.Text:create() - label:setText("Label") + label:setString("Label") label:setFontName("AmericanTypewriter") label:setFontSize(30) label:setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + label:getSize().height / 4)) @@ -1359,7 +1359,7 @@ function UITextAreaTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("TextArea") + alert:setString("TextArea") alert:setFontName(font_UITextAreaTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1369,7 +1369,7 @@ function UITextAreaTest:initExtend() local textArea = ccui.Text:create() textArea:setTextAreaSize(cc.size(280, 150)) textArea:setTextHorizontalAlignment(cc.TEXT_ALIGNMENT_CENTER) - textArea:setText("TextArea widget can line wrap") + textArea:setString("TextArea widget can line wrap") textArea:setFontName("AmericanTypewriter") textArea:setFontSize(32) textArea:setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 - textArea:getSize().height / 8)) @@ -1403,7 +1403,7 @@ function UITextFieldTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UITextFieldTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -1411,7 +1411,7 @@ function UITextFieldTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("TextField") + alert:setString("TextField") alert:setFontName(font_UITextFieldTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1423,16 +1423,16 @@ function UITextFieldTest:initExtend() local textField = sender local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.225,cc.p(screenSize.width / 2.0, screenSize.height / 2.0 + textField:getContentSize().height / 2.0))) - self._displayValueLabel:setText("attach with IME") + self._displayValueLabel:setString("attach with IME") elseif eventType == ccui.TextFiledEventType.detach_with_ime then local textField = sender local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.175, cc.p(screenSize.width / 2.0, screenSize.height / 2.0))) - self._displayValueLabel:setText("detach with IME") + self._displayValueLabel:setString("detach with IME") elseif eventType == ccui.TextFiledEventType.insert_text then - self._displayValueLabel:setText("insert words") + self._displayValueLabel:setString("insert words") elseif eventType == ccui.TextFiledEventType.delete_backward then - self._displayValueLabel:setText("delete word") + self._displayValueLabel:setString("delete word") end end @@ -1473,7 +1473,7 @@ function UITextFieldMaxLengthTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UITextFieldTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -1481,7 +1481,7 @@ function UITextFieldMaxLengthTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("TextField max length") + alert:setString("TextField max length") alert:setFontName(font_UITextFieldTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1494,21 +1494,21 @@ function UITextFieldMaxLengthTest:initExtend() local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.225,cc.p(screenSize.width / 2.0, screenSize.height / 2.0 + textField:getContentSize().height / 2.0))) local info = string.format("attach with IME max length %d",textField:getMaxLength()) - self._displayValueLabel:setText(info) + self._displayValueLabel:setString(info) elseif eventType == ccui.TextFiledEventType.detach_with_ime then local textField = sender local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.175, cc.p(screenSize.width / 2.0, screenSize.height / 2.0))) local info = string.format("detach with IME max length %d",textField:getMaxLength()) - self._displayValueLabel:setText(info) + self._displayValueLabel:setString(info) elseif eventType == ccui.TextFiledEventType.insert_text then local textField = sender local info = string.format("insert words max length %d",textField:getMaxLength()) - self._displayValueLabel:setText(info) + self._displayValueLabel:setString(info) elseif eventType == ccui.TextFiledEventType.delete_backward then local textField = sender local info = string.format("delete word max length %d",textField:getMaxLength()) - self._displayValueLabel:setText(info) + self._displayValueLabel:setString(info) end end @@ -1551,7 +1551,7 @@ function UITextFieldPasswordTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UITextFieldTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -1559,7 +1559,7 @@ function UITextFieldPasswordTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("TextField password") + alert:setString("TextField password") alert:setFontName(font_UITextFieldTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1571,16 +1571,16 @@ function UITextFieldPasswordTest:initExtend() local textField = sender local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.175, cc.p(screenSize.width / 2.0, screenSize.height / 2.0))) - self._displayValueLabel:setText("detach with IME password") + self._displayValueLabel:setString("detach with IME password") elseif eventType == ccui.TextFiledEventType.detach_with_ime then local textField = sender local screenSize = cc.Director:getInstance():getWinSize() textField:runAction(cc.MoveTo:create(0.175, cc.p(screenSize.width / 2.0, screenSize.height / 2.0))) - self._displayValueLabel:setText("detach with IME password") + self._displayValueLabel:setString("detach with IME password") elseif eventType == ccui.TextFiledEventType.insert_text then - self._displayValueLabel:setText("insert words password") + self._displayValueLabel:setString("insert words password") elseif eventType == ccui.TextFiledEventType.delete_backward then - self._displayValueLabel:setText("delete word password") + self._displayValueLabel:setString("delete word password") end end @@ -1623,7 +1623,7 @@ function UIPanelTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel") + alert:setString("Panel") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1691,7 +1691,7 @@ function UIPanelColorTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel color render") + alert:setString("Panel color render") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1761,7 +1761,7 @@ function UIPanelGradientTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel color Gradient") + alert:setString("Panel color Gradient") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1831,7 +1831,7 @@ function UIPanelBackGroundImageTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel background image") + alert:setString("Panel background image") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1901,7 +1901,7 @@ function UIPanelBackGroundImageScale9Test:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel background image scale9") + alert:setString("Panel background image scale9") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1971,7 +1971,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel Layout Linear Vertical") + alert:setString("Panel Layout Linear Vertical") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -1982,7 +1982,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend() local background = root:getChildByName("background_Panel") local layout = ccui.Layout:create() - layout:setLayoutType(ccui.LayoutType.linearVertical) + layout:setLayoutType(ccui.Type.VERTICAL) layout:setSize(cc.size(280, 150)) local backgroundSize = background:getContentSize() layout:setPosition(cc.p((widgetSize.width - backgroundSize.width) / 2 + @@ -2054,7 +2054,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend() local widgetSize = self._widget:getSize() local alert = ccui.Text:create() - alert:setText("Panel Layout Linear Horizontal") + alert:setString("Panel Layout Linear Horizontal") alert:setFontName(font_UIPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2065,7 +2065,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend() local background = root:getChildByName("background_Panel") local layout = ccui.Layout:create() - layout:setLayoutType(ccui.LayoutType.linearHorizontal) + layout:setLayoutType(ccui.Type.HORIZONTAL) layout:setClippingEnabled(true) layout:setSize(cc.size(280, 150)) local backgroundSize = background:getContentSize() @@ -2139,7 +2139,7 @@ function UIScrollViewVerticalTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move by vertical direction") + self._displayValueLabel:setString("Move by vertical direction") self._displayValueLabel:setFontName(font_UIScrollViewTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2147,7 +2147,7 @@ function UIScrollViewVerticalTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("ScrollView") + alert:setString("ScrollView") alert:setFontName(font_UIScrollViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2228,7 +2228,7 @@ function UIScrollViewHorizontalTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move by horizontal direction") + self._displayValueLabel:setString("Move by horizontal direction") self._displayValueLabel:setFontName(font_UIScrollViewTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2236,7 +2236,7 @@ function UIScrollViewHorizontalTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("ScrollView") + alert:setString("ScrollView") alert:setFontName(font_UIScrollViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2324,7 +2324,7 @@ function UIPageViewTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move by horizontal direction") + self._displayValueLabel:setString("Move by horizontal direction") self._displayValueLabel:setFontName(font_UIPageViewTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2332,7 +2332,7 @@ function UIPageViewTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("PageView") + alert:setString("PageView") alert:setFontName(font_UIPageViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2365,7 +2365,7 @@ function UIPageViewTest:initExtend() local label = ccui.Text:create() local pageInfo = string.format("page %d", i) - label:setText(pageInfo) + label:setString(pageInfo) label:setFontName(font_UIPageViewTest) label:setFontSize(30) label:setColor(cc.c3b(192, 192, 192)) @@ -2380,7 +2380,7 @@ function UIPageViewTest:initExtend() if eventType == ccui.PageViewEventType.turning then local pageView = sender local pageInfo = string.format("page %d " , pageView:getCurPageIndex() + 1) - self._displayValueLabel:setText(pageInfo) + self._displayValueLabel:setString(pageInfo) end end @@ -2418,7 +2418,7 @@ function UIListViewVerticalTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move by vertical direction") + self._displayValueLabel:setString("Move by vertical direction") self._displayValueLabel:setFontName(font_UIListViewTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2426,7 +2426,7 @@ function UIListViewVerticalTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("ListView") + alert:setString("ListView") alert:setFontName(font_UIListViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2578,7 +2578,7 @@ function UIListViewHorizontalTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("Move by vertical direction") + self._displayValueLabel:setString("Move by vertical direction") self._displayValueLabel:setFontName(font_UIListViewTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2586,7 +2586,7 @@ function UIListViewHorizontalTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("ListView") + alert:setString("ListView") alert:setFontName(font_UIListViewTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2738,7 +2738,7 @@ function UIDragPanelTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIDragPanelTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2746,7 +2746,7 @@ function UIDragPanelTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("DragPanel") + alert:setString("DragPanel") alert:setFontName(font_UIDragPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2797,7 +2797,7 @@ function UIDragPanelBounceTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("No Event") + self._displayValueLabel:setString("No Event") self._displayValueLabel:setFontName(font_UIDragPanelTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2806,7 +2806,7 @@ function UIDragPanelBounceTest:initExtend() local alert = ccui.Text:create() - alert:setText("DragPanel Bounce") + alert:setString("DragPanel Bounce") alert:setFontName(font_UIDragPanelTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) @@ -2857,7 +2857,7 @@ function UINodeContainerTest:initExtend() local widgetSize = self._widget:getSize() self._displayValueLabel = ccui.Text:create() - self._displayValueLabel:setText("NodeContainer Add CCNode") + self._displayValueLabel:setString("NodeContainer Add CCNode") self._displayValueLabel:setFontName(font_UINodeContainerTest) self._displayValueLabel:setFontSize(32) self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1)) @@ -2865,7 +2865,7 @@ function UINodeContainerTest:initExtend() self._uiLayer:addChild(self._displayValueLabel) local alert = ccui.Text:create() - alert:setText("NodeContainer") + alert:setString("NodeContainer") alert:setFontName(font_UINodeContainerTest) alert:setFontSize(30) alert:setColor(cc.c3b(159, 168, 176)) diff --git a/tools/bindings-generator b/tools/bindings-generator index d5d57a27e2..0aba499447 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit d5d57a27e2002f53746b3f7ee19535afbaba113e +Subproject commit 0aba499447134661135f55e84681540ade4f766f From 048a45489e0c2911d30b888452e63ec118f23cf9 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 15 May 2014 15:42:39 +0800 Subject: [PATCH 083/125] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 6bbf9002c4..8fab47a55a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -673,6 +673,7 @@ Developers: xhcnb Device::setAccelerometerEnabled needs to be invoked before adding ACC listener. Fixed a bug that it will get wrong custom properties when use different count custom properties in CocosBuilder. + Correct TotalTime of ActionObject bopohaa Fixed a bug that Webp test crashes. From e6fe882963f4f0b6ab66a2a31c85719cf2d3eb9d Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 15 May 2014 15:50:12 +0800 Subject: [PATCH 084/125] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 0eb752316a..d648220e7c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ cocos2d-x-3.1-rc0 May.16 2014 [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 [FIX] GLProgramState: Supports multitexturing + [FIX] Studio:ActionObject: correct TotalTime of ActionObject cocos2d-x-3.1-alpha1 May.9 2014 [NEW] Animate: Dispatch a custom event after an animation frame is displayed From 44c6c4d54246f1690696c783da45489b1e01b25a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 15 May 2014 08:18:44 +0000 Subject: [PATCH 085/125] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 258 +++++++++--------- .../auto/lua_cocos2dx_extension_auto.cpp | 58 ++-- .../auto/lua_cocos2dx_physics_auto.cpp | 158 +++++------ .../auto/lua_cocos2dx_spine_auto.cpp | 2 +- .../auto/lua_cocos2dx_studio_auto.cpp | 12 +- .../auto/lua_cocos2dx_ui_auto.cpp | 34 +-- 6 files changed, 261 insertions(+), 261 deletions(-) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 272d2f038c..5b7a65ffb1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -1558,7 +1558,7 @@ int lua_cocos2dx_Touch_getPreviousLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocationInView(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocationInView",argc, 0); @@ -1602,7 +1602,7 @@ int lua_cocos2dx_Touch_getLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getLocation(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLocation",argc, 0); @@ -1646,7 +1646,7 @@ int lua_cocos2dx_Touch_getDelta(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getDelta(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDelta",argc, 0); @@ -1690,7 +1690,7 @@ int lua_cocos2dx_Touch_getStartLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartLocationInView(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartLocationInView",argc, 0); @@ -1734,7 +1734,7 @@ int lua_cocos2dx_Touch_getStartLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartLocation(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartLocation",argc, 0); @@ -1874,7 +1874,7 @@ int lua_cocos2dx_Touch_getLocationInView(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getLocationInView(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLocationInView",argc, 0); @@ -1918,7 +1918,7 @@ int lua_cocos2dx_Touch_getPreviousLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocation(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocation",argc, 0); @@ -3359,7 +3359,7 @@ int lua_cocos2dx_Texture2D_drawAtPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->drawAtPoint(arg0); @@ -4158,11 +4158,11 @@ int lua_cocos2dx_Node_convertToWorldSpaceAR(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToWorldSpaceAR(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToWorldSpaceAR",argc, 1); @@ -4703,7 +4703,7 @@ int lua_cocos2dx_Node_getNodeToWorldTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToWorldTransform(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToWorldTransform",argc, 0); @@ -4747,7 +4747,7 @@ int lua_cocos2dx_Node_getPosition3D(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec3 ret = cobj->getPosition3D(); - object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3)ret); + vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition3D",argc, 0); @@ -4849,11 +4849,11 @@ int lua_cocos2dx_Node_convertToWorldSpace(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToWorldSpace(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToWorldSpace",argc, 1); @@ -5124,7 +5124,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertTouchToNodeSpace(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertTouchToNodeSpace",argc, 1); @@ -5351,7 +5351,7 @@ int lua_cocos2dx_Node_getRotation3D(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec3 ret = cobj->getRotation3D(); - object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3)ret); + vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getRotation3D",argc, 0); @@ -5395,7 +5395,7 @@ int lua_cocos2dx_Node_getNodeToParentTransform(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Mat4& ret = cobj->getNodeToParentTransform(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4&)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToParentTransform",argc, 0); @@ -5442,7 +5442,7 @@ int lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertTouchToNodeSpaceAR(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertTouchToNodeSpaceAR",argc, 1); @@ -5485,11 +5485,11 @@ int lua_cocos2dx_Node_convertToNodeSpace(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToNodeSpace(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToNodeSpace",argc, 1); @@ -5628,7 +5628,7 @@ int lua_cocos2dx_Node_setPosition(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } cobj->setPosition(arg0); @@ -5909,7 +5909,7 @@ int lua_cocos2dx_Node_setRotation3D(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); + ok &= luaval_to_vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setRotation3D(arg0); @@ -6001,7 +6001,7 @@ int lua_cocos2dx_Node_setNodeToParentTransform(lua_State* tolua_S) { cocos2d::Mat4 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); + ok &= luaval_to_mat4(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setNodeToParentTransform(arg0); @@ -6048,7 +6048,7 @@ int lua_cocos2dx_Node_getAnchorPoint(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getAnchorPoint(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPoint",argc, 0); @@ -6266,11 +6266,11 @@ int lua_cocos2dx_Node_convertToNodeSpaceAR(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToNodeSpaceAR(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToNodeSpaceAR",argc, 1); @@ -6449,7 +6449,7 @@ int lua_cocos2dx_Node_getAnchorPointInPoints(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getAnchorPointInPoints(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPointInPoints",argc, 0); @@ -7684,7 +7684,7 @@ int lua_cocos2dx_Node_getParentToNodeTransform(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Mat4& ret = cobj->getParentToNodeTransform(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4&)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getParentToNodeTransform",argc, 0); @@ -8554,7 +8554,7 @@ int lua_cocos2dx_Node_draw(lua_State* tolua_S) if (!ok) { break; } cocos2d::Mat4 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); + ok &= luaval_to_mat4(tolua_S, 3, &arg1); if (!ok) { break; } bool arg2; @@ -8701,7 +8701,7 @@ int lua_cocos2dx_Node_setPosition3D(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); + ok &= luaval_to_vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosition3D(arg0); @@ -8837,7 +8837,7 @@ int lua_cocos2dx_Node_getWorldToNodeTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getWorldToNodeTransform(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWorldToNodeTransform",argc, 0); @@ -10616,7 +10616,7 @@ int lua_cocos2dx_Director_loadMatrix(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); + ok &= luaval_to_mat4(tolua_S, 3, &arg1); if(!ok) return 0; cobj->loadMatrix(arg0, arg1); @@ -10839,7 +10839,7 @@ int lua_cocos2dx_Director_getVisibleOrigin(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVisibleOrigin(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVisibleOrigin",argc, 0); @@ -11059,11 +11059,11 @@ int lua_cocos2dx_Director_convertToUI(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToUI(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToUI",argc, 1); @@ -11724,11 +11724,11 @@ int lua_cocos2dx_Director_convertToGL(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->convertToGL(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "convertToGL",argc, 1); @@ -12041,7 +12041,7 @@ int lua_cocos2dx_Director_getMatrix(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getMatrix(arg0); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMatrix",argc, 1); @@ -12715,7 +12715,7 @@ int lua_cocos2dx_Director_multiplyMatrix(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Mat4",&arg1); + ok &= luaval_to_mat4(tolua_S, 3, &arg1); if(!ok) return 0; cobj->multiplyMatrix(arg0, arg1); @@ -16300,7 +16300,7 @@ int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -16503,7 +16503,7 @@ int lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setOffsetInPixels(arg0); @@ -16729,7 +16729,7 @@ int lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setOffset(arg0); @@ -16776,7 +16776,7 @@ int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); @@ -16869,7 +16869,7 @@ int lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; @@ -16985,7 +16985,7 @@ int lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffsetInPixels",argc, 0); @@ -17070,7 +17070,7 @@ int lua_cocos2dx_SpriteFrame_create(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; ok &= luaval_to_size(tolua_S, 6, &arg4); @@ -17133,7 +17133,7 @@ int lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S) ok &= luaval_to_boolean(tolua_S, 4,&arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::Size arg4; ok &= luaval_to_size(tolua_S, 6, &arg4); @@ -19003,7 +19003,7 @@ int lua_cocos2dx_RotateBy_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 2,&arg0); if (!ok) { break; } cocos2d::Vec3 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec3",&arg1); + ok &= luaval_to_vec3(tolua_S, 3, &arg1); if (!ok) { break; } cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1); object_to_luaval(tolua_S, "cc.RotateBy",(cocos2d::RotateBy*)ret); @@ -19059,7 +19059,7 @@ int lua_cocos2dx_MoveBy_create(lua_State* tolua_S) double arg0; cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1); @@ -19114,7 +19114,7 @@ int lua_cocos2dx_MoveTo_create(lua_State* tolua_S) double arg0; cocos2d::Vec2 arg1; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1); @@ -19285,7 +19285,7 @@ int lua_cocos2dx_JumpBy_create(lua_State* tolua_S) double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if(!ok) @@ -19344,7 +19344,7 @@ int lua_cocos2dx_JumpTo_create(lua_State* tolua_S) double arg2; int arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if(!ok) @@ -20439,7 +20439,7 @@ int lua_cocos2dx_ActionCamera_setEye(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec3 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); + ok &= luaval_to_vec3(tolua_S, 2, &arg0); if (!ok) { break; } cobj->setEye(arg0); @@ -20488,7 +20488,7 @@ int lua_cocos2dx_ActionCamera_getEye(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getEye(); - object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); + vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getEye",argc, 0); @@ -20531,7 +20531,7 @@ int lua_cocos2dx_ActionCamera_setUp(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); + ok &= luaval_to_vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setUp(arg0); @@ -20578,7 +20578,7 @@ int lua_cocos2dx_ActionCamera_getCenter(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getCenter(); - object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); + vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCenter",argc, 0); @@ -20621,7 +20621,7 @@ int lua_cocos2dx_ActionCamera_setCenter(lua_State* tolua_S) { cocos2d::Vec3 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec3",&arg0); + ok &= luaval_to_vec3(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setCenter(arg0); @@ -20668,7 +20668,7 @@ int lua_cocos2dx_ActionCamera_getUp(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec3& ret = cobj->getUp(); - object_to_luaval(tolua_S, "cc.Vec3",(cocos2d::Vec3&)ret); + vec3_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getUp",argc, 0); @@ -24066,7 +24066,7 @@ int lua_cocos2dx_Place_create(lua_State* tolua_S) if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Place* ret = cocos2d::Place::create(arg0); @@ -24931,7 +24931,7 @@ int lua_cocos2dx_Lens3D_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -25070,7 +25070,7 @@ int lua_cocos2dx_Lens3D_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -25150,7 +25150,7 @@ int lua_cocos2dx_Lens3D_create(lua_State* tolua_S) double arg3; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) return 0; @@ -25401,7 +25401,7 @@ int lua_cocos2dx_Ripple3D_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -25448,7 +25448,7 @@ int lua_cocos2dx_Ripple3D_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -25486,7 +25486,7 @@ int lua_cocos2dx_Ripple3D_create(lua_State* tolua_S) double arg5; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); ok &= luaval_to_uint32(tolua_S, 6,&arg4); ok &= luaval_to_number(tolua_S, 7,&arg5); @@ -26289,7 +26289,7 @@ int lua_cocos2dx_Twirl_setPosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosition(arg0); @@ -26336,7 +26336,7 @@ int lua_cocos2dx_Twirl_getPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -26373,7 +26373,7 @@ int lua_cocos2dx_Twirl_create(lua_State* tolua_S) double arg4; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); ok &= luaval_to_uint32(tolua_S, 5,&arg3); ok &= luaval_to_number(tolua_S, 6,&arg4); if(!ok) @@ -26732,7 +26732,7 @@ int lua_cocos2dx_ShuffleTiles_placeTile(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Tile* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); #pragma warning NO CONVERSION TO NATIVE FOR Tile*; if(!ok) @@ -26936,7 +26936,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOnTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->turnOnTile(arg0); @@ -26982,7 +26982,7 @@ int lua_cocos2dx_FadeOutTRTiles_turnOffTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->turnOffTile(arg0); @@ -27029,7 +27029,7 @@ int lua_cocos2dx_FadeOutTRTiles_transformTile(lua_State* tolua_S) cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -27242,7 +27242,7 @@ int lua_cocos2dx_FadeOutUpTiles_transformTile(lua_State* tolua_S) cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -27401,7 +27401,7 @@ int lua_cocos2dx_TurnOffTiles_turnOnTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->turnOnTile(arg0); @@ -27447,7 +27447,7 @@ int lua_cocos2dx_TurnOffTiles_turnOffTile(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->turnOffTile(arg0); @@ -28321,7 +28321,7 @@ int lua_cocos2dx_CardinalSplineTo_updatePosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->updatePosition(arg0); @@ -28674,11 +28674,11 @@ int lua_cocos2dx_DrawNode_drawQuadraticBezier(lua_State* tolua_S) unsigned int arg3; cocos2d::Color4F arg4; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); ok &= luaval_to_uint32(tolua_S, 5,&arg3); @@ -28729,7 +28729,7 @@ int lua_cocos2dx_DrawNode_onDraw(lua_State* tolua_S) cocos2d::Mat4 arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); + ok &= luaval_to_mat4(tolua_S, 2, &arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) @@ -28823,11 +28823,11 @@ int lua_cocos2dx_DrawNode_drawTriangle(lua_State* tolua_S) cocos2d::Vec2 arg2; cocos2d::Color4F arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); ok &=luaval_to_color4f(tolua_S, 5, &arg3); if(!ok) @@ -28877,7 +28877,7 @@ int lua_cocos2dx_DrawNode_drawDot(lua_State* tolua_S) double arg1; cocos2d::Color4F arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); @@ -28932,13 +28932,13 @@ int lua_cocos2dx_DrawNode_drawCubicBezier(lua_State* tolua_S) unsigned int arg4; cocos2d::Color4F arg5; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); ok &= luaval_to_uint32(tolua_S, 6,&arg4); @@ -28991,9 +28991,9 @@ int lua_cocos2dx_DrawNode_drawSegment(lua_State* tolua_S) double arg2; cocos2d::Color4F arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); @@ -30999,7 +30999,7 @@ int lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Mat4 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); + ok &= luaval_to_mat4(tolua_S, 2, &arg0); if (!ok) { break; } cobj->setUniformsForBuiltins(arg0); @@ -33605,7 +33605,7 @@ int lua_cocos2dx_Label_setBMFontFilePath(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; bool ret = cobj->setBMFontFilePath(arg0, arg1); @@ -34839,7 +34839,7 @@ int lua_cocos2dx_Label_createWithBMFont(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 3,&arg1); ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); - ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); + ok &= luaval_to_vec2(tolua_S, 6, &arg4); if(!ok) return 0; cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3, arg4); @@ -35528,7 +35528,7 @@ int lua_cocos2dx_LabelBMFont_initWithString(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); - ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); + ok &= luaval_to_vec2(tolua_S, 6, &arg4); if(!ok) return 0; bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); @@ -35678,7 +35678,7 @@ int lua_cocos2dx_LabelBMFont_setFntFile(lua_State* tolua_S) ok &= luaval_to_std_string(tolua_S, 2,&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cobj->setFntFile(arg0, arg1); @@ -35884,7 +35884,7 @@ int lua_cocos2dx_LabelBMFont_create(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3); if (!ok) { break; } cocos2d::Vec2 arg4; - ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); + ok &= luaval_to_vec2(tolua_S, 6, &arg4); if (!ok) { break; } cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4); object_to_luaval(tolua_S, "cc.LabelBMFont",(cocos2d::LabelBMFont*)ret); @@ -36409,7 +36409,7 @@ int lua_cocos2dx_LayerGradient_setVector(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setVector(arg0); @@ -36594,7 +36594,7 @@ int lua_cocos2dx_LayerGradient_getVector(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getVector(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVector",argc, 0); @@ -36838,7 +36838,7 @@ int lua_cocos2dx_LayerGradient_create(lua_State* tolua_S) ok &=luaval_to_color4b(tolua_S, 3, &arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if (!ok) { break; } cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2); object_to_luaval(tolua_S, "cc.LayerGradient",(cocos2d::LayerGradient*)ret); @@ -43429,7 +43429,7 @@ int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getOffsetPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffsetPosition",argc, 0); @@ -44589,7 +44589,7 @@ int lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setBarChangeRate(arg0); @@ -44813,7 +44813,7 @@ int lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setMidpoint(arg0); @@ -44860,7 +44860,7 @@ int lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getBarChangeRate(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBarChangeRate",argc, 0); @@ -44957,7 +44957,7 @@ int lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getMidpoint(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMidpoint",argc, 0); @@ -45773,7 +45773,7 @@ int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) cocos2d::Rect arg1; cocos2d::Rect arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_rect(tolua_S, 3, &arg1); @@ -48090,7 +48090,7 @@ int lua_cocos2dx_ParticleSystem_setPosVar(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPosVar(arg0); @@ -48725,7 +48725,7 @@ int lua_cocos2dx_ParticleSystem_getGravity(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getGravity(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGravity",argc, 0); @@ -49131,7 +49131,7 @@ int lua_cocos2dx_ParticleSystem_getPosVar(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPosVar(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosVar",argc, 0); @@ -49395,7 +49395,7 @@ int lua_cocos2dx_ParticleSystem_getSourcePosition(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getSourcePosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSourcePosition",argc, 0); @@ -49579,7 +49579,7 @@ int lua_cocos2dx_ParticleSystem_updateQuadWithParticle(lua_State* tolua_S) #pragma warning NO CONVERSION TO NATIVE FOR sParticle*; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cobj->updateQuadWithParticle(arg0, arg1); @@ -50434,7 +50434,7 @@ int lua_cocos2dx_ParticleSystem_setSourcePosition(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setSourcePosition(arg0); @@ -51294,7 +51294,7 @@ int lua_cocos2dx_ParticleSystem_setGravity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setGravity(arg0); @@ -53921,7 +53921,7 @@ int lua_cocos2dx_GridBase_getStep(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getStep(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStep",argc, 0); @@ -54007,7 +54007,7 @@ int lua_cocos2dx_GridBase_setStep(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setStep(arg0); @@ -55382,7 +55382,7 @@ int lua_cocos2dx_GLViewProtocol_getVisibleOrigin(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVisibleOrigin(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVisibleOrigin",argc, 0); @@ -58322,9 +58322,9 @@ int lua_cocos2dx_ParallaxNode_addChild(lua_State* tolua_S) ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if(!ok) return 0; cobj->addChild(arg0, arg1, arg2, arg3); @@ -58516,7 +58516,7 @@ int lua_cocos2dx_TMXObjectGroup_setPositionOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPositionOffset(arg0); @@ -58610,7 +58610,7 @@ int lua_cocos2dx_TMXObjectGroup_getPositionOffset(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPositionOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionOffset",argc, 0); @@ -60907,7 +60907,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; unsigned int ret = cobj->getTileGIDAt(arg0); @@ -60919,7 +60919,7 @@ int lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::TMXTileFlags_* arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); #pragma warning NO CONVERSION TO NATIVE FOR TMXTileFlags_*; if(!ok) @@ -60968,11 +60968,11 @@ int lua_cocos2dx_TMXLayer_getPositionAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPositionAt(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionAt",argc, 1); @@ -61376,7 +61376,7 @@ int lua_cocos2dx_TMXLayer_removeTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->removeTileAt(arg0); @@ -61516,7 +61516,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if (!ok) { break; } cocos2d::TMXTileFlags_ arg2; @@ -61535,7 +61535,7 @@ int lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S) if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if (!ok) { break; } cobj->setTileGID(arg0, arg1); @@ -61901,7 +61901,7 @@ int lua_cocos2dx_TMXLayer_getTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Sprite* ret = cobj->getTileAt(arg0); @@ -62857,7 +62857,7 @@ int lua_cocos2dx_TileMapAtlas_getTileAt(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Color3B ret = cobj->getTileAt(arg0); @@ -62907,7 +62907,7 @@ int lua_cocos2dx_TileMapAtlas_setTile(lua_State* tolua_S) ok &= luaval_to_color3b(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cobj->setTile(arg0, arg1); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp index 97d71ef5c0..673e875412 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp @@ -2028,7 +2028,7 @@ int lua_cocos2dx_extension_Control_getTouchLocation(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getTouchLocation(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchLocation",argc, 1); @@ -2508,7 +2508,7 @@ int lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setLabelAnchorPoint(arg0); @@ -2555,7 +2555,7 @@ int lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getLabelAnchorPoint(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLabelAnchorPoint",argc, 0); @@ -4174,7 +4174,7 @@ int lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(lua_State* tolu ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; bool ret = cobj->initWithTargetAndPos(arg0, arg1); @@ -4268,7 +4268,7 @@ int lua_cocos2dx_extension_ControlHuePicker_getStartPos(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartPos(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartPos",argc, 0); @@ -4615,7 +4615,7 @@ int lua_cocos2dx_extension_ControlHuePicker_create(lua_State* tolua_S) cocos2d::Node* arg0; cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); @@ -4773,7 +4773,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPo ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; bool ret = cobj->initWithTargetAndPos(arg0, arg1); @@ -4821,7 +4821,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(lua_Sta if(!ok) return 0; cocos2d::Vec2 ret = cobj->getStartPos(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getStartPos",argc, 0); @@ -5120,7 +5120,7 @@ int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create(lua_State* t cocos2d::Node* arg0; cocos2d::Vec2 arg1; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); @@ -5830,7 +5830,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(lua_State* t { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPreviousLocation(arg0); @@ -6013,13 +6013,13 @@ int lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoi cocos2d::Vec2 arg2; cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if(!ok) return 0; double ret = cobj->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(arg0, arg1, arg2, arg3); @@ -6066,7 +6066,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->potentiometerBegan(arg0); @@ -6293,7 +6293,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(lua_State* t if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPreviousLocation(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPreviousLocation",argc, 0); @@ -6337,9 +6337,9 @@ int lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(lua cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; double ret = cobj->distanceBetweenPointAndPoint(arg0, arg1); @@ -6386,7 +6386,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->potentiometerEnded(arg0); @@ -6621,7 +6621,7 @@ int lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->potentiometerMoved(arg0); @@ -6825,7 +6825,7 @@ int lua_cocos2dx_extension_ControlSlider_locationFromTouch(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "locationFromTouch",argc, 1); @@ -8251,7 +8251,7 @@ int lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(lua_Sta { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->updateLayoutUsingTouchLocation(arg0); @@ -9375,7 +9375,7 @@ int lua_cocos2dx_extension_ControlSwitch_locationFromTouch(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->locationFromTouch(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "locationFromTouch",argc, 1); @@ -9691,7 +9691,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration(lua_State* tolu cocos2d::Vec2 arg0; double arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); if(!ok) @@ -10255,7 +10255,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setContentOffset(arg0); @@ -10266,7 +10266,7 @@ int lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S) cocos2d::Vec2 arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) @@ -10542,7 +10542,7 @@ int lua_cocos2dx_extension_ScrollView_getContentOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getContentOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getContentOffset",argc, 0); @@ -10817,7 +10817,7 @@ int lua_cocos2dx_extension_ScrollView_maxContainerOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->maxContainerOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "maxContainerOffset",argc, 0); @@ -11002,7 +11002,7 @@ int lua_cocos2dx_extension_ScrollView_minContainerOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->minContainerOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "minContainerOffset",argc, 0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index f0d527be73..cf3d79938c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -36,7 +36,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGravity(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGravity",argc, 0); @@ -123,7 +123,7 @@ int lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setGravity(arg0); @@ -415,7 +415,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vector ret = cobj->getShapes(arg0); @@ -515,7 +515,7 @@ int lua_cocos2dx_physics_PhysicsWorld_getShape(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::PhysicsShape* ret = cobj->getShape(arg0); @@ -1337,7 +1337,7 @@ int lua_cocos2dx_physics_PhysicsShape_containsPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; bool ret = cobj->containsPoint(arg0); @@ -1517,7 +1517,7 @@ int lua_cocos2dx_physics_PhysicsShape_getCenter(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getCenter(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getCenter",argc, 0); @@ -1829,7 +1829,7 @@ int lua_cocos2dx_physics_PhysicsShape_getOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOffset",argc, 0); @@ -2296,7 +2296,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_create(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsShapeCircle* ret = cocos2d::PhysicsShapeCircle::create(arg0, arg1, arg2); @@ -2378,7 +2378,7 @@ int lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; double ret = cocos2d::PhysicsShapeCircle::calculateMoment(arg0, arg1, arg2); @@ -2548,7 +2548,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_create(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsShapeBox* ret = cocos2d::PhysicsShapeBox::create(arg0, arg1, arg2); @@ -2630,7 +2630,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_size(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; double ret = cocos2d::PhysicsShapeBox::calculateMoment(arg0, arg1, arg2); @@ -2747,7 +2747,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPoint(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoint",argc, 1); @@ -2812,7 +2812,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPointB(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPointB",argc, 0); @@ -2856,7 +2856,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPointA(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPointA",argc, 0); @@ -2888,8 +2888,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) { cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::PhysicsShapeEdgeSegment* ret = cocos2d::PhysicsShapeEdgeSegment::create(arg0, arg1); @@ -2901,8 +2901,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); if(!ok) return 0; @@ -2916,8 +2916,8 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S) cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) @@ -3060,7 +3060,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_create(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if(!ok) return 0; cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0, arg1, arg2, arg3); @@ -3645,11 +3645,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if (!ok) { break; } cobj->applyImpulse(arg0, arg1); @@ -3660,7 +3660,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } cobj->applyImpulse(arg0); @@ -3748,11 +3748,11 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) do{ if (argc == 2) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if (!ok) { break; } cobj->applyForce(arg0, arg1); @@ -3763,7 +3763,7 @@ int lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } cobj->applyForce(arg0); @@ -4009,7 +4009,7 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocity(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocity(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocity",argc, 0); @@ -4288,7 +4288,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPositionOffset(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPositionOffset(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionOffset",argc, 0); @@ -4466,7 +4466,7 @@ int lua_cocos2dx_physics_PhysicsBody_getPosition(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPosition",argc, 0); @@ -4735,11 +4735,11 @@ int lua_cocos2dx_physics_PhysicsBody_local2World(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->local2World(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "local2World",argc, 1); @@ -5050,11 +5050,11 @@ int lua_cocos2dx_physics_PhysicsBody_world2Local(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->world2Local(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "world2Local",argc, 1); @@ -5316,7 +5316,7 @@ int lua_cocos2dx_physics_PhysicsBody_setVelocity(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setVelocity(arg0); @@ -5454,7 +5454,7 @@ int lua_cocos2dx_physics_PhysicsBody_setPositionOffset(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPositionOffset(arg0); @@ -5634,11 +5634,11 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocityAtLocalPoint(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocityAtLocalPoint",argc, 1); @@ -5864,11 +5864,11 @@ int lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cocos2d::Vec2 ret = cobj->getVelocityAtWorldPoint(arg0); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getVelocityAtWorldPoint",argc, 1); @@ -6102,7 +6102,7 @@ int lua_cocos2dx_physics_PhysicsBody_createBox(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createBox(arg0, arg1, arg2); @@ -6136,8 +6136,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) { cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeSegment(arg0, arg1); @@ -6149,8 +6149,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) cocos2d::Vec2 arg0; cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); if(!ok) return 0; @@ -6164,8 +6164,8 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S) cocos2d::Vec2 arg1; cocos2d::PhysicsMaterial arg2; double arg3; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); - ok &= luaval_to_object(tolua_S, 3, "cc.Vec2",&arg1); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_vec2(tolua_S, 3, &arg1); ok &= luaval_to_physics_material(tolua_S, 4, &arg2); ok &= luaval_to_number(tolua_S, 5,&arg3); if(!ok) @@ -6303,7 +6303,7 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeBox(lua_State* tolua_S) ok &= luaval_to_size(tolua_S, 2, &arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); ok &= luaval_to_number(tolua_S, 4,&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0, arg1, arg2, arg3); @@ -6362,7 +6362,7 @@ int lua_cocos2dx_physics_PhysicsBody_createCircle(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_number(tolua_S, 2,&arg0); ok &= luaval_to_physics_material(tolua_S, 3, &arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createCircle(arg0, arg1, arg2); @@ -6914,7 +6914,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity(lua_State* to if(!ok) return 0; cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSurfaceVelocity",argc, 0); @@ -6957,7 +6957,7 @@ int lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity(lua_State* to { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setSurfaceVelocity(arg0); @@ -7120,7 +7120,7 @@ int lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity(lua_State* t if(!ok) return 0; cocos2d::Vec2 ret = cobj->getSurfaceVelocity(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSurfaceVelocity",argc, 0); @@ -8187,7 +8187,7 @@ int lua_cocos2dx_physics_PhysicsJointFixed_construct(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsJointFixed* ret = cocos2d::PhysicsJointFixed::construct(arg0, arg1, arg2); @@ -8252,7 +8252,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -8298,7 +8298,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchr1(arg0); @@ -8391,7 +8391,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -8435,7 +8435,7 @@ int lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr1(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr1",argc, 0); @@ -8607,10 +8607,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } double arg4; ok &= luaval_to_number(tolua_S, 6,&arg4); @@ -8635,10 +8635,10 @@ int lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); if (!ok) { break; } cocos2d::Vec2 arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if (!ok) { break; } cocos2d::Vec2 arg3; - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if (!ok) { break; } cocos2d::PhysicsJointLimit* ret = cocos2d::PhysicsJointLimit::construct(arg0, arg1, arg2, arg3); object_to_luaval(tolua_S, "cc.PhysicsJointLimit",(cocos2d::PhysicsJointLimit*)ret); @@ -8704,7 +8704,7 @@ int lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S) cocos2d::Vec2 arg2; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cocos2d::PhysicsJointPin* ret = cocos2d::PhysicsJointPin::construct(arg0, arg1, arg2); @@ -8852,8 +8852,8 @@ int lua_cocos2dx_physics_PhysicsJointDistance_construct(lua_State* tolua_S) cocos2d::Vec2 arg3; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); if(!ok) return 0; cocos2d::PhysicsJointDistance* ret = cocos2d::PhysicsJointDistance::construct(arg0, arg1, arg2, arg3); @@ -8920,7 +8920,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -8966,7 +8966,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchr1(arg0); @@ -9147,7 +9147,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -9191,7 +9191,7 @@ int lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr1(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr1",argc, 0); @@ -9365,8 +9365,8 @@ int lua_cocos2dx_physics_PhysicsJointSpring_construct(lua_State* tolua_S) double arg5; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); ok &= luaval_to_number(tolua_S, 6,&arg4); ok &= luaval_to_number(tolua_S, 7,&arg5); if(!ok) @@ -9443,7 +9443,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchr2(arg0); @@ -9489,7 +9489,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setGrooveA(arg0); @@ -9535,7 +9535,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setGrooveB(arg0); @@ -9582,7 +9582,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGrooveA(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGrooveA",argc, 0); @@ -9626,7 +9626,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getGrooveB(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getGrooveB",argc, 0); @@ -9670,7 +9670,7 @@ int lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchr2(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchr2",argc, 0); @@ -9707,9 +9707,9 @@ int lua_cocos2dx_physics_PhysicsJointGroove_construct(lua_State* tolua_S) cocos2d::Vec2 arg4; ok &= luaval_to_object(tolua_S, 2, "cc.PhysicsBody",&arg0); ok &= luaval_to_object(tolua_S, 3, "cc.PhysicsBody",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Vec2",&arg3); - ok &= luaval_to_object(tolua_S, 6, "cc.Vec2",&arg4); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); + ok &= luaval_to_vec2(tolua_S, 5, &arg3); + ok &= luaval_to_vec2(tolua_S, 6, &arg4); if(!ok) return 0; cocos2d::PhysicsJointGroove* ret = cocos2d::PhysicsJointGroove::construct(arg0, arg1, arg2, arg3, arg4); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp index d130ae9500..e41bcee980 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp @@ -125,7 +125,7 @@ int lua_cocos2dx_spine_Skeleton_onDraw(lua_State* tolua_S) cocos2d::Mat4 arg0; bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Mat4",&arg0); + ok &= luaval_to_mat4(tolua_S, 2, &arg0); ok &= luaval_to_boolean(tolua_S, 3,&arg1); if(!ok) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp index e7b3ad85e2..be3c27cf08 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -3028,7 +3028,7 @@ int lua_cocos2dx_studio_ContourData_addVertex(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->addVertex(arg0); @@ -3814,7 +3814,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(lua_State* tolua_S if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchorPointInPoints(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPointInPoints",argc, 0); @@ -4199,7 +4199,7 @@ int lua_cocos2dx_studio_DisplayManager_containPoint(lua_State* tolua_S) do{ if (argc == 1) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if (!ok) { break; } bool ret = cobj->containPoint(arg0); @@ -4435,7 +4435,7 @@ int lua_cocos2dx_studio_DisplayManager_getAnchorPoint(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getAnchorPoint(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getAnchorPoint",argc, 0); @@ -6052,7 +6052,7 @@ int lua_cocos2dx_studio_Bone_getNodeToArmatureTransform(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToArmatureTransform(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToArmatureTransform",argc, 0); @@ -9616,7 +9616,7 @@ int lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR(lua_State* tolua_S) if(!ok) return 0; cocos2d::Mat4 ret = cobj->getNodeToWorldTransformAR(); - object_to_luaval(tolua_S, "cc.Mat4",(cocos2d::Mat4)ret); + mat4_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getNodeToWorldTransformAR",argc, 0); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 399b2caba4..f9773df6f5 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -843,7 +843,7 @@ int lua_cocos2dx_ui_Widget_setSizePercent(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setSizePercent(arg0); @@ -1070,7 +1070,7 @@ int lua_cocos2dx_ui_Widget_getTouchEndPos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchEndPos(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchEndPos",argc, 0); @@ -1113,7 +1113,7 @@ int lua_cocos2dx_ui_Widget_setPositionPercent(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setPositionPercent(arg0); @@ -1880,7 +1880,7 @@ int lua_cocos2dx_ui_Widget_getWorldPosition(lua_State* tolua_S) if(!ok) return 0; cocos2d::Vec2 ret = cobj->getWorldPosition(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWorldPosition",argc, 0); @@ -2060,7 +2060,7 @@ int lua_cocos2dx_ui_Widget_getTouchMovePos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchMovePos(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchMovePos",argc, 0); @@ -2332,7 +2332,7 @@ int lua_cocos2dx_ui_Widget_getSizePercent(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getSizePercent(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSizePercent",argc, 0); @@ -2376,7 +2376,7 @@ int lua_cocos2dx_ui_Widget_getTouchStartPos(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getTouchStartPos(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTouchStartPos",argc, 0); @@ -2555,7 +2555,7 @@ int lua_cocos2dx_ui_Widget_clippingParentAreaContainPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; bool ret = cobj->clippingParentAreaContainPoint(arg0); @@ -3014,7 +3014,7 @@ int lua_cocos2dx_ui_Widget_getPositionPercent(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getPositionPercent(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionPercent",argc, 0); @@ -3057,7 +3057,7 @@ int lua_cocos2dx_ui_Widget_hitTest(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; bool ret = cobj->hitTest(arg0); @@ -3244,7 +3244,7 @@ int lua_cocos2dx_ui_Widget_checkChildInfo(lua_State* tolua_S) ok &= luaval_to_object(tolua_S, 3, "ccui.Widget",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2); + ok &= luaval_to_vec2(tolua_S, 4, &arg2); if(!ok) return 0; cobj->checkChildInfo(arg0, arg1, arg2); @@ -3569,7 +3569,7 @@ int lua_cocos2dx_ui_Layout_setBackGroundColorVector(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setBackGroundColorVector(arg0); @@ -3800,7 +3800,7 @@ int lua_cocos2dx_ui_Layout_getBackGroundColorVector(lua_State* tolua_S) if(!ok) return 0; const cocos2d::Vec2& ret = cobj->getBackGroundColorVector(); - object_to_luaval(tolua_S, "cc.Vec2",(cocos2d::Vec2&)ret); + vec2_to_luaval(tolua_S, ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getBackGroundColorVector",argc, 0); @@ -9578,7 +9578,7 @@ int lua_cocos2dx_ui_ScrollView_scrollToPercentBothDirection(lua_State* tolua_S) double arg1; bool arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); ok &= luaval_to_number(tolua_S, 3,&arg1); @@ -10535,7 +10535,7 @@ int lua_cocos2dx_ui_ScrollView_jumpToPercentBothDirection(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->jumpToPercentBothDirection(arg0); @@ -14327,7 +14327,7 @@ int lua_cocos2dx_ui_TextField_hitTest(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; bool ret = cobj->hitTest(arg0); @@ -16390,7 +16390,7 @@ int lua_cocos2dx_ui_RichText_setAnchorPoint(lua_State* tolua_S) { cocos2d::Vec2 arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Vec2",&arg0); + ok &= luaval_to_vec2(tolua_S, 2, &arg0); if(!ok) return 0; cobj->setAnchorPoint(arg0); From 96a93260263453c46231b7e330d1a1f804225e45 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Thu, 15 May 2014 16:50:53 +0800 Subject: [PATCH 086/125] [ci skip], modify build-job termination time. --- tools/jenkins-scripts/watchdog.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/jenkins-scripts/watchdog.py b/tools/jenkins-scripts/watchdog.py index 933a6a0ae6..08e5b31668 100644 --- a/tools/jenkins-scripts/watchdog.py +++ b/tools/jenkins-scripts/watchdog.py @@ -4,6 +4,13 @@ import sys import time import os +def interval_time(time1, time2): + arr1 = str(time1).split(':') + arr2 = str(time2).split(':') + hour = int(arr1[0]) - int(arr2[0]) + minute = int(arr1[1]) - int(arr2[1]) + return hour*60+minute + #check & kill dead buid def build_time(_job,_threshold): #get jenkins-job-watchdog-threshold @@ -18,17 +25,15 @@ def build_time(_job,_threshold): buildnu = _job.get_last_buildnumber() print "buildnumber:#",buildnu #get nowtime - nowtime = time.strftime('%M',time.localtime(time.time())) - #print 'nowtime:',nowtime + nowtime = time.strftime('%H:%M',time.localtime(time.time())) + print 'nowtime:', nowtime #get build start time - timeb = build.get_timestamp() - #print 'buildtime:',str(timeb)[14:16] - buildtime = int(str(timeb)[14:16]) - subtime = 0 - if int(nowtime) >= buildtime: - subtime = int(nowtime)-buildtime - else: - subtime = 60-buildtime+int(nowtime) + timestamp = build._poll()['timestamp'] + timeb = time.ctime(timestamp/1000) + buildtime = str(timeb)[11:16] + print 'buildtime:', buildtime + subtime = interval_time(nowtime, buildtime) + print 'subtime:', subtime, _threshold if subtime > _threshold: #print 'subtime',subtime #kill dead buid From cde4e4811b67bb9e997922f56567926a06bd108b Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 15 May 2014 16:54:55 +0800 Subject: [PATCH 087/125] Update some GuiConstants and resubmission pr#6361. --- .../manual/lua_cocos2dx_manual.cpp | 80 ++++++++++--------- .../lua-bindings/script/DeprecatedEnum.lua | 9 +-- .../lua-bindings/script/GuiConstants.lua | 7 +- .../CocoStudioArmatureTest.lua | 2 +- .../CocoStudioGUITest/CocoStudioGUITest.lua | 4 +- 5 files changed, 55 insertions(+), 47 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index d4c924e57d..9e765728f1 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -34,9 +34,9 @@ static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S) { - if (NULL == tolua_S) + if (nullptr == tolua_S) return 0; - + int argc = 0; bool ok = true; @@ -58,49 +58,53 @@ static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S) } } while (0); do { + if (argc == 2) + { #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(tolua_S,2,0,&tolua_err) || - !tolua_isstring(tolua_S,3,0,&tolua_err)) - { - ok = false; - } -#endif - if (!ok) - { - ok = true; - break; + if (!tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isstring(tolua_S,3,0,&tolua_err)) + { + ok = false; + } +#endif + if (!ok) + { + ok = true; + break; + } + const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage"); + return 1; } - const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0)); - MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage); - int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; - int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; - toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage"); - return 1; - } while (0); do { -#if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(tolua_S,2,0,&tolua_err) || - !tolua_isstring(tolua_S,3,0,&tolua_err) || - !tolua_isstring(tolua_S,4,0,&tolua_err) ) + if (argc == 3) { - goto tolua_lerror; - break; - } +#if COCOS2D_DEBUG >= 1 + if (!tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isstring(tolua_S,3,0,&tolua_err) || + !tolua_isstring(tolua_S,4,0,&tolua_err) ) + { + goto tolua_lerror; + break; + } #endif - const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0)); - const std::string disabledImage = ((const std::string) tolua_tocppstring(tolua_S,4,0)); - - MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage,disabledImage); - int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; - int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; - toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage"); - return 1; - + const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const std::string disabledImage = ((const std::string) tolua_tocppstring(tolua_S,4,0)); + + MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage,disabledImage); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage"); + return 1; + } } while (0); - + CCLOG("'create' has wrong number of arguments: %d, was expecting %d\n", argc, 0); return 0; diff --git a/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua b/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua index f27bf8ea92..f10e52a4cd 100644 --- a/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua +++ b/cocos/scripting/lua-bindings/script/DeprecatedEnum.lua @@ -487,9 +487,8 @@ ccui.LoadingBarType = ccui.LoadingBarDirection ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT -ccui.LayoutType = ccui.Type -ccui.LayoutType.absolute = ccui.Type.ABSOLUTE -ccui.LayoutType.linearVertical = ccui.Type.VERTICAL -ccui.LayoutType.linearHorizontal = ccui.Type.HORIZONTAL -ccui.LayoutType.relative = ccui.Type.RELATIVE +ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE +ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL +ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL +ccui.LayoutType.relative = ccui.LayoutType.RELATIVE diff --git a/cocos/scripting/lua-bindings/script/GuiConstants.lua b/cocos/scripting/lua-bindings/script/GuiConstants.lua index 6fea411a49..e322d3bfaf 100644 --- a/cocos/scripting/lua-bindings/script/GuiConstants.lua +++ b/cocos/scripting/lua-bindings/script/GuiConstants.lua @@ -53,7 +53,7 @@ ccui.LayoutBackGroundColorType = gradient = 2, } -ccui.Type = +ccui.LayoutType = { ABSOLUTE = 0, VERTICAL = 1, @@ -171,3 +171,8 @@ ccui.ListViewGravity = { bottom = 4 , centerVertical = 5, } + +ccui.TextType = { + SYSTEM = 0, + TTF = 1, +} diff --git a/tests/lua-tests/src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua b/tests/lua-tests/src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua index fe41ca0d9c..7a60bda075 100644 --- a/tests/lua-tests/src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua +++ b/tests/lua-tests/src/CocoStudioTest/CocoStudioArmatureTest/CocoStudioArmatureTest.lua @@ -270,7 +270,7 @@ function TestAsynchronousLoading:onEnter() end function TestAsynchronousLoading.restartCallback() - ccs.ArmatureDataManager:destoryInstance() + ccs.ArmatureDataManager:destroyInstance() local newScene = ArmatureTestScene.create() newScene:addChild(restartArmatureTest()) cc.Director:getInstance():replaceScene(newScene) diff --git a/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua b/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua index d12e7d5370..e5d2dc1b89 100644 --- a/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua +++ b/tests/lua-tests/src/CocoStudioTest/CocoStudioGUITest/CocoStudioGUITest.lua @@ -1982,7 +1982,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend() local background = root:getChildByName("background_Panel") local layout = ccui.Layout:create() - layout:setLayoutType(ccui.Type.VERTICAL) + layout:setLayoutType(ccui.LayoutType.VERTICAL) layout:setSize(cc.size(280, 150)) local backgroundSize = background:getContentSize() layout:setPosition(cc.p((widgetSize.width - backgroundSize.width) / 2 + @@ -2065,7 +2065,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend() local background = root:getChildByName("background_Panel") local layout = ccui.Layout:create() - layout:setLayoutType(ccui.Type.HORIZONTAL) + layout:setLayoutType(ccui.LayoutType.HORIZONTAL) layout:setClippingEnabled(true) layout:setSize(cc.size(280, 150)) local backgroundSize = background:getContentSize() From 2a93fdaaa645cd34161501206aea1db702c103bb Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Thu, 15 May 2014 17:27:23 +0800 Subject: [PATCH 088/125] modify build terminal time in watchdog.py.[ci skip] --- tools/jenkins-scripts/watchdog.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tools/jenkins-scripts/watchdog.py b/tools/jenkins-scripts/watchdog.py index 08e5b31668..99c2e7447f 100644 --- a/tools/jenkins-scripts/watchdog.py +++ b/tools/jenkins-scripts/watchdog.py @@ -4,13 +4,6 @@ import sys import time import os -def interval_time(time1, time2): - arr1 = str(time1).split(':') - arr2 = str(time2).split(':') - hour = int(arr1[0]) - int(arr2[0]) - minute = int(arr1[1]) - int(arr2[1]) - return hour*60+minute - #check & kill dead buid def build_time(_job,_threshold): #get jenkins-job-watchdog-threshold @@ -25,14 +18,13 @@ def build_time(_job,_threshold): buildnu = _job.get_last_buildnumber() print "buildnumber:#",buildnu #get nowtime - nowtime = time.strftime('%H:%M',time.localtime(time.time())) - print 'nowtime:', nowtime + nowtime = int(time.time()) + print 'nowtime:', time.ctime(nowtime) #get build start time timestamp = build._poll()['timestamp'] - timeb = time.ctime(timestamp/1000) - buildtime = str(timeb)[11:16] - print 'buildtime:', buildtime - subtime = interval_time(nowtime, buildtime) + buildtime = int(timestamp)/1000 + print 'buildtime:', time.ctime(buildtime) + subtime = (nowtime - buildtime)/60 print 'subtime:', subtime, _threshold if subtime > _threshold: #print 'subtime',subtime From 14639d812e88ba3a6c63112343f1b21c66c2fcfc Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 15 May 2014 18:29:54 +0800 Subject: [PATCH 089/125] Update config.gitingore --- tools/travis-scripts/config.gitingore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/travis-scripts/config.gitingore b/tools/travis-scripts/config.gitingore index f3a4b10172..0ed4ff65e4 100644 --- a/tools/travis-scripts/config.gitingore +++ b/tools/travis-scripts/config.gitingore @@ -113,3 +113,6 @@ tags !/tools/cocos2d-console/console/bin/ !/plugin-x/plugin-x_ios.xcworkspace/ !/cocos/2d/platform/android/java/res/ + +v*-deps-*.zip +v*-lua-runtime-*.zip From b9562e5dbf8e8e5a031272aed7b5c945b0381a5e Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 15 May 2014 10:30:59 +0000 Subject: [PATCH 090/125] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 64a28a9138..6d263bef04 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -3474,9 +3474,7 @@ "plugin/tools/toolsForPublish/checkEnvironment.sh", "plugin/tools/toolsForPublish/genPrebuildMK.sh", "plugin/tools/toolsForPublish/publishPlugin.sh", - "tools/particle/convert_YCoordFlipped.py", - "v3-deps-1.zip", - "v3-lua-runtime-1.zip" + "tools/particle/convert_YCoordFlipped.py" ], "lua": [ "cocos/scripting/lua-bindings/Android.mk", From a8c21dcf9f70c608075b45b0107d5bff9f84b4e0 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 15 May 2014 19:59:51 +0800 Subject: [PATCH 091/125] [ci skip] --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 8fab47a55a..a64d7c52c7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -850,6 +850,9 @@ Developers: myourys Make cpp template support Eclipse c++ project + + NatWeiss + Fix compilation error using arch i386 Retired Core Developers: WenSheng Yang From 71d3decbe2017842283604fdd3f58866c8f2bb5d Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Thu, 15 May 2014 20:49:20 +0400 Subject: [PATCH 092/125] [NEW]: added pure reference synthesizer --- cocos/base/CCPlatformMacros.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/base/CCPlatformMacros.h b/cocos/base/CCPlatformMacros.h index 4d7c837ff2..c13e1eab62 100644 --- a/cocos/base/CCPlatformMacros.h +++ b/cocos/base/CCPlatformMacros.h @@ -164,6 +164,10 @@ public: virtual varType get##funName(void) const { return varName; } protected: varType varName;\ public: virtual const varType& get##funName(void) const { return varName; } +#define CC_SYNTHESIZE_READONLY_PURE_REF(varType, varName, funName)\ +protected: varType varName;\ +public: virtual varType& get##funName(void) { return varName; } + /** CC_SYNTHESIZE is used to declare a protected variable. We can use getter to read the variable, and use the setter to change the variable. @param varType the type of variable. From e5494cd9e55e3d93845506d74902c981de2cd44f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 15 May 2014 12:58:13 -0700 Subject: [PATCH 093/125] multiple pass sprite on ShaderSprite2.cpp --- .../Classes/ShaderTest/ShaderTest2.cpp | 80 +++++++++++++++++-- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 77178ef72d..a697277c78 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -27,6 +27,7 @@ #include "ShaderTest.h" #include "../testResource.h" #include "cocos2d.h" +#include namespace ShaderTest2 { @@ -108,6 +109,11 @@ void ShaderTestScene2::runThisTest() // // EffectSprite // +static int tuple_sort( const std::tuple &tuple1, const std::tuple &tuple2 ) +{ + return std::get<0>(tuple1) < std::get<0>(tuple2); +} + class Effect; class EffectSprite : public Sprite { @@ -122,19 +128,73 @@ public: return nullptr; } - void setEffect(Effect *effect) { - if(_effect != effect) { + void setEffect(Effect* effect) { + if(_defaultEffect != effect) { effect->setTarget(this); - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - setGLProgramState(_effect->getGLProgramState()); + CC_SAFE_RELEASE(_defaultEffect); + _defaultEffect = effect; + CC_SAFE_RETAIN(_defaultEffect); + + setGLProgramState(_defaultEffect->getGLProgramState()); + } + } + void addEffect(Effect *effect, ssize_t order) { + effect->retain(); + effect->setTarget(this); + + _effects.push_back(std::make_tuple(order,effect,QuadCommand())); + + std::sort(std::begin(_effects), std::end(_effects), tuple_sort); + } + + void draw(Renderer *renderer, const Mat4 &transform, bool transformUpdated) override + { + // Don't do calculate the culling if the transform was not updated + _insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; + + if(_insideBounds) + { + // negative effects: order < 0 + int idx=0; + for(auto &effect : _effects) { + + if(std::get<0>(effect) >=0) + break; + QuadCommand &q = std::get<2>(effect); + q.init(_globalZOrder, _texture->getName(), std::get<1>(effect)->getGLProgramState(), _blendFunc, &_quad, 1, transform); + renderer->addCommand(&q); + idx++; + + } + + // normal effect: order == 0 + _quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, transform); + renderer->addCommand(&_quadCommand); + + // postive effects: oder >= 0 + for(auto it = std::begin(_effects)+idx; it != std::end(_effects); ++it) { + QuadCommand &q = std::get<2>(*it); + q.init(_globalZOrder, _texture->getName(), std::get<1>(*it)->getGLProgramState(), _blendFunc, &_quad, 1, transform); + renderer->addCommand(&q); + idx++; + } } } protected: - EffectSprite() : _effect(nullptr) {} - Effect *_effect; + EffectSprite() : _defaultEffect(nullptr) + { + _effects.reserve(2); + } + ~EffectSprite() { + for(auto &tuple : _effects) { + std::get<1>(tuple)->release(); + } + CC_SAFE_RELEASE(_defaultEffect); + } + + std::vector> _effects; + Effect* _defaultEffect; }; // @@ -436,6 +496,10 @@ EffectSpriteTest::EffectSpriteTest() _vectorIndex = 0; _sprite->setEffect( _effects.at(_vectorIndex) ); + +// _sprite->addEffect( _effects.at(8), -10 ); +// _sprite->addEffect( _effects.at(1), 1 ); + } } From 9d1ab1ba078af3d14c4a789049dd75036c86da76 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 15 May 2014 16:45:46 -0700 Subject: [PATCH 094/125] uniform sampler CC_Texture0 MUST NOT be defined on shaders since it is a built-in. Built-in uniforms MUST NOT be defined on shaders. Basically all CC_ uniforms must be defined by cocos2d-x --- CHANGELOG | 1 + cocos/renderer/CCGLProgram.cpp | 4 ++ cocos/renderer/ccShader_Label_df.frag | 3 +- cocos/renderer/ccShader_Label_df_glow.frag | 1 - cocos/renderer/ccShader_Label_normal.frag | 1 - cocos/renderer/ccShader_Label_outline.frag | 1 - cocos/renderer/ccShader_PositionTexture.frag | 1 - .../ccShader_PositionTextureA8Color.frag | 1 - .../ccShader_PositionTextureColor.frag | 1 - ...cShader_PositionTextureColorAlphaTest.frag | 1 - .../ccShader_PositionTextureColor_noMVP.frag | 1 - .../ccShader_PositionTexture_uColor.frag | 2 - .../Classes/ShaderTest/ShaderTest.cpp | 49 +++++++++++++++++-- .../cpp-tests/Classes/ShaderTest/ShaderTest.h | 4 ++ .../Resources/Shaders/example_Blur.fsh | 2 - .../Resources/Shaders/example_ColorBars.fsh | 1 - .../Shaders/example_HorizontalColor.fsh | 1 - .../Shaders/example_MultiTexture.fsh | 9 ++-- .../Resources/Shaders/example_Noisy.fsh | 1 - .../Resources/Shaders/example_bloom.fsh | 1 - .../Resources/Shaders/example_celShading.fsh | 2 - .../Shaders/example_edgeDetection.fsh | 1 - .../Resources/Shaders/example_greyScale.fsh | 2 - .../Resources/Shaders/example_lensFlare.fsh | 1 - .../Resources/Shaders/example_normal.fsh | 2 - .../Resources/Shaders/example_outline.fsh | 2 - .../Resources/Shaders/example_sepia.fsh | 2 - 27 files changed, 59 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d648220e7c..a45554b14f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ cocos2d-x-3.1-rc0 May.16 2014 [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 + [FIX] GLProgram: uniform CC_Texture0 is pre-defined by cocos2d. MUST NOT be defined in shaders [FIX] GLProgramState: Supports multitexturing [FIX] Studio:ActionObject: correct TotalTime of ActionObject diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index fb4d42e334..8d43154f2c 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -398,6 +398,10 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source "uniform vec4 CC_SinTime;\n" "uniform vec4 CC_CosTime;\n" "uniform vec4 CC_Random01;\n" + "uniform sampler2D CC_Texture0;\n" + "uniform sampler2D CC_Texture1;\n" + "uniform sampler2D CC_Texture2;\n" + "uniform sampler2D CC_Texture3;\n" "//CC INCLUDES END\n\n", source, }; diff --git a/cocos/renderer/ccShader_Label_df.frag b/cocos/renderer/ccShader_Label_df.frag index 5d4c4cce2a..56b1beed9e 100644 --- a/cocos/renderer/ccShader_Label_df.frag +++ b/cocos/renderer/ccShader_Label_df.frag @@ -6,8 +6,7 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; -uniform vec4 v_textColor; +uniform vec4 v_textColor; void main() { diff --git a/cocos/renderer/ccShader_Label_df_glow.frag b/cocos/renderer/ccShader_Label_df_glow.frag index 6b5c37c346..51eaed548d 100644 --- a/cocos/renderer/ccShader_Label_df_glow.frag +++ b/cocos/renderer/ccShader_Label_df_glow.frag @@ -6,7 +6,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; uniform vec4 v_effectColor; uniform vec4 v_textColor; diff --git a/cocos/renderer/ccShader_Label_normal.frag b/cocos/renderer/ccShader_Label_normal.frag index df527aa4a6..6034615401 100644 --- a/cocos/renderer/ccShader_Label_normal.frag +++ b/cocos/renderer/ccShader_Label_normal.frag @@ -30,7 +30,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; uniform vec4 v_textColor; void main() diff --git a/cocos/renderer/ccShader_Label_outline.frag b/cocos/renderer/ccShader_Label_outline.frag index 1dbd0010f0..958d716802 100644 --- a/cocos/renderer/ccShader_Label_outline.frag +++ b/cocos/renderer/ccShader_Label_outline.frag @@ -8,7 +8,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; uniform vec4 v_effectColor; uniform vec4 v_textColor; diff --git a/cocos/renderer/ccShader_PositionTexture.frag b/cocos/renderer/ccShader_PositionTexture.frag index b6bef35075..6cf04c3952 100644 --- a/cocos/renderer/ccShader_PositionTexture.frag +++ b/cocos/renderer/ccShader_PositionTexture.frag @@ -30,7 +30,6 @@ precision lowp float; \n#endif\n varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; void main() { diff --git a/cocos/renderer/ccShader_PositionTextureA8Color.frag b/cocos/renderer/ccShader_PositionTextureA8Color.frag index e393b97f77..f25c223707 100644 --- a/cocos/renderer/ccShader_PositionTextureA8Color.frag +++ b/cocos/renderer/ccShader_PositionTextureA8Color.frag @@ -31,7 +31,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; void main() { diff --git a/cocos/renderer/ccShader_PositionTextureColor.frag b/cocos/renderer/ccShader_PositionTextureColor.frag index e3f2b93ff5..67da2ed6ad 100644 --- a/cocos/renderer/ccShader_PositionTextureColor.frag +++ b/cocos/renderer/ccShader_PositionTextureColor.frag @@ -30,7 +30,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; void main() { diff --git a/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag b/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag index e0495191a9..c0c13ce301 100644 --- a/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag +++ b/cocos/renderer/ccShader_PositionTextureColorAlphaTest.frag @@ -30,7 +30,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; uniform float CC_alpha_value; void main() diff --git a/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag b/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag index e2c1efdc1c..6b87365af9 100644 --- a/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag +++ b/cocos/renderer/ccShader_PositionTextureColor_noMVP.frag @@ -30,7 +30,6 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; void main() { diff --git a/cocos/renderer/ccShader_PositionTexture_uColor.frag b/cocos/renderer/ccShader_PositionTexture_uColor.frag index f5b8d8ff31..c3da50f6c1 100644 --- a/cocos/renderer/ccShader_PositionTexture_uColor.frag +++ b/cocos/renderer/ccShader_PositionTexture_uColor.frag @@ -33,8 +33,6 @@ uniform vec4 u_color; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; - void main() { gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index c27c9510ab..524039c10e 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -747,24 +747,65 @@ std::string ShaderMultiTexture::subtitle() const return "MultiTexture"; } +ui::Slider* ShaderMultiTexture::createSliderCtl() +{ + auto screenSize = Director::getInstance()->getWinSize(); + + ui::Slider* slider = ui::Slider::create(); + slider->loadBarTexture("cocosui/sliderTrack.png"); + slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); + slider->loadProgressBarTexture("cocosui/sliderProgress.png"); + + slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 3.0f)); + addChild(slider); + + slider->addEventListener([&](Ref* sender, ui::Slider::EventType type) { + + if (type == ui::Slider::EventType::ON_PERCENTAGE_CHANGED) + { + ui::Slider* slider = dynamic_cast(sender); + float p = slider->getPercent() / 100.0f; + _sprite->getGLProgramState()->setUniformFloat("u_interpolate",p); + } + }); + return slider; +} + bool ShaderMultiTexture::init() { if (ShaderTestDemo::init()) { auto s = Director::getInstance()->getWinSize(); - auto sprite = Sprite::create("Images/grossinis_sister1.png"); + // Left: normal sprite + auto left = Sprite::create("Images/grossinis_sister1.png"); + addChild(left); + left->setPosition(s.width*1/4, s.height/2); + + // Right: normal sprite + auto right = Sprite::create("Images/grossinis_sister2.png"); + addChild(right); + right->setPosition(s.width*3/4, s.height/2); + + + // Center: MultiTexture + _sprite = Sprite::create("Images/grossinis_sister1.png"); Texture2D *texture1 = Director::getInstance()->getTextureCache()->addImage("Images/grossinis_sister2.png"); - addChild(sprite); + addChild(_sprite); - sprite->setPosition(Vec2(s.width/2, s.height/2)); + _sprite->setPosition(Vec2(s.width/2, s.height/2)); auto glprogram = GLProgram::createWithFilenames("Shaders/example_MultiTexture.vsh", "Shaders/example_MultiTexture.fsh"); auto glprogramstate = GLProgramState::getOrCreateWithGLProgram(glprogram); - sprite->setGLProgramState(glprogramstate); + _sprite->setGLProgramState(glprogramstate); glprogramstate->setUniformTexture("u_texture1", texture1); + + + // slider + createSliderCtl(); + return true; } diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index 1c55fd4b3b..8e8f7d84c3 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -1,6 +1,8 @@ #ifndef _SHADER_TEST_H_ #define _SHADER_TEST_H_ +#include "ui/CocosGUI.h" + #include "../testBasic.h" #include "extensions/cocos-ext.h" #include "../BaseTest.h" @@ -166,6 +168,8 @@ class ShaderMultiTexture : public ShaderTestDemo { public: ShaderMultiTexture(); + ui::Slider* createSliderCtl(); + Sprite *_sprite; virtual std::string title() const override; virtual std::string subtitle() const override; diff --git a/tests/cpp-tests/Resources/Shaders/example_Blur.fsh b/tests/cpp-tests/Resources/Shaders/example_Blur.fsh index 8489686bf6..169795bc0e 100644 --- a/tests/cpp-tests/Resources/Shaders/example_Blur.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_Blur.fsh @@ -7,8 +7,6 @@ precision mediump float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; - uniform vec4 gaussianCoefficient; uniform vec2 onePixelSize; diff --git a/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh b/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh index 0ed6b49188..ef5886dad3 100644 --- a/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_ColorBars.fsh @@ -5,7 +5,6 @@ precision lowp float; #endif varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; vec4 getColorByCoord(int y){ if(y < 5){ diff --git a/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh b/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh index 86bc8a438c..1b935ae7b6 100644 --- a/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_HorizontalColor.fsh @@ -5,7 +5,6 @@ precision lowp float; #endif varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; vec4 colors[10]; diff --git a/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh index 1dcee6bd83..7c6045d02c 100644 --- a/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_MultiTexture.fsh @@ -6,13 +6,12 @@ precision mediump float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; uniform sampler2D u_texture1; - +uniform float u_interpolate; void main() { - vec4 color1 = texture2D(CC_Texture0, v_texCoord) * vec4(1,1,1,CC_SinTime[3]); - vec4 color2 = texture2D(u_texture1, v_texCoord) * vec4(1,1,1,CC_CosTime[3]); - gl_FragColor = (color1 + color2) * v_fragmentColor; + vec4 color1 = texture2D(CC_Texture0, v_texCoord); + vec4 color2 = texture2D(u_texture1, v_texCoord); + gl_FragColor = v_fragmentColor * mix( color1, color2, u_interpolate); } diff --git a/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh b/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh index ff565de0f2..e7ef423d65 100644 --- a/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_Noisy.fsh @@ -8,7 +8,6 @@ varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec2 resolution; -uniform sampler2D CC_Texture0; const float intensity = 0.05; vec3 noise(vec2 uv) diff --git a/tests/cpp-tests/Resources/Shaders/example_bloom.fsh b/tests/cpp-tests/Resources/Shaders/example_bloom.fsh index fc728e99a6..0ab37f1a91 100644 --- a/tests/cpp-tests/Resources/Shaders/example_bloom.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_bloom.fsh @@ -6,7 +6,6 @@ varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec2 resolution; -uniform sampler2D CC_Texture0; const float blurSize = 1.0/512.0; diff --git a/tests/cpp-tests/Resources/Shaders/example_celShading.fsh b/tests/cpp-tests/Resources/Shaders/example_celShading.fsh index 9e6e13de60..e984076a46 100644 --- a/tests/cpp-tests/Resources/Shaders/example_celShading.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_celShading.fsh @@ -6,8 +6,6 @@ varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec2 resolution; -uniform sampler2D CC_Texture0; - #define FILTER_SIZE 3 #define COLOR_LEVELS 7.0 diff --git a/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh b/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh index b800eb2486..a39f3cfd5e 100644 --- a/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_edgeDetection.fsh @@ -6,7 +6,6 @@ varying vec4 v_fragmentColor; varying vec2 v_texCoord; uniform vec2 resolution; -uniform sampler2D CC_Texture0; float lookup(vec2 p, float dx, float dy) { diff --git a/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh b/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh index af69b0c8a6..05ae5c0e88 100644 --- a/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_greyScale.fsh @@ -5,8 +5,6 @@ precision mediump float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; - void main(void) { vec4 c = texture2D(CC_Texture0, v_texCoord); diff --git a/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh b/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh index 2c4e75c948..b3411576c4 100644 --- a/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_lensFlare.fsh @@ -7,7 +7,6 @@ varying vec2 v_texCoord; uniform vec2 resolution; uniform vec2 textureResolution; -uniform sampler2D CC_Texture0; /*by musk License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. diff --git a/tests/cpp-tests/Resources/Shaders/example_normal.fsh b/tests/cpp-tests/Resources/Shaders/example_normal.fsh index 3ecb825051..c73ca977d3 100644 --- a/tests/cpp-tests/Resources/Shaders/example_normal.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_normal.fsh @@ -5,8 +5,6 @@ precision mediump float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; - void main(void) { gl_FragColor = texture2D(CC_Texture0, v_texCoord); diff --git a/tests/cpp-tests/Resources/Shaders/example_outline.fsh b/tests/cpp-tests/Resources/Shaders/example_outline.fsh index d75b78715e..990119525a 100644 --- a/tests/cpp-tests/Resources/Shaders/example_outline.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_outline.fsh @@ -6,8 +6,6 @@ http://www.idevgames.com/forums/thread-3010.html varying vec2 v_texCoord; varying vec4 v_fragmentColor; -uniform sampler2D CC_Texture0; - uniform vec3 u_outlineColor; uniform float u_threshold; uniform float u_radius; diff --git a/tests/cpp-tests/Resources/Shaders/example_sepia.fsh b/tests/cpp-tests/Resources/Shaders/example_sepia.fsh index 394198137b..409469b5b3 100644 --- a/tests/cpp-tests/Resources/Shaders/example_sepia.fsh +++ b/tests/cpp-tests/Resources/Shaders/example_sepia.fsh @@ -5,8 +5,6 @@ precision mediump float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform sampler2D CC_Texture0; - void main(void) { vec4 c = texture2D(CC_Texture0, v_texCoord); From f9f0142842d2f8705fa00f6db9bbb3f4c3e13cdc Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 15 May 2014 16:52:15 -0700 Subject: [PATCH 095/125] default value is 0.5 for interpolation --- tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index 524039c10e..b8c2cc8237 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -755,6 +755,7 @@ ui::Slider* ShaderMultiTexture::createSliderCtl() slider->loadBarTexture("cocosui/sliderTrack.png"); slider->loadSlidBallTextures("cocosui/sliderThumb.png", "cocosui/sliderThumb.png", ""); slider->loadProgressBarTexture("cocosui/sliderProgress.png"); + slider->setPercent(50); slider->setPosition(Vec2(screenSize.width / 2.0f, screenSize.height / 3.0f)); addChild(slider); @@ -801,7 +802,7 @@ bool ShaderMultiTexture::init() _sprite->setGLProgramState(glprogramstate); glprogramstate->setUniformTexture("u_texture1", texture1); - + glprogramstate->setUniformFloat("u_interpolate",0.5); // slider createSliderCtl(); From 7e4597508c709ff58d6de238fee7e99d33d91ea4 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 15 May 2014 17:22:53 -0700 Subject: [PATCH 096/125] Does not crash on Mac if the .ttf file is not found --- cocos/2d/CCLabel.cpp | 6 +-- cocos/renderer/ccShader_Label_df.frag | 9 ++-- cocos/renderer/ccShader_Label_df_glow.frag | 9 ++-- cocos/renderer/ccShader_Label_normal.frag | 7 +-- cocos/renderer/ccShader_Label_outline.frag | 9 ++-- .../Classes/LabelTest/LabelTestNew.cpp | 52 ++++++++++++------- 6 files changed, 55 insertions(+), 37 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 0202070200..64439726b2 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -349,20 +349,20 @@ void Label::updateShaderProgram() break; case cocos2d::LabelEffect::OUTLINE: setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_LABEL_OUTLINE)); - _uniformEffectColor = glGetUniformLocation(getGLProgram()->getProgram(), "v_effectColor"); + _uniformEffectColor = glGetUniformLocation(getGLProgram()->getProgram(), "u_effectColor"); break; case cocos2d::LabelEffect::GLOW: if (_useDistanceField) { setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW)); - _uniformEffectColor = glGetUniformLocation(getGLProgram()->getProgram(), "v_effectColor"); + _uniformEffectColor = glGetUniformLocation(getGLProgram()->getProgram(), "u_effectColor"); } break; default: return; } - _uniformTextColor = glGetUniformLocation(getGLProgram()->getProgram(), "v_textColor"); + _uniformTextColor = glGetUniformLocation(getGLProgram()->getProgram(), "u_textColor"); } void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false */, bool useA8Shader /* = false */) diff --git a/cocos/renderer/ccShader_Label_df.frag b/cocos/renderer/ccShader_Label_df.frag index 56b1beed9e..cb3dac1122 100644 --- a/cocos/renderer/ccShader_Label_df.frag +++ b/cocos/renderer/ccShader_Label_df.frag @@ -5,8 +5,9 @@ precision lowp float; \n#endif\n varying vec4 v_fragmentColor; -varying vec2 v_texCoord; -uniform vec4 v_textColor; +varying vec2 v_texCoord; + +uniform vec4 u_textColor; void main() { @@ -19,7 +20,7 @@ void main() //float width = fwidth(dist); \n //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\n float width = 0.04; - float alpha = smoothstep(0.5-width, 0.5+width, dist) * v_textColor.a; - gl_FragColor = v_fragmentColor * vec4(v_textColor.rgb,alpha); + float alpha = smoothstep(0.5-width, 0.5+width, dist) * u_textColor.a; + gl_FragColor = v_fragmentColor * vec4(u_textColor.rgb,alpha); } ); diff --git a/cocos/renderer/ccShader_Label_df_glow.frag b/cocos/renderer/ccShader_Label_df_glow.frag index 51eaed548d..b33b3e3d4d 100644 --- a/cocos/renderer/ccShader_Label_df_glow.frag +++ b/cocos/renderer/ccShader_Label_df_glow.frag @@ -5,9 +5,10 @@ precision lowp float; \n#endif\n varying vec4 v_fragmentColor; -varying vec2 v_texCoord; -uniform vec4 v_effectColor; -uniform vec4 v_textColor; +varying vec2 v_texCoord; + +uniform vec4 u_effectColor; +uniform vec4 u_textColor; void main() { @@ -19,7 +20,7 @@ void main() float alpha = smoothstep(0.5-width, 0.5+width, dist); //glow \n float mu = smoothstep(0.5, 1.0, sqrt(dist)); - vec4 color = v_effectColor*(1.0-alpha) + v_textColor*alpha; + vec4 color = u_effectColor*(1.0-alpha) + u_textColor*alpha; gl_FragColor = v_fragmentColor * vec4(color.rgb, max(alpha,mu)*color.a); } ); diff --git a/cocos/renderer/ccShader_Label_normal.frag b/cocos/renderer/ccShader_Label_normal.frag index 6034615401..1e0fc57d5e 100644 --- a/cocos/renderer/ccShader_Label_normal.frag +++ b/cocos/renderer/ccShader_Label_normal.frag @@ -30,12 +30,13 @@ precision lowp float; varying vec4 v_fragmentColor; varying vec2 v_texCoord; -uniform vec4 v_textColor; + +uniform vec4 u_textColor; void main() { - gl_FragColor = v_fragmentColor * vec4( v_textColor.rgb,// RGB from uniform\n - v_textColor.a * texture2D(CC_Texture0, v_texCoord).a// A from texture & uniform\n + gl_FragColor = v_fragmentColor * vec4(u_textColor.rgb,// RGB from uniform\n + u_textColor.a * texture2D(CC_Texture0, v_texCoord).a// A from texture & uniform\n ); } ); diff --git a/cocos/renderer/ccShader_Label_outline.frag b/cocos/renderer/ccShader_Label_outline.frag index 958d716802..4395e90910 100644 --- a/cocos/renderer/ccShader_Label_outline.frag +++ b/cocos/renderer/ccShader_Label_outline.frag @@ -7,9 +7,10 @@ precision lowp float; \n#endif\n varying vec4 v_fragmentColor; -varying vec2 v_texCoord; -uniform vec4 v_effectColor; -uniform vec4 v_textColor; +varying vec2 v_texCoord; + +uniform vec4 u_effectColor; +uniform vec4 u_textColor; void main() { @@ -17,7 +18,7 @@ void main() float fontAlpha = sample.a; float outlineAlpha = sample.r; if (outlineAlpha > 0.0){ - vec4 color = v_textColor * fontAlpha + v_effectColor * (1.0 - fontAlpha); + vec4 color = u_textColor * fontAlpha + u_effectColor * (1.0 - fontAlpha); gl_FragColor = v_fragmentColor * vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a); } else { diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 1d8ee072f9..ea8aac728c 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -607,8 +607,11 @@ LabelTTFUnicodeChinese::LabelTTFUnicodeChinese() // like "Error 3 error C2146: syntax error : missing ')' before identifier 'label'"; TTFConfig ttfConfig("fonts/wt021.ttf",28,GlyphCollection::CUSTOM, "美好的一天啊"); auto label = Label::createWithTTF(ttfConfig,"美好的一天啊", TextHAlignment::CENTER, size.width); - label->setPosition(Vec2(size.width / 2, size.height /2)); - this->addChild(label); + + if(label) { + label->setPosition(Vec2(size.width / 2, size.height /2)); + this->addChild(label); + } } std::string LabelTTFUnicodeChinese::title() const @@ -966,8 +969,10 @@ LabelTTFLargeText::LabelTTFLargeText() TTFConfig ttfConfig("fonts/wt021.ttf",18,GlyphCollection::DYNAMIC); std::string text = FileUtils::getInstance()->getStringFromFile("commonly_used_words.txt"); auto label = Label::createWithTTF(ttfConfig,text, TextHAlignment::CENTER, size.width); - label->setPosition( Vec2(size.width/2, size.height/2) ); - addChild(label); + if(label) { + label->setPosition( Vec2(size.width/2, size.height/2) ); + addChild(label); + } } std::string LabelTTFLargeText::title() const @@ -1090,23 +1095,30 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() TTFConfig ttfConfig("fonts/wt021.ttf", 25, GlyphCollection::DYNAMIC); auto label1 = Label::createWithTTF(ttfConfig, "你好,Cocos2d-x v3çš„New Label.", TextHAlignment::LEFT, size.width * 0.75); - label1->setTextColor(Color4B(128, 255, 255, 255)); - label1->setPosition(Vec2(size.width * 0.1, size.height * 0.6)); - label1->setAnchorPoint(Vec2(0, 0.5)); - this->addChild(label1); - + if(label1) { + label1->setTextColor(Color4B(128, 255, 255, 255)); + label1->setPosition(Vec2(size.width * 0.1, size.height * 0.6)); + label1->setAnchorPoint(Vec2(0, 0.5)); + this->addChild(label1); + } + auto label2 = Label::createWithTTF(ttfConfig, "早上好,Cocos2d-x v3çš„New Label.", TextHAlignment::LEFT, size.width * 0.75); - label2->setTextColor(Color4B(255, 128, 255, 255)); - label2->setPosition(Vec2(size.width * 0.1, size.height * 0.4)); - label2->setAnchorPoint(Vec2(0, 0.5)); - this->addChild(label2); + if(label2) { + label2->setTextColor(Color4B(255, 128, 255, 255)); + label2->setPosition(Vec2(size.width * 0.1, size.height * 0.4)); + label2->setAnchorPoint(Vec2(0, 0.5)); + this->addChild(label2); + } + auto label3 = Label::createWithTTF(ttfConfig, "美好的一天啊美好的一天啊美好的一天啊", TextHAlignment::LEFT, size.width * 0.75); - label3->setTextColor(Color4B(255, 255, 128, 255)); - label3->setPosition(Vec2(size.width * 0.1, size.height * 0.2)); - label3->setAnchorPoint(Vec2(0, 0.5)); - this->addChild(label3); + if(label3) { + label3->setTextColor(Color4B(255, 255, 128, 255)); + label3->setPosition(Vec2(size.width * 0.1, size.height * 0.2)); + label3->setAnchorPoint(Vec2(0, 0.5)); + this->addChild(label3); + } } std::string LabelTTFCJKWrappingTest::title() const @@ -1153,8 +1165,10 @@ LabelTTFUnicodeNew::LabelTTFUnicodeNew() ttfConfig.glyphs = GlyphCollection::CUSTOM; ttfConfig.customGlyphs = chinese.c_str(); auto label3 = Label::createWithTTF(ttfConfig,chinese, TextHAlignment::CENTER,size.width); - label3->setPosition( Vec2(size.width/2, vSize - (vStep * 6.5)) ); - addChild(label3); + if(label3) { + label3->setPosition( Vec2(size.width/2, vSize - (vStep * 6.5)) ); + addChild(label3); + } } std::string LabelTTFUnicodeNew::title() const From d6007a395cdb4626eb56d9cb3d0acbaa81685208 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 16 May 2014 10:20:49 +0800 Subject: [PATCH 097/125] Adds a virtual method for loading native libraries. --- .../org/cocos2dx/lib/Cocos2dxActivity.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index 6b645d4f4f..a1bac4a217 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -58,14 +58,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe return sContext; } - // =========================================================== - // Constructors - // =========================================================== - @Override - protected void onCreate(final Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - + protected void onLoadNativeLibraries() { try { ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); Bundle bundle = ai.metaData; @@ -74,10 +68,23 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe System.loadLibrary(libName); } catch (Exception e) { // ERROR + e.printStackTrace(); } } catch (PackageManager.NameNotFoundException e) { // ERROR + e.printStackTrace(); } + } + + // =========================================================== + // Constructors + // =========================================================== + + @Override + protected void onCreate(final Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + onLoadNativeLibraries(); sContext = this; this.mHandler = new Cocos2dxHandler(this); From a0d5fdc622dd28da4232fc37f5636e67c8dc0cdf Mon Sep 17 00:00:00 2001 From: zhangbin Date: Fri, 16 May 2014 14:07:00 +0800 Subject: [PATCH 098/125] Update the reference of submodule plugin-x. --- plugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin b/plugin index af2b48206a..96dc74898f 160000 --- a/plugin +++ b/plugin @@ -1 +1 @@ -Subproject commit af2b48206acfe005e370702272dbd02495806630 +Subproject commit 96dc74898fcc1be55a68dc404d65067fd337b863 From d3853e3f8b63593fd4bc7184a7e7191f2549e815 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 16 May 2014 14:11:26 +0800 Subject: [PATCH 099/125] [ci skip] --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a45554b14f..2c0c5a5a4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ cocos2d-x-3.1-rc0 May.16 2014 + [NEW] Cocos2dxActivity: Adds a virtual method to load native libraries. + [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 [FIX] GLProgram: uniform CC_Texture0 is pre-defined by cocos2d. MUST NOT be defined in shaders [FIX] GLProgramState: Supports multitexturing From f07e7ae869ce335ef14b7a9a0389ce75f44dd62d Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 16 May 2014 15:15:06 +0800 Subject: [PATCH 100/125] Update README.md: readme for download-deps.py --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e4b3a38b4b..5bf05aa97a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,15 @@ cocos2d-x is: * Easy to use * Community Supported +Git user attention +----------------------- +1. After cloning the repo, please execute `download-deps.py` to download and install some dependences. + + $ cd cocos2d-x + $ python download-deps.py + +2. Please execute `download-deps.py` once you synchronize with this repo. If there aren't any updates, it will not download dependences again. How to start a new game ----------------------- From 9fa30f2c61b72e6104f6022d383ff823d73c7213 Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Fri, 16 May 2014 11:21:56 +0400 Subject: [PATCH 101/125] Added Secure input for CCEditBox on Mac [NEW]: Implemented NSSecureTextField when CCEditBox inputFlag is set to Password [FIX]: Cleanup CCEditBoxMac. CCCustomNSTextField class is not needed. --- extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 7 +- extensions/GUI/CCEditBox/CCEditBoxImplMac.mm | 117 ++++++++++++------- 2 files changed, 77 insertions(+), 47 deletions(-) diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index cbb0a9a00b..a5b93c4f58 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -36,21 +36,16 @@ #include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" -@interface CCCustomNSTextField : NSTextField -{ -} - -@end @interface CCEditBoxImplMac : NSObject { - CCCustomNSTextField* textField_; void* editBox_; BOOL editState_; NSMutableDictionary* placeholderAttributes_; } @property(nonatomic, retain) NSTextField* textField; +@property(nonatomic, retain) NSSecureTextField* secureTextField; @property(nonatomic, retain) NSMutableDictionary* placeholderAttributes; @property(nonatomic, readonly, getter = isEditState) BOOL editState; @property(nonatomic, assign) void* editBox; diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm index dfc3b6d0d0..fbeed2ee37 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm @@ -38,29 +38,10 @@ -@implementation CCCustomNSTextField - -- (CGRect)textRectForBounds:(CGRect)bounds { - float padding = 5.0f; - return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding, - bounds.size.width - padding*2, bounds.size.height - padding*2); -} -- (CGRect)editingRectForBounds:(CGRect)bounds { - return [self textRectForBounds:bounds]; -} - -- (void)setup { - [self setBordered:NO]; - [self setHidden:NO]; - [self setWantsLayer:YES]; -} - -@end - - @implementation CCEditBoxImplMac @synthesize textField = textField_; +@synthesize secureTextField = secureTextField_; @synthesize placeholderAttributes = placeholderAttributes_; @synthesize editState = editState_; @synthesize editBox = editBox_; @@ -75,7 +56,12 @@ { [textField_ resignFirstResponder]; [textField_ removeFromSuperview]; - self.textField = NULL; + [textField_ release]; + + [secureTextField_ resignFirstResponder]; + [secureTextField_ removeFromSuperview]; + [secureTextField_ release]; + [placeholderAttributes_ release]; [super dealloc]; } @@ -84,18 +70,19 @@ { self = [super init]; - do + if (self) { - if (self == nil) break; editState_ = NO; - self.textField = [[[CCCustomNSTextField alloc] initWithFrame: frameRect] autorelease]; - if (!textField_) break; + self.textField = [[[NSTextField alloc] initWithFrame:frameRect] autorelease]; + self.secureTextField = [[[NSSecureTextField alloc] initWithFrame:frameRect] autorelease]; + NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. - textField_.textColor = [NSColor whiteColor]; textField_.font = font; - textField_.backgroundColor = [NSColor clearColor]; - [textField_ setup]; - textField_.delegate = self; + secureTextField_.font = font; + + [self setupTextField:textField_]; + [self setupTextField:secureTextField_]; + self.editBox = editBox; self.placeholderAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: font, NSFontAttributeName, @@ -103,11 +90,19 @@ nil]; [[[self getNSWindow] contentView] addSubview:textField_]; - - return self; - }while(0); + } - return nil; + return self; +} + +- (void)setupTextField:(NSTextField *)textField +{ + [textField setTextColor:[NSColor whiteColor]]; + [textField setBackgroundColor:[NSColor clearColor]]; + [textField setBordered:NO]; + [textField setHidden:NO]; + [textField setWantsLayer:YES]; + [textField setDelegate:self]; } -(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance @@ -120,6 +115,7 @@ NSRect frame = [textField_ frame]; frame.origin = pos; [textField_ setFrame:frame]; + [secureTextField_ setFrame:frame]; } -(void) setContentSize:(NSSize) size @@ -134,18 +130,29 @@ -(void) openKeyboard { - [textField_ becomeFirstResponder]; + if ([textField_ superview]) { + [textField_ becomeFirstResponder]; + } + else { + [secureTextField_ becomeFirstResponder]; + } } -(void) closeKeyboard { - [textField_ resignFirstResponder]; - [textField_ removeFromSuperview]; + if ([textField_ superview]) { + [textField_ resignFirstResponder]; + [textField_ removeFromSuperview]; + } + else { + [secureTextField_ resignFirstResponder]; + [secureTextField_ removeFromSuperview]; + } } - (BOOL)textFieldShouldReturn:(NSTextField *)sender { - if (sender == textField_) { + if (sender == textField_ || sender == secureTextField_) { [sender resignFirstResponder]; } return NO; @@ -301,8 +308,10 @@ void EditBoxImplMac::setFont(const char* pFontName, int fontSize) { NSString * fntName = [NSString stringWithUTF8String:pFontName]; NSFont *textFont = [NSFont fontWithName:fntName size:fontSize]; - if(textFont != nil) + if (textFont != nil) { [_sysEdit.textField setFont:textFont]; + [_sysEdit.secureTextField setFont:textFont]; + } } void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize) @@ -326,7 +335,9 @@ void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize) void EditBoxImplMac::setFontColor(const Color3B& color) { - _sysEdit.textField.textColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; + NSColor *newColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; + _sysEdit.textField.textColor = newColor; + _sysEdit.secureTextField.textColor = newColor; } void EditBoxImplMac::setPlaceholderFontColor(const Color3B& color) @@ -357,7 +368,27 @@ int EditBoxImplMac::getMaxLength() void EditBoxImplMac::setInputFlag(EditBox::InputFlag inputFlag) { - // TODO: NSSecureTextField + switch (inputFlag) + { + case EditBox::InputFlag::PASSWORD: + [_sysEdit.textField.superview addSubview:_sysEdit.secureTextField]; + [_sysEdit.textField removeFromSuperview]; + break; + case EditBox::InputFlag::INITIAL_CAPS_WORD: + CCLOGWARN("INITIAL_CAPS_WORD not implemented"); + break; + case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: + CCLOGWARN("INITIAL_CAPS_SENTENCE not implemented"); + break; + case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS: + CCLOGWARN("INTIAL_CAPS_ALL_CHARACTERS not implemented"); + break; + case EditBox::InputFlag::SENSITIVE: + CCLOGWARN("SENSITIVE not implemented"); + break; + default: + break; + } } void EditBoxImplMac::setReturnType(EditBox::KeyboardReturnType returnType) @@ -371,7 +402,9 @@ bool EditBoxImplMac::isEditing() void EditBoxImplMac::setText(const char* pText) { - _sysEdit.textField.stringValue = [NSString stringWithUTF8String:pText]; + NSString *string = [NSString stringWithUTF8String:pText]; + _sysEdit.textField.stringValue = string; + _sysEdit.textField.stringValue = string; } const char* EditBoxImplMac::getText(void) @@ -385,6 +418,7 @@ void EditBoxImplMac::setPlaceHolder(const char* pText) attributes:_sysEdit.placeholderAttributes]; [[_sysEdit.textField cell] setPlaceholderAttributedString:as]; + [[_sysEdit.secureTextField cell] setPlaceholderAttributedString:as]; [as release]; } @@ -438,6 +472,7 @@ void EditBoxImplMac::setPosition(const Vec2& pos) void EditBoxImplMac::setVisible(bool visible) { [_sysEdit.textField setHidden:!visible]; + [_sysEdit.secureTextField setHidden:!visible]; } void EditBoxImplMac::setContentSize(const Size& size) From cbe1c39fe658c2c3e6de0f1464c26a873f32eefb Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Fri, 16 May 2014 11:37:37 +0400 Subject: [PATCH 102/125] Oops, removed CC_SYNTHESIZE_READONLY_PURE_REF, which is something I added for myself. --- cocos/base/CCPlatformMacros.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cocos/base/CCPlatformMacros.h b/cocos/base/CCPlatformMacros.h index c13e1eab62..4d7c837ff2 100644 --- a/cocos/base/CCPlatformMacros.h +++ b/cocos/base/CCPlatformMacros.h @@ -164,10 +164,6 @@ public: virtual varType get##funName(void) const { return varName; } protected: varType varName;\ public: virtual const varType& get##funName(void) const { return varName; } -#define CC_SYNTHESIZE_READONLY_PURE_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType& get##funName(void) { return varName; } - /** CC_SYNTHESIZE is used to declare a protected variable. We can use getter to read the variable, and use the setter to change the variable. @param varType the type of variable. From 67a558c83db8cc1599234bac74c5ccaa7a898d38 Mon Sep 17 00:00:00 2001 From: Jason Xu Date: Fri, 16 May 2014 15:55:00 +0800 Subject: [PATCH 103/125] for https://github.com/cocos2d/cocos2d-x/commit/93562d6aa6635ec0e0d365a15a723a35d516438a update Cocos2dxHelper and AndroidManifest.xml template. --- .../src/org/cocos2dx/lib/Cocos2dxHelper.java | 25 +------------------ .../proj.android/AndroidManifest.xml | 9 +++---- .../proj.android/AndroidManifest.xml | 11 ++++---- .../proj.android/AndroidManifest.xml | 11 ++++---- .../project/proj.android/AndroidManifest.xml | 9 +++---- .../project/proj.android/AndroidManifest.xml | 11 ++++---- 6 files changed, 24 insertions(+), 52 deletions(-) diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index 4695317696..e3617b80ef 100644 --- a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -66,13 +66,6 @@ public class Cocos2dxHelper { private static Cocos2dxHelperListener sCocos2dxHelperListener; private static Set onActivityResultListeners = new LinkedHashSet(); - /** - * Optional meta-that can be in the manifest for this component, specifying - * the name of the native shared library to load. If not specified, - * "main" is used. - */ - private static final String META_DATA_LIB_NAME = "android.app.lib_name"; - private static final String DEFAULT_LIB_NAME = "main"; // =========================================================== // Constructors @@ -88,23 +81,7 @@ public class Cocos2dxHelper { final ApplicationInfo applicationInfo = activity.getApplicationInfo(); Cocos2dxHelper.sCocos2dxHelperListener = (Cocos2dxHelperListener)activity; - - try { - // Get the lib_name from AndroidManifest.xml metadata - ActivityInfo ai = - activity.getPackageManager().getActivityInfo(activity.getIntent().getComponent(), PackageManager.GET_META_DATA); - if (null != ai.metaData) { - String lib_name = ai.metaData.getString(META_DATA_LIB_NAME); - if (null != lib_name) { - System.loadLibrary(lib_name); - } else { - System.loadLibrary(DEFAULT_LIB_NAME); - } - } - } catch (PackageManager.NameNotFoundException e) { - throw new RuntimeException("Error getting activity info", e); - } - + Cocos2dxHelper.sPackageName = applicationInfo.packageName; Cocos2dxHelper.sFileDirectory = activity.getFilesDir().getAbsolutePath(); Cocos2dxHelper.nativeSetApkPath(applicationInfo.sourceDir); diff --git a/templates/cpp-template-default/proj.android/AndroidManifest.xml b/templates/cpp-template-default/proj.android/AndroidManifest.xml index 03b6257326..4f76d5ccfc 100644 --- a/templates/cpp-template-default/proj.android/AndroidManifest.xml +++ b/templates/cpp-template-default/proj.android/AndroidManifest.xml @@ -9,7 +9,10 @@ - + + + - - - diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml b/templates/lua-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml index d83b700b63..07d5ec8d82 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/AndroidManifest.xml @@ -9,17 +9,16 @@ - + + + + - - - - diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml index d83b700b63..07d5ec8d82 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/AndroidManifest.xml @@ -9,17 +9,16 @@ - + + + + - - - - diff --git a/tests/lua-empty-test/project/proj.android/AndroidManifest.xml b/tests/lua-empty-test/project/proj.android/AndroidManifest.xml index 7c88d6ab2f..7fc7f087d1 100644 --- a/tests/lua-empty-test/project/proj.android/AndroidManifest.xml +++ b/tests/lua-empty-test/project/proj.android/AndroidManifest.xml @@ -10,16 +10,15 @@ + + + - - - - diff --git a/tests/lua-tests/project/proj.android/AndroidManifest.xml b/tests/lua-tests/project/proj.android/AndroidManifest.xml index 4570848f92..1751925ae4 100644 --- a/tests/lua-tests/project/proj.android/AndroidManifest.xml +++ b/tests/lua-tests/project/proj.android/AndroidManifest.xml @@ -10,17 +10,16 @@ - + + + + - - - - From c2ace4c56e06ae65b5fcd9732952162a9dd011e5 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 16 May 2014 08:43:41 +0000 Subject: [PATCH 104/125] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 6d263bef04..9eb017a58e 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -2205,6 +2205,7 @@ "licenses/LICENSE_zlib.txt", "plugin/AUTHORS", "plugin/README.md", + "plugin/jsbindings/Android.mk", "plugin/jsbindings/auto/api/jsb_cocos2dx_pluginx_auto_api.js", "plugin/jsbindings/auto/jsb_cocos2dx_pluginx_auto.cpp", "plugin/jsbindings/auto/jsb_cocos2dx_pluginx_auto.hpp", From 39c76d8a9e48d4e571794267a44a79cf80961525 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 16 May 2014 17:13:17 +0800 Subject: [PATCH 105/125] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 2c0c5a5a4a..34622c15ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ cocos2d-x-3.1-rc0 May.16 2014 [NEW] Cocos2dxActivity: Adds a virtual method to load native libraries. + [FIX] Director: twice calling of onExit [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 [FIX] GLProgram: uniform CC_Texture0 is pre-defined by cocos2d. MUST NOT be defined in shaders [FIX] GLProgramState: Supports multitexturing From 64002e5a2a0a07ce958aa851af0f43907a7de98e Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 16 May 2014 17:14:33 +0800 Subject: [PATCH 106/125] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index a64d7c52c7..7e79394675 100644 --- a/AUTHORS +++ b/AUTHORS @@ -841,6 +841,7 @@ Developers: zifter Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly + Fix twice calling onExit twhittock Fixed a bug that Application::run returns wrong value on Mac platform From 74335a92f7b0fe7f888847e9e1faf328f3dc504d Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 16 May 2014 17:19:02 +0800 Subject: [PATCH 107/125] Roll back lua PhysicsTest. --- .../manual/lua_cocos2dx_physics_manual.cpp | 108 +++++++++--------- .../lua-tests/src/PhysicsTest/PhysicsTest.lua | 102 +++++++++-------- tests/lua-tests/src/helper.lua | 7 +- 3 files changed, 112 insertions(+), 105 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp index 2a02e89c6a..1d4425767c 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_physics_manual.cpp @@ -6,8 +6,8 @@ #include "CCLuaValue.h" #include "CCLuaEngine.h" -#ifndef CC_SAFE_FREE -#define CC_SAFE_FREE(p) { if(p) free(p); p = nullptr; } +#ifndef CC_SAFE_DELETE_ARRAY +#define do { if(p) { delete[] (p); (p) = nullptr; } } while(0) #endif int lua_cocos2dx_physics_PhysicsBody_getJoints(lua_State* tolua_S) @@ -334,11 +334,11 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -366,11 +366,11 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) @@ -401,11 +401,11 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -455,11 +455,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -487,11 +487,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -521,11 +521,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4,&arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -575,11 +575,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -607,11 +607,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -641,11 +641,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4,&arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); do { if (nullptr != ret) { @@ -695,12 +695,12 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShape::recenterPoints(arg0, arg1); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } @@ -717,12 +717,12 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2); vec2_array_to_luaval(tolua_S, arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "recenterPoints",argc, 2); @@ -760,11 +760,11 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::Vec2 ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); vec2_to_luaval(tolua_S, ret); return 1; } @@ -849,7 +849,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S) cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); @@ -890,11 +890,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret); return 1; } @@ -911,11 +911,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret); return 1; } @@ -934,11 +934,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapePolygon",(cocos2d::PhysicsShapePolygon*)ret); return 1; } @@ -976,11 +976,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } double ret = cocos2d::PhysicsShapePolygon::calculateArea(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } @@ -1020,11 +1020,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg1); + CC_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2); - CC_SAFE_FREE(arg1); + CC_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } @@ -1043,11 +1043,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S) ok &= luaval_to_vec2(tolua_S, 4, &arg3); if(!ok) { - CC_SAFE_FREE(arg1); + CC_SAFE_DELETE_ARRAY(arg1); return 0; } double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg1); + CC_SAFE_DELETE_ARRAY(arg1); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } @@ -1090,7 +1090,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S) cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); @@ -1134,7 +1134,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S) cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); @@ -1178,7 +1178,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S) cocos2d::Vec2* arg0 = new cocos2d::Vec2[count]; cobj->getPoints(arg0); vec2_array_to_luaval(tolua_S, arg0, count); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1); @@ -1322,11 +1322,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgePolygon",(cocos2d::PhysicsShapeEdgePolygon*)ret); return 1; } @@ -1343,11 +1343,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgePolygon",(cocos2d::PhysicsShapeEdgePolygon*)ret); return 1; } @@ -1366,11 +1366,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4,&arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgePolygon",(cocos2d::PhysicsShapeEdgePolygon*)ret); return 1; } @@ -1409,11 +1409,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) }} while (0); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgeChain",(cocos2d::PhysicsShapeEdgeChain*)ret); return 1; } @@ -1430,11 +1430,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_physics_material(tolua_S, 3, &arg2); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgeChain",(cocos2d::PhysicsShapeEdgeChain*)ret); return 1; } @@ -1453,11 +1453,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S) ok &= luaval_to_number(tolua_S, 4,&arg3); if(!ok) { - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); return 0; } cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3); - CC_SAFE_FREE(arg0); + CC_SAFE_DELETE_ARRAY(arg0); object_to_luaval(tolua_S, "cc.PhysicsShapeEdgeChain",(cocos2d::PhysicsShapeEdgeChain*)ret); return 1; } diff --git a/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua b/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua index 7b9d9d715e..9043a42c8d 100644 --- a/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua +++ b/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua @@ -106,7 +106,7 @@ local function initWithLayer(layer, callback) local debug = false local function toggleDebugCallback(sender) debug = not debug - layer:getPhysicsWorld():setDebugDrawMask(debug and cc.PhysicsWorld.DEBUGDRAW_ALL or cc.PhysicsWorld.DEBUGDRAW_NONE) + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setDebugDrawMask(debug and cc.PhysicsWorld.DEBUGDRAW_ALL or cc.PhysicsWorld.DEBUGDRAW_NONE) end layer.toggleDebug = function(self) toggleDebugCallback(nil) end; @@ -144,7 +144,7 @@ end local function onTouchBegan(touch, event) local location = touch:getLocation() - local arr = curLayer:getPhysicsWorld():getShapes(location) + local arr = cc.Director:getInstance():getRunningScene():getPhysicsWorld():getShapes(location) local body for _, obj in ipairs(arr) do @@ -162,7 +162,7 @@ local function onTouchBegan(touch, event) curLayer:addChild(mouse); local joint = cc.PhysicsJointPin:construct(mouse:getPhysicsBody(), body, location); joint:setMaxForce(5000.0 * body:getMass()); - curLayer:getPhysicsWorld():addJoint(joint); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():addJoint(joint); touch.mouse = mouse return true; @@ -253,7 +253,7 @@ local function makeTriangle(point, size, color, material) end local function PhysicsDemoClickAdd() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local function onTouchEnded(touch, event) local location = touch:getLocation(); @@ -281,7 +281,7 @@ local function PhysicsDemoClickAdd() end local function PhysicsDemoLogoSmash() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local logo_width = 188.0 @@ -327,8 +327,8 @@ local function PhysicsDemoLogoSmash() return bit.band(bit.rshift(logo_image[bit.rshift(x, 3) + y*logo_raw_length + 1], bit.band(bit.bnot(x), 0x07)), 1) end - curLayer:getPhysicsWorld():setGravity(cc.p(0, 0)); - curLayer:getPhysicsWorld():setUpdateRate(5.0); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0, 0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setUpdateRate(5.0); layer.ball = cc.SpriteBatchNode:create("Images/ball.png", #logo_image); layer:addChild(layer.ball); @@ -363,7 +363,7 @@ local function PhysicsDemoLogoSmash() end local function PhysicsDemoJoints() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() layer:toggleDebug(); @@ -384,6 +384,7 @@ local function PhysicsDemoJoints() node:setPosition(cc.p(0, 0)); layer:addChild(node); + local scene = cc.Director:getInstance():getRunningScene(); for i in range(0, 3) do for j in range(0, 3) do local offset = cc.p(VisibleRect:leftBottom().x + 5 + j * width + width/2, VisibleRect:leftBottom().y + 50 + i * height + height/2); @@ -396,7 +397,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), offset); - curLayer:getPhysicsWorld():addJoint(joint); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -407,7 +408,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointFixed:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), offset); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -418,7 +419,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointDistance:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0)); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -429,7 +430,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointLimit:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0), 30.0, 60.0); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -440,7 +441,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointSpring:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(0, 0), cc.p(0, 0), 500.0, 0.3); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -451,7 +452,7 @@ local function PhysicsDemoJoints() sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); local joint = cc.PhysicsJointGroove:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), cc.p(30, 15), cc.p(30, -15), cc.p(-30, 0)) - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -460,10 +461,10 @@ local function PhysicsDemoJoints() sp1:getPhysicsBody():setTag(DRAG_BODYS_TAG); local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); local joint = cc.PhysicsJointRotarySpring:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 3000.0, 60.0); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -473,10 +474,10 @@ local function PhysicsDemoJoints() local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); local joint = cc.PhysicsJointRotaryLimit:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, math.pi/2); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -486,10 +487,10 @@ local function PhysicsDemoJoints() local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); local joint = cc.PhysicsJointRatchet:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, math.pi/2); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -499,10 +500,10 @@ local function PhysicsDemoJoints() local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); local joint = cc.PhysicsJointGear:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), 0.0, 2.0); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -512,10 +513,10 @@ local function PhysicsDemoJoints() local sp2 = makeBox(cc.p(offset.x + 30, offset.y), cc.size(30, 10)); sp2:getPhysicsBody():setTag(DRAG_BODYS_TAG); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); - curLayer:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp1:getPhysicsBody(), box, cc.p(sp1:getPosition()))); + scene:getPhysicsWorld():addJoint(cc.PhysicsJointPin:construct(sp2:getPhysicsBody(), box, cc.p(sp2:getPosition()))); local joint = cc.PhysicsJointMotor:construct(sp1:getPhysicsBody(), sp2:getPhysicsBody(), math.pi/2); - curLayer:getPhysicsWorld():addJoint(joint); + scene:getPhysicsWorld():addJoint(joint); layer:addChild(sp1); layer:addChild(sp2); @@ -530,7 +531,7 @@ local function PhysicsDemoJoints() end local function PhysicsDemoPyramidStack() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local touchListener = cc.EventListenerTouchOneByOne:create(); @@ -568,7 +569,7 @@ local function PhysicsDemoPyramidStack() end local function PhysicsDemoRayCast() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local function onTouchEnded(touch, event) @@ -590,7 +591,7 @@ local function PhysicsDemoRayCast() local eventDispatcher = layer:getEventDispatcher() eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer); - curLayer:getPhysicsWorld():setGravity(cc.p(0,0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0,0)); local node = cc.DrawNode:create(); node:setPhysicsBody(cc.PhysicsBody:createEdgeSegment(cc.p(VisibleRect:leftBottom().x, VisibleRect:leftBottom().y + 50), cc.p(VisibleRect:rightBottom().x, VisibleRect:rightBottom().y + 50))) @@ -635,7 +636,7 @@ local function PhysicsDemoRayCast() return false end - curLayer:getPhysicsWorld():rayCast(func, point1, point2); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); drawNode:drawSegment(point1, point3, 1, STATIC_COLOR); if point2.x ~= point3.x or point2.y ~= point3.y then @@ -653,7 +654,7 @@ local function PhysicsDemoRayCast() return true; end - curLayer:getPhysicsWorld():rayCast(func, point1, point2); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); drawNode:drawSegment(point1, point3, 1, STATIC_COLOR); if point2.x ~= point3.x or point2.y ~= point3.y then @@ -668,7 +669,7 @@ local function PhysicsDemoRayCast() return true; end - curLayer:getPhysicsWorld():rayCast(func, point1, point2); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(func, point1, point2); drawNode:drawSegment(point1, point2, 1, STATIC_COLOR); for _, p in ipairs(points) do @@ -692,7 +693,7 @@ local function PhysicsDemoRayCast() end local function PhysicsDemoOneWayPlatform() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local touchListener = cc.EventListenerTouchOneByOne:create(); @@ -733,7 +734,7 @@ local function PhysicsDemoOneWayPlatform() end local function PhysicsDemoActions() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() local touchListener = cc.EventListenerTouchOneByOne:create() touchListener:registerScriptHandler(onTouchBegan, cc.Handler.EVENT_TOUCH_BEGAN) @@ -772,7 +773,7 @@ local function PhysicsDemoActions() end local function PhysicsDemoPump() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() layer:toggleDebug(); @@ -802,14 +803,14 @@ local function PhysicsDemoPump() eventDispatcher:addEventListenerWithSceneGraphPriority(touchListener, layer) local function update() - for _, body in ipairs(curLayer:getPhysicsWorld():getAllBodies()) do + for _, body in ipairs(cc.Director:getInstance():getRunningScene():getPhysicsWorld():getAllBodies()) do if body:getTag() == DRAG_BODYS_TAG and body:getPosition().y < 0.0 then body:getNode():setPosition(cc.p(VisibleRect:leftTop().x + 75, VisibleRect:leftTop().y + math.random() * 90, 0)); body:setVelocity(cc.p(0, 0)); end end - local gear = curLayer:getPhysicsWorld():getBody(1); + local gear = cc.Director:getInstance():getRunningScene():getPhysicsWorld():getBody(1); if gear then if distance ~= 0.0 then rotationV = rotationV + distance/2500.0; @@ -870,7 +871,7 @@ local function PhysicsDemoPump() cc.p(VisibleRect:leftBottom().x + 102, VisibleRect:leftBottom().y + 20) }; - local world = curLayer:getPhysicsWorld(); + local world = cc.Director:getInstance():getRunningScene():getPhysicsWorld(); -- small gear local sgear = cc.Node:create(); @@ -933,7 +934,7 @@ local function PhysicsDemoPump() end local function PhysicsDemoSlice() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() layer:toggleDebug() local sliceTag = 1; @@ -993,7 +994,7 @@ local function PhysicsDemoSlice() end local function onTouchEnded(touch, event) - curLayer:getPhysicsWorld():rayCast(slice, touch:getStartLocation(), touch:getLocation()); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():rayCast(slice, touch:getStartLocation(), touch:getLocation()); end local touchListener = cc.EventListenerTouchOneByOne:create(); @@ -1024,10 +1025,10 @@ end local function PhysicsDemoBug3988() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() layer:toggleDebug(); - curLayer:getPhysicsWorld():setGravity(cc.p(0, 0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0, 0)); local ball = cc.Sprite:create("Images/YellowSquare.png"); ball:setPosition(cc.p(VisibleRect:center().x-100, VisibleRect:center().y)); @@ -1047,9 +1048,9 @@ local function PhysicsDemoBug3988() end local function PhysicsContactTest() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() - curLayer:getPhysicsWorld():setGravity(cc.p(0, 0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0, 0)); local s = cc.size(VisibleRect:getVisibleRect().width, VisibleRect:getVisibleRect().height); layer.yellowBoxNum = 50; @@ -1290,11 +1291,11 @@ local function PhysicsContactTest() end local function PhysicsPositionRotationTest() - local layer = cc.Layer:createWithPhysics() + local layer = cc.Layer:create() local function onEnter() layer:toggleDebug() - curLayer:getPhysicsWorld():setGravity(cc.p(0, 0)); + cc.Director:getInstance():getRunningScene():getPhysicsWorld():setGravity(cc.p(0, 0)); local touchListener = cc.EventListenerTouchOneByOne:create() touchListener:registerScriptHandler(onTouchBegan, cc.Handler.EVENT_TOUCH_BEGAN) @@ -1350,9 +1351,10 @@ end function PhysicsTest() cclog("PhysicsTest") - local scene = cc.Scene:create() + local scene = cc.Scene:createWithPhysics() + Helper.usePhysics = true Helper.createFunctionTable = { PhysicsDemoLogoSmash, PhysicsDemoPyramidStack, diff --git a/tests/lua-tests/src/helper.lua b/tests/lua-tests/src/helper.lua index 265cc8bce3..0e242a1c43 100644 --- a/tests/lua-tests/src/helper.lua +++ b/tests/lua-tests/src/helper.lua @@ -83,7 +83,12 @@ function Helper.restartAction() end function Helper.newScene() - local scene = cc.Scene:create() + local scene + if Helper.usePhysics then + scene = cc.Scene:createWithPhysics() + else + scene = cc.Scene:create() + end Helper.currentLayer = Helper.createFunctionTable[Helper.index]() scene:addChild(Helper.currentLayer) scene:addChild(CreateBackMenuItem()) From 67a1027a34040b5aa138f4ad48825d52f1cc3ed3 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 16 May 2014 22:05:26 +0800 Subject: [PATCH 108/125] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 7e79394675..7036ad40b0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -819,6 +819,7 @@ Developers: Fixed a bug that HTTPClient reports 2xx status codes as errors Added missing Text Font and Placeholder feature of EditBox for Mac platform HttpRequest uses std::function as callback + EditBox: mac secure input iSevenDays Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG From ef3263e80de959b6ed350e3619e47a8f52b539a3 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 16 May 2014 22:09:30 +0800 Subject: [PATCH 109/125] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 34622c15ed..75eb1ab4f8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ cocos2d-x-3.1-rc0 May.16 2014 [NEW] Cocos2dxActivity: Adds a virtual method to load native libraries. + [NEW] EditBox: support secure input on Mac [FIX] Director: twice calling of onExit [FIX] Math: Vector2->Vec2, Vector3->Vec3, Vector4->Vec4, Matrix->Mat4 From 64fa90ff0fc2d23db46e1f087ab934dcc3d45ae7 Mon Sep 17 00:00:00 2001 From: Jon Segador Date: Fri, 16 May 2014 16:21:36 +0200 Subject: [PATCH 110/125] Vector2 replaced by Vec2 --- .../cpp-template-default/Classes/HelloWorldScene.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index 4ce3b8217d..cea2c2ccfa 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -28,7 +28,7 @@ bool HelloWorld::init() } Size visibleSize = Director::getInstance()->getVisibleSize(); - Vector2 origin = Director::getInstance()->getVisibleOrigin(); + Vec2 origin = Director::getInstance()->getVisibleOrigin(); ///////////////////////////// // 2. add a menu item with "X" image, which is clicked to quit the program @@ -40,12 +40,12 @@ bool HelloWorld::init() "CloseSelected.png", CC_CALLBACK_1(HelloWorld::menuCloseCallback, this)); - closeItem->setPosition(Vector2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , + closeItem->setPosition(Vec2(origin.x + visibleSize.width - closeItem->getContentSize().width/2 , origin.y + closeItem->getContentSize().height/2)); // create menu, it's an autorelease object auto menu = Menu::create(closeItem, NULL); - menu->setPosition(Vector2::ZERO); + menu->setPosition(Vec2::ZERO); this->addChild(menu, 1); ///////////////////////////// @@ -57,7 +57,7 @@ bool HelloWorld::init() auto label = LabelTTF::create("Hello World", "Arial", 24); // position the label on the center of the screen - label->setPosition(Vector2(origin.x + visibleSize.width/2, + label->setPosition(Vec2(origin.x + visibleSize.width/2, origin.y + visibleSize.height - label->getContentSize().height)); // add the label as a child to this layer @@ -67,7 +67,7 @@ bool HelloWorld::init() auto sprite = Sprite::create("HelloWorld.png"); // position the sprite on the center of the screen - sprite->setPosition(Vector2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); + sprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); // add the sprite as a child to this layer this->addChild(sprite, 0); From 38b4e7ad2cff7e2714aba3bd029bc571644b5cbb Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 16 May 2014 11:02:23 -0700 Subject: [PATCH 111/125] fix memory leak for GLProgramState create logic --- cocos/renderer/CCGLProgramState.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 6f7f05e88e..e0af0859b7 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -240,11 +240,14 @@ void VertexAttribValue::setPointer(GLint size, GLenum type, GLboolean normalized GLProgramState* GLProgramState::create(GLProgram *glprogram) { GLProgramState* ret = nullptr; - ret = new (std::nothrow) GLProgramState; - if(!ret || !ret->init(glprogram)) - CC_SAFE_RELEASE(ret); - - return ret; + ret = new (std::nothrow) GLProgramState(); + if(ret && ret->init(glprogram)) + { + ret->autorelease(); + return ret; + } + CC_SAFE_DELETE(ret); + return nullptr; } GLProgramState* GLProgramState::getOrCreateWithGLProgramName(const std::string &glProgramName ) From 0f672473255ba78e212155cb325efa8e1e3a7d37 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 16 May 2014 14:36:00 -0700 Subject: [PATCH 112/125] Squashed commit of the following: commit a794d107ad85667e3d754f0b6251fc864dfbf288 Author: Ricardo Quesada Date: Fri May 16 14:33:49 2014 -0700 Yeah... everything compiles on win32 and wp8 commit 4740be6e4a0d16f742c27996e7ab2c100adc76af Author: Ricardo Quesada Date: Fri May 16 13:58:38 2014 -0700 CCIME moved to base and compiles on Android commit ff3e1bf1eb27a01019f4e1b56d1aebbe2d385f72 Author: Ricardo Quesada Date: Fri May 16 13:02:57 2014 -0700 compiles Ok for Windows Phone 8 commit 8160a4eb2ecdc61b5bd1cf56b90d2da6f11e3ebd Author: Ricardo Quesada Date: Fri May 16 12:25:31 2014 -0700 fixes for Windows Phone 8 commit 418197649efc93032aee0adc205e502101cdb53d Author: Ricardo Quesada Date: Fri May 16 11:15:13 2014 -0700 Compiles on Win32 commit 08813ed7cf8ac1079ffadeb1ce78ea9e833e1a33 Author: Ricardo Quesada Date: Fri May 16 10:08:31 2014 -0700 Compiles on linux! commit 118896521e5b335a5257090b6863f1fb2a2002fe Author: Ricardo Quesada Date: Fri May 16 09:30:42 2014 -0700 moves cocos/2d/platform -> cocos/platform commit 4fe9319d7717b0c1bccb2db0156eeb86255a89e0 Merge: bd68ec2 511295e Author: Ricardo Quesada Date: Fri May 16 08:24:41 2014 -0700 Merge remote-tracking branch 'cocos2d/v3' into files commit bd68ec2f0e3a826d8b2f4b60564ba65ce766bc56 Author: Ricardo Quesada Date: Thu May 15 19:36:23 2014 -0700 files in the correct directory --- CMakeLists.txt | 4 +- build/android-build.py | 2 +- build/cocos2d_libs.xcodeproj/project.pbxproj | 2513 ++++++++--------- build/cocos2d_tests.xcodeproj/project.pbxproj | 32 +- cocos/2d/CCActionGrid.cpp | 4 +- cocos/2d/CCActionInstant.cpp | 2 +- cocos/2d/CCActionInterval.h | 5 +- cocos/2d/CCActionManager.cpp | 4 +- cocos/2d/CCAnimation.cpp | 6 +- cocos/2d/CCAnimationCache.cpp | 2 +- cocos/2d/CCAtlasNode.cpp | 4 +- cocos/2d/CCAtlasNode.h | 2 +- cocos/2d/CCComponent.cpp | 2 +- cocos/2d/CCComponent.h | 2 +- cocos/2d/CCFont.cpp | 4 +- cocos/2d/CCFontAtlas.cpp | 2 +- cocos/2d/CCFontCharMap.cpp | 6 +- cocos/2d/CCFontFNT.cpp | 11 +- cocos/2d/CCFontFreeType.cpp | 9 +- cocos/2d/CCGrabber.cpp | 2 +- cocos/2d/CCGrid.cpp | 2 +- cocos/2d/CCGrid.h | 2 +- cocos/2d/CCLabel.cpp | 4 +- cocos/2d/CCLabelAtlas.cpp | 10 +- cocos/2d/CCLabelTextFormatter.cpp | 5 +- cocos/2d/CCLabelTextFormatter.h | 2 + cocos/2d/CCLayer.cpp | 4 +- cocos/2d/CCLayer.h | 2 +- cocos/2d/CCMenuItem.cpp | 2 +- cocos/2d/CCMenuItem.h | 2 +- cocos/2d/CCMotionStreak.cpp | 9 +- cocos/2d/CCMotionStreak.h | 4 +- cocos/2d/CCNode.cpp | 4 +- cocos/2d/CCNode.h | 4 +- cocos/2d/CCParallaxNode.cpp | 2 +- cocos/2d/CCParticleBatchNode.cpp | 6 +- cocos/2d/CCParticleBatchNode.h | 2 +- cocos/2d/CCParticleExamples.cpp | 9 +- cocos/2d/CCParticleSystem.cpp | 14 +- cocos/2d/CCParticleSystem.h | 2 +- cocos/2d/CCParticleSystemQuad.cpp | 2 +- cocos/2d/CCProgressTimer.cpp | 2 +- cocos/2d/CCRenderTexture.cpp | 26 +- cocos/2d/CCRenderTexture.h | 2 +- cocos/2d/CCSprite.cpp | 10 +- cocos/2d/CCSprite.h | 4 +- cocos/2d/CCSpriteBatchNode.cpp | 6 +- cocos/2d/CCSpriteBatchNode.h | 4 +- cocos/2d/CCSpriteFrame.cpp | 3 +- cocos/2d/CCSpriteFrame.h | 2 +- cocos/2d/CCSpriteFrameCache.cpp | 18 +- cocos/2d/CCSpriteFrameCache.h | 2 +- cocos/2d/CCTMXLayer.cpp | 8 +- cocos/2d/CCTMXLayer.h | 2 +- cocos/2d/CCTMXXMLParser.cpp | 2 +- cocos/2d/CCTMXXMLParser.h | 2 +- cocos/2d/CCTextFieldTTF.h | 2 +- cocos/2d/CCTileMapAtlas.cpp | 6 +- cocos/2d/CMakeLists.txt | 70 +- cocos/2d/cocos2d.vcxproj | 161 +- cocos/2d/cocos2d.vcxproj.filters | 1568 +++++----- cocos/2d/cocos2d_headers.props | 2 +- cocos/2d/cocos2d_winrt_headers.props | 2 +- cocos/2d/cocos2d_wp8.vcxproj | 246 +- cocos/2d/cocos2d_wp8.vcxproj.filters | 1675 ++++++----- cocos/2d/cocos2d_wp8_headers.props | 2 +- .../platform/android/java/project.properties | 15 - .../wp8-xaml/CopyTemplateFiles.vcxproj.user | 6 - cocos/Android.mk | 85 +- cocos/CMakeLists.txt | 3 +- cocos/audio/android/Android.mk | 6 +- cocos/base/CCConfiguration.cpp | 2 +- cocos/base/CCConsole.cpp | 4 +- cocos/base/CCData.cpp | 2 +- cocos/base/CCDirector.cpp | 18 +- cocos/base/CCEventListener.cpp | 2 +- cocos/{2d => base}/CCIMEDelegate.h | 0 cocos/{2d => base}/CCIMEDispatcher.cpp | 2 +- cocos/{2d => base}/CCIMEDispatcher.h | 2 +- cocos/base/CCPlatformConfig.h | 6 +- cocos/{2d => base}/CCProtocols.h | 11 +- cocos/base/CCRef.cpp | 2 +- cocos/base/CCRef.h | 6 +- cocos/base/CCScheduler.cpp | 6 +- cocos/base/CCScheduler.h | 2 +- cocos/{2d => base}/CCScriptSupport.cpp | 2 +- cocos/{2d => base}/CCScriptSupport.h | 2 +- cocos/{2d => base}/CCUserDefault.cpp | 6 +- cocos/{2d => base}/CCUserDefault.h | 0 cocos/{2d => base}/CCUserDefault.mm | 0 cocos/{2d => base}/CCUserDefaultAndroid.cpp | 8 +- cocos/base/CMakeLists.txt | 26 +- cocos/{2d => base}/TGAlib.cpp | 2 +- cocos/{2d => base}/TGAlib.h | 0 cocos/base/ZipUtils.cpp | 2 +- cocos/base/ZipUtils.h | 2 +- cocos/{2d => base}/ccCArray.cpp | 2 +- cocos/{2d => base}/ccCArray.h | 0 cocos/{2d => base}/ccFPSImages.c | 2 +- cocos/{2d => base}/ccFPSImages.h | 6 +- cocos/base/ccMacros.h | 6 +- cocos/base/ccTypes.h | 7 +- cocos/{2d => base}/ccUTF8.cpp | 2 +- cocos/{2d => base}/ccUTF8.h | 0 cocos/{2d => base}/ccUtils.cpp | 3 +- cocos/{2d => base}/ccUtils.h | 0 cocos/{2d => base}/firePngData.h | 0 cocos/{2d => base}/uthash.h | 0 cocos/{2d => base}/utlist.h | 0 ...cocos2dx-Prefix.pch => cocos2d-prefix.pch} | 0 cocos/cocos2d.h | 114 +- cocos/deprecated/CCArray.cpp | 2 +- cocos/deprecated/CCArray.h | 2 +- cocos/deprecated/CCDictionary.cpp | 2 +- cocos/deprecated/CCDictionary.h | 2 +- cocos/deprecated/CCInteger.h | 2 +- cocos/deprecated/CCNotificationCenter.cpp | 8 +- cocos/deprecated/CCString.cpp | 2 +- .../editor-support/cocosbuilder/CCBReader.cpp | 4 +- .../cocostudio/CCDataReaderHelper.cpp | 2 +- .../cocostudio/CCInputDelegate.cpp | 2 +- cocos/editor-support/spine/CCSkeleton.h | 4 +- cocos/math/CCMath.h | 8 +- cocos/{2d => math}/CCVertex.cpp | 2 +- cocos/{2d => math}/CCVertex.h | 0 cocos/math/CMakeLists.txt | 19 +- cocos/math/{Matrix.cpp => Mat4.cpp} | 6 +- cocos/math/{Matrix.h => Mat4.h} | 6 +- cocos/math/{Matrix.inl => Mat4.inl} | 2 +- cocos/math/Quaternion.h | 4 +- cocos/math/{Vector2.cpp => Vec2.cpp} | 10 +- cocos/math/{Vector2.h => Vec2.h} | 2 +- cocos/math/{Vector2.inl => Vec2.inl} | 2 +- cocos/math/{Vector3.cpp => Vec3.cpp} | 4 +- cocos/math/{Vector3.h => Vec3.h} | 2 +- cocos/math/{Vector3.inl => Vec3.inl} | 4 +- cocos/math/{Vector4.cpp => Vec4.cpp} | 4 +- cocos/math/{Vector4.h => Vec4.h} | 2 +- cocos/math/{Vector4.inl => Vec4.inl} | 4 +- cocos/network/HttpClient.cpp | 2 +- .../{2d => }/platform/CCApplicationProtocol.h | 0 cocos/{2d => }/platform/CCCommon.h | 0 cocos/{2d => }/platform/CCDevice.h | 0 cocos/{2d => }/platform/CCFileUtils.cpp | 8 +- cocos/{2d => }/platform/CCFileUtils.h | 8 +- cocos/{2d => }/platform/CCGLViewProtocol.cpp | 3 +- cocos/{2d => }/platform/CCGLViewProtocol.h | 0 cocos/{2d => }/platform/CCImage.cpp | 10 +- cocos/{2d => }/platform/CCImage.h | 2 +- cocos/{2d => }/platform/CCSAXParser.cpp | 8 +- cocos/{2d => }/platform/CCSAXParser.h | 2 +- cocos/{2d => }/platform/CCThread.cpp | 2 +- cocos/{2d => }/platform/CCThread.h | 3 +- cocos/platform/CMakeLists.txt | 43 + cocos/{2d => }/platform/android/Android.mk | 0 .../platform/android/CCApplication.cpp | 0 .../{2d => }/platform/android/CCApplication.h | 4 +- cocos/{2d => }/platform/android/CCCommon.cpp | 2 +- cocos/{2d => }/platform/android/CCDevice.cpp | 4 +- .../platform/android/CCFileUtilsAndroid.cpp | 2 +- .../platform/android/CCFileUtilsAndroid.h | 2 +- cocos/{2d => }/platform/android/CCGL.h | 0 cocos/{2d => }/platform/android/CCGLView.cpp | 0 cocos/{2d => }/platform/android/CCGLView.h | 2 +- .../platform/android/CCPlatformDefine.h | 0 cocos/{2d => }/platform/android/CCStdC.h | 0 .../{2d => }/platform/android/java/.classpath | 0 cocos/{2d => }/platform/android/java/.project | 0 .../java/.settings/org.eclipse.jdt.core.prefs | 0 .../platform/android/java/AndroidManifest.xml | 0 .../platform/android/java/ant.properties | 0 .../{2d => }/platform/android/java/build.xml | 0 .../android/java/proguard-project.txt | 0 .../platform/android/java/res/.gitignore | 0 .../cocos2dx/lib/Cocos2dxAccelerometer.java | 0 .../org/cocos2dx/lib/Cocos2dxActivity.java | 0 .../src/org/cocos2dx/lib/Cocos2dxBitmap.java | 0 .../org/cocos2dx/lib/Cocos2dxETCLoader.java | 0 .../cocos2dx/lib/Cocos2dxEditBoxDialog.java | 0 .../org/cocos2dx/lib/Cocos2dxEditText.java | 0 .../cocos2dx/lib/Cocos2dxGLSurfaceView.java | 0 .../src/org/cocos2dx/lib/Cocos2dxHandler.java | 0 .../src/org/cocos2dx/lib/Cocos2dxHelper.java | 0 .../cocos2dx/lib/Cocos2dxLocalStorage.java | 0 .../cocos2dx/lib/Cocos2dxLuaJavaBridge.java | 0 .../src/org/cocos2dx/lib/Cocos2dxMusic.java | 0 .../org/cocos2dx/lib/Cocos2dxRenderer.java | 0 .../src/org/cocos2dx/lib/Cocos2dxSound.java | 0 .../cocos2dx/lib/Cocos2dxTextInputWraper.java | 0 .../org/cocos2dx/lib/Cocos2dxTypefaces.java | 0 .../org/cocos2dx/lib/Cocos2dxVideoHelper.java | 0 .../org/cocos2dx/lib/Cocos2dxVideoView.java | 0 .../platform/android/javaactivity.cpp | 21 +- .../{2d => }/platform/android/jni/DPIJni.cpp | 0 cocos/{2d => }/platform/android/jni/DPIJni.h | 0 .../{2d => }/platform/android/jni/IMEJni.cpp | 2 +- cocos/{2d => }/platform/android/jni/IMEJni.h | 0 ...org_cocos2dx_lib_Cocos2dxAccelerometer.cpp | 6 +- .../Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp | 2 +- .../Java_org_cocos2dx_lib_Cocos2dxBitmap.h | 0 .../Java_org_cocos2dx_lib_Cocos2dxHelper.cpp | 0 .../Java_org_cocos2dx_lib_Cocos2dxHelper.h | 0 ...Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp | 6 +- .../platform/android/jni/JniHelper.cpp | 0 .../{2d => }/platform/android/jni/JniHelper.h | 0 .../platform/android/jni/TouchesJni.cpp | 4 +- .../platform/apple/CCFileUtilsApple.h | 0 .../platform/apple/CCFileUtilsApple.mm | 0 cocos/{2d => }/platform/apple/CCLock.cpp | 0 cocos/{2d => }/platform/apple/CCLock.h | 0 cocos/{2d => }/platform/apple/CCThread.mm | 0 cocos/{2d => }/platform/desktop/CCGLView.cpp | 2 +- cocos/{2d => }/platform/desktop/CCGLView.h | 4 +- cocos/{2d => }/platform/ios/CCApplication.h | 4 +- cocos/{2d => }/platform/ios/CCApplication.mm | 0 cocos/{2d => }/platform/ios/CCCommon.mm | 2 +- cocos/{2d => }/platform/ios/CCDevice.mm | 0 .../{2d => }/platform/ios/CCDirectorCaller.h | 7 + .../{2d => }/platform/ios/CCDirectorCaller.mm | 7 + cocos/{2d => }/platform/ios/CCEAGLView.h | 0 cocos/{2d => }/platform/ios/CCEAGLView.mm | 0 cocos/{2d => }/platform/ios/CCES2Renderer.h | 0 cocos/{2d => }/platform/ios/CCES2Renderer.m | 0 cocos/{2d => }/platform/ios/CCESRenderer.h | 0 cocos/{2d => }/platform/ios/CCGL.h | 0 cocos/{2d => }/platform/ios/CCGLView.h | 4 +- cocos/{2d => }/platform/ios/CCGLView.mm | 1 - cocos/{2d => }/platform/ios/CCImage.mm | 6 +- .../{2d => }/platform/ios/CCPlatformDefine.h | 0 cocos/{2d => }/platform/ios/CCStdC.h | 0 cocos/{2d => }/platform/ios/OpenGL_Internal.h | 0 .../{2d => }/platform/linux/CCApplication.cpp | 2 +- cocos/{2d => }/platform/linux/CCApplication.h | 4 +- cocos/{2d => }/platform/linux/CCCommon.cpp | 2 +- cocos/{2d => }/platform/linux/CCDevice.cpp | 4 +- .../platform/linux/CCFileUtilsLinux.cpp | 2 +- .../platform/linux/CCFileUtilsLinux.h | 2 +- cocos/{2d => }/platform/linux/CCGL.h | 0 .../platform/linux/CCPlatformDefine.h | 0 cocos/{2d => }/platform/linux/CCStdC.cpp | 0 cocos/{2d => }/platform/linux/CCStdC.h | 0 cocos/{2d => }/platform/mac/CCApplication.h | 4 +- cocos/{2d => }/platform/mac/CCApplication.mm | 5 +- cocos/{2d => }/platform/mac/CCCommon.mm | 2 +- cocos/{2d => }/platform/mac/CCDevice.mm | 2 +- cocos/{2d => }/platform/mac/CCGL.h | 0 .../{2d => }/platform/mac/CCPlatformDefine.h | 0 cocos/{2d => }/platform/mac/CCStdC.h | 0 .../{2d => }/platform/win32/CCApplication.cpp | 2 +- cocos/{2d => }/platform/win32/CCApplication.h | 4 +- cocos/{2d => }/platform/win32/CCCommon.cpp | 2 +- cocos/{2d => }/platform/win32/CCDevice.cpp | 4 +- .../platform/win32/CCFileUtilsWin32.cpp | 2 +- .../platform/win32/CCFileUtilsWin32.h | 2 +- cocos/{2d => }/platform/win32/CCGL.h | 0 .../platform/win32/CCPlatformDefine.h | 0 cocos/{2d => }/platform/win32/CCStdC.cpp | 0 cocos/{2d => }/platform/win32/CCStdC.h | 0 cocos/{2d => }/platform/win32/compat/stdint.h | 0 .../{2d => }/platform/winrt/CCApplication.cpp | 2 +- cocos/{2d => }/platform/winrt/CCApplication.h | 2 +- cocos/{2d => }/platform/winrt/CCCommon.cpp | 0 cocos/{2d => }/platform/winrt/CCDevice.cpp | 2 +- .../platform/winrt/CCFileUtilsWinRT.cpp | 0 .../platform/winrt/CCFileUtilsWinRT.h | 7 +- .../platform/winrt/CCFreeTypeFont.cpp | 2 +- .../{2d => }/platform/winrt/CCFreeTypeFont.h | 0 cocos/{2d => }/platform/winrt/CCGL.h | 0 cocos/{2d => }/platform/winrt/CCGLView.cpp | 13 +- cocos/{2d => }/platform/winrt/CCGLView.h | 5 + cocos/{2d => }/platform/winrt/CCGL_Angle.h | 0 .../platform/winrt/CCPThreadWinRT.cpp | 8 +- .../{2d => }/platform/winrt/CCPThreadWinRT.h | 12 +- .../platform/winrt/CCPlatformDefine.h | 0 .../platform/winrt/CCPrecompiledShaders.cpp | 0 .../platform/winrt/CCPrecompiledShaders.h | 0 cocos/{2d => }/platform/winrt/CCStdC.cpp | 0 cocos/{2d => }/platform/winrt/CCStdC.h | 4 +- .../{2d => }/platform/winrt/CCWinRTUtils.cpp | 0 cocos/{2d => }/platform/winrt/CCWinRTUtils.h | 2 +- cocos/{2d => }/platform/winrt/DirectXBase.cpp | 6 +- cocos/{2d => }/platform/winrt/DirectXBase.h | 5 + cocos/{2d => }/platform/winrt/DirectXHelper.h | 6 + cocos/{2d => }/platform/winrt/InputEvent.cpp | 2 +- cocos/{2d => }/platform/winrt/InputEvent.h | 0 .../{2d => }/platform/winrt/InputEventTypes.h | 0 .../platform/winrt/inet_ntop_winrt.cpp | 0 .../{2d => }/platform/winrt/inet_ntop_winrt.h | 0 cocos/{2d => }/platform/winrt/pch.cpp | 0 cocos/{2d => }/platform/winrt/pch.h | 0 cocos/{2d => }/platform/winrt/sha1.cpp | 0 cocos/{2d => }/platform/winrt/sha1.h | 0 .../winrt/shaders/precompiledshaders.h | 0 .../wp8-xaml/CopyTemplateFiles.vcxproj | 0 .../CopyTemplateFiles.vcxproj.filters | 0 .../platform/wp8-xaml/cpp/Cocos2dRenderer.cpp | 0 .../platform/wp8-xaml/cpp/Cocos2dRenderer.h | 0 .../wp8-xaml/cpp/Direct3DContentProvider.cpp | 0 .../wp8-xaml/cpp/Direct3DContentProvider.h | 0 .../platform/wp8-xaml/cpp/Direct3DInterop.cpp | 0 .../platform/wp8-xaml/cpp/Direct3DInterop.h | 0 .../platform/wp8-xaml/cpp/DirectXBase.cpp | 0 .../platform/wp8-xaml/cpp/DirectXBase.h | 0 .../platform/wp8-xaml/cpp/DirectXHelper.h | 0 .../platform/wp8-xaml/cpp/EditBoxEvent.cpp | 0 .../platform/wp8-xaml/cpp/EditBoxEvent.h | 0 .../{2d => }/platform/wp8-xaml/xaml/App.xaml | 0 .../platform/wp8-xaml/xaml/App.xaml.cs | 0 .../platform/wp8-xaml/xaml/EditBox.xaml | 0 .../platform/wp8-xaml/xaml/EditBox.xaml.cs | 0 .../platform/wp8-xaml/xaml/MainPage.xaml | 0 .../platform/wp8-xaml/xaml/MainPage.xaml.cs | 0 cocos/{2d => }/platform/wp8/CCGLView.cpp | 14 +- cocos/{2d => }/platform/wp8/CCGLView.h | 8 +- cocos/{2d => }/platform/wp8/Direct3DBase.cpp | 20 +- cocos/{2d => }/platform/wp8/Direct3DBase.h | 11 +- cocos/{2d => }/platform/wp8/DirectXBase.cpp | 0 cocos/{2d => }/platform/wp8/DirectXBase.h | 0 .../platform/wp8/shaders/precompiledshaders.h | 0 cocos/renderer/CCBatchCommand.cpp | 4 +- cocos/renderer/CCBatchCommand.h | 2 +- cocos/renderer/CCCustomCommand.h | 4 +- cocos/renderer/CCGLProgram.cpp | 16 +- cocos/renderer/CCGLProgram.h | 3 +- cocos/renderer/CCGLProgramCache.cpp | 1 + cocos/renderer/CCGLProgramCache.h | 4 +- cocos/renderer/CCGLProgramState.cpp | 3 +- cocos/renderer/CCGLProgramState.h | 10 +- cocos/renderer/CCGLProgramStateCache.cpp | 1 + cocos/renderer/CCGLProgramStateCache.h | 7 +- cocos/renderer/CCGroupCommand.h | 4 +- cocos/renderer/CCQuadCommand.cpp | 1 + cocos/renderer/CCRenderCommand.cpp | 2 +- cocos/renderer/CCRenderCommand.h | 3 +- cocos/renderer/CCRenderCommandPool.h | 2 + cocos/renderer/CCRenderer.h | 9 +- cocos/{2d => renderer}/CCTexture2D.cpp | 11 +- cocos/{2d => renderer}/CCTexture2D.h | 0 cocos/{2d => renderer}/CCTextureAtlas.cpp | 25 +- cocos/{2d => renderer}/CCTextureAtlas.h | 3 +- cocos/{2d => renderer}/CCTextureCache.cpp | 12 +- cocos/{2d => renderer}/CCTextureCache.h | 6 +- cocos/renderer/CMakeLists.txt | 27 +- cocos/renderer/ccGLStateCache.cpp | 1 + .../lua-bindings/manual/CCLuaEngine.h | 2 +- .../platform/android/CCLuaJavaBridge.cpp | 2 +- .../project.pbxproj | 8 +- extensions/GUI/CCEditBox/CCEditBox.h | 2 +- extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp | 4 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- .../GUI/CCScrollView/CCTableViewCell.cpp | 2 +- .../proj.android/jni/hellocpp/main.cpp | 2 +- .../proj.android/project.properties | 2 +- .../proj.android/jni/hellolua/main.cpp | 2 +- .../proj.android/project.properties | 2 +- .../runtime-src/proj.android/jni/lua/main.cpp | 2 +- .../proj.android/project.properties | 2 +- .../cpp-empty-test/cpp-empty-test.csproj | 43 +- .../cpp-empty-testComponent.vcxproj | 22 +- .../cpp-empty-testComponent.vcxproj.filters | 22 +- .../cpp-empty-test/proj.android/jni/main.cpp | 2 +- .../proj.android/project.properties | 2 +- tests/cpp-tests/proj.android/jni/main.cpp | 2 +- .../cpp-tests/proj.android/project.properties | 2 +- .../proj.wp8-xaml/cpp-tests/cpp-tests.csproj | 43 +- .../cpp-testsComponent.vcxproj | 24 +- .../cpp-testsComponent.vcxproj.filters | 28 +- .../project/Classes/AppDelegate.cpp | 2 +- .../project/proj.android/jni/main.cpp | 2 +- .../project/proj.android/project.properties | 2 +- .../project/proj.android/jni/main.cpp | 2 +- .../project/proj.android/project.properties | 2 +- 372 files changed, 3794 insertions(+), 3985 deletions(-) delete mode 100644 cocos/2d/platform/android/java/project.properties delete mode 100644 cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.user rename cocos/{2d => base}/CCIMEDelegate.h (100%) rename cocos/{2d => base}/CCIMEDispatcher.cpp (99%) rename cocos/{2d => base}/CCIMEDispatcher.h (99%) rename cocos/{2d => base}/CCProtocols.h (98%) rename cocos/{2d => base}/CCScriptSupport.cpp (99%) rename cocos/{2d => base}/CCScriptSupport.h (99%) rename cocos/{2d => base}/CCUserDefault.cpp (99%) rename cocos/{2d => base}/CCUserDefault.h (100%) rename cocos/{2d => base}/CCUserDefault.mm (100%) rename cocos/{2d => base}/CCUserDefaultAndroid.cpp (98%) rename cocos/{2d => base}/TGAlib.cpp (99%) rename cocos/{2d => base}/TGAlib.h (100%) rename cocos/{2d => base}/ccCArray.cpp (99%) rename cocos/{2d => base}/ccCArray.h (100%) rename cocos/{2d => base}/ccFPSImages.c (99%) rename cocos/{2d => base}/ccFPSImages.h (93%) rename cocos/{2d => base}/ccUTF8.cpp (99%) rename cocos/{2d => base}/ccUTF8.h (100%) rename cocos/{2d => base}/ccUtils.cpp (98%) rename cocos/{2d => base}/ccUtils.h (100%) rename cocos/{2d => base}/firePngData.h (100%) rename cocos/{2d => base}/uthash.h (100%) rename cocos/{2d => base}/utlist.h (100%) rename cocos/{2d/cocos2dx-Prefix.pch => cocos2d-prefix.pch} (100%) rename cocos/{2d => math}/CCVertex.cpp (99%) rename cocos/{2d => math}/CCVertex.h (100%) rename cocos/math/{Matrix.cpp => Mat4.cpp} (99%) rename cocos/math/{Matrix.h => Mat4.h} (99%) rename cocos/math/{Matrix.inl => Mat4.inl} (98%) rename cocos/math/{Vector2.cpp => Vec2.cpp} (98%) rename cocos/math/{Vector2.h => Vec2.h} (99%) rename cocos/math/{Vector2.inl => Vec2.inl} (98%) rename cocos/math/{Vector3.cpp => Vec3.cpp} (99%) rename cocos/math/{Vector3.h => Vec3.h} (99%) rename cocos/math/{Vector3.inl => Vec3.inl} (97%) rename cocos/math/{Vector4.cpp => Vec4.cpp} (99%) rename cocos/math/{Vector4.h => Vec4.h} (99%) rename cocos/math/{Vector4.inl => Vec4.inl} (97%) rename cocos/{2d => }/platform/CCApplicationProtocol.h (100%) rename cocos/{2d => }/platform/CCCommon.h (100%) rename cocos/{2d => }/platform/CCDevice.h (100%) rename cocos/{2d => }/platform/CCFileUtils.cpp (99%) rename cocos/{2d => }/platform/CCFileUtils.h (100%) rename cocos/{2d => }/platform/CCGLViewProtocol.cpp (99%) rename cocos/{2d => }/platform/CCGLViewProtocol.h (100%) rename cocos/{2d => }/platform/CCImage.cpp (99%) rename cocos/{2d => }/platform/CCImage.h (99%) rename cocos/{2d => }/platform/CCSAXParser.cpp (98%) rename cocos/{2d => }/platform/CCSAXParser.h (98%) rename cocos/{2d => }/platform/CCThread.cpp (98%) rename cocos/{2d => }/platform/CCThread.h (98%) create mode 100644 cocos/platform/CMakeLists.txt rename cocos/{2d => }/platform/android/Android.mk (100%) rename cocos/{2d => }/platform/android/CCApplication.cpp (100%) rename cocos/{2d => }/platform/android/CCApplication.h (97%) rename cocos/{2d => }/platform/android/CCCommon.cpp (98%) rename cocos/{2d => }/platform/android/CCDevice.cpp (99%) rename cocos/{2d => }/platform/android/CCFileUtilsAndroid.cpp (99%) rename cocos/{2d => }/platform/android/CCFileUtilsAndroid.h (98%) rename cocos/{2d => }/platform/android/CCGL.h (100%) rename cocos/{2d => }/platform/android/CCGLView.cpp (100%) rename cocos/{2d => }/platform/android/CCGLView.h (98%) rename cocos/{2d => }/platform/android/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/android/CCStdC.h (100%) rename cocos/{2d => }/platform/android/java/.classpath (100%) rename cocos/{2d => }/platform/android/java/.project (100%) rename cocos/{2d => }/platform/android/java/.settings/org.eclipse.jdt.core.prefs (100%) rename cocos/{2d => }/platform/android/java/AndroidManifest.xml (100%) rename cocos/{2d => }/platform/android/java/ant.properties (100%) rename cocos/{2d => }/platform/android/java/build.xml (100%) rename cocos/{2d => }/platform/android/java/proguard-project.txt (100%) rename cocos/{2d => }/platform/android/java/res/.gitignore (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java (100%) rename cocos/{2d => }/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java (100%) rename cocos/{2d => }/platform/android/javaactivity.cpp (89%) rename cocos/{2d => }/platform/android/jni/DPIJni.cpp (100%) rename cocos/{2d => }/platform/android/jni/DPIJni.h (100%) rename cocos/{2d => }/platform/android/jni/IMEJni.cpp (98%) rename cocos/{2d => }/platform/android/jni/IMEJni.h (100%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp (86%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp (98%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h (100%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp (100%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h (100%) rename cocos/{2d => }/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp (94%) rename cocos/{2d => }/platform/android/jni/JniHelper.cpp (100%) rename cocos/{2d => }/platform/android/jni/JniHelper.h (100%) rename cocos/{2d => }/platform/android/jni/TouchesJni.cpp (98%) rename cocos/{2d => }/platform/apple/CCFileUtilsApple.h (100%) rename cocos/{2d => }/platform/apple/CCFileUtilsApple.mm (100%) rename cocos/{2d => }/platform/apple/CCLock.cpp (100%) rename cocos/{2d => }/platform/apple/CCLock.h (100%) rename cocos/{2d => }/platform/apple/CCThread.mm (100%) rename cocos/{2d => }/platform/desktop/CCGLView.cpp (99%) rename cocos/{2d => }/platform/desktop/CCGLView.h (98%) rename cocos/{2d => }/platform/ios/CCApplication.h (97%) rename cocos/{2d => }/platform/ios/CCApplication.mm (100%) rename cocos/{2d => }/platform/ios/CCCommon.mm (97%) rename cocos/{2d => }/platform/ios/CCDevice.mm (100%) rename cocos/{2d => }/platform/ios/CCDirectorCaller.h (92%) rename cocos/{2d => }/platform/ios/CCDirectorCaller.mm (96%) rename cocos/{2d => }/platform/ios/CCEAGLView.h (100%) rename cocos/{2d => }/platform/ios/CCEAGLView.mm (100%) rename cocos/{2d => }/platform/ios/CCES2Renderer.h (100%) rename cocos/{2d => }/platform/ios/CCES2Renderer.m (100%) rename cocos/{2d => }/platform/ios/CCESRenderer.h (100%) rename cocos/{2d => }/platform/ios/CCGL.h (100%) rename cocos/{2d => }/platform/ios/CCGLView.h (97%) rename cocos/{2d => }/platform/ios/CCGLView.mm (99%) rename cocos/{2d => }/platform/ios/CCImage.mm (98%) rename cocos/{2d => }/platform/ios/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/ios/CCStdC.h (100%) rename cocos/{2d => }/platform/ios/OpenGL_Internal.h (100%) rename cocos/{2d => }/platform/linux/CCApplication.cpp (99%) rename cocos/{2d => }/platform/linux/CCApplication.h (97%) rename cocos/{2d => }/platform/linux/CCCommon.cpp (97%) rename cocos/{2d => }/platform/linux/CCDevice.cpp (99%) rename cocos/{2d => }/platform/linux/CCFileUtilsLinux.cpp (99%) rename cocos/{2d => }/platform/linux/CCFileUtilsLinux.h (98%) rename cocos/{2d => }/platform/linux/CCGL.h (100%) rename cocos/{2d => }/platform/linux/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/linux/CCStdC.cpp (100%) rename cocos/{2d => }/platform/linux/CCStdC.h (100%) rename cocos/{2d => }/platform/mac/CCApplication.h (97%) rename cocos/{2d => }/platform/mac/CCApplication.mm (99%) rename cocos/{2d => }/platform/mac/CCCommon.mm (98%) rename cocos/{2d => }/platform/mac/CCDevice.mm (99%) rename cocos/{2d => }/platform/mac/CCGL.h (100%) rename cocos/{2d => }/platform/mac/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/mac/CCStdC.h (100%) rename cocos/{2d => }/platform/win32/CCApplication.cpp (99%) rename cocos/{2d => }/platform/win32/CCApplication.h (97%) rename cocos/{2d => }/platform/win32/CCCommon.cpp (98%) rename cocos/{2d => }/platform/win32/CCDevice.cpp (99%) rename cocos/{2d => }/platform/win32/CCFileUtilsWin32.cpp (99%) rename cocos/{2d => }/platform/win32/CCFileUtilsWin32.h (99%) rename cocos/{2d => }/platform/win32/CCGL.h (100%) rename cocos/{2d => }/platform/win32/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/win32/CCStdC.cpp (100%) rename cocos/{2d => }/platform/win32/CCStdC.h (100%) rename cocos/{2d => }/platform/win32/compat/stdint.h (100%) rename cocos/{2d => }/platform/winrt/CCApplication.cpp (99%) rename cocos/{2d => }/platform/winrt/CCApplication.h (98%) rename cocos/{2d => }/platform/winrt/CCCommon.cpp (100%) rename cocos/{2d => }/platform/winrt/CCDevice.cpp (99%) rename cocos/{2d => }/platform/winrt/CCFileUtilsWinRT.cpp (100%) rename cocos/{2d => }/platform/winrt/CCFileUtilsWinRT.h (97%) rename cocos/{2d => }/platform/winrt/CCFreeTypeFont.cpp (99%) rename cocos/{2d => }/platform/winrt/CCFreeTypeFont.h (100%) rename cocos/{2d => }/platform/winrt/CCGL.h (100%) rename cocos/{2d => }/platform/winrt/CCGLView.cpp (98%) rename cocos/{2d => }/platform/winrt/CCGLView.h (97%) rename cocos/{2d => }/platform/winrt/CCGL_Angle.h (100%) rename cocos/{2d => }/platform/winrt/CCPThreadWinRT.cpp (92%) rename cocos/{2d => }/platform/winrt/CCPThreadWinRT.h (91%) rename cocos/{2d => }/platform/winrt/CCPlatformDefine.h (100%) rename cocos/{2d => }/platform/winrt/CCPrecompiledShaders.cpp (100%) rename cocos/{2d => }/platform/winrt/CCPrecompiledShaders.h (100%) rename cocos/{2d => }/platform/winrt/CCStdC.cpp (100%) rename cocos/{2d => }/platform/winrt/CCStdC.h (97%) rename cocos/{2d => }/platform/winrt/CCWinRTUtils.cpp (100%) rename cocos/{2d => }/platform/winrt/CCWinRTUtils.h (98%) rename cocos/{2d => }/platform/winrt/DirectXBase.cpp (99%) rename cocos/{2d => }/platform/winrt/DirectXBase.h (96%) rename cocos/{2d => }/platform/winrt/DirectXHelper.h (92%) rename cocos/{2d => }/platform/winrt/InputEvent.cpp (98%) rename cocos/{2d => }/platform/winrt/InputEvent.h (100%) rename cocos/{2d => }/platform/winrt/InputEventTypes.h (100%) rename cocos/{2d => }/platform/winrt/inet_ntop_winrt.cpp (100%) rename cocos/{2d => }/platform/winrt/inet_ntop_winrt.h (100%) rename cocos/{2d => }/platform/winrt/pch.cpp (100%) rename cocos/{2d => }/platform/winrt/pch.h (100%) rename cocos/{2d => }/platform/winrt/sha1.cpp (100%) rename cocos/{2d => }/platform/winrt/sha1.h (100%) rename cocos/{2d => }/platform/winrt/shaders/precompiledshaders.h (100%) rename cocos/{2d => }/platform/wp8-xaml/CopyTemplateFiles.vcxproj (100%) rename cocos/{2d => }/platform/wp8-xaml/CopyTemplateFiles.vcxproj.filters (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Cocos2dRenderer.h (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Direct3DContentProvider.h (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Direct3DInterop.cpp (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/Direct3DInterop.h (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/DirectXBase.cpp (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/DirectXBase.h (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/DirectXHelper.h (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/EditBoxEvent.cpp (100%) rename cocos/{2d => }/platform/wp8-xaml/cpp/EditBoxEvent.h (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/App.xaml (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/App.xaml.cs (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/EditBox.xaml (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/EditBox.xaml.cs (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/MainPage.xaml (100%) rename cocos/{2d => }/platform/wp8-xaml/xaml/MainPage.xaml.cs (100%) rename cocos/{2d => }/platform/wp8/CCGLView.cpp (98%) rename cocos/{2d => }/platform/wp8/CCGLView.h (96%) rename cocos/{2d => }/platform/wp8/Direct3DBase.cpp (95%) rename cocos/{2d => }/platform/wp8/Direct3DBase.h (89%) rename cocos/{2d => }/platform/wp8/DirectXBase.cpp (100%) rename cocos/{2d => }/platform/wp8/DirectXBase.h (100%) rename cocos/{2d => }/platform/wp8/shaders/precompiledshaders.h (100%) rename cocos/{2d => renderer}/CCTexture2D.cpp (99%) rename cocos/{2d => renderer}/CCTexture2D.h (100%) rename cocos/{2d => renderer}/CCTextureAtlas.cpp (99%) rename cocos/{2d => renderer}/CCTextureAtlas.h (99%) rename cocos/{2d => renderer}/CCTextureCache.cpp (99%) rename cocos/{2d => renderer}/CCTextureCache.h (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20e616e368..2a3663eba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,8 @@ endif() include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cocos + ${CMAKE_CURRENT_SOURCE_DIR}/cocos/platform/desktop + ${CMAKE_CURRENT_SOURCE_DIR}/cocos/platform/${PLATFORM_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}/cocos/audio/include ${CMAKE_CURRENT_SOURCE_DIR}/cocos/editor-support ${CMAKE_CURRENT_SOURCE_DIR}/cocos/scripting/lua-bindings/auto @@ -140,8 +142,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/external/unzip ${CMAKE_CURRENT_SOURCE_DIR}/external/edtaa3func ${CMAKE_CURRENT_SOURCE_DIR}/external/chipmunk/include/chipmunk - ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/platform/desktop - ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/platform/${PLATFORM_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/include/${PLATFORM_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}/external/png/include/${PLATFORM_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/include/${PLATFORM_FOLDER} diff --git a/build/android-build.py b/build/android-build.py index ebef60cbe5..7dcd4a6872 100755 --- a/build/android-build.py +++ b/build/android-build.py @@ -116,7 +116,7 @@ def do_build(cocos_root, ndk_root, app_android_root, ndk_build_param,sdk_root,an raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") elif android_platform is not None: sdk_tool_path = os.path.join(sdk_root, "tools/android") - cocoslib_path = os.path.join(cocos_root, "cocos/2d/platform/android/java") + cocoslib_path = os.path.join(cocos_root, "cocos/platform/android/java") command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) if os.system(command) != 0: raise Exception("update cocos lib-project [ " + cocoslib_path + " ] fails!") diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index b7b9739561..cb9b553f43 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -92,9 +92,6 @@ 1A087AE91860400400196EF5 /* edtaa3func.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A087AE61860400400196EF5 /* edtaa3func.cpp */; }; 1A087AEA1860400400196EF5 /* edtaa3func.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A087AE71860400400196EF5 /* edtaa3func.h */; }; 1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A087AE71860400400196EF5 /* edtaa3func.h */; }; - 1A0DB7321823827C0025743D /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7301823827C0025743D /* CCGL.h */; }; - 1A0DB7331823827C0025743D /* CCEAGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7311823827C0025743D /* CCEAGLView.h */; }; - 1A0DB7381823828F0025743D /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7351823828F0025743D /* CCGL.h */; }; 1A12775A18DFCC4F0005F345 /* CCTweenFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 2986667918B1B079000E39CA /* CCTweenFunction.h */; }; 1A12775B18DFCC540005F345 /* CCTweenFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 2986667918B1B079000E39CA /* CCTweenFunction.h */; }; 1A12775C18DFCC590005F345 /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2986667818B1B079000E39CA /* CCTweenFunction.cpp */; }; @@ -278,10 +275,6 @@ 1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */; }; 1A57022F180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */; }; 1A570230180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */; }; - 1A570234180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */; }; - 1A570235180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */; }; - 1A570236180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */; }; - 1A570237180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */; }; 1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570276180BCC900088DEC7 /* CCSprite.cpp */; }; 1A57027F180BCC900088DEC7 /* CCSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570276180BCC900088DEC7 /* CCSprite.cpp */; }; 1A570280180BCC900088DEC7 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570277180BCC900088DEC7 /* CCSprite.h */; }; @@ -306,38 +299,10 @@ 1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */; }; 1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */; }; 1A570299180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */; }; - 1A5702AF180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */; }; - 1A5702B0180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */; }; - 1A5702B1180BCDBC0088DEC7 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */; }; - 1A5702B2180BCDBC0088DEC7 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */; }; - 1A5702B5180BCDF40088DEC7 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */; }; - 1A5702B6180BCDF40088DEC7 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */; }; - 1A5702B7180BCDF40088DEC7 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B4180BCDF40088DEC7 /* CCVertex.h */; }; - 1A5702B8180BCDF40088DEC7 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B4180BCDF40088DEC7 /* CCVertex.h */; }; - 1A5702BA180BCDFC0088DEC7 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */; }; - 1A5702BB180BCDFC0088DEC7 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */; }; - 1A5702C0180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */; }; - 1A5702C1180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */; }; - 1A5702C2180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */; }; - 1A5702C3180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */; }; - 1A5702C4180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */; }; - 1A5702C5180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */; }; 1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */; }; 1A5702C9180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */; }; 1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */; }; 1A5702CB180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */; }; - 1A5702D3180BCE570088DEC7 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */; }; - 1A5702D4180BCE570088DEC7 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */; }; - 1A5702D5180BCE570088DEC7 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */; }; - 1A5702D6180BCE570088DEC7 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */; }; - 1A5702D7180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */; }; - 1A5702D8180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */; }; - 1A5702D9180BCE570088DEC7 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */; }; - 1A5702DA180BCE570088DEC7 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */; }; - 1A5702DB180BCE570088DEC7 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */; }; - 1A5702DC180BCE570088DEC7 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */; }; - 1A5702DD180BCE570088DEC7 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */; }; - 1A5702DE180BCE570088DEC7 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */; }; 1A5702EA180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */; }; 1A5702EB180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */; }; 1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */; }; @@ -362,8 +327,6 @@ 1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */; }; 1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */; }; 1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */; }; - 1A570305180BCED90088DEC7 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570304180BCED90088DEC7 /* ccUtils.cpp */; }; - 1A570306180BCED90088DEC7 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570304180BCED90088DEC7 /* ccUtils.cpp */; }; 1A57030C180BCF190088DEC7 /* CCComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570308180BCF190088DEC7 /* CCComponent.cpp */; }; 1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570308180BCF190088DEC7 /* CCComponent.cpp */; }; 1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570309180BCF190088DEC7 /* CCComponent.h */; }; @@ -372,26 +335,6 @@ 1A570311180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */; }; 1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */; }; 1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */; }; - 1A570319180BCF430088DEC7 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570315180BCF430088DEC7 /* ccCArray.cpp */; }; - 1A57031A180BCF430088DEC7 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570315180BCF430088DEC7 /* ccCArray.cpp */; }; - 1A57031B180BCF430088DEC7 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570316180BCF430088DEC7 /* ccCArray.h */; }; - 1A57031C180BCF430088DEC7 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570316180BCF430088DEC7 /* ccCArray.h */; }; - 1A57031D180BCF430088DEC7 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570317180BCF430088DEC7 /* uthash.h */; }; - 1A57031E180BCF430088DEC7 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570317180BCF430088DEC7 /* uthash.h */; }; - 1A57031F180BCF430088DEC7 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570318180BCF430088DEC7 /* utlist.h */; }; - 1A570320180BCF430088DEC7 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570318180BCF430088DEC7 /* utlist.h */; }; - 1A570324180BCF660088DEC7 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570322180BCF660088DEC7 /* TGAlib.cpp */; }; - 1A570325180BCF660088DEC7 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570322180BCF660088DEC7 /* TGAlib.cpp */; }; - 1A570326180BCF660088DEC7 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570323180BCF660088DEC7 /* TGAlib.h */; }; - 1A570327180BCF660088DEC7 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570323180BCF660088DEC7 /* TGAlib.h */; }; - 1A57032F180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */; }; - 1A570330180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */; }; - 1A570331180BCFD50088DEC7 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */; }; - 1A570332180BCFD50088DEC7 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */; }; - 1A570333180BCFD50088DEC7 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */; }; - 1A570334180BCFD50088DEC7 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */; }; - 1A570335180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */; }; - 1A570336180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */; }; 1A570347180BD0850088DEC7 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A570346180BD0850088DEC7 /* libglfw3.a */; }; 1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570349180BD09B0088DEC7 /* tinyxml2.cpp */; }; 1A57034C180BD09B0088DEC7 /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570349180BD09B0088DEC7 /* tinyxml2.cpp */; }; @@ -542,18 +485,10 @@ 1A8C5A0F180E930E00EF57C3 /* DictionaryHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */; }; 1A8C5A10180E930E00EF57C3 /* DictionaryHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */; }; 1A94D35116C2072800D79D09 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; }; - 1A9DCA23180E6955007A3AD4 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */; }; - 1A9DCA24180E6955007A3AD4 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */; }; - 1A9DCA25180E6955007A3AD4 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */; }; - 1A9DCA26180E6955007A3AD4 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */; }; 1A9DCA27180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */; }; 1A9DCA28180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */; }; 1A9DCA29180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */; }; 1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */; }; - 1A9DCA2D180E6955007A3AD4 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */; }; - 1A9DCA2E180E6955007A3AD4 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */; }; - 1A9DCA3B180E6955007A3AD4 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0C180E6955007A3AD4 /* firePngData.h */; }; - 1A9DCA3C180E6955007A3AD4 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0C180E6955007A3AD4 /* firePngData.h */; }; 1AAF528B180E2ECC000584C8 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B61807AF9C005B8026 /* b2BroadPhase.cpp */; }; 1AAF528C180E2ECC000584C8 /* b2BroadPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168B71807AF9C005B8026 /* b2BroadPhase.h */; }; 1AAF528D180E2ECC000584C8 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B81807AF9C005B8026 /* b2CollideCircle.cpp */; }; @@ -1039,14 +974,6 @@ 2905FA8D18CF08D100240AA3 /* UIWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2905FA1318CF08D100240AA3 /* UIWidget.cpp */; }; 2905FA8E18CF08D100240AA3 /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905FA1418CF08D100240AA3 /* UIWidget.h */; }; 2905FA8F18CF08D100240AA3 /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 2905FA1418CF08D100240AA3 /* UIWidget.h */; }; - 296CAD221915EC8000C64FBF /* CCEventFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 296CAD201915EC8000C64FBF /* CCEventFocus.cpp */; }; - 296CAD231915EC8000C64FBF /* CCEventFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 296CAD201915EC8000C64FBF /* CCEventFocus.cpp */; }; - 296CAD241915EC8000C64FBF /* CCEventFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 296CAD211915EC8000C64FBF /* CCEventFocus.h */; }; - 296CAD251915EC8000C64FBF /* CCEventFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 296CAD211915EC8000C64FBF /* CCEventFocus.h */; }; - 296CAD281915EC9900C64FBF /* CCEventListenerFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 296CAD261915EC9900C64FBF /* CCEventListenerFocus.cpp */; }; - 296CAD291915EC9900C64FBF /* CCEventListenerFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 296CAD261915EC9900C64FBF /* CCEventListenerFocus.cpp */; }; - 296CAD2A1915EC9900C64FBF /* CCEventListenerFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 296CAD271915EC9900C64FBF /* CCEventListenerFocus.h */; }; - 296CAD2B1915EC9900C64FBF /* CCEventListenerFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 296CAD271915EC9900C64FBF /* CCEventListenerFocus.h */; }; 2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2986667818B1B079000E39CA /* CCTweenFunction.cpp */; }; 2AC795DB1862870F005EC8E1 /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D918628689005EC8E1 /* SkeletonBounds.cpp */; }; 2AC795DC1862870F005EC8E1 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D51862867D005EC8E1 /* Event.cpp */; }; @@ -1066,9 +993,6 @@ 2AC795EA1862875D005EC8E1 /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */; }; 373B9129187891F400198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; }; 373B912A187891FB00198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; }; - 3E26D40518ACB5D100834404 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40418ACB5D100834404 /* CCImage.cpp */; }; - 3E26D40618ACB5D100834404 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40418ACB5D100834404 /* CCImage.cpp */; }; - 3E26D40818ACB63900834404 /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3E26D40718ACB63900834404 /* CCDevice.mm */; }; 3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */; }; 3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */; }; 460E468118080832000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; }; @@ -1187,61 +1111,6 @@ 46A160591807A5EB005B8026 /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FEB1807A56F005B8026 /* SimpleAudioEngine.mm */; }; 46A1605A1807A5EB005B8026 /* SimpleAudioEngine_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FEC1807A56F005B8026 /* SimpleAudioEngine_objc.h */; }; 46A1605B1807A5EB005B8026 /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FED1807A56F005B8026 /* SimpleAudioEngine_objc.m */; }; - 46A170131807CBFC005B8026 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */; }; - 46A170141807CBFC005B8026 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */; }; - 46A170151807CBFC005B8026 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A911807B038005B8026 /* CCLock.cpp */; }; - 46A170161807CBFC005B8026 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A921807B038005B8026 /* CCLock.h */; }; - 46A170171807CBFC005B8026 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A931807B038005B8026 /* CCThread.mm */; }; - 46A170181807CBFC005B8026 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A941807B038005B8026 /* CCApplicationProtocol.h */; }; - 46A170191807CBFC005B8026 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A951807B038005B8026 /* CCCommon.h */; }; - 46A1701A1807CBFC005B8026 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A961807B038005B8026 /* CCDevice.h */; }; - 46A1701B1807CBFC005B8026 /* CCGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A971807B038005B8026 /* CCGLViewProtocol.cpp */; }; - 46A1701C1807CBFC005B8026 /* CCGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A981807B038005B8026 /* CCGLViewProtocol.h */; }; - 46A1701D1807CBFC005B8026 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A991807B038005B8026 /* CCFileUtils.cpp */; }; - 46A1701E1807CBFC005B8026 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9A1807B038005B8026 /* CCFileUtils.h */; }; - 46A1701F1807CBFC005B8026 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9B1807B038005B8026 /* CCImage.h */; }; - 46A170231807CBFC005B8026 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */; }; - 46A170241807CBFC005B8026 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA01807B038005B8026 /* CCSAXParser.h */; }; - 46A170251807CBFC005B8026 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA11807B038005B8026 /* CCThread.cpp */; }; - 46A170261807CBFC005B8026 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA21807B038005B8026 /* CCThread.h */; }; - 46A170271807CBFE005B8026 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */; }; - 46A170281807CBFE005B8026 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */; }; - 46A170291807CBFE005B8026 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A911807B038005B8026 /* CCLock.cpp */; }; - 46A1702A1807CBFE005B8026 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A921807B038005B8026 /* CCLock.h */; }; - 46A1702B1807CBFE005B8026 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A931807B038005B8026 /* CCThread.mm */; }; - 46A1702C1807CBFE005B8026 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A941807B038005B8026 /* CCApplicationProtocol.h */; }; - 46A1702D1807CBFE005B8026 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A951807B038005B8026 /* CCCommon.h */; }; - 46A1702E1807CBFE005B8026 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A961807B038005B8026 /* CCDevice.h */; }; - 46A1702F1807CBFE005B8026 /* CCGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A971807B038005B8026 /* CCGLViewProtocol.cpp */; }; - 46A170301807CBFE005B8026 /* CCGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A981807B038005B8026 /* CCGLViewProtocol.h */; }; - 46A170311807CBFE005B8026 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A991807B038005B8026 /* CCFileUtils.cpp */; }; - 46A170321807CBFE005B8026 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9A1807B038005B8026 /* CCFileUtils.h */; }; - 46A170331807CBFE005B8026 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9B1807B038005B8026 /* CCImage.h */; }; - 46A170371807CBFE005B8026 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */; }; - 46A170381807CBFE005B8026 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA01807B038005B8026 /* CCSAXParser.h */; }; - 46A170391807CBFE005B8026 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA11807B038005B8026 /* CCThread.cpp */; }; - 46A1703A1807CBFE005B8026 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA21807B038005B8026 /* CCThread.h */; }; - 46A1703B1807CC07005B8026 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA41807B038005B8026 /* CCApplication.h */; }; - 46A1703C1807CC07005B8026 /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA51807B038005B8026 /* CCApplication.mm */; }; - 46A1703D1807CC07005B8026 /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA61807B038005B8026 /* CCCommon.mm */; }; - 46A1703E1807CC07005B8026 /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA71807B038005B8026 /* CCDevice.mm */; }; - 46A1703F1807CC07005B8026 /* CCDirectorCaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA81807B038005B8026 /* CCDirectorCaller.h */; }; - 46A170401807CC07005B8026 /* CCDirectorCaller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA91807B038005B8026 /* CCDirectorCaller.mm */; }; - 46A170411807CC07005B8026 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAA1807B038005B8026 /* CCGLView.h */; }; - 46A170421807CC07005B8026 /* CCGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AAB1807B038005B8026 /* CCGLView.mm */; }; - 46A170431807CC07005B8026 /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAC1807B038005B8026 /* CCES2Renderer.h */; }; - 46A170441807CC07005B8026 /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AAD1807B038005B8026 /* CCES2Renderer.m */; }; - 46A170451807CC07005B8026 /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAE1807B038005B8026 /* CCESRenderer.h */; }; - 46A170471807CC07005B8026 /* CCImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AB01807B038005B8026 /* CCImage.mm */; }; - 46A170481807CC07005B8026 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB11807B038005B8026 /* CCPlatformDefine.h */; }; - 46A170491807CC07005B8026 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB21807B038005B8026 /* CCStdC.h */; }; - 46A1704B1807CC07005B8026 /* CCEAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AB41807B038005B8026 /* CCEAGLView.mm */; }; - 46A1704C1807CC07005B8026 /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB51807B038005B8026 /* OpenGL_Internal.h */; }; - 46A1704F1807CC1C005B8026 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AC81807B038005B8026 /* CCApplication.h */; }; - 46A170501807CC1C005B8026 /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AC91807B038005B8026 /* CCApplication.mm */; }; - 46A170511807CC1C005B8026 /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16ACA1807B038005B8026 /* CCCommon.mm */; }; - 46A1705B1807CC1C005B8026 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AD41807B038005B8026 /* CCPlatformDefine.h */; }; - 46A1705C1807CC1C005B8026 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AD51807B038005B8026 /* CCStdC.h */; }; 46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */; }; 46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */; }; 46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */; }; @@ -1376,198 +1245,10 @@ 46C02E0818E91123004B7456 /* xxhash.c in Sources */ = {isa = PBXBuildFile; fileRef = 46C02E0518E91123004B7456 /* xxhash.c */; }; 46C02E0918E91123004B7456 /* xxhash.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C02E0618E91123004B7456 /* xxhash.h */; }; 46C02E0A18E91123004B7456 /* xxhash.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C02E0618E91123004B7456 /* xxhash.h */; }; - 500DC8AA19105D41007B91BF /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89919105D41007B91BF /* CCBatchCommand.cpp */; }; - 500DC8AB19105D41007B91BF /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89919105D41007B91BF /* CCBatchCommand.cpp */; }; - 500DC8AC19105D41007B91BF /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89A19105D41007B91BF /* CCBatchCommand.h */; }; - 500DC8AD19105D41007B91BF /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89A19105D41007B91BF /* CCBatchCommand.h */; }; - 500DC8AE19105D41007B91BF /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89B19105D41007B91BF /* CCCustomCommand.cpp */; }; - 500DC8AF19105D41007B91BF /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89B19105D41007B91BF /* CCCustomCommand.cpp */; }; - 500DC8B019105D41007B91BF /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89C19105D41007B91BF /* CCCustomCommand.h */; }; - 500DC8B119105D41007B91BF /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89C19105D41007B91BF /* CCCustomCommand.h */; }; - 500DC8B219105D41007B91BF /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89D19105D41007B91BF /* CCGroupCommand.cpp */; }; - 500DC8B319105D41007B91BF /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC89D19105D41007B91BF /* CCGroupCommand.cpp */; }; - 500DC8B419105D41007B91BF /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89E19105D41007B91BF /* CCGroupCommand.h */; }; - 500DC8B519105D41007B91BF /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC89E19105D41007B91BF /* CCGroupCommand.h */; }; - 500DC8BA19105D41007B91BF /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A119105D41007B91BF /* CCQuadCommand.cpp */; }; - 500DC8BB19105D41007B91BF /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A119105D41007B91BF /* CCQuadCommand.cpp */; }; - 500DC8BC19105D41007B91BF /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A219105D41007B91BF /* CCQuadCommand.h */; }; - 500DC8BD19105D41007B91BF /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A219105D41007B91BF /* CCQuadCommand.h */; }; - 500DC8BE19105D41007B91BF /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A319105D41007B91BF /* CCRenderCommand.cpp */; }; - 500DC8BF19105D41007B91BF /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A319105D41007B91BF /* CCRenderCommand.cpp */; }; - 500DC8C019105D41007B91BF /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A419105D41007B91BF /* CCRenderCommand.h */; }; - 500DC8C119105D41007B91BF /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A419105D41007B91BF /* CCRenderCommand.h */; }; - 500DC8C219105D41007B91BF /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A519105D41007B91BF /* CCRenderCommandPool.h */; }; - 500DC8C319105D41007B91BF /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A519105D41007B91BF /* CCRenderCommandPool.h */; }; - 500DC8C419105D41007B91BF /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A619105D41007B91BF /* CCRenderer.cpp */; }; - 500DC8C519105D41007B91BF /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8A619105D41007B91BF /* CCRenderer.cpp */; }; - 500DC8C619105D41007B91BF /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A719105D41007B91BF /* CCRenderer.h */; }; - 500DC8C719105D41007B91BF /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8A719105D41007B91BF /* CCRenderer.h */; }; - 500DC8D119105F7D007B91BF /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8CC19105F7D007B91BF /* CCAffineTransform.cpp */; }; - 500DC8D219105F7D007B91BF /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8CC19105F7D007B91BF /* CCAffineTransform.cpp */; }; - 500DC8D319105F7D007B91BF /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8CD19105F7D007B91BF /* CCAffineTransform.h */; }; - 500DC8D419105F7D007B91BF /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8CD19105F7D007B91BF /* CCAffineTransform.h */; }; - 500DC8D519105F7D007B91BF /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8CE19105F7D007B91BF /* CCGeometry.cpp */; }; - 500DC8D619105F7D007B91BF /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8CE19105F7D007B91BF /* CCGeometry.cpp */; }; - 500DC8D719105F7D007B91BF /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8CF19105F7D007B91BF /* CCGeometry.h */; }; - 500DC8D819105F7D007B91BF /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8CF19105F7D007B91BF /* CCGeometry.h */; }; - 500DC8D919105F7D007B91BF /* CCMathBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8D019105F7D007B91BF /* CCMathBase.h */; }; - 500DC8DA19105F7D007B91BF /* CCMathBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8D019105F7D007B91BF /* CCMathBase.h */; }; - 500DC92A19106300007B91BF /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8E719106300007B91BF /* atitc.cpp */; }; - 500DC92B19106300007B91BF /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8E719106300007B91BF /* atitc.cpp */; }; - 500DC92C19106300007B91BF /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8E819106300007B91BF /* atitc.h */; }; - 500DC92D19106300007B91BF /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8E819106300007B91BF /* atitc.h */; }; - 500DC92E19106300007B91BF /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8E919106300007B91BF /* base64.cpp */; }; - 500DC92F19106300007B91BF /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8E919106300007B91BF /* base64.cpp */; }; - 500DC93019106300007B91BF /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EA19106300007B91BF /* base64.h */; }; - 500DC93119106300007B91BF /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EA19106300007B91BF /* base64.h */; }; - 500DC93219106300007B91BF /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8EB19106300007B91BF /* CCAutoreleasePool.cpp */; }; - 500DC93319106300007B91BF /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8EB19106300007B91BF /* CCAutoreleasePool.cpp */; }; - 500DC93419106300007B91BF /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EC19106300007B91BF /* CCAutoreleasePool.h */; }; - 500DC93519106300007B91BF /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EC19106300007B91BF /* CCAutoreleasePool.h */; }; - 500DC93619106300007B91BF /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8ED19106300007B91BF /* ccConfig.h */; }; - 500DC93719106300007B91BF /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8ED19106300007B91BF /* ccConfig.h */; }; - 500DC93819106300007B91BF /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8EE19106300007B91BF /* CCConfiguration.cpp */; }; - 500DC93919106300007B91BF /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8EE19106300007B91BF /* CCConfiguration.cpp */; }; - 500DC93A19106300007B91BF /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EF19106300007B91BF /* CCConfiguration.h */; }; - 500DC93B19106300007B91BF /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8EF19106300007B91BF /* CCConfiguration.h */; }; - 500DC93C19106300007B91BF /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F019106300007B91BF /* CCConsole.cpp */; }; - 500DC93D19106300007B91BF /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F019106300007B91BF /* CCConsole.cpp */; }; - 500DC93E19106300007B91BF /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F119106300007B91BF /* CCConsole.h */; }; - 500DC93F19106300007B91BF /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F119106300007B91BF /* CCConsole.h */; }; - 500DC94019106300007B91BF /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F219106300007B91BF /* CCData.cpp */; }; - 500DC94119106300007B91BF /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F219106300007B91BF /* CCData.cpp */; }; - 500DC94219106300007B91BF /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F319106300007B91BF /* CCData.h */; }; - 500DC94319106300007B91BF /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F319106300007B91BF /* CCData.h */; }; - 500DC94419106300007B91BF /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F419106300007B91BF /* CCDataVisitor.cpp */; }; - 500DC94519106300007B91BF /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F419106300007B91BF /* CCDataVisitor.cpp */; }; - 500DC94619106300007B91BF /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F519106300007B91BF /* CCDataVisitor.h */; }; - 500DC94719106300007B91BF /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F519106300007B91BF /* CCDataVisitor.h */; }; - 500DC94819106300007B91BF /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F619106300007B91BF /* CCDirector.cpp */; }; - 500DC94919106300007B91BF /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F619106300007B91BF /* CCDirector.cpp */; }; - 500DC94A19106300007B91BF /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F719106300007B91BF /* CCDirector.h */; }; - 500DC94B19106300007B91BF /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F719106300007B91BF /* CCDirector.h */; }; - 500DC94C19106300007B91BF /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F819106300007B91BF /* CCEvent.cpp */; }; - 500DC94D19106300007B91BF /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8F819106300007B91BF /* CCEvent.cpp */; }; - 500DC94E19106300007B91BF /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F919106300007B91BF /* CCEvent.h */; }; - 500DC94F19106300007B91BF /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8F919106300007B91BF /* CCEvent.h */; }; - 500DC95019106300007B91BF /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FA19106300007B91BF /* CCEventAcceleration.cpp */; }; - 500DC95119106300007B91BF /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FA19106300007B91BF /* CCEventAcceleration.cpp */; }; - 500DC95219106300007B91BF /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FB19106300007B91BF /* CCEventAcceleration.h */; }; - 500DC95319106300007B91BF /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FB19106300007B91BF /* CCEventAcceleration.h */; }; - 500DC95419106300007B91BF /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FC19106300007B91BF /* CCEventCustom.cpp */; }; - 500DC95519106300007B91BF /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FC19106300007B91BF /* CCEventCustom.cpp */; }; - 500DC95619106300007B91BF /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FD19106300007B91BF /* CCEventCustom.h */; }; - 500DC95719106300007B91BF /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FD19106300007B91BF /* CCEventCustom.h */; }; - 500DC95819106300007B91BF /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FE19106300007B91BF /* CCEventDispatcher.cpp */; }; - 500DC95919106300007B91BF /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC8FE19106300007B91BF /* CCEventDispatcher.cpp */; }; - 500DC95A19106300007B91BF /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FF19106300007B91BF /* CCEventDispatcher.h */; }; - 500DC95B19106300007B91BF /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC8FF19106300007B91BF /* CCEventDispatcher.h */; }; - 500DC95C19106300007B91BF /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90019106300007B91BF /* CCEventKeyboard.cpp */; }; - 500DC95D19106300007B91BF /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90019106300007B91BF /* CCEventKeyboard.cpp */; }; - 500DC95E19106300007B91BF /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90119106300007B91BF /* CCEventKeyboard.h */; }; - 500DC95F19106300007B91BF /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90119106300007B91BF /* CCEventKeyboard.h */; }; - 500DC96019106300007B91BF /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90219106300007B91BF /* CCEventListener.cpp */; }; - 500DC96119106300007B91BF /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90219106300007B91BF /* CCEventListener.cpp */; }; - 500DC96219106300007B91BF /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90319106300007B91BF /* CCEventListener.h */; }; - 500DC96319106300007B91BF /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90319106300007B91BF /* CCEventListener.h */; }; - 500DC96419106300007B91BF /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90419106300007B91BF /* CCEventListenerAcceleration.cpp */; }; - 500DC96519106300007B91BF /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90419106300007B91BF /* CCEventListenerAcceleration.cpp */; }; - 500DC96619106300007B91BF /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90519106300007B91BF /* CCEventListenerAcceleration.h */; }; - 500DC96719106300007B91BF /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90519106300007B91BF /* CCEventListenerAcceleration.h */; }; - 500DC96819106300007B91BF /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90619106300007B91BF /* CCEventListenerCustom.cpp */; }; - 500DC96919106300007B91BF /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90619106300007B91BF /* CCEventListenerCustom.cpp */; }; - 500DC96A19106300007B91BF /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90719106300007B91BF /* CCEventListenerCustom.h */; }; - 500DC96B19106300007B91BF /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90719106300007B91BF /* CCEventListenerCustom.h */; }; - 500DC96C19106300007B91BF /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90819106300007B91BF /* CCEventListenerKeyboard.cpp */; }; - 500DC96D19106300007B91BF /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90819106300007B91BF /* CCEventListenerKeyboard.cpp */; }; - 500DC96E19106300007B91BF /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90919106300007B91BF /* CCEventListenerKeyboard.h */; }; - 500DC96F19106300007B91BF /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90919106300007B91BF /* CCEventListenerKeyboard.h */; }; - 500DC97019106300007B91BF /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90A19106300007B91BF /* CCEventListenerMouse.cpp */; }; - 500DC97119106300007B91BF /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90A19106300007B91BF /* CCEventListenerMouse.cpp */; }; - 500DC97219106300007B91BF /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90B19106300007B91BF /* CCEventListenerMouse.h */; }; - 500DC97319106300007B91BF /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90B19106300007B91BF /* CCEventListenerMouse.h */; }; - 500DC97419106300007B91BF /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90C19106300007B91BF /* CCEventListenerTouch.cpp */; }; - 500DC97519106300007B91BF /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90C19106300007B91BF /* CCEventListenerTouch.cpp */; }; - 500DC97619106300007B91BF /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90D19106300007B91BF /* CCEventListenerTouch.h */; }; - 500DC97719106300007B91BF /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90D19106300007B91BF /* CCEventListenerTouch.h */; }; - 500DC97819106300007B91BF /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90E19106300007B91BF /* CCEventMouse.cpp */; }; - 500DC97919106300007B91BF /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC90E19106300007B91BF /* CCEventMouse.cpp */; }; - 500DC97A19106300007B91BF /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90F19106300007B91BF /* CCEventMouse.h */; }; - 500DC97B19106300007B91BF /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC90F19106300007B91BF /* CCEventMouse.h */; }; - 500DC97C19106300007B91BF /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91019106300007B91BF /* CCEventTouch.cpp */; }; - 500DC97D19106300007B91BF /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91019106300007B91BF /* CCEventTouch.cpp */; }; - 500DC97E19106300007B91BF /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91119106300007B91BF /* CCEventTouch.h */; }; - 500DC97F19106300007B91BF /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91119106300007B91BF /* CCEventTouch.h */; }; - 500DC98019106300007B91BF /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91219106300007B91BF /* CCEventType.h */; }; - 500DC98119106300007B91BF /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91219106300007B91BF /* CCEventType.h */; }; - 500DC98219106300007B91BF /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91319106300007B91BF /* ccMacros.h */; }; - 500DC98319106300007B91BF /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91319106300007B91BF /* ccMacros.h */; }; - 500DC98419106300007B91BF /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91419106300007B91BF /* CCMap.h */; }; - 500DC98519106300007B91BF /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91419106300007B91BF /* CCMap.h */; }; - 500DC98619106300007B91BF /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91519106300007B91BF /* CCNS.cpp */; }; - 500DC98719106300007B91BF /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91519106300007B91BF /* CCNS.cpp */; }; - 500DC98819106300007B91BF /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91619106300007B91BF /* CCNS.h */; }; - 500DC98919106300007B91BF /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91619106300007B91BF /* CCNS.h */; }; - 500DC98A19106300007B91BF /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91719106300007B91BF /* CCPlatformConfig.h */; }; - 500DC98B19106300007B91BF /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91719106300007B91BF /* CCPlatformConfig.h */; }; - 500DC98C19106300007B91BF /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91819106300007B91BF /* CCPlatformMacros.h */; }; - 500DC98D19106300007B91BF /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91819106300007B91BF /* CCPlatformMacros.h */; }; - 500DC98E19106300007B91BF /* CCRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91919106300007B91BF /* CCRef.cpp */; }; - 500DC98F19106300007B91BF /* CCRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91919106300007B91BF /* CCRef.cpp */; }; - 500DC99019106300007B91BF /* CCRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91A19106300007B91BF /* CCRef.h */; }; - 500DC99119106300007B91BF /* CCRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91A19106300007B91BF /* CCRef.h */; }; - 500DC99219106300007B91BF /* CCRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91B19106300007B91BF /* CCRefPtr.h */; }; - 500DC99319106300007B91BF /* CCRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91B19106300007B91BF /* CCRefPtr.h */; }; - 500DC99419106300007B91BF /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91C19106300007B91BF /* CCScheduler.cpp */; }; - 500DC99519106300007B91BF /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91C19106300007B91BF /* CCScheduler.cpp */; }; - 500DC99619106300007B91BF /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91D19106300007B91BF /* CCScheduler.h */; }; - 500DC99719106300007B91BF /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91D19106300007B91BF /* CCScheduler.h */; }; - 500DC99819106300007B91BF /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91E19106300007B91BF /* ccTypes.cpp */; }; - 500DC99919106300007B91BF /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC91E19106300007B91BF /* ccTypes.cpp */; }; - 500DC99A19106300007B91BF /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91F19106300007B91BF /* ccTypes.h */; }; - 500DC99B19106300007B91BF /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC91F19106300007B91BF /* ccTypes.h */; }; - 500DC99C19106300007B91BF /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92019106300007B91BF /* CCValue.cpp */; }; - 500DC99D19106300007B91BF /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92019106300007B91BF /* CCValue.cpp */; }; - 500DC99E19106300007B91BF /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92119106300007B91BF /* CCValue.h */; }; - 500DC99F19106300007B91BF /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92119106300007B91BF /* CCValue.h */; }; - 500DC9A019106300007B91BF /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92219106300007B91BF /* CCVector.h */; }; - 500DC9A119106300007B91BF /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92219106300007B91BF /* CCVector.h */; }; - 500DC9A219106300007B91BF /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92419106300007B91BF /* etc1.cpp */; }; - 500DC9A319106300007B91BF /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92419106300007B91BF /* etc1.cpp */; }; - 500DC9A419106300007B91BF /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92519106300007B91BF /* etc1.h */; }; - 500DC9A519106300007B91BF /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92519106300007B91BF /* etc1.h */; }; - 500DC9A619106300007B91BF /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92619106300007B91BF /* s3tc.cpp */; }; - 500DC9A719106300007B91BF /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92619106300007B91BF /* s3tc.cpp */; }; - 500DC9A819106300007B91BF /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92719106300007B91BF /* s3tc.h */; }; - 500DC9A919106300007B91BF /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92719106300007B91BF /* s3tc.h */; }; - 500DC9AA19106300007B91BF /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92819106300007B91BF /* ZipUtils.cpp */; }; - 500DC9AB19106300007B91BF /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC92819106300007B91BF /* ZipUtils.cpp */; }; - 500DC9AC19106300007B91BF /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92919106300007B91BF /* ZipUtils.h */; }; - 500DC9AD19106300007B91BF /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC92919106300007B91BF /* ZipUtils.h */; }; - 500DC9B01910633C007B91BF /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9AE1910633C007B91BF /* CCTouch.cpp */; }; - 500DC9B11910633C007B91BF /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9AE1910633C007B91BF /* CCTouch.cpp */; }; - 500DC9B21910633C007B91BF /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9AF1910633C007B91BF /* CCTouch.h */; }; - 500DC9B31910633C007B91BF /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9AF1910633C007B91BF /* CCTouch.h */; }; - 500DC9B619106E6D007B91BF /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9B419106E6D007B91BF /* TransformUtils.cpp */; }; - 500DC9B719106E6D007B91BF /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9B419106E6D007B91BF /* TransformUtils.cpp */; }; - 500DC9B819106E6D007B91BF /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9B519106E6D007B91BF /* TransformUtils.h */; }; - 500DC9B919106E6D007B91BF /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9B519106E6D007B91BF /* TransformUtils.h */; }; - 500DC9BC19106E89007B91BF /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9BA19106E89007B91BF /* CCProfiling.cpp */; }; - 500DC9BD19106E89007B91BF /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 500DC9BA19106E89007B91BF /* CCProfiling.cpp */; }; - 500DC9BE19106E89007B91BF /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9BB19106E89007B91BF /* CCProfiling.h */; }; - 500DC9BF19106E89007B91BF /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 500DC9BB19106E89007B91BF /* CCProfiling.h */; }; 5027253A190BF1B900AAF4ED /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 50272538190BF1B900AAF4ED /* cocos2d.h */; }; 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 50272538190BF1B900AAF4ED /* cocos2d.h */; }; 5027253C190BF1B900AAF4ED /* cocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50272539190BF1B900AAF4ED /* cocos2d.cpp */; }; 5027253D190BF1B900AAF4ED /* cocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50272539190BF1B900AAF4ED /* cocos2d.cpp */; }; - 5034CA19191D591000CE6051 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9F7191D591000CE6051 /* ccShaders.h */; }; - 5034CA1A191D591100CE6051 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9F7191D591000CE6051 /* ccShaders.h */; }; - 5034CA1B191D591100CE6051 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034C9F8191D591000CE6051 /* ccShaders.cpp */; }; - 5034CA1C191D591100CE6051 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034C9F8191D591000CE6051 /* ccShaders.cpp */; }; - 5034CA1D191D591100CE6051 /* CCGLProgramCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9F9191D591000CE6051 /* CCGLProgramCache.h */; }; - 5034CA1E191D591100CE6051 /* CCGLProgramCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9F9191D591000CE6051 /* CCGLProgramCache.h */; }; - 5034CA1F191D591100CE6051 /* CCGLProgramCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034C9FA191D591000CE6051 /* CCGLProgramCache.cpp */; }; - 5034CA20191D591100CE6051 /* CCGLProgramCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034C9FA191D591000CE6051 /* CCGLProgramCache.cpp */; }; 5034CA21191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9FB191D591000CE6051 /* ccShader_PositionTextureColorAlphaTest.frag */; }; 5034CA22191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */ = {isa = PBXBuildFile; fileRef = 5034C9FB191D591000CE6051 /* ccShader_PositionTextureColorAlphaTest.frag */; }; 5034CA2B191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA00191D591000CE6051 /* ccShader_PositionTextureA8Color.vert */; }; @@ -1604,22 +1285,369 @@ 5034CA4A191D591100CE6051 /* ccShader_Label_df.frag in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA0F191D591000CE6051 /* ccShader_Label_df.frag */; }; 5034CA4B191D591100CE6051 /* ccShader_Label_df_glow.frag in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA10191D591000CE6051 /* ccShader_Label_df_glow.frag */; }; 5034CA4C191D591100CE6051 /* ccShader_Label_df_glow.frag in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA10191D591000CE6051 /* ccShader_Label_df_glow.frag */; }; - 5034CA4D191D591100CE6051 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA11191D591000CE6051 /* ccGLStateCache.h */; }; - 5034CA4E191D591100CE6051 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA11191D591000CE6051 /* ccGLStateCache.h */; }; - 5034CA4F191D591100CE6051 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA12191D591000CE6051 /* ccGLStateCache.cpp */; }; - 5034CA50191D591100CE6051 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA12191D591000CE6051 /* ccGLStateCache.cpp */; }; - 5034CA51191D591100CE6051 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA13191D591000CE6051 /* CCGLProgramStateCache.h */; }; - 5034CA52191D591100CE6051 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA13191D591000CE6051 /* CCGLProgramStateCache.h */; }; - 5034CA53191D591100CE6051 /* CCGLProgramStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA14191D591000CE6051 /* CCGLProgramStateCache.cpp */; }; - 5034CA54191D591100CE6051 /* CCGLProgramStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA14191D591000CE6051 /* CCGLProgramStateCache.cpp */; }; - 5034CA55191D591100CE6051 /* CCGLProgramState.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA15191D591000CE6051 /* CCGLProgramState.h */; }; - 5034CA56191D591100CE6051 /* CCGLProgramState.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA15191D591000CE6051 /* CCGLProgramState.h */; }; - 5034CA57191D591100CE6051 /* CCGLProgramState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA16191D591000CE6051 /* CCGLProgramState.cpp */; }; - 5034CA58191D591100CE6051 /* CCGLProgramState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA16191D591000CE6051 /* CCGLProgramState.cpp */; }; - 5034CA59191D591100CE6051 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA17191D591000CE6051 /* CCGLProgram.h */; }; - 5034CA5A191D591100CE6051 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 5034CA17191D591000CE6051 /* CCGLProgram.h */; }; - 5034CA5B191D591100CE6051 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA18191D591000CE6051 /* CCGLProgram.cpp */; }; - 5034CA5C191D591100CE6051 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5034CA18191D591000CE6051 /* CCGLProgram.cpp */; }; + 503DD8E01926736A00CD74DD /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8CE1926736A00CD74DD /* CCApplication.h */; }; + 503DD8E11926736A00CD74DD /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8CF1926736A00CD74DD /* CCApplication.mm */; }; + 503DD8E21926736A00CD74DD /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8D01926736A00CD74DD /* CCCommon.mm */; }; + 503DD8E31926736A00CD74DD /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8D11926736A00CD74DD /* CCDevice.mm */; }; + 503DD8E41926736A00CD74DD /* CCDirectorCaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D21926736A00CD74DD /* CCDirectorCaller.h */; }; + 503DD8E51926736A00CD74DD /* CCDirectorCaller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8D31926736A00CD74DD /* CCDirectorCaller.mm */; }; + 503DD8E61926736A00CD74DD /* CCEAGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D41926736A00CD74DD /* CCEAGLView.h */; }; + 503DD8E71926736A00CD74DD /* CCEAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8D51926736A00CD74DD /* CCEAGLView.mm */; }; + 503DD8E81926736A00CD74DD /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D61926736A00CD74DD /* CCES2Renderer.h */; }; + 503DD8E91926736A00CD74DD /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8D71926736A00CD74DD /* CCES2Renderer.m */; }; + 503DD8EA1926736A00CD74DD /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D81926736A00CD74DD /* CCESRenderer.h */; }; + 503DD8EB1926736A00CD74DD /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8D91926736A00CD74DD /* CCGL.h */; }; + 503DD8EC1926736A00CD74DD /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DA1926736A00CD74DD /* CCGLView.h */; }; + 503DD8ED1926736A00CD74DD /* CCGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8DB1926736A00CD74DD /* CCGLView.mm */; }; + 503DD8EE1926736A00CD74DD /* CCImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8DC1926736A00CD74DD /* CCImage.mm */; }; + 503DD8EF1926736A00CD74DD /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DD1926736A00CD74DD /* CCPlatformDefine.h */; }; + 503DD8F01926736A00CD74DD /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DE1926736A00CD74DD /* CCStdC.h */; }; + 503DD8F11926736A00CD74DD /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8DF1926736A00CD74DD /* OpenGL_Internal.h */; }; + 503DD8F51926B0DB00CD74DD /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8F21926B0DB00CD74DD /* CCIMEDelegate.h */; }; + 503DD8F61926B0DB00CD74DD /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8F21926B0DB00CD74DD /* CCIMEDelegate.h */; }; + 503DD8F71926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8F31926B0DB00CD74DD /* CCIMEDispatcher.cpp */; }; + 503DD8F81926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503DD8F31926B0DB00CD74DD /* CCIMEDispatcher.cpp */; }; + 503DD8F91926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8F41926B0DB00CD74DD /* CCIMEDispatcher.h */; }; + 503DD8FA1926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 503DD8F41926B0DB00CD74DD /* CCIMEDispatcher.h */; }; + 50ABBD381925AB0000A911A9 /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD1B1925AB0000A911A9 /* CCAffineTransform.cpp */; }; + 50ABBD391925AB0000A911A9 /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD1B1925AB0000A911A9 /* CCAffineTransform.cpp */; }; + 50ABBD3A1925AB0000A911A9 /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1C1925AB0000A911A9 /* CCAffineTransform.h */; }; + 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1C1925AB0000A911A9 /* CCAffineTransform.h */; }; + 50ABBD3C1925AB0000A911A9 /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD1D1925AB0000A911A9 /* CCGeometry.cpp */; }; + 50ABBD3D1925AB0000A911A9 /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD1D1925AB0000A911A9 /* CCGeometry.cpp */; }; + 50ABBD3E1925AB0000A911A9 /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1E1925AB0000A911A9 /* CCGeometry.h */; }; + 50ABBD3F1925AB0000A911A9 /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1E1925AB0000A911A9 /* CCGeometry.h */; }; + 50ABBD401925AB0000A911A9 /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1F1925AB0000A911A9 /* CCMath.h */; }; + 50ABBD411925AB0000A911A9 /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD1F1925AB0000A911A9 /* CCMath.h */; }; + 50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD201925AB0000A911A9 /* CCMathBase.h */; }; + 50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD201925AB0000A911A9 /* CCMathBase.h */; }; + 50ABBD441925AB0000A911A9 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD211925AB0000A911A9 /* CCVertex.cpp */; }; + 50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD211925AB0000A911A9 /* CCVertex.cpp */; }; + 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD221925AB0000A911A9 /* CCVertex.h */; }; + 50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD221925AB0000A911A9 /* CCVertex.h */; }; + 50ABBD481925AB0000A911A9 /* Mat4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD231925AB0000A911A9 /* Mat4.cpp */; }; + 50ABBD491925AB0000A911A9 /* Mat4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD231925AB0000A911A9 /* Mat4.cpp */; }; + 50ABBD4A1925AB0000A911A9 /* Mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD241925AB0000A911A9 /* Mat4.h */; }; + 50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD241925AB0000A911A9 /* Mat4.h */; }; + 50ABBD4C1925AB0000A911A9 /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD261925AB0000A911A9 /* MathUtil.cpp */; }; + 50ABBD4D1925AB0000A911A9 /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD261925AB0000A911A9 /* MathUtil.cpp */; }; + 50ABBD4E1925AB0000A911A9 /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD271925AB0000A911A9 /* MathUtil.h */; }; + 50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD271925AB0000A911A9 /* MathUtil.h */; }; + 50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2A1925AB0000A911A9 /* Quaternion.cpp */; }; + 50ABBD511925AB0000A911A9 /* Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2A1925AB0000A911A9 /* Quaternion.cpp */; }; + 50ABBD521925AB0000A911A9 /* Quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD2B1925AB0000A911A9 /* Quaternion.h */; }; + 50ABBD531925AB0000A911A9 /* Quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD2B1925AB0000A911A9 /* Quaternion.h */; }; + 50ABBD541925AB0000A911A9 /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2D1925AB0000A911A9 /* TransformUtils.cpp */; }; + 50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2D1925AB0000A911A9 /* TransformUtils.cpp */; }; + 50ABBD561925AB0000A911A9 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD2E1925AB0000A911A9 /* TransformUtils.h */; }; + 50ABBD571925AB0000A911A9 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD2E1925AB0000A911A9 /* TransformUtils.h */; }; + 50ABBD581925AB0000A911A9 /* Vec2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2F1925AB0000A911A9 /* Vec2.cpp */; }; + 50ABBD591925AB0000A911A9 /* Vec2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD2F1925AB0000A911A9 /* Vec2.cpp */; }; + 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD301925AB0000A911A9 /* Vec2.h */; }; + 50ABBD5B1925AB0000A911A9 /* Vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD301925AB0000A911A9 /* Vec2.h */; }; + 50ABBD5C1925AB0000A911A9 /* Vec3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD321925AB0000A911A9 /* Vec3.cpp */; }; + 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD321925AB0000A911A9 /* Vec3.cpp */; }; + 50ABBD5E1925AB0000A911A9 /* Vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD331925AB0000A911A9 /* Vec3.h */; }; + 50ABBD5F1925AB0000A911A9 /* Vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD331925AB0000A911A9 /* Vec3.h */; }; + 50ABBD601925AB0000A911A9 /* Vec4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD351925AB0000A911A9 /* Vec4.cpp */; }; + 50ABBD611925AB0000A911A9 /* Vec4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD351925AB0000A911A9 /* Vec4.cpp */; }; + 50ABBD621925AB0000A911A9 /* Vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD361925AB0000A911A9 /* Vec4.h */; }; + 50ABBD631925AB0000A911A9 /* Vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD361925AB0000A911A9 /* Vec4.h */; }; + 50ABBD831925AB4100A911A9 /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD641925AB4100A911A9 /* CCBatchCommand.cpp */; }; + 50ABBD841925AB4100A911A9 /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD641925AB4100A911A9 /* CCBatchCommand.cpp */; }; + 50ABBD851925AB4100A911A9 /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD651925AB4100A911A9 /* CCBatchCommand.h */; }; + 50ABBD861925AB4100A911A9 /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD651925AB4100A911A9 /* CCBatchCommand.h */; }; + 50ABBD871925AB4100A911A9 /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD661925AB4100A911A9 /* CCCustomCommand.cpp */; }; + 50ABBD881925AB4100A911A9 /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD661925AB4100A911A9 /* CCCustomCommand.cpp */; }; + 50ABBD891925AB4100A911A9 /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD671925AB4100A911A9 /* CCCustomCommand.h */; }; + 50ABBD8A1925AB4100A911A9 /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD671925AB4100A911A9 /* CCCustomCommand.h */; }; + 50ABBD8B1925AB4100A911A9 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD681925AB4100A911A9 /* CCGLProgram.cpp */; }; + 50ABBD8C1925AB4100A911A9 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD681925AB4100A911A9 /* CCGLProgram.cpp */; }; + 50ABBD8D1925AB4100A911A9 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD691925AB4100A911A9 /* CCGLProgram.h */; }; + 50ABBD8E1925AB4100A911A9 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD691925AB4100A911A9 /* CCGLProgram.h */; }; + 50ABBD8F1925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6A1925AB4100A911A9 /* CCGLProgramCache.cpp */; }; + 50ABBD901925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6A1925AB4100A911A9 /* CCGLProgramCache.cpp */; }; + 50ABBD911925AB4100A911A9 /* CCGLProgramCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6B1925AB4100A911A9 /* CCGLProgramCache.h */; }; + 50ABBD921925AB4100A911A9 /* CCGLProgramCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6B1925AB4100A911A9 /* CCGLProgramCache.h */; }; + 50ABBD931925AB4100A911A9 /* CCGLProgramState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6C1925AB4100A911A9 /* CCGLProgramState.cpp */; }; + 50ABBD941925AB4100A911A9 /* CCGLProgramState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6C1925AB4100A911A9 /* CCGLProgramState.cpp */; }; + 50ABBD951925AB4100A911A9 /* CCGLProgramState.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */; }; + 50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */; }; + 50ABBD971925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */; }; + 50ABBD981925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */; }; + 50ABBD991925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */; }; + 50ABBD9A1925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */; }; + 50ABBD9B1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */; }; + 50ABBD9C1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */; }; + 50ABBD9D1925AB4100A911A9 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */; }; + 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */; }; + 50ABBD9F1925AB4100A911A9 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */; }; + 50ABBDA01925AB4100A911A9 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */; }; + 50ABBDA11925AB4100A911A9 /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */; }; + 50ABBDA21925AB4100A911A9 /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */; }; + 50ABBDA31925AB4100A911A9 /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */; }; + 50ABBDA41925AB4100A911A9 /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */; }; + 50ABBDA51925AB4100A911A9 /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */; }; + 50ABBDA61925AB4100A911A9 /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */; }; + 50ABBDA71925AB4100A911A9 /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */; }; + 50ABBDA81925AB4100A911A9 /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */; }; + 50ABBDA91925AB4100A911A9 /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD771925AB4100A911A9 /* CCRenderCommand.h */; }; + 50ABBDAA1925AB4100A911A9 /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD771925AB4100A911A9 /* CCRenderCommand.h */; }; + 50ABBDAB1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD781925AB4100A911A9 /* CCRenderCommandPool.h */; }; + 50ABBDAC1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD781925AB4100A911A9 /* CCRenderCommandPool.h */; }; + 50ABBDAD1925AB4100A911A9 /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD791925AB4100A911A9 /* CCRenderer.cpp */; }; + 50ABBDAE1925AB4100A911A9 /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD791925AB4100A911A9 /* CCRenderer.cpp */; }; + 50ABBDAF1925AB4100A911A9 /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7A1925AB4100A911A9 /* CCRenderer.h */; }; + 50ABBDB01925AB4100A911A9 /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7A1925AB4100A911A9 /* CCRenderer.h */; }; + 50ABBDB11925AB4100A911A9 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7B1925AB4100A911A9 /* ccShaders.cpp */; }; + 50ABBDB21925AB4100A911A9 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7B1925AB4100A911A9 /* ccShaders.cpp */; }; + 50ABBDB31925AB4100A911A9 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7C1925AB4100A911A9 /* ccShaders.h */; }; + 50ABBDB41925AB4100A911A9 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7C1925AB4100A911A9 /* ccShaders.h */; }; + 50ABBDB51925AB4100A911A9 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7D1925AB4100A911A9 /* CCTexture2D.cpp */; }; + 50ABBDB61925AB4100A911A9 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7D1925AB4100A911A9 /* CCTexture2D.cpp */; }; + 50ABBDB71925AB4100A911A9 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7E1925AB4100A911A9 /* CCTexture2D.h */; }; + 50ABBDB81925AB4100A911A9 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD7E1925AB4100A911A9 /* CCTexture2D.h */; }; + 50ABBDB91925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7F1925AB4100A911A9 /* CCTextureAtlas.cpp */; }; + 50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD7F1925AB4100A911A9 /* CCTextureAtlas.cpp */; }; + 50ABBDBB1925AB4100A911A9 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD801925AB4100A911A9 /* CCTextureAtlas.h */; }; + 50ABBDBC1925AB4100A911A9 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD801925AB4100A911A9 /* CCTextureAtlas.h */; }; + 50ABBDBD1925AB4100A911A9 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD811925AB4100A911A9 /* CCTextureCache.cpp */; }; + 50ABBDBE1925AB4100A911A9 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBD811925AB4100A911A9 /* CCTextureCache.cpp */; }; + 50ABBDBF1925AB4100A911A9 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD821925AB4100A911A9 /* CCTextureCache.h */; }; + 50ABBDC01925AB4100A911A9 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBD821925AB4100A911A9 /* CCTextureCache.h */; }; + 50ABBE1F1925AB6F00A911A9 /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC11925AB6E00A911A9 /* atitc.cpp */; }; + 50ABBE201925AB6F00A911A9 /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC11925AB6E00A911A9 /* atitc.cpp */; }; + 50ABBE211925AB6F00A911A9 /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC21925AB6E00A911A9 /* atitc.h */; }; + 50ABBE221925AB6F00A911A9 /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC21925AB6E00A911A9 /* atitc.h */; }; + 50ABBE231925AB6F00A911A9 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC31925AB6E00A911A9 /* base64.cpp */; }; + 50ABBE241925AB6F00A911A9 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC31925AB6E00A911A9 /* base64.cpp */; }; + 50ABBE251925AB6F00A911A9 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC41925AB6E00A911A9 /* base64.h */; }; + 50ABBE261925AB6F00A911A9 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC41925AB6E00A911A9 /* base64.h */; }; + 50ABBE271925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC51925AB6E00A911A9 /* CCAutoreleasePool.cpp */; }; + 50ABBE281925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC51925AB6E00A911A9 /* CCAutoreleasePool.cpp */; }; + 50ABBE291925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC61925AB6E00A911A9 /* CCAutoreleasePool.h */; }; + 50ABBE2A1925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC61925AB6E00A911A9 /* CCAutoreleasePool.h */; }; + 50ABBE2B1925AB6F00A911A9 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC71925AB6E00A911A9 /* ccCArray.cpp */; }; + 50ABBE2C1925AB6F00A911A9 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDC71925AB6E00A911A9 /* ccCArray.cpp */; }; + 50ABBE2D1925AB6F00A911A9 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC81925AB6E00A911A9 /* ccCArray.h */; }; + 50ABBE2E1925AB6F00A911A9 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC81925AB6E00A911A9 /* ccCArray.h */; }; + 50ABBE2F1925AB6F00A911A9 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC91925AB6E00A911A9 /* ccConfig.h */; }; + 50ABBE301925AB6F00A911A9 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDC91925AB6E00A911A9 /* ccConfig.h */; }; + 50ABBE311925AB6F00A911A9 /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCA1925AB6E00A911A9 /* CCConfiguration.cpp */; }; + 50ABBE321925AB6F00A911A9 /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCA1925AB6E00A911A9 /* CCConfiguration.cpp */; }; + 50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCB1925AB6E00A911A9 /* CCConfiguration.h */; }; + 50ABBE341925AB6F00A911A9 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCB1925AB6E00A911A9 /* CCConfiguration.h */; }; + 50ABBE351925AB6F00A911A9 /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCC1925AB6E00A911A9 /* CCConsole.cpp */; }; + 50ABBE361925AB6F00A911A9 /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCC1925AB6E00A911A9 /* CCConsole.cpp */; }; + 50ABBE371925AB6F00A911A9 /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCD1925AB6E00A911A9 /* CCConsole.h */; }; + 50ABBE381925AB6F00A911A9 /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCD1925AB6E00A911A9 /* CCConsole.h */; }; + 50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCE1925AB6E00A911A9 /* CCData.cpp */; }; + 50ABBE3A1925AB6F00A911A9 /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDCE1925AB6E00A911A9 /* CCData.cpp */; }; + 50ABBE3B1925AB6F00A911A9 /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCF1925AB6E00A911A9 /* CCData.h */; }; + 50ABBE3C1925AB6F00A911A9 /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDCF1925AB6E00A911A9 /* CCData.h */; }; + 50ABBE3D1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD01925AB6E00A911A9 /* CCDataVisitor.cpp */; }; + 50ABBE3E1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD01925AB6E00A911A9 /* CCDataVisitor.cpp */; }; + 50ABBE3F1925AB6F00A911A9 /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD11925AB6E00A911A9 /* CCDataVisitor.h */; }; + 50ABBE401925AB6F00A911A9 /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD11925AB6E00A911A9 /* CCDataVisitor.h */; }; + 50ABBE411925AB6F00A911A9 /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD21925AB6E00A911A9 /* CCDirector.cpp */; }; + 50ABBE421925AB6F00A911A9 /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD21925AB6E00A911A9 /* CCDirector.cpp */; }; + 50ABBE431925AB6F00A911A9 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD31925AB6E00A911A9 /* CCDirector.h */; }; + 50ABBE441925AB6F00A911A9 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD31925AB6E00A911A9 /* CCDirector.h */; }; + 50ABBE451925AB6F00A911A9 /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD41925AB6E00A911A9 /* CCEvent.cpp */; }; + 50ABBE461925AB6F00A911A9 /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD41925AB6E00A911A9 /* CCEvent.cpp */; }; + 50ABBE471925AB6F00A911A9 /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD51925AB6E00A911A9 /* CCEvent.h */; }; + 50ABBE481925AB6F00A911A9 /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD51925AB6E00A911A9 /* CCEvent.h */; }; + 50ABBE491925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD61925AB6E00A911A9 /* CCEventAcceleration.cpp */; }; + 50ABBE4A1925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD61925AB6E00A911A9 /* CCEventAcceleration.cpp */; }; + 50ABBE4B1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD71925AB6E00A911A9 /* CCEventAcceleration.h */; }; + 50ABBE4C1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD71925AB6E00A911A9 /* CCEventAcceleration.h */; }; + 50ABBE4D1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD81925AB6E00A911A9 /* CCEventCustom.cpp */; }; + 50ABBE4E1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDD81925AB6E00A911A9 /* CCEventCustom.cpp */; }; + 50ABBE4F1925AB6F00A911A9 /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD91925AB6E00A911A9 /* CCEventCustom.h */; }; + 50ABBE501925AB6F00A911A9 /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDD91925AB6E00A911A9 /* CCEventCustom.h */; }; + 50ABBE511925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDA1925AB6E00A911A9 /* CCEventDispatcher.cpp */; }; + 50ABBE521925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDA1925AB6E00A911A9 /* CCEventDispatcher.cpp */; }; + 50ABBE531925AB6F00A911A9 /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDB1925AB6E00A911A9 /* CCEventDispatcher.h */; }; + 50ABBE541925AB6F00A911A9 /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDB1925AB6E00A911A9 /* CCEventDispatcher.h */; }; + 50ABBE551925AB6F00A911A9 /* CCEventFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDC1925AB6E00A911A9 /* CCEventFocus.cpp */; }; + 50ABBE561925AB6F00A911A9 /* CCEventFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDC1925AB6E00A911A9 /* CCEventFocus.cpp */; }; + 50ABBE571925AB6F00A911A9 /* CCEventFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDD1925AB6E00A911A9 /* CCEventFocus.h */; }; + 50ABBE581925AB6F00A911A9 /* CCEventFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDD1925AB6E00A911A9 /* CCEventFocus.h */; }; + 50ABBE591925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDE1925AB6E00A911A9 /* CCEventKeyboard.cpp */; }; + 50ABBE5A1925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDDE1925AB6E00A911A9 /* CCEventKeyboard.cpp */; }; + 50ABBE5B1925AB6F00A911A9 /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDF1925AB6E00A911A9 /* CCEventKeyboard.h */; }; + 50ABBE5C1925AB6F00A911A9 /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDDF1925AB6E00A911A9 /* CCEventKeyboard.h */; }; + 50ABBE5D1925AB6F00A911A9 /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE01925AB6E00A911A9 /* CCEventListener.cpp */; }; + 50ABBE5E1925AB6F00A911A9 /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE01925AB6E00A911A9 /* CCEventListener.cpp */; }; + 50ABBE5F1925AB6F00A911A9 /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE11925AB6E00A911A9 /* CCEventListener.h */; }; + 50ABBE601925AB6F00A911A9 /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE11925AB6E00A911A9 /* CCEventListener.h */; }; + 50ABBE611925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE21925AB6E00A911A9 /* CCEventListenerAcceleration.cpp */; }; + 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE21925AB6E00A911A9 /* CCEventListenerAcceleration.cpp */; }; + 50ABBE631925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE31925AB6E00A911A9 /* CCEventListenerAcceleration.h */; }; + 50ABBE641925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE31925AB6E00A911A9 /* CCEventListenerAcceleration.h */; }; + 50ABBE651925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE41925AB6E00A911A9 /* CCEventListenerCustom.cpp */; }; + 50ABBE661925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE41925AB6E00A911A9 /* CCEventListenerCustom.cpp */; }; + 50ABBE671925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE51925AB6E00A911A9 /* CCEventListenerCustom.h */; }; + 50ABBE681925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE51925AB6E00A911A9 /* CCEventListenerCustom.h */; }; + 50ABBE691925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE61925AB6E00A911A9 /* CCEventListenerFocus.cpp */; }; + 50ABBE6A1925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE61925AB6E00A911A9 /* CCEventListenerFocus.cpp */; }; + 50ABBE6B1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE71925AB6E00A911A9 /* CCEventListenerFocus.h */; }; + 50ABBE6C1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE71925AB6E00A911A9 /* CCEventListenerFocus.h */; }; + 50ABBE6D1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE81925AB6E00A911A9 /* CCEventListenerKeyboard.cpp */; }; + 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDE81925AB6E00A911A9 /* CCEventListenerKeyboard.cpp */; }; + 50ABBE6F1925AB6F00A911A9 /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE91925AB6E00A911A9 /* CCEventListenerKeyboard.h */; }; + 50ABBE701925AB6F00A911A9 /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDE91925AB6E00A911A9 /* CCEventListenerKeyboard.h */; }; + 50ABBE711925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEA1925AB6E00A911A9 /* CCEventListenerMouse.cpp */; }; + 50ABBE721925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEA1925AB6E00A911A9 /* CCEventListenerMouse.cpp */; }; + 50ABBE731925AB6F00A911A9 /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDEB1925AB6E00A911A9 /* CCEventListenerMouse.h */; }; + 50ABBE741925AB6F00A911A9 /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDEB1925AB6E00A911A9 /* CCEventListenerMouse.h */; }; + 50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEC1925AB6E00A911A9 /* CCEventListenerTouch.cpp */; }; + 50ABBE761925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEC1925AB6E00A911A9 /* CCEventListenerTouch.cpp */; }; + 50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDED1925AB6E00A911A9 /* CCEventListenerTouch.h */; }; + 50ABBE781925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDED1925AB6E00A911A9 /* CCEventListenerTouch.h */; }; + 50ABBE791925AB6F00A911A9 /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEE1925AB6E00A911A9 /* CCEventMouse.cpp */; }; + 50ABBE7A1925AB6F00A911A9 /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDEE1925AB6E00A911A9 /* CCEventMouse.cpp */; }; + 50ABBE7B1925AB6F00A911A9 /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDEF1925AB6E00A911A9 /* CCEventMouse.h */; }; + 50ABBE7C1925AB6F00A911A9 /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDEF1925AB6E00A911A9 /* CCEventMouse.h */; }; + 50ABBE7D1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF01925AB6E00A911A9 /* CCEventTouch.cpp */; }; + 50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF01925AB6E00A911A9 /* CCEventTouch.cpp */; }; + 50ABBE7F1925AB6F00A911A9 /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF11925AB6E00A911A9 /* CCEventTouch.h */; }; + 50ABBE801925AB6F00A911A9 /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF11925AB6E00A911A9 /* CCEventTouch.h */; }; + 50ABBE811925AB6F00A911A9 /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF21925AB6E00A911A9 /* CCEventType.h */; }; + 50ABBE821925AB6F00A911A9 /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF21925AB6E00A911A9 /* CCEventType.h */; }; + 50ABBE831925AB6F00A911A9 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF31925AB6E00A911A9 /* ccFPSImages.c */; }; + 50ABBE841925AB6F00A911A9 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF31925AB6E00A911A9 /* ccFPSImages.c */; }; + 50ABBE851925AB6F00A911A9 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF41925AB6E00A911A9 /* ccFPSImages.h */; }; + 50ABBE861925AB6F00A911A9 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF41925AB6E00A911A9 /* ccFPSImages.h */; }; + 50ABBE871925AB6F00A911A9 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF51925AB6E00A911A9 /* ccMacros.h */; }; + 50ABBE881925AB6F00A911A9 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF51925AB6E00A911A9 /* ccMacros.h */; }; + 50ABBE891925AB6F00A911A9 /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF61925AB6E00A911A9 /* CCMap.h */; }; + 50ABBE8A1925AB6F00A911A9 /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF61925AB6E00A911A9 /* CCMap.h */; }; + 50ABBE8B1925AB6F00A911A9 /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF71925AB6E00A911A9 /* CCNS.cpp */; }; + 50ABBE8C1925AB6F00A911A9 /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDF71925AB6E00A911A9 /* CCNS.cpp */; }; + 50ABBE8D1925AB6F00A911A9 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF81925AB6E00A911A9 /* CCNS.h */; }; + 50ABBE8E1925AB6F00A911A9 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF81925AB6E00A911A9 /* CCNS.h */; }; + 50ABBE8F1925AB6F00A911A9 /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF91925AB6E00A911A9 /* CCPlatformConfig.h */; }; + 50ABBE901925AB6F00A911A9 /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDF91925AB6E00A911A9 /* CCPlatformConfig.h */; }; + 50ABBE911925AB6F00A911A9 /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFA1925AB6E00A911A9 /* CCPlatformMacros.h */; }; + 50ABBE921925AB6F00A911A9 /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFA1925AB6E00A911A9 /* CCPlatformMacros.h */; }; + 50ABBE931925AB6F00A911A9 /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */; }; + 50ABBE941925AB6F00A911A9 /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */; }; + 50ABBE951925AB6F00A911A9 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */; }; + 50ABBE961925AB6F00A911A9 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */; }; + 50ABBE971925AB6F00A911A9 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */; }; + 50ABBE981925AB6F00A911A9 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */; }; + 50ABBE991925AB6F00A911A9 /* CCRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */; }; + 50ABBE9A1925AB6F00A911A9 /* CCRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */; }; + 50ABBE9B1925AB6F00A911A9 /* CCRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFF1925AB6E00A911A9 /* CCRef.h */; }; + 50ABBE9C1925AB6F00A911A9 /* CCRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBDFF1925AB6E00A911A9 /* CCRef.h */; }; + 50ABBE9D1925AB6F00A911A9 /* CCRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */; }; + 50ABBE9E1925AB6F00A911A9 /* CCRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */; }; + 50ABBE9F1925AB6F00A911A9 /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE011925AB6E00A911A9 /* CCScheduler.cpp */; }; + 50ABBEA01925AB6F00A911A9 /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE011925AB6E00A911A9 /* CCScheduler.cpp */; }; + 50ABBEA11925AB6F00A911A9 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE021925AB6E00A911A9 /* CCScheduler.h */; }; + 50ABBEA21925AB6F00A911A9 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE021925AB6E00A911A9 /* CCScheduler.h */; }; + 50ABBEA31925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE031925AB6E00A911A9 /* CCScriptSupport.cpp */; }; + 50ABBEA41925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE031925AB6E00A911A9 /* CCScriptSupport.cpp */; }; + 50ABBEA51925AB6F00A911A9 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE041925AB6E00A911A9 /* CCScriptSupport.h */; }; + 50ABBEA61925AB6F00A911A9 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE041925AB6E00A911A9 /* CCScriptSupport.h */; }; + 50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE051925AB6E00A911A9 /* CCTouch.cpp */; }; + 50ABBEA81925AB6F00A911A9 /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE051925AB6E00A911A9 /* CCTouch.cpp */; }; + 50ABBEA91925AB6F00A911A9 /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE061925AB6E00A911A9 /* CCTouch.h */; }; + 50ABBEAA1925AB6F00A911A9 /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE061925AB6E00A911A9 /* CCTouch.h */; }; + 50ABBEAB1925AB6F00A911A9 /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE071925AB6E00A911A9 /* ccTypes.cpp */; }; + 50ABBEAC1925AB6F00A911A9 /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE071925AB6E00A911A9 /* ccTypes.cpp */; }; + 50ABBEAD1925AB6F00A911A9 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE081925AB6E00A911A9 /* ccTypes.h */; }; + 50ABBEAE1925AB6F00A911A9 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE081925AB6E00A911A9 /* ccTypes.h */; }; + 50ABBEAF1925AB6F00A911A9 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE091925AB6E00A911A9 /* CCUserDefault.cpp */; }; + 50ABBEB01925AB6F00A911A9 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE091925AB6E00A911A9 /* CCUserDefault.cpp */; }; + 50ABBEB11925AB6F00A911A9 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE0A1925AB6E00A911A9 /* CCUserDefault.h */; }; + 50ABBEB21925AB6F00A911A9 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE0A1925AB6E00A911A9 /* CCUserDefault.h */; }; + 50ABBEB31925AB6F00A911A9 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0B1925AB6F00A911A9 /* CCUserDefault.mm */; }; + 50ABBEB41925AB6F00A911A9 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0B1925AB6F00A911A9 /* CCUserDefault.mm */; }; + 50ABBEB51925AB6F00A911A9 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0C1925AB6F00A911A9 /* CCUserDefaultAndroid.cpp */; }; + 50ABBEB61925AB6F00A911A9 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0C1925AB6F00A911A9 /* CCUserDefaultAndroid.cpp */; }; + 50ABBEB71925AB6F00A911A9 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0D1925AB6F00A911A9 /* ccUTF8.cpp */; }; + 50ABBEB81925AB6F00A911A9 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0D1925AB6F00A911A9 /* ccUTF8.cpp */; }; + 50ABBEB91925AB6F00A911A9 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE0E1925AB6F00A911A9 /* ccUTF8.h */; }; + 50ABBEBA1925AB6F00A911A9 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE0E1925AB6F00A911A9 /* ccUTF8.h */; }; + 50ABBEBB1925AB6F00A911A9 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0F1925AB6F00A911A9 /* ccUtils.cpp */; }; + 50ABBEBC1925AB6F00A911A9 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE0F1925AB6F00A911A9 /* ccUtils.cpp */; }; + 50ABBEBD1925AB6F00A911A9 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE101925AB6F00A911A9 /* ccUtils.h */; }; + 50ABBEBE1925AB6F00A911A9 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE101925AB6F00A911A9 /* ccUtils.h */; }; + 50ABBEBF1925AB6F00A911A9 /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE111925AB6F00A911A9 /* CCValue.cpp */; }; + 50ABBEC01925AB6F00A911A9 /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE111925AB6F00A911A9 /* CCValue.cpp */; }; + 50ABBEC11925AB6F00A911A9 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE121925AB6F00A911A9 /* CCValue.h */; }; + 50ABBEC21925AB6F00A911A9 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE121925AB6F00A911A9 /* CCValue.h */; }; + 50ABBEC31925AB6F00A911A9 /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE131925AB6F00A911A9 /* CCVector.h */; }; + 50ABBEC41925AB6F00A911A9 /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE131925AB6F00A911A9 /* CCVector.h */; }; + 50ABBEC51925AB6F00A911A9 /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE141925AB6F00A911A9 /* etc1.cpp */; }; + 50ABBEC61925AB6F00A911A9 /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE141925AB6F00A911A9 /* etc1.cpp */; }; + 50ABBEC71925AB6F00A911A9 /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE151925AB6F00A911A9 /* etc1.h */; }; + 50ABBEC81925AB6F00A911A9 /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE151925AB6F00A911A9 /* etc1.h */; }; + 50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE161925AB6F00A911A9 /* firePngData.h */; }; + 50ABBECA1925AB6F00A911A9 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE161925AB6F00A911A9 /* firePngData.h */; }; + 50ABBECB1925AB6F00A911A9 /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE171925AB6F00A911A9 /* s3tc.cpp */; }; + 50ABBECC1925AB6F00A911A9 /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE171925AB6F00A911A9 /* s3tc.cpp */; }; + 50ABBECD1925AB6F00A911A9 /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE181925AB6F00A911A9 /* s3tc.h */; }; + 50ABBECE1925AB6F00A911A9 /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE181925AB6F00A911A9 /* s3tc.h */; }; + 50ABBECF1925AB6F00A911A9 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE191925AB6F00A911A9 /* TGAlib.cpp */; }; + 50ABBED01925AB6F00A911A9 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE191925AB6F00A911A9 /* TGAlib.cpp */; }; + 50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1A1925AB6F00A911A9 /* TGAlib.h */; }; + 50ABBED21925AB6F00A911A9 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1A1925AB6F00A911A9 /* TGAlib.h */; }; + 50ABBED31925AB6F00A911A9 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1B1925AB6F00A911A9 /* uthash.h */; }; + 50ABBED41925AB6F00A911A9 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1B1925AB6F00A911A9 /* uthash.h */; }; + 50ABBED51925AB6F00A911A9 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1C1925AB6F00A911A9 /* utlist.h */; }; + 50ABBED61925AB6F00A911A9 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1C1925AB6F00A911A9 /* utlist.h */; }; + 50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */; }; + 50ABBED81925AB6F00A911A9 /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */; }; + 50ABBED91925AB6F00A911A9 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */; }; + 50ABBEDA1925AB6F00A911A9 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */; }; + 50ABBFFD1926664800A911A9 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF1B1926664700A911A9 /* CCFileUtilsApple.h */; }; + 50ABBFFE1926664800A911A9 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF1B1926664700A911A9 /* CCFileUtilsApple.h */; }; + 50ABBFFF1926664800A911A9 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1C1926664700A911A9 /* CCFileUtilsApple.mm */; }; + 50ABC0001926664800A911A9 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1C1926664700A911A9 /* CCFileUtilsApple.mm */; }; + 50ABC0011926664800A911A9 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1D1926664700A911A9 /* CCLock.cpp */; }; + 50ABC0021926664800A911A9 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1D1926664700A911A9 /* CCLock.cpp */; }; + 50ABC0031926664800A911A9 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF1E1926664700A911A9 /* CCLock.h */; }; + 50ABC0041926664800A911A9 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF1E1926664700A911A9 /* CCLock.h */; }; + 50ABC0051926664800A911A9 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1F1926664700A911A9 /* CCThread.mm */; }; + 50ABC0061926664800A911A9 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF1F1926664700A911A9 /* CCThread.mm */; }; + 50ABC0071926664800A911A9 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF201926664700A911A9 /* CCApplicationProtocol.h */; }; + 50ABC0081926664800A911A9 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF201926664700A911A9 /* CCApplicationProtocol.h */; }; + 50ABC0091926664800A911A9 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF211926664700A911A9 /* CCCommon.h */; }; + 50ABC00A1926664800A911A9 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF211926664700A911A9 /* CCCommon.h */; }; + 50ABC00B1926664800A911A9 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF221926664700A911A9 /* CCDevice.h */; }; + 50ABC00C1926664800A911A9 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF221926664700A911A9 /* CCDevice.h */; }; + 50ABC00D1926664800A911A9 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF231926664700A911A9 /* CCFileUtils.cpp */; }; + 50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF231926664700A911A9 /* CCFileUtils.cpp */; }; + 50ABC00F1926664800A911A9 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF241926664700A911A9 /* CCFileUtils.h */; }; + 50ABC0101926664800A911A9 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF241926664700A911A9 /* CCFileUtils.h */; }; + 50ABC0111926664800A911A9 /* CCGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF251926664700A911A9 /* CCGLViewProtocol.cpp */; }; + 50ABC0121926664800A911A9 /* CCGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF251926664700A911A9 /* CCGLViewProtocol.cpp */; }; + 50ABC0131926664800A911A9 /* CCGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF261926664700A911A9 /* CCGLViewProtocol.h */; }; + 50ABC0141926664800A911A9 /* CCGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF261926664700A911A9 /* CCGLViewProtocol.h */; }; + 50ABC0151926664800A911A9 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF271926664700A911A9 /* CCImage.cpp */; }; + 50ABC0161926664800A911A9 /* CCImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF271926664700A911A9 /* CCImage.cpp */; }; + 50ABC0171926664800A911A9 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF281926664700A911A9 /* CCImage.h */; }; + 50ABC0181926664800A911A9 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF281926664700A911A9 /* CCImage.h */; }; + 50ABC0191926664800A911A9 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF291926664700A911A9 /* CCSAXParser.cpp */; }; + 50ABC01A1926664800A911A9 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF291926664700A911A9 /* CCSAXParser.cpp */; }; + 50ABC01B1926664800A911A9 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF2A1926664700A911A9 /* CCSAXParser.h */; }; + 50ABC01C1926664800A911A9 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF2A1926664700A911A9 /* CCSAXParser.h */; }; + 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF2B1926664700A911A9 /* CCThread.cpp */; }; + 50ABC01E1926664800A911A9 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF2B1926664700A911A9 /* CCThread.cpp */; }; + 50ABC01F1926664800A911A9 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF2C1926664700A911A9 /* CCThread.h */; }; + 50ABC0201926664800A911A9 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF2C1926664700A911A9 /* CCThread.h */; }; + 50ABC0211926664800A911A9 /* CCGLView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF2E1926664700A911A9 /* CCGLView.cpp */; }; + 50ABC0231926664800A911A9 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF2F1926664700A911A9 /* CCGLView.h */; }; + 50ABC05D1926664800A911A9 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF4F1926664700A911A9 /* CCApplication.h */; }; + 50ABC05F1926664800A911A9 /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF501926664700A911A9 /* CCApplication.mm */; }; + 50ABC0611926664800A911A9 /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF511926664700A911A9 /* CCCommon.mm */; }; + 50ABC0631926664800A911A9 /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 50ABBF521926664700A911A9 /* CCDevice.mm */; }; + 50ABC0651926664800A911A9 /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF531926664700A911A9 /* CCGL.h */; }; + 50ABC0671926664800A911A9 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF541926664700A911A9 /* CCPlatformDefine.h */; }; + 50ABC0691926664800A911A9 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ABBF551926664700A911A9 /* CCStdC.h */; }; 50E6D30E18DADB5D0051CA34 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */; }; 50E6D30F18DADB5D0051CA34 /* CCProtectedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */; }; 50E6D31018DAF01A0051CA34 /* CCProtectedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */; }; @@ -1694,35 +1722,7 @@ 50FCEBCA18C72017004AD434 /* WidgetReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCEB9118C72017004AD434 /* WidgetReader.h */; }; 50FCEBCB18C72017004AD434 /* WidgetReaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */; }; 50FCEBCC18C72017004AD434 /* WidgetReaderProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */; }; - A04583F2189053B500E32FE8 /* CCGLView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A04583F0189053B500E32FE8 /* CCGLView.cpp */; }; - A04583F3189053B500E32FE8 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = A04583F1189053B500E32FE8 /* CCGLView.h */; }; A07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; }; - B2AF2F9518EBAEAE00C5807C /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8218EBAEAE00C5807C /* MathUtil.cpp */; }; - B2AF2F9618EBAEAE00C5807C /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8218EBAEAE00C5807C /* MathUtil.cpp */; }; - B2AF2F9718EBAEAE00C5807C /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8318EBAEAE00C5807C /* MathUtil.h */; }; - B2AF2F9818EBAEAE00C5807C /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8318EBAEAE00C5807C /* MathUtil.h */; }; - B2AF2F9918EBAEAE00C5807C /* Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8618EBAEAE00C5807C /* Matrix.cpp */; }; - B2AF2F9A18EBAEAE00C5807C /* Matrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8618EBAEAE00C5807C /* Matrix.cpp */; }; - B2AF2F9B18EBAEAE00C5807C /* Matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8718EBAEAE00C5807C /* Matrix.h */; }; - B2AF2F9C18EBAEAE00C5807C /* Matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8718EBAEAE00C5807C /* Matrix.h */; }; - B2AF2F9D18EBAEAE00C5807C /* Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8918EBAEAE00C5807C /* Quaternion.cpp */; }; - B2AF2F9E18EBAEAE00C5807C /* Quaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8918EBAEAE00C5807C /* Quaternion.cpp */; }; - B2AF2F9F18EBAEAE00C5807C /* Quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8A18EBAEAE00C5807C /* Quaternion.h */; }; - B2AF2FA018EBAEAE00C5807C /* Quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8A18EBAEAE00C5807C /* Quaternion.h */; }; - B2AF2FA118EBAEAE00C5807C /* Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8C18EBAEAE00C5807C /* Vector2.cpp */; }; - B2AF2FA218EBAEAE00C5807C /* Vector2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8C18EBAEAE00C5807C /* Vector2.cpp */; }; - B2AF2FA318EBAEAE00C5807C /* Vector2.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8D18EBAEAE00C5807C /* Vector2.h */; }; - B2AF2FA418EBAEAE00C5807C /* Vector2.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F8D18EBAEAE00C5807C /* Vector2.h */; }; - B2AF2FA518EBAEAE00C5807C /* Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8F18EBAEAE00C5807C /* Vector3.cpp */; }; - B2AF2FA618EBAEAE00C5807C /* Vector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F8F18EBAEAE00C5807C /* Vector3.cpp */; }; - B2AF2FA718EBAEAE00C5807C /* Vector3.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F9018EBAEAE00C5807C /* Vector3.h */; }; - B2AF2FA818EBAEAE00C5807C /* Vector3.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F9018EBAEAE00C5807C /* Vector3.h */; }; - B2AF2FA918EBAEAE00C5807C /* Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F9218EBAEAE00C5807C /* Vector4.cpp */; }; - B2AF2FAA18EBAEAE00C5807C /* Vector4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AF2F9218EBAEAE00C5807C /* Vector4.cpp */; }; - B2AF2FAB18EBAEAE00C5807C /* Vector4.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F9318EBAEAE00C5807C /* Vector4.h */; }; - B2AF2FAC18EBAEAE00C5807C /* Vector4.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2F9318EBAEAE00C5807C /* Vector4.h */; }; - B2AF2FB118EBBDA100C5807C /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2FB018EBBDA100C5807C /* CCMath.h */; }; - B2AF2FB218EBBDA100C5807C /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AF2FB018EBBDA100C5807C /* CCMath.h */; }; B37510711823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */; }; B37510721823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */; }; B37510731823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */; }; @@ -1873,9 +1873,6 @@ 1A01C6A318F58F7500EFE3A6 /* CCNotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNotificationCenter.h; sourceTree = ""; }; 1A087AE61860400400196EF5 /* edtaa3func.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = edtaa3func.cpp; sourceTree = ""; }; 1A087AE71860400400196EF5 /* edtaa3func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = edtaa3func.h; sourceTree = ""; }; - 1A0DB7301823827C0025743D /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; - 1A0DB7311823827C0025743D /* CCEAGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEAGLView.h; sourceTree = ""; }; - 1A0DB7351823828F0025743D /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; 1A1645AE191B726C008C7C7F /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConvertUTF.c; sourceTree = ""; }; 1A1645AF191B726C008C7C7F /* ConvertUTFWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertUTFWrapper.cpp; sourceTree = ""; }; 1A570047180BC5A10088DEC7 /* CCAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAction.cpp; sourceTree = ""; }; @@ -1966,8 +1963,6 @@ 1A57021E180BCC1A0088DEC7 /* CCParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystem.h; sourceTree = ""; }; 1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCParticleSystemQuad.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuad.h; sourceTree = ""; }; - 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScriptSupport.cpp; sourceTree = ""; }; - 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScriptSupport.h; sourceTree = ""; }; 1A570276180BCC900088DEC7 /* CCSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCSprite.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 1A570277180BCC900088DEC7 /* CCSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite.h; sourceTree = ""; }; 1A570278180BCC900088DEC7 /* CCSpriteBatchNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteBatchNode.cpp; sourceTree = ""; }; @@ -1980,22 +1975,8 @@ 1A57028F180BCCAB0088DEC7 /* CCAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimation.h; sourceTree = ""; }; 1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAnimationCache.cpp; sourceTree = ""; }; 1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimationCache.h; sourceTree = ""; }; - 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccUTF8.cpp; sourceTree = ""; }; - 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUTF8.h; sourceTree = ""; }; - 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertex.cpp; sourceTree = ""; }; - 1A5702B4180BCDF40088DEC7 /* CCVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertex.h; sourceTree = ""; }; - 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUtils.h; sourceTree = ""; }; - 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIMEDelegate.h; sourceTree = ""; }; - 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCIMEDispatcher.cpp; sourceTree = ""; }; - 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIMEDispatcher.h; sourceTree = ""; }; 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCTextFieldTTF.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextFieldTTF.h; sourceTree = ""; }; - 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexture2D.cpp; sourceTree = ""; }; - 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2D.h; sourceTree = ""; }; - 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureAtlas.cpp; sourceTree = ""; }; - 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureAtlas.h; sourceTree = ""; }; - 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureCache.cpp; sourceTree = ""; }; - 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCache.h; sourceTree = ""; }; 1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTileMapAtlas.cpp; sourceTree = ""; }; 1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTileMapAtlas.h; sourceTree = ""; }; 1A5702E2180BCE750088DEC7 /* CCTMXLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCTMXLayer.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; @@ -2008,21 +1989,10 @@ 1A5702E9180BCE750088DEC7 /* CCTMXXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCTMXXMLParser.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParallaxNode.cpp; sourceTree = ""; }; 1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParallaxNode.h; sourceTree = ""; }; - 1A570304180BCED90088DEC7 /* ccUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccUtils.cpp; sourceTree = ""; }; 1A570308180BCF190088DEC7 /* CCComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComponent.cpp; sourceTree = ""; }; 1A570309180BCF190088DEC7 /* CCComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComponent.h; sourceTree = ""; }; 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComponentContainer.cpp; sourceTree = ""; }; 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComponentContainer.h; sourceTree = ""; }; - 1A570315180BCF430088DEC7 /* ccCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccCArray.cpp; sourceTree = ""; }; - 1A570316180BCF430088DEC7 /* ccCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccCArray.h; sourceTree = ""; }; - 1A570317180BCF430088DEC7 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = ""; }; - 1A570318180BCF430088DEC7 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; - 1A570322180BCF660088DEC7 /* TGAlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TGAlib.cpp; sourceTree = ""; }; - 1A570323180BCF660088DEC7 /* TGAlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGAlib.h; sourceTree = ""; }; - 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUserDefault.cpp; sourceTree = ""; }; - 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUserDefault.h; sourceTree = ""; }; - 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCUserDefault.mm; sourceTree = ""; }; - 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUserDefaultAndroid.cpp; sourceTree = ""; }; 1A570346180BD0850088DEC7 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = ../external/glfw3/prebuilt/mac/libglfw3.a; sourceTree = ""; }; 1A570349180BD09B0088DEC7 /* tinyxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cpp; sourceTree = ""; }; 1A57034A180BD09B0088DEC7 /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = ""; }; @@ -2104,12 +2074,8 @@ 1A8C5986180E930E00EF57C3 /* CocoStudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoStudio.h; sourceTree = ""; }; 1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictionaryHelper.cpp; sourceTree = ""; }; 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryHelper.h; sourceTree = ""; }; - 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccFPSImages.c; sourceTree = ""; }; - 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccFPSImages.h; sourceTree = ""; }; 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLBufferedNode.cpp; sourceTree = ""; }; 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLBufferedNode.h; sourceTree = ""; }; - 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtocols.h; sourceTree = ""; }; - 1A9DCA0C180E6955007A3AD4 /* firePngData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = firePngData.h; sourceTree = ""; }; 1AAF5351180E3060000584C8 /* AssetsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManager.cpp; sourceTree = ""; }; 1AAF5352180E3060000584C8 /* AssetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssetsManager.h; sourceTree = ""; }; 1AAF5362180E3374000584C8 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = ""; }; @@ -2265,10 +2231,6 @@ 2905FA1318CF08D100240AA3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = ""; }; 2905FA1418CF08D100240AA3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = ""; }; 29080DEB191B82CE0066F8DF /* UIDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIDeprecated.h; sourceTree = ""; }; - 296CAD201915EC8000C64FBF /* CCEventFocus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventFocus.cpp; path = ../base/CCEventFocus.cpp; sourceTree = ""; }; - 296CAD211915EC8000C64FBF /* CCEventFocus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventFocus.h; path = ../base/CCEventFocus.h; sourceTree = ""; }; - 296CAD261915EC9900C64FBF /* CCEventListenerFocus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerFocus.cpp; path = ../base/CCEventListenerFocus.cpp; sourceTree = ""; }; - 296CAD271915EC9900C64FBF /* CCEventListenerFocus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerFocus.h; path = ../base/CCEventListenerFocus.h; sourceTree = ""; }; 2986667818B1B079000E39CA /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = ""; }; 2986667918B1B079000E39CA /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = ""; }; 2AC795D318628672005EC8E1 /* BoundingBoxAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoundingBoxAttachment.cpp; sourceTree = ""; }; @@ -2290,8 +2252,6 @@ 37936A3C1869B76800E974DD /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = ""; }; 37936A3D1869B76800E974DD /* stringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringbuffer.h; sourceTree = ""; }; 37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = ""; }; - 3E26D40418ACB5D100834404 /* CCImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCImage.cpp; sourceTree = ""; }; - 3E26D40718ACB63900834404 /* CCDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = ""; }; 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayer.h; sourceTree = ""; }; 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = ""; }; 46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = ""; }; @@ -2513,44 +2473,6 @@ 46A169981807AFD6005B8026 /* cpSweep1D.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = ""; }; 46A169991807AFD6005B8026 /* cpVect.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = ""; }; 46A1699A1807AFD6005B8026 /* prime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = ""; }; - 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsApple.h; sourceTree = ""; }; - 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCFileUtilsApple.mm; sourceTree = ""; }; - 46A16A911807B038005B8026 /* CCLock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCLock.cpp; sourceTree = ""; }; - 46A16A921807B038005B8026 /* CCLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCLock.h; sourceTree = ""; }; - 46A16A931807B038005B8026 /* CCThread.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCThread.mm; sourceTree = ""; }; - 46A16A941807B038005B8026 /* CCApplicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplicationProtocol.h; sourceTree = ""; }; - 46A16A951807B038005B8026 /* CCCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCCommon.h; sourceTree = ""; }; - 46A16A961807B038005B8026 /* CCDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDevice.h; sourceTree = ""; }; - 46A16A971807B038005B8026 /* CCGLViewProtocol.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCGLViewProtocol.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - 46A16A981807B038005B8026 /* CCGLViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCGLViewProtocol.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16A991807B038005B8026 /* CCFileUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtils.cpp; sourceTree = ""; }; - 46A16A9A1807B038005B8026 /* CCFileUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtils.h; sourceTree = ""; }; - 46A16A9B1807B038005B8026 /* CCImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCImage.h; sourceTree = ""; }; - 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCSAXParser.cpp; sourceTree = ""; }; - 46A16AA01807B038005B8026 /* CCSAXParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCSAXParser.h; sourceTree = ""; }; - 46A16AA11807B038005B8026 /* CCThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCThread.cpp; sourceTree = ""; }; - 46A16AA21807B038005B8026 /* CCThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCThread.h; sourceTree = ""; }; - 46A16AA41807B038005B8026 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; - 46A16AA51807B038005B8026 /* CCApplication.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCApplication.mm; sourceTree = ""; }; - 46A16AA61807B038005B8026 /* CCCommon.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCCommon.mm; sourceTree = ""; }; - 46A16AA71807B038005B8026 /* CCDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = ""; }; - 46A16AA81807B038005B8026 /* CCDirectorCaller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDirectorCaller.h; sourceTree = ""; }; - 46A16AA91807B038005B8026 /* CCDirectorCaller.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDirectorCaller.mm; sourceTree = ""; }; - 46A16AAA1807B038005B8026 /* CCGLView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCGLView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16AAB1807B038005B8026 /* CCGLView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = CCGLView.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16AAC1807B038005B8026 /* CCES2Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCES2Renderer.h; sourceTree = ""; }; - 46A16AAD1807B038005B8026 /* CCES2Renderer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CCES2Renderer.m; sourceTree = ""; }; - 46A16AAE1807B038005B8026 /* CCESRenderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCESRenderer.h; sourceTree = ""; }; - 46A16AB01807B038005B8026 /* CCImage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCImage.mm; sourceTree = ""; }; - 46A16AB11807B038005B8026 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; - 46A16AB21807B038005B8026 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; - 46A16AB41807B038005B8026 /* CCEAGLView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEAGLView.mm; sourceTree = ""; }; - 46A16AB51807B038005B8026 /* OpenGL_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGL_Internal.h; sourceTree = ""; }; - 46A16AC81807B038005B8026 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCApplication.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16AC91807B038005B8026 /* CCApplication.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = CCApplication.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16ACA1807B038005B8026 /* CCCommon.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = CCCommon.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 46A16AD41807B038005B8026 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; - 46A16AD51807B038005B8026 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; 46A16E1B1807C948005B8026 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos/2d/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; 46A16E1C1807C948005B8026 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../cocos/2d/platform/third_party/ios/libraries/libfreetype.a; sourceTree = ""; }; 46A16E1D1807C948005B8026 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../cocos/2d/platform/third_party/ios/libraries/libjpeg.a; sourceTree = ""; }; @@ -2577,103 +2499,8 @@ 46A170781807CE7A005B8026 /* CCPhysicsWorld.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorld.h; sourceTree = ""; }; 46C02E0518E91123004B7456 /* xxhash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xxhash.c; sourceTree = ""; }; 46C02E0618E91123004B7456 /* xxhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxhash.h; sourceTree = ""; }; - 500DC89919105D41007B91BF /* CCBatchCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBatchCommand.cpp; sourceTree = ""; }; - 500DC89A19105D41007B91BF /* CCBatchCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBatchCommand.h; sourceTree = ""; }; - 500DC89B19105D41007B91BF /* CCCustomCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCCustomCommand.cpp; sourceTree = ""; }; - 500DC89C19105D41007B91BF /* CCCustomCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCustomCommand.h; sourceTree = ""; }; - 500DC89D19105D41007B91BF /* CCGroupCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGroupCommand.cpp; sourceTree = ""; }; - 500DC89E19105D41007B91BF /* CCGroupCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGroupCommand.h; sourceTree = ""; }; - 500DC8A119105D41007B91BF /* CCQuadCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCQuadCommand.cpp; sourceTree = ""; }; - 500DC8A219105D41007B91BF /* CCQuadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCQuadCommand.h; sourceTree = ""; }; - 500DC8A319105D41007B91BF /* CCRenderCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderCommand.cpp; sourceTree = ""; }; - 500DC8A419105D41007B91BF /* CCRenderCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommand.h; sourceTree = ""; }; - 500DC8A519105D41007B91BF /* CCRenderCommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommandPool.h; sourceTree = ""; }; - 500DC8A619105D41007B91BF /* CCRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderer.cpp; sourceTree = ""; }; - 500DC8A719105D41007B91BF /* CCRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer.h; sourceTree = ""; }; - 500DC8CC19105F7D007B91BF /* CCAffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAffineTransform.cpp; sourceTree = ""; }; - 500DC8CD19105F7D007B91BF /* CCAffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAffineTransform.h; sourceTree = ""; }; - 500DC8CE19105F7D007B91BF /* CCGeometry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGeometry.cpp; sourceTree = ""; }; - 500DC8CF19105F7D007B91BF /* CCGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGeometry.h; sourceTree = ""; }; - 500DC8D019105F7D007B91BF /* CCMathBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMathBase.h; sourceTree = ""; }; - 500DC8E719106300007B91BF /* atitc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = atitc.cpp; path = ../base/atitc.cpp; sourceTree = ""; }; - 500DC8E819106300007B91BF /* atitc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atitc.h; path = ../base/atitc.h; sourceTree = ""; }; - 500DC8E919106300007B91BF /* base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = base64.cpp; path = ../base/base64.cpp; sourceTree = ""; }; - 500DC8EA19106300007B91BF /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = ../base/base64.h; sourceTree = ""; }; - 500DC8EB19106300007B91BF /* CCAutoreleasePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCAutoreleasePool.cpp; path = ../base/CCAutoreleasePool.cpp; sourceTree = ""; }; - 500DC8EC19106300007B91BF /* CCAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAutoreleasePool.h; path = ../base/CCAutoreleasePool.h; sourceTree = ""; }; - 500DC8ED19106300007B91BF /* ccConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccConfig.h; path = ../base/ccConfig.h; sourceTree = ""; }; - 500DC8EE19106300007B91BF /* CCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCConfiguration.cpp; path = ../base/CCConfiguration.cpp; sourceTree = ""; }; - 500DC8EF19106300007B91BF /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCConfiguration.h; path = ../base/CCConfiguration.h; sourceTree = ""; }; - 500DC8F019106300007B91BF /* CCConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCConsole.cpp; path = ../base/CCConsole.cpp; sourceTree = ""; }; - 500DC8F119106300007B91BF /* CCConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCConsole.h; path = ../base/CCConsole.h; sourceTree = ""; }; - 500DC8F219106300007B91BF /* CCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCData.cpp; path = ../base/CCData.cpp; sourceTree = ""; }; - 500DC8F319106300007B91BF /* CCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCData.h; path = ../base/CCData.h; sourceTree = ""; }; - 500DC8F419106300007B91BF /* CCDataVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDataVisitor.cpp; path = ../base/CCDataVisitor.cpp; sourceTree = ""; }; - 500DC8F519106300007B91BF /* CCDataVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDataVisitor.h; path = ../base/CCDataVisitor.h; sourceTree = ""; }; - 500DC8F619106300007B91BF /* CCDirector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDirector.cpp; path = ../base/CCDirector.cpp; sourceTree = ""; }; - 500DC8F719106300007B91BF /* CCDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDirector.h; path = ../base/CCDirector.h; sourceTree = ""; }; - 500DC8F819106300007B91BF /* CCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEvent.cpp; path = ../base/CCEvent.cpp; sourceTree = ""; }; - 500DC8F919106300007B91BF /* CCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEvent.h; path = ../base/CCEvent.h; sourceTree = ""; }; - 500DC8FA19106300007B91BF /* CCEventAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventAcceleration.cpp; path = ../base/CCEventAcceleration.cpp; sourceTree = ""; }; - 500DC8FB19106300007B91BF /* CCEventAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventAcceleration.h; path = ../base/CCEventAcceleration.h; sourceTree = ""; }; - 500DC8FC19106300007B91BF /* CCEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventCustom.cpp; path = ../base/CCEventCustom.cpp; sourceTree = ""; }; - 500DC8FD19106300007B91BF /* CCEventCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventCustom.h; path = ../base/CCEventCustom.h; sourceTree = ""; }; - 500DC8FE19106300007B91BF /* CCEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventDispatcher.cpp; path = ../base/CCEventDispatcher.cpp; sourceTree = ""; }; - 500DC8FF19106300007B91BF /* CCEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventDispatcher.h; path = ../base/CCEventDispatcher.h; sourceTree = ""; }; - 500DC90019106300007B91BF /* CCEventKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventKeyboard.cpp; path = ../base/CCEventKeyboard.cpp; sourceTree = ""; }; - 500DC90119106300007B91BF /* CCEventKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventKeyboard.h; path = ../base/CCEventKeyboard.h; sourceTree = ""; }; - 500DC90219106300007B91BF /* CCEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListener.cpp; path = ../base/CCEventListener.cpp; sourceTree = ""; }; - 500DC90319106300007B91BF /* CCEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListener.h; path = ../base/CCEventListener.h; sourceTree = ""; }; - 500DC90419106300007B91BF /* CCEventListenerAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerAcceleration.cpp; path = ../base/CCEventListenerAcceleration.cpp; sourceTree = ""; }; - 500DC90519106300007B91BF /* CCEventListenerAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerAcceleration.h; path = ../base/CCEventListenerAcceleration.h; sourceTree = ""; }; - 500DC90619106300007B91BF /* CCEventListenerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerCustom.cpp; path = ../base/CCEventListenerCustom.cpp; sourceTree = ""; }; - 500DC90719106300007B91BF /* CCEventListenerCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerCustom.h; path = ../base/CCEventListenerCustom.h; sourceTree = ""; }; - 500DC90819106300007B91BF /* CCEventListenerKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerKeyboard.cpp; path = ../base/CCEventListenerKeyboard.cpp; sourceTree = ""; }; - 500DC90919106300007B91BF /* CCEventListenerKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerKeyboard.h; path = ../base/CCEventListenerKeyboard.h; sourceTree = ""; }; - 500DC90A19106300007B91BF /* CCEventListenerMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerMouse.cpp; path = ../base/CCEventListenerMouse.cpp; sourceTree = ""; }; - 500DC90B19106300007B91BF /* CCEventListenerMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerMouse.h; path = ../base/CCEventListenerMouse.h; sourceTree = ""; }; - 500DC90C19106300007B91BF /* CCEventListenerTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerTouch.cpp; path = ../base/CCEventListenerTouch.cpp; sourceTree = ""; }; - 500DC90D19106300007B91BF /* CCEventListenerTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerTouch.h; path = ../base/CCEventListenerTouch.h; sourceTree = ""; }; - 500DC90E19106300007B91BF /* CCEventMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventMouse.cpp; path = ../base/CCEventMouse.cpp; sourceTree = ""; }; - 500DC90F19106300007B91BF /* CCEventMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventMouse.h; path = ../base/CCEventMouse.h; sourceTree = ""; }; - 500DC91019106300007B91BF /* CCEventTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventTouch.cpp; path = ../base/CCEventTouch.cpp; sourceTree = ""; }; - 500DC91119106300007B91BF /* CCEventTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventTouch.h; path = ../base/CCEventTouch.h; sourceTree = ""; }; - 500DC91219106300007B91BF /* CCEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventType.h; path = ../base/CCEventType.h; sourceTree = ""; }; - 500DC91319106300007B91BF /* ccMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccMacros.h; path = ../base/ccMacros.h; sourceTree = ""; }; - 500DC91419106300007B91BF /* CCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCMap.h; path = ../base/CCMap.h; sourceTree = ""; }; - 500DC91519106300007B91BF /* CCNS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCNS.cpp; path = ../base/CCNS.cpp; sourceTree = ""; }; - 500DC91619106300007B91BF /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCNS.h; path = ../base/CCNS.h; sourceTree = ""; }; - 500DC91719106300007B91BF /* CCPlatformConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformConfig.h; path = ../base/CCPlatformConfig.h; sourceTree = ""; }; - 500DC91819106300007B91BF /* CCPlatformMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformMacros.h; path = ../base/CCPlatformMacros.h; sourceTree = ""; }; - 500DC91919106300007B91BF /* CCRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCRef.cpp; path = ../base/CCRef.cpp; sourceTree = ""; }; - 500DC91A19106300007B91BF /* CCRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCRef.h; path = ../base/CCRef.h; sourceTree = ""; }; - 500DC91B19106300007B91BF /* CCRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCRefPtr.h; path = ../base/CCRefPtr.h; sourceTree = ""; }; - 500DC91C19106300007B91BF /* CCScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCScheduler.cpp; path = ../base/CCScheduler.cpp; sourceTree = ""; }; - 500DC91D19106300007B91BF /* CCScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCScheduler.h; path = ../base/CCScheduler.h; sourceTree = ""; }; - 500DC91E19106300007B91BF /* ccTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccTypes.cpp; path = ../base/ccTypes.cpp; sourceTree = ""; }; - 500DC91F19106300007B91BF /* ccTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccTypes.h; path = ../base/ccTypes.h; sourceTree = ""; }; - 500DC92019106300007B91BF /* CCValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCValue.cpp; path = ../base/CCValue.cpp; sourceTree = ""; }; - 500DC92119106300007B91BF /* CCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCValue.h; path = ../base/CCValue.h; sourceTree = ""; }; - 500DC92219106300007B91BF /* CCVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCVector.h; path = ../base/CCVector.h; sourceTree = ""; }; - 500DC92319106300007B91BF /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = ../base/CMakeLists.txt; sourceTree = ""; }; - 500DC92419106300007B91BF /* etc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = etc1.cpp; path = ../base/etc1.cpp; sourceTree = ""; }; - 500DC92519106300007B91BF /* etc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = etc1.h; path = ../base/etc1.h; sourceTree = ""; }; - 500DC92619106300007B91BF /* s3tc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s3tc.cpp; path = ../base/s3tc.cpp; sourceTree = ""; }; - 500DC92719106300007B91BF /* s3tc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s3tc.h; path = ../base/s3tc.h; sourceTree = ""; }; - 500DC92819106300007B91BF /* ZipUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ZipUtils.cpp; path = ../base/ZipUtils.cpp; sourceTree = ""; }; - 500DC92919106300007B91BF /* ZipUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZipUtils.h; path = ../base/ZipUtils.h; sourceTree = ""; }; - 500DC9AE1910633C007B91BF /* CCTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCTouch.cpp; path = ../base/CCTouch.cpp; sourceTree = ""; }; - 500DC9AF1910633C007B91BF /* CCTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCTouch.h; path = ../base/CCTouch.h; sourceTree = ""; }; - 500DC9B419106E6D007B91BF /* TransformUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformUtils.cpp; sourceTree = ""; }; - 500DC9B519106E6D007B91BF /* TransformUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformUtils.h; sourceTree = ""; }; - 500DC9BA19106E89007B91BF /* CCProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCProfiling.cpp; path = ../base/CCProfiling.cpp; sourceTree = ""; }; - 500DC9BB19106E89007B91BF /* CCProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCProfiling.h; path = ../base/CCProfiling.h; sourceTree = ""; }; 50272538190BF1B900AAF4ED /* cocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cocos2d.h; path = ../cocos/cocos2d.h; sourceTree = ""; }; 50272539190BF1B900AAF4ED /* cocos2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocos2d.cpp; path = ../cocos/cocos2d.cpp; sourceTree = ""; }; - 5034C9F7191D591000CE6051 /* ccShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaders.h; sourceTree = ""; }; - 5034C9F8191D591000CE6051 /* ccShaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccShaders.cpp; sourceTree = ""; }; - 5034C9F9191D591000CE6051 /* CCGLProgramCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramCache.h; sourceTree = ""; }; - 5034C9FA191D591000CE6051 /* CCGLProgramCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramCache.cpp; sourceTree = ""; }; 5034C9FB191D591000CE6051 /* ccShader_PositionTextureColorAlphaTest.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColorAlphaTest.frag; sourceTree = ""; }; 5034CA00191D591000CE6051 /* ccShader_PositionTextureA8Color.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureA8Color.vert; sourceTree = ""; }; 5034CA01191D591000CE6051 /* ccShader_PositionTextureA8Color.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureA8Color.frag; sourceTree = ""; }; @@ -2692,18 +2519,212 @@ 5034CA0E191D591000CE6051 /* ccShader_Label_normal.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_Label_normal.frag; sourceTree = ""; }; 5034CA0F191D591000CE6051 /* ccShader_Label_df.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_Label_df.frag; sourceTree = ""; }; 5034CA10191D591000CE6051 /* ccShader_Label_df_glow.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_Label_df_glow.frag; sourceTree = ""; }; - 5034CA11191D591000CE6051 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = ""; }; - 5034CA12191D591000CE6051 /* ccGLStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccGLStateCache.cpp; sourceTree = ""; }; - 5034CA13191D591000CE6051 /* CCGLProgramStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramStateCache.h; sourceTree = ""; }; - 5034CA14191D591000CE6051 /* CCGLProgramStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramStateCache.cpp; sourceTree = ""; }; - 5034CA15191D591000CE6051 /* CCGLProgramState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramState.h; sourceTree = ""; }; - 5034CA16191D591000CE6051 /* CCGLProgramState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramState.cpp; sourceTree = ""; }; - 5034CA17191D591000CE6051 /* CCGLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgram.h; sourceTree = ""; }; - 5034CA18191D591000CE6051 /* CCGLProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgram.cpp; sourceTree = ""; }; 5034CA60191D91CF00CE6051 /* ccShader_PositionTextureColor.vert */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColor.vert; sourceTree = ""; }; 5034CA61191D91CF00CE6051 /* ccShader_PositionTextureColor.frag */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColor.frag; sourceTree = ""; }; 5034CA62191D91CF00CE6051 /* ccShader_PositionTextureColor_noMVP.vert */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColor_noMVP.vert; sourceTree = ""; }; 5034CA63191D91CF00CE6051 /* ccShader_PositionTextureColor_noMVP.frag */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColor_noMVP.frag; sourceTree = ""; }; + 503DD8CE1926736A00CD74DD /* CCApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; + 503DD8CF1926736A00CD74DD /* CCApplication.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCApplication.mm; sourceTree = ""; }; + 503DD8D01926736A00CD74DD /* CCCommon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCCommon.mm; sourceTree = ""; }; + 503DD8D11926736A00CD74DD /* CCDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = ""; }; + 503DD8D21926736A00CD74DD /* CCDirectorCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirectorCaller.h; sourceTree = ""; }; + 503DD8D31926736A00CD74DD /* CCDirectorCaller.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDirectorCaller.mm; sourceTree = ""; }; + 503DD8D41926736A00CD74DD /* CCEAGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEAGLView.h; sourceTree = ""; }; + 503DD8D51926736A00CD74DD /* CCEAGLView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEAGLView.mm; sourceTree = ""; }; + 503DD8D61926736A00CD74DD /* CCES2Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCES2Renderer.h; sourceTree = ""; }; + 503DD8D71926736A00CD74DD /* CCES2Renderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCES2Renderer.m; sourceTree = ""; }; + 503DD8D81926736A00CD74DD /* CCESRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCESRenderer.h; sourceTree = ""; }; + 503DD8D91926736A00CD74DD /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; + 503DD8DA1926736A00CD74DD /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; + 503DD8DB1926736A00CD74DD /* CCGLView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCGLView.mm; sourceTree = ""; }; + 503DD8DC1926736A00CD74DD /* CCImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCImage.mm; sourceTree = ""; }; + 503DD8DD1926736A00CD74DD /* CCPlatformDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; + 503DD8DE1926736A00CD74DD /* CCStdC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; + 503DD8DF1926736A00CD74DD /* OpenGL_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenGL_Internal.h; sourceTree = ""; }; + 503DD8F21926B0DB00CD74DD /* CCIMEDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCIMEDelegate.h; path = ../base/CCIMEDelegate.h; sourceTree = ""; }; + 503DD8F31926B0DB00CD74DD /* CCIMEDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCIMEDispatcher.cpp; path = ../base/CCIMEDispatcher.cpp; sourceTree = ""; }; + 503DD8F41926B0DB00CD74DD /* CCIMEDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCIMEDispatcher.h; path = ../base/CCIMEDispatcher.h; sourceTree = ""; }; + 50ABBD1B1925AB0000A911A9 /* CCAffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAffineTransform.cpp; sourceTree = ""; }; + 50ABBD1C1925AB0000A911A9 /* CCAffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAffineTransform.h; sourceTree = ""; }; + 50ABBD1D1925AB0000A911A9 /* CCGeometry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGeometry.cpp; sourceTree = ""; }; + 50ABBD1E1925AB0000A911A9 /* CCGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGeometry.h; sourceTree = ""; }; + 50ABBD1F1925AB0000A911A9 /* CCMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMath.h; sourceTree = ""; }; + 50ABBD201925AB0000A911A9 /* CCMathBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMathBase.h; sourceTree = ""; }; + 50ABBD211925AB0000A911A9 /* CCVertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertex.cpp; sourceTree = ""; }; + 50ABBD221925AB0000A911A9 /* CCVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertex.h; sourceTree = ""; }; + 50ABBD231925AB0000A911A9 /* Mat4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mat4.cpp; sourceTree = ""; }; + 50ABBD241925AB0000A911A9 /* Mat4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mat4.h; sourceTree = ""; }; + 50ABBD251925AB0000A911A9 /* Mat4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Mat4.inl; sourceTree = ""; }; + 50ABBD261925AB0000A911A9 /* MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathUtil.cpp; sourceTree = ""; }; + 50ABBD271925AB0000A911A9 /* MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathUtil.h; sourceTree = ""; }; + 50ABBD281925AB0000A911A9 /* MathUtil.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MathUtil.inl; sourceTree = ""; }; + 50ABBD291925AB0000A911A9 /* MathUtilNeon.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MathUtilNeon.inl; sourceTree = ""; }; + 50ABBD2A1925AB0000A911A9 /* Quaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Quaternion.cpp; sourceTree = ""; }; + 50ABBD2B1925AB0000A911A9 /* Quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Quaternion.h; sourceTree = ""; }; + 50ABBD2C1925AB0000A911A9 /* Quaternion.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Quaternion.inl; sourceTree = ""; }; + 50ABBD2D1925AB0000A911A9 /* TransformUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformUtils.cpp; sourceTree = ""; }; + 50ABBD2E1925AB0000A911A9 /* TransformUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformUtils.h; sourceTree = ""; }; + 50ABBD2F1925AB0000A911A9 /* Vec2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vec2.cpp; sourceTree = ""; }; + 50ABBD301925AB0000A911A9 /* Vec2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vec2.h; sourceTree = ""; }; + 50ABBD311925AB0000A911A9 /* Vec2.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vec2.inl; sourceTree = ""; }; + 50ABBD321925AB0000A911A9 /* Vec3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vec3.cpp; sourceTree = ""; }; + 50ABBD331925AB0000A911A9 /* Vec3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vec3.h; sourceTree = ""; }; + 50ABBD341925AB0000A911A9 /* Vec3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vec3.inl; sourceTree = ""; }; + 50ABBD351925AB0000A911A9 /* Vec4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vec4.cpp; sourceTree = ""; }; + 50ABBD361925AB0000A911A9 /* Vec4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vec4.h; sourceTree = ""; }; + 50ABBD371925AB0000A911A9 /* Vec4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vec4.inl; sourceTree = ""; }; + 50ABBD641925AB4100A911A9 /* CCBatchCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBatchCommand.cpp; sourceTree = ""; }; + 50ABBD651925AB4100A911A9 /* CCBatchCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBatchCommand.h; sourceTree = ""; }; + 50ABBD661925AB4100A911A9 /* CCCustomCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCCustomCommand.cpp; sourceTree = ""; }; + 50ABBD671925AB4100A911A9 /* CCCustomCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCustomCommand.h; sourceTree = ""; }; + 50ABBD681925AB4100A911A9 /* CCGLProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgram.cpp; sourceTree = ""; }; + 50ABBD691925AB4100A911A9 /* CCGLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgram.h; sourceTree = ""; }; + 50ABBD6A1925AB4100A911A9 /* CCGLProgramCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramCache.cpp; sourceTree = ""; }; + 50ABBD6B1925AB4100A911A9 /* CCGLProgramCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramCache.h; sourceTree = ""; }; + 50ABBD6C1925AB4100A911A9 /* CCGLProgramState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramState.cpp; sourceTree = ""; }; + 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramState.h; sourceTree = ""; }; + 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgramStateCache.cpp; sourceTree = ""; }; + 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgramStateCache.h; sourceTree = ""; }; + 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccGLStateCache.cpp; sourceTree = ""; }; + 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = ""; }; + 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGroupCommand.cpp; sourceTree = ""; }; + 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGroupCommand.h; sourceTree = ""; }; + 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCQuadCommand.cpp; sourceTree = ""; }; + 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCQuadCommand.h; sourceTree = ""; }; + 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderCommand.cpp; sourceTree = ""; }; + 50ABBD771925AB4100A911A9 /* CCRenderCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommand.h; sourceTree = ""; }; + 50ABBD781925AB4100A911A9 /* CCRenderCommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommandPool.h; sourceTree = ""; }; + 50ABBD791925AB4100A911A9 /* CCRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderer.cpp; sourceTree = ""; }; + 50ABBD7A1925AB4100A911A9 /* CCRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer.h; sourceTree = ""; }; + 50ABBD7B1925AB4100A911A9 /* ccShaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccShaders.cpp; sourceTree = ""; }; + 50ABBD7C1925AB4100A911A9 /* ccShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaders.h; sourceTree = ""; }; + 50ABBD7D1925AB4100A911A9 /* CCTexture2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexture2D.cpp; sourceTree = ""; }; + 50ABBD7E1925AB4100A911A9 /* CCTexture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2D.h; sourceTree = ""; }; + 50ABBD7F1925AB4100A911A9 /* CCTextureAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureAtlas.cpp; sourceTree = ""; }; + 50ABBD801925AB4100A911A9 /* CCTextureAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureAtlas.h; sourceTree = ""; }; + 50ABBD811925AB4100A911A9 /* CCTextureCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureCache.cpp; sourceTree = ""; }; + 50ABBD821925AB4100A911A9 /* CCTextureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCache.h; sourceTree = ""; }; + 50ABBDC11925AB6E00A911A9 /* atitc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = atitc.cpp; path = ../base/atitc.cpp; sourceTree = ""; }; + 50ABBDC21925AB6E00A911A9 /* atitc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atitc.h; path = ../base/atitc.h; sourceTree = ""; }; + 50ABBDC31925AB6E00A911A9 /* base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = base64.cpp; path = ../base/base64.cpp; sourceTree = ""; }; + 50ABBDC41925AB6E00A911A9 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = ../base/base64.h; sourceTree = ""; }; + 50ABBDC51925AB6E00A911A9 /* CCAutoreleasePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCAutoreleasePool.cpp; path = ../base/CCAutoreleasePool.cpp; sourceTree = ""; }; + 50ABBDC61925AB6E00A911A9 /* CCAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAutoreleasePool.h; path = ../base/CCAutoreleasePool.h; sourceTree = ""; }; + 50ABBDC71925AB6E00A911A9 /* ccCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccCArray.cpp; path = ../base/ccCArray.cpp; sourceTree = ""; }; + 50ABBDC81925AB6E00A911A9 /* ccCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccCArray.h; path = ../base/ccCArray.h; sourceTree = ""; }; + 50ABBDC91925AB6E00A911A9 /* ccConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccConfig.h; path = ../base/ccConfig.h; sourceTree = ""; }; + 50ABBDCA1925AB6E00A911A9 /* CCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCConfiguration.cpp; path = ../base/CCConfiguration.cpp; sourceTree = ""; }; + 50ABBDCB1925AB6E00A911A9 /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCConfiguration.h; path = ../base/CCConfiguration.h; sourceTree = ""; }; + 50ABBDCC1925AB6E00A911A9 /* CCConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCConsole.cpp; path = ../base/CCConsole.cpp; sourceTree = ""; }; + 50ABBDCD1925AB6E00A911A9 /* CCConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCConsole.h; path = ../base/CCConsole.h; sourceTree = ""; }; + 50ABBDCE1925AB6E00A911A9 /* CCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCData.cpp; path = ../base/CCData.cpp; sourceTree = ""; }; + 50ABBDCF1925AB6E00A911A9 /* CCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCData.h; path = ../base/CCData.h; sourceTree = ""; }; + 50ABBDD01925AB6E00A911A9 /* CCDataVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDataVisitor.cpp; path = ../base/CCDataVisitor.cpp; sourceTree = ""; }; + 50ABBDD11925AB6E00A911A9 /* CCDataVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDataVisitor.h; path = ../base/CCDataVisitor.h; sourceTree = ""; }; + 50ABBDD21925AB6E00A911A9 /* CCDirector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDirector.cpp; path = ../base/CCDirector.cpp; sourceTree = ""; }; + 50ABBDD31925AB6E00A911A9 /* CCDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDirector.h; path = ../base/CCDirector.h; sourceTree = ""; }; + 50ABBDD41925AB6E00A911A9 /* CCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEvent.cpp; path = ../base/CCEvent.cpp; sourceTree = ""; }; + 50ABBDD51925AB6E00A911A9 /* CCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEvent.h; path = ../base/CCEvent.h; sourceTree = ""; }; + 50ABBDD61925AB6E00A911A9 /* CCEventAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventAcceleration.cpp; path = ../base/CCEventAcceleration.cpp; sourceTree = ""; }; + 50ABBDD71925AB6E00A911A9 /* CCEventAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventAcceleration.h; path = ../base/CCEventAcceleration.h; sourceTree = ""; }; + 50ABBDD81925AB6E00A911A9 /* CCEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventCustom.cpp; path = ../base/CCEventCustom.cpp; sourceTree = ""; }; + 50ABBDD91925AB6E00A911A9 /* CCEventCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventCustom.h; path = ../base/CCEventCustom.h; sourceTree = ""; }; + 50ABBDDA1925AB6E00A911A9 /* CCEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventDispatcher.cpp; path = ../base/CCEventDispatcher.cpp; sourceTree = ""; }; + 50ABBDDB1925AB6E00A911A9 /* CCEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventDispatcher.h; path = ../base/CCEventDispatcher.h; sourceTree = ""; }; + 50ABBDDC1925AB6E00A911A9 /* CCEventFocus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventFocus.cpp; path = ../base/CCEventFocus.cpp; sourceTree = ""; }; + 50ABBDDD1925AB6E00A911A9 /* CCEventFocus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventFocus.h; path = ../base/CCEventFocus.h; sourceTree = ""; }; + 50ABBDDE1925AB6E00A911A9 /* CCEventKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventKeyboard.cpp; path = ../base/CCEventKeyboard.cpp; sourceTree = ""; }; + 50ABBDDF1925AB6E00A911A9 /* CCEventKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventKeyboard.h; path = ../base/CCEventKeyboard.h; sourceTree = ""; }; + 50ABBDE01925AB6E00A911A9 /* CCEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListener.cpp; path = ../base/CCEventListener.cpp; sourceTree = ""; }; + 50ABBDE11925AB6E00A911A9 /* CCEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListener.h; path = ../base/CCEventListener.h; sourceTree = ""; }; + 50ABBDE21925AB6E00A911A9 /* CCEventListenerAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerAcceleration.cpp; path = ../base/CCEventListenerAcceleration.cpp; sourceTree = ""; }; + 50ABBDE31925AB6E00A911A9 /* CCEventListenerAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerAcceleration.h; path = ../base/CCEventListenerAcceleration.h; sourceTree = ""; }; + 50ABBDE41925AB6E00A911A9 /* CCEventListenerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerCustom.cpp; path = ../base/CCEventListenerCustom.cpp; sourceTree = ""; }; + 50ABBDE51925AB6E00A911A9 /* CCEventListenerCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerCustom.h; path = ../base/CCEventListenerCustom.h; sourceTree = ""; }; + 50ABBDE61925AB6E00A911A9 /* CCEventListenerFocus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerFocus.cpp; path = ../base/CCEventListenerFocus.cpp; sourceTree = ""; }; + 50ABBDE71925AB6E00A911A9 /* CCEventListenerFocus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerFocus.h; path = ../base/CCEventListenerFocus.h; sourceTree = ""; }; + 50ABBDE81925AB6E00A911A9 /* CCEventListenerKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerKeyboard.cpp; path = ../base/CCEventListenerKeyboard.cpp; sourceTree = ""; }; + 50ABBDE91925AB6E00A911A9 /* CCEventListenerKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerKeyboard.h; path = ../base/CCEventListenerKeyboard.h; sourceTree = ""; }; + 50ABBDEA1925AB6E00A911A9 /* CCEventListenerMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerMouse.cpp; path = ../base/CCEventListenerMouse.cpp; sourceTree = ""; }; + 50ABBDEB1925AB6E00A911A9 /* CCEventListenerMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerMouse.h; path = ../base/CCEventListenerMouse.h; sourceTree = ""; }; + 50ABBDEC1925AB6E00A911A9 /* CCEventListenerTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerTouch.cpp; path = ../base/CCEventListenerTouch.cpp; sourceTree = ""; }; + 50ABBDED1925AB6E00A911A9 /* CCEventListenerTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerTouch.h; path = ../base/CCEventListenerTouch.h; sourceTree = ""; }; + 50ABBDEE1925AB6E00A911A9 /* CCEventMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventMouse.cpp; path = ../base/CCEventMouse.cpp; sourceTree = ""; }; + 50ABBDEF1925AB6E00A911A9 /* CCEventMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventMouse.h; path = ../base/CCEventMouse.h; sourceTree = ""; }; + 50ABBDF01925AB6E00A911A9 /* CCEventTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventTouch.cpp; path = ../base/CCEventTouch.cpp; sourceTree = ""; }; + 50ABBDF11925AB6E00A911A9 /* CCEventTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventTouch.h; path = ../base/CCEventTouch.h; sourceTree = ""; }; + 50ABBDF21925AB6E00A911A9 /* CCEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventType.h; path = ../base/CCEventType.h; sourceTree = ""; }; + 50ABBDF31925AB6E00A911A9 /* ccFPSImages.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ccFPSImages.c; path = ../base/ccFPSImages.c; sourceTree = ""; }; + 50ABBDF41925AB6E00A911A9 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccFPSImages.h; path = ../base/ccFPSImages.h; sourceTree = ""; }; + 50ABBDF51925AB6E00A911A9 /* ccMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccMacros.h; path = ../base/ccMacros.h; sourceTree = ""; }; + 50ABBDF61925AB6E00A911A9 /* CCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCMap.h; path = ../base/CCMap.h; sourceTree = ""; }; + 50ABBDF71925AB6E00A911A9 /* CCNS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCNS.cpp; path = ../base/CCNS.cpp; sourceTree = ""; }; + 50ABBDF81925AB6E00A911A9 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCNS.h; path = ../base/CCNS.h; sourceTree = ""; }; + 50ABBDF91925AB6E00A911A9 /* CCPlatformConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformConfig.h; path = ../base/CCPlatformConfig.h; sourceTree = ""; }; + 50ABBDFA1925AB6E00A911A9 /* CCPlatformMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformMacros.h; path = ../base/CCPlatformMacros.h; sourceTree = ""; }; + 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCProfiling.cpp; path = ../base/CCProfiling.cpp; sourceTree = ""; }; + 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCProfiling.h; path = ../base/CCProfiling.h; sourceTree = ""; }; + 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCProtocols.h; path = ../base/CCProtocols.h; sourceTree = ""; }; + 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCRef.cpp; path = ../base/CCRef.cpp; sourceTree = ""; }; + 50ABBDFF1925AB6E00A911A9 /* CCRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCRef.h; path = ../base/CCRef.h; sourceTree = ""; }; + 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCRefPtr.h; path = ../base/CCRefPtr.h; sourceTree = ""; }; + 50ABBE011925AB6E00A911A9 /* CCScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCScheduler.cpp; path = ../base/CCScheduler.cpp; sourceTree = ""; }; + 50ABBE021925AB6E00A911A9 /* CCScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCScheduler.h; path = ../base/CCScheduler.h; sourceTree = ""; }; + 50ABBE031925AB6E00A911A9 /* CCScriptSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCScriptSupport.cpp; path = ../base/CCScriptSupport.cpp; sourceTree = ""; }; + 50ABBE041925AB6E00A911A9 /* CCScriptSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCScriptSupport.h; path = ../base/CCScriptSupport.h; sourceTree = ""; }; + 50ABBE051925AB6E00A911A9 /* CCTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCTouch.cpp; path = ../base/CCTouch.cpp; sourceTree = ""; }; + 50ABBE061925AB6E00A911A9 /* CCTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCTouch.h; path = ../base/CCTouch.h; sourceTree = ""; }; + 50ABBE071925AB6E00A911A9 /* ccTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccTypes.cpp; path = ../base/ccTypes.cpp; sourceTree = ""; }; + 50ABBE081925AB6E00A911A9 /* ccTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccTypes.h; path = ../base/ccTypes.h; sourceTree = ""; }; + 50ABBE091925AB6E00A911A9 /* CCUserDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCUserDefault.cpp; path = ../base/CCUserDefault.cpp; sourceTree = ""; }; + 50ABBE0A1925AB6E00A911A9 /* CCUserDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCUserDefault.h; path = ../base/CCUserDefault.h; sourceTree = ""; }; + 50ABBE0B1925AB6F00A911A9 /* CCUserDefault.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CCUserDefault.mm; path = ../base/CCUserDefault.mm; sourceTree = ""; }; + 50ABBE0C1925AB6F00A911A9 /* CCUserDefaultAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCUserDefaultAndroid.cpp; path = ../base/CCUserDefaultAndroid.cpp; sourceTree = ""; }; + 50ABBE0D1925AB6F00A911A9 /* ccUTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccUTF8.cpp; path = ../base/ccUTF8.cpp; sourceTree = ""; }; + 50ABBE0E1925AB6F00A911A9 /* ccUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccUTF8.h; path = ../base/ccUTF8.h; sourceTree = ""; }; + 50ABBE0F1925AB6F00A911A9 /* ccUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ccUtils.cpp; path = ../base/ccUtils.cpp; sourceTree = ""; }; + 50ABBE101925AB6F00A911A9 /* ccUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ccUtils.h; path = ../base/ccUtils.h; sourceTree = ""; }; + 50ABBE111925AB6F00A911A9 /* CCValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCValue.cpp; path = ../base/CCValue.cpp; sourceTree = ""; }; + 50ABBE121925AB6F00A911A9 /* CCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCValue.h; path = ../base/CCValue.h; sourceTree = ""; }; + 50ABBE131925AB6F00A911A9 /* CCVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCVector.h; path = ../base/CCVector.h; sourceTree = ""; }; + 50ABBE141925AB6F00A911A9 /* etc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = etc1.cpp; path = ../base/etc1.cpp; sourceTree = ""; }; + 50ABBE151925AB6F00A911A9 /* etc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = etc1.h; path = ../base/etc1.h; sourceTree = ""; }; + 50ABBE161925AB6F00A911A9 /* firePngData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = firePngData.h; path = ../base/firePngData.h; sourceTree = ""; }; + 50ABBE171925AB6F00A911A9 /* s3tc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s3tc.cpp; path = ../base/s3tc.cpp; sourceTree = ""; }; + 50ABBE181925AB6F00A911A9 /* s3tc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s3tc.h; path = ../base/s3tc.h; sourceTree = ""; }; + 50ABBE191925AB6F00A911A9 /* TGAlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TGAlib.cpp; path = ../base/TGAlib.cpp; sourceTree = ""; }; + 50ABBE1A1925AB6F00A911A9 /* TGAlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TGAlib.h; path = ../base/TGAlib.h; sourceTree = ""; }; + 50ABBE1B1925AB6F00A911A9 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = uthash.h; path = ../base/uthash.h; sourceTree = ""; }; + 50ABBE1C1925AB6F00A911A9 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utlist.h; path = ../base/utlist.h; sourceTree = ""; }; + 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ZipUtils.cpp; path = ../base/ZipUtils.cpp; sourceTree = ""; }; + 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZipUtils.h; path = ../base/ZipUtils.h; sourceTree = ""; }; + 50ABBF1B1926664700A911A9 /* CCFileUtilsApple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsApple.h; sourceTree = ""; }; + 50ABBF1C1926664700A911A9 /* CCFileUtilsApple.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCFileUtilsApple.mm; sourceTree = ""; }; + 50ABBF1D1926664700A911A9 /* CCLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLock.cpp; sourceTree = ""; }; + 50ABBF1E1926664700A911A9 /* CCLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLock.h; sourceTree = ""; }; + 50ABBF1F1926664700A911A9 /* CCThread.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCThread.mm; sourceTree = ""; }; + 50ABBF201926664700A911A9 /* CCApplicationProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCApplicationProtocol.h; sourceTree = ""; }; + 50ABBF211926664700A911A9 /* CCCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCommon.h; sourceTree = ""; }; + 50ABBF221926664700A911A9 /* CCDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDevice.h; sourceTree = ""; }; + 50ABBF231926664700A911A9 /* CCFileUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtils.cpp; sourceTree = ""; }; + 50ABBF241926664700A911A9 /* CCFileUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFileUtils.h; sourceTree = ""; }; + 50ABBF251926664700A911A9 /* CCGLViewProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLViewProtocol.cpp; sourceTree = ""; }; + 50ABBF261926664700A911A9 /* CCGLViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLViewProtocol.h; sourceTree = ""; }; + 50ABBF271926664700A911A9 /* CCImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCImage.cpp; sourceTree = ""; }; + 50ABBF281926664700A911A9 /* CCImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCImage.h; sourceTree = ""; }; + 50ABBF291926664700A911A9 /* CCSAXParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSAXParser.cpp; sourceTree = ""; }; + 50ABBF2A1926664700A911A9 /* CCSAXParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSAXParser.h; sourceTree = ""; }; + 50ABBF2B1926664700A911A9 /* CCThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCThread.cpp; sourceTree = ""; }; + 50ABBF2C1926664700A911A9 /* CCThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCThread.h; sourceTree = ""; }; + 50ABBF2E1926664700A911A9 /* CCGLView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLView.cpp; sourceTree = ""; }; + 50ABBF2F1926664700A911A9 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; + 50ABBF4F1926664700A911A9 /* CCApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; + 50ABBF501926664700A911A9 /* CCApplication.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCApplication.mm; sourceTree = ""; }; + 50ABBF511926664700A911A9 /* CCCommon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCCommon.mm; sourceTree = ""; }; + 50ABBF521926664700A911A9 /* CCDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = ""; }; + 50ABBF531926664700A911A9 /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; + 50ABBF541926664700A911A9 /* CCPlatformDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; + 50ABBF551926664700A911A9 /* CCStdC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; 50DC5180187B817900A9C23F /* RELEASE_NOTES.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = RELEASE_NOTES.md; path = ../docs/RELEASE_NOTES.md; sourceTree = ""; }; 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProtectedNode.cpp; sourceTree = ""; }; 50E6D30D18DADB5D0051CA34 /* CCProtectedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtectedNode.h; sourceTree = ""; }; @@ -2742,69 +2763,15 @@ 50FCEB9018C72017004AD434 /* WidgetReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetReader.cpp; sourceTree = ""; }; 50FCEB9118C72017004AD434 /* WidgetReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReader.h; sourceTree = ""; }; 50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReaderProtocol.h; sourceTree = ""; }; - A0053F46189B2BEA0035A564 /* Android.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = Android.mk; sourceTree = ""; }; - A0053F47189B2BEA0035A564 /* CCApplication.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCApplication.cpp; sourceTree = ""; }; - A0053F48189B2BEA0035A564 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; - A0053F49189B2BEA0035A564 /* CCCommon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCCommon.cpp; sourceTree = ""; }; - A0053F4A189B2BEA0035A564 /* CCDevice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDevice.cpp; sourceTree = ""; }; - A0053F4B189B2BEA0035A564 /* CCFileUtilsAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtilsAndroid.cpp; sourceTree = ""; }; - A0053F4C189B2BEA0035A564 /* CCFileUtilsAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsAndroid.h; sourceTree = ""; }; - A0053F4D189B2BEA0035A564 /* CCGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; - A0053F4E189B2BEA0035A564 /* CCGLView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLView.cpp; sourceTree = ""; }; - A0053F4F189B2BEA0035A564 /* CCGLView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; - A0053F51189B2BEA0035A564 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; - A0053F52189B2BEA0035A564 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; - A0053FA8189B2BEA0035A564 /* CCApplication.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCApplication.cpp; sourceTree = ""; }; - A0053FA9189B2BEA0035A564 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; - A0053FAA189B2BEA0035A564 /* CCCommon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCCommon.cpp; sourceTree = ""; }; - A0053FAB189B2BEA0035A564 /* CCDevice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDevice.cpp; sourceTree = ""; }; - A0053FAC189B2BEA0035A564 /* CCFileUtilsWin32.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtilsWin32.cpp; sourceTree = ""; }; - A0053FAD189B2BEA0035A564 /* CCFileUtilsWin32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsWin32.h; sourceTree = ""; }; - A0053FAE189B2BEA0035A564 /* CCGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; - A0053FB0189B2BEA0035A564 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; - A0053FB1189B2BEA0035A564 /* CCStdC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCStdC.cpp; sourceTree = ""; }; - A0053FB2189B2BEA0035A564 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; - A0053FB6189B2BEA0035A564 /* CCApplication.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCApplication.cpp; sourceTree = ""; }; - A0053FB7189B2BEA0035A564 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = ""; }; - A0053FB8189B2BEA0035A564 /* CCCommon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCCommon.cpp; sourceTree = ""; }; - A0053FB9189B2BEA0035A564 /* CCDevice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDevice.cpp; sourceTree = ""; }; - A0053FBA189B2BEA0035A564 /* CCFileUtilsLinux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtilsLinux.cpp; sourceTree = ""; }; - A0053FBB189B2BEA0035A564 /* CCFileUtilsLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsLinux.h; sourceTree = ""; }; - A0053FBC189B2BEA0035A564 /* CCGL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; - A0053FBE189B2BEA0035A564 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = ""; }; - A0053FBF189B2BEA0035A564 /* CCStdC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCStdC.cpp; sourceTree = ""; }; - A0053FC0189B2BEA0035A564 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = ""; }; A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libchipmunk Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbox2d Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A03F2ED617814268006731B9 /* libCocosDenshion Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCocosDenshion Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A03F2FD617814595006731B9 /* libcocos2dx-extensions Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2dx-extensions Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - A04583F0189053B500E32FE8 /* CCGLView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCGLView.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - A04583F1189053B500E32FE8 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCGLView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; A07A4D641783777C0073F6A7 /* libcocos2dx iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2dx iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4EFC1783867C0073F6A7 /* libcocos2dx-extensions iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2dx-extensions iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4F3B178387670073F6A7 /* libchipmunk iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libchipmunk iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4F9E1783876B0073F6A7 /* libbox2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbox2d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A07A4FB4178387730073F6A7 /* libCocosDenshion iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCocosDenshion iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B2AF2F8218EBAEAE00C5807C /* MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathUtil.cpp; sourceTree = ""; }; - B2AF2F8318EBAEAE00C5807C /* MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathUtil.h; sourceTree = ""; }; - B2AF2F8418EBAEAE00C5807C /* MathUtil.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MathUtil.inl; sourceTree = ""; }; - B2AF2F8518EBAEAE00C5807C /* MathUtilNeon.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MathUtilNeon.inl; sourceTree = ""; }; - B2AF2F8618EBAEAE00C5807C /* Matrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Matrix.cpp; sourceTree = ""; }; - B2AF2F8718EBAEAE00C5807C /* Matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Matrix.h; sourceTree = ""; }; - B2AF2F8818EBAEAE00C5807C /* Matrix.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Matrix.inl; sourceTree = ""; }; - B2AF2F8918EBAEAE00C5807C /* Quaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Quaternion.cpp; sourceTree = ""; }; - B2AF2F8A18EBAEAE00C5807C /* Quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Quaternion.h; sourceTree = ""; }; - B2AF2F8B18EBAEAE00C5807C /* Quaternion.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Quaternion.inl; sourceTree = ""; }; - B2AF2F8C18EBAEAE00C5807C /* Vector2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vector2.cpp; sourceTree = ""; }; - B2AF2F8D18EBAEAE00C5807C /* Vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector2.h; sourceTree = ""; }; - B2AF2F8E18EBAEAE00C5807C /* Vector2.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vector2.inl; sourceTree = ""; }; - B2AF2F8F18EBAEAE00C5807C /* Vector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vector3.cpp; sourceTree = ""; }; - B2AF2F9018EBAEAE00C5807C /* Vector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector3.h; sourceTree = ""; }; - B2AF2F9118EBAEAE00C5807C /* Vector3.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vector3.inl; sourceTree = ""; }; - B2AF2F9218EBAEAE00C5807C /* Vector4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Vector4.cpp; sourceTree = ""; }; - B2AF2F9318EBAEAE00C5807C /* Vector4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector4.h; sourceTree = ""; }; - B2AF2F9418EBAEAE00C5807C /* Vector4.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vector4.inl; sourceTree = ""; }; - B2AF2FB018EBBDA100C5807C /* CCMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMath.h; sourceTree = ""; }; B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsBodyInfo_chipmunk.cpp; sourceTree = ""; }; B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBodyInfo_chipmunk.h; sourceTree = ""; }; B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContactInfo_chipmunk.cpp; sourceTree = ""; }; @@ -2922,6 +2889,7 @@ 46A15FCE1807A544005B8026 /* README.md */, 50DC5180187B817900A9C23F /* RELEASE_NOTES.md */, 46A169A11807B037005B8026 /* 2d */, + 50ABBEDB1926664700A911A9 /* platform */, 46A15FD01807A56F005B8026 /* audio */, 1A5700A2180BC5E60088DEC7 /* base */, 1A01C67518F57BE800EFE3A6 /* deprecated */, @@ -3051,81 +3019,103 @@ 1A5700A2180BC5E60088DEC7 /* base */ = { isa = PBXGroup; children = ( - 500DC8E719106300007B91BF /* atitc.cpp */, - 500DC8E819106300007B91BF /* atitc.h */, - 500DC8E919106300007B91BF /* base64.cpp */, - 500DC8EA19106300007B91BF /* base64.h */, - 500DC8EB19106300007B91BF /* CCAutoreleasePool.cpp */, - 500DC8EC19106300007B91BF /* CCAutoreleasePool.h */, - 500DC8ED19106300007B91BF /* ccConfig.h */, - 500DC8EE19106300007B91BF /* CCConfiguration.cpp */, - 500DC8EF19106300007B91BF /* CCConfiguration.h */, - 500DC8F019106300007B91BF /* CCConsole.cpp */, - 500DC8F119106300007B91BF /* CCConsole.h */, - 500DC8F219106300007B91BF /* CCData.cpp */, - 500DC8F319106300007B91BF /* CCData.h */, - 500DC8F419106300007B91BF /* CCDataVisitor.cpp */, - 500DC8F519106300007B91BF /* CCDataVisitor.h */, - 500DC8F619106300007B91BF /* CCDirector.cpp */, - 500DC8F719106300007B91BF /* CCDirector.h */, - 500DC8F819106300007B91BF /* CCEvent.cpp */, - 500DC8F919106300007B91BF /* CCEvent.h */, - 500DC8FA19106300007B91BF /* CCEventAcceleration.cpp */, - 500DC8FB19106300007B91BF /* CCEventAcceleration.h */, - 500DC8FC19106300007B91BF /* CCEventCustom.cpp */, - 500DC8FD19106300007B91BF /* CCEventCustom.h */, - 500DC8FE19106300007B91BF /* CCEventDispatcher.cpp */, - 500DC8FF19106300007B91BF /* CCEventDispatcher.h */, - 500DC90019106300007B91BF /* CCEventKeyboard.cpp */, - 500DC90119106300007B91BF /* CCEventKeyboard.h */, - 500DC90219106300007B91BF /* CCEventListener.cpp */, - 500DC90319106300007B91BF /* CCEventListener.h */, - 500DC90419106300007B91BF /* CCEventListenerAcceleration.cpp */, - 500DC90519106300007B91BF /* CCEventListenerAcceleration.h */, - 500DC90619106300007B91BF /* CCEventListenerCustom.cpp */, - 500DC90719106300007B91BF /* CCEventListenerCustom.h */, - 500DC90819106300007B91BF /* CCEventListenerKeyboard.cpp */, - 500DC90919106300007B91BF /* CCEventListenerKeyboard.h */, - 500DC90A19106300007B91BF /* CCEventListenerMouse.cpp */, - 500DC90B19106300007B91BF /* CCEventListenerMouse.h */, - 500DC90C19106300007B91BF /* CCEventListenerTouch.cpp */, - 500DC90D19106300007B91BF /* CCEventListenerTouch.h */, - 500DC90E19106300007B91BF /* CCEventMouse.cpp */, - 500DC90F19106300007B91BF /* CCEventMouse.h */, - 500DC91019106300007B91BF /* CCEventTouch.cpp */, - 500DC91119106300007B91BF /* CCEventTouch.h */, - 500DC91219106300007B91BF /* CCEventType.h */, - 500DC91319106300007B91BF /* ccMacros.h */, - 500DC91419106300007B91BF /* CCMap.h */, - 500DC91519106300007B91BF /* CCNS.cpp */, - 500DC91619106300007B91BF /* CCNS.h */, - 500DC91719106300007B91BF /* CCPlatformConfig.h */, - 500DC91819106300007B91BF /* CCPlatformMacros.h */, - 500DC9BA19106E89007B91BF /* CCProfiling.cpp */, - 500DC9BB19106E89007B91BF /* CCProfiling.h */, - 500DC91919106300007B91BF /* CCRef.cpp */, - 500DC91A19106300007B91BF /* CCRef.h */, - 500DC91B19106300007B91BF /* CCRefPtr.h */, - 500DC91C19106300007B91BF /* CCScheduler.cpp */, - 500DC91D19106300007B91BF /* CCScheduler.h */, - 500DC9AE1910633C007B91BF /* CCTouch.cpp */, - 500DC9AF1910633C007B91BF /* CCTouch.h */, - 500DC91E19106300007B91BF /* ccTypes.cpp */, - 500DC91F19106300007B91BF /* ccTypes.h */, - 500DC92019106300007B91BF /* CCValue.cpp */, - 500DC92119106300007B91BF /* CCValue.h */, - 500DC92219106300007B91BF /* CCVector.h */, - 500DC92319106300007B91BF /* CMakeLists.txt */, - 500DC92419106300007B91BF /* etc1.cpp */, - 500DC92519106300007B91BF /* etc1.h */, - 500DC92619106300007B91BF /* s3tc.cpp */, - 500DC92719106300007B91BF /* s3tc.h */, - 500DC92819106300007B91BF /* ZipUtils.cpp */, - 500DC92919106300007B91BF /* ZipUtils.h */, - 296CAD201915EC8000C64FBF /* CCEventFocus.cpp */, - 296CAD211915EC8000C64FBF /* CCEventFocus.h */, - 296CAD261915EC9900C64FBF /* CCEventListenerFocus.cpp */, - 296CAD271915EC9900C64FBF /* CCEventListenerFocus.h */, + 50ABBDC11925AB6E00A911A9 /* atitc.cpp */, + 50ABBDC21925AB6E00A911A9 /* atitc.h */, + 50ABBDC31925AB6E00A911A9 /* base64.cpp */, + 50ABBDC41925AB6E00A911A9 /* base64.h */, + 50ABBDC51925AB6E00A911A9 /* CCAutoreleasePool.cpp */, + 50ABBDC61925AB6E00A911A9 /* CCAutoreleasePool.h */, + 50ABBDC71925AB6E00A911A9 /* ccCArray.cpp */, + 50ABBDC81925AB6E00A911A9 /* ccCArray.h */, + 50ABBDC91925AB6E00A911A9 /* ccConfig.h */, + 50ABBDCA1925AB6E00A911A9 /* CCConfiguration.cpp */, + 50ABBDCB1925AB6E00A911A9 /* CCConfiguration.h */, + 50ABBDCC1925AB6E00A911A9 /* CCConsole.cpp */, + 50ABBDCD1925AB6E00A911A9 /* CCConsole.h */, + 50ABBDCE1925AB6E00A911A9 /* CCData.cpp */, + 50ABBDCF1925AB6E00A911A9 /* CCData.h */, + 50ABBDD01925AB6E00A911A9 /* CCDataVisitor.cpp */, + 50ABBDD11925AB6E00A911A9 /* CCDataVisitor.h */, + 50ABBDD21925AB6E00A911A9 /* CCDirector.cpp */, + 50ABBDD31925AB6E00A911A9 /* CCDirector.h */, + 50ABBDD41925AB6E00A911A9 /* CCEvent.cpp */, + 50ABBDD51925AB6E00A911A9 /* CCEvent.h */, + 50ABBDD61925AB6E00A911A9 /* CCEventAcceleration.cpp */, + 50ABBDD71925AB6E00A911A9 /* CCEventAcceleration.h */, + 50ABBDD81925AB6E00A911A9 /* CCEventCustom.cpp */, + 50ABBDD91925AB6E00A911A9 /* CCEventCustom.h */, + 50ABBDDA1925AB6E00A911A9 /* CCEventDispatcher.cpp */, + 50ABBDDB1925AB6E00A911A9 /* CCEventDispatcher.h */, + 50ABBDDC1925AB6E00A911A9 /* CCEventFocus.cpp */, + 50ABBDDD1925AB6E00A911A9 /* CCEventFocus.h */, + 50ABBDDE1925AB6E00A911A9 /* CCEventKeyboard.cpp */, + 50ABBDDF1925AB6E00A911A9 /* CCEventKeyboard.h */, + 50ABBDE01925AB6E00A911A9 /* CCEventListener.cpp */, + 50ABBDE11925AB6E00A911A9 /* CCEventListener.h */, + 50ABBDE21925AB6E00A911A9 /* CCEventListenerAcceleration.cpp */, + 50ABBDE31925AB6E00A911A9 /* CCEventListenerAcceleration.h */, + 50ABBDE41925AB6E00A911A9 /* CCEventListenerCustom.cpp */, + 50ABBDE51925AB6E00A911A9 /* CCEventListenerCustom.h */, + 50ABBDE61925AB6E00A911A9 /* CCEventListenerFocus.cpp */, + 50ABBDE71925AB6E00A911A9 /* CCEventListenerFocus.h */, + 50ABBDE81925AB6E00A911A9 /* CCEventListenerKeyboard.cpp */, + 50ABBDE91925AB6E00A911A9 /* CCEventListenerKeyboard.h */, + 50ABBDEA1925AB6E00A911A9 /* CCEventListenerMouse.cpp */, + 50ABBDEB1925AB6E00A911A9 /* CCEventListenerMouse.h */, + 50ABBDEC1925AB6E00A911A9 /* CCEventListenerTouch.cpp */, + 50ABBDED1925AB6E00A911A9 /* CCEventListenerTouch.h */, + 50ABBDEE1925AB6E00A911A9 /* CCEventMouse.cpp */, + 50ABBDEF1925AB6E00A911A9 /* CCEventMouse.h */, + 50ABBDF01925AB6E00A911A9 /* CCEventTouch.cpp */, + 50ABBDF11925AB6E00A911A9 /* CCEventTouch.h */, + 50ABBDF21925AB6E00A911A9 /* CCEventType.h */, + 50ABBDF31925AB6E00A911A9 /* ccFPSImages.c */, + 50ABBDF41925AB6E00A911A9 /* ccFPSImages.h */, + 503DD8F21926B0DB00CD74DD /* CCIMEDelegate.h */, + 503DD8F31926B0DB00CD74DD /* CCIMEDispatcher.cpp */, + 503DD8F41926B0DB00CD74DD /* CCIMEDispatcher.h */, + 50ABBDF51925AB6E00A911A9 /* ccMacros.h */, + 50ABBDF61925AB6E00A911A9 /* CCMap.h */, + 50ABBDF71925AB6E00A911A9 /* CCNS.cpp */, + 50ABBDF81925AB6E00A911A9 /* CCNS.h */, + 50ABBDF91925AB6E00A911A9 /* CCPlatformConfig.h */, + 50ABBDFA1925AB6E00A911A9 /* CCPlatformMacros.h */, + 50ABBDFB1925AB6E00A911A9 /* CCProfiling.cpp */, + 50ABBDFC1925AB6E00A911A9 /* CCProfiling.h */, + 50ABBDFD1925AB6E00A911A9 /* CCProtocols.h */, + 50ABBDFE1925AB6E00A911A9 /* CCRef.cpp */, + 50ABBDFF1925AB6E00A911A9 /* CCRef.h */, + 50ABBE001925AB6E00A911A9 /* CCRefPtr.h */, + 50ABBE011925AB6E00A911A9 /* CCScheduler.cpp */, + 50ABBE021925AB6E00A911A9 /* CCScheduler.h */, + 50ABBE031925AB6E00A911A9 /* CCScriptSupport.cpp */, + 50ABBE041925AB6E00A911A9 /* CCScriptSupport.h */, + 50ABBE051925AB6E00A911A9 /* CCTouch.cpp */, + 50ABBE061925AB6E00A911A9 /* CCTouch.h */, + 50ABBE071925AB6E00A911A9 /* ccTypes.cpp */, + 50ABBE081925AB6E00A911A9 /* ccTypes.h */, + 50ABBE091925AB6E00A911A9 /* CCUserDefault.cpp */, + 50ABBE0A1925AB6E00A911A9 /* CCUserDefault.h */, + 50ABBE0B1925AB6F00A911A9 /* CCUserDefault.mm */, + 50ABBE0C1925AB6F00A911A9 /* CCUserDefaultAndroid.cpp */, + 50ABBE0D1925AB6F00A911A9 /* ccUTF8.cpp */, + 50ABBE0E1925AB6F00A911A9 /* ccUTF8.h */, + 50ABBE0F1925AB6F00A911A9 /* ccUtils.cpp */, + 50ABBE101925AB6F00A911A9 /* ccUtils.h */, + 50ABBE111925AB6F00A911A9 /* CCValue.cpp */, + 50ABBE121925AB6F00A911A9 /* CCValue.h */, + 50ABBE131925AB6F00A911A9 /* CCVector.h */, + 50ABBE141925AB6F00A911A9 /* etc1.cpp */, + 50ABBE151925AB6F00A911A9 /* etc1.h */, + 50ABBE161925AB6F00A911A9 /* firePngData.h */, + 50ABBE171925AB6F00A911A9 /* s3tc.cpp */, + 50ABBE181925AB6F00A911A9 /* s3tc.h */, + 50ABBE191925AB6F00A911A9 /* TGAlib.cpp */, + 50ABBE1A1925AB6F00A911A9 /* TGAlib.h */, + 50ABBE1B1925AB6F00A911A9 /* uthash.h */, + 50ABBE1C1925AB6F00A911A9 /* utlist.h */, + 50ABBE1D1925AB6F00A911A9 /* ZipUtils.cpp */, + 50ABBE1E1925AB6F00A911A9 /* ZipUtils.h */, ); name = base; path = ../cocos/2d; @@ -3242,15 +3232,6 @@ name = "particle-nodes"; sourceTree = ""; }; - 1A570231180BCC380088DEC7 /* script-support */ = { - isa = PBXGroup; - children = ( - 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */, - 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */, - ); - name = "script-support"; - sourceTree = ""; - }; 1A570275180BCC840088DEC7 /* sprite-nodes */ = { isa = PBXGroup; children = ( @@ -3273,16 +3254,10 @@ 1A57029A180BCD4F0088DEC7 /* support */ = { isa = PBXGroup; children = ( - 1A57032A180BCFBC0088DEC7 /* user-default */, - 1A570321180BCF580088DEC7 /* image-support */, - 1A570314180BCF1C0088DEC7 /* data-support */, - 1A570307180BCEFB0088DEC7 /* component */, - 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */, - 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */, - 1A570304180BCED90088DEC7 /* ccUtils.cpp */, - 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */, - 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */, - 1A5702B4180BCDF40088DEC7 /* CCVertex.h */, + 1A570308180BCF190088DEC7 /* CCComponent.cpp */, + 1A570309180BCF190088DEC7 /* CCComponent.h */, + 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */, + 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */, ); name = support; sourceTree = ""; @@ -3292,9 +3267,6 @@ children = ( 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */, 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */, - 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */, - 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */, - 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */, ); name = "text-input-node"; sourceTree = ""; @@ -3302,12 +3274,6 @@ 1A5702CC180BCE410088DEC7 /* textures */ = { isa = PBXGroup; children = ( - 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */, - 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */, - 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */, - 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */, - 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */, - 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */, ); name = textures; sourceTree = ""; @@ -3331,48 +3297,6 @@ name = "tilemap-parallax-nodes"; sourceTree = ""; }; - 1A570307180BCEFB0088DEC7 /* component */ = { - isa = PBXGroup; - children = ( - 1A570308180BCF190088DEC7 /* CCComponent.cpp */, - 1A570309180BCF190088DEC7 /* CCComponent.h */, - 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */, - 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */, - ); - name = component; - sourceTree = ""; - }; - 1A570314180BCF1C0088DEC7 /* data-support */ = { - isa = PBXGroup; - children = ( - 1A570315180BCF430088DEC7 /* ccCArray.cpp */, - 1A570316180BCF430088DEC7 /* ccCArray.h */, - 1A570317180BCF430088DEC7 /* uthash.h */, - 1A570318180BCF430088DEC7 /* utlist.h */, - ); - name = "data-support"; - sourceTree = ""; - }; - 1A570321180BCF580088DEC7 /* image-support */ = { - isa = PBXGroup; - children = ( - 1A570322180BCF660088DEC7 /* TGAlib.cpp */, - 1A570323180BCF660088DEC7 /* TGAlib.h */, - ); - name = "image-support"; - sourceTree = ""; - }; - 1A57032A180BCFBC0088DEC7 /* user-default */ = { - isa = PBXGroup; - children = ( - 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */, - 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */, - 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */, - 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */, - ); - name = "user-default"; - sourceTree = ""; - }; 1A57033E180BD0490088DEC7 /* external */ = { isa = PBXGroup; children = ( @@ -4432,12 +4356,8 @@ 46A169A11807B037005B8026 /* 2d */ = { isa = PBXGroup; children = ( - 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */, - 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */, 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */, 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */, - 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */, - 1A9DCA0C180E6955007A3AD4 /* firePngData.h */, 1A570046180BC59A0088DEC7 /* actions */, 1A570095180BC5B00088DEC7 /* base-nodes */, 1A570109180BC8DC0088DEC7 /* draw-nodes */, @@ -4447,8 +4367,6 @@ 1A5701F2180BCB970088DEC7 /* menu-nodes */, 1A5701FF180BCBBD0088DEC7 /* misc-nodes */, 1A570218180BCC000088DEC7 /* particle-nodes */, - 46A16A5A1807B038005B8026 /* platform */, - 1A570231180BCC380088DEC7 /* script-support */, 1A570275180BCC840088DEC7 /* sprite-nodes */, 1A57029A180BCD4F0088DEC7 /* support */, 1A5702BC180BCE0A0088DEC7 /* text-input-node */, @@ -4459,84 +4377,6 @@ path = ../cocos/2d; sourceTree = ""; }; - 46A16A5A1807B038005B8026 /* platform */ = { - isa = PBXGroup; - children = ( - A0053F45189B2BEA0035A564 /* android */, - 46A16A8E1807B038005B8026 /* apple */, - 46A16A941807B038005B8026 /* CCApplicationProtocol.h */, - 46A16A951807B038005B8026 /* CCCommon.h */, - 46A16A961807B038005B8026 /* CCDevice.h */, - 46A16A991807B038005B8026 /* CCFileUtils.cpp */, - 46A16A9A1807B038005B8026 /* CCFileUtils.h */, - 46A16A971807B038005B8026 /* CCGLViewProtocol.cpp */, - 46A16A981807B038005B8026 /* CCGLViewProtocol.h */, - 3E26D40418ACB5D100834404 /* CCImage.cpp */, - 46A16A9B1807B038005B8026 /* CCImage.h */, - 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */, - 46A16AA01807B038005B8026 /* CCSAXParser.h */, - 46A16AA11807B038005B8026 /* CCThread.cpp */, - 46A16AA21807B038005B8026 /* CCThread.h */, - A04583EF189053B500E32FE8 /* desktop */, - 46A16AA31807B038005B8026 /* ios */, - A0053FB5189B2BEA0035A564 /* linux */, - 46A16AC71807B038005B8026 /* mac */, - A0053FA7189B2BEA0035A564 /* win32 */, - ); - path = platform; - sourceTree = ""; - }; - 46A16A8E1807B038005B8026 /* apple */ = { - isa = PBXGroup; - children = ( - 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */, - 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */, - 46A16A911807B038005B8026 /* CCLock.cpp */, - 46A16A921807B038005B8026 /* CCLock.h */, - 46A16A931807B038005B8026 /* CCThread.mm */, - ); - path = apple; - sourceTree = ""; - }; - 46A16AA31807B038005B8026 /* ios */ = { - isa = PBXGroup; - children = ( - 46A16AA41807B038005B8026 /* CCApplication.h */, - 46A16AA51807B038005B8026 /* CCApplication.mm */, - 46A16AA61807B038005B8026 /* CCCommon.mm */, - 46A16AA71807B038005B8026 /* CCDevice.mm */, - 46A16AA81807B038005B8026 /* CCDirectorCaller.h */, - 46A16AA91807B038005B8026 /* CCDirectorCaller.mm */, - 46A16AAA1807B038005B8026 /* CCGLView.h */, - 46A16AAB1807B038005B8026 /* CCGLView.mm */, - 46A16AAC1807B038005B8026 /* CCES2Renderer.h */, - 46A16AAD1807B038005B8026 /* CCES2Renderer.m */, - 46A16AAE1807B038005B8026 /* CCESRenderer.h */, - 1A0DB7301823827C0025743D /* CCGL.h */, - 46A16AB01807B038005B8026 /* CCImage.mm */, - 46A16AB11807B038005B8026 /* CCPlatformDefine.h */, - 46A16AB21807B038005B8026 /* CCStdC.h */, - 1A0DB7311823827C0025743D /* CCEAGLView.h */, - 46A16AB41807B038005B8026 /* CCEAGLView.mm */, - 46A16AB51807B038005B8026 /* OpenGL_Internal.h */, - ); - path = ios; - sourceTree = ""; - }; - 46A16AC71807B038005B8026 /* mac */ = { - isa = PBXGroup; - children = ( - 3E26D40718ACB63900834404 /* CCDevice.mm */, - 46A16AC81807B038005B8026 /* CCApplication.h */, - 46A16AC91807B038005B8026 /* CCApplication.mm */, - 46A16ACA1807B038005B8026 /* CCCommon.mm */, - 1A0DB7351823828F0025743D /* CCGL.h */, - 46A16AD41807B038005B8026 /* CCPlatformDefine.h */, - 46A16AD51807B038005B8026 /* CCStdC.h */, - ); - path = mac; - sourceTree = ""; - }; 46A170611807CE7A005B8026 /* physics */ = { isa = PBXGroup; children = ( @@ -4577,33 +4417,35 @@ 46A170851807CE87005B8026 /* math */ = { isa = PBXGroup; children = ( - 500DC8CC19105F7D007B91BF /* CCAffineTransform.cpp */, - 500DC8CD19105F7D007B91BF /* CCAffineTransform.h */, - 500DC8CE19105F7D007B91BF /* CCGeometry.cpp */, - 500DC8CF19105F7D007B91BF /* CCGeometry.h */, - 500DC8D019105F7D007B91BF /* CCMathBase.h */, - B2AF2FB018EBBDA100C5807C /* CCMath.h */, - B2AF2F8218EBAEAE00C5807C /* MathUtil.cpp */, - B2AF2F8318EBAEAE00C5807C /* MathUtil.h */, - B2AF2F8418EBAEAE00C5807C /* MathUtil.inl */, - B2AF2F8518EBAEAE00C5807C /* MathUtilNeon.inl */, - B2AF2F8618EBAEAE00C5807C /* Matrix.cpp */, - B2AF2F8718EBAEAE00C5807C /* Matrix.h */, - B2AF2F8818EBAEAE00C5807C /* Matrix.inl */, - B2AF2F8918EBAEAE00C5807C /* Quaternion.cpp */, - B2AF2F8A18EBAEAE00C5807C /* Quaternion.h */, - B2AF2F8B18EBAEAE00C5807C /* Quaternion.inl */, - 500DC9B419106E6D007B91BF /* TransformUtils.cpp */, - 500DC9B519106E6D007B91BF /* TransformUtils.h */, - B2AF2F8C18EBAEAE00C5807C /* Vector2.cpp */, - B2AF2F8D18EBAEAE00C5807C /* Vector2.h */, - B2AF2F8E18EBAEAE00C5807C /* Vector2.inl */, - B2AF2F8F18EBAEAE00C5807C /* Vector3.cpp */, - B2AF2F9018EBAEAE00C5807C /* Vector3.h */, - B2AF2F9118EBAEAE00C5807C /* Vector3.inl */, - B2AF2F9218EBAEAE00C5807C /* Vector4.cpp */, - B2AF2F9318EBAEAE00C5807C /* Vector4.h */, - B2AF2F9418EBAEAE00C5807C /* Vector4.inl */, + 50ABBD1B1925AB0000A911A9 /* CCAffineTransform.cpp */, + 50ABBD1C1925AB0000A911A9 /* CCAffineTransform.h */, + 50ABBD1D1925AB0000A911A9 /* CCGeometry.cpp */, + 50ABBD1E1925AB0000A911A9 /* CCGeometry.h */, + 50ABBD1F1925AB0000A911A9 /* CCMath.h */, + 50ABBD201925AB0000A911A9 /* CCMathBase.h */, + 50ABBD211925AB0000A911A9 /* CCVertex.cpp */, + 50ABBD221925AB0000A911A9 /* CCVertex.h */, + 50ABBD231925AB0000A911A9 /* Mat4.cpp */, + 50ABBD241925AB0000A911A9 /* Mat4.h */, + 50ABBD251925AB0000A911A9 /* Mat4.inl */, + 50ABBD261925AB0000A911A9 /* MathUtil.cpp */, + 50ABBD271925AB0000A911A9 /* MathUtil.h */, + 50ABBD281925AB0000A911A9 /* MathUtil.inl */, + 50ABBD291925AB0000A911A9 /* MathUtilNeon.inl */, + 50ABBD2A1925AB0000A911A9 /* Quaternion.cpp */, + 50ABBD2B1925AB0000A911A9 /* Quaternion.h */, + 50ABBD2C1925AB0000A911A9 /* Quaternion.inl */, + 50ABBD2D1925AB0000A911A9 /* TransformUtils.cpp */, + 50ABBD2E1925AB0000A911A9 /* TransformUtils.h */, + 50ABBD2F1925AB0000A911A9 /* Vec2.cpp */, + 50ABBD301925AB0000A911A9 /* Vec2.h */, + 50ABBD311925AB0000A911A9 /* Vec2.inl */, + 50ABBD321925AB0000A911A9 /* Vec3.cpp */, + 50ABBD331925AB0000A911A9 /* Vec3.h */, + 50ABBD341925AB0000A911A9 /* Vec3.inl */, + 50ABBD351925AB0000A911A9 /* Vec4.cpp */, + 50ABBD361925AB0000A911A9 /* Vec4.h */, + 50ABBD371925AB0000A911A9 /* Vec4.inl */, ); name = math; path = ../cocos/math; @@ -4623,31 +4465,37 @@ isa = PBXGroup; children = ( 5034CA5D191D591900CE6051 /* shaders */, - 5034C9F7191D591000CE6051 /* ccShaders.h */, - 5034C9F8191D591000CE6051 /* ccShaders.cpp */, - 5034C9F9191D591000CE6051 /* CCGLProgramCache.h */, - 5034C9FA191D591000CE6051 /* CCGLProgramCache.cpp */, - 5034CA11191D591000CE6051 /* ccGLStateCache.h */, - 5034CA12191D591000CE6051 /* ccGLStateCache.cpp */, - 5034CA13191D591000CE6051 /* CCGLProgramStateCache.h */, - 5034CA14191D591000CE6051 /* CCGLProgramStateCache.cpp */, - 5034CA15191D591000CE6051 /* CCGLProgramState.h */, - 5034CA16191D591000CE6051 /* CCGLProgramState.cpp */, - 5034CA17191D591000CE6051 /* CCGLProgram.h */, - 5034CA18191D591000CE6051 /* CCGLProgram.cpp */, - 500DC89919105D41007B91BF /* CCBatchCommand.cpp */, - 500DC89A19105D41007B91BF /* CCBatchCommand.h */, - 500DC89B19105D41007B91BF /* CCCustomCommand.cpp */, - 500DC89C19105D41007B91BF /* CCCustomCommand.h */, - 500DC89D19105D41007B91BF /* CCGroupCommand.cpp */, - 500DC89E19105D41007B91BF /* CCGroupCommand.h */, - 500DC8A119105D41007B91BF /* CCQuadCommand.cpp */, - 500DC8A219105D41007B91BF /* CCQuadCommand.h */, - 500DC8A319105D41007B91BF /* CCRenderCommand.cpp */, - 500DC8A419105D41007B91BF /* CCRenderCommand.h */, - 500DC8A519105D41007B91BF /* CCRenderCommandPool.h */, - 500DC8A619105D41007B91BF /* CCRenderer.cpp */, - 500DC8A719105D41007B91BF /* CCRenderer.h */, + 50ABBD641925AB4100A911A9 /* CCBatchCommand.cpp */, + 50ABBD651925AB4100A911A9 /* CCBatchCommand.h */, + 50ABBD661925AB4100A911A9 /* CCCustomCommand.cpp */, + 50ABBD671925AB4100A911A9 /* CCCustomCommand.h */, + 50ABBD681925AB4100A911A9 /* CCGLProgram.cpp */, + 50ABBD691925AB4100A911A9 /* CCGLProgram.h */, + 50ABBD6A1925AB4100A911A9 /* CCGLProgramCache.cpp */, + 50ABBD6B1925AB4100A911A9 /* CCGLProgramCache.h */, + 50ABBD6C1925AB4100A911A9 /* CCGLProgramState.cpp */, + 50ABBD6D1925AB4100A911A9 /* CCGLProgramState.h */, + 50ABBD6E1925AB4100A911A9 /* CCGLProgramStateCache.cpp */, + 50ABBD6F1925AB4100A911A9 /* CCGLProgramStateCache.h */, + 50ABBD701925AB4100A911A9 /* ccGLStateCache.cpp */, + 50ABBD711925AB4100A911A9 /* ccGLStateCache.h */, + 50ABBD721925AB4100A911A9 /* CCGroupCommand.cpp */, + 50ABBD731925AB4100A911A9 /* CCGroupCommand.h */, + 50ABBD741925AB4100A911A9 /* CCQuadCommand.cpp */, + 50ABBD751925AB4100A911A9 /* CCQuadCommand.h */, + 50ABBD761925AB4100A911A9 /* CCRenderCommand.cpp */, + 50ABBD771925AB4100A911A9 /* CCRenderCommand.h */, + 50ABBD781925AB4100A911A9 /* CCRenderCommandPool.h */, + 50ABBD791925AB4100A911A9 /* CCRenderer.cpp */, + 50ABBD7A1925AB4100A911A9 /* CCRenderer.h */, + 50ABBD7B1925AB4100A911A9 /* ccShaders.cpp */, + 50ABBD7C1925AB4100A911A9 /* ccShaders.h */, + 50ABBD7D1925AB4100A911A9 /* CCTexture2D.cpp */, + 50ABBD7E1925AB4100A911A9 /* CCTexture2D.h */, + 50ABBD7F1925AB4100A911A9 /* CCTextureAtlas.cpp */, + 50ABBD801925AB4100A911A9 /* CCTextureAtlas.h */, + 50ABBD811925AB4100A911A9 /* CCTextureCache.cpp */, + 50ABBD821925AB4100A911A9 /* CCTextureCache.h */, ); name = renderer; path = ../cocos/renderer; @@ -4682,6 +4530,91 @@ name = shaders; sourceTree = ""; }; + 503DD8CD1926736A00CD74DD /* ios */ = { + isa = PBXGroup; + children = ( + 503DD8CE1926736A00CD74DD /* CCApplication.h */, + 503DD8CF1926736A00CD74DD /* CCApplication.mm */, + 503DD8D01926736A00CD74DD /* CCCommon.mm */, + 503DD8D11926736A00CD74DD /* CCDevice.mm */, + 503DD8D21926736A00CD74DD /* CCDirectorCaller.h */, + 503DD8D31926736A00CD74DD /* CCDirectorCaller.mm */, + 503DD8D41926736A00CD74DD /* CCEAGLView.h */, + 503DD8D51926736A00CD74DD /* CCEAGLView.mm */, + 503DD8D61926736A00CD74DD /* CCES2Renderer.h */, + 503DD8D71926736A00CD74DD /* CCES2Renderer.m */, + 503DD8D81926736A00CD74DD /* CCESRenderer.h */, + 503DD8D91926736A00CD74DD /* CCGL.h */, + 503DD8DA1926736A00CD74DD /* CCGLView.h */, + 503DD8DB1926736A00CD74DD /* CCGLView.mm */, + 503DD8DC1926736A00CD74DD /* CCImage.mm */, + 503DD8DD1926736A00CD74DD /* CCPlatformDefine.h */, + 503DD8DE1926736A00CD74DD /* CCStdC.h */, + 503DD8DF1926736A00CD74DD /* OpenGL_Internal.h */, + ); + path = ios; + sourceTree = ""; + }; + 50ABBEDB1926664700A911A9 /* platform */ = { + isa = PBXGroup; + children = ( + 503DD8CD1926736A00CD74DD /* ios */, + 50ABBF2D1926664700A911A9 /* desktop */, + 50ABBF4E1926664700A911A9 /* mac */, + 50ABBF1A1926664700A911A9 /* apple */, + 50ABBF201926664700A911A9 /* CCApplicationProtocol.h */, + 50ABBF211926664700A911A9 /* CCCommon.h */, + 50ABBF221926664700A911A9 /* CCDevice.h */, + 50ABBF231926664700A911A9 /* CCFileUtils.cpp */, + 50ABBF241926664700A911A9 /* CCFileUtils.h */, + 50ABBF251926664700A911A9 /* CCGLViewProtocol.cpp */, + 50ABBF261926664700A911A9 /* CCGLViewProtocol.h */, + 50ABBF271926664700A911A9 /* CCImage.cpp */, + 50ABBF281926664700A911A9 /* CCImage.h */, + 50ABBF291926664700A911A9 /* CCSAXParser.cpp */, + 50ABBF2A1926664700A911A9 /* CCSAXParser.h */, + 50ABBF2B1926664700A911A9 /* CCThread.cpp */, + 50ABBF2C1926664700A911A9 /* CCThread.h */, + ); + name = platform; + path = ../cocos/platform; + sourceTree = ""; + }; + 50ABBF1A1926664700A911A9 /* apple */ = { + isa = PBXGroup; + children = ( + 50ABBF1B1926664700A911A9 /* CCFileUtilsApple.h */, + 50ABBF1C1926664700A911A9 /* CCFileUtilsApple.mm */, + 50ABBF1D1926664700A911A9 /* CCLock.cpp */, + 50ABBF1E1926664700A911A9 /* CCLock.h */, + 50ABBF1F1926664700A911A9 /* CCThread.mm */, + ); + path = apple; + sourceTree = ""; + }; + 50ABBF2D1926664700A911A9 /* desktop */ = { + isa = PBXGroup; + children = ( + 50ABBF2E1926664700A911A9 /* CCGLView.cpp */, + 50ABBF2F1926664700A911A9 /* CCGLView.h */, + ); + path = desktop; + sourceTree = ""; + }; + 50ABBF4E1926664700A911A9 /* mac */ = { + isa = PBXGroup; + children = ( + 50ABBF4F1926664700A911A9 /* CCApplication.h */, + 50ABBF501926664700A911A9 /* CCApplication.mm */, + 50ABBF511926664700A911A9 /* CCCommon.mm */, + 50ABBF521926664700A911A9 /* CCDevice.mm */, + 50ABBF531926664700A911A9 /* CCGL.h */, + 50ABBF541926664700A911A9 /* CCPlatformDefine.h */, + 50ABBF551926664700A911A9 /* CCStdC.h */, + ); + path = mac; + sourceTree = ""; + }; 50FCEB6818C72017004AD434 /* WidgetReader */ = { isa = PBXGroup; children = ( @@ -4822,68 +4755,6 @@ path = TextReader; sourceTree = ""; }; - A0053F45189B2BEA0035A564 /* android */ = { - isa = PBXGroup; - children = ( - A0053F46189B2BEA0035A564 /* Android.mk */, - A0053F47189B2BEA0035A564 /* CCApplication.cpp */, - A0053F48189B2BEA0035A564 /* CCApplication.h */, - A0053F49189B2BEA0035A564 /* CCCommon.cpp */, - A0053F4A189B2BEA0035A564 /* CCDevice.cpp */, - A0053F4B189B2BEA0035A564 /* CCFileUtilsAndroid.cpp */, - A0053F4C189B2BEA0035A564 /* CCFileUtilsAndroid.h */, - A0053F4D189B2BEA0035A564 /* CCGL.h */, - A0053F4E189B2BEA0035A564 /* CCGLView.cpp */, - A0053F4F189B2BEA0035A564 /* CCGLView.h */, - A0053F51189B2BEA0035A564 /* CCPlatformDefine.h */, - A0053F52189B2BEA0035A564 /* CCStdC.h */, - ); - path = android; - sourceTree = ""; - }; - A0053FA7189B2BEA0035A564 /* win32 */ = { - isa = PBXGroup; - children = ( - A0053FA8189B2BEA0035A564 /* CCApplication.cpp */, - A0053FA9189B2BEA0035A564 /* CCApplication.h */, - A0053FAA189B2BEA0035A564 /* CCCommon.cpp */, - A0053FAB189B2BEA0035A564 /* CCDevice.cpp */, - A0053FAC189B2BEA0035A564 /* CCFileUtilsWin32.cpp */, - A0053FAD189B2BEA0035A564 /* CCFileUtilsWin32.h */, - A0053FAE189B2BEA0035A564 /* CCGL.h */, - A0053FB0189B2BEA0035A564 /* CCPlatformDefine.h */, - A0053FB1189B2BEA0035A564 /* CCStdC.cpp */, - A0053FB2189B2BEA0035A564 /* CCStdC.h */, - ); - path = win32; - sourceTree = ""; - }; - A0053FB5189B2BEA0035A564 /* linux */ = { - isa = PBXGroup; - children = ( - A0053FB6189B2BEA0035A564 /* CCApplication.cpp */, - A0053FB7189B2BEA0035A564 /* CCApplication.h */, - A0053FB8189B2BEA0035A564 /* CCCommon.cpp */, - A0053FB9189B2BEA0035A564 /* CCDevice.cpp */, - A0053FBA189B2BEA0035A564 /* CCFileUtilsLinux.cpp */, - A0053FBB189B2BEA0035A564 /* CCFileUtilsLinux.h */, - A0053FBC189B2BEA0035A564 /* CCGL.h */, - A0053FBE189B2BEA0035A564 /* CCPlatformDefine.h */, - A0053FBF189B2BEA0035A564 /* CCStdC.cpp */, - A0053FC0189B2BEA0035A564 /* CCStdC.h */, - ); - path = linux; - sourceTree = ""; - }; - A04583EF189053B500E32FE8 /* desktop */ = { - isa = PBXGroup; - children = ( - A04583F0189053B500E32FE8 /* CCGLView.cpp */, - A04583F1189053B500E32FE8 /* CCGLView.h */, - ); - path = desktop; - sourceTree = ""; - }; B3D8D4471799219B0039C204 /* mac */ = { isa = PBXGroup; children = ( @@ -4919,49 +4790,39 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 50ABBE9B1925AB6F00A911A9 /* CCRef.h in Headers */, + 50ABBE851925AB6F00A911A9 /* ccFPSImages.h in Headers */, 5034CA39191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */, 2AC795DF18628723005EC8E1 /* SkeletonBounds.h in Headers */, + 50ABBE891925AB6F00A911A9 /* CCMap.h in Headers */, 2AC795E018628723005EC8E1 /* Event.h in Headers */, 2AC795E118628723005EC8E1 /* EventData.h in Headers */, 50E6D33618E174130051CA34 /* UIHBox.h in Headers */, - 500DC94A19106300007B91BF /* CCDirector.h in Headers */, - 500DC97A19106300007B91BF /* CCEventMouse.h in Headers */, + 50ABBE8D1925AB6F00A911A9 /* CCNS.h in Headers */, 2AC795E218628723005EC8E1 /* BoundingBoxAttachment.h in Headers */, 06CAAAC9186AD7EE0012A414 /* TriggerMng.h in Headers */, 2905FA6018CF08D100240AA3 /* UILayoutParameter.h in Headers */, + 50ABBEA51925AB6F00A911A9 /* CCScriptSupport.h in Headers */, 1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */, 5034CA3F191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, - 500DC8B419105D41007B91BF /* CCGroupCommand.h in Headers */, - 500DC8D319105F7D007B91BF /* CCAffineTransform.h in Headers */, - 46A170191807CBFC005B8026 /* CCCommon.h in Headers */, + 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */, 46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */, 2905FA4818CF08D100240AA3 /* UIButton.h in Headers */, 46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */, - 46A170241807CBFC005B8026 /* CCSAXParser.h in Headers */, - 46A1701A1807CBFC005B8026 /* CCDevice.h in Headers */, - B2AF2F9F18EBAEAE00C5807C /* Quaternion.h in Headers */, - 46A170161807CBFC005B8026 /* CCLock.h in Headers */, - 46A1701C1807CBFC005B8026 /* CCGLViewProtocol.h in Headers */, - 46A1701E1807CBFC005B8026 /* CCFileUtils.h in Headers */, + 50ABBD3E1925AB0000A911A9 /* CCGeometry.h in Headers */, + 50ABBE631925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */, 2905FA4418CF08D100240AA3 /* GUIDefine.h in Headers */, B37510771823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */, - 46A1705B1807CC1C005B8026 /* CCPlatformDefine.h in Headers */, 46A170EE1807CECA005B8026 /* CCPhysicsShape.h in Headers */, 2905FA5018CF08D100240AA3 /* UIHelper.h in Headers */, - 46A170261807CBFC005B8026 /* CCThread.h in Headers */, + 50ABBED31925AB6F00A911A9 /* uthash.h in Headers */, 46A170E91807CECA005B8026 /* CCPhysicsContact.h in Headers */, B375107B1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */, 2905FA6818CF08D100240AA3 /* UILoadingBar.h in Headers */, - 500DC99A19106300007B91BF /* ccTypes.h in Headers */, 46A170F01807CECA005B8026 /* CCPhysicsWorld.h in Headers */, - 500DC8C219105D41007B91BF /* CCRenderCommandPool.h in Headers */, - 5034CA4D191D591100CE6051 /* ccGLStateCache.h in Headers */, - 46A1705C1807CC1C005B8026 /* CCStdC.h in Headers */, - 46A1704F1807CC1C005B8026 /* CCApplication.h in Headers */, - 500DC98C19106300007B91BF /* CCPlatformMacros.h in Headers */, - 46A170131807CBFC005B8026 /* CCFileUtilsApple.h in Headers */, - 46A1701F1807CBFC005B8026 /* CCImage.h in Headers */, - 46A170181807CBFC005B8026 /* CCApplicationProtocol.h in Headers */, + 50ABBEC11925AB6F00A911A9 /* CCValue.h in Headers */, + 50ABBE871925AB6F00A911A9 /* ccMacros.h in Headers */, + 50ABBE731925AB6F00A911A9 /* CCEventListenerMouse.h in Headers */, 1A570063180BC5A10088DEC7 /* CCAction.h in Headers */, 1A570067180BC5A10088DEC7 /* CCActionCamera.h in Headers */, 1A57006B180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */, @@ -4972,48 +4833,40 @@ 06CAAAD1186AD8010012A414 /* ObjectFactory.h in Headers */, 1A570077180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */, 1A57007B180BC5A10088DEC7 /* CCActionInstant.h in Headers */, - 500DC8BC19105D41007B91BF /* CCQuadCommand.h in Headers */, - 500DC94E19106300007B91BF /* CCEvent.h in Headers */, 1A57007F180BC5A10088DEC7 /* CCActionInterval.h in Headers */, 1A01C69A18F57BE800EFE3A6 /* CCSet.h in Headers */, - 296CAD2A1915EC9900C64FBF /* CCEventListenerFocus.h in Headers */, 1A570083180BC5A10088DEC7 /* CCActionManager.h in Headers */, 1A570087180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */, + 50ABBD911925AB4100A911A9 /* CCGLProgramCache.h in Headers */, ED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */, + 50ABBEC31925AB6F00A911A9 /* CCVector.h in Headers */, 1A57008B180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */, - 500DC96E19106300007B91BF /* CCEventListenerKeyboard.h in Headers */, - 1A0DB7381823828F0025743D /* CCGL.h in Headers */, + 50ABBD8D1925AB4100A911A9 /* CCGLProgram.h in Headers */, + 50ABBEA11925AB6F00A911A9 /* CCScheduler.h in Headers */, + 50ABBDB71925AB4100A911A9 /* CCTexture2D.h in Headers */, 2905FA6C18CF08D100240AA3 /* UIPageView.h in Headers */, 50FCEB9518C72017004AD434 /* ButtonReader.h in Headers */, + 50ABBE811925AB6F00A911A9 /* CCEventType.h in Headers */, 1A57008F180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 1A570093180BC5A10088DEC7 /* CCActionTween.h in Headers */, - 500DC8C019105D41007B91BF /* CCRenderCommand.h in Headers */, + 50ABBD4A1925AB0000A911A9 /* Mat4.h in Headers */, 1A57009A180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, 1A5700A0180BC5D20088DEC7 /* CCNode.h in Headers */, + 50ABC0671926664800A911A9 /* CCPlatformDefine.h in Headers */, 46C02E0918E91123004B7456 /* xxhash.h in Headers */, - B2AF2FA318EBAEAE00C5807C /* Vector2.h in Headers */, 06CAAAC6186AD7E60012A414 /* TriggerObj.h in Headers */, - 500DC8B019105D41007B91BF /* CCCustomCommand.h in Headers */, - 500DC8AC19105D41007B91BF /* CCBatchCommand.h in Headers */, - A04583F3189053B500E32FE8 /* CCGLView.h in Headers */, - B2AF2FA718EBAEAE00C5807C /* Vector3.h in Headers */, 1A570110180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */, - 500DC8D719105F7D007B91BF /* CCGeometry.h in Headers */, - 500DC96619106300007B91BF /* CCEventListenerAcceleration.h in Headers */, B37510791823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */, 1A570114180BC8EE0088DEC7 /* CCDrawNode.h in Headers */, - 500DC98219106300007B91BF /* ccMacros.h in Headers */, 1A57011D180BC90D0088DEC7 /* CCGrabber.h in Headers */, 1A570121180BC90D0088DEC7 /* CCGrid.h in Headers */, 5034CA2D191D591100CE6051 /* ccShader_PositionTextureA8Color.frag in Headers */, 50E6D33A18E174130051CA34 /* UIRelativeBox.h in Headers */, - 500DC8C619105D41007B91BF /* CCRenderer.h in Headers */, 50E6D30F18DADB5D0051CA34 /* CCProtectedNode.h in Headers */, - 500DC9BE19106E89007B91BF /* CCProfiling.h in Headers */, 50FCEB9918C72017004AD434 /* CheckBoxReader.h in Headers */, 50E6D33E18E174130051CA34 /* UIVBox.h in Headers */, - 500DC9AC19106300007B91BF /* ZipUtils.h in Headers */, 1AC0269C1914068200FA920D /* ConvertUTF.h in Headers */, + 50ABBED11925AB6F00A911A9 /* TGAlib.h in Headers */, 1A57019F180BCB590088DEC7 /* CCFont.h in Headers */, 1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */, 1A01C68618F57BE800EFE3A6 /* CCArray.h in Headers */, @@ -5021,106 +4874,100 @@ 1A5701B3180BCB590088DEC7 /* CCFontFNT.h in Headers */, 5034CA47191D591100CE6051 /* ccShader_Label_normal.frag in Headers */, 1A5701B7180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */, - 500DC94219106300007B91BF /* CCData.h in Headers */, 1A5701BB180BCB5A0088DEC7 /* CCLabel.h in Headers */, 1A5701BF180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */, + 50ABBED91925AB6F00A911A9 /* ZipUtils.h in Headers */, 1A5701C3180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */, - 500DC93A19106300007B91BF /* CCConfiguration.h in Headers */, + 50ABBE5F1925AB6F00A911A9 /* CCEventListener.h in Headers */, 1A5701C9180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */, 5034CA37191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, 1A5701CD180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */, 1A5701E0180BCB8C0088DEC7 /* CCLayer.h in Headers */, 1A5701E4180BCB8C0088DEC7 /* CCScene.h in Headers */, 1A01C68818F57BE800EFE3A6 /* CCBool.h in Headers */, + 50ABBEAD1925AB6F00A911A9 /* ccTypes.h in Headers */, 1A087AEA1860400400196EF5 /* edtaa3func.h in Headers */, 1A5701E8180BCB8C0088DEC7 /* CCTransition.h in Headers */, 2905FA4C18CF08D100240AA3 /* UICheckBox.h in Headers */, 1A5701EC180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */, 1A5701F0180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */, 1A5701F9180BCBAD0088DEC7 /* CCMenu.h in Headers */, + 50ABBD401925AB0000A911A9 /* CCMath.h in Headers */, 1A5701FD180BCBAD0088DEC7 /* CCMenuItem.h in Headers */, 1A570204180BCBD40088DEC7 /* CCClippingNode.h in Headers */, 1A01C6A618F58F7500EFE3A6 /* CCNotificationCenter.h in Headers */, 1A57020A180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */, 1A570212180BCBF40088DEC7 /* CCProgressTimer.h in Headers */, 1A570216180BCBF40088DEC7 /* CCRenderTexture.h in Headers */, - 500DC95219106300007B91BF /* CCEventAcceleration.h in Headers */, - 500DC99E19106300007B91BF /* CCValue.h in Headers */, 1A01C69618F57BE800EFE3A6 /* CCInteger.h in Headers */, 1A570223180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */, + 50ABBD891925AB4100A911A9 /* CCCustomCommand.h in Headers */, 5034CA43191D591100CE6051 /* ccShader_Label.vert in Headers */, 1A570227180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */, 1A57022B180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */, 5034CA2F191D591100CE6051 /* ccShader_PositionTexture.vert in Headers */, + 50ABBE951925AB6F00A911A9 /* CCProfiling.h in Headers */, 5034CA4B191D591100CE6051 /* ccShader_Label_df_glow.frag in Headers */, + 50ABBE4F1925AB6F00A911A9 /* CCEventCustom.h in Headers */, + 50ABBD521925AB0000A911A9 /* Quaternion.h in Headers */, 1A57022F180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */, - 500DC96A19106300007B91BF /* CCEventListenerCustom.h in Headers */, - B2AF2F9718EBAEAE00C5807C /* MathUtil.h in Headers */, - 1A570236180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */, - 500DC95E19106300007B91BF /* CCEventKeyboard.h in Headers */, 2905FA4218CF08D100240AA3 /* CocosGUI.h in Headers */, - 500DC95A19106300007B91BF /* CCEventDispatcher.h in Headers */, 5034CA49191D591100CE6051 /* ccShader_Label_df.frag in Headers */, - 500DC9A019106300007B91BF /* CCVector.h in Headers */, - 500DC92C19106300007B91BF /* atitc.h in Headers */, 1A01C68C18F57BE800EFE3A6 /* CCDeprecated.h in Headers */, - 500DC98419106300007B91BF /* CCMap.h in Headers */, + 50ABBD561925AB0000A911A9 /* TransformUtils.h in Headers */, 2905FA6418CF08D100240AA3 /* UIListView.h in Headers */, 50FCEBB918C72017004AD434 /* TextAtlasReader.h in Headers */, + 50ABBD991925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */, 5034CA3D191D591100CE6051 /* ccShader_PositionColor.frag in Headers */, 1A570280180BCC900088DEC7 /* CCSprite.h in Headers */, 1A570284180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */, - 500DC9A419106300007B91BF /* etc1.h in Headers */, - 5034CA55191D591100CE6051 /* CCGLProgramState.h in Headers */, 5034CA2B191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */, 1A570288180BCC900088DEC7 /* CCSpriteFrame.h in Headers */, 1A57028C180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */, 5027253A190BF1B900AAF4ED /* cocos2d.h in Headers */, 1A570294180BCCAB0088DEC7 /* CCAnimation.h in Headers */, + 50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */, 1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */, 50FCEB9D18C72017004AD434 /* ImageViewReader.h in Headers */, + 50ABBE911925AB6F00A911A9 /* CCPlatformMacros.h in Headers */, + 50ABC05D1926664800A911A9 /* CCApplication.h in Headers */, + 50ABC0071926664800A911A9 /* CCApplicationProtocol.h in Headers */, 50FCEBA918C72017004AD434 /* LoadingBarReader.h in Headers */, - 500DC9B21910633C007B91BF /* CCTouch.h in Headers */, - 1A5702B1180BCDBC0088DEC7 /* ccUTF8.h in Headers */, - 1A5702B7180BCDF40088DEC7 /* CCVertex.h in Headers */, - 1A5702BA180BCDFC0088DEC7 /* ccUtils.h in Headers */, - 1A5702C0180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */, + 50ABBD4E1925AB0000A911A9 /* MathUtil.h in Headers */, 2905FA7618CF08D100240AA3 /* UIScrollView.h in Headers */, - 1A5702C4180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */, + 50ABBE431925AB6F00A911A9 /* CCDirector.h in Headers */, 1A12775B18DFCC540005F345 /* CCTweenFunction.h in Headers */, 1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */, - 1A5702D5180BCE570088DEC7 /* CCTexture2D.h in Headers */, - 1A5702D9180BCE570088DEC7 /* CCTextureAtlas.h in Headers */, - 1A5702DD180BCE570088DEC7 /* CCTextureCache.h in Headers */, 1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */, 1A5702F0180BCE750088DEC7 /* CCTMXLayer.h in Headers */, + 50ABC01B1926664800A911A9 /* CCSAXParser.h in Headers */, + 50ABBED51925AB6F00A911A9 /* utlist.h in Headers */, 50FCEBAD18C72017004AD434 /* PageViewReader.h in Headers */, 1A5702F4180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */, + 50ABBDAF1925AB4100A911A9 /* CCRenderer.h in Headers */, 1A5702F8180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */, 5034CA21191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */, + 50ABBDA11925AB4100A911A9 /* CCGroupCommand.h in Headers */, 1A5702FC180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */, + 50ABBDBB1925AB4100A911A9 /* CCTextureAtlas.h in Headers */, 1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */, + 50ABBE4B1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */, 1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */, 1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */, 50FCEBC918C72017004AD434 /* WidgetReader.h in Headers */, + 50ABBD851925AB4100A911A9 /* CCBatchCommand.h in Headers */, + 50ABC0651926664800A911A9 /* CCGL.h in Headers */, B37510751823AC9F00B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */, - 500DC94619106300007B91BF /* CCDataVisitor.h in Headers */, - B2AF2FAB18EBAEAE00C5807C /* Vector4.h in Headers */, - 1A57031B180BCF430088DEC7 /* ccCArray.h in Headers */, - 1A57031D180BCF430088DEC7 /* uthash.h in Headers */, - 1A57031F180BCF430088DEC7 /* utlist.h in Headers */, + 50ABBD621925AB0000A911A9 /* Vec4.h in Headers */, 1A01C69418F57BE800EFE3A6 /* CCFloat.h in Headers */, - 1A570326180BCF660088DEC7 /* TGAlib.h in Headers */, - 1A570331180BCFD50088DEC7 /* CCUserDefault.h in Headers */, - 500DC93419106300007B91BF /* CCAutoreleasePool.h in Headers */, 2905FA5818CF08D100240AA3 /* UILayout.h in Headers */, 1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */, 1A570356180BD0B00088DEC7 /* ioapi.h in Headers */, - 500DC99619106300007B91BF /* CCScheduler.h in Headers */, + 50ABBE331925AB6F00A911A9 /* CCConfiguration.h in Headers */, + 50ABC01F1926664800A911A9 /* CCThread.h in Headers */, 1A57035A180BD0B00088DEC7 /* unzip.h in Headers */, - 296CAD241915EC8000C64FBF /* CCEventFocus.h in Headers */, - 500DC98819106300007B91BF /* CCNS.h in Headers */, 1AD71DAB180E26E600808F54 /* CCBAnimationManager.h in Headers */, + 50ABBDBF1925AB4100A911A9 /* CCTextureCache.h in Headers */, 1AD71DAF180E26E600808F54 /* CCBFileLoader.h in Headers */, B37510741823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */, 2905FA8E18CF08D100240AA3 /* UIWidget.h in Headers */, @@ -5130,135 +4977,159 @@ 2905FA7E18CF08D100240AA3 /* UIText.h in Headers */, 1AD71DBB180E26E600808F54 /* CCBSelectorResolver.h in Headers */, 5034CA35191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */, - 500DC98019106300007B91BF /* CCEventType.h in Headers */, + 50ABBE6F1925AB6F00A911A9 /* CCEventListenerKeyboard.h in Headers */, + 50ABBE9D1925AB6F00A911A9 /* CCRefPtr.h in Headers */, 1AD71DBF180E26E600808F54 /* CCBSequence.h in Headers */, 1AD71DC3180E26E600808F54 /* CCBSequenceProperty.h in Headers */, 5034CA31191D591100CE6051 /* ccShader_PositionTexture_uColor.vert in Headers */, 1AD71DCB180E26E600808F54 /* CCControlButtonLoader.h in Headers */, 1AD71DCF180E26E600808F54 /* CCControlLoader.h in Headers */, + 50ABBE7B1925AB6F00A911A9 /* CCEventMouse.h in Headers */, 1AD71DD3180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */, 1AD71DD7180E26E600808F54 /* CCLabelTTFLoader.h in Headers */, 1AD71DDB180E26E600808F54 /* CCLayerColorLoader.h in Headers */, + 503DD8F91926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */, 1AD71DDF180E26E600808F54 /* CCLayerGradientLoader.h in Headers */, 1AD71DE3180E26E600808F54 /* CCLayerLoader.h in Headers */, - 500DC97219106300007B91BF /* CCEventListenerMouse.h in Headers */, 1AD71DE7180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */, 1AD71DEB180E26E600808F54 /* CCMenuItemLoader.h in Headers */, 1AD71DED180E26E600808F54 /* CCMenuLoader.h in Headers */, + 50ABBE8F1925AB6F00A911A9 /* CCPlatformConfig.h in Headers */, 1AD71DF1180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */, 2905FA7218CF08D100240AA3 /* UIScrollInterface.h in Headers */, - B2AF2F9B18EBAEAE00C5807C /* Matrix.h in Headers */, 1AD71DF5180E26E600808F54 /* CCNodeLoader.h in Headers */, 1AD71DF9180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */, + 50ABBE291925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */, 2905FA8A18CF08D100240AA3 /* UITextField.h in Headers */, + 50ABBE471925AB6F00A911A9 /* CCEvent.h in Headers */, + 50ABBE6B1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */, 1AD71DFB180E26E600808F54 /* CCNodeLoaderListener.h in Headers */, + 50ABBDA51925AB4100A911A9 /* CCQuadCommand.h in Headers */, 1AD71DFF180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */, + 50ABBD3A1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 1AD71E03180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */, - 5034CA51191D591100CE6051 /* CCGLProgramStateCache.h in Headers */, 1AD71E07180E26E600808F54 /* CCScrollViewLoader.h in Headers */, + 50ABBE571925AB6F00A911A9 /* CCEventFocus.h in Headers */, 1AD71E0B180E26E600808F54 /* CCSpriteLoader.h in Headers */, 1AD71E0D180E26E600808F54 /* CocosBuilder.h in Headers */, 1AD71E97180E26E600808F54 /* Animation.h in Headers */, 1AD71E9B180E26E600808F54 /* AnimationState.h in Headers */, 1A01C69218F57BE800EFE3A6 /* CCDouble.h in Headers */, + 50ABBE251925AB6F00A911A9 /* base64.h in Headers */, + 50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */, 1AD71E9F180E26E600808F54 /* AnimationStateData.h in Headers */, 1AD71EA3180E26E600808F54 /* Atlas.h in Headers */, 1AD71EA7180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */, + 503DD8F51926B0DB00CD74DD /* CCIMEDelegate.h in Headers */, 1AD71EAB180E26E600808F54 /* Attachment.h in Headers */, - 500DC97E19106300007B91BF /* CCEventTouch.h in Headers */, 50FCEBC118C72017004AD434 /* TextFieldReader.h in Headers */, 1AD71EAF180E26E600808F54 /* AttachmentLoader.h in Headers */, 1AD71EB3180E26E600808F54 /* Bone.h in Headers */, 2905FA8218CF08D100240AA3 /* UITextAtlas.h in Headers */, 1AD71EB7180E26E600808F54 /* BoneData.h in Headers */, - 500DC99219106300007B91BF /* CCRefPtr.h in Headers */, + 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */, 1AD71EBB180E26E600808F54 /* CCSkeleton.h in Headers */, - 500DC97619106300007B91BF /* CCEventListenerTouch.h in Headers */, 50FCEBA118C72017004AD434 /* LayoutReader.h in Headers */, + 50ABBEBD1925AB6F00A911A9 /* ccUtils.h in Headers */, 1AD71EBF180E26E600808F54 /* CCSkeletonAnimation.h in Headers */, 2905FA7018CF08D100240AA3 /* UIRichText.h in Headers */, 1AD71EC3180E26E600808F54 /* extension.h in Headers */, 50FCEBC518C72017004AD434 /* TextReader.h in Headers */, 1AD71EC7180E26E600808F54 /* Json.h in Headers */, - 500DC8D919105F7D007B91BF /* CCMathBase.h in Headers */, + 50ABC0231926664800A911A9 /* CCGLView.h in Headers */, 06CAAACD186AD7F90012A414 /* TriggerBase.h in Headers */, 1AD71ECB180E26E600808F54 /* RegionAttachment.h in Headers */, + 50ABBFFD1926664800A911A9 /* CCFileUtilsApple.h in Headers */, 2905FA8618CF08D100240AA3 /* UITextBMFont.h in Headers */, 1AD71ECF180E26E600808F54 /* Skeleton.h in Headers */, 5034CA41191D591100CE6051 /* ccShader_Position_uColor.frag in Headers */, + 50ABBE7F1925AB6F00A911A9 /* CCEventTouch.h in Headers */, + 50ABBE5B1925AB6F00A911A9 /* CCEventKeyboard.h in Headers */, 1A01C69E18F57BE800EFE3A6 /* CCString.h in Headers */, - 500DC9B819106E6D007B91BF /* TransformUtils.h in Headers */, 1AD71ED3180E26E600808F54 /* SkeletonData.h in Headers */, + 50ABC00F1926664800A911A9 /* CCFileUtils.h in Headers */, + 50ABBE3B1925AB6F00A911A9 /* CCData.h in Headers */, 1AD71ED7180E26E600808F54 /* SkeletonJson.h in Headers */, - 500DC9A819106300007B91BF /* s3tc.h in Headers */, 1AD71EDB180E26E600808F54 /* Skin.h in Headers */, + 50ABBE3F1925AB6F00A911A9 /* CCDataVisitor.h in Headers */, 1AD71EDF180E26E600808F54 /* Slot.h in Headers */, 1AD71EE3180E26E600808F54 /* SlotData.h in Headers */, 1AD71EE7180E26E600808F54 /* spine-cocos2dx.h in Headers */, 1AD71EE9180E26E600808F54 /* spine.h in Headers */, 1AAF536C180E3374000584C8 /* HttpClient.h in Headers */, + 50ABBD9D1925AB4100A911A9 /* ccGLStateCache.h in Headers */, + 50ABBEB91925AB6F00A911A9 /* ccUTF8.h in Headers */, 1AAF536E180E3374000584C8 /* HttpRequest.h in Headers */, - 500DC99019106300007B91BF /* CCRef.h in Headers */, 1AAF5370180E3374000584C8 /* HttpResponse.h in Headers */, + 50ABBE671925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */, 1AAF5374180E3374000584C8 /* SocketIO.h in Headers */, + 50ABBE2F1925AB6F00A911A9 /* ccConfig.h in Headers */, 373B9129187891F400198F86 /* CCComBase.h in Headers */, 1AAF5378180E3374000584C8 /* WebSocket.h in Headers */, 1AAF5851180E40B9000584C8 /* LocalStorage.h in Headers */, 1A01C69018F57BE800EFE3A6 /* CCDictionary.h in Headers */, - 1A9DCA25180E6955007A3AD4 /* ccFPSImages.h in Headers */, 1A9DCA29180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */, - 1A9DCA2D180E6955007A3AD4 /* CCProtocols.h in Headers */, 50FCEBB118C72017004AD434 /* ScrollViewReader.h in Headers */, - 500DC98A19106300007B91BF /* CCPlatformConfig.h in Headers */, - 5034CA19191D591000CE6051 /* ccShaders.h in Headers */, - 1A9DCA3B180E6955007A3AD4 /* firePngData.h in Headers */, + 50ABC0031926664800A911A9 /* CCLock.h in Headers */, B37510721823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */, + 50ABBE2D1925AB6F00A911A9 /* ccCArray.h in Headers */, 50FCEBA518C72017004AD434 /* ListViewReader.h in Headers */, + 50ABBD5E1925AB0000A911A9 /* Vec3.h in Headers */, 1A8C598D180E930E00EF57C3 /* CCActionFrame.h in Headers */, 1A8C5991180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */, 1A8C5995180E930E00EF57C3 /* CCActionManagerEx.h in Headers */, + 50ABBE211925AB6F00A911A9 /* atitc.h in Headers */, 1A8C5999180E930E00EF57C3 /* CCActionNode.h in Headers */, 1A8C599D180E930E00EF57C3 /* CCActionObject.h in Headers */, + 50ABBE371925AB6F00A911A9 /* CCConsole.h in Headers */, 1A8C59A1180E930E00EF57C3 /* CCArmature.h in Headers */, 1A8C59A5180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */, 1A8C59A9180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */, + 50ABC00B1926664800A911A9 /* CCDevice.h in Headers */, 2905FA7A18CF08D100240AA3 /* UISlider.h in Headers */, - 500DC93E19106300007B91BF /* CCConsole.h in Headers */, 1A8C59AD180E930E00EF57C3 /* CCArmatureDefine.h in Headers */, + 50ABC0131926664800A911A9 /* CCGLViewProtocol.h in Headers */, 1A8C59B1180E930E00EF57C3 /* CCBatchNode.h in Headers */, + 50ABBDB31925AB4100A911A9 /* ccShaders.h in Headers */, 2905FA5418CF08D100240AA3 /* UIImageView.h in Headers */, 1A8C59B5180E930E00EF57C3 /* CCBone.h in Headers */, + 50ABBDAB1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */, 5034CA45191D591100CE6051 /* ccShader_Label_outline.frag in Headers */, - 500DC96219106300007B91BF /* CCEventListener.h in Headers */, 1A8C59B9180E930E00EF57C3 /* CCColliderDetector.h in Headers */, 1A8C59BD180E930E00EF57C3 /* CCComAttribute.h in Headers */, 1A8C59C1180E930E00EF57C3 /* CCComAudio.h in Headers */, - B2AF2FB118EBBDA100C5807C /* CCMath.h in Headers */, 1A8C59C5180E930E00EF57C3 /* CCComController.h in Headers */, 1A8C59C9180E930E00EF57C3 /* CCComRender.h in Headers */, - 5034CA59191D591100CE6051 /* CCGLProgram.h in Headers */, 1A8C59CD180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */, + 50ABBEB11925AB6F00A911A9 /* CCUserDefault.h in Headers */, + 50ABBEC71925AB6F00A911A9 /* etc1.h in Headers */, + 50ABBEA91925AB6F00A911A9 /* CCTouch.h in Headers */, + 50ABBE971925AB6F00A911A9 /* CCProtocols.h in Headers */, 1A8C59D1180E930E00EF57C3 /* CCDatas.h in Headers */, 1A8C59D5180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */, 1A8C59D9180E930E00EF57C3 /* CCDisplayFactory.h in Headers */, + 50ABC0691926664800A911A9 /* CCStdC.h in Headers */, + 50ABBECD1925AB6F00A911A9 /* s3tc.h in Headers */, + 50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, 1A8C59DD180E930E00EF57C3 /* CCDisplayManager.h in Headers */, 1A8C59E1180E930E00EF57C3 /* CCInputDelegate.h in Headers */, 1A8C59E5180E930E00EF57C3 /* CCProcessBase.h in Headers */, 1A8C59E9180E930E00EF57C3 /* CCSGUIReader.h in Headers */, 5034CA33191D591100CE6051 /* ccShader_PositionTexture_uColor.frag in Headers */, + 50ABC0171926664800A911A9 /* CCImage.h in Headers */, 1A8C59ED180E930E00EF57C3 /* CCSkin.h in Headers */, - 5034CA1D191D591100CE6051 /* CCGLProgramCache.h in Headers */, + 50ABBDA91925AB4100A911A9 /* CCRenderCommand.h in Headers */, + 50ABBD951925AB4100A911A9 /* CCGLProgramState.h in Headers */, 1A8C59F1180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */, 1A8C59F5180E930E00EF57C3 /* CCSSceneReader.h in Headers */, 1A8C59F9180E930E00EF57C3 /* CCTransformHelp.h in Headers */, 1A8C59FD180E930E00EF57C3 /* CCTween.h in Headers */, 1A8C5A05180E930E00EF57C3 /* CCUtilMath.h in Headers */, + 50ABC0091926664800A911A9 /* CCCommon.h in Headers */, + 50ABBE531925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, 1A8C5A07180E930E00EF57C3 /* CocoStudio.h in Headers */, - 500DC93619106300007B91BF /* ccConfig.h in Headers */, - 500DC93019106300007B91BF /* base64.h in Headers */, 1A8C5A0F180E930E00EF57C3 /* DictionaryHelper.h in Headers */, 50FCEBBD18C72017004AD434 /* TextBMFontReader.h in Headers */, - 500DC95619106300007B91BF /* CCEventCustom.h in Headers */, 50FCEBCB18C72017004AD434 /* WidgetReaderProtocol.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5403,210 +5274,195 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 500DC9B31910633C007B91BF /* CCTouch.h in Headers */, 2AC795E71862875D005EC8E1 /* SkeletonBounds.h in Headers */, 2AC795E81862875D005EC8E1 /* Event.h in Headers */, - 500DC97B19106300007B91BF /* CCEventMouse.h in Headers */, 2AC795E91862875D005EC8E1 /* EventData.h in Headers */, 2AC795EA1862875D005EC8E1 /* BoundingBoxAttachment.h in Headers */, - 500DC93519106300007B91BF /* CCAutoreleasePool.h in Headers */, - 5034CA1A191D591100CE6051 /* ccShaders.h in Headers */, - 46A1702D1807CBFE005B8026 /* CCCommon.h in Headers */, + 503DD8F01926736A00CD74DD /* CCStdC.h in Headers */, 46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */, + 50ABBDA21925AB4100A911A9 /* CCGroupCommand.h in Headers */, + 503DD8EF1926736A00CD74DD /* CCPlatformDefine.h in Headers */, 46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */, - 500DC95719106300007B91BF /* CCEventCustom.h in Headers */, - 500DC95319106300007B91BF /* CCEventAcceleration.h in Headers */, - B2AF2F9818EBAEAE00C5807C /* MathUtil.h in Headers */, - 500DC9BF19106E89007B91BF /* CCProfiling.h in Headers */, - 500DC8D819105F7D007B91BF /* CCGeometry.h in Headers */, 50FCEBAE18C72017004AD434 /* PageViewReader.h in Headers */, - 46A1703F1807CC07005B8026 /* CCDirectorCaller.h in Headers */, - 46A170381807CBFE005B8026 /* CCSAXParser.h in Headers */, + 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 5034CA38191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, - 500DC97319106300007B91BF /* CCEventListenerMouse.h in Headers */, - 500DC99319106300007B91BF /* CCRefPtr.h in Headers */, - 46A1702E1807CBFE005B8026 /* CCDevice.h in Headers */, - 46A1702A1807CBFE005B8026 /* CCLock.h in Headers */, - 46A170451807CC07005B8026 /* CCESRenderer.h in Headers */, + 50ABBE7C1925AB6F00A911A9 /* CCEventMouse.h in Headers */, 46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */, - 46A170411807CC07005B8026 /* CCGLView.h in Headers */, - 46A170301807CBFE005B8026 /* CCGLViewProtocol.h in Headers */, - 5034CA4E191D591100CE6051 /* ccGLStateCache.h in Headers */, - 500DC8B119105D41007B91BF /* CCCustomCommand.h in Headers */, - 500DC8DA19105F7D007B91BF /* CCMathBase.h in Headers */, - 46A170321807CBFE005B8026 /* CCFileUtils.h in Headers */, - 46A1703A1807CBFE005B8026 /* CCThread.h in Headers */, 46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */, 2905FA6118CF08D100240AA3 /* UILayoutParameter.h in Headers */, - 500DC8BD19105D41007B91BF /* CCQuadCommand.h in Headers */, + 50ABBE9C1925AB6F00A911A9 /* CCRef.h in Headers */, + 50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */, 46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */, - 46A170491807CC07005B8026 /* CCStdC.h in Headers */, - 46A1703B1807CC07005B8026 /* CCApplication.h in Headers */, - 46A170271807CBFE005B8026 /* CCFileUtilsApple.h in Headers */, - 46A170431807CC07005B8026 /* CCES2Renderer.h in Headers */, - 46A170331807CBFE005B8026 /* CCImage.h in Headers */, + 50ABBDB41925AB4100A911A9 /* ccShaders.h in Headers */, + 50ABBE861925AB6F00A911A9 /* ccFPSImages.h in Headers */, + 50ABBE2E1925AB6F00A911A9 /* ccCArray.h in Headers */, + 50ABC0041926664800A911A9 /* CCLock.h in Headers */, 5034CA40191D591100CE6051 /* ccShader_Position_uColor.vert in Headers */, + 50ABBEC21925AB6F00A911A9 /* CCValue.h in Headers */, 2905FA5518CF08D100240AA3 /* UIImageView.h in Headers */, - 46A170481807CC07005B8026 /* CCPlatformDefine.h in Headers */, - 46A1704C1807CC07005B8026 /* OpenGL_Internal.h in Headers */, - 46A1702C1807CBFE005B8026 /* CCApplicationProtocol.h in Headers */, + 50ABBECA1925AB6F00A911A9 /* firePngData.h in Headers */, + 50ABBE401925AB6F00A911A9 /* CCDataVisitor.h in Headers */, 1A570064180BC5A10088DEC7 /* CCAction.h in Headers */, 06CAAACE186AD7FA0012A414 /* TriggerBase.h in Headers */, - 500DC9AD19106300007B91BF /* ZipUtils.h in Headers */, + 503DD8EC1926736A00CD74DD /* CCGLView.h in Headers */, 50FCEBC218C72017004AD434 /* TextFieldReader.h in Headers */, + 50ABBEBA1925AB6F00A911A9 /* ccUTF8.h in Headers */, 1A570068180BC5A10088DEC7 /* CCActionCamera.h in Headers */, 1A57006C180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */, 5034CA3A191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */, + 50ABBEC41925AB6F00A911A9 /* CCVector.h in Headers */, + 50ABBE501925AB6F00A911A9 /* CCEventCustom.h in Headers */, 1A570070180BC5A10088DEC7 /* CCActionEase.h in Headers */, 1A570074180BC5A10088DEC7 /* CCActionGrid.h in Headers */, B37510841823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */, 5034CA46191D591100CE6051 /* ccShader_Label_outline.frag in Headers */, 1A570078180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */, + 50ABBD631925AB0000A911A9 /* Vec4.h in Headers */, 1A01C68918F57BE800EFE3A6 /* CCBool.h in Headers */, 1A57007C180BC5A10088DEC7 /* CCActionInstant.h in Headers */, + 50ABBE781925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, B37510861823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */, 1A570080180BC5A10088DEC7 /* CCActionInterval.h in Headers */, 1A570084180BC5A10088DEC7 /* CCActionManager.h in Headers */, + 50ABC0141926664800A911A9 /* CCGLViewProtocol.h in Headers */, 1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */, + 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */, 1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */, 2905FA8318CF08D100240AA3 /* UITextAtlas.h in Headers */, 1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */, - 1A0DB7331823827C0025743D /* CCEAGLView.h in Headers */, 1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, 2905FA5118CF08D100240AA3 /* UIHelper.h in Headers */, 1A5700A1180BC5D20088DEC7 /* CCNode.h in Headers */, - 500DC93B19106300007B91BF /* CCConfiguration.h in Headers */, 50FCEB9618C72017004AD434 /* ButtonReader.h in Headers */, 2905FA7118CF08D100240AA3 /* UIRichText.h in Headers */, + 503DD8E41926736A00CD74DD /* CCDirectorCaller.h in Headers */, + 50ABBD8A1925AB4100A911A9 /* CCCustomCommand.h in Headers */, 2905FA6D18CF08D100240AA3 /* UIPageView.h in Headers */, 2905FA7318CF08D100240AA3 /* UIScrollInterface.h in Headers */, + 50ABBE881925AB6F00A911A9 /* ccMacros.h in Headers */, + 50ABC0101926664800A911A9 /* CCFileUtils.h in Headers */, 2905FA4318CF08D100240AA3 /* CocosGUI.h in Headers */, 5034CA30191D591100CE6051 /* ccShader_PositionTexture.vert in Headers */, - 500DC93119106300007B91BF /* base64.h in Headers */, - B2AF2FA018EBAEAE00C5807C /* Quaternion.h in Headers */, 50E6D33718E174130051CA34 /* UIHBox.h in Headers */, 1A570111180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */, 50E6D33F18E174130051CA34 /* UIVBox.h in Headers */, + 50ABBE381925AB6F00A911A9 /* CCConsole.h in Headers */, + 50ABBE8A1925AB6F00A911A9 /* CCMap.h in Headers */, + 503DD8E61926736A00CD74DD /* CCEAGLView.h in Headers */, + 50ABBE4C1925AB6F00A911A9 /* CCEventAcceleration.h in Headers */, + 50ABBD571925AB0000A911A9 /* TransformUtils.h in Headers */, 1A570115180BC8EE0088DEC7 /* CCDrawNode.h in Headers */, 06CAAAC5186AD7E50012A414 /* TriggerObj.h in Headers */, 1A57011E180BC90D0088DEC7 /* CCGrabber.h in Headers */, 1A570122180BC90D0088DEC7 /* CCGrid.h in Headers */, - 500DC8C319105D41007B91BF /* CCRenderCommandPool.h in Headers */, - 5034CA52191D591100CE6051 /* CCGLProgramStateCache.h in Headers */, - 500DC8C719105D41007B91BF /* CCRenderer.h in Headers */, - 500DC98519106300007B91BF /* CCMap.h in Headers */, 50FCEBBA18C72017004AD434 /* TextAtlasReader.h in Headers */, 5034CA2E191D591100CE6051 /* ccShader_PositionTextureA8Color.frag in Headers */, + 50ABBD5B1925AB0000A911A9 /* Vec2.h in Headers */, + 50ABBD411925AB0000A911A9 /* CCMath.h in Headers */, 1A5701A0180BCB590088DEC7 /* CCFont.h in Headers */, + 50ABBD9A1925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */, + 50ABBD3F1925AB0000A911A9 /* CCGeometry.h in Headers */, + 50ABBFFE1926664800A911A9 /* CCFileUtilsApple.h in Headers */, 1A5701A4180BCB590088DEC7 /* CCFontAtlas.h in Headers */, 1A5701A8180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */, - 500DC98919106300007B91BF /* CCNS.h in Headers */, 1A5701B4180BCB590088DEC7 /* CCFontFNT.h in Headers */, 1A5701B8180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */, 1A5701BC180BCB5A0088DEC7 /* CCLabel.h in Headers */, 1A5701C0180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */, + 50ABBE681925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */, 5034CA42191D591100CE6051 /* ccShader_Position_uColor.frag in Headers */, - 500DC97719106300007B91BF /* CCEventListenerTouch.h in Headers */, - 500DC93F19106300007B91BF /* CCConsole.h in Headers */, 1A5701C4180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */, + 50ABBDA61925AB4100A911A9 /* CCQuadCommand.h in Headers */, + 50ABBE9E1925AB6F00A911A9 /* CCRefPtr.h in Headers */, 1A01C69518F57BE800EFE3A6 /* CCFloat.h in Headers */, 1A5701CA180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */, 2905FA7B18CF08D100240AA3 /* UISlider.h in Headers */, 5034CA22191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */, + 50ABBECE1925AB6F00A911A9 /* s3tc.h in Headers */, + 50ABBE901925AB6F00A911A9 /* CCPlatformConfig.h in Headers */, 1A5701CE180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */, - 296CAD251915EC8000C64FBF /* CCEventFocus.h in Headers */, 50FCEBCA18C72017004AD434 /* WidgetReader.h in Headers */, 1A5701E1180BCB8C0088DEC7 /* CCLayer.h in Headers */, 1A5701E5180BCB8C0088DEC7 /* CCScene.h in Headers */, - 500DC92D19106300007B91BF /* atitc.h in Headers */, 1A5701E9180BCB8C0088DEC7 /* CCTransition.h in Headers */, + 50ABBED41925AB6F00A911A9 /* uthash.h in Headers */, 1A5701ED180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */, - 500DC8C119105D41007B91BF /* CCRenderCommand.h in Headers */, 1A5701F1180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */, 1A5701FA180BCBAD0088DEC7 /* CCMenu.h in Headers */, 50FCEBBE18C72017004AD434 /* TextBMFontReader.h in Headers */, 1A5701FE180BCBAD0088DEC7 /* CCMenuItem.h in Headers */, + 50ABC00C1926664800A911A9 /* CCDevice.h in Headers */, 1A570205180BCBD40088DEC7 /* CCClippingNode.h in Headers */, 5034CA34191D591100CE6051 /* ccShader_PositionTexture_uColor.frag in Headers */, + 50ABBEA21925AB6F00A911A9 /* CCScheduler.h in Headers */, 1A57020B180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */, 1A570213180BCBF40088DEC7 /* CCProgressTimer.h in Headers */, B37510821823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */, 1A570217180BCBF40088DEC7 /* CCRenderTexture.h in Headers */, 1A570224180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */, - 500DC95F19106300007B91BF /* CCEventKeyboard.h in Headers */, - 500DC95B19106300007B91BF /* CCEventDispatcher.h in Headers */, + 503DD8F61926B0DB00CD74DD /* CCIMEDelegate.h in Headers */, 373B912A187891FB00198F86 /* CCComBase.h in Headers */, - 500DC8D419105F7D007B91BF /* CCAffineTransform.h in Headers */, 1A570228180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */, 1A57022C180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */, 1A570230180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */, 5034CA2C191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */, - 1A570237180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */, + 50ABBE981925AB6F00A911A9 /* CCProtocols.h in Headers */, 2905FA8B18CF08D100240AA3 /* UITextField.h in Headers */, - 500DC96F19106300007B91BF /* CCEventListenerKeyboard.h in Headers */, - 500DC8B519105D41007B91BF /* CCGroupCommand.h in Headers */, 50FCEBA618C72017004AD434 /* ListViewReader.h in Headers */, - 500DC9B919106E6D007B91BF /* TransformUtils.h in Headers */, + 50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */, + 50ABBE441925AB6F00A911A9 /* CCDirector.h in Headers */, 5034CA4A191D591100CE6051 /* ccShader_Label_df.frag in Headers */, - 500DC99119106300007B91BF /* CCRef.h in Headers */, 1A570281180BCC900088DEC7 /* CCSprite.h in Headers */, 1A570285180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */, 1A570289180BCC900088DEC7 /* CCSpriteFrame.h in Headers */, + 50ABBE701925AB6F00A911A9 /* CCEventListenerKeyboard.h in Headers */, 1A57028D180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */, 1A570295180BCCAB0088DEC7 /* CCAnimation.h in Headers */, + 50ABBDB81925AB4100A911A9 /* CCTexture2D.h in Headers */, + 50ABBE341925AB6F00A911A9 /* CCConfiguration.h in Headers */, 1A570299180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */, - 1A5702B2180BCDBC0088DEC7 /* ccUTF8.h in Headers */, - 1A5702B8180BCDF40088DEC7 /* CCVertex.h in Headers */, 06CAAAD2186AD8030012A414 /* ObjectFactory.h in Headers */, - 1A5702BB180BCDFC0088DEC7 /* ccUtils.h in Headers */, - 1A5702C1180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */, + 50ABBEAA1925AB6F00A911A9 /* CCTouch.h in Headers */, 2905FA6918CF08D100240AA3 /* UILoadingBar.h in Headers */, + 50ABBE741925AB6F00A911A9 /* CCEventListenerMouse.h in Headers */, 2905FA8F18CF08D100240AA3 /* UIWidget.h in Headers */, - 1A5702C5180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */, - 5034CA1E191D591100CE6051 /* CCGLProgramCache.h in Headers */, 50FCEB9A18C72017004AD434 /* CheckBoxReader.h in Headers */, - 500DC8AD19105D41007B91BF /* CCBatchCommand.h in Headers */, 1A5702CB180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */, 2905FA7F18CF08D100240AA3 /* UIText.h in Headers */, - 1A5702D6180BCE570088DEC7 /* CCTexture2D.h in Headers */, - 1A5702DA180BCE570088DEC7 /* CCTextureAtlas.h in Headers */, - 1A5702DE180BCE570088DEC7 /* CCTextureCache.h in Headers */, 1A5702ED180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */, - 500DC99F19106300007B91BF /* CCValue.h in Headers */, 1A5702F1180BCE750088DEC7 /* CCTMXLayer.h in Headers */, 5034CA44191D591100CE6051 /* ccShader_Label.vert in Headers */, 1A5702F5180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */, 1A5702F9180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */, 1AC0269D1914068200FA920D /* ConvertUTF.h in Headers */, - 500DC9A119106300007B91BF /* CCVector.h in Headers */, 1A5702FD180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */, 1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */, + 50ABBE2A1925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */, 1A57030F180BCF190088DEC7 /* CCComponent.h in Headers */, 1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */, 1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */, - 1A57031C180BCF430088DEC7 /* ccCArray.h in Headers */, 2905FA6518CF08D100240AA3 /* UIListView.h in Headers */, 50FCEBAA18C72017004AD434 /* LoadingBarReader.h in Headers */, - B2AF2FA818EBAEAE00C5807C /* Vector3.h in Headers */, - 1A57031E180BCF430088DEC7 /* uthash.h in Headers */, - 500DC98B19106300007B91BF /* CCPlatformConfig.h in Headers */, - 1A570320180BCF430088DEC7 /* utlist.h in Headers */, 50FCEBC618C72017004AD434 /* TextReader.h in Headers */, 2905FA7718CF08D100240AA3 /* UIScrollView.h in Headers */, B375107F1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */, - 1A570327180BCF660088DEC7 /* TGAlib.h in Headers */, - 1A570332180BCFD50088DEC7 /* CCUserDefault.h in Headers */, - 500DC94319106300007B91BF /* CCData.h in Headers */, 1A57034E180BD09B0088DEC7 /* tinyxml2.h in Headers */, 1A570357180BD0B00088DEC7 /* ioapi.h in Headers */, + 50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */, 1A01C69B18F57BE800EFE3A6 /* CCSet.h in Headers */, + 50ABBED61925AB6F00A911A9 /* utlist.h in Headers */, 1A57035B180BD0B00088DEC7 /* unzip.h in Headers */, 5034CA48191D591100CE6051 /* ccShader_Label_normal.frag in Headers */, + 50ABBD531925AB0000A911A9 /* Quaternion.h in Headers */, 1AD71DAC180E26E600808F54 /* CCBAnimationManager.h in Headers */, + 503DD8E81926736A00CD74DD /* CCES2Renderer.h in Headers */, 1AD71DB0180E26E600808F54 /* CCBFileLoader.h in Headers */, + 50ABBE6C1925AB6F00A911A9 /* CCEventListenerFocus.h in Headers */, 1AD71DB4180E26E600808F54 /* CCBKeyframe.h in Headers */, 5034CA3E191D591100CE6051 /* ccShader_PositionColor.frag in Headers */, + 50ABBE301925AB6F00A911A9 /* ccConfig.h in Headers */, + 50ABBDAC1925AB4100A911A9 /* CCRenderCommandPool.h in Headers */, 1AD71DB6180E26E600808F54 /* CCBMemberVariableAssigner.h in Headers */, 1AD71DBA180E26E600808F54 /* CCBReader.h in Headers */, 1AD71DBC180E26E600808F54 /* CCBSelectorResolver.h in Headers */, @@ -5617,42 +5473,54 @@ 1AD71DD0180E26E600808F54 /* CCControlLoader.h in Headers */, 1AD71DD4180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */, 5034CA3C191D591100CE6051 /* ccShader_PositionColor.vert in Headers */, + 50ABC0181926664800A911A9 /* CCImage.h in Headers */, + 50ABBE8E1925AB6F00A911A9 /* CCNS.h in Headers */, + 50ABBEA61925AB6F00A911A9 /* CCScriptSupport.h in Headers */, 46C02E0A18E91123004B7456 /* xxhash.h in Headers */, 5034CA4C191D591100CE6051 /* ccShader_Label_df_glow.frag in Headers */, 50E6D33B18E174130051CA34 /* UIRelativeBox.h in Headers */, + 503DD8EB1926736A00CD74DD /* CCGL.h in Headers */, + 50ABBE3C1925AB6F00A911A9 /* CCData.h in Headers */, 1AD71DD8180E26E600808F54 /* CCLabelTTFLoader.h in Headers */, + 503DD8FA1926B0DB00CD74DD /* CCIMEDispatcher.h in Headers */, 1AD71DDC180E26E600808F54 /* CCLayerColorLoader.h in Headers */, 1AD71DE0180E26E600808F54 /* CCLayerGradientLoader.h in Headers */, 1AD71DE4180E26E600808F54 /* CCLayerLoader.h in Headers */, + 50ABBEC81925AB6F00A911A9 /* etc1.h in Headers */, 1AD71DE8180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */, 50E6D31118DAF01E0051CA34 /* CCProtectedNode.h in Headers */, 1AD71DEC180E26E600808F54 /* CCMenuItemLoader.h in Headers */, 1AD71DEE180E26E600808F54 /* CCMenuLoader.h in Headers */, 1AD71DF2180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */, + 50ABBDB01925AB4100A911A9 /* CCRenderer.h in Headers */, 1AD71DF6180E26E600808F54 /* CCNodeLoader.h in Headers */, + 50ABBD861925AB4100A911A9 /* CCBatchCommand.h in Headers */, 1AD71DFA180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */, - B2AF2FAC18EBAEAE00C5807C /* Vector4.h in Headers */, + 50ABBE481925AB6F00A911A9 /* CCEvent.h in Headers */, 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */, 1AD71DFC180E26E600808F54 /* CCNodeLoaderListener.h in Headers */, 3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */, + 50ABBE641925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */, 1AD71E00180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */, 1AD71E04180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */, 1AD71E08180E26E600808F54 /* CCScrollViewLoader.h in Headers */, 1AD71E0C180E26E600808F54 /* CCSpriteLoader.h in Headers */, + 50ABBD921925AB4100A911A9 /* CCGLProgramCache.h in Headers */, 1AD71E0E180E26E600808F54 /* CocosBuilder.h in Headers */, - 500DC93719106300007B91BF /* ccConfig.h in Headers */, 1AD71E98180E26E600808F54 /* Animation.h in Headers */, 1AD71E9C180E26E600808F54 /* AnimationState.h in Headers */, + 50ABBE961925AB6F00A911A9 /* CCProfiling.h in Headers */, + 503DD8E01926736A00CD74DD /* CCApplication.h in Headers */, + 50ABBD8E1925AB4100A911A9 /* CCGLProgram.h in Headers */, 1AD71EA0180E26E600808F54 /* AnimationStateData.h in Headers */, 50FCEB9E18C72017004AD434 /* ImageViewReader.h in Headers */, - 500DC98119106300007B91BF /* CCEventType.h in Headers */, + 50ABC0081926664800A911A9 /* CCApplicationProtocol.h in Headers */, 1AD71EA4180E26E600808F54 /* Atlas.h in Headers */, 1AD71EA8180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */, 1ABA68B11888D700007D1BB4 /* CCFontCharMap.h in Headers */, + 50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */, 1AD71EAC180E26E600808F54 /* Attachment.h in Headers */, - 500DC94719106300007B91BF /* CCDataVisitor.h in Headers */, 2905FA4918CF08D100240AA3 /* UIButton.h in Headers */, - 500DC96719106300007B91BF /* CCEventListenerAcceleration.h in Headers */, 1AD71EB0180E26E600808F54 /* AttachmentLoader.h in Headers */, 5034CA32191D591100CE6051 /* ccShader_PositionTexture_uColor.vert in Headers */, 1AD71EB4180E26E600808F54 /* Bone.h in Headers */, @@ -5661,95 +5529,98 @@ 1AD71EBC180E26E600808F54 /* CCSkeleton.h in Headers */, 1A01C69718F57BE800EFE3A6 /* CCInteger.h in Headers */, 50FCEBB218C72017004AD434 /* ScrollViewReader.h in Headers */, + 50ABBEBE1925AB6F00A911A9 /* ccUtils.h in Headers */, + 50ABBE801925AB6F00A911A9 /* CCEventTouch.h in Headers */, 1AD71EC0180E26E600808F54 /* CCSkeletonAnimation.h in Headers */, - 500DC94F19106300007B91BF /* CCEvent.h in Headers */, - B2AF2FB218EBBDA100C5807C /* CCMath.h in Headers */, 1AD71EC4180E26E600808F54 /* extension.h in Headers */, 1AD71EC8180E26E600808F54 /* Json.h in Headers */, 1AD71ECC180E26E600808F54 /* RegionAttachment.h in Headers */, + 50ABBDBC1925AB4100A911A9 /* CCTextureAtlas.h in Headers */, 1AD71ED0180E26E600808F54 /* Skeleton.h in Headers */, + 50ABBE541925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, 1AD71ED4180E26E600808F54 /* SkeletonData.h in Headers */, 1AD71ED8180E26E600808F54 /* SkeletonJson.h in Headers */, 1A12775A18DFCC4F0005F345 /* CCTweenFunction.h in Headers */, 1AD71EDC180E26E600808F54 /* Skin.h in Headers */, + 50ABBD5F1925AB0000A911A9 /* Vec3.h in Headers */, 1AD71EE0180E26E600808F54 /* Slot.h in Headers */, 1AD71EE4180E26E600808F54 /* SlotData.h in Headers */, 1AD71EE8180E26E600808F54 /* spine-cocos2dx.h in Headers */, - B2AF2F9C18EBAEAE00C5807C /* Matrix.h in Headers */, 1AD71EEA180E26E600808F54 /* spine.h in Headers */, 1AAF536D180E3374000584C8 /* HttpClient.h in Headers */, 1AAF536F180E3374000584C8 /* HttpRequest.h in Headers */, 1AAF5371180E3374000584C8 /* HttpResponse.h in Headers */, 1AAF5375180E3374000584C8 /* SocketIO.h in Headers */, 1AAF5379180E3374000584C8 /* WebSocket.h in Headers */, + 50ABBE921925AB6F00A911A9 /* CCPlatformMacros.h in Headers */, + 50ABBE821925AB6F00A911A9 /* CCEventType.h in Headers */, 1AAF5852180E40B9000584C8 /* LocalStorage.h in Headers */, - 1A9DCA26180E6955007A3AD4 /* ccFPSImages.h in Headers */, - 5034CA5A191D591100CE6051 /* CCGLProgram.h in Headers */, + 50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */, 1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */, - 1A0DB7321823827C0025743D /* CCGL.h in Headers */, - 1A9DCA2E180E6955007A3AD4 /* CCProtocols.h in Headers */, - 500DC96B19106300007B91BF /* CCEventListenerCustom.h in Headers */, - 1A9DCA3C180E6955007A3AD4 /* firePngData.h in Headers */, 1A01C69F18F57BE800EFE3A6 /* CCString.h in Headers */, - 296CAD2B1915EC9900C64FBF /* CCEventListenerFocus.h in Headers */, 1A01C69118F57BE800EFE3A6 /* CCDictionary.h in Headers */, - 500DC99B19106300007B91BF /* ccTypes.h in Headers */, 1A8C598E180E930E00EF57C3 /* CCActionFrame.h in Headers */, 1A8C5992180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */, 5034CA36191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */, - 5034CA56191D591100CE6051 /* CCGLProgramState.h in Headers */, 1A8C5996180E930E00EF57C3 /* CCActionManagerEx.h in Headers */, 2905FA4D18CF08D100240AA3 /* UICheckBox.h in Headers */, - 500DC9A519106300007B91BF /* etc1.h in Headers */, 1A8C599A180E930E00EF57C3 /* CCActionNode.h in Headers */, 1A8C599E180E930E00EF57C3 /* CCActionObject.h in Headers */, 1A8C59A2180E930E00EF57C3 /* CCArmature.h in Headers */, 1A8C59A6180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */, 2905FA8718CF08D100240AA3 /* UITextBMFont.h in Headers */, - 500DC97F19106300007B91BF /* CCEventTouch.h in Headers */, - B2AF2FA418EBAEAE00C5807C /* Vector2.h in Headers */, 1A8C59AA180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */, 1A8C59AE180E930E00EF57C3 /* CCArmatureDefine.h in Headers */, 1A8C59B2180E930E00EF57C3 /* CCBatchNode.h in Headers */, 1A8C59B6180E930E00EF57C3 /* CCBone.h in Headers */, - 500DC9A919106300007B91BF /* s3tc.h in Headers */, 1A8C59BA180E930E00EF57C3 /* CCColliderDetector.h in Headers */, + 50ABBEAE1925AB6F00A911A9 /* ccTypes.h in Headers */, 1A8C59BE180E930E00EF57C3 /* CCComAttribute.h in Headers */, + 50ABBE261925AB6F00A911A9 /* base64.h in Headers */, 1A8C59C2180E930E00EF57C3 /* CCComAudio.h in Headers */, 1A01C68718F57BE800EFE3A6 /* CCArray.h in Headers */, 1A01C6A718F58F7500EFE3A6 /* CCNotificationCenter.h in Headers */, - 500DC98D19106300007B91BF /* CCPlatformMacros.h in Headers */, 1A8C59C6180E930E00EF57C3 /* CCComController.h in Headers */, + 50ABBEDA1925AB6F00A911A9 /* ZipUtils.h in Headers */, 1A8C59CA180E930E00EF57C3 /* CCComRender.h in Headers */, 1A8C59CE180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */, 1A8C59D2180E930E00EF57C3 /* CCDatas.h in Headers */, + 50ABBDC01925AB4100A911A9 /* CCTextureCache.h in Headers */, ED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */, 1A8C59D6180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */, + 50ABC0201926664800A911A9 /* CCThread.h in Headers */, 1A01C69318F57BE800EFE3A6 /* CCDouble.h in Headers */, + 50ABBE221925AB6F00A911A9 /* atitc.h in Headers */, 1A8C59DA180E930E00EF57C3 /* CCDisplayFactory.h in Headers */, 1A8C59DE180E930E00EF57C3 /* CCDisplayManager.h in Headers */, 50FCEBB618C72017004AD434 /* SliderReader.h in Headers */, - 500DC99719106300007B91BF /* CCScheduler.h in Headers */, - 500DC98319106300007B91BF /* ccMacros.h in Headers */, + 50ABBED21925AB6F00A911A9 /* TGAlib.h in Headers */, 1A01C68D18F57BE800EFE3A6 /* CCDeprecated.h in Headers */, 1A8C59E2180E930E00EF57C3 /* CCInputDelegate.h in Headers */, + 503DD8EA1926736A00CD74DD /* CCESRenderer.h in Headers */, 1A8C59E6180E930E00EF57C3 /* CCProcessBase.h in Headers */, - 500DC96319106300007B91BF /* CCEventListener.h in Headers */, + 50ABBE581925AB6F00A911A9 /* CCEventFocus.h in Headers */, + 50ABC00A1926664800A911A9 /* CCCommon.h in Headers */, 2905FA5918CF08D100240AA3 /* UILayout.h in Headers */, + 50ABBE5C1925AB6F00A911A9 /* CCEventKeyboard.h in Headers */, B375107D1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */, + 50ABC01C1926664800A911A9 /* CCSAXParser.h in Headers */, 2905FA4518CF08D100240AA3 /* GUIDefine.h in Headers */, 1A8C59EA180E930E00EF57C3 /* CCSGUIReader.h in Headers */, + 503DD8F11926736A00CD74DD /* OpenGL_Internal.h in Headers */, 1A8C59EE180E930E00EF57C3 /* CCSkin.h in Headers */, B37510801823ACA100B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */, - 500DC94B19106300007B91BF /* CCDirector.h in Headers */, 50FCEBA218C72017004AD434 /* LayoutReader.h in Headers */, 1A8C59F2180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */, 1A8C59F6180E930E00EF57C3 /* CCSSceneReader.h in Headers */, 1A8C59FA180E930E00EF57C3 /* CCTransformHelp.h in Headers */, + 50ABBDAA1925AB4100A911A9 /* CCRenderCommand.h in Headers */, 1A8C59FE180E930E00EF57C3 /* CCTween.h in Headers */, 1A8C5A06180E930E00EF57C3 /* CCUtilMath.h in Headers */, + 50ABBE601925AB6F00A911A9 /* CCEventListener.h in Headers */, 1A8C5A08180E930E00EF57C3 /* CocoStudio.h in Headers */, 1A8C5A10180E930E00EF57C3 /* DictionaryHelper.h in Headers */, + 50ABBEB21925AB6F00A911A9 /* CCUserDefault.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -6106,70 +5977,64 @@ buildActionMask = 2147483647; files = ( 2AC795DB1862870F005EC8E1 /* SkeletonBounds.cpp in Sources */, + 50ABBE2B1925AB6F00A911A9 /* ccCArray.cpp in Sources */, 2AC795DC1862870F005EC8E1 /* Event.cpp in Sources */, 1A01C68A18F57BE800EFE3A6 /* CCDeprecated.cpp in Sources */, 1A1645B0191B726C008C7C7F /* ConvertUTF.c in Sources */, - 500DC93219106300007B91BF /* CCAutoreleasePool.cpp in Sources */, 2905FA5618CF08D100240AA3 /* UILayout.cpp in Sources */, 2AC795DD1862870F005EC8E1 /* EventData.cpp in Sources */, 2AC795DE1862870F005EC8E1 /* BoundingBoxAttachment.cpp in Sources */, - 46A170501807CC1C005B8026 /* CCApplication.mm in Sources */, + 50ABBD581925AB0000A911A9 /* Vec2.cpp in Sources */, + 50ABBE311925AB6F00A911A9 /* CCConfiguration.cpp in Sources */, 1A01C6A418F58F7500EFE3A6 /* CCNotificationCenter.cpp in Sources */, 46A170EA1807CECA005B8026 /* CCPhysicsJoint.cpp in Sources */, - 46A170141807CBFC005B8026 /* CCFileUtilsApple.mm in Sources */, - 500DC99C19106300007B91BF /* CCValue.cpp in Sources */, 5027253C190BF1B900AAF4ED /* cocos2d.cpp in Sources */, - 500DC95C19106300007B91BF /* CCEventKeyboard.cpp in Sources */, - 46A1701D1807CBFC005B8026 /* CCFileUtils.cpp in Sources */, + 50ABC0611926664800A911A9 /* CCCommon.mm in Sources */, + 50ABBDB11925AB4100A911A9 /* ccShaders.cpp in Sources */, 46A170EF1807CECA005B8026 /* CCPhysicsWorld.cpp in Sources */, - 500DC96C19106300007B91BF /* CCEventListenerKeyboard.cpp in Sources */, - 46A170231807CBFC005B8026 /* CCSAXParser.cpp in Sources */, - B2AF2FA918EBAEAE00C5807C /* Vector4.cpp in Sources */, 46A170ED1807CECA005B8026 /* CCPhysicsShape.cpp in Sources */, - 46A170171807CBFC005B8026 /* CCThread.mm in Sources */, + 50ABBE991925AB6F00A911A9 /* CCRef.cpp in Sources */, ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */, 06CAAACB186AD7F20012A414 /* TriggerMng.cpp in Sources */, - 46A170511807CC1C005B8026 /* CCCommon.mm in Sources */, - 46A1701B1807CBFC005B8026 /* CCGLViewProtocol.cpp in Sources */, - 500DC97019106300007B91BF /* CCEventListenerMouse.cpp in Sources */, 46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */, - 3E26D40818ACB63900834404 /* CCDevice.mm in Sources */, - 46A170151807CBFC005B8026 /* CCLock.cpp in Sources */, - A04583F2189053B500E32FE8 /* CCGLView.cpp in Sources */, + 50ABBDA71925AB4100A911A9 /* CCRenderCommand.cpp in Sources */, + 50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */, + 50ABBEBB1925AB6F00A911A9 /* ccUtils.cpp in Sources */, + 50ABBEB71925AB6F00A911A9 /* ccUTF8.cpp in Sources */, + 50ABBE271925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */, + 50ABBE8B1925AB6F00A911A9 /* CCNS.cpp in Sources */, 46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */, - 46A170251807CBFC005B8026 /* CCThread.cpp in Sources */, 1A570061180BC5A10088DEC7 /* CCAction.cpp in Sources */, - 5034CA4F191D591100CE6051 /* ccGLStateCache.cpp in Sources */, + 50ABBEC51925AB6F00A911A9 /* etc1.cpp in Sources */, 50FCEB9718C72017004AD434 /* CheckBoxReader.cpp in Sources */, 1A570065180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */, - 500DC8BE19105D41007B91BF /* CCRenderCommand.cpp in Sources */, + 50ABBEAB1925AB6F00A911A9 /* ccTypes.cpp in Sources */, 1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */, 1A57006D180BC5A10088DEC7 /* CCActionEase.cpp in Sources */, 2905FA4E18CF08D100240AA3 /* UIHelper.cpp in Sources */, 1A570071180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */, B37510761823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */, - 500DC98619106300007B91BF /* CCNS.cpp in Sources */, + 50ABBFFF1926664800A911A9 /* CCFileUtilsApple.mm in Sources */, 1A570075180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */, B375107A1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */, 1A570079180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */, - B2AF2FA118EBAEAE00C5807C /* Vector2.cpp in Sources */, - 500DC95819106300007B91BF /* CCEventDispatcher.cpp in Sources */, + 50ABBE591925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */, 1A57007D180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */, 1A570081180BC5A10088DEC7 /* CCActionManager.cpp in Sources */, 1A570085180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */, 1A570089180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */, - 296CAD281915EC9900C64FBF /* CCEventListenerFocus.cpp in Sources */, 1A57008D180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, 1A570091180BC5A10088DEC7 /* CCActionTween.cpp in Sources */, - B2AF2F9918EBAEAE00C5807C /* Matrix.cpp in Sources */, - 500DC94419106300007B91BF /* CCDataVisitor.cpp in Sources */, + 50ABBEBF1925AB6F00A911A9 /* CCValue.cpp in Sources */, 1A570098180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */, 1A57009E180BC5D20088DEC7 /* CCNode.cpp in Sources */, 2905FA7418CF08D100240AA3 /* UIScrollView.cpp in Sources */, + 50ABBE651925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */, B37510781823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */, - 500DC97819106300007B91BF /* CCEventMouse.cpp in Sources */, 50FCEBB718C72017004AD434 /* TextAtlasReader.cpp in Sources */, + 50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */, 1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, + 50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 2905FA6618CF08D100240AA3 /* UILoadingBar.cpp in Sources */, 50FCEBA318C72017004AD434 /* ListViewReader.cpp in Sources */, 1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */, @@ -6178,35 +6043,29 @@ 1A57011F180BC90D0088DEC7 /* CCGrid.cpp in Sources */, 50FCEBA718C72017004AD434 /* LoadingBarReader.cpp in Sources */, 06C0F2EF186AD822003594D5 /* ObjectFactory.cpp in Sources */, - 5034CA53191D591100CE6051 /* CCGLProgramStateCache.cpp in Sources */, - 500DC96419106300007B91BF /* CCEventListenerAcceleration.cpp in Sources */, 1A57019D180BCB590088DEC7 /* CCFont.cpp in Sources */, 1A5701A1180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */, 1A5701A5180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */, - 500DC96819106300007B91BF /* CCEventListenerCustom.cpp in Sources */, - 500DC95019106300007B91BF /* CCEventAcceleration.cpp in Sources */, - 5034CA1B191D591100CE6051 /* ccShaders.cpp in Sources */, 1A5701B1180BCB590088DEC7 /* CCFontFNT.cpp in Sources */, 1A5701B5180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */, - 5034CA1F191D591100CE6051 /* CCGLProgramCache.cpp in Sources */, 1A5701B9180BCB5A0088DEC7 /* CCLabel.cpp in Sources */, - 500DC93819106300007B91BF /* CCConfiguration.cpp in Sources */, - 500DC9A619106300007B91BF /* s3tc.cpp in Sources */, 1A5701BD180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */, + 50ABBE551925AB6F00A911A9 /* CCEventFocus.cpp in Sources */, + 50ABBE491925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */, 1A5701C1180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */, + 50ABBD4C1925AB0000A911A9 /* MathUtil.cpp in Sources */, 1A087AE81860400400196EF5 /* edtaa3func.cpp in Sources */, B37510731823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */, + 50ABBD831925AB4100A911A9 /* CCBatchCommand.cpp in Sources */, 1A5701C7180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */, 1A5701CB180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */, + 50ABBE711925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */, 1A5701DE180BCB8C0088DEC7 /* CCLayer.cpp in Sources */, - 500DC99819106300007B91BF /* ccTypes.cpp in Sources */, - 500DC8C419105D41007B91BF /* CCRenderer.cpp in Sources */, 1A5701E2180BCB8C0088DEC7 /* CCScene.cpp in Sources */, 1A12775C18DFCC590005F345 /* CCTweenFunction.cpp in Sources */, - 500DC94019106300007B91BF /* CCData.cpp in Sources */, 1A5701E6180BCB8C0088DEC7 /* CCTransition.cpp in Sources */, 1A5701EA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */, - 500DC9B619106E6D007B91BF /* TransformUtils.cpp in Sources */, + 50ABBDAD1925AB4100A911A9 /* CCRenderer.cpp in Sources */, 1A5701EE180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */, 1A5701F7180BCBAD0088DEC7 /* CCMenu.cpp in Sources */, 1A1645B2191B726C008C7C7F /* ConvertUTFWrapper.cpp in Sources */, @@ -6215,184 +6074,196 @@ 06CAAACF186AD7FC0012A414 /* TriggerBase.cpp in Sources */, 1A570208180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */, 1A570210180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */, + 50ABBDB51925AB4100A911A9 /* CCTexture2D.cpp in Sources */, 1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, + 50ABBE411925AB6F00A911A9 /* CCDirector.cpp in Sources */, 1A570221180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */, 1A570225180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */, 1A570229180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */, 1A57022D180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */, - 500DC9B01910633C007B91BF /* CCTouch.cpp in Sources */, 50FCEB9B18C72017004AD434 /* ImageViewReader.cpp in Sources */, - 500DC9AA19106300007B91BF /* ZipUtils.cpp in Sources */, - 1A570234180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */, 1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */, 1A570282180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */, 1A570286180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */, + 50ABC0191926664800A911A9 /* CCSAXParser.cpp in Sources */, 1A57028A180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */, - 3E26D40518ACB5D100834404 /* CCImage.cpp in Sources */, 1A570292180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */, 1A570296180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */, 2905FA8C18CF08D100240AA3 /* UIWidget.cpp in Sources */, 2905FA8018CF08D100240AA3 /* UITextAtlas.cpp in Sources */, + 50ABBE351925AB6F00A911A9 /* CCConsole.cpp in Sources */, + 50ABBEAF1925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, 50FCEBBB18C72017004AD434 /* TextBMFontReader.cpp in Sources */, + 50ABBE791925AB6F00A911A9 /* CCEventMouse.cpp in Sources */, 50FCEBBF18C72017004AD434 /* TextFieldReader.cpp in Sources */, 50FCEBAF18C72017004AD434 /* ScrollViewReader.cpp in Sources */, - 1A5702AF180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */, - 500DC8D519105F7D007B91BF /* CCGeometry.cpp in Sources */, - 1A5702B5180BCDF40088DEC7 /* CCVertex.cpp in Sources */, - 1A5702C2180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */, + 50ABC0111926664800A911A9 /* CCGLViewProtocol.cpp in Sources */, + 50ABBE3D1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */, + 50ABBE7D1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, 50FCEBAB18C72017004AD434 /* PageViewReader.cpp in Sources */, - 1A5702D3180BCE570088DEC7 /* CCTexture2D.cpp in Sources */, - 1A5702D7180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */, - 1A5702DB180BCE570088DEC7 /* CCTextureCache.cpp in Sources */, 1A5702EA180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */, + 50ABBD971925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */, 1A5702EE180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */, - 500DC97C19106300007B91BF /* CCEventTouch.cpp in Sources */, + 50ABBE691925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */, 1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */, 1A5702F6180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */, 1A5702FA180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, + 50ABBD5C1925AB0000A911A9 /* Vec3.cpp in Sources */, 1A570300180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */, - 1A570305180BCED90088DEC7 /* ccUtils.cpp in Sources */, 1A57030C180BCF190088DEC7 /* CCComponent.cpp in Sources */, - 500DC96019106300007B91BF /* CCEventListener.cpp in Sources */, 1A570310180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */, - 1A570319180BCF430088DEC7 /* ccCArray.cpp in Sources */, B37510711823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */, - 1A570324180BCF660088DEC7 /* TGAlib.cpp in Sources */, 1A01C69C18F57BE800EFE3A6 /* CCString.cpp in Sources */, - 1A57032F180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */, - 1A570333180BCFD50088DEC7 /* CCUserDefault.mm in Sources */, - 1A570335180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */, + 50ABBD3C1925AB0000A911A9 /* CCGeometry.cpp in Sources */, + 50ABC0011926664800A911A9 /* CCLock.cpp in Sources */, 50E6D30E18DADB5D0051CA34 /* CCProtectedNode.cpp in Sources */, - 500DC93C19106300007B91BF /* CCConsole.cpp in Sources */, + 50ABBD931925AB4100A911A9 /* CCGLProgramState.cpp in Sources */, 1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */, 1A570354180BD0B00088DEC7 /* ioapi.cpp in Sources */, 1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */, 1AD71DA9180E26E600808F54 /* CCBAnimationManager.cpp in Sources */, - 500DC95419106300007B91BF /* CCEventCustom.cpp in Sources */, 1AD71DAD180E26E600808F54 /* CCBFileLoader.cpp in Sources */, 50E6D33418E174130051CA34 /* UIHBox.cpp in Sources */, + 50ABBEB31925AB6F00A911A9 /* CCUserDefault.mm in Sources */, 2905FA8418CF08D100240AA3 /* UITextBMFont.cpp in Sources */, 1AD71DB1180E26E600808F54 /* CCBKeyframe.cpp in Sources */, 1AD71DB7180E26E600808F54 /* CCBReader.cpp in Sources */, - B2AF2FA518EBAEAE00C5807C /* Vector3.cpp in Sources */, + 50ABBEB51925AB6F00A911A9 /* CCUserDefaultAndroid.cpp in Sources */, 1AD71DBD180E26E600808F54 /* CCBSequence.cpp in Sources */, 1AD71DC1180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */, 1AD71DC9180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */, 1AD71DCD180E26E600808F54 /* CCControlLoader.cpp in Sources */, + 50ABBE831925AB6F00A911A9 /* ccFPSImages.c in Sources */, 50FCEBC718C72017004AD434 /* WidgetReader.cpp in Sources */, 1AD71DD1180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */, 1AD71DD5180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */, + 50ABBEA71925AB6F00A911A9 /* CCTouch.cpp in Sources */, 1AD71DD9180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */, - 500DC94C19106300007B91BF /* CCEvent.cpp in Sources */, - 500DC8BA19105D41007B91BF /* CCQuadCommand.cpp in Sources */, 1AD71DDD180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */, 1AD71DE1180E26E600808F54 /* CCLayerLoader.cpp in Sources */, 1AD71DE5180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */, + 50ABBD8B1925AB4100A911A9 /* CCGLProgram.cpp in Sources */, 1AD71DE9180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */, + 50ABBDA31925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, 2905FA6A18CF08D100240AA3 /* UIPageView.cpp in Sources */, 06CAAAC7186AD7E90012A414 /* TriggerObj.cpp in Sources */, 1AD71DEF180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */, + 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */, 1AD71DF3180E26E600808F54 /* CCNodeLoader.cpp in Sources */, 1AD71DF7180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */, + 50ABBECB1925AB6F00A911A9 /* s3tc.cpp in Sources */, 1AD71DFD180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */, 50FCEB9318C72017004AD434 /* ButtonReader.cpp in Sources */, - 5034CA57191D591100CE6051 /* CCGLProgramState.cpp in Sources */, 1AD71E01180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */, 1AD71E05180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */, 1AD71E09180E26E600808F54 /* CCSpriteLoader.cpp in Sources */, - 500DC8AE19105D41007B91BF /* CCCustomCommand.cpp in Sources */, - 500DC92A19106300007B91BF /* atitc.cpp in Sources */, + 50ABBD481925AB0000A911A9 /* Mat4.cpp in Sources */, 1AD71E95180E26E600808F54 /* Animation.cpp in Sources */, 1AD71E99180E26E600808F54 /* AnimationState.cpp in Sources */, 1AD71E9D180E26E600808F54 /* AnimationStateData.cpp in Sources */, 1AD71EA1180E26E600808F54 /* Atlas.cpp in Sources */, - 500DC97419106300007B91BF /* CCEventListenerTouch.cpp in Sources */, 1AD71EA5180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */, - 500DC8D119105F7D007B91BF /* CCAffineTransform.cpp in Sources */, + 50ABBD8F1925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */, + 50ABBD441925AB0000A911A9 /* CCVertex.cpp in Sources */, 1AD71EA9180E26E600808F54 /* Attachment.cpp in Sources */, 1AD71EAD180E26E600808F54 /* AttachmentLoader.cpp in Sources */, + 503DD8F71926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */, 1AD71EB1180E26E600808F54 /* Bone.cpp in Sources */, 1AD71EB5180E26E600808F54 /* BoneData.cpp in Sources */, 1AD71EB9180E26E600808F54 /* CCSkeleton.cpp in Sources */, - 500DC8AA19105D41007B91BF /* CCBatchCommand.cpp in Sources */, + 50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 1AD71EBD180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */, 2905FA4018CF08D100240AA3 /* CocosGUI.cpp in Sources */, 1AD71EC1180E26E600808F54 /* extension.cpp in Sources */, + 50ABBE511925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */, + 50ABC0051926664800A911A9 /* CCThread.mm in Sources */, 1AD71EC5180E26E600808F54 /* Json.cpp in Sources */, - B2AF2F9518EBAEAE00C5807C /* MathUtil.cpp in Sources */, 50E6D33C18E174130051CA34 /* UIVBox.cpp in Sources */, 1AD71EC9180E26E600808F54 /* RegionAttachment.cpp in Sources */, 50E6D33818E174130051CA34 /* UIRelativeBox.cpp in Sources */, 1AD71ECD180E26E600808F54 /* Skeleton.cpp in Sources */, 1AD71ED1180E26E600808F54 /* SkeletonData.cpp in Sources */, 1AD71ED5180E26E600808F54 /* SkeletonJson.cpp in Sources */, - 296CAD221915EC8000C64FBF /* CCEventFocus.cpp in Sources */, 1AD71ED9180E26E600808F54 /* Skin.cpp in Sources */, 1AD71EDD180E26E600808F54 /* Slot.cpp in Sources */, 1AD71EE1180E26E600808F54 /* SlotData.cpp in Sources */, 2905FA7818CF08D100240AA3 /* UISlider.cpp in Sources */, 1AD71EE5180E26E600808F54 /* spine-cocos2dx.cpp in Sources */, 1AAF536A180E3374000584C8 /* HttpClient.cpp in Sources */, + 50ABC0631926664800A911A9 /* CCDevice.mm in Sources */, 1AAF5372180E3374000584C8 /* SocketIO.cpp in Sources */, + 50ABBE1F1925AB6F00A911A9 /* atitc.cpp in Sources */, 1AAF5376180E3374000584C8 /* WebSocket.cpp in Sources */, 1A01C69818F57BE800EFE3A6 /* CCSet.cpp in Sources */, 1AAF584F180E40B9000584C8 /* LocalStorage.cpp in Sources */, + 50ABBEA31925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */, + 50ABBE6D1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, 1AAF5853180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */, 2905FA4A18CF08D100240AA3 /* UICheckBox.cpp in Sources */, - 500DC94819106300007B91BF /* CCDirector.cpp in Sources */, - 500DC9BC19106E89007B91BF /* CCProfiling.cpp in Sources */, - 1A9DCA23180E6955007A3AD4 /* ccFPSImages.c in Sources */, 1A9DCA27180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */, - 500DC9A219106300007B91BF /* etc1.cpp in Sources */, 2905FA5E18CF08D100240AA3 /* UILayoutParameter.cpp in Sources */, + 50ABBD541925AB0000A911A9 /* TransformUtils.cpp in Sources */, 1A8C598B180E930E00EF57C3 /* CCActionFrame.cpp in Sources */, + 50ABBD9B1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */, 1A8C598F180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */, + 50ABBDB91925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, 1A8C5993180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */, - B2AF2F9D18EBAEAE00C5807C /* Quaternion.cpp in Sources */, 1A8C5997180E930E00EF57C3 /* CCActionNode.cpp in Sources */, + 50ABBECF1925AB6F00A911A9 /* TGAlib.cpp in Sources */, 50FCEBC318C72017004AD434 /* TextReader.cpp in Sources */, 1A8C599B180E930E00EF57C3 /* CCActionObject.cpp in Sources */, + 50ABBE451925AB6F00A911A9 /* CCEvent.cpp in Sources */, 1A8C599F180E930E00EF57C3 /* CCArmature.cpp in Sources */, 1A8C59A3180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */, 1A8C59A7180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */, 1A8C59AB180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */, 1A8C59AF180E930E00EF57C3 /* CCBatchNode.cpp in Sources */, + 50ABBE611925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, + 50ABBD9F1925AB4100A911A9 /* CCGroupCommand.cpp in Sources */, 1A8C59B3180E930E00EF57C3 /* CCBone.cpp in Sources */, 1A8C59B7180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */, - 5034CA5B191D591100CE6051 /* CCGLProgram.cpp in Sources */, 1A8C59BB180E930E00EF57C3 /* CCComAttribute.cpp in Sources */, + 50ABBD871925AB4100A911A9 /* CCCustomCommand.cpp in Sources */, 1A8C59BF180E930E00EF57C3 /* CCComAudio.cpp in Sources */, 1A8C59C3180E930E00EF57C3 /* CCComController.cpp in Sources */, 2905FA5218CF08D100240AA3 /* UIImageView.cpp in Sources */, + 50ABBDBD1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, 2905FA7C18CF08D100240AA3 /* UIText.cpp in Sources */, 50FCEB9F18C72017004AD434 /* LayoutReader.cpp in Sources */, + 50ABC0211926664800A911A9 /* CCGLView.cpp in Sources */, 1A8C59C7180E930E00EF57C3 /* CCComRender.cpp in Sources */, + 50ABC00D1926664800A911A9 /* CCFileUtils.cpp in Sources */, 1A8C59CB180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */, 1A8C59CF180E930E00EF57C3 /* CCDatas.cpp in Sources */, 1A8C59D3180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */, - 500DC8B219105D41007B91BF /* CCGroupCommand.cpp in Sources */, 50FCEBB318C72017004AD434 /* SliderReader.cpp in Sources */, + 50ABBE4D1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */, + 50ABBE9F1925AB6F00A911A9 /* CCScheduler.cpp in Sources */, + 50ABC0151926664800A911A9 /* CCImage.cpp in Sources */, + 50ABBE231925AB6F00A911A9 /* base64.cpp in Sources */, + 50ABBE5D1925AB6F00A911A9 /* CCEventListener.cpp in Sources */, 1A8C59D7180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */, + 50ABBD601925AB0000A911A9 /* Vec4.cpp in Sources */, 1A8C59DB180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */, 2905FA6218CF08D100240AA3 /* UIListView.cpp in Sources */, 1A8C59DF180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */, - 500DC92E19106300007B91BF /* base64.cpp in Sources */, - 500DC99419106300007B91BF /* CCScheduler.cpp in Sources */, 1A8C59E3180E930E00EF57C3 /* CCProcessBase.cpp in Sources */, - 500DC98E19106300007B91BF /* CCRef.cpp in Sources */, 1A8C59E7180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */, + 50ABC05F1926664800A911A9 /* CCApplication.mm in Sources */, 1A8C59EB180E930E00EF57C3 /* CCSkin.cpp in Sources */, 1A8C59EF180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */, 1A8C59F3180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */, 2905FA6E18CF08D100240AA3 /* UIRichText.cpp in Sources */, 1A01C68E18F57BE800EFE3A6 /* CCDictionary.cpp in Sources */, 1A8C59F7180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */, + 50ABBD381925AB0000A911A9 /* CCAffineTransform.cpp in Sources */, 1A8C59FB180E930E00EF57C3 /* CCTween.cpp in Sources */, 2905FA8818CF08D100240AA3 /* UITextField.cpp in Sources */, 46C02E0718E91123004B7456 /* xxhash.c in Sources */, 1A8C5A03180E930E00EF57C3 /* CCUtilMath.cpp in Sources */, 1A8C5A0D180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */, + 50ABBE931925AB6F00A911A9 /* CCProfiling.cpp in Sources */, 1ABA68AE1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */, 2905FA4618CF08D100240AA3 /* UIButton.cpp in Sources */, ); @@ -6535,7 +6406,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 296CAD291915EC9900C64FBF /* CCEventListenerFocus.cpp in Sources */, 1A01C69918F57BE800EFE3A6 /* CCSet.cpp in Sources */, 1A01C69D18F57BE800EFE3A6 /* CCString.cpp in Sources */, 2986667F18B1B246000E39CA /* CCTweenFunction.cpp in Sources */, @@ -6543,286 +6413,285 @@ 2AC795E418628746005EC8E1 /* Event.cpp in Sources */, 2AC795E518628746005EC8E1 /* EventData.cpp in Sources */, 2AC795E618628746005EC8E1 /* BoundingBoxAttachment.cpp in Sources */, - 46A1703C1807CC07005B8026 /* CCApplication.mm in Sources */, - 500DC93919106300007B91BF /* CCConfiguration.cpp in Sources */, - 500DC92F19106300007B91BF /* base64.cpp in Sources */, - 46A170471807CC07005B8026 /* CCImage.mm in Sources */, - 46A1704B1807CC07005B8026 /* CCEAGLView.mm in Sources */, 46A171001807CECB005B8026 /* CCPhysicsJoint.cpp in Sources */, - 46A170441807CC07005B8026 /* CCES2Renderer.m in Sources */, - 46A170281807CBFE005B8026 /* CCFileUtilsApple.mm in Sources */, - 46A170311807CBFE005B8026 /* CCFileUtils.cpp in Sources */, - 500DC9B719106E6D007B91BF /* TransformUtils.cpp in Sources */, 46A171051807CECB005B8026 /* CCPhysicsWorld.cpp in Sources */, - 46A1703E1807CC07005B8026 /* CCDevice.mm in Sources */, - 500DC9A319106300007B91BF /* etc1.cpp in Sources */, + 50ABBDA01925AB4100A911A9 /* CCGroupCommand.cpp in Sources */, 46A171031807CECB005B8026 /* CCPhysicsShape.cpp in Sources */, + 50ABC0161926664800A911A9 /* CCImage.cpp in Sources */, 1A01C6A518F58F7500EFE3A6 /* CCNotificationCenter.cpp in Sources */, - 46A170371807CBFE005B8026 /* CCSAXParser.cpp in Sources */, - 46A1702B1807CBFE005B8026 /* CCThread.mm in Sources */, 50E6D33918E174130051CA34 /* UIRelativeBox.cpp in Sources */, ED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */, - 46A170401807CC07005B8026 /* CCDirectorCaller.mm in Sources */, 1A01C68F18F57BE800EFE3A6 /* CCDictionary.cpp in Sources */, + 50ABBE561925AB6F00A911A9 /* CCEventFocus.cpp in Sources */, 06CAAACC186AD7F50012A414 /* TriggerMng.cpp in Sources */, - 46A1703D1807CC07005B8026 /* CCCommon.mm in Sources */, + 503DD8E11926736A00CD74DD /* CCApplication.mm in Sources */, + 50ABC01A1926664800A911A9 /* CCSAXParser.cpp in Sources */, + 503DD8EE1926736A00CD74DD /* CCImage.mm in Sources */, 50FCEBC818C72017004AD434 /* WidgetReader.cpp in Sources */, - 46A1702F1807CBFE005B8026 /* CCGLViewProtocol.cpp in Sources */, 46A170FC1807CECB005B8026 /* CCPhysicsBody.cpp in Sources */, - 46A170291807CBFE005B8026 /* CCLock.cpp in Sources */, - 500DC97119106300007B91BF /* CCEventListenerMouse.cpp in Sources */, - 500DC8AB19105D41007B91BF /* CCBatchCommand.cpp in Sources */, - 500DC92B19106300007B91BF /* atitc.cpp in Sources */, + 50ABBD941925AB4100A911A9 /* CCGLProgramState.cpp in Sources */, + 50ABBE281925AB6F00A911A9 /* CCAutoreleasePool.cpp in Sources */, 46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */, - 46A170391807CBFE005B8026 /* CCThread.cpp in Sources */, 3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */, - 46A170421807CC07005B8026 /* CCGLView.mm in Sources */, 1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */, 1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */, 1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */, 1A57006E180BC5A10088DEC7 /* CCActionEase.cpp in Sources */, + 50ABBD8C1925AB4100A911A9 /* CCGLProgram.cpp in Sources */, 1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */, + 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, B37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */, 2905FA8D18CF08D100240AA3 /* UIWidget.cpp in Sources */, + 50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, 50FCEB9818C72017004AD434 /* CheckBoxReader.cpp in Sources */, + 50ABBE6E1925AB6F00A911A9 /* CCEventListenerKeyboard.cpp in Sources */, + 50ABBE461925AB6F00A911A9 /* CCEvent.cpp in Sources */, + 50ABBEA01925AB6F00A911A9 /* CCScheduler.cpp in Sources */, + 50ABBE4E1925AB6F00A911A9 /* CCEventCustom.cpp in Sources */, + 50ABBE761925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, + 50ABBE5A1925AB6F00A911A9 /* CCEventKeyboard.cpp in Sources */, 1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */, - 500DC99D19106300007B91BF /* CCValue.cpp in Sources */, B37510851823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */, + 50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */, 1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */, + 50ABBEC01925AB6F00A911A9 /* CCValue.cpp in Sources */, + 50ABBD591925AB0000A911A9 /* Vec2.cpp in Sources */, + 50ABBE421925AB6F00A911A9 /* CCDirector.cpp in Sources */, 1A57007E180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */, 1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */, - 500DC97519106300007B91BF /* CCEventListenerTouch.cpp in Sources */, 1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */, - 500DC9BD19106E89007B91BF /* CCProfiling.cpp in Sources */, 1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */, 2905FA6F18CF08D100240AA3 /* UIRichText.cpp in Sources */, + 50ABBED81925AB6F00A911A9 /* ZipUtils.cpp in Sources */, 1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */, 1A570092180BC5A10088DEC7 /* CCActionTween.cpp in Sources */, 1A570099180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */, + 50ABBD4D1925AB0000A911A9 /* MathUtil.cpp in Sources */, + 50ABBE3E1925AB6F00A911A9 /* CCDataVisitor.cpp in Sources */, 1A57009F180BC5D20088DEC7 /* CCNode.cpp in Sources */, B37510831823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */, - B2AF2FA618EBAEAE00C5807C /* Vector3.cpp in Sources */, 1A57010F180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, 1A570113180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */, 1A57011C180BC90D0088DEC7 /* CCGrabber.cpp in Sources */, 1A570120180BC90D0088DEC7 /* CCGrid.cpp in Sources */, - 500DC96919106300007B91BF /* CCEventListenerCustom.cpp in Sources */, 06C0F2F0186AD824003594D5 /* ObjectFactory.cpp in Sources */, - 500DC99919106300007B91BF /* ccTypes.cpp in Sources */, 1A57019E180BCB590088DEC7 /* CCFont.cpp in Sources */, + 503DD8E21926736A00CD74DD /* CCCommon.mm in Sources */, 1A5701A2180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */, + 50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */, + 50ABBE241925AB6F00A911A9 /* base64.cpp in Sources */, 1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */, - 500DC96119106300007B91BF /* CCEventListener.cpp in Sources */, 1A5701B2180BCB590088DEC7 /* CCFontFNT.cpp in Sources */, 1A5701B6180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */, + 50ABBEAC1925AB6F00A911A9 /* ccTypes.cpp in Sources */, 1A5701BA180BCB5A0088DEC7 /* CCLabel.cpp in Sources */, 2905FA4B18CF08D100240AA3 /* UICheckBox.cpp in Sources */, 1A5701BE180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */, 1A5701C2180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */, - 500DC97919106300007B91BF /* CCEventMouse.cpp in Sources */, 1A087AE91860400400196EF5 /* edtaa3func.cpp in Sources */, B375107E1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */, - 500DC99519106300007B91BF /* CCScheduler.cpp in Sources */, 1A5701C8180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */, 1A5701CC180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */, 1A5701DF180BCB8C0088DEC7 /* CCLayer.cpp in Sources */, + 50ABBDBE1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, 1A5701E3180BCB8C0088DEC7 /* CCScene.cpp in Sources */, - 500DC95119106300007B91BF /* CCEventAcceleration.cpp in Sources */, - 5034CA5C191D591100CE6051 /* CCGLProgram.cpp in Sources */, - 500DC9B11910633C007B91BF /* CCTouch.cpp in Sources */, + 50ABBD611925AB0000A911A9 /* Vec4.cpp in Sources */, + 50ABBD9C1925AB4100A911A9 /* ccGLStateCache.cpp in Sources */, 1A5701E7180BCB8C0088DEC7 /* CCTransition.cpp in Sources */, + 50ABC01E1926664800A911A9 /* CCThread.cpp in Sources */, 1A5701EB180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */, 1A5701EF180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */, 1A5701F8180BCBAD0088DEC7 /* CCMenu.cpp in Sources */, + 50ABBD511925AB0000A911A9 /* Quaternion.cpp in Sources */, 1A5701FC180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */, 06CAAAD0186AD7FE0012A414 /* TriggerBase.cpp in Sources */, 2905FA4F18CF08D100240AA3 /* UIHelper.cpp in Sources */, + 50ABBD491925AB0000A911A9 /* Mat4.cpp in Sources */, 1A570203180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */, 1A570209180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */, 1A570211180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */, + 503DD8ED1926736A00CD74DD /* CCGLView.mm in Sources */, 50FCEBA818C72017004AD434 /* LoadingBarReader.cpp in Sources */, 1A570215180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, 1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */, - 500DC9AB19106300007B91BF /* ZipUtils.cpp in Sources */, 1A570226180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */, 1A57022A180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */, 1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */, - 1A570235180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */, + 50ABBD901925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */, 2905FA5718CF08D100240AA3 /* UILayout.cpp in Sources */, 2905FA7D18CF08D100240AA3 /* UIText.cpp in Sources */, 50E6D33D18E174130051CA34 /* UIVBox.cpp in Sources */, 1A57027F180BCC900088DEC7 /* CCSprite.cpp in Sources */, - 500DC93319106300007B91BF /* CCAutoreleasePool.cpp in Sources */, 1A570283180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */, 1A570287180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */, 1A57028B180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */, 1A570293180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */, 1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */, 50FCEBC418C72017004AD434 /* TextReader.cpp in Sources */, - 500DC94919106300007B91BF /* CCDirector.cpp in Sources */, - 1A5702B0180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */, 50FCEB9418C72017004AD434 /* ButtonReader.cpp in Sources */, - 500DC8AF19105D41007B91BF /* CCCustomCommand.cpp in Sources */, - 1A5702B6180BCDF40088DEC7 /* CCVertex.cpp in Sources */, - 1A5702C3180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */, + 50ABBE321925AB6F00A911A9 /* CCConfiguration.cpp in Sources */, 1A5702C9180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */, - 1A5702D4180BCE570088DEC7 /* CCTexture2D.cpp in Sources */, - 1A5702D8180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */, - 1A5702DC180BCE570088DEC7 /* CCTextureCache.cpp in Sources */, 1A5702EB180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */, 1A5702EF180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */, 1A5702F3180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */, + 50ABBD3D1925AB0000A911A9 /* CCGeometry.cpp in Sources */, + 50ABBECC1925AB6F00A911A9 /* s3tc.cpp in Sources */, 50E6D31018DAF01A0051CA34 /* CCProtectedNode.cpp in Sources */, 1A5702F7180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */, + 50ABBEC61925AB6F00A911A9 /* etc1.cpp in Sources */, + 50ABBE8C1925AB6F00A911A9 /* CCNS.cpp in Sources */, + 50ABBDAE1925AB4100A911A9 /* CCRenderer.cpp in Sources */, + 50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */, 1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, - 500DC8B319105D41007B91BF /* CCGroupCommand.cpp in Sources */, 2905FA6B18CF08D100240AA3 /* UIPageView.cpp in Sources */, - 500DC95519106300007B91BF /* CCEventCustom.cpp in Sources */, 1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */, - 1A570306180BCED90088DEC7 /* ccUtils.cpp in Sources */, 1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */, 1A570311180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */, - 296CAD231915EC8000C64FBF /* CCEventFocus.cpp in Sources */, - 1A57031A180BCF430088DEC7 /* ccCArray.cpp in Sources */, + 50ABBE2C1925AB6F00A911A9 /* ccCArray.cpp in Sources */, + 50ABC0061926664800A911A9 /* CCThread.mm in Sources */, B375107C1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */, 50FCEBB418C72017004AD434 /* SliderReader.cpp in Sources */, - 1A570325180BCF660088DEC7 /* TGAlib.cpp in Sources */, - 1A570330180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */, - 1A570334180BCFD50088DEC7 /* CCUserDefault.mm in Sources */, - 1A570336180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */, - 500DC95919106300007B91BF /* CCEventDispatcher.cpp in Sources */, + 50ABBEB61925AB6F00A911A9 /* CCUserDefaultAndroid.cpp in Sources */, 1A57034C180BD09B0088DEC7 /* tinyxml2.cpp in Sources */, + 50ABBDB61925AB4100A911A9 /* CCTexture2D.cpp in Sources */, 1A570355180BD0B00088DEC7 /* ioapi.cpp in Sources */, 1A570359180BD0B00088DEC7 /* unzip.cpp in Sources */, - 500DC96519106300007B91BF /* CCEventListenerAcceleration.cpp in Sources */, - 500DC94D19106300007B91BF /* CCEvent.cpp in Sources */, 1AD71DAA180E26E600808F54 /* CCBAnimationManager.cpp in Sources */, + 50ABBD881925AB4100A911A9 /* CCCustomCommand.cpp in Sources */, + 50ABBE941925AB6F00A911A9 /* CCProfiling.cpp in Sources */, 1AD71DAE180E26E600808F54 /* CCBFileLoader.cpp in Sources */, 1AD71DB2180E26E600808F54 /* CCBKeyframe.cpp in Sources */, 1AD71DB8180E26E600808F54 /* CCBReader.cpp in Sources */, - 500DC8C519105D41007B91BF /* CCRenderer.cpp in Sources */, 1AD71DBE180E26E600808F54 /* CCBSequence.cpp in Sources */, 1AD71DC2180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */, 1AD71DCA180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */, - 500DC9A719106300007B91BF /* s3tc.cpp in Sources */, 1AD71DCE180E26E600808F54 /* CCControlLoader.cpp in Sources */, 1AD71DD2180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */, - B2AF2F9618EBAEAE00C5807C /* MathUtil.cpp in Sources */, - B2AF2F9A18EBAEAE00C5807C /* Matrix.cpp in Sources */, + 50ABBE5E1925AB6F00A911A9 /* CCEventListener.cpp in Sources */, 1AD71DD6180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */, 1AD71DDA180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */, 50FCEBC018C72017004AD434 /* TextFieldReader.cpp in Sources */, 1AD71DDE180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */, 1AD71DE2180E26E600808F54 /* CCLayerLoader.cpp in Sources */, 1AD71DE6180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */, + 50ABBEA81925AB6F00A911A9 /* CCTouch.cpp in Sources */, 1AD71DEA180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */, 06CAAAC8186AD7EB0012A414 /* TriggerObj.cpp in Sources */, 1AD71DF0180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */, + 503DD8E91926736A00CD74DD /* CCES2Renderer.m in Sources */, 5027253D190BF1B900AAF4ED /* cocos2d.cpp in Sources */, - 5034CA50191D591100CE6051 /* ccGLStateCache.cpp in Sources */, + 50ABBE6A1925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */, + 50ABBE661925AB6F00A911A9 /* CCEventListenerCustom.cpp in Sources */, 1AD71DF4180E26E600808F54 /* CCNodeLoader.cpp in Sources */, + 503DD8F81926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */, 1AD71DF8180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */, 1AD71DFE180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */, - 5034CA54191D591100CE6051 /* CCGLProgramStateCache.cpp in Sources */, 1AD71E02180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */, 1AD71E06180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */, 1AD71E0A180E26E600808F54 /* CCSpriteLoader.cpp in Sources */, 1AD71E96180E26E600808F54 /* Animation.cpp in Sources */, 1AD71E9A180E26E600808F54 /* AnimationState.cpp in Sources */, 1AD71E9E180E26E600808F54 /* AnimationStateData.cpp in Sources */, + 50ABBDB21925AB4100A911A9 /* ccShaders.cpp in Sources */, 1AD71EA2180E26E600808F54 /* Atlas.cpp in Sources */, 1AD71EA6180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */, 1AD71EAA180E26E600808F54 /* Attachment.cpp in Sources */, 1AD71EAE180E26E600808F54 /* AttachmentLoader.cpp in Sources */, 1AD71EB2180E26E600808F54 /* Bone.cpp in Sources */, + 50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */, 2905FA8118CF08D100240AA3 /* UITextAtlas.cpp in Sources */, + 50ABBEB01925AB6F00A911A9 /* CCUserDefault.cpp in Sources */, 50FCEBB818C72017004AD434 /* TextAtlasReader.cpp in Sources */, 1AD71EB6180E26E600808F54 /* BoneData.cpp in Sources */, - 500DC8D619105F7D007B91BF /* CCGeometry.cpp in Sources */, 50FCEB9C18C72017004AD434 /* ImageViewReader.cpp in Sources */, + 50ABBE521925AB6F00A911A9 /* CCEventDispatcher.cpp in Sources */, 1AD71EBA180E26E600808F54 /* CCSkeleton.cpp in Sources */, 1A01C68B18F57BE800EFE3A6 /* CCDeprecated.cpp in Sources */, 1AD71EBE180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */, - 500DC94119106300007B91BF /* CCData.cpp in Sources */, 50FCEBBC18C72017004AD434 /* TextBMFontReader.cpp in Sources */, - 500DC8BB19105D41007B91BF /* CCQuadCommand.cpp in Sources */, + 50ABBD391925AB0000A911A9 /* CCAffineTransform.cpp in Sources */, + 50ABBD841925AB4100A911A9 /* CCBatchCommand.cpp in Sources */, 1AD71EC2180E26E600808F54 /* extension.cpp in Sources */, 1AD71EC6180E26E600808F54 /* Json.cpp in Sources */, 1AD71ECA180E26E600808F54 /* RegionAttachment.cpp in Sources */, 1AD71ECE180E26E600808F54 /* Skeleton.cpp in Sources */, 1AD71ED2180E26E600808F54 /* SkeletonData.cpp in Sources */, - 500DC97D19106300007B91BF /* CCEventTouch.cpp in Sources */, 1AD71ED6180E26E600808F54 /* SkeletonJson.cpp in Sources */, + 50ABBDA81925AB4100A911A9 /* CCRenderCommand.cpp in Sources */, 2905FA6718CF08D100240AA3 /* UILoadingBar.cpp in Sources */, 2905FA5F18CF08D100240AA3 /* UILayoutParameter.cpp in Sources */, 1AD71EDA180E26E600808F54 /* Skin.cpp in Sources */, + 50ABBEA41925AB6F00A911A9 /* CCScriptSupport.cpp in Sources */, 1AD71EDE180E26E600808F54 /* Slot.cpp in Sources */, 1AD71EE2180E26E600808F54 /* SlotData.cpp in Sources */, + 503DD8E71926736A00CD74DD /* CCEAGLView.mm in Sources */, 1AD71EE6180E26E600808F54 /* spine-cocos2dx.cpp in Sources */, 2905FA8518CF08D100240AA3 /* UITextBMFont.cpp in Sources */, 1AAF536B180E3374000584C8 /* HttpClient.cpp in Sources */, - 3E26D40618ACB5D100834404 /* CCImage.cpp in Sources */, 1AAF5373180E3374000584C8 /* SocketIO.cpp in Sources */, - 500DC94519106300007B91BF /* CCDataVisitor.cpp in Sources */, - B2AF2FAA18EBAEAE00C5807C /* Vector4.cpp in Sources */, 1AAF5377180E3374000584C8 /* WebSocket.cpp in Sources */, - 500DC93D19106300007B91BF /* CCConsole.cpp in Sources */, + 50ABBDA41925AB4100A911A9 /* CCQuadCommand.cpp in Sources */, 1AAF5850180E40B9000584C8 /* LocalStorage.cpp in Sources */, - 5034CA58191D591100CE6051 /* CCGLProgramState.cpp in Sources */, 1AAF5854180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */, - 1A9DCA24180E6955007A3AD4 /* ccFPSImages.c in Sources */, 1A9DCA28180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */, + 50ABBE201925AB6F00A911A9 /* atitc.cpp in Sources */, 50FCEBA018C72017004AD434 /* LayoutReader.cpp in Sources */, 50E6D33518E174130051CA34 /* UIHBox.cpp in Sources */, - 5034CA1C191D591100CE6051 /* ccShaders.cpp in Sources */, - 500DC98F19106300007B91BF /* CCRef.cpp in Sources */, 50FCEBB018C72017004AD434 /* ScrollViewReader.cpp in Sources */, + 50ABBE9A1925AB6F00A911A9 /* CCRef.cpp in Sources */, + 50ABBE361925AB6F00A911A9 /* CCConsole.cpp in Sources */, + 503DD8E51926736A00CD74DD /* CCDirectorCaller.mm in Sources */, + 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */, + 50ABC0121926664800A911A9 /* CCGLViewProtocol.cpp in Sources */, + 50ABC0021926664800A911A9 /* CCLock.cpp in Sources */, 50FCEBAC18C72017004AD434 /* PageViewReader.cpp in Sources */, 1A8C598C180E930E00EF57C3 /* CCActionFrame.cpp in Sources */, 1A8C5990180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */, 50FCEBA418C72017004AD434 /* ListViewReader.cpp in Sources */, 1A8C5994180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */, + 50ABBEBC1925AB6F00A911A9 /* ccUtils.cpp in Sources */, + 50ABBE721925AB6F00A911A9 /* CCEventListenerMouse.cpp in Sources */, 1A8C5998180E930E00EF57C3 /* CCActionNode.cpp in Sources */, 1A8C599C180E930E00EF57C3 /* CCActionObject.cpp in Sources */, 2905FA6318CF08D100240AA3 /* UIListView.cpp in Sources */, 1A8C59A0180E930E00EF57C3 /* CCArmature.cpp in Sources */, + 50ABC0001926664800A911A9 /* CCFileUtilsApple.mm in Sources */, 2905FA7918CF08D100240AA3 /* UISlider.cpp in Sources */, 1A8C59A4180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */, 1A8C59A8180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */, 2905FA8918CF08D100240AA3 /* UITextField.cpp in Sources */, 1A8C59AC180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */, - 500DC98719106300007B91BF /* CCNS.cpp in Sources */, + 50ABBEB81925AB6F00A911A9 /* ccUTF8.cpp in Sources */, 1A8C59B0180E930E00EF57C3 /* CCBatchNode.cpp in Sources */, + 50ABBE841925AB6F00A911A9 /* ccFPSImages.c in Sources */, 1A8C59B4180E930E00EF57C3 /* CCBone.cpp in Sources */, 1A8C59B8180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */, 1A8C59BC180E930E00EF57C3 /* CCComAttribute.cpp in Sources */, - 500DC8BF19105D41007B91BF /* CCRenderCommand.cpp in Sources */, + 50ABBE4A1925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */, 1A8C59C0180E930E00EF57C3 /* CCComAudio.cpp in Sources */, - B2AF2F9E18EBAEAE00C5807C /* Quaternion.cpp in Sources */, 1A8C59C4180E930E00EF57C3 /* CCComController.cpp in Sources */, 1A8C59C8180E930E00EF57C3 /* CCComRender.cpp in Sources */, 1A8C59CC180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */, 1A8C59D0180E930E00EF57C3 /* CCDatas.cpp in Sources */, 1A8C59D4180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */, - 500DC96D19106300007B91BF /* CCEventListenerKeyboard.cpp in Sources */, 1A8C59D8180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */, 46C02E0818E91123004B7456 /* xxhash.c in Sources */, - 500DC95D19106300007B91BF /* CCEventKeyboard.cpp in Sources */, + 50ABBED01925AB6F00A911A9 /* TGAlib.cpp in Sources */, 2905FA4118CF08D100240AA3 /* CocosGUI.cpp in Sources */, - 5034CA20191D591100CE6051 /* CCGLProgramCache.cpp in Sources */, 1A01C68518F57BE800EFE3A6 /* CCArray.cpp in Sources */, 1A8C59DC180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */, 1A8C59E0180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */, 1A8C59E4180E930E00EF57C3 /* CCProcessBase.cpp in Sources */, + 503DD8E31926736A00CD74DD /* CCDevice.mm in Sources */, 1A8C59E8180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */, 1A8C59EC180E930E00EF57C3 /* CCSkin.cpp in Sources */, 2905FA4718CF08D100240AA3 /* UIButton.cpp in Sources */, 1A8C59F0180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */, + 50ABBEB41925AB6F00A911A9 /* CCUserDefault.mm in Sources */, 1A1645B1191B726C008C7C7F /* ConvertUTF.c in Sources */, - B2AF2FA218EBAEAE00C5807C /* Vector2.cpp in Sources */, - 500DC8D219105F7D007B91BF /* CCAffineTransform.cpp in Sources */, 1A8C59F4180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */, 1A8C59F8180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */, + 50ABBE3A1925AB6F00A911A9 /* CCData.cpp in Sources */, 1A8C59FC180E930E00EF57C3 /* CCTween.cpp in Sources */, 2905FA5318CF08D100240AA3 /* UIImageView.cpp in Sources */, 1A1645B3191B726C008C7C7F /* ConvertUTFWrapper.cpp in Sources */, @@ -6830,6 +6699,8 @@ 2905FA7518CF08D100240AA3 /* UIScrollView.cpp in Sources */, 1A8C5A0E180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */, 1ABA68AF1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */, + 50ABBE7A1925AB6F00A911A9 /* CCEventMouse.cpp in Sources */, + 50ABBD981925AB4100A911A9 /* CCGLProgramStateCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7109,7 +6980,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "../cocos/2d/cocos2dx-Prefix.pch"; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_MAC, @@ -7126,7 +6997,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop"; }; name = Debug; }; @@ -7135,7 +7006,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "../cocos/2d/cocos2dx-Prefix.pch"; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_KEYBOARD_SUPPORT, @@ -7152,7 +7023,7 @@ "\"$(SRCROOT)/../external/freetype2/prebuilt/mac\"", "\"$(SRCROOT)/../external/websockets/prebuilt/mac\"", ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop"; }; name = Release; }; @@ -7215,7 +7086,6 @@ "$(inherited)", "/Applications/Xcode\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", ); - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/ $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/ui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external/Box2D $(SRCROOT)/../external $(SRCROOT)/../cocos/storage"; }; name = Debug; }; @@ -7226,7 +7096,6 @@ "$(inherited)", "/Applications/Xcode\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", ); - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/ $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/ui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external/Box2D $(SRCROOT)/../external $(SRCROOT)/../cocos/storage"; }; name = Release; }; @@ -7236,7 +7105,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; HEADER_SEARCH_PATHS = ""; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac"; }; name = Debug; }; @@ -7246,7 +7115,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; GCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC; HEADER_SEARCH_PATHS = ""; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac"; }; name = Release; }; @@ -7261,7 +7130,7 @@ ); HEADER_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = "$(inherited)"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; }; name = Debug; }; @@ -7276,7 +7145,7 @@ ); HEADER_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = "$(inherited)"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../cocos/platform/desktop $(SRCROOT)/../external/glfw3/include/mac"; }; name = Release; }; @@ -7286,7 +7155,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "../cocos/2d/cocos2dx-Prefix.pch"; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_IPHONE, @@ -7314,7 +7183,7 @@ ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; }; name = Debug; }; @@ -7324,7 +7193,7 @@ ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "../cocos/2d/cocos2dx-Prefix.pch"; + GCC_PREFIX_HEADER = "../cocos/cocos2d-prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", CC_TARGET_OS_IPHONE, @@ -7352,7 +7221,7 @@ ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; }; name = Release; }; @@ -7390,7 +7259,7 @@ LIBRARY_SEARCH_PATHS = "$(inherited)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/curl/include/ios"; }; name = Debug; }; @@ -7408,7 +7277,7 @@ LIBRARY_SEARCH_PATHS = "$(inherited)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external/curl/include/ios"; }; name = Release; }; @@ -7485,7 +7354,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios"; }; name = Debug; }; @@ -7502,7 +7371,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios"; }; name = Release; }; diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index c13c8fd7bd..11c134ac8a 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -5228,7 +5228,7 @@ CC_TARGET_OS_MAC, ); INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-empty-test/proj.mac/Info.plist"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; }; name = Debug; }; @@ -5242,7 +5242,7 @@ CC_TARGET_OS_MAC, ); INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-empty-test/proj.mac/Info.plist"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5262,7 +5262,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; }; name = Debug; }; @@ -5281,7 +5281,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5298,7 +5298,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; }; name = Debug; }; @@ -5314,7 +5314,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5331,7 +5331,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; }; name = Debug; }; @@ -5347,7 +5347,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5367,7 +5367,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; }; name = Debug; }; @@ -5386,7 +5386,7 @@ "-image_base", 100000000, ); - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5405,7 +5405,7 @@ PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; }; name = Debug; }; @@ -5423,7 +5423,7 @@ PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5437,7 +5437,7 @@ CC_TARGET_OS_MAC, ); INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-tests/proj.mac/Info.plist"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; }; name = Debug; }; @@ -5450,7 +5450,7 @@ CC_TARGET_OS_MAC, ); INFOPLIST_FILE = "$(SRCROOT)/../tests/cpp-tests/proj.mac/Info.plist"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/mac $(SRCROOT)/../external/glfw3/include/mac"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -5497,7 +5497,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; }; name = Debug; }; @@ -5513,7 +5513,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../cocos/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios"; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/cocos/2d/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp index 437cbd6178..6f3aec7b8b 100644 --- a/cocos/2d/CCActionGrid.cpp +++ b/cocos/2d/CCActionGrid.cpp @@ -23,10 +23,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #include "2d/CCActionGrid.h" -#include "base/CCDirector.h" + #include "2d/CCGrid.h" #include "2d/CCNodeGrid.h" +#include "base/CCDirector.h" NS_CC_BEGIN // implementation of GridAction diff --git a/cocos/2d/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp index 6a2a5e4a0b..1b5372520a 100644 --- a/cocos/2d/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -28,7 +28,7 @@ #include "2d/CCActionInstant.h" #include "2d/CCNode.h" #include "2d/CCSprite.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index 564c24c4d5..d1b3a9dd46 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -28,13 +28,14 @@ THE SOFTWARE. #ifndef __ACTION_CCINTERVAL_ACTION_H__ #define __ACTION_CCINTERVAL_ACTION_H__ +#include + #include "2d/CCNode.h" #include "2d/CCAction.h" -#include "2d/CCProtocols.h" #include "2d/CCSpriteFrame.h" #include "2d/CCAnimation.h" +#include "base/CCProtocols.h" #include "base/CCVector.h" -#include NS_CC_BEGIN diff --git a/cocos/2d/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp index 98be24d3ee..0fb432a912 100644 --- a/cocos/2d/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -30,8 +30,8 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "base/CCScheduler.h" #include "base/ccMacros.h" -#include "2d/ccCArray.h" -#include "2d/uthash.h" +#include "base/ccCArray.h" +#include "base/uthash.h" NS_CC_BEGIN // diff --git a/cocos/2d/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp index d95b0816f6..335288b675 100644 --- a/cocos/2d/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "2d/CCAnimation.h" -#include "2d/CCTextureCache.h" -#include "2d/CCTexture2D.h" -#include "base/ccMacros.h" #include "2d/CCSpriteFrame.h" +#include "renderer/CCTextureCache.h" +#include "renderer/CCTexture2D.h" +#include "base/ccMacros.h" #include "base/CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index e1e922d8ae..fcbe96d501 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "2d/CCAnimation.h" #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteFrameCache.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "deprecated/CCString.h" using namespace std; diff --git a/cocos/2d/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp index 8c1ac25ebf..cc750ff187 100644 --- a/cocos/2d/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -26,10 +26,10 @@ THE SOFTWARE. ****************************************************************************/ #include "CCAtlasNode.h" -#include "2d/CCTextureAtlas.h" -#include "2d/CCTextureCache.h" +#include "renderer/CCTextureAtlas.h" #include "base/CCDirector.h" #include "base/CCDirector.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" diff --git a/cocos/2d/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h index cdcda77bc6..9fa995488d 100644 --- a/cocos/2d/CCAtlasNode.h +++ b/cocos/2d/CCAtlasNode.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __CCATLAS_NODE_H__ #include "2d/CCNode.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" #include "base/ccTypes.h" #include "renderer/CCQuadCommand.h" diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index 1c71ce4a70..22ae3e915c 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCComponent.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" NS_CC_BEGIN diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index fac789b3b0..c52db45b3c 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CC_FRAMEWORK_COMPONENT_H__ #include "base/CCRef.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #include NS_CC_BEGIN diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 8e18fc4a66..1561df741f 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCFont.h" -#include "ccUTF8.h" +#include "2d/CCFont.h" +#include "base/ccUTF8.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index fd3425c4fa..18153676af 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -25,7 +25,7 @@ #include "2d/CCFontAtlas.h" #include "2d/CCFontFreeType.h" -#include "ccUTF8.h" +#include "base/ccUTF8.h" #include "base/CCDirector.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" diff --git a/cocos/2d/CCFontCharMap.cpp b/cocos/2d/CCFontCharMap.cpp index 75e802e31e..4438f7a165 100644 --- a/cocos/2d/CCFontCharMap.cpp +++ b/cocos/2d/CCFontCharMap.cpp @@ -25,10 +25,10 @@ #include "CCFontCharMap.h" #include "2d/CCFontAtlas.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" +#include "base/ccUTF8.h" #include "base/CCDirector.h" -#include "2d/CCTextureCache.h" -#include "ccUTF8.h" +#include "renderer/CCTextureCache.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 6e7a9f7364..adae2b9ac3 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -24,15 +24,16 @@ ****************************************************************************/ #include "2d/CCFontFNT.h" -#include "2d/uthash.h" +#include "base/uthash.h" +#include "2d/CCFontAtlas.h" +#include "base/ccUTF8.h" +#include "platform/CCFileUtils.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" -#include "2d/CCFontAtlas.h" #include "base/CCMap.h" +#include "renderer/CCTextureCache.h" + #include "deprecated/CCString.h" -#include "2d/CCTextureCache.h" -#include "ccUTF8.h" -#include "2d/platform/CCFileUtils.h" using namespace std; NS_CC_BEGIN diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 588bb4b4ac..c99269bcdd 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -23,12 +23,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "2d/CCFontFreeType.h" + #include #include -#include "ccUTF8.h" -#include "2d/CCFontFreeType.h" -#include "2d/platform/CCFileUtils.h" +#include "base/ccUTF8.h" +#include "platform/CCFileUtils.h" #include "edtaa3func.h" #include FT_BBOX_H @@ -563,4 +564,4 @@ void FontFreeType::renderCharAt(unsigned char *dest,int posX, int posY, unsigned } } -NS_CC_END \ No newline at end of file +NS_CC_END diff --git a/cocos/2d/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp index f6a633c411..6a4f68acd9 100644 --- a/cocos/2d/CCGrabber.cpp +++ b/cocos/2d/CCGrabber.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGrabber.h" #include "base/ccMacros.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index dc7b879de9..1e43ad7d5b 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" #include "2d/CCGrabber.h" -#include "2d/ccUtils.h" +#include "base/ccUtils.h" #include "2d/CCGrid.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramCache.h" diff --git a/cocos/2d/CCGrid.h b/cocos/2d/CCGrid.h index 9d59f24ce7..4e0c96f68d 100644 --- a/cocos/2d/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include "base/ccTypes.h" #include "base/CCDirector.h" #include "2d/CCNode.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" #ifdef EMSCRIPTEN #include "CCGLBufferedNode.h" #endif // EMSCRIPTEN diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 64439726b2..9372b247fd 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -27,9 +27,9 @@ #include "2d/CCFontAtlasCache.h" #include "2d/CCSprite.h" #include "2d/CCLabelTextFormatter.h" -#include "2d/ccUTF8.h" +#include "base/ccUTF8.h" #include "2d/CCSpriteFrame.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "2d/CCFont.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index ee8b209331..f051917c84 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -25,17 +25,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCLabelAtlas.h" -#include "2d/CCTextureAtlas.h" -#include "2d/CCTextureCache.h" +#include "renderer/CCTextureAtlas.h" #include "2d/CCDrawingPrimitives.h" +#include "platform/CCFileUtils.h" #include "base/ccConfig.h" +#include "base/CCDirector.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgram.h" #include "renderer/ccGLStateCache.h" -#include "base/CCDirector.h" #include "math/TransformUtils.h" -#include "2d/platform/CCFileUtils.h" -// external + #include "deprecated/CCString.h" #if CC_LABELATLAS_DEBUG_DRAW diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index a64ba30140..580e9ff5c8 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -23,10 +23,11 @@ THE SOFTWARE. ****************************************************************************/ +#include "2d/CCLabelTextFormatter.h" + #include -#include "ccUTF8.h" -#include "CCLabelTextFormatter.h" +#include "base/ccUTF8.h" #include "base/CCDirector.h" #include "2d/CCLabel.h" diff --git a/cocos/2d/CCLabelTextFormatter.h b/cocos/2d/CCLabelTextFormatter.h index 2b15b456a6..664310a8b3 100644 --- a/cocos/2d/CCLabelTextFormatter.h +++ b/cocos/2d/CCLabelTextFormatter.h @@ -26,6 +26,8 @@ #ifndef _CCLabelTextFormatter_h_ #define _CCLabelTextFormatter_h_ +#include "base/CCPlatformMacros.h" + NS_CC_BEGIN class Label; diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index de60f31a02..6777dd4c05 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -27,8 +27,8 @@ THE SOFTWARE. #include #include "2d/CCLayer.h" -#include "2d/CCScriptSupport.h" -#include "2d/platform/CCDevice.h" +#include "base/CCScriptSupport.h" +#include "platform/CCDevice.h" #include "2d/CCScene.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index 363d2aab8e..4f8bdb3046 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __CCLAYER_H__ #include "2d/CCNode.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" #include "base/CCEventTouch.h" #ifdef EMSCRIPTEN #include "CCGLBufferedNode.h" diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index 79891fbb9a..ceda096b82 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "2d/CCSprite.h" #include "CCLabelAtlas.h" #include "2d/CCLabel.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #include "deprecated/CCString.h" #include #include diff --git a/cocos/2d/CCMenuItem.h b/cocos/2d/CCMenuItem.h index 6af521c09f..2152046acc 100644 --- a/cocos/2d/CCMenuItem.h +++ b/cocos/2d/CCMenuItem.h @@ -33,7 +33,7 @@ THE SOFTWARE. // cocos2d includes #include "2d/CCNode.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index 09fa33dc68..585ef38cdc 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -23,16 +23,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #include "2d/CCMotionStreak.h" -#include "2d/CCTextureCache.h" -#include "2d/CCVertex.h" +#include "math/CCVertex.h" +#include "base/ccMacros.h" +#include "base/CCDirector.h" +#include "renderer/CCTextureCache.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCCustomCommand.h" #include "renderer/CCRenderer.h" -#include "base/ccMacros.h" -#include "base/CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h index 20cfcf87ef..d4c5a1c47c 100644 --- a/cocos/2d/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCMOTION_STREAK_H__ #define __CCMOTION_STREAK_H__ -#include "2d/CCProtocols.h" -#include "2d/CCTexture2D.h" +#include "base/CCProtocols.h" +#include "renderer/CCTexture2D.h" #include "base/ccTypes.h" #include "2d/CCNode.h" #include "renderer/CCCustomCommand.h" diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 461550ab50..d7451357ac 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -36,10 +36,10 @@ THE SOFTWARE. #include "base/CCEventDispatcher.h" #include "base/CCEvent.h" #include "base/CCEventTouch.h" -#include "2d/ccCArray.h" +#include "base/ccCArray.h" #include "2d/CCGrid.h" #include "2d/CCActionManager.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #include "2d/CCScene.h" #include "2d/CCComponent.h" #include "2d/CCComponentContainer.h" diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index f8a52ca287..e08fa3d779 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -32,11 +32,11 @@ #include "base/ccMacros.h" #include "base/CCEventDispatcher.h" #include "base/CCVector.h" +#include "base/CCScriptSupport.h" +#include "base/CCProtocols.h" #include "math/CCAffineTransform.h" #include "math/CCMath.h" #include "renderer/ccGLStateCache.h" -#include "2d/CCScriptSupport.h" -#include "2d/CCProtocols.h" #include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp index 86f89e867f..89c1480d0d 100644 --- a/cocos/2d/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCParallaxNode.h" -#include "2d/ccCArray.h" +#include "base/ccCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 9b2177fe28..6b19d4457e 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -30,16 +30,16 @@ #include "2d/CCParticleBatchNode.h" -#include "2d/CCTextureCache.h" -#include "2d/CCTextureAtlas.h" +#include "renderer/CCTextureAtlas.h" #include "2d/CCGrid.h" #include "2d/CCParticleSystem.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/CCProfiling.h" #include "base/ccConfig.h" #include "base/ccMacros.h" #include "base/base64.h" #include "base/ZipUtils.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" #include "renderer/ccGLStateCache.h" diff --git a/cocos/2d/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h index 2b6d716a94..a967425fca 100644 --- a/cocos/2d/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -31,7 +31,7 @@ #define __CCPARTICLEBATCHNODE_H__ #include "2d/CCNode.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" #include "renderer/CCBatchCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp index 6498740b76..6869dc79f2 100644 --- a/cocos/2d/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -24,11 +24,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCParticleExamples.h" + +#include "2d/CCParticleExamples.h" +#include "platform/CCImage.h" #include "base/CCDirector.h" -#include "2d/CCTextureCache.h" -#include "firePngData.h" -#include "2d/platform/CCImage.h" +#include "base/firePngData.h" +#include "renderer/CCTextureCache.h" NS_CC_BEGIN // diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index eafe9e19d0..724b196724 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -42,21 +42,21 @@ THE SOFTWARE. // cocos2d uses a another approach, but the results are almost identical. // -#include "CCParticleSystem.h" +#include "2d/CCParticleSystem.h" #include -#include "CCParticleBatchNode.h" +#include "2d/CCParticleBatchNode.h" +#include "renderer/CCTextureAtlas.h" +#include "platform/CCFileUtils.h" +#include "platform/CCImage.h" #include "base/ccTypes.h" -#include "2d/CCTextureCache.h" -#include "2d/CCTextureAtlas.h" #include "base/base64.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/platform/CCImage.h" #include "base/ZipUtils.h" #include "base/CCDirector.h" #include "base/CCProfiling.h" -// opengl +#include "renderer/CCTextureCache.h" + #include "CCGL.h" using namespace std; diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index fc2050b7b4..55d85c3446 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCPARTICLE_SYSTEM_H__ #define __CCPARTICLE_SYSTEM_H__ -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" #include "2d/CCNode.h" #include "base/CCValue.h" #include "deprecated/CCString.h" diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index fc4f5fd779..02d02dfe36 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "2d/CCParticleSystemQuad.h" #include "2d/CCSpriteFrame.h" #include "2d/CCParticleBatchNode.h" -#include "2d/CCTextureAtlas.h" +#include "renderer/CCTextureAtlas.h" #include "base/CCDirector.h" #include "base/CCEventType.h" #include "base/CCConfiguration.h" diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index d3249380fb..d0cbabdf87 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -27,8 +27,8 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "2d/CCTextureCache.h" #include "2d/CCDrawingPrimitives.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" #include "renderer/ccGLStateCache.h" diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 436e07daa8..f11364a019 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -24,27 +24,27 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "base/CCConfiguration.h" #include "2d/CCRenderTexture.h" + +#include "base/ccUtils.h" +#include "platform/CCImage.h" +#include "platform/CCFileUtils.h" +#include "2d/CCGrid.h" +#include "base/CCEventType.h" +#include "base/CCConfiguration.h" +#include "base/CCConfiguration.h" #include "base/CCDirector.h" -#include "2d/platform/CCImage.h" +#include "base/CCEventListenerCustom.h" +#include "base/CCEventDispatcher.h" #include "renderer/CCGLProgram.h" #include "renderer/ccGLStateCache.h" -#include "base/CCConfiguration.h" -#include "2d/ccUtils.h" -#include "2d/CCTextureCache.h" -#include "2d/platform/CCFileUtils.h" -#include "CCGL.h" -#include "base/CCEventType.h" -#include "2d/CCGrid.h" - +#include "renderer/CCTextureCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCGroupCommand.h" #include "renderer/CCCustomCommand.h" -// extern -#include "base/CCEventListenerCustom.h" -#include "base/CCEventDispatcher.h" +#include "CCGL.h" + NS_CC_BEGIN diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index d3f7ece158..47f2c506df 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "2d/CCSprite.h" -#include "2d/platform/CCImage.h" +#include "platform/CCImage.h" #include "renderer/CCGroupCommand.h" #include "renderer/CCCustomCommand.h" diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index a5c2049310..b922554d18 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -26,14 +26,18 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCSprite.h" + +#include +#include + #include "2d/CCSpriteBatchNode.h" #include "2d/CCAnimation.h" #include "2d/CCAnimationCache.h" #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteFrameCache.h" -#include "2d/CCTextureCache.h" #include "2d/CCDrawingPrimitives.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTextureCache.h" +#include "renderer/CCTexture2D.h" #include "renderer/CCGLProgramState.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" @@ -48,8 +52,6 @@ THE SOFTWARE. #include "deprecated/CCString.h" -#include -#include NS_CC_BEGIN diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 38d826fdb6..29935d7404 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -29,8 +29,8 @@ THE SOFTWARE. #define __SPRITE_NODE_CCSPRITE_H__ #include "2d/CCNode.h" -#include "2d/CCProtocols.h" -#include "2d/CCTextureAtlas.h" +#include "base/CCProtocols.h" +#include "renderer/CCTextureAtlas.h" #include "base/ccTypes.h" #include #ifdef EMSCRIPTEN diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 4c44ae543e..474704247c 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -28,15 +28,17 @@ THE SOFTWARE. #include "2d/CCSpriteBatchNode.h" +#include + #include "2d/CCSprite.h" #include "2d/CCGrid.h" #include "2d/CCDrawingPrimitives.h" -#include "2d/CCTextureCache.h" #include "2d/CCLayer.h" #include "2d/CCScene.h" #include "base/ccConfig.h" #include "base/CCDirector.h" #include "base/CCProfiling.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" #include "renderer/ccGLStateCache.h" @@ -46,8 +48,6 @@ THE SOFTWARE. #include "deprecated/CCString.h" // For StringUtils::format -// external -#include NS_CC_BEGIN diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index 6f59a65ba1..6bdbac905d 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -32,9 +32,9 @@ THE SOFTWARE. #include #include "2d/CCNode.h" -#include "2d/CCProtocols.h" -#include "2d/CCTextureAtlas.h" +#include "base/CCProtocols.h" #include "base/ccMacros.h" +#include "renderer/CCTextureAtlas.h" #include "renderer/CCBatchCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index 86f46dc809..51d02c4d73 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -24,7 +24,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/CCTextureCache.h" + +#include "renderer/CCTextureCache.h" #include "2d/CCSpriteFrame.h" #include "base/CCDirector.h" diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index bea7424ba3..9a534fbcdc 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __SPRITE_CCSPRITE_FRAME_H__ #include "2d/CCNode.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" #include "base/CCRef.h" #include "math/CCGeometry.h" diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 4f9cedfa9e..2bd0dcc782 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -27,17 +27,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "base/CCNS.h" -#include "base/ccMacros.h" -#include "2d/CCTextureCache.h" #include "2d/CCSpriteFrameCache.h" + +#include + #include "2d/CCSpriteFrame.h" #include "2d/CCSprite.h" -#include "math/TransformUtils.h" -#include "2d/platform/CCFileUtils.h" -#include "deprecated/CCString.h" +#include "platform/CCFileUtils.h" +#include "base/CCNS.h" +#include "base/ccMacros.h" #include "base/CCDirector.h" -#include +#include "renderer/CCTextureCache.h" +#include "math/TransformUtils.h" + +#include "deprecated/CCString.h" + using namespace std; diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index d4c592e34d..7e01d33e7d 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -36,7 +36,7 @@ THE SOFTWARE. */ #include "2d/CCSpriteFrame.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" #include "base/CCRef.h" #include "base/CCValue.h" #include "base/CCMap.h" diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index 8a61292f57..d763dabbf9 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -24,15 +24,17 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #include "2d/CCTMXLayer.h" + #include "2d/CCTMXXMLParser.h" #include "2d/CCTMXTiledMap.h" #include "2d/CCSprite.h" -#include "2d/CCTextureCache.h" -#include "2d/ccCArray.h" +#include "base/ccCArray.h" +#include "base/CCDirector.h" +#include "renderer/CCTextureCache.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" -#include "base/CCDirector.h" #include "deprecated/CCString.h" // For StringUtils::format diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index 58ffa34db4..2ab316b90e 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "CCAtlasNode.h" #include "2d/CCSpriteBatchNode.h" #include "CCTMXXMLParser.h" -#include "2d/ccCArray.h" +#include "base/ccCArray.h" NS_CC_BEGIN class TMXMapInfo; diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index a2de4100a6..7d42c9c978 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include "CCTMXXMLParser.h" #include "CCTMXTiledMap.h" #include "base/ccMacros.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/ZipUtils.h" #include "base/base64.h" #include "base/CCDirector.h" diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 94621db3b0..dde1c4f535 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -30,7 +30,7 @@ THE SOFTWARE. #define __CC_TM_XML_PARSER__ #include "math/CCGeometry.h" -#include "2d/platform/CCSAXParser.h" +#include "platform/CCSAXParser.h" #include "base/CCVector.h" #include "base/CCValue.h" diff --git a/cocos/2d/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h index 98b3283492..5c4eb4f54d 100644 --- a/cocos/2d/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CC_TEXT_FIELD_H__ #include "2d/CCLabel.h" -#include "2d/CCIMEDelegate.h" +#include "base/CCIMEDelegate.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp index 77f4e7d43f..03b1633ba2 100644 --- a/cocos/2d/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -25,9 +25,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCTileMapAtlas.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/CCTextureAtlas.h" -#include "TGAlib.h" +#include "platform/CCFileUtils.h" +#include "renderer/CCTextureAtlas.h" +#include "base/TGAlib.h" #include "base/ccConfig.h" #include "base/CCDirector.h" #include "deprecated/CCString.h" diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index a164b8a64f..630aa69782 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -2,43 +2,19 @@ if(WIN32) ADD_DEFINITIONS(-DUNICODE -D_UNICODE) -set(COCOS_2D_PLATFORM_SRC - 2d/platform/win32/CCStdC.cpp - 2d/platform/win32/CCFileUtilsWin32.cpp - 2d/platform/win32/CCCommon.cpp - 2d/platform/win32/CCApplication.cpp - 2d/platform/desktop/CCGLView.cpp - 2d/platform/win32/CCDevice.cpp -) - -elseif(APPLE) - -else() - -set(COCOS_2D_PLATFORM_SRC - 2d/platform/linux/CCStdC.cpp - 2d/platform/linux/CCFileUtilsLinux.cpp - 2d/platform/linux/CCCommon.cpp - 2d/platform/linux/CCApplication.cpp - 2d/platform/desktop/CCGLView.cpp - 2d/platform/linux/CCDevice.cpp -) - endif() include_directories( ../external/ConvertUTF ) - set(COCOS_2D_SRC - 2d/ccFPSImages.c - 2d/CCAction.cpp 2d/CCActionCamera.cpp 2d/CCActionCatmullRom.cpp + 2d/CCAction.cpp 2d/CCActionEase.cpp - 2d/CCActionGrid.cpp 2d/CCActionGrid3D.cpp + 2d/CCActionGrid.cpp 2d/CCActionInstant.cpp 2d/CCActionInterval.cpp 2d/CCActionManager.cpp @@ -46,29 +22,28 @@ set(COCOS_2D_SRC 2d/CCActionProgressTimer.cpp 2d/CCActionTiledGrid.cpp 2d/CCActionTween.cpp - 2d/CCAnimation.cpp 2d/CCAnimationCache.cpp + 2d/CCAnimation.cpp 2d/CCAtlasNode.cpp 2d/CCClippingNode.cpp - 2d/CCComponent.cpp 2d/CCComponentContainer.cpp - 2d/CCDrawNode.cpp + 2d/CCComponent.cpp 2d/CCDrawingPrimitives.cpp - 2d/CCFont.cpp - 2d/CCFontAtlas.cpp + 2d/CCDrawNode.cpp 2d/CCFontAtlasCache.cpp + 2d/CCFontAtlas.cpp 2d/CCFontCharMap.cpp + 2d/CCFont.cpp 2d/CCFontFNT.cpp 2d/CCFontFreeType.cpp 2d/CCGLBufferedNode.cpp 2d/CCGrabber.cpp 2d/CCGrid.cpp - 2d/CCIMEDispatcher.cpp - 2d/CCLabel.cpp 2d/CCLabelAtlas.cpp 2d/CCLabelBMFont.cpp - 2d/CCLabelTTF.cpp + 2d/CCLabel.cpp 2d/CCLabelTextFormatter.cpp + 2d/CCLabelTTF.cpp 2d/CCLayer.cpp 2d/CCMenu.cpp 2d/CCMenuItem.cpp @@ -83,38 +58,19 @@ set(COCOS_2D_SRC 2d/CCProgressTimer.cpp 2d/CCRenderTexture.cpp 2d/CCScene.cpp - 2d/CCScriptSupport.cpp - 2d/CCSprite.cpp 2d/CCSpriteBatchNode.cpp - 2d/CCSpriteFrame.cpp + 2d/CCSprite.cpp 2d/CCSpriteFrameCache.cpp + 2d/CCSpriteFrame.cpp + 2d/CCTextFieldTTF.cpp + 2d/CCTileMapAtlas.cpp 2d/CCTMXLayer.cpp 2d/CCTMXObjectGroup.cpp 2d/CCTMXTiledMap.cpp 2d/CCTMXXMLParser.cpp - 2d/CCTextFieldTTF.cpp - 2d/CCTexture2D.cpp - 2d/CCTextureAtlas.cpp - 2d/CCTextureCache.cpp - 2d/CCTileMapAtlas.cpp 2d/CCTransition.cpp 2d/CCTransitionPageTurn.cpp 2d/CCTransitionProgress.cpp 2d/CCTweenFunction.cpp - 2d/CCUserDefault.cpp - 2d/CCUserDefaultAndroid.cpp - 2d/CCVertex.cpp - 2d/TGAlib.cpp - 2d/ccCArray.cpp - 2d/ccUTF8.cpp - 2d/ccUtils.cpp - 2d/platform/CCSAXParser.cpp - 2d/platform/CCThread.cpp - 2d/platform/CCGLViewProtocol.cpp - 2d/platform/CCFileUtils.cpp - 2d/platform/CCImage.cpp - ../external/edtaa3func/edtaa3func.cpp - ../external/ConvertUTF/ConvertUTFWrapper.cpp - ../external/ConvertUTF/ConvertUTF.c ) diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index e5b1b92dc4..d7f58d5390 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -178,6 +178,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -198,15 +199,23 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + + + + + @@ -217,13 +226,14 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + - - - - + + + @@ -234,6 +244,17 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + + + + + + + + @@ -246,6 +267,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + @@ -262,7 +286,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - @@ -274,11 +297,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - + - - @@ -289,6 +310,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -297,15 +319,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - @@ -315,22 +333,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - @@ -342,6 +344,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + @@ -364,21 +367,33 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + + + + + + + + + @@ -395,13 +410,14 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + - - - - + + + @@ -413,6 +429,21 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + + + + + + + + + + + + + @@ -426,6 +457,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + + + @@ -442,7 +476,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - @@ -454,12 +487,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - + - - - @@ -470,24 +500,20 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou + - - - - - @@ -497,58 +523,15 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/cocos/2d/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters index ec392a9884..5c2b8adc1e 100644 --- a/cocos/2d/cocos2d.vcxproj.filters +++ b/cocos/2d/cocos2d.vcxproj.filters @@ -1,108 +1,57 @@  - - {cc64f5ad-2234-494c-9c51-b7a20c8887aa} - - - {736cf4ab-e0d6-40ba-912a-b062d28d318a} - - - {1c7c61b8-3d36-4ba0-a87c-457eb4c782d0} - - - {0b3a64bd-79fa-476a-a461-6b97e5072453} - - - {e455af5e-da09-4f41-b79f-df4dd311820d} - - - {206bd96b-f80e-4722-8675-d7c6ff9b3639} - - - {075492ba-08bc-404c-92da-32029797a600} - - - {41abe422-1602-4fe0-ac1c-6b04a14c1abb} - - - {8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd} - - - {926fc31c-8742-4984-9940-c972dd02fc8a} - - - {9428f8e6-4ce3-4596-b8af-14d70b7c5b5d} - - - {755e5282-111e-46a5-9169-7c12b37f5ffc} - - - {d94bbf20-8de9-49a7-ae20-6a1140cf633b} - - - {4a64789e-cc8d-4f84-a869-e6dae2e0d58c} - - - {bb98a889-9a48-4e31-af2f-117f14da388a} - - - {fdea327e-b905-47db-8c33-b70d7866166b} - - - {46c8d130-b8b5-47f5-a063-ca700e1c32cc} - - - {f2671200-b2d8-4d2e-9728-06719cf6f835} - - - {535c04b0-fe2b-44c9-9a8c-9029e2b6de5c} - - - {5b082c5c-d396-43ca-b3b1-997d0f6247d0} - - - {1179d205-d065-49f0-8457-bc4c3f1d0cb3} - - - {cc25bb83-527d-4218-8d68-ebf963ce7698} - - - {c45b97e8-fa1f-4e58-8ec5-d46371c2dd26} - - - {caa78ce0-9b58-4314-b117-1acae278691e} - - - {47fda93e-6eb4-4abc-b5bc-725bf667a395} - {08593631-5bf5-46aa-9436-62595c4f7bf6} {aeadfa95-9c89-4212-98ae-89ad57db596a} - - {aec8225f-81a7-4213-b97b-7004d5535398} - - - {cba0f362-878c-438b-ad0f-43d287516357} - - - {32373f63-2c2d-4eab-bc4a-21745ba0b3fb} - - - {b4e2b1e5-2d79-44a3-af45-728d47b7bdb2} - {0b1152b1-c732-4560-8629-87843b0fbd7c} - - {02a21a86-8f65-441b-ae13-11dec1c45ee5} + + {0965e868-aacd-4d73-9c78-31d3cdaaed52} - + + {4d0146d9-df5b-4430-a426-60aa395750a6} + + + {a495c9fc-5276-476d-ba6b-5d627b31ef30} + + + {87a7d557-f382-477f-b183-69901a320c17} + + + {9ac3f4cb-fb7b-4bcc-8b5b-1d454f2ff564} + + + {fdea951b-e91d-45da-b5bd-22a1b875960a} + + + {3622d05e-fcef-4d4b-a51d-771d1c13a2ef} + + + {a565f213-2d13-4d2d-a3a0-5b2d06cbd05f} + + + {ec174f10-2de3-4568-9f30-b2f0a4e9396e} + + + {364c3b8c-77eb-46ed-a866-a8686b1b65bc} + + + {589928bf-e550-41f1-ae21-64443dd5fe21} + + + {1849ae10-8a10-4784-bbad-66fa67a1ed04} + + {6c1e4a6b-c168-436b-aa63-0af7f4caebf9} + + {b4e2b1e5-2d79-44a3-af45-728d47b7bdb2} + @@ -120,262 +69,6 @@ physics - - base_nodes - - - base_nodes - - - effects - - - effects - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - text_input_node - - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support - - - support\component - - - support\component - - - support\data_support - - - support\image_support - - - support\tinyxml2 - - - support\user_default - - - support\zip_support - - - support\zip_support - - - support - physics\chipmunk @@ -391,23 +84,8 @@ physics\chipmunk - - misc_nodes - - - label_nodes - - - label_nodes - - - platform\desktop - - - platform - - xxhash + external\xxhash deprecated @@ -428,12 +106,213 @@ deprecated + + external\ConvertUTF + + + external\ConvertUTF + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + base + base base + + base + base @@ -461,6 +340,9 @@ base + + base + base @@ -473,6 +355,9 @@ base + + base + base @@ -488,6 +373,9 @@ base + + base + base @@ -500,51 +388,63 @@ base + + base + base base + + base + + + base + + + base + + + base + base + + base + + + base + + + base + base - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - - - math - renderer renderer + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + renderer @@ -557,38 +457,95 @@ renderer - - base - - - base - - - renderer - - - renderer - - - renderer - - - renderer - renderer - + renderer - - ConvertUTF + + renderer - - ConvertUTF + + renderer - - actions + + platform\desktop + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + platform + + + platform + + + platform + + + platform + + + platform + + + external\tinyxml2 + + + external\unzip + + + external\unzip + + + external\edtaa + + + base @@ -607,292 +564,6 @@ physics - - base_nodes - - - base_nodes - - - effects - - - effects - - - include - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform\win32 - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - text_input_node - - - text_input_node - - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support - - - support - - - support\component - - - support\component - - - support\data_support - - - support\data_support - - - support\data_support - - - support\image_support - - - support\tinyxml2 - - - support\user_default - - - support\zip_support - - - support\zip_support - physics\chipmunk @@ -911,20 +582,8 @@ physics\chipmunk - - misc_nodes - - - label_nodes - - - label_nodes - - - platform\desktop - - xxhash + external\xxhash deprecated @@ -957,12 +616,210 @@ deprecated + + external\ConvertUTF + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + base + base base + + base + base @@ -993,6 +850,9 @@ base + + base + base @@ -1005,6 +865,9 @@ base + + base + base @@ -1023,6 +886,9 @@ base + + base + base @@ -1032,9 +898,18 @@ base + + base + + + base + base + + base + base @@ -1044,53 +919,50 @@ base + + base + base base + + base + + + base + + + base + base base - + base - - math + + base - - math + + base - - math + + base - - math + + base - - math + + base - - math - - - math - - - math - - - math - - - math - - - math + + base renderer @@ -1098,6 +970,21 @@ renderer + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + renderer @@ -1113,120 +1000,139 @@ renderer - - base - - - base - - - renderer - - - renderer - - - renderer - - - renderer - renderer - + renderer - - ConvertUTF + + renderer - - actions + + renderer - - - + + platform\desktop + + + platform\win32\compat + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + + platform\win32 + + math - + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + platform + + + external\tinyxml2 + + + external\unzip + + + external\unzip + + + external\edtaa + + + base + + + base + + + math + math math - - math - math - + math - + math - + math - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - - - renderer\shaders - \ No newline at end of file diff --git a/cocos/2d/cocos2d_headers.props b/cocos/2d/cocos2d_headers.props index 51362bbae4..afdcd49a10 100644 --- a/cocos/2d/cocos2d_headers.props +++ b/cocos/2d/cocos2d_headers.props @@ -7,7 +7,7 @@ - $(EngineRoot)cocos;$(EngineRoot)cocos\2d\platform\win32;$(EngineRoot)cocos\2d\platform\desktop;$(EngineRoot)external\glfw3\include\win32;$(EngineRoot)external\win32-specific\gles\include\OGLES + $(EngineRoot)cocos;$(EngineRoot)cocos\platform\win32;$(EngineRoot)cocos\platform\desktop;$(EngineRoot)external\glfw3\include\win32;$(EngineRoot)external\win32-specific\gles\include\OGLES _VARIADIC_MAX=10;%(PreprocessorDefinitions) diff --git a/cocos/2d/cocos2d_winrt_headers.props b/cocos/2d/cocos2d_winrt_headers.props index a9c86090e4..fd510616e4 100644 --- a/cocos/2d/cocos2d_winrt_headers.props +++ b/cocos/2d/cocos2d_winrt_headers.props @@ -7,7 +7,7 @@ - $(EngineRoot)cocos;$(EngineRoot)cocos\2d\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\xxhash;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\2d\renderer;$(EngineRoot)cocos\math\kazmath;$(EngineRoot)cocos\ui;$(EngineRoot)cocos\base;$(EngineRoot)cocos\physics;$(EngineRoot)cocos\math\kazmath\include;$(GeneratedFilesDir);$(EngineRoot)external\ConvertUTF; + $(EngineRoot)cocos;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\xxhash;$(EngineRoot)\external\winrt-specific;$(GeneratedFilesDir);$(EngineRoot)external\ConvertUTF; diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index 1b145bce6f..7a47583a8a 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -75,7 +75,7 @@ %(PreprocessorDefinitions) - Use + NotUsing pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -100,7 +100,7 @@ _LIB;NDEBUG;%(PreprocessorDefinitions) - Use + NotUsing pch.h $(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories) $(EngineRoot)external\sqlite3\include;$(EngineRoot)external\unzip;$(EngineRoot)external\edtaa3func;$(EngineRoot)external\tinyxml2;$(EngineRoot)external\png\include\wp8;$(EngineRoot)external\jpeg\include\wp8;$(EngineRoot)external\curl\include\wp8;$(EngineRoot)external\curl\include\wp8\curl;$(EngineRoot)external\tiff\include\wp8;$(EngineRoot)external\freetype2\include\wp8;$(EngineRoot)external\wp8-specific\zlib\include;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external\xxhash;%(AdditionalIncludeDirectories) @@ -225,6 +225,7 @@ + @@ -245,15 +246,34 @@ + + false + false + + + + + + + + + + + + + + + + @@ -264,13 +284,14 @@ + + - - - - + + + @@ -281,6 +302,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -293,6 +337,9 @@ + + + @@ -309,7 +356,6 @@ - @@ -321,28 +367,9 @@ - - false - false - false - false - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - + - - @@ -353,6 +380,7 @@ + @@ -361,15 +389,11 @@ - - - - @@ -379,54 +403,6 @@ - - - - - - - - - - - - - - - - - - - true - true - true - true - Create - Create - pch.h - Cdecl - Cdecl - Cdecl - Cdecl - Create - Create - pch.h - - - - Create - Create - Create - Create - false - false - false - false - - - - - @@ -438,6 +414,7 @@ + @@ -460,21 +437,33 @@ + + + + + + + + + + + + @@ -490,13 +479,14 @@ + + - - - - + + + @@ -508,6 +498,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -521,6 +540,9 @@ + + + @@ -537,55 +559,44 @@ - - - - + - - - - + - - - - - @@ -594,49 +605,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + @@ -661,6 +639,6 @@ - + \ No newline at end of file diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index 10ccab392c..347e3dc121 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -1,87 +1,15 @@  - - {cc64f5ad-2234-494c-9c51-b7a20c8887aa} - - - {736cf4ab-e0d6-40ba-912a-b062d28d318a} - - - {1c7c61b8-3d36-4ba0-a87c-457eb4c782d0} - - - {0b3a64bd-79fa-476a-a461-6b97e5072453} - - - {e455af5e-da09-4f41-b79f-df4dd311820d} - - - {206bd96b-f80e-4722-8675-d7c6ff9b3639} - - - {075492ba-08bc-404c-92da-32029797a600} - - - {41abe422-1602-4fe0-ac1c-6b04a14c1abb} - - - {8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd} - {926fc31c-8742-4984-9940-c972dd02fc8a} - - {755e5282-111e-46a5-9169-7c12b37f5ffc} - - - {d94bbf20-8de9-49a7-ae20-6a1140cf633b} - - - {4a64789e-cc8d-4f84-a869-e6dae2e0d58c} - - - {bb98a889-9a48-4e31-af2f-117f14da388a} - - - {fdea327e-b905-47db-8c33-b70d7866166b} - - - {46c8d130-b8b5-47f5-a063-ca700e1c32cc} - - - {f2671200-b2d8-4d2e-9728-06719cf6f835} - - - {535c04b0-fe2b-44c9-9a8c-9029e2b6de5c} - - - {5b082c5c-d396-43ca-b3b1-997d0f6247d0} - - - {1179d205-d065-49f0-8457-bc4c3f1d0cb3} - - - {cc25bb83-527d-4218-8d68-ebf963ce7698} - - - {c45b97e8-fa1f-4e58-8ec5-d46371c2dd26} - - - {caa78ce0-9b58-4314-b117-1acae278691e} - - - {47fda93e-6eb4-4abc-b5bc-725bf667a395} - {08593631-5bf5-46aa-9436-62595c4f7bf6} {aeadfa95-9c89-4212-98ae-89ad57db596a} - - {aec8225f-81a7-4213-b97b-7004d5535398} - {cba0f362-878c-438b-ad0f-43d287516357} @@ -91,21 +19,42 @@ {14e6de7a-f7ef-4249-9141-abf17033d9c2} - - {a36c6808-a8d6-43f4-bfb0-e08ee2747a21} - {5598fb0c-c012-45b6-8e43-447e7891b61d} + + {fdee8fd3-05f9-46a1-aa15-6ceb16358145} + + + {f3673af7-9bbd-463b-a3a9-a081e67248d8} + + + {fbaf3e74-09dc-4f89-9d5a-0e7ccabbfbff} + - {9bbf7050-757b-41b1-ab15-418db52c2023} + {41c1aef6-86c9-42e3-b68c-6da3107ff587} - - {3237780d-1154-4049-bf53-151c421f26e9} + + {a03a9ca0-013a-4082-bb45-43f024ff0f4e} - + + {0e7c99cb-0b41-4120-9773-49c31345d829} + + + {729473cd-a9e2-4133-b78e-37a6c3687550} + + + {54949861-d861-4eea-89bf-0498ef3c338c} + + + {64846670-6658-45f9-84cf-29e013870c37} + + {026f880b-7918-49f8-8f0d-00f7593ce326} + + {a36c6808-a8d6-43f4-bfb0-e08ee2747a21} + @@ -123,247 +72,6 @@ physics - - base_nodes - - - base_nodes - - - effects - - - effects - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - text_input_node - - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support - - - support\component - - - support\component - - - support\data_support - - - support\image_support - - - support\tinyxml2 - - - support\user_default - - - support\zip_support - - - support\zip_support - - - support - physics\chipmunk @@ -379,57 +87,8 @@ physics\chipmunk - - misc_nodes - - - label_nodes - - - label_nodes - - - platform - - - - platform\wp8 - - - platform\wp8 - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - xxhash + external\xxhash deprecated @@ -449,37 +108,301 @@ deprecated - - platform\winrt - - - platform\winrt - - + + external\ConvertUTF + + + external\ConvertUTF + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + math - + + math + + + math + + + math + + math math - + math - + math - + math + + math + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + external\tinyxml2 + + + external\unzip + + + external\unzip + + + external\edtaa + + + base + base base + + base + base @@ -507,6 +430,9 @@ base + + base + base @@ -519,6 +445,9 @@ base + + base + base @@ -534,6 +463,9 @@ base + + base + base @@ -546,75 +478,114 @@ base + + base + base base + + base + + + base + + + base + + + base + base + + base + + + base + + + base + base - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform\wp8 - - math + + platform\wp8 - - math + + platform\wp8 - - math + + platform\winrt - + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + base - - base - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - ConvertUTF - - - ConvertUTF - @@ -632,292 +603,6 @@ physics - - base_nodes - - - base_nodes - - - effects - - - effects - - - include - - - include - - - include - - - include - - - include - - - include - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - layers_scenes_transitions_nodes - - - menu_nodes - - - menu_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - misc_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - particle_nodes - - - script_support - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - actions - - - draw_nodes - - - draw_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - label_nodes - - - platform\etc - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - platform - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - sprite_nodes - - - text_input_node - - - text_input_node - - - text_input_node - - - textures - - - textures - - - textures - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - tilemap_parallax_nodes - - - - support - - - support - - - support - - - support\component - - - support\component - - - support\data_support - - - support\data_support - - - support\data_support - - - support\image_support - - - support\tinyxml2 - - - support\user_default - - - support\zip_support - - - support\zip_support - physics\chipmunk @@ -936,57 +621,8 @@ physics\chipmunk - - misc_nodes - - - label_nodes - - - label_nodes - - - - platform\wp8 - - - platform\wp8 - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - - platform\winrt - - xxhash + external\xxhash deprecated @@ -1018,14 +654,203 @@ deprecated - - platform\winrt + + external\ConvertUTF - - platform\winrt + + 2d - - platform\winrt + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + 2d + + + math + + + math math @@ -1033,30 +858,102 @@ math - + math - + + math + + math math - + math - + math - + math + + math + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + renderer + + + external\tinyxml2 + + + external\unzip + + + external\unzip + + + external\edtaa + + + base + base base + + base + base @@ -1087,6 +984,9 @@ base + + base + base @@ -1099,6 +999,9 @@ base + + base + base @@ -1117,6 +1020,9 @@ base + + base + base @@ -1126,9 +1032,18 @@ base + + base + + + base + base + + base + base @@ -1138,171 +1053,237 @@ base + + base + base base + + base + + + base + + + base + base base + + base + + + base + + + base + + + base + + + base + + + base + base - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - renderer + + platform - - math + + platform - - math + + platform\wp8 - - math + + platform\wp8 - + + platform\wp8 + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + + platform\winrt + + base - + base - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - renderer - - - ConvertUTF - + + math + math math - - math - math - + math - + math - + math - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - renderer\Shaders + renderer\shaders - - base + + renderer \ No newline at end of file diff --git a/cocos/2d/cocos2d_wp8_headers.props b/cocos/2d/cocos2d_wp8_headers.props index 0ff1cd875e..d9e60d6d8c 100644 --- a/cocos/2d/cocos2d_wp8_headers.props +++ b/cocos/2d/cocos2d_wp8_headers.props @@ -7,7 +7,7 @@ - $(EngineRoot)cocos\2d\platform\wp8;$(EngineRoot)cocos\2d\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\2d;$(EngineRoot)cocos\math\kazmath;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos\2d\renderer;$(EngineRoot)cocos\ui;$(EngineRoot)cocos;$(EngineRoot)cocos\base;$(EngineRoot)cocos\physics;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)cocos\math\kazmath\include;$(EngineRoot)cocos\deprecated;$(EngineRoot)external\ConvertUTF;$(GeneratedFilesDir) + $(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(GeneratedFilesDir) _VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true true diff --git a/cocos/2d/platform/android/java/project.properties b/cocos/2d/platform/android/java/project.properties deleted file mode 100644 index 88ca83f9d0..0000000000 --- a/cocos/2d/platform/android/java/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -android.library=true -# Project target. -target=android-10 diff --git a/cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.user b/cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.user deleted file mode 100644 index 17f726ed50..0000000000 --- a/cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/cocos/Android.mk b/cocos/Android.mk index 297a26e97a..22112f4be5 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -12,8 +12,8 @@ cocos2d.cpp \ 2d/CCActionCamera.cpp \ 2d/CCActionCatmullRom.cpp \ 2d/CCActionEase.cpp \ -2d/CCActionGrid3D.cpp \ 2d/CCActionGrid.cpp \ +2d/CCActionGrid3D.cpp \ 2d/CCActionInstant.cpp \ 2d/CCActionInterval.cpp \ 2d/CCActionManager.cpp \ @@ -21,30 +21,28 @@ cocos2d.cpp \ 2d/CCActionProgressTimer.cpp \ 2d/CCActionTiledGrid.cpp \ 2d/CCActionTween.cpp \ -2d/CCAnimationCache.cpp \ 2d/CCAnimation.cpp \ +2d/CCAnimationCache.cpp \ 2d/CCAtlasNode.cpp \ -2d/ccCArray.cpp \ 2d/CCClippingNode.cpp \ -2d/CCComponentContainer.cpp \ 2d/CCComponent.cpp \ -2d/CCDrawingPrimitives.cpp \ +2d/CCComponentContainer.cpp \ 2d/CCDrawNode.cpp \ -2d/CCFontAtlasCache.cpp \ -2d/CCFontAtlas.cpp \ -2d/CCFontCharMap.cpp \ +2d/CCDrawingPrimitives.cpp \ 2d/CCFont.cpp \ +2d/CCFontAtlas.cpp \ +2d/CCFontAtlasCache.cpp \ +2d/CCFontCharMap.cpp \ 2d/CCFontFNT.cpp \ 2d/CCFontFreeType.cpp \ 2d/CCGLBufferedNode.cpp \ 2d/CCGrabber.cpp \ 2d/CCGrid.cpp \ -2d/CCIMEDispatcher.cpp \ +2d/CCLabel.cpp \ 2d/CCLabelAtlas.cpp \ 2d/CCLabelBMFont.cpp \ -2d/CCLabel.cpp \ -2d/CCLabelTextFormatter.cpp \ 2d/CCLabelTTF.cpp \ +2d/CCLabelTextFormatter.cpp \ 2d/CCLayer.cpp \ 2d/CCMenu.cpp \ 2d/CCMenuItem.cpp \ @@ -59,45 +57,35 @@ cocos2d.cpp \ 2d/CCProgressTimer.cpp \ 2d/CCRenderTexture.cpp \ 2d/CCScene.cpp \ -2d/CCScriptSupport.cpp \ -2d/CCSpriteBatchNode.cpp \ 2d/CCSprite.cpp \ -2d/CCSpriteFrameCache.cpp \ +2d/CCSpriteBatchNode.cpp \ 2d/CCSpriteFrame.cpp \ -2d/CCTextFieldTTF.cpp \ -2d/CCTexture2D.cpp \ -2d/CCTextureAtlas.cpp \ -2d/CCTextureCache.cpp \ -2d/CCTileMapAtlas.cpp \ +2d/CCSpriteFrameCache.cpp \ 2d/CCTMXLayer.cpp \ 2d/CCTMXObjectGroup.cpp \ 2d/CCTMXTiledMap.cpp \ 2d/CCTMXXMLParser.cpp \ +2d/CCTextFieldTTF.cpp \ +2d/CCTileMapAtlas.cpp \ 2d/CCTransition.cpp \ 2d/CCTransitionPageTurn.cpp \ 2d/CCTransitionProgress.cpp \ 2d/CCTweenFunction.cpp \ -2d/CCUserDefaultAndroid.cpp \ -2d/CCUserDefault.cpp \ -2d/ccUTF8.cpp \ -2d/ccUtils.cpp \ -2d/CCVertex.cpp \ -2d/TGAlib.cpp \ -2d/ccFPSImages.c \ -2d/platform/CCGLViewProtocol.cpp \ -2d/platform/CCFileUtils.cpp \ -2d/platform/CCSAXParser.cpp \ -2d/platform/CCThread.cpp \ -2d/platform/CCImage.cpp \ +platform/CCGLViewProtocol.cpp \ +platform/CCFileUtils.cpp \ +platform/CCSAXParser.cpp \ +platform/CCThread.cpp \ +platform/CCImage.cpp \ math/CCAffineTransform.cpp \ math/CCGeometry.cpp \ +math/CCVertex.cpp \ +math/Mat4.cpp \ math/MathUtil.cpp \ -math/Matrix.cpp \ math/Quaternion.cpp \ math/TransformUtils.cpp \ -math/Vector2.cpp \ -math/Vector3.cpp \ -math/Vector4.cpp \ +math/Vec2.cpp \ +math/Vec3.cpp \ +math/Vec4.cpp \ base/CCAutoreleasePool.cpp \ base/CCConfiguration.cpp \ base/CCConsole.cpp \ @@ -108,40 +96,52 @@ base/CCEvent.cpp \ base/CCEventAcceleration.cpp \ base/CCEventCustom.cpp \ base/CCEventDispatcher.cpp \ +base/CCEventFocus.cpp \ base/CCEventKeyboard.cpp \ base/CCEventListener.cpp \ base/CCEventListenerAcceleration.cpp \ base/CCEventListenerCustom.cpp \ +base/CCEventListenerFocus.cpp \ base/CCEventListenerKeyboard.cpp \ base/CCEventListenerMouse.cpp \ base/CCEventListenerTouch.cpp \ base/CCEventMouse.cpp \ base/CCEventTouch.cpp \ -base/CCEventFocus.cpp \ -base/CCEventListenerFocus.cpp \ +base/CCIMEDispatcher.cpp \ base/CCNS.cpp \ base/CCProfiling.cpp \ base/CCRef.cpp \ base/CCScheduler.cpp \ +base/CCScriptSupport.cpp \ base/CCTouch.cpp \ +base/CCUserDefault.cpp \ +base/CCUserDefaultAndroid.cpp \ base/CCValue.cpp \ +base/TGAlib.cpp \ base/ZipUtils.cpp \ base/atitc.cpp \ base/base64.cpp \ +base/ccCArray.cpp \ +base/ccFPSImages.c \ base/ccTypes.cpp \ +base/ccUTF8.cpp \ +base/ccUtils.cpp \ base/etc1.cpp \ base/s3tc.cpp \ renderer/CCBatchCommand.cpp \ renderer/CCCustomCommand.cpp \ renderer/CCGLProgram.cpp \ +renderer/CCGLProgramCache.cpp \ renderer/CCGLProgramState.cpp \ renderer/CCGLProgramStateCache.cpp \ -renderer/ccGLStateCache.cpp \ renderer/CCGroupCommand.cpp \ renderer/CCQuadCommand.cpp \ renderer/CCRenderCommand.cpp \ renderer/CCRenderer.cpp \ -renderer/CCGLProgramCache.cpp \ +renderer/CCTexture2D.cpp \ +renderer/CCTextureAtlas.cpp \ +renderer/CCTextureCache.cpp \ +renderer/ccGLStateCache.cpp \ renderer/ccShaders.cpp \ deprecated/CCArray.cpp \ deprecated/CCSet.cpp \ @@ -170,8 +170,7 @@ physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/. \ - $(LOCAL_PATH)/2d \ - $(LOCAL_PATH)/2d/platform/android \ + $(LOCAL_PATH)/platform/android \ $(LOCAL_PATH)/../external/tinyxml2 \ $(LOCAL_PATH)/../external/unzip \ $(LOCAL_PATH)/../external/chipmunk/include/chipmunk \ @@ -179,7 +178,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/. \ - $(LOCAL_PATH)/2d/platform/android \ + $(LOCAL_PATH)/platform/android \ $(LOCAL_PATH)/../external/tinyxml2 \ $(LOCAL_PATH)/../external/unzip \ $(LOCAL_PATH)/../external/chipmunk/include/chipmunk \ @@ -212,4 +211,4 @@ include $(BUILD_STATIC_LIBRARY) $(call import-module,freetype2/prebuilt/android) $(call import-module,chipmunk) -$(call import-module,2d/platform/android) +$(call import-module,platform/android) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index ecc42fc558..7541b3c039 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -8,6 +8,7 @@ set(COCOS_SRC ) include(2d/CMakeLists.txt) +include(platform/CMakeLists.txt) include(physics/CMakeLists.txt) include(math/CMakeLists.txt) include(renderer/CMakeLists.txt) @@ -20,7 +21,7 @@ include(storage/CMakeLists.txt) add_library(cocos2d STATIC ${COCOS_SRC} ${COCOS_2D_SRC} - ${COCOS_2D_PLATFORM_SRC} + ${COCOS_PLATFORM_SRC} ${COCOS_BASE_SRC} ${COCOS_RENDERER_SRC} ${COCOS_MATH_SRC} diff --git a/cocos/audio/android/Android.mk b/cocos/audio/android/Android.mk index 3da9a20b15..e5f3261840 100644 --- a/cocos/audio/android/Android.mk +++ b/cocos/audio/android/Android.mk @@ -13,11 +13,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../include LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \ $(LOCAL_PATH)/../.. \ - $(LOCAL_PATH)/../../math \ - $(LOCAL_PATH)/../../2d \ - $(LOCAL_PATH)/../../2d/platform/android \ - $(LOCAL_PATH)/../../base \ - $(LOCAL_PATH)/../../physics + $(LOCAL_PATH)/../../platform/android LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi diff --git a/cocos/base/CCConfiguration.cpp b/cocos/base/CCConfiguration.cpp index 4490e975e0..c5b8bd61f1 100644 --- a/cocos/base/CCConfiguration.cpp +++ b/cocos/base/CCConfiguration.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include "base/ccMacros.h" #include "base/ccConfig.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 7f95c2e595..1eaf59e458 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -59,8 +59,8 @@ #include "base/CCPlatformConfig.h" #include "base/CCConfiguration.h" #include "2d/CCScene.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/CCTextureCache.h" +#include "platform/CCFileUtils.h" +#include "renderer/CCTextureCache.h" #include "CCGLView.h" #include "base/base64.h" NS_CC_BEGIN diff --git a/cocos/base/CCData.cpp b/cocos/base/CCData.cpp index 9cff6809e8..fda70d44b7 100644 --- a/cocos/base/CCData.cpp +++ b/cocos/base/CCData.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "base/CCData.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/ccMacros.h" #include diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index 5ac02909d9..791482c1b8 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -31,23 +31,24 @@ THE SOFTWARE. // standard includes #include -#include "2d/ccFPSImages.h" #include "2d/CCDrawingPrimitives.h" #include "2d/CCScene.h" #include "2d/CCSpriteFrameCache.h" -#include "2d/platform/CCFileUtils.h" -#include "renderer/ccGLStateCache.h" -#include "2d/platform/CCImage.h" +#include "platform/CCFileUtils.h" +#include "platform/CCImage.h" #include "2d/CCActionManager.h" #include "2d/CCFontFNT.h" #include "2d/CCFontAtlasCache.h" #include "2d/CCAnimationCache.h" -#include "2d/CCUserDefault.h" +#include "2d/CCTransition.h" +#include "2d/CCFontFreeType.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgramStateCache.h" -#include "2d/CCTransition.h" -#include "2d/CCTextureCache.h" -#include "2d/CCFontFreeType.h" +#include "renderer/CCTextureCache.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCRenderer.h" +#include "base/CCUserDefault.h" +#include "base/ccFPSImages.h" #include "base/CCScheduler.h" #include "base/ccMacros.h" #include "base/CCEventDispatcher.h" @@ -57,7 +58,6 @@ THE SOFTWARE. #include "base/CCAutoreleasePool.h" #include "base/CCProfiling.h" #include "base/CCConfiguration.h" -#include "renderer/CCRenderer.h" #include "base/CCNS.h" #include "math/CCMath.h" #include "CCApplication.h" diff --git a/cocos/base/CCEventListener.cpp b/cocos/base/CCEventListener.cpp index 2c0985b6fd..c6f6acaccd 100644 --- a/cocos/base/CCEventListener.cpp +++ b/cocos/base/CCEventListener.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "base/CCEventListener.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" NS_CC_BEGIN diff --git a/cocos/2d/CCIMEDelegate.h b/cocos/base/CCIMEDelegate.h similarity index 100% rename from cocos/2d/CCIMEDelegate.h rename to cocos/base/CCIMEDelegate.h diff --git a/cocos/2d/CCIMEDispatcher.cpp b/cocos/base/CCIMEDispatcher.cpp similarity index 99% rename from cocos/2d/CCIMEDispatcher.cpp rename to cocos/base/CCIMEDispatcher.cpp index 589d2f8189..c5b59c0110 100644 --- a/cocos/2d/CCIMEDispatcher.cpp +++ b/cocos/base/CCIMEDispatcher.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/CCIMEDispatcher.h" +#include "base/CCIMEDispatcher.h" #include diff --git a/cocos/2d/CCIMEDispatcher.h b/cocos/base/CCIMEDispatcher.h similarity index 99% rename from cocos/2d/CCIMEDispatcher.h rename to cocos/base/CCIMEDispatcher.h index 6b6a4b1fc7..09b212bff4 100644 --- a/cocos/2d/CCIMEDispatcher.h +++ b/cocos/base/CCIMEDispatcher.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CC_IME_DISPATCHER_H__ #define __CC_IME_DISPATCHER_H__ -#include "2d/CCIMEDelegate.h" +#include "base/CCIMEDelegate.h" NS_CC_BEGIN diff --git a/cocos/base/CCPlatformConfig.h b/cocos/base/CCPlatformConfig.h index f9e5e698a3..12c1735256 100644 --- a/cocos/base/CCPlatformConfig.h +++ b/cocos/base/CCPlatformConfig.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CC_PLATFORM_CONFIG_H__ -#define __CC_PLATFORM_CONFIG_H__ +#ifndef __BASE_CC_PLATFORM_CONFIG_H__ +#define __BASE_CC_PLATFORM_CONFIG_H__ /** Config of cocos2d-x project, per target platform. @@ -154,5 +154,5 @@ Config of cocos2d-x project, per target platform. #endif #endif // CC_PLATFORM_WIN32 -#endif // __CC_PLATFORM_CONFIG_H__ +#endif // __BASE_CC_PLATFORM_CONFIG_H__ diff --git a/cocos/2d/CCProtocols.h b/cocos/base/CCProtocols.h similarity index 98% rename from cocos/2d/CCProtocols.h rename to cocos/base/CCProtocols.h index 13535409df..b12daa781f 100644 --- a/cocos/2d/CCProtocols.h +++ b/cocos/base/CCProtocols.h @@ -24,12 +24,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CCPROTOCOLS_H__ -#define __CCPROTOCOLS_H__ +#ifndef __BASE_CCPROTOCOLS_H__ +#define __BASE_CCPROTOCOLS_H__ + +#include #include "base/ccTypes.h" -#include "2d/CCTexture2D.h" -#include +#include "renderer/CCTexture2D.h" NS_CC_BEGIN @@ -267,4 +268,4 @@ public: NS_CC_END -#endif // __CCPROTOCOLS_H__ +#endif // __BASE_CCPROTOCOLS_H__ diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 9163a32409..1f2c3a4ce7 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCRef.h" #include "base/CCAutoreleasePool.h" #include "base/ccMacros.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #if CC_USE_MEM_LEAK_DETECTION #include // std::find diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index e418d3d659..50f8c8b05c 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -23,8 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CCREF_H__ -#define __CCREF_H__ +#ifndef __BASE_CCREF_H__ +#define __BASE_CCREF_H__ #include "base/CCPlatformMacros.h" #include "base/ccConfig.h" @@ -172,4 +172,4 @@ typedef void (Ref::*SEL_SCHEDULE)(float); NS_CC_END -#endif // __CCREF_H__ +#endif // __BASE_CCREF_H__ diff --git a/cocos/base/CCScheduler.cpp b/cocos/base/CCScheduler.cpp index 08a6cb6186..3688f74a3c 100644 --- a/cocos/base/CCScheduler.cpp +++ b/cocos/base/CCScheduler.cpp @@ -28,9 +28,9 @@ THE SOFTWARE. #include "base/CCScheduler.h" #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "2d/utlist.h" -#include "2d/ccCArray.h" -#include "2d/CCScriptSupport.h" +#include "base/utlist.h" +#include "base/ccCArray.h" +#include "base/CCScriptSupport.h" NS_CC_BEGIN diff --git a/cocos/base/CCScheduler.h b/cocos/base/CCScheduler.h index 7c7a0a5d6b..51f352770a 100644 --- a/cocos/base/CCScheduler.h +++ b/cocos/base/CCScheduler.h @@ -34,7 +34,7 @@ THE SOFTWARE. #include "base/CCRef.h" #include "base/CCVector.h" -#include "2d/uthash.h" +#include "base/uthash.h" NS_CC_BEGIN diff --git a/cocos/2d/CCScriptSupport.cpp b/cocos/base/CCScriptSupport.cpp similarity index 99% rename from cocos/2d/CCScriptSupport.cpp rename to cocos/base/CCScriptSupport.cpp index 0bf83ef912..f5400c436a 100644 --- a/cocos/2d/CCScriptSupport.cpp +++ b/cocos/base/CCScriptSupport.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #if CC_ENABLE_SCRIPT_BINDING diff --git a/cocos/2d/CCScriptSupport.h b/cocos/base/CCScriptSupport.h similarity index 99% rename from cocos/2d/CCScriptSupport.h rename to cocos/base/CCScriptSupport.h index 8bf06a0dcb..ee649a1f9a 100644 --- a/cocos/2d/CCScriptSupport.h +++ b/cocos/base/CCScriptSupport.h @@ -29,7 +29,7 @@ #include "base/ccConfig.h" #if CC_ENABLE_SCRIPT_BINDING -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/CCTouch.h" #include "base/CCEventTouch.h" #include "base/CCEventKeyboard.h" diff --git a/cocos/2d/CCUserDefault.cpp b/cocos/base/CCUserDefault.cpp similarity index 99% rename from cocos/2d/CCUserDefault.cpp rename to cocos/base/CCUserDefault.cpp index 7344507f7c..884e383171 100644 --- a/cocos/2d/CCUserDefault.cpp +++ b/cocos/base/CCUserDefault.cpp @@ -22,9 +22,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/CCUserDefault.h" -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCFileUtils.h" +#include "base/CCUserDefault.h" +#include "platform/CCCommon.h" +#include "platform/CCFileUtils.h" #include "tinyxml2.h" #include "base/base64.h" diff --git a/cocos/2d/CCUserDefault.h b/cocos/base/CCUserDefault.h similarity index 100% rename from cocos/2d/CCUserDefault.h rename to cocos/base/CCUserDefault.h diff --git a/cocos/2d/CCUserDefault.mm b/cocos/base/CCUserDefault.mm similarity index 100% rename from cocos/2d/CCUserDefault.mm rename to cocos/base/CCUserDefault.mm diff --git a/cocos/2d/CCUserDefaultAndroid.cpp b/cocos/base/CCUserDefaultAndroid.cpp similarity index 98% rename from cocos/2d/CCUserDefaultAndroid.cpp rename to cocos/base/CCUserDefaultAndroid.cpp index f24a6a8010..fb96d39e37 100644 --- a/cocos/2d/CCUserDefaultAndroid.cpp +++ b/cocos/base/CCUserDefaultAndroid.cpp @@ -22,13 +22,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/CCUserDefault.h" +#include "base/CCUserDefault.h" #include "base/CCPlatformConfig.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/base64.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include "2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" +#include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" // root name of xml #define USERDEFAULT_ROOT_NAME "userDefaultRoot" @@ -38,7 +38,7 @@ THE SOFTWARE. #define XML_FILE_NAME "UserDefault.xml" #ifdef KEEP_COMPATABILITY -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "../tinyxml2/tinyxml2.h" #endif diff --git a/cocos/base/CMakeLists.txt b/cocos/base/CMakeLists.txt index 2c7faeb78f..0b628db4ac 100644 --- a/cocos/base/CMakeLists.txt +++ b/cocos/base/CMakeLists.txt @@ -1,36 +1,44 @@ set(COCOS_BASE_SRC - base/atitc.cpp - base/base64.cpp base/CCAutoreleasePool.cpp base/CCConfiguration.cpp base/CCConsole.cpp base/CCData.cpp base/CCDataVisitor.cpp base/CCDirector.cpp - base/CCEventAcceleration.cpp base/CCEvent.cpp + base/CCEventAcceleration.cpp base/CCEventCustom.cpp base/CCEventDispatcher.cpp + base/CCEventFocus.cpp base/CCEventKeyboard.cpp - base/CCEventListenerAcceleration.cpp base/CCEventListener.cpp + base/CCEventListenerAcceleration.cpp base/CCEventListenerCustom.cpp + base/CCEventListenerFocus.cpp base/CCEventListenerKeyboard.cpp base/CCEventListenerMouse.cpp base/CCEventListenerTouch.cpp base/CCEventMouse.cpp base/CCEventTouch.cpp - base/CCEventFocus.cpp - base/CCEventListenerFocus.cpp + base/CCIMEDispatcher.cpp base/CCNS.cpp base/CCProfiling.cpp base/CCRef.cpp base/CCScheduler.cpp + base/CCScriptSupport.cpp base/CCTouch.cpp - base/ccTypes.cpp + base/CCUserDefault.cpp + base/CCUserDefaultAndroid.cpp base/CCValue.cpp + base/TGAlib.cpp + base/ZipUtils.cpp + base/atitc.cpp + base/base64.cpp + base/ccCArray.cpp + base/ccFPSImages.c + base/ccTypes.cpp + base/ccUTF8.cpp + base/ccUtils.cpp base/etc1.cpp base/s3tc.cpp - base/ZipUtils.cpp ) - diff --git a/cocos/2d/TGAlib.cpp b/cocos/base/TGAlib.cpp similarity index 99% rename from cocos/2d/TGAlib.cpp rename to cocos/base/TGAlib.cpp index abcd90ebb3..5c097f6c46 100644 --- a/cocos/2d/TGAlib.cpp +++ b/cocos/base/TGAlib.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "TGAlib.h" #include "base/CCData.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/2d/TGAlib.h b/cocos/base/TGAlib.h similarity index 100% rename from cocos/2d/TGAlib.h rename to cocos/base/TGAlib.h diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index ffe6b5941c..c5f7e26011 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -29,7 +29,7 @@ #include "base/ZipUtils.h" #include "base/CCData.h" #include "base/ccMacros.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "unzip.h" #include diff --git a/cocos/base/ZipUtils.h b/cocos/base/ZipUtils.h index 9df427e943..d6b1e20c9a 100644 --- a/cocos/base/ZipUtils.h +++ b/cocos/base/ZipUtils.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include "2d/platform/android/CCFileUtilsAndroid.h" +#include "platform/android/CCFileUtilsAndroid.h" #elif(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) // for import ssize_t on win32 platform #include "CCStdC.h" diff --git a/cocos/2d/ccCArray.cpp b/cocos/base/ccCArray.cpp similarity index 99% rename from cocos/2d/ccCArray.cpp rename to cocos/base/ccCArray.cpp index 78e7c2cfc7..a9a463e624 100644 --- a/cocos/2d/ccCArray.cpp +++ b/cocos/base/ccCArray.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/ccCArray.h" +#include "base/ccCArray.h" #include "base/CCRef.h" #include "base/ccTypes.h" diff --git a/cocos/2d/ccCArray.h b/cocos/base/ccCArray.h similarity index 100% rename from cocos/2d/ccCArray.h rename to cocos/base/ccCArray.h diff --git a/cocos/2d/ccFPSImages.c b/cocos/base/ccFPSImages.c similarity index 99% rename from cocos/2d/ccFPSImages.c rename to cocos/base/ccFPSImages.c index 7beb7309e3..725491f9b1 100644 --- a/cocos/2d/ccFPSImages.c +++ b/cocos/base/ccFPSImages.c @@ -23,7 +23,7 @@ * THE SOFTWARE. */ -#include "ccFPSImages.h" +#include "base/ccFPSImages.h" unsigned char cc_fps_images_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, diff --git a/cocos/2d/ccFPSImages.h b/cocos/base/ccFPSImages.h similarity index 93% rename from cocos/2d/ccFPSImages.h rename to cocos/base/ccFPSImages.h index ad9f012692..02fd5a83dd 100644 --- a/cocos/2d/ccFPSImages.h +++ b/cocos/base/ccFPSImages.h @@ -22,8 +22,8 @@ * THE SOFTWARE. */ -#ifndef __CCFPSIMAGES__H -#define __CCFPSIMAGES__H +#ifndef __BASE_CCFPSIMAGES__H +#define __BASE_CCFPSIMAGES__H #ifdef __cplusplus extern "C" { @@ -36,4 +36,4 @@ unsigned int cc_fps_images_len(void); } #endif -#endif // __CCFPSIMAGES__H +#endif // __BASE_CCFPSIMAGES__H diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 476a1e0de7..165dbab7cf 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -25,8 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CCMACROS_H__ -#define __CCMACROS_H__ +#ifndef __BASE_CCMACROS_H__ +#define __BASE_CCMACROS_H__ #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES @@ -276,4 +276,4 @@ It should work same as apples CFSwapInt32LittleToHost(..) #define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) #define CC_CALLBACK_3(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, ##__VA_ARGS__) -#endif // __CCMACROS_H__ +#endif // __BASE_CCMACROS_H__ diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 3b884d55a8..f447c4de5b 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -25,10 +25,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef __CCTYPES_H__ -#define __CCTYPES_H__ +#ifndef __BASE_CCTYPES_H__ +#define __BASE_CCTYPES_H__ #include + #include "math/CCGeometry.h" #include "math/CCMath.h" #include "CCGL.h" @@ -478,4 +479,4 @@ extern const ssize_t CC_INVALID_INDEX; NS_CC_END -#endif //__CCTYPES_H__ +#endif //__BASE_CCTYPES_H__ diff --git a/cocos/2d/ccUTF8.cpp b/cocos/base/ccUTF8.cpp similarity index 99% rename from cocos/2d/ccUTF8.cpp rename to cocos/base/ccUTF8.cpp index b3a68da20a..fd9514f4c9 100644 --- a/cocos/2d/ccUTF8.cpp +++ b/cocos/base/ccUTF8.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "ccUTF8.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/CCConsole.h" #include "ConvertUTF.h" diff --git a/cocos/2d/ccUTF8.h b/cocos/base/ccUTF8.h similarity index 100% rename from cocos/2d/ccUTF8.h rename to cocos/base/ccUTF8.h diff --git a/cocos/2d/ccUtils.cpp b/cocos/base/ccUtils.cpp similarity index 98% rename from cocos/2d/ccUtils.cpp rename to cocos/base/ccUtils.cpp index 456cb573a3..55182df253 100644 --- a/cocos/2d/ccUtils.cpp +++ b/cocos/base/ccUtils.cpp @@ -22,7 +22,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/ccUtils.h" + +#include "base/ccUtils.h" namespace cocos2d { diff --git a/cocos/2d/ccUtils.h b/cocos/base/ccUtils.h similarity index 100% rename from cocos/2d/ccUtils.h rename to cocos/base/ccUtils.h diff --git a/cocos/2d/firePngData.h b/cocos/base/firePngData.h similarity index 100% rename from cocos/2d/firePngData.h rename to cocos/base/firePngData.h diff --git a/cocos/2d/uthash.h b/cocos/base/uthash.h similarity index 100% rename from cocos/2d/uthash.h rename to cocos/base/uthash.h diff --git a/cocos/2d/utlist.h b/cocos/base/utlist.h similarity index 100% rename from cocos/2d/utlist.h rename to cocos/base/utlist.h diff --git a/cocos/2d/cocos2dx-Prefix.pch b/cocos/cocos2d-prefix.pch similarity index 100% rename from cocos/2d/cocos2dx-Prefix.pch rename to cocos/cocos2d-prefix.pch diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 143678e877..b26c4026e1 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -56,8 +56,13 @@ THE SOFTWARE. #include "base/ZipUtils.h" #include "base/CCProfiling.h" #include "base/CCConsole.h" +#include "base/ccUTF8.h" +#include "base/CCUserDefault.h" +#include "base/CCIMEDelegate.h" +#include "base/CCIMEDispatcher.h" // EventDispatcher +#include "base/CCEventType.h" #include "base/CCEventDispatcher.h" #include "base/CCEventListenerTouch.h" #include "base/CCEventTouch.h" @@ -75,12 +80,13 @@ THE SOFTWARE. // math #include "math/CCAffineTransform.h" #include "math/CCGeometry.h" -#include "math/Vector2.h" -#include "math/Vector3.h" -#include "math/Vector4.h" -#include "math/Matrix.h" +#include "math/Vec2.h" +#include "math/Vec3.h" +#include "math/Vec4.h" +#include "math/Mat4.h" #include "math/Quaternion.h" #include "math/MathUtil.h" +#include "math/CCVertex.h" // actions #include "2d/CCAction.h" @@ -130,10 +136,9 @@ THE SOFTWARE. #include "2d/CCGrid.h" // include -#include "base/CCEventType.h" -#include "2d/CCProtocols.h" +#include "base/CCProtocols.h" -// new renderer +// renderer #include "renderer/CCCustomCommand.h" #include "renderer/CCGroupCommand.h" #include "renderer/CCQuadCommand.h" @@ -145,6 +150,8 @@ THE SOFTWARE. #include "renderer/CCGLProgramState.h" #include "renderer/ccGLStateCache.h" #include "renderer/ccShaders.h" +#include "renderer/CCTexture2D.h" +#include "renderer/CCTextureCache.h" // physics #include "physics/CCPhysicsBody.h" @@ -154,75 +161,75 @@ THE SOFTWARE. #include "physics/CCPhysicsWorld.h" // platform -#include "2d/platform/CCDevice.h" -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/platform/CCImage.h" -#include "2d/platform/CCSAXParser.h" -#include "2d/platform/CCThread.h" +#include "platform/CCDevice.h" +#include "platform/CCCommon.h" +#include "platform/CCFileUtils.h" +#include "platform/CCImage.h" +#include "platform/CCSAXParser.h" +#include "platform/CCThread.h" #include "base/CCPlatformConfig.h" #include "base/CCPlatformMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - #include "2d/platform/ios/CCApplication.h" - #include "2d/platform/ios/CCGLView.h" - #include "2d/platform/ios/CCGL.h" - #include "2d/platform/ios/CCStdC.h" + #include "platform/ios/CCApplication.h" + #include "platform/ios/CCGLView.h" + #include "platform/ios/CCGL.h" + #include "platform/ios/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - #include "2d/platform/android/CCApplication.h" - #include "2d/platform/android/CCGLView.h" - #include "2d/platform/android/CCGL.h" - #include "2d/platform/android/CCStdC.h" + #include "platform/android/CCApplication.h" + #include "platform/android/CCGLView.h" + #include "platform/android/CCGL.h" + #include "platform/android/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) - #include "2d/platform/blackberry/CCApplication.h" - #include "2d/platform/blackberry/CCGLView.h" - #include "2d/platform/blackberry/CCGL.h" - #include "2d/platform/blackberry/CCStdC.h" + #include "platform/blackberry/CCApplication.h" + #include "platform/blackberry/CCGLView.h" + #include "platform/blackberry/CCGL.h" + #include "platform/blackberry/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - #include "2d/platform/win32/CCApplication.h" - #include "2d/platform/desktop/CCGLView.h" - #include "2d/platform/win32/CCGL.h" - #include "2d/platform/win32/CCStdC.h" + #include "platform/win32/CCApplication.h" + #include "platform/desktop/CCGLView.h" + #include "platform/win32/CCGL.h" + #include "platform/win32/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - #include "2d/platform/mac/CCApplication.h" - #include "2d/platform/desktop/CCGLView.h" - #include "2d/platform/mac/CCGL.h" - #include "2d/platform/mac/CCStdC.h" + #include "platform/mac/CCApplication.h" + #include "platform/desktop/CCGLView.h" + #include "platform/mac/CCGL.h" + #include "platform/mac/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC #if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) - #include "2d/platform/linux/CCApplication.h" - #include "2d/platform/desktop/CCGLView.h" - #include "2d/platform/linux/CCGL.h" - #include "2d/platform/linux/CCStdC.h" + #include "platform/linux/CCApplication.h" + #include "platform/desktop/CCGLView.h" + #include "platform/linux/CCGL.h" + #include "platform/linux/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) - #include "2d/platform/winrt/CCApplication.h" - #include "2d/platform/winrt/CCGLView.h" - #include "2d/platform/winrt/CCGL.h" - #include "2d/platform/winrt/CCStdC.h" - #include "2d/platform/winrt/CCPrecompiledShaders.h" + #include "platform/winrt/CCApplication.h" + #include "platform/winrt/CCGLView.h" + #include "platform/winrt/CCGL.h" + #include "platform/winrt/CCStdC.h" + #include "platform/winrt/CCPrecompiledShaders.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WINRT #if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - #include "2d/platform/winrt/CCApplication.h" - #include "2d/platform/wp8/CCGLView.h" - #include "2d/platform/winrt/CCGL.h" - #include "2d/platform/winrt/CCStdC.h" - #include "2d/platform/winrt/CCPrecompiledShaders.h" + #include "platform/winrt/CCApplication.h" + #include "platform/wp8/CCGLView.h" + #include "platform/winrt/CCGL.h" + #include "platform/winrt/CCStdC.h" + #include "platform/winrt/CCPrecompiledShaders.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8 // script_support -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" // sprite_nodes #include "2d/CCAnimation.h" @@ -232,20 +239,11 @@ THE SOFTWARE. #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteFrameCache.h" -// support -#include "2d/ccUTF8.h" -#include "2d/CCUserDefault.h" -#include "2d/CCVertex.h" - // text_input_node -#include "2d/CCIMEDelegate.h" -#include "2d/CCIMEDispatcher.h" #include "2d/CCTextFieldTTF.h" // textures -#include "2d/CCTexture2D.h" -#include "2d/CCTextureAtlas.h" -#include "2d/CCTextureCache.h" +#include "renderer/CCTextureAtlas.h" // tilemap_parallax_nodes #include "2d/CCParallaxNode.h" diff --git a/cocos/deprecated/CCArray.cpp b/cocos/deprecated/CCArray.cpp index a3778e19fc..80118faa74 100644 --- a/cocos/deprecated/CCArray.cpp +++ b/cocos/deprecated/CCArray.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCArray.h" #include "deprecated/CCString.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/deprecated/CCArray.h b/cocos/deprecated/CCArray.h index a6361e1b80..c06bd5e6b0 100644 --- a/cocos/deprecated/CCArray.h +++ b/cocos/deprecated/CCArray.h @@ -34,7 +34,7 @@ THE SOFTWARE. #include "base/CCRef.h" #include "base/ccMacros.h" #else -#include "2d/ccCArray.h" +#include "base/ccCArray.h" #endif #include "base/CCDataVisitor.h" diff --git a/cocos/deprecated/CCDictionary.cpp b/cocos/deprecated/CCDictionary.cpp index 7552d9285b..96ae7dcc7a 100644 --- a/cocos/deprecated/CCDictionary.cpp +++ b/cocos/deprecated/CCDictionary.cpp @@ -26,7 +26,7 @@ #include "CCDictionary.h" #include "deprecated/CCString.h" #include "CCInteger.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "deprecated/CCString.h" #include "CCBool.h" #include "CCInteger.h" diff --git a/cocos/deprecated/CCDictionary.h b/cocos/deprecated/CCDictionary.h index 1993a81d56..5bd701c10a 100644 --- a/cocos/deprecated/CCDictionary.h +++ b/cocos/deprecated/CCDictionary.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCDICTIONARY_H__ #define __CCDICTIONARY_H__ -#include "2d/uthash.h" +#include "base/uthash.h" #include "base/CCRef.h" #include "CCArray.h" #include "deprecated/CCString.h" diff --git a/cocos/deprecated/CCInteger.h b/cocos/deprecated/CCInteger.h index c78d5eba74..c3710eaf49 100644 --- a/cocos/deprecated/CCInteger.h +++ b/cocos/deprecated/CCInteger.h @@ -27,7 +27,7 @@ #include "base/CCRef.h" #include "base/CCDataVisitor.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" NS_CC_BEGIN diff --git a/cocos/deprecated/CCNotificationCenter.cpp b/cocos/deprecated/CCNotificationCenter.cpp index 837ac6f8dc..7fec442329 100644 --- a/cocos/deprecated/CCNotificationCenter.cpp +++ b/cocos/deprecated/CCNotificationCenter.cpp @@ -24,11 +24,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCNotificationCenter.h" -#include "deprecated/CCArray.h" -#include "2d/CCScriptSupport.h" +#include "deprecated/CCNotificationCenter.h" + #include +#include "base/CCScriptSupport.h" +#include "deprecated/CCArray.h" + using namespace std; NS_CC_BEGIN diff --git a/cocos/deprecated/CCString.cpp b/cocos/deprecated/CCString.cpp index 311c250bc0..8492573d70 100644 --- a/cocos/deprecated/CCString.cpp +++ b/cocos/deprecated/CCString.cpp @@ -24,7 +24,7 @@ Copyright (c) 2013-2014 Chukong Technologies ****************************************************************************/ #include "deprecated/CCString.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/ccMacros.h" #include #include diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index a224629a71..60bb3119fd 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -2,10 +2,10 @@ #include #include "base/CCDirector.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "2d/CCScene.h" -#include "2d/CCTextureCache.h" #include "2d/CCSpriteFrameCache.h" +#include "renderer/CCTextureCache.h" #include "CCBReader.h" #include "CCNodeLoader.h" diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index a2ab0aecf7..cea37b4e63 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/CCDirector.h" #include "base/CCScheduler.h" diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp index 6f1dc7a5ed..7bc3d50526 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "cocostudio/CCInputDelegate.h" #include "base/CCDirector.h" -#include "2d/platform/CCDevice.h" +#include "platform/CCDevice.h" #include "base/CCEventListenerTouch.h" #include "base/CCEventListenerAcceleration.h" #include "base/CCEventListenerKeyboard.h" diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index 3b44e667df..dbcde2fb2c 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -37,8 +37,8 @@ #include #include "2d/CCNode.h" -#include "2d/CCProtocols.h" -#include "2d/CCTextureAtlas.h" +#include "base/CCProtocols.h" +#include "renderer/CCTextureAtlas.h" #include "renderer/CCCustomCommand.h" namespace spine { diff --git a/cocos/math/CCMath.h b/cocos/math/CCMath.h index e5f1daa130..7ea6798945 100644 --- a/cocos/math/CCMath.h +++ b/cocos/math/CCMath.h @@ -1,10 +1,10 @@ #ifndef __CC_MATH_H__ #define __CC_MATH_H__ -#include "Vector2.h" -#include "Vector3.h" -#include "Vector4.h" -#include "Matrix.h" +#include "Vec2.h" +#include "Vec3.h" +#include "Vec4.h" +#include "Mat4.h" #include "Quaternion.h" #endif \ No newline at end of file diff --git a/cocos/2d/CCVertex.cpp b/cocos/math/CCVertex.cpp similarity index 99% rename from cocos/2d/CCVertex.cpp rename to cocos/math/CCVertex.cpp index 8a96b2c2ee..5a9673d0db 100644 --- a/cocos/2d/CCVertex.cpp +++ b/cocos/math/CCVertex.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "2d/CCVertex.h" +#include "math/CCVertex.h" #include "base/ccMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/CCVertex.h b/cocos/math/CCVertex.h similarity index 100% rename from cocos/2d/CCVertex.h rename to cocos/math/CCVertex.h diff --git a/cocos/math/CMakeLists.txt b/cocos/math/CMakeLists.txt index df76392225..e7f2a0012b 100644 --- a/cocos/math/CMakeLists.txt +++ b/cocos/math/CMakeLists.txt @@ -1,12 +1,13 @@ set(COCOS_MATH_SRC - math/CCAffineTransform.cpp - math/CCGeometry.cpp - math/MathUtil.cpp - math/Matrix.cpp - math/Quaternion.cpp - math/TransformUtils.cpp - math/Vector2.cpp - math/Vector3.cpp - math/Vector4.cpp + math/CCAffineTransform.cpp + math/CCGeometry.cpp + math/CCVertex.cpp + math/Mat4.cpp + math/MathUtil.cpp + math/Quaternion.cpp + math/TransformUtils.cpp + math/Vec2.cpp + math/Vec3.cpp + math/Vec4.cpp ) diff --git a/cocos/math/Matrix.cpp b/cocos/math/Mat4.cpp similarity index 99% rename from cocos/math/Matrix.cpp rename to cocos/math/Mat4.cpp index c904b758f4..cd6217f1ad 100644 --- a/cocos/math/Matrix.cpp +++ b/cocos/math/Mat4.cpp @@ -18,9 +18,9 @@ This file was modified to fit the cocos2d-x project */ -#include "Matrix.h" -#include "Quaternion.h" -#include "MathUtil.h" +#include "math/Mat4.h" +#include "math/Quaternion.h" +#include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Matrix.h b/cocos/math/Mat4.h similarity index 99% rename from cocos/math/Matrix.h rename to cocos/math/Mat4.h index 1513599f53..077e5c0882 100644 --- a/cocos/math/Matrix.h +++ b/cocos/math/Mat4.h @@ -21,8 +21,8 @@ #ifndef MATH_MAT4_H #define MATH_MAT4_H -#include "math/Vector3.h" -#include "math/Vector4.h" +#include "math/Vec3.h" +#include "math/Vec4.h" NS_CC_MATH_BEGIN @@ -980,6 +980,6 @@ inline const Vec4 operator*(const Mat4& m, const Vec4& v); NS_CC_MATH_END -#include "Matrix.inl" +#include "math/Mat4.inl" #endif // MATH_MAT4_H diff --git a/cocos/math/Matrix.inl b/cocos/math/Mat4.inl similarity index 98% rename from cocos/math/Matrix.inl rename to cocos/math/Mat4.inl index 3ae3fc8c2d..ca01271d7c 100644 --- a/cocos/math/Matrix.inl +++ b/cocos/math/Mat4.inl @@ -18,7 +18,7 @@ This file was modified to fit the cocos2d-x project */ -#include "Matrix.h" +#include "math/Mat4.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Quaternion.h b/cocos/math/Quaternion.h index 73a7163807..bd8bc47db3 100644 --- a/cocos/math/Quaternion.h +++ b/cocos/math/Quaternion.h @@ -21,8 +21,8 @@ #ifndef QUATERNION_H_ #define QUATERNION_H_ -#include "Vector3.h" -#include "Matrix.h" +#include "math/Vec3.h" +#include "math/Mat4.h" //#include "Plane.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Vector2.cpp b/cocos/math/Vec2.cpp similarity index 98% rename from cocos/math/Vector2.cpp rename to cocos/math/Vec2.cpp index 0b0df415cd..c12a8e5ad3 100644 --- a/cocos/math/Vector2.cpp +++ b/cocos/math/Vec2.cpp @@ -18,7 +18,7 @@ This file was modified to fit the cocos2d-x project */ -#include "math/Vector2.h" +#include "math/Vec2.h" #include "math/MathUtil.h" #include "base/ccMacros.h" @@ -27,10 +27,10 @@ NS_CC_MATH_BEGIN // returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E) { - float ABmin = MIN(A, B); - float ABmax = MAX(A, B); - float CDmin = MIN(C, D); - float CDmax = MAX(C, D); + float ABmin = std::min(A, B); + float ABmax = std::max(A, B); + float CDmin = std::min(C, D); + float CDmax = std::max(C, D); if (ABmax < CDmin || CDmax < ABmin) { diff --git a/cocos/math/Vector2.h b/cocos/math/Vec2.h similarity index 99% rename from cocos/math/Vector2.h rename to cocos/math/Vec2.h index 0b5d9cb9c7..059d646c88 100644 --- a/cocos/math/Vector2.h +++ b/cocos/math/Vec2.h @@ -747,6 +747,6 @@ typedef Vec2 Point2; NS_CC_MATH_END -#include "Vector2.inl" +#include "Vec2.inl" #endif // MATH_VEC2_H diff --git a/cocos/math/Vector2.inl b/cocos/math/Vec2.inl similarity index 98% rename from cocos/math/Vector2.inl rename to cocos/math/Vec2.inl index 9108765efc..329208b1e5 100644 --- a/cocos/math/Vector2.inl +++ b/cocos/math/Vec2.inl @@ -18,7 +18,7 @@ This file was modified to fit the cocos2d-x project */ -#include "Vector2.h" +#include "math/Vec2.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Vector3.cpp b/cocos/math/Vec3.cpp similarity index 99% rename from cocos/math/Vector3.cpp rename to cocos/math/Vec3.cpp index 766aa822e3..63955842c0 100644 --- a/cocos/math/Vector3.cpp +++ b/cocos/math/Vec3.cpp @@ -18,8 +18,8 @@ This file was modified to fit the cocos2d-x project */ -#include "Vector3.h" -#include "MathUtil.h" +#include "math/Vec3.h" +#include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Vector3.h b/cocos/math/Vec3.h similarity index 99% rename from cocos/math/Vector3.h rename to cocos/math/Vec3.h index 2ebfa8fd88..5521ab1505 100644 --- a/cocos/math/Vector3.h +++ b/cocos/math/Vec3.h @@ -471,6 +471,6 @@ typedef Vec3 Point3; NS_CC_MATH_END -#include "Vector3.inl" +#include "Vec3.inl" #endif // MATH_VEC3_H diff --git a/cocos/math/Vector3.inl b/cocos/math/Vec3.inl similarity index 97% rename from cocos/math/Vector3.inl rename to cocos/math/Vec3.inl index 8bd30d61c0..2bfbc74d8d 100644 --- a/cocos/math/Vector3.inl +++ b/cocos/math/Vec3.inl @@ -18,8 +18,8 @@ This file was modified to fit the cocos2d-x project */ -#include "Vector3.h" -#include "Matrix.h" +#include "math/Vec3.h" +#include "math/Mat4.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Vector4.cpp b/cocos/math/Vec4.cpp similarity index 99% rename from cocos/math/Vector4.cpp rename to cocos/math/Vec4.cpp index 3c8f8223c1..c78281300b 100644 --- a/cocos/math/Vector4.cpp +++ b/cocos/math/Vec4.cpp @@ -18,8 +18,8 @@ This file was modified to fit the cocos2d-x project */ -#include "Vector4.h" -#include "MathUtil.h" +#include "math/Vec4.h" +#include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN diff --git a/cocos/math/Vector4.h b/cocos/math/Vec4.h similarity index 99% rename from cocos/math/Vector4.h rename to cocos/math/Vec4.h index ce12686b92..2523978ce4 100644 --- a/cocos/math/Vector4.h +++ b/cocos/math/Vec4.h @@ -446,6 +446,6 @@ inline const Vec4 operator*(float x, const Vec4& v); NS_CC_MATH_END -#include "Vector4.inl" +#include "math/Vec4.inl" #endif // MATH_VEC4_H diff --git a/cocos/math/Vector4.inl b/cocos/math/Vec4.inl similarity index 97% rename from cocos/math/Vector4.inl rename to cocos/math/Vec4.inl index 9bdd7a9920..d69aee16f1 100644 --- a/cocos/math/Vector4.inl +++ b/cocos/math/Vec4.inl @@ -18,8 +18,8 @@ This file was modified to fit the cocos2d-x project */ -#include "Matrix.h" -#include "Vector4.h" +#include "math/Mat4.h" +#include "math/Vec4.h" NS_CC_MATH_BEGIN diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index da18c9f2b9..2af83c8dee 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -38,7 +38,7 @@ #include "curl/curl.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/CCApplicationProtocol.h b/cocos/platform/CCApplicationProtocol.h similarity index 100% rename from cocos/2d/platform/CCApplicationProtocol.h rename to cocos/platform/CCApplicationProtocol.h diff --git a/cocos/2d/platform/CCCommon.h b/cocos/platform/CCCommon.h similarity index 100% rename from cocos/2d/platform/CCCommon.h rename to cocos/platform/CCCommon.h diff --git a/cocos/2d/platform/CCDevice.h b/cocos/platform/CCDevice.h similarity index 100% rename from cocos/2d/platform/CCDevice.h rename to cocos/platform/CCDevice.h diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp similarity index 99% rename from cocos/2d/platform/CCFileUtils.cpp rename to cocos/platform/CCFileUtils.cpp index e615f70e21..af4a22ab26 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -24,13 +24,17 @@ THE SOFTWARE. ****************************************************************************/ #include "CCFileUtils.h" + +#include + #include "base/CCData.h" #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "CCSAXParser.h" +#include "platform/CCSAXParser.h" + #include "tinyxml2.h" #include "unzip.h" -#include + using namespace std; diff --git a/cocos/2d/platform/CCFileUtils.h b/cocos/platform/CCFileUtils.h similarity index 100% rename from cocos/2d/platform/CCFileUtils.h rename to cocos/platform/CCFileUtils.h index 567f17249c..60e899ed35 100644 --- a/cocos/2d/platform/CCFileUtils.h +++ b/cocos/platform/CCFileUtils.h @@ -25,15 +25,15 @@ THE SOFTWARE. #ifndef __CC_FILEUTILS_H__ #define __CC_FILEUTILS_H__ +#include +#include +#include + #include "base/CCPlatformMacros.h" #include "base/ccTypes.h" #include "base/CCValue.h" #include "base/CCData.h" -#include -#include -#include - NS_CC_BEGIN /** diff --git a/cocos/2d/platform/CCGLViewProtocol.cpp b/cocos/platform/CCGLViewProtocol.cpp similarity index 99% rename from cocos/2d/platform/CCGLViewProtocol.cpp rename to cocos/platform/CCGLViewProtocol.cpp index ffd2632bce..d2f821ac8b 100644 --- a/cocos/2d/platform/CCGLViewProtocol.cpp +++ b/cocos/platform/CCGLViewProtocol.cpp @@ -23,7 +23,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCGLViewProtocol.h" +#include "platform/CCGLViewProtocol.h" + #include "base/CCTouch.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" diff --git a/cocos/2d/platform/CCGLViewProtocol.h b/cocos/platform/CCGLViewProtocol.h similarity index 100% rename from cocos/2d/platform/CCGLViewProtocol.h rename to cocos/platform/CCGLViewProtocol.h diff --git a/cocos/2d/platform/CCImage.cpp b/cocos/platform/CCImage.cpp similarity index 99% rename from cocos/2d/platform/CCImage.cpp rename to cocos/platform/CCImage.cpp index 254ab5b880..193fe50d53 100644 --- a/cocos/2d/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -24,12 +24,14 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCImage.h" -#include "base/CCData.h" +#include "platform/CCImage.h" #include #include +#include "base/CCData.h" + + #ifdef EMSCRIPTEN #include #include @@ -44,7 +46,7 @@ extern "C" } #include "base/s3tc.h" #include "base/atitc.h" -#include "2d/TGAlib.h" +#include "base/TGAlib.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) && (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) #include "decode.h" @@ -55,7 +57,7 @@ extern "C" #include "CCStdC.h" #include "CCFileUtils.h" #include "base/CCConfiguration.h" -#include "2d/ccUtils.h" +#include "base/ccUtils.h" #include "base/ZipUtils.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "android/CCFileUtilsAndroid.h" diff --git a/cocos/2d/platform/CCImage.h b/cocos/platform/CCImage.h similarity index 99% rename from cocos/2d/platform/CCImage.h rename to cocos/platform/CCImage.h index 000beace1a..6762204b05 100644 --- a/cocos/2d/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CC_IMAGE_H__ #include "base/CCRef.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" // premultiply alpha, or the effect will wrong when want to use other pixel format in Texture2D, // such as RGB888, RGB5A1 diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/platform/CCSAXParser.cpp similarity index 98% rename from cocos/2d/platform/CCSAXParser.cpp rename to cocos/platform/CCSAXParser.cpp index 75dd1c0415..e9c0acf702 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/platform/CCSAXParser.cpp @@ -22,12 +22,14 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCSAXParser.h" -#include "CCFileUtils.h" -#include "tinyxml2.h" +#include "platform/CCSAXParser.h" #include // because its based on windows 8 build :P +#include "platform/CCFileUtils.h" +#include "tinyxml2.h" + + NS_CC_BEGIN class XmlSaxHander : public tinyxml2::XMLVisitor diff --git a/cocos/2d/platform/CCSAXParser.h b/cocos/platform/CCSAXParser.h similarity index 98% rename from cocos/2d/platform/CCSAXParser.h rename to cocos/platform/CCSAXParser.h index 2564bb0a40..601e87d831 100644 --- a/cocos/2d/platform/CCSAXParser.h +++ b/cocos/platform/CCSAXParser.h @@ -25,7 +25,7 @@ #define __CCSAXPARSER_H__ #include "base/CCPlatformConfig.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/CCThread.cpp b/cocos/platform/CCThread.cpp similarity index 98% rename from cocos/2d/platform/CCThread.cpp rename to cocos/platform/CCThread.cpp index b3e9e96c39..08c9588b7f 100644 --- a/cocos/2d/platform/CCThread.cpp +++ b/cocos/platform/CCThread.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCThread.h" +#include "platform/CCThread.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/CCThread.h b/cocos/platform/CCThread.h similarity index 98% rename from cocos/2d/platform/CCThread.h rename to cocos/platform/CCThread.h index 8783b82413..f2c6453f9f 100644 --- a/cocos/2d/platform/CCThread.h +++ b/cocos/platform/CCThread.h @@ -29,7 +29,8 @@ THE SOFTWARE. #include #include #include -#include "2d/platform/CCCommon.h" + +#include "platform/CCCommon.h" #include "base/CCPlatformMacros.h" #include "base/CCDirector.h" diff --git a/cocos/platform/CMakeLists.txt b/cocos/platform/CMakeLists.txt new file mode 100644 index 0000000000..c3ab0850e5 --- /dev/null +++ b/cocos/platform/CMakeLists.txt @@ -0,0 +1,43 @@ +if(WIN32) + +ADD_DEFINITIONS(-DUNICODE -D_UNICODE) + +set(COCOS_PLATFORM_SPECIFIC_SRC + platform/win32/CCStdC.cpp + platform/win32/CCFileUtilsWin32.cpp + platform/win32/CCCommon.cpp + platform/win32/CCApplication.cpp + platform/win32/CCDevice.cpp +) + +elseif(APPLE) + +else() + +set(COCOS_PLATFORM_SPECIFIC_SRC + platform/linux/CCStdC.cpp + platform/linux/CCFileUtilsLinux.cpp + platform/linux/CCCommon.cpp + platform/linux/CCApplication.cpp + platform/linux/CCDevice.cpp +) + +endif() + +include_directories( + ../external/ConvertUTF +) + +set(COCOS_PLATFORM_SRC + platform/CCSAXParser.cpp + platform/CCThread.cpp + platform/CCGLViewProtocol.cpp + platform/CCFileUtils.cpp + platform/CCImage.cpp + platform/desktop/CCGLView.cpp + ../external/edtaa3func/edtaa3func.cpp + ../external/ConvertUTF/ConvertUTFWrapper.cpp + ../external/ConvertUTF/ConvertUTF.c + ${COCOS_PLATFORM_SPECIFIC_SRC} +) + diff --git a/cocos/2d/platform/android/Android.mk b/cocos/platform/android/Android.mk similarity index 100% rename from cocos/2d/platform/android/Android.mk rename to cocos/platform/android/Android.mk diff --git a/cocos/2d/platform/android/CCApplication.cpp b/cocos/platform/android/CCApplication.cpp similarity index 100% rename from cocos/2d/platform/android/CCApplication.cpp rename to cocos/platform/android/CCApplication.cpp diff --git a/cocos/2d/platform/android/CCApplication.h b/cocos/platform/android/CCApplication.h similarity index 97% rename from cocos/2d/platform/android/CCApplication.h rename to cocos/platform/android/CCApplication.h index 226a006fce..9a921d7b75 100644 --- a/cocos/2d/platform/android/CCApplication.h +++ b/cocos/platform/android/CCApplication.h @@ -29,8 +29,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCApplicationProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/CCCommon.cpp b/cocos/platform/android/CCCommon.cpp similarity index 98% rename from cocos/2d/platform/android/CCCommon.cpp rename to cocos/platform/android/CCCommon.cpp index c8a96de0fd..0692077c21 100644 --- a/cocos/2d/platform/android/CCCommon.cpp +++ b/cocos/platform/android/CCCommon.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include #include diff --git a/cocos/2d/platform/android/CCDevice.cpp b/cocos/platform/android/CCDevice.cpp similarity index 99% rename from cocos/2d/platform/android/CCDevice.cpp rename to cocos/platform/android/CCDevice.cpp index 2a4cca9c5f..fc5a0902f8 100644 --- a/cocos/2d/platform/android/CCDevice.cpp +++ b/cocos/platform/android/CCDevice.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "2d/platform/CCDevice.h" +#include "platform/CCDevice.h" #include #include #include @@ -34,7 +34,7 @@ THE SOFTWARE. #include "jni/DPIJni.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include "jni/JniHelper.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp b/cocos/platform/android/CCFileUtilsAndroid.cpp similarity index 99% rename from cocos/2d/platform/android/CCFileUtilsAndroid.cpp rename to cocos/platform/android/CCFileUtilsAndroid.cpp index 700e721922..e4ff00dec6 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos/platform/android/CCFileUtilsAndroid.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #include "CCFileUtilsAndroid.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" #include "android/asset_manager.h" #include "android/asset_manager_jni.h" diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.h b/cocos/platform/android/CCFileUtilsAndroid.h similarity index 98% rename from cocos/2d/platform/android/CCFileUtilsAndroid.h rename to cocos/platform/android/CCFileUtilsAndroid.h index cad3d13a29..9639c0daed 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.h +++ b/cocos/platform/android/CCFileUtilsAndroid.h @@ -28,7 +28,7 @@ Copyright (c) 2013-2014 Chukong Technologies Inc. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/CCPlatformMacros.h" #include "base/ccTypes.h" #include diff --git a/cocos/2d/platform/android/CCGL.h b/cocos/platform/android/CCGL.h similarity index 100% rename from cocos/2d/platform/android/CCGL.h rename to cocos/platform/android/CCGL.h diff --git a/cocos/2d/platform/android/CCGLView.cpp b/cocos/platform/android/CCGLView.cpp similarity index 100% rename from cocos/2d/platform/android/CCGLView.cpp rename to cocos/platform/android/CCGLView.cpp diff --git a/cocos/2d/platform/android/CCGLView.h b/cocos/platform/android/CCGLView.h similarity index 98% rename from cocos/2d/platform/android/CCGLView.h rename to cocos/platform/android/CCGLView.h index d8ea2b93de..6423d7019d 100644 --- a/cocos/2d/platform/android/CCGLView.h +++ b/cocos/platform/android/CCGLView.h @@ -31,7 +31,7 @@ THE SOFTWARE. #include "base/CCRef.h" #include "math/CCGeometry.h" -#include "2d/platform/CCGLViewProtocol.h" +#include "platform/CCGLViewProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/CCPlatformDefine.h b/cocos/platform/android/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/android/CCPlatformDefine.h rename to cocos/platform/android/CCPlatformDefine.h diff --git a/cocos/2d/platform/android/CCStdC.h b/cocos/platform/android/CCStdC.h similarity index 100% rename from cocos/2d/platform/android/CCStdC.h rename to cocos/platform/android/CCStdC.h diff --git a/cocos/2d/platform/android/java/.classpath b/cocos/platform/android/java/.classpath similarity index 100% rename from cocos/2d/platform/android/java/.classpath rename to cocos/platform/android/java/.classpath diff --git a/cocos/2d/platform/android/java/.project b/cocos/platform/android/java/.project similarity index 100% rename from cocos/2d/platform/android/java/.project rename to cocos/platform/android/java/.project diff --git a/cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs b/cocos/platform/android/java/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs rename to cocos/platform/android/java/.settings/org.eclipse.jdt.core.prefs diff --git a/cocos/2d/platform/android/java/AndroidManifest.xml b/cocos/platform/android/java/AndroidManifest.xml similarity index 100% rename from cocos/2d/platform/android/java/AndroidManifest.xml rename to cocos/platform/android/java/AndroidManifest.xml diff --git a/cocos/2d/platform/android/java/ant.properties b/cocos/platform/android/java/ant.properties similarity index 100% rename from cocos/2d/platform/android/java/ant.properties rename to cocos/platform/android/java/ant.properties diff --git a/cocos/2d/platform/android/java/build.xml b/cocos/platform/android/java/build.xml similarity index 100% rename from cocos/2d/platform/android/java/build.xml rename to cocos/platform/android/java/build.xml diff --git a/cocos/2d/platform/android/java/proguard-project.txt b/cocos/platform/android/java/proguard-project.txt similarity index 100% rename from cocos/2d/platform/android/java/proguard-project.txt rename to cocos/platform/android/java/proguard-project.txt diff --git a/cocos/2d/platform/android/java/res/.gitignore b/cocos/platform/android/java/res/.gitignore similarity index 100% rename from cocos/2d/platform/android/java/res/.gitignore rename to cocos/platform/android/java/res/.gitignore diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHandler.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTextInputWraper.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java diff --git a/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java similarity index 100% rename from cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java rename to cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java diff --git a/cocos/2d/platform/android/javaactivity.cpp b/cocos/platform/android/javaactivity.cpp similarity index 89% rename from cocos/2d/platform/android/javaactivity.cpp rename to cocos/platform/android/javaactivity.cpp index b4d265d162..58524d839a 100644 --- a/cocos/2d/platform/android/javaactivity.cpp +++ b/cocos/platform/android/javaactivity.cpp @@ -22,14 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "base/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + #include "CCApplication.h" -#include "CCDirector.h" -#include "CCDrawingPrimitives.h" -#include "CCEventCustom.h" -#include "CCEventType.h" +#include "base/CCDirector.h" +#include "base/CCEventCustom.h" +#include "base/CCEventType.h" +#include "renderer/CCGLProgramCache.h" +#include "renderer/CCTextureCache.h" +#include "2d/CCDrawingPrimitives.h" #include "CCGLView.h" -#include "CCGLProgramCache.h" -#include "CCTextureCache.h" #include "platform/android/jni/JniHelper.h" #include #include @@ -83,6 +86,8 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnSurfaceChanged(JNIEnv* env, { cocos2d::Application::getInstance()->applicationScreenSizeChanged(w, h); } - - + } + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + diff --git a/cocos/2d/platform/android/jni/DPIJni.cpp b/cocos/platform/android/jni/DPIJni.cpp similarity index 100% rename from cocos/2d/platform/android/jni/DPIJni.cpp rename to cocos/platform/android/jni/DPIJni.cpp diff --git a/cocos/2d/platform/android/jni/DPIJni.h b/cocos/platform/android/jni/DPIJni.h similarity index 100% rename from cocos/2d/platform/android/jni/DPIJni.h rename to cocos/platform/android/jni/DPIJni.h diff --git a/cocos/2d/platform/android/jni/IMEJni.cpp b/cocos/platform/android/jni/IMEJni.cpp similarity index 98% rename from cocos/2d/platform/android/jni/IMEJni.cpp rename to cocos/platform/android/jni/IMEJni.cpp index ea96931c28..8d9c00d5ee 100644 --- a/cocos/2d/platform/android/jni/IMEJni.cpp +++ b/cocos/platform/android/jni/IMEJni.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "IMEJni.h" -#include "CCIMEDispatcher.h" +#include "base/CCIMEDispatcher.h" #include "JniHelper.h" #include diff --git a/cocos/2d/platform/android/jni/IMEJni.h b/cocos/platform/android/jni/IMEJni.h similarity index 100% rename from cocos/2d/platform/android/jni/IMEJni.h rename to cocos/platform/android/jni/IMEJni.h diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp similarity index 86% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp index d61ddc4dc6..23199fe053 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp @@ -1,8 +1,8 @@ #include "JniHelper.h" #include -#include "CCDirector.h" -#include "CCEventDispatcher.h" -#include "CCEventAcceleration.h" +#include "base/CCDirector.h" +#include "base/CCEventDispatcher.h" +#include "base/CCEventAcceleration.h" #define TG3_GRAVITY_EARTH (9.80665f) diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp similarity index 98% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp index bdd9ee815f..1218a08dd4 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "JniHelper.h" #include -#include "CCDirector.h" +#include "base/CCDirector.h" #include "../CCApplication.h" #include "platform/CCFileUtils.h" #include diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h similarity index 100% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp similarity index 100% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h similarity index 100% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp similarity index 94% rename from cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp rename to cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp index 38886285df..28b4ba3bbf 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp @@ -1,8 +1,8 @@ -#include "CCIMEDispatcher.h" -#include "CCDirector.h" +#include "base/CCIMEDispatcher.h" +#include "base/CCDirector.h" +#include "base/CCEventType.h" #include "../CCApplication.h" #include "platform/CCFileUtils.h" -#include "CCEventType.h" #include "JniHelper.h" #include diff --git a/cocos/2d/platform/android/jni/JniHelper.cpp b/cocos/platform/android/jni/JniHelper.cpp similarity index 100% rename from cocos/2d/platform/android/jni/JniHelper.cpp rename to cocos/platform/android/jni/JniHelper.cpp diff --git a/cocos/2d/platform/android/jni/JniHelper.h b/cocos/platform/android/jni/JniHelper.h similarity index 100% rename from cocos/2d/platform/android/jni/JniHelper.h rename to cocos/platform/android/jni/JniHelper.h diff --git a/cocos/2d/platform/android/jni/TouchesJni.cpp b/cocos/platform/android/jni/TouchesJni.cpp similarity index 98% rename from cocos/2d/platform/android/jni/TouchesJni.cpp rename to cocos/platform/android/jni/TouchesJni.cpp index 3d53f3204b..023b7fba93 100644 --- a/cocos/2d/platform/android/jni/TouchesJni.cpp +++ b/cocos/platform/android/jni/TouchesJni.cpp @@ -21,8 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDirector.h" -#include "CCEventKeyboard.h" +#include "base/CCDirector.h" +#include "base/CCEventKeyboard.h" #include "CCGLView.h" #include diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.h b/cocos/platform/apple/CCFileUtilsApple.h similarity index 100% rename from cocos/2d/platform/apple/CCFileUtilsApple.h rename to cocos/platform/apple/CCFileUtilsApple.h diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.mm b/cocos/platform/apple/CCFileUtilsApple.mm similarity index 100% rename from cocos/2d/platform/apple/CCFileUtilsApple.mm rename to cocos/platform/apple/CCFileUtilsApple.mm diff --git a/cocos/2d/platform/apple/CCLock.cpp b/cocos/platform/apple/CCLock.cpp similarity index 100% rename from cocos/2d/platform/apple/CCLock.cpp rename to cocos/platform/apple/CCLock.cpp diff --git a/cocos/2d/platform/apple/CCLock.h b/cocos/platform/apple/CCLock.h similarity index 100% rename from cocos/2d/platform/apple/CCLock.h rename to cocos/platform/apple/CCLock.h diff --git a/cocos/2d/platform/apple/CCThread.mm b/cocos/platform/apple/CCThread.mm similarity index 100% rename from cocos/2d/platform/apple/CCThread.mm rename to cocos/platform/apple/CCThread.mm diff --git a/cocos/2d/platform/desktop/CCGLView.cpp b/cocos/platform/desktop/CCGLView.cpp similarity index 99% rename from cocos/2d/platform/desktop/CCGLView.cpp rename to cocos/platform/desktop/CCGLView.cpp index 30077f7130..702244a29e 100644 --- a/cocos/2d/platform/desktop/CCGLView.cpp +++ b/cocos/platform/desktop/CCGLView.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "base/CCEventDispatcher.h" #include "base/CCEventKeyboard.h" #include "base/CCEventMouse.h" -#include "2d/CCIMEDispatcher.h" +#include "base/CCIMEDispatcher.h" #include diff --git a/cocos/2d/platform/desktop/CCGLView.h b/cocos/platform/desktop/CCGLView.h similarity index 98% rename from cocos/2d/platform/desktop/CCGLView.h rename to cocos/platform/desktop/CCGLView.h index 8160855ea8..065578730f 100644 --- a/cocos/2d/platform/desktop/CCGLView.h +++ b/cocos/platform/desktop/CCGLView.h @@ -27,8 +27,8 @@ THE SOFTWARE. #define __CC_EGLVIEW_DESKTOP_H__ #include "base/CCRef.h" -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCGLViewProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCGLViewProtocol.h" #include "glfw3.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/ios/CCApplication.h b/cocos/platform/ios/CCApplication.h similarity index 97% rename from cocos/2d/platform/ios/CCApplication.h rename to cocos/platform/ios/CCApplication.h index 64073ca7f7..b41cabd53a 100644 --- a/cocos/2d/platform/ios/CCApplication.h +++ b/cocos/platform/ios/CCApplication.h @@ -29,8 +29,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCApplicationProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/ios/CCApplication.mm b/cocos/platform/ios/CCApplication.mm similarity index 100% rename from cocos/2d/platform/ios/CCApplication.mm rename to cocos/platform/ios/CCApplication.mm diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/platform/ios/CCCommon.mm similarity index 97% rename from cocos/2d/platform/ios/CCCommon.mm rename to cocos/platform/ios/CCCommon.mm index 4607ba6e9f..6f1ee35d76 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/platform/ios/CCCommon.mm @@ -26,7 +26,7 @@ #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include #include diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm similarity index 100% rename from cocos/2d/platform/ios/CCDevice.mm rename to cocos/platform/ios/CCDevice.mm diff --git a/cocos/2d/platform/ios/CCDirectorCaller.h b/cocos/platform/ios/CCDirectorCaller.h similarity index 92% rename from cocos/2d/platform/ios/CCDirectorCaller.h rename to cocos/platform/ios/CCDirectorCaller.h index f3b4ee4c92..c48a0598f4 100644 --- a/cocos/2d/platform/ios/CCDirectorCaller.h +++ b/cocos/platform/ios/CCDirectorCaller.h @@ -22,6 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + +#include "base/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import @interface CCDirectorCaller : NSObject { @@ -35,3 +39,6 @@ +(id) sharedDirectorCaller; +(void) destroy; @end + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCDirectorCaller.mm b/cocos/platform/ios/CCDirectorCaller.mm similarity index 96% rename from cocos/2d/platform/ios/CCDirectorCaller.mm rename to cocos/platform/ios/CCDirectorCaller.mm index f254530736..4adf295793 100644 --- a/cocos/2d/platform/ios/CCDirectorCaller.mm +++ b/cocos/platform/ios/CCDirectorCaller.mm @@ -22,6 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + +#include "base/CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import #import "CCDirectorCaller.h" @@ -101,3 +105,6 @@ static id s_sharedDirectorCaller; } @end + +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCEAGLView.h b/cocos/platform/ios/CCEAGLView.h similarity index 100% rename from cocos/2d/platform/ios/CCEAGLView.h rename to cocos/platform/ios/CCEAGLView.h diff --git a/cocos/2d/platform/ios/CCEAGLView.mm b/cocos/platform/ios/CCEAGLView.mm similarity index 100% rename from cocos/2d/platform/ios/CCEAGLView.mm rename to cocos/platform/ios/CCEAGLView.mm diff --git a/cocos/2d/platform/ios/CCES2Renderer.h b/cocos/platform/ios/CCES2Renderer.h similarity index 100% rename from cocos/2d/platform/ios/CCES2Renderer.h rename to cocos/platform/ios/CCES2Renderer.h diff --git a/cocos/2d/platform/ios/CCES2Renderer.m b/cocos/platform/ios/CCES2Renderer.m similarity index 100% rename from cocos/2d/platform/ios/CCES2Renderer.m rename to cocos/platform/ios/CCES2Renderer.m diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/platform/ios/CCESRenderer.h similarity index 100% rename from cocos/2d/platform/ios/CCESRenderer.h rename to cocos/platform/ios/CCESRenderer.h diff --git a/cocos/2d/platform/ios/CCGL.h b/cocos/platform/ios/CCGL.h similarity index 100% rename from cocos/2d/platform/ios/CCGL.h rename to cocos/platform/ios/CCGL.h diff --git a/cocos/2d/platform/ios/CCGLView.h b/cocos/platform/ios/CCGLView.h similarity index 97% rename from cocos/2d/platform/ios/CCGLView.h rename to cocos/platform/ios/CCGLView.h index 8529ee1bfd..d5a62dd084 100644 --- a/cocos/2d/platform/ios/CCGLView.h +++ b/cocos/platform/ios/CCGLView.h @@ -30,8 +30,8 @@ #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS #include "base/CCRef.h" -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCGLViewProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCGLViewProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/ios/CCGLView.mm b/cocos/platform/ios/CCGLView.mm similarity index 99% rename from cocos/2d/platform/ios/CCGLView.mm rename to cocos/platform/ios/CCGLView.mm index c5490ebf08..fa7844a2fb 100644 --- a/cocos/2d/platform/ios/CCGLView.mm +++ b/cocos/platform/ios/CCGLView.mm @@ -24,7 +24,6 @@ ****************************************************************************/ #include "base/CCPlatformConfig.h" - #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS #import diff --git a/cocos/2d/platform/ios/CCImage.mm b/cocos/platform/ios/CCImage.mm similarity index 98% rename from cocos/2d/platform/ios/CCImage.mm rename to cocos/platform/ios/CCImage.mm index 4a49ec0eb5..71ebce91a2 100644 --- a/cocos/2d/platform/ios/CCImage.mm +++ b/cocos/platform/ios/CCImage.mm @@ -26,14 +26,14 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS -#import "2d/platform/CCImage.h" -#import "2d/platform/CCCommon.h" +#import "platform/CCImage.h" +#import "platform/CCCommon.h" #import #import #import -#include +#include NS_CC_BEGIN diff --git a/cocos/2d/platform/ios/CCPlatformDefine.h b/cocos/platform/ios/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/ios/CCPlatformDefine.h rename to cocos/platform/ios/CCPlatformDefine.h diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/platform/ios/CCStdC.h similarity index 100% rename from cocos/2d/platform/ios/CCStdC.h rename to cocos/platform/ios/CCStdC.h diff --git a/cocos/2d/platform/ios/OpenGL_Internal.h b/cocos/platform/ios/OpenGL_Internal.h similarity index 100% rename from cocos/2d/platform/ios/OpenGL_Internal.h rename to cocos/platform/ios/OpenGL_Internal.h diff --git a/cocos/2d/platform/linux/CCApplication.cpp b/cocos/platform/linux/CCApplication.cpp similarity index 99% rename from cocos/2d/platform/linux/CCApplication.cpp rename to cocos/platform/linux/CCApplication.cpp index 89529c8553..ad4e47bc0a 100644 --- a/cocos/2d/platform/linux/CCApplication.cpp +++ b/cocos/platform/linux/CCApplication.cpp @@ -31,7 +31,7 @@ THE SOFTWARE. #include #include #include "base/CCDirector.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "CCGLView.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/linux/CCApplication.h b/cocos/platform/linux/CCApplication.h similarity index 97% rename from cocos/2d/platform/linux/CCApplication.h rename to cocos/platform/linux/CCApplication.h index 2582e89a0d..f8fadac55e 100644 --- a/cocos/2d/platform/linux/CCApplication.h +++ b/cocos/platform/linux/CCApplication.h @@ -29,8 +29,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCApplicationProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/linux/CCCommon.cpp b/cocos/platform/linux/CCCommon.cpp similarity index 97% rename from cocos/2d/platform/linux/CCCommon.cpp rename to cocos/platform/linux/CCCommon.cpp index adf4576bd0..320f96d108 100644 --- a/cocos/2d/platform/linux/CCCommon.cpp +++ b/cocos/platform/linux/CCCommon.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "CCStdC.h" #include "base/CCConsole.h" diff --git a/cocos/2d/platform/linux/CCDevice.cpp b/cocos/platform/linux/CCDevice.cpp similarity index 99% rename from cocos/2d/platform/linux/CCDevice.cpp rename to cocos/platform/linux/CCDevice.cpp index 262c4301e7..5e007f7d28 100644 --- a/cocos/2d/platform/linux/CCDevice.cpp +++ b/cocos/platform/linux/CCDevice.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#include "2d/platform/CCDevice.h" +#include "platform/CCDevice.h" #include #include @@ -36,7 +36,7 @@ THE SOFTWARE. #include #include #include -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "ft2build.h" #include FT_FREETYPE_H diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp b/cocos/platform/linux/CCFileUtilsLinux.cpp similarity index 99% rename from cocos/2d/platform/linux/CCFileUtilsLinux.cpp rename to cocos/platform/linux/CCFileUtilsLinux.cpp index f65f4da3e9..dfb882c885 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp +++ b/cocos/platform/linux/CCFileUtilsLinux.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX #include "CCFileUtilsLinux.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/ccMacros.h" #include "CCApplication.h" #include "deprecated/CCString.h" diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.h b/cocos/platform/linux/CCFileUtilsLinux.h similarity index 98% rename from cocos/2d/platform/linux/CCFileUtilsLinux.h rename to cocos/platform/linux/CCFileUtilsLinux.h index a1b45e8e29..e9a38a61eb 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.h +++ b/cocos/platform/linux/CCFileUtilsLinux.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/CCPlatformMacros.h" #include "base/ccTypes.h" #include diff --git a/cocos/2d/platform/linux/CCGL.h b/cocos/platform/linux/CCGL.h similarity index 100% rename from cocos/2d/platform/linux/CCGL.h rename to cocos/platform/linux/CCGL.h diff --git a/cocos/2d/platform/linux/CCPlatformDefine.h b/cocos/platform/linux/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/linux/CCPlatformDefine.h rename to cocos/platform/linux/CCPlatformDefine.h diff --git a/cocos/2d/platform/linux/CCStdC.cpp b/cocos/platform/linux/CCStdC.cpp similarity index 100% rename from cocos/2d/platform/linux/CCStdC.cpp rename to cocos/platform/linux/CCStdC.cpp diff --git a/cocos/2d/platform/linux/CCStdC.h b/cocos/platform/linux/CCStdC.h similarity index 100% rename from cocos/2d/platform/linux/CCStdC.h rename to cocos/platform/linux/CCStdC.h diff --git a/cocos/2d/platform/mac/CCApplication.h b/cocos/platform/mac/CCApplication.h similarity index 97% rename from cocos/2d/platform/mac/CCApplication.h rename to cocos/platform/mac/CCApplication.h index 1e8f52d130..0655b4120b 100644 --- a/cocos/2d/platform/mac/CCApplication.h +++ b/cocos/platform/mac/CCApplication.h @@ -29,8 +29,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCApplicationProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCApplication.mm b/cocos/platform/mac/CCApplication.mm similarity index 99% rename from cocos/2d/platform/mac/CCApplication.mm rename to cocos/platform/mac/CCApplication.mm index d311c1d1b4..2f352d57d5 100644 --- a/cocos/2d/platform/mac/CCApplication.mm +++ b/cocos/platform/mac/CCApplication.mm @@ -27,12 +27,13 @@ THE SOFTWARE. #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC #import "CCApplication.h" + #import #include -#include "2d/platform/CCFileUtils.h" + +#include "platform/CCFileUtils.h" #include "math/CCGeometry.h" #include "base/CCDirector.h" -#import "CCDirectorCaller.h" #include "CCGLView.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCCommon.mm b/cocos/platform/mac/CCCommon.mm similarity index 98% rename from cocos/2d/platform/mac/CCCommon.mm rename to cocos/platform/mac/CCCommon.mm index be3c7b3cad..4e042bd14e 100644 --- a/cocos/2d/platform/mac/CCCommon.mm +++ b/cocos/platform/mac/CCCommon.mm @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "base/CCDirector.h" #include "CCGLView.h" diff --git a/cocos/2d/platform/mac/CCDevice.mm b/cocos/platform/mac/CCDevice.mm similarity index 99% rename from cocos/2d/platform/mac/CCDevice.mm rename to cocos/platform/mac/CCDevice.mm index 9130d39315..0d13a3a586 100644 --- a/cocos/2d/platform/mac/CCDevice.mm +++ b/cocos/platform/mac/CCDevice.mm @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC -#include "2d/platform/CCDevice.h" +#include "platform/CCDevice.h" #include #include #include diff --git a/cocos/2d/platform/mac/CCGL.h b/cocos/platform/mac/CCGL.h similarity index 100% rename from cocos/2d/platform/mac/CCGL.h rename to cocos/platform/mac/CCGL.h diff --git a/cocos/2d/platform/mac/CCPlatformDefine.h b/cocos/platform/mac/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/mac/CCPlatformDefine.h rename to cocos/platform/mac/CCPlatformDefine.h diff --git a/cocos/2d/platform/mac/CCStdC.h b/cocos/platform/mac/CCStdC.h similarity index 100% rename from cocos/2d/platform/mac/CCStdC.h rename to cocos/platform/mac/CCStdC.h diff --git a/cocos/2d/platform/win32/CCApplication.cpp b/cocos/platform/win32/CCApplication.cpp similarity index 99% rename from cocos/2d/platform/win32/CCApplication.cpp rename to cocos/platform/win32/CCApplication.cpp index a67ba66439..2afa94595b 100644 --- a/cocos/2d/platform/win32/CCApplication.cpp +++ b/cocos/platform/win32/CCApplication.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "CCGLView.h" #include "base/CCDirector.h" #include -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" /** @brief This function change the PVRFrame show/hide setting in register. @param bEnable If true show the PVRFrame window, otherwise hide. diff --git a/cocos/2d/platform/win32/CCApplication.h b/cocos/platform/win32/CCApplication.h similarity index 97% rename from cocos/2d/platform/win32/CCApplication.h rename to cocos/platform/win32/CCApplication.h index b56cc0cc4c..7167a4d747 100644 --- a/cocos/2d/platform/win32/CCApplication.h +++ b/cocos/platform/win32/CCApplication.h @@ -29,8 +29,8 @@ THE SOFTWARE. #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "CCStdC.h" -#include "2d/platform/CCCommon.h" -#include "2d/platform/CCApplicationProtocol.h" +#include "platform/CCCommon.h" +#include "platform/CCApplicationProtocol.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/win32/CCCommon.cpp b/cocos/platform/win32/CCCommon.cpp similarity index 98% rename from cocos/2d/platform/win32/CCCommon.cpp rename to cocos/platform/win32/CCCommon.cpp index d605e5bf91..a95ed75d00 100644 --- a/cocos/2d/platform/win32/CCCommon.cpp +++ b/cocos/platform/win32/CCCommon.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include "CCStdC.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/win32/CCDevice.cpp b/cocos/platform/win32/CCDevice.cpp similarity index 99% rename from cocos/2d/platform/win32/CCDevice.cpp rename to cocos/platform/win32/CCDevice.cpp index 839e67e495..ab9b3e489b 100644 --- a/cocos/2d/platform/win32/CCDevice.cpp +++ b/cocos/platform/win32/CCDevice.cpp @@ -26,8 +26,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 -#include "2d/platform/CCDevice.h" -#include "2d/platform/CCFileUtils.h" +#include "platform/CCDevice.h" +#include "platform/CCFileUtils.h" #include "CCStdC.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp b/cocos/platform/win32/CCFileUtilsWin32.cpp similarity index 99% rename from cocos/2d/platform/win32/CCFileUtilsWin32.cpp rename to cocos/platform/win32/CCFileUtilsWin32.cpp index a146025d4e..2d036c5dfc 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/platform/win32/CCFileUtilsWin32.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include "CCFileUtilsWin32.h" -#include "2d/platform/CCCommon.h" +#include "platform/CCCommon.h" #include using namespace std; diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.h b/cocos/platform/win32/CCFileUtilsWin32.h similarity index 99% rename from cocos/2d/platform/win32/CCFileUtilsWin32.h rename to cocos/platform/win32/CCFileUtilsWin32.h index d075aa94e9..fdb2b9106b 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.h +++ b/cocos/platform/win32/CCFileUtilsWin32.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 -#include "2d/platform/CCFileUtils.h" +#include "platform/CCFileUtils.h" #include "base/CCPlatformMacros.h" #include "base/ccTypes.h" #include diff --git a/cocos/2d/platform/win32/CCGL.h b/cocos/platform/win32/CCGL.h similarity index 100% rename from cocos/2d/platform/win32/CCGL.h rename to cocos/platform/win32/CCGL.h diff --git a/cocos/2d/platform/win32/CCPlatformDefine.h b/cocos/platform/win32/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/win32/CCPlatformDefine.h rename to cocos/platform/win32/CCPlatformDefine.h diff --git a/cocos/2d/platform/win32/CCStdC.cpp b/cocos/platform/win32/CCStdC.cpp similarity index 100% rename from cocos/2d/platform/win32/CCStdC.cpp rename to cocos/platform/win32/CCStdC.cpp diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/platform/win32/CCStdC.h similarity index 100% rename from cocos/2d/platform/win32/CCStdC.h rename to cocos/platform/win32/CCStdC.h diff --git a/cocos/2d/platform/win32/compat/stdint.h b/cocos/platform/win32/compat/stdint.h similarity index 100% rename from cocos/2d/platform/win32/compat/stdint.h rename to cocos/platform/win32/compat/stdint.h diff --git a/cocos/2d/platform/winrt/CCApplication.cpp b/cocos/platform/winrt/CCApplication.cpp similarity index 99% rename from cocos/2d/platform/winrt/CCApplication.cpp rename to cocos/platform/winrt/CCApplication.cpp index 139981cdca..7925bfa6ba 100644 --- a/cocos/2d/platform/winrt/CCApplication.cpp +++ b/cocos/platform/winrt/CCApplication.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #else #include "platform/wp8/CCGLView.h" #endif -#include "CCDirector.h" +#include "base/CCDirector.h" #include #include "platform/CCFileUtils.h" #include "CCWinRTUtils.h" diff --git a/cocos/2d/platform/winrt/CCApplication.h b/cocos/platform/winrt/CCApplication.h similarity index 98% rename from cocos/2d/platform/winrt/CCApplication.h rename to cocos/platform/winrt/CCApplication.h index 7d2deb39db..97028820e4 100644 --- a/cocos/2d/platform/winrt/CCApplication.h +++ b/cocos/platform/winrt/CCApplication.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_APPLICATION_WINRT_H__ #define __CC_APPLICATION_WINRT_H__ -#include "CCPlatformConfig.h" +#include "base/CCPlatformConfig.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) #include "CCStdC.h" diff --git a/cocos/2d/platform/winrt/CCCommon.cpp b/cocos/platform/winrt/CCCommon.cpp similarity index 100% rename from cocos/2d/platform/winrt/CCCommon.cpp rename to cocos/platform/winrt/CCCommon.cpp diff --git a/cocos/2d/platform/winrt/CCDevice.cpp b/cocos/platform/winrt/CCDevice.cpp similarity index 99% rename from cocos/2d/platform/winrt/CCDevice.cpp rename to cocos/platform/winrt/CCDevice.cpp index 46c9b0cd43..bbbad71687 100644 --- a/cocos/2d/platform/winrt/CCDevice.cpp +++ b/cocos/platform/winrt/CCDevice.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCPlatformConfig.h" +#include "base/CCPlatformConfig.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) #include "cocos2d.h" diff --git a/cocos/2d/platform/winrt/CCFileUtilsWinRT.cpp b/cocos/platform/winrt/CCFileUtilsWinRT.cpp similarity index 100% rename from cocos/2d/platform/winrt/CCFileUtilsWinRT.cpp rename to cocos/platform/winrt/CCFileUtilsWinRT.cpp diff --git a/cocos/2d/platform/winrt/CCFileUtilsWinRT.h b/cocos/platform/winrt/CCFileUtilsWinRT.h similarity index 97% rename from cocos/2d/platform/winrt/CCFileUtilsWinRT.h rename to cocos/platform/winrt/CCFileUtilsWinRT.h index 2ace3f6f22..8e130e496e 100644 --- a/cocos/2d/platform/winrt/CCFileUtilsWinRT.h +++ b/cocos/platform/winrt/CCFileUtilsWinRT.h @@ -25,12 +25,13 @@ #ifndef __CC_FILEUTILS_WINRT_H__ #define __CC_FILEUTILS_WINRT_H__ -#include "platform/CCFileUtils.h" -#include "CCPlatformMacros.h" -#include "ccTypes.h" #include #include +#include "platform/CCFileUtils.h" +#include "base/CCPlatformMacros.h" +#include "base/ccTypes.h" + NS_CC_BEGIN /** diff --git a/cocos/2d/platform/winrt/CCFreeTypeFont.cpp b/cocos/platform/winrt/CCFreeTypeFont.cpp similarity index 99% rename from cocos/2d/platform/winrt/CCFreeTypeFont.cpp rename to cocos/platform/winrt/CCFreeTypeFont.cpp index 9f5b4acc58..5acba12a9d 100644 --- a/cocos/2d/platform/winrt/CCFreeTypeFont.cpp +++ b/cocos/platform/winrt/CCFreeTypeFont.cpp @@ -22,7 +22,7 @@ ****************************************************************************/ #include "CCFreeTypeFont.h" -#include "CCDirector.h" +#include "base/CCDirector.h" #include "platform/CCFileUtils.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_WP8) diff --git a/cocos/2d/platform/winrt/CCFreeTypeFont.h b/cocos/platform/winrt/CCFreeTypeFont.h similarity index 100% rename from cocos/2d/platform/winrt/CCFreeTypeFont.h rename to cocos/platform/winrt/CCFreeTypeFont.h diff --git a/cocos/2d/platform/winrt/CCGL.h b/cocos/platform/winrt/CCGL.h similarity index 100% rename from cocos/2d/platform/winrt/CCGL.h rename to cocos/platform/winrt/CCGL.h diff --git a/cocos/2d/platform/winrt/CCGLView.cpp b/cocos/platform/winrt/CCGLView.cpp similarity index 98% rename from cocos/2d/platform/winrt/CCGLView.cpp rename to cocos/platform/winrt/CCGLView.cpp index f78be18d6c..118449fa25 100644 --- a/cocos/2d/platform/winrt/CCGLView.cpp +++ b/cocos/platform/winrt/CCGLView.cpp @@ -23,11 +23,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #include "CCGLView.h" -#include "ccMacros.h" -#include "CCDirector.h" -#include "CCTouch.h" -#include "CCIMEDispatcher.h" +#include "base/ccMacros.h" +#include "base/CCDirector.h" +#include "base/CCTouch.h" +#include "2d/CCIMEDispatcher.h" #include "CCApplication.h" #include "CCWinRTUtils.h" @@ -577,3 +580,5 @@ void GLView::QueueEvent(std::shared_ptr& event) } NS_CC_END + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/2d/platform/winrt/CCGLView.h b/cocos/platform/winrt/CCGLView.h similarity index 97% rename from cocos/2d/platform/winrt/CCGLView.h rename to cocos/platform/winrt/CCGLView.h index 6864805e59..96b403a3c1 100644 --- a/cocos/2d/platform/winrt/CCGLView.h +++ b/cocos/platform/winrt/CCGLView.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_EGLVIEW_WINRT_H__ #define __CC_EGLVIEW_WINRT_H__ +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #include "CCStdC.h" #include "CCGL.h" #include "platform/CCCommon.h" @@ -164,4 +167,6 @@ private: NS_CC_END +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #endif // end of __CC_EGLVIEW_WINRT_H__ diff --git a/cocos/2d/platform/winrt/CCGL_Angle.h b/cocos/platform/winrt/CCGL_Angle.h similarity index 100% rename from cocos/2d/platform/winrt/CCGL_Angle.h rename to cocos/platform/winrt/CCGL_Angle.h diff --git a/cocos/2d/platform/winrt/CCPThreadWinRT.cpp b/cocos/platform/winrt/CCPThreadWinRT.cpp similarity index 92% rename from cocos/2d/platform/winrt/CCPThreadWinRT.cpp rename to cocos/platform/winrt/CCPThreadWinRT.cpp index 3d63daf631..5bd691eb9f 100644 --- a/cocos/2d/platform/winrt/CCPThreadWinRT.cpp +++ b/cocos/platform/winrt/CCPThreadWinRT.cpp @@ -22,9 +22,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCPThreadWinRT.h" +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + +#include "CCPThreadWinRT.h" + NS_CC_BEGIN void pthread_mutex_init(pthread_mutex_t* m, void* attributes) { @@ -49,3 +53,5 @@ void pthread_mutex_destroy(pthread_mutex_t* m) NS_CC_END + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/2d/platform/winrt/CCPThreadWinRT.h b/cocos/platform/winrt/CCPThreadWinRT.h similarity index 91% rename from cocos/2d/platform/winrt/CCPThreadWinRT.h rename to cocos/platform/winrt/CCPThreadWinRT.h index 042d10e36a..2a75a9535a 100644 --- a/cocos/2d/platform/winrt/CCPThreadWinRT.h +++ b/cocos/platform/winrt/CCPThreadWinRT.h @@ -26,7 +26,11 @@ THE SOFTWARE. #ifndef __CCPTHREADWINRT_H__ #define __CCPTHREADWINRT_H__ -#include "CCPlatformMacros.h" + +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + +#include "base/CCPlatformMacros.h" #include @@ -49,9 +53,9 @@ void pthread_mutex_destroy(pthread_mutex_t* m); #define pthread_cond_signal(x) #define pthread_cond_init(x, y) - - - NS_CC_END + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #endif // __CCPTHREADWINRT_H__ diff --git a/cocos/2d/platform/winrt/CCPlatformDefine.h b/cocos/platform/winrt/CCPlatformDefine.h similarity index 100% rename from cocos/2d/platform/winrt/CCPlatformDefine.h rename to cocos/platform/winrt/CCPlatformDefine.h diff --git a/cocos/2d/platform/winrt/CCPrecompiledShaders.cpp b/cocos/platform/winrt/CCPrecompiledShaders.cpp similarity index 100% rename from cocos/2d/platform/winrt/CCPrecompiledShaders.cpp rename to cocos/platform/winrt/CCPrecompiledShaders.cpp diff --git a/cocos/2d/platform/winrt/CCPrecompiledShaders.h b/cocos/platform/winrt/CCPrecompiledShaders.h similarity index 100% rename from cocos/2d/platform/winrt/CCPrecompiledShaders.h rename to cocos/platform/winrt/CCPrecompiledShaders.h diff --git a/cocos/2d/platform/winrt/CCStdC.cpp b/cocos/platform/winrt/CCStdC.cpp similarity index 100% rename from cocos/2d/platform/winrt/CCStdC.cpp rename to cocos/platform/winrt/CCStdC.cpp diff --git a/cocos/2d/platform/winrt/CCStdC.h b/cocos/platform/winrt/CCStdC.h similarity index 97% rename from cocos/2d/platform/winrt/CCStdC.h rename to cocos/platform/winrt/CCStdC.h index 99992001ba..21d91faea6 100644 --- a/cocos/2d/platform/winrt/CCStdC.h +++ b/cocos/platform/winrt/CCStdC.h @@ -26,11 +26,11 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "CCPlatformConfig.h" +#include "base/CCPlatformConfig.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 -#include "CCPlatformMacros.h" +#include "base/CCPlatformMacros.h" #include #include diff --git a/cocos/2d/platform/winrt/CCWinRTUtils.cpp b/cocos/platform/winrt/CCWinRTUtils.cpp similarity index 100% rename from cocos/2d/platform/winrt/CCWinRTUtils.cpp rename to cocos/platform/winrt/CCWinRTUtils.cpp diff --git a/cocos/2d/platform/winrt/CCWinRTUtils.h b/cocos/platform/winrt/CCWinRTUtils.h similarity index 98% rename from cocos/2d/platform/winrt/CCWinRTUtils.h rename to cocos/platform/winrt/CCWinRTUtils.h index d3db742355..f289ead8c4 100644 --- a/cocos/2d/platform/winrt/CCWinRTUtils.h +++ b/cocos/platform/winrt/CCWinRTUtils.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCWINRT_UTILS_H__ #define __CCWINRT_UTILS_H__ -#include "CCPlatformMacros.h" +#include "base/CCPlatformMacros.h" #include #include diff --git a/cocos/2d/platform/winrt/DirectXBase.cpp b/cocos/platform/winrt/DirectXBase.cpp similarity index 99% rename from cocos/2d/platform/winrt/DirectXBase.cpp rename to cocos/platform/winrt/DirectXBase.cpp index 7f6a2c6655..27166a9758 100644 --- a/cocos/2d/platform/winrt/DirectXBase.cpp +++ b/cocos/platform/winrt/DirectXBase.cpp @@ -16,6 +16,10 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //----------------------------------------------------------------------------------------------- + +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #include "DirectXBase.h" #include #include @@ -463,4 +467,4 @@ float DirectXBase::ConvertDipsToPixels(float dips) return floor(dips * m_dpi / dipsPerInch + 0.5f); // Round to nearest integer. } - +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/2d/platform/winrt/DirectXBase.h b/cocos/platform/winrt/DirectXBase.h similarity index 96% rename from cocos/2d/platform/winrt/DirectXBase.h rename to cocos/platform/winrt/DirectXBase.h index eb37bfb87d..73e7a1276b 100644 --- a/cocos/2d/platform/winrt/DirectXBase.h +++ b/cocos/platform/winrt/DirectXBase.h @@ -18,6 +18,9 @@ //----------------------------------------------------------------------------------------------- #pragma once +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + #include #include #include @@ -76,3 +79,5 @@ protected private: }; #pragma warning (default: 4449) + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/2d/platform/winrt/DirectXHelper.h b/cocos/platform/winrt/DirectXHelper.h similarity index 92% rename from cocos/2d/platform/winrt/DirectXHelper.h rename to cocos/platform/winrt/DirectXHelper.h index 2166d0c91c..6065191353 100644 --- a/cocos/2d/platform/winrt/DirectXHelper.h +++ b/cocos/platform/winrt/DirectXHelper.h @@ -18,6 +18,10 @@ //----------------------------------------------------------------------------------------------- #pragma once + +#include "base/CCPlatformConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + // Helper utilities to make Win32 APIs work with exceptions. namespace DX { @@ -30,3 +34,5 @@ namespace DX } } } + +#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/cocos/2d/platform/winrt/InputEvent.cpp b/cocos/platform/winrt/InputEvent.cpp similarity index 98% rename from cocos/2d/platform/winrt/InputEvent.cpp rename to cocos/platform/winrt/InputEvent.cpp index 44ac44c240..ccc49a5ad0 100644 --- a/cocos/2d/platform/winrt/InputEvent.cpp +++ b/cocos/platform/winrt/InputEvent.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "InputEvent.h" #include "CCGLView.h" -#include "CCEventAcceleration.h" +#include "base/CCEventAcceleration.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/winrt/InputEvent.h b/cocos/platform/winrt/InputEvent.h similarity index 100% rename from cocos/2d/platform/winrt/InputEvent.h rename to cocos/platform/winrt/InputEvent.h diff --git a/cocos/2d/platform/winrt/InputEventTypes.h b/cocos/platform/winrt/InputEventTypes.h similarity index 100% rename from cocos/2d/platform/winrt/InputEventTypes.h rename to cocos/platform/winrt/InputEventTypes.h diff --git a/cocos/2d/platform/winrt/inet_ntop_winrt.cpp b/cocos/platform/winrt/inet_ntop_winrt.cpp similarity index 100% rename from cocos/2d/platform/winrt/inet_ntop_winrt.cpp rename to cocos/platform/winrt/inet_ntop_winrt.cpp diff --git a/cocos/2d/platform/winrt/inet_ntop_winrt.h b/cocos/platform/winrt/inet_ntop_winrt.h similarity index 100% rename from cocos/2d/platform/winrt/inet_ntop_winrt.h rename to cocos/platform/winrt/inet_ntop_winrt.h diff --git a/cocos/2d/platform/winrt/pch.cpp b/cocos/platform/winrt/pch.cpp similarity index 100% rename from cocos/2d/platform/winrt/pch.cpp rename to cocos/platform/winrt/pch.cpp diff --git a/cocos/2d/platform/winrt/pch.h b/cocos/platform/winrt/pch.h similarity index 100% rename from cocos/2d/platform/winrt/pch.h rename to cocos/platform/winrt/pch.h diff --git a/cocos/2d/platform/winrt/sha1.cpp b/cocos/platform/winrt/sha1.cpp similarity index 100% rename from cocos/2d/platform/winrt/sha1.cpp rename to cocos/platform/winrt/sha1.cpp diff --git a/cocos/2d/platform/winrt/sha1.h b/cocos/platform/winrt/sha1.h similarity index 100% rename from cocos/2d/platform/winrt/sha1.h rename to cocos/platform/winrt/sha1.h diff --git a/cocos/2d/platform/winrt/shaders/precompiledshaders.h b/cocos/platform/winrt/shaders/precompiledshaders.h similarity index 100% rename from cocos/2d/platform/winrt/shaders/precompiledshaders.h rename to cocos/platform/winrt/shaders/precompiledshaders.h diff --git a/cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj b/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj similarity index 100% rename from cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj rename to cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj diff --git a/cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.filters b/cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj.filters similarity index 100% rename from cocos/2d/platform/wp8-xaml/CopyTemplateFiles.vcxproj.filters rename to cocos/platform/wp8-xaml/CopyTemplateFiles.vcxproj.filters diff --git a/cocos/2d/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp rename to cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp diff --git a/cocos/2d/platform/wp8-xaml/cpp/Cocos2dRenderer.h b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Cocos2dRenderer.h rename to cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.h diff --git a/cocos/2d/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp rename to cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.cpp diff --git a/cocos/2d/platform/wp8-xaml/cpp/Direct3DContentProvider.h b/cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Direct3DContentProvider.h rename to cocos/platform/wp8-xaml/cpp/Direct3DContentProvider.h diff --git a/cocos/2d/platform/wp8-xaml/cpp/Direct3DInterop.cpp b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Direct3DInterop.cpp rename to cocos/platform/wp8-xaml/cpp/Direct3DInterop.cpp diff --git a/cocos/2d/platform/wp8-xaml/cpp/Direct3DInterop.h b/cocos/platform/wp8-xaml/cpp/Direct3DInterop.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/Direct3DInterop.h rename to cocos/platform/wp8-xaml/cpp/Direct3DInterop.h diff --git a/cocos/2d/platform/wp8-xaml/cpp/DirectXBase.cpp b/cocos/platform/wp8-xaml/cpp/DirectXBase.cpp similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/DirectXBase.cpp rename to cocos/platform/wp8-xaml/cpp/DirectXBase.cpp diff --git a/cocos/2d/platform/wp8-xaml/cpp/DirectXBase.h b/cocos/platform/wp8-xaml/cpp/DirectXBase.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/DirectXBase.h rename to cocos/platform/wp8-xaml/cpp/DirectXBase.h diff --git a/cocos/2d/platform/wp8-xaml/cpp/DirectXHelper.h b/cocos/platform/wp8-xaml/cpp/DirectXHelper.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/DirectXHelper.h rename to cocos/platform/wp8-xaml/cpp/DirectXHelper.h diff --git a/cocos/2d/platform/wp8-xaml/cpp/EditBoxEvent.cpp b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/EditBoxEvent.cpp rename to cocos/platform/wp8-xaml/cpp/EditBoxEvent.cpp diff --git a/cocos/2d/platform/wp8-xaml/cpp/EditBoxEvent.h b/cocos/platform/wp8-xaml/cpp/EditBoxEvent.h similarity index 100% rename from cocos/2d/platform/wp8-xaml/cpp/EditBoxEvent.h rename to cocos/platform/wp8-xaml/cpp/EditBoxEvent.h diff --git a/cocos/2d/platform/wp8-xaml/xaml/App.xaml b/cocos/platform/wp8-xaml/xaml/App.xaml similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/App.xaml rename to cocos/platform/wp8-xaml/xaml/App.xaml diff --git a/cocos/2d/platform/wp8-xaml/xaml/App.xaml.cs b/cocos/platform/wp8-xaml/xaml/App.xaml.cs similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/App.xaml.cs rename to cocos/platform/wp8-xaml/xaml/App.xaml.cs diff --git a/cocos/2d/platform/wp8-xaml/xaml/EditBox.xaml b/cocos/platform/wp8-xaml/xaml/EditBox.xaml similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/EditBox.xaml rename to cocos/platform/wp8-xaml/xaml/EditBox.xaml diff --git a/cocos/2d/platform/wp8-xaml/xaml/EditBox.xaml.cs b/cocos/platform/wp8-xaml/xaml/EditBox.xaml.cs similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/EditBox.xaml.cs rename to cocos/platform/wp8-xaml/xaml/EditBox.xaml.cs diff --git a/cocos/2d/platform/wp8-xaml/xaml/MainPage.xaml b/cocos/platform/wp8-xaml/xaml/MainPage.xaml similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/MainPage.xaml rename to cocos/platform/wp8-xaml/xaml/MainPage.xaml diff --git a/cocos/2d/platform/wp8-xaml/xaml/MainPage.xaml.cs b/cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs similarity index 100% rename from cocos/2d/platform/wp8-xaml/xaml/MainPage.xaml.cs rename to cocos/platform/wp8-xaml/xaml/MainPage.xaml.cs diff --git a/cocos/2d/platform/wp8/CCGLView.cpp b/cocos/platform/wp8/CCGLView.cpp similarity index 98% rename from cocos/2d/platform/wp8/CCGLView.cpp rename to cocos/platform/wp8/CCGLView.cpp index d89fab28f5..c6869b3fe8 100644 --- a/cocos/2d/platform/wp8/CCGLView.cpp +++ b/cocos/platform/wp8/CCGLView.cpp @@ -24,14 +24,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGLView.h" -#include "CCSet.h" -#include "ccMacros.h" -#include "CCDirector.h" -#include "CCTouch.h" -#include "CCIMEDispatcher.h" +#include "deprecated/CCSet.h" +#include "base/ccMacros.h" +#include "base/CCDirector.h" +#include "base/CCTouch.h" +#include "base/CCIMEDispatcher.h" #include "CCApplication.h" #include "CCWinRTUtils.h" -#include "CCNotificationCenter.h" +#include "deprecated/CCNotificationCenter.h" using namespace Platform; using namespace Windows::Foundation; @@ -397,7 +397,7 @@ void GLView::UpdateWindowSize() } } -const Matrix& GLView::getOrientationMatrix() const +const Mat4& GLView::getOrientationMatrix() const { return m_orientationMatrix; }; diff --git a/cocos/2d/platform/wp8/CCGLView.h b/cocos/platform/wp8/CCGLView.h similarity index 96% rename from cocos/2d/platform/wp8/CCGLView.h rename to cocos/platform/wp8/CCGLView.h index 9ffa1f9d29..69914a8aa2 100644 --- a/cocos/2d/platform/wp8/CCGLView.h +++ b/cocos/platform/wp8/CCGLView.h @@ -61,8 +61,8 @@ public: virtual void swapBuffers(); virtual void setViewPortInPoints(float x , float y , float w , float h); virtual void setScissorInPoints(float x , float y , float w , float h); - const Matrix& getOrientationMatrix() const; - const Matrix& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; + const Mat4& getOrientationMatrix() const; + const Mat4& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; @@ -162,8 +162,8 @@ private: bool m_lastPointValid; bool m_windowClosed; bool m_windowVisible; - Matrix m_orientationMatrix; - Matrix m_reverseOrientationMatrix; + Mat4 m_orientationMatrix; + Mat4 m_reverseOrientationMatrix; bool m_running; diff --git a/cocos/2d/platform/wp8/Direct3DBase.cpp b/cocos/platform/wp8/Direct3DBase.cpp similarity index 95% rename from cocos/2d/platform/wp8/Direct3DBase.cpp rename to cocos/platform/wp8/Direct3DBase.cpp index f909b07507..7d378b3ef0 100644 --- a/cocos/2d/platform/wp8/Direct3DBase.cpp +++ b/cocos/platform/wp8/Direct3DBase.cpp @@ -1,4 +1,8 @@ -#include "Direct3DBase.h" +// XXX: For some reason, this file must not be compiled +// XXX: Ask MS why +#if 0 + +#include "Direct3DBase.h" using namespace DirectX; @@ -330,9 +334,9 @@ void Direct3DBase::ComputeOrientationMatrices() } } -Vec2 Direct3DBase::TransformToOrientation(Vec2 point, bool dipsToPixels) +Point Direct3DBase::TransformToOrientation(Point point, bool dipsToPixels) { - Vec2 returnValue; + Point returnValue; switch (m_orientation) { @@ -340,20 +344,22 @@ Vec2 Direct3DBase::TransformToOrientation(Vec2 point, bool dipsToPixels) returnValue = point; break; case DisplayOrientations::Landscape: - returnValue = Vec2(point.Y, m_windowBounds.Width - point.X); + returnValue = Point(point.Y, m_windowBounds.Width - point.X); break; case DisplayOrientations::PortraitFlipped: - returnValue = Vec2(m_windowBounds.Width - point.X, m_windowBounds.Height - point.Y); + returnValue = Point(m_windowBounds.Width - point.X, m_windowBounds.Height - point.Y); break; case DisplayOrientations::LandscapeFlipped: - returnValue = Vec2(m_windowBounds.Height -point.Y, point.X); + returnValue = Point(m_windowBounds.Height - point.Y, point.X); break; default: throw ref new Platform::FailureException(); break; } - return dipsToPixels ? Vec2(ConvertDipsToPixels(returnValue.X), + return dipsToPixels ? Point(ConvertDipsToPixels(returnValue.X), ConvertDipsToPixels(returnValue.Y)) : returnValue; } + +#endif // 0 diff --git a/cocos/2d/platform/wp8/Direct3DBase.h b/cocos/platform/wp8/Direct3DBase.h similarity index 89% rename from cocos/2d/platform/wp8/Direct3DBase.h rename to cocos/platform/wp8/Direct3DBase.h index dfc4bfd3af..d5737bbbde 100644 --- a/cocos/2d/platform/wp8/Direct3DBase.h +++ b/cocos/platform/wp8/Direct3DBase.h @@ -1,5 +1,10 @@ #pragma once +// XXX: For some reason, this file must not be compiled +// XXX: Ask MS why +#if 0 + + #include #include #include @@ -24,7 +29,7 @@ public: virtual void Present(); virtual float ConvertDipsToPixels(float dips); virtual void ComputeOrientationMatrices(); - virtual Windows::Foundation::Vec2 TransformToOrientation(Windows::Foundation::Vec2 point, bool dipsToPixels=true); + virtual Windows::Foundation::Point TransformToOrientation(Windows::Foundation::Point point, bool dipsToPixels=true); float getOrientedWindowWidth() {return m_orientedScreenSize.Width;}; float getOrientedWindowHeight() {return m_orientedScreenSize.Height;}; @@ -53,4 +58,6 @@ protected private: // Transforms used for rendering 2D and 3D elements in proper orientation DirectX::XMMATRIX m_orientationTransform3D; DirectX::XMMATRIX m_orientationTransform2D; -}; \ No newline at end of file +}; + +#endif // 0 diff --git a/cocos/2d/platform/wp8/DirectXBase.cpp b/cocos/platform/wp8/DirectXBase.cpp similarity index 100% rename from cocos/2d/platform/wp8/DirectXBase.cpp rename to cocos/platform/wp8/DirectXBase.cpp diff --git a/cocos/2d/platform/wp8/DirectXBase.h b/cocos/platform/wp8/DirectXBase.h similarity index 100% rename from cocos/2d/platform/wp8/DirectXBase.h rename to cocos/platform/wp8/DirectXBase.h diff --git a/cocos/2d/platform/wp8/shaders/precompiledshaders.h b/cocos/platform/wp8/shaders/precompiledshaders.h similarity index 100% rename from cocos/2d/platform/wp8/shaders/precompiledshaders.h rename to cocos/platform/wp8/shaders/precompiledshaders.h diff --git a/cocos/renderer/CCBatchCommand.cpp b/cocos/renderer/CCBatchCommand.cpp index 8cd92c148d..e122fc1344 100644 --- a/cocos/renderer/CCBatchCommand.cpp +++ b/cocos/renderer/CCBatchCommand.cpp @@ -25,8 +25,8 @@ #include "renderer/CCBatchCommand.h" #include "renderer/ccGLStateCache.h" -#include "2d/CCTextureAtlas.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTextureAtlas.h" +#include "renderer/CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCBatchCommand.h b/cocos/renderer/CCBatchCommand.h index d5920b369b..a91abdac22 100644 --- a/cocos/renderer/CCBatchCommand.h +++ b/cocos/renderer/CCBatchCommand.h @@ -25,7 +25,7 @@ #ifndef _CC_BATCHCOMMAND_H_ #define _CC_BATCHCOMMAND_H_ -#include "CCRenderCommand.h" +#include "renderer/CCRenderCommand.h" #include "renderer/CCGLProgram.h" #include "CCRenderCommandPool.h" diff --git a/cocos/renderer/CCCustomCommand.h b/cocos/renderer/CCCustomCommand.h index 03fdead69a..a1f1ea04f2 100644 --- a/cocos/renderer/CCCustomCommand.h +++ b/cocos/renderer/CCCustomCommand.h @@ -26,8 +26,8 @@ #ifndef _CC_CUSTOMCOMMAND_H_ #define _CC_CUSTOMCOMMAND_H_ -#include "CCRenderCommand.h" -#include "CCRenderCommandPool.h" +#include "renderer/CCRenderCommand.h" +#include "renderer/CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 8d43154f2c..9806874f03 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -26,19 +26,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "base/CCDirector.h" #include "renderer/CCGLProgram.h" -#include "renderer/ccGLStateCache.h" -#include "base/ccMacros.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/uthash.h" -#include "deprecated/CCString.h" -#include "CCGL.h" #ifndef WIN32 #include #endif +#include "base/CCDirector.h" +#include "base/ccMacros.h" +#include "base/uthash.h" +#include "renderer/ccGLStateCache.h" +#include "platform/CCFileUtils.h" +#include "CCGL.h" + +#include "deprecated/CCString.h" + #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) #include "CCPrecompiledShaders.h" #endif diff --git a/cocos/renderer/CCGLProgram.h b/cocos/renderer/CCGLProgram.h index d77847e5a4..0958ed8ebb 100644 --- a/cocos/renderer/CCGLProgram.h +++ b/cocos/renderer/CCGLProgram.h @@ -30,12 +30,13 @@ THE SOFTWARE. #ifndef __CCGLPROGRAM_H__ #define __CCGLPROGRAM_H__ +#include + #include "base/ccMacros.h" #include "base/CCRef.h" #include "base/ccTypes.h" #include "CCGL.h" #include "math/CCMath.h" -#include NS_CC_BEGIN diff --git a/cocos/renderer/CCGLProgramCache.cpp b/cocos/renderer/CCGLProgramCache.cpp index 9ea37905e0..c2ce9c9dbf 100644 --- a/cocos/renderer/CCGLProgramCache.cpp +++ b/cocos/renderer/CCGLProgramCache.cpp @@ -26,6 +26,7 @@ THE SOFTWARE. ****************************************************************************/ #include "renderer/CCGLProgramCache.h" + #include "renderer/CCGLProgram.h" #include "renderer/ccShaders.h" #include "base/ccMacros.h" diff --git a/cocos/renderer/CCGLProgramCache.h b/cocos/renderer/CCGLProgramCache.h index 1f9914f0f8..b57cf35563 100644 --- a/cocos/renderer/CCGLProgramCache.h +++ b/cocos/renderer/CCGLProgramCache.h @@ -28,11 +28,11 @@ THE SOFTWARE. #ifndef __CCGLPROGRAMCACHE_H__ #define __CCGLPROGRAMCACHE_H__ -#include "base/CCRef.h" - #include #include +#include "base/CCRef.h" + NS_CC_BEGIN class GLProgram; diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index e0af0859b7..eadae38e75 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -27,11 +27,12 @@ THE SOFTWARE. ****************************************************************************/ #include "renderer/CCGLProgramState.h" + #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramStateCache.h" #include "renderer/CCGLProgramCache.h" #include "renderer/ccGLStateCache.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index fb117a9eed..babfed8fed 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -25,13 +25,13 @@ THE SOFTWARE. #ifndef __CCGLPROGRAMSTATE_H__ #define __CCGLPROGRAMSTATE_H__ +#include + #include "base/ccTypes.h" #include "base/CCVector.h" -#include "math/Vector2.h" -#include "math/Vector3.h" -#include "math/Vector4.h" - -#include +#include "math/Vec2.h" +#include "math/Vec3.h" +#include "math/Vec4.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCGLProgramStateCache.cpp b/cocos/renderer/CCGLProgramStateCache.cpp index 51ddef546a..dd80d592b4 100644 --- a/cocos/renderer/CCGLProgramStateCache.cpp +++ b/cocos/renderer/CCGLProgramStateCache.cpp @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "renderer/CCGLProgramStateCache.h" + #include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" diff --git a/cocos/renderer/CCGLProgramStateCache.h b/cocos/renderer/CCGLProgramStateCache.h index ed0bdbe499..88b6b41a9a 100644 --- a/cocos/renderer/CCGLProgramStateCache.h +++ b/cocos/renderer/CCGLProgramStateCache.h @@ -27,11 +27,10 @@ THE SOFTWARE. #include "base/ccTypes.h" #include "base/CCVector.h" -#include "math/Vector2.h" -#include "math/Vector3.h" -#include "math/Vector4.h" - #include "base/CCMap.h" +#include "math/Vec2.h" +#include "math/Vec3.h" +#include "math/Vec4.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCGroupCommand.h b/cocos/renderer/CCGroupCommand.h index 2fe829a8e7..56748468f0 100644 --- a/cocos/renderer/CCGroupCommand.h +++ b/cocos/renderer/CCGroupCommand.h @@ -26,12 +26,12 @@ #ifndef _CC_GROUPCOMMAND_H_ #define _CC_GROUPCOMMAND_H_ +#include + #include "base/CCRef.h" #include "CCRenderCommand.h" #include "CCRenderCommandPool.h" -#include - NS_CC_BEGIN class GroupCommandManager : public Ref diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index 1aae065718..4b497ff253 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -24,6 +24,7 @@ #include "renderer/CCQuadCommand.h" + #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" diff --git a/cocos/renderer/CCRenderCommand.cpp b/cocos/renderer/CCRenderCommand.cpp index 578f28d426..0c11c5699b 100644 --- a/cocos/renderer/CCRenderCommand.cpp +++ b/cocos/renderer/CCRenderCommand.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ -#include "CCRenderCommand.h" +#include "renderer/CCRenderCommand.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCRenderCommand.h b/cocos/renderer/CCRenderCommand.h index a8eeb5a45a..2caf58e2a0 100644 --- a/cocos/renderer/CCRenderCommand.h +++ b/cocos/renderer/CCRenderCommand.h @@ -26,8 +26,9 @@ #ifndef __CCRENDERCOMMAND_H_ #define __CCRENDERCOMMAND_H_ -#include "base/CCPlatformMacros.h" #include + +#include "base/CCPlatformMacros.h" #include "base/ccTypes.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCRenderCommandPool.h b/cocos/renderer/CCRenderCommandPool.h index cfc52ab416..a90ef31f76 100644 --- a/cocos/renderer/CCRenderCommandPool.h +++ b/cocos/renderer/CCRenderCommandPool.h @@ -28,7 +28,9 @@ #include #include + #include "base/CCPlatformMacros.h" + NS_CC_BEGIN template diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index cadb5acd4e..434214db09 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -26,13 +26,14 @@ #ifndef __CC_RENDERER_H_ #define __CC_RENDERER_H_ -#include "base/CCPlatformMacros.h" -#include "CCRenderCommand.h" -#include "renderer/CCGLProgram.h" -#include "CCGL.h" #include #include +#include "base/CCPlatformMacros.h" +#include "renderer/CCRenderCommand.h" +#include "renderer/CCGLProgram.h" +#include "CCGL.h" + NS_CC_BEGIN class EventListenerCustom; diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp similarity index 99% rename from cocos/2d/CCTexture2D.cpp rename to cocos/renderer/CCTexture2D.cpp index f6a6df9033..3477268257 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -31,11 +31,12 @@ THE SOFTWARE. * https://devforums.apple.com/message/37855#37855 by a1studmuffin */ +#include "renderer/CCTexture2D.h" + #include "CCGL.h" -#include "2d/CCTexture2D.h" -#include "2d/platform/CCImage.h" -#include "2d/ccUtils.h" -#include "2d/platform/CCDevice.h" +#include "platform/CCImage.h" +#include "base/ccUtils.h" +#include "platform/CCDevice.h" #include "base/ccConfig.h" #include "base/ccMacros.h" #include "base/CCConfiguration.h" @@ -49,7 +50,7 @@ THE SOFTWARE. #if CC_ENABLE_CACHE_TEXTURE_DATA - #include "2d/CCTextureCache.h" + #include "renderer/CCTextureCache.h" #endif NS_CC_BEGIN diff --git a/cocos/2d/CCTexture2D.h b/cocos/renderer/CCTexture2D.h similarity index 100% rename from cocos/2d/CCTexture2D.h rename to cocos/renderer/CCTexture2D.h diff --git a/cocos/2d/CCTextureAtlas.cpp b/cocos/renderer/CCTextureAtlas.cpp similarity index 99% rename from cocos/2d/CCTextureAtlas.cpp rename to cocos/renderer/CCTextureAtlas.cpp index 847149e520..332a0246bb 100644 --- a/cocos/2d/CCTextureAtlas.cpp +++ b/cocos/renderer/CCTextureAtlas.cpp @@ -25,24 +25,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -// cocos2d -#include "2d/CCTextureAtlas.h" -#include "2d/CCTextureCache.h" +#include "renderer/CCTextureAtlas.h" + +#include + #include "base/ccMacros.h" -#include "renderer/CCGLProgram.h" -#include "renderer/ccGLStateCache.h" #include "base/CCEventType.h" #include "base/CCDirector.h" -#include "CCGL.h" #include "base/CCConfiguration.h" -#include "renderer/CCRenderer.h" - -// support -#include "2d/CCTexture2D.h" -#include "deprecated/CCString.h" -#include #include "base/CCEventDispatcher.h" #include "base/CCEventListenerCustom.h" +#include "renderer/CCTextureCache.h" +#include "renderer/CCGLProgram.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCRenderer.h" +#include "renderer/CCTexture2D.h" +#include "CCGL.h" + + +#include "deprecated/CCString.h" //According to some tests GL_TRIANGLE_STRIP is slower, MUCH slower. Probably I'm doing something very wrong diff --git a/cocos/2d/CCTextureAtlas.h b/cocos/renderer/CCTextureAtlas.h similarity index 99% rename from cocos/2d/CCTextureAtlas.h rename to cocos/renderer/CCTextureAtlas.h index 1916af4e94..5dd431d116 100644 --- a/cocos/2d/CCTextureAtlas.h +++ b/cocos/renderer/CCTextureAtlas.h @@ -28,10 +28,11 @@ THE SOFTWARE. #ifndef __CCTEXTURE_ATLAS_H__ #define __CCTEXTURE_ATLAS_H__ +#include + #include "base/ccTypes.h" #include "base/CCRef.h" #include "base/ccConfig.h" -#include NS_CC_BEGIN diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp similarity index 99% rename from cocos/2d/CCTextureCache.cpp rename to cocos/renderer/CCTextureCache.cpp index 44f52e9f49..87ebe6195d 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -25,24 +25,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "renderer/CCTextureCache.h" + #include #include #include #include -#include "2d/CCTextureCache.h" -#include "2d/CCTexture2D.h" +#include "renderer/CCTexture2D.h" #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "2d/platform/CCFileUtils.h" -#include "2d/ccUtils.h" #include "base/CCScheduler.h" +#include "platform/CCFileUtils.h" +#include "base/ccUtils.h" + #include "deprecated/CCString.h" #ifdef EMSCRIPTEN #include -#include "2d/platform/emscripten/CCTextureCacheEmscripten.h" +#include "platform/emscripten/CCTextureCacheEmscripten.h" #endif // EMSCRIPTEN using namespace std; diff --git a/cocos/2d/CCTextureCache.h b/cocos/renderer/CCTextureCache.h similarity index 98% rename from cocos/2d/CCTextureCache.h rename to cocos/renderer/CCTextureCache.h index e3e3437a19..993ceb6b0b 100644 --- a/cocos/2d/CCTextureCache.h +++ b/cocos/renderer/CCTextureCache.h @@ -38,11 +38,11 @@ THE SOFTWARE. #include #include "base/CCRef.h" -#include "2d/CCTexture2D.h" -#include "2d/platform/CCImage.h" +#include "renderer/CCTexture2D.h" +#include "platform/CCImage.h" #if CC_ENABLE_CACHE_TEXTURE_DATA - #include "2d/platform/CCImage.h" + #include "platform/CCImage.h" #include #endif diff --git a/cocos/renderer/CMakeLists.txt b/cocos/renderer/CMakeLists.txt index 35cc09b4d8..42a78f3c23 100644 --- a/cocos/renderer/CMakeLists.txt +++ b/cocos/renderer/CMakeLists.txt @@ -1,15 +1,18 @@ set(COCOS_RENDERER_SRC - renderer/CCBatchCommand.cpp - renderer/CCCustomCommand.cpp - renderer/CCGLProgram.cpp - renderer/CCGLProgramState.cpp - renderer/CCGLProgramStateCache.cpp - renderer/CCGroupCommand.cpp - renderer/CCQuadCommand.cpp - renderer/CCRenderCommand.cpp - renderer/CCRenderer.cpp - renderer/CCGLProgramCache.cpp - renderer/ccGLStateCache.cpp - renderer/ccShaders.cpp + renderer/CCBatchCommand.cpp + renderer/CCCustomCommand.cpp + renderer/CCGLProgramCache.cpp + renderer/CCGLProgram.cpp + renderer/CCGLProgramStateCache.cpp + renderer/CCGLProgramState.cpp + renderer/ccGLStateCache.cpp + renderer/CCGroupCommand.cpp + renderer/CCQuadCommand.cpp + renderer/CCRenderCommand.cpp + renderer/CCRenderer.cpp + renderer/ccShaders.cpp + renderer/CCTexture2D.cpp + renderer/CCTextureAtlas.cpp + renderer/CCTextureCache.cpp ) diff --git a/cocos/renderer/ccGLStateCache.cpp b/cocos/renderer/ccGLStateCache.cpp index 7f4db72592..33b85c9b7a 100644 --- a/cocos/renderer/ccGLStateCache.cpp +++ b/cocos/renderer/ccGLStateCache.cpp @@ -26,6 +26,7 @@ THE SOFTWARE. ****************************************************************************/ #include "renderer/ccGLStateCache.h" + #include "renderer/CCGLProgram.h" #include "base/CCDirector.h" #include "base/ccConfig.h" diff --git a/cocos/scripting/lua-bindings/manual/CCLuaEngine.h b/cocos/scripting/lua-bindings/manual/CCLuaEngine.h index d57da90df3..1b43120fd2 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaEngine.h +++ b/cocos/scripting/lua-bindings/manual/CCLuaEngine.h @@ -31,7 +31,7 @@ extern "C" { } #include "cocos2d.h" -#include "2d/CCScriptSupport.h" +#include "base/CCScriptSupport.h" #include "CCLuaStack.h" #include "CCLuaValue.h" #include "LuaScriptHandlerMgr.h" diff --git a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp index 871c9f24b1..14b48ddd17 100644 --- a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp +++ b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp @@ -1,6 +1,6 @@ #include "CCLuaJavaBridge.h" -#include "2d/platform/android/jni/JniHelper.h" +#include "platform/android/jni/JniHelper.h" #include #define LOG_TAG "luajc" diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index ed02f45ec4..3f682c84da 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -926,7 +926,7 @@ "OTHER_LDFLAGS[sdk=iphonesimulator7.1]" = "-llua"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../2d/platform/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/ios"; }; name = Debug; }; @@ -950,7 +950,7 @@ "OTHER_LDFLAGS[sdk=iphonesimulator7.1]" = "-llua"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../2d/platform/ios"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/ios"; }; name = Release; }; @@ -970,7 +970,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../../../external/lua/luajit/prebuilt/mac"; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../2d/platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; }; name = Debug; }; @@ -990,7 +990,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../../../external/lua/luajit/prebuilt/mac"; TARGETED_DEVICE_FAMILY = "1,2"; - USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../2d/platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../platform/mac $(SRCROOT)/../../../../external/glfw3/include/mac"; }; name = Release; }; diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index d666528d18..5b627ef498 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -26,7 +26,7 @@ #ifndef __CCEDITTEXT_H__ #define __CCEDITTEXT_H__ -#include "2d/CCIMEDelegate.h" +#include "base/CCIMEDelegate.h" #include "extensions/ExtensionMacros.h" #include "../CCControlExtension/CCControlExtensions.h" diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp index e43d85d746..5cef5fd0b8 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp @@ -25,8 +25,8 @@ THE SOFTWARE. #include "CCEditBoxImplWp8.h" #include "CCEditBox.h" #include "CCGLView.h" -#include "CCScriptSupport.h" -#include "ccUTF8.h" +#include "base/CCScriptSupport.h" +#include "base/ccUTF8.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 020b775a92..f025eea458 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -25,7 +25,7 @@ #include "CCScrollView.h" #include "CCGLView.h" -#include "2d/platform/CCDevice.h" +#include "platform/CCDevice.h" #include "2d/CCActionInstant.h" #include "2d/CCActionInterval.h" #include "2d/CCActionTween.h" diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 8965bb036b..3222775cbb 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCTableViewCell.h" -#include "2d/ccCArray.h" +#include "base/ccCArray.h" NS_CC_EXT_BEGIN diff --git a/templates/cpp-template-default/proj.android/jni/hellocpp/main.cpp b/templates/cpp-template-default/proj.android/jni/hellocpp/main.cpp index 26fe88c3a5..5199d12ab4 100644 --- a/templates/cpp-template-default/proj.android/jni/hellocpp/main.cpp +++ b/templates/cpp-template-default/proj.android/jni/hellocpp/main.cpp @@ -1,6 +1,6 @@ #include "AppDelegate.h" #include "cocos2d.h" -#include "2d/platform/android/jni/JniHelper.h" +#include "platform/android/jni/JniHelper.h" #include #include diff --git a/templates/cpp-template-default/proj.android/project.properties b/templates/cpp-template-default/proj.android/project.properties index 870a4a196d..dc57659a70 100644 --- a/templates/cpp-template-default/proj.android/project.properties +++ b/templates/cpp-template-default/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../cocos2d/cocos/2d/platform/android/java +android.library.reference.1=../cocos2d/cocos/platform/android/java diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp index 26fe88c3a5..5199d12ab4 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp @@ -1,6 +1,6 @@ #include "AppDelegate.h" #include "cocos2d.h" -#include "2d/platform/android/jni/JniHelper.h" +#include "platform/android/jni/JniHelper.h" #include #include diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/project.properties b/templates/lua-template-default/frameworks/runtime-src/proj.android/project.properties index 44eace38a5..8e5895514b 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/project.properties +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../cocos2d-x/cocos/2d/platform/android/java +android.library.reference.1=../../cocos2d-x/cocos/platform/android/java diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp index 8b71bdfb13..3aae632663 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/jni/lua/main.cpp @@ -1,6 +1,6 @@ #include "AppDelegate.h" #include "cocos2d.h" -#include "2d/platform/android/jni/JniHelper.h" +#include "platform/android/jni/JniHelper.h" #include #include #include "ConfigParser.h" diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/project.properties b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/project.properties index 44eace38a5..8e5895514b 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.android/project.properties +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.android/project.properties @@ -10,4 +10,4 @@ # Project target. target=android-10 -android.library.reference.1=../../cocos2d-x/cocos/2d/platform/android/java +android.library.reference.1=../../cocos2d-x/cocos/platform/android/java diff --git a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj index 4301dbdbb6..386162ebb1 100644 --- a/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj +++ b/tests/cpp-empty-test/proj-wp8-xaml/cpp-empty-test/cpp-empty-test.csproj @@ -90,16 +90,10 @@ 4 - - App.xaml.cs - - - EditBox.xaml.cs - - - MainPage.xaml.cs - + + + True @@ -141,23 +135,6 @@ AppResources.Designer.cs - - - App.xaml - MSBuild:Compile - Designer - - - EditBox.xaml - MSBuild:Compile - Designer - - - MainPage.xaml - MSBuild:Compile - Designer - - {F5D665F8-AE19-4F3F-99A7-230A1E8305D2} @@ -170,6 +147,20 @@ PreserveNewest + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + +