tests compiles on xcode 6.3

no more USING_NS in the header files.
it creates conflict with xcode 6.3
This commit is contained in:
Ricardo Quesada 2015-04-08 17:37:30 -07:00
parent 64c45fa3ca
commit 51374eb822
193 changed files with 1151 additions and 1037 deletions

View File

@ -9,7 +9,7 @@ DEFINE_TEST_SUITE(ActionManagerTests);
class ActionManagerTest : public TestCase class ActionManagerTest : public TestCase
{ {
protected: protected:
TextureAtlas* _atlas; cocos2d::TextureAtlas* _atlas;
std::string _title; std::string _title;

View File

@ -30,16 +30,14 @@
#include "../testBasic.h" #include "../testBasic.h"
#include "../BaseTest.h" #include "../BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(ActionsEaseTests); DEFINE_TEST_SUITE(ActionsEaseTests);
class EaseSpriteDemo : public TestCase class EaseSpriteDemo : public TestCase
{ {
protected: protected:
Sprite* _grossini; cocos2d::Sprite* _grossini;
Sprite* _tamara; cocos2d::Sprite* _tamara;
Sprite* _kathia; cocos2d::Sprite* _kathia;
std::string _title; std::string _title;

View File

@ -26,6 +26,8 @@
#include "ActionsProgressTest.h" #include "ActionsProgressTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
ActionsProgressTests::ActionsProgressTests() ActionsProgressTests::ActionsProgressTests()
{ {
ADD_TEST_CASE(SpriteProgressToRadial); ADD_TEST_CASE(SpriteProgressToRadial);

View File

@ -29,16 +29,14 @@
#include "../testBasic.h" #include "../testBasic.h"
#include "../BaseTest.h" #include "../BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(ActionsTests); DEFINE_TEST_SUITE(ActionsTests);
class ActionsDemo : public TestCase class ActionsDemo : public TestCase
{ {
protected: protected:
Sprite* _grossini; cocos2d::Sprite* _grossini;
Sprite* _tamara; cocos2d::Sprite* _tamara;
Sprite* _kathia; cocos2d::Sprite* _kathia;
public: public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
@ -194,7 +192,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
EventListenerCustom* _frameDisplayedListener; cocos2d::EventListenerCustom* _frameDisplayedListener;
}; };
class ActionSequence : public ActionsDemo class ActionSequence : public ActionsDemo
@ -405,9 +403,9 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void addNewSpriteWithCoords(Vec2 p); virtual void addNewSpriteWithCoords(cocos2d::Vec2 p);
virtual void runActionsInSprite(Sprite* sprite); virtual void runActionsInSprite(cocos2d::Sprite* sprite);
//void onTouchesEnded(const std::vector<Touch*>& touches, Event* event) override; //void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event) override;
}; };
class ActionMoveStacked : public ActionStacked class ActionMoveStacked : public ActionStacked
@ -416,7 +414,7 @@ public:
CREATE_FUNC(ActionMoveStacked); CREATE_FUNC(ActionMoveStacked);
virtual std::string title() const override; virtual std::string title() const override;
virtual void runActionsInSprite(Sprite* sprite) override; virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
}; };
class ActionMoveJumpStacked : public ActionStacked class ActionMoveJumpStacked : public ActionStacked
@ -425,7 +423,7 @@ public:
CREATE_FUNC(ActionMoveJumpStacked); CREATE_FUNC(ActionMoveJumpStacked);
virtual std::string title() const override; virtual std::string title() const override;
virtual void runActionsInSprite(Sprite* sprite) override; virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
}; };
class ActionMoveBezierStacked : public ActionStacked class ActionMoveBezierStacked : public ActionStacked
@ -434,7 +432,7 @@ public:
CREATE_FUNC(ActionMoveBezierStacked); CREATE_FUNC(ActionMoveBezierStacked);
virtual std::string title() const override; virtual std::string title() const override;
virtual void runActionsInSprite(Sprite* sprite) override; virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
}; };
class ActionCatmullRomStacked : public ActionsDemo class ActionCatmullRomStacked : public ActionsDemo
@ -470,7 +468,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
Sprite* _spriteTmp; cocos2d::Sprite* _spriteTmp;
}; };
class Issue1305_2 : public ActionsDemo class Issue1305_2 : public ActionsDemo
@ -515,7 +513,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual std::string title() const override; virtual std::string title() const override;
void logSprRotation(Sprite* sender); void logSprRotation(cocos2d::Sprite* sender);
}; };
class Issue1398 : public ActionsDemo class Issue1398 : public ActionsDemo
@ -579,7 +577,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual std::string title() const override; virtual std::string title() const override;
private: private:
Vector<Node*> _pausedTargets; cocos2d::Vector<Node*> _pausedTargets;
}; };
#endif #endif

View File

