mirror of https://github.com/axmolengine/axmol.git
Fix some local variable names in tests (#17445)
This commit is contained in:
parent
13a438dbfd
commit
e293520057
|
@ -24,8 +24,8 @@ bool Bug15594Layer::init()
|
|||
|
||||
auto animation = Animation3D::create("Images/bugs/bug15594.c3t");
|
||||
auto animate = Animate3D::create(animation);
|
||||
auto repeate = RepeatForever::create(animate);
|
||||
sprite3d->runAction(repeate);
|
||||
auto repeat = RepeatForever::create(animate);
|
||||
sprite3d->runAction(repeat);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -343,10 +343,10 @@ void HoleDemo::setup()
|
|||
|
||||
_outerClipper = ClippingNode::create();
|
||||
_outerClipper->retain();
|
||||
AffineTransform tranform = AffineTransform::IDENTITY;
|
||||
tranform = AffineTransformScale(tranform, target->getScale(), target->getScale());
|
||||
AffineTransform transform = AffineTransform::IDENTITY;
|
||||
transform = AffineTransformScale(transform, target->getScale(), target->getScale());
|
||||
|
||||
_outerClipper->setContentSize( SizeApplyAffineTransform(target->getContentSize(), tranform));
|
||||
_outerClipper->setContentSize(SizeApplyAffineTransform(target->getContentSize(), transform));
|
||||
_outerClipper->setAnchorPoint( Vec2(0.5, 0.5) );
|
||||
_outerClipper->setPosition(Vec2(this->getContentSize()) * 0.5f);
|
||||
_outerClipper->runAction(RepeatForever::create(RotateBy::create(1, 45)));
|
||||
|
|
|
@ -58,26 +58,26 @@ void PrettyPrinterDemo::onEnter()
|
|||
}
|
||||
|
||||
// Test code
|
||||
PrettyPrinter vistor;
|
||||
PrettyPrinter visitor;
|
||||
|
||||
// print dictionary
|
||||
auto dict = __Dictionary::createWithContentsOfFile("animations/animations.plist");
|
||||
dict->acceptVisitor(vistor);
|
||||
log("%s", vistor.getResult().c_str());
|
||||
dict->acceptVisitor(visitor);
|
||||
log("%s", visitor.getResult().c_str());
|
||||
log("-------------------------------");
|
||||
|
||||
__Set myset;
|
||||
for (int i = 0; i < 30; ++i) {
|
||||
myset.addObject(__String::createWithFormat("str: %d", i));
|
||||
}
|
||||
vistor.clear();
|
||||
myset.acceptVisitor(vistor);
|
||||
log("%s", vistor.getResult().c_str());
|
||||
visitor.clear();
|
||||
myset.acceptVisitor(visitor);
|
||||
log("%s", visitor.getResult().c_str());
|
||||
log("-------------------------------");
|
||||
|
||||
vistor.clear();
|
||||
visitor.clear();
|
||||
addSprite();
|
||||
// dict = Director::getInstance()->getTextureCache()->snapshotTextures();
|
||||
// dict->acceptVisitor(vistor);
|
||||
// log("%s", vistor.getResult().c_str());
|
||||
// dict->acceptVisitor(visitor);
|
||||
// log("%s", visitor.getResult().c_str());
|
||||
}
|
||||
|
|
|
@ -1201,12 +1201,12 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float d
|
|||
|
||||
Vec2 center = PhysicsShape::getPolygonCenter(points, pointsCount);
|
||||
Node* node = Node::create();
|
||||
PhysicsBody* polyon = PhysicsBody::createPolygon(points, pointsCount, PHYSICSBODY_MATERIAL_DEFAULT, -center);
|
||||
PhysicsBody* polygon = PhysicsBody::createPolygon(points, pointsCount, PHYSICSBODY_MATERIAL_DEFAULT, -center);
|
||||
node->setPosition(center);
|
||||
node->addComponent(polyon);
|
||||
polyon->setVelocity(body->getVelocityAtWorldPoint(center));
|
||||
polyon->setAngularVelocity(body->getAngularVelocity());
|
||||
polyon->setTag(_sliceTag);
|
||||
node->addComponent(polygon);
|
||||
polygon->setVelocity(body->getVelocityAtWorldPoint(center));
|
||||
polygon->setAngularVelocity(body->getAngularVelocity());
|
||||
polygon->setTag(_sliceTag);
|
||||
addChild(node);
|
||||
|
||||
delete[] points;
|
||||
|
|
|
@ -546,11 +546,11 @@ bool EffectSpriteLamp::init()
|
|||
lampEffect->setKBump(2);
|
||||
_sprite->setEffect(lampEffect);
|
||||
_effect = lampEffect;
|
||||
auto listerner = EventListenerTouchAllAtOnce::create();
|
||||
listerner->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this);
|
||||
listerner->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this);
|
||||
listerner->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this);
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listerner, this);
|
||||
auto listener = EventListenerTouchAllAtOnce::create();
|
||||
listener->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this);
|
||||
listener->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this);
|
||||
listener->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this);
|
||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -365,11 +365,11 @@ var Camera3DTest = (function(){
|
|||
layer3D.setCameraMask(2);
|
||||
},
|
||||
|
||||
addNewSpriteWithCoords:function(postion, file, playAnimation, scale, bindCamera){
|
||||
addNewSpriteWithCoords:function(position, file, playAnimation, scale, bindCamera){
|
||||
var sprite = new jsb.Sprite3D(file);
|
||||
this._layer3D.addChild(sprite);
|
||||
var globalZOrder = sprite.getGlobalZOrder();
|
||||
sprite.setPosition3D(postion);
|
||||
sprite.setPosition3D(position);
|
||||
sprite.setGlobalZOrder(globalZOrder);
|
||||
if(playAnimation){
|
||||
var animation = new jsb.Animation3D(file, "Take 001");
|
||||
|
|
|
@ -42,8 +42,8 @@ local function AccelerometerMainLayer()
|
|||
target:setPosition(cc.p(ptNowX , ptNowY))
|
||||
end
|
||||
|
||||
local listerner = cc.EventListenerAcceleration:create(accelerometerListener)
|
||||
layer:getEventDispatcher():addEventListenerWithSceneGraphPriority(listerner,ball)
|
||||
local listener = cc.EventListenerAcceleration:create(accelerometerListener)
|
||||
layer:getEventDispatcher():addEventListenerWithSceneGraphPriority(listener, ball)
|
||||
end
|
||||
|
||||
local function onExit()
|
||||
|
|
|
@ -751,9 +751,9 @@ function SpriteAccelerationEventTest:onEnter()
|
|||
target:setPosition(cc.p(ptNowX , ptNowY))
|
||||
end
|
||||
|
||||
local listerner = cc.EventListenerAcceleration:create(accelerometerListener)
|
||||
local listener = cc.EventListenerAcceleration:create(accelerometerListener)
|
||||
|
||||
self:getEventDispatcher():addEventListenerWithSceneGraphPriority(listerner,sprite)
|
||||
self:getEventDispatcher():addEventListenerWithSceneGraphPriority(listener, sprite)
|
||||
end
|
||||
|
||||
function SpriteAccelerationEventTest:onExit()
|
||||
|
|
|
@ -1036,14 +1036,14 @@ local function PhysicsDemoSlice()
|
|||
|
||||
local center = cc.PhysicsShape:getPolygonCenter(points)
|
||||
local node = cc.Node:create()
|
||||
local polyon = cc.PhysicsBody:createPolygon(points,
|
||||
local polygon = cc.PhysicsBody:createPolygon(points,
|
||||
cc.PHYSICSBODY_MATERIAL_DEFAULT,
|
||||
cc.p(-center.x, -center.y))
|
||||
node:setPosition(center)
|
||||
node:setPhysicsBody(polyon)
|
||||
polyon:setVelocity(body:getVelocityAtWorldPoint(center))
|
||||
polyon:setAngularVelocity(body:getAngularVelocity())
|
||||
polyon.tag = sliceTag
|
||||
node:setPhysicsBody(polygon)
|
||||
polygon:setVelocity(body:getVelocityAtWorldPoint(center))
|
||||
polygon:setAngularVelocity(body:getAngularVelocity())
|
||||
polygon.tag = sliceTag
|
||||
layer:addChild(node)
|
||||
end
|
||||
|
||||
|
|
|
@ -184,9 +184,9 @@ function Sprite3DWithSkinTest.addNewSpriteWithCoords(parent,x,y)
|
|||
end
|
||||
animate:setTag(110)
|
||||
animate:setQuality(Sprite3DWithSkinTest._animateQuality)
|
||||
local repeate = cc.RepeatForever:create(animate)
|
||||
repeate:setTag(110)
|
||||
sprite:runAction(repeate)
|
||||
local repeat = cc.RepeatForever:create(animate)
|
||||
repeat:setTag(110)
|
||||
sprite:runAction(repeat)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue