Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

看一下代码? #556

Open
wants to merge 165 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
9304fbd
chmod
zrong Dec 31, 2013
a6c1f49
set default project to lulala
zrong Dec 31, 2013
a2ce4e4
Merge branch 'develop' into zrong
zrong Jan 2, 2014
9412600
compile framework
zrong Jan 2, 2014
6daac85
Merge branch 'develop' into zrong
zrong Jan 2, 2014
f9173f0
rebuild framework
zrong Jan 2, 2014
fdf7ed6
Merge branch 'develop' into zrong
zrong Jan 5, 2014
992fc9c
merge develop
zrong Jan 10, 2014
f9c5279
update vs project
zrong Jan 10, 2014
4d3b628
Merge branch 'zrong' of github.com:zrong/quick-cocos2d-x into zrong
zrong Jan 10, 2014
f9f7582
merge zrong/develop
zrong Jan 21, 2014
c74cbe1
compile framework
zrong Jan 23, 2014
867a0db
modify vcxproj
zrong Feb 8, 2014
2a6ad61
Merge branch 'develop' into zrong
zrong Feb 8, 2014
0876a99
fix a ByteArrayVarint decode issue
zrong Feb 22, 2014
cfd8736
Merge branch 'develop' into zrong
zrong Feb 22, 2014
17f4508
update framework
zrong Feb 22, 2014
b49c149
merge zrong/develop
zrong Mar 11, 2014
10f834b
merge develop
zrong Mar 12, 2014
dea5eb2
merge develop
zrong Mar 12, 2014
6249995
Merge branch 'develop' into zrong
zrong Mar 12, 2014
e6edf2a
Merge branch 'develop' into zrong
zrong Mar 13, 2014
55a5578
compile framework
zrong Mar 13, 2014
7b9ebde
merge develop
zrong Mar 14, 2014
e99f338
merge develop
zrong Mar 21, 2014
c2a9237
add getColor4B and getColor4F to CCImage
zrong Mar 27, 2014
6803eac
merge develop
zrong Mar 27, 2014
113fabc
add getColor and getColorAlpha in CCSpriteExtend.lua
zrong Mar 28, 2014
c193c6b
move ccimage method to h file
zrong Mar 29, 2014
a598646
mv CCImage.getColor4B and getColor4F to h file
zrong Mar 29, 2014
1a94ef7
add the filters support
zrong Mar 30, 2014
fe93af9
add filter.lua into framework
zrong Mar 31, 2014
0e2a071
add some comments to filte.lua
zrong Mar 31, 2014
4587534
android build is OK now
zrong Apr 1, 2014
895e37c
fix CCFilteredSpriteWithMulti bugs
zrong Apr 1, 2014
0f3f579
update
zrong Apr 1, 2014
98eb3cf
add CCDrawNodeExtend.lut, an encapsulation to CCDrawNode
zrong Apr 2, 2014
6112b6e
merge newSprite and newScale9Sprite
zrong Apr 2, 2014
3d6e9b9
Merge branch 'zrong' of github.com:zrong/quick-cocos2d-x into zrong
zrong Apr 2, 2014
ede98bd
modify the path config in SimulatorConfig.cpp;
zrong Apr 3, 2014
3251086
add the filters filt to xcode project
Apr 3, 2014
c62d5da
Merge branch 'zrong' of 192.168.18.18:lib/quick into zrong
Apr 3, 2014
6640ce5
modify SimulatorConfig path
Apr 3, 2014
c7b351f
Merge branch 'zrong' of github.com:zrong/quick-cocos2d-x into zrong
zrong Apr 3, 2014
62e44f2
fix display.newFSprite
zrong Apr 3, 2014
ac9f68f
remove precision from shapen filter, because the PVR is not support it
Apr 8, 2014
1f2c1f6
add condition compile of shaders; add samper of filters
zrong Apr 9, 2014
2f13e8c
fix shader compile errors
Apr 9, 2014
b14a48c
filter shader bugs
zrong Apr 9, 2014
b356da2
fix hue shader bug
Apr 9, 2014
0ba2753
improve filters sample
zrong Apr 9, 2014
29b2ad7
modify CCGrayFilter::setPrameters
zrong Apr 9, 2014
2db5b79
fix methods
zrong Apr 9, 2014
07c663d
add printscreen to display.lua
zrong Apr 10, 2014
7007c5a
improve CCDrawNodeExtend
zrong Apr 10, 2014
cfae9ae
add CCDrawNodeExtend:clear
zrong Apr 10, 2014
f6f9ef4
improve CCHTTPRequest to upload file
zrong Apr 12, 2014
3be9b8a
improve CCHTTPRequest to upload a file
zrong Apr 14, 2014
95a1db3
export resumeSchedulerAndActions and pauseSchedulerAndActions to lua
zrong Apr 16, 2014
c336ee1
add async image to display.addSpriteFrameList
zrong Apr 18, 2014
4c37fea
update framework
zrong Apr 18, 2014
db460b8
merge develop
zrong Apr 18, 2014
4fe2341
Merge branch 'develop' into zrong
zrong Apr 22, 2014
a740d9a
add dragonbones extension
zrong Apr 23, 2014
6305e7a
fix DB Matrix compile error.
zrong Apr 23, 2014
d81c9c6
merge new DragonBones, fix Matrix compile error
zrong Apr 24, 2014
bc508eb
DragonBones lua export has done
zrong Apr 24, 2014
efe8cbf
add removeAllScriptHandler method
zrong Apr 24, 2014
2852247
export AnimationData to lua
zrong Apr 25, 2014
96f108e
add Heads seach paths and replace CCTextureAtlas for OS X
Apr 25, 2014
3e58f35
add zip2dev.sh
zrong Apr 28, 2014
1ff9748
Merge branch 'dragonbones' into zrong
zrong Apr 28, 2014
3612f16
update update.lua
zrong Apr 28, 2014
6d9c818
add a parameter to drawCircle
zrong Apr 28, 2014
dd53ebb
Move old dragonbones sample to ccarmature;
zrong Apr 28, 2014
88926b6
Fix memory leak of CCImage:getColor4F
zrong Apr 28, 2014
2044248
update framework
zrong Apr 29, 2014
ed11ec8
Modify Android.mk to build DragonBones
zrong Apr 29, 2014
478d0e2
fix typo
zrong May 1, 2014
ae55015
update framework
zrong May 1, 2014
7d3d8e0
insert DRagonBones and filter to ios project
May 1, 2014
499b7e5
Cancel all of CCLOG;
zrong May 7, 2014
cdaaba9
Add clear filter function into filter sample.
zrong May 7, 2014
40e186f
Merge branch 'zrong' of 192.168.18.18:lib/quick into zrong
zrong May 7, 2014
8979d68
Modify display.newMaskedSprite to support offset
zrong May 14, 2014
23181fb
Update framework.
zrong May 14, 2014
e373b0b
Update newMaskedSprite to return a Texture
zrong May 14, 2014
90d7a88
Update framework
zrong May 14, 2014
9077eb2
update framework
zrong May 14, 2014
3f8ea6c
Update framework
zrong May 14, 2014
fa21f71
fix a bua of CCDragonBonesExtend removeScriptListener
zrong May 19, 2014
d9eb152
update framework
zrong May 19, 2014
fad81f7
Fixs ByteArray.writeRawByte and writeString and readString bugs, than…
zrong May 22, 2014
c654976
update filter.lua
zrong Jun 10, 2014
70365ed
update Cocos2dxActivity.java for onResume bug
zrong Jun 11, 2014
6c33d91
update framwork
zrong Jun 11, 2014
d815726
ignore local properties
zrong Jun 16, 2014
32ed02d
Merge branch 'zrong' of github.com:zrong/quick-cocos2d-x into zrong
zrong Jun 16, 2014
ccfa74a
update proj.properties
zrong Jun 18, 2014
e1d39b1
update README
zrong Jun 23, 2014
79ba04c
Add WebView components for ios
zrong Jun 23, 2014
30b25ad
Test WebView in Android is done
zrong Jun 24, 2014
a68a5ef
Update package name, set activity name in android project.
zrong Jun 24, 2014
68c8a1c
remove CCB support and CCArmature support
zrong Jun 25, 2014
540a527
Modify template
zrong Jun 25, 2014
4b707a6
Add webview.lua; remove framework_precompiled.zip from samples
zrong Jun 25, 2014
6dad909
update template
zrong Jun 25, 2014
8ad2bf7
add webview support in win32
zrong Jun 25, 2014
7083e5d
rename AssetsManager to Updater
zrong Jun 29, 2014
c7120dc
modify Updater
zrong Jun 30, 2014
dba6702
update cocos2d-x win32 project for updater
zrong Jun 30, 2014
5d31312
update update module
zrong Jul 1, 2014
3bbf1d6
Merge branch 'zrong' of github.com:zrong/quick-cocos2d-x into zrong
zrong Jul 1, 2014
e138d34
update update module
zrong Jul 1, 2014
bdfb762
update Updater moodule
zrong Jul 1, 2014
2028ae6
update CCFileUtils and update module
zrong Jul 2, 2014
e2cadeb
add io.getres method for update;modify display.newSprite for update.
zrong Jul 3, 2014
7a331cd
Remove ccarmature sample.
zrong Jul 7, 2014
a3b323e
Add DragonSwitchClothes demo
zrong Jul 7, 2014
102342a
fix proj.mac to support extends/update module;Add 2 demo to samples/d…
zrong Jul 8, 2014
8fb6116
update README
zrong Jul 8, 2014
f14e92b
Fix update module for win32
zrong Jul 8, 2014
34e7805
update README.md
zrong Jul 8, 2014
a3d7652
Delete some methods about Long in lua.ByteArray; Add samples/bytearray
zrong Jul 9, 2014
f425ef6
fix some memory issues about dragonbones
zrong Jul 11, 2014
2019ea5
update dragonbone sample
zrong Jul 15, 2014
6f6dd94
Add async loader to CCAnimationCache and CCSpriteFrameCache
zrong Jul 16, 2014
cb664cc
update README
zrong Jul 16, 2014
521efc3
Fix runtimeerror in windows
zrong Jul 17, 2014
5bf6a3e
Update CCDragonBones
zrong Jul 17, 2014
93bc355
Update DragonBones Event system
zrong Jul 18, 2014
364ed66
fix addSpriteFramesWithFile error in CCSpriteFrameCache
zrong Jul 18, 2014
aafb048
Add aync loading to DragonBones
zrong Jul 19, 2014
1eb0f4b
fix some syntax for ndk
zrong Jul 21, 2014
3068a59
Rename DragonBones/renderer/Cocos2dx* to CCDB*; Update Create functio…
zrong Jul 22, 2014
b823770
debug dragonbones async loading.
zrong Jul 23, 2014
eb626b3
add some dbs files
zrong Jul 24, 2014
e509068
Fix memory leak of dragonbones
zrong Jul 24, 2014
65c0c6f
update dragonbones framework and sample
zrong Jul 25, 2014
66c6055
rename __func__ to __FUNCTION__ because msvs is unsupported it
zrong Jul 25, 2014
d5ab670
fix build error in win32
zrong Jul 25, 2014
261f276
Fix android compile error;Update README
zrong Jul 25, 2014
af4ffc5
update framework
zrong Jul 25, 2014
927cc04
Fix Sigleton error in windows
zrong Jul 26, 2014
a73ad4b
when provide a out of range to CCImage::getColor4B, retuan a {0,0,0,0…
zrong Jul 27, 2014
27744e2
Fix slash after path
zrong Jul 28, 2014
9fbb346
update ios project for dragonbones
zrong Jul 28, 2014
42800e8
modify CCDBNode
zrong Jul 28, 2014
37bc653
Add SetColor and SetOpacity supports to DragonBones.
zrong Jul 30, 2014
8173ad0
Ignore lua path in some samples.
zrong Jul 30, 2014
b17e731
Add Javascript and Cookie support in Android
zrong Jul 31, 2014
5e427cc
update java template for webview
zrong Jul 31, 2014
f38a371
Modify Updater module
zrong Aug 17, 2014
c83afb2
fix curl buts
zrong Aug 17, 2014
d39388f
update framework
zrong Aug 18, 2014
b7034d6
update update
zrong Aug 18, 2014
2034fc0
fix update bug
zrong Aug 19, 2014
3f8c7a1
update display
zrong Aug 20, 2014
2eb3a74
upadte framework
zrong Aug 20, 2014
a46202c
modify vardump
zrong Aug 21, 2014
b93f9a0
update gettext
zrong Aug 21, 2014
1e55066
adjust functions.lua
zrong Aug 25, 2014
03a91b5
update display
zrong Aug 28, 2014
03a51aa
update CURL to CURLOPT_FRESH_CONNECT
zrong Sep 11, 2014
dab1f61
fix memory leak in CCFileteredSprite
zrong Sep 16, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ lib/proj.win32/Release/
*/*/proj.android/obj/
*/*/proj.android/assets/
*/*/proj.android/libs/

develop.zip
local.properties
92 changes: 45 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,62 @@
## CHINESE => [README_CN.md](README_CN.md)
根据我们的项目需要,我对 [quick-cocos2d-x][3] 做了一些修改。

quick-cocos2d-x is a **quick** framework, based on cocos2d-x. Make mobile games in Lua.
这个版本基于 quick 被收购前停止更新几个月的过程中,quick社区推送多个pr后的最新的一个版本。quick 升级到 2.2.3 后有许多大的修改,例如更新player到QT,重写framework架构,对framework中的部分class进行重命名等等。由于对现有项目影响太大,我没有跟进。

**CODE LESS, PLAY MORE !**
所以,这个版本与目前的quick 2.2.3 不兼容。

> [cocos2d-x](http://www.cocos2d-x.org) is a multi-platform 2D game engine in C++, based on cocos2d-iphone and licensed under MIT. Now this engine has been expanded to iOS, Android, Bada, BlackBerry, Marmalade and desktop operating systems like Linux, WindowsXP & Windows7.
这个版本主要进行了如下修改,这些修改有的已经同步到官方quick库中,有的则没有。

<br />
没有同步的原因同上。

## Run Player
2014-07-25 更新:

Open quick-cocos2d-x/player/bin/mac/quick-x-player.app, or quick-cocos2d-x/player/bin/win32/quick-x-player.exe
1. 解决 DragonBonesCPP 的内存泄露;
2. 为 DragonBonesCPP 增加异步加载功能;
3. 完善 lua framewark 支持,将所有DragonBones功能移到 [dragonbones.lua][9] 中。
4. 为 [dragonbones sample][10] 增加一个 [DragonAsyncLoading][11] 范例,描述如何实现同步/异步加载,以及如何清理缓存。

![](http://cn.quick-x.com/wp-content/uploads/2013/08/player_01.png)
2014-07-16 更新:

1. Select menu: File -> Open
2. Set Project Directory to **quick-cocos2d-x/sample/coinflip**
3. Set Script File to **scripts/main.lua**
4. Set Screen Direction to **Portrait**
5. Click "Open Project" button.
1. 更新 DragonBonesCPP 库到最新,解决一些内存泄露;
2. 为 CCAnimationCache/CCSpriteFrameCache 加入异步加载支持。

Get Started:
2014-07-09 更新:

- quick-cocos2d-x official site: [quick-x.com](http://quick-x.com/)
- chinese official site: [cn.quick-x.com](http://cn.quick-x.com/)
1. 增加 samples/bytearray ;
2. 解决 ByteArray 的bug;
3. 删除 ByteArray:readLong/readULong/writeLong/writeULong,[原因见此][8] 。

2014-07-08 更新:

<br />
1. 修复 Mac/Win32 版本 player 的编译错误;
2. 删除 extensions/AssetsManager 模块,使用 extensions/updater 取而代之;
3. 删除 samples/ccarmature ,因为 CCArmature 已经被删除,sample当然也没用了;
4. 为 samples/dragonbones 加入了两个demo:SwitchClothes 和 ChaseStarling ;
5. 增加几个lua导出方法以支持新加入的两个 demo。

----
2014-06-25 更新:

## Why quick-cocos2d-x
1. 删除 CCB 支持,这个编辑器的开发早已停止,我并不使用它;
2. 删除 CCArmature,因为已经使用了DragonBonesCPP;
3. 加入 iOS 和 Android 的WebView组件,位于 extensions,详见:[在 cocos2d-x 中嵌入浏览器][7] 。

QUICK = SUCCESS !
之前的更新:

- **No risk**: cocos2d-x's Lua support already exists two years, mature, reliable, the choice of large companies.

- **Full-featured framework**: Write the entire game using Lua, no C++ requirements.

- **Native extensions**: Integration of third-party components, including Payment, Ad, Analysis. Lua-ObjectiveC and Lua-Java bridge make life easy.

- **Enhanced Simulator**: Run the game from any directory, multiple resolution switching, debug console.

- **100% FREE**: cocos2d-x, Lua, quick-cocos2d-x all is Open-Sources project. licensed under MIT.

<br />

### Framework main features:

- display: creates scenes, display objects, animation ...
- transition: moving, fades, creates animation programing easy ...
- audio: play background music, effect sounds ...
- ui: creates button, menu, label ...
- luaoc: Lua call Objective-C, Objective-C call Lua ...
- luaj: Lua call Java, Java call Lua ...
- network: Asynchronous HTTP requests, JSON, check the network status ...

<br />

If you want to support the development of this project, please donate to the ongoing pledgie.org campagin.

<a href='https://pledgie.com/campaigns/22966'><img alt='Click here to lend your support to: quick-cocos2d-x and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/22966.png?skin_name=chrome' border='0' ></a>
1. 加入 [SocketTCP][4] 对 luasocket 进行了封装;
1. 模仿AS3用lua实现了 [ByteArray][5];
1. 加入 [DragonBonesCPP][1] 组件,位于 extensions,使用 CCDragonBones.lua 进行了封装;
2. 加入 [cocos2d-x-filter][2] 组件,位于 extensioins,使用 filters.lua 进行了封装;
3. 加入了 CCDrawNodeExtend.lua 对 CCDrawNode 的常用方法进行封装;
4. 增加 printscreen, upload 等多个常用方法……

[1]: https://github.com/DragonBones/DragonBonesCPP
[2]: https://github.com/zrong/cocos2d-x-filters
[3]: https://github.com/chukong/quick-cocos2d-x
[4]: http://zengrong.net/post/1980.htm
[5]: http://zengrong.net/post/1968.htm
[6]: https://github.com/go3k/CCXWebview
[7]: http://zengrong.net/post/2123.htm
[8]: http://zengrong.net/post/2134.htm
[9]: https://github.com/zrong/quick-cocos2d-x/blob/zrong/framework/dragonbones.lua
[10]: https://github.com/zrong/quick-cocos2d-x/blob/zrong/samples/dragonbones/
[11]: https://github.com/zrong/quick-cocos2d-x/blob/zrong/samples/dragonbones/scripts/demos/DragonAsyncLoading.lua
48 changes: 16 additions & 32 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
quick-cocos2d-x 是一个可以让您觉得“爽快”的 cocos2d-x 的扩展版。基于 cocos2d-x,完全的跨平台能力、优异的性能和可靠性。而 quick-cocos2d-x 在这一切的基础上,添加了完善的 Lua 脚本语言支持,让开发者可以使用 Lua 这种简单易用的脚本语言完成商业品质的移动游戏
根据我们的项目需要,我对 [quick-cocos2d-x][3] 做了一些修改

这个版本基于 quick 被收购前停止更新几个月的过程中,quick社区推送多个pr后的最新的一个版本。quick 升级到 2.2.3 后有许多大的修改,例如更新player到QT,重写framework架构,对framework中的部分class进行重命名等等。由于对现有项目影响太大,我没有跟进。

**中国区特别推荐:**
所以,这个版本与目前的quick 2.2.3 不兼容。

- quick-cocos2d-x 中文站 [http://cn.quick-x.com/](http://cn.quick-x.com/)
- QQ 群 284148017, 243709595
- 新浪微博 [http://weibo.com/quickcocos2dx](http://weibo.com/quickcocos2dx)
- OSChina 镜像仓库(国内访问稳定快速),100% 和 github 仓库同步,地址 [http://git.oschina.net/dualface/quick-cocos2d-x](http://git.oschina.net/dualface/quick-cocos2d-x)
- CSDN 镜像仓库(国内访问稳定快速),100% 和 github 仓库同步,地址 [https://code.csdn.net/liaoyulei01/quick-cocos2d-x](https://code.csdn.net/liaoyulei01/quick-cocos2d-x)
这个版本主要进行了如下修改,这些修改有的已经同步到官方quick库中,有的则没有。

没有同步的原因同上。

**如果你觉得 quick-cocos2d-x 靠谱,请点一下本页面上面的 "Star" 按钮,然后发发微博帮忙宣传吧**


<br />


## 为什么选择 quick-cocos2d-x

在这个“以快致胜”的时代,生产力很大程度上决定了成败!

* **Lua 是成熟、无风险的选择**: cocos2d-x 对 Lua 的支持已经很成熟,国内外多家大型开发商都在使用 cocos2d-x + Lua 开发游戏。而且 Lua 在游戏领域已经有十多年的实践使用,被各种大型端游所应用。所以可以找到各种 Lua 的开源项目来进一步降低开发成本。

* **低门槛、高效率**: Lua 简单易用,了解任何一种语言的开发者都可以在一周内掌握。而且 quick-cocos2d-x 提供了一个全功能的,基于 Lua 语言的高层开发框架。这个框架可以极大程度降低游戏开发的门槛并提高开发效率。一个没有任何 C++ 知识的团队也能创建商业品质的移动游戏。

* **出色的框架设计**: quick-cocos2d-x 由具备多年框架和 API 设计经验的资深开发者创建。之前我们创建的 FleaPHP、QeePHP 都是国内顶尖的 PHP 开发框架之一。今时今日,我们将多年来积累的经验带到了移动领域,为移动游戏开发提供了一流质量的开发框架支持。

* **无痛升级**: 高层开发框架的引入,统一了底层 cocos2d-x 的 API,解决了 cocos2d-x 升级改进时对游戏开发和维护带来的影响。团队不再需要纠结是否升级,没有任何痛苦就可以获得最新版 cocos2d-x 带来的好处。quick-cocos2d-x 将会紧跟 cocos2d-x 的版本发布,并且尽力保证高层框架的 API 不发生破坏兼容性的变化。

* **无限的扩展能力**: quick-cocos2d-x 准备了多种扩展,让开发者可以用 C++/Java/Objective-C 语言开发与设备操作系统、第三方平台相关的功能,并方便的集成到 Lua 脚本中。而且 quick-cocos2d-x 还附带了预先开发完成的第三方库,可以为游戏添加支付、分析、广告等服务。随着时间的流逝,这些扩展插件还在不断增加,并且全部以开源形式发布。

* **增强的开发环境**: 在 Windows 和 Mac 环境下,quick-cocos2d-x 提供了更完善的模拟器,开发者只要一个执行文件就可以开始游戏的开发和测试。

* **最快的脚本引擎**: Lua 是“最快”的脚本语言之一,而 quick-cocos2d-x 集成了 LuaJIT,在支持 JIT 的设备上,可以将 Lua 脚本编译为机器码执行,性能无以伦比。

* **开放源代码**: cocos2d-x、Lua,以及 quick-cocos2d-x 都是开源的项目。这意味着更低的成本、自由修改的权利,以及快速发展的技术。  
1. 加入 [SocketTCP][4] 对 luasocket 进行了封装;
1. 模仿AS3用lua实现了 [ByteArray][5];
1. 加入 [DragonBonesCPP][1] 组件,使用 CCDragonBones.lua 进行了封装;
2. 加入 [cocos2d-x-filter][2] 组件,使用 filters.lua 进行了封装;
3. 加入了 CCDrawNodeExtend.lua 对 CCDrawNode 的常用方法进行封装;
4. 增加 printscreen, upload 等多个常用方法……

[1]: https://github.com/DragonBones/DragonBonesCPP
[2]: https://github.com/zrong/cocos2d-x-filters
[3]: https://github.com/chukong/quick-cocos2d-x
[4]: http://zengrong.net/post/1980.htm
[5]: http://zengrong.net/post/1968.htm
Binary file added bin/win32/iconv/dos2unix.exe
Binary file not shown.
Binary file added bin/win32/iconv/iconv.exe
Binary file not shown.
Binary file added bin/win32/iconv/libcharset1.dll
Binary file not shown.
Binary file added bin/win32/iconv/libiconv-2.dll
Binary file not shown.
Binary file added bin/win32/iconv/libiconv.mo
Binary file not shown.
Binary file added bin/win32/iconv/libiconv2.dll
Binary file not shown.
Binary file added bin/win32/iconv/libintl-8.dll
Binary file not shown.
Binary file added bin/win32/iconv/libintl3.dll
Binary file not shown.
Binary file added bin/win32/iconv/mac2unix.exe
Binary file not shown.
Binary file added bin/win32/iconv/unix2dos.exe
Binary file not shown.
Binary file added bin/win32/iconv/unix2mac.exe
Binary file not shown.
Empty file modified bin/win32/lua51.dll
100644 → 100755
Empty file.
Empty file modified bin/win32/luajit.exe
100644 → 100755
Empty file.
Empty file modified bin/win32/php.exe
100644 → 100755
Empty file.
Empty file modified bin/win32/php5ts.dll
100644 → 100755
Empty file.
Empty file modified bin/win32/setx.exe
100644 → 100755
Empty file.
Empty file modified bin/win32/ssleay32.dll
100644 → 100755
Empty file.
Empty file modified bin/win32/tolua++.exe
100644 → 100755
Empty file.
21 changes: 10 additions & 11 deletions framework/cc/utils/ByteArray.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A sample: https://github.com/zrong/lua#ByteArray
@author zrong(zengrong.net)

Creation 2013-11-14
Last Modification 2014-01-01
Last Modification 2014-07-09
]]
local ByteArray = class("ByteArray")

Expand Down Expand Up @@ -200,6 +200,9 @@ function ByteArray:writeUShort(__ushort)
return self
end

--[[
-- 2014-07-09 Remove all of methods about Long in ByteArray.
-- @see http://zengrong.net/post/2134.htm
function ByteArray:readLong()
local __, __v = string.unpack(self:readBuf(8), self:_getLC("l"))
return __v
Expand All @@ -222,6 +225,7 @@ function ByteArray:writeULong(__ulong)
self:writeBuf(__s)
return self
end
]]

function ByteArray:readUByte()
local __, __val = string.unpack(self:readRawByte(), "b")
Expand All @@ -245,6 +249,8 @@ function ByteArray:writeLuaNumber(__number)
return self
end

--- The differently about (read/write)StringBytes and (read/write)String
-- are use pack libraty or not.
function ByteArray:readStringBytes(__len)
assert(__len, "Need a length of the string!")
if __len == 0 then return "" end
Expand All @@ -259,18 +265,11 @@ function ByteArray:writeStringBytes(__string)
return self
end

--- DO NOT use this method, it's inefficient.
-- Alternatively use readStringBytes.
function ByteArray:readString(__len)
assert(__len, "Need a length of the string!")
if __len == 0 then return "" end
self:_checkAvailable()
local __bytes = ""
for i=self._pos, #self._buf do
local __byte = string.byte(self._buf[i])
__bytes = __bytes .. string.char(__byte)
end
return __bytes
return self:readBuf(__len)
end

function ByteArray:writeString(__string)
Expand Down Expand Up @@ -390,7 +389,7 @@ function ByteArray:writeRawByte(__rawByte)
self._buf[i] = string.char(0)
end
end
self._buf[self._pos] = __rawByte
self._buf[self._pos] = string.sub(__rawByte, 1,1)
self._pos = self._pos + 1
return self
end
Expand All @@ -406,7 +405,7 @@ end
--- Write a encoded char array into buf
function ByteArray:writeBuf(__s)
for i=1,#__s do
self:writeRawByte(__s:sub(i))
self:writeRawByte(string.sub(__s,i,i))
end
return self
end
Expand Down
22 changes: 15 additions & 7 deletions framework/cc/utils/Gettext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,30 @@ function Gettext._getFileData(mo_file)

--- use quick-cocos2d-x CCFileUtils, cross-platform
local mo_data = CCFileUtils:sharedFileUtils():getFileData(mo_file)
if not mo_data then
print("Gettext._getFileData("..mo_file.."), the file is not exists.")
end
return mo_data
end

function Gettext.loadMOFromFile(mo_file)
return Gettext.parseData(Gettext._getFileData(mo_file))
end

function Gettext.gettextFromFile(mo_file)
return Gettext.gettext(Gettext._getFileData(mo_file))
function Gettext.gettextFromFile(mo_file, strict)
return Gettext.gettext(Gettext._getFileData(mo_file), strict)
end

function Gettext.gettext(mo_data)
local __hash = Gettext.parseData(mo_data)
return function(text)
return __hash[text] or text
end
function Gettext.gettext(mo_data, strict)
if mo_data then
local __hash = Gettext.parseData(mo_data)
return function(text)
return __hash[text] or text
end
elseif strict then
return nil
end
return function(text) return text end
end

function Gettext.parseData(mo_data)
Expand Down
1 change: 1 addition & 0 deletions framework/cocos2dx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ require(cc.PACKAGE_NAME .. ".cocos2dx.CCSceneExtend")
require(cc.PACKAGE_NAME .. ".cocos2dx.CCSpriteExtend")
require(cc.PACKAGE_NAME .. ".cocos2dx.CCLayerExtend")
require(cc.PACKAGE_NAME .. ".cocos2dx.CCDrawNodeExtend")
require(cc.PACKAGE_NAME .. ".cocos2dx.CCDragonBonesExtend")
80 changes: 80 additions & 0 deletions framework/cocos2dx/CCDragonBonesExtend.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
-- For CCDragonBones
-- @author zrong(zengrong.net)
-- Creation: 2014-04-24

CCDragonBonesExtend = class("CCDragonBonesExtend", CCNodeExtend)
CCDragonBonesExtend.__index = CCDragonBonesExtend

CCDragonBonesExtend.EVENTS = {
MOVEMENT_CHANGE = AnimationEvent.START,
FADE_IN = AnimationEvent.FADE_IN,
FADE_OUT = AnimationEvent.FADE_OUT,
START = AnimationEvent.START,
COMPLETE = AnimationEvent.COMPLETE,
LOOP_COMPLETE = AnimationEvent.LOOP_COMPLETE,
FADE_IN_COMPLETE = AnimationEvent.FADE_IN_COMPLETE,
FADE_OUT_COMPLETE = AnimationEvent.FADE_OUT_COMPLETE,
}

function CCDragonBonesExtend.extend(target)
local t = tolua.getpeer(target)
if not t then
t = {}
tolua.setpeer(target, t)
end
setmetatable(t, CCDragonBonesExtend)
return target
end

function CCDragonBonesExtend:addMovementScriptListener(listener)
self:removeMovementScriptListener()
local __bridge = function(evt)
listener(evt:getType(), evt:getMovementID())
end
self:addScriptListener(CCDragonBonesExtend.EVENTS.START, __bridge)
self:addScriptListener(CCDragonBonesExtend.EVENTS.COMPLETE, __bridge)
self:addScriptListener(CCDragonBonesExtend.EVENTS.LOOP_COMPLETE, __bridge)
return self
end

function CCDragonBonesExtend:removeMovementScriptListener()
self:removeScriptListener(CCDragonBonesExtend.EVENTS.START)
self:removeScriptListener(CCDragonBonesExtend.EVENTS.COMPLETE)
self:removeScriptListener(CCDragonBonesExtend.EVENTS.LOOP_COMPLETE)
return self
end

function CCDragonBonesExtend:addScriptListener(evtType, listener)
self:removeScriptListener(evtType, listener)
self._listeners[evtType] = listener
self:registerScriptHandler(listener, evtType)
return self
end

function CCDragonBonesExtend:removeScriptListener(evtType, listener)
if not self._listeners then self._listeners = {} end
local __listener = self._listeners[evtType]
if __listener then
self:unregisterScriptHandler(evtType)
self._listeners[evtType] = nil
end
return self
end

function CCDragonBonesExtend:removeAllScriptListener()
for __k, __v in pairs(self._listeners) do
self:removeScriptListener(__k)
end
self._listeners = {}
return self
end

function CCDragonBonesExtend:getAnimations()
local aniList = self:getAnimationList()
local anis = {}
for i=0,aniList:count()-1 do
anis[#anis+1] = aniList:objectAtIndex(i):getCString()
end
return anis
end

8 changes: 7 additions & 1 deletion framework/cocos2dx/CCDrawNodeExtend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function CCDrawNodeExtend:drawCircle(radius, params)
local startRadian = 0
local endRadian = math.pi*2
local borderWidth = 0
local posX = 0
local posY = 0
if params then
if params.segments then segments = params.segments end
if params.startAngle then
Expand All @@ -50,13 +52,17 @@ function CCDrawNodeExtend:drawCircle(radius, params)
if params.fillColor then fillColor = params.fillColor end
if params.borderColor then borderColor = params.borderColor end
if params.borderWidth then borderWidth = params.borderWidth end
if params.pos then
posX = params.pos[1]
posY = params.pos[2]
end
end
local radianPerSegm = 2 * math.pi/segments
local points = CCPointArray:create(segments)
for i=1,segments do
local radii = startRadian+i*radianPerSegm
if radii > endRadian then break end
points:add(cc.p(radius * math.cos(radii), radius * math.sin(radii)))
points:add(cc.p(posX + radius * math.cos(radii), posY + radius * math.sin(radii)))
end
self:drawPolygon(points:fetchPoints(), points:count(), fillColor, borderWidth, borderColor)
return self
Expand Down
Loading