Skip to content

Commit c27fa16

Browse files
committed
Fix advanced release mode
1 parent 6390735 commit c27fa16

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

Diff for: CCBoot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ cc.loader = (function () {
992992
delete _queue[url];
993993
}
994994

995-
if (ENABLE_IMAEG_POOL && cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
995+
if (window.ENABLE_IMAEG_POOL && cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
996996
imagePool.put(img);
997997
}
998998
};

Diff for: cocos2d/core/base-nodes/CCNodeWebGLRenderCmd.js

+2
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,6 @@
6060
set: function (value) { this.setShaderProgram(value); },
6161
get: function () { return this.getShaderProgram(); }
6262
});
63+
/** @expose */
64+
proto._shaderProgram;
6365
})();

Diff for: cocos2d/core/platform/CCClass.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ cc.inject = function (srcPrototype, destPrototype) {
140140
* @namespace
141141
* @name ClassManager
142142
*/
143-
var ClassManager = {
144-
id : (0|(Math.random()*998)),
143+
var ClassManager = function () {
144+
var id = (0|(Math.random()*998));
145+
var instanceId = (0|(Math.random()*998));
145146

146-
instanceId : (0|(Math.random()*998)),
147-
148-
getNewID : function(){
149-
return this.id++;
150-
},
147+
this.getNewID = function () {
148+
return id++;
149+
};
151150

152-
getNewInstanceId : function(){
153-
return this.instanceId++;
154-
}
151+
this.getNewInstanceId = function () {
152+
return instanceId++;
153+
};
155154
};
155+
var classManager = new ClassManager();
156156

157157
/* Managed JavaScript Inheritance
158158
* Based on John Resig's Simple JavaScript Inheritance http://ejohn.org/blog/simple-javascript-inheritance/
@@ -192,7 +192,7 @@ var ClassManager = {
192192
var Class;
193193
if (cc.game.config && cc.game.config[cc.game.CONFIG_KEY.exposeClassName]) {
194194
var constructor = "(function " + (props._className || "Class") + " (arg0, arg1, arg2, arg3, arg4, arg5) {\n";
195-
constructor += " this.__instanceId = ClassManager.getNewInstanceId();\n";
195+
constructor += " this.__instanceId = classManager.getNewInstanceId();\n";
196196
constructor += " if (this.ctor) {\n";
197197
constructor += " switch (arguments.length) {\n";
198198
constructor += " case 0: this.ctor(); break;\n";
@@ -208,7 +208,7 @@ var ClassManager = {
208208
}
209209
else {
210210
Class = function (arg0, arg1, arg2, arg3, arg4) {
211-
this.__instanceId = ClassManager.getNewInstanceId();
211+
this.__instanceId = classManager.getNewInstanceId();
212212
if (this.ctor) {
213213
switch (arguments.length) {
214214
case 0: this.ctor(); break;
@@ -223,7 +223,7 @@ var ClassManager = {
223223
};
224224
}
225225

226-
desc.value = ClassManager.getNewID();
226+
desc.value = classManager.getNewID();
227227
Object.defineProperty(prototype, '__pid', desc);
228228

229229
// Populate our constructed prototype object

Diff for: cocos2d/core/textures/TexturesWebGL.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ cc._tmp.WebGLTexture2D = function () {
496496

497497
self._hasPremultipliedAlpha = premultiplied;
498498
self._hasMipmaps = false;
499-
if (ENABLE_IMAEG_POOL) {
499+
if (window.ENABLE_IMAEG_POOL) {
500500
self._htmlElementObj = null;
501501
}
502502

0 commit comments

Comments
 (0)