@ -27,6 +27,10 @@
#include "cocos2d.h" #include "cocos2d.h"
#include <chrono> #include <chrono>
USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::ui;
AllocatorTests::AllocatorTests() AllocatorTests::AllocatorTests()
{ {
ADD_TEST_CASE(AllocatorTest); ADD_TEST_CASE(AllocatorTest);

View File

@ -43,7 +43,7 @@ public:
virtual void initGLContextAttrs(); virtual void initGLContextAttrs();
/** /**
@brief Implement Director and Scene init code here. @brief Implement Director and cocos2d::Scene* init code here.
@return true Initialize success, app continue. @return true Initialize success, app continue.
@return false Initialize failed, app terminate. @return false Initialize failed, app terminate.
*/ */

View File

@ -27,6 +27,7 @@
#include "controller.h" #include "controller.h"
USING_NS_CC; USING_NS_CC;
USING_NS_CC_EXT;
TestBase::TestBase() TestBase::TestBase()
: _parentTest(nullptr) : _parentTest(nullptr)

View File

@ -29,15 +29,12 @@
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
#include "VisibleRect.h" #include "VisibleRect.h"
USING_NS_CC;
USING_NS_CC_EXT;
class TestSuite; class TestSuite;
/** /**
* Each test case should inherit from TestCase, and add to a TestSuite object. * Each test case should inherit from TestCase, and add to a TestSuite object.
*/ */
class TestCase : public Scene class TestCase : public cocos2d::Scene
{ {
public: public:
/** TestCase test type.*/ /** TestCase test type.*/
@ -73,10 +70,10 @@ public:
virtual std::string getActualOutput() const { return ""; } virtual std::string getActualOutput() const { return ""; }
/** Callback functions.*/ /** Callback functions.*/
virtual void restartTestCallback(Ref* sender); virtual void restartTestCallback(cocos2d::Ref* sender);
virtual void nextTestCallback(Ref* sender); virtual void nextTestCallback(cocos2d::Ref* sender);
virtual void priorTestCallback(Ref* sender); virtual void priorTestCallback(cocos2d::Ref* sender);
virtual void onBackCallback(Ref* sender); virtual void onBackCallback(cocos2d::Ref* sender);
/** /**
* You should NEVER call this method, unless you know what you are doing. * You should NEVER call this method, unless you know what you are doing.
@ -98,12 +95,12 @@ CC_CONSTRUCTOR_ACCESS:
virtual bool init() override; virtual bool init() override;
protected: protected:
MenuItemImage* _priorTestItem; cocos2d::MenuItemImage* _priorTestItem;
MenuItemImage* _restartTestItem; cocos2d::MenuItemImage* _restartTestItem;
MenuItemImage* _nextTestItem; cocos2d::MenuItemImage* _nextTestItem;
Label* _titleLabel; cocos2d::Label* _titleLabel;
Label* _subtitleLabel; cocos2d::Label* _subtitleLabel;
private: private:
TestSuite* _testSuite; TestSuite* _testSuite;
@ -119,7 +116,7 @@ private:
* *
* @note You should not inherit from TestBase directly. * @note You should not inherit from TestBase directly.
*/ */
class TestBase : public Ref class TestBase : public cocos2d::Ref
{ {
public: public:
virtual ~TestBase(); virtual ~TestBase();
@ -159,7 +156,7 @@ class TestController;
class TestSuite : public TestBase class TestSuite : public TestBase
{ {
public: public:
void addTestCase(const std::string& testName, std::function<Scene*()> callback); void addTestCase(const std::string& testName, std::function<cocos2d::Scene*()> callback);
virtual void restartCurrTest(); virtual void restartCurrTest();
virtual void enterNextTest(); virtual void enterNextTest();
@ -168,7 +165,7 @@ public:
virtual void runThisTest() override; virtual void runThisTest() override;
private: private:
std::vector<std::function<Scene*()>> _testCallbacks; std::vector<std::function<cocos2d::Scene*()>> _testCallbacks;
int _currTestIndex; int _currTestIndex;
friend class TestController; friend class TestController;
@ -177,7 +174,7 @@ private:
/** /**
* An instance of TestList is a means for displaying hierarchical lists of TestSuite. * An instance of TestList is a means for displaying hierarchical lists of TestSuite.
*/ */
class TestList : public TestBase, public TableViewDataSource, public TableViewDelegate class TestList : public TestBase, public cocos2d::extension::TableViewDataSource, public cocos2d::extension::TableViewDelegate
{ {
public: public:
TestList(); TestList();
@ -187,10 +184,10 @@ public:
virtual void runThisTest() override; virtual void runThisTest() override;
virtual void tableCellTouched(TableView* table, TableViewCell* cell) override; virtual void tableCellTouched(cocos2d::extension::TableView* table, cocos2d::extension::TableViewCell* cell) override;
virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override; virtual cocos2d::extension::TableViewCell* tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx) override;
virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) override; virtual cocos2d::Size tableCellSizeForIndex(cocos2d::extension::TableView *table, ssize_t idx) override;
virtual ssize_t numberOfCellsInTableView(TableView *table) override; virtual ssize_t numberOfCellsInTableView(cocos2d::extension::TableView *table) override;
virtual void scrollViewDidScroll(cocos2d::extension::ScrollView* view) override{} virtual void scrollViewDidScroll(cocos2d::extension::ScrollView* view) override{}
virtual void scrollViewDidZoom(cocos2d::extension::ScrollView* view) override{} virtual void scrollViewDidZoom(cocos2d::extension::ScrollView* view) override{}
@ -198,7 +195,7 @@ public:
private: private:
std::vector<std::function<TestBase*()>> _testCallbacks; std::vector<std::function<TestBase*()>> _testCallbacks;
bool _cellTouchEnabled; bool _cellTouchEnabled;
Vec2 _tableOffset; cocos2d::Vec2 _tableOffset;
friend class TestController; friend class TestController;
}; };
@ -222,9 +219,9 @@ public:
virtual std::string title() const { return ""; } virtual std::string title() const { return ""; }
virtual std::string subtitle() const{ return ""; } virtual std::string subtitle() const{ return ""; }
virtual void restartCallback(Ref* sender) {} virtual void restartCallback(cocos2d::Ref* sender) {}
virtual void nextCallback(Ref* sender){} virtual void nextCallback(cocos2d::Ref* sender){}
virtual void backCallback(Ref* sender){} virtual void backCallback(cocos2d::Ref* sender){}
virtual void onEnter() override{} virtual void onEnter() override{}
virtual void onExit() override{} virtual void onExit() override{}

View File

@ -29,6 +29,11 @@
#include <algorithm> #include <algorithm>
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::ui;
BillBoardTests::BillBoardTests() BillBoardTests::BillBoardTests()
{ {
ADD_TEST_CASE(BillBoardRotationTest); ADD_TEST_CASE(BillBoardRotationTest);

View File

@ -55,19 +55,19 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void update(float dt) override; virtual void update(float dt) override;
void addNewBillBoradWithCoords(Vec3 p); void addNewBillBoradWithCoords(cocos2d::Vec3 p);
void addNewAniBillBoradWithCoords(Vec3 p); void addNewAniBillBoradWithCoords(cocos2d::Vec3 p);
void rotateCameraCallback(Ref* sender,float value); void rotateCameraCallback(cocos2d::Ref* sender,float value);
//void onTouchesMoved(const std::vector<Touch*>& touches, Event* event) override; //void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event) override;
void menuCallback_orientedPoint(Ref* sender); void menuCallback_orientedPoint(cocos2d::Ref* sender);
void menuCallback_orientedPlane(Ref* sender); void menuCallback_orientedPlane(cocos2d::Ref* sender);
protected: protected:
Camera* _camera; cocos2d::Camera* _camera;
Layer* _layerBillBorad; cocos2d::Layer* _layerBillBorad;
std::vector<BillBoard*> _billboards; std::vector<cocos2d::BillBoard*> _billboards;
}; };
DEFINE_TEST_SUITE(BillBoardTests); DEFINE_TEST_SUITE(BillBoardTests);

View File

@ -4,6 +4,7 @@
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
#include "renderer/CCCustomCommand.h" #include "renderer/CCCustomCommand.h"
USING_NS_CC;
USING_NS_CC_EXT; USING_NS_CC_EXT;
#define PTM_RATIO 32 #define PTM_RATIO 32

View File

@ -9,7 +9,7 @@ DEFINE_TEST_SUITE(Box2DTests);
class Box2DTest : public TestCase class Box2DTest : public TestCase
{ {
Texture2D* _spriteTexture; // weak ref cocos2d::Texture2D* _spriteTexture; // weak ref
b2World* world; b2World* world;
// GLESDebugDraw* _debugDraw; // GLESDebugDraw* _debugDraw;
@ -19,17 +19,17 @@ public:
void initPhysics(); void initPhysics();
void createResetButton(); void createResetButton();
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
void addNewSpriteAtPosition(Vec2 p); void addNewSpriteAtPosition(cocos2d::Vec2 p);
void update(float dt) override; void update(float dt) override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
#if CC_ENABLE_BOX2D_INTEGRATION #if CC_ENABLE_BOX2D_INTEGRATION
protected: protected:
Mat4 _modelViewMV; Mat4 _modelViewMV;
void onDraw(); void onDraw();
CustomCommand _customCommand; cocos2d::CustomCommand _customCommand;
#endif #endif
} ; } ;

View File

@ -3,6 +3,8 @@
#include "Test.h" #include "Test.h"
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
USING_NS_CC;
#define kAccelerometerFrequency 30 #define kAccelerometerFrequency 30
#define FRAMES_BETWEEN_PRESSES_FOR_DOUBLE_CLICK 10 #define FRAMES_BETWEEN_PRESSES_FOR_DOUBLE_CLICK 10

View File

@ -9,7 +9,7 @@ DEFINE_TEST_SUITE(Box2dTestBedSuite);
class Box2dTestBed : public TestCase class Box2dTestBed : public TestCase
{ {
int m_entryID; int m_entryID;
EventListenerTouchOneByOne* _touchListener; cocos2d::EventListenerTouchOneByOne* _touchListener;
public: public:
static Box2dTestBed* createWithEntryID(int entryId); static Box2dTestBed* createWithEntryID(int entryId);
@ -18,16 +18,16 @@ public:
bool initWithEntryID(int entryId); bool initWithEntryID(int entryId);
bool onTouchBegan(Touch* touch, Event* event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchMoved(Touch* touch, Event* event); void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
}; };
struct TestEntry; struct TestEntry;
class Test; class Test;
class Box2DView : public Layer class Box2DView : public cocos2d::Layer
{ {
EventListenerTouchOneByOne* _touchListener; cocos2d::EventListenerTouchOneByOne* _touchListener;
EventListenerKeyboard* _keyboardListener; cocos2d::EventListenerKeyboard* _keyboardListener;
TestEntry* m_entry; TestEntry* m_entry;
Test* m_test; Test* m_test;
int m_entryID; int m_entryID;
@ -37,22 +37,22 @@ public:
bool initWithEntryID(int entryId); bool initWithEntryID(int entryId);
std::string title() const; std::string title() const;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
// virtual void registerWithTouchDispatcher(); // virtual void registerWithTouchDispatcher();
bool onTouchBegan(Touch* touch, Event* event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchMoved(Touch* touch, Event* event); void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchEnded(Touch* touch, Event* event); void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
void onKeyPressed(EventKeyboard::KeyCode code, Event* event); void onKeyPressed(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event);
void onKeyReleased(EventKeyboard::KeyCode code, Event* event); void onKeyReleased(cocos2d::EventKeyboard::KeyCode code, cocos2d::Event* event);
//virtual void accelerometer(UIAccelerometer* accelerometer, Acceleration* acceleration); //virtual void accelerometer(UIAccelerometer* accelerometer, cocos2d::Acceleration* acceleration);
static Box2DView* viewWithEntryID(int entryId); static Box2DView* viewWithEntryID(int entryId);
protected: protected:
void onDraw(const Mat4 &transform, uint32_t flags); void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
CustomCommand _customCmd; cocos2d::CustomCommand _customCmd;
}; };
#endif #endif

View File

@ -9,6 +9,8 @@
#include "Bug-1159.h" #include "Bug-1159.h"
USING_NS_CC;
Scene* Bug1159Layer::scene() Scene* Bug1159Layer::scene()
{ {
auto scene = Scene::create(); auto scene = Scene::create();

View File

@ -8,8 +8,8 @@ class Bug1159Layer : public BugsTestBase
public: public:
virtual bool init() override; virtual bool init() override;
virtual void onExit() override; virtual void onExit() override;
static Scene* scene(); static cocos2d::Scene* scene();
void callBack(Ref* sender); void callBack(cocos2d::Ref* sender);
CREATE_FUNC(Bug1159Layer); CREATE_FUNC(Bug1159Layer);
}; };

View File

@ -5,6 +5,8 @@
#include "Bug-1174.h" #include "Bug-1174.h"
USING_NS_CC;
int check_for_error( Vec2 p1, Vec2 p2, Vec2 p3, Vec2 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( Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t ) int check_for_error( Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t )

View File

@ -5,6 +5,8 @@
#include "Bug-350.h" #include "Bug-350.h"
USING_NS_CC;
bool Bug350Layer::init() bool Bug350Layer::init()
{ {
if (BugsTestBase::init()) if (BugsTestBase::init())

View File

@ -5,6 +5,8 @@
#include "Bug-422.h" #include "Bug-422.h"
USING_NS_CC;
bool Bug422Layer::init() bool Bug422Layer::init()
{ {
if (BugsTestBase::init()) if (BugsTestBase::init())

View File

@ -12,7 +12,7 @@ public:
void reset(); void reset();
void check(Node* target); void check(Node* target);
void menuCallback(Ref* sender); void menuCallback(cocos2d::Ref* sender);
}; };
#endif // __BUG_422_H__ #endif // __BUG_422_H__

View File

@ -6,6 +6,8 @@
#include "Bug-458.h" #include "Bug-458.h"
#include "QuestionContainerSprite.h" #include "QuestionContainerSprite.h"
USING_NS_CC;
bool Bug458Layer::init() bool Bug458Layer::init()
{ {
if(BugsTestBase::init()) if(BugsTestBase::init())

View File

@ -9,7 +9,7 @@ public:
CREATE_FUNC(Bug458Layer); CREATE_FUNC(Bug458Layer);
virtual bool init() override; virtual bool init() override;
void selectAnswer(Ref* sender); void selectAnswer(cocos2d::Ref* sender);
}; };
#endif // __BUG_458_H__ #endif // __BUG_458_H__

View File

@ -5,6 +5,8 @@
#include "Bug-624.h" #include "Bug-624.h"
USING_NS_CC;
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// //
// Bug624Layer // Bug624Layer

View File

@ -9,7 +9,7 @@ public:
virtual ~Bug624Layer(); virtual ~Bug624Layer();
virtual bool init() override; virtual bool init() override;
void switchLayer(float dt); void switchLayer(float dt);
virtual void onAcceleration(Acceleration* acc, Event* event); virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event);
CREATE_FUNC(Bug624Layer); CREATE_FUNC(Bug624Layer);
}; };
@ -20,7 +20,7 @@ public:
virtual ~Bug624Layer2(); virtual ~Bug624Layer2();
virtual bool init() override; virtual bool init() override;
void switchLayer(float dt); void switchLayer(float dt);
virtual void onAcceleration(Acceleration* acc, Event* event); virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event);
CREATE_FUNC(Bug624Layer2); CREATE_FUNC(Bug624Layer2);
}; };

View File

@ -5,6 +5,8 @@
#include "Bug-886.h" #include "Bug-886.h"
USING_NS_CC;
bool Bug886Layer::init() bool Bug886Layer::init()
{ {
if(BugsTestBase::init()) if(BugsTestBase::init())

View File

@ -7,6 +7,8 @@
#include "Bug-899.h" #include "Bug-899.h"
USING_NS_CC;
bool Bug899Layer::init() bool Bug899Layer::init()
{ {
// Director::getInstance()->enableRetinaDisplay(true); // Director::getInstance()->enableRetinaDisplay(true);

View File

@ -9,6 +9,8 @@
// Import the interfaces // Import the interfaces
#include"Bug-914.h" #include"Bug-914.h"
USING_NS_CC;
Scene* Bug914Layer::scene() Scene* Bug914Layer::scene()
{ {
// 'scene' is an autorelease object. // 'scene' is an autorelease object.

View File

@ -6,12 +6,12 @@
class Bug914Layer : public BugsTestBase class Bug914Layer : public BugsTestBase
{ {
public: public:
static Scene* scene(); static cocos2d::Scene* scene();
virtual bool init() override; virtual bool init() override;
void onTouchesMoved(const std::vector<Touch*>& touches, Event * event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesBegan(const std::vector<Touch*>& touches, Event * event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void restart(Ref* sender); void restart(cocos2d::Ref* sender);
CREATE_FUNC(Bug914Layer); CREATE_FUNC(Bug914Layer);
}; };

View File

@ -8,6 +8,8 @@
#include "Bug-Child.h" #include "Bug-Child.h"
USING_NS_CC;
bool BugChild::init() bool BugChild::init()
{ {
if (BugsTestBase::init()) if (BugsTestBase::init())

View File

@ -18,16 +18,16 @@ public:
virtual bool init() override; virtual bool init() override;
void switchChild(Ref* sender); void switchChild(cocos2d::Ref* sender);
protected: protected:
Sprite* parent1; cocos2d::Sprite* parent1;
Sprite* parent2; cocos2d::Sprite* parent2;
Sprite* child; cocos2d::Sprite* child;
Menu* menu; cocos2d::Menu* menu;
}; };
#endif /* defined(__Bug_Child__) */ #endif /* defined(__Bug_Child__) */

View File

@ -25,6 +25,8 @@ THE SOFTWARE.
#include "Camera3DTest.h" #include "Camera3DTest.h"
USING_NS_CC;
enum enum
{ {
IDC_NEXT = 100, IDC_NEXT = 100,

View File

@ -65,10 +65,10 @@ class CameraBaseTest : public TestCase
public: public:
protected: protected:
BillBoard* bill1; cocos2d::BillBoard* bill1;
BillBoard* bill2; cocos2d::BillBoard* bill2;
Label* l1; cocos2d::Label* l1;
Label* l2; cocos2d::Label* l2;
}; };
class CameraRotationTest : public CameraBaseTest { class CameraRotationTest : public CameraBaseTest {
@ -89,9 +89,9 @@ public:
protected: protected:
Node* _camControlNode; cocos2d::Node* _camControlNode;
Node* _camNode; cocos2d::Node* _camNode;
EventListenerTouchOneByOne* _lis; cocos2d::EventListenerTouchOneByOne* _lis;
}; };
class Camera3DTestDemo : public CameraBaseTest class Camera3DTestDemo : public CameraBaseTest
@ -105,50 +105,50 @@ public:
virtual void onExit() override; virtual void onExit() override;
// overrides // overrides
virtual std::string title() const override; virtual std::string title() const override;
void addNewSpriteWithCoords(Vec3 p,std::string fileName,bool playAnimation=false,float scale=1.0f,bool bindCamera=false); void addNewSpriteWithCoords(cocos2d::Vec3 p,std::string fileName,bool playAnimation=false,float scale=1.0f,bool bindCamera=false);
void onTouchesBegan(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesMoved(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void scaleCameraCallback(Ref* sender,float value); void scaleCameraCallback(cocos2d::Ref* sender,float value);
void rotateCameraCallback(Ref* sender,float value); void rotateCameraCallback(cocos2d::Ref* sender,float value);
void SwitchViewCallback(Ref* sender,CameraType cameraType); void SwitchViewCallback(cocos2d::Ref* sender,CameraType cameraType);
void updateCamera(float fDelta); void updateCamera(float fDelta);
void move3D(float elapsedTime); void move3D(float elapsedTime);
void updateState(float elapsedTime); void updateState(float elapsedTime);
bool isState(unsigned int state,unsigned int bit) const; bool isState(unsigned int state,unsigned int bit) const;
void reachEndCallBack(); void reachEndCallBack();
bool onTouchesCommon(Touch* touch, Event* event, bool* touchProperty); bool onTouchesCommon(cocos2d::Touch* touch, cocos2d::Event* event, bool* touchProperty);
bool onTouchesZoomOut(Touch* touch, Event* event); bool onTouchesZoomOut(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesZoomOutEnd(Touch* touch, Event* event); void onTouchesZoomOutEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesZoomIn(Touch* touch, Event* event); bool onTouchesZoomIn(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesZoomInEnd(Touch* touch, Event* event); void onTouchesZoomInEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesRotateLeft(Touch* touch, Event* event); bool onTouchesRotateLeft(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesRotateLeftEnd(Touch* touch, Event* event); void onTouchesRotateLeftEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesRotateRight(Touch* touch, Event* event); bool onTouchesRotateRight(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesRotateRightEnd(Touch* touch, Event* event); void onTouchesRotateRightEnd(cocos2d::Touch* touch, cocos2d::Event* event);
protected: protected:
std::string _title; std::string _title;
Layer* _layer3D; cocos2d::Layer* _layer3D;
Sprite3D* _sprite3D; cocos2d::Sprite3D* _sprite3D;
Vec3 _targetPos; cocos2d::Vec3 _targetPos;
CameraType _cameraType; CameraType _cameraType;
MenuItem* _incRot; cocos2d::MenuItem* _incRot;
MenuItem* _decRot; cocos2d::MenuItem* _decRot;
unsigned int _curState; unsigned int _curState;
Camera* _camera; cocos2d::Camera* _camera;
MoveTo* _moveAction; cocos2d::MoveTo* _moveAction;
bool _bZoomOut; bool _bZoomOut;
bool _bZoomIn; bool _bZoomIn;
bool _bRotateLeft; bool _bRotateLeft;
bool _bRotateRight; bool _bRotateRight;
Label* _RotateRightlabel; cocos2d::Label* _RotateRightlabel;
Label* _RotateLeftlabel; cocos2d::Label* _RotateLeftlabel;
Label* _ZoomInlabel; cocos2d::Label* _ZoomInlabel;
Label* _ZoomOutlabel; cocos2d::Label* _ZoomOutlabel;
}; };
class CameraCullingDemo : public CameraBaseTest class CameraCullingDemo : public CameraBaseTest
@ -166,22 +166,22 @@ public:
// overrides // overrides
virtual std::string title() const override; virtual std::string title() const override;
void reachEndCallBack(); void reachEndCallBack();
void switchViewCallback(Ref* sender); void switchViewCallback(cocos2d::Ref* sender);
void addSpriteCallback(Ref* sender); void addSpriteCallback(cocos2d::Ref* sender);
void delSpriteCallback(Ref* sender); void delSpriteCallback(cocos2d::Ref* sender);
void drawCameraFrustum(); void drawCameraFrustum();
protected: protected:
Label* _labelSprite3DCount; cocos2d::Label* _labelSprite3DCount;
Layer* _layer3D; cocos2d::Layer* _layer3D;
std::vector<Sprite3D*> _objects; std::vector<cocos2d::Sprite3D*> _objects;
CameraType _cameraType; CameraType _cameraType;
Camera* _cameraFirst; cocos2d::Camera* _cameraFirst;
Camera* _cameraThird; cocos2d::Camera* _cameraThird;
MoveBy* _moveAction; cocos2d::MoveBy* _moveAction;
DrawNode3D* _drawAABB; cocos2d::DrawNode3D* _drawAABB;
DrawNode3D* _drawFrustum; cocos2d::DrawNode3D* _drawFrustum;
int _row; int _row;
}; };
@ -200,26 +200,26 @@ public:
// overrides // overrides
virtual std::string title() const override; virtual std::string title() const override;
void switchOperateCallback(Ref* sender); void switchOperateCallback(cocos2d::Ref* sender);
void switchTargetCallback(Ref* sender); void switchTargetCallback(cocos2d::Ref* sender);
void onTouchsMoved(const std::vector<cocos2d::Touch*> &touchs, cocos2d::Event *event); void onTouchsMoved(const std::vector<cocos2d::Touch*> &touchs, cocos2d::Event *event);
void updateCameraTransform(); void updateCameraTransform();
void calculateArcBall( cocos2d::Vec3 & axis, float & angle, float p1x, float p1y, float p2x, float p2y );//calculate rotation quaternion parameters void calculateArcBall( cocos2d::Vec3 & axis, float & angle, float p1x, float p1y, float p2x, float p2y );//calculate rotation quaternion parameters
float projectToSphere( float r, float x, float y );//points on the screen project to arc ball float projectToSphere( float r, float x, float y );//points on the screen project to arc ball
protected: protected:
Layer* _layer3D; cocos2d::Layer* _layer3D;
CameraType _cameraType; CameraType _cameraType;
Camera* _camera; cocos2d::Camera* _camera;
DrawNode3D* _drawGrid; cocos2d::DrawNode3D* _drawGrid;
Quaternion _rotationQuat; //rotation Quaternion cocos2d::Quaternion _rotationQuat; //rotation Quaternion
float _radius; //arc ball radius float _radius; //arc ball radius
float _distanceZ; float _distanceZ;
OperateCamType _operate; //switch rotate or zoom OperateCamType _operate; //switch rotate or zoom
Vec3 _center; //camera look target cocos2d::Vec3 _center; //camera look target
int _target; //switch camera look target int _target; //switch camera look target
Sprite3D* _sprite3D1; cocos2d::Sprite3D* _sprite3D1;
Sprite3D* _sprite3D2; cocos2d::Sprite3D* _sprite3D2;
}; };
class FogTestDemo : public CameraBaseTest class FogTestDemo : public CameraBaseTest
@ -237,21 +237,21 @@ public:
// overrides // overrides
virtual std::string title() const override; virtual std::string title() const override;
void onTouchesMoved(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void switchTypeCallback(Ref* sender,int type); void switchTypeCallback(cocos2d::Ref* sender,int type);
protected: protected:
Layer* _layer3D; cocos2d::Layer* _layer3D;
CameraType _cameraType; CameraType _cameraType;
Camera* _camera; cocos2d::Camera* _camera;
Sprite3D* _sprite3D1; cocos2d::Sprite3D* _sprite3D1;
Sprite3D* _sprite3D2; cocos2d::Sprite3D* _sprite3D2;
GLProgram* _shader; cocos2d::GLProgram* _shader;
GLProgramState* _state; cocos2d::GLProgramState* _state;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
EventListenerCustom* _backToForegroundListener; cocos2d::EventListenerCustom* _backToForegroundListener;
#endif #endif
}; };

View File

@ -8,6 +8,8 @@
#include "ChipmunkTest.h" #include "ChipmunkTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
enum { enum {
kTagParentNode = 1, kTagParentNode = 1,

View File

@ -9,8 +9,6 @@
#include "../BaseTest.h" #include "../BaseTest.h"
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
USING_NS_CC_EXT;
class ChipmunkTest : public TestCase class ChipmunkTest : public TestCase
{ {
public: public:
@ -21,18 +19,18 @@ public:
void onEnter() override; void onEnter() override;
void initPhysics(); void initPhysics();
void createResetButton(); void createResetButton();
void reset(Ref* sender); void reset(cocos2d::Ref* sender);
void addNewSpriteAtPosition(cocos2d::Vec2 p); void addNewSpriteAtPosition(cocos2d::Vec2 p);
void update(float dt) override; void update(float dt) override;
void toggleDebugCallback(Ref* sender); void toggleDebugCallback(cocos2d::Ref* sender);
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
virtual void onAcceleration(Acceleration* acc, Event* event); virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event);
private: private:
Texture2D* _spriteTexture; // weak ref cocos2d::Texture2D* _spriteTexture; // weak ref
#if CC_ENABLE_CHIPMUNK_INTEGRATION #if CC_ENABLE_CHIPMUNK_INTEGRATION
PhysicsDebugNode* _debugLayer; // weak ref cocos2d::extension::PhysicsDebugNode* _debugLayer; // weak ref
#endif #endif
cpSpace* _space; // strong ref cpSpace* _space; // strong ref
cpShape* _walls[4]; cpShape* _walls[4];

View File

@ -1,6 +1,8 @@
#include "ClickAndMoveTest.h" #include "ClickAndMoveTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum enum
{ {
kTagSprite = 1, kTagSprite = 1,

View File

@ -11,8 +11,8 @@ public:
CREATE_FUNC(ClickAndMoveTestCase); CREATE_FUNC(ClickAndMoveTestCase);
ClickAndMoveTestCase(); ClickAndMoveTestCase();
bool onTouchBegan(Touch* touch, Event *event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchEnded(Touch* touch, Event *event); void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
}; };
#endif #endif

View File

@ -9,6 +9,8 @@
#include "../testResource.h" #include "../testResource.h"
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
USING_NS_CC;
enum { enum {
kTagTitleLabel = 1, kTagTitleLabel = 1,
kTagSubtitleLabel = 2, kTagSubtitleLabel = 2,

View File

@ -28,15 +28,15 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void setup() override; virtual void setup() override;
virtual Action* actionRotate(); virtual cocos2d::Action* actionRotate();
virtual Action* actionScale(); virtual cocos2d::Action* actionScale();
virtual DrawNode* shape(); virtual cocos2d::DrawNode* shape();
virtual Sprite* grossini(); virtual cocos2d::Sprite* grossini();
virtual Node* stencil(); virtual cocos2d::Node* stencil();
virtual ClippingNode* clipper(); virtual cocos2d::ClippingNode* clipper();
virtual Node* content(); virtual cocos2d::Node* content();
}; };
class ShapeTest : public BasicTest class ShapeTest : public BasicTest
@ -47,8 +47,8 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual Node* stencil() override; virtual cocos2d::Node* stencil() override;
virtual Node* content() override; virtual cocos2d::Node* content() override;
}; };
class ShapeInvertedTest : public ShapeTest class ShapeInvertedTest : public ShapeTest
@ -58,7 +58,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual ClippingNode* clipper() override; virtual cocos2d::ClippingNode* clipper() override;
}; };
class SpriteTest : public BasicTest class SpriteTest : public BasicTest
@ -69,9 +69,9 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual Node* stencil() override; virtual cocos2d::Node* stencil() override;
virtual ClippingNode* clipper() override; virtual cocos2d::ClippingNode* clipper() override;
virtual Node* content() override; virtual cocos2d::Node* content() override;
}; };
class SpriteNoAlphaTest : public SpriteTest class SpriteNoAlphaTest : public SpriteTest
@ -81,7 +81,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual ClippingNode* clipper() override; virtual cocos2d::ClippingNode* clipper() override;
}; };
class SpriteInvertedTest : public SpriteTest class SpriteInvertedTest : public SpriteTest
@ -91,7 +91,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual ClippingNode* clipper() override; virtual cocos2d::ClippingNode* clipper() override;
}; };
class NestedTest : public BaseClippingNodeTest class NestedTest : public BaseClippingNodeTest
@ -113,12 +113,12 @@ public:
virtual void setup() override; virtual void setup() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void pokeHoleAtPoint(Vec2 point); void pokeHoleAtPoint(cocos2d::Vec2 point);
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
private: private:
ClippingNode* _outerClipper; cocos2d::ClippingNode* _outerClipper;
Node* _holes; cocos2d::Node* _holes;
Node* _holesStencil; cocos2d::Node* _holesStencil;
}; };
class ScrollViewDemo : public BaseClippingNodeTest class ScrollViewDemo : public BaseClippingNodeTest
@ -129,12 +129,12 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void setup() override; virtual void setup() override;
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
private: private:
bool _scrolling; bool _scrolling;
Vec2 _lastPoint; cocos2d::Vec2 _lastPoint;
}; };
//#if COCOS2D_DEBUG > 1 //#if COCOS2D_DEBUG > 1
@ -149,20 +149,20 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void setup() override; virtual void setup() override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) override;
virtual void setupStencilForClippingOnPlane(GLint plane); virtual void setupStencilForClippingOnPlane(GLint plane);
virtual void setupStencilForDrawingOnPlane(GLint plane); virtual void setupStencilForDrawingOnPlane(GLint plane);
protected: protected:
std::list<CustomCommand> _renderCmds; std::list<cocos2d::CustomCommand> _renderCmds;
void onEnableStencil(); void onEnableStencil();
void onDisableStencil(); void onDisableStencil();
void onBeforeDrawClip(int planeIndex, const Vec2& pt); void onBeforeDrawClip(int planeIndex, const cocos2d::Vec2& pt);
void onBeforeDrawSprite(int planeIndex, const Vec2& pt); void onBeforeDrawSprite(int planeIndex, const cocos2d::Vec2& pt);
protected: protected:
Vector<Sprite*> _sprites; cocos2d::Vector<cocos2d::Sprite*> _sprites;
Vector<Sprite*> _spritesStencil; cocos2d::Vector<cocos2d::Sprite*> _spritesStencil;
}; };
class RawStencilBufferTest2 : public RawStencilBufferTest class RawStencilBufferTest2 : public RawStencilBufferTest

