mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/2youyouo2/cocos2d-x; branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3
Conflicts: tests/lua-tests/src/CocoStudioTest/CocoStudioActionTimelineTest/CocoStudioActionTimelineTest.lua
This commit is contained in:
commit
5bcc1c29d9
|
@ -1,5 +1,7 @@
|
|||
cocos2d-x-3.3 ???
|
||||
cocos2d-x-3.3-rc2 Dec.5
|
||||
[FIX] C++: use 100% of one core on Windows
|
||||
[FIX] Label: when a label is added to a invisible parent node, app will crash if switching from background
|
||||
[FIX] Label: label will not be shown when using system font on Mac
|
||||
[FIX] Studio reader: replace protocol buffer with flatbuffer
|
||||
|
||||
cocos2d-x-3.3-rc1 Nov.29 2014
|
||||
|
|
|
@ -929,7 +929,7 @@ void Sprite::setSpriteFrame(const std::string &spriteFrameName)
|
|||
SpriteFrameCache *cache = SpriteFrameCache::getInstance();
|
||||
SpriteFrame *spriteFrame = cache->getSpriteFrameByName(spriteFrameName);
|
||||
|
||||
CCASSERT(spriteFrame, "Invalid spriteFrameName");
|
||||
CCASSERT(spriteFrame, std::string("Invalid spriteFrameName :").append(spriteFrameName).c_str());
|
||||
|
||||
setSpriteFrame(spriteFrame);
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ else()
|
|||
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
|
||||
endif()
|
||||
|
||||
foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL PROTOBUF_LITE)
|
||||
foreach(pkg ZLIB MINIZIP JPEG PNG TIFF TinyXML2 FREETYPE WEBSOCKETS CURL FLATBUFFERS)
|
||||
cocos_use_pkg(cocos2d ${pkg})
|
||||
endforeach()
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_CC_BEGIN
|
|||
|
||||
CC_DLL const char* cocos2dVersion()
|
||||
{
|
||||
return "cocos2d-x 3.3rc1";
|
||||
return "cocos2d-x 3.3rc2";
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -822,6 +822,12 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree)
|
|||
node = ActionTimelineNode::create(root, action);
|
||||
node->setName(root->getName());
|
||||
}
|
||||
cocostudio::timeline::ActionTimeline* action = cocostudio::timeline::ActionTimelineCache::getInstance()->createActionWithFlatBuffersFile(filePath);
|
||||
if(action)
|
||||
{
|
||||
node->runAction(action);
|
||||
action->gotoFrameAndPlay(0);
|
||||
}
|
||||
}
|
||||
else if (classname == "SimpleAudio")
|
||||
{
|
||||
|
|
|
@ -241,7 +241,10 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str
|
|||
builder.CreateVector(_texturePngs),
|
||||
nodeTree,
|
||||
aciton);
|
||||
builder.Finish(csparsebinary);
|
||||
builder.Finish(csparsebinary);
|
||||
|
||||
_textures.clear();
|
||||
_texturePngs.clear();
|
||||
|
||||
|
||||
std::string outFullPath = FileUtils::getInstance()->fullPathForFilename(flatbuffersFileName);
|
||||
|
|
|
@ -478,6 +478,7 @@ namespace cocostudio
|
|||
|
||||
bool displaystate = options->displaystate();
|
||||
checkBox->setBright(displaystate);
|
||||
checkBox->setEnabled(displaystate);
|
||||
|
||||
|
||||
auto widgetReader = WidgetReader::getInstance();
|
||||
|
|
|
@ -506,11 +506,8 @@ namespace cocostudio
|
|||
slider->loadProgressBarTexture(progressBarFileName, (Widget::TextureResType)progressBarType);
|
||||
|
||||
bool displaystate = options->displaystate();
|
||||
if(!displaystate)
|
||||
{
|
||||
slider->setBright(displaystate);
|
||||
slider->setEnabled(false);
|
||||
}
|
||||
slider->setBright(displaystate);
|
||||
slider->setEnabled(displaystate);
|
||||
|
||||
auto widgetReader = WidgetReader::getInstance();
|
||||
widgetReader->setPropsWithFlatBuffers(node, (Table*)options->widgetOptions());
|
||||
|
|
|
@ -275,6 +275,7 @@ namespace cocostudio
|
|||
auto options = (TextFieldOptions*)textFieldOptions;
|
||||
|
||||
textField->setUnifySizeEnabled(false);
|
||||
textField->ignoreContentAdaptWithSize(false);
|
||||
|
||||
std::string placeholder = options->placeHolder()->c_str();
|
||||
textField->setPlaceHolder(placeholder);
|
||||
|
|
|
@ -893,17 +893,6 @@ void Mat4::subtract(const Mat4& m1, const Mat4& m2, Mat4* dst)
|
|||
#endif
|
||||
}
|
||||
|
||||
void Mat4::transformPoint(Vec3* point) const
|
||||
{
|
||||
GP_ASSERT(point);
|
||||
transformVector(point->x, point->y, point->z, 1.0f, point);
|
||||
}
|
||||
|
||||
void Mat4::transformPoint(const Vec3& point, Vec3* dst) const
|
||||
{
|
||||
transformVector(point.x, point.y, point.z, 1.0f, dst);
|
||||
}
|
||||
|
||||
void Mat4::transformVector(Vec3* vector) const
|
||||
{
|
||||
GP_ASSERT(vector);
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef MATH_MAT4_H
|
||||
#define MATH_MAT4_H
|
||||
|
||||
#include "base/ccMacros.h"
|
||||
|
||||
#include "math/Vec3.h"
|
||||
#include "math/Vec4.h"
|
||||
|
||||
|
@ -761,7 +763,7 @@ public:
|
|||
*
|
||||
* @param point The point to transform and also a vector to hold the result in.
|
||||
*/
|
||||
void transformPoint(Vec3* point) const;
|
||||
inline void transformPoint(Vec3* point) const { GP_ASSERT(point); transformVector(point->x, point->y, point->z, 1.0f, point); }
|
||||
|
||||
/**
|
||||
* Transforms the specified point by this matrix, and stores
|
||||
|
@ -770,7 +772,7 @@ public:
|
|||
* @param point The point to transform.
|
||||
* @param dst A vector to store the transformed point in.
|
||||
*/
|
||||
void transformPoint(const Vec3& point, Vec3* dst) const;
|
||||
inline void transformPoint(const Vec3& point, Vec3* dst) const { GP_ASSERT(dst); transformVector(point.x, point.y, point.z, 1.0f, dst); }
|
||||
|
||||
/**
|
||||
* Transforms the specified vector by this matrix by
|
||||
|
|
|
@ -132,7 +132,7 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
|
|||
lastBreakLocation = i + insertCount;
|
||||
}
|
||||
textSize = [lineBreak sizeWithAttributes:tokenAttributesDict];
|
||||
if(textSize.height > info->height)
|
||||
if(info->height > 0 && textSize.height > info->height)
|
||||
break;
|
||||
if (textSize.width > info->width) {
|
||||
if(lastBreakLocation > 0) {
|
||||
|
|
|
@ -89,14 +89,14 @@ int Application::run()
|
|||
QueryPerformanceCounter(&nNow);
|
||||
if (nNow.QuadPart - nLast.QuadPart > _animationInterval.QuadPart)
|
||||
{
|
||||
nLast.QuadPart = nNow.QuadPart;
|
||||
nLast.QuadPart = nNow.QuadPart - (nNow.QuadPart % _animationInterval.QuadPart);
|
||||
|
||||
director->mainLoop();
|
||||
glview->pollEvents();
|
||||
}
|
||||
else
|
||||
{
|
||||
Sleep(0);
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,8 @@ GLProgram::GLProgram()
|
|||
, _fragShader(0)
|
||||
, _flags()
|
||||
{
|
||||
_director = Director::getInstance();
|
||||
CCASSERT(nullptr != _director, "Director is null when init a GLProgram");
|
||||
memset(_builtInUniforms, 0, sizeof(_builtInUniforms));
|
||||
}
|
||||
|
||||
|
@ -855,17 +857,12 @@ void GLProgram::setUniformLocationWithMatrix4fv(GLint location, const GLfloat* m
|
|||
|
||||
void GLProgram::setUniformsForBuiltins()
|
||||
{
|
||||
Director* director = Director::getInstance();
|
||||
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
|
||||
|
||||
auto matrixMV = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
|
||||
|
||||
setUniformsForBuiltins(matrixMV);
|
||||
setUniformsForBuiltins(_director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW));
|
||||
}
|
||||
|
||||
void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV)
|
||||
{
|
||||
auto matrixP = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
auto& matrixP = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
|
||||
if(_flags.usesP)
|
||||
setUniformLocationWithMatrix4fv(_builtInUniforms[UNIFORM_P_MATRIX], matrixP.m, 1);
|
||||
|
@ -892,11 +889,10 @@ void GLProgram::setUniformsForBuiltins(const Mat4 &matrixMV)
|
|||
}
|
||||
|
||||
if(_flags.usesTime) {
|
||||
Director *director = Director::getInstance();
|
||||
// This doesn't give the most accurate global time value.
|
||||
// Cocos2D doesn't store a high precision time value, so this will have to do.
|
||||
// Getting Mach time per frame per shader using time could be extremely expensive.
|
||||
float time = director->getTotalFrames() * director->getAnimationInterval();
|
||||
float time = _director->getTotalFrames() * _director->getAnimationInterval();
|
||||
|
||||
setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_TIME], time/10.0, time, time*2, time*4);
|
||||
setUniformLocationWith4f(_builtInUniforms[GLProgram::UNIFORM_SIN_TIME], time/8.0, time/4.0, time/2.0, sinf(time));
|
||||
|
|
|
@ -46,7 +46,7 @@ NS_CC_BEGIN
|
|||
*/
|
||||
|
||||
class GLProgram;
|
||||
|
||||
class Director;
|
||||
typedef void (*GLInfoFunction)(GLuint program, GLenum pname, GLint* params);
|
||||
typedef void (*GLLogFunction) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
|
||||
|
@ -359,6 +359,8 @@ protected:
|
|||
std::unordered_map<std::string, Uniform> _userUniforms;
|
||||
std::unordered_map<std::string, VertexAttrib> _vertexAttribs;
|
||||
std::unordered_map<GLint, GLvoid*> _hashForUniforms;
|
||||
//cached director pointer for calling
|
||||
Director* _director;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -17,7 +17,11 @@ To report bugs, please use the [Issue Tracker](https://github.com/cocos2d/cocos2
|
|||
|
||||
Steps to report a bug:
|
||||
* Open the [url](https://github.com/cocos2d/cocos2d-x/issues/new)
|
||||
* Add all the needed information to reproduce the bug
|
||||
* Add all the needed information to reproduce the bug, the information include
|
||||
* engine version
|
||||
* steps to reproduce the bug
|
||||
* some pseudocode
|
||||
* resources link if needed
|
||||
|
||||
|
||||
## Submitting patches
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version":"v3-deps-27",
|
||||
"version":"v3-deps-28",
|
||||
"zip_file_size":"87419231",
|
||||
"repo_name":"cocos2d-x-3rd-party-libs-bin",
|
||||
"repo_parent":"https://github.com/cocos2d/",
|
||||
|
|
|
@ -2433,53 +2433,6 @@
|
|||
"external/png/prebuilt/wp8/Win32/libpng.lib",
|
||||
"external/png/prebuilt/wp_8.1/arm/libpng.lib",
|
||||
"external/png/prebuilt/wp_8.1/win32/libpng.lib",
|
||||
"external/protobuf-lite/Android.mk",
|
||||
"external/protobuf-lite/CMakeLists.txt",
|
||||
"external/protobuf-lite/src/google/protobuf/config.h",
|
||||
"external/protobuf-lite/src/google/protobuf/extension_set.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/extension_set.h",
|
||||
"external/protobuf-lite/src/google/protobuf/generated_message_util.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/generated_message_util.h",
|
||||
"external/protobuf-lite/src/google/protobuf/io/coded_stream.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/io/coded_stream.h",
|
||||
"external/protobuf-lite/src/google/protobuf/io/coded_stream_inl.h",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream.h",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream_impl.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream_impl.h",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/io/zero_copy_stream_impl_lite.h",
|
||||
"external/protobuf-lite/src/google/protobuf/message_lite.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/message_lite.h",
|
||||
"external/protobuf-lite/src/google/protobuf/repeated_field.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/repeated_field.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_arm_gcc.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_arm_qnx.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_atomicword_compat.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_macosx.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_mips_gcc.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_pnacl.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_x86_gcc.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/atomicops_internals_x86_msvc.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/common.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/common.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/hash.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/map-util.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/once.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/once.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/platform_macros.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/stl_util.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/stringprintf.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/stringprintf.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/template_util.h",
|
||||
"external/protobuf-lite/src/google/protobuf/stubs/type_traits.h",
|
||||
"external/protobuf-lite/src/google/protobuf/wire_format_lite.cc",
|
||||
"external/protobuf-lite/src/google/protobuf/wire_format_lite.h",
|
||||
"external/protobuf-lite/src/google/protobuf/wire_format_lite_inl.h",
|
||||
"external/protobuf-lite/win32/config.h",
|
||||
"external/sqlite3/Android.mk",
|
||||
"external/sqlite3/include/sqlite3.h",
|
||||
"external/sqlite3/include/sqlite3ext.h",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"templateVersion":"1.5",
|
||||
"runtimeVersion":"1.5"
|
||||
"templateVersion":"1.6",
|
||||
"runtimeVersion":"1.6"
|
||||
}
|
|
@ -524,11 +524,11 @@ bool createDir(const char *sPathName)
|
|||
{
|
||||
DirName[i] = 0;
|
||||
#ifdef _WIN32
|
||||
if(_access(DirName, NULL) != 0)
|
||||
if(_access(DirName, 0) != 0)
|
||||
{
|
||||
if(_mkdir(DirName/*, 0755*/) == -1)
|
||||
#else
|
||||
if (access(DirName, NULL) != 0)
|
||||
if (access(DirName, 0) != 0)
|
||||
{
|
||||
if(mkdir(DirName, 0755) == -1)
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
//
|
||||
// main.m
|
||||
// HelloLua
|
||||
//
|
||||
// Copyright __MyCompanyName__ 2011. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version":"v3-lua-runtime-1.5.1",
|
||||
"zip_file_size":"30660780",
|
||||
"version":"v3-lua-runtime-1.6",
|
||||
"zip_file_size":"39063553",
|
||||
"repo_name":"cocos-runtime-bin",
|
||||
"repo_parent":"https://github.com/chukong/"
|
||||
}
|
||||
|
|
|
@ -1092,12 +1092,13 @@ void ClippingToRenderTextureTest::reproduceBug()
|
|||
img->drawPolygon(triangle, 3, red, 0, red);
|
||||
clipper->addChild(img);
|
||||
|
||||
// container rendered on Texture the size of the screen
|
||||
RenderTexture* rt = RenderTexture::create(visibleSize.width, visibleSize.height);
|
||||
// container rendered on Texture the size of the screen and because Clipping node use stencil buffer so we need to
|
||||
// create RenderTexture with depthStencil format parameter
|
||||
RenderTexture* rt = RenderTexture::create(visibleSize.width, visibleSize.height, Texture2D::PixelFormat::RGBA8888, GL_DEPTH24_STENCIL8);
|
||||
rt->setPosition(visibleSize.width/2, visibleSize.height/2);
|
||||
this->addChild(rt);
|
||||
|
||||
rt->beginWithClear(0.3f, 0, 0, 1);
|
||||
rt->begin();
|
||||
container->visit();
|
||||
rt->end();
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 62aa5ed9cb84f5d2784ae3332a29fc5a900cfb3f
|
||||
Subproject commit 3b956b46cc683f81d69811b3016810c1a93ad5f1
|
|
@ -77,9 +77,16 @@ def main():
|
|||
|
||||
if platform == 'win32':
|
||||
x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s' % cur_platform))
|
||||
if not os.path.exists(x86_llvm_path):
|
||||
x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s' % cur_platform))
|
||||
else:
|
||||
x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s-%s' % (cur_platform, 'x86')))
|
||||
if not os.path.exists(x86_llvm_path):
|
||||
x86_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86')))
|
||||
|
||||
x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.3/prebuilt', '%s-%s' % (cur_platform, 'x86_64')))
|
||||
if not os.path.exists(x64_llvm_path):
|
||||
x64_llvm_path = os.path.abspath(os.path.join(ndk_root, 'toolchains/llvm-3.4/prebuilt', '%s-%s' % (cur_platform, 'x86_64')))
|
||||
|
||||
if os.path.isdir(x86_llvm_path):
|
||||
llvm_path = x86_llvm_path
|
||||
|
|
Loading…
Reference in New Issue