Skip to content

Commit

Permalink
Merge branch 'v3.7-release' of https://github.com/cocos2d/cocos2d-x i…
Browse files Browse the repository at this point in the history
…nto v3

Conflicts:
	docs/RELEASE_NOTES.md
	web
  • Loading branch information
pandamicro committed Jul 15, 2015
2 parents 3c08b49 + 650f045 commit 436564f
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 533 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ cocos2d-x-3.8 ??
[FIX] renderer: UI component can't click correctly by moving UI and camera far away of origin.
[FIX] JS: Fixed issue of iOS/JS reflection `callStaticMethod` with bool arg

cocos2d-x-3.7rc1 July.14 2015
[REFINE] framework: Used msbuild to generating engine prebuilt libs on win32.
[REFINE] 3d: Used shader with normal while creating mesh with normals
[REFINE] 3d: Set default 3d animation quality to low
[REFINE] web: Improved localStorage warning when disabled

[FIX] studio: Fixed percentage setting won't take effect when UISlider's background resource set to null
[FIX] studio: Fixed a bug that SingleNode's color isn't set
[FIX] studio: Fixed child nodes can't be rendered when particle and TiledMap as parent and their resource have been removed from disk
[FIX] studio: Fixed a bug of JSON parser that texture address is wrong
[FIX] studio: Fixed a bug that drawLine & drawPoints don't apply blend function in parser
[FIX] studio: Fixed a bug that check box front cross texture will expand to normal size when change status between normal and disable frequently
[FIX] studio: Fixed a bug that normal texture won't show when slider set to disable mode then clean slider ball disable texture
[FIX] 3d: Fixed obj loading failed on windows
[FIX] 3d: Fixed clipping node does not work for Sprite3D
[FIX] platform: Fixed js template run error on linux
[FIX] Tilemap: Fixed CCTMXXMLParser code negligence
[FIX] JS: Fixed constant value error for ccui.Layout.BACKGROUND_IMAGE_ZORDER
[FIX] JS: Fixed XMLHttpRequest can't be retain in JSB
[FIX] JS: Added cc.path.mainFileName
[FIX] JS: Fixed issue that override cleanup function in JS can't get invoked during node detaching
[FIX] JS: Fixed cc.loader notification issue with image asynchonous loading
[FIX] web: Fixed MenuItems' color/opacity setter issue with child nodes
[FIX] web: Fixed page view's layout issue for JSON parser
[FIX] web: Add ttc loader and prevent the pure digital fonts is invalid
[FIX] web: Fixed Float32Array initialization
[FIX] web: Fixed a bug that layout background is missing
[FIX] web: Fixed a bug that ObjectExtensionData miss setCustomProperty and getCustomProperty function

cocos2d-x-3.7rc0 July.1 2015
[HIGHLIGHT] core: Added Material system (JS/Lua ready)
[HIGHLIGHT] 3d: Added Physics3d support (JS/Lua ready)
Expand Down
2 changes: 1 addition & 1 deletion cocos/cocos2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ NS_CC_BEGIN

CC_DLL const char* cocos2dVersion()
{
return "cocos2d-x-3.7rc0";
return "cocos2d-x-3.7rc1";
}

NS_CC_END
Expand Down
5 changes: 5 additions & 0 deletions cocos/scripting/js-bindings/manual/ScriptingCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ int ScriptingCore::handleNodeEvent(void* data)
}
else if (action == kNodeOnCleanup) {
cleanupSchedulesAndActions(p);

if (isFunctionOverridedInJS(JS::RootedObject(_cx, p->obj.get()), "cleanup", js_cocos2dx_Node_cleanup))
{
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "cleanup", 1, &dataVal, &retval);
}
}

return ret;
Expand Down
2 changes: 1 addition & 1 deletion cocos/scripting/js-bindings/manual/ScriptingCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <assert.h>
#include <memory>

#define ENGINE_VERSION "Cocos2d-JS v3.7 RC0"
#define ENGINE_VERSION "Cocos2d-JS v3.7 RC1"

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

Expand Down
44 changes: 33 additions & 11 deletions cocos/scripting/js-bindings/script/jsb_boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,20 @@ cc.path = {
if(index < 0) return null;
return pathStr.substring(index, pathStr.length);
},

/**
* Get the main name of a file name
* @param {string} fileName
* @returns {string}
*/
mainFileName: function(fileName){
if(fileName){
var idx = fileName.lastIndexOf(".");
if(idx !== -1)
return fileName.substring(0,idx);
}
return fileName;
},

