Cleanup order of fields initialization.

Make initialization order to match declarations.
This change twice reduces number of warnings when compiling on MacOS X with Xcode 6.1
Warnings was like "Field 'XXXX' will be initialized after field 'YYYY'"
This commit is contained in:
Vladimir Timofeev 2014-10-30 17:25:46 +03:00
parent e99ea7a9fe
commit 2835b094da
38 changed files with 142 additions and 142 deletions

View File

@ -66,9 +66,9 @@ Camera* Camera::createOrthographic(float zoomX, float zoomY, float nearPlane, fl
} }
Camera::Camera() Camera::Camera()
: _cameraFlag(1) : _scene(nullptr)
, _scene(nullptr)
, _viewProjectionDirty(true) , _viewProjectionDirty(true)
, _cameraFlag(1)
{ {
} }

View File

@ -106,23 +106,23 @@ static inline Tex2F __t(const Vec2 &v)
DrawNode::DrawNode() DrawNode::DrawNode()
: _vao(0) : _vao(0)
, _vbo(0) , _vbo(0)
, _vaoGLPoint(0)
, _vboGLPoint(0)
, _vaoGLLine(0)
, _vboGLLine(0)
, _bufferCapacity(0) , _bufferCapacity(0)
, _bufferCount(0) , _bufferCount(0)
, _buffer(nullptr) , _buffer(nullptr)
, _dirty(false)
, _vaoGLPoint(0)
, _vboGLPoint(0)
, _bufferCapacityGLPoint(0) , _bufferCapacityGLPoint(0)
, _bufferCountGLPoint(0) , _bufferCountGLPoint(0)
, _bufferGLPoint(nullptr) , _bufferGLPoint(nullptr)
, _pointColor(1,1,1,1) , _pointColor(1,1,1,1)
, _pointSize(1) , _pointSize(1)
, _dirtyGLPoint(false)
, _vaoGLLine(0)
, _vboGLLine(0)
, _bufferCapacityGLLine(0) , _bufferCapacityGLLine(0)
, _bufferCountGLLine(0) , _bufferCountGLLine(0)
, _bufferGLLine(nullptr) , _bufferGLLine(nullptr)
, _dirty(false)
, _dirtyGLPoint(false)
, _dirtyGLLine(false) , _dirtyGLLine(false)
{ {
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;

View File

@ -113,11 +113,11 @@ TMXLayer::TMXLayer()
, _tiles(nullptr) , _tiles(nullptr)
, _tileSet(nullptr) , _tileSet(nullptr)
, _layerOrientation(FAST_TMX_ORIENTATION_ORTHO) , _layerOrientation(FAST_TMX_ORIENTATION_ORTHO)
,_texture(nullptr) , _texture(nullptr)
, _vertexZvalue(0) , _vertexZvalue(0)
, _useAutomaticVertexZ(false) , _useAutomaticVertexZ(false)
, _dirty(true)
, _quadsDirty(true) , _quadsDirty(true)
, _dirty(true)
, _vertexBuffer(nullptr) , _vertexBuffer(nullptr)
, _vData(nullptr) , _vData(nullptr)
, _indexBuffer(nullptr) , _indexBuffer(nullptr)

View File

@ -94,9 +94,9 @@ FT_Library FontFreeType::getFTLibrary()
FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */,int outline /* = 0 */) FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */,int outline /* = 0 */)
: _fontRef(nullptr) : _fontRef(nullptr)
,_distanceFieldEnabled(distanceFieldEnabled) , _stroker(nullptr)
,_outlineSize(0.0f) , _distanceFieldEnabled(distanceFieldEnabled)
,_stroker(nullptr) , _outlineSize(0.0f)
{ {
if (outline > 0) if (outline > 0)
{ {

View File

@ -235,30 +235,30 @@ bool Label::setCharMap(const std::string& charMapFile, int itemWidth, int itemHe
Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */, Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = TextHAlignment::LEFT */,
TextVAlignment vAlignment /* = TextVAlignment::TOP */,bool useDistanceField /* = false */,bool useA8Shader /* = false */) TextVAlignment vAlignment /* = TextVAlignment::TOP */,bool useDistanceField /* = false */,bool useA8Shader /* = false */)
: _reusedLetter(nullptr) : _isOpacityModifyRGB(false)
, _commonLineHeight(0.0f) , _contentDirty(false)
, _fontAtlas(atlas)
, _textSprite(nullptr)
, _compatibleMode(false)
, _reusedLetter(nullptr)
, _additionalKerning(0.0f) , _additionalKerning(0.0f)
, _commonLineHeight(0.0f)
, _lineBreakWithoutSpaces(false) , _lineBreakWithoutSpaces(false)
, _horizontalKernings(nullptr)
, _maxLineWidth(0) , _maxLineWidth(0)
, _labelDimensions(Size::ZERO)
, _labelWidth(0) , _labelWidth(0)
, _labelHeight(0) , _labelHeight(0)
, _labelDimensions(Size::ZERO)
, _hAlignment(hAlignment) , _hAlignment(hAlignment)
, _vAlignment(vAlignment) , _vAlignment(vAlignment)
, _horizontalKernings(nullptr) , _currNumLines(-1)
, _fontAtlas(atlas) , _fontScale(1.0f)
, _isOpacityModifyRGB(false)
, _useDistanceField(useDistanceField) , _useDistanceField(useDistanceField)
, _useA8Shader(useA8Shader) , _useA8Shader(useA8Shader)
, _fontScale(1.0f)
, _uniformEffectColor(0)
, _currNumLines(-1)
, _textSprite(nullptr)
, _contentDirty(false)
, _shadowDirty(false)
, _compatibleMode(false)
, _insideBounds(true)
, _effectColorF(Color4F::BLACK) , _effectColorF(Color4F::BLACK)
, _uniformEffectColor(0)
, _shadowDirty(false)
, _insideBounds(true)
{ {
setAnchorPoint(Vec2::ANCHOR_MIDDLE); setAnchorPoint(Vec2::ANCHOR_MIDDLE);
reset(); reset();

View File

@ -44,8 +44,8 @@ void BaseLight::setRotationFromDirection( const Vec3 &direction )
BaseLight::BaseLight() BaseLight::BaseLight()
: _intensity(1.0f) : _intensity(1.0f)
, _enabled(true)
, _lightFlag(LightFlag::LIGHT0) , _lightFlag(LightFlag::LIGHT0)
, _enabled(true)
{ {
} }

View File

@ -82,16 +82,18 @@ Node::Node(void)
, _scaleX(1.0f) , _scaleX(1.0f)
, _scaleY(1.0f) , _scaleY(1.0f)
, _scaleZ(1.0f) , _scaleZ(1.0f)
, _positionZ(0.0f)
, _position(Vec2::ZERO) , _position(Vec2::ZERO)
, _positionZ(0.0f)
, _usingNormalizedPosition(false)
, _normalizedPositionDirty(false)
, _skewX(0.0f) , _skewX(0.0f)
, _skewY(0.0f) , _skewY(0.0f)
, _anchorPointInPoints(Vec2::ZERO) , _anchorPointInPoints(Vec2::ZERO)
, _anchorPoint(Vec2::ZERO) , _anchorPoint(Vec2::ZERO)
, _contentSize(Size::ZERO) , _contentSize(Size::ZERO)
, _useAdditionalTransform(false)
, _transformDirty(true) , _transformDirty(true)
, _inverseDirty(true) , _inverseDirty(true)
, _useAdditionalTransform(false)
, _transformUpdated(true) , _transformUpdated(true)
// children (lazy allocs) // children (lazy allocs)
// lazy alloc // lazy alloc
@ -100,6 +102,8 @@ Node::Node(void)
, _parent(nullptr) , _parent(nullptr)
// "whole screen" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true // "whole screen" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true
, _tag(Node::INVALID_TAG) , _tag(Node::INVALID_TAG)
, _name("")
, _hashOfName(0)
// userData is always inited as nil // userData is always inited as nil
, _userData(nullptr) , _userData(nullptr)
, _userObject(nullptr) , _userObject(nullptr)
@ -125,10 +129,6 @@ Node::Node(void)
, _realColor(Color3B::WHITE) , _realColor(Color3B::WHITE)
, _cascadeColorEnabled(false) , _cascadeColorEnabled(false)
, _cascadeOpacityEnabled(false) , _cascadeOpacityEnabled(false)
, _usingNormalizedPosition(false)
, _normalizedPositionDirty(false)
, _name("")
, _hashOfName(0)
, _cameraMask(1) , _cameraMask(1)
{ {
// set default scheduler and actionManager // set default scheduler and actionManager

View File

@ -40,7 +40,11 @@ NS_CC_BEGIN
// implementation RenderTexture // implementation RenderTexture
RenderTexture::RenderTexture() RenderTexture::RenderTexture()
: _FBO(0) : _keepMatrix(false)
, _rtTextureRect(Rect::ZERO)
, _fullRect(Rect::ZERO)
, _fullviewPort(Rect::ZERO)
, _FBO(0)
, _depthRenderBufffer(0) , _depthRenderBufffer(0)
, _oldFBO(0) , _oldFBO(0)
, _texture(0) , _texture(0)
@ -53,10 +57,6 @@ RenderTexture::RenderTexture()
, _clearStencil(0) , _clearStencil(0)
, _autoDraw(false) , _autoDraw(false)
, _sprite(nullptr) , _sprite(nullptr)
, _keepMatrix(false)
, _rtTextureRect(Rect::ZERO)
, _fullRect(Rect::ZERO)
, _fullviewPort(Rect::ZERO)
, _saveFileCallback(nullptr) , _saveFileCallback(nullptr)
{ {
#if CC_ENABLE_CACHE_TEXTURE_DATA #if CC_ENABLE_CACHE_TEXTURE_DATA

View File

@ -259,10 +259,10 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated)
} }
Sprite::Sprite(void) Sprite::Sprite(void)
: _shouldBeHidden(false) : _batchNode(nullptr)
, _shouldBeHidden(false)
, _texture(nullptr) , _texture(nullptr)
, _insideBounds(true) , _insideBounds(true)
, _batchNode(nullptr)
{ {
#if CC_SPRITE_DEBUG_DRAW #if CC_SPRITE_DEBUG_DRAW
_debugDrawNode = DrawNode::create(); _debugDrawNode = DrawNode::create();

View File

@ -55,8 +55,8 @@ TextFieldTTF::TextFieldTTF()
, _charCount(0) , _charCount(0)
, _inputText("") , _inputText("")
, _placeHolder("") // prevent Label initWithString assertion , _placeHolder("") // prevent Label initWithString assertion
, _secureTextEntry(false)
, _colorText(Color4B::WHITE) , _colorText(Color4B::WHITE)
, _secureTextEntry(false)
{ {
_colorSpaceHolder.r = _colorSpaceHolder.g = _colorSpaceHolder.b = 127; _colorSpaceHolder.r = _colorSpaceHolder.g = _colorSpaceHolder.b = 127;
_colorSpaceHolder.a = 255; _colorSpaceHolder.a = 255;

View File

@ -247,13 +247,13 @@ void Animate3D::setWeight(float weight)
} }
Animate3D::Animate3D() Animate3D::Animate3D()
: _absSpeed(1.f) : _state(Animate3D::Animate3DState::Running)
, _animation(nullptr)
, _absSpeed(1.f)
, _weight(1.f) , _weight(1.f)
, _start(0.f) , _start(0.f)
, _last(1.f) , _last(1.f)
, _animation(nullptr)
, _playReverse(false) , _playReverse(false)
, _state(Animate3D::Animate3DState::Running)
, _accTransTime(0.0f) , _accTransTime(0.0f)
, _lastTime(0.0f) , _lastTime(0.0f)
{ {

View File

@ -103,8 +103,8 @@ float AnimationCurve<componentSize>::getEndTime() const
template <int componentSize> template <int componentSize>
AnimationCurve<componentSize>::AnimationCurve() AnimationCurve<componentSize>::AnimationCurve()
: _keytime(nullptr) : _value(nullptr)
, _value(nullptr) , _keytime(nullptr)
, _count(0) , _count(0)
, _componentSizeByte(0) , _componentSizeByte(0)
, _evaluateFun(nullptr) , _evaluateFun(nullptr)

View File

@ -2181,14 +2181,14 @@ Reference* Bundle3D::seekToFirstType(unsigned int type)
} }
Bundle3D::Bundle3D() Bundle3D::Bundle3D()
:_isBinary(false), : _modelPath(""),
_modelPath(""),
_path(""), _path(""),
_version(""), _version(""),
_jsonBuffer(nullptr), _jsonBuffer(nullptr),
_binaryBuffer(nullptr), _binaryBuffer(nullptr),
_referenceCount(0), _referenceCount(0),
_references(nullptr) _references(nullptr),
_isBinary(false)
{ {
} }

View File

@ -364,10 +364,10 @@ public:
} }
Animation3DData(const Animation3DData& other) Animation3DData(const Animation3DData& other)
: _totalTime(other._totalTime) : _translationKeys(other._translationKeys)
, _translationKeys(other._translationKeys)
, _rotationKeys(other._rotationKeys) , _rotationKeys(other._rotationKeys)
, _scaleKeys(other._scaleKeys) , _scaleKeys(other._scaleKeys)
, _totalTime(other._totalTime)
{ {
} }

View File

@ -36,14 +36,14 @@ using namespace std;
NS_CC_BEGIN NS_CC_BEGIN
Mesh::Mesh() Mesh::Mesh()
: _visible(true) : _texture(nullptr)
, _texture(nullptr)
, _skin(nullptr) , _skin(nullptr)
, _visible(true)
, _isTransparent(false)
, _meshIndexData(nullptr) , _meshIndexData(nullptr)
, _visibleChanged(nullptr)
, _glProgramState(nullptr) , _glProgramState(nullptr)
, _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED) , _blend(BlendFunc::ALPHA_NON_PREMULTIPLIED)
, _isTransparent(false) , _visibleChanged(nullptr)
{ {
} }

View File

@ -33,8 +33,8 @@ static int PALETTE_ROWS = 3;
MeshSkin::MeshSkin() MeshSkin::MeshSkin()
: _rootBone(nullptr) : _rootBone(nullptr)
, _matrixPalette(nullptr)
, _skeleton(nullptr) , _skeleton(nullptr)
, _matrixPalette(nullptr)
{ {
} }

View File

@ -30,8 +30,8 @@ NS_CC_BEGIN
EventController::EventController(ControllerEventType type, Controller* controller, int keyCode) EventController::EventController(ControllerEventType type, Controller* controller, int keyCode)
: Event(Type::GAME_CONTROLLER) : Event(Type::GAME_CONTROLLER)
, _controllerEventType(type) , _controllerEventType(type)
, _keyCode(keyCode)
, _controller(controller) , _controller(controller)
, _keyCode(keyCode)
, _isConnected(true) , _isConnected(true)
{ {
@ -41,8 +41,8 @@ EventController::EventController(ControllerEventType type, Controller* controlle
: Event(Type::GAME_CONTROLLER) : Event(Type::GAME_CONTROLLER)
, _controllerEventType(type) , _controllerEventType(type)
, _controller(controller) , _controller(controller)
, _isConnected(isConnected)
, _keyCode(0) , _keyCode(0)
, _isConnected(isConnected)
{ {
} }

View File

@ -30,8 +30,8 @@ NS_CC_BEGIN
EventFocus::EventFocus(ui::Widget *widgetLoseFocus, ui::Widget* widgetGetFocus) EventFocus::EventFocus(ui::Widget *widgetLoseFocus, ui::Widget* widgetGetFocus)
:Event(Type::FOCUS), :Event(Type::FOCUS),
_widgetLoseFocus(widgetLoseFocus), _widgetGetFocus(widgetGetFocus),
_widgetGetFocus(widgetGetFocus) _widgetLoseFocus(widgetLoseFocus)
{ {
} }

View File

@ -5,10 +5,10 @@ using namespace cocos2d;
namespace cocosbuilder { namespace cocosbuilder {
CCBKeyframe::CCBKeyframe() CCBKeyframe::CCBKeyframe()
: _time(0.0f) : _object(nullptr)
, _time(0.0f)
, _easingType(EasingType::INSTANT) , _easingType(EasingType::INSTANT)
, _easingOpt(0.0f) , _easingOpt(0.0f)
, _object(nullptr)
{} {}
CCBKeyframe::~CCBKeyframe() CCBKeyframe::~CCBKeyframe()

View File

@ -69,12 +69,12 @@ namespace cocostudio
WidgetReader::WidgetReader() WidgetReader::WidgetReader()
:_sizePercentX(0.0f), :_sizePercentX(0.0f),
_sizePercentY(0.0f), _sizePercentY(0.0f),
_isAdaptScreen(false),
_width(0.0f),
_height(0.0f),
_positionPercentX(0.0f), _positionPercentX(0.0f),
_positionPercentY(0.0f), _positionPercentY(0.0f),
_opacity(255) _width(0.0f),
_height(0.0f),
_opacity(255),
_isAdaptScreen(false)
{ {
valueToInt = [=](const std::string& str) -> int{ valueToInt = [=](const std::string& str) -> int{
return atoi(str.c_str()); return atoi(str.c_str());

View File

@ -222,15 +222,15 @@ enum WS_MSG {
WebSocket::WebSocket() WebSocket::WebSocket()
: _readyState(State::CONNECTING) : _readyState(State::CONNECTING)
, _port(80) , _port(80)
, _pendingFrameDataLen(0)
, _currentDataLen(0)
, _currentData(nullptr)
, _wsHelper(nullptr) , _wsHelper(nullptr)
, _wsInstance(nullptr) , _wsInstance(nullptr)
, _wsContext(nullptr) , _wsContext(nullptr)
, _delegate(nullptr) , _delegate(nullptr)
, _SSLConnection(0) , _SSLConnection(0)
, _wsProtocols(nullptr) , _wsProtocols(nullptr)
, _pendingFrameDataLen(0)
, _currentDataLen(0)
, _currentData(nullptr)
{ {
} }

View File

@ -48,16 +48,16 @@ NS_CC_BEGIN
// //
UniformValue::UniformValue() UniformValue::UniformValue()
: _useCallback(false) : _uniform(nullptr)
, _uniform(nullptr)
, _glprogram(nullptr) , _glprogram(nullptr)
, _useCallback(false)
{ {
} }
UniformValue::UniformValue(Uniform *uniform, GLProgram* glprogram) UniformValue::UniformValue(Uniform *uniform, GLProgram* glprogram)
: _useCallback(false) : _uniform(uniform)
, _uniform(uniform)
, _glprogram(glprogram) , _glprogram(glprogram)
, _useCallback(false)
{ {
} }
@ -182,15 +182,15 @@ void UniformValue::setMat4(const Mat4& value)
// //
VertexAttribValue::VertexAttribValue() VertexAttribValue::VertexAttribValue()
: _useCallback(false) : _vertexAttrib(nullptr)
, _vertexAttrib(nullptr) , _useCallback(false)
, _enabled(false) , _enabled(false)
{ {
} }
VertexAttribValue::VertexAttribValue(VertexAttrib *vertexAttrib) VertexAttribValue::VertexAttribValue(VertexAttrib *vertexAttrib)
: _useCallback(false) : _vertexAttrib(vertexAttrib)
, _vertexAttrib(vertexAttrib) , _useCallback(false)
, _enabled(false) , _enabled(false)
{ {
} }
@ -274,10 +274,10 @@ GLProgramState* GLProgramState::getOrCreateWithGLProgram(GLProgram *glprogram)
} }
GLProgramState::GLProgramState() GLProgramState::GLProgramState()
: _vertexAttribsFlags(0) : _uniformAttributeValueDirty(true)
, _glprogram(nullptr)
, _textureUnitIndex(1) , _textureUnitIndex(1)
, _uniformAttributeValueDirty(true) , _vertexAttribsFlags(0)
, _glprogram(nullptr)
{ {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
/** listen the event that renderer was recreated on Android/WP8 */ /** listen the event that renderer was recreated on Android/WP8 */

View File

@ -78,17 +78,17 @@ static const char *s_ambientLightUniformColorName = "u_AmbientLightSour
MeshCommand::MeshCommand() MeshCommand::MeshCommand()
: _textureID(0) : _textureID(0)
, _blendType(BlendFunc::DISABLE)
, _glProgramState(nullptr) , _glProgramState(nullptr)
, _cullFaceEnabled(false) , _blendType(BlendFunc::DISABLE)
, _cullFace(GL_BACK)
, _depthTestEnabled(false)
, _depthWriteEnabled(false)
, _displayColor(1.0f, 1.0f, 1.0f, 1.0f) , _displayColor(1.0f, 1.0f, 1.0f, 1.0f)
, _matrixPalette(nullptr) , _matrixPalette(nullptr)
, _matrixPaletteSize(0) , _matrixPaletteSize(0)
, _materialID(0) , _materialID(0)
, _vao(0) , _vao(0)
, _cullFaceEnabled(false)
, _cullFace(GL_BACK)
, _depthTestEnabled(false)
, _depthWriteEnabled(false)
, _lightMask(-1) , _lightMask(-1)
{ {
_type = RenderCommand::Type::MESH_COMMAND; _type = RenderCommand::Type::MESH_COMMAND;

View File

@ -56,10 +56,10 @@ VertexBuffer* VertexBuffer::create(int sizePerVertex, int vertexNumber)
} }
VertexBuffer::VertexBuffer() VertexBuffer::VertexBuffer()
: _vbo(0) : _recreateVBOEventListener(nullptr)
, _vertexNumber(0) , _vbo(0)
, _sizePerVertex(0) , _sizePerVertex(0)
, _recreateVBOEventListener(nullptr) , _vertexNumber(0)
{ {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)

View File

@ -35,17 +35,17 @@ class VertexBuffer;
struct CC_DLL VertexStreamAttribute struct CC_DLL VertexStreamAttribute
{ {
VertexStreamAttribute() VertexStreamAttribute()
: _offset(0),_semantic(0),_type(0),_size(0), _normalize(false) : _normalize(false),_offset(0),_semantic(0),_type(0),_size(0)
{ {
} }
VertexStreamAttribute(int offset, int semantic, int type, int size) VertexStreamAttribute(int offset, int semantic, int type, int size)
: _offset(offset),_semantic(semantic),_type(type),_size(size), _normalize(false) : _normalize(false),_offset(offset),_semantic(semantic),_type(type),_size(size)
{ {
} }
VertexStreamAttribute(int offset, int semantic, int type, int size, bool normalize) VertexStreamAttribute(int offset, int semantic, int type, int size, bool normalize)
: _offset(offset),_semantic(semantic),_type(type),_size(size), _normalize(normalize) : _normalize(normalize),_offset(offset),_semantic(semantic),_type(type),_size(size)
{ {
} }

View File

@ -46,6 +46,7 @@ _buttonNormalRenderer(nullptr),
_buttonClickedRenderer(nullptr), _buttonClickedRenderer(nullptr),
_buttonDisableRenderer(nullptr), _buttonDisableRenderer(nullptr),
_titleRenderer(nullptr), _titleRenderer(nullptr),
_zoomScale(0.1f),
_normalFileName(""), _normalFileName(""),
_clickedFileName(""), _clickedFileName(""),
_disabledFileName(""), _disabledFileName(""),
@ -65,7 +66,6 @@ _normalTextureScaleXInSize(1.0f),
_normalTextureScaleYInSize(1.0f), _normalTextureScaleYInSize(1.0f),
_pressedTextureScaleXInSize(1.0f), _pressedTextureScaleXInSize(1.0f),
_pressedTextureScaleYInSize(1.0f), _pressedTextureScaleYInSize(1.0f),
_zoomScale(0.1f),
_normalTextureLoaded(false), _normalTextureLoaded(false),
_pressedTextureLoaded(false), _pressedTextureLoaded(false),
_disabledTextureLoaded(false), _disabledTextureLoaded(false),

View File

@ -38,13 +38,13 @@ EditBox::EditBox(void)
, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) , _editBoxInputMode(EditBox::InputMode::SINGLE_LINE)
, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) , _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS)
, _keyboardReturnType(KeyboardReturnType::DEFAULT) , _keyboardReturnType(KeyboardReturnType::DEFAULT)
, _backgroundSprite(nullptr)
, _fontSize(-1) , _fontSize(-1)
, _placeholderFontSize(-1) , _placeholderFontSize(-1)
, _colText(Color3B::WHITE) , _colText(Color3B::WHITE)
, _colPlaceHolder(Color3B::GRAY) , _colPlaceHolder(Color3B::GRAY)
, _maxLength(0) , _maxLength(0)
, _adjustHeight(0.0f) , _adjustHeight(0.0f)
, _backgroundSprite(nullptr)
#if CC_ENABLE_SCRIPT_BINDING #if CC_ENABLE_SCRIPT_BINDING
, _scriptEditBoxHandler(0) , _scriptEditBoxHandler(0)
#endif #endif

View File

@ -51,13 +51,15 @@ static GLint s_layer = -1;
IMPLEMENT_CLASS_GUI_INFO(Layout) IMPLEMENT_CLASS_GUI_INFO(Layout)
Layout::Layout(): Layout::Layout():
_clippingEnabled(false),
_backGroundScale9Enabled(false), _backGroundScale9Enabled(false),
_backGroundImage(nullptr), _backGroundImage(nullptr),
_backGroundImageFileName(""), _backGroundImageFileName(""),
_backGroundImageCapInsets(Rect::ZERO), _backGroundImageCapInsets(Rect::ZERO),
_colorType(BackGroundColorType::NONE), _colorType(BackGroundColorType::NONE),
_bgImageTexType(TextureResType::LOCAL), _bgImageTexType(TextureResType::LOCAL),
_backGroundImageTextureSize(Size::ZERO),
_backGroundImageColor(Color3B::WHITE),
_backGroundImageOpacity(255),
_colorRender(nullptr), _colorRender(nullptr),
_gradientRender(nullptr), _gradientRender(nullptr),
_cColor(Color3B::WHITE), _cColor(Color3B::WHITE),
@ -65,14 +67,13 @@ _gStartColor(Color3B::WHITE),
_gEndColor(Color3B::WHITE), _gEndColor(Color3B::WHITE),
_alongVector(Vec2(0.0f, -1.0f)), _alongVector(Vec2(0.0f, -1.0f)),
_cOpacity(255), _cOpacity(255),
_backGroundImageTextureSize(Size::ZERO), _clippingEnabled(false),
_layoutType(Type::ABSOLUTE), _layoutType(Type::ABSOLUTE),
_clippingType(ClippingType::STENCIL), _clippingType(ClippingType::STENCIL),
_clippingStencil(nullptr), _clippingStencil(nullptr),
_scissorRectDirty(false), _scissorRectDirty(false),
_clippingRect(Rect::ZERO), _clippingRect(Rect::ZERO),
_clippingParent(nullptr), _clippingParent(nullptr),
_doLayoutDirty(true),
_clippingRectDirty(true), _clippingRectDirty(true),
_currentStencilEnabled(GL_FALSE), _currentStencilEnabled(GL_FALSE),
_currentStencilWriteMask(~0), _currentStencilWriteMask(~0),
@ -86,12 +87,11 @@ _currentDepthWriteMask(GL_TRUE),
_currentAlphaTestEnabled(GL_FALSE), _currentAlphaTestEnabled(GL_FALSE),
_currentAlphaTestFunc(GL_ALWAYS), _currentAlphaTestFunc(GL_ALWAYS),
_currentAlphaTestRef(1), _currentAlphaTestRef(1),
_backGroundImageColor(Color3B::WHITE), _doLayoutDirty(true),
_backGroundImageOpacity(255), _isInterceptTouch(false),
_passFocusToChild(true),
_loopFocus(false), _loopFocus(false),
_isFocusPassing(false), _passFocusToChild(true),
_isInterceptTouch(false) _isFocusPassing(false)
{ {
//no-op //no-op
} }

View File

@ -31,10 +31,10 @@ NS_CC_BEGIN
namespace ui { namespace ui {
LayoutComponent::LayoutComponent() LayoutComponent::LayoutComponent()
:_actived(true) : _usingPercentContentSize(false)
,_usingPercentContentSize(false) , _referencePoint(ReferencePoint::BOTTOM_LEFT)
,_usingPercentPosition(false) , _usingPercentPosition(false)
,_referencePoint(ReferencePoint::BOTTOM_LEFT) , _actived(true)
{ {
_name = __LAYOUT_COMPONENT_NAME; _name = __LAYOUT_COMPONENT_NAME;
} }

View File

@ -35,10 +35,10 @@ ListView::ListView():
_model(nullptr), _model(nullptr),
_gravity(Gravity::CENTER_VERTICAL), _gravity(Gravity::CENTER_VERTICAL),
_itemsMargin(0.0f), _itemsMargin(0.0f),
_listViewEventListener(nullptr),
_listViewEventSelector(nullptr),
_curSelectedIndex(0), _curSelectedIndex(0),
_refreshViewDirty(true), _refreshViewDirty(true),
_listViewEventListener(nullptr),
_listViewEventSelector(nullptr),
_eventCallback(nullptr) _eventCallback(nullptr)
{ {
this->setTouchEnabled(true); this->setTouchEnabled(true);

View File

@ -31,22 +31,22 @@ namespace ui {
IMPLEMENT_CLASS_GUI_INFO(PageView) IMPLEMENT_CLASS_GUI_INFO(PageView)
PageView::PageView(): PageView::PageView():
_isAutoScrolling(false),
_autoScrollDistance(0.0f),
_autoScrollSpeed(0.0f),
_autoScrollDirection(AutoScrollDirection::LEFT),
_curPageIdx(0), _curPageIdx(0),
_touchMoveDirection(TouchDirection::LEFT), _touchMoveDirection(TouchDirection::LEFT),
_leftBoundaryChild(nullptr), _leftBoundaryChild(nullptr),
_rightBoundaryChild(nullptr), _rightBoundaryChild(nullptr),
_leftBoundary(0.0f), _leftBoundary(0.0f),
_rightBoundary(0.0f), _rightBoundary(0.0f),
_isAutoScrolling(false), _customScrollThreshold(0.0),
_autoScrollDistance(0.0f), _usingCustomScrollThreshold(false),
_autoScrollSpeed(0.0f),
_autoScrollDirection(AutoScrollDirection::LEFT),
_childFocusCancelOffset(5.0f), _childFocusCancelOffset(5.0f),
_pageViewEventListener(nullptr), _pageViewEventListener(nullptr),
_pageViewEventSelector(nullptr), _pageViewEventSelector(nullptr),
_eventCallback(nullptr), _eventCallback(nullptr)
_customScrollThreshold(0.0),
_usingCustomScrollThreshold(false)
{ {
this->setTouchEnabled(true); this->setTouchEnabled(true);
} }

View File

@ -45,11 +45,11 @@ namespace ui {
, _bottomLeft(nullptr) , _bottomLeft(nullptr)
, _bottom(nullptr) , _bottom(nullptr)
, _bottomRight(nullptr) , _bottomRight(nullptr)
, _scale9Enabled(true)
, _insetLeft(0) , _insetLeft(0)
, _insetTop(0) , _insetTop(0)
, _insetRight(0) , _insetRight(0)
, _insetBottom(0) , _insetBottom(0)
, _scale9Enabled(true)
{ {
this->setAnchorPoint(Vec2(0.5,0.5)); this->setAnchorPoint(Vec2(0.5,0.5));
} }

View File

@ -57,14 +57,14 @@ _capInsetsBarRenderer(Rect::ZERO),
_capInsetsProgressBarRenderer(Rect::ZERO), _capInsetsProgressBarRenderer(Rect::ZERO),
_sliderEventListener(nullptr), _sliderEventListener(nullptr),
_sliderEventSelector(nullptr), _sliderEventSelector(nullptr),
_eventCallback(nullptr),
_barTexType(TextureResType::LOCAL), _barTexType(TextureResType::LOCAL),
_progressBarTexType(TextureResType::LOCAL), _progressBarTexType(TextureResType::LOCAL),
_ballNTexType(TextureResType::LOCAL), _ballNTexType(TextureResType::LOCAL),
_ballPTexType(TextureResType::LOCAL), _ballPTexType(TextureResType::LOCAL),
_ballDTexType(TextureResType::LOCAL), _ballDTexType(TextureResType::LOCAL),
_barRendererAdaptDirty(true), _barRendererAdaptDirty(true),
_progressBarRendererDirty(true), _progressBarRendererDirty(true)
_eventCallback(nullptr)
{ {
setTouchEnabled(true); setTouchEnabled(true);
} }

View File

@ -141,28 +141,28 @@ _enabled(true),
_bright(true), _bright(true),
_touchEnabled(false), _touchEnabled(false),
_highlight(false), _highlight(false),
_affectByClipping(false),
_ignoreSize(false),
_propagateTouchEvents(true),
_brightStyle(BrightStyle::NONE), _brightStyle(BrightStyle::NONE),
_touchBeganPosition(Vec2::ZERO), _sizeType(SizeType::ABSOLUTE),
_touchMovePosition(Vec2::ZERO), _positionType(PositionType::ABSOLUTE),
_touchEndPosition(Vec2::ZERO),
_touchEventListener(nullptr),
_touchEventSelector(nullptr),
_actionTag(0), _actionTag(0),
_customSize(Size::ZERO), _customSize(Size::ZERO),
_ignoreSize(false),
_affectByClipping(false),
_sizeType(SizeType::ABSOLUTE),
_sizePercent(Vec2::ZERO), _sizePercent(Vec2::ZERO),
_positionType(PositionType::ABSOLUTE),
_positionPercent(Vec2::ZERO), _positionPercent(Vec2::ZERO),
_hitted(false), _hitted(false),
_touchListener(nullptr), _touchListener(nullptr),
_touchBeganPosition(Vec2::ZERO),
_touchMovePosition(Vec2::ZERO),
_touchEndPosition(Vec2::ZERO),
_flippedX(false), _flippedX(false),
_flippedY(false), _flippedY(false),
_layoutParameterType(LayoutParameter::Type::NONE),
_focused(false), _focused(false),
_focusEnabled(true), _focusEnabled(true),
_layoutParameterType(LayoutParameter::Type::NONE), _touchEventListener(nullptr),
_propagateTouchEvents(true) _touchEventSelector(nullptr)
{ {
} }

View File

@ -62,8 +62,8 @@ ScrollView::ScrollView()
, _touchLength(0.0f) , _touchLength(0.0f)
, _minScale(0.0f) , _minScale(0.0f)
, _maxScale(0.0f) , _maxScale(0.0f)
, _touchListener(nullptr)
, _scissorRestored(false) , _scissorRestored(false)
, _touchListener(nullptr)
{ {
} }

View File

@ -50,20 +50,20 @@ const std::string AssetsManagerEx::BATCH_UPDATE_ID = "@batch_update";
AssetsManagerEx::AssetsManagerEx(const std::string& manifestUrl, const std::string& storagePath) AssetsManagerEx::AssetsManagerEx(const std::string& manifestUrl, const std::string& storagePath)
: _updateState(State::UNCHECKED) : _updateState(State::UNCHECKED)
, _waitToUpdate(false) , _assets(nullptr)
, _totalToDownload(0)
, _totalWaitToDownload(0)
, _percent(0)
, _percentByFile(0)
, _manifestUrl(manifestUrl)
, _storagePath("") , _storagePath("")
, _cacheVersionPath("") , _cacheVersionPath("")
, _cacheManifestPath("") , _cacheManifestPath("")
, _tempManifestPath("") , _tempManifestPath("")
, _assets(nullptr) , _manifestUrl(manifestUrl)
, _localManifest(nullptr) , _localManifest(nullptr)
, _tempManifest(nullptr) , _tempManifest(nullptr)
, _remoteManifest(nullptr) , _remoteManifest(nullptr)
, _waitToUpdate(false)
, _percent(0)
, _percentByFile(0)
, _totalToDownload(0)
, _totalWaitToDownload(0)
{ {
// Init variables // Init variables
_eventDispatcher = Director::getInstance()->getEventDispatcher(); _eventDispatcher = Director::getInstance()->getEventDispatcher();

View File

@ -31,14 +31,14 @@ NS_CC_EXT_BEGIN
EventAssetsManagerEx::EventAssetsManagerEx(const std::string& eventName, cocos2d::extension::AssetsManagerEx *manager, const EventCode &code, float percent/* = 0 */, float percentByFile/* = 0*/, const std::string& assetId/* = "" */, const std::string& message/* = "" */, int curle_code/* = CURLE_OK*/, int curlm_code/* = CURLM_OK*/) EventAssetsManagerEx::EventAssetsManagerEx(const std::string& eventName, cocos2d::extension::AssetsManagerEx *manager, const EventCode &code, float percent/* = 0 */, float percentByFile/* = 0*/, const std::string& assetId/* = "" */, const std::string& message/* = "" */, int curle_code/* = CURLE_OK*/, int curlm_code/* = CURLM_OK*/)
: EventCustom(eventName) : EventCustom(eventName)
, _manager(manager)
, _code(code) , _code(code)
, _manager(manager)
, _message(message)
, _assetId(assetId)
, _curle_code(curle_code) , _curle_code(curle_code)
, _curlm_code(curlm_code) , _curlm_code(curlm_code)
, _percent(percent) , _percent(percent)
, _percentByFile(percentByFile) , _percentByFile(percentByFile)
, _assetId(assetId)
, _message(message)
{ {
} }

View File

@ -145,10 +145,10 @@ int downloadProgressFunc(Downloader::ProgressData *ptr, double totalToDownload,
} }
Downloader::Downloader() Downloader::Downloader()
: _onError(nullptr) : _connectionTimeout(DEFAULT_TIMEOUT)
, _onError(nullptr)
, _onProgress(nullptr) , _onProgress(nullptr)
, _onSuccess(nullptr) , _onSuccess(nullptr)
, _connectionTimeout(DEFAULT_TIMEOUT)
, _supportResuming(false) , _supportResuming(false)
{ {
_fileUtils = FileUtils::getInstance(); _fileUtils = FileUtils::getInstance();