mirror of https://github.com/axmolengine/axmol.git
Merge pull request #4653 from dabingnn/develop_FixTestCase_ArmatureSceneTest
Develop fix test case armature scene test
This commit is contained in:
commit
599aabc55b
|
@ -2,6 +2,8 @@
|
|||
#include "../../testResource.h"
|
||||
#include "cocostudio/CocoStudio.h"
|
||||
#include "CCNodeGrid.h"
|
||||
#include "renderer/CCRenderer.h"
|
||||
#include "renderer/CCCustomCommand.h"
|
||||
|
||||
|
||||
using namespace cocos2d;
|
||||
|
@ -228,11 +230,6 @@ void ArmatureTestLayer::backCallback(Object *pSender)
|
|||
Director::getInstance()->replaceScene(s);
|
||||
s->release();
|
||||
}
|
||||
void ArmatureTestLayer::draw()
|
||||
{
|
||||
Layer::draw();
|
||||
}
|
||||
|
||||
|
||||
void TestAsynchronousLoading::onEnter()
|
||||
{
|
||||
|
@ -1097,16 +1094,24 @@ std::string TestBoundingBox::title() const
|
|||
}
|
||||
void TestBoundingBox::draw()
|
||||
{
|
||||
CC_NODE_DRAW_SETUP();
|
||||
CustomCommand *cmd = CustomCommand::getCommandPool().generateCommand();
|
||||
cmd->init(0, _vertexZ);
|
||||
cmd->func = CC_CALLBACK_0(TestBoundingBox::onDraw, this);
|
||||
Director::getInstance()->getRenderer()->addCommand(cmd);
|
||||
|
||||
}
|
||||
|
||||
void TestBoundingBox::onDraw()
|
||||
{
|
||||
getShaderProgram()->use();
|
||||
getShaderProgram()->setUniformsForBuiltins(_modelViewTransform);
|
||||
|
||||
rect = armature->getBoundingBox();
|
||||
|
||||
|
||||
DrawPrimitives::setDrawColor4B(100, 100, 100, 255);
|
||||
DrawPrimitives::drawRect(rect.origin, Point(rect.getMaxX(), rect.getMaxY()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TestAnchorPoint::onEnter()
|
||||
{
|
||||
ArmatureTestLayer::onEnter();
|
||||
|
|
|
@ -62,7 +62,6 @@ public:
|
|||
// overrides
|
||||
virtual void onEnter() override;
|
||||
virtual void onExit() override;
|
||||
virtual void draw() override;
|
||||
|
||||
protected:
|
||||
MenuItemImage *restartItem;
|
||||
|
@ -296,6 +295,8 @@ public:
|
|||
|
||||
cocostudio::Armature *armature;
|
||||
Rect rect;
|
||||
protected:
|
||||
void onDraw();
|
||||
};
|
||||
|
||||
class TestAnchorPoint : public ArmatureTestLayer
|
||||
|
|
Loading…
Reference in New Issue