/**
* Get the file name of a file path.
Expand Down Expand Up @@ -625,15 +639,18 @@ cc.loader = {
}
var basePath = loader.getBasePath ? loader.getBasePath() : self.resPath;
var realUrl = self.getUrl(basePath, url);
var data = loader.load(realUrl, url);
if (data) {
self.cache[url] = data;
cb(null, data);
} else {
self.cache[url] = null;
delete self.cache[url];
cb();
}

loader.load(realUrl, url, item, function (err, data) {
if (err) {
cc.log(err);
self.cache[url] = null;
delete self.cache[url];
cb();
} else {
self.cache[url] = data;
cb(null, data);
}
});
},

/**
Expand Down Expand Up @@ -776,13 +793,18 @@ cc.loader = {
* Release the cache of resource by url.
* @param url
*/
release : function(url){//do nothing in jsb
release : function(url){
var cache = this.cache;
delete cache[url];
},

/**
* Resource cache of all resources.
*/
releaseAll : function(){//do nothing in jsb
releaseAll : function(){
var locCache = this.cache;
for (var key in locCache)
delete locCache[key];
}

};
Expand Down
2 changes: 1 addition & 1 deletion cocos/scripting/js-bindings/script/jsb_cocos2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// CCConfig.js
//
cc.ENGINE_VERSION = "Cocos2d-JS v3.7 RC0";
cc.ENGINE_VERSION = "Cocos2d-JS v3.7 RC1";

cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0;
cc.DIRECTOR_STATS_POSITION = {x: 0, y: 0};
Expand Down
40 changes: 26 additions & 14 deletions cocos/scripting/js-bindings/script/jsb_loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
//

cc._emptyLoader = {
load : function(realUrl, url){
load : function(realUrl, url, res, cb){
cb && cb(null, null);
return null;
}
};
Expand All @@ -39,21 +40,25 @@ cc.loader.register([
cc._emptyLoader);

cc._txtLoader = {
load : function(realUrl, url){
return jsb.fileUtils.getStringFromFile(realUrl);
load : function(realUrl, url, res, cb){
var result = jsb.fileUtils.getStringFromFile(realUrl);
cb && cb(null, result);
return result;
}
};
cc.loader.register(["txt", "xml", "vsh", "fsh", "tmx", "tsx"], cc._txtLoader);

cc._jsonLoader = {
load : function(realUrl, url){
var data = jsb.fileUtils.getStringFromFile(realUrl);
load : function(realUrl, url, res, cb){
var data = jsb.fileUtils.getStringFromFile(realUrl), result;
try{
return JSON.parse(data);
result = JSON.parse(data);
}catch(e){
cc.error(e);
return null;
result = null;
}
cb && cb(null, result);
return result;
}
};
cc.loader.register(["json", "ExportJson"], cc._jsonLoader);
Expand All @@ -73,16 +78,20 @@ cc._imgLoader = {
cc.loader.register(["png", "jpg", "bmp","jpeg","gif"], cc._imgLoader);

cc._plistLoader = {
load : function(realUrl, url){
load : function(realUrl, url, res, cb){
var content = jsb.fileUtils.getStringFromFile(realUrl);
return cc.plistParser.parse(content);
var result = cc.plistParser.parse(content);
cb && cb(null, result);
return result;
}
};
cc.loader.register(["plist"], cc._plistLoader);

cc._binaryLoader = {
load : function(realUrl, url){
return cc.loader.loadBinarySync(realUrl);
load : function(realUrl, url, res, cb){
var result = cc.loader.loadBinarySync(realUrl);
cb && cb(null, result);
return result;
}
};
cc.loader.register(["ccbi"], cc._binaryLoader);
Expand Down Expand Up @@ -166,9 +175,12 @@ cc._fntLoader = {
return fnt;
},

load : function(realUrl, url){
var data = jsb.fileUtils.getStringFromFile(realUrl);
return this.parseFnt(data, url);
load : function(realUrl, url, res, cb){
var data = jsb.fileUtils.getStringFromFile(realUrl), result = null;
if (data)
result = this.parseFnt(data, url);
cb && cb(null, result);
return result;
}
};
cc.loader.register(["fnt"], cc._fntLoader);
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@
var node,
self = this;
loadTexture(json["FileData"], resourcePath, function(path, type){
if(!cc.loader.getRes(path))
cc.log("%s need to be preloaded", path);
node = new cc.ParticleSystem(path);
self.generalAttributes(node, json);
node.setPositionType(cc.ParticleSystem.TYPE_GROUPED);
Expand Down Expand Up @@ -859,8 +857,6 @@
];
textureList.forEach(function(item){
loadTexture(json[item.name], resourcePath, function(path, type){
if(type === 0 && !loader.getRes(path))
cc.log("%s need to be preloaded", path);
item.handle.call(widget, path, type);
});
});
Expand Down Expand Up @@ -1025,8 +1021,6 @@
var startCharMap = json["StartChar"];

loadTexture(json["LabelAtlasFileImage_CNB"], resourcePath, function(path, type){
if(!cc.loader.getRes(path))
cc.log("%s need to be preloaded", path);
if(type === 0){
widget.setProperty(stringValue, path, itemWidth, itemHeight, startCharMap);
}
Expand All @@ -1051,8 +1045,6 @@
widget.setString(text);

loadTexture(json["LabelBMFontFile_CNB"], resourcePath, function(path, type){
if(!cc.loader.getRes(path))
cc.log("%s need to be pre loaded", path);
widget.setFntFile(path);
});
widget.ignoreContentAdaptWithSize(true);
Expand Down
Loading

0 comments on commit 436564f

Please sign in to comment.