2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_NODE_CHILDREN_TEST_H__
|
|
|
|
#define __PERFORMANCE_NODE_CHILDREN_TEST_H__
|
|
|
|
|
|
|
|
#include "PerformanceTest.h"
|
|
|
|
#include "support/CCProfiling.h"
|
|
|
|
|
|
|
|
class NodeChildrenMenuLayer : public PerformBasicLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NodeChildrenMenuLayer(bool bControlMenuVisible, int nMaxCases = 0, int nCurCase = 0);
|
|
|
|
virtual void showCurrentTest();
|
2013-08-21 05:18:32 +08:00
|
|
|
void dumpProfilerInfo(float dt);
|
|
|
|
|
|
|
|
// overrides
|
|
|
|
virtual void onExitTransitionDidStart() override;
|
|
|
|
virtual void onEnterTransitionDidFinish() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
class NodeChildrenMainScene : public Scene
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void updateQuantityOfNodes() = 0;
|
|
|
|
|
|
|
|
void updateQuantityLabel();
|
|
|
|
|
|
|
|
int getQuantityOfNodes() { return quantityOfNodes; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int lastRenderedCount;
|
|
|
|
int quantityOfNodes;
|
|
|
|
int currentQuantityOfNodes;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheet : public NodeChildrenMainScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~IterateSpriteSheet();
|
|
|
|
virtual void updateQuantityOfNodes();
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt) = 0;
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
SpriteBatchNode *batchNode;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-08-21 05:18:32 +08:00
|
|
|
class IterateSpriteSheetForLoop : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void update(float dt);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual const char* profilerName();
|
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheetIterator : public IterateSpriteSheet
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class IterateSpriteSheetCArray : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class AddRemoveSpriteSheet : public NodeChildrenMainScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~AddRemoveSpriteSheet();
|
|
|
|
virtual void updateQuantityOfNodes();
|
|
|
|
virtual void initWithQuantityOfNodes(unsigned int nNodes);
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt) = 0;
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2013-06-20 14:17:10 +08:00
|
|
|
SpriteBatchNode *batchNode;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
#if CC_ENABLE_PROFILERS
|
2013-06-20 14:17:10 +08:00
|
|
|
ProfilingTimer* _profilingTimer;
|
2012-04-19 14:35:52 +08:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2013-08-23 09:21:52 +08:00
|
|
|
///
|
|
|
|
|
|
|
|
class CallFuncsSpriteSheetForEach : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void update(float dt);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual const char* profilerName();
|
|
|
|
};
|
|
|
|
|
|
|
|
class CallFuncsSpriteSheetCMacro : public IterateSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void update(float dt);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual const char* profilerName();
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class AddSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
2013-08-25 01:56:07 +08:00
|
|
|
class GetSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void update(float dt);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual const char* profilerName();
|
|
|
|
};
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class RemoveSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ReorderSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2012-06-08 13:55:28 +08:00
|
|
|
virtual void update(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
virtual std::string title();
|
2011-03-25 13:59:08 +08:00
|
|
|
virtual std::string subtitle();
|
2013-03-25 11:47:27 +08:00
|
|
|
virtual const char* profilerName();
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-08-24 04:14:57 +08:00
|
|
|
class SortAllChildrenSpriteSheet : public AddRemoveSpriteSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void update(float dt);
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual const char* profilerName();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
void runNodeChildrenTest();
|
|
|
|
|
|
|
|
#endif // __PERFORMANCE_NODE_CHILDREN_TEST_H__
|