Skip to content

Commit 53ed1b5

Browse files
committed
Merge pull request cocos2d#4 from cocos2d/master
Merge from the latest version of cocos2d
2 parents 865e934 + b153cbd commit 53ed1b5

File tree

1,707 files changed

+144133
-45209
lines changed

Some content is hidden

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

1,707 files changed

+144133
-45209
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@ tools/tojs/user.cfg
8787
tools/tojs/userconf.ini
8888
# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/
8989
tools/jenkins_scripts/mac/android/userconf.ini
90+
91+
# CTags
92+
tags

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "external/emscripten"]
1111
path = external/emscripten
1212
url = https://github.com/kripken/emscripten.git
13+
[submodule "tools/cocos2d-console"]
14+
path = tools/cocos2d-console
15+
url = https://github.com/cocos2d/cocos2d-console.git

.travis.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1+
---
12
language: cpp
2-
script:
3-
- export NACL_SDK_ROOT=$PWD/nacl_sdk/pepper_canary
4-
- export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin
5-
- make -j4
6-
install:
7-
- "if [ \"$PLATFORM\" != nacl ]; then ./install-deps-linux.sh; fi"
8-
- "if [ \"$PLATFORM\" = nacl ]; then sudo apt-get update; fi"
9-
- "if [ \"$PLATFORM\" = nacl ]; then sudo apt-get install libc6:i386; fi"
10-
- "if [ \"$PLATFORM\" = nacl ]; then wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip; fi"
11-
- "if [ \"$PLATFORM\" = nacl ]; then unzip nacl_sdk.zip; fi"
12-
- "if [ \"$PLATFORM\" = nacl ]; then nacl_sdk/naclsdk update --force pepper_canary; fi"
13-
env:
14-
- PLATFORM=nacl DEBUG=1
15-
- PLATFORM=nacl DEBUG=0
16-
- PLATFORM=linux DEBUG=1
17-
- PLATFORM=linux DEBUG=0
3+
env:
4+
matrix:
5+
- GEN_JSB=YES
6+
- PLATFORM=linux DEBUG=1
7+
- PLATFORM=nacl DEBUG=1
8+
- PLATFORM=android
9+
- PLATFORM=emscripten DEBUG=1
10+
global:
11+
- secure: |-
12+
cHXOjAda+t2tmBVuVAiQfvhDN+unToO6hX1rc3dJeGDOk4rlQnylJacjA7o/
13+
enkWeHagbW2Ja4h7BxQz4h7dada8zEbIbEMK4VEHx6AWwQM+GIEqkJPv5g8k
14+
4P20MLpX4XyUwm/16btpnqgXlyd8Q3Zjh3Vui/5/VzwPnxUQEho=
15+
- secure: |-
16+
U/JsyiSR9q+8wX1arfciy3BdbMQaKmgt48/9tiU7P2RQJ/FR2AHGq85sNGI/
17+
ZUxN4JPLGALEvkFMo4NYyJDUcsdRHZX3vbp5xbSSRaBigqJIj3HDxtlPVf2m
18+
/W2GzcfNNX1ACO18hSWH0d2yFlF263ZmvudzQIfqTESfjGQBzwA=
19+
- secure: |-
20+
Wsngwo3jlZtvuPfr3RNhqrz/liNIhKYnlw4KYJO90gMQ9ZQKRTlMv2BMiPw/
21+
9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh
22+
X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI=
23+
script:
24+
- export NACL_SDK_ROOT=$HOME/bin/nacl_sdk/pepper_canary
25+
- export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin
26+
- export NDK_ROOT=$HOME/bin/android-ndk
27+
- ./tools/travis-scripts/run-script.sh
28+
29+
before_install:
30+
- ./tools/travis-scripts/before-install.sh
31+

AUTHORS

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ Developers:
1111
Ricardo Quesada
1212
Rolando Abarca
1313
Javascript Binding and testjs
14+
15+
carlomorgantinizynga
16+
CCLabelTTF supports for shadow and stroke
17+
Adding CCLabelTTF::createWithFontDefinition.
18+
19+
James Gregory (j4m3z0r, Zynga)
20+
Maintainer of Emscripten port.
21+
Initial Emscripten port.
22+
Use browser font rendering instead of FreeType.
23+
24+
DarraghCoy
25+
Fix a potential crash SimpleAudioEngineOpenSL::playEffect
26+
27+
silverscania
28+
Pass correct parameter to glPixelStorei when creating a texture
29+
30+
FlagellumDei
31+
Center the window correctly on windows
1432

1533
ggggamer
1634
fixed memory leak of preloadEffect on windows
@@ -39,6 +57,7 @@ Developers:
3957

