Skip to content

Commit 7c202f3

Browse files
committed
Merge pull request cocos2d#6 from cocos2d/develop
sync original repo
2 parents 70d141e + baebdb9 commit 7c202f3

File tree

426 files changed

+3062
-6720
lines changed

Some content is hidden

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

426 files changed

+3062
-6720
lines changed

AUTHORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ Developers:
668668

669669
zhiqiangxu
670670
Fixed a logic error in ControlUtils::RectUnion.
671+
Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan.
671672

672673
yinkaile (2youyouo2)
673674
Maintainer of Armature Bone Animation.
@@ -688,6 +689,9 @@ Developers:
688689
SBKarr
689690
AngelCode binary file format support for LabelBMFont.
690691

692+
zarelaky
693+
OpenAL context isn't destroyed correctly on mac and ios.
694+
691695
Retired Core Developers:
692696
WenSheng Yang
693697
Author of windows port, CCTextField,

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ cocos2d-x-3.0beta0 ?? 2013
1919
[FIX] Sprites with PhysicsBody move to a wrong position when game resume from background.
2020
[FIX] Crash if connection breaks during download using AssetManager.
2121
[NEW] AngelCode binary file format support for LabelBMFont.
22+
[FIX] OpenAL context isn't destroyed correctly on mac and ios.
23+
[FIX] Useless conversion in ScrollView::onTouchBegan.
2224
[Android]
2325
[NEW] build/android-build.sh: add supporting to generate .apk file
2426
[FIX] XMLHttpRequest receives wrong binary array.

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,19 @@ add_subdirectory(cocos/scripting)
284284
endif(BUILD_LIBS_LUA)
285285

286286
# build samples
287-
add_subdirectory(samples)
287+
if(BUILD_HelloCpp)
288+
add_subdirectory(samples/Cpp/HelloCpp)
289+
endif(BUILD_HelloCpp)
290+
291+
if(BUILD_TestCpp)
292+
add_subdirectory(samples/Cpp/TestCpp)
293+
endif(BUILD_TestCpp)
294+
295+
if(BUILD_HelloLua)
296+
add_subdirectory(samples/Lua/HelloLua)
297+
endif(BUILD_HelloLua)
298+
299+
if(BUILD_TestLua)
300+
add_subdirectory(samples/Lua/TestLua)
301+
endif(BUILD_TestLua)
302+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ How to start a new game
3030
Example:
3131

3232
$ cd cocos2d-x/tools/project-creator
33-
$ ./create-multi-platform-projects.py -p mygame -k com.your_company.mygame -l cpp
34-
$ cd ../../projects/mygame
33+
$ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
34+
$ cd /home/mygame
3535

3636

3737
Main features
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
812ab716d10a52b752f0d15b2393b2b0a7c8e969
1+
4b92c964454c54c1b5df9576f11365c53e253724

cocos/2d/CCDeprecated.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ CC_DEPRECATED_ATTRIBUTE typedef IMEDelegate CCIMEDelegate;
545545
CC_DEPRECATED_ATTRIBUTE typedef IMEKeyboardNotificationInfo CCIMEKeyboardNotificationInfo;
546546
CC_DEPRECATED_ATTRIBUTE typedef TextFieldDelegate CCTextFieldDelegate;
547547
CC_DEPRECATED_ATTRIBUTE typedef TextFieldTTF CCTextFieldTTF;
548-
CC_DEPRECATED_ATTRIBUTE typedef NotificationCenter CCNotificationCenter;
548+
CC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter CCNotificationCenter;
549+
CC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter NotificationCenter;
549550
//CC_DEPRECATED_ATTRIBUTE typedef TargetedTouchDelegate CCTargetedTouchDelegate;
550551
//CC_DEPRECATED_ATTRIBUTE typedef StandardTouchDelegate CCStandardTouchDelegate;
551552
//CC_DEPRECATED_ATTRIBUTE typedef TouchDelegate CCTouchDelegate;

cocos/2d/CCDirector.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ THE SOFTWARE.
3737
#include "CCArray.h"
3838
#include "CCScheduler.h"
3939
#include "ccMacros.h"
40-
#include "CCNotificationCenter.h"
4140
#include "CCTransition.h"
4241
#include "CCTextureCache.h"
4342
#include "CCSpriteFrameCache.h"
@@ -768,7 +767,6 @@ void Director::purgeDirector()
768767

769768
// cocos2d-x specific data structures
770769
UserDefault::destroyInstance();
771-
NotificationCenter::destroyInstance();
772770

773771
GL::invalidateStateCache();
774772

cocos/2d/CCDrawNode.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
#include "CCDrawNode.h"
2424
#include "CCShaderCache.h"
2525
#include "CCGL.h"
26-
#include "CCNotificationCenter.h"
2726
#include "CCEventType.h"
2827
#include "CCConfiguration.h"
2928
#include "CCCustomCommand.h"
3029
#include "CCDirector.h"
3130
#include "CCRenderer.h"
31+
#include "CCEventListenerCustom.h"
32+
#include "CCEventDispatcher.h"
3233

3334
NS_CC_BEGIN
3435

@@ -124,10 +125,6 @@ DrawNode::~DrawNode()
124125
GL::bindVAO(0);
125126
_vao = 0;
126127
}
127-
128-
#if CC_ENABLE_CACHE_TEXTURE_DATA
129-
NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND);
130-
#endif
131128
}
132129

133130
DrawNode* DrawNode::create()
@@ -196,10 +193,12 @@ bool DrawNode::init()
196193

197194
#if CC_ENABLE_CACHE_TEXTURE_DATA
198195
// Need to listen the event only when not use batchnode, because it will use VBO
199-
NotificationCenter::getInstance()->addObserver(this,
200-
callfuncO_selector(DrawNode::listenBackToForeground),
201-
EVNET_COME_TO_FOREGROUND,
202-
nullptr);
196+
auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){
197+
/** listen the event that coming to foreground on Android */
198+
this->init();
199+
});
200+
201+
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
203202
#endif
204203

205204
return true;
@@ -472,11 +471,4 @@ void DrawNode::setBlendFunc(const BlendFunc &blendFunc)
472471
_blendFunc = blendFunc;
473472
}
474473

475-
/** listen the event that coming to foreground on Android
476-
*/
477-
void DrawNode::listenBackToForeground(Object *obj)
478-
{
479-
init();
480-
}
481-
482474
NS_CC_END

cocos/2d/CCDrawNode.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ class CC_DLL DrawNode : public Node
7878
* @lua NA
7979
*/
8080
void setBlendFunc(const BlendFunc &blendFunc);
81-
82-
/** listen the event that coming to foreground on Android
83-
* @js NA
84-
* @lua NA
85-
*/
86-
void listenBackToForeground(Object *obj);
8781

8882
void onDraw();
8983

cocos/2d/CCEventType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// The application will come to foreground.
1010
// This message is used for reloading resources before come to foreground on Android.
1111
// This message is posted in main.cpp.
12-
#define EVNET_COME_TO_FOREGROUND "event_come_to_foreground"
12+
#define EVENT_COME_TO_FOREGROUND "event_come_to_foreground"
1313

1414
// The application will come to background.
1515
// This message is used for doing something before coming to background, such as save RenderTexture.

0 commit comments

Comments
 (0)