cocos2d-x\cocos\base\ccConfig.h
设置开关 0是不需要 1是需要
#ifndef CC_USE_TIFF
#define CC_USE_TIFF 0 //modify ycc
#endif // CC_USE_TIFF
/** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package size.
*/
#ifndef CC_USE_WEBP
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
#define CC_USE_WEBP 0
#endif
#endif // CC_USE_WEBP
/** Use physics integration API. */
#ifndef CC_USE_PHYSICS#define CC_USE_PHYSICS 0
#endif
/** Use 3d physics integration API. */
#ifndef CC_USE_3D_PHYSICS
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
#define CC_USE_3D_PHYSICS 0
#endif
#endif <

通过修改cocos2d-x的ccConfig.h文件,关闭不必要功能如TIFF和WEBP支持,以及在lua-bindings的Android项目中注释掉3D物理引擎相关源文件,可以有效减小libcocos2dlua.so的体积。同时,在lua_module_register函数中,可以根据需求选择性注册模块,如spine、cocos3d等,进一步优化体积。

1万+

被折叠的 条评论
为什么被折叠?