4058
martell
4159
use tinyxml2 to replace libxml2
60+
Added Mingw-crt Support without breaking VS SDK
4261

4362
mchinen
4463
fix emulator issue for OpenGL ES 2.0 on Android
@@ -62,6 +81,7 @@ Developers:
6281
Fix CCUserDefault.cpp compiling on Android.
6382
Fixing CCFileUtils 'createXXXXWithContentsOfFile' path lookup issue.
6483
Add CCDirector::popToSceneStackLevel(int level).
84+
Fixing a bug that custom font can't be loaded correctly if using full path of filename on android.
6585

6686
Waiter
6787
fix an error that OpenSLEngine can't load resources from SD card
@@ -115,6 +135,8 @@ Developers:
115135
CCTableView crashes if a CCTableViewDelegate is not provided.
116136
Fixing a bug that _realOpacity isn't assigned in CCLayerColor::initWithColor.
117137
CCScrollView TouchPriority Fix
138+
Add encrypted PVR.CCZ support to ZipUtils + Tests
139+
Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).
118140

119141
Weeds (Andre Rudlaff)
120142
Used fontconfig to enhance font rendering on linux.
@@ -149,12 +171,15 @@ Developers:
149171
contribute for Android module building
150172
Simpler, correct handling of spritesheet sources for CCScale9Sprite.
151173
Clean up linked libraries for android.
174+
JavaScript debugger improved and bugfixed.
175+
Fix flags for debugger server socket.
152176

153177
Nicolas Gramlich (nicolasgramlich, Zynga)
154178
fixed CCDirector to use CCLabelBMFont instead of CCLabelTTF
155179
added CCBReader (CCBI format)
156180
Added cleanup and reset methods to ScriptingCore.
157181
Fixed a bug in ScriptingCore::evalString not setting the outval.
182+
Updated .classpath of Android project to latest ADT 22 build tool compatibility.
158183

159184
Rohan Kuruvilla (rohankuruvilla, Zynga)
160185
Improvements to JS Bindings.
@@ -273,6 +298,7 @@ Developers:
273298
xyhl515
274299
Fixed a bug that CCControlSwitch::setOn(isOn,false) doesn't work.
275300
Adds VS2012 Express template installing support.
301+
Fixing a logical error in CCDrawNode::drawPolygon.
276302

277303
DarraghCoy
278304
Fix for unaligned memory access crash in CCBReader::readFloat().
@@ -305,12 +331,15 @@ Developers:
305331
Fixing a bug that CCPhysicsSprite was overriding only some of the getPosition methods.
306332
Adding a macro USE_BOX2D to check whether to enable Box2D for linux and nacl port.
307333
Adding Travis build support for linux and NaCl.
334+
Logging assert messages to the console.
335+
Renaming CCScriptSupport::executeAssert to CCScriptSupport::handleAssert.
308336

309337
Peter Young (young40)
310338
Implements setVisible() for CCEditBox
311339

312340
csy1988525
313341
Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted.
342+
fixed a bug when button's parent is hided, the button still can responce to clicked event.
314343

315344
Asad ur Rehman (AsadR)
316345
Adding CCNotificationCenter::removeAllObservers(CCObject *target).
@@ -327,6 +356,7 @@ Developers:
327356

328357
flamingo (flaming0)
329358
Null pointer check in order to prevent crashes.
359+
Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.
330360

331361
rtissera (Romain TISSERAND)
332362
Adding missing JNIEXPORT / JNICALL declarations.
@@ -369,6 +399,7 @@ Developers:
369399

370400
jotel (Jaroslaw Lewandowski)
371401
Fixing a bug that wrong type of argument signature is used in setAccelerometerIntervalJNI function.
402+
Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).
372403

373404
MarcelBloemendaal
374405
Adding secureTextEntry property to CCTextFieldTTF.
@@ -384,12 +415,44 @@ Developers:
384415
ptekchand (Pranav Tekchand)
385416
Supporting negative node scales for CCScrollView.
386417

387-
James Gregory (j4m3z0r, Zynga)
388-
Initial Emscripten port.
389-
390418
coolengineer (Hojin Choi)
391419
Refactoring callback selector for HttpResponse.
392420

