Skip to content

Commit 86d8474

Browse files
committed
Remove useless cc.IS_RETINA_DISPLAY_SUPPORTED macro and it’s usage
1 parent f9a30bb commit 86d8474

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

cocos2d/core/platform/CCConfig.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,6 @@ cc.LABELATLAS_DEBUG_DRAW = 0;
262262

263263
cc.DRAWNODE_TOTAL_VERTICES = 20000;
264264

265-
/**
266-
* Whether or not support retina display
267-
* @constant
268-
* @type {Number}
269-
*/
270-
cc.IS_RETINA_DISPLAY_SUPPORTED = 1;
271-
272265
/**
273266
* Default engine
274267
* @constant

cocos2d/core/platform/CCMacro.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,8 @@ cc.FLT_EPSILON = 0.0000001192092896;
244244
* @return {Number}
245245
* @function
246246
*/
247-
cc.contentScaleFactor = cc.IS_RETINA_DISPLAY_SUPPORTED ? function () {
247+
cc.contentScaleFactor = function () {
248248
return cc.director._contentScaleFactor;
249-
} : function () {
250-
return 1;
251249
};
252250

253251
/**
@@ -312,12 +310,10 @@ cc._sizePixelsToPointsOut = function (sizeInPixels, outSize) {
312310
* @return {cc.Rect}
313311
* @function
314312
*/
315-
cc.rectPixelsToPoints = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (pixel) {
313+
cc.rectPixelsToPoints = function (pixel) {
316314
var scale = cc.contentScaleFactor();
317315
return cc.rect(pixel.x / scale, pixel.y / scale,
318316
pixel.width / scale, pixel.height / scale);
319-
} : function (p) {
320-
return p;
321317
};
322318

323319
/**
@@ -326,12 +322,10 @@ cc.rectPixelsToPoints = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (pixel) {
326322
* @return {cc.Rect}
327323
* @function
328324
*/
329-
cc.rectPointsToPixels = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (point) {
325+
cc.rectPointsToPixels = function (point) {
330326
var scale = cc.contentScaleFactor();
331327
return cc.rect(point.x * scale, point.y * scale,
332328
point.width * scale, point.height * scale);
333-
} : function (p) {
334-
return p;
335329
};
336330

337331
//some gl constant variable

0 commit comments

Comments
 (0)