From dd6c14e88d358f583914a20e850a7e9e233150e7 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Wed, 27 Nov 2013 10:35:23 +0800 Subject: [PATCH] add test case --- .../NewRendererTest/NewRendererTest.cpp | 34 +++++++++++++++++++ .../Classes/NewRendererTest/NewRendererTest.h | 13 +++++++ 2 files changed, 47 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp index 6b24656607..8eaafe1a58 100644 --- a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.cpp @@ -21,6 +21,7 @@ static std::function createFunctions[] = CL(NewSpriteBatchTest), CL(NewClippingNodeTest), CL(NewDrawNodeTest), + CL(NewCullingTest), }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -401,3 +402,36 @@ string NewDrawNodeTest::subtitle() { return "DrawNode"; } + +NewCullingTest::NewCullingTest() +{ + auto s = Director::getInstance()->getWinSize(); + + auto parent = Node::create(); + parent->setPosition(s.width/2, s.height/2); + addChild(parent); + auto parent2 = Node::create(); + parent2->setPosition(0,0); + parent->addChild(parent2); + parent2->runAction(RepeatForever::create((JumpBy::create(2, Point(0,0), 300, 1)))); + NewSprite* sprite = NewSprite::create("Images/grossini.png"); + sprite->setPosition(Point(0,0)); + sprite->runAction(RepeatForever::create(RotateBy::create(3, 360))); + parent2->addChild(sprite); +} + +NewCullingTest::~NewCullingTest() +{ + +} + +string NewCullingTest::title() +{ + return "New Render"; +} + +string NewCullingTest::subtitle() +{ + return "Culling"; +} + diff --git a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h index 17d3cd0267..5e0bf64e61 100644 --- a/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h +++ b/samples/Cpp/TestCpp/Classes/NewRendererTest/NewRendererTest.h @@ -107,4 +107,17 @@ protected: virtual ~NewDrawNodeTest(); }; +class NewCullingTest : public MultiSceneTest +{ +public: + + CREATE_FUNC(NewCullingTest) + virtual string title(); + virtual string subtitle(); + +protected: + NewCullingTest(); + virtual ~NewCullingTest(); +}; + #endif //__NewRendererTest_H_