Skip to content
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
2 changes: 1 addition & 1 deletion HelloHTML5World/src/myApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var CircleSprite = cc.Sprite.extend({
},
myUpdate:function (dt) {
this._radians -= 6;
//this._addDirtyRegionToDirector(this.boundingBoxToWorld());
//this._addDirtyRegionToDirector(this.getBoundingBoxToWorld());
}
});

Expand Down
34 changes: 17 additions & 17 deletions cocos2d/CCDirector.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{

//purge?
this._purgeDirecotorInNextLoop = false;
this._winSizeInPixels = this._winSizeInPoints = cc.SizeMake(cc.canvas.width, cc.canvas.height);
this._winSizeInPixels = this._winSizeInPoints = cc.size(cc.canvas.width, cc.canvas.height);

this._openGLView = null;
this._contentScaleFactor = 1.0;
Expand Down Expand Up @@ -322,7 +322,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
if (!this._paused) {
this._scheduler.update(this._deltaTime);
}
//this._fullRect = new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height);
//this._fullRect = cc.rect(0, 0, cc.canvas.width, cc.canvas.height);
//cc.renderContext.clearRect(this._fullRect.origin.x, this._fullRect.origin.y, this._fullRect.size.width, -this._fullRect.size.height);
cc.renderContext.clearRect(0, 0, cc.canvas.width, -cc.canvas.height);

Expand All @@ -333,7 +333,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
if (this._dirtyRegion) {
//cc.renderContext.clearRect(0, 0, cc.canvas.width, -cc.canvas.height);

var fullRect = new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height);
var fullRect = cc.rect(0, 0, cc.canvas.width, cc.canvas.height);
this._dirtyRegion = cc.Rect.CCRectIntersection(this._dirtyRegion, fullRect);

if(cc.Rect.CCRectEqualToRect(cc.RectZero(), this._dirtyRegion)){
Expand Down Expand Up @@ -412,11 +412,11 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
return;

if (!this._dirtyRegion) {
this._dirtyRegion = new cc.Rect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
this._dirtyRegion = cc.rect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
return;
}
this._dirtyRegion = cc.Rect.CCRectUnion(this._dirtyRegion,
new cc.Rect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height));
cc.rect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height));
},

