@@ -52,7 +52,7 @@ cc.clone = function (obj) {
52
52
* @param {object } jsobj subclass
53
53
* @param {object } klass superclass
54
54
*/
55
- cc . associateWithNative = function ( jsobj , superclass ) {
55
+ cc . associateWithNative = function ( jsobj , superclass ) {
56
56
} ;
57
57
58
58
/**
@@ -135,40 +135,49 @@ cc.MessageBox = function (message) {
135
135
console . log ( message ) ;
136
136
} ;
137
137
138
- // cocos2d debug
139
- if ( cc . COCOS2D_DEBUG == 0 ) {
140
- cc . log = function ( ) {
141
- } ;
142
- cc . logINFO = function ( ) {
143
- } ;
144
- cc . logERROR = function ( ) {
145
- } ;
146
- }
147
- else if ( cc . COCOS2D_DEBUG == 1 ) {
148
- cc . logINFO = cc . log ;
149
- cc . logERROR = function ( ) {
150
- } ;
151
- }
152
- else if ( cc . COCOS2D_DEBUG > 1 ) {
153
- cc . logINFO = cc . log ;
154
- cc . logERROR = cc . log ;
155
- } // COCOS2D_DEBUG
156
-
157
- if ( cc . COCOS2D_DEBUG ) {
158
- cc . Assert = function ( cond , message ) {
159
- if ( ( typeof console . assert ) == "function" ) {
160
- console . assert ( cond , message ) ;
161
- } else {
162
- if ( ! cond ) {
163
- if ( message ) {
164
- alert ( message ) ;
165
- }
138
+ /**
139
+ * Output Assert message.
140
+ * @function
141
+ * @param {Boolean } cond If cond is false, assert.
142
+ * @param {String } message
143
+ */
144
+ cc . Assert = function ( cond , message ) {
145
+ if ( ( typeof console . assert ) == "function" ) {
146
+ console . assert ( cond , message ) ;
147
+ } else {
148
+ if ( ! cond ) {
149
+ if ( message ) {
150
+ alert ( message ) ;
166
151
}
167
152
}
168
153
}
169
- } else {
170
- cc . Assert = function ( ) {
171
- } ;
154
+ }
155
+
156
+ /**
157
+ * Update Debug setting.
158
+ * @function
159
+ */
160
+ cc . initDebugSetting = function ( ) {
161
+ // cocos2d debug
162
+ if ( cc . COCOS2D_DEBUG == 0 ) {
163
+ cc . log = function ( ) {
164
+ } ;
165
+ cc . logINFO = function ( ) {
166
+ } ;
167
+ cc . logERROR = function ( ) {
168
+ } ;
169
+ cc . Assert = function ( ) {
170
+ } ;
171
+ }
172
+ else if ( cc . COCOS2D_DEBUG == 1 ) {
173
+ cc . logINFO = cc . log ;
174
+ cc . logERROR = function ( ) {
175
+ } ;
176
+ }
177
+ else if ( cc . COCOS2D_DEBUG > 1 ) {
178
+ cc . logINFO = cc . log ;
179
+ cc . logERROR = cc . log ;
180
+ } // COCOS2D_DEBUG
172
181
}
173
182
174
183
// Enum the language type supportted now
0 commit comments