Skip to content

Commit

Permalink
Fix various minor typos (cocos2d#17570)
Browse files Browse the repository at this point in the history
  • Loading branch information
mogemimi authored and minggo committed Mar 23, 2017
1 parent 72d47c7 commit 8a327c7
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str
_builder = new (std::nothrow) FlatBufferBuilder();

Offset<NodeTree> nodeTree;
Offset<NodeAction> aciton;
Offset<NodeAction> action;
std::vector<Offset<flatbuffers::AnimationInfo>> animationInfos;

const tinyxml2::XMLElement* child = element->FirstChildElement();
Expand All @@ -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
{
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -1351,7 +1351,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
_builder = new (std::nothrow) FlatBufferBuilder();

Offset<NodeTree> nodeTree;
Offset<NodeAction> aciton;
Offset<NodeAction> action;
std::vector<Offset<flatbuffers::AnimationInfo> > animationInfos;

const tinyxml2::XMLElement* child = element->FirstChildElement();
Expand All @@ -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
{
Expand Down Expand Up @@ -1402,7 +1402,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
_builder->CreateVector(_textures),
_builder->CreateVector(_texturePngs),
nodeTree,
aciton,
action,
_builder->CreateVector(animationInfos));
_builder->Finish(csparsebinary);

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/ParticleTest/ParticleTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class RenderTextureTestDepthStencil : public RenderTextureTest
cocos2d::CustomCommand _renderCmds[4];
void onBeforeClear();
void onBeforeStencil();
void onBeforDraw();
void onBeforeDraw();
void onAfterDraw();

private:
Expand Down
18 changes: 9 additions & 9 deletions tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

//------------------------------------------------------------------
Expand Down Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Sprite3DUVAnimationTest : public Sprite3DTestDemo
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)
Expand Down
14 changes: 7 additions & 7 deletions tests/js-tests/src/Sprite3DTest/Sprite3DTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
});

Expand Down

0 comments on commit 8a327c7

Please sign in to comment.