Add Test Case: LayerColor should not occlude sprites and labels when depth test is true

This commit is contained in:
Huabing.Xu 2014-01-09 14:50:29 +08:00
parent b454bf01e3
commit 1b339a4635
2 changed files with 38 additions and 0 deletions

View File

@ -25,6 +25,7 @@ static std::function<Layer*()> createFunctions[] = {
CL(LayerExtendedBlendOpacityTest),
CL(LayerBug3162A),
CL(LayerBug3162B),
CL(LayerColorOccludeBug),
};
static int sceneIdx=-1;
@ -954,3 +955,27 @@ std::string LayerBug3162B::subtitle() const
{
return "u and m layer color is effected/diseffected with b layer";
}
std::string LayerColorOccludeBug::title() const
{
return "Layer Color Occlude Bug Test";
}
std::string LayerColorOccludeBug::subtitle() const
{
return "Layer Color Should not occlude titles and any sprites";
}
void LayerColorOccludeBug::onEnter()
{
LayerTest::onEnter();
Director::getInstance()->setDepthTest(true);
_layer = LayerColor::create(Color4B(0, 80, 95, 255));
addChild(_layer);
}
void LayerColorOccludeBug::onExit()
{
LayerTest::onExit();
Director::getInstance()->setDepthTest(false);
}

View File

@ -202,6 +202,19 @@ private:
LayerColor* _layer[3];
};
class LayerColorOccludeBug : public LayerTest
{
public:
CREATE_FUNC(LayerColorOccludeBug);
virtual void onEnter() override;
virtual void onExit() override;
virtual std::string title() const override;
virtual std::string subtitle() const override;
private:
LayerColor* _layer;
};
class LayerTestScene : public TestScene
{
public: