Update CCDrawNode, remove condition MACRO

This commit is contained in:
XiaoFeng 2015-11-25 23:26:57 +08:00
parent d47a79c0e4
commit 9ec451ca31
2 changed files with 8 additions and 11 deletions

View File

@ -104,13 +104,7 @@ static inline Tex2F __t(const Vec2 &v)
// implementation of DrawNode
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
static const int DEFAULT_LINE_WIDTH = 1;
#else
static const int DEFAULT_LINE_WIDTH = 2;
#endif
DrawNode::DrawNode()
DrawNode::DrawNode(int lineWidth)
: _vao(0)
, _vbo(0)
, _vaoGLPoint(0)
@ -129,7 +123,8 @@ DrawNode::DrawNode()
, _dirty(false)
, _dirtyGLPoint(false)
, _dirtyGLLine(false)
, _lineWidth(DEFAULT_LINE_WIDTH)
, _lineWidth(lineWidth)
, _defaultLineWidth(lineWidth)
, _lineSmoothEnable(false)
{
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
@ -943,7 +938,7 @@ void DrawNode::clear()
_dirtyGLLine = true;
_bufferCountGLPoint = 0;
_dirtyGLPoint = true;
_lineWidth = DEFAULT_LINE_WIDTH;
_lineWidth = _defaultLineWidth;
}
const BlendFunc& DrawNode::getBlendFunc() const

View File

@ -38,6 +38,8 @@
NS_CC_BEGIN
static const int DEFAULT_LINE_WIDTH = 2;
class PointArray;
/**
* @addtogroup _2d
@ -323,7 +325,7 @@ public:
float getLineWidth();
CC_CONSTRUCTOR_ACCESS:
DrawNode();
DrawNode(int lineWidth = DEFAULT_LINE_WIDTH);
virtual ~DrawNode();
virtual bool init() override;
@ -365,7 +367,7 @@ protected:
int _lineWidth;
bool _lineSmoothEnable;
int _defaultLineWidth;
private:
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
};