diff --git a/AUTHORS b/AUTHORS index 6ff1e5efd7..c6a0ecb2a6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -909,6 +909,7 @@ Developers: gin0606 Add a new line at the end of a file Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android + Fix video scale issue in iOS billtt Fixed a bug that Node::setScale(float) may not work properly @@ -935,6 +936,12 @@ Developers: yongkangchen Fixed a bug that font size of EditBox is not scaled when glview is scaled on Mac OS X Fixed a bug that Label::setTextColor does not have any effect on Mac OS X + + wagulu + Fixed a bug that particle effect is wrong when scaled + + reckhou + Optimize FPS control on Android Retired Core Developers: WenSheng Yang diff --git a/CHANGELOG b/CHANGELOG index 28a4cb64e3..8b48f633e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,12 +7,16 @@ cocos2d-x-3.3 ?? [FIX] EditBox: font size is not scaled when glview is scaled on Mac OS X [FIX] Label: can not set charmap after it is created [FIX] Label: setTextColor does not have any effect on Mac OS X + [FIX] ParticleSystem: effect is wrong if scene scaled [FIX] Scale9Sprite: new added sprite will be hidden [FIX] UIListView: can not insert an item in specific position, it is added at bottom [FIX] TabelView: can handle touch event though its parents are invisible [FIX] TextField: can not use backspace to delete a character + [FIX] UIVideoPlayer: video frame size is not calculated correctly on iOS + [FIX] UIWidget: may crash if remove itself in touch call back function [FIX] Others: can not import java library shift by engine correctly when using Eclispe on Android + [FIX] Others: optimize FPS contorl algorithm on Android [FIX] Lua-binding: replace dynamic_cast to std::is_base_of in object_to_luaval diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme index 25dbc11dbb..f57131f56a 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme index 170dc164b6..fcbd659bae 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/build all libs iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme similarity index 72% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme index f0be0b3387..a660f083f3 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme similarity index 72% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme index 5e6d46462b..e99ccec6a6 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/box2d iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libbox2d iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme similarity index 71% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme index cae588170f..ee1a4e52a6 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme similarity index 71% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme index e433af4505..fe458520e3 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/chipmunk iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libchipmunk iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme similarity index 70% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme index 1edbfaa4c2..644f4fba3f 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d Mac.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme similarity index 70% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme index 82675f8fea..3f87120c62 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocos2d iOS.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme new file mode 100644 index 0000000000..5afa747562 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme new file mode 100644 index 0000000000..e25be6f519 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosbuilder iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme similarity index 69% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme index dbf36bb025..29d3c9fed6 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion Mac.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme similarity index 69% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme index c74eed7e60..23cfbd87e0 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/CocosDenshion iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocosdenshion iOS.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme new file mode 100644 index 0000000000..5685108bbc --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme new file mode 100644 index 0000000000..694e940085 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libcocostudio iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme similarity index 70% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme index 6f6c9a919d..547a4846c5 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions Mac.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension Mac.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme similarity index 70% rename from build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme rename to build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme index 9d554e8913..7468928ac2 100644 --- a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/cocos2dx-extensions iOS.xcscheme +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libextension iOS.xcscheme @@ -1,6 +1,6 @@ @@ -39,6 +39,15 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme new file mode 100644 index 0000000000..f2e0e4d87d --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme new file mode 100644 index 0000000000..77b899549f --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libnetwork iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme new file mode 100644 index 0000000000..7d9db72df8 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme new file mode 100644 index 0000000000..bc42031fd3 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libspine iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme new file mode 100644 index 0000000000..fd629758eb --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme new file mode 100644 index 0000000000..b419d0a349 --- /dev/null +++ b/build/cocos2d_libs.xcodeproj/xcshareddata/xcschemes/libui iOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme index 2937783395..784723fab8 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme index ecc2fd2528..ccac8c68e7 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/build all tests iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme index 17cd1fc940..2695cf3b5b 100644 --- a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/cpp-empty-test Mac.xcscheme @@ -1,6 +1,6 @@ checkVisibility(transform, _contentSize) : _insideBounds; + bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY; + _insideBounds = transformUpdated ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) { _customCommand.init(_globalZOrder); - _customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, flags); + _customCommand.func = CC_CALLBACK_0(Label::onDraw, this, transform, transformUpdated); renderer->addCommand(&_customCommand); } } diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 25c1066098..1dc57a04f2 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -771,7 +771,12 @@ void ParticleSystem::update(float dt) Vec2 newPos; - if (_positionType == PositionType::FREE || _positionType == PositionType::RELATIVE) + if (_positionType == PositionType::FREE) + { + Vec2 diff = convertToNodeSpace(currentPosition) - convertToNodeSpace(p-> startPos); + newPos = p->pos - diff; + } + else if(_positionType == PositionType::RELATIVE) { Vec2 diff = currentPosition - p->startPos; newPos = p->pos - diff; diff --git a/cocos/base/ccUtils.h b/cocos/base/ccUtils.h index 39204ae6e5..faf95cf4a0 100644 --- a/cocos/base/ccUtils.h +++ b/cocos/base/ccUtils.h @@ -74,8 +74,8 @@ namespace utils */ std::vector CC_DLL findChildren(const Node &node, const std::string &name); - /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof。 - * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain several numbers can approximate to 1 ( like 90.099998474121094 ), it will return inf. this function is used to fix this bug. + /** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof. + * Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain several numbers can approximate to 1 ( like 90.099998474121094 ), it will return inf. this function is used to fix this bug. */ double CC_DLL atof(const char* str); } diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index 84930e6ae8..598b086bbd 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -888,39 +888,19 @@ std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& dir std::string FileUtils::searchFullPathForFilename(const std::string& filename) const { - // If filename is absolute path, we don't need to consider 'search paths' and 'resolution orders'. if (isAbsolutePath(filename)) { return filename; } - - // Already Cached ? - auto cacheIter = _fullPathCache.find(filename); - if( cacheIter != _fullPathCache.end() ) + std::string path = const_cast(this)->fullPathForFilename(filename); + if (0 == path.compare(filename)) { - return cacheIter->second; + return ""; } - - // Get the new file name. - const std::string newFilename( getNewFilename(filename) ); - - std::string fullpath; - - for (auto searchIt = _searchPathArray.cbegin(); searchIt != _searchPathArray.cend(); ++searchIt) + else { - for (auto resolutionIt = _searchResolutionsOrderArray.cbegin(); resolutionIt != _searchResolutionsOrderArray.cend(); ++resolutionIt) - { - fullpath = const_cast(this)->getPathForFilename(newFilename, *resolutionIt, *searchIt); - - if (!fullpath.empty()) - { - // Using the filename passed in as key. - const_cast(this)->_fullPathCache.insert(std::make_pair(filename, fullpath)); - return fullpath; - } - } + return path; } - return ""; } bool FileUtils::isFileExist(const std::string& filename) const diff --git a/cocos/platform/CCFileUtils.h b/cocos/platform/CCFileUtils.h index 5fe985694d..9594b52d11 100644 --- a/cocos/platform/CCFileUtils.h +++ b/cocos/platform/CCFileUtils.h @@ -407,12 +407,16 @@ protected: virtual std::string getNewFilename(const std::string &filename) const; /** - * Checks whether file exists without considering search paths and resolution orders. + * Checks whether a file exists without considering search paths and resolution orders. + * @param The file (with absolute path) to look up for + * @return Returns true if the file found at the given absolute path, otherwise returns false */ virtual bool isFileExistInternal(const std::string& filename) const = 0; /** - * Checks whether file exists without considering search paths and resolution orders. + * Checks whether a directory exists without considering search paths and resolution orders. + * @param The directory (with absolute path) to look up for + * @return Returns true if the directory found at the given absolute path, otherwise returns false */ virtual bool isDirectoryExistInternal(const std::string& dirPath) const; @@ -438,7 +442,14 @@ protected: */ virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename); - + /** + * Returns the fullpath for a given filename. + * This is an alternative for fullPathForFilename, there are two main differences: + * First, it returns empty string instead of the original filename when no file found for the given name. + * Secondly, it's a const function. + * @param filename The file name to look up for + * @return The full path for the file, if not found, the return value will be an empty string + */ virtual std::string searchFullPathForFilename(const std::string& filename) const; diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 07335110cd..08cd3e5f10 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -97,6 +97,8 @@ namespace { static const int PVR_TEXTURE_FLAG_TYPE_MASK = 0xff; + static bool _PVRHaveAlphaPremultiplied = false; + // Values taken from PVRTexture.h from http://www.imgtec.com enum class PVR2TextureFlag { @@ -455,7 +457,6 @@ Image::Image() , _unpack(false) , _fileType(Format::UNKOWN) , _renderFormat(Texture2D::PixelFormat::NONE) -, _preMulti(false) , _numberOfMipmaps(0) , _hasPremultipliedAlpha(true) { @@ -875,7 +876,7 @@ bool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen) /* init image info */ _width = cinfo.output_width; _height = cinfo.output_height; - _preMulti = false; + _hasPremultipliedAlpha = false; row_pointer[0] = static_cast(malloc(cinfo.output_width*cinfo.output_components * sizeof(unsigned char))); CC_BREAK_IF(! row_pointer[0]); @@ -1043,7 +1044,7 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) } else { - _preMulti = false; + _hasPremultipliedAlpha = false; } if (row_pointers != nullptr) @@ -1216,7 +1217,7 @@ bool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen) { /* the raster data is pre-multiplied by the alpha component after invoking TIFFReadRGBAImageOriented*/ - _preMulti = true; + _hasPremultipliedAlpha = true; memcpy(_data, raster, npixels*sizeof (uint32)); } @@ -1288,7 +1289,9 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen) Configuration *configuration = Configuration::getInstance(); - _hasPremultipliedAlpha = false; + //can not detect the premultiplied alpha from pvr file, use _PVRHaveAlphaPremultiplied instead. + _hasPremultipliedAlpha = _PVRHaveAlphaPremultiplied; + unsigned int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags); PVR2TexturePixelFormat formatFlags = static_cast(flags & PVR_TEXTURE_FLAG_TYPE_MASK); bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false; @@ -1478,7 +1481,7 @@ bool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen) // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files if (flags & (unsigned int)PVR3TextureFlag::PremultipliedAlpha) { - _preMulti = true; + _hasPremultipliedAlpha = true; } // sizing @@ -1706,7 +1709,7 @@ bool Image::initWithTGAData(tImageTGA* tgaData) _dataLen = _width * _height * tgaData->pixelDepth / 8; _fileType = Format::TGA; - _preMulti = false; + _hasPremultipliedAlpha = false; ret = true; @@ -2056,7 +2059,7 @@ bool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int wid _height = height; _width = width; - _preMulti = preMulti; + _hasPremultipliedAlpha = preMulti; _renderFormat = Texture2D::PixelFormat::RGBA8888; // only RGBA8888 supported @@ -2351,7 +2354,13 @@ void Image::premultipliedAlpha() fourBytes[i] = CC_RGB_PREMULTIPLY_ALPHA(p[0], p[1], p[2], p[3]); } - _preMulti = true; + _hasPremultipliedAlpha = true; +} + + +void Image::setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) +{ + _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; } NS_CC_END diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index 9cb49f63d1..483ea686ff 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -122,10 +122,10 @@ public: inline Texture2D::PixelFormat getRenderFormat() { return _renderFormat; } inline int getWidth() { return _width; } inline int getHeight() { return _height; } - inline bool isPremultipliedAlpha() { return _preMulti; } inline int getNumberOfMipmaps() { return _numberOfMipmaps; } inline MipmapInfo* getMipmaps() { return _mipmaps; } inline bool hasPremultipliedAlpha() { return _hasPremultipliedAlpha; } + CC_DEPRECATED_ATTRIBUTE inline bool isPremultipliedAlpha() { return _hasPremultipliedAlpha; } int getBitPerPixel(); bool hasAlpha(); @@ -138,6 +138,15 @@ public: @param isToRGB whether the image is saved as RGB format. */ bool saveToFile(const std::string &filename, bool isToRGB = true); + + + /** treats (or not) PVR files as if they have alpha premultiplied. + Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is + possible load them as if they have (or not) the alpha channel premultiplied. + + By default it is disabled. + */ + static void setPVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); protected: bool initWithJpgData(const unsigned char * data, ssize_t dataLen); @@ -171,7 +180,6 @@ protected: bool _unpack; Format _fileType; Texture2D::PixelFormat _renderFormat; - bool _preMulti; MipmapInfo _mipmaps[MIPMAP_MAX]; // pointer to mipmap images int _numberOfMipmaps; // false if we cann't auto detect the image is premultiplied or not. diff --git a/cocos/platform/android/CCApplication.cpp b/cocos/platform/android/CCApplication.cpp index 9cfaf5d8a8..e3afdb9ba2 100644 --- a/cocos/platform/android/CCApplication.cpp +++ b/cocos/platform/android/CCApplication.cpp @@ -68,7 +68,16 @@ int Application::run() void Application::setAnimationInterval(double interval) { - // NYI + JniMethodInfo methodInfo; + if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxRenderer", "setAnimationInterval", + "(D)V")) + { + CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__); + } + else + { + methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, interval); + } } ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java index a40d06019e..14cb7739c6 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxRenderer.java @@ -82,31 +82,30 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer { @Override public void onDrawFrame(final GL10 gl) { /* - * FPS controlling algorithm is not accurate, and it will slow down FPS - * on some devices. So comment FPS controlling code. + * No need to use algorithm in default(60 FPS) situation, + * since onDrawFrame() was called by system 60 times per second by default. */ + if (sAnimationInterval <= 1.0 / 60 * Cocos2dxRenderer.NANOSECONDSPERSECOND) { + Cocos2dxRenderer.nativeRender(); + } else { + final long now = System.nanoTime(); + final long interval = now - this.mLastTickInNanoSeconds; - /* - final long nowInNanoSeconds = System.nanoTime(); - final long interval = nowInNanoSeconds - this.mLastTickInNanoSeconds; - */ - - // should render a frame when onDrawFrame() is called or there is a - // "ghost" - Cocos2dxRenderer.nativeRender(); - - /* - // fps controlling - if (interval < Cocos2dxRenderer.sAnimationInterval) { - try { - // because we render it before, so we should sleep twice time interval - Thread.sleep((Cocos2dxRenderer.sAnimationInterval - interval) / Cocos2dxRenderer.NANOSECONDSPERMICROSECOND); - } catch (final Exception e) { + if (interval < Cocos2dxRenderer.sAnimationInterval) { + try { + Thread.sleep((Cocos2dxRenderer.sAnimationInterval - interval) / Cocos2dxRenderer.NANOSECONDSPERMICROSECOND); + } catch (final Exception e) { + } } + /* + * Render time MUST be counted in, or the FPS will slower than appointed. + */ + final long renderStart = System.nanoTime(); + Cocos2dxRenderer.nativeRender(); + final long renderEnd = System.nanoTime(); + final long renderInterval = renderEnd - renderStart; + this.mLastTickInNanoSeconds = renderEnd - renderInterval; } - - this.mLastTickInNanoSeconds = nowInNanoSeconds; - */ } // =========================================================== diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java index 11ca29a137..48dc5d8d67 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java @@ -119,7 +119,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl mViewHeight = maxHeight; if (mVideoWidth != 0 && mVideoHeight != 0) { - fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight); + fixSize(mViewLeft, mViewTop, mViewWidth, mViewHeight); } } @@ -324,7 +324,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl if (mFullScreenEnabled) { fixSize(0, 0, mFullScreenWidth, mFullScreenHeight); } else { - fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight); + fixSize(mViewLeft, mViewTop, mViewWidth, mViewHeight); } } diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index d120aa3112..1857c24d43 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -121,8 +121,6 @@ const Texture2D::PixelFormatInfoMap Texture2D::_pixelFormatInfoTables(TexturePix // Default is: RGBA8888 (32-bit textures) static Texture2D::PixelFormat g_defaultAlphaPixelFormat = Texture2D::PixelFormat::DEFAULT; -static bool _PVRHaveAlphaPremultiplied = false; - ////////////////////////////////////////////////////////////////////////// //conventer function @@ -779,20 +777,8 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format) } // set the premultiplied tag - if (!image->hasPremultipliedAlpha()) - { - if (image->getFileType() == Image::Format::PVR) - { - _hasPremultipliedAlpha = _PVRHaveAlphaPremultiplied; - }else - { - CCLOG("wanning: We cann't find the data is premultiplied or not, we will assume it's false."); - _hasPremultipliedAlpha = false; - } - }else - { - _hasPremultipliedAlpha = image->isPremultipliedAlpha(); - } + _hasPremultipliedAlpha = image->hasPremultipliedAlpha(); + return true; } } @@ -1218,10 +1204,10 @@ void Texture2D::drawInRect(const Rect& rect) void Texture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied) { - _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; + Image::setPVRImagesHavePremultipliedAlpha(haveAlphaPremultiplied); } - + // // Use to apply MIN/MAG filter // diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index 97b515dc7e..9944c2b163 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -182,10 +182,12 @@ public: possible load them as if they have (or not) the alpha channel premultiplied. By default it is disabled. + + deprecated, please use Image::setPVRImagesHavePremultipliedAlpha() instead. @since v0.99.5 */ - static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); + CC_DEPRECATED_ATTRIBUTE static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied); public: /** diff --git a/cocos/scripting/lua-bindings/auto/api/Image.lua b/cocos/scripting/lua-bindings/auto/api/Image.lua index b491b70e7c..4ce6cd8d50 100644 --- a/cocos/scripting/lua-bindings/auto/api/Image.lua +++ b/cocos/scripting/lua-bindings/auto/api/Image.lua @@ -16,11 +16,6 @@ -- @param #bool bool -- @return bool#bool ret (return value: bool) --------------------------------- --- @function [parent=#Image] getBitPerPixel --- @param self --- @return int#int ret (return value: int) - -------------------------------- -- @function [parent=#Image] hasAlpha -- @param self @@ -48,9 +43,9 @@ -- @return int#int ret (return value: int) -------------------------------- --- @function [parent=#Image] isPremultipliedAlpha +-- @function [parent=#Image] getBitPerPixel -- @param self --- @return bool#bool ret (return value: bool) +-- @return int#int ret (return value: int) -------------------------------- -- @function [parent=#Image] getFileType @@ -67,6 +62,11 @@ -- @param self -- @return int#int ret (return value: int) +-------------------------------- +-- @function [parent=#Image] setPVRImagesHavePremultipliedAlpha +-- @param self +-- @param #bool bool + -------------------------------- -- @function [parent=#Image] Image -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua index 81a1947825..c7c1456291 100644 --- a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua @@ -150,11 +150,6 @@ -- @param self -- @return int#int ret (return value: int) --------------------------------- --- @function [parent=#Texture2D] PVRImagesHavePremultipliedAlpha --- @param self --- @param #bool bool - -------------------------------- -- @function [parent=#Texture2D] Texture2D -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index bc2442b771..959a3237c1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -3500,38 +3500,6 @@ int lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(lua_State* tolua_S) #endif return 0; } -int lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Texture2D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Texture2D:PVRImagesHavePremultipliedAlpha"); - if(!ok) - return 0; - cocos2d::Texture2D::PVRImagesHavePremultipliedAlpha(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Texture2D:PVRImagesHavePremultipliedAlpha",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha'.",&tolua_err); -#endif - return 0; -} int lua_cocos2dx_Texture2D_constructor(lua_State* tolua_S) { int argc = 0; @@ -3606,7 +3574,6 @@ int lua_register_cocos2dx_Texture2D(lua_State* tolua_S) tolua_function(tolua_S,"setMaxS",lua_cocos2dx_Texture2D_setMaxS); tolua_function(tolua_S,"setDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat); tolua_function(tolua_S,"getDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat); - tolua_function(tolua_S,"PVRImagesHavePremultipliedAlpha", lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Texture2D).name(); g_luaType[typeName] = "cc.Texture2D"; @@ -44744,50 +44711,6 @@ int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Image_getBitPerPixel(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Image* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_getBitPerPixel'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getBitPerPixel(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_Image_hasAlpha(lua_State* tolua_S) { int argc = 0; @@ -45011,7 +44934,7 @@ int lua_cocos2dx_Image_getWidth(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) +int lua_cocos2dx_Image_getBitPerPixel(lua_State* tolua_S) { int argc = 0; cocos2d::Image* cobj = nullptr; @@ -45031,7 +44954,7 @@ int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_isPremultipliedAlpha'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_getBitPerPixel'", nullptr); return 0; } #endif @@ -45041,16 +44964,16 @@ int lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S) { if(!ok) return 0; - bool ret = cobj->isPremultipliedAlpha(); - tolua_pushboolean(tolua_S,(bool)ret); + int ret = cobj->getBitPerPixel(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:isPremultipliedAlpha",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_isPremultipliedAlpha'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); #endif return 0; @@ -45187,6 +45110,38 @@ int lua_cocos2dx_Image_getRenderFormat(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Image:setPVRImagesHavePremultipliedAlpha"); + if(!ok) + return 0; + cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Image:setPVRImagesHavePremultipliedAlpha",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'.",&tolua_err); +#endif + return 0; +} int lua_cocos2dx_Image_constructor(lua_State* tolua_S) { int argc = 0; @@ -45236,16 +45191,16 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_Image_constructor); tolua_function(tolua_S,"hasPremultipliedAlpha",lua_cocos2dx_Image_hasPremultipliedAlpha); tolua_function(tolua_S,"saveToFile",lua_cocos2dx_Image_saveToFile); - tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); tolua_function(tolua_S,"hasAlpha",lua_cocos2dx_Image_hasAlpha); tolua_function(tolua_S,"isCompressed",lua_cocos2dx_Image_isCompressed); tolua_function(tolua_S,"getHeight",lua_cocos2dx_Image_getHeight); tolua_function(tolua_S,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile); tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth); - tolua_function(tolua_S,"isPremultipliedAlpha",lua_cocos2dx_Image_isPremultipliedAlpha); + tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); tolua_function(tolua_S,"getFileType",lua_cocos2dx_Image_getFileType); tolua_function(tolua_S,"getNumberOfMipmaps",lua_cocos2dx_Image_getNumberOfMipmaps); tolua_function(tolua_S,"getRenderFormat",lua_cocos2dx_Image_getRenderFormat); + tolua_function(tolua_S,"setPVRImagesHavePremultipliedAlpha", lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Image).name(); g_luaType[typeName] = "cc.Image"; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 5e6bd89644..0cff4e3b27 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1574,7 +1574,6 @@ int register_all_cocos2dx(lua_State* tolua_S); - #endif // __cocos2dx_h__ diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings Mac.xcscheme b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings Mac.xcscheme index 59ef8fc5d8..4aa19dbd74 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings Mac.xcscheme +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings Mac.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme index ca661aa036..d9f900f7bb 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/xcshareddata/xcschemes/luabindings iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -48,6 +57,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/cocos/ui/UILayoutParameter.h b/cocos/ui/UILayoutParameter.h index 4862e91e68..0fcdc98794 100644 --- a/cocos/ui/UILayoutParameter.h +++ b/cocos/ui/UILayoutParameter.h @@ -135,8 +135,6 @@ protected: class LayoutParameterProtocol { public: - LayoutParameterProtocol(){} - virtual ~LayoutParameterProtocol(){} virtual LayoutParameter* getLayoutParameter() const= 0; }; diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index ae26500b0e..d67d6ed770 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -323,7 +323,7 @@ void VideoPlayer::draw(Renderer* renderer, const Mat4 &transform, uint32_t flags auto directorInstance = Director::getInstance(); auto glView = directorInstance->getOpenGLView(); auto frameSize = glView->getFrameSize(); - auto scaleFactor = directorInstance->getContentScaleFactor(); + auto scaleFactor = [static_cast(glView->getEAGLView()) contentScaleFactor]; auto winSize = directorInstance->getWinSize(); diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index c6cab6ec0c..6de3360581 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -319,7 +319,6 @@ void Widget::setSizePercent(const Vec2 &percent) this->setContentSize(cSize); } _customSize = cSize; - onSizeChanged(); } void Widget::updateSizeAndPosition() @@ -373,7 +372,8 @@ void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize) default: break; } - onSizeChanged(); + + //update position & position percent Vec2 absPos = getPosition(); switch (_positionType) { @@ -426,7 +426,6 @@ void Widget::ignoreContentAdaptWithSize(bool ignore) { this->setContentSize(_customSize); } - onSizeChanged(); } bool Widget::isIgnoreContentAdaptWithSize() const @@ -486,7 +485,6 @@ void Widget::updateContentSizeWithTextureSize(const cocos2d::Size &size) { this->setContentSize(_customSize); } - onSizeChanged(); } void Widget::setTouchEnabled(bool enable) @@ -719,6 +717,7 @@ void Widget::onTouchCancelled(Touch *touch, Event *unusedEvent) void Widget::pushDownEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::BEGAN); } @@ -727,10 +726,12 @@ void Widget::pushDownEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_BEGAN); } + this->release(); } void Widget::moveEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::MOVED); } @@ -739,11 +740,12 @@ void Widget::moveEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_MOVED); } + this->release(); } void Widget::releaseUpEvent() { - + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::ENDED); } @@ -752,10 +754,12 @@ void Widget::releaseUpEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_ENDED); } + this->release(); } void Widget::cancelUpEvent() { + this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::CANCELED); @@ -765,7 +769,7 @@ void Widget::cancelUpEvent() { (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_CANCELED); } - + this->release(); } void Widget::addTouchEventListener(Ref *target, SEL_TouchEvent selector) @@ -1036,7 +1040,6 @@ void Widget::copyProperties(Widget *widget) { setLayoutParameter(iter->second->clone()); } - onSizeChanged(); } void Widget::setFlippedX(bool flippedX) diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index b8df096ef1..e4d62a7947 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -41,7 +41,7 @@ NS_CC_EXT_BEGIN class ScrollView; -class ScrollViewDelegate +class CC_EX_DLL ScrollViewDelegate { public: /** diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 7f56938d5e..0868b2f6a9 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -51,7 +51,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIButtonTest); sceneManager->setMinUISceneId(kUIButtonTest); - sceneManager->setMaxUISceneId(kUIButtonTest_Title); + sceneManager->setMaxUISceneId(kUIButtonTest_RemoveSelf); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } @@ -87,7 +87,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIImageViewTest); sceneManager->setMinUISceneId(kUIImageViewTest); - sceneManager->setMaxUISceneId(kUIImageViewTest_Scale9); + sceneManager->setMaxUISceneId(kUIImageViewTest_ContentSize); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 35c713551b..8b8e7959dd 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -344,3 +344,80 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, Widget::TouchEventType type) break; } } + + +// UIButtonTest_RemoveSelf +UIButtonTestRemoveSelf::UIButtonTestRemoveSelf() +: _displayValueLabel(nullptr) +{ + +} + +UIButtonTestRemoveSelf::~UIButtonTestRemoveSelf() +{ +} + +bool UIButtonTestRemoveSelf::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the button events will be displayed + _displayValueLabel = Text::create("No Event", "fonts/Marker Felt.ttf",32); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + _uiLayer->addChild(_displayValueLabel); + + // Add the alert + Text* alert = Text::create("Remove Self in the Button's Callback shouldn't cause crash!","fonts/Marker Felt.ttf",10); + alert->setColor(Color3B(159, 168, 176)); + + alert->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f - alert->getContentSize().height * 2.75f)); + + _uiLayer->addChild(alert); + + // Create the button + Button* button = Button::create("cocosui/animationbuttonnormal.png", + "cocosui/animationbuttonpressed.png"); + button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); + // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTestRemoveSelf::touchEvent, this)); + _uiLayer->addChild(button); + + + + return true; + } + return false; +} + +void UIButtonTestRemoveSelf::touchEvent(Ref *pSender, Widget::TouchEventType type) +{ + switch (type) + { + case Widget::TouchEventType::BEGAN: + _displayValueLabel->setString(String::createWithFormat("Touch Down")->getCString()); + break; + + case Widget::TouchEventType::MOVED: + _displayValueLabel->setString(String::createWithFormat("Touch Move")->getCString()); + break; + + case Widget::TouchEventType::ENDED: + { + _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + + _uiLayer->removeFromParentAndCleanup(true); + } + break; + + case Widget::TouchEventType::CANCELED: + _displayValueLabel->setString(String::createWithFormat("Touch Cancelled")->getCString()); + break; + + default: + break; + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h index 0cf2f01c8f..48031ba3b3 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h @@ -79,4 +79,17 @@ protected: Text* _displayValueLabel; }; +class UIButtonTestRemoveSelf : public UIScene +{ +public: + UIButtonTestRemoveSelf(); + ~UIButtonTestRemoveSelf(); + bool init(); + void touchEvent(Ref *pSender, Widget::TouchEventType type); + +protected: + UI_SCENE_CREATE_FUNC(UIButtonTestRemoveSelf) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIButtonTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index a8b34f408e..01978a4e86 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -61,3 +61,71 @@ bool UIImageViewTest_Scale9::init() } return false; } + +// UIImageViewTest_ContentSize + +bool UIImageViewTest_ContentSize::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + Text* alert = Text::create("ImageView ContentSize Change", "fonts/Marker Felt.ttf", 26); + alert->setColor(Color3B(159, 168, 176)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f - alert->getContentSize().height * 2.125f)); + + _uiLayer->addChild(alert); + + Text *status = Text::create("child ImageView position percent", "fonts/Marker Felt.ttf", 16); + status->setColor(Color3B::RED); + status->setPosition(Vec2(widgetSize.width/2, widgetSize.height/2 + 80)); + _uiLayer->addChild(status,20); + + // Create the imageview + ImageView* imageView = ImageView::create("cocosui/buttonHighlighted.png"); + imageView->setScale9Enabled(true); + imageView->setContentSize(Size(200, 80)); + imageView->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f )); + + + ImageView* imageViewChild = ImageView::create("cocosui/buttonHighlighted.png"); + imageViewChild->setScale9Enabled(true); + imageViewChild->setSizeType(Widget::SizeType::PERCENT); + imageViewChild->setPositionType(Widget::PositionType::PERCENT); + imageViewChild->setSizePercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->setPositionPercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f)); + + ImageView* imageViewChild2 = ImageView::create("cocosui/buttonHighlighted.png"); + imageViewChild2->setScale9Enabled(true); + imageViewChild2->setSizeType(Widget::SizeType::PERCENT); + imageViewChild2->setPositionType(Widget::PositionType::PERCENT); + imageViewChild2->setSizePercent(Vec2::ANCHOR_MIDDLE); + imageViewChild2->setPositionPercent(Vec2::ANCHOR_MIDDLE); + imageViewChild->addChild(imageViewChild2); + + + imageView->addChild(imageViewChild); + + imageView->setTouchEnabled(true); + imageView->addTouchEventListener([=](Ref* sender, Widget::TouchEventType type){ + if (type == Widget::TouchEventType::ENDED) { + float width = CCRANDOM_0_1() * 200 + 50; + float height = CCRANDOM_0_1() * 80 + 30; + imageView->setContentSize(Size(width, height)); + + imageViewChild->setPositionPercent(Vec2(CCRANDOM_0_1(), CCRANDOM_0_1())); + status->setString(StringUtils::format("child ImageView position percent: %f, %f", + imageViewChild->getPositionPercent().x, imageViewChild->getPositionPercent().y)); + } + }); + + _uiLayer->addChild(imageView); + + return true; + } + return false; +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h index 7067bbb407..a70668751c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.h @@ -45,4 +45,13 @@ protected: UI_SCENE_CREATE_FUNC(UIImageViewTest_Scale9) }; +class UIImageViewTest_ContentSize : public UIScene +{ +public: + bool init(); + +protected: + UI_SCENE_CREATE_FUNC(UIImageViewTest_ContentSize) +}; + #endif /* defined(__TestCpp__UIImageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index edbecf2bd2..05b505b6cd 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -45,6 +45,7 @@ static const char* s_testArray[] = "UIButtonTest_Scale9", "UIButtonTest_PressedAction", "UIButtonTest_Title", + "UIButtonTest_RemoveSelf", "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", @@ -58,6 +59,7 @@ static const char* s_testArray[] = */ "UIImageViewTest", "UIImageViewTest_Scale9", + "UIImageViewTest_ContentSize", "UILoadingBarTest_Left", "UILoadingBarTest_Right", "UILoadingBarTest_Left_Scale9", @@ -190,7 +192,8 @@ Scene *UISceneManager::currentUIScene() case kUIButtonTest_Title: return UIButtonTest_Title::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIButtonTest_RemoveSelf: + return UIButtonTestRemoveSelf::sceneWithTitle(s_testArray[_currentUISceneId]); case kUICheckBoxTest: return UICheckBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); @@ -205,7 +208,8 @@ Scene *UISceneManager::currentUIScene() case kUIImageViewTest_Scale9: return UIImageViewTest_Scale9::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIImageViewTest_ContentSize: + return UIImageViewTest_ContentSize::sceneWithTitle(s_testArray[_currentUISceneId]); case kUILoadingBarTest_Left: return UILoadingBarTest_Left::sceneWithTitle(s_testArray[_currentUISceneId]); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 0dd94ad395..bbdf68dec1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -35,6 +35,7 @@ enum kUIButtonTest_Scale9, kUIButtonTest_PressedAction, kUIButtonTest_Title, + kUIButtonTest_RemoveSelf, kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, @@ -48,6 +49,7 @@ enum */ kUIImageViewTest, kUIImageViewTest_Scale9, + kUIImageViewTest_ContentSize, kUILoadingBarTest_Left, kUILoadingBarTest_Right, kUILoadingBarTest_Left_Scale9, diff --git a/tools/jenkins-scripts/ci-dailybuild-android.py b/tools/jenkins-scripts/ci-dailybuild-android.py index 57c3d745ab..469ff1680a 100644 --- a/tools/jenkins-scripts/ci-dailybuild-android.py +++ b/tools/jenkins-scripts/ci-dailybuild-android.py @@ -5,7 +5,9 @@ from shutil import copy import sys import traceback import MySQLdb - +from email.mime.text import MIMEText +import smtplib +import datetime def check_current_3rd_libs(): #get current_libs config backup_files = range(2) @@ -51,22 +53,69 @@ def save_build_stats(filename, size): cursor.execute(sql) db.commit() db.close() + def scan_all_libs(): + stats = {} _path = 'tests/cpp-empty-test/proj.android/libs/armeabi/libcpp_empty_test.so' filesize = os.path.getsize(_path)/1024 + stats['libcpp_empty_test'] = filesize save_build_stats('libcpp_empty_test', filesize) _path = 'tests/lua-empty-test/project/proj.android/libs/armeabi/liblua_empty_test.so' filesize = os.path.getsize(_path)/1024 + stats['liblua_empty_test'] = filesize save_build_stats('liblua_empty_test', filesize) lib_path = './tests/cpp-tests/proj.android/obj/local/armeabi' for root, dirs, files in os.walk(lib_path): for _file in files: if not _file.endswith(".a"): continue + print _file libfile = lib_path + '/' + _file _filename = _file.split('.')[0] filesize = os.path.getsize(libfile)/1024 + stats[_filename]=filesize save_build_stats(_filename, filesize) + return stats + +def send_mail(sub,title,content): + #to_list = os.environ['EMAIL_LIST'].split(' ') + mail_user = os.environ['EMAIL_USER'] + mail_pass = os.environ['EMAIL_PWD'] + to_list = os.environ['EMAIL_LIST'].split(' ') + mail_postfix = 'gmail.com' + me = mail_user + "<" + mail_user + "@" + mail_postfix + ">" + msg = MIMEText(content, _subtype='plain', _charset='gb2312') + msg['Subject'] = sub + msg['From'] = me + msg['To'] = " ".join(to_list) + print 'to users:', msg['To'] + msg['Content'] = 'test' + try: + s = smtplib.SMTP('smtp.gmail.com', 587) + s.ehlo() + s.starttls() + s.login(mail_user,mail_pass) + s.sendmail(me, to_list, str(msg)) + print 'info:', me, to_list, str(msg) + s.close() + return True + except Exception, e: + print str(e) + return False + +def sendEmail(stats): + now = datetime.datetime.now() + sub = "Cocos2d-x Android dailybuild stats of " + now.strftime("%Y-%m-%d") + title = "Dailybuild stats" + content = "The following list tracks the sizes of Cocos2d-x Android built libraries:\n" + + for key in stats: + content += key + content += " : " + content += str(stats[key]) + "KB" + content += "\n" + + send_mail(sub, title, content) def main(): print 'Build Config:' @@ -89,7 +138,8 @@ def main(): ret = os.system('python build/android-build.py -b release all') if(ret == 0): strip_android_libs() - scan_all_libs() + stats = scan_all_libs() + sendEmail(stats) os.system('git clean -xdf -f') print 'build exit' print ret