From 8a327c77faaa40d2d48ff6aee5fefa210666afca Mon Sep 17 00:00:00 2001 From: mogemimi Date: Thu, 23 Mar 2017 10:30:42 +0900 Subject: [PATCH] Fix various minor typos (#17570) --- .../cocostudio/FlatBuffersSerialize.cpp | 12 ++++++------ .../Classes/ParticleTest/ParticleTest.cpp | 4 ++-- .../Classes/ParticleTest/ParticleTest.h | 2 +- .../RenderTextureTest/RenderTextureTest.cpp | 4 ++-- .../RenderTextureTest/RenderTextureTest.h | 2 +- .../Classes/Sprite3DTest/Sprite3DTest.cpp | 18 +++++++++--------- .../Classes/Sprite3DTest/Sprite3DTest.h | 2 +- .../js-tests/src/Sprite3DTest/Sprite3DTest.js | 14 +++++++------- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index df3c3c4021..cb13c19999 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -243,7 +243,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str _builder = new (std::nothrow) FlatBufferBuilder(); Offset nodeTree; - Offset aciton; + Offset action; std::vector> animationInfos; const tinyxml2::XMLElement* child = element->FirstChildElement(); @@ -255,7 +255,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str if (name == "Animation") // action { const tinyxml2::XMLElement* animation = child; - aciton = createNodeAction(animation); + action = createNodeAction(animation); } else if (name == "ObjectData") // nodeTree { @@ -296,7 +296,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str _builder->CreateVector(_textures), _builder->CreateVector(_texturePngs), nodeTree, - aciton, + action, _builder->CreateVector(animationInfos)); _builder->Finish(csparsebinary); @@ -1351,7 +1351,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato _builder = new (std::nothrow) FlatBufferBuilder(); Offset nodeTree; - Offset aciton; + Offset action; std::vector > animationInfos; const tinyxml2::XMLElement* child = element->FirstChildElement(); @@ -1363,7 +1363,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato if (name == "Animation") // action { const tinyxml2::XMLElement* animation = child; - aciton = createNodeAction(animation); + action = createNodeAction(animation); } else if (name == "ObjectData") // nodeTree { @@ -1402,7 +1402,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato _builder->CreateVector(_textures), _builder->CreateVector(_texturePngs), nodeTree, - aciton, + action, _builder->CreateVector(animationInfos)); _builder->Finish(csparsebinary); diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index 73b0dc866f..cf41e45c38 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -1813,7 +1813,7 @@ std::string PremultipliedAlphaTest::subtitle() const return "no black halo, particles should fade out\n animation should be normal"; } -void PremultipliedAlphaTest::readdPaticle(float delta) +void PremultipliedAlphaTest::readdParticle(float delta) { if (_hasEmitter) { @@ -1856,7 +1856,7 @@ void PremultipliedAlphaTest::onEnter() this->addChild(_emitter, 10); _hasEmitter = true; - schedule(CC_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdPaticle), 1.0f); + schedule(CC_SCHEDULE_SELECTOR(PremultipliedAlphaTest::readdParticle), 1.0f); } // PremultipliedAlphaTest2 diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h index 7c8025b151..c5a151ae83 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h @@ -321,7 +321,7 @@ class PremultipliedAlphaTest : public ParticleDemo public: CREATE_FUNC(PremultipliedAlphaTest); virtual void onEnter() override; - void readdPaticle(float delta); + void readdParticle(float delta); virtual std::string title() const override; virtual std::string subtitle() const override; }; diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 126ae3f8b9..ca464a86e4 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -449,7 +449,7 @@ void RenderTextureTestDepthStencil::draw(Renderer *renderer, const Mat4 &transfo _spriteDS->visit(); _renderCmds[2].init(_globalZOrder, transform, flags); - _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforDraw, this); + _renderCmds[2].func = CC_CALLBACK_0(RenderTextureTestDepthStencil::onBeforeDraw, this); renderer->addCommand(&_renderCmds[2]); _spriteDraw->visit(); @@ -484,7 +484,7 @@ void RenderTextureTestDepthStencil::onBeforeStencil() // RenderState::StateBlock::_defaultState->setStencilOperation(RenderState::STENCIL_OP_REPLACE, RenderState::STENCIL_OP_REPLACE, RenderState::STENCIL_OP_REPLACE); } -void RenderTextureTestDepthStencil::onBeforDraw() +void RenderTextureTestDepthStencil::onBeforeDraw() { glStencilFunc(GL_NOTEQUAL, 1, 0xFF); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h index 6d626b0eab..8287ed293d 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.h @@ -77,7 +77,7 @@ private: cocos2d::CustomCommand _renderCmds[4]; void onBeforeClear(); void onBeforeStencil(); - void onBeforDraw(); + void onBeforeDraw(); void onAfterDraw(); private: diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index d347c43105..1b27266de5 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -236,7 +236,7 @@ Sprite3DUVAnimationTest::Sprite3DUVAnimationTest() { //the offset use to translating texture _cylinder_texture_offset = 0; - _shining_duraion = 0; + _shining_duration = 0; Size visibleSize = Director::getInstance()->getVisibleSize(); //use custom camera @@ -299,18 +299,18 @@ void Sprite3DUVAnimationTest::cylinderUpdate(float dt) _cylinder_texture_offset = (_cylinder_texture_offset >1) ? 0 : _cylinder_texture_offset; if(fade_in) { - _shining_duraion += 0.5*dt; - if(_shining_duraion>1) fade_in = false; + _shining_duration += 0.5 * dt; + if (_shining_duration > 1) fade_in = false; } else { - _shining_duraion -= 0.5*dt; - if(_shining_duraion<0) fade_in = true; + _shining_duration -= 0.5 * dt; + if (_shining_duration < 0) fade_in = true; } //pass the result to shader _state->setUniformFloat("offset",_cylinder_texture_offset); - _state->setUniformFloat("duration",_shining_duraion); + _state->setUniformFloat("duration", _shining_duration); } //------------------------------------------------------------------ @@ -950,9 +950,9 @@ void Sprite3DWithSkinTest::addNewSpriteWithCoords(Vec2 p) animate->setSpeed(inverse ? -speed : speed); animate->setTag(110); animate->setQuality((Animate3DQuality)_animateQuality); - auto repeate = RepeatForever::create(animate); - repeate->setTag(110); - sprite->runAction(repeate); + auto repeat = RepeatForever::create(animate); + repeat->setTag(110); + sprite->runAction(repeat); } } diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h index 6a1181fd06..3a99495432 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h @@ -92,7 +92,7 @@ protected: void cylinderUpdate(float dt); float _cylinder_texture_offset; - float _shining_duraion; + float _shining_duration; cocos2d::GLProgramState * _state; #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) diff --git a/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js b/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js index 56ae054f73..c350000b6f 100755 --- a/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js +++ b/tests/js-tests/src/Sprite3DTest/Sprite3DTest.js @@ -1234,7 +1234,7 @@ var Sprite3DUVAnimationTest = Sprite3DTestDemo.extend({ _title:"Testing UV Animation", _subtitle:"", _cylinder_texture_offset:0, - _shining_duraion:0, + _shining_duration:0, _state:null, fade_in:true, @@ -1261,7 +1261,7 @@ var Sprite3DUVAnimationTest = Sprite3DTestDemo.extend({ cylinder.setGLProgramState(this._state); this._state.setUniformFloat("offset", this._cylinder_texture_offset); - this._state.setUniformFloat("duration", this._shining_duraion); + this._state.setUniformFloat("duration", this._shining_duration); //pass mesh's attribute to shader var offset = 0; @@ -1292,18 +1292,18 @@ var Sprite3DUVAnimationTest = Sprite3DTestDemo.extend({ this._cylinder_texture_offset = this._cylinder_texture_offset > 1 ? 0 : this._cylinder_texture_offset; if(this.fade_in){ - this._shining_duraion += 0.5 * dt; - if(this._shining_duraion > 1) + this._shining_duration += 0.5 * dt; + if(this._shining_duration > 1) this.fade_in = false; }else{ - this._shining_duraion -= 0.5 * dt; - if(this._shining_duraion < 0) + this._shining_duration -= 0.5 * dt; + if(this._shining_duration < 0) this.fade_in = true; } //pass the result to shader this._state.setUniformFloat("offset", this._cylinder_texture_offset); - this._state.setUniformFloat("duration", this._shining_duraion); + this._state.setUniformFloat("duration", this._shining_duration); } });