按 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环 ...
随机推荐
- QSerialPort
(草稿) qt5提供QSerialPort类,封装了串口的api, 可以用这个类写串口通信程序.
- Windebug双机调试环境搭建
Windebug双机调试环境搭建 开始进行内核编程/驱动编程的调试工作是非常烦人的,由于程序运行与内核层不受操作系统的管控,所以容易引起主机蓝屏和崩溃是常有的事.这也就使得内核程序的调试成了一大 ...
- Can't connect to MySQL server on 'XXX' (13)
出现can't connect to MySQL server using '' (13)的错误,结果是 SELinux 不让 httpd 访问外网,一开始还以为是iptables造成的,关闭之后发现 ...
- JavaScript下全选反选的Demo程序里实现checkmeonly函数 DOM
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Java -强引用&弱引用
⑴强引用(StrongReference) 就是通过new得的对象引用 强引用是使用最普遍的引用.如果一个对象具有强引用,那垃圾回收器绝不会回收它.当内存空间不足,Java虚拟机宁愿抛出OutOfMe ...
- ZOJ 3594 年份水题 【注意:没有0年】
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #i ...
- 修改 Mac 默认 PHP 运行环境,给 MAMP 配置全局 Composer
在没有配置全局性的 Composer 的时候,如果你在没有安装 Composer 的目录下运行 Composer 命令,比如:create-project 系统会返回: Could not open ...
- 使用linq对字符串1,2,3,4,5,6,7,8,9,10求和
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SumI ...
- BZOJ 1592: [Usaco2008 Feb]Making the Grade 路面修整( dp )
最优的做法最后路面的高度一定是原来某一路面的高度. dp(x, t) = min{ dp(x - 1, k) } + | H[x] - h(t) | ( 1 <= k <= t ) 表示前 ...
- javascript每日一练(五)——BOM
一.BOM打开,关闭窗口 window.open(); window.close(); <!doctype html> <html> <head> <meta ...