cocos2dx 常识

cocos2dx 常识,第1张

概述<0>Cocos2d-x基本类源码的剖析 CCApplication CCDirector, CCDisplayLinkDirector CCLayer CCScene CCSprite CCNode CCPoolManager CCAutoreleasePool CCFileUtils CCScheduler CCActionManager CCNotificationCenter <4> st <0>Cocos2d-x基本类源码的剖析 CCApplication CCDirector,CCdisplaylinkDirector cclayer CCScene CCSprite CCNode CCPoolManager CCautoreleasePool CCfileUtils CCScheduler CCActionManager CCNotificationCenter <4> static inline unsigned int getHashCodeByString(const char *key) { unsigned int len = strlen(key); const char *end=key+len; unsigned int hash; for (hash = 0; key < end; key++) { hash *= 16777619; hash ^= (unsigned int) (unsigned char) toupper(*key); } return (hash); } 总结:得到hash码,看来也是这种取字节流的方式. <5> #define CCAssert(cond,msg) do { \ if (!(cond)) { \ if (!cc_assert_script_compatible(msg) && strlen(msg)) \ cocos2d::cclog("Assert Failed: %s",msg); \ CC_ASSERT(cond); \ } \ } while (0) 总结:可见,CCAssert在断言着cloud为真,一旦不为真,那么就会输出msg提示信息. <6> voID CCDirector::setKeypaddispatcher(CCKeypaddispatcher* pKeypaddispatcher) { CC_SAFE_RETAIN(pKeypaddispatcher); CC_SAFE_RELEASE(m_pKeypaddispatcher); m_pKeypaddispatcher = pKeypaddispatcher; } 总结:指针为方式内存泄露,也采取的这种,保存传进来的,释放原来的,将传进来的赋值给原来的. 总结

以上是内存溢出为你收集整理的cocos2dx 常识全部内容,希望文章能够帮你解决cocos2dx 常识所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1081005.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存