421+
djh-
422+
Fixing a bug that displayed color of CCDrawNode is incorrect when VAO is disabled.
423+
424+
acai (beingstudio)
425+
Fix of null pointer access in CCBAnimationManager::getRunningSequenceName.
426+
427+
metalgit92
428+
Adding const qualification to some CCNode's getters
429+
430+
Clarinexus
431+
Fixing a bug that setColor and setOpacity of CCControlButton and CCScale9Sprite are broken.
432+
433+
Xander84
434+
Fixing a bug in CCBValue::getByteValue.
435+
436+
smshuja
437+
Fixing a bug that pointQueryFirst returns invalid Shape when a shape is not found in JSB.
438+
Fixing a bug that New PivotJoint can't access 4 parameters like in html5 version.
439+
440+
Carsten Sandtner (casarock)
441+
Adding XMLHttpRequest support for JSB.
442+
443+
Lee, Jae-Hong (pyrasis)
444+
Maintainer of tizen port.
445+
446+
lumendes
447+
Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.
448+
449+
sunxiaoyu
450+
Refactoring CCEditBox to add UITextField only when keyboard was opened, remove it when keyboard was closed.
451+
452+
edwardzhou (Edward Zhou)
453+
Correcting the type detecting order for Lua CCBProxy::getNodeTypeName.
454+
Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash.
455+
393456
Retired Core Developers:
394457
WenSheng Yang
395458
Author of windows port, CCTextField,

CHANGELOG

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,84 @@
1+
2.1rc0-x-2.1.4 @Jnue.12 2013
2+
[all platforms]
3+
Bug #2098: fix TouchPriority issue of CCScrollView
4+
Bug #2107: fix crash in HttpClient request on 64Bit
5+
Bug #2115: fix linking errors for TestCPP with libcurl
6+
Bug #2128: remove setting ignoreAnchorPoint for child CCB files and fix crash while trying to load sprite frame when the file is missing
7+
Bug #2140: fix a bug that the displayed color of CCDrawNode is incorrect when VAO is disabled
8+
Bug #2142: adding CCDataVisitor and implementing CCPrettyPrinter
9+
Bug #2143: fix a crash caused by ScrollView.setDelegate(tmp function)
10+
Bug #2146: unpack texture data correctly
11+
Bug #2147: fix null pointer access in CCBAnimationManager::getRunningSequenceName()
12+
Bug #2150: fix a bug that setColor and setOpacity of CCControlButton and CCScale9Sprite are broken
13+
Bug #2251: fix a logical error in CCDrawNode::drawPolygon()
14+
Bug #2271: fix memory leak as possible
15+
Feature #1859: make AssetsManager download resources in a new thread
16+
Feature #2086: make CCLabelTTF supports shadows and stroke
17+
Feature #2100: add CCDirector::popToSceneStackLevel(int level)
18+
Feature #2105: add Travis build support
19+
Feature #2108: add example for russian language in TestCpp
20+
Feature #2111: add CC_DISABLE_COPY macro
21+
Feature #2114: add __attribute__(__format__()) for CCLog and CCString
22+
Feature #2116: support negative node scales for CCScrollView
23+
Feature #2117: implement CCDictionary::writeToFile()
24+
Feature #2122: add method to create a CCMenuItemToggle from a CCArray with a target selector
25+
Feature #2132: add encrypted PVR.CCZ support to ZipUtils + Tests
26+
Feature #2157: add Mingw-crt Support without breaking VS SDK
27+
Feature #2265: add CCLabelTTF::createWithFontDefinition()
28+
Feature #2270: add Armature(CocoStudio runtime) support
29+
Refactor #2109: add const modifier for classes CCArray, CCObject
30+
Refactor #2118: move ccpX functions to CCPoint methods and operators
31+
Refactor #2119: use httpresponse_selector instead of callfuncND_selector for the callback function of CCHttpRequest
32+
Refactor #2123: refactor network extension, fixing unlikely memory leaks, adding PUT/DELETE methods
33+
Refactor #2127: add CCLOG before original path is returned in CCFileUtils::fullPathForFileName to aid in debugging
34+
Refactor #2149: add const qualification to some CCNode's getters
35+
Refactor #2189: CCLabelTTF::enableShadow() const update
36+
Refactor #2215: refactor CCConfiguration
37+
Refactor #2217: use CCLabelAtlas instead of CCLabelTTF to show FPS
38+
Refactor #2231: implement a format of CCConfiguration
39+
Refactor #2233: add support for "CCString" types for boolean and integers in CCConfiguration
40+
Refactor #2236: fix memory hot spot of CCTextureAtlas::updateQuad()
41+
[android]
42+
Bug #1284: fix a bug that SimpleAudioEngine may cause crash on i9100
43+
Bug #2151: fix custom font loading on Android for resource mapped font files
44+
Bug #2190: updat .classpath of Android project to latest ADT 22 build tool compatibility
45+
Bug #2266: fix a bug that CCFileUtils::getFileData() may not get file data correctly on Android
46+
Feature #2161: add ETC1 image format
47+
[iOS]
48+
Bug #2102: fix missing protocol method warning for iOS 6.0 addition
49+
Bug #2104: fix a bug that JPEG picture not displayed correctly on iOS 4.3
50+
Bug #2260: fix a bug that CCDirectory::createWithContentsOfFile() returns a valid pointer though the file is missing on iOS
51+
Refactor #2101: update cocos2dx Xcode project to detect more warnings
52+
Refactor #2253: add UITextField only when keyboard was opened, removing it when keyboard was closed
53+
[mac]
54+
Bug #2249: fix linebreaks on Mac OSX
55+
[win32]
56+
Bug #2131: fix memory leak of SimpleAudioEngine::preloadEffect()
57+
Bug #2145: center the window correctly on windows
58+
[emscripten]
59+
Feature #2120: compile c++ to js
60+
Bug #2159: use browser font rendering instead of FreeType
61+
Refactor #2133: compile for Emscripten in asm.js mode
62+
Document #2121: write a document to describe the usage of emscriptenate port
63+
[tizen]
64+
Feature #2185: add support for Tizen
65+
[javascript binding]
66+
Bug #2099: fix a bug in ScriptingCore::evalString() not setting the outval
67+
Bug #2179: fix a bug that pointQueryFirst returns invalid Shape when a shape is not found
68+
Bug #2186: fix a bug that new PivotJoint can't access 4 parameters like in html5 version
69+
Bug #2187: JavaScript debugger improved and bug fixed
70+
Bug #2243: fix a bug that XMLHttpRequest dones't support non-ascii characters
71+
Bug #2244: fix a bug that cc.Camera.getEyeXYZ, cc.Camera.getCenterXYZ, cc.Camera.getUpXYZ return bad values
72+
Feature #1647: Bind websocket to javascript
73+
Feature #2092: add XMLHttpRequest and bind it to JSB
74+
Feature #2106: add support for javascript byte code
75+
Feature #2162: add command line tool for generating javascript bytecode
76+
Feature #2214: upgrade Spidermonkey to Firefox v21
77+
Refactor #2152: log assert messages to the console and renaming CCScriptSupport::executeAssert to CCScriptSupport::handleAssert
78+
Refactor #2247: use functions instead of macros to speeding up building for JSB project
79+
[lua binding]
80+
Feature #2103: implement most test cases
81+
182
cocos2d-2.1rc0-x-2.1.3 @May.01 2013
283
[all platforms]
384
Bug #1853: use SHELLOPTS instead of "-o igncr" for Android Eclipse project

