PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/libs/cocos2d/Support/ccUtils.c

http://github.com/kstenerud/ObjectAL-for-iPhone
C | 18 lines | 10 code | 1 blank | 7 comment | 0 complexity | fe22f1980a9e5cb413b6e8431a477249 MD5 | raw file
 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 */
 9unsigned int ccNextPOT(unsigned int x)
10{
11    x = x - 1;
12    x = x | (x >> 1);
13    x = x | (x >> 2);
14    x = x | (x >> 4);
15    x = x | (x >> 8);
16    x = x | (x >>16);
17    return x + 1;
18}