From be64dd97cf659e50fddbca846da1efabd7b50c5b Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Mon, 11 Nov 2013 18:09:47 -0800 Subject: [PATCH 01/11] replaces `delete[]` with `free()` in C-based API API that returns a newly allocated buffer as an output argument (not return value) are error-prone. - Users forget to release the newly allocated buffer - Or the call `delete` instead of `delete[]` But some of those API need to call `realloc` on the buffer. But `realloc` is only valid if the buffer was previously allocated with `malloc`. If a buffer needs to be re-allocated using a C++ API, then `std::vector` should be used instead... So, this patch does: - Migrates the API from `new []` / `delete[]` to `malloc()` / `free()` - Fixes all the memory issues: incorrect deallocs and memory leaks - Updates the documentation - And fixes misc issues with the API: removes `cc` from the ZipUtils class. --- cocos/2d/CCFontFreeType.cpp | 2 +- cocos/2d/CCParticleSystem.cpp | 6 +- cocos/2d/CCTMXXMLParser.cpp | 6 +- cocos/2d/CCTextureCache.cpp | 2 +- cocos/2d/CCUserDefault.cpp | 9 +- cocos/2d/CCUserDefault.mm | 6 +- cocos/2d/CCUserDefaultAndroid.cpp | 18 ++-- cocos/2d/TGAlib.cpp | 2 +- cocos/2d/ZipUtils.cpp | 99 ++++++++++--------- cocos/2d/ZipUtils.h | 49 +++++---- cocos/2d/base64.cpp | 6 +- cocos/2d/base64.h | 4 +- cocos/2d/platform/CCFileUtils.cpp | 4 +- cocos/2d/platform/CCFileUtils.h | 4 +- cocos/2d/platform/CCImageCommon_cpp.h | 8 +- cocos/2d/platform/CCSAXParser.cpp | 2 +- cocos/base/CCString.cpp | 2 +- .../editor-support/cocosbuilder/CCBReader.cpp | 2 +- .../cocosbuilder/CCNodeLoader.cpp | 2 +- .../cocostudio/CCDataReaderHelper.cpp | 5 +- .../cocostudio/CCSGUIReader.cpp | 8 +- .../cocostudio/CCSSceneReader.cpp | 29 +++--- cocos/editor-support/spine/Atlas.cpp | 2 +- cocos/editor-support/spine/SkeletonJson.cpp | 2 +- .../javascript/bindings/ScriptingCore.cpp | 2 +- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../lua/bindings/Cocos2dxLuaLoader.cpp | 2 +- .../TextureAtlasEncryptionTest.cpp | 8 +- 28 files changed, 150 insertions(+), 143 deletions(-) diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 5e2173204f..77f0b872d0 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -136,7 +136,7 @@ FontFreeType::~FontFreeType() } if (_ttfData) { - delete _ttfData; + free(_ttfData); _ttfData = nullptr; } } diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index cb2c4326f3..dd7bb47dd3 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -396,7 +396,7 @@ bool ParticleSystem::initWithDictionary(Dictionary *dictionary, const std::strin CCASSERT( buffer != NULL, "CCParticleSystem: error decoding textureImageData"); CC_BREAK_IF(!buffer); - int deflatedLen = ZipUtils::ccInflateMemory(buffer, decodeLen, &deflated); + int deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated); CCASSERT( deflated != NULL, "CCParticleSystem: error ungzipping textureImageData"); CC_BREAK_IF(!deflated); @@ -420,8 +420,8 @@ bool ParticleSystem::initWithDictionary(Dictionary *dictionary, const std::strin bRet = true; } } while (0); - CC_SAFE_DELETE_ARRAY(buffer); - CC_SAFE_DELETE_ARRAY(deflated); + free(buffer); + free(deflated); return bRet; } diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index d981cca6b4..5abe1e6f31 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -66,7 +66,7 @@ TMXLayerInfo::~TMXLayerInfo() CC_SAFE_RELEASE(_properties); if( _ownTiles && _tiles ) { - delete [] _tiles; + free(_tiles); _tiles = NULL; } } @@ -757,12 +757,12 @@ void TMXMapInfo::endElement(void *ctx, const char *name) // int sizeHint = s.width * s.height * sizeof(uint32_t); int sizeHint = (int)(s.width * s.height * sizeof(unsigned int)); - int inflatedLen = ZipUtils::ccInflateMemoryWithHint(buffer, len, &deflated, sizeHint); + int inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint); CCASSERT(inflatedLen == sizeHint, ""); inflatedLen = (size_t)&inflatedLen; // XXX: to avoid warnings in compiler - delete [] buffer; + free(buffer); buffer = NULL; if( ! deflated ) diff --git a/cocos/2d/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp index e4c9a0c8aa..15b30ccb6a 100644 --- a/cocos/2d/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -622,7 +622,7 @@ void VolatileTextureMgr::reloadAllTextures() Texture2D::setDefaultAlphaPixelFormat(oldPixelFormat); } - CC_SAFE_DELETE_ARRAY(pBuffer); + free(pBuffer); CC_SAFE_RELEASE(image); } break; diff --git a/cocos/2d/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp index 2104051f76..aa7a12f816 100644 --- a/cocos/2d/CCUserDefault.cpp +++ b/cocos/2d/CCUserDefault.cpp @@ -59,7 +59,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLEle *doc = xmlDoc; //CCFileData data(UserDefault::getInstance()->getXMLFilePath().c_str(),"rt"); long nSize; - const char* pXmlBuffer = (const char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &nSize); + char* pXmlBuffer = (char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &nSize); //const char* pXmlBuffer = (const char*)data.getBuffer(); if(NULL == pXmlBuffer) { @@ -67,7 +67,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLEle break; } xmlDoc->Parse(pXmlBuffer, nSize); - delete[] pXmlBuffer; + free(pXmlBuffer); // get root node *rootNode = xmlDoc->RootElement(); if (NULL == *rootNode) @@ -323,7 +323,7 @@ Data* UserDefault::getDataForKey(const char* pKey, Data* defaultValue) if (decodedData) { ret = Data::create(decodedData, decodedDataLen); - delete decodedData; + free(decodedData); } } @@ -408,7 +408,8 @@ void UserDefault::setDataForKey(const char* pKey, const Data& value) { setValueForKey(pKey, encodedData); - if (encodedData) delete encodedData; + if (encodedData) + free(encodedData); } UserDefault* UserDefault::getInstance() diff --git a/cocos/2d/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm index da1c8827fd..e64f339b8d 100644 --- a/cocos/2d/CCUserDefault.mm +++ b/cocos/2d/CCUserDefault.mm @@ -74,7 +74,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc tinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument(); *doc = xmlDoc; long size; - const char* pXmlBuffer = (const char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &size); + char* pXmlBuffer = (char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &size); //const char* pXmlBuffer = (const char*)data.getBuffer(); if(NULL == pXmlBuffer) { @@ -82,7 +82,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc break; } xmlDoc->Parse(pXmlBuffer); - delete[] pXmlBuffer; + free(pXmlBuffer); // get root node rootNode = xmlDoc->RootElement(); if (NULL == rootNode) @@ -394,7 +394,7 @@ Data* UserDefault::getDataForKey(const char* pKey, Data* defaultValue) // set value in NSUserDefaults setDataForKey(pKey, ret); - delete decodedData; + free(decodedData); flush(); diff --git a/cocos/2d/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp index db18dd2951..510c83c14c 100644 --- a/cocos/2d/CCUserDefaultAndroid.cpp +++ b/cocos/2d/CCUserDefaultAndroid.cpp @@ -83,7 +83,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc break; } xmlDoc->Parse(pXmlBuffer); - delete[] pXmlBuffer; + free(pXmlBuffer); // get root node rootNode = xmlDoc->RootElement(); if (NULL == rootNode) @@ -367,10 +367,7 @@ Data* UserDefault::getDataForKey(const char* pKey, Data* defaultValue) // set value in NSUserDefaults setDataForKey(pKey, ret); - CC_SAFE_DELETE_ARRAY(decodedData); - - delete decodedData; - + free(decodedData); flush(); // delete xmle node @@ -392,9 +389,8 @@ Data* UserDefault::getDataForKey(const char* pKey, Data* defaultValue) string encodedStr = getStringForKeyJNI(pKey, encodedDefaultData); - if (encodedDefaultData) { - delete encodedDefaultData; - } + if (encodedDefaultData) + free(encodedDefaultData); CCLOG("ENCODED STRING: --%s--%d", encodedStr.c_str(), encodedStr.length()); @@ -408,6 +404,7 @@ Data* UserDefault::getDataForKey(const char* pKey, Data* defaultValue) if (decodedData && decodedDataLen) { ret = Data::create(decodedData, decodedDataLen); + free(decodedData); } CCLOG("RETURNED %p!", ret); @@ -475,9 +472,8 @@ void UserDefault::setDataForKey(const char* pKey, const Data& value) return setStringForKeyJNI(pKey, encodedData); - if (encodedData) { - delete encodedData; - } + if (encodedData) + free(encodedData); } // XXX: deprecated diff --git a/cocos/2d/TGAlib.cpp b/cocos/2d/TGAlib.cpp index 8725e765cb..160be2a907 100644 --- a/cocos/2d/TGAlib.cpp +++ b/cocos/2d/TGAlib.cpp @@ -270,7 +270,7 @@ tImageTGA * tgaLoad(const char *filename) } } while(0); - CC_SAFE_DELETE_ARRAY(pBuffer); + free(pBuffer); return info; } diff --git a/cocos/2d/ZipUtils.cpp b/cocos/2d/ZipUtils.cpp index 2e5d9fe43f..8bec015765 100644 --- a/cocos/2d/ZipUtils.cpp +++ b/cocos/2d/ZipUtils.cpp @@ -39,7 +39,7 @@ bool ZipUtils::s_bEncryptionKeyIsValid = false; // --------------------- ZipUtils --------------------- -inline void ZipUtils::ccDecodeEncodedPvr(unsigned int *data, long len) +inline void ZipUtils::decodeEncodedPvr(unsigned int *data, long len) { const int enclen = 1024; const int securelen = 512; @@ -47,10 +47,10 @@ inline void ZipUtils::ccDecodeEncodedPvr(unsigned int *data, long len) // check if key was set // make sure to call caw_setkey_part() for all 4 key parts - CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, "Cocos2D: CCZ file is encrypted but key part 0 is not set. Did you call ZipUtils::ccSetPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, "Cocos2D: CCZ file is encrypted but key part 1 is not set. Did you call ZipUtils::ccSetPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, "Cocos2D: CCZ file is encrypted but key part 2 is not set. Did you call ZipUtils::ccSetPvrEncryptionKeyPart(...)?"); - CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, "Cocos2D: CCZ file is encrypted but key part 3 is not set. Did you call ZipUtils::ccSetPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, "Cocos2D: CCZ file is encrypted but key part 0 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, "Cocos2D: CCZ file is encrypted but key part 1 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, "Cocos2D: CCZ file is encrypted but key part 2 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); + CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, "Cocos2D: CCZ file is encrypted but key part 3 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?"); // create long key if(!s_bEncryptionKeyIsValid) @@ -108,7 +108,7 @@ inline void ZipUtils::ccDecodeEncodedPvr(unsigned int *data, long len) } } -inline unsigned int ZipUtils::ccChecksumPvr(const unsigned int *data, long len) +inline unsigned int ZipUtils::checksumPvr(const unsigned int *data, long len) { unsigned int cs = 0; const int cslen = 128; @@ -127,13 +127,13 @@ inline unsigned int ZipUtils::ccChecksumPvr(const unsigned int *data, long len) // Should buffer factor be 1.5 instead of 2 ? #define BUFFER_INC_FACTOR (2) -int ZipUtils::ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long *outLength, long outLenghtHint) +int ZipUtils::inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long *outLength, long outLenghtHint) { /* ret value */ int err = Z_OK; long bufferSize = outLenghtHint; - *out = new unsigned char[bufferSize]; + *out = (unsigned char*)malloc(bufferSize); z_stream d_stream; /* decompression stream */ d_stream.zalloc = (alloc_func)0; @@ -192,10 +192,10 @@ int ZipUtils::ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned return err; } -int ZipUtils::ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLengthHint) +int ZipUtils::inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLengthHint) { long outLength = 0; - int err = ccInflateMemoryWithHint(in, inLength, out, &outLength, outLengthHint); + int err = inflateMemoryWithHint(in, inLength, out, &outLength, outLengthHint); if (err != Z_OK || *out == NULL) { if (err == Z_MEM_ERROR) @@ -214,22 +214,24 @@ int ZipUtils::ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned { CCLOG("cocos2d: ZipUtils: Unknown error while decompressing map data!"); } - - delete[] *out; - *out = NULL; + + if(*out) { + free(*out); + *out = NULL; + } outLength = 0; } return outLength; } -int ZipUtils::ccInflateMemory(unsigned char *in, long inLength, unsigned char **out) +int ZipUtils::inflateMemory(unsigned char *in, long inLength, unsigned char **out) { // 256k for hint - return ccInflateMemoryWithHint(in, inLength, out, 256 * 1024); + return inflateMemoryWithHint(in, inLength, out, 256 * 1024); } -int ZipUtils::ccInflateGZipFile(const char *path, unsigned char **out) +int ZipUtils::inflateGZipFile(const char *path, unsigned char **out) { int len; unsigned int offset = 0; @@ -299,7 +301,7 @@ int ZipUtils::ccInflateGZipFile(const char *path, unsigned char **out) return offset; } -bool ZipUtils::ccIsCCZFile(const char *path) +bool ZipUtils::isCCZFile(const char *path) { // load file into memory unsigned char* compressed = NULL; @@ -307,16 +309,19 @@ bool ZipUtils::ccIsCCZFile(const char *path) long fileLen = 0; compressed = FileUtils::getInstance()->getFileData(path, "rb", &fileLen); - if(NULL == compressed || 0 == fileLen) + if(compressed == NULL || fileLen == 0) { CCLOG("cocos2d: ZipUtils: loading file failed"); return false; } - return ccIsCCZBuffer(compressed, fileLen); + bool ret = isCCZBuffer(compressed, fileLen); + free(compressed); + + return ret; } -bool ZipUtils::ccIsCCZBuffer(const unsigned char *buffer, long len) +bool ZipUtils::isCCZBuffer(const unsigned char *buffer, long len) { if (len < sizeof(struct CCZHeader)) { @@ -328,7 +333,7 @@ bool ZipUtils::ccIsCCZBuffer(const unsigned char *buffer, long len) } -bool ZipUtils::ccIsGZipFile(const char *path) +bool ZipUtils::isGZipFile(const char *path) { // load file into memory unsigned char* compressed = NULL; @@ -342,10 +347,12 @@ bool ZipUtils::ccIsGZipFile(const char *path) return false; } - return ccIsGZipBuffer(compressed, fileLen); + bool ret = isGZipBuffer(compressed, fileLen); + free(compressed); + return ret; } -bool ZipUtils::ccIsGZipBuffer(const unsigned char *buffer, long len) +bool ZipUtils::isGZipBuffer(const unsigned char *buffer, long len) { if (len < 2) { @@ -356,7 +363,7 @@ bool ZipUtils::ccIsGZipBuffer(const unsigned char *buffer, long len) } -int ZipUtils::ccInflateCCZBuffer(const unsigned char *buffer, long bufferLen, unsigned char **out) +int ZipUtils::inflateCCZBuffer(const unsigned char *buffer, long bufferLen, unsigned char **out) { struct CCZHeader *header = (struct CCZHeader*) buffer; @@ -402,11 +409,11 @@ int ZipUtils::ccInflateCCZBuffer(const unsigned char *buffer, long bufferLen, un unsigned int* ints = (unsigned int*)(buffer+12); int enclen = (bufferLen-12)/4; - ccDecodeEncodedPvr(ints, enclen); + decodeEncodedPvr(ints, enclen); #if COCOS2D_DEBUG > 0 // verify checksum in debug mode - unsigned int calculated = ccChecksumPvr(ints, enclen); + unsigned int calculated = checksumPvr(ints, enclen); unsigned int required = CC_SWAP_INT32_BIG_TO_HOST( header->reserved ); if(calculated != required) @@ -446,7 +453,7 @@ int ZipUtils::ccInflateCCZBuffer(const unsigned char *buffer, long bufferLen, un return len; } -int ZipUtils::ccInflateCCZFile(const char *path, unsigned char **out) +int ZipUtils::inflateCCZFile(const char *path, unsigned char **out) { CCAssert(out, ""); CCAssert(&*out, ""); @@ -463,10 +470,12 @@ int ZipUtils::ccInflateCCZFile(const char *path, unsigned char **out) return -1; } - return ccInflateCCZBuffer(compressed, fileLen, out); + int ret = inflateCCZBuffer(compressed, fileLen, out); + free(compressed); + return ret; } -void ZipUtils::ccSetPvrEncryptionKeyPart(int index, unsigned int value) +void ZipUtils::setPvrEncryptionKeyPart(int index, unsigned int value) { CCASSERT(index >= 0, "Cocos2d: key part index cannot be less than 0"); CCASSERT(index <= 3, "Cocos2d: key part index cannot be greater than 3"); @@ -478,12 +487,12 @@ void ZipUtils::ccSetPvrEncryptionKeyPart(int index, unsigned int value) } } -void ZipUtils::ccSetPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) +void ZipUtils::setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) { - ccSetPvrEncryptionKeyPart(0, keyPart1); - ccSetPvrEncryptionKeyPart(1, keyPart2); - ccSetPvrEncryptionKeyPart(2, keyPart3); - ccSetPvrEncryptionKeyPart(3, keyPart4); + setPvrEncryptionKeyPart(0, keyPart1); + setPvrEncryptionKeyPart(1, keyPart2); + setPvrEncryptionKeyPart(2, keyPart3); + setPvrEncryptionKeyPart(3, keyPart4); } // --------------------- ZipFile --------------------- @@ -582,14 +591,12 @@ bool ZipFile::fileExists(const std::string &fileName) const return ret; } -unsigned char *ZipFile::getFileData(const std::string &fileName, long *pSize) +unsigned char *ZipFile::getFileData(const std::string &fileName, long *size) { - unsigned char * pBuffer = NULL; - if (pSize) - { - *pSize = 0; - } - + unsigned char * buffer = NULL; + if (size) + *size = 0; + do { CC_BREAK_IF(!_data->zipFile); @@ -606,18 +613,18 @@ unsigned char *ZipFile::getFileData(const std::string &fileName, long *pSize) 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); + buffer = (unsigned char*)malloc(fileInfo.uncompressed_size); + int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer, fileInfo.uncompressed_size); CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, "the file size is wrong"); - if (pSize) + if (size) { - *pSize = fileInfo.uncompressed_size; + *size = fileInfo.uncompressed_size; } unzCloseCurrentFile(_data->zipFile); } while (0); - return pBuffer; + return buffer; } NS_CC_END diff --git a/cocos/2d/ZipUtils.h b/cocos/2d/ZipUtils.h index 48552502b4..b635da18c3 100644 --- a/cocos/2d/ZipUtils.h +++ b/cocos/2d/ZipUtils.h @@ -64,7 +64,7 @@ namespace cocos2d * @since v0.8.1 */ - static int ccInflateMemory(unsigned char *in, long inLength, unsigned char **out); + static int inflateMemory(unsigned char *in, long inLength, unsigned char **out); /** * Inflates either zlib or gzip deflated memory. The inflated memory is @@ -76,7 +76,7 @@ namespace cocos2d * @since v1.0.0 */ - static int ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLenghtHint); + static int inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLenghtHint); /** inflates a GZip file into memory * @@ -84,7 +84,7 @@ namespace cocos2d * * @since v0.99.5 */ - static int ccInflateGZipFile(const char *filename, unsigned char **out); + static int inflateGZipFile(const char *filename, unsigned char **out); /** test a file is a GZip format file or not * @@ -92,7 +92,7 @@ namespace cocos2d * * @since v3.0 */ - static bool ccIsGZipFile(const char *filename); + static bool isGZipFile(const char *filename); /** test the buffer is GZip format or not * @@ -100,7 +100,7 @@ namespace cocos2d * * @since v3.0 */ - static bool ccIsGZipBuffer(const unsigned char *buffer, long len); + static bool isGZipBuffer(const unsigned char *buffer, long len); /** inflates a CCZ file into memory * @@ -108,7 +108,7 @@ namespace cocos2d * * @since v0.99.5 */ - static int ccInflateCCZFile(const char *filename, unsigned char **out); + static int inflateCCZFile(const char *filename, unsigned char **out); /** inflates a buffer with CCZ format into memory * @@ -116,7 +116,7 @@ namespace cocos2d * * @since v3.0 */ - static int ccInflateCCZBuffer(const unsigned char *buffer, long len, unsigned char **out); + static int inflateCCZBuffer(const unsigned char *buffer, long len, unsigned char **out); /** test a file is a CCZ format file or not * @@ -124,7 +124,7 @@ namespace cocos2d * * @since v3.0 */ - static bool ccIsCCZFile(const char *filename); + static bool isCCZFile(const char *filename); /** test the buffer is CCZ format or not * @@ -132,7 +132,7 @@ namespace cocos2d * * @since v3.0 */ - static bool ccIsCCZBuffer(const unsigned char *buffer, long len); + static bool isCCZBuffer(const unsigned char *buffer, long len); /** Sets the pvr.ccz encryption key parts separately for added * security. @@ -141,10 +141,10 @@ namespace cocos2d * 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function 4 * different times, preferably from 4 different source files, as follows * - * ZipUtils::ccSetPvrEncryptionKeyPart(0, 0xaaaaaaaa); - * ZipUtils::ccSetPvrEncryptionKeyPart(1, 0xbbbbbbbb); - * ZipUtils::ccSetPvrEncryptionKeyPart(2, 0xcccccccc); - * ZipUtils::ccSetPvrEncryptionKeyPart(3, 0xdddddddd); + * ZipUtils::setPvrEncryptionKeyPart(0, 0xaaaaaaaa); + * ZipUtils::setPvrEncryptionKeyPart(1, 0xbbbbbbbb); + * ZipUtils::setPvrEncryptionKeyPart(2, 0xcccccccc); + * ZipUtils::setPvrEncryptionKeyPart(3, 0xdddddddd); * * Splitting the key into 4 parts and calling the function * from 4 different source files increases the difficulty to @@ -152,15 +152,15 @@ namespace cocos2d * is *never* 100% secure and the key code can be cracked by * knowledgable persons. * - * IMPORTANT: Be sure to call ccSetPvrEncryptionKey or - * ccSetPvrEncryptionKeyPart with all of the key parts *before* loading + * IMPORTANT: Be sure to call setPvrEncryptionKey or + * setPvrEncryptionKeyPart with all of the key parts *before* loading * the spritesheet or decryption will fail and the spritesheet * will fail to load. * * @param index part of the key [0..3] * @param value value of the key part */ - static void ccSetPvrEncryptionKeyPart(int index, unsigned int value); + static void setPvrEncryptionKeyPart(int index, unsigned int value); /** Sets the pvr.ccz encryption key. * @@ -168,14 +168,14 @@ namespace cocos2d * 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function with * the key split into 4 parts as follows * - * ZipUtils::ccSetPvrEncryptionKey(0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd); + * ZipUtils::setPvrEncryptionKey(0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd); * * Note that using this function makes it easier to reverse engineer and * discover the complete key because the key parts are present in one * function call. * - * IMPORTANT: Be sure to call ccSetPvrEncryptionKey or - * ccSetPvrEncryptionKeyPart with all of the key parts *before* loading + * IMPORTANT: Be sure to call setPvrEncryptionKey or + * setPvrEncryptionKeyPart with all of the key parts *before* loading * the spritesheet or decryption will fail and the spritesheet * will fail to load. * @@ -184,13 +184,12 @@ namespace cocos2d * @param keyPart3 the key value part 3. * @param keyPart4 the key value part 4. */ - static void ccSetPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4); + static void setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4); private: - static int ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long *outLength, - long outLenghtHint); - static inline void ccDecodeEncodedPvr (unsigned int *data, long len); - static inline unsigned int ccChecksumPvr(const unsigned int *data, long len); + static int inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long *outLength, long outLenghtHint); + static inline void decodeEncodedPvr (unsigned int *data, long len); + static inline unsigned int checksumPvr(const unsigned int *data, long len); static unsigned int s_uEncryptedPvrKeyParts[4]; static unsigned int s_uEncryptionKey[1024]; @@ -249,7 +248,7 @@ namespace cocos2d * @param fileName File name * @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0. * @return Upon success, a pointer to the data is returned, otherwise NULL. - * @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned. + * @warning Recall: you are responsible for calling free() on any Non-NULL pointer returned. * * @since v2.0.5 */ diff --git a/cocos/2d/base64.cpp b/cocos/2d/base64.cpp index 131b0d81f7..e9e14ca7bb 100644 --- a/cocos/2d/base64.cpp +++ b/cocos/2d/base64.cpp @@ -141,7 +141,7 @@ int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char * unsigned int outLength = 0; //should be enough to store 6-bit buffers in 8-bit buffers - *out = new unsigned char[(size_t)(inLength * 3.0f / 4.0f + 1)]; + *out = (unsigned char*)malloc(inLength * 3.0f / 4.0f + 1); if( *out ) { int ret = _base64Decode(in, inLength, *out, &outLength); @@ -150,7 +150,7 @@ int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char * #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) printf("Base64Utils: error decoding"); #endif - delete [] *out; + free(*out); *out = NULL; outLength = 0; } @@ -162,7 +162,7 @@ int base64Encode(const unsigned char *in, unsigned int inLength, char **out) { unsigned int outLength = inLength * 4 / 3 + (inLength % 3 > 0 ? 4 : 0); //should be enough to store 8-bit buffers in 6-bit buffers - *out = new char[outLength+1]; + *out = (char*)malloc(outLength+1); if( *out ) { _base64Encode(in, inLength, *out); } diff --git a/cocos/2d/base64.h b/cocos/2d/base64.h index c00a78c27a..fd95485d9e 100644 --- a/cocos/2d/base64.h +++ b/cocos/2d/base64.h @@ -37,7 +37,7 @@ namespace cocos2d { /** * Decodes a 64base encoded memory. The decoded memory is - * expected to be freed by the caller. + * expected to be freed by the caller by calling `free()` * * @returns the length of the out buffer * @@ -47,7 +47,7 @@ int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char * /** * Encodes bytes into a 64base encoded memory with terminating '\0' character. - * The encoded memory is expected to be freed by the caller. + * The encoded memory is expected to be freed by the caller by calling `free()` * * @returns the length of the out buffer * diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index 6760432cad..ddd9c25dfe 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -503,7 +503,7 @@ unsigned char* FileUtils::getFileData(const char* filename, const char* mode, lo fseek(fp,0,SEEK_END); *size = ftell(fp); fseek(fp,0,SEEK_SET); - buffer = new unsigned char[*size]; + buffer = (unsigned char*)malloc(*size); *size = fread(buffer,sizeof(unsigned char), *size,fp); fclose(fp); } while (0); @@ -543,7 +543,7 @@ unsigned char* FileUtils::getFileDataFromZip(const char* zipFilePath, const char nRet = unzOpenCurrentFile(pFile); CC_BREAK_IF(UNZ_OK != nRet); - buffer = new unsigned char[FileInfo.uncompressed_size]; + buffer = (unsigned char*)malloc(FileInfo.uncompressed_size); int CC_UNUSED nSize = unzReadCurrentFile(pFile, buffer, FileInfo.uncompressed_size); CCASSERT(nSize == 0 || nSize == (int)FileInfo.uncompressed_size, "the file size is wrong"); diff --git a/cocos/2d/platform/CCFileUtils.h b/cocos/2d/platform/CCFileUtils.h index 855f016fe5..1827ba53c7 100644 --- a/cocos/2d/platform/CCFileUtils.h +++ b/cocos/2d/platform/CCFileUtils.h @@ -86,7 +86,7 @@ public: * @param[in] pszMode The read mode of the file. * @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0. * @return Upon success, a pointer to the data is returned, otherwise NULL. - * @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned. + * @warning Recall: you are responsible for calling free() on any Non-NULL pointer returned. */ virtual unsigned char* getFileData(const char* filename, const char* mode, long *size); @@ -96,7 +96,7 @@ public: * @param[in] filename The resource file name which contains the relative path of the zip file. * @param[out] size If the file read operation succeeds, it will be the data size, otherwise 0. * @return Upon success, a pointer to the data is returned, otherwise NULL. - * @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned. + * @warning Recall: you are responsible for calling free() on any Non-NULL pointer returned. */ virtual unsigned char* getFileDataFromZip(const char* zipFilePath, const char* filename, long *size); diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index f2fc7a9a08..c2224b5bda 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -460,13 +460,13 @@ bool Image::initWithImageData(const unsigned char * data, long dataLen) int unpackedLen = 0; //detecgt and unzip the compress file - if (ZipUtils::ccIsCCZBuffer(data, dataLen)) + if (ZipUtils::isCCZBuffer(data, dataLen)) { - unpackedLen = ZipUtils::ccInflateCCZBuffer(data, dataLen, &unpackedData); + unpackedLen = ZipUtils::inflateCCZBuffer(data, dataLen, &unpackedData); } - else if (ZipUtils::ccIsGZipBuffer(data, dataLen)) + else if (ZipUtils::isGZipBuffer(data, dataLen)) { - unpackedLen = ZipUtils::ccInflateMemory(const_cast(data), dataLen, &unpackedData); + unpackedLen = ZipUtils::inflateMemory(const_cast(data), dataLen, &unpackedData); } else { diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp index 04201557c1..056a088826 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/2d/platform/CCSAXParser.cpp @@ -121,7 +121,7 @@ bool SAXParser::parse(const char *pszFile) { ret = parse(pBuffer, size); } - CC_SAFE_DELETE_ARRAY(pBuffer); + free(pBuffer); return ret; } diff --git a/cocos/base/CCString.cpp b/cocos/base/CCString.cpp index 67193eb52c..046e8f2e7a 100644 --- a/cocos/base/CCString.cpp +++ b/cocos/base/CCString.cpp @@ -260,7 +260,7 @@ String* String::createWithContentsOfFile(const char* filename) String* ret = NULL; data = FileUtils::getInstance()->getFileData(filename, "rb", &size); ret = String::createWithData(data, size); - CC_SAFE_DELETE_ARRAY(data); + free(data); return ret; } diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index 2fec8df55a..f3b24f6b6f 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -248,7 +248,7 @@ Node* CCBReader::readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, unsigned char * pBytes = FileUtils::getInstance()->getFileData(strPath.c_str(), "rb", &size); Data *data = new Data(pBytes, size); - CC_SAFE_DELETE_ARRAY(pBytes); + free(pBytes); Node *ret = this->readNodeGraphFromData(data, pOwner, parentSize); diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index 7eba8e9340..de28a1a3e5 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -926,7 +926,7 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader reader->getAnimationManager()->setRootContainerSize(pParent->getContentSize()); Data *data = new Data(pBytes, size); - CC_SAFE_DELETE_ARRAY(pBytes); + free(pBytes); data->retain(); reader->_data = data; diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 17f10067ed..41091ce765 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -297,7 +297,7 @@ void DataReaderHelper::addDataFromFile(const char *filePath) long size; std::string fullPath = CCFileUtils::getInstance()->fullPathForFilename(filePath); - const char *pFileContent = (char *)CCFileUtils::getInstance()->getFileData(fullPath.c_str() , "r", &size); + char *pFileContent = (char *)CCFileUtils::getInstance()->getFileData(fullPath.c_str() , "r", &size); DataInfo dataInfo; dataInfo.filename = filePathStr; @@ -312,6 +312,7 @@ void DataReaderHelper::addDataFromFile(const char *filePath) { DataReaderHelper::addDataFromJsonCache(pFileContent, &dataInfo); } + free(pFileContent); } void DataReaderHelper::addDataFromFileAsync(const char *imagePath, const char *plistPath, const char *filePath, Object *target, SEL_SCHEDULE selector) @@ -395,6 +396,8 @@ void DataReaderHelper::addDataFromFileAsync(const char *imagePath, const char *p std::string fullPath = CCFileUtils::getInstance()->fullPathForFilename(filePath); long size; + + // XXX fileContent is being leaked data->fileContent = (char *)CCFileUtils::getInstance()->getFileData(fullPath.c_str() , "r", &size); if (str.compare(".xml") == 0) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 3ad788b563..69bc0cf803 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -222,14 +222,14 @@ const cocos2d::Size CCSGUIReader::getFileDesignSize(const char* fileName) const UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) { m_bOlderVersion = false; - const char *des = NULL; + char *des = NULL; std::string jsonpath; JsonDictionary *jsonDict = NULL; jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); long size = 0; - des = (char*)(FileUtils::getInstance()->getFileData(jsonpath.c_str(),"r" , &size)); - if(NULL == des || strcmp(des, "") == 0) + des = (char*)FileUtils::getInstance()->getFileData(jsonpath.c_str(),"r" , &size); + if(des == NULL || strcmp(des, "") == 0) { printf("read json file[%s] error!\n", fileName); return NULL; @@ -288,7 +288,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) CC_SAFE_DELETE(widgetTree); CC_SAFE_DELETE(actions); CC_SAFE_DELETE(jsonDict); - CC_SAFE_DELETE_ARRAY(des); + free(des); return widget; } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 25c84fd773..ebe973e7f9 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -48,18 +48,19 @@ namespace cocostudio { cocos2d::Node* SceneReader::createNodeWithSceneFile(const char* pszFileName) { long size = 0; - const char* pData = 0; + char* pData = 0; cocos2d::Node *pNode = NULL; do { - CC_BREAK_IF(pszFileName == NULL); - pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size)); - CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0); - JsonDictionary *jsonDict = new JsonDictionary(); - jsonDict->initWithDescription(pData); - pNode = createObject(jsonDict,NULL); - CC_SAFE_DELETE(jsonDict); + CC_BREAK_IF(pszFileName == NULL); + pData = (char*)cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size); + CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0); + JsonDictionary *jsonDict = new JsonDictionary(); + jsonDict->initWithDescription(pData); + pNode = createObject(jsonDict,NULL); + CC_SAFE_DELETE(jsonDict); + free(pData); } while (0); - + return pNode; } @@ -214,10 +215,10 @@ namespace cocostudio { file_path = reDir.substr(0, pos+1); } long size = 0; - const char *des = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size)); + char *des = (char*)cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size); JsonDictionary *jsonDict = new JsonDictionary(); jsonDict->initWithDescription(des); - if(NULL == des || strcmp(des, "") == 0) + if(des == NULL || strcmp(des, "") == 0) { CCLOG("read json file[%s] error!\n", pPath.c_str()); } @@ -261,7 +262,7 @@ namespace cocostudio { CC_SAFE_DELETE(jsonDict); CC_SAFE_DELETE(subData); - CC_SAFE_DELETE_ARRAY(des); + free(des); } else if(comName != NULL && strcmp(comName, "CCComAudio") == 0) { @@ -284,12 +285,12 @@ namespace cocostudio { { pAttribute = ComAttribute::create(); long size = 0; - const char* pData = 0; - pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(), "r", &size)); + char* pData = (char*)cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(), "r", &size); if(pData != NULL && strcmp(pData, "") != 0) { pAttribute->getDict()->initWithDescription(pData); } + free(pData); } else { diff --git a/cocos/editor-support/spine/Atlas.cpp b/cocos/editor-support/spine/Atlas.cpp index 1a2293bacb..e3d6d799b4 100644 --- a/cocos/editor-support/spine/Atlas.cpp +++ b/cocos/editor-support/spine/Atlas.cpp @@ -303,7 +303,7 @@ Atlas* Atlas_readAtlasFile (const char* path) { data = _Util_readFile(path, &length); if (data) atlas = Atlas_readAtlas(data, length, dir); - delete [] data; + FREE(data); FREE(dir); return atlas; } diff --git a/cocos/editor-support/spine/SkeletonJson.cpp b/cocos/editor-support/spine/SkeletonJson.cpp index 6bfeeb24e7..6c1e039b10 100644 --- a/cocos/editor-support/spine/SkeletonJson.cpp +++ b/cocos/editor-support/spine/SkeletonJson.cpp @@ -240,7 +240,7 @@ SkeletonData* SkeletonJson_readSkeletonDataFile (SkeletonJson* self, const char* return 0; } skeletonData = SkeletonJson_readSkeletonData(self, json); - delete [] json; + FREE(json); return skeletonData; } diff --git a/cocos/scripting/javascript/bindings/ScriptingCore.cpp b/cocos/scripting/javascript/bindings/ScriptingCore.cpp index 86ddb4bd2e..0f7fca11f4 100644 --- a/cocos/scripting/javascript/bindings/ScriptingCore.cpp +++ b/cocos/scripting/javascript/bindings/ScriptingCore.cpp @@ -536,7 +536,7 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c if (data) { script = JS_DecodeScript(cx, data, length, NULL, NULL); - CC_SAFE_DELETE_ARRAY(data); + free(data); } // b) no jsc file, check js file diff --git a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index bbc36bbe5b..024733dad8 100644 --- a/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -36a6cc6177c059364c6ccc3b1151b6475219b396 \ No newline at end of file +5bc5339bd77792b57c97cebbe7dfd3b634038e38 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp index 69967031a8..fa1f7cb01c 100644 --- a/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp +++ b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp @@ -56,7 +56,7 @@ extern "C" luaL_error(L, "error loading module %s from file %s :\n\t%s", lua_tostring(L, 1), filename.c_str(), lua_tostring(L, -1)); } - delete []codeBuffer; + free(codeBuffer); } else { diff --git a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp index 5aea719250..e7f3d6ddf6 100644 --- a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp @@ -46,10 +46,10 @@ void TextureAtlasEncryptionDemo::onEnter() // 1) Set the encryption keys or step 2 will fail // In this case the encryption key 0xaaaaaaaabbbbbbbbccccccccdddddddd is // split into four parts. See the header docs for more information. - ZipUtils::ccSetPvrEncryptionKeyPart(0, 0xaaaaaaaa); - ZipUtils::ccSetPvrEncryptionKeyPart(1, 0xbbbbbbbb); - ZipUtils::ccSetPvrEncryptionKeyPart(2, 0xcccccccc); - ZipUtils::ccSetPvrEncryptionKeyPart(3, 0xdddddddd); + ZipUtils::setPvrEncryptionKeyPart(0, 0xaaaaaaaa); + ZipUtils::setPvrEncryptionKeyPart(1, 0xbbbbbbbb); + ZipUtils::setPvrEncryptionKeyPart(2, 0xcccccccc); + ZipUtils::setPvrEncryptionKeyPart(3, 0xdddddddd); // Alternatively, you can call the function that accepts the key in a single // function call. From 46ef7a7fbc5e0bf8fc8f0ed23bf2465e78612b94 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 14 Nov 2013 13:35:17 +0800 Subject: [PATCH 02/11] Fix bug: deprecate old interface --- cocos/2d/ZipUtils.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cocos/2d/ZipUtils.h b/cocos/2d/ZipUtils.h index b635da18c3..c322f8300a 100644 --- a/cocos/2d/ZipUtils.h +++ b/cocos/2d/ZipUtils.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include "CCPlatformConfig.h" #include "CCPlatformDefine.h" +#include "CCPlatformMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCFileUtilsAndroid.h" @@ -64,6 +65,7 @@ namespace cocos2d * @since v0.8.1 */ + CC_DEPRECATED_ATTRIBUTE static int ccInflateMemory(unsigned char *in, long inLength, unsigned char **out) { return inflateMemory(in, inLength, out); } static int inflateMemory(unsigned char *in, long inLength, unsigned char **out); /** @@ -76,7 +78,8 @@ namespace cocos2d * @since v1.0.0 */ - static int inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLenghtHint); + CC_DEPRECATED_ATTRIBUTE static int ccInflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLengthHint) { return inflateMemoryWithHint(in, inLength, out, outLengthHint); } + static int inflateMemoryWithHint(unsigned char *in, long inLength, unsigned char **out, long outLengthHint); /** inflates a GZip file into memory * @@ -84,6 +87,7 @@ namespace cocos2d * * @since v0.99.5 */ + CC_DEPRECATED_ATTRIBUTE static int ccInflateGZipFile(const char *filename, unsigned char **out) { return inflateGZipFile(filename, out); } static int inflateGZipFile(const char *filename, unsigned char **out); /** test a file is a GZip format file or not @@ -92,6 +96,7 @@ namespace cocos2d * * @since v3.0 */ + CC_DEPRECATED_ATTRIBUTE static bool ccIsGZipFile(const char *filename) { return isGZipFile(filename); } static bool isGZipFile(const char *filename); /** test the buffer is GZip format or not @@ -100,6 +105,7 @@ namespace cocos2d * * @since v3.0 */ + CC_DEPRECATED_ATTRIBUTE static bool ccIsGZipBuffer(const unsigned char *buffer, long len) { return isGZipBuffer(buffer, len); } static bool isGZipBuffer(const unsigned char *buffer, long len); /** inflates a CCZ file into memory @@ -108,6 +114,7 @@ namespace cocos2d * * @since v0.99.5 */ + CC_DEPRECATED_ATTRIBUTE static int ccInflateCCZFile(const char *filename, unsigned char **out) { return inflateCCZFile(filename, out); } static int inflateCCZFile(const char *filename, unsigned char **out); /** inflates a buffer with CCZ format into memory @@ -116,6 +123,7 @@ namespace cocos2d * * @since v3.0 */ + CC_DEPRECATED_ATTRIBUTE static int ccInflateCCZBuffer(const unsigned char *buffer, long len, unsigned char **out) { return inflateCCZBuffer(buffer, len, out); } static int inflateCCZBuffer(const unsigned char *buffer, long len, unsigned char **out); /** test a file is a CCZ format file or not @@ -124,6 +132,7 @@ namespace cocos2d * * @since v3.0 */ + CC_DEPRECATED_ATTRIBUTE static bool ccIsCCZFile(const char *filename) { return isCCZFile(filename); } static bool isCCZFile(const char *filename); /** test the buffer is CCZ format or not @@ -132,6 +141,7 @@ namespace cocos2d * * @since v3.0 */ + CC_DEPRECATED_ATTRIBUTE static bool ccIsCCZBuffer(const unsigned char *buffer, long len) { return isCCZBuffer(buffer, len); } static bool isCCZBuffer(const unsigned char *buffer, long len); /** Sets the pvr.ccz encryption key parts separately for added @@ -160,6 +170,7 @@ namespace cocos2d * @param index part of the key [0..3] * @param value value of the key part */ + CC_DEPRECATED_ATTRIBUTE static void ccSetPvrEncryptionKeyPart(int index, unsigned int value) { setPvrEncryptionKeyPart(index, value); } static void setPvrEncryptionKeyPart(int index, unsigned int value); /** Sets the pvr.ccz encryption key. @@ -184,6 +195,7 @@ namespace cocos2d * @param keyPart3 the key value part 3. * @param keyPart4 the key value part 4. */ + CC_DEPRECATED_ATTRIBUTE static void ccSetPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) { setPvrEncryptionKey(keyPart1, keyPart2, keyPart3, keyPart4); } static void setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4); private: From 03c8c8f4fcf1891463e10a9f8bcd894b801415a0 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 14 Nov 2013 14:48:16 +0800 Subject: [PATCH 03/11] Fix bug: use free() in imageCommon_cpp.h --- cocos/2d/platform/CCImageCommon_cpp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index cc0d672841..33906b16f8 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -424,7 +424,7 @@ bool Image::initWithImageFile(const char * strPath) bRet = initWithImageData(buffer, bufferLen); } - CC_SAFE_DELETE_ARRAY(buffer); + free(buffer); #endif // EMSCRIPTEN return bRet; @@ -444,7 +444,7 @@ bool Image::initWithImageFileThreadSafe(const char *fullpath) { ret = initWithImageData(buffer, dataLen); } - CC_SAFE_DELETE_ARRAY(buffer); + free(buffer); return ret; } From 489463246725e6720aad27a32261a57e7c232f5b Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Thu, 14 Nov 2013 17:14:35 +0800 Subject: [PATCH 04/11] Fix bug: add android, fix android can not compile --- cocos/2d/CCUserDefaultAndroid.cpp | 2 +- cocos/2d/platform/android/CCFileUtilsAndroid.cpp | 4 ++-- cocos/2d/platform/win32/CCFileUtilsWin32.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp index 510c83c14c..8f6895f572 100644 --- a/cocos/2d/CCUserDefaultAndroid.cpp +++ b/cocos/2d/CCUserDefaultAndroid.cpp @@ -75,7 +75,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc tinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument(); *doc = xmlDoc; long size; - const char* pXmlBuffer = (const char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &size); + char* pXmlBuffer = (char*)FileUtils::getInstance()->getFileData(UserDefault::getInstance()->getXMLFilePath().c_str(), "rb", &size); //const char* pXmlBuffer = (const char*)data.getBuffer(); if(NULL == pXmlBuffer) { diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp index c447b5db32..839966a122 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.cpp +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.cpp @@ -191,7 +191,7 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* filename, const char* off_t fileSize = AAsset_getLength(asset); - data = new unsigned char[fileSize]; + data = (unsigned char*) malloc(fileSize); int bytesread = AAsset_read(asset, (void*)data, fileSize); if (size) @@ -214,7 +214,7 @@ unsigned char* FileUtilsAndroid::doGetFileData(const char* filename, const char* fseek(fp,0,SEEK_END); fileSize = ftell(fp); fseek(fp,0,SEEK_SET); - data = new unsigned char[fileSize]; + data = (unsigned char*) malloc(fileSize); fileSize = fread(data,sizeof(unsigned char), fileSize,fp); fclose(fp); diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp index 216797bd9e..a417f34fa1 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.cpp @@ -139,7 +139,7 @@ unsigned char* FileUtilsWin32::getFileData(const char* filename, const char* mod *size = ::GetFileSize(fileHandle, NULL); - pBuffer = new unsigned char[*size]; + pBuffer = (unsigned char*) malloc(*size); DWORD sizeRead = 0; BOOL successed = FALSE; successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, NULL); @@ -147,7 +147,7 @@ unsigned char* FileUtilsWin32::getFileData(const char* filename, const char* mod if (!successed) { - CC_SAFE_DELETE_ARRAY(pBuffer); + free(pBuffer); } } while (0); From e14295c404b0ec66a3732f622347472e7b1ebc4f Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Fri, 15 Nov 2013 09:45:03 +0800 Subject: [PATCH 05/11] Merge branch 'develop' into free_instead_of_delete --- .../cocostudio/CCSGUIReader.cpp | 4 +- .../cocostudio/CCSSceneReader.cpp | 439 +++++++++--------- 2 files changed, 223 insertions(+), 220 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 7179c41172..cbfe527b68 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -122,7 +122,7 @@ const cocos2d::Size GUIReader::getFileDesignSize(const char* fileName) const UIWidget* GUIReader::widgetFromJsonFile(const char *fileName) { DictionaryHelper* dicHelper = DICTOOL; - const char *des = nullptr; + char *des = nullptr; std::string jsonpath; JsonDictionary *jsonDict = nullptr; jsonpath = CCFileUtils::getInstance()->fullPathForFilename(fileName); @@ -164,7 +164,7 @@ UIWidget* GUIReader::widgetFromJsonFile(const char *fileName) CC_SAFE_DELETE(pReader); CC_SAFE_DELETE(jsonDict); - CC_SAFE_DELETE_ARRAY(des); + free(des); return widget; } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index 452bfca276..385c147e27 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -30,40 +30,42 @@ using namespace gui; namespace cocostudio { - SceneReader* SceneReader::s_sharedReader = nullptr; + SceneReader* SceneReader::s_sharedReader = nullptr; SceneReader::SceneReader() { - } + } SceneReader::~SceneReader() { } - const char* SceneReader::sceneReaderVersion() - { - return "1.0.0.0"; - } + const char* SceneReader::sceneReaderVersion() + { + return "1.0.0.0"; + } cocos2d::Node* SceneReader::createNodeWithSceneFile(const char* pszFileName) { long size = 0; - const char* pData = 0; - cocos2d::Node *pNode = nullptr; - do { - CC_BREAK_IF(pszFileName == nullptr); - pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size)); - CC_BREAK_IF(pData == nullptr || strcmp(pData, "") == 0); - JsonDictionary *jsonDict = new JsonDictionary(); - jsonDict->initWithDescription(pData); - pNode = createObject(jsonDict,nullptr); - CC_SAFE_DELETE(jsonDict); + char* pData = 0; + cocos2d::Node *pNode = nullptr; + do + { + CC_BREAK_IF(pszFileName == nullptr); + pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size)); + CC_BREAK_IF(pData == nullptr || strcmp(pData, "") == 0); + JsonDictionary *jsonDict = new JsonDictionary(); + jsonDict->initWithDescription(pData); + pNode = createObject(jsonDict,nullptr); + CC_SAFE_DELETE(jsonDict); + free(pData); } while (0); return pNode; - } + } - Node* SceneReader::createObject(JsonDictionary * inputFiles, Node* parenet) + Node* SceneReader::createObject(JsonDictionary * inputFiles, Node* parenet) { const char *className = inputFiles->getItemStringValue("classname"); if(strcmp(className, "CCNode") == 0) @@ -86,63 +88,63 @@ namespace cocostudio { { JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); if (!subDict) - { - CC_SAFE_DELETE(subDict); - break; - } - const char *comName = subDict->getItemStringValue("classname"); - const char *pComName = subDict->getItemStringValue("name"); - - JsonDictionary *fileData = subDict->getSubDictionary("fileData"); - std::string pPath; - std::string pPlistFile; - int nResType = 0; - if (fileData != nullptr) { - const char *file = fileData->getItemStringValue("path"); - nResType = fileData->getItemIntValue("resourceType", -1); - const char *plistFile = fileData->getItemStringValue("plistFile"); - if (file != nullptr) - { - pPath.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); - } + CC_SAFE_DELETE(subDict); + break; + } + const char *comName = subDict->getItemStringValue("classname"); + const char *pComName = subDict->getItemStringValue("name"); + + JsonDictionary *fileData = subDict->getSubDictionary("fileData"); + std::string pPath; + std::string pPlistFile; + int nResType = 0; + if (fileData != nullptr) + { + const char *file = fileData->getItemStringValue("path"); + nResType = fileData->getItemIntValue("resourceType", -1); + const char *plistFile = fileData->getItemStringValue("plistFile"); + if (file != nullptr) + { + pPath.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(file)); + } - if (plistFile != nullptr) - { - pPlistFile.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(plistFile)); - } - CC_SAFE_DELETE(fileData); + if (plistFile != nullptr) + { + pPlistFile.append(cocos2d::FileUtils::getInstance()->fullPathForFilename(plistFile)); + } + CC_SAFE_DELETE(fileData); } if (comName != nullptr && strcmp(comName, "CCSprite") == 0) { - cocos2d::Sprite *pSprite = nullptr; + cocos2d::Sprite *pSprite = nullptr; - if (nResType == 0) - { - if (pPath.find(".png") == pPath.npos) - { - continue; - } - pSprite = Sprite::create(pPath.c_str()); - } - else if (nResType == 1) - { - std::string pngFile = pPlistFile; - std::string::size_type pos = pngFile.find(".plist"); - if (pos == pPath.npos) - { - continue; - } - pngFile.replace(pos, pngFile.length(), ".png"); - CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); - pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); - } - else - { - continue; - } - + if (nResType == 0) + { + if (pPath.find(".png") == pPath.npos) + { + continue; + } + pSprite = Sprite::create(pPath.c_str()); + } + else if (nResType == 1) + { + std::string pngFile = pPlistFile; + std::string::size_type pos = pngFile.find(".plist"); + if (pos == pPath.npos) + { + continue; + } + pngFile.replace(pos, pngFile.length(), ".png"); + CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(pPlistFile.c_str(), pngFile.c_str()); + pSprite = Sprite::createWithSpriteFrameName(pPath.c_str()); + } + else + { + continue; + } + ComRender *pRender = ComRender::create(pSprite, "CCSprite"); if (pComName != nullptr) { @@ -153,19 +155,19 @@ namespace cocostudio { } else if(comName != nullptr && strcmp(comName, "CCTMXTiledMap") == 0) { - cocos2d::TMXTiledMap *pTmx = nullptr; - if (nResType == 0) - { - if (pPath.find(".tmx") == pPath.npos) - { - continue; - } - pTmx = TMXTiledMap::create(pPath.c_str()); - } - else - { - continue; - } + cocos2d::TMXTiledMap *pTmx = nullptr; + if (nResType == 0) + { + if (pPath.find(".tmx") == pPath.npos) + { + continue; + } + pTmx = TMXTiledMap::create(pPath.c_str()); + } + else + { + continue; + } ComRender *pRender = ComRender::create(pTmx, "CCTMXTiledMap"); if (pComName != nullptr) @@ -182,17 +184,17 @@ namespace cocostudio { continue; } - cocos2d::ParticleSystemQuad *pParticle = nullptr; - if (nResType == 0) - { - pParticle = ParticleSystemQuad::create(pPath.c_str()); - } - else - { - CCLOG("unknown resourcetype on CCParticleSystemQuad!"); - } + cocos2d::ParticleSystemQuad *pParticle = nullptr; + if (nResType == 0) + { + pParticle = ParticleSystemQuad::create(pPath.c_str()); + } + else + { + CCLOG("unknown resourcetype on CCParticleSystemQuad!"); + } - pParticle->setPosition(0, 0); + pParticle->setPosition(0, 0); ComRender *pRender = ComRender::create(pParticle, "CCParticleSystemQuad"); if (pComName != nullptr) { @@ -202,133 +204,134 @@ namespace cocostudio { } else if(comName != nullptr && strcmp(comName, "CCArmature") == 0) { - if (nResType != 0) - { - continue; - } - std::string reDir = pPath; - std::string file_path = ""; - size_t pos = reDir.find_last_of('/'); - if (pos != std::string::npos) - { - file_path = reDir.substr(0, pos+1); - } - long size = 0; - const char *des = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size)); - JsonDictionary *jsonDict = new JsonDictionary(); - jsonDict->initWithDescription(des); - if(nullptr == des || strcmp(des, "") == 0) - { - CCLOG("read json file[%s] error!\n", pPath.c_str()); - } + if (nResType != 0) + { + continue; + } + std::string reDir = pPath; + std::string file_path = ""; + size_t pos = reDir.find_last_of('/'); + if (pos != std::string::npos) + { + file_path = reDir.substr(0, pos+1); + } + long size = 0; + char *des = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size)); + JsonDictionary *jsonDict = new JsonDictionary(); + jsonDict->initWithDescription(des); + if(nullptr == des || strcmp(des, "") == 0) + { + CCLOG("read json file[%s] error!\n", pPath.c_str()); + } - int childrenCount = DICTOOL->getArrayCount_json(jsonDict, "armature_data"); - JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); - const char *name = DICTOOL->getStringValue_json(subData, "name"); + int childrenCount = DICTOOL->getArrayCount_json(jsonDict, "armature_data"); + JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); + const char *name = DICTOOL->getStringValue_json(subData, "name"); - childrenCount = DICTOOL->getArrayCount_json(jsonDict, "config_file_path"); - for (long j = 0; j < childrenCount; ++j) - { - const char* plist = DICTOOL->getStringValueFromArray_json(jsonDict, "config_file_path", j); - std::string plistpath; - plistpath += file_path; - plistpath.append(plist); - cocos2d::Dictionary *root = Dictionary::createWithContentsOfFile(plistpath.c_str()); - Dictionary* metadata = DICTOOL->getSubDictionary(root, "metadata"); - const char* textureFileName = DICTOOL->getStringValue(metadata, "textureFileName"); + childrenCount = DICTOOL->getArrayCount_json(jsonDict, "config_file_path"); + for (long j = 0; j < childrenCount; ++j) + { + const char* plist = DICTOOL->getStringValueFromArray_json(jsonDict, "config_file_path", j); + std::string plistpath; + plistpath += file_path; + plistpath.append(plist); + cocos2d::Dictionary *root = Dictionary::createWithContentsOfFile(plistpath.c_str()); + Dictionary* metadata = DICTOOL->getSubDictionary(root, "metadata"); + const char* textureFileName = DICTOOL->getStringValue(metadata, "textureFileName"); - std::string textupath; - textupath += file_path; - textupath.append(textureFileName); + std::string textupath; + textupath += file_path; + textupath.append(textureFileName); - ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); + ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); - } + } - Armature *pAr = Armature::create(name); - ComRender *pRender = ComRender::create(pAr, "CCArmature"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); + Armature *pAr = Armature::create(name); + ComRender *pRender = ComRender::create(pAr, "CCArmature"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); - const char *actionName = subDict->getItemStringValue("selectedactionname"); - if (actionName != nullptr && pAr->getAnimation() != nullptr) - { - pAr->getAnimation()->play(actionName); - } + const char *actionName = subDict->getItemStringValue("selectedactionname"); + if (actionName != nullptr && pAr->getAnimation() != nullptr) + { + pAr->getAnimation()->play(actionName); + } - CC_SAFE_DELETE(jsonDict); - CC_SAFE_DELETE(subData); - CC_SAFE_DELETE_ARRAY(des); + CC_SAFE_DELETE(jsonDict); + CC_SAFE_DELETE(subData); + free(des); } else if(comName != nullptr && strcmp(comName, "CCComAudio") == 0) { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } + ComAudio *pAudio = nullptr; + if (nResType == 0) + { + pAudio = ComAudio::create(); + } + else + { + continue; + } pAudio->preloadEffect(pPath.c_str()); gb->addComponent(pAudio); } else if(comName != nullptr && strcmp(comName, "CCComAttribute") == 0) { ComAttribute *pAttribute = nullptr; - if (nResType == 0) - { - pAttribute = ComAttribute::create(); - long size = 0; - const char* pData = 0; - pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(), "r", &size)); - if(pData != nullptr && strcmp(pData, "") != 0) - { - pAttribute->getDict()->initWithDescription(pData); - } - } - else - { - CCLOG("unknown resourcetype on CCComAttribute!"); - continue; - } + if (nResType == 0) + { + pAttribute = ComAttribute::create(); + long size = 0; + char* pData = 0; + pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(), "r", &size)); + if(pData != nullptr && strcmp(pData, "") != 0) + { + pAttribute->getDict()->initWithDescription(pData); + } + free(pData); + } + else + { + CCLOG("unknown resourcetype on CCComAttribute!"); + continue; + } gb->addComponent(pAttribute); } else if (comName != nullptr && strcmp(comName, "CCBackgroundAudio") == 0) { - ComAudio *pAudio = nullptr; - if (nResType == 0) - { - pAudio = ComAudio::create(); - } - else - { - continue; - } + ComAudio *pAudio = nullptr; + if (nResType == 0) + { + pAudio = ComAudio::create(); + } + else + { + continue; + } pAudio->preloadBackgroundMusic(pPath.c_str()); - pAudio->setFile(pPath.c_str()); - const bool bLoop = (subDict->getItemIntValue("loop", 0) != 0); - pAudio->setLoop(bLoop); + pAudio->setFile(pPath.c_str()); + const bool bLoop = (subDict->getItemIntValue("loop", 0) != 0); + pAudio->setLoop(bLoop); gb->addComponent(pAudio); - pAudio->playBackgroundMusic(pPath.c_str(), bLoop); + pAudio->playBackgroundMusic(pPath.c_str(), bLoop); } - else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) - { + else if(comName != nullptr && strcmp(comName, "GUIComponent") == 0) + { gui::UILayer *pLayer = gui::UILayer::create(); - pLayer->scheduleUpdate(); - UIWidget* widget= GUIReader::shareReader()->widgetFromJsonFile(pPath.c_str()); - pLayer->addWidget(widget); - ComRender *pRender = ComRender::create(pLayer, "GUIComponent"); - if (pComName != nullptr) - { - pRender->setName(pComName); - } - gb->addComponent(pRender); - } + pLayer->scheduleUpdate(); + UIWidget* widget= GUIReader::shareReader()->widgetFromJsonFile(pPath.c_str()); + pLayer->addWidget(widget); + ComRender *pRender = ComRender::create(pLayer, "GUIComponent"); + if (pComName != nullptr) + { + pRender->setName(pComName); + } + gb->addComponent(pRender); + } CC_SAFE_DELETE(subDict); } @@ -353,41 +356,41 @@ namespace cocostudio { void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, JsonDictionary* dict) { - int x = dict->getItemIntValue("x", 0); - int y = dict->getItemIntValue("y", 0); - node->setPosition(Point(x, y)); - - const bool bVisible = (dict->getItemIntValue("visible", 1) != 0); - node->setVisible(bVisible); - - int nTag = dict->getItemIntValue("objecttag", -1); + int x = dict->getItemIntValue("x", 0); + int y = dict->getItemIntValue("y", 0); + node->setPosition(Point(x, y)); + + const bool bVisible = (dict->getItemIntValue("visible", 1) != 0); + node->setVisible(bVisible); + + int nTag = dict->getItemIntValue("objecttag", -1); node->setTag(nTag); - - int nZorder = dict->getItemIntValue("zorder", 0); - node->setZOrder(nZorder); - - float fScaleX = dict->getItemFloatValue("scalex", 1.0); - float fScaleY = dict->getItemFloatValue("scaley", 1.0); + + int nZorder = dict->getItemIntValue("zorder", 0); + node->setZOrder(nZorder); + + float fScaleX = dict->getItemFloatValue("scalex", 1.0); + float fScaleY = dict->getItemFloatValue("scaley", 1.0); node->setScaleX(fScaleX); node->setScaleY(fScaleY); - float fRotationZ = dict->getItemIntValue("rotation", 0); + float fRotationZ = dict->getItemIntValue("rotation", 0); node->setRotation(fRotationZ); } - SceneReader* SceneReader::getInstance() - { - if (s_sharedReader == nullptr) - { - s_sharedReader = new SceneReader(); - } - return s_sharedReader; - } + SceneReader* SceneReader::getInstance() + { + if (s_sharedReader == nullptr) + { + s_sharedReader = new SceneReader(); + } + return s_sharedReader; + } void SceneReader::purgeSceneReader() { - CC_SAFE_DELETE(s_sharedReader); - DictionaryHelper::shareHelper()->purgeDictionaryHelper(); + CC_SAFE_DELETE(s_sharedReader); + DictionaryHelper::shareHelper()->purgeDictionaryHelper(); } } From 1730fcddcb98f3ee80682e88590a70b0b95b4cdf Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 15 Nov 2013 13:29:39 +0800 Subject: [PATCH 06/11] Modify layout --- cocos/gui/UILayout.cpp | 43 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 3cbd5fef8a..be152ec817 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -853,26 +853,61 @@ void UILayout::doLayout() break; case RELATIVE_LOCATION_ABOVE_LEFTALIGN: - case RELATIVE_LOCATION_ABOVE_CENTER: + finalPosY += mg.bottom; + finalPosY += relativeWidgetMargin.top; + finalPosX += mg.left; + break; case RELATIVE_LOCATION_ABOVE_RIGHTALIGN: finalPosY += mg.bottom; finalPosY += relativeWidgetMargin.top; + finalPosX -= mg.right; break; + case RELATIVE_LOCATION_ABOVE_CENTER: + finalPosY += mg.bottom; + finalPosY += relativeWidgetMargin.top; + break; + case RELATIVE_LOCATION_LEFT_OF_TOPALIGN: - case RELATIVE_LOCATION_LEFT_OF_CENTER: + finalPosX -= mg.right; + finalPosX -= relativeWidgetMargin.left; + finalPosY -= mg.top; + break; case RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN: finalPosX -= mg.right; finalPosX -= relativeWidgetMargin.left; + finalPosY += mg.bottom; break; + case RELATIVE_LOCATION_LEFT_OF_CENTER: + finalPosX -= mg.right; + finalPosX -= relativeWidgetMargin.left; + break; + case RELATIVE_LOCATION_RIGHT_OF_TOPALIGN: - case RELATIVE_LOCATION_RIGHT_OF_CENTER: + finalPosX += mg.left; + finalPosX += relativeWidgetMargin.right; + finalPosY -= mg.top; + break; case RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN: finalPosX += mg.left; finalPosX += relativeWidgetMargin.right; + finalPosY += mg.bottom; break; + case RELATIVE_LOCATION_RIGHT_OF_CENTER: + finalPosX += mg.left; + finalPosX += relativeWidgetMargin.right; + break; + case RELATIVE_LOCATION_BELOW_LEFTALIGN: - case RELATIVE_LOCATION_BELOW_CENTER: + finalPosY -= mg.top; + finalPosY -= relativeWidgetMargin.bottom; + finalPosX += mg.left; + break; case RELATIVE_LOCATION_BELOW_RIGHTALIGN: + finalPosY -= mg.top; + finalPosY -= relativeWidgetMargin.bottom; + finalPosX -= mg.right; + break; + case RELATIVE_LOCATION_BELOW_CENTER: finalPosY -= mg.top; finalPosY -= relativeWidgetMargin.bottom; break; From ec9bc0069ffd2fbda85f4eed8d261b603194b239 Mon Sep 17 00:00:00 2001 From: samuele3 Date: Fri, 15 Nov 2013 13:48:34 +0800 Subject: [PATCH 07/11] Modify template of lua ios_mac config and some bugs --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/scripting/lua/bindings/CCLuaStack.cpp | 8 + cocos/scripting/lua/bindings/CCLuaStack.h | 2 + cocos/scripting/lua/script/CCBReaderLoad.lua | 2 +- .../CocoStudioSceneTest.lua | 1 - .../CocoStudioTest/CocoStudioTest.lua | 10 +- .../HelloLua.xcodeproj/project.pbxproj | 515 ++++++++---------- 7 files changed, 228 insertions(+), 312 deletions(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index 5562fe8565..c0057afb57 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -bb6b434fc4b6f0865e841fd87dddff603200c029 \ No newline at end of file +9490bdedbc6e817240a1661c6bcbcafc9095c267 \ No newline at end of file diff --git a/cocos/scripting/lua/bindings/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp index 9016d111df..7d0357d78b 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.cpp +++ b/cocos/scripting/lua/bindings/CCLuaStack.cpp @@ -103,6 +103,14 @@ int lua_print(lua_State * luastate) NS_CC_BEGIN +LuaStack::~LuaStack() +{ + if (nullptr != _state) + { + lua_close(_state); + } +} + LuaStack *LuaStack::create(void) { LuaStack *stack = new LuaStack(); diff --git a/cocos/scripting/lua/bindings/CCLuaStack.h b/cocos/scripting/lua/bindings/CCLuaStack.h index dc066ac745..8d00e2ff4c 100644 --- a/cocos/scripting/lua/bindings/CCLuaStack.h +++ b/cocos/scripting/lua/bindings/CCLuaStack.h @@ -41,6 +41,8 @@ public: static LuaStack *create(void); static LuaStack *attach(lua_State *L); + virtual ~LuaStack(); + /** @brief Method used to get a pointer to the lua_State that the script module is attached to. @return A pointer to the lua_State that the script module is attached to. diff --git a/cocos/scripting/lua/script/CCBReaderLoad.lua b/cocos/scripting/lua/script/CCBReaderLoad.lua index 3919dfce6e..6acfe432fa 100644 --- a/cocos/scripting/lua/script/CCBReaderLoad.lua +++ b/cocos/scripting/lua/script/CCBReaderLoad.lua @@ -2,7 +2,7 @@ ccb = ccb or {} function CCBReaderLoad(strFilePath,proxy,owner) if nil == proxy then - return + return nil end local ccbReader = proxy:createCCBReader() diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua index fe46748cf0..c7f557b0be 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioSceneTest/CocoStudioSceneTest.lua @@ -48,7 +48,6 @@ end function SceneEditorTestLayer.create() local scene = cc.Scene:create() local layer = SceneEditorTestLayer.extend(cc.LayerColor:create()) - layer:initWithColor(cc.c4b(0,0,0,255)) layer:addChild(layer:createGameScene(), 0, 1) scene:addChild(layer) return scene diff --git a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua index fdc95dae89..f830bc194e 100644 --- a/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/CocoStudioTest/CocoStudioTest.lua @@ -13,24 +13,20 @@ local cocoStudioTestItemNames = runArmatureTestScene() end }, + { itemTitle = "CocoStudioGUITest", testScene = function () runCocosGUITestScene() end }, - { - itemTitle = "CocoStudioComponentsTest", - testScene = function () - --runComponentsTestLayer() - end - }, + { itemTitle = "CocoStudioSceneTest", testScene = function () runCocosSceneTestScene() end - } + }, } local CocoStudioTestScene = class("CocoStudioTestScene") diff --git a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 67d6e16713..ec0d5f7366 100644 --- a/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/template/multi-platform-lua/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -7,17 +7,48 @@ objects = { /* Begin PBXBuildFile section */ - 1525771E17CEFBD400BE417B /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771B17CEFBD400BE417B /* DeprecatedClass.lua */; }; - 1525771F17CEFBD400BE417B /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771C17CEFBD400BE417B /* DeprecatedEnum.lua */; }; - 1525772017CEFBD400BE417B /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771D17CEFBD400BE417B /* DeprecatedOpenglEnum.lua */; }; - 15C1568E1683131500D239F2 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C1568D1683131500D239F2 /* libcurl.a */; }; - 1A0227AC17A3AA3500B867AD /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A517A3AA3500B867AD /* AudioEngine.lua */; }; - 1A0227AD17A3AA3500B867AD /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A617A3AA3500B867AD /* CCBReaderLoad.lua */; }; - 1A0227AE17A3AA3500B867AD /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A717A3AA3500B867AD /* Cocos2dConstants.lua */; }; - 1A0227AF17A3AA3500B867AD /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A817A3AA3500B867AD /* Deprecated.lua */; }; - 1A0227B017A3AA3500B867AD /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A917A3AA3500B867AD /* DrawPrimitives.lua */; }; - 1A0227B117A3AA3500B867AD /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227AA17A3AA3500B867AD /* Opengl.lua */; }; - 1A0227B217A3AA3500B867AD /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227AB17A3AA3500B867AD /* OpenglConstants.lua */; }; + 15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */; }; + 15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */; }; + 15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */; }; + 15A8A4471834C43700142BE0 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */; }; + 15A8A4481834C43700142BE0 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4311834BDA200142BE0 /* libluabindings iOS.a */; }; + 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; + 15A8A4641834C6AD00142BE0 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */; }; + 15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */; }; + 15A8A4661834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */; }; + 15A8A4671834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */; }; + 15A8A4681834C6AD00142BE0 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */; }; + 15A8A4691834C6AD00142BE0 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */; }; + 15A8A46A1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */; }; + 15A8A46B1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */; }; + 15A8A46C1834C6AD00142BE0 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4591834C6AD00142BE0 /* Deprecated.lua */; }; + 15A8A46D1834C6AD00142BE0 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4591834C6AD00142BE0 /* Deprecated.lua */; }; + 15A8A46E1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */; }; + 15A8A46F1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */; }; + 15A8A4701834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */; }; + 15A8A4711834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */; }; + 15A8A4721834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */; }; + 15A8A4731834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */; }; + 15A8A4741834C6AD00142BE0 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */; }; + 15A8A4751834C6AD00142BE0 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */; }; + 15A8A4761834C6AD00142BE0 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45E1834C6AD00142BE0 /* json.lua */; }; + 15A8A4771834C6AD00142BE0 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45E1834C6AD00142BE0 /* json.lua */; }; + 15A8A4781834C6AD00142BE0 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45F1834C6AD00142BE0 /* luaj.lua */; }; + 15A8A4791834C6AD00142BE0 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45F1834C6AD00142BE0 /* luaj.lua */; }; + 15A8A47A1834C6AD00142BE0 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4601834C6AD00142BE0 /* luaoc.lua */; }; + 15A8A47B1834C6AD00142BE0 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4601834C6AD00142BE0 /* luaoc.lua */; }; + 15A8A47C1834C6AD00142BE0 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4611834C6AD00142BE0 /* Opengl.lua */; }; + 15A8A47D1834C6AD00142BE0 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4611834C6AD00142BE0 /* Opengl.lua */; }; + 15A8A47E1834C6AD00142BE0 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */; }; + 15A8A47F1834C6AD00142BE0 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */; }; + 15A8A4801834C6AD00142BE0 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */; }; + 15A8A4811834C6AD00142BE0 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */; }; + 15A8A4821834C73500142BE0 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */; }; + 15A8A4831834C73500142BE0 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */; }; + 15A8A4841834C73500142BE0 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */; }; + 15A8A4851834C73500142BE0 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */; }; + 15A8A4861834C73500142BE0 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4231834BDA200142BE0 /* libluabindings Mac.a */; }; + 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; 1AC3622F16D47C5C000847F2 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622316D47C5C000847F2 /* background.mp3 */; }; 1AC3623016D47C5C000847F2 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622416D47C5C000847F2 /* background.ogg */; }; 1AC3623116D47C5C000847F2 /* crop.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622516D47C5C000847F2 /* crop.png */; }; @@ -30,13 +61,11 @@ 1AC3623816D47C5C000847F2 /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622C16D47C5C000847F2 /* land.png */; }; 1AC3623916D47C5C000847F2 /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622D16D47C5C000847F2 /* menu1.png */; }; 1AC3623A16D47C5C000847F2 /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622E16D47C5C000847F2 /* menu2.png */; }; - 1ADB273817CCA0C200634B5E /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ADB273717CCA0C200634B5E /* Cocos2d.lua */; }; 1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; }; 5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; }; 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; }; 5023811A17EBBCAC00990C9B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810A17EBBCAC00990C9B /* Default.png */; }; 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810B17EBBCAC00990C9B /* Default@2x.png */; }; - 5023811C17EBBCAC00990C9B /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; }; 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810D17EBBCAC00990C9B /* Icon-120.png */; }; 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810E17EBBCAC00990C9B /* Icon-144.png */; }; 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810F17EBBCAC00990C9B /* Icon-152.png */; }; @@ -65,17 +94,6 @@ 5023815317EBBCE400990C9B /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622C16D47C5C000847F2 /* land.png */; }; 5023815617EBBCE400990C9B /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622D16D47C5C000847F2 /* menu1.png */; }; 5023815717EBBCE400990C9B /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622E16D47C5C000847F2 /* menu2.png */; }; - 5023815917EBBCE400990C9B /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A517A3AA3500B867AD /* AudioEngine.lua */; }; - 5023815A17EBBCE400990C9B /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A617A3AA3500B867AD /* CCBReaderLoad.lua */; }; - 5023815B17EBBCE400990C9B /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A717A3AA3500B867AD /* Cocos2dConstants.lua */; }; - 5023815C17EBBCE400990C9B /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A817A3AA3500B867AD /* Deprecated.lua */; }; - 5023815D17EBBCE400990C9B /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227A917A3AA3500B867AD /* DrawPrimitives.lua */; }; - 5023815E17EBBCE400990C9B /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227AA17A3AA3500B867AD /* Opengl.lua */; }; - 5023816117EBBCE400990C9B /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A0227AB17A3AA3500B867AD /* OpenglConstants.lua */; }; - 5023816217EBBCE400990C9B /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ADB273717CCA0C200634B5E /* Cocos2d.lua */; }; - 5023816317EBBCE400990C9B /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771B17CEFBD400BE417B /* DeprecatedClass.lua */; }; - 5023816417EBBCE400990C9B /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771C17CEFBD400BE417B /* DeprecatedEnum.lua */; }; - 5023816717EBBCE400990C9B /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1525771D17CEFBD400BE417B /* DeprecatedOpenglEnum.lua */; }; 5023817617EBBE3400990C9B /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5023817217EBBE3400990C9B /* Icon.icns */; }; 5023817817EBBE3400990C9B /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5023817417EBBE3400990C9B /* main.cpp */; }; 5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5023817917EBBE8300990C9B /* OpenGLES.framework */; }; @@ -86,21 +104,9 @@ 5091733917ECE17A00D62437 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733317ECE17A00D62437 /* Icon-58.png */; }; 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733417ECE17A00D62437 /* Icon-80.png */; }; 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733517ECE17A00D62437 /* Icon-100.png */; }; - 50D7C96517EBBECA005D0B91 /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3E11786631700122817 /* libbox2d iOS.a */; }; - 50D7C96617EBBECA005D0B91 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DF1786631700122817 /* libchipmunk iOS.a */; }; - 50D7C96717EBBECA005D0B91 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DB1786631700122817 /* libcocos2dx iOS.a */; }; - 50D7C96817EBBECA005D0B91 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DD1786631700122817 /* libcocos2dx-extensions iOS.a */; }; - 50D7C96917EBBECA005D0B91 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3E31786631700122817 /* libCocosDenshion iOS.a */; }; - 50D7C96A17EBBECB005D0B91 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3E71786631700122817 /* libluabindings iOS.a */; }; 50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */; }; 50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */; }; 50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */; }; - 50D7C97117EBBEF7005D0B91 /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D31786631700122817 /* libbox2d Mac.a */; }; - 50D7C97217EBBEF7005D0B91 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D11786631700122817 /* libchipmunk Mac.a */; }; - 50D7C97317EBBEF7005D0B91 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3CD1786631700122817 /* libcocos2dx Mac.a */; }; - 50D7C97417EBBEF7005D0B91 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3CF1786631700122817 /* libcocos2dx-extensions Mac.a */; }; - 50D7C97517EBBEF7005D0B91 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D51786631700122817 /* libCocosDenshion Mac.a */; }; - 50D7C97617EBBEF7005D0B91 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3D91786631700122817 /* libluabindings Mac.a */; }; D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; }; F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; }; F293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; }; @@ -112,132 +118,125 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1AF4C3CC1786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1551A33F158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 1AF4C3CE1786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4181834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2FD617814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 1AF4C3D01786631700122817 /* PBXContainerItemProxy */ = { + 15A8A41A1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2CB81780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 1AF4C3D21786631700122817 /* PBXContainerItemProxy */ = { + 15A8A41C1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2D9B1780BDF7006731B9; remoteInfo = "box2d Mac"; }; - 1AF4C3D41786631700122817 /* PBXContainerItemProxy */ = { + 15A8A41E1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AF4C3D61786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4201834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F31FD1781479B006731B9; remoteInfo = "jsbindings Mac"; }; - 1AF4C3D81786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4221834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A6FB53017854BC300CDF010; remoteInfo = "luabindings Mac"; }; - 1AF4C3DA1786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4D641783777C0073F6A7; remoteInfo = "cocos2dx iOS"; }; - 1AF4C3DC1786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4261834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4EFC1783867C0073F6A7; remoteInfo = "cocos2dx-extensions iOS"; }; - 1AF4C3DE1786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4281834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F3B178387670073F6A7; remoteInfo = "chipmunk iOS"; }; - 1AF4C3E01786631700122817 /* PBXContainerItemProxy */ = { + 15A8A42A1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F9E1783876B0073F6A7; remoteInfo = "box2d iOS"; }; - 1AF4C3E21786631700122817 /* PBXContainerItemProxy */ = { + 15A8A42C1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AF4C3E41786631700122817 /* PBXContainerItemProxy */ = { + 15A8A42E1834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A5030178387750073F6A7; remoteInfo = "jsbindings iOS"; }; - 1AF4C3E61786631700122817 /* PBXContainerItemProxy */ = { + 15A8A4301834BDA200142BE0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A119791178526AA00D62A44; remoteInfo = "luabindings iOS"; }; - 5023816D17EBBDBE00990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A03F2E8E178141C1006731B9; - remoteInfo = "build-all-libs Mac"; - }; - 5023816F17EBBDC600990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4E0B178386390073F6A7; - remoteInfo = "build-all-libs iOS"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1525771B17CEFBD400BE417B /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../../../scripting/lua/script/DeprecatedClass.lua; sourceTree = ""; }; - 1525771C17CEFBD400BE417B /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../../../scripting/lua/script/DeprecatedEnum.lua; sourceTree = ""; }; - 1525771D17CEFBD400BE417B /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../../../scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = ""; }; + 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; + 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../../../cocos/scripting/lua/script/AudioEngine.lua; sourceTree = ""; }; + 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../../../cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = ""; }; + 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../../../cocos/scripting/lua/script/Cocos2d.lua; sourceTree = ""; }; + 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../../../cocos/scripting/lua/script/Cocos2dConstants.lua; sourceTree = ""; }; + 15A8A4591834C6AD00142BE0 /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../../../cocos/scripting/lua/script/Deprecated.lua; sourceTree = ""; }; + 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../../../cocos/scripting/lua/script/DeprecatedClass.lua; sourceTree = ""; }; + 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../../../cocos/scripting/lua/script/DeprecatedEnum.lua; sourceTree = ""; }; + 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../../../cocos/scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = ""; }; + 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../../../cocos/scripting/lua/script/DrawPrimitives.lua; sourceTree = ""; }; + 15A8A45E1834C6AD00142BE0 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = ../../../cocos/scripting/lua/script/json.lua; sourceTree = ""; }; + 15A8A45F1834C6AD00142BE0 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = ../../../cocos/scripting/lua/script/luaj.lua; sourceTree = ""; }; + 15A8A4601834C6AD00142BE0 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = ../../../cocos/scripting/lua/script/luaoc.lua; sourceTree = ""; }; + 15A8A4611834C6AD00142BE0 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../../../cocos/scripting/lua/script/Opengl.lua; sourceTree = ""; }; + 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../../../cocos/scripting/lua/script/OpenglConstants.lua; sourceTree = ""; }; + 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = ../../../cocos/scripting/lua/script/StudioConstants.lua; sourceTree = ""; }; + 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 1A0227A517A3AA3500B867AD /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../../../scripting/lua/script/AudioEngine.lua; sourceTree = ""; }; - 1A0227A617A3AA3500B867AD /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../../../scripting/lua/script/CCBReaderLoad.lua; sourceTree = ""; }; - 1A0227A717A3AA3500B867AD /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../../../scripting/lua/script/Cocos2dConstants.lua; sourceTree = ""; }; - 1A0227A817A3AA3500B867AD /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../../../scripting/lua/script/Deprecated.lua; sourceTree = ""; }; - 1A0227A917A3AA3500B867AD /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../../../scripting/lua/script/DrawPrimitives.lua; sourceTree = ""; }; - 1A0227AA17A3AA3500B867AD /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../../../scripting/lua/script/Opengl.lua; sourceTree = ""; }; - 1A0227AB17A3AA3500B867AD /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../../../scripting/lua/script/OpenglConstants.lua; sourceTree = ""; }; 1AC3622316D47C5C000847F2 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = background.mp3; path = ../Resources/background.mp3; sourceTree = ""; }; 1AC3622416D47C5C000847F2 /* background.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; name = background.ogg; path = ../Resources/background.ogg; sourceTree = ""; }; 1AC3622516D47C5C000847F2 /* crop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = crop.png; path = ../Resources/crop.png; sourceTree = ""; }; @@ -250,8 +249,6 @@ 1AC3622C16D47C5C000847F2 /* land.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = land.png; path = ../Resources/land.png; sourceTree = ""; }; 1AC3622D16D47C5C000847F2 /* menu1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = menu1.png; path = ../Resources/menu1.png; sourceTree = ""; }; 1AC3622E16D47C5C000847F2 /* menu2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = menu2.png; path = ../Resources/menu2.png; sourceTree = ""; }; - 1ADB273717CCA0C200634B5E /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../../../scripting/lua/script/Cocos2d.lua; sourceTree = ""; }; - 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 5023810817EBBCAC00990C9B /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; @@ -305,12 +302,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 50D7C97117EBBEF7005D0B91 /* libbox2d Mac.a in Frameworks */, - 50D7C97217EBBEF7005D0B91 /* libchipmunk Mac.a in Frameworks */, - 50D7C97317EBBEF7005D0B91 /* libcocos2dx Mac.a in Frameworks */, - 50D7C97417EBBEF7005D0B91 /* libcocos2dx-extensions Mac.a in Frameworks */, - 50D7C97517EBBEF7005D0B91 /* libCocosDenshion Mac.a in Frameworks */, - 50D7C97617EBBEF7005D0B91 /* libluabindings Mac.a in Frameworks */, + 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */, + 15A8A4821834C73500142BE0 /* libchipmunk Mac.a in Frameworks */, + 15A8A4831834C73500142BE0 /* libcocos2dx Mac.a in Frameworks */, + 15A8A4841834C73500142BE0 /* libcocos2dx-extensions Mac.a in Frameworks */, + 15A8A4851834C73500142BE0 /* libCocosDenshion Mac.a in Frameworks */, + 15A8A4861834C73500142BE0 /* libluabindings Mac.a in Frameworks */, 50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */, 50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */, 50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */, @@ -328,15 +325,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */, + 15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */, + 15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */, + 15A8A4471834C43700142BE0 /* libCocosDenshion iOS.a in Frameworks */, + 15A8A4481834C43700142BE0 /* libluabindings iOS.a in Frameworks */, D6B061351803AC000077942B /* CoreMotion.framework in Frameworks */, - 50D7C96517EBBECA005D0B91 /* libbox2d iOS.a in Frameworks */, - 50D7C96617EBBECA005D0B91 /* libchipmunk iOS.a in Frameworks */, - 50D7C96717EBBECA005D0B91 /* libcocos2dx iOS.a in Frameworks */, - 50D7C96817EBBECA005D0B91 /* libcocos2dx-extensions iOS.a in Frameworks */, - 50D7C96917EBBECA005D0B91 /* libCocosDenshion iOS.a in Frameworks */, - 50D7C96A17EBBECB005D0B91 /* libluabindings iOS.a in Frameworks */, 1AF4C403178663F200122817 /* libz.dylib in Frameworks */, - 15C1568E1683131500D239F2 /* libcurl.a in Frameworks */, 50805AAF17EBBEAA004CFAD3 /* UIKit.framework in Frameworks */, 5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */, F293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */, @@ -351,45 +346,49 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 15A8A4041834BDA200142BE0 /* Products */ = { + isa = PBXGroup; + children = ( + 15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */, + 15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */, + 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */, + 15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */, + 15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */, + 15A8A4211834BDA200142BE0 /* libjsbindings Mac.a */, + 15A8A4231834BDA200142BE0 /* libluabindings Mac.a */, + 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */, + 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */, + 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */, + 15A8A42B1834BDA200142BE0 /* libbox2d iOS.a */, + 15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */, + 15A8A42F1834BDA200142BE0 /* libjsbindings iOS.a */, + 15A8A4311834BDA200142BE0 /* libluabindings iOS.a */, + ); + name = Products; + sourceTree = ""; + }; 1A0227A417A3AA1A00B867AD /* Lua Common */ = { isa = PBXGroup; children = ( - 1525771B17CEFBD400BE417B /* DeprecatedClass.lua */, - 1525771C17CEFBD400BE417B /* DeprecatedEnum.lua */, - 1525771D17CEFBD400BE417B /* DeprecatedOpenglEnum.lua */, - 1A0227A517A3AA3500B867AD /* AudioEngine.lua */, - 1A0227A617A3AA3500B867AD /* CCBReaderLoad.lua */, - 1ADB273717CCA0C200634B5E /* Cocos2d.lua */, - 1A0227A717A3AA3500B867AD /* Cocos2dConstants.lua */, - 1A0227A817A3AA3500B867AD /* Deprecated.lua */, - 1A0227A917A3AA3500B867AD /* DrawPrimitives.lua */, - 1A0227AA17A3AA3500B867AD /* Opengl.lua */, - 1A0227AB17A3AA3500B867AD /* OpenglConstants.lua */, + 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */, + 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */, + 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */, + 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */, + 15A8A4591834C6AD00142BE0 /* Deprecated.lua */, + 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */, + 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */, + 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */, + 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */, + 15A8A45E1834C6AD00142BE0 /* json.lua */, + 15A8A45F1834C6AD00142BE0 /* luaj.lua */, + 15A8A4601834C6AD00142BE0 /* luaoc.lua */, + 15A8A4611834C6AD00142BE0 /* Opengl.lua */, + 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */, + 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */, ); name = "Lua Common"; sourceTree = ""; }; - 1AF4C3BA1786631600122817 /* Products */ = { - isa = PBXGroup; - children = ( - 1AF4C3CD1786631700122817 /* libcocos2dx Mac.a */, - 1AF4C3CF1786631700122817 /* libcocos2dx-extensions Mac.a */, - 1AF4C3D11786631700122817 /* libchipmunk Mac.a */, - 1AF4C3D31786631700122817 /* libbox2d Mac.a */, - 1AF4C3D51786631700122817 /* libCocosDenshion Mac.a */, - 1AF4C3D71786631700122817 /* libjsbindings Mac.a */, - 1AF4C3D91786631700122817 /* libluabindings Mac.a */, - 1AF4C3DB1786631700122817 /* libcocos2dx iOS.a */, - 1AF4C3DD1786631700122817 /* libcocos2dx-extensions iOS.a */, - 1AF4C3DF1786631700122817 /* libchipmunk iOS.a */, - 1AF4C3E11786631700122817 /* libbox2d iOS.a */, - 1AF4C3E31786631700122817 /* libCocosDenshion iOS.a */, - 1AF4C3E51786631700122817 /* libjsbindings iOS.a */, - 1AF4C3E71786631700122817 /* libluabindings iOS.a */, - ); - name = Products; - sourceTree = ""; - }; 5023810617EBBCAC00990C9B /* ios */ = { isa = PBXGroup; children = ( @@ -442,7 +441,7 @@ F293B3BD15EB7BE500256477 = { isa = PBXGroup; children = ( - 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */, + 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */, 5023810617EBBCAC00990C9B /* ios */, 5023817117EBBE3400990C9B /* mac */, F293BB7C15EB830F00256477 /* Classes */, @@ -465,6 +464,7 @@ F293B3CB15EB7BE500256477 /* Frameworks */ = { isa = PBXGroup; children = ( + 15A8A4871834C90E00142BE0 /* libcurl.dylib */, D6B061341803AC000077942B /* CoreMotion.framework */, 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */, 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */, @@ -528,7 +528,6 @@ buildRules = ( ); dependencies = ( - 5023816E17EBBDBE00990C9B /* PBXTargetDependency */, ); name = "HelloLua Mac"; productName = HelloLua; @@ -546,7 +545,6 @@ buildRules = ( ); dependencies = ( - 5023817017EBBDC600990C9B /* PBXTargetDependency */, ); name = "HelloLua iOS"; productName = HelloLua; @@ -578,8 +576,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 1AF4C3BA1786631600122817 /* Products */; - ProjectRef = 1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */; + ProductGroup = 15A8A4041834BDA200142BE0 /* Products */; + ProjectRef = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */; }, ); projectRoot = ""; @@ -591,102 +589,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AF4C3CD1786631700122817 /* libcocos2dx Mac.a */ = { + 15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx Mac.a"; - remoteRef = 1AF4C3CC1786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3CF1786631700122817 /* libcocos2dx-extensions Mac.a */ = { + 15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions Mac.a"; - remoteRef = 1AF4C3CE1786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4181834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3D11786631700122817 /* libchipmunk Mac.a */ = { + 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk Mac.a"; - remoteRef = 1AF4C3D01786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A41A1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3D31786631700122817 /* libbox2d Mac.a */ = { + 15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d Mac.a"; - remoteRef = 1AF4C3D21786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A41C1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3D51786631700122817 /* libCocosDenshion Mac.a */ = { + 15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion Mac.a"; - remoteRef = 1AF4C3D41786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A41E1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3D71786631700122817 /* libjsbindings Mac.a */ = { + 15A8A4211834BDA200142BE0 /* libjsbindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings Mac.a"; - remoteRef = 1AF4C3D61786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4201834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3D91786631700122817 /* libluabindings Mac.a */ = { + 15A8A4231834BDA200142BE0 /* libluabindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings Mac.a"; - remoteRef = 1AF4C3D81786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4221834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3DB1786631700122817 /* libcocos2dx iOS.a */ = { + 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx iOS.a"; - remoteRef = 1AF4C3DA1786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3DD1786631700122817 /* libcocos2dx-extensions iOS.a */ = { + 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions iOS.a"; - remoteRef = 1AF4C3DC1786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4261834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3DF1786631700122817 /* libchipmunk iOS.a */ = { + 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk iOS.a"; - remoteRef = 1AF4C3DE1786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4281834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3E11786631700122817 /* libbox2d iOS.a */ = { + 15A8A42B1834BDA200142BE0 /* libbox2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d iOS.a"; - remoteRef = 1AF4C3E01786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A42A1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3E31786631700122817 /* libCocosDenshion iOS.a */ = { + 15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion iOS.a"; - remoteRef = 1AF4C3E21786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A42C1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3E51786631700122817 /* libjsbindings iOS.a */ = { + 15A8A42F1834BDA200142BE0 /* libjsbindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings iOS.a"; - remoteRef = 1AF4C3E41786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A42E1834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C3E71786631700122817 /* libluabindings iOS.a */ = { + 15A8A4311834BDA200142BE0 /* libluabindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings iOS.a"; - remoteRef = 1AF4C3E61786631700122817 /* PBXContainerItemProxy */; + remoteRef = 15A8A4301834BDA200142BE0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -696,30 +694,34 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15A8A4711834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */, 5023814817EBBCE400990C9B /* background.mp3 in Resources */, 5023814917EBBCE400990C9B /* background.ogg in Resources */, 5023814A17EBBCE400990C9B /* crop.png in Resources */, + 15A8A4811834C6AD00142BE0 /* StudioConstants.lua in Resources */, + 15A8A4791834C6AD00142BE0 /* luaj.lua in Resources */, + 15A8A4671834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */, 5023814B17EBBCE400990C9B /* dog.png in Resources */, 5023814D17EBBCE400990C9B /* effect1.wav in Resources */, + 15A8A46B1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */, 5023814F17EBBCE400990C9B /* farm.jpg in Resources */, + 15A8A4771834C6AD00142BE0 /* json.lua in Resources */, + 15A8A46F1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */, + 15A8A47F1834C6AD00142BE0 /* OpenglConstants.lua in Resources */, 5023815017EBBCE400990C9B /* fonts in Resources */, + 15A8A47D1834C6AD00142BE0 /* Opengl.lua in Resources */, + 15A8A4691834C6AD00142BE0 /* Cocos2d.lua in Resources */, + 15A8A4731834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */, 5023815117EBBCE400990C9B /* hello.lua in Resources */, + 15A8A46D1834C6AD00142BE0 /* Deprecated.lua in Resources */, 5023815217EBBCE400990C9B /* hello2.lua in Resources */, + 15A8A4751834C6AD00142BE0 /* DrawPrimitives.lua in Resources */, + 15A8A47B1834C6AD00142BE0 /* luaoc.lua in Resources */, 5023815317EBBCE400990C9B /* land.png in Resources */, 5023815617EBBCE400990C9B /* menu1.png in Resources */, 5023815717EBBCE400990C9B /* menu2.png in Resources */, - 5023815917EBBCE400990C9B /* AudioEngine.lua in Resources */, 5023817617EBBE3400990C9B /* Icon.icns in Resources */, - 5023815A17EBBCE400990C9B /* CCBReaderLoad.lua in Resources */, - 5023815B17EBBCE400990C9B /* Cocos2dConstants.lua in Resources */, - 5023815C17EBBCE400990C9B /* Deprecated.lua in Resources */, - 5023815D17EBBCE400990C9B /* DrawPrimitives.lua in Resources */, - 5023815E17EBBCE400990C9B /* Opengl.lua in Resources */, - 5023816117EBBCE400990C9B /* OpenglConstants.lua in Resources */, - 5023816217EBBCE400990C9B /* Cocos2d.lua in Resources */, - 5023816317EBBCE400990C9B /* DeprecatedClass.lua in Resources */, - 5023816417EBBCE400990C9B /* DeprecatedEnum.lua in Resources */, - 5023816717EBBCE400990C9B /* DeprecatedOpenglEnum.lua in Resources */, + 15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -727,45 +729,49 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15A8A46E1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */, + 15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */, 5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */, + 15A8A47E1834C6AD00142BE0 /* OpenglConstants.lua in Resources */, 5091733B17ECE17A00D62437 /* Icon-100.png in Resources */, + 15A8A4781834C6AD00142BE0 /* luaj.lua in Resources */, 1AC3622F16D47C5C000847F2 /* background.mp3 in Resources */, 1AC3623016D47C5C000847F2 /* background.ogg in Resources */, 1AC3623116D47C5C000847F2 /* crop.png in Resources */, + 15A8A47C1834C6AD00142BE0 /* Opengl.lua in Resources */, + 15A8A4741834C6AD00142BE0 /* DrawPrimitives.lua in Resources */, 1AC3623216D47C5C000847F2 /* dog.png in Resources */, 5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */, 1AC3623316D47C5C000847F2 /* effect1.wav in Resources */, + 15A8A4681834C6AD00142BE0 /* Cocos2d.lua in Resources */, 5091733617ECE17A00D62437 /* Icon-29.png in Resources */, + 15A8A4801834C6AD00142BE0 /* StudioConstants.lua in Resources */, 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */, 1AC3623416D47C5C000847F2 /* farm.jpg in Resources */, 1AC3623516D47C5C000847F2 /* fonts in Resources */, + 15A8A4721834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */, + 15A8A4701834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */, + 15A8A46A1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */, 1AC3623616D47C5C000847F2 /* hello.lua in Resources */, 5091733917ECE17A00D62437 /* Icon-58.png in Resources */, + 15A8A4641834C6AD00142BE0 /* AudioEngine.lua in Resources */, 1AC3623716D47C5C000847F2 /* hello2.lua in Resources */, 1AC3623816D47C5C000847F2 /* land.png in Resources */, + 15A8A4661834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */, 5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */, 5023812017EBBCAC00990C9B /* Icon-57.png in Resources */, 1AC3623916D47C5C000847F2 /* menu1.png in Resources */, + 15A8A47A1834C6AD00142BE0 /* luaoc.lua in Resources */, 1AC3623A16D47C5C000847F2 /* menu2.png in Resources */, 5023812217EBBCAC00990C9B /* Icon-76.png in Resources */, + 15A8A46C1834C6AD00142BE0 /* Deprecated.lua in Resources */, 5091733A17ECE17A00D62437 /* Icon-80.png in Resources */, - 1A0227AC17A3AA3500B867AD /* AudioEngine.lua in Resources */, - 1A0227AD17A3AA3500B867AD /* CCBReaderLoad.lua in Resources */, - 1A0227AE17A3AA3500B867AD /* Cocos2dConstants.lua in Resources */, - 1A0227AF17A3AA3500B867AD /* Deprecated.lua in Resources */, - 1A0227B017A3AA3500B867AD /* DrawPrimitives.lua in Resources */, 5091733717ECE17A00D62437 /* Icon-40.png in Resources */, - 1A0227B117A3AA3500B867AD /* Opengl.lua in Resources */, 5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */, + 15A8A4761834C6AD00142BE0 /* json.lua in Resources */, 5023811A17EBBCAC00990C9B /* Default.png in Resources */, - 1A0227B217A3AA3500B867AD /* OpenglConstants.lua in Resources */, 5091733817ECE17A00D62437 /* Icon-50.png in Resources */, - 1ADB273817CCA0C200634B5E /* Cocos2d.lua in Resources */, - 1525771E17CEFBD400BE417B /* DeprecatedClass.lua in Resources */, - 1525771F17CEFBD400BE417B /* DeprecatedEnum.lua in Resources */, 5023812117EBBCAC00990C9B /* Icon-72.png in Resources */, - 5023811C17EBBCAC00990C9B /* Icon-114.png in Resources */, - 1525772017CEFBD400BE417B /* DeprecatedOpenglEnum.lua in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -794,24 +800,11 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 5023816E17EBBDBE00990C9B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "build-all-libs Mac"; - targetProxy = 5023816D17EBBDBE00990C9B /* PBXContainerItemProxy */; - }; - 5023817017EBBDC600990C9B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "build-all-libs iOS"; - targetProxy = 5023816F17EBBDC600990C9B /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 5023816917EBBCE400990C9B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -821,30 +814,9 @@ CC_TARGET_OS_MAC, "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"", - "\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/include\"", - ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries", - "$(inherited)", - "\"$(SRCROOT)/../../../scripting/lua/luajit/mac\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-image_base", 100000000, @@ -852,13 +824,14 @@ 10000, ); SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/mac $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../external/glfw3/include/mac $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; }; name = Debug; }; 5023816A17EBBCE400990C9B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -867,30 +840,9 @@ CC_TARGET_OS_MAC, "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"", - "\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/include\"", - ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries", - "$(inherited)", - "\"$(SRCROOT)/../../../scripting/lua/luajit/mac\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-image_base", 100000000, @@ -898,6 +850,7 @@ 10000, ); SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/mac $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../external/glfw3/include/mac $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; }; name = Release; }; @@ -973,7 +926,7 @@ F293B6C515EB7BEA00256477 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -983,41 +936,20 @@ CC_TARGET_OS_IPHONE, "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"", - "\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../audio/include\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/include\"", - ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries", - "$(inherited)", - "\"$(SRCROOT)/../../../scripting/lua/luajit/ios\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/ios $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; }; name = Debug; }; F293B6C615EB7BEA00256477 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1026,34 +958,13 @@ CC_TARGET_OS_IPHONE, "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../scripting/lua/tolua\"", - "\"$(SRCROOT)/../../../scripting/lua/luajit/include\"", - "\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"", - "\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../audio/include\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/include\"", - ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries", - "$(inherited)", - "\"$(SRCROOT)/../../../scripting/lua/luajit/ios\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../../cocos $(SRCROOT)/../../../cocos/base $(SRCROOT)/../../../cocos/2d $(SRCROOT)/../../../cocos/physics $(SRCROOT)/../../../cocos/math/kazmath/include $(SRCROOT)/../../../cocos/2d/platform/ios $(SRCROOT)/../../../cocos/audio/include $(SRCROOT)/../../../cocos/editor-support $(SRCROOT)/../../../cocos/gui $(SRCROOT)/../../../external/chipmunk/include/chipmunk $(SRCROOT)/../../../external $(SRCROOT)/../../../cocos/scripting/lua/bindings $(SRCROOT)/../../../external/lua/luajit/include $(SRCROOT)/../../../external/lua/tolua"; }; name = Release; }; From 050a47c4eb5720b3120a10dbdd9515d66d0f3a77 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 15 Nov 2013 14:35:55 +0800 Subject: [PATCH 08/11] issue #2854:Disable CDT Builder on Eclipse --- .../AssetsManagerTest/proj.android/.classpath | 1 + .../AssetsManagerTest/proj.android/.project | 64 ++----------------- samples/Cpp/HelloCpp/proj.android/.classpath | 2 +- samples/Cpp/HelloCpp/proj.android/.project | 64 ++----------------- .../Cpp/SimpleGame/proj.android/.classpath | 2 +- samples/Cpp/SimpleGame/proj.android/.project | 64 ++----------------- samples/Cpp/TestCpp/proj.android/.project | 64 ++----------------- .../CocosDragonJS/proj.android/.classpath | 1 + .../CocosDragonJS/proj.android/.project | 64 ++----------------- .../CrystalCraze/proj.android/.classpath | 1 + .../CrystalCraze/proj.android/.project | 64 ++----------------- .../MoonWarriors/proj.android/.classpath | 1 + .../MoonWarriors/proj.android/.project | 64 ++----------------- .../TestJavascript/proj.android/.classpath | 1 + .../TestJavascript/proj.android/.project | 64 ++----------------- .../WatermelonWithMe/proj.android/.classpath | 1 + .../WatermelonWithMe/proj.android/.project | 64 ++----------------- samples/Lua/HelloLua/proj.android/.classpath | 1 + samples/Lua/HelloLua/proj.android/.project | 52 ++------------- samples/Lua/TestLua/proj.android/.classpath | 1 + samples/Lua/TestLua/proj.android/.project | 52 ++------------- .../proj.android/.classpath | 5 +- .../multi-platform-cpp/proj.android/.project | 60 ++--------------- .../multi-platform-js/proj.android/.classpath | 5 +- .../multi-platform-js/proj.android/.project | 64 +------------------ .../proj.android/.classpath | 5 +- 26 files changed, 72 insertions(+), 759 deletions(-) diff --git a/samples/Cpp/AssetsManagerTest/proj.android/.classpath b/samples/Cpp/AssetsManagerTest/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Cpp/AssetsManagerTest/proj.android/.classpath +++ b/samples/Cpp/AssetsManagerTest/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Cpp/AssetsManagerTest/proj.android/.project b/samples/Cpp/AssetsManagerTest/proj.android/.project index 3ce737b86e..87fc1c9e0e 100644 --- a/samples/Cpp/AssetsManagerTest/proj.android/.project +++ b/samples/Cpp/AssetsManagerTest/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch diff --git a/samples/Cpp/HelloCpp/proj.android/.classpath b/samples/Cpp/HelloCpp/proj.android/.classpath index 0b08408342..c06dfcb8e5 100644 --- a/samples/Cpp/HelloCpp/proj.android/.classpath +++ b/samples/Cpp/HelloCpp/proj.android/.classpath @@ -2,8 +2,8 @@ + - diff --git a/samples/Cpp/HelloCpp/proj.android/.project b/samples/Cpp/HelloCpp/proj.android/.project index 00f27149c6..93335a6f16 100644 --- a/samples/Cpp/HelloCpp/proj.android/.project +++ b/samples/Cpp/HelloCpp/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (5).launch diff --git a/samples/Cpp/SimpleGame/proj.android/.classpath b/samples/Cpp/SimpleGame/proj.android/.classpath index 0b08408342..c06dfcb8e5 100644 --- a/samples/Cpp/SimpleGame/proj.android/.classpath +++ b/samples/Cpp/SimpleGame/proj.android/.classpath @@ -2,8 +2,8 @@ + - diff --git a/samples/Cpp/SimpleGame/proj.android/.project b/samples/Cpp/SimpleGame/proj.android/.project index c9f6aeb48d..4e2c99e96f 100644 --- a/samples/Cpp/SimpleGame/proj.android/.project +++ b/samples/Cpp/SimpleGame/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (8).launch diff --git a/samples/Cpp/TestCpp/proj.android/.project b/samples/Cpp/TestCpp/proj.android/.project index ba4ce24ee5..b02e99a830 100644 --- a/samples/Cpp/TestCpp/proj.android/.project +++ b/samples/Cpp/TestCpp/proj.android/.project @@ -21,68 +21,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (9).launch diff --git a/samples/Javascript/CocosDragonJS/proj.android/.classpath b/samples/Javascript/CocosDragonJS/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Javascript/CocosDragonJS/proj.android/.classpath +++ b/samples/Javascript/CocosDragonJS/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Javascript/CocosDragonJS/proj.android/.project b/samples/Javascript/CocosDragonJS/proj.android/.project index 0855474886..0a89f1ca12 100644 --- a/samples/Javascript/CocosDragonJS/proj.android/.project +++ b/samples/Javascript/CocosDragonJS/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (3).launch diff --git a/samples/Javascript/CrystalCraze/proj.android/.classpath b/samples/Javascript/CrystalCraze/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Javascript/CrystalCraze/proj.android/.classpath +++ b/samples/Javascript/CrystalCraze/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Javascript/CrystalCraze/proj.android/.project b/samples/Javascript/CrystalCraze/proj.android/.project index 37434e64a4..274dcabae3 100644 --- a/samples/Javascript/CrystalCraze/proj.android/.project +++ b/samples/Javascript/CrystalCraze/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (4).launch diff --git a/samples/Javascript/MoonWarriors/proj.android/.classpath b/samples/Javascript/MoonWarriors/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Javascript/MoonWarriors/proj.android/.classpath +++ b/samples/Javascript/MoonWarriors/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Javascript/MoonWarriors/proj.android/.project b/samples/Javascript/MoonWarriors/proj.android/.project index ce591a7d55..6c9a469ace 100644 --- a/samples/Javascript/MoonWarriors/proj.android/.project +++ b/samples/Javascript/MoonWarriors/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (7).launch diff --git a/samples/Javascript/TestJavascript/proj.android/.classpath b/samples/Javascript/TestJavascript/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Javascript/TestJavascript/proj.android/.classpath +++ b/samples/Javascript/TestJavascript/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Javascript/TestJavascript/proj.android/.project b/samples/Javascript/TestJavascript/proj.android/.project index dd20aeed95..4474f112c9 100644 --- a/samples/Javascript/TestJavascript/proj.android/.project +++ b/samples/Javascript/TestJavascript/proj.android/.project @@ -36,68 +36,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (10).launch diff --git a/samples/Javascript/WatermelonWithMe/proj.android/.classpath b/samples/Javascript/WatermelonWithMe/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Javascript/WatermelonWithMe/proj.android/.classpath +++ b/samples/Javascript/WatermelonWithMe/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Javascript/WatermelonWithMe/proj.android/.project b/samples/Javascript/WatermelonWithMe/proj.android/.project index a4e3c72357..e6fddbb64c 100644 --- a/samples/Javascript/WatermelonWithMe/proj.android/.project +++ b/samples/Javascript/WatermelonWithMe/proj.android/.project @@ -31,68 +31,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (12).launch diff --git a/samples/Lua/HelloLua/proj.android/.classpath b/samples/Lua/HelloLua/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Lua/HelloLua/proj.android/.classpath +++ b/samples/Lua/HelloLua/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Lua/HelloLua/proj.android/.project b/samples/Lua/HelloLua/proj.android/.project index 6b0e37d723..633e8ba316 100644 --- a/samples/Lua/HelloLua/proj.android/.project +++ b/samples/Lua/HelloLua/proj.android/.project @@ -6,56 +6,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (6).launch diff --git a/samples/Lua/TestLua/proj.android/.classpath b/samples/Lua/TestLua/proj.android/.classpath index 3f9691c5dd..0b08408342 100644 --- a/samples/Lua/TestLua/proj.android/.classpath +++ b/samples/Lua/TestLua/proj.android/.classpath @@ -4,5 +4,6 @@ + diff --git a/samples/Lua/TestLua/proj.android/.project b/samples/Lua/TestLua/proj.android/.project index 3c1261c623..6c0b0be311 100644 --- a/samples/Lua/TestLua/proj.android/.project +++ b/samples/Lua/TestLua/proj.android/.project @@ -6,56 +6,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - ${ProjDirPath}/build_native.sh - - - org.eclipse.cdt.make.core.buildCommand - bash - - - org.eclipse.cdt.make.core.buildLocation - ${ProjDirPath} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (11).launch diff --git a/template/multi-platform-cpp/proj.android/.classpath b/template/multi-platform-cpp/proj.android/.classpath index a4763d1eec..0b08408342 100644 --- a/template/multi-platform-cpp/proj.android/.classpath +++ b/template/multi-platform-cpp/proj.android/.classpath @@ -1,8 +1,9 @@ - - + + + diff --git a/template/multi-platform-cpp/proj.android/.project b/template/multi-platform-cpp/proj.android/.project index b0bd2f6953..c07874533a 100644 --- a/template/multi-platform-cpp/proj.android/.project +++ b/template/multi-platform-cpp/proj.android/.project @@ -21,60 +21,12 @@ - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - -C ${ProjDirPath} NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt -j2 - - - org.eclipse.cdt.make.core.buildCommand - ${ProjDirPath}/ANDROID_NDK/ndk-build - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder (1).launch @@ -102,7 +54,7 @@ Classes 2 - COCOS2DX/projects/HelloCpp/Classes + COCOS2DX/projects/HelloCpp/Classes cocos2dx @@ -112,7 +64,7 @@ extensions 2 - COCOS2DX/extensions + COCOS2DX/extensions scripting diff --git a/template/multi-platform-js/proj.android/.classpath b/template/multi-platform-js/proj.android/.classpath index a4763d1eec..0b08408342 100644 --- a/template/multi-platform-js/proj.android/.classpath +++ b/template/multi-platform-js/proj.android/.classpath @@ -1,8 +1,9 @@ - - + + + diff --git a/template/multi-platform-js/proj.android/.project b/template/multi-platform-js/proj.android/.project index ea6400b5fb..c65124f88e 100644 --- a/template/multi-platform-js/proj.android/.project +++ b/template/multi-platform-js/proj.android/.project @@ -26,65 +26,7 @@ LaunchConfigHandle - <project>/.externalToolBuilders/Javah_jni_builder.launch - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - -C ${ProjDirPath} NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt -j2 - - - org.eclipse.cdt.make.core.buildCommand - ${ProjDirPath}/ANDROID_NDK/ndk-build - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false + <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch @@ -112,7 +54,7 @@ Classes 2 - COCOS2DX/projects/HelloJavascript/Classes + COCOS2DX/projects/HelloJavascript/Classes cocos2dx @@ -122,7 +64,7 @@ extensions 2 - COCOS2DX/extensions + COCOS2DX/extensions scripting diff --git a/template/multi-platform-lua/proj.android/.classpath b/template/multi-platform-lua/proj.android/.classpath index a4763d1eec..0b08408342 100644 --- a/template/multi-platform-lua/proj.android/.classpath +++ b/template/multi-platform-lua/proj.android/.classpath @@ -1,8 +1,9 @@ - - + + + From 75d9bde4596d714b20b268c0b49063e397910be0 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Fri, 15 Nov 2013 14:37:34 +0800 Subject: [PATCH 09/11] Modify relative layout --- cocos/gui/UILayout.cpp | 94 +++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 14 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index be152ec817..c7c48dfb24 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -813,9 +813,9 @@ void UILayout::doLayout() } UIMargin relativeWidgetMargin; UIMargin mg = layoutParameter->getMargin(); - if (relativeWidget) + if (relativeWidgetLP) { - relativeWidgetMargin = relativeWidget->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE)->getMargin(); + relativeWidgetMargin = relativeWidgetLP->getMargin(); } //handle margin switch (align) @@ -854,62 +854,128 @@ void UILayout::doLayout() case RELATIVE_LOCATION_ABOVE_LEFTALIGN: finalPosY += mg.bottom; - finalPosY += relativeWidgetMargin.top; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT) + { + finalPosY += relativeWidgetMargin.top; + } finalPosX += mg.left; break; case RELATIVE_LOCATION_ABOVE_RIGHTALIGN: finalPosY += mg.bottom; - finalPosY += relativeWidgetMargin.top; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT) + { + finalPosY += relativeWidgetMargin.top; + } finalPosX -= mg.right; break; case RELATIVE_LOCATION_ABOVE_CENTER: finalPosY += mg.bottom; - finalPosY += relativeWidgetMargin.top; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT) + { + finalPosY += relativeWidgetMargin.top; + } break; case RELATIVE_LOCATION_LEFT_OF_TOPALIGN: finalPosX -= mg.right; - finalPosX -= relativeWidgetMargin.left; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL) + { + finalPosX -= relativeWidgetMargin.left; + } finalPosY -= mg.top; break; case RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN: finalPosX -= mg.right; - finalPosX -= relativeWidgetMargin.left; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL) + { + finalPosX -= relativeWidgetMargin.left; + } finalPosY += mg.bottom; break; case RELATIVE_LOCATION_LEFT_OF_CENTER: finalPosX -= mg.right; - finalPosX -= relativeWidgetMargin.left; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL) + { + finalPosX -= relativeWidgetMargin.left; + } break; case RELATIVE_LOCATION_RIGHT_OF_TOPALIGN: finalPosX += mg.left; - finalPosX += relativeWidgetMargin.right; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL) + { + finalPosX += relativeWidgetMargin.right; + } finalPosY -= mg.top; break; case RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN: finalPosX += mg.left; - finalPosX += relativeWidgetMargin.right; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL) + { + finalPosX += relativeWidgetMargin.right; + } finalPosY += mg.bottom; break; case RELATIVE_LOCATION_RIGHT_OF_CENTER: finalPosX += mg.left; - finalPosX += relativeWidgetMargin.right; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL) + { + finalPosX += relativeWidgetMargin.right; + } break; case RELATIVE_LOCATION_BELOW_LEFTALIGN: finalPosY -= mg.top; - finalPosY -= relativeWidgetMargin.bottom; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL) + { + finalPosY -= relativeWidgetMargin.bottom; + } finalPosX += mg.left; break; case RELATIVE_LOCATION_BELOW_RIGHTALIGN: finalPosY -= mg.top; - finalPosY -= relativeWidgetMargin.bottom; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL) + { + finalPosY -= relativeWidgetMargin.bottom; + } finalPosX -= mg.right; break; case RELATIVE_LOCATION_BELOW_CENTER: finalPosY -= mg.top; - finalPosY -= relativeWidgetMargin.bottom; + if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM + && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL) + { + finalPosY -= relativeWidgetMargin.bottom; + } break; default: break; From 0c309acbe7e0e517926af081d4f0f25001507080 Mon Sep 17 00:00:00 2001 From: boyu0 Date: Fri, 15 Nov 2013 15:41:43 +0800 Subject: [PATCH 10/11] fix CCBReader magic bytes compare bug which cause CocosBuilderTest turns black --- cocos/editor-support/cocosbuilder/CCBReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index baf81a6f55..bf566770fe 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -387,7 +387,7 @@ bool CCBReader::readHeader() int magicBytes = *((int*)(this->_bytes + this->_currentByte)); this->_currentByte += 4; - if(CC_SWAP_INT32_LITTLE_TO_HOST(magicBytes) != (*reinterpret_cast("ccbi"))) { + if(CC_SWAP_INT32_BIG_TO_HOST(magicBytes) != (*reinterpret_cast("ccbi"))) { return false; } From 6db31508cc165de2f99b26ae0af5cae7719bc09b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 15 Nov 2013 16:01:03 +0800 Subject: [PATCH 11/11] fix Incomplete helloLua project configuration. --- samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj | 2 +- .../multi-platform-lua/proj.win32/HelloLua.sln | 14 ++++++-------- .../multi-platform-lua/proj.win32/HelloLua.vcxproj | 5 ++++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index fb17ddfe2e..aae3a8cf1f 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -97,7 +97,7 @@ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) true Windows diff --git a/template/multi-platform-lua/proj.win32/HelloLua.sln b/template/multi-platform-lua/proj.win32/HelloLua.sln index 5fdeacb7a4..d5769661f0 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.sln +++ b/template/multi-platform-lua/proj.win32/HelloLua.sln @@ -7,7 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxpro {DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159} {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} - {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject @@ -15,12 +14,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libExtensions", "..\..\..\e ProjectSection(ProjectDependencies) = postProject {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25} - {929480E7-23C0-4DF6-8456-096D71547116} = {929480E7-23C0-4DF6-8456-096D71547116} {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libBox2D", "..\..\..\external\Box2D\proj.win32\Box2D.vcxproj", "{929480E7-23C0-4DF6-8456-096D71547116}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libchipmunk", "..\..\..\external\chipmunk\proj.win32\chipmunk.vcxproj", "{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "..\..\..\cocos\2d\cocos2d.vcxproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}" @@ -35,6 +31,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosBuilder", "..\..\.. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\..\..\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj", "{B57CF53F-2E49-4031-9822-047CC0E6BDE2}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\..\..\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -49,10 +47,6 @@ Global {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32 {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32 {21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32 - {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32 - {929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32 - {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32 - {929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32 {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32 @@ -81,6 +75,10 @@ Global {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32 {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32 {B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32 + {7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj index b15be7cabb..6762f6a744 100644 --- a/template/multi-platform-lua/proj.win32/HelloLua.vcxproj +++ b/template/multi-platform-lua/proj.win32/HelloLua.vcxproj @@ -84,7 +84,7 @@ MachineX86 true $(OutDir);%(AdditionalLibraryDirectories) - lua51.lib;websockets.lib;%(AdditionalDependencies) + libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies) 0x0409 @@ -187,6 +187,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\external\websockets\prebuilt\win32\*.*" "$(Ou {b57cf53f-2e49-4031-9822-047cc0e6bde2} + + {7e06e92c-537a-442b-9e4a-4761c84f8a1a} + {df2638c0-8128-4847-867c-6eafe3dee7b5}