rectIsInDirtyRegion:function (rect) {
Expand Down Expand Up @@ -547,7 +547,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
popScene:function () {
cc.Assert(this._runningScene != null, "running scene should not null");

//this.addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));

this._scenesStack.pop();
var c = this._scenesStack.length;
Expand Down Expand Up @@ -627,7 +627,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
pushScene:function (scene) {
cc.Assert(scene, "the scene should not null");

//this.addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));

this._sendCleanupToScene = false;

Expand All @@ -642,7 +642,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
replaceScene:function (scene) {
cc.Assert(scene != null, "the scene should not be null");

//this.addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));
var i = this._scenesStack.length;

this._sendCleanupToScene = true;
Expand All @@ -657,7 +657,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
reshapeProjection:function (newWindowSize) {
if(this._openGLView){
this._winSizeInPoints = this._openGLView.getSize();
this._winSizeInPixels = cc.SizeMake(this._winSizeInPoints.width * this._contentScaleFactor,
this._winSizeInPixels = cc.size(this._winSizeInPoints.width * this._contentScaleFactor,
this._winSizeInPoints.height * this._contentScaleFactor);

this.setProjection(this._projection);
Expand All @@ -671,7 +671,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
if (!this._paused) {
return;
}
//this.addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));

this.setAnimationInterval(this._oldAnimationInterval);
this._lastUpdate = cc.Time.gettimeofdayCocos2d();
Expand All @@ -695,7 +695,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
cc.Assert(scene != null, "running scene should not be null");
cc.Assert(this._runningScene == null, "_runningScene should be null");

//this.addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));

this.pushScene(scene);
this.startAnimation();
Expand Down Expand Up @@ -728,7 +728,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
setContentScaleFactor:function (scaleFactor) {
if (scaleFactor != this._contentScaleFactor) {
this._contentScaleFactor = scaleFactor;
this._winSizeInPixels = cc.SizeMake(this._winSizeInPoints.width * scaleFactor, this._winSizeInPoints.height * scaleFactor);
this._winSizeInPixels = cc.size(this._winSizeInPoints.width * scaleFactor, this._winSizeInPoints.height * scaleFactor);

if (this._openGLView) {
this.updateContentScaleFactor();
Expand Down Expand Up @@ -834,7 +834,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{

// set size
this._winSizeInPoints = this._openGLView.getSize();
this._winSizeInPixels = cc.SizeMake(this._winSizeInPoints.width * this._contentScaleFactor, this._winSizeInPoints.height * this._contentScaleFactor);
this._winSizeInPixels = cc.size(this._winSizeInPoints.width * this._contentScaleFactor, this._winSizeInPoints.height * this._contentScaleFactor);

this._createStatsLabel();

Expand Down Expand Up @@ -1132,9 +1132,9 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
},

_createStatsLabel:function(){
this._FPSLabel = cc.LabelTTF.create("00.0", "Arial", 18, cc.SizeMake(60,16), cc.TEXT_ALIGNMENT_RIGHT);
this._SPFLabel = cc.LabelTTF.create("0.000", "Arial", 18, cc.SizeMake(60,16), cc.TEXT_ALIGNMENT_RIGHT);
this._drawsLabel = cc.LabelTTF.create("000", "Arial", 18, cc.SizeMake(60,16), cc.TEXT_ALIGNMENT_RIGHT);
this._FPSLabel = cc.LabelTTF.create("00.0", "Arial", 18, cc.size(60,16), cc.TEXT_ALIGNMENT_RIGHT);
this._SPFLabel = cc.LabelTTF.create("0.000", "Arial", 18, cc.size(60,16), cc.TEXT_ALIGNMENT_RIGHT);
this._drawsLabel = cc.LabelTTF.create("000", "Arial", 18, cc.size(60,16), cc.TEXT_ALIGNMENT_RIGHT);

this._drawsLabel.setPosition( cc.pAdd( cc.p(20,48), cc.DIRECTOR_STATS_POSITION ) );
this._SPFLabel.setPosition( cc.pAdd( cc.p(20,30), cc.DIRECTOR_STATS_POSITION ) );
Expand Down Expand Up @@ -1244,7 +1244,7 @@ cc.defaultFPS = 60;
/*
window.onfocus = function () {
if (!cc.firstRun) {
cc.Director.getInstance().addRegionToDirtyRegion(new cc.Rect(0, 0, cc.canvas.width, cc.canvas.height));
cc.Director.getInstance().addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));
}
};
*/
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/actions/CCAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ cc.Follow = cc.Action.extend(/** @lends cc.Follow# */{
* // example
* // creates the action with a set boundary
* var sprite = cc.Sprite.create("spriteFileName");
* var followAction = cc.Follow.create(sprite, cc.RectMake(0, 0, s.width * 2 - 100, s.height));
* var followAction = cc.Follow.create(sprite, cc.rect(0, 0, s.width * 2 - 100, s.height));
* this.runAction(followAction);
*
* // creates the action with no boundary set
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/actions/CCActionGrid3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ cc.Twirl = cc.Grid3DAction.extend({
var amp = 0.1 * this._amplitude * this._amplitudeRate;
var a = r * Math.cos(Math.PI / 2.0 + time * Math.PI * this._twirls * 2) * amp;

var d = cc.p();
var d = cc.p(0,0);

d.x = Math.sin(a) * (v.y - c.y) + Math.cos(a) * (v.x - c.x);
d.y = Math.cos(a) * (v.y - c.y) - Math.sin(a) * (v.x - c.x);
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/actions/CCActionInterval.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ cc.BezierBy = cc.ActionInterval.extend(/** @lends cc.BezierBy# */{
*/
ctor:function () {
this._config = new cc.BezierConfig();
this._startPosition = cc.p();
this._startPosition = cc.p(0,0);
}
});

Expand Down
6 changes: 3 additions & 3 deletions cocos2d/base_nodes/CCAtlasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
this._itemHeight = tileHeight;

this._opacity = 255;
this._color = this._colorUnmodified = cc.WHITE();
this._color = this._colorUnmodified = cc.WHITE;
this._isOpacityModifyRGB = true;

this._blendFunc.src = cc.BLEND_SRC;
Expand Down Expand Up @@ -156,7 +156,7 @@ cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
var cacheTextureForColor = cc.TextureCache.getInstance().getTextureColors(this._originalTexture);
if (cacheTextureForColor) {
var tx = this._originalTexture;
var textureRect = new cc.Rect(0, 0, tx.width, tx.height);
var textureRect = cc.rect(0, 0, tx.width, tx.height);
var colorTexture = cc.generateTintImage(tx, cacheTextureForColor, this._color, textureRect);
var img = new Image();
img.src = colorTexture.toDataURL();
Expand Down Expand Up @@ -272,7 +272,7 @@ cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
size = this._textureAtlas.getTexture().getContentSize();
}
else {
size = new cc.Size(this._textureAtlas.getTexture().width, this._textureAtlas.getTexture().height);
size = cc.size(this._textureAtlas.getTexture().width, this._textureAtlas.getTexture().height);
}
this._itemsPerColumn = parseInt(size.height / this._itemHeight);
this._itemsPerRow = parseInt(size.width / this._itemWidth);
Expand Down
Loading