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
{
protected:
TextureAtlas* _atlas;
cocos2d::TextureAtlas* _atlas;
std::string _title;

View File

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

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@ public:
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 false Initialize failed, app terminate.
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ DEFINE_TEST_SUITE(Box2DTests);
class Box2DTest : public TestCase
{
Texture2D* _spriteTexture; // weak ref
cocos2d::Texture2D* _spriteTexture; // weak ref
b2World* world;
// GLESDebugDraw* _debugDraw;
@ -19,17 +19,17 @@ public:
void initPhysics();
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 onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
#if CC_ENABLE_BOX2D_INTEGRATION
protected:
Mat4 _modelViewMV;
void onDraw();
CustomCommand _customCommand;
cocos2d::CustomCommand _customCommand;
#endif
} ;

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,8 @@
#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 )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -65,10 +65,10 @@ class CameraBaseTest : public TestCase
public:
protected:
BillBoard* bill1;
BillBoard* bill2;
Label* l1;
Label* l2;
cocos2d::BillBoard* bill1;
cocos2d::BillBoard* bill2;
cocos2d::Label* l1;
cocos2d::Label* l2;
};
class CameraRotationTest : public CameraBaseTest {
@ -89,9 +89,9 @@ public:
protected:
Node* _camControlNode;
Node* _camNode;
EventListenerTouchOneByOne* _lis;
cocos2d::Node* _camControlNode;
cocos2d::Node* _camNode;
cocos2d::EventListenerTouchOneByOne* _lis;
};
class Camera3DTestDemo : public CameraBaseTest
@ -105,50 +105,50 @@ public:
virtual void onExit() override;
// overrides
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 onTouchesMoved(const std::vector<Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event);
void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
void scaleCameraCallback(Ref* sender,float value);
void rotateCameraCallback(Ref* sender,float value);
void SwitchViewCallback(Ref* sender,CameraType cameraType);
void scaleCameraCallback(cocos2d::Ref* sender,float value);
void rotateCameraCallback(cocos2d::Ref* sender,float value);
void SwitchViewCallback(cocos2d::Ref* sender,CameraType cameraType);
void updateCamera(float fDelta);
void move3D(float elapsedTime);
void updateState(float elapsedTime);
bool isState(unsigned int state,unsigned int bit) const;
void reachEndCallBack();
bool onTouchesCommon(Touch* touch, Event* event, bool* touchProperty);
bool onTouchesZoomOut(Touch* touch, Event* event);
void onTouchesZoomOutEnd(Touch* touch, Event* event);
bool onTouchesZoomIn(Touch* touch, Event* event);
void onTouchesZoomInEnd(Touch* touch, Event* event);
bool onTouchesCommon(cocos2d::Touch* touch, cocos2d::Event* event, bool* touchProperty);
bool onTouchesZoomOut(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesZoomOutEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesZoomIn(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesZoomInEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesRotateLeft(Touch* touch, Event* event);
void onTouchesRotateLeftEnd(Touch* touch, Event* event);
bool onTouchesRotateRight(Touch* touch, Event* event);
void onTouchesRotateRightEnd(Touch* touch, Event* event);
bool onTouchesRotateLeft(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesRotateLeftEnd(cocos2d::Touch* touch, cocos2d::Event* event);
bool onTouchesRotateRight(cocos2d::Touch* touch, cocos2d::Event* event);
void onTouchesRotateRightEnd(cocos2d::Touch* touch, cocos2d::Event* event);
protected:
std::string _title;
Layer* _layer3D;
Sprite3D* _sprite3D;
Vec3 _targetPos;
cocos2d::Layer* _layer3D;
cocos2d::Sprite3D* _sprite3D;
cocos2d::Vec3 _targetPos;
CameraType _cameraType;
MenuItem* _incRot;
MenuItem* _decRot;
cocos2d::MenuItem* _incRot;
cocos2d::MenuItem* _decRot;
unsigned int _curState;
Camera* _camera;
MoveTo* _moveAction;
cocos2d::Camera* _camera;
cocos2d::MoveTo* _moveAction;
bool _bZoomOut;
bool _bZoomIn;
bool _bRotateLeft;
bool _bRotateRight;
Label* _RotateRightlabel;
Label* _RotateLeftlabel;
Label* _ZoomInlabel;
Label* _ZoomOutlabel;
cocos2d::Label* _RotateRightlabel;
cocos2d::Label* _RotateLeftlabel;
cocos2d::Label* _ZoomInlabel;
cocos2d::Label* _ZoomOutlabel;
};
class CameraCullingDemo : public CameraBaseTest
@ -166,22 +166,22 @@ public:
// overrides
virtual std::string title() const override;
void reachEndCallBack();
void switchViewCallback(Ref* sender);
void addSpriteCallback(Ref* sender);
void delSpriteCallback(Ref* sender);
void switchViewCallback(cocos2d::Ref* sender);
void addSpriteCallback(cocos2d::Ref* sender);
void delSpriteCallback(cocos2d::Ref* sender);
void drawCameraFrustum();
protected:
Label* _labelSprite3DCount;
Layer* _layer3D;
std::vector<Sprite3D*> _objects;
cocos2d::Label* _labelSprite3DCount;
cocos2d::Layer* _layer3D;
std::vector<cocos2d::Sprite3D*> _objects;
CameraType _cameraType;
Camera* _cameraFirst;
Camera* _cameraThird;
MoveBy* _moveAction;
DrawNode3D* _drawAABB;
DrawNode3D* _drawFrustum;
cocos2d::Camera* _cameraFirst;
cocos2d::Camera* _cameraThird;
cocos2d::MoveBy* _moveAction;
cocos2d::DrawNode3D* _drawAABB;
cocos2d::DrawNode3D* _drawFrustum;
int _row;
};
@ -200,26 +200,26 @@ public:
// overrides
virtual std::string title() const override;
void switchOperateCallback(Ref* sender);
void switchTargetCallback(Ref* sender);
void switchOperateCallback(cocos2d::Ref* sender);
void switchTargetCallback(cocos2d::Ref* sender);
void onTouchsMoved(const std::vector<cocos2d::Touch*> &touchs, cocos2d::Event *event);
void updateCameraTransform();
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
protected:
Layer* _layer3D;
cocos2d::Layer* _layer3D;
CameraType _cameraType;
Camera* _camera;
DrawNode3D* _drawGrid;
Quaternion _rotationQuat; //rotation Quaternion
cocos2d::Camera* _camera;
cocos2d::DrawNode3D* _drawGrid;
cocos2d::Quaternion _rotationQuat; //rotation Quaternion
float _radius; //arc ball radius
float _distanceZ;
OperateCamType _operate; //switch rotate or zoom
Vec3 _center; //camera look target
cocos2d::Vec3 _center; //camera look target
int _target; //switch camera look target
Sprite3D* _sprite3D1;
Sprite3D* _sprite3D2;
cocos2d::Sprite3D* _sprite3D1;
cocos2d::Sprite3D* _sprite3D2;
};
class FogTestDemo : public CameraBaseTest
@ -237,21 +237,21 @@ public:
// overrides
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:
Layer* _layer3D;
cocos2d::Layer* _layer3D;
CameraType _cameraType;
Camera* _camera;
Sprite3D* _sprite3D1;
Sprite3D* _sprite3D2;
GLProgram* _shader;
GLProgramState* _state;
cocos2d::Camera* _camera;
cocos2d::Sprite3D* _sprite3D1;
cocos2d::Sprite3D* _sprite3D2;
cocos2d::GLProgram* _shader;
cocos2d::GLProgramState* _state;
#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
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,11 +22,11 @@ public:
virtual std::string title() 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:
void onDraw(const Mat4 &transform, uint32_t flags);
CustomCommand _customCommand;
void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
cocos2d::CustomCommand _customCommand;
};
class DrawNodeTest : public DrawPrimitivesBaseTest

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ public:
virtual void onEnter() 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:
ActionTimeline* action;

