/libs/cocos2d/ccConfig.h
C Header | 195 lines | 21 code | 20 blank | 154 comment | 1 complexity | 7ce733021eca1f3233d547d035bc241d MD5 | raw file
Possible License(s): Apache-2.0
1/* 2 * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 * 4 * Copyright (c) 2008-2010 Ricardo Quesada 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * THE SOFTWARE. 23 */ 24 25 26/** 27 @file 28 cocos2d (cc) configuration file 29*/ 30 31/** @def CC_FONT_LABEL_SUPPORT 32 If enabled, FontLabel will be used to render .ttf files. 33 If the .ttf file is not found, then it will use the standard UIFont class 34 If disabled, the standard UIFont class will be used. 35 36 To enable set it to a value different than 0. Enabled by default. 37 */ 38#define CC_FONT_LABEL_SUPPORT 1 39 40/** @def CC_DIRECTOR_FAST_FPS 41 If enabled, then the FPS will be drawn using CCLabelAtlas (fast rendering). 42 You will need to add the fps_images.png to your project. 43 If disabled, the FPS will be rendered using CCLabel (slow rendering) 44 45 To enable set it to a value different than 0. Enabled by default. 46 */ 47#define CC_DIRECTOR_FAST_FPS 1 48 49/** @def CC_DIRECTOR_FPS_INTERVAL 50 Senconds between FPS updates. 51 0.5 seconds, means that the FPS number will be updated every 0.5 seconds. 52 Having a bigger number means a more reliable FPS 53 54 Default value: 0.1f 55 */ 56#define CC_DIRECTOR_FPS_INTERVAL (0.1f) 57 58/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS 59 If enabled, and only when it is used with CCFastDirector, the main loop will wait 0.04 seconds to 60 dispatch all the events, even if there are not events to dispatch. 61 If your game uses lot's of events (eg: touches) it might be a good idea to enable this feature. 62 Otherwise, it is safe to leave it disabled. 63 64 To enable set it to a value different than 0. Disabled by default. 65 66 @warning This feature is experimental 67 */ 68 #define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0 69 70/** @def CC_COCOSNODE_RENDER_SUBPIXEL 71 If enabled, the CCNode objects (CCSprite, CCLabel,etc) will be able to render in subpixels. 72 If disabled, integer pixels will be used. 73 74 To enable set it to a value different than 0. Enabled by default. 75 */ 76#define CC_COCOSNODE_RENDER_SUBPIXEL 1 77 78/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 79 If enabled, the CCSprite objects rendered with CCSpriteBatchNode will be able to render in subpixels. 80 If disabled, integer pixels will be used. 81 82 To enable set it to a value different than 0. Enabled by default. 83 */ 84#define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 85 86/** @def CC_USES_VBO 87 If enabled, batch nodes (texture atlas and particle system) will use VBO instead of vertex list (VBO is recommended by Apple) 88 89 To enable set it to a value different than 0. 90 Enabled by default on ARMv7 processors and iPhone Simulator. 91 Disabled by default on ARMv6 processors. 92 93 @since v0.99.5 94 */ 95 96#if defined(__ARM_NEON__) || defined(TARGET_IPHONE_SIMULATOR) 97#define CC_USES_VBO 1 98#else 99#define CC_USES_VBO 0 100#endif 101 102/** @def CC_NODE_TRANSFORM_USING_AFFINE_MATRIX 103 If enabled, CCNode will transform the nodes using a cached Affine matrix. 104 If disabled, the node will be transformed using glTranslate,glRotate,glScale. 105 Using the affine matrix only requires 2 GL calls. 106 Using the translate/rotate/scale requires 5 GL calls. 107 But computing the Affine matrix is relative expensive. 108 But according to performance tests, Affine matrix performs better. 109 This parameter doesn't affect SpriteSheet nodes. 110 111 To enable set it to a value different than 0. Enabled by default. 112 113 */ 114#define CC_NODE_TRANSFORM_USING_AFFINE_MATRIX 1 115 116/** @def CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA 117 If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images). 118 Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images) 119 120 To enable set it to a value different than 0. Enabled by default. 121 122 @since v0.99.5 123 */ 124#define CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA 1 125 126/** @def CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 127 Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas. 128 It seems it is the recommend way, but it is much slower, so, enable it at your own risk 129 130 To enable set it to a value different than 0. Disabled by default. 131 132 */ 133#define CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 0 134 135/** @def CC_TEXTURE_NPOT_SUPPORT 136 If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures. 137 NPOT textures have the following limitations: 138 - They can't have mipmaps 139 - They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T} 140 141 To enable set it to a value different than 0. Disabled by default. 142 143 @since v0.99.2 144 */ 145#define CC_TEXTURE_NPOT_SUPPORT 0 146 147/** @def CC_SPRITE_DEBUG_DRAW 148 If enabled, all subclasses of CCSprite will draw a bounding box 149 Useful for debugging purposes only. It is recommened to leave it disabled. 150 151 To enable set it to a value different than 0. Disabled by default. 152 */ 153#define CC_SPRITE_DEBUG_DRAW 0 154 155/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW 156 If enabled, all subclasses of CCSprite that are rendered using an CCSpriteSheet draw a bounding box. 157 Useful for debugging purposes only. It is recommened to leave it disabled. 158 159 To enable set it to a value different than 0. Disabled by default. 160 */ 161#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0 162 163/** @def CC_BITMAPFONTATLAS_DEBUG_DRAW 164 If enabled, all subclasses of BitmapFontAtlas will draw a bounding box 165 Useful for debugging purposes only. It is recommened to leave it disabled. 166 167 To enable set it to a value different than 0. Disabled by default. 168 */ 169#define CC_BITMAPFONTATLAS_DEBUG_DRAW 0 170 171/** @def CC_LABELATLAS_DEBUG_DRAW 172 If enabled, all subclasses of LabeltAtlas will draw a bounding box 173 Useful for debugging purposes only. It is recommened to leave it disabled. 174 175 To enable set it to a value different than 0. Disabled by default. 176 */ 177#define CC_LABELATLAS_DEBUG_DRAW 0 178 179/** @def CC_ENABLE_PROFILERS 180 If enabled, will activate various profilers withing cocos2d. This statistical data will be output to the console 181 once per second showing average time (in milliseconds) required to execute the specific routine(s). 182 Useful for debugging purposes only. It is recommened to leave it disabled. 183 184 To enable set it to a value different than 0. Disabled by default. 185 */ 186#define CC_ENABLE_PROFILERS 0 187 188/** @def CC_COMPATIBILITY_WITH_0_8 189 Enable it if you want to support v0.8 compatbility. 190 Basically, classes without namespaces will work. 191 It is recommended to disable compatibility once you have migrated your game to v0.9 to avoid class name polution 192 193 To enable set it to a value different than 0. Disabled by default. 194 */ 195#define CC_COMPATIBILITY_WITH_0_8 0