Skip to content

Commit 1879068

Browse files
committed
Merge commit '881e5d12c70a54410f9e23acfe4b48d36ddbd60b' into scgamex-v3
* commit '881e5d12c70a54410f9e23acfe4b48d36ddbd60b': add one more android return buttons (cocos2d#18636) fix build status (cocos2d#18630) Reverts Node::cleanup changes in PR cocos2d#17836 which is merged in v3.16. (cocos2d#18565) [ci skip]make codes more readable (cocos2d#18627) Update README.md [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18625) Setup android builds: cpp_test, cpp_empty, cocos_new for appveyor (cocos2d#18624) [ci skip]Update console (cocos2d#18621) don't copy not exist files when creating a new project (cocos2d#18618) add folder ref for Xcode, unify code style (cocos2d#18617) Add test wrap unicode text (cocos2d#18570) fix JSB Memory leaks and crashes (cocos2d#18577) fix spine crash (cocos2d#18582) 18572 PR amends & override warning fix (cocos2d#18580) Simlpify appveyor script, remove unused functions (cocos2d#18568) Android Emulator Blank Screen 0x501 and 0x502 Problem Bugfix Update (cocos2d#18606) # Conflicts: # cocos/ui/UIEditBox/UIEditBoxImpl-common.h # tools/cocos2d-console
2 parents 125494e + 881e5d1 commit 1879068

Some content is hidden

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

42 files changed

+818
-711
lines changed

.appveyor.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ environment:
77
PYTHON: "C:\\Python27"
88
PYTHON_VERSION: "2.7.13"
99
PYTHON_ARCH: "32"
10+
matrix:
11+
- build_type: android_cpp_empty_test
12+
- build_type: android_cpp_tests
13+
- build_type: android_cocos_new_test
14+
# - build_type: android_gen_libs
15+
- build_type: windows32
1016

1117
platform:
1218
- x86
1319

1420
configuration:
1521
- Release
1622

17-
before_build:
23+
before_build:
1824
- ps: ./tools/appveyor-scripts/before-build.ps1
1925

2026
build_script:
@@ -27,4 +33,6 @@ branches:
2733
- v4-develop
2834
- v3-doc
2935
- v3.11_backup
30-
- v35-for-tizen
36+
- v35-for-tizen
37+
38+
clone_depth: 50

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
cocos2d-x
55
=========
66

7-
| |iOS|Mac|Linux|Win32|Android|
8-
| ----|----|----- | ---|----|------|
9-
|v3|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=ios)](http://45.56.80.45:8080/job/daily-build-v3/node=ios)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=mac)](http://45.56.80.45:8080/job/daily-build-v3/node=mac)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=linux)](http://45.56.80.45:8080/job/daily-build-v3/node=linux)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=win32_bak)](http://45.56.80.45:8080/job/daily-build-v3/node=win32_bak)|[![Build Status](http://45.56.80.45:8080/buildStatus/icon?job=daily-build-v3/node=android)](http://45.56.80.45:8080/job/daily-build-v3/node=android)
7+
|Win32|Others|
8+
| ----|------|
9+
[![Build status](https://ci.appveyor.com/api/projects/status/nlgirox464j6ldg5/branch/v3?svg=true)](https://ci.appveyor.com/project/minggo/cocos2d-x/branch/v3)|[![Build Status](https://travis-ci.org/cocos2d/cocos2d-x.svg?branch=v3)](https://travis-ci.org/cocos2d/cocos2d-x)
1010

1111

1212
[cocos2d-x][1] is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications.
@@ -153,11 +153,11 @@ Main features
153153
Build Requirements
154154
------------------
155155

156-
* Mac OS X 10.7+, Xcode 7+
156+
* Mac OS X 10.7+, Xcode 8+
157157
* or Ubuntu 12.10+, CMake 2.6+
158-
* or Windows 7+, VS 2013+
158+
* or Windows 7+, VS 2015
159159
* Python 2.7.5
160-
* NDK r11+ is required to build Android games(tested with r14)
160+
* NDK r16+ is required to build Android games
161161
* Android Studio 2.3.3+ to build Android games(tested with 2.3.3)
162162
* JRE or JDK 1.6+ is required for web publishing
163163

build/cocos2d_tests.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@
695695
3EA0FB5E191B92F100B170C8 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
696696
3EA0FB66191B933000B170C8 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
697697
3EA0FB72191C844400B170C8 /* UIVideoPlayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */; };
698+
400308D820060F12000DFE6D /* strings in Resources */ = {isa = PBXBuildFile; fileRef = 400308D720060F12000DFE6D /* strings */; };
698699
460629781CDB4DBA00B44058 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 460629771CDB4DBA00B44058 /* ccs-res */; };
699700
460629791CDB4DBA00B44058 /* ccs-res in Resources */ = {isa = PBXBuildFile; fileRef = 460629771CDB4DBA00B44058 /* ccs-res */; };
700701
463D7E7C1D227C5F00EA6BD1 /* Bug-14327.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463D7E781D227C3800EA6BD1 /* Bug-14327.cpp */; };
@@ -2223,6 +2224,7 @@
22232224
3EA0FB65191B933000B170C8 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; };
22242225
3EA0FB70191C844400B170C8 /* UIVideoPlayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIVideoPlayerTest.cpp; sourceTree = "<group>"; };
22252226
3EA0FB71191C844400B170C8 /* UIVideoPlayerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayerTest.h; sourceTree = "<group>"; };
2227+
400308D720060F12000DFE6D /* strings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = strings; path = "../tests/cpp-tests/Resources/strings"; sourceTree = "<group>"; };
22262228
460629771CDB4DBA00B44058 /* ccs-res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "ccs-res"; path = "../tests/cpp-tests/Resources/ccs-res"; sourceTree = "<group>"; };
22272229
463D7E781D227C3800EA6BD1 /* Bug-14327.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "Bug-14327.cpp"; sourceTree = "<group>"; };
22282230
463D7E791D227C3800EA6BD1 /* Bug-14327.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bug-14327.h"; sourceTree = "<group>"; };
@@ -3938,6 +3940,7 @@
39383940
1AC35CA818CED83500F37B72 /* Resources */ = {
39393941
isa = PBXGroup;
39403942
children = (
3943+
400308D720060F12000DFE6D /* strings */,
39413944
38FA2E75194AECF800FF2BE4 /* ActionTimeline */,
39423945
1AC35CA918CED84500F37B72 /* animations */,
39433946
3E2BDAD119BEA3E20055CDCD /* audio */,
@@ -5694,6 +5697,7 @@
56945697
1AC35CD218CED84500F37B72 /* background.ogg in Resources */,
56955698
1AC35D0018CED84500F37B72 /* pew-pew-lei.wav in Resources */,
56965699
1AC35CD018CED84500F37B72 /* background.mp3 in Resources */,
5700+
400308D820060F12000DFE6D /* strings in Resources */,
56975701
1AC35CD618CED84500F37B72 /* CocosBuilderExample.ccbproj in Resources */,
56985702
3E92EA851921A7720094CD21 /* Sprite3DTest in Resources */,
56995703
1AC35CA318CECF1E00F37B72 /* InfoPlist.strings in Resources */,

cocos/2d/CCNode.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,15 @@ void Node::cleanup()
218218
// timers
219219
this->unscheduleAllCallbacks();
220220

221-
_eventDispatcher->removeEventListenersForTarget(this);
221+
// NOTE: Although it was correct that removing event listeners associated with current node in Node::cleanup.
222+
// But it broke the compatibility to the versions before v3.16 .
223+
// User code may call `node->removeFromParent(true)` which will trigger node's cleanup method, when the node
224+
// is added to scene again, event listeners like EventListenerTouchOneByOne will be lost.
225+
// In fact, user's code should use `node->removeFromParent(false)` in order not to do a cleanup and just remove node
226+
// from its parent. For more discussion about why we revert this change is at https://github.com/cocos2d/cocos2d-x/issues/18104.
227+
// We need to consider more before we want to correct the old and wrong logic code.
228+
// For now, compatiblity is the most important for our users.
229+
// _eventDispatcher->removeEventListenersForTarget(this);
222230

223231
for( const auto &child: _children)
224232
child->cleanup();

cocos/editor-support/spine/SkeletonJson.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,22 +408,22 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
408408
if (!vertices) {
409409
if (weighted) {
410410
deform2 = tempDeform;
411-
memset(deform, 0, sizeof(float) * deformLength);
411+
memset(deform2, 0, sizeof(float) * deformLength);
412412
} else
413413
deform2 = attachment->vertices;
414414
} else {
415415
int v, start = Json_getInt(valueMap, "offset", 0);
416416
Json* vertex;
417417
deform2 = tempDeform;
418-
memset(deform, 0, sizeof(float) * start);
418+
memset(deform2, 0, sizeof(float) * start);
419419
if (self->scale == 1) {
420420
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
421421
deform2[v] = vertex->valueFloat;
422422
} else {
423423
for (vertex = vertices->child, v = start; vertex; vertex = vertex->next, ++v)
424424
deform2[v] = vertex->valueFloat * self->scale;
425425
}
426-
memset(deform + v, 0, sizeof(float) * (deformLength - v));
426+
memset(deform2 + v, 0, sizeof(float) * (deformLength - v));
427427
if (!weighted) {
428428
float* verticesAttachment = attachment->vertices;
429429
for (v = 0; v < deformLength; ++v)

cocos/editor-support/spine/SkeletonRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
253253
trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount;
254254
trianglesTwoColor.verts = twoColorBatch->allocateVertices(attachmentVertices->_triangles->vertCount);
255255
trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount;
256-
for (int ii = 0; i < trianglesTwoColor.vertCount; ii++) {
256+
for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) {
257257
trianglesTwoColor.verts[ii].texCoords = attachmentVertices->_triangles->verts[ii].texCoords;
258258
}
259259
spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4, (float*)trianglesTwoColor.verts, 0, 7);

cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
204204
editBox.endAction = Cocos2dxEditBox.kEndActionNext;
205205
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
206206
return true;
207-
} else if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_SEARCH) {
207+
} else if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO) {
208208
editBox.endAction = Cocos2dxEditBox.kEndActionReturn;
209209
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
210210
}

