Skip to content

Commit 32d03db

Browse files
committed
Merge branch 'develop' into develop-winrt
2 parents e8218ed + 18265fe commit 32d03db

Some content is hidden

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

66 files changed

+2190
-2721
lines changed

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

+2-14
Original file line numberDiff line numberDiff line change
@@ -595,19 +595,14 @@ void ScriptingCore::createGlobalContext() {
595595
#if defined(JS_GC_ZEAL) && defined(DEBUG)
596596
//JS_SetGCZeal(this->_cx, 2, JS_DEFAULT_ZEAL_FREQ);
597597
#endif
598-
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
599-
_global.emplace(_cx);
600-
#else
598+
601599
_global.construct(_cx);
602-
#endif
603600
_global.ref() = NewGlobalObject(_cx);
604601

605602
JSAutoCompartment ac(_cx, _global.ref());
606603

607-
#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
608604
// Removed in Firefox v34
609605
js::SetDefaultObjectForContext(_cx, _global.ref());
610-
#endif
611606

612607
for (std::vector<sc_register_sth>::iterator it = registrationList.begin(); it != registrationList.end(); it++) {
613608
sc_register_sth callback = *it;
@@ -1756,20 +1751,13 @@ bool JSBDebug_BufferWrite(JSContext* cx, unsigned argc, jsval* vp)
17561751

17571752
void ScriptingCore::enableDebugger(unsigned int port)
17581753
{
1759-
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
1760-
if (_debugGlobal.isNothing())
1761-
#else
17621754
if (_debugGlobal.empty())
1763-
#endif
17641755
{
17651756
JSAutoCompartment ac0(_cx, _global.ref().get());
17661757

17671758
JS_SetDebugMode(_cx, true);
1768-
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
1769-
_debugGlobal.emplace(_cx);
1770-
#else
1759+
17711760
_debugGlobal.construct(_cx);
1772-
#endif
17731761
_debugGlobal.ref() = NewGlobalObject(_cx, true);
17741762
// Adds the debugger object to root, otherwise it may be collected by GC.
17751763
//AddObjectRoot(_cx, &_debugGlobal); no need, it's persistent rooted now

frameworks/js-bindings/bindings/manual/ui/jsb_cocos2dx_ui_manual.cpp

+36-24
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ static bool js_cocos2dx_UICheckBox_addEventListener(JSContext *cx, uint32_t argc
184184
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
185185
tmpObj->autorelease();
186186

187-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
188-
if (nullptr == dict)
187+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
188+
if (nullptr == comp)
189189
{
190-
dict = cocos2d::__Dictionary::create();
191-
cobj->setUserObject(dict);
190+
comp = new CallbacksComponent();
191+
comp->autorelease();
192+
cobj->addComponent(comp);
192193
}
194+
cocos2d::__Dictionary* dict = comp->callbacks;
193195
dict->setObject(tmpObj, "checkBoxEventListener");
194196

195197
tmpObj->setJSCallbackFunc(args.get(0));
@@ -236,12 +238,14 @@ static bool js_cocos2dx_UISlider_addEventListener(JSContext *cx, uint32_t argc,
236238
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
237239
tmpObj->autorelease();
238240

239-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
240-
if (nullptr == dict)
241+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
242+
if (nullptr == comp)
241243
{
242-
dict = cocos2d::__Dictionary::create();
243-
cobj->setUserObject(dict);
244+
comp = new CallbacksComponent();
245+
comp->autorelease();
246+
cobj->addComponent(comp);
244247
}
248+
cocos2d::__Dictionary* dict = comp->callbacks;
245249
dict->setObject(tmpObj, "sliderEventListener");
246250

247251
tmpObj->setJSCallbackFunc(args.get(0));
@@ -288,12 +292,14 @@ static bool js_cocos2dx_UITextField_addEventListener(JSContext *cx, uint32_t arg
288292
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
289293
tmpObj->autorelease();
290294

291-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
292-
if (nullptr == dict)
295+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
296+
if (nullptr == comp)
293297
{
294-
dict = cocos2d::__Dictionary::create();
295-
cobj->setUserObject(dict);
298+
comp = new CallbacksComponent();
299+
comp->autorelease();
300+
cobj->addComponent(comp);
296301
}
302+
cocos2d::__Dictionary* dict = comp->callbacks;
297303
dict->setObject(tmpObj, "textfieldEventListener");
298304

299305
tmpObj->setJSCallbackFunc(args.get(0));
@@ -340,12 +346,14 @@ static bool js_cocos2dx_UIPageView_addEventListener(JSContext *cx, uint32_t argc
340346
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
341347
tmpObj->autorelease();
342348

343-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
344-
if (nullptr == dict)
349+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
350+
if (nullptr == comp)
345351
{
346-
dict = cocos2d::__Dictionary::create();
347-
cobj->setUserObject(dict);
352+
comp = new CallbacksComponent();
353+
comp->autorelease();
354+
cobj->addComponent(comp);
348355
}
356+
cocos2d::__Dictionary* dict = comp->callbacks;
349357
dict->setObject(tmpObj, "pageViewEventListener");
350358

351359
tmpObj->setJSCallbackFunc(args.get(0));
@@ -392,12 +400,14 @@ static bool js_cocos2dx_UIScrollView_addEventListener(JSContext *cx, uint32_t ar
392400
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
393401
tmpObj->autorelease();
394402

395-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
396-
if (nullptr == dict)
403+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
404+
if (nullptr == comp)
397405
{
398-
dict = cocos2d::__Dictionary::create();
399-
cobj->setUserObject(dict);
406+
comp = new CallbacksComponent();
407+
comp->autorelease();
408+
cobj->addComponent(comp);
400409
}
410+
cocos2d::__Dictionary* dict = comp->callbacks;
401411
dict->setObject(tmpObj, "scrollViewEventListener");
402412

403413
tmpObj->setJSCallbackFunc(args.get(0));
@@ -443,12 +453,14 @@ static bool js_cocos2dx_UIListView_addEventListener(JSContext *cx, uint32_t argc
443453
JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();
444454
tmpObj->autorelease();
445455

446-
cocos2d::__Dictionary* dict = static_cast<cocos2d::__Dictionary*>(cobj->getUserObject());
447-
if (nullptr == dict)
456+
CallbacksComponent *comp = static_cast<CallbacksComponent *>(cobj->getComponent(CallbacksComponent::NAME));
457+
if (nullptr == comp)
448458
{
449-
dict = cocos2d::__Dictionary::create();
450-
cobj->setUserObject(dict);
459+
comp = new CallbacksComponent();
460+
comp->autorelease();
461+
cobj->addComponent(comp);
451462
}
463+
cocos2d::__Dictionary* dict = comp->callbacks;
452464
dict->setObject(tmpObj, "listViewEventListener");
453465

454466
tmpObj->setJSCallbackFunc(args.get(0));

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

+5
Original file line numberDiff line numberDiff line change
@@ -2799,3 +2799,8 @@ cc.LabelTTF.prototype.setDimensions = function (dim, height) {
27992799
}
28002800
this._setDimensions(dim);
28012801
};
2802+
2803+
//
2804+
// Label enableStroke
2805+
//
2806+
cc.Label.prototype.enableStroke = cc.Label.prototype.enableOutline;

frameworks/js-bindings/bindings/script/studio/parsers/timelineParser-2.x.js

+18-22
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,12 @@
412412

413413
}
414414

415-
var bgStartColor = json["FirstColor"];
416-
var bgEndColor = json["EndColor"];
417-
if(bgStartColor != null && bgEndColor != null){
418-
var startC = getColor(bgStartColor);
419-
if(bgEndColor["R"] == null && bgEndColor["G"] == null && bgEndColor["B"] == null)
420-
widget.setBackGroundColor( startC );
421-
else
422-
widget.setBackGroundColor( startC, getColor(bgEndColor) );
423-
}
415+
var firstColor = json["FirstColor"];
416+
var endColor = json["EndColor"];
417+
if(endColor["R"] != null && endColor["G"] != null && endColor["B"] != null)
418+
widget.setBackGroundColor(getColor(firstColor), getColor(endColor));
419+
else
420+
widget.setBackGroundColor(getColor(json["SingleColor"]));
424421

425422
var colorVector = json["ColorVector"];
426423
if(colorVector != null)
@@ -638,6 +635,10 @@
638635

639636
this.widgetAttributes(widget, json);
640637

638+
loadTexture(json["FileData"], resourcePath, function(path, type){
639+
widget.setBackGroundImage(path, type);
640+
});
641+
641642
var clipEnabled = json["ClipAble"];
642643
widget.setClippingEnabled(clipEnabled);
643644

@@ -684,10 +685,6 @@
684685
widget.setBackGroundColorVector(cc.p(colorVectorX, colorVectorY));
685686
}
686687

687-
loadTexture(json["FileData"], resourcePath, function(path, type){
688-
widget.setBackGroundImage(path, type);
689-
});
690-
691688
var innerNodeSize = json["InnerNodeSize"];
692689
var innerSize = cc.size(
693690
innerNodeSize["Width"] || 0,
@@ -822,6 +819,10 @@
822819

823820
this.widgetAttributes(widget, json);
824821

822+
loadTexture(json["FileData"], resourcePath, function(path, type){
823+
widget.setBackGroundImage(path, type);
824+
});
825+
825826
var clipEnabled = json["ClipAble"] || false;
826827
widget.setClippingEnabled(clipEnabled);
827828

@@ -862,10 +863,6 @@
862863
if(bgColorOpacity != null)
863864
widget.setBackGroundColorOpacity(bgColorOpacity);
864865

865-
loadTexture(json["FileData"], resourcePath, function(path, type){
866-
widget.setBackGroundImage(path, type);
867-
});
868-
869866
setContentSize(widget, json["Size"]);
870867

871868
return widget;
@@ -884,6 +881,10 @@
884881

885882
this.widgetAttributes(widget, json);
886883

884+
loadTexture(json["FileData"], resourcePath, function(path, type){
885+
widget.setBackGroundImage(path, type);
886+
});
887+
887888
var clipEnabled = json["ClipAble"] || false;
888889
widget.setClippingEnabled(clipEnabled);
889890

@@ -957,11 +958,6 @@
957958
if(bgColorOpacity != null)
958959
widget.setBackGroundColorOpacity(bgColorOpacity);
959960

960-
961-
loadTexture(json["FileData"], resourcePath, function(path, type){
962-
widget.setBackGroundImage(path, type);
963-
});
964-
965961
setContentSize(widget, json["Size"]);
966962

967963
return widget;

frameworks/js-bindings/external/spidermonkey/include/ios/js-config-32.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
/* #undef JS_PUNBOX64 */
4848

4949
/* MOZILLA JSAPI version number components */
50-
#define MOZJS_MAJOR_VERSION 34
51-
#define MOZJS_MINOR_VERSION 0
50+
#define MOZJS_MAJOR_VERSION 33
51+
#define MOZJS_MINOR_VERSION 1
5252

5353
#endif /* js_config_h */

frameworks/js-bindings/external/spidermonkey/include/ios/js-config-64.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define JS_PUNBOX64 1
4848

4949
/* MOZILLA JSAPI version number components */
50-
#define MOZJS_MAJOR_VERSION 34
51-
#define MOZJS_MINOR_VERSION 0
50+
#define MOZJS_MAJOR_VERSION 33
51+
#define MOZJS_MINOR_VERSION 1
5252

5353
#endif /* js_config_h */

0 commit comments

Comments
 (0)