View File

@ -4,8 +4,6 @@
#include "../testBasic.h" #include "../testBasic.h"
#include "../BaseTest.h" #include "../BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(ConfigurationTests); DEFINE_TEST_SUITE(ConfigurationTests);
class ConfigurationBase : public TestCase class ConfigurationBase : public TestCase

View File

@ -27,8 +27,6 @@
#include "../BaseTest.h" #include "../BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(ConsoleTests); DEFINE_TEST_SUITE(ConsoleTests);
class BaseTestConsole : public TestCase class BaseTestConsole : public TestCase

View File

@ -3,6 +3,8 @@
#include "stdlib.h" #include "stdlib.h"
#include "curl/curl.h" #include "curl/curl.h"
USING_NS_CC;
CurlTests::CurlTests() CurlTests::CurlTests()
{ {
ADD_TEST_CASE(CurlTest); ADD_TEST_CASE(CurlTest);

View File

@ -14,7 +14,7 @@ public:
CurlTest(); CurlTest();
~CurlTest(); ~CurlTest();
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
private: private:
cocos2d::Label* _label; cocos2d::Label* _label;

View File

@ -1,5 +1,7 @@
#include "CurrentLanguageTest.h" #include "CurrentLanguageTest.h"
USING_NS_CC;
CurrentLanguageTests::CurrentLanguageTests() CurrentLanguageTests::CurrentLanguageTests()
{ {
ADD_TEST_CASE(CurrentLanguageTest); ADD_TEST_CASE(CurrentLanguageTest);

View File

@ -1,6 +1,8 @@
#include "DataVisitorTest.h" #include "DataVisitorTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
DataVisitorTests::DataVisitorTests() DataVisitorTests::DataVisitorTests()
{ {
ADD_TEST_CASE(PrettyPrinterDemo); ADD_TEST_CASE(PrettyPrinterDemo);

View File

@ -2,6 +2,8 @@
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
#include "renderer/CCCustomCommand.h" #include "renderer/CCCustomCommand.h"
USING_NS_CC;
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher #elif _MSC_VER >= 1400 //vs 2005 or higher

View File

@ -22,11 +22,11 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
protected: protected:
void onDraw(const Mat4 &transform, uint32_t flags); void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
CustomCommand _customCommand; cocos2d::CustomCommand _customCommand;
}; };
class DrawNodeTest : public DrawPrimitivesBaseTest class DrawNodeTest : public DrawPrimitivesBaseTest

View File

@ -1,5 +1,7 @@
#include "EffectsAdvancedTest.h" #include "EffectsAdvancedTest.h"
USING_NS_CC;
enum enum
{ {
kTagTextLayer = 1, kTagTextLayer = 1,

View File

@ -9,13 +9,13 @@ DEFINE_TEST_SUITE(EffectAdvanceTests);
class EffectAdvanceBaseTest: public TestCase class EffectAdvanceBaseTest: public TestCase
{ {
protected: protected:
TextureAtlas* _atlas; cocos2d::TextureAtlas* _atlas;
std::string _title; std::string _title;
Node* _bgNode; cocos2d::Node* _bgNode;
Node* _target1; cocos2d::Node* _target1;
Node* _target2; cocos2d::Node* _target2;
public: public:
virtual void onEnter() override; virtual void onEnter() override;

View File

@ -1,6 +1,8 @@
#include "EffectsTest.h" #include "EffectsTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum { enum {
kTagTextLayer = 1, kTagTextLayer = 1,

View File

@ -9,7 +9,7 @@ class EffectBaseTest : public TestCase
{ {
protected: protected:
//UxString _title; //UxString _title;
NodeGrid* _gridNodeTarget; cocos2d::NodeGrid* _gridNodeTarget;
public: public:
static EffectBaseTest* create(int index) static EffectBaseTest* create(int index)
{ {

View File

@ -4,9 +4,6 @@
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
#include "../../BaseTest.h" #include "../../BaseTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
DEFINE_TEST_SUITE(AssetsManagerExTests); DEFINE_TEST_SUITE(AssetsManagerExTests);
class AssetsManagerExLoaderScene : public TestCase class AssetsManagerExLoaderScene : public TestCase
@ -16,7 +13,7 @@ public:
AssetsManagerExLoaderScene(int testIndex); AssetsManagerExLoaderScene(int testIndex);
void startDownloadCallback(Ref* sender); void startDownloadCallback(cocos2d::Ref* sender);
virtual std::string title() const; virtual std::string title() const;
@ -25,11 +22,11 @@ public:
private: private:
int _testIndex; int _testIndex;
Layer* _loadLayer; cocos2d::Layer* _loadLayer;
Menu* _downloadMenu; cocos2d::Menu* _downloadMenu;
AssetsManagerEx *_am; AssetsManagerEx *_am;
Label *_progress; cocos2d::Label* _progress;
EventListenerAssetsManagerEx* _amListener; EventListenerAssetsManagerEx* _amListener;
void onLoadEnd(); void onLoadEnd();

View File

@ -45,7 +45,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
protected: protected:
ActionTimeline* action; ActionTimeline* action;

View File

@ -40,7 +40,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void restartTestCallback(Ref* pSender) override; virtual void restartTestCallback(cocos2d::Ref* pSender) override;
void dataLoaded(float percent); void dataLoaded(float percent);
}; };
@ -83,8 +83,8 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void onIncrease(Ref* pSender); virtual void onIncrease(cocos2d::Ref* pSender);
virtual void onDecrease(Ref* pSender); virtual void onDecrease(cocos2d::Ref* pSender);
virtual void addArmature(int number); virtual void addArmature(int number);
virtual void addArmatureToParent(cocostudio::Armature *armature); virtual void addArmatureToParent(cocostudio::Armature *armature);
virtual void removeArmatureFromParent(int tag); virtual void removeArmatureFromParent(int tag);
@ -149,7 +149,7 @@ public:
void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex);
void checkAction(float dt); void checkAction(float dt);
protected: protected:
NodeGrid* _gridNode; cocos2d::NodeGrid* _gridNode;
}; };
@ -162,7 +162,7 @@ public:
virtual void onExit() override; virtual void onExit() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
int displayIndex; int displayIndex;
cocostudio::Armature *armature; cocostudio::Armature *armature;
@ -177,7 +177,7 @@ public:
virtual void onExit() override; virtual void onExit() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
int animationID; int animationID;
cocostudio::Armature *armature; cocostudio::Armature *armature;
@ -198,7 +198,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
virtual void update(float delta); virtual void update(float delta);
void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex);
@ -261,7 +261,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual void update(float delta); virtual void update(float delta);
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex); void onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex);
@ -269,7 +269,7 @@ public:
cocostudio::Armature *armature; cocostudio::Armature *armature;
cocostudio::Armature *armature2; cocostudio::Armature *armature2;
DrawNode *drawNode; cocos2d::DrawNode* drawNode;
cocos2d::Sprite *bullet; cocos2d::Sprite *bullet;
}; };
#endif #endif
@ -282,13 +282,13 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
cocostudio::Armature *armature; cocostudio::Armature *armature;
Rect rect; cocos2d::Rect rect;
protected: protected:
DrawNode* _drawNode; cocos2d::DrawNode* _drawNode;
}; };
class TestAnchorPoint : public ArmatureBaseTest class TestAnchorPoint : public ArmatureBaseTest
@ -308,7 +308,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
virtual std::string title() const override; virtual std::string title() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
cocostudio::Armature *armature; cocostudio::Armature *armature;
int weaponIndex; int weaponIndex;
@ -324,7 +324,7 @@ public:
virtual void playWithIndex(int index); virtual void playWithIndex(int index);
CC_SYNTHESIZE(cocostudio::Armature*, m_pMount, Mount); CC_SYNTHESIZE(cocostudio::Armature*, m_pMount, Mount);
CC_SYNTHESIZE(cocos2d::Scene*, _scene, Scene); CC_SYNTHESIZE(cocos2d::Scene*, _scene, cocos2d::Scene*);
}; };
class TestArmatureNesting2 : public ArmatureBaseTest class TestArmatureNesting2 : public ArmatureBaseTest
@ -336,10 +336,10 @@ public:
virtual void onExit() override; virtual void onExit() override;
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void changeMountCallback(Ref* pSender); void changeMountCallback(cocos2d::Ref* pSender);
virtual cocostudio::Armature *createMount(const char *name, Vec2 position); virtual cocostudio::Armature *createMount(const char *name, cocos2d::Vec2 position);
private: private:
Hero *hero; Hero *hero;
@ -372,7 +372,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void updateSubTitle(); void updateSubTitle();
int animationID; int animationID;
@ -389,7 +389,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
}; };
@ -403,7 +403,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void dataLoaded(float percent); void dataLoaded(float percent);

