summary refs log tree commit diff stats
path: root/libs/cocos2d/Support/ccUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cocos2d/Support/ccUtils.c')
-rwxr-xr-xlibs/cocos2d/Support/ccUtils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/cocos2d/Support/ccUtils.c b/libs/cocos2d/Support/ccUtils.c new file mode 100755 index 0000000..39786ec --- /dev/null +++ b/libs/cocos2d/Support/ccUtils.c
@@ -0,0 +1,20 @@
1/*
2 * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 *
4 */
5
6/*
7 ccNextPOT function is licensed under the same license that is used in CCTexture2D.m.
8 */
9#include "ccUtils.h"
10
11unsigned long ccNextPOT(unsigned long x)
12{
13 x = x - 1;
14 x = x | (x >> 1);
15 x = x | (x >> 2);
16 x = x | (x >> 4);
17 x = x | (x >> 8);
18 x = x | (x >>16);
19 return x + 1;
20} \ No newline at end of file