diff --git a/AUTHORS b/AUTHORS index d62059fb13..4ec7b7de70 100644 --- a/AUTHORS +++ b/AUTHORS @@ -485,6 +485,12 @@ Developers: musikov Fixing a bug that missing precision when getting strokeColor and fontFillColor + + hawkwood (Justin Hawkwood) + Fixing a bug that EditBox doesn't show any text if it's initialized with text. + + wtyqm (zhang peng) + Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes. Retired Core Developers: WenSheng Yang diff --git a/cocos2dx/CCScheduler.cpp b/cocos2dx/CCScheduler.cpp index 74b61fe152..796d07d10b 100644 --- a/cocos2dx/CCScheduler.cpp +++ b/cocos2dx/CCScheduler.cpp @@ -491,6 +491,40 @@ void Scheduler::scheduleUpdateForTarget(Object *pTarget, int nPriority, bool bPa } } +bool Scheduler::isScheduledForTarget(SEL_SCHEDULE pfnSelector, Object *pTarget) +{ + CCAssert(pfnSelector, "Argument selector must be non-NULL"); + CCAssert(pTarget, "Argument target must be non-NULL"); + + tHashTimerEntry *pElement = NULL; + HASH_FIND_INT(_hashForTimers, &pTarget, pElement); + + if (!pElement) + { + return false; + } + + if (pElement->timers == NULL) + { + return false; + }else + { + for (unsigned int i = 0; i < pElement->timers->num; ++i) + { + Timer *timer = (Timer*)pElement->timers->arr[i]; + + if (pfnSelector == timer->getSelector()) + { + return true; + } + } + + return false; + } + + return false; // should never get here +} + void Scheduler::removeUpdateFromHash(struct _listEntry *entry) { tHashUpdateEntry *element = NULL; diff --git a/cocos2dx/CCScheduler.h b/cocos2dx/CCScheduler.h index 5cab6f186c..04ea895366 100644 --- a/cocos2dx/CCScheduler.h +++ b/cocos2dx/CCScheduler.h @@ -159,6 +159,11 @@ public: @since v0.99.3 */ void scheduleUpdateForTarget(Object *pTarget, int nPriority, bool bPaused); + + /** Checks whether a selector for a given taget is scheduled. + @since v3.0.0 + */ + bool isScheduledForTarget(SEL_SCHEDULE pfnSelector, Object *pTarget); /** Unschedule a selector for a given target. If you want to unschedule the "update", use unscheudleUpdateForTarget. diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 5dd95f6d85..0673a5fee6 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -1039,6 +1039,11 @@ Scheduler* Node::getScheduler() return _scheduler; } +bool Node::isScheduled(SEL_SCHEDULE selector) +{ + return _scheduler->isScheduledForTarget(selector, this); +} + void Node::scheduleUpdate() { scheduleUpdateWithPriority(0); diff --git a/cocos2dx/platform/CCImage.h b/cocos2dx/platform/CCImage.h index 977aa31279..01aa23b46f 100644 --- a/cocos2dx/platform/CCImage.h +++ b/cocos2dx/platform/CCImage.h @@ -45,6 +45,8 @@ NS_CC_BEGIN class CC_DLL Image : public Object { public: + friend class TextureCache; + Image(); ~Image(); @@ -79,15 +81,6 @@ public: */ bool initWithImageFile(const char * strPath, EImageFormat imageType = kFmtPng); - /* - @brief The same result as with initWithImageFile, but thread safe. It is caused by - loadImage() in TextureCache.cpp. - @param fullpath full path of the file. - @param imageType the type of image, currently only supporting two types. - @return true if loaded correctly. - */ - bool initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType = kFmtPng); - /** @brief Load image from stream buffer. @@ -189,6 +182,15 @@ private: // noncopyable Image(const Image& rImg); Image & operator=(const Image&); + + /* + @brief The same result as with initWithImageFile, but thread safe. It is caused by + loadImage() in TextureCache.cpp. + @param fullpath full path of the file. + @param imageType the type of image, currently only supporting two types. + @return true if loaded correctly. + */ + bool initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType = kFmtPng); }; // end of platform group diff --git a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp index 9197d8e54c..775c1258a7 100644 --- a/cocos2dx/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos2dx/platform/android/CCFileUtilsAndroid.cpp @@ -92,13 +92,8 @@ bool FileUtilsAndroid::isFileExist(const std::string& strFilePath) { const char* s = strFilePath.c_str(); - if (strFilePath.find(_defaultResRootPath) != 0) - { - // Didn't find "assets/" at the beginning of the path - } else { - // Found "assets/" at the beginning of the path and we don't want it - s += strlen("assets/"); - } + // Found "assets/" at the beginning of the path and we don't want it + if (strFilePath.find(_defaultResRootPath) == 0) s += strlen("assets/"); if (s_assetmanager) { AAsset* aa = AAssetManager_open(s_assetmanager, s, AASSET_MODE_UNKNOWN); @@ -160,13 +155,14 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* pszFileName, const ch if (fullPath[0] != '/') { - if (forAsync) + + string fullPath(pszFileName); + // fullPathForFilename is not thread safe. + if (! forAsync) { - // Nothing to do when using the Android assetmanager APIs??? + fullPath = fullPathForFilename(pszFileName); } - string fullPath = fullPathForFilename(pszFileName); - const char* relativepath = fullPath.c_str(); // "assets/" is at the beginning of the path and we don't want it diff --git a/cocos2dx/platform/ios/CCImage.mm b/cocos2dx/platform/ios/CCImage.mm index 8cced182d7..cdd3a8a2c4 100644 --- a/cocos2dx/platform/ios/CCImage.mm +++ b/cocos2dx/platform/ios/CCImage.mm @@ -428,7 +428,7 @@ bool Image::initWithImageFile(const char * strPath, EImageFormat eImgFmt/* = eFm bool Image::initWithImageFileThreadSafe(const char *fullpath, EImageFormat imageType) { /* - * FileUtils::fullPathFromRelativePath() is not thread-safe, it use autorelease(). + * FileUtils::fullPathFromRelativePath() is not thread-safe. */ bool bRet = false; unsigned long nSize = 0; diff --git a/cocos2dx/proj.linux/.cproject b/cocos2dx/proj.linux/.cproject index f1c8fc20db..b618cc6921 100755 --- a/cocos2dx/proj.linux/.cproject +++ b/cocos2dx/proj.linux/.cproject @@ -37,7 +37,6 @@ - @@ -60,7 +59,6 @@ - @@ -87,7 +85,6 @@ - @@ -170,7 +167,6 @@ - @@ -192,7 +188,6 @@ - @@ -218,7 +213,6 @@ - @@ -302,7 +296,6 @@ - @@ -325,7 +318,6 @@ - @@ -352,7 +344,6 @@ - @@ -435,7 +426,6 @@ - @@ -458,7 +448,6 @@ - @@ -485,7 +474,6 @@ - diff --git a/cocos2dx/support/zip_support/ZipUtils.cpp b/cocos2dx/support/zip_support/ZipUtils.cpp index 2f1dd4e2ec..1a2cddaa4e 100644 --- a/cocos2dx/support/zip_support/ZipUtils.cpp +++ b/cocos2dx/support/zip_support/ZipUtils.cpp @@ -456,14 +456,9 @@ public: ZipFile::ZipFile(const std::string &zipFile, const std::string &filter) : _data(new ZipFilePrivate) -, _dataThread(new ZipFilePrivate) { _data->zipFile = unzOpen(zipFile.c_str()); - _dataThread->zipFile = unzOpen(zipFile.c_str()); - if (_data->zipFile && _dataThread->zipFile) - { - setFilter(filter); - } + setFilter(filter); } ZipFile::~ZipFile() @@ -472,36 +467,32 @@ ZipFile::~ZipFile() { unzClose(_data->zipFile); } - if (_dataThread && _dataThread->zipFile) - { - unzClose(_dataThread->zipFile); - } + CC_SAFE_DELETE(_data); - CC_SAFE_DELETE(_dataThread); } -bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data) +bool ZipFile::setFilter(const std::string &filter) { bool ret = false; do { - CC_BREAK_IF(!data); - CC_BREAK_IF(!data->zipFile); + CC_BREAK_IF(!_data); + CC_BREAK_IF(!_data->zipFile); // clear existing file list - data->fileList.clear(); + _data->fileList.clear(); // UNZ_MAXFILENAMEINZIP + 1 - it is done so in unzLocateFile char szCurrentFileName[UNZ_MAXFILENAMEINZIP + 1]; unz_file_info64 fileInfo; // go through all files and store position information about the required files - int err = unzGoToFirstFile64(data->zipFile, &fileInfo, + int err = unzGoToFirstFile64(_data->zipFile, &fileInfo, szCurrentFileName, sizeof(szCurrentFileName) - 1); while (err == UNZ_OK) { unz_file_pos posInfo; - int posErr = unzGetFilePos(data->zipFile, &posInfo); + int posErr = unzGetFilePos(_data->zipFile, &posInfo); if (posErr == UNZ_OK) { std::string currentFileName = szCurrentFileName; @@ -512,11 +503,11 @@ bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data) ZipEntryInfo entry; entry.pos = posInfo; entry.uncompressed_size = (uLong)fileInfo.uncompressed_size; - data->fileList[currentFileName] = entry; + _data->fileList[currentFileName] = entry; } } // next file - also get the information about it - err = unzGoToNextFile64(data->zipFile, &fileInfo, + err = unzGoToNextFile64(_data->zipFile, &fileInfo, szCurrentFileName, sizeof(szCurrentFileName) - 1); } ret = true; @@ -526,11 +517,6 @@ bool ZipFile::setFilter(const std::string &filter, ZipFilePrivate *data) return ret; } -bool ZipFile::setFilter(const std::string &filter) -{ - return (setFilter(filter, _data) && setFilter(filter, _dataThread)); -} - bool ZipFile::fileExists(const std::string &fileName) const { bool ret = false; @@ -545,11 +531,6 @@ bool ZipFile::fileExists(const std::string &fileName) const } unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *pSize) -{ - return getFileData(fileName, pSize, _data); -} - -unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long *pSize, ZipFilePrivate *data) { unsigned char * pBuffer = NULL; if (pSize) @@ -559,29 +540,29 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, unsigned long * do { - CC_BREAK_IF(!data->zipFile); + CC_BREAK_IF(!_data->zipFile); CC_BREAK_IF(fileName.empty()); - ZipFilePrivate::FileListContainer::const_iterator it = data->fileList.find(fileName); - CC_BREAK_IF(it == data->fileList.end()); + ZipFilePrivate::FileListContainer::const_iterator it = _data->fileList.find(fileName); + CC_BREAK_IF(it == _data->fileList.end()); ZipEntryInfo fileInfo = it->second; - int nRet = unzGoToFilePos(data->zipFile, &fileInfo.pos); + int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos); CC_BREAK_IF(UNZ_OK != nRet); - nRet = unzOpenCurrentFile(data->zipFile); + nRet = unzOpenCurrentFile(_data->zipFile); CC_BREAK_IF(UNZ_OK != nRet); pBuffer = new unsigned char[fileInfo.uncompressed_size]; - int CC_UNUSED nSize = unzReadCurrentFile(data->zipFile, pBuffer, fileInfo.uncompressed_size); + int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, pBuffer, fileInfo.uncompressed_size); CCAssert(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); if (pSize) { *pSize = fileInfo.uncompressed_size; } - unzCloseCurrentFile(data->zipFile); + unzCloseCurrentFile(_data->zipFile); } while (0); return pBuffer; diff --git a/cocos2dx/support/zip_support/ZipUtils.h b/cocos2dx/support/zip_support/ZipUtils.h index a13660981b..d245760271 100644 --- a/cocos2dx/support/zip_support/ZipUtils.h +++ b/cocos2dx/support/zip_support/ZipUtils.h @@ -171,10 +171,6 @@ namespace cocos2d class ZipFile { public: -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - friend class FileUtilsAndroid; -#endif - /** * Constructor, open zip file and store file list. * @@ -220,13 +216,8 @@ namespace cocos2d unsigned char *getFileData(const std::string &fileName, unsigned long *pSize); private: - bool setFilter(const std::string &filer, ZipFilePrivate *data); - unsigned char *getFileData(const std::string &fileName, unsigned long *pSize, ZipFilePrivate *data); - /** Internal data like zip file pointer / file list array and so on */ ZipFilePrivate *_data; - /** Another data used not in main thread */ - ZipFilePrivate *_dataThread; }; } // end of namespace cocos2d #endif // __SUPPORT_ZIPUTILS_H__ diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index 4b87193cfa..9b8f22d884 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -108,6 +108,9 @@ CCBReader::CCBReader(CCBReader * pCCBReader) this->mOwnerOutletNames = pCCBReader->mOwnerOutletNames; this->mOwnerOutletNodes = pCCBReader->mOwnerOutletNodes; this->mOwnerOutletNodes->retain(); + + this->mCCBRootPath = pCCBReader->getCCBRootPath(); + init(); } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index deb5644850..655132037c 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -77,7 +77,8 @@ static const int CC_EDIT_BOX_PADDING = 5; textField_.backgroundColor = [UIColor clearColor]; textField_.borderStyle = UITextBorderStyleNone; textField_.delegate = self; - textField_.returnKeyType = UIReturnKeyDefault; + textField_.hidden = true; + textField_.returnKeyType = UIReturnKeyDefault; [textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged]; self.editBox = editBox; diff --git a/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml b/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml index 035a395c49..b0d65245fa 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml @@ -4,16 +4,16 @@ android:versionName="3.2.0" android:installLocation="preferExternal"> - - - - - + + + + + - + - + @@ -22,22 +22,22 @@ - diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id new file mode 100644 index 0000000000..8fee1b7bd7 --- /dev/null +++ b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png.REMOVED.git-id @@ -0,0 +1 @@ +a19769aee91a80e7148db4238e0cb6df4cc5a250 \ No newline at end of file diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id new file mode 100644 index 0000000000..bb1906a48a --- /dev/null +++ b/plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png.REMOVED.git-id @@ -0,0 +1 @@ +dad94a0903f7d1b167e72bc36e0b9134d49e7b69 \ No newline at end of file diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml index 501669d871..0fde0134a1 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml @@ -115,7 +115,9 @@ android:layout_weight="1" android:hint="@string/nd3_account_login_hint_account" android:singleLine="true" - android:inputType="textEmailAddress"> + android:nextFocusDown="@+id/nd3_account_login_password" + android:inputType="textEmailAddress" + android:imeOptions="actionNext"> + android:singleLine="true" + android:imeOptions="actionDone" > diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml index 2909d63194..eb78473082 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml @@ -119,7 +119,9 @@ android:layout_weight="1" android:hint="@string/nd3_account_login_hint_account" android:singleLine="true" - android:inputType="textEmailAddress"> + android:nextFocusDown="@+id/nd3_account_login_password" + android:inputType="textEmailAddress" + android:imeOptions="actionNext"> + android:singleLine="true" + android:imeOptions="actionDone"> diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml index 8b9b690d86..cd76a0ba13 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml @@ -113,6 +113,7 @@ android:maxLength="70" android:hint="@string/nd3_account_register_hint_account" style="@style/nd3_option_edittext_style" + android:imeOptions="actionNext" > @@ -152,6 +153,7 @@ android:maxLength="12" android:hint="@string/nd3_account_register_hint_password" style="@style/nd3_option_edittext_style" + android:imeOptions="actionDone" > diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml index e575e847e3..6ae7992eb8 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml @@ -109,6 +109,7 @@ android:maxLength="70" android:hint="@string/nd3_account_register_hint_account" style="@style/nd3_option_edittext_style" + android:imeOptions="actionNext" > @@ -188,6 +189,7 @@ android:maxLength="12" android:hint="@string/nd3_account_register_hint_password" style="@style/nd3_option_edittext_style" + android:imeOptions="actionDone" > diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml index 2303eb7cc3..d3746c3d26 100644 --- a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml @@ -4,16 +4,16 @@ android:layout_width="fill_parent" android:layout_height="wrap_content"> + android:id="@+id/nd3_empty_listview_txt" + android:text="@string/nd3_list_item_loading" + android:textColor="@color/nd3_black" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="@dimen/nd3_margin_size"/> + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:background="@drawable/nd3_horizontal_line" + android:layout_below="@id/nd3_empty_listview_txt"/> diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml new file mode 100644 index 0000000000..b7a89fe5c5 --- /dev/null +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml @@ -0,0 +1,34 @@ + + + + + + + + + + \ No newline at end of file diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml new file mode 100644 index 0000000000..4595839d15 --- /dev/null +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml @@ -0,0 +1,35 @@ + + + + + + + + \ No newline at end of file diff --git a/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml new file mode 100644 index 0000000000..a7937815c5 --- /dev/null +++ b/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +