Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #3935 Refactor cc.sys. #1634

Merged
merged 6 commits into from Mar 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
494 changes: 444 additions & 50 deletions CCBoot.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions HelloHTML5World/project.json
@@ -1,9 +1,9 @@
{
"debugMode" : 4,
"debugMode" : 1,
"showFPS" : true,
"frameRate" : 60,
"id" : "gameCanvas",
"renderMode" : 1,
"renderMode" : 2,
"engineDir":"../",

"modules" : ["menus"],
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/clipping-nodes/CCClippingNode.js
Expand Up @@ -456,7 +456,7 @@ cc.ClippingNode = cc.Node.extend(/** @lends cc.ClippingNode# */{

window._proto = cc.ClippingNode.prototype;

if (cc.sys.supportWebGL) {
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
//WebGL
_proto.init = _proto._initForWebGL;
_proto.visit = _proto._visitForWebGL;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/CCDirector.js
Expand Up @@ -1098,7 +1098,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
}
});

if (cc.sys.supportWebGL) {
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
cc.Director.prototype._clear = cc.Director.prototype._clearWebGL;
cc.Director.prototype._beforeVisitScene = cc.Director.prototype._beforeVisitSceneWebGL;
cc.Director.prototype._afterVisitScene = cc.Director.prototype._afterVisitSceneWebGL;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/base-nodes/CCAtlasNode.js
Expand Up @@ -387,7 +387,7 @@ cc.AtlasNode = cc.NodeRGBA.extend(/** @lends cc.AtlasNode# */{
});

window._proto = cc.AtlasNode.prototype;
if(cc.sys.supportWebGL){
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
_proto.initWithTexture = _proto._initWithTextureForWebGL;
_proto.draw = _proto._drawForWebGL;
_proto.setColor = _proto._setColorForWebGL;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/base-nodes/CCNode.js
Expand Up @@ -2291,7 +2291,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{

window._proto = cc.Node.prototype;

if(cc.sys.supportWebGL){
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
//WebGL
_proto.ctor = _proto._ctorForWebGL;
_proto.setNodeDirty = _proto._setNodeDirtyForWebGL;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/labelttf/CCLabelTTF.js
Expand Up @@ -1173,7 +1173,7 @@ cc.LabelTTF = cc.Sprite.extend(/** @lends cc.LabelTTF# */{
});

window._proto = cc.LabelTTF.prototype;
if(cc.sys.supportWebGL){
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
_proto.setColor = cc.Sprite.prototype.setColor;
_proto._setColorsString = _proto._setColorsStringForWebGL;
_proto.updateDisplayedColor = cc.Sprite.prototype.updateDisplayedColor;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/layers/CCLayer.js
Expand Up @@ -612,7 +612,7 @@ cc.LayerColor = cc.LayerRGBA.extend(/** @lends cc.LayerColor# */{
});

window._proto = cc.LayerColor.prototype;
if(cc.sys.supportWebGL){
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
_proto.ctor = _proto._ctorForWebGL;
_proto.setContentSize = _proto._setContentSizeForWebGL;
_proto._setWidth = _proto._setWidthForWebGL;
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/platform/CCMacro.js
Expand Up @@ -321,7 +321,7 @@ cc.RECT_POINTS_TO_PIXELS = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (point) {
return p;
};

if (!cc.sys.supportWebGL) {
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
/**
* WebGL constants
* @type {object}
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/core/platform/CCTypes.js
Expand Up @@ -350,7 +350,7 @@ cc.AnimationFrameData = function(texCoords, delay, size){
this.size = size;
};

if(cc.sys.supportWebGL){
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
//redefine some types with ArrayBuffer for WebGL
cc.color = function (r, g, b, a, arrayBuffer, offset) {
if (r === undefined)
Expand Down