View File

@ -8,7 +8,7 @@
DEFINE_TEST_SUITE(CocoStudioSceneEditTests); DEFINE_TEST_SUITE(CocoStudioSceneEditTests);
class SceneEditorTestBase : public TestCase class cocos2d::Scene*EditorTestBase : public TestCase
{ {
public: public:
virtual bool init() override; virtual bool init() override;
@ -16,9 +16,9 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
protected: protected:
MenuItemImage *restartItem; cocos2d::MenuItemImage* restartItem;
MenuItemImage *nextItem; cocos2d::MenuItemImage* nextItem;
MenuItemImage *backItem; cocos2d::MenuItemImage* backItem;
protected: protected:
virtual void changeLoadTypeCallback(cocos2d::Ref *pSender); virtual void changeLoadTypeCallback(cocos2d::Ref *pSender);
@ -35,7 +35,7 @@ protected:
std::string _filePath; std::string _filePath;
}; };
class LoadSceneEdtiorFileTest : public SceneEditorTestBase class LoadSceneEdtiorFileTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(LoadSceneEdtiorFileTest); CREATE_FUNC(LoadSceneEdtiorFileTest);
@ -52,7 +52,7 @@ private:
}; };
class SpriteComponentTest : public SceneEditorTestBase class SpriteComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(SpriteComponentTest); CREATE_FUNC(SpriteComponentTest);
@ -69,7 +69,7 @@ private:
void defaultPlay(); void defaultPlay();
}; };
class ArmatureComponentTest : public SceneEditorTestBase class ArmatureComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(ArmatureComponentTest); CREATE_FUNC(ArmatureComponentTest);
@ -86,7 +86,7 @@ private:
void defaultPlay(); void defaultPlay();
}; };
class UIComponentTest : public SceneEditorTestBase class UIComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(UIComponentTest); CREATE_FUNC(UIComponentTest);
@ -98,12 +98,12 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
cocos2d::Node* createGameScene(); cocos2d::Node* createGameScene();
void touchEvent(cocos2d::Ref *pSender, ui::Widget::TouchEventType type); void touchEvent(cocos2d::Ref *pSender, cocos2d::ui::Widget::TouchEventType type);
private: private:
void defaultPlay(); void defaultPlay();
}; };
class TmxMapComponentTest : public SceneEditorTestBase class TmxMapComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(TmxMapComponentTest); CREATE_FUNC(TmxMapComponentTest);
@ -120,7 +120,7 @@ private:
}; };
class ParticleComponentTest : public SceneEditorTestBase class ParticleComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(ParticleComponentTest); CREATE_FUNC(ParticleComponentTest);
@ -136,7 +136,7 @@ protected:
void defaultPlay(); void defaultPlay();
}; };
class EffectComponentTest : public SceneEditorTestBase class EffectComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(EffectComponentTest); CREATE_FUNC(EffectComponentTest);
@ -154,7 +154,7 @@ private:
}; };
class BackgroundComponentTest : public SceneEditorTestBase class BackgroundComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(BackgroundComponentTest); CREATE_FUNC(BackgroundComponentTest);
@ -170,7 +170,7 @@ private:
void defaultPlay(); void defaultPlay();
}; };
class AttributeComponentTest : public SceneEditorTestBase class AttributeComponentTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(AttributeComponentTest); CREATE_FUNC(AttributeComponentTest);
@ -188,7 +188,7 @@ private:
void defaultPlay(); void defaultPlay();
}; };
class TriggerTest : public SceneEditorTestBase class TriggerTest : public cocos2d::Scene*EditorTestBase
{ {
public: public:
CREATE_FUNC(TriggerTest); CREATE_FUNC(TriggerTest);
@ -201,10 +201,10 @@ public:
virtual void onExit() override; virtual void onExit() override;
// default implements are used to call script callback if exist // default implements are used to call script callback if exist
virtual bool onTouchBegan(Touch *touch, Event *unused_event); virtual bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* unused_event);
virtual void onTouchMoved(Touch *touch, Event *unused_event); virtual void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* unused_event);
virtual void onTouchEnded(Touch *touch, Event *unused_event); virtual void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* unused_event);
virtual void onTouchCancelled(Touch *touch, Event *unused_event); virtual void onTouchCancelled(cocos2d::Touch* touch, cocos2d::Event* unused_event);
// update of game // update of game
void gameLogic(float dt); void gameLogic(float dt);

