diff --git a/cocos2d/core/platform/CCConfig.js b/cocos2d/core/platform/CCConfig.js index 027bede099..920ef69528 100644 --- a/cocos2d/core/platform/CCConfig.js +++ b/cocos2d/core/platform/CCConfig.js @@ -165,23 +165,6 @@ cc.TEXTURE_ATLAS_USE_VAO = 0; */ cc.TEXTURE_NPOT_SUPPORT = 0; -/** - *

- * If enabled, cocos2d supports retina display.
- * For performance reasons, it's recommended disable it in games without retina display support, like iPad only games.
- *
- * To enable set it to 1. Use 0 to disable it. Enabled by default.
- *
- * This value governs only the PNG, GIF, BMP, images.
- * This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value.
- * To modify it, in Web engine please refer to CCConfig.js, in JSB please refer to CCConfig.h - *

- * @constant - * @type {Number} - * @deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it. - */ -cc.RETINA_DISPLAY_SUPPORT = 1; - /** *

* It's the suffix that will be appended to the files in order to load "retina display" images.
@@ -262,13 +245,6 @@ cc.LABELATLAS_DEBUG_DRAW = 0; cc.DRAWNODE_TOTAL_VERTICES = 20000; -/** - * Whether or not support retina display - * @constant - * @type {Number} - */ -cc.IS_RETINA_DISPLAY_SUPPORTED = 0; - /** * Default engine * @constant diff --git a/cocos2d/core/platform/CCMacro.js b/cocos2d/core/platform/CCMacro.js index 8ee902585b..a89331c9f1 100644 --- a/cocos2d/core/platform/CCMacro.js +++ b/cocos2d/core/platform/CCMacro.js @@ -244,10 +244,8 @@ cc.FLT_EPSILON = 0.0000001192092896; * @return {Number} * @function */ -cc.contentScaleFactor = cc.IS_RETINA_DISPLAY_SUPPORTED ? function () { +cc.contentScaleFactor = function () { return cc.director._contentScaleFactor; -} : function () { - return 1; }; /** @@ -312,12 +310,10 @@ cc._sizePixelsToPointsOut = function (sizeInPixels, outSize) { * @return {cc.Rect} * @function */ -cc.rectPixelsToPoints = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (pixel) { +cc.rectPixelsToPoints = function (pixel) { var scale = cc.contentScaleFactor(); return cc.rect(pixel.x / scale, pixel.y / scale, pixel.width / scale, pixel.height / scale); -} : function (p) { - return p; }; /** @@ -326,12 +322,10 @@ cc.rectPixelsToPoints = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (pixel) { * @return {cc.Rect} * @function */ -cc.rectPointsToPixels = cc.IS_RETINA_DISPLAY_SUPPORTED ? function (point) { +cc.rectPointsToPixels = function (point) { var scale = cc.contentScaleFactor(); return cc.rect(point.x * scale, point.y * scale, point.width * scale, point.height * scale); -} : function (p) { - return p; }; //some gl constant variable