Skip to content

Commit c017823

Browse files
Merge remote-tracking branch 'dumganhar/remove-associate-nativeobj'
Conflicts: games/MoonWarriors/src/AboutLayer.js games/MoonWarriors/src/Bullet.js games/MoonWarriors/src/Enemy.js games/MoonWarriors/src/Explosion.js games/MoonWarriors/src/HitEffect.js games/MoonWarriors/src/SettingsLayer.js games/MoonWarriors/src/Ship.js games/MoonWarriors/src/SysMenu.js tests/SpriteTest/SpriteTest.js
2 parents 221465a + 704b2ec commit c017823

35 files changed

+22
-108
lines changed

games/MoonWarriors/src/AboutLayer.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
var AboutLayer = cc.Layer.extend({
2-
ctor:function () {
3-
cc.associateWithNative( this, cc.Layer );
4-
this._super();
5-
},
62
init:function () {
73
var bRet = false;
84
if (this._super()) {

games/MoonWarriors/src/Bullet.js

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ var Bullet = cc.Sprite.extend({
1010
attackMode:MW.ENEMY_MOVE_TYPE.NORMAL,
1111
parentType:MW.BULLET_TYPE.PLAYER,
1212
ctor:function (bulletSpeed, weaponType, attackMode) {
13-
// needed for JS-Bindings compatibility
14-
cc.associateWithNative( this, cc.Sprite );
1513
this._super();
1614

1715
this.yVelocity = -bulletSpeed;

games/MoonWarriors/src/Enemy.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ var Enemy = cc.Sprite.extend({
1313
attackMode:MW.ENEMY_MOVE_TYPE.NORMAL,
1414
_hurtColorLife:0,
1515
ctor:function (arg) {
16-
// needed for JS-Bindings compatibility
17-
cc.associateWithNative( this, cc.Sprite );
1816
this._super();
1917

2018
this.HP = arg.HP;
@@ -103,4 +101,4 @@ Enemy.getOrCreateEnemy = function(arg) {
103101
g_sharedGameLayer.addEnemy(addEnemy, addEnemy.zOrder, MW.UNIT_TAG.ENEMY);
104102
MW.CONTAINER.ENEMIES.push(addEnemy);
105103
return addEnemy;
106-
};
104+
};

games/MoonWarriors/src/Explosion.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ var Explosion = cc.Sprite.extend({
33
tmpHeight:0,
44
active:true,
55
ctor:function () {
6-
// needed for JS-Bindings compatibility
7-
cc.associateWithNative( this, cc.Sprite );
86
this._super();
97

108
var pFrame = cc.SpriteFrameCache.getInstance().getSpriteFrame("explosion_01.png");

games/MoonWarriors/src/GameControlMenu.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
var GameControlMenu = cc.Layer.extend({
2-
ctor:function() {
3-
// needed for JS-Bindings compatibility
4-
cc.associateWithNative( this, cc.Layer);
5-
},
2+
63
init:function () {
74
var bRet = false;
85
if (this._super()) {

games/MoonWarriors/src/GameLayer.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ var GameLayer = cc.Layer.extend({
3333
_explosions:null,
3434
_texOpaqueBatch:null,
3535
_texTransparentBatch:null,
36-
ctor:function () {
37-
cc.associateWithNative( this, cc.Layer );
38-
},
36+
3937
init:function () {
4038
var bRet = false;
4139
if (this._super()) {

games/MoonWarriors/src/GameOver.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
var GameOver = cc.Layer.extend({
22
_ship:null,
33
_lbScore:0,
4-
ctor:function() {
5-
// needed for JS-Bindings compatibility
6-
cc.associateWithNative( this, cc.Layer);
7-
},
4+
85
init:function () {
96
var bRet = false;
107
if (this._super()) {

games/MoonWarriors/src/HitEffect.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
var HitEffect = cc.Sprite.extend({
22
active:true,
33
ctor:function () {
4-
cc.associateWithNative( this, cc.Sprite );
5-
this._super();
4+
this._super();
65

76
this.initWithSpriteFrameName("hit.png");
87
this.setBlendFunc(gl.SRC_ALPHA, gl.ONE);

games/MoonWarriors/src/SettingsLayer.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
var SettingsLayer = cc.Layer.extend({
2-
ctor:function () {
3-
cc.associateWithNative( this, cc.Layer );
4-
this._super();
5-
},
62
init:function () {
73
var bRet = false;
84
if (this._super()) {

games/MoonWarriors/src/Ship.js

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ var Ship = cc.Sprite.extend({
1313
_hurtColorLife:0,
1414
active:true,
1515
ctor:function () {
16-
17-
// needed for JS-Bindings compatibility
18-
cc.associateWithNative( this, cc.Sprite );
1916
this._super();
2017

2118
//init life

games/MoonWarriors/src/SparkEffect.js

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ var SparkEffect = cc.Class.extend({
55
scale:1.2,
66
duration:0.7,
77
ctor:function () {
8-
cc.associateWithNative( this, cc.Class );
9-
108
this.spark1 = cc.Sprite.createWithSpriteFrameName("explode2.png");
119
this.spark1.setBlendFunc(gl.SRC_ALPHA, gl.ONE);
1210
this.spark2 = cc.Sprite.createWithSpriteFrameName("explode3.png");

games/MoonWarriors/src/SysMenu.js

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ cc.dumpConfig();
33
var SysMenu = cc.Layer.extend({
44
_ship:null,
55

6-
ctor:function () {
7-
cc.associateWithNative( this, cc.Layer );
8-
this._super();
9-
},
106
init:function () {
117
var bRet = false;
128
if (this._super()) {

games/WatermelonWithMe/watermelon_with_me.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ var GameLayer = cc.LayerGradient.extend({
163163
ctor:function (game_state) {
164164
cc.SpriteFrameCache.getInstance().addSpriteFrames(s_coinsPlist);
165165
this._super(); // if you extend CC object, and write your own constructor, you should always call parent's constructor
166-
cc.associateWithNative(this, cc.LayerGradient);
166+
167167
this.init(cc.c4b(0, 0, 0, 255), cc.c4b(255, 255, 255, 255));
168168
this.setPosition(0, 0);
169169

@@ -916,7 +916,7 @@ var GameLayer = cc.LayerGradient.extend({
916916
var BootLayer = cc.Layer.extend({
917917

918918
ctor:function () {
919-
cc.associateWithNative(this, cc.Layer);
919+
this._super();
920920
this.init();
921921
// music
922922
audioEngine.playMusic(s_game_music_mp3);
@@ -989,7 +989,7 @@ var OptionsLayer = cc.LayerGradient.extend({
989989

990990
ctor:function () {
991991
this._super();
992-
cc.associateWithNative(this, cc.LayerGradient);
992+
993993
this.init(cc.c4b(0, 0, 0, 255), cc.c4b(255, 255, 255, 255));
994994

995995
var label1 = cc.LabelBMFont.create("MUSIC ON", s_Konqa32FNT);
@@ -1031,7 +1031,7 @@ var ScoresLayer = cc.LayerGradient.extend({
10311031

10321032
ctor:function () {
10331033
this._super();
1034-
cc.associateWithNative(this, cc.LayerGradient);
1034+
10351035
this.init(cc.c4b(0, 0, 0, 255), cc.c4b(255, 255, 255, 255));
10361036

10371037
var label = cc.LabelBMFont.create("HI SCORES", s_Gas40FNT);

tests/BaseTestLayer/BaseTestLayer.js

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ var BaseTestLayer = cc.LayerGradient.extend({
4242
sys.garbageCollect();
4343

4444
this._super();
45-
cc.associateWithNative( this, cc.LayerGradient );
4645

4746
// default gradient colors
4847
var a = cc.c4b(98,99,117,255);

tests/ClickAndMoveTest/ClickAndMoveTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var ClickAndMoveTestScene = TestScene.extend({
3737
var MainLayer = cc.Layer.extend({
3838
ctor:function () {
3939
this._super();
40-
cc.associateWithNative(this, cc.Layer);
40+
4141
this.init();
4242

4343
if( 'touches' in sys.capabilities )

tests/CocosDenshionTest/CocosDenshionTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ CocosDenshionTest = cc.LayerGradient.extend({
159159
_testCount:0,
160160
ctor:function () {
161161
this._super();
162-
cc.associateWithNative(this, cc.LayerGradient);
162+
163163
this.init(cc.c4b(0, 0, 0, 255), cc.c4b(148, 80, 120, 255));
164164

165165
this._itemMenu = cc.Menu.create();

tests/EventTest/EventTest.js

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ var sceneIdx = -1;
3434
var EventTest = cc.Layer.extend({
3535
ctor:function() {
3636
this._super();
37-
38-
cc.associateWithNative( this, cc.Layer );
3937
this.init();
4038
},
4139

tests/ExtensionsTest/ExtensionsTest.js

-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ var extensionsTestItemNames = [
7979
];
8080

8181
var ExtensionsMainLayer = cc.Layer.extend({
82-
ctor:function() {
83-
this._super();
84-
cc.associateWithNative( this, cc.Layer );
85-
},
86-
8782
onEnter:function () {
8883
this._super();
8984

tests/ExtensionsTest/S9SpriteTest/S9SpriteTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var S9SpriteTestDemo = cc.LayerGradient.extend({
4040

4141
ctor:function() {
4242
this._super();
43-
cc.associateWithNative( this, cc.LayerGradient );
4443
this.init( cc.c4b(0,0,0,255), cc.c4b(98,99,117,255));
4544
cc.SpriteFrameCache.getInstance().addSpriteFrames(s_s9s_blocks9_plist);
4645
cc.log('sprite frames added to sprite frame cache...');

tests/ExtensionsTest/TableViewTest/TableViewTestScene.js

-9
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,12 @@
2525
****************************************************************************/
2626

2727
var CustomTableViewCell = cc.TableViewCell.extend({
28-
ctor:function() {
29-
this._super();
30-
cc.associateWithNative( this, cc.TableViewCell );
31-
},
32-
3328
draw:function (ctx) {
3429
this._super(ctx);
3530
}
3631
});
3732

3833
var TableViewTestLayer = cc.Layer.extend({
39-
ctor:function() {
40-
this._super();
41-
cc.associateWithNative( this, cc.Layer );
42-
},
4334

4435
init:function () {
4536
if (!this._super()) {

tests/IntervalTest/IntervalTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ IntervalLayer = cc.LayerGradient.extend({
4242

4343
ctor:function () {
4444
this._super();
45-
cc.associateWithNative( this, cc.LayerGradient );
4645
this.init( cc.c4b(0,0,0,255), cc.c4b(98,99,117,255));
4746

4847
this.time0 = this.time1 = this.time2 = this.time3 = this.time4 = 0.0;

tests/MenuTest/MenuTest.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var TAG_MENU1 = 77771;
3636
//------------------------------------------------------------------
3737
var MenuLayerMainMenu = cc.Layer.extend({
3838
ctor:function () {
39-
cc.associateWithNative(this, cc.Layer);
39+
this._super();
4040
this.init();
4141
},
4242
init:function () {
@@ -165,7 +165,7 @@ var MenuLayer2 = cc.Layer.extend({
165165
_alignedH:false,
166166

167167
ctor:function () {
168-
cc.associateWithNative(this, cc.Layer);
168+
this._super();
169169
this.init();
170170
},
171171
init:function () {
@@ -250,7 +250,7 @@ var MenuLayer3 = cc.Layer.extend({
250250
_disabledItem:null,
251251

252252
ctor:function () {
253-
cc.associateWithNative(this, cc.Layer);
253+
this._super();
254254
this.init();
255255
},
256256
init:function () {
@@ -311,7 +311,7 @@ var MenuLayer3 = cc.Layer.extend({
311311

312312
var MenuLayer4 = cc.Layer.extend({
313313
ctor:function () {
314-
cc.associateWithNative(this, cc.Layer);
314+
this._super();
315315
this.init();
316316
},
317317
init:function () {
@@ -409,7 +409,7 @@ var MenuLayerPriorityTest = cc.Layer.extend({
409409
_priority:false,
410410

411411
ctor:function () {
412-
cc.associateWithNative(this, cc.Layer);
412+
this._super();
413413
this.init();
414414

415415
this._menu1 = cc.Menu.create();

tests/OpenGLTest/OpenGLTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ var GLNodeCCAPITest = OpenGLTestLayer.extend({
549549
var ShaderNode = cc.GLNode.extend({
550550
ctor:function(vertexShader, framentShader) {
551551
this._super();
552-
cc.associateWithNative( this, cc.GLNode );
553552
this.init();
554553

555554
if( 'opengl' in sys.capabilities ) {

tests/PerformanceTest/PerformanceAnimationTest.js

-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ var CharacterView = cc.Node.extend({
167167
rightItem:null,
168168
leftX:null,
169169

170-
ctor:function() {
171-
this._super();
172-
cc.associateWithNative(this, cc.Node);
173-
},
174170
init: function() {
175171
this._super();
176172
cc.SpriteFrameCache.getInstance().addSpriteFrames("res/animations/crystals.plist");

tests/PerformanceTest/PerformanceNodeChildrenTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ var NodeChildrenMainScene = cc.Scene.extend({
7474

7575
ctor:function() {
7676
this._super();
77-
cc.associateWithNative( this, cc.Scene );
7877
this.init();
7978
},
8079

tests/PerformanceTest/PerformanceParticleTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ var ParticleMainScene = cc.Scene.extend({
7878
_subtestNumber:null,
7979
ctor:function () {
8080
this._super();
81-
cc.associateWithNative(this, cc.Scene);
8281
this.init();
8382
},
8483
initWithSubTest:function (asubtest, particles) {

tests/PerformanceTest/PerformanceSpriteTest.js

-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ var SpriteMainScene = cc.Scene.extend({
280280
_subtestNumber:1,
281281
ctor:function() {
282282
this._super();
283-
cc.associateWithNative( this, cc.Scene );
284283
this.init();
285284
},
286285

tests/PerformanceTest/PerformanceSpriteTest2.js

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ var PerformanceTestBase = cc.Layer.extend({
9191

9292
ctor:function() {
9393
this._super();
94-
cc.associateWithNative( this, cc.Layer );
9594
this.init();
9695
},
9796
onEnter:function () {

tests/PerformanceTest/PerformanceTest.js

-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ var PerformanceTests = [
4343
var PerformanceMainLayer = cc.LayerGradient.extend({
4444
ctor:function() {
4545
this._super();
46-
cc.associateWithNative( this, cc.LayerGradient );
4746
this.init( cc.c4b(0,0,0,255), cc.c4b(98,99,117,255));
4847
},
4948

@@ -107,7 +106,6 @@ var PerformBasicLayer = cc.Layer.extend({
107106
_curCase:0,
108107
ctor:function () {
109108
this._super();
110-
cc.associateWithNative( this, cc.Layer );
111109
this.init();
112110
this._curCase = nCurCase;
113111
},

tests/RotateWorldTest/RotateWorldTest.js

-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var RotateWorldTestScene = TestScene.extend({
3636
var SpriteLayer = cc.Layer.extend({
3737
ctor:function () {
3838
this._super();
39-
cc.associateWithNative(this, cc.Layer);
4039
this.init();
4140
},
4241

@@ -90,7 +89,6 @@ SpriteLayer.create = function () {
9089
var TestLayer = cc.Layer.extend({
9190
ctor:function () {
9291
this._super();
93-
cc.associateWithNative(this, cc.Layer);
9492
this.init();
9593
},
9694

@@ -121,7 +119,6 @@ TestLayer.create = function () {
121119
var RotateWorldMainLayer = cc.Layer.extend({
122120
ctor:function () {
123121
this._super();
124-
cc.associateWithNative(this, cc.Layer);
125122
this.init();
126123
},
127124

0 commit comments

Comments
 (0)