cocos/renderer/CCGLProgram.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ GLProgram::~GLProgram()
235235
GL::deleteProgram(_program);
236236
}
237237

238-
238+
239239
clearHashUniforms();
240240
}
241241

@@ -489,6 +489,9 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source
489489
if (compileTimeHeaders.empty()) {
490490
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
491491
headersDef = (type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n");
492+
// Bugfix to make shader variables types constant to be understood by the current Android Virtual Devices or Emulators. This will also eliminate the 0x501 and 0x502 OpenGL Errors during emulation.
493+
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
494+
headersDef = "#version 100\n precision mediump float;\n precision mediump int;\n";
492495
#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
493496
// STEVE: changed mediump to highp
494497
headersDef = (type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision highp float;\n precision highp int;\n");
@@ -930,7 +933,7 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV)
930933

931934
if (_flags.usesP)
932935
setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_P_MATRIX], matrixP.m, 1);
933-
936+
934937
if (_flags.usesMultiViewP)
935938
{
936939
Mat4 mats[4];
@@ -949,7 +952,7 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV)
949952
Mat4 matrixMVP = matrixP * matrixMV;
950953
setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_MVP_MATRIX], matrixMVP.m, 1);
951954
}
952-
955+
953956
if (_flags.usesMultiViewMVP)
954957
{
955958
Mat4 mats[4];
@@ -1027,4 +1030,3 @@ inline void GLProgram::clearHashUniforms()
10271030
}
10281031