View File

@ -16,7 +16,7 @@ public:
AnimationsTestLayer(); AnimationsTestLayer();
virtual ~AnimationsTestLayer(); virtual ~AnimationsTestLayer();
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName); virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Ref* pTarget, const char * pSelectorName);
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName); virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node); virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node);

View File

@ -32,7 +32,7 @@ class HelloCocosBuilderLayer
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Ref * pTarget, const char * pSelectorName); virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName); virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node); virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
virtual bool onAssignCCBCustomProperty(Ref* pTarget, const char* pMemberVariableName, const cocos2d::Value& pCCBValue); virtual bool onAssignCCBCustomProperty(cocos2d::Ref* pTarget, const char* pMemberVariableName, const cocos2d::Value& pCCBValue);
virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader); virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader);
void onMenuTestClicked(cocos2d::Ref * sender, cocos2d::extension::Control::EventType pControlEvent); void onMenuTestClicked(cocos2d::Ref * sender, cocos2d::extension::Control::EventType pControlEvent);

View File

@ -19,7 +19,7 @@ class TimelineCallbackTestLayer
virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Ref * pTarget, const char * pSelectorName); virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName); virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(Ref * pTarget, const char* pSelectorName); virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Ref* pTarget, const char* pSelectorName);
virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node); virtual bool onAssignCCBMemberVariable(cocos2d::Ref * pTarget, const char * pMemberVariableName, cocos2d::Node * node);
void onCallback1(Node* sender); void onCallback1(Node* sender);

View File

