mirror of https://github.com/axmolengine/axmol.git
Add Test Case: LayerColor should not occlude sprites and labels when depth test is true
This commit is contained in:
parent
b454bf01e3
commit
1b339a4635
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue