2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_TEST_H__
|
|
|
|
#define __PERFORMANCE_TEST_H__
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
class PerformanceMainLayer : public cocos2d::Layer
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2014-01-15 11:27:57 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
bool onTouchBegan(cocos2d::Touch* touches, cocos2d::Event* event) override;
|
|
|
|
void onTouchMoved(cocos2d::Touch* touches, cocos2d::Event* event) override;
|
2014-01-15 11:27:57 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void onMouseScroll(cocos2d::Event* event);
|
2014-01-15 11:27:57 +08:00
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Vec2 _beginPos;
|
|
|
|
cocos2d::Menu* _itemMenu;
|
2014-02-10 11:42:15 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
static cocos2d::Vec2 _CurrentPos;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
class PerformBasicLayer : public cocos2d::Layer
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
PerformBasicLayer(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0);
|
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void restartCallback(cocos2d::Ref* sender);
|
|
|
|
virtual void nextCallback(cocos2d::Ref* sender);
|
|
|
|
virtual void backCallback(cocos2d::Ref* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void showCurrentTest() = 0;
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void toMainLayer(cocos2d::Ref* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2013-06-15 14:03:30 +08:00
|
|
|
bool _controlMenuVisible;
|
|
|
|
int _maxCases;
|
|
|
|
int _curCase;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class PerformanceTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|