10291032
NS_CC_END
1030-

cocos/renderer/CCRenderer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ void Renderer::mapBuffers()
347347

348348
void Renderer::addCommand(RenderCommand* command)
349349
{
350-
int renderQueue =_commandGroupStack.top();
351-
addCommand(command, renderQueue);
350+
int renderQueueID =_commandGroupStack.top();
351+
addCommand(command, renderQueueID);
352352
}
353353

354-
void Renderer::addCommand(RenderCommand* command, int renderQueue)
354+
void Renderer::addCommand(RenderCommand* command, int renderQueueID)
355355
{
356356
CCASSERT(!_isRendering, "Cannot add command while rendering");
357-
CCASSERT(renderQueue >=0, "Invalid render queue");
357+
CCASSERT(renderQueueID >=0, "Invalid render queue");
358358
CCASSERT(command->getType() != RenderCommand::Type::UNKNOWN_COMMAND, "Invalid Command Type");
359359

360-
_renderGroups[renderQueue].push_back(command);
360+
_renderGroups[renderQueueID].push_back(command);
361361
}
362362

363363
void Renderer::pushGroup(int renderQueueID)

cocos/renderer/CCRenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class CC_DLL Renderer
160160
void addCommand(RenderCommand* command);
161161

162162
/** Adds a `RenderComamnd` into the renderer specifying a particular render queue ID */
163-
void addCommand(RenderCommand* command, int renderQueue);
163+
void addCommand(RenderCommand* command, int renderQueueID);
164164

165165
/** Pushes a group into the render queue */
166166
void pushGroup(int renderQueueID);

0 commit comments

Comments
 (0)