@ -25,6 +25,9 @@
#include "CCControlButtonTest.h" #include "CCControlButtonTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
bool ControlButtonTest_HelloVariableSize::init() bool ControlButtonTest_HelloVariableSize::init()
{ {
if (ControlScene::init()) if (ControlScene::init())

View File

@ -28,8 +28,6 @@
#include "../CCControlScene.h" #include "../CCControlScene.h"
USING_NS_CC_EXT;
class ControlButtonTest_HelloVariableSize : public ControlScene class ControlButtonTest_HelloVariableSize : public ControlScene
{ {
public: public:
@ -37,7 +35,7 @@ public:
virtual bool init() override; virtual bool init() override;
/** Creates and return a button with a default background and title color. */ /** Creates and return a button with a default background and title color. */
ControlButton *standardButtonWithTitle(const char * title); cocos2d::extension::ControlButton* standardButtonWithTitle(const char * title);
}; };
class ControlButtonTest_Event : public ControlScene class ControlButtonTest_Event : public ControlScene
@ -50,18 +48,18 @@ public:
virtual bool init() override; virtual bool init() override;
void touchDownAction(Ref *sender, Control::EventType controlEvent); void touchDownAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchDragInsideAction(Ref *sender, Control::EventType controlEvent); void touchDragInsideAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchDragOutsideAction(Ref *sender, Control::EventType controlEvent); void touchDragOutsideAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchDragEnterAction(Ref *sender, Control::EventType controlEvent); void touchDragEnterAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchDragExitAction(Ref *sender, Control::EventType controlEvent); void touchDragExitAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchUpInsideAction(Ref *sender, Control::EventType controlEvent); void touchUpInsideAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchUpOutsideAction(Ref *sender, Control::EventType controlEvent); void touchUpOutsideAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchCancelAction(Ref *sender, Control::EventType controlEvent); void touchCancelAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
void touchBitmaskAction(Ref *sender, Control::EventType controlEvent); void touchBitmaskAction(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
protected: protected:
CC_SYNTHESIZE_RETAIN(Label *, _displayValueLabel, DisplayValueLabel) CC_SYNTHESIZE_RETAIN(cocos2d::Label*, _displayValueLabel, DisplayValueLabel)
CC_SYNTHESIZE_RETAIN(Label *, _displayBitmaskLabel, DisplayBitmaskLabel) CC_SYNTHESIZE_RETAIN(cocos2d::Label*, _displayBitmaskLabel, DisplayBitmaskLabel)
}; };
@ -69,7 +67,7 @@ class ControlButtonTest_Styling : public ControlScene
{ {
public: public:
virtual bool init() override; virtual bool init() override;
ControlButton *standardButtonWithTitle(const char *title); cocos2d::extension::ControlButton* standardButtonWithTitle(const char *title);
CREATE_FUNC(ControlButtonTest_Styling); CREATE_FUNC(ControlButtonTest_Styling);
}; };

View File

@ -1,5 +1,6 @@
#include "CCControlColourPickerTest.h" #include "CCControlColourPickerTest.h"
USING_NS_CC;
USING_NS_CC_EXT; USING_NS_CC_EXT;
ControlColourPickerTest::ControlColourPickerTest() ControlColourPickerTest::ControlColourPickerTest()

View File

@ -1,8 +1,6 @@
#include "../CCControlScene.h" #include "../CCControlScene.h"
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
USING_NS_CC_EXT;
class ControlColourPickerTest : public ControlScene class ControlColourPickerTest : public ControlScene
{ {
public: public:
@ -10,9 +8,9 @@ public:
virtual ~ControlColourPickerTest(); virtual ~ControlColourPickerTest();
virtual bool init() override; virtual bool init() override;
/** Callback for the change value. */ /** Callback for the change value. */
void colourValueChanged(Ref *sender, Control::EventType controlEvent); void colourValueChanged(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
CC_SYNTHESIZE_RETAIN(Label*, _colorLabel, ColorLabel) CC_SYNTHESIZE_RETAIN(cocos2d::Label*, _colorLabel, ColorLabel)
CREATE_FUNC(ControlColourPickerTest) CREATE_FUNC(ControlColourPickerTest)
}; };

View File

@ -33,9 +33,9 @@ public:
ControlPotentiometerTest(); ControlPotentiometerTest();
virtual ~ControlPotentiometerTest(); virtual ~ControlPotentiometerTest();
virtual bool init() override; virtual bool init() override;
CC_SYNTHESIZE_RETAIN(Label*, _displayValueLabel, DisplayValueLabel) CC_SYNTHESIZE_RETAIN(cocos2d::Label*, _displayValueLabel, DisplayValueLabel)
void valueChanged(Ref *sender, Control::EventType controlEvent); void valueChanged(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
CREATE_FUNC(ControlPotentiometerTest) CREATE_FUNC(ControlPotentiometerTest)
}; };

View File

@ -27,6 +27,9 @@
#include "CCControlSceneManager.h" #include "CCControlSceneManager.h"
#include "../ExtensionsTest.h" #include "../ExtensionsTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
bool ControlScene::init() bool ControlScene::init()
{ {
if (TestCase::init()) if (TestCase::init())

View File

@ -30,8 +30,6 @@
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
#include "BaseTest.h" #include "BaseTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
class ControlScene : public TestCase class ControlScene : public TestCase
{ {

View File

@ -29,8 +29,6 @@
#include "extensions/cocos-ext.h" #include "extensions/cocos-ext.h"
#include "BaseTest.h" #include "BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(ControlTests); DEFINE_TEST_SUITE(ControlTests);
#endif /* __CCCONTROLSCENEMANAGER_H__ */ #endif /* __CCCONTROLSCENEMANAGER_H__ */

View File

@ -26,6 +26,9 @@
#include "CCControlSliderTest.h" #include "CCControlSliderTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
ControlSliderTest::ControlSliderTest() ControlSliderTest::ControlSliderTest()
{ {

View File

@ -33,9 +33,9 @@ public:
ControlSliderTest(); ControlSliderTest();
virtual ~ControlSliderTest(); virtual ~ControlSliderTest();
virtual bool init() override; virtual bool init() override;
void valueChanged(Ref *sender, Control::EventType controlEvent); void valueChanged(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
protected: protected:
Label* _displayValueLabel; cocos2d::Label* _displayValueLabel;
}; };

View File

@ -25,6 +25,9 @@
#include "CCControlStepperTest.h" #include "CCControlStepperTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
ControlStepperTest::ControlStepperTest() ControlStepperTest::ControlStepperTest()
: _displayValueLabel(nullptr) : _displayValueLabel(nullptr)
{ {

View File

@ -36,12 +36,12 @@ public:
virtual ~ControlStepperTest(); virtual ~ControlStepperTest();
virtual bool init() override; virtual bool init() override;
/** Creates and returns a new ControlStepper. */ /** Creates and returns a new ControlStepper. */
ControlStepper* makeControlStepper(); cocos2d::extension::ControlStepper* makeControlStepper();
/** Callback for the change value. */ /** Callback for the change value. */
void valueChanged(Ref *sender, Control::EventType controlEvent); void valueChanged(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
protected: protected:
CC_SYNTHESIZE_RETAIN(Label*, _displayValueLabel, DisplayValueLabel) CC_SYNTHESIZE_RETAIN(cocos2d::Label*, _displayValueLabel, DisplayValueLabel)
}; };

View File

@ -26,6 +26,9 @@
#include "CCControlSwitchTest.h" #include "CCControlSwitchTest.h"
USING_NS_CC;
USING_NS_CC_EXT;
ControlSwitchTest::~ControlSwitchTest() ControlSwitchTest::~ControlSwitchTest()
{ {
CC_SAFE_RELEASE(_displayValueLabel); CC_SAFE_RELEASE(_displayValueLabel);

View File

@ -32,8 +32,8 @@ public:
virtual ~ControlSwitchTest(); virtual ~ControlSwitchTest();
virtual bool init() override; virtual bool init() override;
/** Callback for the change value. */ /** Callback for the change value. */
void valueChanged(Ref* sender, Control::EventType controlEvent); void valueChanged(cocos2d::Ref* sender, cocos2d::extension::Control::EventType controlEvent);
Label *_displayValueLabel; cocos2d::Label* _displayValueLabel;
CREATE_FUNC(ControlSwitchTest); CREATE_FUNC(ControlSwitchTest);
}; };

View File

@ -35,7 +35,7 @@ public:
void onMenuSendBinaryClicked(cocos2d::Ref *sender); void onMenuSendBinaryClicked(cocos2d::Ref *sender);
virtual std::string title() const override { return "WebSocket Test"; } virtual std::string title() const override { return "WebSocket Test"; }
void startTestCallback(Ref* sender); void startTestCallback(cocos2d::Ref* sender);
private: private:
cocos2d::network::WebSocket* _wsiSendText; cocos2d::network::WebSocket* _wsiSendText;

View File

@ -3,7 +3,6 @@
#include "../BaseTest.h" #include "../BaseTest.h"
USING_NS_CC;
DEFINE_TEST_SUITE(FileUtilsTests); DEFINE_TEST_SUITE(FileUtilsTests);

View File

@ -1,6 +1,8 @@
#include "FontTest.h" #include "FontTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum { enum {
kTagLabel1, kTagLabel1,
kTagLabel2, kTagLabel2,

View File

@ -1,5 +1,7 @@
#include "MouseTest.h" #include "MouseTest.h"
USING_NS_CC;
template <typename T> std::string tostr(const T& t) { std::ostringstream os; os<<t; return os.str(); } template <typename T> std::string tostr(const T& t) { std::ostringstream os; os<<t; return os.str(); }
MouseTests::MouseTests() MouseTests::MouseTests()

View File

@ -19,18 +19,18 @@ public:
MouseEventTest(); MouseEventTest();
~MouseEventTest(); ~MouseEventTest();
void onMouseDown(Event* event); void onMouseDown(cocos2d::Event* event);
void onMouseUp(Event* event); void onMouseUp(cocos2d::Event* event);
void onMouseMove(Event* event); void onMouseMove(cocos2d::Event* event);
void onMouseScroll(Event* event); void onMouseScroll(cocos2d::Event* event);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
Label* _labelAction; cocos2d::Label* _labelAction;
Label* _labelPosition; cocos2d::Label* _labelPosition;
EventListenerMouse* _mouseListener; cocos2d::EventListenerMouse* _mouseListener;
}; };
class HideMouseTest : public BaseMouseTest class HideMouseTest : public BaseMouseTest
@ -44,7 +44,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
EventListenerMouse* _lis; cocos2d::EventListenerMouse* _lis;
}; };
#endif #endif

View File

@ -1,6 +1,8 @@
#include "IntervalTest.h" #include "IntervalTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
#define SID_STEP1 100 #define SID_STEP1 100
#define SID_STEP2 101 #define SID_STEP2 101
#define SID_STEP3 102 #define SID_STEP3 102

View File

@ -17,11 +17,11 @@ public:
//CREATE_NODE(IntervalLayer); //CREATE_NODE(IntervalLayer);
protected: protected:
Label* _label0; cocos2d::Label* _label0;
Label* _label1; cocos2d::Label* _label1;
Label* _label2; cocos2d::Label* _label2;
Label* _label3; cocos2d::Label* _label3;
Label* _label4; cocos2d::Label* _label4;
float _time0, _time1, _time2, _time3, _time4; float _time0, _time1, _time2, _time3, _time4;
}; };

View File

@ -2,6 +2,8 @@
#include "../testResource.h" #include "../testResource.h"
#include "cocos2d.h" #include "cocos2d.h"
USING_NS_CC;
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher #elif _MSC_VER >= 1400 //vs 2005 or higher

View File

@ -20,7 +20,7 @@ public:
class Atlas1 : public AtlasDemo class Atlas1 : public AtlasDemo
{ {
TextureAtlas* _textureAtlas; cocos2d::TextureAtlas* _textureAtlas;
public: public:
CREATE_FUNC(Atlas1); CREATE_FUNC(Atlas1);
@ -28,11 +28,11 @@ public:
~Atlas1(); ~Atlas1();
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
protected: protected:
void onDraw(const Mat4 &transform, uint32_t flags); void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
protected: protected:
CustomCommand _customCommand; cocos2d::CustomCommand _customCommand;
}; };
class LabelAtlasTest : public AtlasDemo class LabelAtlasTest : public AtlasDemo
@ -206,18 +206,18 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
void setAlignmentLeft(Ref* sender); void setAlignmentLeft(cocos2d::Ref* sender);
void setAlignmentCenter(Ref* sender); void setAlignmentCenter(cocos2d::Ref* sender);
void setAlignmentRight(Ref* sender); void setAlignmentRight(cocos2d::Ref* sender);
void setAlignmentTop(Ref* sender); void setAlignmentTop(cocos2d::Ref* sender);
void setAlignmentMiddle(Ref* sender); void setAlignmentMiddle(cocos2d::Ref* sender);
void setAlignmentBottom(Ref* sender); void setAlignmentBottom(cocos2d::Ref* sender);
void updateAlignment(); void updateAlignment();
const char* getCurrentAlignment(); const char* getCurrentAlignment();
private: private:
TextHAlignment _horizAlign; cocos2d::TextHAlignment _horizAlign;
LabelTTF* _label; cocos2d::LabelTTF* _label;
TextVAlignment _vertAlign; cocos2d::TextVAlignment _vertAlign;
}; };
class LabelTTFMultiline : public AtlasDemo class LabelTTFMultiline : public AtlasDemo
@ -258,17 +258,17 @@ public:
void snapArrowsToEdge(); void snapArrowsToEdge();
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void stringChanged(Ref *sender); void stringChanged(cocos2d::Ref* sender);
void alignmentChanged(Ref *sender); void alignmentChanged(cocos2d::Ref* sender);
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
public: public:
LabelBMFont *_labelShouldRetain; cocos2d::LabelBMFont* _labelShouldRetain;
Sprite *_arrowsBarShouldRetain; cocos2d::Sprite* _arrowsBarShouldRetain;
Sprite *_arrowsShouldRetain; cocos2d::Sprite* _arrowsShouldRetain;
MenuItemFont *_lastSentenceItem, *_lastAlignmentItem; cocos2d::MenuItemFont *_lastSentenceItem, *_lastAlignmentItem;
bool _drag; bool _drag;
}; };

View File

