按 Eclipse 开发喜好重新布置 cocos2dx 目录层次
【tonyfield 2013.08.29 】
1. Cocos2dx 库的改动
处于个人的固执,花一天时间重新布置了cocos2dx 2.1.4的目录层次,将android平台无关的代码全数裁剪,代码按模块置于 jni 下,主要分为
cocos2d, CocosDenshion, extensions, external,third_party 5个主要模块,其中 NDK中已有的 AssetManager及GLES/SLES头文件全部删除,只要包含路径含有 ${NDK_ROOT}/platforms/android-8/arch-arm/usr/include,则这些文件没必要复制在工程中。目录结构如下:
.
├── cocos2dx
│ ├── actions
│ ├── base_nodes
│ ├── cocoa
│ ├── draw_nodes
│ ├── effects
│ ├── include
│ ├── kazmath
│ │ ├── include
│ │ │ └── kazmath
│ │ │ └── GL
│ │ └── src
│ │ └── GL
│ ├── keypad_dispatcher
│ ├── label_nodes
│ ├── layers_scenes_transitions_nodes
│ ├── menu_nodes
│ ├── misc_nodes
│ ├── particle_nodes
│ ├── platform
│ │ └── android
│ │ └── jni
│ ├── script_support
│ ├── shaders
│ ├── sprite_nodes
│ ├── support
│ │ ├── component
│ │ ├── data_support
│ │ ├── image_support
│ │ ├── tinyxml2
│ │ ├── user_default
│ │ └── zip_support
│ ├── text_input_node
│ ├── textures
│ ├── tilemap_parallax_nodes
│ └── touch_dispatcher
├── CocosDenshion
│ ├── include
│ ├── jni
│ └── opensl
├── extensions
│ ├── AssetsManager
│ ├── CCArmature
│ │ ├── animation
│ │ ├── datas
│ │ ├── display
│ │ ├── external_tool
│ │ │ └── Json
│ │ │ └── lib_json
│ │ ├── physics
│ │ └── utils
│ ├── CCBReader
│ ├── Components
│ ├── GUI
│ │ ├── CCControlExtension
│ │ ├── CCEditBox
│ │ └── CCScrollView
│ ├── LocalStorage
│ ├── network
│ ├── physics_nodes
│ └── spine
├── external
│ ├── Box2D
│ │ ├── Collision
│ │ │ └── Shapes
│ │ ├── Common
│ │ ├── Dynamics
│ │ │ ├── Contacts
│ │ │ └── Joints
│ │ └── Rope
│ ├── chipmunk
│ │ ├── include
│ │ │ └── chipmunk
│ │ │ └── constraints
│ │ └── src
│ │ └── constraints
│ ├── emscripten
│ ├── libwebsockets
│ │ ├── include
│ │ └── lib
│ │ ├── armeabi
│ │ ├── armeabi-v7a
│ │ └── x86
│ └── sqlite3
│ ├── include
│ └── libraries
│ └── win32
└── third_party
├── libcurl
│ ├── include
│ │ └── curl
│ └── libs
│ ├── armeabi
│ ├── armeabi-v7a
│ └── x86
├── libjpeg
│ ├── include
│ └── libs
│ ├── armeabi
│ ├── armeabi-v7a
│ └── x86
├── libpng
│ ├── include
│ └── libs
│ ├── armeabi
│ ├── armeabi-v7a
│ └── x86
├── libtiff
│ ├── include
│ └── libs
│ ├── armeabi
│ ├── armeabi-v7a
│ └── x86
└── libwebp
├── include
└── libs
├── armeabi
├── armeabi-v7a
└── x86 119 directories
新的 Android.mk 内容为
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos2dx_top LOCAL_MODULE_FILENAME := libcocos2d_top #LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libpng_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libxml2_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libtiff_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libwebp_static COCOS2DX_PATH := $(LOCAL_PATH)/cocos2dx
LOCAL_EXPORT_C_INCLUDES := $(COCOS2DX_PATH) \
$(COCOS2DX_PATH)/include \
$(COCOS2DX_PATH)/kazmath/include \
$(COCOS2DX_PATH)/platform/android # define the macro to compile through support/zip_support/ioapi.c
LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API
LOCAL_EXPORT_CFLAGS := -Wno-psabi -DUSE_FILE32API include $(BUILD_STATIC_LIBRARY) $(call import-module,cocos2dx)
$(call import-module,CocosDenshion)
$(call import-module,extensions) $(call import-module,external/Box2D)
$(call import-module,external/chipmunk)
$(call import-module,third_party/libcurl)
$(call import-module,third_party/libjpeg)
$(call import-module,third_party/libpng)
$(call import-module,third_party/libtiff)
$(call import-module,third_party/libwebp)
其中,LOCAL_WHOLE_STATIC_LIBRARIES 没必要定义了
2. TestCpp 的改动
复制导入TestCpp工程
将公用类代码 /home/yourname/cocos2d-x-2.1.4/samples/Cpp/TestCpp/Classes 复制到 TestCpp/jni;
将assets资源 /home/yourname/cocos2d-x-2.1.4/samples/Cpp/TestCpp/Resources 复制到 TestCpp/assets;
添加 Eclipse 局部环境变量 COCOS2DX_ROOT 为第1节中项目的jni目录;
在项目属性中添加第1节改好的 cocos2dx库
Android.mk 改为
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := testcpp LOCAL_MODULE_FILENAME := libtestcpp LOCAL_SRC_FILES := testcpp/main.cpp \
Classes/AccelerometerTest/AccelerometerTest.cpp \
Classes/ActionManagerTest/ActionManagerTest.cpp \
Classes/ActionsTest/ActionsTest.cpp \
Classes/ActionsEaseTest/ActionsEaseTest.cpp \
Classes/ActionsProgressTest/ActionsProgressTest.cpp \
Classes/Box2DTest/Box2dTest.cpp \
Classes/Box2DTestBed/Box2dView.cpp \
Classes/Box2DTestBed/GLES-Render.cpp \
Classes/Box2DTestBed/Test.cpp \
Classes/Box2DTestBed/TestEntries.cpp \
Classes/BugsTest/Bug-1159.cpp \
Classes/BugsTest/Bug-1174.cpp \
Classes/BugsTest/Bug-350.cpp \
Classes/BugsTest/Bug-422.cpp \
Classes/BugsTest/Bug-624.cpp \
Classes/BugsTest/Bug-886.cpp \
Classes/BugsTest/Bug-899.cpp \
Classes/BugsTest/Bug-914.cpp \
Classes/BugsTest/BugsTest.cpp \
Classes/BugsTest/Bug-458/Bug-458.cpp \
Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp \
Classes/ChipmunkTest/ChipmunkTest.cpp \
Classes/ClickAndMoveTest/ClickAndMoveTest.cpp \
Classes/ClippingNodeTest/ClippingNodeTest.cpp \
Classes/CocosDenshionTest/CocosDenshionTest.cpp \
Classes/CurlTest/CurlTest.cpp \
Classes/CurrentLanguageTest/CurrentLanguageTest.cpp \
Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp \
Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp \
Classes/EffectsTest/EffectsTest.cpp \
Classes/ExtensionsTest/ExtensionsTest.cpp \
Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \
Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \
Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp \
Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp \
Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp \
Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp \
Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp \
Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp \
Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp \
Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \
Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \
Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \
Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \
Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \
\
Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp \
Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp \
Classes/ExtensionsTest/ComponentsTest/GameOverScene.cpp \
Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp \
Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp \
Classes/ExtensionsTest/ComponentsTest/SceneController.cpp \
\
Classes/FontTest/FontTest.cpp \
Classes/IntervalTest/IntervalTest.cpp \
Classes/KeypadTest/KeypadTest.cpp \
Classes/LabelTest/LabelTest.cpp \
Classes/LayerTest/LayerTest.cpp \
Classes/NodeTest/NodeTest.cpp \
Classes/TextInputTest/TextInputTest.cpp \
Classes/MenuTest/MenuTest.cpp \
Classes/MotionStreakTest/MotionStreakTest.cpp \
Classes/MutiTouchTest/MutiTouchTest.cpp \
Classes/ParallaxTest/ParallaxTest.cpp \
Classes/ParticleTest/ParticleTest.cpp \
Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp \
Classes/PerformanceTest/PerformanceParticleTest.cpp \
Classes/PerformanceTest/PerformanceSpriteTest.cpp \
Classes/PerformanceTest/PerformanceTest.cpp \
Classes/PerformanceTest/PerformanceTextureTest.cpp \
Classes/PerformanceTest/PerformanceTouchesTest.cpp \
Classes/RenderTextureTest/RenderTextureTest.cpp \
Classes/RotateWorldTest/RotateWorldTest.cpp \
Classes/SceneTest/SceneTest.cpp \
Classes/SchedulerTest/SchedulerTest.cpp \
Classes/ShaderTest/ShaderTest.cpp \
Classes/SpineTest/SpineTest.cpp \
Classes/SpriteTest/SpriteTest.cpp \
Classes/TextureCacheTest/TextureCacheTest.cpp \
Classes/Texture2dTest/Texture2dTest.cpp \
Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp \
Classes/TileMapTest/TileMapTest.cpp \
Classes/TouchesTest/Ball.cpp \
Classes/TouchesTest/Paddle.cpp \
Classes/TouchesTest/TouchesTest.cpp \
Classes/TransitionsTest/TransitionsTest.cpp \
Classes/UserDefaultTest/UserDefaultTest.cpp \
Classes/ZwoptexTest/ZwoptexTest.cpp \
Classes/FileUtilsTest/FileUtilsTest.cpp \
Classes/DataVisitorTest/DataVisitorTest.cpp \
Classes/ConfigurationTest/ConfigurationTest.cpp \
Classes/controller.cpp \
Classes/testBasic.cpp \
Classes/AppDelegate.cpp \
Classes/VisibleRect.cpp #LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
#LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
#LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
#LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes \
$(COCOS2DX_ROOT)/cocos2dx \
$(COCOS2DX_ROOT)/cocos2dx/include \
$(COCOS2DX_ROOT)/cocos2dx/kazmath/include \
$(COCOS2DX_ROOT)/cocos2dx/platform/android \
$(COCOS2DX_ROOT)/extensions \
$(COCOS2DX_ROOT)/external \
$(COCOS2DX_ROOT)/external/chipmunk/include/chipmunk \
$(COCOS2DX_ROOT)/CocosDenshion/include \
$(COCOS2DX_ROOT)/third_party/libcurl/include \
$(COCOS2DX_ROOT)/extensions/network \
$(COCOS2DX_ROOT)/external/libwebsockets/include include $(BUILD_STATIC_LIBRARY)
编译完成。值得注意的时,你不用再在mk文件末尾 添加(call import-module,external/Box2D) 语句,只要添加头文件包含路径。
【转载请注明来自blog.csdn.net/tonyfield 谢谢 2013.08.30 】
按 Eclipse 开发喜好重新布置 cocos2dx 目录层次的更多相关文章
- Hadoop伪分布配置与基于Eclipse开发环境搭建
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- 在IDEA上跑eclipse开发的J2EE项目
Context MacOS 10.12.1 IDEA ULTIMATE 2016.2 项目使用eclipse开发 项目使用SVN进修版本管理 核心步骤 检出项目,完成基本配置 从svn检出 当项目下载 ...
- Linux上搭建Hadoop2.6.3集群以及WIN7通过Eclipse开发MapReduce的demo
近期为了分析国内航空旅游业常见安全漏洞,想到了用大数据来分析,其实数据也不大,只是生产项目没有使用Hadoop,因此这里实际使用一次. 先看一下通过hadoop分析后的结果吧,最终通过hadoop分析 ...
- Linux下使用Eclipse开发Hadoop应用程序
在前面一篇文章中介绍了如果在完全分布式的环境下搭建Hadoop0.20.2,现在就再利用这个环境完成开发. 首先用hadoop这个用户登录linux系统(hadoop用户在前面一篇文章中创建的),然后 ...
- zookeeper Eclipse 开发环境搭建及简单示例
一,下载Zookeeper安装包 从官方网站下载稳定版安装包后,解压. 其中ZK_HOME 为:D:\Program Files\zookeeper-3.4.9 二,启动Zookeeper Serve ...
- 在Eclipse中手动安装pydev插件,eclipse开发python环境配置
最近在学习Python,因为我是做java的,用惯了eclipse,所以就想用eclipse开发python,但是配置开发环境的时候发现按照网上的配置大多不行,而且都是用的在线安装,很垃圾,没办法,自 ...
- 用eclipse开发和调试postgresql-8.4.1
按照书本<PostgreSQL数据库内核分析>根据第一章讲解的linux下,编译 安装:不同的是libreadline5-dev版本没有了,就用新的版本代替:我的ubuntu 14 所以必 ...
- SBT 构建scala eclipse开发
scala eclipse sbt 应用程序开发 搭建Eclipse开发Scala应用程序的一般步骤 一.环境准备: 1.Scala : http://www.scala-lang.org/ 2.Sc ...
- windows环境下Eclipse开发MapReduce程序遇到的四个问题及解决办法
按此文章<Hadoop集群(第7期)_Eclipse开发环境设置>进行MapReduce开发环境搭建的过程中遇到一些问题,饶了一些弯路,解决办法记录在此: 文档目的: 记录windows环 ...
随机推荐
- 亚马逊带Marketplace product code的image无法再mount到其他镜像上
这是对已发布镜像的保护么?难道对其进行修改的路彻底断掉了? 以volume形式attach也不行,dd成raw再读取也读不了,敢问路在何方呢 If a volume has an AWS Market ...
- SuperSocket源码解析之配置系统
一 继承Net配置系统 Net应用程序配置机制跟程序集引用大致类似,均具有继承性,如iis几乎每个应用程序都会有一个Web.config,比如我们使用vs2012以上版本创建一个web应用程序会自带一 ...
- 安卓android WebView Memory Leak WebView内存泄漏
Android WebView Memory Leak WebView内存泄漏 在这次开发过程中,需要用到webview展示一些界面,但是加载的页面如果有很多图片就会发现内存占用暴涨,并且在退出该界面 ...
- Ubuntu下安装和配置mysql
一.检查 1.检查是否已经安装mysql whereis mysql 2.检查mysql服务是否已经启动 sudo netstat -tap | grep mysql 如果没有安装,下面就进行安装. ...
- Integral Promotions整数提升和符号扩展(char,unsigned char,signed char)
以下来自msdn: Objects of an integral type can be converted to another wider integral type (that is, a ty ...
- 如何使用不同dll的相同namespace下的相同接口
问题: 程序里加载了2个dll,这2个dll里都声明了同样的命名空间(这个不违法),然后在这个同样的命名空间下,他俩又定义了同名的interface. 然后我程序里直接using这个命名空间,使用这个 ...
- POJ训练计划2299_Ultra-QuickSort(归并排序求逆序数)
Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 39279 Accepted: 14163 ...
- 将DataTable 存到一个集合当中
将DataTable 存到一个集合中 此做法来自:http://www.codeproject.com/Articles/692832/Simple-way-of-using-SQL-DataTabl ...
- UVA 10317 - Equating Equations (背包)
Problem F Equating Equations Input: standard input Output: standard output Time Limit: 6 seconds Mem ...
- 基于visual Studio2013解决C语言竞赛题之1018数组求和
题目 解决代码及点评 /************************************************************************/ ...