diff --git a/cocos/base/ZipUtils.cpp b/cocos/base/ZipUtils.cpp index aef1ce6570..c8c16a7f67 100644 --- a/cocos/base/ZipUtils.cpp +++ b/cocos/base/ZipUtils.cpp @@ -32,6 +32,8 @@ #include "unzip.h" #endif #include "ioapi_mem.h" +#include + #include #include @@ -508,9 +510,115 @@ struct ZipEntryInfo uLong uncompressed_size; }; -class ZipFilePrivate +struct ZipFilePrivate { -public: + ZipFilePrivate() { + functionOverrides.zopen_file = ZipFile_open_file_func; + functionOverrides.zopendisk_file = ZipFile_opendisk_file_func; + functionOverrides.zread_file = ZipFile_read_file_func; + functionOverrides.zwrite_file = ZipFile_write_file_func; + functionOverrides.ztell_file = ZipFile_tell_file_func; + functionOverrides.zseek_file = ZipFile_seek_file_func; + functionOverrides.zclose_file = ZipFile_close_file_func; + functionOverrides.zerror_file = ZipFile_error_file_func; + functionOverrides.opaque = this; + } + + // unzip overrides to support FileStream + static long ZipFile_tell_file_func(voidpf opaque, voidpf stream) { + if (stream == nullptr) + return -1; + + auto* fs = (FileStream*) stream; + + return fs->tell(); + } + + static long ZipFile_seek_file_func(voidpf opaque, voidpf stream, uint32_t offset, int origin) { + if (stream == nullptr) + return -1; + + auto* fs = (FileStream*) stream; + + return fs->seek((long) offset, origin); // must return 0 for success or -1 for error + } + + static voidpf ZipFile_open_file_func(voidpf opaque, const char* filename, int mode) { + FileStream::Mode fsMode; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ) + fsMode = FileStream::Mode::READ; + else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + fsMode = FileStream::Mode::APPEND; + else if (mode & ZLIB_FILEFUNC_MODE_CREATE) + fsMode = FileStream::Mode::WRITE; + else + return nullptr; + + return FileUtils::getInstance()->openFileStream(filename, fsMode).release(); + } + + static voidpf ZipFile_opendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode) { + if (stream == nullptr) + return nullptr; + + auto* zipFileInfo = (ZipFilePrivate*) opaque; + std::string diskFilename = zipFileInfo->zipFileName; + + const auto pos = diskFilename.rfind('.', std::string::npos); + + if (pos != std::string::npos && pos != 0) { + const size_t bufferSize = 5; + char extensionBuffer[bufferSize]; + snprintf(&extensionBuffer[0], bufferSize, ".z%02u", number_disk + 1); + diskFilename.replace(pos, std::min((size_t) 4, zipFileInfo->zipFileName.size() - pos), extensionBuffer); + return ZipFile_open_file_func(opaque, diskFilename.c_str(), mode); + } + + return nullptr; + } + + static uint32_t ZipFile_read_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size) { + if (stream == nullptr) + return (uint32_t) -1; + + auto* fs = (FileStream*) stream; + return fs->read(buf, size); + } + + static uint32_t ZipFile_write_file_func(voidpf opaque, voidpf stream, const void* buf, uint32_t size) { + if (stream == nullptr) + return (uint32_t) -1; + + auto* fs = (FileStream*) stream; + return fs->write(buf, size); + } + + static int ZipFile_close_file_func(voidpf opaque, voidpf stream) { + if (stream == nullptr) + return -1; + + auto* fs = (FileStream*) stream; + const auto result = fs->close(); // 0 for success, -1 for error + delete fs; + return result; + } + + // THis isn't supported by FileStream, so just check if the stream is null and open + static int ZipFile_error_file_func(voidpf opaque, voidpf stream) { + if (stream == nullptr) { + return -1; + } + + auto* fs = (FileStream*) stream; + + if (fs->isOpen()) { + return 0; + } + + return -1; + } + // End of Overrides + std::string zipFileName; unzFile zipFile; std::mutex zipFileMtx; @@ -519,114 +627,10 @@ public: // std::unordered_map is faster if available on the platform typedef std::unordered_map FileListContainer; FileListContainer fileList; + + zlib_filefunc_def functionOverrides{}; }; -// unzip overrides to support FileStream -long ZipFile_tell_file_func(voidpf opaque, voidpf stream) -{ - if (stream == nullptr) - return -1; - - auto* fs = (FileStream*)stream; - - return fs->tell(); -} - -long ZipFile_seek_file_func(voidpf opaque, voidpf stream, uint32_t offset, int origin) -{ - if (stream == nullptr) - return -1; - - auto* fs = (FileStream*)stream; - - return fs->seek((long)offset, origin); // must return 0 for success or -1 for error -} - -voidpf ZipFile_open_file_func(voidpf opaque, const char* filename, int mode) -{ - FileStream::Mode fsMode; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ) - fsMode = FileStream::Mode::READ; - else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - fsMode = FileStream::Mode::APPEND; - else if (mode & ZLIB_FILEFUNC_MODE_CREATE) - fsMode = FileStream::Mode::WRITE; - else - return nullptr; - - return FileUtils::getInstance()->openFileStream(filename, fsMode).release(); -} - -voidpf ZipFile_opendisk_file_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode) -{ - if (stream == nullptr) - return nullptr; - - auto* zipFileInfo = (ZipFilePrivate*)opaque; - std::string diskFilename = zipFileInfo->zipFileName; - - const auto pos = diskFilename.rfind('.', std::string::npos); - - if (pos != std::string::npos && pos != 0) - { - const size_t bufferSize = 5; - char extensionBuffer[bufferSize]; - snprintf(&extensionBuffer[0], bufferSize, ".z%02u", number_disk + 1); - diskFilename.replace(pos, std::min((size_t)4, zipFileInfo->zipFileName.size() - pos), extensionBuffer); - return ZipFile_open_file_func(opaque, diskFilename.c_str(), mode); - } - - return nullptr; -} - -uint32_t ZipFile_read_file_func(voidpf opaque, voidpf stream, void* buf, uint32_t size) -{ - if (stream == nullptr) - return (uint32_t)-1; - - auto* fs = (FileStream*)stream; - return fs->read(buf, size); -} - -uint32_t ZipFile_write_file_func(voidpf opaque, voidpf stream, const void* buf, uint32_t size) -{ - if (stream == nullptr) - return (uint32_t)-1; - - auto* fs = (FileStream*)stream; - return fs->write(buf, size); -} - -int ZipFile_close_file_func(voidpf opaque, voidpf stream) -{ - if (stream == nullptr) - return -1; - - auto* fs = (FileStream*)stream; - const auto result = fs->close(); // 0 for success, -1 for error - delete fs; - return result; -} - -// THis isn't supported by FileStream, so just check if the stream is null and open -int ZipFile_error_file_func(voidpf opaque, voidpf stream) -{ - if (stream == nullptr) - { - return -1; - } - - auto* fs = (FileStream*)stream; - - if (fs->isOpen()) - { - return 0; - } - - return -1; -} -// End of Overrides - ZipFile *ZipFile::createWithBuffer(const void* buffer, uLong size) { ZipFile *zip = new (std::nothrow) ZipFile(); @@ -639,18 +643,16 @@ ZipFile *ZipFile::createWithBuffer(const void* buffer, uLong size) } ZipFile::ZipFile() -: _data(new ZipFilePrivate) +: _data(new ZipFilePrivate()) { - fillFunctionOverrides(); _data->zipFile = nullptr; } ZipFile::ZipFile(const std::string &zipFile, const std::string &filter) -: _data(new ZipFilePrivate) +: _data(new ZipFilePrivate()) { - fillFunctionOverrides(); _data->zipFileName = zipFile; - _data->zipFile = unzOpen2(zipFile.c_str(), &_functionOverrides); + _data->zipFile = unzOpen2(zipFile.c_str(), &_data->functionOverrides); setFilter(filter); } @@ -829,7 +831,7 @@ std::string ZipFile::getFirstFilename() { if (unzGoToFirstFile(_data->zipFile) != UNZ_OK) return emptyFilename; std::string path; - unz_file_info info; + unz_file_info_s info; getCurrentFileInfo(&path, &info); return path; } @@ -838,13 +840,12 @@ std::string ZipFile::getNextFilename() { if (unzGoToNextFile(_data->zipFile) != UNZ_OK) return emptyFilename; std::string path; - unz_file_info info; + unz_file_info_s info; getCurrentFileInfo(&path, &info); return path; } -int ZipFile::getCurrentFileInfo(std::string *filename, unz_file_info *info) -{ +int ZipFile::getCurrentFileInfo(std::string* filename, unz_file_info_s* info) { char path[FILENAME_MAX + 1]; int ret = unzGetCurrentFileInfo(_data->zipFile, info, path, sizeof(path), nullptr, 0, nullptr, 0); if (ret != UNZ_OK) { @@ -974,7 +975,7 @@ unsigned char* ZipFile::getFileDataFromZip(const std::string& zipFilePath, const CC_BREAK_IF(UNZ_OK != ret); char filePathA[260]; - unz_file_info fileInfo; + unz_file_info_s fileInfo; ret = unzGetCurrentFileInfo(file, &fileInfo, filePathA, sizeof(filePathA), nullptr, 0, nullptr, 0); CC_BREAK_IF(UNZ_OK != ret); @@ -997,17 +998,4 @@ unsigned char* ZipFile::getFileDataFromZip(const std::string& zipFilePath, const return buffer; } -void ZipFile::fillFunctionOverrides() -{ - _functionOverrides.zopen_file = ZipFile_open_file_func; - _functionOverrides.zopendisk_file = ZipFile_opendisk_file_func; - _functionOverrides.zread_file = ZipFile_read_file_func; - _functionOverrides.zwrite_file = ZipFile_write_file_func; - _functionOverrides.ztell_file = ZipFile_tell_file_func; - _functionOverrides.zseek_file = ZipFile_seek_file_func; - _functionOverrides.zclose_file = ZipFile_close_file_func; - _functionOverrides.zerror_file = ZipFile_error_file_func; - _functionOverrides.opaque = _data; -} - NS_CC_END diff --git a/cocos/base/ZipUtils.h b/cocos/base/ZipUtils.h index 990a563a01..1fc3de4bbf 100644 --- a/cocos/base/ZipUtils.h +++ b/cocos/base/ZipUtils.h @@ -29,8 +29,6 @@ THE SOFTWARE. #define __SUPPORT_ZIPUTILS_H__ /// @cond DO_NOT_SHOW -#include - #include "platform/CCPlatformMacros.h" #include "platform/CCFileUtils.h" #include @@ -43,7 +41,7 @@ THE SOFTWARE. #endif #ifndef _unz64_H -typedef struct unz_file_info_s unz_file_info; +struct unz_file_info_s; #endif /** @@ -212,9 +210,8 @@ namespace cocos2d // forward declaration struct ZipEntryInfo; - class ZipFilePrivate; - struct unz_file_info_s; - + struct ZipFilePrivate; + struct ZipFileStream { ZipEntryInfo* entry; @@ -319,16 +316,14 @@ namespace cocos2d CC_DEPRECATED() static unsigned char* getFileDataFromZip(const std::string& zipFilePath, const std::string& filename, ssize_t* size); private: - void fillFunctionOverrides(); /* Only used internal for createWithBuffer() */ ZipFile(); bool initWithBuffer(const void *buffer, unsigned long size); - int getCurrentFileInfo(std::string *filename, unz_file_info *info); + int getCurrentFileInfo(std::string* filename, unz_file_info_s* info); /** Internal data like zip file pointer / file list array and so on */ ZipFilePrivate *_data; - zlib_filefunc_def _functionOverrides{}; }; } // end of namespace cocos2d diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 3ebb5e62c9..bacbc9f9af 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -37,6 +37,7 @@ #else // from our embedded sources #include "unzip.h" #endif +#include NS_CC_EXT_BEGIN @@ -372,7 +373,7 @@ bool AssetsManager::uncompress() // Open the zip file string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME; - zlib_filefunc_def zipFunctionOverrides; + zlib_filefunc_def_s zipFunctionOverrides; fillZipFunctionOverrides(zipFunctionOverrides); AssetManagerZipFileInfo zipFileInfo; @@ -631,8 +632,7 @@ AssetsManager* AssetsManager::create(const char* packageUrl, const char* version return manager; } -void AssetsManager::fillZipFunctionOverrides(zlib_filefunc_def& zipFunctionOverrides) -{ +void AssetsManager::fillZipFunctionOverrides(zlib_filefunc_def_s& zipFunctionOverrides) { zipFunctionOverrides.zopen_file = AssetManager_open_file_func; zipFunctionOverrides.zopendisk_file = AssetManager_opendisk_file_func; zipFunctionOverrides.zread_file = AssetManager_read_file_func; diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 4024f5f7d4..43ec5f09a2 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -26,7 +26,6 @@ #ifndef __AssetsManager__ #define __AssetsManager__ -#include #include #include @@ -35,6 +34,7 @@ #include "extensions/ExtensionMacros.h" #include "extensions/ExtensionExport.h" +struct zlib_filefunc_def_s; namespace cocos2d { namespace network { class Downloader; @@ -170,7 +170,7 @@ protected: bool uncompress(); void setSearchPath(); void downloadAndUncompress(); - void fillZipFunctionOverrides(zlib_filefunc_def& zipFunctionOverrides); + void fillZipFunctionOverrides(zlib_filefunc_def_s& zipFunctionOverrides); private: //! The path to store downloaded resources. diff --git a/extensions/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/AssetsManagerEx.cpp index 731d731db9..1496644dc5 100644 --- a/extensions/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/AssetsManagerEx.cpp @@ -34,6 +34,7 @@ #else // from our embedded sources #include "unzip.h" #endif +#include #include "base/CCAsyncTaskPool.h" NS_CC_EXT_BEGIN @@ -427,7 +428,7 @@ bool AssetsManagerEx::decompress(const std::string &zip) } const std::string rootPath = zip.substr(0, pos+1); - zlib_filefunc_def zipFunctionOverrides; + zlib_filefunc_def_s zipFunctionOverrides; fillZipFunctionOverrides(zipFunctionOverrides); AssetManagerExZipFileInfo zipFileInfo; @@ -1296,8 +1297,7 @@ void AssetsManagerEx::onDownloadUnitsFinished() } } -void AssetsManagerEx::fillZipFunctionOverrides(zlib_filefunc_def& zipFunctionOverrides) -{ +void AssetsManagerEx::fillZipFunctionOverrides(zlib_filefunc_def_s& zipFunctionOverrides) { zipFunctionOverrides.zopen_file = AssetManagerEx_open_file_func; zipFunctionOverrides.zopendisk_file = AssetManagerEx_opendisk_file_func; zipFunctionOverrides.zread_file = AssetManagerEx_read_file_func; diff --git a/extensions/assets-manager/AssetsManagerEx.h b/extensions/assets-manager/AssetsManagerEx.h index 82322993f1..b0d823f56a 100644 --- a/extensions/assets-manager/AssetsManagerEx.h +++ b/extensions/assets-manager/AssetsManagerEx.h @@ -26,7 +26,6 @@ #ifndef __AssetsManagerEx__ #define __AssetsManagerEx__ -#include #include #include #include @@ -42,6 +41,8 @@ #include "extensions/ExtensionExport.h" #include "rapidjson/document-wrapper.h" +struct zlib_filefunc_def_s; + NS_CC_EXT_BEGIN @@ -220,7 +221,7 @@ private: // Called when one DownloadUnits finished void onDownloadUnitsFinished(); - void fillZipFunctionOverrides(zlib_filefunc_def &zipFunctionOverrides); + void fillZipFunctionOverrides(zlib_filefunc_def_s &zipFunctionOverrides); //! The event of the current AssetsManagerEx in event dispatcher std::string _eventName; diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index d7b3bd5634..03de6a6d3e 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/extensions -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/extensions -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID cxxgenerator_headers = diff --git a/tools/tolua/cocos2dx_3d.ini b/tools/tolua/cocos2dx_3d.ini index e64f189032..f845e328e8 100644 --- a/tools/tolua/cocos2dx_3d.ini +++ b/tools/tolua/cocos2dx_3d.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID cxxgenerator_headers = diff --git a/tools/tolua/cocos2dx_audioengine.ini b/tools/tolua/cocos2dx_audioengine.ini index d097f6be2f..88c98a0f37 100644 --- a/tools/tolua/cocos2dx_audioengine.ini +++ b/tools/tolua/cocos2dx_audioengine.ini @@ -16,7 +16,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_backend.ini b/tools/tolua/cocos2dx_backend.ini index 19761fa9e6..5711215471 100644 --- a/tools/tolua/cocos2dx_backend.ini +++ b/tools/tolua/cocos2dx_backend.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/extensions -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/extensions -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID cxxgenerator_headers = diff --git a/tools/tolua/cocos2dx_controller.ini b/tools/tolua/cocos2dx_controller.ini index fdc31d953b..d5500b7e45 100644 --- a/tools/tolua/cocos2dx_controller.ini +++ b/tools/tolua/cocos2dx_controller.ini @@ -16,7 +16,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID cxxgenerator_headers = diff --git a/tools/tolua/cocos2dx_csloader.ini b/tools/tolua/cocos2dx_csloader.ini index b1ebddd271..6219300f96 100644 --- a/tools/tolua/cocos2dx_csloader.ini +++ b/tools/tolua/cocos2dx_csloader.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_extension.ini b/tools/tolua/cocos2dx_extension.ini index 046b58ddb2..d5ac503216 100644 --- a/tools/tolua/cocos2dx_extension.ini +++ b/tools/tolua/cocos2dx_extension.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external -I%(cocosdir)s/external/json +cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty -I%(cocosdir)s/thirdparty/rapidjson cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_navmesh.ini b/tools/tolua/cocos2dx_navmesh.ini index 1f488e54c8..eb443e8e39 100644 --- a/tools/tolua/cocos2dx_navmesh.ini +++ b/tools/tolua/cocos2dx_navmesh.ini @@ -18,7 +18,7 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -DCC_USE_NAVME win32_clang_flags = -U __SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external -I%(cocosdir)s/external/recast/Detour -I%(cocosdir)s/external/recast/DetourCrowd -I%(cocosdir)s/external/recast/DetourTileCache -I%(cocosdir)s/external/recast/DebugUtils -I%(cocosdir)s/external/recast/fastlz -I%(cocosdir)s/external/recast/Recast -I%(cocosdir)s/external/lua/luajit/include -I%(cocosdir)s/external/lua/tolua -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/scripting/lua-bindings/manual +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty -I%(cocosdir)s/thirdparty/recast/Detour -I%(cocosdir)s/thirdparty/recast/DetourCrowd -I%(cocosdir)s/thirdparty/recast/DetourTileCache -I%(cocosdir)s/thirdparty/recast/DebugUtils -I%(cocosdir)s/thirdparty/recast/fastlz -I%(cocosdir)s/thirdparty/recast/Recast -I%(cocosdir)s/thirdparty/lua/luajit/include -I%(cocosdir)s/thirdparty/lua/tolua -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/scripting/lua-bindings/manual cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_physics.ini b/tools/tolua/cocos2dx_physics.ini index eec1763cfc..8a5ab2e154 100644 --- a/tools/tolua/cocos2dx_physics.ini +++ b/tools/tolua/cocos2dx_physics.ini @@ -16,7 +16,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_physics3d.ini b/tools/tolua/cocos2dx_physics3d.ini index 1210dd375b..cbeee849c2 100644 --- a/tools/tolua/cocos2dx_physics3d.ini +++ b/tools/tolua/cocos2dx_physics3d.ini @@ -18,7 +18,7 @@ clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -DCC_ENABLE_BU win32_clang_flags = -U __SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external -I%(cocosdir)s/external/bullet +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty -I%(cocosdir)s/thirdparty/bullet cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_spine.ini b/tools/tolua/cocos2dx_spine.ini index 767d982299..277fa1bb29 100644 --- a/tools/tolua/cocos2dx_spine.ini +++ b/tools/tolua/cocos2dx_spine.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/spine -I%(cocosdir)s/extensions/spine/runtime/include -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/spine -I%(cocosdir)s/extensions/spine/runtime/include -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index a37f654479..bed1726c94 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -17,7 +17,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/external -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external/lua/luajit/include -I%(cocosdir)s/external/lua/tolua -I%(cocosdir)s/extensions/scripting/lua-bindings/manual +cocos_headers = -I%(cocosdir)s/thirdparty -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty/lua/luajit/include -I%(cocosdir)s/thirdparty/lua/tolua -I%(cocosdir)s/extensions/scripting/lua-bindings/manual cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_video.ini b/tools/tolua/cocos2dx_video.ini index bf9a13d5e7..23ba4e382f 100644 --- a/tools/tolua/cocos2dx_video.ini +++ b/tools/tolua/cocos2dx_video.ini @@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID diff --git a/tools/tolua/cocos2dx_webview.ini b/tools/tolua/cocos2dx_webview.ini index e0ed93cebe..a14606dfaf 100644 --- a/tools/tolua/cocos2dx_webview.ini +++ b/tools/tolua/cocos2dx_webview.ini @@ -13,7 +13,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT clang_headers = clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__ -cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/external +cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/extensions -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty cocos_flags = -DANDROID