From 28b266bc5e67066a50b395fe5b0c3f6695a7c538 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Sep 2013 10:49:59 +0800 Subject: [PATCH 1/9] [Android] Android.mk fixes after adding GUI test. --- extensions/Android.mk | 2 +- samples/Cpp/TestCpp/Android.mk | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/extensions/Android.mk b/extensions/Android.mk index e5f7924e84..0a1877b23e 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -43,8 +43,8 @@ CocoStudio/Armature/display/CCDisplayFactory.cpp \ CocoStudio/Armature/display/CCDisplayManager.cpp \ CocoStudio/Armature/display/CCSkin.cpp \ CocoStudio/Armature/physics/CCColliderDetector.cpp \ -CocoStudio/Armature/utils/CCArmatureDefine.cpp \ CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ +CocoStudio/Armature/utils/CCArmatureDefine.cpp \ CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ CocoStudio/Armature/utils/CCTransformHelp.cpp \ diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 5bfb604d82..0bd66f56b9 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -45,6 +45,7 @@ Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ Classes/EffectsTest/EffectsTest.cpp \ Classes/ExtensionsTest/ExtensionsTest.cpp \ +Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \ Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ @@ -59,8 +60,27 @@ Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp \ Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp \ Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ -Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ +Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ +Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \ Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \ Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \ From 480b2dd1d8c627ff3d0e2ca3c0c638c8705a88d2 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Sep 2013 10:52:42 +0800 Subject: [PATCH 2/9] [Linux] Updating Makefile for TestCpp. --- samples/Cpp/TestCpp/proj.linux/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/samples/Cpp/TestCpp/proj.linux/Makefile b/samples/Cpp/TestCpp/proj.linux/Makefile index f681b7d41d..4cf8a35a44 100644 --- a/samples/Cpp/TestCpp/proj.linux/Makefile +++ b/samples/Cpp/TestCpp/proj.linux/Makefile @@ -60,6 +60,25 @@ SOURCES = ../Classes/AccelerometerTest/AccelerometerTest.cpp \ ../Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ ../Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ ../Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UISceneManager.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIDragPanelTest/UIDragPanelTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelAtlasTest/UILabelAtlasTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelBMFontTest/UILabelBMFontTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UILabelTest/UILabelTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIPanelTest/UIPanelTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UITextAreaTest/UITextAreaTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp \ + ../Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp \ ../Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp \ ../Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ ../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp \ From 664345a6736f6a631a47ed936661093e1ed9a353 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Sep 2013 11:01:00 +0800 Subject: [PATCH 3/9] Removing unused files. Old XXXDispatcher. --- .../CCKeyboardDispatcher.h | 83 ------ cocos2dx/keypad_dispatcher/CCKeypadDelegate.h | 102 -------- .../keypad_dispatcher/CCKeypadDispatcher.h | 103 -------- .../CCTouchDelegateProtocol.h | 179 ------------- cocos2dx/touch_dispatcher/CCTouchDispatcher.h | 237 ------------------ cocos2dx/touch_dispatcher/CCTouchHandler.h | 138 ---------- 6 files changed, 842 deletions(-) delete mode 100644 cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.h delete mode 100644 cocos2dx/keypad_dispatcher/CCKeypadDelegate.h delete mode 100644 cocos2dx/keypad_dispatcher/CCKeypadDispatcher.h delete mode 100644 cocos2dx/touch_dispatcher/CCTouchDelegateProtocol.h delete mode 100644 cocos2dx/touch_dispatcher/CCTouchDispatcher.h delete mode 100644 cocos2dx/touch_dispatcher/CCTouchHandler.h diff --git a/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.h b/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.h deleted file mode 100644 index 86a006d933..0000000000 --- a/cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __CCKEYBOARD_DISPATCHER_H__ -#define __CCKEYBOARD_DISPATCHER_H__ - -#include -#include -#include "cocoa/CCArray.h" - -NS_CC_BEGIN - -/** - * @addtogroup input - * @{ - */ - -typedef std::function KeyboardDelegate; - -/** -@class KeyboardDispatcher -@brief Dispatch the keypad message from the phone -*/ -class CC_DLL KeyboardDispatcher : public Object -{ -public: - /** - * @js ctor - */ - KeyboardDispatcher(); - /** - * @js NA - * @lua NA - */ - ~KeyboardDispatcher(); - - /** - @brief set delagate to key press event - */ - void setKeyPressDelegate(KeyboardDelegate delegate); - /** - @brief set delagate to key release event - */ - void setKeyReleaseDelegate(KeyboardDelegate delegate); - - /** - @brief dispatch the key stroke event - */ - bool dispatchKeyboardEvent(int keyCode, bool pressed); - -protected: - - KeyboardDelegate _keyPressDelegate; - KeyboardDelegate _keyReleaseDelegate; -}; - -// end of input group -/// @} - -NS_CC_END - -#endif //__CCKEYBOARD_DISPATCHER_H__ diff --git a/cocos2dx/keypad_dispatcher/CCKeypadDelegate.h b/cocos2dx/keypad_dispatcher/CCKeypadDelegate.h deleted file mode 100644 index 60c582326a..0000000000 --- a/cocos2dx/keypad_dispatcher/CCKeypadDelegate.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __CCKEYPAD_DELEGATE_H__ -#define __CCKEYPAD_DELEGATE_H__ - - -#include "cocoa/CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup input - * @{ - */ - -class CC_DLL KeypadDelegate -{ -public: - /** The back key clicked - * @js NA - * @lua NA - */ - - virtual void keyBackClicked() {} - - /** The menu key clicked. only available on wophone & android - * @js NA - * @lua NA - */ - virtual void keyMenuClicked() {}; -}; - -/** -@brief -KeypadHandler -Object than contains the KeypadDelegate. -*/ -class CC_DLL KeypadHandler : public Object -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~KeypadHandler(void); - - /** delegate - * @js NA - * @lua NA - */ - KeypadDelegate* getDelegate(); - /** - * @js NA - * @lua NA - */ - void setDelegate(KeypadDelegate *pDelegate); - - /** initializes a KeypadHandler with a delegate - * @js NA - * @lua NA - */ - virtual bool initWithDelegate(KeypadDelegate *pDelegate); - -public: - /** allocates a KeypadHandler with a delegate - * @js NA - * @lua NA - */ - static KeypadHandler* handlerWithDelegate(KeypadDelegate *pDelegate); - -protected: - KeypadDelegate* _delegate; -}; - -// end of input group -/// @} - -NS_CC_END - -#endif // __CCKEYPAD_DELEGATE_H__ diff --git a/cocos2dx/keypad_dispatcher/CCKeypadDispatcher.h b/cocos2dx/keypad_dispatcher/CCKeypadDispatcher.h deleted file mode 100644 index 4dcb3f2f3d..0000000000 --- a/cocos2dx/keypad_dispatcher/CCKeypadDispatcher.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __CCKEYPAD_DISPATCHER_H__ -#define __CCKEYPAD_DISPATCHER_H__ - -#include "CCKeypadDelegate.h" -#include "cocoa/CCArray.h" - -NS_CC_BEGIN - -/** - * @addtogroup input - * @{ - */ - -typedef enum { - // the back key clicked msg - kTypeBackClicked = 1, - kTypeMenuClicked, -} ccKeypadMSGType; - -struct _ccCArray; -/** -@class KeypadDispatcher -@brief Dispatch the keypad message from the phone -*/ -class CC_DLL KeypadDispatcher : public Object -{ -public: - /** - * @js ctor - */ - KeypadDispatcher(); - /** - * @js NA - * @lua NA - */ - ~KeypadDispatcher(); - - /** - @brief add delegate to concern keypad msg - */ - void addDelegate(KeypadDelegate* pDelegate); - - /** - @brief remove the delegate from the delegates who concern keypad msg - */ - void removeDelegate(KeypadDelegate* pDelegate); - - /** - @brief force add the delegate - */ - void forceAddDelegate(KeypadDelegate* pDelegate); - - /** - @brief force remove the delegate - */ - void forceRemoveDelegate(KeypadDelegate* pDelegate); - - /** - @brief dispatch the key pad msg - */ - bool dispatchKeypadMSG(ccKeypadMSGType nMsgType); - -protected: - - Array* _delegates; - bool _locked; - bool _toAdd; - bool _toRemove; - - struct _ccCArray *_handlersToAdd; - struct _ccCArray *_handlersToRemove; -}; - -// end of input group -/// @} - -NS_CC_END - -#endif //__CCKEYPAD_DISPATCHER_H__ diff --git a/cocos2dx/touch_dispatcher/CCTouchDelegateProtocol.h b/cocos2dx/touch_dispatcher/CCTouchDelegateProtocol.h deleted file mode 100644 index 1474289c97..0000000000 --- a/cocos2dx/touch_dispatcher/CCTouchDelegateProtocol.h +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 Valentin Milea - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ -#define __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ - -#include "cocoa/CCObject.h" -#include "ccConfig.h" - -NS_CC_BEGIN - -class Touch; -class Event; -class Set; -class TouchDispatcher; - -/** - * @addtogroup input - * @{ - */ - -class CC_DLL TouchDelegate -{ -public: - /** - * @js NA - * @lua NA - */ - TouchDelegate() {} - /** - * @js NA - * @lua NA - */ - virtual ~TouchDelegate() - { - } - /** - * @js NA - * @lua NA - */ - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; - // optional - /** - * @js NA - * @lua NA - */ - virtual void ccTouchMoved(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - - // optional - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesCancelled(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - -}; -/** - @brief - Using this type of delegate results in two benefits: - - 1. You don't need to deal with Sets, the dispatcher does the job of splitting - them. You get exactly one UITouch per call. - - 2. You can *claim* a UITouch by returning true in ccTouchBegan. Updates of claimed - touches are sent only to the delegate(s) that claimed them. So if you get a move/ - ended/canceled update you're sure it's your touch. This frees you from doing a - lot of checks when doing multi-touch. - - (The name TargetedTouchDelegate relates to updates "targeting" their specific - handler, without bothering the other handlers.) - @since v0.8 - */ - class CC_DLL TargetedTouchDelegate : public TouchDelegate - { - public: - /** Return true to claim the touch. - @since v0 - */ - virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;}; - - // optional - /** - * @js NA - * @lua NA - */ - virtual void ccTouchMoved(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - }; - -/** @brief - This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Canceled). - @since v0.8 - */ - class CC_DLL StandardTouchDelegate : public TouchDelegate - { - public: - // optional - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesBegan(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesMoved(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesEnded(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - /** - * @js NA - * @lua NA - */ - virtual void ccTouchesCancelled(Set *pTouches, Event *pEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - }; - -// end of input group -/// @} - -NS_CC_END - -#endif // __TOUCH_DISPATHCHER_CCTOUCH_DELEGATE_PROTOCOL_H__ diff --git a/cocos2dx/touch_dispatcher/CCTouchDispatcher.h b/cocos2dx/touch_dispatcher/CCTouchDispatcher.h deleted file mode 100644 index 0c1a187c4c..0000000000 --- a/cocos2dx/touch_dispatcher/CCTouchDispatcher.h +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 Valentin Milea - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __TOUCH_DISPATCHER_CCTOUCH_DISPATCHER_H__ -#define __TOUCH_DISPATCHER_CCTOUCH_DISPATCHER_H__ - -#include "CCTouchDelegateProtocol.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" - -NS_CC_BEGIN - -/** - * @addtogroup input - * @{ - */ - - -enum { - CCTOUCHBEGAN, - CCTOUCHMOVED, - CCTOUCHENDED, - CCTOUCHCANCELLED, - - ccTouchMax, -}; - -class Set; -class Event; - -struct ccTouchHandlerHelperData { - // we only use the type -// void (StandardTouchDelegate::*touchesSel)(Set*, Event*); -// void (TargetedTouchDelegate::*touchSel)(NSTouch*, Event*); - int _type; -}; - - -class CC_DLL EGLTouchDelegate -{ -public: - /** - * @js NA - * @lua NA - */ - virtual void touchesBegan(Set* touches, Event* pEvent) = 0; - /** - * @js NA - * @lua NA - */ - virtual void touchesMoved(Set* touches, Event* pEvent) = 0; - /** - * @js NA - * @lua NA - */ - virtual void touchesEnded(Set* touches, Event* pEvent) = 0; - /** - * @js NA - * @lua NA - */ - virtual void touchesCancelled(Set* touches, Event* pEvent) = 0; - /** - * @js NA - * @lua NA - */ - virtual ~EGLTouchDelegate() {} -}; - -class TouchHandler; -struct _ccCArray; -/** @brief TouchDispatcher. - Singleton that handles all the touch events. - The dispatcher dispatches events to the registered TouchHandlers. - There are 2 different type of touch handlers: - - Standard Touch Handlers - - Targeted Touch Handlers - - The Standard Touch Handlers work like the CocoaTouch touch handler: a set of touches is passed to the delegate. - On the other hand, the Targeted Touch Handlers only receive 1 touch at the time, and they can "swallow" touches (avoid the propagation of the event). - - Firstly, the dispatcher sends the received touches to the targeted touches. - These touches can be swallowed by the Targeted Touch Handlers. If there are still remaining touches, then the remaining touches will be sent - to the Standard Touch Handlers. - - @since v0.8.0 - */ -class CC_DLL TouchDispatcher : public Object, public EGLTouchDelegate -{ -public: - /** - * @js NA - * @lua NA - */ - ~TouchDispatcher(); - /** - * @js NA - * @lua NA - */ - bool init(void); - /** - * @js NA - * @lua NA - */ - TouchDispatcher() - : _targetedHandlers(NULL) - , _standardHandlers(NULL) - , _handlersToAdd(NULL) - , _handlersToRemove(NULL) - - {} - -public: - /** Whether or not the events are going to be dispatched. Default: true - * @js NA - * @lua NA - */ - bool isDispatchEvents(void); - void setDispatchEvents(bool bDispatchEvents); - - /** Adds a standard touch delegate to the dispatcher's list. - See StandardTouchDelegate description. - IMPORTANT: The delegate will be retained. - * @js NA - * @lua NA - */ - void addStandardDelegate(TouchDelegate *pDelegate, int nPriority); - - /** Adds a targeted touch delegate to the dispatcher's list. - See TargetedTouchDelegate description. - IMPORTANT: The delegate will be retained. - * @js NA - * @lua NA - */ - void addTargetedDelegate(TouchDelegate *pDelegate, int nPriority, bool bSwallowsTouches); - - /** Removes a touch delegate. - The delegate will be released - * @js NA - * @lua NA - */ - void removeDelegate(TouchDelegate *pDelegate); - - /** Removes all touch delegates, releasing all the delegates - * @js NA - * @lua NA - */ - void removeAllDelegates(void); - - /** Changes the priority of a previously added delegate. The lower the number, - the higher the priority - * @js NA - * @lua NA - */ - void setPriority(int nPriority, TouchDelegate *pDelegate); - /** - * @js NA - * @lua NA - */ - void touches(Set *pTouches, Event *pEvent, unsigned int uIndex); - /** - * @js NA - * @lua NA - */ - virtual void touchesBegan(Set* touches, Event* pEvent); - /** - * @js NA - * @lua NA - */ - virtual void touchesMoved(Set* touches, Event* pEvent); - /** - * @js NA - * @lua NA - */ - virtual void touchesEnded(Set* touches, Event* pEvent); - /** - * @js NA - * @lua NA - */ - virtual void touchesCancelled(Set* touches, Event* pEvent); - -public: - /** - * @js NA - * @lua NA - */ - TouchHandler* findHandler(TouchDelegate *pDelegate); -protected: - void forceRemoveDelegate(TouchDelegate *pDelegate); - void forceAddHandler(TouchHandler *pHandler, Array* pArray); - void forceRemoveAllDelegates(void); - void rearrangeHandlers(Array* pArray); - TouchHandler* findHandler(Array* pArray, TouchDelegate *pDelegate); - -protected: - Array* _targetedHandlers; - Array* _standardHandlers; - - bool _locked; - bool _toAdd; - bool _toRemove; - Array* _handlersToAdd; - struct _ccCArray *_handlersToRemove; - bool _toQuit; - bool _dispatchEvents; - - // 4, 1 for each type of event - struct ccTouchHandlerHelperData _handlerHelperData[ccTouchMax]; -}; - -// end of input group -/// @} - -NS_CC_END - -#endif // __TOUCH_DISPATCHER_CCTOUCH_DISPATCHER_H__ diff --git a/cocos2dx/touch_dispatcher/CCTouchHandler.h b/cocos2dx/touch_dispatcher/CCTouchHandler.h deleted file mode 100644 index ff0c55fea7..0000000000 --- a/cocos2dx/touch_dispatcher/CCTouchHandler.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2009 Valentin Milea - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. -****************************************************************************/ - -#ifndef __TOUCH_DISPATCHER_CCTOUCH_HANDLER_H__ -#define __TOUCH_DISPATCHER_CCTOUCH_HANDLER_H__ - -#include "CCTouchDelegateProtocol.h" -#include "CCTouchDispatcher.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCSet.h" - -NS_CC_BEGIN - -/** - * @addtogroup input - * @{ - */ - -/** - TouchHandler - Object than contains the delegate and priority of the event handler. -*/ -class CC_DLL TouchHandler : public Object -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~TouchHandler(void); - - /** delegate - * @js NA - * @lua NA - */ - TouchDelegate* getDelegate(); - /** - * @js NA - * @lua NA - */ - void setDelegate(TouchDelegate *pDelegate); - - /** priority */ - int getPriority(void); - void setPriority(int nPriority); - - /** enabled selectors */ - int getEnabledSelectors(void); - void setEnalbedSelectors(int nValue); - - /** initializes a TouchHandler with a delegate and a priority */ - bool initWithDelegate(TouchDelegate *pDelegate, int nPriority); - -public: - /** allocates a TouchHandler with a delegate and a priority */ - static TouchHandler* handlerWithDelegate(TouchDelegate *pDelegate, int nPriority); - -protected: - TouchDelegate *_delegate; - int _priority; - int _enabledSelectors; -}; - -/** StandardTouchHandler - It forwards each event to the delegate. - */ -class CC_DLL StandardTouchHandler : public TouchHandler -{ -public: - /** initializes a TouchHandler with a delegate and a priority */ - bool initWithDelegate(TouchDelegate *pDelegate, int nPriority); - -public: - /** allocates a TouchHandler with a delegate and a priority */ - static StandardTouchHandler* handlerWithDelegate(TouchDelegate *pDelegate, int nPriority); -}; - -/** - TargetedTouchHandler - Object than contains the claimed touches and if it swallows touches. - Used internally by TouchDispatcher - */ -class CC_DLL TargetedTouchHandler : public TouchHandler -{ -public: - /** - * @js NA - * @lua NA - */ - ~TargetedTouchHandler(void); - - /** whether or not the touches are swallowed */ - bool isSwallowsTouches(void); - void setSwallowsTouches(bool bSwallowsTouches); - - /** MutableSet that contains the claimed touches */ - Set* getClaimedTouches(void); - - /** initializes a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ - bool initWithDelegate(TouchDelegate *pDelegate, int nPriority, bool bSwallow); - -public: - /** allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ - static TargetedTouchHandler* handlerWithDelegate(TouchDelegate *pDelegate, int nPriority, bool bSwallow); - -protected: - bool _swallowsTouches; - Set *_claimedTouches; -}; - -// end of input group -/// @} - -NS_CC_END - -#endif // __TOUCH_DISPATCHER_CCTOUCH_HANDLER_H__ From fe1b11a814ed5aceb531c09bc66442de020d26a5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Sep 2013 11:28:33 +0800 Subject: [PATCH 4/9] Fixing wrong include. --- .../Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp index 6514e7e2cf..4d17896184 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp @@ -1,7 +1,7 @@ #include "CocosGUIScene.h" #include "UISceneManager.h" //#include "CocosGUIExamplesRegisterScene.h" -#include "ExtensionsTest.h" +#include "../ExtensionsTest.h" const char* gui_scene_names[2] = { From 3072144ad5a73e67395692df2ee8e667b09fb801 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 17 Sep 2013 11:44:33 +0800 Subject: [PATCH 5/9] implement Cocos2dxHelperListener --- .../src/org/cocos2dx/lib/Cocos2dxHelper.java | 65 +++++++++++++++---- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index ef830a0cb0..824cb69dc7 100755 --- a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -27,7 +27,8 @@ import java.io.UnsupportedEncodingException; import java.util.Locale; import android.app.Activity; -import android.content.Context; +import android.app.AlertDialog; +import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; @@ -72,8 +73,8 @@ public class Cocos2dxHelper { public static void init(final Activity activity) { final ApplicationInfo applicationInfo = activity.getApplicationInfo(); - Cocos2dxHelper.sActivity = activity; - + initListener(); + try { // Get the lib_name from AndroidManifest.xml metadata ActivityInfo ai = @@ -101,6 +102,51 @@ public class Cocos2dxHelper { //Cocos2dxHelper.nativeSetAssetManager(sAssetManager); Cocos2dxBitmap.setContext(activity); } + + public static void initListener() { + Cocos2dxHelper.sCocos2dxHelperListener = new Cocos2dxHelperListener() { + + @Override + public void showEditTextDialog(final String title, final String message, + final int inputMode, final int inputFlag, final int returnType, final int maxLength) { + + sActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + new Cocos2dxEditBoxDialog(sActivity, + title, + message, + inputMode, + inputFlag, + returnType, + maxLength).show(); + } + }); + } + + + @Override + public void showDialog(final String title, final String message) { + + sActivity.runOnUiThread(new Runnable() { + + @Override + public void run() { + new AlertDialog.Builder(sActivity) + .setTitle(title) + .setMessage(message) + .setPositiveButton("Ok", + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + // TODO Auto-generated method stub + } + }).create().show(); + } + }); + } + }; + } public static Activity getActivity() { return sActivity; @@ -241,12 +287,7 @@ public class Cocos2dxHelper { try { final byte[] bytesUTF8 = pResult.getBytes("UTF8"); - Cocos2dxHelper.sCocos2dxHelperListener.runOnGLThread(new Runnable() { - @Override - public void run() { - Cocos2dxHelper.nativeSetEditTextDialogResult(bytesUTF8); - } - }); + Cocos2dxHelper.nativeSetEditTextDialogResult(bytesUTF8); } catch (UnsupportedEncodingException pUnsupportedEncodingException) { /* Nothing. */ } @@ -342,9 +383,7 @@ public class Cocos2dxHelper { // =========================================================== public static interface Cocos2dxHelperListener { - public void showDialog(final String pTitle, final String pMessage); - public void showEditTextDialog(final String pTitle, final String pMessage, final int pInputMode, final int pInputFlag, final int pReturnType, final int pMaxLength); - - public void runOnGLThread(final Runnable pRunnable); + public void showDialog(final String title, final String message); + public void showEditTextDialog(final String title, final String message, final int inputMode, final int inputFlag, final int returnType, final int maxLength); } } From 9cd99f4c669a5eb5ada271bf1da01ffc6799fafa Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Sep 2013 11:56:00 +0800 Subject: [PATCH 6/9] [Android] ArmatureTest compilation fix. --- samples/Cpp/TestCpp/Android.mk | 1 - .../ArmatureTest/ArmatureScene.cpp | 873 ------------------ .../ArmatureTest/ArmatureScene.h | 217 ----- 3 files changed, 1091 deletions(-) delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp delete mode 100644 samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index 0bd66f56b9..8e8f270da7 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -45,7 +45,6 @@ Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \ Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \ Classes/EffectsTest/EffectsTest.cpp \ Classes/ExtensionsTest/ExtensionsTest.cpp \ -Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \ Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \ Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \ Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp deleted file mode 100644 index 0e62769a95..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp +++ /dev/null @@ -1,873 +0,0 @@ -#include "ArmatureScene.h" -#include "../../testResource.h" - - -using namespace cocos2d; -using namespace cocos2d::extension; - -CCLayer* NextTest(); -CCLayer* BackTest(); -CCLayer* RestartTest(); - -static int s_nActionIdx = -1; - - -CCLayer *CreateLayer(int index) -{ - CCLayer *pLayer = NULL; - switch(index) - { - case TEST_DRAGON_BONES_2_0: - pLayer = new TestDragonBones20(); break; - case TEST_COCOSTUDIO_WITH_SKELETON: - pLayer = new TestCSWithSkeleton(); break; - case TEST_COCOSTUDIO_WITHOUT_SKELETON: - pLayer = new TestCSWithoutSkeleton(); break; - case TEST_PERFORMANCE: - pLayer = new TestPerformance(); break; - case TEST_CHANGE_ZORDER: - pLayer = new TestChangeZorder(); break; - case TEST_ANIMATION_EVENT: - pLayer = new TestAnimationEvent(); break; - case TEST_PARTICLE_DISPLAY: - pLayer = new TestParticleDisplay(); break; - case TEST_USE_DIFFERENT_PICTURE: - pLayer = new TestUseMutiplePicture(); break; - case TEST_BCOLLIDER_DETECTOR: - pLayer = new TestColliderDetector(); break; - case TEST_BOUDINGBOX: - pLayer = new TestBoundingBox(); break; - case TEST_ANCHORPOINT: - pLayer = new TestAnchorPoint(); break; - case TEST_ARMATURE_NESTING: - pLayer = new TestArmatureNesting(); break; - default: - break; - } - - return pLayer; -} - - -CCLayer* NextTest() -{ - ++s_nActionIdx; - s_nActionIdx = s_nActionIdx % TEST_LAYER_COUNT; - - CCLayer* pLayer = CreateLayer(s_nActionIdx); - pLayer->autorelease(); - - return pLayer; -} - -CCLayer* BackTest() -{ - --s_nActionIdx; - if( s_nActionIdx < 0 ) - s_nActionIdx += TEST_LAYER_COUNT; - - CCLayer* pLayer = CreateLayer(s_nActionIdx); - pLayer->autorelease(); - - return pLayer; -} - -CCLayer* RestartTest() -{ - CCLayer* pLayer = CreateLayer(s_nActionIdx); - pLayer->autorelease(); - - return pLayer; -} - - -ArmatureTestScene::ArmatureTestScene(bool bPortrait) -{ - TestScene::init(); - - CCSprite *bg = CCSprite::create("armature/bg.jpg"); - bg->setPosition(VisibleRect::center()); - - float scaleX = VisibleRect::getVisibleRect().size.width / bg->getContentSize().width; - float scaleY = VisibleRect::getVisibleRect().size.height / bg->getContentSize().height; - - bg->setScaleX(scaleX); - bg->setScaleY(scaleY); - - addChild(bg); -} -void ArmatureTestScene::runThisTest() -{ - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/TestBone0.png", "armature/TestBone0.plist", "armature/TestBone.json"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/Cowboy0.png", "armature/Cowboy0.plist", "armature/Cowboy.ExportJson"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/knight.png", "armature/knight.plist", "armature/knight.xml"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/weapon.png", "armature/weapon.plist", "armature/weapon.xml"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/robot.png", "armature/robot.plist", "armature/robot.xml"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/cyborg.png", "armature/cyborg.plist", "armature/cyborg.xml"); - CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("armature/Dragon.png", "armature/Dragon.plist", "armature/Dragon.xml"); - - s_nActionIdx = -1; - addChild(NextTest()); - - CCDirector::sharedDirector()->replaceScene(this); -} -void ArmatureTestScene::MainMenuCallback(CCObject* pSender) -{ - TestScene::MainMenuCallback(pSender); - - removeAllChildren(); - CCArmatureDataManager::sharedArmatureDataManager()->purgeArmatureSystem(); -} - - - -void ArmatureTestLayer::onEnter() -{ - - CCLayer::onEnter(); - - // add title and subtitle - std::string str = title(); - const char * pTitle = str.c_str(); - CCLabelTTF* label = CCLabelTTF::create(pTitle, "Arial", 18); - label->setColor(ccc3(0, 0, 0)); - addChild(label, 1, 10000); - label->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 30) ); - - std::string strSubtitle = subtitle(); - if( ! strSubtitle.empty() ) - { - CCLabelTTF* l = CCLabelTTF::create(strSubtitle.c_str(), "Arial", 18); - l->setColor(ccc3(0, 0, 0)); - addChild(l, 1, 10001); - l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y - 60) ); - } - - // add menu - CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(ArmatureTestLayer::backCallback) ); - CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(ArmatureTestLayer::restartCallback) ); - CCMenuItemImage *item3 = CCMenuItemImage::create(s_pPathF1, s_pPathF2, this, menu_selector(ArmatureTestLayer::nextCallback) ); - - CCMenu *menu = CCMenu::create(item1, item2, item3, NULL); - - menu->setPosition(CCPointZero); - item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); - item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); - - addChild(menu, 100); - - setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTextureColor)); - -} -void ArmatureTestLayer::onExit() -{ -} - -std::string ArmatureTestLayer::title() -{ - return "CSArmature Test Bed"; -} -std::string ArmatureTestLayer::subtitle() -{ - return ""; -} - -void ArmatureTestLayer::restartCallback(CCObject* pSender) -{ - CCScene* s = new ArmatureTestScene(); - s->addChild( RestartTest() ); - CCDirector::sharedDirector()->replaceScene(s); - s->release(); -} -void ArmatureTestLayer::nextCallback(CCObject* pSender) -{ - CCScene* s = new ArmatureTestScene(); - s->addChild( NextTest() ); - CCDirector::sharedDirector()->replaceScene(s); - s->release(); -} -void ArmatureTestLayer::backCallback(CCObject* pSender) -{ - CCScene* s = new ArmatureTestScene(); - s->addChild( BackTest() ); - CCDirector::sharedDirector()->replaceScene(s); - s->release(); -} -void ArmatureTestLayer::draw() -{ - CCLayer::draw(); -} - - - -void TestDragonBones20::onEnter() -{ - ArmatureTestLayer::onEnter(); - - cocos2d::extension::CCArmature *armature = NULL; - armature = cocos2d::extension::CCArmature::create("Dragon"); - armature->getAnimation()->playByIndex(1); - armature->getAnimation()->setAnimationScale(0.4f); - armature->setPosition(VisibleRect::center().x, VisibleRect::center().y * 0.3f); - armature->setScale(0.6f); - addChild(armature); -} - -std::string TestDragonBones20::title() -{ - return "Test Export From DragonBones version 2.0"; -} - - -void TestCSWithSkeleton::onEnter() -{ - ArmatureTestLayer::onEnter(); - cocos2d::extension::CCArmature *armature = NULL; - armature = cocos2d::extension::CCArmature::create("Cowboy"); - armature->getAnimation()->playByIndex(0); - armature->setScale(0.2f); - armature->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y/*-100*/)); - addChild(armature); -} - -std::string TestCSWithSkeleton::title() -{ - return "Test Export From CocoStudio With Skeleton Effect"; -} - - - -void TestCSWithoutSkeleton::onEnter() -{ - ArmatureTestLayer::onEnter(); - cocos2d::extension::CCArmature *armature = NULL; - armature = cocos2d::extension::CCArmature::create("TestBone"); - armature->getAnimation()->playByIndex(0); - armature->setAnchorPoint(ccp(0.5, -0.1)); - armature->setScale(0.2f); - armature->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y-100)); - addChild(armature); -} - -std::string TestCSWithoutSkeleton::title() -{ - return "Test Export From CocoStudio Without Skeleton Effect"; -} - - - - -TestPerformance::~TestPerformance() -{ -} -void TestPerformance::onEnter() -{ - ArmatureTestLayer::onEnter(); - - armatureCount = frames = times = lastTimes = 0; - generated = false; - - scheduleUpdate(); -} - -std::string TestPerformance::title() -{ - return "Test Performance"; -} -std::string TestPerformance::subtitle() -{ - return "Current CCArmature Count : "; -} -void TestPerformance::addArmature(cocos2d::extension::CCArmature *armature) -{ - armatureCount++; - addChild(armature, armatureCount); -} -void TestPerformance::update(float delta) -{ - frames ++; - times += delta; - - if (frames/times > 58) - { - cocos2d::extension::CCArmature *armature = NULL; - armature = new cocos2d::extension::CCArmature(); - armature->init("Knight_f/Knight"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(50 + armatureCount * 2, 150); - armature->setScale(0.6f); - addArmature(armature); - armature->release(); - - char pszCount[255]; - sprintf(pszCount, "%s %i", subtitle().c_str(), armatureCount); - CCLabelTTF *label = (CCLabelTTF*)getChildByTag(10001); - label->setString(pszCount); - } -} - - - - - - -void TestChangeZorder::onEnter() -{ - ArmatureTestLayer::onEnter(); - - cocos2d::extension::CCArmature *armature = NULL; - currentTag = -1; - - armature = cocos2d::extension::CCArmature::create("Knight_f/Knight"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y-100)); - ++currentTag; - armature->setScale(0.6f); - addChild(armature, currentTag, currentTag); - - armature = cocos2d::extension::CCArmature::create("TestBone"); - armature->getAnimation()->playByIndex(0); - armature->setScale(0.24f); - armature->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y-100)); - ++currentTag; - addChild(armature, currentTag, currentTag); - - armature = cocos2d::extension::CCArmature::create("Dragon"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(ccp(VisibleRect::center().x , VisibleRect::center().y-100)); - ++currentTag; - armature->setScale(0.6f); - addChild(armature, currentTag, currentTag); - - schedule( schedule_selector(TestChangeZorder::changeZorder), 1); - - currentTag = 0; -} -std::string TestChangeZorder::title() -{ - return "Test Change ZOrder Of Different CCArmature"; -} -void TestChangeZorder::changeZorder(float dt) -{ - - CCNode *node = getChildByTag(currentTag); - - node->setZOrder(CCRANDOM_0_1() * 3); - - currentTag ++; - currentTag = currentTag % 3; -} - - - - -void TestAnimationEvent::onEnter() -{ - ArmatureTestLayer::onEnter(); - armature = cocos2d::extension::CCArmature::create("Cowboy"); - armature->getAnimation()->play("Fire"); - armature->setScaleX(-0.24f); - armature->setScaleY(0.24f); - armature->setPosition(ccp(VisibleRect::left().x + 50, VisibleRect::left().y)); - armature->getAnimation()->MovementEventSignal.connect(this, &TestAnimationEvent::animationEvent); - addChild(armature); -} -std::string TestAnimationEvent::title() -{ - return "Test CCArmature Animation Event"; -} -void TestAnimationEvent::animationEvent(cocos2d::extension::CCArmature *armature, MovementEventType movementType, const char *movementID) -{ - std::string id = movementID; - - if (movementType == LOOP_COMPLETE) - { - if (id.compare("Fire") == 0) - { - CCActionInterval *actionToRight = CCMoveTo::create(2, ccp(VisibleRect::right().x - 50, VisibleRect::right().y)); - armature->stopAllActions(); - armature->runAction(CCSequence::create(actionToRight, CCCallFunc::create(this, callfunc_selector(TestAnimationEvent::callback1)), NULL)); - armature->getAnimation()->play("Walk"); - } - else if (id.compare("FireMax") == 0) - { - CCActionInterval *actionToLeft = CCMoveTo::create(2, ccp(VisibleRect::left().x + 50, VisibleRect::left().y)); - armature->stopAllActions(); - armature->runAction(CCSequence::create(actionToLeft, CCCallFunc::create(this, callfunc_selector(TestAnimationEvent::callback2)), NULL)); - armature->getAnimation()->play("Walk"); - } - } -} -void TestAnimationEvent::callback1() -{ - armature->runAction(CCScaleTo::create(0.3f, 0.3f, 0.3f)); - armature->getAnimation()->play("FireMax", 10); -} -void TestAnimationEvent::callback2() -{ - armature->runAction(CCScaleTo::create(0.3f, -0.3f, 0.3f)); - armature->getAnimation()->play("Fire", 10); -} - - - - -void TestParticleDisplay::onEnter() -{ - ArmatureTestLayer::onEnter(); - setTouchEnabled(true); - - animationID = 0; - - armature = cocos2d::extension::CCArmature::create("robot"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(VisibleRect::center()); - armature->setScale(0.48f); - armature->getAnimation()->setAnimationScale(0.5f); - addChild(armature); - - - CCParticleSystem *p1 = CCParticleSystemQuad::create("Particles/SmallSun.plist"); - CCParticleSystem *p2 = CCParticleSystemQuad::create("Particles/SmallSun.plist"); - - cocos2d::extension::CCBone *bone = cocos2d::extension::CCBone::create("p1"); - bone->addDisplay(p1, 0); - bone->changeDisplayByIndex(0, true); - bone->setIgnoreMovementBoneData(true); - bone->setZOrder(100); - bone->setScale(1.2f); - armature->addBone(bone, "bady-a3"); - - bone = cocos2d::extension::CCBone::create("p2"); - bone->addDisplay(p2, 0); - bone->changeDisplayByIndex(0, true); - bone->setIgnoreMovementBoneData(true); - bone->setZOrder(100); - bone->setScale(1.2f); - armature->addBone(bone, "bady-a30"); -} -std::string TestParticleDisplay::title() -{ - return "Test Particle Display"; -} -std::string TestParticleDisplay::subtitle() -{ - return "Touch to change animation"; -} -bool TestParticleDisplay::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) -{ - ++animationID; - animationID = animationID % armature->getAnimation()->getMovementCount(); - armature->getAnimation()->playByIndex(animationID); - return false; -} - -void TestParticleDisplay::registerWithTouchDispatcher() -{ - CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, INT_MIN+1, true); -} - - - - -void TestUseMutiplePicture::onEnter() -{ - ArmatureTestLayer::onEnter(); - setTouchEnabled(true); - - displayIndex = 0; - - armature = cocos2d::extension::CCArmature::create("Knight_f/Knight"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(ccp(VisibleRect::left().x+70, VisibleRect::left().y)); - armature->setScale(1.2f); - addChild(armature); - - std::string weapon[] = {"weapon_f-sword.png", "weapon_f-sword2.png", "weapon_f-sword3.png", "weapon_f-sword4.png", "weapon_f-sword5.png", "weapon_f-knife.png", "weapon_f-hammer.png"}; - - CCSpriteDisplayData displayData; - for (int i = 0; i < 7; i++) - { - displayData.setParam(weapon[i].c_str()); - armature->getBone("weapon")->addDisplay(&displayData, i); - } -} -std::string TestUseMutiplePicture::title() -{ - return "Test One CCArmature Use Different Picture"; -} -std::string TestUseMutiplePicture::subtitle() -{ - return "weapon and armature are in different picture"; -} -bool TestUseMutiplePicture::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) -{ - ++displayIndex; - displayIndex = (displayIndex) % 6; - armature->getBone("weapon")->changeDisplayByIndex(displayIndex, true); - return false; -} -void TestUseMutiplePicture::registerWithTouchDispatcher() -{ - CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, INT_MIN+1, true); -} - - - - - - -#if ENABLE_PHYSICS_BOX2D_DETECT - -class Contact -{ -public: - b2Fixture *fixtureA; - b2Fixture *fixtureB; -}; - -class ContactListener : public b2ContactListener -{ - //! Callbacks for derived classes. - virtual void BeginContact(b2Contact *contact) - { - if (contact) - { - Contact c; - c.fixtureA = contact->GetFixtureA(); - c.fixtureB = contact->GetFixtureB(); - - contact_list.push_back(c); - } - B2_NOT_USED(contact); - } - virtual void EndContact(b2Contact *contact) - { - contact_list.clear(); - B2_NOT_USED(contact); - } - virtual void PreSolve(b2Contact *contact, const b2Manifold *oldManifold) - { - B2_NOT_USED(contact); - B2_NOT_USED(oldManifold); - } - virtual void PostSolve(const b2Contact *contact, const b2ContactImpulse *impulse) - { - B2_NOT_USED(contact); - B2_NOT_USED(impulse); - } - -public: - std::list contact_list; -}; - -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT - -enum ColliderType -{ - eBulletTag, - eEnemyTag -}; - - -int TestColliderDetector::beginHit(cpArbiter *arb, cpSpace *space, void *unused) -{ - CP_ARBITER_GET_SHAPES(arb, a, b); - - CCBone *bone = (CCBone*)a->data; - bone->getArmature()->setVisible(false); - - return 0; -} - -void TestColliderDetector::endHit(cpArbiter *arb, cpSpace *space, void *unused) -{ - CP_ARBITER_GET_SHAPES(arb, a, b); - - CCBone *bone = (CCBone*)a->data; - bone->getArmature()->setVisible(true); -} - -void TestColliderDetector::destroyCPBody(cpBody *body) -{ - cpShape *shape = body->shapeList_private; - while(shape) - { - cpShape *temp = shape->next_private; - - cpSpaceRemoveShape(space, shape); - cpShapeFree(shape); - - shape = temp; - } - - cpSpaceRemoveBody(space, body); - cpBodyFree(body); -} -#endif - -TestColliderDetector::~TestColliderDetector() -{ -#if ENABLE_PHYSICS_BOX2D_DETECT - CC_SAFE_DELETE(world); - CC_SAFE_DELETE(listener); - CC_SAFE_DELETE(debugDraw); -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT - destroyCPBody(armature2->getCPBody()); - destroyCPBody(bullet->getCPBody()); - - cpSpaceFree(space); -#endif -} - -void TestColliderDetector::onEnter() -{ - ArmatureTestLayer::onEnter(); - - scheduleUpdate(); - - armature = cocos2d::extension::CCArmature::create("Cowboy"); - armature->getAnimation()->play("FireWithoutBullet"); - armature->getAnimation()->setAnimationScale(0.2f); - armature->setScaleX(-0.2f); - armature->setScaleY(0.2f); - armature->setPosition(ccp(VisibleRect::left().x + 70, VisibleRect::left().y)); - addChild(armature); - - armature2 = cocos2d::extension::CCArmature::create("Cowboy"); - armature2->getAnimation()->play("Walk"); - armature2->setScaleX(-0.2f); - armature2->setScaleY(0.2f); - armature2->setPosition(ccp(VisibleRect::right().x - 30, VisibleRect::left().y)); - addChild(armature2); - - bullet = CCPhysicsSprite::createWithSpriteFrameName("25.png"); - addChild(bullet); - - initWorld(); -} -std::string TestColliderDetector::title() -{ - return "Test Collider Detector"; -} -void TestColliderDetector::draw() -{ -#if ENABLE_PHYSICS_BOX2D_DETECT - ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position ); - kmGLPushMatrix(); - world->DrawDebugData(); - kmGLPopMatrix(); -#endif -} -void TestColliderDetector::update(float delta) -{ -#if ENABLE_PHYSICS_BOX2D_DETECT - armature2->setVisible(true); -#endif - - if (armature->getAnimation()->getCurrentFrameIndex() == 9) - { - CCPoint p = armature->getBone("Layer126")->getDisplayRenderNode()->convertToWorldSpaceAR(ccp(0, 0)); - bullet->setPosition(ccp(p.x + 60, p.y)); - - bullet->stopAllActions(); - bullet->runAction(CCMoveBy::create(1.5f, ccp(350, 0))); - } - -#if ENABLE_PHYSICS_BOX2D_DETECT - world->Step(delta, 0, 0); - - for (std::list::iterator it = listener->contact_list.begin(); it != listener->contact_list.end(); ++it) - { - Contact &contact = *it; - - b2Body *b2a = contact.fixtureA->GetBody(); - b2Body *b2b = contact.fixtureB->GetBody(); - - CCBone *ba = (CCBone *)b2a->GetUserData(); - CCBone *bb = (CCBone *)b2b->GetUserData(); - - bb->getArmature()->setVisible(false); - } -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT - cpSpaceStep(space, delta); -#endif -} -void TestColliderDetector::initWorld() -{ -#if ENABLE_PHYSICS_BOX2D_DETECT - b2Vec2 noGravity(0, 0); - - world = new b2World(noGravity); - world->SetAllowSleeping(true); - - listener = new ContactListener(); - world->SetContactListener(listener); - - debugDraw = new GLESDebugDraw( PT_RATIO ); - world->SetDebugDraw(debugDraw); - - uint32 flags = 0; - flags += b2Draw::e_shapeBit; - // flags += b2Draw::e_jointBit; - // flags += b2Draw::e_aabbBit; - // flags += b2Draw::e_pairBit; - // flags += b2Draw::e_centerOfMassBit; - debugDraw->SetFlags(flags); - - - // Define the dynamic body. - //Set up a 1m squared box in the physics world - b2BodyDef bodyDef; - bodyDef.type = b2_dynamicBody; - - b2Body *body = world->CreateBody(&bodyDef); - - // Define another box shape for our dynamic body. - b2PolygonShape dynamicBox; - dynamicBox.SetAsBox(.5f, .5f);//These are mid points for our 1m box - - // Define the dynamic body fixture. - b2FixtureDef fixtureDef; - fixtureDef.shape = &dynamicBox; - fixtureDef.isSensor = true; - body->CreateFixture(&fixtureDef); - - - bullet->setB2Body(body); - bullet->setPTMRatio(PT_RATIO); - bullet->setPosition( ccp( -100, -100) ); - - body = world->CreateBody(&bodyDef); - armature2->setB2Body(body); - -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT - space = cpSpaceNew(); - space->gravity = cpv(0, 0); - - // Physics debug layer - CCPhysicsDebugNode *debugLayer = CCPhysicsDebugNode::create(space); - this->addChild(debugLayer, INT_MAX); - - CCSize size = bullet->getContentSize(); - - int num = 4; - cpVect verts[] = { - cpv(-size.width/2,-size.height/2), - cpv(-size.width/2,size.height/2), - cpv(size.width/2,size.height/2), - cpv(size.width/2,-size.height/2), - }; - - cpBody *body = cpBodyNew(1.0f, cpMomentForPoly(1.0f, num, verts, cpvzero)); - cpSpaceAddBody(space, body); - - cpShape* shape = cpPolyShapeNew(body, num, verts, cpvzero); - shape->collision_type = eBulletTag; - cpSpaceAddShape(space, shape); - - bullet->setCPBody(body); - - body = cpBodyNew(INFINITY, INFINITY); - cpSpaceAddBody(space, body); - armature2->setCPBody(body); - - shape = body->shapeList_private; - while(shape){ - cpShape *next = shape->next_private; - shape->collision_type = eEnemyTag; - shape = next; - } - - cpSpaceAddCollisionHandler(space, eEnemyTag, eBulletTag, beginHit, NULL, NULL, endHit, NULL); -#endif -} - - - - - -void TestBoundingBox::onEnter() -{ - ArmatureTestLayer::onEnter(); - - armature = cocos2d::extension::CCArmature::create("Cowboy"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(VisibleRect::center()); - armature->setScale(0.2f); - addChild(armature); -} -std::string TestBoundingBox::title() -{ - return "Test BoundingBox"; -} -void TestBoundingBox::draw() -{ - CC_NODE_DRAW_SETUP(); - - rect = CCRectApplyAffineTransform(armature->boundingBox(), armature->nodeToParentTransform()); - - ccDrawColor4B(100, 100, 100, 255); - ccDrawRect(rect.origin, ccp(rect.getMaxX(), rect.getMaxY())); -} - - - -void TestAnchorPoint::onEnter() -{ - ArmatureTestLayer::onEnter(); - - for (int i = 0; i<5; i++) - { - cocos2d::extension::CCArmature *armature = cocos2d::extension::CCArmature::create("Cowboy"); - armature->getAnimation()->playByIndex(0); - armature->setPosition(VisibleRect::center()); - armature->setScale(0.2f); - addChild(armature, 0, i); - } - - getChildByTag(0)->setAnchorPoint(ccp(0,0)); - getChildByTag(1)->setAnchorPoint(ccp(0,1)); - getChildByTag(2)->setAnchorPoint(ccp(1,0)); - getChildByTag(3)->setAnchorPoint(ccp(1,1)); - getChildByTag(4)->setAnchorPoint(ccp(0.5,0.5)); - -} -std::string TestAnchorPoint::title() -{ - return "Test Set AnchorPoint"; -} - - -void TestArmatureNesting::onEnter() -{ - ArmatureTestLayer::onEnter(); - setTouchEnabled(true); - - armature = cocos2d::extension::CCArmature::create("cyborg"); - armature->getAnimation()->playByIndex(1); - armature->setPosition(VisibleRect::center()); - armature->setScale(1.2f); - armature->getAnimation()->setAnimationScale(0.4f); - addChild(armature); - - weaponIndex = 0; -} -std::string TestArmatureNesting::title() -{ - return "Test CCArmature Nesting"; -} -bool TestArmatureNesting::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) -{ - ++weaponIndex; - weaponIndex = weaponIndex % 4; - - armature->getBone("armInside")->getChildArmature()->getAnimation()->playByIndex(weaponIndex); - armature->getBone("armOutside")->getChildArmature()->getAnimation()->playByIndex(weaponIndex); - return false; -} -void TestArmatureNesting::registerWithTouchDispatcher() -{ - CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, INT_MIN+1, true); -} \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h deleted file mode 100644 index 67576a3746..0000000000 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ArmatureTest/ArmatureScene.h +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef __HELLOWORLD_SCENE_H__ -#define __HELLOWORLD_SCENE_H__ - -#include "cocos2d.h" -#include "cocos-ext.h" -#include "../../VisibleRect.h" -#include "../../testBasic.h" - -#if ENABLE_PHYSICS_BOX2D_DETECT -#include "../../Box2DTestBed/GLES-Render.h" -#include "Box2D/Box2D.h" -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT -#include "chipmunk.h" -#endif - -class ArmatureTestScene : public TestScene -{ -public: - ArmatureTestScene(bool bPortrait = false); - - virtual void runThisTest(); - - // The CallBack for back to the main menu scene - virtual void MainMenuCallback(CCObject* pSender); -}; - -enum { - TEST_COCOSTUDIO_WITH_SKELETON = 0, - TEST_COCOSTUDIO_WITHOUT_SKELETON, - TEST_DRAGON_BONES_2_0, - TEST_PERFORMANCE, - TEST_CHANGE_ZORDER, - TEST_ANIMATION_EVENT, - TEST_PARTICLE_DISPLAY, - TEST_USE_DIFFERENT_PICTURE, - TEST_BCOLLIDER_DETECTOR, - TEST_BOUDINGBOX, - TEST_ANCHORPOINT, - TEST_ARMATURE_NESTING, - - TEST_LAYER_COUNT -}; - -class ArmatureTestLayer : public CCLayer -{ -public: - virtual void onEnter(); - virtual void onExit(); - - virtual std::string title(); - virtual std::string subtitle(); - - void restartCallback(CCObject* pSender); - void nextCallback(CCObject* pSender); - void backCallback(CCObject* pSender); - - virtual void draw(); -}; - - - -class TestDragonBones20 : public ArmatureTestLayer -{ -public: - virtual void onEnter(); - virtual std::string title(); -}; - - - -class TestCSWithSkeleton : public ArmatureTestLayer -{ - virtual void onEnter(); - virtual std::string title(); -}; - -class TestCSWithoutSkeleton : public ArmatureTestLayer -{ - virtual void onEnter(); - virtual std::string title(); -}; - - -class TestPerformance : public ArmatureTestLayer -{ -public: - ~TestPerformance(); - - virtual void onEnter(); - virtual std::string title(); - virtual std::string subtitle(); - virtual void addArmature(cocos2d::extension::CCArmature *armature); - void update(float delta); - - int armatureCount; - - int frames; - float times; - float lastTimes; - bool generated; -}; - - -class TestChangeZorder : public ArmatureTestLayer -{ - virtual void onEnter(); - virtual std::string title(); - void changeZorder(float dt); - - int currentTag; -}; - - -class TestAnimationEvent : public ArmatureTestLayer, public sigslot::has_slots<> -{ -public: - - virtual void onEnter(); - virtual std::string title(); - void animationEvent(cocos2d::extension::CCArmature *armature, cocos2d::extension::MovementEventType movementType, const char *movementID); - void callback1(); - void callback2(); - - cocos2d::extension::CCArmature *armature; -}; - -class TestUseMutiplePicture : public ArmatureTestLayer -{ - virtual void onEnter(); - virtual std::string title(); - virtual std::string subtitle(); - virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); - virtual void registerWithTouchDispatcher(); - - int displayIndex; - cocos2d::extension::CCArmature *armature; -}; - -class TestParticleDisplay : public ArmatureTestLayer -{ - virtual void onEnter(); - virtual std::string title(); - virtual std::string subtitle(); - virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); - virtual void registerWithTouchDispatcher(); - - int animationID; - cocos2d::extension::CCArmature *armature; -}; - -#if ENABLE_PHYSICS_BOX2D_DETECT -class ContactListener; -#endif - -class TestColliderDetector : public ArmatureTestLayer, public sigslot::has_slots<> -{ -public: - ~TestColliderDetector(); - - virtual void onEnter(); - virtual std::string title(); - virtual void draw(); - virtual void update(float delta); - - void initWorld(); - - cocos2d::extension::CCArmature *armature; - cocos2d::extension::CCArmature *armature2; - - cocos2d::extension::CCPhysicsSprite *bullet; - -#if ENABLE_PHYSICS_BOX2D_DETECT - b2World *world; - ContactListener *listener; - GLESDebugDraw *debugDraw; -#elif ENABLE_PHYSICS_CHIPMUNK_DETECT - cpSpace *space; - - static int beginHit(cpArbiter *arb, cpSpace *space, void *unused); - static void endHit(cpArbiter *arb, cpSpace *space, void *unused); - - void destroyCPBody(cpBody *body); -#endif -}; - - - -class TestBoundingBox : public ArmatureTestLayer -{ -public: - virtual void onEnter(); - virtual std::string title(); - virtual void draw(); - - cocos2d::extension::CCArmature *armature; - CCRect rect; -}; - -class TestAnchorPoint : public ArmatureTestLayer -{ -public: - virtual void onEnter(); - virtual std::string title(); -}; - -class TestArmatureNesting : public ArmatureTestLayer -{ -public: - virtual void onEnter(); - virtual std::string title(); - virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); - virtual void registerWithTouchDispatcher(); - - cocos2d::extension::CCArmature *armature; - int weaponIndex; -}; -#endif // __HELLOWORLD_SCENE_H__ \ No newline at end of file From db169c6d91f1e18dbcd3da608f264db0bd78960e Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 17 Sep 2013 13:04:28 +0800 Subject: [PATCH 7/9] Add setTouchPriority empty implementation for CCLayer. --- .../javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index 9ac6e60f7a..f028b5a79f 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -60d103435762fea41e137a0d126bc9a94ec71dc3 \ No newline at end of file +cd24df86bd74572c1ef45ee4af05633066a9d966 \ No newline at end of file From a25c2cabf8b9b51c742b4109ab36173d72407237 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Tue, 17 Sep 2013 13:25:15 +0800 Subject: [PATCH 8/9] 1. Fixes failed to build windows. 2. Upload CocoGUI Resources. --- extensions/CocoStudio/GUI/Layouts/Layout.cpp | 4 +- .../cocosgui/Hello.png.REMOVED.git-id | 1 + .../UITest/background.png.REMOVED.git-id | 1 + .../Resources/cocosgui/b11.png.REMOVED.git-id | 1 + .../bitmapFontTest2.png.REMOVED.git-id | 1 + .../examples/examples.json.REMOVED.git-id | 1 + .../equip_1/equip_1.json.REMOVED.git-id | 1 + .../map_1/map_pve.png.REMOVED.git-id | 1 + .../page_1/background.png.REMOVED.git-id | 1 + .../hd/cocosgui/Hello.png.REMOVED.git-id | 1 + .../UITest/background.png.REMOVED.git-id | 1 + .../hd/cocosgui/b11.png.REMOVED.git-id | 1 + .../bitmapFontTest2.png.REMOVED.git-id | 1 + .../examples/examples.json.REMOVED.git-id | 1 + .../equip_1/equip_1.json.REMOVED.git-id | 1 + .../map_1/map_pve.png.REMOVED.git-id | 1 + .../page_1/background.png.REMOVED.git-id | 1 + .../Cpp/TestCpp/proj.win32/TestCpp.vcxproj | 40 ++++ .../proj.win32/TestCpp.vcxproj.filters | 174 ++++++++++++++++++ 19 files changed, 232 insertions(+), 2 deletions(-) create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id create mode 100644 samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id diff --git a/extensions/CocoStudio/GUI/Layouts/Layout.cpp b/extensions/CocoStudio/GUI/Layouts/Layout.cpp index 779ff73616..17e90a2108 100644 --- a/extensions/CocoStudio/GUI/Layouts/Layout.cpp +++ b/extensions/CocoStudio/GUI/Layouts/Layout.cpp @@ -462,7 +462,7 @@ bool RectClippingNode::init() rect[2] = Point(_clippingSize.width, _clippingSize.height); rect[3] = Point(0, _clippingSize.height); - Color4F green = {0, 1, 0, 1}; + Color4F green(0, 1, 0, 1); m_pInnerStencil->drawPolygon(rect, 4, green, 0, green); if (CCClippingNode::init(m_pInnerStencil)) { @@ -480,7 +480,7 @@ void RectClippingNode::setClippingSize(const Size &size) rect[1] = Point(_clippingSize.width, 0); rect[2] = Point(_clippingSize.width, _clippingSize.height); rect[3] = Point(0, _clippingSize.height); - Color4F green = {0, 1, 0, 1}; + Color4F green(0, 1, 0, 1); m_pInnerStencil->clear(); m_pInnerStencil->drawPolygon(rect, 4, green, 0, green); } diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id new file mode 100644 index 0000000000..f02d84fd8f --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/Hello.png.REMOVED.git-id @@ -0,0 +1 @@ +5fe89fb5bd58cedf13b0363f97b20e3ea7ff255d \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id new file mode 100644 index 0000000000..746e4e19e9 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/UITest/background.png.REMOVED.git-id @@ -0,0 +1 @@ +500d95937f3fd81659da66d2099b6c80d988a6b5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id new file mode 100644 index 0000000000..0b4502562c --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/b11.png.REMOVED.git-id @@ -0,0 +1 @@ +39179659c7b94b213b6ab7b24372c96378f61062 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id new file mode 100644 index 0000000000..d025022480 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/bitmapFontTest2.png.REMOVED.git-id @@ -0,0 +1 @@ +9975e4961272d5bda6d5f3bbd61ea0fc02222199 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id new file mode 100644 index 0000000000..f28818a9af --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/examples/examples.json.REMOVED.git-id @@ -0,0 +1 @@ +0a4ce85782909e964aa0e95e89bab8272d0c3d4e \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id new file mode 100644 index 0000000000..596d52b27c --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id @@ -0,0 +1 @@ +0a77108d377ceb5f084f1aab1877159df9499428 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id new file mode 100644 index 0000000000..6f99243a26 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id @@ -0,0 +1 @@ +39d29cbeb700598c3e4ad6d3ee0ac273a3385fcd \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id new file mode 100644 index 0000000000..746e4e19e9 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id @@ -0,0 +1 @@ +500d95937f3fd81659da66d2099b6c80d988a6b5 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id new file mode 100644 index 0000000000..bf03af4205 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/Hello.png.REMOVED.git-id @@ -0,0 +1 @@ +a6e5d948d0c85ecc42b7a2ebf5751e3990002bac \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id new file mode 100644 index 0000000000..1f73829609 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/UITest/background.png.REMOVED.git-id @@ -0,0 +1 @@ +eff519b0334eaeb486f302ec2581771950b7cca2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id new file mode 100644 index 0000000000..7ad21adacb --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/b11.png.REMOVED.git-id @@ -0,0 +1 @@ +021493cabd2489bf2c20c657e5523e24608df86c \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id new file mode 100644 index 0000000000..d025022480 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/bitmapFontTest2.png.REMOVED.git-id @@ -0,0 +1 @@ +9975e4961272d5bda6d5f3bbd61ea0fc02222199 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id new file mode 100644 index 0000000000..f28818a9af --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/examples/examples.json.REMOVED.git-id @@ -0,0 +1 @@ +0a4ce85782909e964aa0e95e89bab8272d0c3d4e \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id new file mode 100644 index 0000000000..596d52b27c --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/equip_1/equip_1.json.REMOVED.git-id @@ -0,0 +1 @@ +0a77108d377ceb5f084f1aab1877159df9499428 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id new file mode 100644 index 0000000000..7e87ef6cb4 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/map_1/map_pve.png.REMOVED.git-id @@ -0,0 +1 @@ +1a6a5a2f571c692a962e9159fca8ea5d6879a748 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id new file mode 100644 index 0000000000..1f73829609 --- /dev/null +++ b/samples/Cpp/TestCpp/Resources/hd/cocosgui/gui_examples/page_1/background.png.REMOVED.git-id @@ -0,0 +1 @@ +eff519b0334eaeb486f302ec2581771950b7cca2 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj index e38cc2fe68..d8c38569e3 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj @@ -146,6 +146,26 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O + + + + + + + + + + + + + + + + + + + + @@ -260,6 +280,26 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O + + + + + + + + + + + + + + + + + + + + diff --git a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters index f6dac52c63..cf47e0d936 100644 --- a/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters +++ b/samples/Cpp/TestCpp/proj.win32/TestCpp.vcxproj.filters @@ -241,6 +241,60 @@ {0b414789-7971-4a4c-86e3-40cc00936684} + + {9daecd38-37c6-4216-a999-86077af83beb} + + + {493fcd85-c749-482d-9404-905e99aa0103} + + + {5c1960de-24ba-4b72-be18-cc160dd2a50d} + + + {175b363b-a41a-4b1d-bde1-970e77e64cff} + + + {2e08949f-bf73-4fdc-85e8-34b8c69aa978} + + + {c57c0453-a096-44d7-830b-1cf24c712cfd} + + + {c4dbbfb3-0e91-492f-bbbf-f03fb26f3f54} + + + {01097388-e538-4081-8e16-d1ff3a86292a} + + + {160da6f0-a0f1-4a53-8e5e-cf0a63ee82a3} + + + {fadff96e-c19a-41f5-a755-547cf1f8a5fb} + + + {73c268e8-3872-49d6-9204-1e679ff72a42} + + + {6e7f1d2a-c8c1-4f48-826f-930bc8a0556e} + + + {305e1c54-9321-49f7-8672-46d1286dbe83} + + + {df6e9468-93f7-472d-be1d-d274d7de677e} + + + {dedcabba-959c-40e3-9959-7ccf4e31c792} + + + {cfc87c30-a7b4-4b6f-bc5d-da45360466b6} + + + {5caf2179-ae22-4040-8bac-17e9f22efbf7} + + + {24f044ee-09a6-406b-98d7-8d5d759e5bb1} + @@ -571,6 +625,66 @@ Classes\NewEventDispatcherTest + + Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest + + + Classes\ExtensionsTest\CocoStudioGUITest + + + Classes\ExtensionsTest\CocoStudioGUITest + + + Classes\ExtensionsTest\CocoStudioGUITest + @@ -1078,5 +1192,65 @@ Classes\NewEventDispatcherTest + + Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest + + + Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest + + + Classes\ExtensionsTest\CocoStudioGUITest + + + Classes\ExtensionsTest\CocoStudioGUITest + + + Classes\ExtensionsTest\CocoStudioGUITest + \ No newline at end of file From b42c2fc487052e78f47226442571b6ba48f9c9c3 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 17 Sep 2013 13:39:16 +0800 Subject: [PATCH 9/9] remove dependence of sdl --- cocos2dx/platform/linux/CCEGLView.h | 3 +-- cocos2dx/proj.linux/cocos2dx.mk | 2 +- install-deps-linux.sh | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cocos2dx/platform/linux/CCEGLView.h b/cocos2dx/platform/linux/CCEGLView.h index 1e8c8e9c6c..5dae9ec609 100644 --- a/cocos2dx/platform/linux/CCEGLView.h +++ b/cocos2dx/platform/linux/CCEGLView.h @@ -11,8 +11,7 @@ #include "platform/CCCommon.h" #include "cocoa/CCGeometry.h" #include "platform/CCEGLViewProtocol.h" - #include "platform/third_party/linux/glfw/glfw3.h" -#include +#include "platform/third_party/linux/glfw/glfw3.h" #include bool initExtensions(); diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos2dx/proj.linux/cocos2dx.mk index 3269129024..29c1f8f3fd 100644 --- a/cocos2dx/proj.linux/cocos2dx.mk +++ b/cocos2dx/proj.linux/cocos2dx.mk @@ -120,7 +120,7 @@ SHAREDLIBS += -lfmodex endif endif -SHAREDLIBS += -lSDL2 -lGLEW -lfontconfig -lpthread -lGL -lpng `pkg-config --libs glfw3` +SHAREDLIBS += -lGLEW -lfontconfig -lpthread -lGL -lpng `pkg-config --libs glfw3` SHAREDLIBS += -L$(FMOD_LIBDIR) -Wl,-rpath,$(abspath $(FMOD_LIBDIR)) SHAREDLIBS += -L$(LIB_DIR) -Wl,-rpath,$(abspath $(LIB_DIR)) diff --git a/install-deps-linux.sh b/install-deps-linux.sh index 705c4b659d..d122e6a451 100755 --- a/install-deps-linux.sh +++ b/install-deps-linux.sh @@ -5,7 +5,6 @@ DEPENDS+=' libxmu-dev' DEPENDS+=' libglu1-mesa-dev' DEPENDS+=' libgl2ps-dev' DEPENDS+=' libxi-dev' -DEPENDS+=' libsdl2-dev' DEPENDS+=' g++' DEPENDS+=' libzip-dev' DEPENDS+=' libpng12-dev'