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