mirror of https://github.com/axmolengine/axmol.git
Update CCDrawNode, remove condition MACRO
This commit is contained in:
parent
d47a79c0e4
commit
9ec451ca31
|
@ -104,13 +104,7 @@ static inline Tex2F __t(const Vec2 &v)
|
||||||
|
|
||||||
// implementation of DrawNode
|
// implementation of DrawNode
|
||||||
|
|
||||||
#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only
|
DrawNode::DrawNode(int lineWidth)
|
||||||
static const int DEFAULT_LINE_WIDTH = 1;
|
|
||||||
#else
|
|
||||||
static const int DEFAULT_LINE_WIDTH = 2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DrawNode::DrawNode()
|
|
||||||
: _vao(0)
|
: _vao(0)
|
||||||
, _vbo(0)
|
, _vbo(0)
|
||||||
, _vaoGLPoint(0)
|
, _vaoGLPoint(0)
|
||||||
|
@ -129,7 +123,8 @@ DrawNode::DrawNode()
|
||||||
, _dirty(false)
|
, _dirty(false)
|
||||||
, _dirtyGLPoint(false)
|
, _dirtyGLPoint(false)
|
||||||
, _dirtyGLLine(false)
|
, _dirtyGLLine(false)
|
||||||
, _lineWidth(DEFAULT_LINE_WIDTH)
|
, _lineWidth(lineWidth)
|
||||||
|
, _defaultLineWidth(lineWidth)
|
||||||
, _lineSmoothEnable(false)
|
, _lineSmoothEnable(false)
|
||||||
{
|
{
|
||||||
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
|
||||||
|
@ -943,7 +938,7 @@ void DrawNode::clear()
|
||||||
_dirtyGLLine = true;
|
_dirtyGLLine = true;
|
||||||
_bufferCountGLPoint = 0;
|
_bufferCountGLPoint = 0;
|
||||||
_dirtyGLPoint = true;
|
_dirtyGLPoint = true;
|
||||||
_lineWidth = DEFAULT_LINE_WIDTH;
|
_lineWidth = _defaultLineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlendFunc& DrawNode::getBlendFunc() const
|
const BlendFunc& DrawNode::getBlendFunc() const
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
static const int DEFAULT_LINE_WIDTH = 2;
|
||||||
|
|
||||||
class PointArray;
|
class PointArray;
|
||||||
/**
|
/**
|
||||||
* @addtogroup _2d
|
* @addtogroup _2d
|
||||||
|
@ -323,7 +325,7 @@ public:
|
||||||
float getLineWidth();
|
float getLineWidth();
|
||||||
|
|
||||||
CC_CONSTRUCTOR_ACCESS:
|
CC_CONSTRUCTOR_ACCESS:
|
||||||
DrawNode();
|
DrawNode(int lineWidth = DEFAULT_LINE_WIDTH);
|
||||||
virtual ~DrawNode();
|
virtual ~DrawNode();
|
||||||
virtual bool init() override;
|
virtual bool init() override;
|
||||||
|
|
||||||
|
@ -365,7 +367,7 @@ protected:
|
||||||
int _lineWidth;
|
int _lineWidth;
|
||||||
|
|
||||||
bool _lineSmoothEnable;
|
bool _lineSmoothEnable;
|
||||||
|
int _defaultLineWidth;
|
||||||
private:
|
private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
|
CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue