Skip to content

Commit a474d6a

Browse files
committed
Merge pull request #1635 from pandamicro/develop
Update runtime
2 parents 06d3e26 + 7252910 commit a474d6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1730
-370
lines changed

build/cocos2d_jsb_samples.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@
14981498
FRAMEWORK_SEARCH_PATHS = (
14991499
"$(inherited)",
15001500
"$(SRCROOT)/../frameworks/js-bindings/cocos2d-x/plugin/plugins/facebook/proj.ios",
1501-
"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks",
15021501
);
15031502
GCC_DYNAMIC_NO_PIC = NO;
15041503
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
@@ -1532,7 +1531,6 @@
15321531
FRAMEWORK_SEARCH_PATHS = (
15331532
"$(inherited)",
15341533
"$(SRCROOT)/../frameworks/js-bindings/cocos2d-x/plugin/plugins/facebook/proj.ios",
1535-
"$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks",
15361534
);
15371535
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
15381536
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;

frameworks/cocos2d-html5

frameworks/js-bindings/bindings/manual/ScriptingCore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <assert.h>
4040
#include <memory>
4141

42-
#define ENGINE_VERSION "Cocos2d-JS v3.4"
42+
#define ENGINE_VERSION "Cocos2d-JS v3.5"
4343

4444
void js_log(const char *format, ...);
4545

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
// CCConfig.js
2828
//
29-
cc.ENGINE_VERSION = "Cocos2d-JS v3.4";
29+
cc.ENGINE_VERSION = "Cocos2d-JS v3.5";
3030

3131
cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0;
3232
cc.DIRECTOR_STATS_POSITION = {x: 0, y: 0};

frameworks/js-bindings/cocos2d-x

Submodule cocos2d-x updated 1 file
Binary file not shown.
Binary file not shown.
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
/****************************************************************************
2+
Copyright (c) 2008-2010 Ricardo Quesada
3+
Copyright (c) 2011-2012 cocos2d-x.org
4+
Copyright (c) 2013-2014 Chukong Technologies Inc.
5+
6+
http://www.cocos2d-x.org
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.
25+
****************************************************************************/
26+
cc.CameraFlag = {
27+
DEFAULT : 1,
28+
USER1 : 1 << 1,
29+
USER2 : 1 << 2,
30+
USER3 : 1 << 3,
31+
USER4 : 1 << 4,
32+
USER5 : 1 << 5,
33+
USER6 : 1 << 6,
34+
USER7 : 1 << 7,
35+
USER8 : 1 << 8
36+
};
37+
38+
cc.LightType = {
39+
DIRECTIONAL : 0,
40+
POINT : 1,
41+
SPOT : 2,
42+
AMBIENT : 3,
43+
};
44+
45+
cc.LightFlag = {
46+
LIGHT0 : 1,
47+
LIGHT1 : 1 << 1,
48+
LIGHT2 : 1 << 2,
49+
LIGHT3 : 1 << 3,
50+
LIGHT4 : 1 << 4,
51+
LIGHT5 : 1 << 5,
52+
LIGHT6 : 1 << 6,
53+
LIGHT7 : 1 << 7,
54+
LIGHT8 : 1 << 8,
55+
LIGHT9 : 1 << 9,
56+
LIGHT10 : 1 << 10,
57+
LIGHT11 : 1 << 11,
58+
LIGHT12 : 1 << 12,
59+
LIGHT13 : 1 << 13,
60+
LIGHT14 : 1 << 14,
61+
LIGHT15 : 1 << 15,
62+
};
63+
64+
cc.AsyncTaskPool.TaskType = {
65+
TASK_IO : 0,
66+
TASK_NETWORK : 1,
67+
TASK_OTHER : 2,
68+
TASK_MAX_TYPE : 3
69+
};
70+
71+
jsb.BillBoard.Mode = {
72+
VIEW_POINT_ORIENTED : 0, // orient to the camera
73+
VIEW_PLANE_ORIENTED : 1 // orient to the XOY plane of camera
74+
};
75+
76+
cc.attributeNames = [cc.ATTRIBUTE_NAME_POSITION,
77+
cc.ATTRIBUTE_NAME_COLOR,
78+
cc.ATTRIBUTE_NAME_TEX_COORD,
79+
cc.ATTRIBUTE_NAME_TEX_COORD1,
80+
cc.ATTRIBUTE_NAME_TEX_COORD2,
81+
cc.ATTRIBUTE_NAME_TEX_COORD3,
82+
cc.ATTRIBUTE_NAME_NORMAL,
83+
cc.ATTRIBUTE_NAME_BLEND_WEIGHT,
84+
cc.ATTRIBUTE_NAME_BLEND_INDEX];
85+
86+
cc.math = cc.math || {};
87+
88+
cc.math.Vec3 = function(x=0, y=0, z=0){
89+
this.x = x;
90+
this.y = y;
91+
this.z = z;
92+
};
93+
94+
cc.math.Vec3.prototype.normalize = function(){
95+
var n = this.x * this.x + this.y * this.y + this.z * this.z;
96+
n = 1 / Math.sqrt(n);
97+
this.x *= n;
98+
this.y *= n;
99+
this.z *= n;
100+
};
101+
102+
cc.math.vec3 = function(x, y, z){
103+
return new cc.math.Vec3(x, y, z);
104+
};
105+
106+
cc.math.vec3Cross = function(v1, v2){
107+
return new cc.math.Vec3(v1.y * v2.z - v1.z * v2.y,
108+
v1.z * v2.x - v1.x * v2.z,
109+
v1.x * v2.y - v1.y * v2.x);
110+
};
111+
112+
cc.math.vec3Dot = function(v1, v2){
113+
return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
114+
};
115+
116+
cc.math.vec3Length = function(v){
117+
return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
118+
};
119+
120+
cc.math.vec3Normalize = function(v){
121+
var n = v.x * v.x + v.y * v.y + v.z * v.z;
122+
n = 1 / Math.sqrt(n);
123+
return cc.math.vec3(v.x * n, v.y * n, v.z * n);
124+
};
125+
126+
cc.math.vec3Add = function(v1, v2){
127+
return new cc.math.Vec3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
128+
};
129+
130+
cc.math.vec3Sub = function(v1, v2){
131+
return new cc.math.Vec3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
132+
};
133+
134+
cc.math.Quaternion = function(x=0, y=0, z=0, w=0){
135+
this.x = x;
136+
this.y = y;
137+
this.z = z;
138+
this.w = w;
139+
};
140+
141+
cc.math.quaternion = function(xOrAxis, yOrAngle, z, w){
142+
if(w !== undefined){
143+
return new cc.math.Quaternion(xOrAxis, yOrAngle, z, w);
144+
}
145+
else if(yOrAngle !== undefined){
146+
var sinHalfAngle = Math.sin(yOrAngle / 2);
147+
var normal = cc.math.vec3(xOrAxis.x, xOrAxis.y, xOrAxis.z);
148+
normal.normalize();
149+
return cc.math.quaternion(normal.x * sinHalfAngle, normal.y * sinHalfAngle, normal.z * sinHalfAngle, Math.cos(yOrAngle / 2));
150+
}
151+
};
152+
153+
cc.math.AABB = function(min=cc.math.vec3(99999, 99999, 99999), max=cc.math.vec3(-99999, -99999, -99999)){
154+
this.min = min;
155+
this.max = max;
156+
};
157+
158+
cc.math.aabb = function(min, max){
159+
return new cc.math.AABB(min, max);
160+
};
161+
162+
cc.math.aabbGetCorners = function(aabb){
163+
var corners = new Array(8);
164+
corners[0] = cc.math.vec3(aabb.min.x, aabb.max.y, aabb.max.z);
165+
corners[1] = cc.math.vec3(aabb.min.x, aabb.min.y, aabb.max.z);
166+
corners[2] = cc.math.vec3(aabb.max.x, aabb.min.y, aabb.max.z);
167+
corners[3] = cc.math.vec3(aabb.max.x, aabb.max.y, aabb.max.z);
168+
169+
corners[4] = cc.math.vec3(aabb.max.x, aabb.max.y, aabb.min.z);
170+
corners[5] = cc.math.vec3(aabb.max.x, aabb.min.y, aabb.min.z);
171+
corners[6] = cc.math.vec3(aabb.min.x, aabb.min.y, aabb.min.z);
172+
corners[7] = cc.math.vec3(aabb.min.x, aabb.max.y, aabb.min.z);
173+
return corners;
174+
};
175+
176+
cc.math.OBB = function(aabb){
177+
this.center = cc.math.vec3((aabb.min.x + aabb.max.x)/2, (aabb.min.y + aabb.max.y)/2, (aabb.min.z + aabb.max.z)/2); // obb center
178+
this.xAxis = cc.math.vec3(1, 0, 0); // x axis of obb, unit vector
179+
this.yAxis = cc.math.vec3(0, 1, 0); // y axis of obb, unit vecotr
180+
this.zAxis = cc.math.vec3(0, 0, 1); // z axis of obb, unit vector
181+
this.extents = cc.math.vec3((aabb.max.x - aabb.min.x)/2, (aabb.max.y - aabb.min.y)/2, (aabb.max.z - aabb.min.z)/2); // obb length along each axis
182+
this.extentX = cc.math.vec3((aabb.max.x - aabb.min.x)/2, 0, 0); // _xAxis * _extents.x
183+
this.extentY = cc.math.vec3(0, (aabb.max.y - aabb.min.y)/2, 0); // _yAxis * _extents.y
184+
this.extentZ = cc.math.vec3(0, 0, (aabb.max.z - aabb.min.z)/2); // _zAxis * _extents.z
185+
};
186+
187+
cc.math.obb = function(aabb){
188+
return new cc.math.OBB(aabb);
189+
};
190+
191+
cc.math.Ray = function(origin = cc.math.vec3(0, 0, 0), direction = cc.math.vec3(0, 0, 1)){
192+
this.origin = origin;
193+
this.direction = direction;
194+
};
195+
196+
cc.math.ray = function(origin, direction){
197+
return new cc.math.Ray(origin, direction);
198+
};
199+
200+
cc.math.Vec4 = cc.math.Quaternion;
201+
202+
cc.math.vec4 = function(x, y, z, w){
203+
return new cc.math.Vec4(x, y, z, w);
204+
};
205+
206+
jsb.sprite3DCache = jsb.Sprite3DCache.getInstance();
207+
208+
jsb.Sprite3D.extend = cc.Class.extend;
209+
210+
jsb.Sprite3D.prototype._setBlendFunc = jsb.Sprite3D.prototype.setBlendFunc;
211+
jsb.Sprite3D.prototype.setBlendFunc = templateSetBlendFunc;
212+
213+
jsb.Mesh.prototype._setBlendFunc = jsb.Mesh.prototype.setBlendFunc;
214+
jsb.Mesh.prototype.setBlendFunc = templateSetBlendFunc;
215+
216+
jsb.Sprite3D.prototype._ctor = function(modelPath, texturePath){
217+
if(modelPath === undefined){
218+
this.init();
219+
}else{
220+
if(modelPath.length < 4){
221+
cc.log("invalid filename for Sprite3D");
222+
return;
223+
}
224+
this.initWithFile(modelPath);
225+
var bb = this.getBoundingBox();
226+
this.setContentSize(cc.size(bb.width, bb.height));
227+
228+
if(texturePath !== undefined)
229+
this.setTexture(texturePath);
230+
}
231+
};
232+
233+
jsb.BillBoard.prototype._ctor = function(filename, rect, mode = jsb.BillBoard.Mode.VIEW_POINT_ORIENTED){
234+
if(filename !== undefined && filename instanceof cc.Texture2D){
235+
rect = rect || jsb.BillBoard.Mode.VIEW_POINT_ORIENTED;
236+
this.initWithTexture(filename);
237+
this.setMode(rect);
238+
}else if(filename !== undefined && typeof filename === "string"){
239+
if(rect !== undefined){
240+
if(typeof rect === "object"){
241+
this.initWithFile(filename, rect);
242+
this.setMode(mode);
243+
}else{
244+
this.initWithFile(filename);
245+
this.setMode(rect);
246+
}
247+
}else{
248+
this.initWithFile(filename);
249+
this.setMode(jsb.BillBoard.Mode.VIEW_POINT_ORIENTED);
250+
}
251+
}else{
252+
filename = filename || jsb.BillBoard.Mode.VIEW_POINT_ORIENTED;
253+
this.init();
254+
this.setMode(filename);
255+
}
256+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/****************************************************************************
2+
Copyright (c) 2008-2010 Ricardo Quesada
3+
Copyright (c) 2011-2012 cocos2d-x.org
4+
Copyright (c) 2013-2014 Chukong Technologies Inc.
5+
6+
http://www.cocos2d-x.org
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.
25+
****************************************************************************/
26+
27+
jsb.ParticleSystem3D.prototype._setBlendFunc = jsb.ParticleSystem3D.prototype.setBlendFunc;
28+
jsb.ParticleSystem3D.prototype.setBlendFunc = templateSetBlendFunc;

0 commit comments

Comments
 (0)