Skip to content

Fixed HyBrid Sprite Test #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cocos2d/actions/CCActionInstant.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ cc.CallFunc = cc.ActionInstant.extend(/** @lends cc.CallFunc# */{
* @return {Boolean}
*/
initWithTarget:function (selector, selectorTarget, data) {
this._data = data || null;
this._callFunc = selector || null;
this._selectorTarget = selectorTarget || null;
this._data = data;
this._callFunc = selector;
this._selectorTarget = selectorTarget;
return true;
},

Expand Down
12 changes: 9 additions & 3 deletions cocos2d/base_nodes/CCNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
*/
removeFromParent:function (cleanup) {
if (this._parent) {
cleanup = cleanup || true;
if (cleanup == null){
cleanup = true;
}
this._parent.removeChild(this, cleanup);
}
},
Expand All @@ -1051,7 +1053,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
return;
}

cleanup = cleanup || true;
if (cleanup == null){
cleanup = true;
}
if (this._children.indexOf(child) > -1) {
this._detachChild(child, cleanup);
}
Expand Down Expand Up @@ -1090,7 +1094,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
removeAllChildren:function (cleanup) {
// not using detachChild improves speed here
if (this._children != null) {
cleanup = cleanup || true;
if (cleanup == null){
cleanup = true;
}
for (var i = 0; i < this._children.length; i++) {
var node = this._children[i];
if (node) {
Expand Down
6 changes: 3 additions & 3 deletions cocos2d/label_nodes/CCLabelBMFont.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
* @param {String} fntFile
* @param {String} width
* @param {Number} alignment
* @param {Number} imageOffset
* @param {cc.Point} imageOffset
* @return {Boolean}
*/
initWithString:function (str, fntFile, width, alignment, imageOffset) {
Expand All @@ -564,7 +564,7 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
if (this.initWithTexture(texture, theString.length)) {
this._alignment = alignment || cc.TEXT_ALIGNMENT_LEFT;
this._imageOffset = imageOffset || cc.PointZero();
this._width = width || cc.LabelAutomaticWidth;
this._width = (width == null)?cc.LabelAutomaticWidth:width;
this._opacity = 255;
this._color = cc.white();
this._contentSize = cc.SizeZero();
Expand Down Expand Up @@ -1035,7 +1035,7 @@ cc.LabelBMFont = cc.SpriteBatchNode.extend(/** @lends cc.LabelBMFont# */{
* @param {String} fntFile
* @param {String} width
* @param {Number} alignment
* @param {Number} imageOffset
* @param {cc.Point} imageOffset
* @return {cc.LabelBMFont|Null}
* @example
* // Example 01
Expand Down
4 changes: 3 additions & 1 deletion cocos2d/layers_scenes_transitions_nodes/CCLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@ cc.LayerColor = cc.Layer.extend(/** @lends cc.LayerColor# */{
},

/**
* @param color
* @param {cc.Color4B} color
* @param {Number} width
* @param {Number} height
* @return {Boolean}
*/
init:function (color, width, height) {
Expand Down
4 changes: 2 additions & 2 deletions cocos2d/misc_nodes/CCRenderTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ cc.RenderTexture = cc.Node.extend(/** @lends cc.RenderTexture# */{
*/
initWithWidthAndHeight:function (width, height, format, depthStencilFormat) {
if (cc.renderContextType == cc.CANVAS) {
this.canvas.width = width || 10;
this.canvas.height = height || 10;
this.canvas.width = (width == null) ? 10 : width;
this.canvas.height = (height == null) ? 10 : height;

this.context.translate(0, this.canvas.height);

Expand Down
6 changes: 4 additions & 2 deletions cocos2d/sprite_nodes/CCAnimationCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ cc.AnimationCache = cc.Class.extend(/** @lends cc.AnimationCache# */{
* @return {cc.Animation}
*/
getAnimation:function (name) {
if(this._animations.hasOwnProperty(name))
if (this._animations.hasOwnProperty(name))
return this._animations[name];
return null;
},
Expand Down Expand Up @@ -173,7 +173,9 @@ cc.AnimationCache = cc.Class.extend(/** @lends cc.AnimationCache# */{

for (var key in animations) {
var animationDict = animations[key];
var loops = parseInt(animationDict["loops"]) || 1;

var loopsTemp = parseInt(animationDict["loops"]);
var loops = (loopsTemp == null) ? 1 : loopsTemp;
var restoreOriginalFrame = (animationDict["restoreOriginalFrame"] && animationDict["restoreOriginalFrame"] == true) ? true : false;
var frameArray = animationDict["frames"];

Expand Down
2 changes: 1 addition & 1 deletion cocos2d/support/CCUserDefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ cc.UserDefault = cc.Class.extend(/** @lends cc.UserDefault# */{
*/
getFloatForKey:function (key, defaultValue) {
var value = this._getValueForKey(key);
var ret = defaultValue || 0.0;
var ret = defaultValue || 0;

if (value) {
return parseFloat(value);
Expand Down