Skip to content

Commit 8d25c2f

Browse files
author
linshun
committed
2 parents 13b281c + ee0f3ae commit 8d25c2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1762
-965
lines changed

AUTHORS.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,34 @@ Core Developers:
1515
Ricardo Quesada
1616

1717

18-
Developers:
19-
18+
Contributors:
19+
Name GithubID Main contribution
20+
21+
Dali Kilani @dadilcool added instruction to read me
22+
23+
Chris @hannon235 added node.js api for box2d
24+
25+
Jason Aeschliman @jaeschliman fix cc.Node setposition
26+
27+
Sun Zhuoshi(Intel) @sunzhuoshi engine loader fix
28+
29+
Alejandro Reyero @KaTXi fix error message
30+
31+
Long Xiang @seanlong resource loader count
32+
33+
Timm Drevensek(Zynga) @timmjd cc.Class fix
34+
add CCScale9Sprite test
35+
36+
Lzzy Chen @czizzy audio engine fix
37+
cleanup comments
38+
39+
Mcscooter @mcscooter tilempapxml fix
40+
41+
Roed @roed mouse rightclick api
42+
43+
Surith Thekkiam(Zynga) @folecr match Cocos2dx api
44+
45+
Robert Boyd @rboyd fix stackable actions
2046

2147

2248
Cocos2d-x and cocos2d-html5 can not grow so fast without the active community.

CHANGELOG.txt

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
1+
Cocos2d-html5-v2.1.1 @ Jan.28, 2013
2+
* Fixed bugs
3+
* Added mouse button to MouseDispatcher, supports right-click
4+
* Changed preload audio type from "bgm" and "effect" to "sound"
5+
* Added "Sys" class for system capabilities
6+
* Improved cc.BuilderReader to support .ccbi extension auto-completion
7+
* Improved TMXXMLParser to support XML, CSV and zlib compression
8+
* Changed cc.Time.gettimeofdayCocos2d to Date.now which is more javascript friendly.
9+
* Added support for stackable actions
10+
111
Cocos2d-html5-v2.1.0 @ Dec.4, 2012
2-
* Improved cc.Class and add Release Mode.
3-
* All tests and games can now be run on Cocos2d-html5, Cocos2d-iPhone and Cocos2d-x.
4-
* Added support for google.base.
5-
* Added support for CocosBuilder and Bone Animation.
6-
* Updated API for Javascript Binding.
7-
* Integrated Chipmunk physical engine and chipmunk tests.
8-
* Added physicsDebugNode, physicsSprite, drawNode.
9-
* Built cocos2d-js-tests repo for tests.
10-
* Fixed support for mouse/touch/keyboard.
11-
* Fixed bugs.
12-
* Added WaterMelon with me and CocosDragon games for sample.
13-
* Added Edit Box for input.
12+
* Improved cc.Class and add Release Mode
13+
* All tests and games can now be run on Cocos2d-html5, Cocos2d-iPhone and Cocos2d-x
14+
* Added support for google.base
15+
* Added support for CocosBuilder and Bone Animation
16+
* Updated API for Javascript Binding
17+
* Integrated Chipmunk physical engine and chipmunk tests
18+
* Added physicsDebugNode, physicsSprite, drawNode
19+
* Built cocos2d-js-tests repo for tests
20+
* Fixed support for mouse/touch/keyboard
21+
* Fixed bugs
22+
* Added WaterMelon with me and CocosDragon games for sample
23+
* Added Edit Box for input
1424

1525
Cocos2d-html5-v2.0.0 @ Aug.28, 2012
16-
* Updated API to Cocos2d-x V2.0.
17-
* Updated template and directory name.
18-
* Improved JS files loader.
19-
* Added support for Dom rendering.
20-
* Updated JSDoc comments and shell.
21-
* Added TileMap property process and flip.
22-
* Improved BMFont.
23-
* Added Actions spline paths and cc.AnimationFrame.
24-
* Added support for multi-touch.
25-
* Added mini-framework for Dom manipulation.
26-
* Changed cc.Animation, cc.AudioEngine, cc.LableTTF and cc.Sprite API.
26+
* Updated API to Cocos2d-x V2.0
27+
* Updated template and directory name
28+
* Improved JS files loader
29+
* Added support for Dom rendering
30+
* Updated JSDoc comments and shell
31+
* Added TileMap property process and flip
32+
* Improved BMFont
33+
* Added Actions spline paths and cc.AnimationFrame
34+
* Added support for multi-touch
35+
* Added mini-framework for Dom manipulation
36+
* Changed cc.Animation, cc.AudioEngine, cc.LableTTF and cc.Sprite API
2737

2838

2939
Cocos2d-html5-v0.5.0-alpha2 @ Jun.18, 2012
30-
* Changed API, use "create" to construct all objects.
31-
* Fixed naming of variables.
32-
* Added JSDoc comments and shell.
33-
* Fixed Dom Menu flicker bug.
34-
* Changed code for closure compiler Advance optional.
35-
* Added version control.
40+
* Changed API, use "create" to construct all objects
41+
* Fixed naming of variables
42+
* Added JSDoc comments and shell
43+
* Fixed Dom Menu flicker bug
44+
* Changed code for closure compiler Advance optional
45+
* Added version control
3646

3747
Cocos2d-html5-v0.5.0-alpha @ May.28, 2012
38-
* supports canvas and Dom Menu.
39-
* part of test cases were added and tested in chrome.
40-
* porting from cocos2d-x is not finished.
41-
* files must load from http server.
48+
* supports canvas and Dom Menu
49+
* part of test cases were added and tested in chrome
50+
* porting from cocos2d-x is not finished
51+
* files must load from http server
4252

4353
Cocos2d-html5-v0.1.0 @ Jan.29, 2012
4454
* Build the directory structure of Engine

Demo/NativeClientDemo/cocos2d.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
(function () {
2828
var d = document;
2929
var c = {
30-
menuType:'canvas', //whether to use canvas mode menu or dom menu
3130
COCOS2D_DEBUG:2, //0 to turn debug off, 1 for basic debug, and 2 for full debug
3231
box2d:false,
3332
chipmunk:false,

HelloHTML5World/build.xml

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,74 @@
66

77
<target name="compile">
88
<jscomp compilationLevel="simple" warning="quiet"
9-
debug="false" output="myApp-v0.1.js">
9+
debug="false" output="myApp-HelloWorld.js">
1010
<sources dir="${basedir}/../cocos2d">
1111
<file name="platform/CCClass.js"/>
1212
<file name="platform/CCCommon.js"/>
13-
<file name="platform/platform.js"/>
1413
<file name="platform/miniFramework.js"/>
14+
<file name="platform/ZipUtils.js"/>
15+
<file name="platform/base64.js"/>
16+
<file name="platform/gzip.js"/>
17+
<file name="platform/CCMacro.js"/>
18+
<file name="platform/CCFileUtils.js"/>
19+
<file name="platform/CCTypes.js"/>
20+
<file name="platform/zlib.min.js"/>
1521
<file name="cocoa/CCGeometry.js"/>
16-
<file name="cocoa/CCSet.js"/>
22+
<file name="platform/Sys.js"/>
23+
<file name="platform/CCConfig.js"/>
1724
<file name="cocoa/CCNS.js"/>
18-
<file name="platform/CCTypes.js"/>
25+
<file name="cocoa/CCSet.js"/>
1926
<file name="cocoa/CCAffineTransform.js"/>
2027
<file name="support/CCPointExtension.js"/>
28+
<file name="support/CCUserDefault.js"/>
2129
<file name="base_nodes/CCNode.js"/>
2230
<file name="base_nodes/CCdomNode.js"/>
23-
<file name="platform/CCMacro.js"/>
24-
<file name="platform/CCConfig.js"/>
31+
<file name="base_nodes/CCAtlasNode.js"/>
2532
<file name="textures/CCTexture2D.js"/>
2633
<file name="textures/CCTextureCache.js"/>
34+
<file name="textures/CCTextureAtlas.js"/>
35+
<file name="misc_nodes/CCRenderTexture.js"/>
36+
<file name="misc_nodes/CCProgressTimer.js"/>
37+
<file name="effects/CCGrid.js"/>
38+
<file name="effects/CCGrabber.js"/>
2739
<file name="actions/CCAction.js"/>
2840
<file name="actions/CCActionInterval.js"/>
41+
<file name="actions/CCActionInstant.js"/>
2942
<file name="actions/CCActionManager.js"/>
43+
<file name="actions/CCActionProgressTimer.js"/>
44+
<file name="actions/CCActionCamera.js"/>
3045
<file name="actions/CCActionEase.js"/>
46+
<file name="actions/CCActionGrid.js"/>
47+
<file name="actions/CCActionTiledGrid.js"/>
48+
<file name="actions/CCActionCatmullRom.js"/>
3149
<file name="layers_scenes_transitions_nodes/CCScene.js"/>
3250
<file name="layers_scenes_transitions_nodes/CCLayer.js"/>
3351
<file name="layers_scenes_transitions_nodes/CCTransition.js"/>
52+
<file name="layers_scenes_transitions_nodes/CCTransitionProgress.js"/>
53+
<file name="layers_scenes_transitions_nodes/CCTransitionPageTurn.js"/>
3454
<file name="sprite_nodes/CCSprite.js"/>
55+
<file name="sprite_nodes/CCAnimation.js"/>
56+
<file name="sprite_nodes/CCAnimationCache.js"/>
57+
<file name="sprite_nodes/CCSpriteFrame.js"/>
58+
<file name="sprite_nodes/CCSpriteFrameCache.js"/>
59+
<file name="sprite_nodes/CCSpriteBatchNode.js"/>
60+
<file name="label_nodes/CCLabelAtlas.js"/>
3561
<file name="label_nodes/CCLabelTTF.js"/>
36-
<file name="text_input_node/CCIMEDispatcher.js"/>
62+
<file name="label_nodes/CCLabelBMFont.js"/>
63+
<file name="particle_nodes/CCParticleSystem.js"/>
64+
<file name="particle_nodes/CCParticleBatchNode.js"/>
65+
<file name="particle_nodes/CCParticleSystemQuad.js"/>
66+
<file name="particle_nodes/CCParticleExamples.js"/>
3767
<file name="touch_dispatcher/CCTouchDelegateProtocol.js"/>
3868
<file name="touch_dispatcher/CCTouchHandler.js"/>
3969
<file name="touch_dispatcher/CCTouchDispatcher.js"/>
40-
<file name="keypad_dispatcher/CCKeypadDelegate.js"/>
41-
<file name="keypad_dispatcher/CCKeypadDispatcher.js"/>
70+
<file name="touch_dispatcher/CCMouseDispatcher.js"/>
71+
<file name="keyboard_dispatcher/CCKeyboardDelegate.js"/>
72+
<file name="keyboard_dispatcher/CCKeyboardDispatcher.js"/>
73+
<file name="text_input_node/CCIMEDispatcher.js"/>
74+
<file name="text_input_node/CCTextFieldTTF.js"/>
4275
<file name="CCDirector.js"/>
76+
<file name="CCCamera.js"/>
4377
<file name="CCScheduler.js"/>
4478
<file name="CCLoader.js"/>
4579
<file name="CCDrawingPrimitives.js"/>
@@ -48,10 +82,47 @@
4882
<file name="platform/AppControl.js"/>
4983
<file name="menu_nodes/CCMenuItem.js"/>
5084
<file name="menu_nodes/CCMenu.js"/>
85+
<file name="tileMap_parallax_nodes/CCTMXTiledMap.js"/>
86+
<file name="tileMap_parallax_nodes/CCTMXXMLParser.js"/>
87+
<file name="tileMap_parallax_nodes/CCTMXObjectGroup.js"/>
88+
<file name="tileMap_parallax_nodes/CCTMXLayer.js"/>
89+
<file name="tileMap_parallax_nodes/CCParallaxNode.js"/>
90+
<file name="Draw_Nodes/CCDrawNode.js"/>
91+
<file name="physics_nodes/CCPhysicsDebugNode.js"/>
92+
<file name="physics_nodes/CCPhysicsSprite.js"/>
5193
</sources>
5294
<sources dir="${basedir}/../CocosDenshion">
5395
<file name="SimpleAudioEngine.js"/>
5496
</sources>
97+
<!-- extensions -->
98+
<sources dir="${basedir}/../extensions">
99+
<file name="CCBReader/CCBReaderUtil.js"/>
100+
<file name="CCBReader/CCBValue.js"/>
101+
<file name="CCBReader/CCBKeyframe.js"/>
102+
<file name="CCBReader/CCBSequence.js"/>
103+
<file name="CCBReader/CCNodeLoader.js"/>
104+
<file name="CCBReader/CCBReader.js"/>
105+
<file name="CCBReader/CCControlLoader.js"/>
106+
<file name="CCBReader/CCSpriteLoader.js"/>
107+
<file name="CCBReader/CCNodeLoaderLibrary.js"/>
108+
<file name="CCBReader/CCBRelativePositioning.js"/>
109+
<file name="CCBReader/CCBAnimationManager.js"/>
110+
<file name="GUI/CCControlExtension/CCControl.js"/>
111+
<file name="GUI/CCControlExtension/CCControlButton.js"/>
112+
<file name="GUI/CCControlExtension/CCControlUtils.js"/>
113+
<file name="GUI/CCControlExtension/CCInvocation.js"/>
114+
<file name="GUI/CCControlExtension/CCScale9Sprite.js"/>
115+
<file name="GUI/CCControlExtension/CCControlSlider.js"/>
116+
<file name="GUI/CCControlExtension/CCControlSwitch.js"/>
117+
<file name="GUI/CCControlExtension/CCControlColourPicker.js"/>
118+
<file name="GUI/CCControlExtension/CCControlHuePicker.js"/>
119+
<file name="GUI/CCControlExtension/CCControlSaturationBrightnessPicker.js"/>
120+
<file name="GUI/CCControlExtension/CCMenuPassive.js"/>
121+
<file name="GUI/CCScrollView/CCSorting.js"/>
122+
<file name="GUI/CCScrollView/CCScrollView.js"/>
123+
<file name="GUI/CCScrollView/CCTableView.js"/>
124+
<file name="CCControlEditBox.js"/>
125+
</sources>
55126
<sources dir="${basedir}">
56127
<file name="src/resource.js"/>
57128
<file name="src/myApp.js"/>

chipmunk/chipmunk.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@
2727
};
2828

2929
//var VERSION = CP_VERSION_MAJOR + "." + CP_VERSION_MINOR + "." + CP_VERSION_RELEASE;
30-
3130
var cp;
3231
if(typeof exports === 'undefined'){
3332
cp = {};
3433

3534
if(typeof window === 'object'){
36-
window.cp = cp;
35+
window["cp"] = cp;
3736
}
3837
} else {
3938
cp = exports;
@@ -3370,7 +3369,7 @@
33703369

33713370
SegmentShape.prototype.collisionTable = [
33723371
null,
3373-
function(seg, seg) { return NONE; }, // seg2seg
3372+
function(seg, seg2) { return NONE; }, // seg2seg
33743373
seg2poly
33753374
];
33763375

cocos2d/CCDirector.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,25 +169,23 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
169169
_watcherFun:null,
170170
_watcherSender:null,
171171

172-
_currTimeValue:null,
173172
_isBlur:false,
174173

175174
/**
176175
* Constructor
177176
*/
178177
ctor:function () {
179-
this._currTimeValue = new cc.timeval();
180-
this._lastUpdate = new cc.timeval();
178+
this._lastUpdate = Date.now();
181179
if(!cc.isAddedHiddenEvent){
182180
var selfPointer = this;
183181
window.addEventListener("focus",function(){
184-
selfPointer._lastUpdate = cc.Time.gettimeofdayCocos2d(selfPointer._lastUpdate);
182+
selfPointer._lastUpdate = Date.now();
185183
}, false);
186184
}
187185
},
188186

189187
_resetLastUpdate:function(){
190-
this._lastUpdate = cc.Time.gettimeofdayCocos2d(this._lastUpdate);
188+
this._lastUpdate = Date.now();
191189
},
192190

193191
/**
@@ -213,7 +211,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
213211
this._frameRate = 0;
214212
this._displayStats = false;//can remove
215213
this._totalFrames = this._frames = 0;
216-
this._lastUpdate = new cc.timeval();
214+
this._lastUpdate = Date.now();
217215

218216
//Paused?
219217
this._paused = false;
@@ -255,29 +253,22 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
255253
* calculates delta time since last time it was called
256254
*/
257255
calculateDeltaTime:function () {
258-
var now = cc.Time.gettimeofdayCocos2d(this._currTimeValue);
259-
if (!now) {
260-
cc.log("error in gettimeofday");
261-
this._deltaTime = 0;
262-
return;
263-
}
256+
var now = Date.now();
264257

265258
// new delta time.
266259
if (this._nextDeltaTimeZero) {
267260
this._deltaTime = 0;
268261
this._nextDeltaTimeZero = false;
269262
} else {
270-
this._deltaTime = (now.tv_sec - this._lastUpdate.tv_sec) + (now.tv_usec - this._lastUpdate.tv_usec) / 1000000.0;
271-
this._deltaTime = Math.max(0, this._deltaTime);
263+
this._deltaTime = (now-this._lastUpdate) / 1000;
272264
}
273265

274266
if (cc.DEBUG) {
275267
if (this._deltaTime > 0.2) {
276268
this._deltaTime = 1 / 60.0;
277269
}
278270
}
279-
this._lastUpdate.tv_sec = now.tv_sec;
280-
this._lastUpdate.tv_usec = now.tv_usec;
271+
this._lastUpdate = now;
281272
},
282273

283274
/**
@@ -668,7 +659,7 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
668659
//this.addRegionToDirtyRegion(cc.rect(0, 0, cc.canvas.width, cc.canvas.height));
669660

670661
this.setAnimationInterval(this._oldAnimationInterval);
671-
this._lastUpdate = cc.Time.gettimeofdayCocos2d();
662+
this._lastUpdate = Date.now();
672663
if (!this._lastUpdate) {
673664
cc.log("cocos2d: Director: Error in gettimeofday");
674665
}
@@ -1143,9 +1134,8 @@ cc.Director = cc.Class.extend(/** @lends cc.Director# */{
11431134
},
11441135

11451136
_calculateMPF:function () {
1146-
var now = cc.Time.gettimeofdayCocos2d();
1147-
1148-
this._secondsPerFrame = (now.tv_sec - this._lastUpdate.tv_sec) + (now.tv_usec - this._lastUpdate.tv_usec) / 1000000.0;
1137+
var now = Date.now();
1138+
this._secondsPerFrame = (now-this._lastUpdate)/1000;
11491139
}
11501140
});
11511141

@@ -1173,7 +1163,7 @@ cc.DisplayLinkDirector = cc.Director.extend(/** @lends cc.DisplayLinkDirector# *
11731163
* start Animation
11741164
*/
11751165
startAnimation:function () {
1176-
this._lastUpdate = cc.Time.gettimeofdayCocos2d();
1166+
this._nextDeltaTimeZero = true;
11771167
this.invalid = false;
11781168
cc.Application.sharedApplication().setAnimationInterval(this._animationInterval);
11791169
},

0 commit comments

Comments
 (0)