Skip to content

Commit 69dee37

Browse files
committed
Merge pull request #1132 from IgorMats/develop
Add SkeletonAnimation and GLProgram to the list of extendable classes.
2 parents 79ba1ec + d87ac95 commit 69dee37

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

frameworks/js-bindings/bindings/script/jsb.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,7 @@ if (jsb.fileUtils.isFileExist('jsb_pluginx.js')) {
125125
require('jsb_pluginx.js');
126126
}
127127
}
128+
129+
if (window.sp) {
130+
require('script/jsb_spine.js');
131+
}

frameworks/js-bindings/bindings/script/jsb_cocos2d.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,7 @@ cc.TMXLayer.extend = cc.Class.extend;
14611461
cc.TMXTiledMap.extend = cc.Class.extend;
14621462
cc.TMXMapInfo.extend = cc.Class.extend;
14631463
cc.TransitionScene.extend = cc.Class.extend;
1464+
cc.GLProgram.extend = cc.Class.extend;
14641465

14651466

14661467
// Cocos2d-html5 supports multi scene resources preloading.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2013-2014 Chukong Technologies Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
* THE SOFTWARE.
21+
*/
22+
23+
sp.SkeletonAnimation.prototype._ctor = function(skeletonDataFile, atlasFile, scale) {
24+
if(atlasFile) {
25+
this.initWithFile(skeletonDataFile, atlasFile, scale);
26+
this.initialize();
27+
}
28+
};
29+
30+
sp.SkeletonAnimation.extend = cc.Class.extend;

tools/tojs/cocos2dx.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAu
2929

3030
classes = New.* Sprite SpriteBatchNode SpriteFrame SpriteFrameCache Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn ReverseTime Animate AnimationFrame Animation AnimationCache Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc CallFuncN RenderTexture GridAction Grid3DAction Grid3D TiledGrid3D GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Lens3D Ripple3D PageTurn3D ShakyTiles3D ShatteredTiles3D WavesTiles3D JumpTiles3D Speed ActionManager Set SimpleAudioEngine Scheduler Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram GLProgramCache Application ClippingNode MotionStreak TextFieldTTF GLViewProtocol GLView Component ComponentContainer __NodeRGBA __LayerRGBA SAXParser Event(?!.*(Physics).*).* Device Configuration ProtectedNode GLProgramState Image
3131

32-
classes_need_extend = Node __NodeRGBA Layer.* Sprite SpriteBatchNode SpriteFrame Menu MenuItem.* Scene DrawNode Component .*Action.* GridBase Grid3D TiledGrid3D MotionStreak ParticleBatchNode ParticleSystem TextFieldTTF RenderTexture TileMapAtlas TMXLayer TMXTiledMap TMXMapInfo TransitionScene ProgressTimer ParallaxNode Label.*
32+
classes_need_extend = Node __NodeRGBA Layer.* Sprite SpriteBatchNode SpriteFrame Menu MenuItem.* Scene DrawNode Component .*Action.* GridBase Grid3D TiledGrid3D MotionStreak ParticleBatchNode ParticleSystem TextFieldTTF RenderTexture TileMapAtlas TMXLayer TMXTiledMap TMXMapInfo TransitionScene ProgressTimer ParallaxNode Label.* GLProgram
3333

3434
# what should we skip? in the format ClassName::[function function]
3535
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also

tools/tojs/cocos2dx_spine.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ headers = %(cocosdir)s/cocos/editor-support/spine/spine-cocos2dx.h
2222

2323
classes = SkeletonRenderer SkeletonAnimation
2424

25+
classes_need_extend = SkeletonAnimation
26+
2527
skip = SkeletonRenderer::[createWithData findBone findSlot getAttachment],
2628
SkeletonAnimation::[createWithData getCurrent setAnimation addAnimation setAnimationListener]
2729

0 commit comments

Comments
 (0)