@ -2,6 +2,7 @@
#include "../testResource.h" #include "../testResource.h"
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
USING_NS_CC;
using namespace ui; using namespace ui;
enum { enum {

View File

@ -164,17 +164,17 @@ public:
void snapArrowsToEdge(); void snapArrowsToEdge();
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void stringChanged(Ref *sender); void stringChanged(cocos2d::Ref* sender);
void alignmentChanged(Ref *sender); void alignmentChanged(cocos2d::Ref* sender);
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
public: public:
Label *_labelShouldRetain; cocos2d::Label* _labelShouldRetain;
Sprite *_arrowsBarShouldRetain; cocos2d::Sprite* _arrowsBarShouldRetain;
Sprite *_arrowsShouldRetain; cocos2d::Sprite* _arrowsShouldRetain;
MenuItemFont *_lastSentenceItem, *_lastAlignmentItem; cocos2d::MenuItemFont *_lastSentenceItem, *_lastAlignmentItem;
bool _drag; bool _drag;
}; };
@ -244,13 +244,13 @@ public:
private: private:
void setAlignmentLeft(Ref* sender); void setAlignmentLeft(cocos2d::Ref* sender);
void setAlignmentCenter(Ref* sender); void setAlignmentCenter(cocos2d::Ref* sender);
void setAlignmentRight(Ref* sender); void setAlignmentRight(cocos2d::Ref* sender);
void updateAlignment(); void updateAlignment();
Label * _label; cocos2d::Label* _label;
TextHAlignment _horizAlign; cocos2d::TextHAlignment _horizAlign;
}; };
@ -338,11 +338,11 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void sliderEvent(Ref *pSender, ui::Slider::EventType type); void sliderEvent(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType type);
private: private:
Label* shadowLabelOutline; cocos2d::Label* shadowLabelOutline;
Label* shadowLabelTTF; cocos2d::Label* shadowLabelTTF;
Label* shadowLabelBMFont; cocos2d::Label* shadowLabelBMFont;
}; };
class LabelCharMapTest : public AtlasDemoNew class LabelCharMapTest : public AtlasDemoNew
@ -421,17 +421,17 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
void setAlignmentLeft(Ref* sender); void setAlignmentLeft(cocos2d::Ref* sender);
void setAlignmentCenter(Ref* sender); void setAlignmentCenter(cocos2d::Ref* sender);
void setAlignmentRight(Ref* sender); void setAlignmentRight(cocos2d::Ref* sender);
void setAlignmentTop(Ref* sender); void setAlignmentTop(cocos2d::Ref* sender);
void setAlignmentMiddle(Ref* sender); void setAlignmentMiddle(cocos2d::Ref* sender);
void setAlignmentBottom(Ref* sender); void setAlignmentBottom(cocos2d::Ref* sender);
const char* getCurrentAlignment(); const char* getCurrentAlignment();
Label* _label; cocos2d::Label* _label;
TextHAlignment _horizAlign; cocos2d::TextHAlignment _horizAlign;
TextVAlignment _vertAlign; cocos2d::TextVAlignment _vertAlign;
}; };
class LabelIssue4428Test : public AtlasDemoNew class LabelIssue4428Test : public AtlasDemoNew
@ -466,9 +466,9 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void sliderEvent(Ref *sender, ui::Slider::EventType type); void sliderEvent(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType type);
private: private:
Label* label; cocos2d::Label* label;
}; };
class LabelAdditionalKerningTest : public AtlasDemoNew class LabelAdditionalKerningTest : public AtlasDemoNew
@ -481,9 +481,9 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void sliderEvent(Ref *sender, ui::Slider::EventType type); void sliderEvent(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType type);
private: private:
Label* label; cocos2d::Label* label;
}; };
class LabelIssue8492Test : public AtlasDemoNew class LabelIssue8492Test : public AtlasDemoNew

View File

@ -1,6 +1,8 @@
#include "LayerTest.h" #include "LayerTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum enum
{ {
kTagLayer = 1, kTagLayer = 1,

View File

@ -68,11 +68,11 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void updateSize(Vec2 &touchLocation); void updateSize(cocos2d::Vec2 &touchLocation);
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
}; };
class LayerTest2 : public LayerTest class LayerTest2 : public LayerTest
@ -99,7 +99,7 @@ class LayerGradientTest : public LayerTest
public: public:
CREATE_FUNC(LayerGradientTest); CREATE_FUNC(LayerGradientTest);
LayerGradientTest(); LayerGradientTest();
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void toggleItem(cocos2d::Ref *sender); void toggleItem(cocos2d::Ref *sender);
@ -128,7 +128,7 @@ class LayerIgnoreAnchorPointPos : public LayerTest
public: public:
CREATE_FUNC(LayerIgnoreAnchorPointPos); CREATE_FUNC(LayerIgnoreAnchorPointPos);
virtual void onEnter() override; virtual void onEnter() override;
void onToggle(Ref* pObject); void onToggle(cocos2d::Ref* pObject);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
}; };
@ -138,7 +138,7 @@ class LayerIgnoreAnchorPointRot : public LayerTest
public: public:
CREATE_FUNC(LayerIgnoreAnchorPointRot); CREATE_FUNC(LayerIgnoreAnchorPointRot);
virtual void onEnter() override; virtual void onEnter() override;
void onToggle(Ref* pObject); void onToggle(cocos2d::Ref* pObject);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
}; };
@ -148,7 +148,7 @@ class LayerIgnoreAnchorPointScale : public LayerTest
public: public:
CREATE_FUNC(LayerIgnoreAnchorPointScale); CREATE_FUNC(LayerIgnoreAnchorPointScale);
virtual void onEnter() override; virtual void onEnter() override;
void onToggle(Ref* pObject); void onToggle(cocos2d::Ref* pObject);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
}; };
@ -173,7 +173,7 @@ public:
void step(float dt); void step(float dt);
private: private:
LayerColor* _layer[3]; cocos2d::LayerColor* _layer[3];
}; };
class LayerBug3162B : public LayerTest class LayerBug3162B : public LayerTest
@ -187,7 +187,7 @@ public:
void step(float dt); void step(float dt);
private: private:
LayerColor* _layer[3]; cocos2d::LayerColor* _layer[3];
}; };
class LayerColorOccludeBug : public LayerTest class LayerColorOccludeBug : public LayerTest
@ -200,7 +200,8 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
LayerColor* _layer; cocos2d::LayerColor* _layer;
}; };
#endif #endif

View File

@ -1,5 +1,7 @@
#include "LightTest.h" #include "LightTest.h"
USING_NS_CC;
LightTests::LightTests() LightTests::LightTests()
{ {
ADD_TEST_CASE(LightTest); ADD_TEST_CASE(LightTest);

View File

@ -40,7 +40,7 @@ public:
virtual void update(float delta) override; virtual void update(float delta) override;
void SwitchLight(Ref* sender, LightType lightType); void SwitchLight(cocos2d::Ref* sender, cocos2d::LightType lightType);
private: private:
@ -49,15 +49,15 @@ private:
private: private:
AmbientLight *_ambientLight; cocos2d::AmbientLight* _ambientLight;
DirectionLight *_directionalLight; cocos2d::DirectionLight* _directionalLight;
PointLight *_pointLight; cocos2d::PointLight* _pointLight;
SpotLight *_spotLight; cocos2d::SpotLight* _spotLight;
Label *_ambientLightLabel; cocos2d::Label* _ambientLightLabel;
Label *_directionalLightLabel; cocos2d::Label* _directionalLightLabel;
Label *_pointLightLabel; cocos2d::Label* _pointLightLabel;
Label *_spotLightLabel; cocos2d::Label* _spotLightLabel;
}; };
#endif #endif

View File

@ -26,6 +26,8 @@
#include "MenuTest.h" #include "MenuTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum { enum {
kTagMenu = 1, kTagMenu = 1,
kTagMenu0 = 0, kTagMenu0 = 0,

View File

