123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- /****************************************************************************
- Copyright (c) 2010-2012 cocos2d-x.org
- Copyright (c) 2008-2010 Ricardo Quesada
- Copyright (c) 2011 Zynga Inc.
- http://www.cocos2d-x.org
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- ****************************************************************************/
- /**
- * <p>
- * The current version of Cocos2d-html5 being used.<br/>
- * Please DO NOT remove this String, it is an important flag for bug tracking.<br/>
- * If you post a bug to forum, please attach this flag.
- * </p>
- * @constant
- * @type String
- */
- cc.ENGINE_VERSION = "Cocos2d-html5-v2.2.3";
- /**
- * <p>
- * If enabled, the texture coordinates will be calculated by using this formula: <br/>
- * - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2); <br/>
- * - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2); <br/>
- * <br/>
- * The same for bottom and top. <br/>
- * <br/>
- * This formula prevents artifacts by using 99% of the texture. <br/>
- * The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.<br/>
- * <br/>
- * Affected nodes: <br/>
- * - cc.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap <br/>
- * - cc.LabelAtlas <br/>
- * - cc.QuadParticleSystem <br/>
- * - cc.TileMap <br/>
- * <br/>
- * To enabled set it to 1. Disabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0;
- /**
- * Position of the FPS (Default: 0,0 (bottom-left corner))
- * @constant
- * @type cc.Point
- */
- cc.DIRECTOR_STATS_POSITION = cc.p(0, 0);
- /**
- * <p>
- * Senconds between FPS updates.<br/>
- * 0.5 seconds, means that the FPS number will be updated every 0.5 seconds.<br/>
- * Having a bigger number means a more reliable FPS<br/>
- * <br/>
- * Default value: 0.1f<br/>
- * </p>
- * @constant
- * @type Number
- */
- cc.DIRECTOR_FPS_INTERVAL = 0.5;
- /**
- * <p>
- * If enabled, the cc.Node objects (cc.Sprite, cc.Label,etc) will be able to render in subpixels.<br/>
- * If disabled, integer pixels will be used.<br/>
- * <br/>
- * To enable set it to 1. Enabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.COCOSNODE_RENDER_SUBPIXEL = 1;
- /**
- * <p>
- * If enabled, the cc.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.<br/>
- * If disabled, integer pixels will be used.<br/>
- * <br/>
- * To enable set it to 1. Enabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.SPRITEBATCHNODE_RENDER_SUBPIXEL = 1;
- /**
- * <p>
- * If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).<br/>
- * Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images)<br/>
- * <br/>
- * To enable set it to a value different than 0. Enabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA = 0;
- /**
- * <p>
- * Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.<br/>
- * It seems it is the recommend way, but it is much slower, so, enable it at your own risk<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP = 0;
- /**
- * <p>
- * By default, cc.TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects).<br/>
- * Apple recommends its usage but they might consume a lot of memory, specially if you use many of them.<br/>
- * So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it.<br/>
- * <br/>
- * To disable it set it to 0. disable by default.(Not Supported on WebGL)<br/>
- * </p>
- * @constant
- * @type Number
- */
- cc.TEXTURE_ATLAS_USE_VAO = 0;
- /**
- * <p>
- * If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures.<br/>
- * NPOT textures have the following limitations:<br/>
- * - They can't have mipmaps<br/>
- * - They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default. <br/>
- * <br/>
- * This value governs only the PNG, GIF, BMP, images.<br/>
- * 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.
- * </p>
- * @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.TEXTURE_NPOT_SUPPORT = 0;
- /**
- * <p>
- * If enabled, cocos2d supports retina display.<br/>
- * For performance reasons, it's recommended disable it in games without retina display support, like iPad only games.<br/>
- * <br/>
- * To enable set it to 1. Use 0 to disable it. Enabled by default.<br/>
- * <br/>
- * This value governs only the PNG, GIF, BMP, images.<br/>
- * 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.
- * </p>
- * @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;
- /**
- * <p>
- * It's the suffix that will be appended to the files in order to load "retina display" images.<br/>
- * <br/>
- * On an iPhone4 with Retina Display support enabled, the file @"sprite-hd.png" will be loaded instead of @"sprite.png".<br/>
- * If the file doesn't exist it will use the non-retina display image.<br/>
- * <br/>
- * Platforms: Only used on Retina Display devices like iPhone 4.
- * </p>
- * @constant
- * @type String
- */
- cc.RETINA_DISPLAY_FILENAME_SUFFIX = "-hd";
- /**
- * <p>
- * If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for CCLabelTTF objects. <br/>
- * If it is disabled, it will use A8 (Alpha 8-bit textures). <br/>
- * LA88 textures are 6% faster than A8 textures, but they will consume 2x memory. <br/>
- * <br/>
- * This feature is enabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.USE_LA88_LABELS = 1;
- /**
- * <p>
- * If enabled, all subclasses of cc.Sprite will draw a bounding box<br/>
- * Useful for debugging purposes only. It is recommened to leave it disabled.<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default:<br/>
- * 0 -- disabled<br/>
- * 1 -- draw bounding box<br/>
- * 2 -- draw texture box
- * </p>
- * @constant
- * @type Number
- */
- cc.SPRITE_DEBUG_DRAW = 0;
- /**
- * <p>
- * If enabled, all subclasses of cc.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.<br/>
- * Useful for debugging purposes only. It is recommened to leave it disabled.<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.SPRITEBATCHNODE_DEBUG_DRAW = 0;
- /**
- * <p>
- * If enabled, all subclasses of cc.LabelBMFont will draw a bounding box <br/>
- * Useful for debugging purposes only. It is recommened to leave it disabled.<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default.<br/>
- * </p>
- * @constant
- * @type Number
- */
- cc.LABELBMFONT_DEBUG_DRAW = 0;
- /**
- * <p>
- * If enabled, all subclasses of cc.LabeltAtlas will draw a bounding box<br/>
- * Useful for debugging purposes only. It is recommened to leave it disabled.<br/>
- * <br/>
- * To enable set it to a value different than 0. Disabled by default.
- * </p>
- * @constant
- * @type Number
- */
- cc.LABELATLAS_DEBUG_DRAW = 0;
- /**
- * whether or not support retina display
- * @constant
- * @type Number
- */
- cc.IS_RETINA_DISPLAY_SUPPORTED = 1;
- /**
- * default engine
- * @constant
- * @type String
- */
- cc.DEFAULT_ENGINE = cc.ENGINE_VERSION + "-canvas";
- /**
- * Runtime information
- * @deprecated Use "sys" instead.
- */
- cc.config = {
- 'platform' : sys.platform
- };
- /**
- * dump config info, but only in debug mode
- */
- cc.dumpConfig = function() {
- for(var i in sys )
- cc.log( i + " = " + sys[i] );
- };
- /**
- * <p>
- * If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. <br/>
- * If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions. <br/>
- * If disabled, only the last run action will take effect.
- * </p>
- * @constant
- * @type {number}
- */
- cc.ENABLE_STACKABLE_ACTIONS = 1;
- /**
- * <p>
- * If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. <br/>
- * In order to use them, you have to use the following functions, insead of the the GL ones: <br/>
- * - ccGLUseProgram() instead of glUseProgram() <br/>
- * - ccGLDeleteProgram() instead of glDeleteProgram() <br/>
- * - ccGLBlendFunc() instead of glBlendFunc() <br/>
- * <br/>
- * If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache. <br/>
- * It is recommened to enable whenever possible to improve speed. <br/>
- * If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on.
- * </p>
- * @constant
- * @type Number
- */
- cc.ENABLE_GL_STATE_CACHE = 1;
|