mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12586 from fusijie/add-autoculling-bug-testcase
add auto culling test case.
This commit is contained in:
commit
265c9b55e0
|
@ -35,6 +35,7 @@ NewRendererTests::NewRendererTests()
|
|||
ADD_TEST_CASE(NewCullingTest);
|
||||
ADD_TEST_CASE(VBOFullTest);
|
||||
ADD_TEST_CASE(CaptureScreenTest);
|
||||
ADD_TEST_CASE(BugAutoCulling)
|
||||
};
|
||||
|
||||
std::string MultiSceneTest::title() const
|
||||
|
@ -475,3 +476,33 @@ void CaptureScreenTest::afterCaptured(bool succeed, const std::string& outputFil
|
|||
log("Capture screen failed.");
|
||||
}
|
||||
}
|
||||
|
||||
BugAutoCulling::BugAutoCulling()
|
||||
{
|
||||
Size s = Director::getInstance()->getWinSize();
|
||||
for (int i=0; i<100; i++) {
|
||||
auto sprite = Sprite::create("Images/grossini.png");
|
||||
sprite->setPosition(s.width/2 + s.width/10 * i, s.height/2);
|
||||
this->addChild(sprite);
|
||||
}
|
||||
this->scheduleOnce([=](float){
|
||||
auto camera = Director::getInstance()->getRunningScene()->getCameras().front();
|
||||
auto move = MoveBy::create(2.0, Vec2(2 * s.width, 0));
|
||||
camera->runAction(Sequence::create(move, move->reverse(),nullptr));
|
||||
}, 1.0f, "lambda-autoculling-bug");
|
||||
}
|
||||
|
||||
BugAutoCulling::~BugAutoCulling()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string BugAutoCulling::title() const
|
||||
{
|
||||
return "Bug-AutoCulling";
|
||||
}
|
||||
|
||||
std::string BugAutoCulling::subtitle() const
|
||||
{
|
||||
return "Moving the camera to the right instead of moving the layer";
|
||||
}
|
|
@ -129,4 +129,15 @@ protected:
|
|||
std::string _filename;
|
||||
};
|
||||
|
||||
class BugAutoCulling : public MultiSceneTest
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(BugAutoCulling);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
protected:
|
||||
BugAutoCulling();
|
||||
virtual ~BugAutoCulling();
|
||||
};
|
||||
|
||||
#endif //__NewRendererTest_H_
|
||||
|
|
Loading…
Reference in New Issue