CocosDenshion/android/opensl/OpenSLEngine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ bool initAudioPlayer(AudioPlayer* player, const char* filename)
289289
if(fp){
290290
SLDataLocator_URI loc_fd = {SL_DATALOCATOR_URI , (SLchar*)filename};
291291
SLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED};
292-
(player->audioSrc) = {&loc_fd, &format_mime};
292+
player->audioSrc.pLocator = &loc_fd;
293+
player->audioSrc.pFormat = &format_mime;
293294
return createAudioPlayerBySource(player);
294295
}
295296
LOGD("file not found! Stop preload file: %s", filename);

CocosDenshion/android/opensl/SimpleAudioEngineOpenSL.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,25 @@ void SimpleAudioEngineOpenSL::setEffectsVolume(float volume)
8888

8989
unsigned int SimpleAudioEngineOpenSL::playEffect(const char* pszFilePath, bool bLoop)
9090
{
91-
unsigned int soundID;
92-
do
93-
{
94-
soundID = s_pOpenSL->preloadEffect(pszFilePath);
95-
if (soundID != FILE_NOT_FOUND)
96-
{
97-
if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)
98-
{
99-
// recreate an effect player
100-
s_pOpenSL->recreatePlayer(pszFilePath);
101-
break;
102-
}
103-
s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);
104-
s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);
105-
}
106-
} while (0);
107-
s_pOpenSL->setEffectLooping(soundID, bLoop);
108-
return soundID;
91+
unsigned int soundID = s_pOpenSL->preloadEffect(pszFilePath);
92+
93+
if (soundID != FILE_NOT_FOUND)
94+
{
95+
if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)
96+
{
97+
// recreate an effect player
98+
s_pOpenSL->recreatePlayer(pszFilePath);
99+
}
100+
else
101+
{
102+
s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);
103+
s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);
104+
}
105+
106+
s_pOpenSL->setEffectLooping(soundID, bLoop);
107+
}
108+
109+
return soundID;
109110
}
110111

111112
void SimpleAudioEngineOpenSL::pauseEffect(unsigned int nSoundId)

0 commit comments

Comments
 (0)