@ -39,39 +39,39 @@ public:
virtual bool init() override; virtual bool init() override;
}; };
class MenuLayerMainMenu : public Layer class MenuLayerMainMenu : public cocos2d::Layer
{ {
protected: protected:
MenuItem* _disabledItem; cocos2d::MenuItem* _disabledItem;
EventListenerTouchOneByOne* _touchListener; cocos2d::EventListenerTouchOneByOne* _touchListener;
public: public:
MenuLayerMainMenu(); MenuLayerMainMenu();
~MenuLayerMainMenu(); ~MenuLayerMainMenu();
public: public:
bool onTouchBegan(Touch *touch, Event * event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchEnded(Touch *touch, Event * event); void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchCancelled(Touch *touch, Event * event); void onTouchCancelled(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchMoved(Touch *touch, Event * event); void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
void allowTouches(float dt); void allowTouches(float dt);
void menuCallback(Ref* sender); void menuCallback(cocos2d::Ref* sender);
void menuCallbackConfig(Ref* sender); void menuCallbackConfig(cocos2d::Ref* sender);
void menuCallbackDisabled(Ref* sender); void menuCallbackDisabled(cocos2d::Ref* sender);
void menuCallback2(Ref* sender); void menuCallback2(cocos2d::Ref* sender);
void menuCallbackPriorityTest(Ref* sender); void menuCallbackPriorityTest(cocos2d::Ref* sender);
void menuCallbackBugsTest(Ref *pSender); void menuCallbackBugsTest(cocos2d::Ref* pSender);
void onQuit(Ref* sender); void onQuit(cocos2d::Ref* sender);
void menuMovingCallback(Ref *pSender); void menuMovingCallback(cocos2d::Ref* pSender);
//CREATE_NODE(MenuLayer1); //CREATE_NODE(MenuLayer1);
}; };
class MenuLayer2 : public Layer class MenuLayer2 : public cocos2d::Layer
{ {
protected: protected:
Vec2 _centeredMenu; cocos2d::Vec2 _centeredMenu;
bool _alignedH; bool _alignedH;
void alignMenusH(); void alignMenusH();
@ -81,56 +81,56 @@ public:
MenuLayer2(); MenuLayer2();
~MenuLayer2(); ~MenuLayer2();
void menuCallback(Ref* sender); void menuCallback(cocos2d::Ref* sender);
void menuCallbackOpacity(Ref* sender); void menuCallbackOpacity(cocos2d::Ref* sender);
void menuCallbackAlign(Ref* sender); void menuCallbackAlign(cocos2d::Ref* sender);
//CREATE_NODE(MenuLayer2); //CREATE_NODE(MenuLayer2);
}; };
class MenuLayer3 : public Layer class MenuLayer3 : public cocos2d::Layer
{ {
protected: protected:
MenuItem* _disabledItem; cocos2d::MenuItem* _disabledItem;
public: public:
MenuLayer3(); MenuLayer3();
~MenuLayer3(); ~MenuLayer3();
}; };
class MenuLayer4 : public Layer class MenuLayer4 : public cocos2d::Layer
{ {
public: public:
MenuLayer4(); MenuLayer4();
~MenuLayer4(); ~MenuLayer4();
void menuCallback(Ref* sender); void menuCallback(cocos2d::Ref* sender);
void backCallback(Ref* sender); void backCallback(cocos2d::Ref* sender);
}; };
class BugsTest : public Layer class BugsTest : public cocos2d::Layer
{ {
public: public:
BugsTest(); BugsTest();
void issue1410MenuCallback(Ref *pSender); void issue1410MenuCallback(cocos2d::Ref* pSender);
void issue1410v2MenuCallback(Ref *pSender); void issue1410v2MenuCallback(cocos2d::Ref* pSender);
void backMenuCallback(Ref *pSender); void backMenuCallback(cocos2d::Ref* pSender);
}; };
class RemoveMenuItemWhenMove : public Layer class RemoveMenuItemWhenMove : public cocos2d::Layer
{ {
public: public:
RemoveMenuItemWhenMove(); RemoveMenuItemWhenMove();
~RemoveMenuItemWhenMove(); ~RemoveMenuItemWhenMove();
bool onTouchBegan(Touch *touch, Event *event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchMoved(Touch *touch, Event *event); void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
void goBack(Ref *pSender); void goBack(cocos2d::Ref* pSender);
private: private:
MenuItemFont *item; cocos2d::MenuItemFont *item;
EventListenerTouchOneByOne* _touchListener; cocos2d::EventListenerTouchOneByOne* _touchListener;
}; };
#endif #endif

View File

@ -1,6 +1,8 @@
#include "MotionStreakTest.h" #include "MotionStreakTest.h"
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum { enum {
kTagLabel = 1, kTagLabel = 1,
kTagSprite1 = 2, kTagSprite1 = 2,

View File

@ -3,7 +3,6 @@
#include "../BaseTest.h" #include "../BaseTest.h"
//USING_NS_CC;
DEFINE_TEST_SUITE(MotionStreakTests); DEFINE_TEST_SUITE(MotionStreakTests);
@ -17,16 +16,16 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
virtual void onEnter() override; virtual void onEnter() override;
void modeCallback(Ref* sender); void modeCallback(cocos2d::Ref* sender);
protected: protected:
MotionStreak *streak; cocos2d::MotionStreak* streak;
}; };
class MotionStreakTest1 : public MotionStreakTest class MotionStreakTest1 : public MotionStreakTest
{ {
protected: protected:
Node* _root; cocos2d::Node* _root;
Node* _target; cocos2d::Node* _target;
public: public:
CREATE_FUNC(MotionStreakTest1); CREATE_FUNC(MotionStreakTest1);
@ -38,13 +37,13 @@ public:
class MotionStreakTest2 : public MotionStreakTest class MotionStreakTest2 : public MotionStreakTest
{ {
protected: protected:
Node* _root; cocos2d::Node* _root;
Node* _target; cocos2d::Node* _target;
public: public:
CREATE_FUNC(MotionStreakTest2); CREATE_FUNC(MotionStreakTest2);
virtual void onEnter() override; virtual void onEnter() override;
void onTouchesMoved(const std::vector<Touch*>& touches, Event* event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
virtual std::string title() const override; virtual std::string title() const override;
}; };
@ -58,7 +57,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void update(float dt) override; virtual void update(float dt) override;
private: private:
Vec2 _center; cocos2d::Vec2 _center;
float _radius; float _radius;
float _angle; float _angle;
}; };

View File

@ -1,5 +1,7 @@
#include "MutiTouchTest.h" #include "MutiTouchTest.h"
USING_NS_CC;
MutiTouchTests::MutiTouchTests() MutiTouchTests::MutiTouchTests()
{ {
ADD_TEST_CASE(MutiTouchTest); ADD_TEST_CASE(MutiTouchTest);

View File

@ -12,10 +12,10 @@ public:
virtual bool init() override; virtual bool init() override;
void onTouchesBegan(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesMoved(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesCancelled(const std::vector<Touch*>& touches, cocos2d::Event *event); void onTouchesCancelled(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
}; };
#endif /* __MUTITOUCHTEST_H__ */ #endif /* __MUTITOUCHTEST_H__ */

View File

@ -108,7 +108,7 @@ private:
cocos2d::experimental::AudioProfile _audioProfile; cocos2d::experimental::AudioProfile _audioProfile;
int _audioCount; int _audioCount;
Label* _showLabel; cocos2d::Label* _showLabel;
float _time; float _time;
float _minDelay; float _minDelay;
void* _timeSlider; void* _timeSlider;

View File

@ -9,6 +9,8 @@
#include "NewEventDispatcherTest.h" #include "NewEventDispatcherTest.h"
#include "testResource.h" #include "testResource.h"
USING_NS_CC;
EventDispatcherTests::EventDispatcherTests() EventDispatcherTests::EventDispatcherTests()
{ {
ADD_TEST_CASE(TouchableSpriteTest); ADD_TEST_CASE(TouchableSpriteTest);

View File

@ -57,8 +57,8 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
EventListenerCustom* _listener; cocos2d::EventListenerCustom* _listener;
EventListenerCustom* _listener2; cocos2d::EventListenerCustom* _listener2;
}; };
class LabelKeyboardEventTest : public EventDispatcherTestDemo class LabelKeyboardEventTest : public EventDispatcherTestDemo
@ -89,7 +89,7 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
Sprite* _sprite; cocos2d::Sprite* _sprite;
bool _spriteSaved; bool _spriteSaved;
}; };
@ -113,16 +113,16 @@ public:
virtual void update(float dt) override; virtual void update(float dt) override;
void onEvent1(EventCustom *event); void onEvent1(cocos2d::EventCustom* event);
void onEvent2(EventCustom *event); void onEvent2(cocos2d::EventCustom* event);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
protected: protected:
int _count1, _count2, _count3, _count4; int _count1, _count2, _count3, _count4;
Label *_label1, *_label2, *_label3, *_label4; cocos2d::Label* _label1, *_label2, *_label3, *_label4;
EventListenerCustom *_event1, *_event2, *_event3, *_event4; cocos2d::EventListenerCustom* _event1, *_event2, *_event3, *_event4;
}; };
class GlobalZTouchTest : public EventDispatcherTestDemo class GlobalZTouchTest : public EventDispatcherTestDemo
@ -137,7 +137,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
protected: protected:
Sprite* _sprite; cocos2d::Sprite* _sprite;
float _accum; float _accum;
}; };
@ -151,8 +151,8 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
protected: protected:
bool isPointInNode(Vec2 pt, Node* node); bool isPointInNode(cocos2d::Vec2 pt, cocos2d::Node* node);
bool isPointInTopHalfAreaOfScreen(Vec2 pt); bool isPointInTopHalfAreaOfScreen(cocos2d::Vec2 pt);
}; };
class PauseResumeTargetTest : public EventDispatcherTestDemo class PauseResumeTargetTest : public EventDispatcherTestDemo
@ -179,7 +179,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
EventListenerCustom* _customlistener; cocos2d::EventListenerCustom* _customlistener;
bool _bugFixed; bool _bugFixed;
}; };
@ -227,7 +227,7 @@ public:
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
private: private:
EventListenerCustom* _listener; cocos2d::EventListenerCustom* _listener;
}; };
#endif /* defined(__samples__NewEventDispatcherTest__) */ #endif /* defined(__samples__NewEventDispatcherTest__) */

View File

@ -24,6 +24,8 @@
#include "NewRendererTest.h" #include "NewRendererTest.h"
USING_NS_CC;
NewRendererTests::NewRendererTests() NewRendererTests::NewRendererTests()
{ {
ADD_TEST_CASE(NewSpriteTest); ADD_TEST_CASE(NewSpriteTest);

View File

@ -30,7 +30,7 @@ public:
void createSpriteTest(); void createSpriteTest();
void createNewSpriteTest(); void createNewSpriteTest();
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
protected: protected:
NewSpriteTest(); NewSpriteTest();
@ -58,8 +58,8 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
void addNewSpriteWithCoords(Vec2 p); void addNewSpriteWithCoords(cocos2d::Vec2 p);
protected: protected:
NewSpriteBatchTest(); NewSpriteBatchTest();
@ -74,16 +74,16 @@ public:
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
protected: protected:
NewClippingNodeTest(); NewClippingNodeTest();
virtual ~NewClippingNodeTest(); virtual ~NewClippingNodeTest();
bool _scrolling; bool _scrolling;
Vec2 _lastPoint; cocos2d::Vec2 _lastPoint;
}; };
class NewDrawNodeTest : public MultiSceneTest class NewDrawNodeTest : public MultiSceneTest
@ -110,9 +110,9 @@ public:
protected: protected:
NewCullingTest(); NewCullingTest();
virtual ~NewCullingTest(); virtual ~NewCullingTest();
bool onTouchBegan(Touch* touch, Event *event); bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event *event);
void onTouchMoved(Touch* touch, Event *event); void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event *event);
Vec2 _lastPos; cocos2d::Vec2 _lastPos;
}; };
class VBOFullTest : public MultiSceneTest class VBOFullTest : public MultiSceneTest
@ -139,7 +139,7 @@ protected:
CaptureScreenTest(); CaptureScreenTest();
~CaptureScreenTest(); ~CaptureScreenTest();
void onCaptured(Ref*); void onCaptured(cocos2d::Ref*);
void afterCaptured(bool succeed, const std::string& outputFile); void afterCaptured(bool succeed, const std::string& outputFile);
std::string _filename; std::string _filename;

View File

@ -27,6 +27,8 @@
#include <regex> #include <regex>
#include "../testResource.h" #include "../testResource.h"
USING_NS_CC;
enum enum
{ {
kTagSprite1 = 1, kTagSprite1 = 1,

View File

@ -40,7 +40,7 @@ protected:
TestCocosNodeDemo(); TestCocosNodeDemo();
virtual ~TestCocosNodeDemo(); virtual ~TestCocosNodeDemo();
Director::Projection _preProjection; cocos2d::Director::Projection _preProjection;
}; };
class NodeTest2 : public TestCocosNodeDemo class NodeTest2 : public TestCocosNodeDemo
@ -208,8 +208,8 @@ public:
protected: protected:
CameraTest1(); CameraTest1();
Sprite *_sprite1; cocos2d::Sprite* _sprite1;
Sprite *_sprite2; cocos2d::Sprite* _sprite2;
}; };
class CameraTest2 : public TestCocosNodeDemo class CameraTest2 : public TestCocosNodeDemo
@ -224,15 +224,15 @@ public:
protected: protected:
CameraTest2(); CameraTest2();
Sprite *_sprite1; cocos2d::Sprite* _sprite1;
Sprite *_sprite2; cocos2d::Sprite* _sprite2;
}; };
class ConvertToNode : public TestCocosNodeDemo class ConvertToNode : public TestCocosNodeDemo
{ {
public: public:
CREATE_FUNC(ConvertToNode); CREATE_FUNC(ConvertToNode);
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event); void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
virtual std::string title() const override; virtual std::string title() const override;
virtual std::string subtitle() const override; virtual std::string subtitle() const override;
@ -273,7 +273,7 @@ public:
protected: protected:
NodeGlobalZValueTest(); NodeGlobalZValueTest();
Sprite *_sprite; cocos2d::Sprite* _sprite;
}; };
class NodeNormalizedPositionTest1 : public TestCocosNodeDemo class NodeNormalizedPositionTest1 : public TestCocosNodeDemo
@ -298,7 +298,7 @@ protected:
NodeNormalizedPositionTest2(); NodeNormalizedPositionTest2();
void update(float dt) override; void update(float dt) override;
Size _copyContentSize; cocos2d::Size _copyContentSize;
float _accum; float _accum;
}; };
@ -314,7 +314,7 @@ protected:
void update(float dt) override; void update(float dt) override;
float _accum; float _accum;
Sprite *sprite; cocos2d::Sprite* sprite;
}; };
class NodeNameTest : public TestCocosNodeDemo class NodeNameTest : public TestCocosNodeDemo

View File

@ -1,5 +1,7 @@
#include "OpenURLTest.h" #include "OpenURLTest.h"
USING_NS_CC;
OpenURLTests::OpenURLTests() OpenURLTests::OpenURLTests()
{ {
ADD_TEST_CASE(OpenURLTest); ADD_TEST_CASE(OpenURLTest);

Some files were not shown because too many files have changed in this diff Show More