2013-11-05 01:14:22 +08:00
|
|
|
#ifndef __NewRendererTest_H_
|
|
|
|
#define __NewRendererTest_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
2013-11-13 03:53:53 +08:00
|
|
|
#define kTagSpriteBatchNode 100
|
2013-11-16 03:29:11 +08:00
|
|
|
#define kTagClipperNode 101
|
|
|
|
#define kTagContentNode 102
|
2013-11-13 03:53:53 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(NewRendererTests);
|
2013-11-13 03:19:18 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class MultiSceneTest : public TestCase
|
2013-11-13 03:19:18 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-27 08:54:48 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class NewSpriteTest : public MultiSceneTest
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewSpriteTest);
|
2013-11-13 03:19:18 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
void createSpriteTest();
|
|
|
|
void createNewSpriteTest();
|
2015-04-09 08:37:30 +08:00
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewSpriteTest();
|
|
|
|
virtual ~NewSpriteTest();
|
2013-11-05 01:14:22 +08:00
|
|
|
};
|
|
|
|
|
2014-04-07 22:02:43 +08:00
|
|
|
class GroupCommandTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(GroupCommandTest);
|
|
|
|
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
GroupCommandTest();
|
|
|
|
virtual ~GroupCommandTest();
|
|
|
|
};
|
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
class NewClippingNodeTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewClippingNodeTest);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-15 08:39:03 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
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);
|
2013-11-16 03:29:11 +08:00
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewClippingNodeTest();
|
|
|
|
virtual ~NewClippingNodeTest();
|
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
bool _scrolling;
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Vec2 _lastPoint;
|
2013-11-16 03:29:11 +08:00
|
|
|
};
|
2013-11-15 08:39:03 +08:00
|
|
|
|
2013-11-20 05:57:39 +08:00
|
|
|
class NewDrawNodeTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewDrawNodeTest)
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-20 05:57:39 +08:00
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewDrawNodeTest();
|
|
|
|
virtual ~NewDrawNodeTest();
|
2013-11-20 05:57:39 +08:00
|
|
|
};
|
|
|
|
|
2013-11-27 10:35:23 +08:00
|
|
|
class NewCullingTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CREATE_FUNC(NewCullingTest)
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-27 10:35:23 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
NewCullingTest();
|
|
|
|
virtual ~NewCullingTest();
|
2015-04-09 08:37:30 +08:00
|
|
|
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event *event);
|
|
|
|
void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event *event);
|
|
|
|
cocos2d::Vec2 _lastPos;
|
2013-11-27 10:35:23 +08:00
|
|
|
};
|
|
|
|
|
2014-01-15 09:03:54 +08:00
|
|
|
class VBOFullTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(VBOFullTest);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
VBOFullTest();
|
|
|
|
virtual ~VBOFullTest();
|
|
|
|
};
|
|
|
|
|
2014-05-13 16:23:35 +08:00
|
|
|
class CaptureScreenTest : public MultiSceneTest
|
|
|
|
{
|
2014-05-26 16:32:13 +08:00
|
|
|
static const int childTag = 119;
|
2014-05-13 16:23:35 +08:00
|
|
|
public:
|
2014-05-13 17:17:15 +08:00
|
|
|
CREATE_FUNC(CaptureScreenTest);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-05-13 16:23:35 +08:00
|
|
|
|
|
|
|
protected:
|
2014-05-13 17:17:15 +08:00
|
|
|
CaptureScreenTest();
|
|
|
|
~CaptureScreenTest();
|
2014-05-13 16:23:35 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void onCaptured(cocos2d::Ref*);
|
2014-05-14 01:06:26 +08:00
|
|
|
void afterCaptured(bool succeed, const std::string& outputFile);
|
2014-05-13 16:23:35 +08:00
|
|
|
|
2014-05-14 01:06:26 +08:00
|
|
|
std::string _filename;
|
2014-05-13 16:23:35 +08:00
|
|
|
};
|
|
|
|
|
2013-11-05 01:14:22 +08:00
|
|
|
#endif //__NewRendererTest_H_
|