2014-02-10 11:42:15 +08:00
|
|
|
#ifndef __PERFORMANCE_SCENARIO_TEST_H__
|
|
|
|
#define __PERFORMANCE_SCENARIO_TEST_H__
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
#include "BaseTest.h"
|
2014-02-10 11:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
DEFINE_TEST_SUITE(PerformceScenarioTests);
|
2014-02-10 11:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
class ScenarioTest : public TestCase
|
2014-02-10 11:42:15 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(ScenarioTest);
|
2014-02-10 11:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
virtual bool init() override;
|
2014-02-10 11:42:15 +08:00
|
|
|
virtual std::string title() const override;
|
2015-05-11 16:26:14 +08:00
|
|
|
virtual void performTests();
|
2014-02-10 11:42:15 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event) ;
|
2014-02-12 16:14:04 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
static cocos2d::Scene* scene();
|
2014-02-10 11:42:15 +08:00
|
|
|
|
|
|
|
private:
|
2014-02-12 16:14:04 +08:00
|
|
|
void addNewSprites(int num);
|
2014-02-10 11:42:15 +08:00
|
|
|
void removeSprites();
|
|
|
|
|
|
|
|
void addParticles();
|
|
|
|
void removeParticles();
|
|
|
|
|
2014-02-12 16:14:04 +08:00
|
|
|
void addParticleSystem(int num);
|
|
|
|
void removeParticleSystem();
|
|
|
|
|
2014-02-10 11:42:15 +08:00
|
|
|
private:
|
2014-02-12 16:14:04 +08:00
|
|
|
static int _initParticleNum;
|
|
|
|
static int _parStepNum;
|
|
|
|
static int _initSpriteNum;
|
|
|
|
static int _spriteStepNum;
|
|
|
|
static int _initParsysNum;
|
|
|
|
static int _parsysStepNum;
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::TMXTiledMap* _map1;
|
|
|
|
cocos2d::TMXTiledMap* _map2;
|
2014-02-12 16:14:04 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::MenuItemToggle* _itemToggle;
|
|
|
|
cocos2d::Vector<cocos2d::Sprite*> _spriteArray;
|
|
|
|
cocos2d::Vector<cocos2d::ParticleSystemQuad*> _parsysArray;
|
|
|
|
cocos2d::Label* _spriteLabel;
|
|
|
|
cocos2d::Label* _particleLabel;
|
|
|
|
cocos2d::Label* _parsysLabel;
|
2014-02-10 11:42:15 +08:00
|
|
|
int _particleNumber;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|