View File

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

View File

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

View File

@ -16,7 +16,7 @@ public:
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 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::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName);
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);
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::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);
void onCallback1(Node* sender);

View File

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

View File

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

View File

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

View File

@ -1,8 +1,6 @@
#include "../CCControlScene.h"
#include "extensions/cocos-ext.h"
USING_NS_CC_EXT;
class ControlColourPickerTest : public ControlScene
{
public:
@ -10,9 +8,9 @@ public:
virtual ~ControlColourPickerTest();
virtual bool init() override;
/** 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)
};

View File

@ -33,9 +33,9 @@ public:
ControlPotentiometerTest();
virtual ~ControlPotentiometerTest();
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)
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,7 +40,7 @@ protected:
TestCocosNodeDemo();
virtual ~TestCocosNodeDemo();
Director::Projection _preProjection;
cocos2d::Director::Projection _preProjection;
};
class NodeTest2 : public TestCocosNodeDemo
@ -208,8 +208,8 @@ public:
protected:
CameraTest1();
Sprite *_sprite1;
Sprite *_sprite2;
cocos2d::Sprite* _sprite1;
cocos2d::Sprite* _sprite2;
};
class CameraTest2 : public TestCocosNodeDemo
@ -224,15 +224,15 @@ public:
protected:
CameraTest2();
Sprite *_sprite1;
Sprite *_sprite2;
cocos2d::Sprite* _sprite1;
cocos2d::Sprite* _sprite2;
};
class ConvertToNode : public TestCocosNodeDemo
{
public:
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 subtitle() const override;
@ -273,7 +273,7 @@ public:
protected:
NodeGlobalZValueTest();
Sprite *_sprite;
cocos2d::Sprite* _sprite;
};
class NodeNormalizedPositionTest1 : public TestCocosNodeDemo
@ -298,7 +298,7 @@ protected:
NodeNormalizedPositionTest2();
void update(float dt) override;
Size _copyContentSize;
cocos2d::Size _copyContentSize;
float _accum;
};
@ -314,7 +314,7 @@ protected:
void update(float dt) override;
float _accum;
Sprite *sprite;
cocos2d::Sprite* sprite;
};
class NodeNameTest : public TestCocosNodeDemo

View File

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

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