summary refs log tree commit diff stats
path: root/libs/cocos2d/ccConfig.h
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-07-30 11:19:14 -0400
committerStarla Insigna <starla4444@gmail.com>2011-07-30 11:19:14 -0400
commit9cd57b731ab1c666d4a1cb725538fdc137763d12 (patch)
tree5bac45ae5157a1cb10c6e45500cbf72789917980 /libs/cocos2d/ccConfig.h
downloadcartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.gz
cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.tar.bz2
cartcollect-9cd57b731ab1c666d4a1cb725538fdc137763d12.zip
Initial commit (version 0.2.1)
Diffstat (limited to 'libs/cocos2d/ccConfig.h')
-rwxr-xr-xlibs/cocos2d/ccConfig.h334
1 files changed, 334 insertions, 0 deletions
diff --git a/libs/cocos2d/ccConfig.h b/libs/cocos2d/ccConfig.h new file mode 100755 index 0000000..55b4cd8 --- /dev/null +++ b/libs/cocos2d/ccConfig.h
@@ -0,0 +1,334 @@
1/*
2 * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 *
4 * Copyright (c) 2008-2010 Ricardo Quesada
5 * Copyright (c) 2011 Zynga Inc.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 */
25
26
27#import <Availability.h>
28
29/**
30 @file
31 cocos2d (cc) configuration file
32*/
33
34/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
35 If enabled, the texture coordinates will be calculated by using this formula:
36 - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2);
37 - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2);
38
39 The same for bottom and top.
40
41 This formula prevents artifacts by using 99% of the texture.
42 The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
43
44 Affected nodes:
45 - CCSprite / CCSpriteBatchNode and subclasses: CCLabelBMFont, CCTMXTiledMap
46 - CCLabelAtlas
47 - CCQuadParticleSystem
48 - CCTileMap
49
50 To enabled set it to 1. Disabled by default.
51
52 @since v0.99.5
53 */
54#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
55#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0
56#endif
57
58
59/** @def CC_FONT_LABEL_SUPPORT
60 If enabled, FontLabel will be used to render .ttf files.
61 If the .ttf file is not found, then it will use the standard UIFont class
62 If disabled, the standard UIFont class will be used.
63
64 To disable set it to 0. Enabled by default.
65
66 Only valid for cocos2d-ios. Not supported on cocos2d-mac
67 */
68#ifndef CC_FONT_LABEL_SUPPORT
69#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
70#define CC_FONT_LABEL_SUPPORT 1
71#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
72#define CC_FONT_LABEL_SUPPORT 0
73#endif
74#endif
75
76/** @def CC_DIRECTOR_FAST_FPS
77 If enabled, then the FPS will be drawn using CCLabelAtlas (fast rendering).
78 You will need to add the fps_images.png to your project.
79 If disabled, the FPS will be rendered using CCLabel (slow rendering)
80
81 To enable set it to a value different than 0. Enabled by default.
82 */
83#ifndef CC_DIRECTOR_FAST_FPS
84#define CC_DIRECTOR_FAST_FPS 1
85#endif
86
87/** @def CC_DIRECTOR_FPS_INTERVAL
88 Senconds between FPS updates.
89 0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
90 Having a bigger number means a more reliable FPS
91
92 Default value: 0.1f
93 */
94#ifndef CC_DIRECTOR_FPS_INTERVAL
95#define CC_DIRECTOR_FPS_INTERVAL (0.1f)
96#endif
97
98/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS
99 If enabled, and only when it is used with CCFastDirector, the main loop will wait 0.04 seconds to
100 dispatch all the events, even if there are not events to dispatch.
101 If your game uses lot's of events (eg: touches) it might be a good idea to enable this feature.
102 Otherwise, it is safe to leave it disabled.
103
104 To enable set it to 1. Disabled by default.
105
106 @warning This feature is experimental
107 */
108#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS
109#define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0
110#endif
111
112/** @def CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD
113 If enabled, cocos2d-mac will run on the Display Link thread. If disabled cocos2d-mac will run in its own thread.
114
115 If enabled, the images will be drawn at the "correct" time, but the events might not be very responsive.
116 If disabled, some frames might be skipped, but the events will be dispatched as they arrived.
117
118 To enable set it to a 1, to disable it set to 0. Enabled by default.
119
120 Only valid for cocos2d-mac. Not supported on cocos2d-ios.
121
122 */
123#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD
124#define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1
125#endif
126
127/** @def CC_COCOSNODE_RENDER_SUBPIXEL
128 If enabled, the CCNode objects (CCSprite, CCLabel,etc) will be able to render in subpixels.
129 If disabled, integer pixels will be used.
130
131 To enable set it to 1. Enabled by default.
132 */
133#ifndef CC_COCOSNODE_RENDER_SUBPIXEL
134#define CC_COCOSNODE_RENDER_SUBPIXEL 1
135#endif
136
137/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
138 If enabled, the CCSprite objects rendered with CCSpriteBatchNode will be able to render in subpixels.
139 If disabled, integer pixels will be used.
140
141 To enable set it to 1. Enabled by default.
142 */
143#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
144#define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1
145#endif
146
147/** @def CC_USES_VBO
148 If enabled, batch nodes (texture atlas and particle system) will use VBO instead of vertex list (VBO is recommended by Apple)
149
150 To enable set it to 1.
151 Enabled by default on iPhone with ARMv7 processors, iPhone Simulator and Mac
152 Disabled by default on iPhone with ARMv6 processors.
153
154 @since v0.99.5
155 */
156#ifndef CC_USES_VBO
157#if defined(__ARM_NEON__) || TARGET_IPHONE_SIMULATOR || defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
158#define CC_USES_VBO 1
159#else
160#define CC_USES_VBO 0
161#endif
162#endif
163
164/** @def CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
165 If enabled, CCNode will transform the nodes using a cached Affine matrix.
166 If disabled, the node will be transformed using glTranslate,glRotate,glScale.
167 Using the affine matrix only requires 2 GL calls.
168 Using the translate/rotate/scale requires 5 GL calls.
169 But computing the Affine matrix is relative expensive.
170 But according to performance tests, Affine matrix performs better.
171 This parameter doesn't affect CCSpriteBatchNode nodes.
172
173 To enable set it to a value different than 0. Enabled by default.
174
175 */
176#ifndef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
177#define CC_NODE_TRANSFORM_USING_AFFINE_MATRIX 1
178#endif
179
180/** @def CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
181 If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).
182 Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images)
183
184 To enable set it to a value different than 0. Enabled by default.
185
186 @since v0.99.5
187 */
188#ifndef CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA
189#define CC_OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA 1
190#endif
191
192/** @def CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP
193 Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.
194 It seems it is the recommend way, but it is much slower, so, enable it at your own risk
195
196 To enable set it to a value different than 0. Disabled by default.
197
198 */
199#ifndef CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP
200#define CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 0
201#endif
202
203/** @def CC_TEXTURE_NPOT_SUPPORT
204 If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures.
205 NPOT textures have the following limitations:
206 - They can't have mipmaps
207 - They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}
208
209 To enable set it to a value different than 0. Disabled by default.
210
211 This value governs only the PNG, GIF, BMP, images.
212 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.
213
214 @deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it.
215
216 @since v0.99.2
217 */
218#ifndef CC_TEXTURE_NPOT_SUPPORT
219#define CC_TEXTURE_NPOT_SUPPORT 0
220#endif
221
222/** @def CC_RETINA_DISPLAY_SUPPORT
223 If enabled, cocos2d supports retina display.
224 For performance reasons, it's recommended disable it in games without retina display support, like iPad only games.
225
226 To enable set it to 1. Use 0 to disable it. Enabled by default.
227
228 @since v0.99.5
229 */
230#ifndef CC_RETINA_DISPLAY_SUPPORT
231#define CC_RETINA_DISPLAY_SUPPORT 1
232#endif
233
234/** @def CC_RETINA_DISPLAY_FILENAME_SUFFIX
235 It's the suffix that will be appended to the files in order to load "retina display" images.
236
237 On an iPhone4 with Retina Display support enabled, the file @"sprite-hd.png" will be loaded instead of @"sprite.png".
238 If the file doesn't exist it will use the non-retina display image.
239
240 Platforms: Only used on Retina Display devices like iPhone 4.
241
242 @since v0.99.5
243 */
244#ifndef CC_RETINA_DISPLAY_FILENAME_SUFFIX
245#define CC_RETINA_DISPLAY_FILENAME_SUFFIX @"-hd"
246#endif
247
248/** @def CC_USE_LA88_LABELS_ON_NEON_ARCH
249 If enabled, it will use LA88 (16-bit textures) on Neon devices for CCLabelTTF objects.
250 If it is disabled, or if it is used on another architecture it will use A8 (8-bit textures).
251 On Neon devices, LA88 textures are 6% faster than A8 textures, but then will consume 2x memory.
252
253 This feature is disabled by default.
254
255 Platforms: Only used on ARM Neon architectures like iPhone 3GS or newer and iPad.
256
257 @since v0.99.5
258 */
259#ifndef CC_USE_LA88_LABELS_ON_NEON_ARCH
260#define CC_USE_LA88_LABELS_ON_NEON_ARCH 0
261#endif
262
263/** @def CC_SPRITE_DEBUG_DRAW
264 If enabled, all subclasses of CCSprite will draw a bounding box
265 Useful for debugging purposes only. It is recommened to leave it disabled.
266
267 To enable set it to a value different than 0. Disabled by default:
268 0 -- disabled
269 1 -- draw bounding box
270 2 -- draw texture box
271 */
272#ifndef CC_SPRITE_DEBUG_DRAW
273#define CC_SPRITE_DEBUG_DRAW 0
274#endif
275
276/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW
277 If enabled, all subclasses of CCSprite that are rendered using an CCSpriteBatchNode draw a bounding box.
278 Useful for debugging purposes only. It is recommened to leave it disabled.
279
280 To enable set it to a value different than 0. Disabled by default.
281 */
282#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW
283#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0
284#endif
285
286/** @def CC_LABELBMFONT_DEBUG_DRAW
287 If enabled, all subclasses of CCLabelBMFont will draw a bounding box
288 Useful for debugging purposes only. It is recommened to leave it disabled.
289
290 To enable set it to a value different than 0. Disabled by default.
291 */
292#ifndef CC_LABELBMFONT_DEBUG_DRAW
293#define CC_LABELBMFONT_DEBUG_DRAW 0
294#endif
295
296/** @def CC_LABELBMFONT_DEBUG_DRAW
297 If enabled, all subclasses of CCLabeltAtlas will draw a bounding box
298 Useful for debugging purposes only. It is recommened to leave it disabled.
299
300 To enable set it to a value different than 0. Disabled by default.
301 */
302#ifndef CC_LABELATLAS_DEBUG_DRAW
303#define CC_LABELATLAS_DEBUG_DRAW 0
304#endif
305
306/** @def CC_ENABLE_PROFILERS
307 If enabled, will activate various profilers withing cocos2d. This statistical data will be output to the console
308 once per second showing average time (in milliseconds) required to execute the specific routine(s).
309 Useful for debugging purposes only. It is recommened to leave it disabled.
310
311 To enable set it to a value different than 0. Disabled by default.
312 */
313#ifndef CC_ENABLE_PROFILERS
314#define CC_ENABLE_PROFILERS 0
315#endif
316
317//
318// DON'T edit this macro.
319//
320#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
321
322#if CC_RETINA_DISPLAY_SUPPORT
323#define CC_IS_RETINA_DISPLAY_SUPPORTED 1
324#else
325#define CC_IS_RETINA_DISPLAY_SUPPORTED 0
326#endif
327
328#elif __MAC_OS_X_VERSION_MAX_ALLOWED
329
330#define CC_IS_RETINA_DISPLAY_SUPPORTED 0
331
332#endif
333
334