diff --git a/CMakeOptions.md b/CMakeOptions.md index 6ccd0498aa..87bb4d1272 100644 --- a/CMakeOptions.md +++ b/CMakeOptions.md @@ -40,6 +40,7 @@ - win32: whether use ANGLE GLES backend - osx: whether use OpenGL instead Metal backend - ios/tvos: whether use GLES instead Metal backend +- AX_CORE_PROFILE: whether strip deprecated features, default `FALSE` - AX_ISA_LEVEL: specifiy SIMD Instructions Acceleration Level: 0~4, 0: disabled, 1: SSE2, 2: SSE4.1/NEON, 3: SSE4.2, 4: AVX2, default: 2 - AX_GLES_PROFILE: specify GLES profile version for GLES backend, valid value `200`, `300` - AX_WASM_THREADS: specify wasm thread count, valid value: number: `>=0` , string: must be: `auto` or `navigator.hardwareConcurrency`(default), diff --git a/core/2d/FastTMXTiledMap.h b/core/2d/FastTMXTiledMap.h index b04eac75e1..c2cbd8f72b 100644 --- a/core/2d/FastTMXTiledMap.h +++ b/core/2d/FastTMXTiledMap.h @@ -204,9 +204,9 @@ public: * animations are not enabled by default */ void setTileAnimEnabled(bool enabled); - - AX_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); } - +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) int getLayerNum() const { return getLayerCount(); } +#endif int getLayerCount() const { return _layerCount; } std::string_view getResourceFile() const { return _tmxFile; } @@ -268,4 +268,4 @@ private: // @API compatible typedef FastTMXTiledMap TMXTiledMap; -} +} // namespace ax diff --git a/core/2d/FontAtlasCache.cpp b/core/2d/FontAtlasCache.cpp index 6dc974e660..36a9d01245 100644 --- a/core/2d/FontAtlasCache.cpp +++ b/core/2d/FontAtlasCache.cpp @@ -144,12 +144,12 @@ FontAtlas* FontAtlasCache::getFontAtlasFNT(std::string_view fontFileName, const return nullptr; } - +#ifndef AX_CORE_PROFILE FontAtlas* FontAtlasCache::getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset) { return getFontAtlasFNT(fontFileName, Rect(imageOffset.x, imageOffset.y, 0, 0), false); } - +#endif FontAtlas* FontAtlasCache::getFontAtlasCharMap(std::string_view plistFile) { std::string_view atlasName = plistFile; @@ -260,11 +260,12 @@ void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Rec _atlasMap.emplace(std::move(atlasName), tempAtlas); } } - +#ifndef AX_CORE_PROFILE void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset) { reloadFontAtlasFNT(fontFileName, Rect(imageOffset.x, imageOffset.y, 0, 0), false); } +#endif void FontAtlasCache::unloadFontAtlasTTF(std::string_view fontFileName) { diff --git a/core/2d/FontAtlasCache.h b/core/2d/FontAtlasCache.h index e3294babb1..964d52c309 100644 --- a/core/2d/FontAtlasCache.h +++ b/core/2d/FontAtlasCache.h @@ -52,8 +52,9 @@ public: static FontAtlas* getFontAtlasFNT(std::string_view fontFileName); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, std::string_view subTextureKey); static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - AX_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); - +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset); +#endif static FontAtlas* getFontAtlasCharMap(std::string_view charMapFile, int itemWidth, int itemHeight, @@ -73,10 +74,10 @@ public: otherwise, it will cause program crash! */ static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated); - - AX_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName, +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) static void reloadFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset = Vec2::ZERO); - +#endif /** Unload all texture atlas texture create by special file name. CAUTION : All component use this font texture should be reset font name, though the file name is same! otherwise, it will cause program crash! diff --git a/core/2d/FontFNT.cpp b/core/2d/FontFNT.cpp index 5fb6259f61..74916fa290 100644 --- a/core/2d/FontFNT.cpp +++ b/core/2d/FontFNT.cpp @@ -590,12 +590,12 @@ FontFNT* FontFNT::create(std::string_view fntFilePath) tempFont->autorelease(); return tempFont; } - +#ifndef AX_CORE_PROFILE FontFNT* FontFNT::create(std::string_view fntFilePath, const Vec2& imageOffset) { return create(fntFilePath, Rect(imageOffset.x, imageOffset.y, 0, 0), false); } - +#endif FontFNT::FontFNT(BMFontConfiguration* theContfig, const Rect& imageRect, bool imageRotated) : _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated) { diff --git a/core/2d/FontFNT.h b/core/2d/FontFNT.h index f9b3af2d7d..1df12c5673 100644 --- a/core/2d/FontFNT.h +++ b/core/2d/FontFNT.h @@ -149,9 +149,9 @@ public: static FontFNT* create(std::string_view fntFilePath, const Rect& imageRect, bool imageRotated); static FontFNT* create(std::string_view fntFilePath, std::string_view subTextureKey); static FontFNT* create(std::string_view fntFilePath); - - AX_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); - +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO); +#endif /** Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary. */ diff --git a/core/2d/Label.cpp b/core/2d/Label.cpp index 0c5b31e820..05e0309826 100644 --- a/core/2d/Label.cpp +++ b/core/2d/Label.cpp @@ -360,6 +360,7 @@ Label* Label::createWithBMFont(std::string_view bmfontPath, return nullptr; } +#ifndef AX_CORE_PROFILE Label* Label::createWithBMFont(std::string_view bmfontPath, std::string_view text, const TextHAlignment& hAlignment, @@ -369,7 +370,7 @@ Label* Label::createWithBMFont(std::string_view bmfontPath, return createWithBMFont(bmfontPath, text, hAlignment, maxLineWidth, Rect(imageOffset.x, imageOffset.y, 0, 0), false); } - +#endif Label* Label::createWithCharMap(std::string_view plistFile) { auto ret = new Label(); @@ -927,12 +928,12 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, std::string_view return true; } - +#ifndef AX_CORE_PROFILE bool Label::setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& imageOffset, float fontSize) { return setBMFontFilePath(bmfontFilePath, Rect(imageOffset.x, imageOffset.y, 0, 0), false); } - +#endif void Label::setString(std::string_view text) { if (text.compare(_utf8Text)) diff --git a/core/2d/Label.h b/core/2d/Label.h index c6531ce4c0..b6978f7324 100644 --- a/core/2d/Label.h +++ b/core/2d/Label.h @@ -273,12 +273,13 @@ public: * @return An automatically released Label object. * @see setBMFontFilePath setMaxLineWidth */ - AX_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath, +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) static Label* createWithBMFont(std::string_view bmfontPath, std::string_view text, const TextHAlignment& hAlignment, int maxLineWidth, const Vec2& imageOffset); - +#endif /** * Allocates and initializes a Label, with char map configuration. * @@ -341,12 +342,12 @@ public: /** Sets a new bitmap font to Label */ virtual bool setBMFontFilePath(std::string_view bmfontFilePath, std::string_view subTextureKey, float fontSize = 0); - +#ifndef AX_CORE_PROFILE /** Sets a new bitmap font to Label */ - AX_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath, + AX_DEPRECATED(2.1) virtual bool setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& imageOffset, float fontSize = 0); - +#endif /** Returns the bitmap font used by the Label.*/ std::string_view getBMFontFilePath() const { return _bmFontPath; } @@ -794,8 +795,10 @@ protected: virtual void updateShaderProgram(); virtual void updateFontScale(); +#ifndef AX_CORE_PROFILE /* DEPRECATED: use updateFontScale instead */ - AX_DEPRECATED_ATTRIBUTE virtual void updateBMFontScale() { updateFontScale(); } + AX_DEPRECATED(2.1) virtual void updateBMFontScale() { updateFontScale(); } +#endif void scaleFontSize(float fontSize); bool setTTFConfigInternal(const TTFConfig& ttfConfig); bool updateTTFConfigInternal(); diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index abbd1d8be9..6deed277ad 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -32,7 +32,7 @@ # include_guard (GLOBAL) # The version number -set(_AX_VERSION 2.1) +set(_AX_VERSION 2.2) if(NOT DEFINED _AX_CORE_LIB) set(_AX_CORE_LIB axmol CACHE INTERNAL "The axmol core lib name" ) @@ -114,6 +114,7 @@ cmake_dependent_option(AX_ENABLE_NAVMESH "Build NavMesh support" ON "AX_ENABLE_3 option(AX_UPDATE_BUILD_VERSION "Update build version" ON) option(AX_DISABLE_GLES2 "Whether disable GLES2 support" OFF) +option(AX_CORE_PROFILE "Whether strip deprecated features" OFF) # default value for axmol extensions modules to Build # total supported extensions count: 13 @@ -319,6 +320,7 @@ ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_NAVMESH) ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_MEDIA) ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_AUDIO) ax_config_pred(${_AX_CORE_LIB} AX_ENABLE_CONSOLE) +ax_config_pred(${_AX_CORE_LIB} AX_CORE_PROFILE) # use 3rdparty libs add_subdirectory(${_AX_ROOT}/3rdparty ${ENGINE_BINARY_PATH}/3rdparty) diff --git a/core/axmol.h b/core/axmol.h index 3309002f2e..3108206a58 100644 --- a/core/axmol.h +++ b/core/axmol.h @@ -38,7 +38,9 @@ THE SOFTWARE. #include "base/Config.h" // base -#include "base/AsyncTaskPool.h" +#ifndef AX_CORE_PROFILE +# include "base/AsyncTaskPool.h" +#endif #include "base/AutoreleasePool.h" #include "base/Configuration.h" #include "base/Logging.h" diff --git a/core/base/CMakeLists.txt b/core/base/CMakeLists.txt index c3c752b79d..371dc85924 100644 --- a/core/base/CMakeLists.txt +++ b/core/base/CMakeLists.txt @@ -39,7 +39,6 @@ set(_AX_BASE_HEADER base/Event.h base/Types.h base/Enums.h - base/AsyncTaskPool.h base/Random.h base/Object.h base/Profiling.h @@ -85,7 +84,6 @@ set(_AX_BASE_HEADER ) set(_AX_BASE_SRC - base/AsyncTaskPool.cpp base/JobSystem.cpp base/AutoreleasePool.cpp base/Configuration.cpp @@ -141,6 +139,11 @@ set(_AX_BASE_SRC ${_AX_BASE_SPECIFIC_SRC} ) +if(NOT AX_CORE_PROFILE) + set(_AX_BASE_HEADER ${_AX_BASE_HEADER} base/AsyncTaskPool.h) + set(_AX_BASE_SRC ${_AX_BASE_SRC} base/AsyncTaskPool.cpp) +endif() + if(AX_ENABLE_CONSOLE) set(_AX_BASE_HEADER ${_AX_BASE_HEADER} base/Console.h) set(_AX_BASE_SRC ${_AX_BASE_SRC} base/Console.cpp) diff --git a/core/base/Data.h b/core/base/Data.h index 77ca7bbd6d..8bcf282ca4 100644 --- a/core/base/Data.h +++ b/core/base/Data.h @@ -38,7 +38,6 @@ * @addtogroup base * @js NA * @lua NA - * @DEPRECATED use axstd::byte_buffer directly */ namespace ax { diff --git a/core/base/Director.cpp b/core/base/Director.cpp index b8624f4487..dbeefd9647 100644 --- a/core/base/Director.cpp +++ b/core/base/Director.cpp @@ -57,7 +57,9 @@ THE SOFTWARE. #include "base/Logging.h" #include "base/AutoreleasePool.h" #include "base/Configuration.h" -#include "base/AsyncTaskPool.h" +#ifndef AX_CORE_PROFILE +# include "base/AsyncTaskPool.h" +#endif #include "base/ObjectFactory.h" #include "platform/Application.h" #if defined(AX_ENABLE_AUDIO) @@ -1057,7 +1059,9 @@ void Director::reset() AnimationCache::destroyInstance(); SpriteFrameCache::destroyInstance(); FileUtils::destroyInstance(); +#ifndef AX_CORE_PROFILE AsyncTaskPool::destroyInstance(); +#endif backend::ProgramStateRegistry::destroyInstance(); backend::ProgramManager::destroyInstance(); diff --git a/core/base/Logging.cpp b/core/base/Logging.cpp index 741a2bac9b..73500b6936 100644 --- a/core/base/Logging.cpp +++ b/core/base/Logging.cpp @@ -230,7 +230,7 @@ AX_DLL void writeLog(LogItem& item, const char* tag) # endif #endif } - +#ifndef AX_CORE_PROFILE AX_API void print(const char* format, ...) { va_list args; @@ -243,5 +243,5 @@ AX_API void print(const char* format, ...) outputLog(LogItem::vformat(FMT_COMPILE("{}{}\n"), preprocessLog(LogItem{LogLevel::Silent}), message), "axmol debug info"); } - +#endif } diff --git a/core/base/Logging.h b/core/base/Logging.h index 8d6212d063..e1a41e20d7 100644 --- a/core/base/Logging.h +++ b/core/base/Logging.h @@ -160,9 +160,10 @@ inline void printLogT(_FmtType&& fmt, LogItem& item, _Types&&... args) #define AXLOGT AXLOGV +#ifndef AX_CORE_PROFILE /** @brief Output Debug message. */ -/* AX_DEPRECATED_ATTRIBUTE*/ AX_API void print(const char* format, ...) AX_FORMAT_PRINTF(1, 2); // use AXLOGD instead - +/* AX_DEPRECATED(2.1)*/ AX_API void print(const char* format, ...) AX_FORMAT_PRINTF(1, 2); // use AXLOGD instead +#endif } diff --git a/core/base/Scheduler.h b/core/base/Scheduler.h index a3e8424544..c00b84a368 100644 --- a/core/base/Scheduler.h +++ b/core/base/Scheduler.h @@ -471,12 +471,12 @@ public: @js NA */ void runOnAxmolThread(std::function action); - - AX_DEPRECATED_ATTRIBUTE void performFunctionInCocosThread(std::function action) +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) void performFunctionInCocosThread(std::function action) { runOnAxmolThread(std::move(action)); } - +#endif /** * Remove all pending functions queued to be performed with Scheduler::runOnAxmolThread * Functions unscheduled in this manner will not be executed @@ -485,8 +485,9 @@ public: * @js NA */ void removeAllPendingActions(); - AX_DEPRECATED_ATTRIBUTE void removeAllFunctionsToBePerformedInCocosThread() { removeAllPendingActions(); } - +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) void removeAllFunctionsToBePerformedInCocosThread() { removeAllPendingActions(); } +#endif protected: /** Schedules the 'callback' function for a given target with a given priority. The 'callback' selector will be called every frame. diff --git a/core/base/ScriptSupport.cpp b/core/base/ScriptSupport.cpp index 2dfbec22f2..224cda4f38 100644 --- a/core/base/ScriptSupport.cpp +++ b/core/base/ScriptSupport.cpp @@ -59,7 +59,7 @@ ScriptHandlerEntry::~ScriptHandlerEntry() if (_handler != 0) { ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_handler); - LUALOG("[LUA] Remove event handler: %d", _handler); + AXLOGD("[LUA] Remove event handler: %d", _handler); _handler = 0; } } @@ -80,14 +80,14 @@ bool SchedulerScriptHandlerEntry::init(float interval, bool paused) _timer = new TimerScriptHandler(); _timer->initWithScriptHandler(_handler, interval); _paused = paused; - LUALOG("[LUA] ADD script schedule: %d, entryID: %d", _handler, _entryId); + AXLOGD("[LUA] ADD script schedule: {}, entryID: {}", _handler, _entryId); return true; } SchedulerScriptHandlerEntry::~SchedulerScriptHandlerEntry() { _timer->release(); - LUALOG("[LUA] DEL script schedule %d, entryID: %d", _handler, _entryId); + AXLOGD("[LUA] DEL script schedule {}, entryID: {}", _handler, _entryId); } // diff --git a/core/base/UTF8.cpp b/core/base/UTF8.cpp index 5fb98c2011..76ecbd13bc 100644 --- a/core/base/UTF8.cpp +++ b/core/base/UTF8.cpp @@ -38,7 +38,7 @@ namespace ax namespace StringUtils { - +//#ifndef AX_CORE_PROFILE std::string AX_DLL format(const char* format, ...) { va_list args; @@ -116,7 +116,7 @@ std::string vformat(const char* format, va_list ap) return buf; } - +//#endif /* * @str: the string to search through. * @c: the character to not look for. diff --git a/core/base/UTF8.h b/core/base/UTF8.h index f3d3c84d5e..f4dc22ee77 100644 --- a/core/base/UTF8.h +++ b/core/base/UTF8.h @@ -66,10 +66,11 @@ inline std::string toString(T arg) { return fmt::to_string(arg); } - +//#ifndef AX_CORE_PROFILE // DEPRECATED since axmol-2.1.4, use fmt::format instead std::string AX_DLL format(const char* format, ...) AX_FORMAT_PRINTF(1, 2); std::string AX_DLL vformat(const char* format, va_list ap); +//#endif /** * @brief Converts from UTF8 string to UTF16 string. diff --git a/core/cocos2d.h b/core/cocos2d.h index 4c057ca6b2..75d469bb46 100644 --- a/core/cocos2d.h +++ b/core/cocos2d.h @@ -25,10 +25,14 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +!!! The cocos2d-x compatibility header, please reserve this file, because some +extensions use it, i.g fairygui, live2d ... + ****************************************************************************/ -#ifndef __COCOS2D_H__ -#define __COCOS2D_H__ +#ifndef __AX_COCOS2DX_H__ +#define __AX_COCOS2DX_H__ #include "axmol.h" @@ -49,23 +53,22 @@ using Ref = Object; #define setDisplayStats setStatsDisplay -} +} // namespace ax namespace cocos2d = ax; -#define CC_SAFE_RELEASE AX_SAFE_RELEASE -#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL -#define CC_SAFE_DELETE AX_SAFE_DELETE -#define CCASSERT AXASSERT -#define CC_ASSERT AX_ASSERT -#define CC_CONSTRUCTOR_ACCESS public - -#define CCLOG AXLOG -#define CCLOGINFO AXLOGINFO -#define CCLOGWARN AXLOGWARN -#define CCLOGERROR AXLOGERROR - -#define CC_DEPRECATED_ATTRIBUTE AX_DEPRECATED_ATTRIBUTE +#define CC_SAFE_RELEASE AX_SAFE_RELEASE +#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL +#define CC_SAFE_DELETE AX_SAFE_DELETE +#define CCASSERT AXASSERT +#define CC_ASSERT AX_ASSERT +#define CC_CONSTRUCTOR_ACCESS public +#ifndef AX_CORE_PROFILE +# define CCLOG AXLOG +# define CCLOGINFO AXLOGINFO +# define CCLOGWARN AXLOGWARN +# define CCLOGERROR AXLOGERROR +#endif #define CC_SAFE_RETAIN AX_SAFE_RETAIN diff --git a/core/platform/FileUtils.cpp b/core/platform/FileUtils.cpp index 4a3c5f37d9..880a8edbe7 100644 --- a/core/platform/FileUtils.cpp +++ b/core/platform/FileUtils.cpp @@ -489,7 +489,7 @@ bool FileUtils::writeStringToFile(std::string_view dataStr, std::string_view ful { return FileUtils::writeBinaryToFile(dataStr.data(), dataStr.size(), fullPath); } - +#ifndef AX_CORE_PROFILE void FileUtils::writeStringToFile(std::string dataStr, std::string_view fullPath, std::function callback) const @@ -500,12 +500,12 @@ void FileUtils::writeStringToFile(std::string dataStr, }, std::move(callback), std::move(dataStr)); } - +#endif bool FileUtils::writeDataToFile(const Data& data, std::string_view fullPath) const { return FileUtils::writeBinaryToFile(data.getBytes(), data.getSize(), fullPath); } - +#ifndef AX_CORE_PROFILE void FileUtils::writeDataToFile(Data data, std::string_view fullPath, std::function callback) const { performOperationOffthread( @@ -514,7 +514,7 @@ void FileUtils::writeDataToFile(Data data, std::string_view fullPath, std::funct }, std::move(callback), std::move(data)); } - +#endif bool FileUtils::writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath) { AXASSERT(!fullPath.empty() && dataSize > 0, "Invalid parameters."); @@ -553,7 +553,7 @@ std::string FileUtils::getStringFromFile(std::string_view filename) const getContents(filename, &s); return s; } - +#ifndef AX_CORE_PROFILE void FileUtils::getStringFromFile(std::string_view path, std::function callback) const { // Get the full path on the main thread, to avoid the issue that FileUtil's is not @@ -563,14 +563,14 @@ void FileUtils::getStringFromFile(std::string_view path, std::function std::string { return FileUtils::getInstance()->getStringFromFile(path); }, std::move(callback)); } - +#endif Data FileUtils::getDataFromFile(std::string_view filename) const { Data d; getContents(filename, &d); return d; } - +#ifndef AX_CORE_PROFILE void FileUtils::getDataFromFile(std::string_view filename, std::function callback) const { auto fullPath = fullPathForFilename(filename); @@ -578,7 +578,7 @@ void FileUtils::getDataFromFile(std::string_view filename, std::function Data { return FileUtils::getInstance()->getDataFromFile(path); }, std::move(callback)); } - +#endif FileUtils::Status FileUtils::getContents(std::string_view filename, ResizableBuffer* buffer) const { if (filename.empty()) @@ -614,7 +614,7 @@ FileUtils::Status FileUtils::getContents(std::string_view filename, ResizableBuf return Status::OK; } - +#ifndef AX_CORE_PROFILE void FileUtils::writeValueMapToFile(ValueMap dict, std::string_view fullPath, std::function callback) const { @@ -635,7 +635,7 @@ void FileUtils::writeValueVectorToFile(ValueVector vecData, }, std::move(callback), std::move(vecData)); } - +#endif std::string FileUtils::getPathForFilename(std::string_view filename, std::string_view searchPath) const { auto file = filename; @@ -923,7 +923,7 @@ bool FileUtils::isFileExist(std::string_view filename) const return !fullpath.empty(); } } - +#ifndef AX_CORE_PROFILE void FileUtils::isFileExist(std::string_view filename, std::function callback) const { auto fullPath = fullPathForFilename(filename); @@ -931,7 +931,7 @@ void FileUtils::isFileExist(std::string_view filename, std::function [path = std::string{fullPath}]() -> bool { return FileUtils::getInstance()->isFileExist(path); }, std::move(callback)); } - +#endif bool FileUtils::isAbsolutePath(std::string_view path) const { return isAbsolutePathInternal(path); @@ -970,6 +970,8 @@ bool FileUtils::isDirectoryExist(std::string_view dirPath) const } } +#ifndef AX_CORE_PROFILE + void FileUtils::isDirectoryExist(std::string_view fullPath, std::function callback) const { AXASSERT(isAbsolutePath(fullPath), "Async isDirectoryExist only accepts absolute file paths"); @@ -1049,6 +1051,7 @@ void FileUtils::listFilesRecursivelyAsync(std::string_view dirPath, }, std::move(callback)); } +#endif std::unique_ptr FileUtils::openFileStream(std::string_view filePath, IFileStream::Mode mode) const { diff --git a/core/platform/FileUtils.h b/core/platform/FileUtils.h index 77498d45e4..ac36e595bf 100644 --- a/core/platform/FileUtils.h +++ b/core/platform/FileUtils.h @@ -144,30 +144,12 @@ public: */ virtual std::string getStringFromFile(std::string_view filename) const; - /** - * Gets string from a file, async off the main cocos thread - * - * @param path filepath for the string to be read. Can be relative or absolute path - * @param callback Function that will be called when file is read. Will be called - * on the main cocos thread. - */ - virtual void getStringFromFile(std::string_view path, std::function callback) const; - /** * Creates binary data from a file. * @return A data object. */ virtual Data getDataFromFile(std::string_view filename) const; - /** - * Gets a binary data object from a file, async off the main cocos thread. - * - * @param filename filepath for the data to be read. Can be relative or absolute path - * @param callback Function that will be called when file is read. Will be called - * on the main cocos thread. - */ - virtual void getDataFromFile(std::string_view filename, std::function callback) const; - enum class Status { OK = 0, @@ -433,23 +415,6 @@ public: */ virtual bool writeStringToFile(std::string_view dataStr, std::string_view fullPath) const; - /** - * Write a string to a file, done async off the main cocos thread - * Use this function if you need file access without blocking the main thread. - * - * This function takes a std::string by value on purpose, to leverage move sematics. - * If you want to avoid a copy of your datastr, use std::move/std::forward if appropriate - * - * @param dataStr the string want to save - * @param fullPath The full path to the file you want to save a string - * @param callback The function called once the string has been written to a file. This - * function will be executed on the main cocos thread. It will have on boolean argument - * signifying if the write was successful. - */ - virtual void writeStringToFile(std::string dataStr, - std::string_view fullPath, - std::function callback) const; - /** * write Data into a file * @@ -464,22 +429,6 @@ public: */ static bool writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath); - /** - * Write Data into a file, done async off the main cocos thread. - * - * Use this function if you need to write Data while not blocking the main cocos thread. - * - * This function takes Data by value on purpose, to leverage move sematics. - * If you want to avoid a copy of your data, use std::move/std::forward if appropriate - * - *@param data The data that will be written to disk - *@param fullPath The absolute file path that the data will be written to - *@param callback The function that will be called when data is written to disk. This - * function will be executed on the main cocos thread. It will have on boolean argument - * signifying if the write was successful. - */ - virtual void writeDataToFile(Data data, std::string_view fullPath, std::function callback) const; - /** * write ValueMap into a plist file * @@ -489,24 +438,6 @@ public: */ virtual bool writeValueMapToFile(const ValueMap& dict, std::string_view fullPath) const; - /** - * Write a ValueMap into a file, done async off the main cocos thread. - * - * Use this function if you need to write a ValueMap while not blocking the main cocos thread. - * - * This function takes ValueMap by value on purpose, to leverage move sematics. - * If you want to avoid a copy of your dict, use std::move/std::forward if appropriate - * - *@param dict The ValueMap that will be written to disk - *@param fullPath The absolute file path that the data will be written to - *@param callback The function that will be called when dict is written to disk. This - * function will be executed on the main cocos thread. It will have on boolean argument - * signifying if the write was successful. - */ - virtual void writeValueMapToFile(ValueMap dict, - std::string_view fullPath, - std::function callback) const; - /** * write ValueVector into a plist file * @@ -516,24 +447,6 @@ public: */ virtual bool writeValueVectorToFile(const ValueVector& vecData, std::string_view fullPath) const; - /** - * Write a ValueVector into a file, done async off the main cocos thread. - * - * Use this function if you need to write a ValueVector while not blocking the main cocos thread. - * - * This function takes ValueVector by value on purpose, to leverage move sematics. - * If you want to avoid a copy of your dict, use std::move/std::forward if appropriate - * - *@param vecData The ValueVector that will be written to disk - *@param fullPath The absolute file path that the data will be written to - *@param callback The function that will be called when vecData is written to disk. This - * function will be executed on the main cocos thread. It will have on boolean argument - * signifying if the write was successful. - */ - virtual void writeValueVectorToFile(ValueVector vecData, - std::string_view fullPath, - std::function callback) const; - // Converts the contents of a file to a ValueVector. // This method is used internally. virtual ValueVector getValueVectorFromFile(std::string_view filename) const; @@ -547,34 +460,14 @@ public: */ virtual bool isFileExist(std::string_view filename) const; - /** - * Checks if a file exists, done async off the main cocos thread. - * - * Use this function if you need to check if a file exists while not blocking the main cocos thread. - * - * @note If a relative path was passed in, it will be inserted a default root path at the beginning. - * @param filename The path of the file, it could be a relative or absolute path. - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the file exists, false otherwise. - */ - virtual void isFileExist(std::string_view filename, std::function callback) const; - /** * Gets filename extension is a suffix (separated from the base filename by a dot) in lower case. * Examples of filename extensions are .png, .jpeg, .exe, .dmg and .txt. * @param filePath The path of the file, it could be a relative or absolute path. * @return suffix for filename in lower case or empty if a dot not found. */ - AX_DEPRECATED_ATTRIBUTE static std::string getFileExtension(std::string_view filePath) { return getPathExtension(filePath); } static std::string getPathExtension(std::string_view filePath); - /** - * Gets filename shotName - * @param filePath The path of the file, it could be a relative or absolute path. - * @return fileName.Extension without path - */ - AX_DEPRECATED_ATTRIBUTE static std::string getFileShortName(std::string_view filePath) { return getPathBaseName(filePath); } - /* * @since axmol-2.1.5 */ @@ -611,15 +504,6 @@ public: */ virtual bool isDirectoryExist(std::string_view dirPath) const; - /** - * Checks whether the absoulate path is a directory, async off of the main cocos thread. - * - * @param dirPath The path of the directory, it must be an absolute path - * @param callback that will accept a boolean, true if the file exists, false otherwise. - * Callback will happen on the main cocos thread. - */ - virtual void isDirectoryExist(std::string_view fullPath, std::function callback) const; - /** * Creates a directory. * @@ -627,16 +511,6 @@ public: * @return True if the directory have been created successfully, false if not. */ virtual bool createDirectories(std::string_view dirPath) const; - AX_DEPRECATED_ATTRIBUTE bool createDirectory(std::string_view dirPath) const { return createDirectories(dirPath); } - - /** - * Create a directory, async off the main cocos thread. - * - * @param dirPath the path of the directory, it must be an absolute path - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the directory was successfully, false otherwise. - */ - AX_DEPRECATED_ATTRIBUTE void createDirectory(std::string_view dirPath, std::function callback) const; /** * Removes a directory. @@ -646,15 +520,6 @@ public: */ virtual bool removeDirectory(std::string_view dirPath) const; - /** - * Removes a directory, async off the main cocos thread. - * - * @param dirPath the path of the directory, it must be an absolute path - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the directory was successfully removed, false otherwise. - */ - AX_DEPRECATED_ATTRIBUTE void removeDirectory(std::string_view dirPath, std::function callback) const; - /** * Removes a file. * @@ -663,15 +528,6 @@ public: */ virtual bool removeFile(std::string_view filepath) const; - /** - * Removes a file, async off the main cocos thread. - * - * @param filepath the path of the file to remove, it must be an absolute path - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the file was successfully removed, false otherwise. - */ - AX_DEPRECATED_ATTRIBUTE virtual void removeFile(std::string_view filepath, std::function callback) const; - /** * Renames a file under the given directory. * @@ -682,20 +538,6 @@ public: */ virtual bool renameFile(std::string_view path, std::string_view oldname, std::string_view name) const; - /** - * Renames a file under the given directory, async off the main cocos thread. - * - * @param path The parent directory path of the file, it must be an absolute path. - * @param oldname The current name of the file. - * @param name The new name of the file. - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the file was successfully renamed, false otherwise. - */ - AX_DEPRECATED_ATTRIBUTE virtual void renameFile(std::string_view path, - std::string_view oldname, - std::string_view name, - std::function callback) const; - /** * Renames a file under the given directory. * @@ -705,18 +547,6 @@ public: */ virtual bool renameFile(std::string_view oldfullpath, std::string_view newfullpath) const; - /** - * Renames a file under the given directory, async off the main cocos thread. - * - * @param oldfullpath The current fullpath of the file. Includes path and name. - * @param newfullpath The new fullpath of the file. Includes path and name. - * @param callback The function that will be called when the operation is complete. Will have one boolean - * argument, true if the file was successfully renamed, false otherwise. - */ - AX_DEPRECATED_ATTRIBUTE void renameFile(std::string_view oldfullpath, - std::string_view newfullpath, - std::function callback) const; - /** * Retrieve the file size. * @@ -726,6 +556,183 @@ public: */ virtual int64_t getFileSize(std::string_view filepath) const; + /** + * List all files in a directory. + * + * @param dirPath The path of the directory, it could be a relative or an absolute path. + * @return File paths in a string vector + */ + virtual std::vector listFiles(std::string_view dirPath) const; + + /** + * List all files recursively in a directory. + * + * @param dirPath The path of the directory, it could be a relative or an absolute path. + * @return File paths in a string vector + */ + virtual void listFilesRecursively(std::string_view dirPath, std::vector* files) const; + + +#ifndef AX_CORE_PROFILE + /** + * Gets string from a file, async off the main cocos thread + * + * @param path filepath for the string to be read. Can be relative or absolute path + * @param callback Function that will be called when file is read. Will be called + * on the main cocos thread. + */ + AX_DEPRECATED(2.1) virtual void getStringFromFile(std::string_view path, std::function callback) const; + /** + * Gets a binary data object from a file, async off the main cocos thread. + * + * @param filename filepath for the data to be read. Can be relative or absolute path + * @param callback Function that will be called when file is read. Will be called + * on the main cocos thread. + */ + AX_DEPRECATED(2.1) virtual void getDataFromFile(std::string_view filename, std::function callback) const; + /** + * Write a string to a file, done async off the main cocos thread + * Use this function if you need file access without blocking the main thread. + * + * This function takes a std::string by value on purpose, to leverage move sematics. + * If you want to avoid a copy of your datastr, use std::move/std::forward if appropriate + * + * @param dataStr the string want to save + * @param fullPath The full path to the file you want to save a string + * @param callback The function called once the string has been written to a file. This + * function will be executed on the main cocos thread. It will have on boolean argument + * signifying if the write was successful. + */ + AX_DEPRECATED(2.1) virtual void writeStringToFile(std::string dataStr, + std::string_view fullPath, + std::function callback) const; + /** + * Write Data into a file, done async off the main cocos thread. + * + * Use this function if you need to write Data while not blocking the main cocos thread. + * + * This function takes Data by value on purpose, to leverage move sematics. + * If you want to avoid a copy of your data, use std::move/std::forward if appropriate + * + *@param data The data that will be written to disk + *@param fullPath The absolute file path that the data will be written to + *@param callback The function that will be called when data is written to disk. This + * function will be executed on the main cocos thread. It will have on boolean argument + * signifying if the write was successful. + */ + AX_DEPRECATED(2.1) virtual void writeDataToFile(Data data, std::string_view fullPath, std::function callback) const; + /** + * Write a ValueMap into a file, done async off the main cocos thread. + * + * Use this function if you need to write a ValueMap while not blocking the main cocos thread. + * + * This function takes ValueMap by value on purpose, to leverage move sematics. + * If you want to avoid a copy of your dict, use std::move/std::forward if appropriate + * + *@param dict The ValueMap that will be written to disk + *@param fullPath The absolute file path that the data will be written to + *@param callback The function that will be called when dict is written to disk. This + * function will be executed on the main cocos thread. It will have on boolean argument + * signifying if the write was successful. + */ + AX_DEPRECATED(2.1) virtual void writeValueMapToFile(ValueMap dict, + std::string_view fullPath, + std::function callback) const; + /** + * Write a ValueVector into a file, done async off the main cocos thread. + * + * Use this function if you need to write a ValueVector while not blocking the main cocos thread. + * + * This function takes ValueVector by value on purpose, to leverage move sematics. + * If you want to avoid a copy of your dict, use std::move/std::forward if appropriate + * + *@param vecData The ValueVector that will be written to disk + *@param fullPath The absolute file path that the data will be written to + *@param callback The function that will be called when vecData is written to disk. This + * function will be executed on the main cocos thread. It will have on boolean argument + * signifying if the write was successful. + */ + AX_DEPRECATED(2.1) virtual void writeValueVectorToFile(ValueVector vecData, + std::string_view fullPath, + std::function callback) const; + /** + * Checks if a file exists, done async off the main cocos thread. + * + * Use this function if you need to check if a file exists while not blocking the main cocos thread. + * + * @note If a relative path was passed in, it will be inserted a default root path at the beginning. + * @param filename The path of the file, it could be a relative or absolute path. + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the file exists, false otherwise. + */ + AX_DEPRECATED(2.1) virtual void isFileExist(std::string_view filename, std::function callback) const; + + AX_DEPRECATED(2.1) static std::string getFileExtension(std::string_view filePath) { return getPathExtension(filePath); } + AX_DEPRECATED(2.1) static std::string getFileShortName(std::string_view filePath) { return getPathBaseName(filePath); } + /** + * Checks whether the absoulate path is a directory, async off of the main cocos thread. + * + * @param dirPath The path of the directory, it must be an absolute path + * @param callback that will accept a boolean, true if the file exists, false otherwise. + * Callback will happen on the main cocos thread. + */ + AX_DEPRECATED(2.1) virtual void isDirectoryExist(std::string_view fullPath, std::function callback) const; + + AX_DEPRECATED(2.1) bool createDirectory(std::string_view dirPath) const { return createDirectories(dirPath); } + + /** + * Create a directory, async off the main cocos thread. + * + * @param dirPath the path of the directory, it must be an absolute path + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the directory was successfully, false otherwise. + */ + AX_DEPRECATED(2.1) void createDirectory(std::string_view dirPath, std::function callback) const; + + /** + * Removes a directory, async off the main cocos thread. + * + * @param dirPath the path of the directory, it must be an absolute path + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the directory was successfully removed, false otherwise. + */ + AX_DEPRECATED(2.1) void removeDirectory(std::string_view dirPath, std::function callback) const; + + /** + * Removes a file, async off the main cocos thread. + * + * @param filepath the path of the file to remove, it must be an absolute path + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the file was successfully removed, false otherwise. + */ + AX_DEPRECATED(2.1) virtual void removeFile(std::string_view filepath, std::function callback) const; + + /** + * Renames a file under the given directory, async off the main cocos thread. + * + * @param path The parent directory path of the file, it must be an absolute path. + * @param oldname The current name of the file. + * @param name The new name of the file. + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the file was successfully renamed, false otherwise. + */ + AX_DEPRECATED(2.1) virtual void renameFile(std::string_view path, + std::string_view oldname, + std::string_view name, + std::function callback) const; + + /** + * Renames a file under the given directory, async off the main cocos thread. + * + * @param oldfullpath The current fullpath of the file. Includes path and name. + * @param newfullpath The new fullpath of the file. Includes path and name. + * @param callback The function that will be called when the operation is complete. Will have one boolean + * argument, true if the file was successfully renamed, false otherwise. + */ + AX_DEPRECATED(2.1) void renameFile(std::string_view oldfullpath, + std::string_view newfullpath, + std::function callback) const; + /** * Retrieve the file size, async off the main cocos thread. * @@ -734,15 +741,7 @@ public: * @param callback The function that will be called when the operation is complete. Will have one long * argument, the file size. */ - AX_DEPRECATED_ATTRIBUTE void getFileSize(std::string_view filepath, std::function callback) const; - - /** - * List all files in a directory. - * - * @param dirPath The path of the directory, it could be a relative or an absolute path. - * @return File paths in a string vector - */ - virtual std::vector listFiles(std::string_view dirPath) const; + AX_DEPRECATED(2.1) void getFileSize(std::string_view filepath, std::function callback) const; /** * List all files in a directory async, off of the main cocos thread. @@ -753,15 +752,7 @@ public: * @js NA * @lua NA */ - AX_DEPRECATED_ATTRIBUTE void listFilesAsync(std::string_view dirPath, std::function)> callback) const; - - /** - * List all files recursively in a directory. - * - * @param dirPath The path of the directory, it could be a relative or an absolute path. - * @return File paths in a string vector - */ - virtual void listFilesRecursively(std::string_view dirPath, std::vector* files) const; + AX_DEPRECATED(2.1) void listFilesAsync(std::string_view dirPath, std::function)> callback) const; /** * List all files recursively in a directory, async off the main cocos thread. @@ -772,9 +763,9 @@ public: * @js NA * @lua NA */ - AX_DEPRECATED_ATTRIBUTE void listFilesRecursivelyAsync(std::string_view dirPath, + AX_DEPRECATED(2.1) void listFilesRecursivelyAsync(std::string_view dirPath, std::function)> callback) const; - +#endif /** Returns the full path cache. */ const hlookup::string_map getFullPathCache() const { return _fullPathCache; } diff --git a/core/platform/PlatformMacros.h b/core/platform/PlatformMacros.h index a48c4779e6..e1b615f66a 100644 --- a/core/platform/PlatformMacros.h +++ b/core/platform/PlatformMacros.h @@ -314,52 +314,52 @@ public: \ #define AX_BREAK_IF(cond) \ if (cond) \ break - -#define __AXLOGWITHFUNCTION(s, ...) \ - ax::print("%s : %s", __FUNCTION__, ax::StringUtils::format(s, ##__VA_ARGS__).c_str()) - +#ifndef AX_CORE_PROFILE +# define __AXLOGWITHFUNCTION(s, ...) \ + ax::print("%s : %s", __FUNCTION__, ax::StringUtils::format(s, ##__VA_ARGS__).c_str()) /// @name legacy log macros, deprecated since axmol 2.1.4, use AXLOGD, AXLOGI, AXLOGW, ... instead /// @{ -#if !defined(_AX_DEBUG) || _AX_DEBUG == 0 -# define AXLOG(...) \ - do \ - { \ - } while (0) -# define AXLOGINFO(...) \ - do \ - { \ - } while (0) -# define AXLOGERROR(...) \ - do \ - { \ - } while (0) -# define AXLOGWARN(...) \ - do \ - { \ - } while (0) +# if !defined(_AX_DEBUG) || _AX_DEBUG == 0 +# define AXLOG(...) \ + do \ + { \ + } while (0) +# define AXLOGINFO(...) \ + do \ + { \ + } while (0) +# define AXLOGERROR(...) \ + do \ + { \ + } while (0) +# define AXLOGWARN(...) \ + do \ + { \ + } while (0) -#elif _AX_DEBUG == 1 -# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__) -# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__) -# define AXLOGINFO(format, ...) \ - do \ - { \ - } while (0) -# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) +# elif _AX_DEBUG == 1 +# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__) +# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__) +# define AXLOGINFO(format, ...) \ + do \ + { \ + } while (0) +# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) -#elif _AX_DEBUG > 1 -# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__) -# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__) -# define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__) -# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) -#endif // _AX_DEBUG +# elif _AX_DEBUG > 1 +# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__) +# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__) +# define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__) +# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__) +# endif // _AX_DEBUG /** Lua engine debug */ -#if !defined(_AX_DEBUG) || _AX_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0 -# define LUALOG(...) -#else -# define LUALOG(format, ...) ax::print(format, ##__VA_ARGS__) -#endif // Lua engine debug +# if !defined(_AX_DEBUG) || _AX_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0 +# define LUALOG(...) +# else +# define LUALOG(format, ...) ax::print(format, ##__VA_ARGS__) +# endif // Lua engine debug +#endif // end of debug group /// @} @@ -391,23 +391,18 @@ public: \ TypeName(); \ AX_DISALLOW_COPY_AND_ASSIGN(TypeName) -/** @def AX_DEPRECATED_ATTRIBUTE - * Only certain compilers support __attribute__((deprecated)). - */ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -# define AX_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#elif _MSC_VER >= 1400 // vs 2005 or higher -# define AX_DEPRECATED_ATTRIBUTE __declspec(deprecated) -#else -# define AX_DEPRECATED_ATTRIBUTE -#endif - /** @def AX_DEPRECATED(...) * Macro to mark things deprecated as of a particular version * can be used with arbitrary parameters which are thrown away. * e.g. AX_DEPRECATED(4.0) or AX_DEPRECATED(4.0, "not going to need this anymore") etc. */ -#define AX_DEPRECATED(...) AX_DEPRECATED_ATTRIBUTE +#if defined(_WIN32) +# define AX_DEPRECATED(...) __declspec(deprecated) +#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) +# define AX_DEPRECATED(...) __attribute__((deprecated)) +#else +# define AX_DEPRECATED(...) +#endif /** @def AX_FORMAT_PRINTF(formatPos, argPos) * Only certain compiler support __attribute__((format)) diff --git a/core/platform/android/Application-android.h b/core/platform/android/Application-android.h index e83f82c424..11a57b9b53 100644 --- a/core/platform/android/Application-android.h +++ b/core/platform/android/Application-android.h @@ -61,10 +61,10 @@ public: @return Current application instance pointer. */ static Application* getInstance(); - +#ifndef AX_CORE_PROFILE /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - + AX_DEPRECATED(2.1) static Application* sharedApplication(); +#endif /** @brief Get current language config @return Current language config diff --git a/core/platform/linux/Application-linux.h b/core/platform/linux/Application-linux.h index dbde22f5c5..9066d1ec27 100644 --- a/core/platform/linux/Application-linux.h +++ b/core/platform/linux/Application-linux.h @@ -64,10 +64,10 @@ public: @return Current application instance pointer. */ static Application* getInstance(); - +#ifndef AX_CORE_PROFILE /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - + AX_DEPRECATED(2.1) static Application* sharedApplication(); +#endif /* override functions */ virtual LanguageType getCurrentLanguage() override; diff --git a/core/platform/wasm/Application-wasm.h b/core/platform/wasm/Application-wasm.h index bafa58316e..61868fabbd 100644 --- a/core/platform/wasm/Application-wasm.h +++ b/core/platform/wasm/Application-wasm.h @@ -69,10 +69,10 @@ public: @return Current application instance pointer. */ static Application* getInstance(); - +#ifndef AX_CORE_PROFILE /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication(); - + AX_DEPRECATED(2.1) static Application* sharedApplication(); +#endif /* override functions */ virtual LanguageType getCurrentLanguage() override; @@ -94,19 +94,19 @@ public: */ virtual bool openURL(std::string_view url) override; - +#ifndef AX_CORE_PROFILE /** * Sets the Resource root path. * @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead. */ - AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir); + AX_DEPRECATED(2.1) void setResourceRootPath(const std::string& rootResDir); /** * Gets the Resource root path. * @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. */ - AX_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(); - + AX_DEPRECATED(2.1) const std::string& getResourceRootPath(); +#endif /** @brief Get target platform */ diff --git a/core/renderer/Texture2D.cpp b/core/renderer/Texture2D.cpp index 330ea49d4f..8f3bc6017f 100644 --- a/core/renderer/Texture2D.cpp +++ b/core/renderer/Texture2D.cpp @@ -192,7 +192,7 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i { if (image == nullptr) { - __AXLOGWITHFUNCTION("axmol: Texture2D. Can't create Texture. UIImage is nil"); + AXLOGW("axmol: Texture2D. Can't create Texture. UIImage is nil"); return false; } diff --git a/core/renderer/backend/ProgramManager.h b/core/renderer/backend/ProgramManager.h index 4dc3eb9ac7..944b618d1e 100644 --- a/core/renderer/backend/ProgramManager.h +++ b/core/renderer/backend/ProgramManager.h @@ -103,23 +103,23 @@ public: * Unload all program objects from cache. */ void unloadAllPrograms(); - +#ifndef AX_CORE_PROFILE /** * Remove a program object from cache. * @param program Specifies the program object to move. */ - AX_DEPRECATED_ATTRIBUTE void removeProgram(Program* prog) { unloadProgram(prog); } + AX_DEPRECATED(2.1) void removeProgram(Program* prog) { unloadProgram(prog); } /** * Remove all unused program objects from cache. */ - AX_DEPRECATED_ATTRIBUTE void removeUnusedProgram() { unloadUnusedPrograms(); } + AX_DEPRECATED(2.1) void removeUnusedProgram() { unloadUnusedPrograms(); } /** * Remove all program objects from cache. */ - AX_DEPRECATED_ATTRIBUTE void removeAllPrograms() { unloadAllPrograms(); } - + AX_DEPRECATED(2.1) void removeAllPrograms() { unloadAllPrograms(); } +#endif protected: ProgramManager(); virtual ~ProgramManager(); diff --git a/core/renderer/backend/ProgramState.cpp b/core/renderer/backend/ProgramState.cpp index 18a5c41e2c..70da1bcc8e 100644 --- a/core/renderer/backend/ProgramState.cpp +++ b/core/renderer/backend/ProgramState.cpp @@ -280,6 +280,7 @@ void ProgramState::setFragmentUniform(int location, const void* data, std::size_ } #endif +#ifndef AX_CORE_PROFILE void ProgramState::setVertexAttrib(std::string_view name, std::size_t index, VertexFormat format, @@ -296,7 +297,7 @@ void ProgramState::setVertexStride(uint32_t stride) ensureVertexLayoutMutable(); _vertexLayout->setStride(stride); } - +#endif void ProgramState::validateSharedVertexLayout(VertexLayoutType vlt) { if (!_ownVertexLayout && !_vertexLayout->isValid()) diff --git a/core/renderer/backend/ProgramState.h b/core/renderer/backend/ProgramState.h index f310cfa6ab..64036af783 100644 --- a/core/renderer/backend/ProgramState.h +++ b/core/renderer/backend/ProgramState.h @@ -306,17 +306,17 @@ public: * so batch ID was set to -1 indicate batch was disabled */ void updateBatchId(); - +#ifndef AX_CORE_PROFILE /* * Follow API is deprecated, use getMutableVertexLayout instead */ - AX_DEPRECATED_ATTRIBUTE void setVertexAttrib(std::string_view name, + AX_DEPRECATED(2.1) void setVertexAttrib(std::string_view name, std::size_t index, VertexFormat format, std::size_t offset, bool needToBeNormallized); - AX_DEPRECATED_ATTRIBUTE void setVertexStride(uint32_t stride); - + AX_DEPRECATED(2.1) void setVertexStride(uint32_t stride); +#endif /** Custom shader program's vertex layout maybe not setup * so engine specific render node(such as Sprite) should invoke this API when ProgramState changed */ diff --git a/core/renderer/backend/VertexLayout.h b/core/renderer/backend/VertexLayout.h index 4cba06cb76..ff2ed5658e 100644 --- a/core/renderer/backend/VertexLayout.h +++ b/core/renderer/backend/VertexLayout.h @@ -81,8 +81,8 @@ public: VertexFormat format, std::size_t offset, bool needNormalized); - - AX_DEPRECATED_ATTRIBUTE void setAttribute(std::string_view name, +#ifndef AX_CORE_PROFILE + AX_DEPRECATED(2.1) void setAttribute(std::string_view name, std::size_t index, VertexFormat format, std::size_t offset, @@ -90,7 +90,7 @@ public: { setAttrib(name, index, format, offset, needNormalized); } - +#endif /** * Set stride of vertices. * @param stride Specifies the distance between the data of two vertices, in bytes. diff --git a/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.cpp b/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.cpp index b57c11e158..fc17ce99c8 100644 --- a/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.cpp +++ b/extensions/Effekseer/EffekseerForCocos2d-x/EffekseerForCocos2d-x.cpp @@ -215,7 +215,7 @@ Effekseer::TextureRef TextureLoader::Load(const EFK_CHAR* path, ::Effekseer::Tex { char path8[300]; ::Effekseer::ConvertUtf16ToUtf8(path8, 300, path); - CCLOG("%s : The texture is not shown on a mobile. The size is not power of two.", path8); + AXLOGW("{} : The texture is not shown on a mobile. The size is not power of two.", path8); } #endif } diff --git a/extensions/assets-manager/src/assets-manager/AssetsManager.cpp b/extensions/assets-manager/src/assets-manager/AssetsManager.cpp index 22b06bf543..7a5bc51f7b 100644 --- a/extensions/assets-manager/src/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/src/assets-manager/AssetsManager.cpp @@ -417,7 +417,7 @@ bool AssetsManager::uncompress() { // Entry is a directory, so create it. // If the directory exists, it will failed silently. - if (!FileUtils::getInstance()->createDirectory(fullPath)) + if (!FileUtils::getInstance()->createDirectories(fullPath)) { AXLOGD("can not create directory {}", fullPath); unzClose(zipfile); @@ -442,7 +442,7 @@ bool AssetsManager::uncompress() auto fsOut = FileUtils::getInstance()->openFileStream(dir, FileStream::Mode::READ); if (!fsOut) { - if (!FileUtils::getInstance()->createDirectory(dir)) + if (!FileUtils::getInstance()->createDirectories(dir)) { AXLOGD("can not create directory {}", dir); unzClose(zipfile); diff --git a/extensions/assets-manager/src/assets-manager/AssetsManagerEx.cpp b/extensions/assets-manager/src/assets-manager/AssetsManagerEx.cpp index efe053a47c..4c645c5133 100644 --- a/extensions/assets-manager/src/assets-manager/AssetsManagerEx.cpp +++ b/extensions/assets-manager/src/assets-manager/AssetsManagerEx.cpp @@ -307,7 +307,7 @@ void AssetsManagerEx::loadLocalManifest(std::string_view /*manifestUrl*/) { // Recreate storage, to empty the content _fileUtils->removeDirectory(_storagePath); - _fileUtils->createDirectory(_storagePath); + _fileUtils->createDirectories(_storagePath); AX_SAFE_RELEASE(cachedManifest); } else @@ -371,12 +371,12 @@ void AssetsManagerEx::setStoragePath(std::string_view storagePath) { _storagePath = storagePath; adjustPath(_storagePath); - _fileUtils->createDirectory(_storagePath); + _fileUtils->createDirectories(_storagePath); _tempStoragePath = _storagePath; _tempStoragePath.append(TEMP_FOLDERNAME); adjustPath(_tempStoragePath); - _fileUtils->createDirectory(_tempStoragePath); + _fileUtils->createDirectories(_tempStoragePath); } void AssetsManagerEx::adjustPath(std::string& path) @@ -447,7 +447,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) { // There are not directory entry in some case. // So we need to create directory when decompressing file entry - if (!_fileUtils->createDirectory(basename(fullPath))) + if (!_fileUtils->createDirectories(basename(fullPath))) { // Failed to create directory AXLOGD("AssetsManagerEx : can not create directory {}\n", fullPath); @@ -461,7 +461,7 @@ bool AssetsManagerEx::decompress(std::string_view zip) std::string_view dir = basename(fullPath); if (!_fileUtils->isDirectoryExist(dir)) { - if (!_fileUtils->createDirectory(dir)) + if (!_fileUtils->createDirectories(dir)) { // Failed to create directory AXLOGD("AssetsManagerEx : can not create directory {}\n", fullPath); @@ -778,7 +778,7 @@ void AssetsManagerEx::startUpdate() _fileUtils->removeDirectory(_tempStoragePath); AX_SAFE_RELEASE(_tempManifest); // Recreate temp storage path and save remote manifest - _fileUtils->createDirectory(_tempStoragePath); + _fileUtils->createDirectories(_tempStoragePath); _remoteManifest->saveToFile(_tempManifestPath); } @@ -846,7 +846,7 @@ void AssetsManagerEx::updateSucceed() // Create directory if (relativePath.back() == '/') { - _fileUtils->createDirectory(dstPath); + _fileUtils->createDirectories(dstPath); } // Copy file else @@ -1258,7 +1258,7 @@ void AssetsManagerEx::queueDowload() _currConcurrentTask++; DownloadUnit& unit = _downloadUnits[key]; - _fileUtils->createDirectory(basename(unit.storagePath)); + _fileUtils->createDirectories(basename(unit.storagePath)); _downloader->createDownloadFileTask(unit.srcUrl, unit.storagePath, unit.customId); _tempManifest->setAssetDownloadState(key, Manifest::DownloadState::DOWNLOADING); diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.cpp b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.cpp index c19d89f7a3..f6d6fc056e 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.cpp @@ -102,11 +102,6 @@ void ActionTimelineCache::destroyInstance() AX_SAFE_DELETE(_sharedActionCache); } -void ActionTimelineCache::purge() -{ - _animationActions.clear(); -} - void ActionTimelineCache::init() { using namespace std::placeholders; diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h index bba73ff84f..9203d4b0dc 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h @@ -66,8 +66,6 @@ public: /** Destroys the singleton */ static void destroyInstance(); - void purge(); - void init(); /** Remove action with filename, and also remove other resource relate with this file */ diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp index 802573f719..a7424ba2f2 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp @@ -248,8 +248,6 @@ CSLoader::CSLoader() CREATE_CLASS_NODE_READER_INFO(TextFieldExReader); } -void CSLoader::purge() {} - void CSLoader::init() { using namespace std::placeholders; diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h index f55b2f372a..349bebc614 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h @@ -75,8 +75,6 @@ public: static void destroyInstance(); CSLoader(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h b/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h index 01231b6003..146995bb0c 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h @@ -316,10 +316,6 @@ public: virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override; virtual Frame* clone() override; - /** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */ - AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } - AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } - inline void setColor(const ax::Color3B& color) { _color = color; } inline ax::Color3B getColor() const { return _color; } diff --git a/extensions/cocostudio/src/cocostudio/Armature.h b/extensions/cocostudio/src/cocostudio/Armature.h index 388a604786..59d8d5bd87 100644 --- a/extensions/cocostudio/src/cocostudio/Armature.h +++ b/extensions/cocostudio/src/cocostudio/Armature.h @@ -39,36 +39,6 @@ struct cpBody; namespace cocostudio { - -AX_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; -AX_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; -AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -AX_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; -AX_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; -AX_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; -AX_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; -AX_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; -AX_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; -AX_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; -AX_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; -AX_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; -AX_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; -AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -AX_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; -AX_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; -AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -AX_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; -AX_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; -AX_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; -AX_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; -AX_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; -AX_DEPRECATED_ATTRIBUTE typedef Bone CCBone; -AX_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; -AX_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; -AX_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -AX_DEPRECATED_ATTRIBUTE typedef ax::tweenfunc::TweenType CCTweenType; - class CCS_DLL Armature : public ax::Node, public ax::BlendProtocol { @@ -195,7 +165,7 @@ public: #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setColliderFilter(ColliderFilter* filter); #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - AX_DEPRECATED_ATTRIBUTE virtual void drawContour(); + AX_DEPRECATED(2.1) virtual void drawContour(); #endif virtual void setArmatureData(ArmatureData* armatureData) { _armatureData = armatureData; } diff --git a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp index f9e39682b8..77485b4025 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp +++ b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.cpp @@ -117,16 +117,6 @@ void ArmatureAnimation::stop() ProcessBase::stop(); } -void ArmatureAnimation::setAnimationScale(float animationScale) -{ - setSpeedScale(animationScale); -} - -float ArmatureAnimation::getAnimationScale() const -{ - return getSpeedScale(); -} - void ArmatureAnimation::setSpeedScale(float speedScale) { if (speedScale == _speedScale) @@ -246,11 +236,6 @@ void ArmatureAnimation::play(std::string_view animationName, int durationTo, int _armature->update(0); } -void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop) -{ - playWithIndex(animationIndex, durationTo, loop); -} - void ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop) { std::vector& movName = _animationData->movementNames; @@ -456,18 +441,6 @@ std::string ArmatureAnimation::getCurrentMovementID() const return _movementID; } -void ArmatureAnimation::setMovementEventCallFunc(Object* target, SEL_MovementEventCallFunc callFunc) -{ - _movementEventTarget = target; - _movementEventCallFunc = callFunc; -} - -void ArmatureAnimation::setFrameEventCallFunc(Object* target, SEL_FrameEventCallFunc callFunc) -{ - _frameEventTarget = target; - _frameEventCallFunc = callFunc; -} - void ArmatureAnimation::setMovementEventCallFunc( std::function listener) { diff --git a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h index 722332a7b4..6bea37856b 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h +++ b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h @@ -90,14 +90,6 @@ public: */ virtual bool init(Armature* armature); - /** - * Scale animation play speed. - * This method is deprecated, please use setSpeedScale. - * @param animationScale Scale value - */ - AX_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); - AX_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; - /** * Scale animation play speed. * @param animationScale Scale value @@ -105,9 +97,6 @@ public: virtual void setSpeedScale(float speedScale); virtual float getSpeedScale() const; - //! The animation update speed - AX_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} - using ProcessBase::play; /** * Play animation by animation name. @@ -130,7 +119,6 @@ public: * @deprecated, please use playWithIndex * @param animationIndex the animation index you want to play */ - AX_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithNames(const std::vector& movementNames, int durationTo = -1, bool loop = true); @@ -179,18 +167,6 @@ public: */ std::string getCurrentMovementID() const; - /** - * Set armature's movement event callback function - * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); - */ - AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(ax::Object* target, SEL_MovementEventCallFunc callFunc); - - /** - * Set armature's frame event callback function - * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr); - */ - AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(ax::Object* target, SEL_FrameEventCallFunc callFunc); - void setMovementEventCallFunc( std::function listener); void setFrameEventCallFunc( diff --git a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp index 596c9f376b..d9be52aa38 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp +++ b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.cpp @@ -50,8 +50,8 @@ ArmatureDataManager* ArmatureDataManager::getInstance() void ArmatureDataManager::destroyInstance() { - SpriteFrameCacheHelper::purge(); - DataReaderHelper::purge(); + SpriteFrameCacheHelper::destroyInstance(); + DataReaderHelper::destroyInstance(); AX_SAFE_RELEASE_NULL(s_sharedArmatureDataManager); } diff --git a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h index d268512ee9..6bebc68d3b 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h +++ b/extensions/cocostudio/src/cocostudio/ArmatureDataManager.h @@ -46,15 +46,6 @@ struct RelativeData class CCS_DLL ArmatureDataManager : public ax::Object { public: - /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static ArmatureDataManager* sharedArmatureDataManager() - { - return ArmatureDataManager::getInstance(); - } - - /** @deprecated Use destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; - static ArmatureDataManager* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/src/cocostudio/Bone.cpp b/extensions/cocostudio/src/cocostudio/Bone.cpp index ad37a76490..4b7b858a52 100644 --- a/extensions/cocostudio/src/cocostudio/Bone.cpp +++ b/extensions/cocostudio/src/cocostudio/Bone.cpp @@ -411,16 +411,6 @@ void Bone::removeDisplay(int index) _displayManager->removeDisplay(index); } -void Bone::changeDisplayByIndex(int index, bool force) -{ - changeDisplayWithIndex(index, force); -} - -void Bone::changeDisplayByName(std::string_view name, bool force) -{ - changeDisplayWithName(name, force); -} - void Bone::changeDisplayWithIndex(int index, bool force) { _displayManager->changeDisplayWithIndex(index, force); diff --git a/extensions/cocostudio/src/cocostudio/Bone.h b/extensions/cocostudio/src/cocostudio/Bone.h index e088aa6fdf..0a4d79b914 100644 --- a/extensions/cocostudio/src/cocostudio/Bone.h +++ b/extensions/cocostudio/src/cocostudio/Bone.h @@ -94,9 +94,6 @@ public: void removeDisplay(int index); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); - void changeDisplayWithIndex(int index, bool force); void changeDisplayWithName(std::string_view name, bool force); @@ -190,12 +187,6 @@ public: virtual void setIgnoreMovementBoneData(bool ignore) { _ignoreMovementBoneData = ignore; } virtual bool isIgnoreMovementBoneData() const { return _ignoreMovementBoneData; } - /* - * This function is deprecated, please use isIgnoreMovementBoneData() - * @lua NA - */ - AX_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } - /* * Set blend function */ diff --git a/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp b/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp index e51987f10a..a876f56931 100644 --- a/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp +++ b/extensions/cocostudio/src/cocostudio/DataReaderHelper.cpp @@ -237,7 +237,7 @@ float DataReaderHelper::getPositionReadScale() return s_PositionReadScale; } -void DataReaderHelper::purge() +void DataReaderHelper::destroyInstance() { _configFileList.clear(); AX_SAFE_RELEASE_NULL(_dataReaderHelper); diff --git a/extensions/cocostudio/src/cocostudio/DataReaderHelper.h b/extensions/cocostudio/src/cocostudio/DataReaderHelper.h index c8fe1ede94..eb27778714 100644 --- a/extensions/cocostudio/src/cocostudio/DataReaderHelper.h +++ b/extensions/cocostudio/src/cocostudio/DataReaderHelper.h @@ -86,13 +86,9 @@ protected: } DataInfo; public: - /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper() - { - return DataReaderHelper::getInstance(); - } static DataReaderHelper* getInstance(); + static void destroyInstance(); /** * Scale the position data, used for multiresolution adapter @@ -101,8 +97,6 @@ public: static void setPositionReadScale(float scale); static float getPositionReadScale(); - static void purge(); - public: /** * @js ctor diff --git a/extensions/cocostudio/src/cocostudio/DisplayManager.h b/extensions/cocostudio/src/cocostudio/DisplayManager.h index a0291a9c5f..1bf8b18f41 100644 --- a/extensions/cocostudio/src/cocostudio/DisplayManager.h +++ b/extensions/cocostudio/src/cocostudio/DisplayManager.h @@ -76,12 +76,6 @@ public: const ax::Vector& getDecorativeDisplayList() const; - /* - * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName - */ - AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force); - /** * Change display by index. You can just use this method to change display in the display list. * The display list is just used for this bone, and it is the displays you may use in every frame. diff --git a/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.cpp b/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.cpp index ea2176b89e..d08c6fdf21 100644 --- a/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.cpp +++ b/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.cpp @@ -122,11 +122,6 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() return _instanceFlatBuffersSerialize; } -void FlatBuffersSerialize::purge() -{ - AX_SAFE_DELETE(_instanceFlatBuffersSerialize); -} - void FlatBuffersSerialize::destroyInstance() { AX_SAFE_DELETE(_instanceFlatBuffersSerialize); diff --git a/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.h b/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.h index 5eb11a224b..00c49a6a1f 100644 --- a/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.h +++ b/extensions/cocostudio/src/cocostudio/FlatBuffersSerialize.h @@ -93,8 +93,6 @@ class CCS_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/extensions/cocostudio/src/cocostudio/InputDelegate.cpp b/extensions/cocostudio/src/cocostudio/InputDelegate.cpp index 4122c0e149..26fb698042 100644 --- a/extensions/cocostudio/src/cocostudio/InputDelegate.cpp +++ b/extensions/cocostudio/src/cocostudio/InputDelegate.cpp @@ -55,27 +55,6 @@ InputDelegate::~InputDelegate(void) Device::setAccelerometerEnabled(false); } -void InputDelegate::didAccelerate(ax::Acceleration* /*accelerationValue*/) {} - -bool InputDelegate::ccTouchBegan(ax::Touch* /*touch*/, ax::Event* /*event*/) -{ - return false; -} - -void InputDelegate::ccTouchMoved(ax::Touch* /*touch*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchEnded(ax::Touch* /*touch*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchCancelled(ax::Touch* /*touch*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchesBegan(ax::__Set* /*touches*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchesMoved(ax::__Set* /*touches*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchesEnded(ax::__Set* /*touches*/, ax::Event* /*event*/) {} - -void InputDelegate::ccTouchesCancelled(ax::__Set* /*touches*/, ax::Event* /*event*/) {} - void InputDelegate::onAcceleration(ax::Acceleration* /*acc*/, ax::Event* /*event*/) {} void InputDelegate::onKeyPressed(ax::EventKeyboard::KeyCode /*keyCode*/, ax::Event* /*event*/) {} diff --git a/extensions/cocostudio/src/cocostudio/InputDelegate.h b/extensions/cocostudio/src/cocostudio/InputDelegate.h index b44fa63a6f..03dc513c7a 100644 --- a/extensions/cocostudio/src/cocostudio/InputDelegate.h +++ b/extensions/cocostudio/src/cocostudio/InputDelegate.h @@ -65,44 +65,6 @@ public: virtual ax::Touch::DispatchMode getTouchMode() const; virtual void setTouchPriority(int priority); virtual int getTouchPriority() const; - /** @deprecated Please override onAcceleration */ - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void didAccelerate(ax::Acceleration* accelerationValue) final; - // Deprecated touch callbacks. - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(ax::Touch* touch, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(ax::Touch* touch, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(ax::Touch* touch, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(ax::Touch* touch, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(ax::__Set* touches, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(ax::__Set* touches, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(ax::__Set* touches, ax::Event* event) final; - /** - * @js NA - */ - AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(ax::__Set* touches, ax::Event* event) final; /** * @js NA */ diff --git a/extensions/cocostudio/src/cocostudio/SGUIReader.h b/extensions/cocostudio/src/cocostudio/SGUIReader.h index f346fc7102..e9e5ffa68c 100644 --- a/extensions/cocostudio/src/cocostudio/SGUIReader.h +++ b/extensions/cocostudio/src/cocostudio/SGUIReader.h @@ -56,8 +56,6 @@ typedef void (ax::Object::*SEL_ParseEvent)(std::string_view, ax::Object*, const class CCS_DLL GUIReader : public ax::Object { public: - AX_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; - AX_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; static GUIReader* getInstance(); static void destroyInstance(); diff --git a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.cpp b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.cpp index d4b5c6db5c..3395a6f9d2 100644 --- a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.cpp +++ b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.cpp @@ -9,12 +9,6 @@ SpineSkeletonDataCache* SpineSkeletonDataCache::getInstance() SpineSkeletonDataCache::SpineSkeletonDataCache() { - _reportError = &ax::print; -} - -void SpineSkeletonDataCache::setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...)) -{ - _reportError = std::move(errorfunc); } void SpineSkeletonDataCache::removeData(const char* dataFile) @@ -69,7 +63,7 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char if ((!binary.getError().isEmpty())) { ++failed; - _reportError("#parse spine .skel data file failed, error:%s", binary.getError().buffer()); + AXLOGE("#parse spine .skel data file failed, error:{}", binary.getError().buffer()); } } else @@ -81,7 +75,7 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char if ((!json.getError().isEmpty())) { ++failed; - _reportError("#parse spine .json data file failed, error:%s", json.getError().buffer()); + AXLOGE("#parse spine .json data file failed, error:{}", json.getError().buffer()); } } @@ -142,12 +136,6 @@ SpineSkeletonDataCache* SpineSkeletonDataCache::getInstance() SpineSkeletonDataCache::SpineSkeletonDataCache() { - _reportError = &ax::print; -} - -void SpineSkeletonDataCache::setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...)) -{ - _reportError = errorfunc; } void SpineSkeletonDataCache::removeData(const char* dataFile) @@ -205,7 +193,7 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char if ((binary->error != nullptr)) { ++failed; - _reportError("#parse spine .skel data file failed, error:%s", binary->error); + AXLOGE("#parse spine .skel data file failed, error:{}", binary->error); } spSkeletonBinary_dispose(binary); @@ -224,7 +212,7 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char if ((json->error != nullptr)) { ++failed; - _reportError("#parse spine .json data file failed, error:%s", json->error); + AXLOGE("#parse spine .json data file failed, error:{}", json->error); } spSkeletonJson_dispose(json); @@ -233,7 +221,7 @@ SpineSkeletonDataCache::SkeletonData* SpineSkeletonDataCache::addData(const char if ((loader->error1 != nullptr)) { ++failed; - _reportError("#parse spine attachment failed, error:%s%s", loader->error1, loader->error2); + AXLOGE("#parse spine attachment failed, error:{}{}", loader->error1, loader->error2); } if (failed > 0) diff --git a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h index 400cfe4e3f..9197da3468 100644 --- a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h @@ -29,8 +29,6 @@ public: SpineSkeletonDataCache(); - void setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...)); - SkeletonData* addData(const char* dataFile, const char* atlasFile, float scale); void removeData(const char* dataFile); @@ -40,7 +38,6 @@ public: public: hlookup::string_map _cacheTable; - void (*_reportError)(const char* pszFormat, ...); }; #else @@ -64,8 +61,6 @@ public: SpineSkeletonDataCache(); - void setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...)); - static SpineSkeletonDataCache* getInstance(); SkeletonData* addData(const char* dataFile, const char* atlasFile, float scale); @@ -77,7 +72,6 @@ public: public: hlookup::string_map _cacheTable; - void (*_reportError)(const char* pszFormat, ...); }; #endif diff --git a/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.cpp b/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.cpp index 840c2dbbbc..96734fd3bf 100644 --- a/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.cpp +++ b/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.cpp @@ -44,7 +44,7 @@ SpriteFrameCacheHelper* SpriteFrameCacheHelper::getInstance() return _spriteFrameCacheHelper; } -void SpriteFrameCacheHelper::purge() +void SpriteFrameCacheHelper::destroyInstance() { delete _spriteFrameCacheHelper; _spriteFrameCacheHelper = nullptr; diff --git a/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h b/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h index 8b0e44f561..56e1aac2b6 100644 --- a/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h +++ b/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h @@ -46,15 +46,10 @@ namespace cocostudio class CCS_DLL SpriteFrameCacheHelper { public: - /** @deprecated Use getInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper() - { - return SpriteFrameCacheHelper::getInstance(); - } static SpriteFrameCacheHelper* getInstance(); - static void purge(); + static void destroyInstance(); public: /** diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index 80fd307a49..0d5c2046f4 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -46,8 +46,6 @@ public: ~ArmatureNodeReader(); static ArmatureNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index fd1b59ef59..b33a32516e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -54,11 +54,6 @@ ButtonReader* ButtonReader::getInstance() return instanceButtonReader; } -void ButtonReader::purge() -{ - AX_SAFE_DELETE(instanceButtonReader); -} - void ButtonReader::destroyInstance() { AX_SAFE_DELETE(instanceButtonReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index e6d2eec3fc..451b890f16 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -39,8 +39,6 @@ public: virtual ~ButtonReader(); static ButtonReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index 42578f579f..e1d6f9c980 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -39,8 +39,6 @@ public: virtual ~CheckBoxReader(); static CheckBoxReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index 55cca252fe..bbb02f226e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -51,11 +51,6 @@ ComAudioReader* ComAudioReader::getInstance() return _instanceComAudioReader; } -void ComAudioReader::purge() -{ - AX_SAFE_DELETE(_instanceComAudioReader); -} - void ComAudioReader::destroyInstance() { AX_SAFE_DELETE(_instanceComAudioReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index d15871752f..546f567216 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -41,8 +41,6 @@ public: ~ComAudioReader(); static ComAudioReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index ab1af9c571..51b770a2e0 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -40,8 +40,6 @@ public: ~GameMapReader(); static GameMapReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp index 729f746621..6768bea13c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp @@ -63,11 +63,6 @@ CameraBackgroundBrush* GameNode3DReader::getSceneBrushInstance() return _sceneBrushInstance; } -void GameNode3DReader::purge() -{ - AX_SAFE_DELETE(_instanceNode3DReader); -} - void GameNode3DReader::destroyInstance() { AX_SAFE_DELETE(_instanceNode3DReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h index d2579df4fe..f6168c0b50 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -42,8 +42,6 @@ public: static GameNode3DReader* getInstance(); static ax::CameraBackgroundBrush* getSceneBrushInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index f1bd726103..d7254f1491 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -39,8 +39,6 @@ public: virtual ~ImageViewReader(); static ImageViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 675d4ab0c8..dbec83323b 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -40,8 +40,6 @@ public: virtual ~LayoutReader(); static LayoutReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp index 8a49344079..101df41092 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp @@ -56,11 +56,6 @@ Light3DReader* Light3DReader::getInstance() return _instanceLight3DReader; } -void Light3DReader::purge() -{ - AX_SAFE_DELETE(_instanceLight3DReader); -} - void Light3DReader::destroyInstance() { AX_SAFE_DELETE(_instanceLight3DReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h index e948552215..abe656375f 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -40,8 +40,6 @@ public: ~Light3DReader(); static Light3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index ce3760636b..19591467b3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -39,8 +39,6 @@ public: virtual ~ListViewReader(); static ListViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 9b10815bbb..e5b74d4816 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -39,8 +39,6 @@ public: virtual ~LoadingBarReader(); static LoadingBarReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.cpp index 44d88dd585..36dbd59223 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.cpp @@ -61,11 +61,6 @@ MeshReader* MeshReader::getInstance() return _instanceMeshReader; } -void MeshReader::purge() -{ - AX_SAFE_DELETE(_instanceMeshReader); -} - void MeshReader::destroyInstance() { AX_SAFE_DELETE(_instanceMeshReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h index b0478e8426..e675aace3c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h @@ -41,8 +41,6 @@ public: ~MeshReader(); static MeshReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 35e38b62ea..a4a48f24d3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -55,11 +55,6 @@ Node3DReader* Node3DReader::getInstance() return _instanceNode3DReader; } -void Node3DReader::purge() -{ - AX_SAFE_DELETE(_instanceNode3DReader); -} - void Node3DReader::destroyInstance() { AX_SAFE_DELETE(_instanceNode3DReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 6604cada1b..18057bab44 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -41,8 +41,6 @@ public: ~Node3DReader(); static Node3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h index ae8ba5c2e2..fe6bcf952a 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -40,8 +40,6 @@ public: ~NodeReader(); static NodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index f8cf913031..a6593ccc00 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -39,8 +39,6 @@ public: virtual ~PageViewReader(); static PageViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index ccb0cab992..02990796d0 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -57,11 +57,6 @@ Particle3DReader* Particle3DReader::getInstance() return _instanceParticle3DReader; } -void Particle3DReader::purge() -{ - AX_SAFE_DELETE(_instanceParticle3DReader); -} - void Particle3DReader::destroyInstance() { AX_SAFE_DELETE(_instanceParticle3DReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index af60c2d414..3f8b3e5a92 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -40,8 +40,6 @@ public: ~Particle3DReader(); static Particle3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index e19c06728a..8ea9156d46 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -56,11 +56,6 @@ ParticleReader* ParticleReader::getInstance() return _instanceParticleReader; } -void ParticleReader::purge() -{ - AX_SAFE_DELETE(_instanceParticleReader); -} - void ParticleReader::destroyInstance() { AX_SAFE_DELETE(_instanceParticleReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 1d6aa86e78..8d2990709d 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -40,8 +40,6 @@ public: ~ParticleReader(); static ParticleReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index 7fbecdc7cb..dd9bd146f5 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -50,11 +50,6 @@ ProjectNodeReader* ProjectNodeReader::getInstance() return _instanceProjectNodeReader; } -void ProjectNodeReader::purge() -{ - AX_SAFE_DELETE(_instanceProjectNodeReader); -} - void ProjectNodeReader::destroyInstance() { AX_SAFE_DELETE(_instanceProjectNodeReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 8b00d9c7f5..c7be9b54c1 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -39,8 +39,6 @@ public: ~ProjectNodeReader(); static ProjectNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h index bd9867cdd6..239043918b 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h @@ -39,8 +39,6 @@ public: virtual ~RadioButtonGroupReader(); static RadioButtonGroupReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h index a1d54abe27..9882c3f457 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h @@ -39,8 +39,6 @@ public: virtual ~RadioButtonReader(); static RadioButtonReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h index 9a2c5802cf..67fdf1a1a5 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h @@ -39,8 +39,6 @@ public: virtual ~RichTextReader(); static RichTextReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index e87ba214ec..ae35342eb9 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -39,8 +39,6 @@ public: virtual ~ScrollViewReader(); static ScrollViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index ed25d95fb0..90c0c61c5d 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -53,11 +53,6 @@ SingleNodeReader* SingleNodeReader::getInstance() return _instanceSingleNodeReader; } -void SingleNodeReader::purge() -{ - AX_SAFE_DELETE(_instanceSingleNodeReader); -} - void SingleNodeReader::destroyInstance() { AX_SAFE_DELETE(_instanceSingleNodeReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index ee606c992e..e06f293b6e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -40,8 +40,6 @@ public: ~SingleNodeReader(); static SingleNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h index c9004e7404..f32aa5a1ef 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -37,8 +37,6 @@ public: ~BoneNodeReader(); static BoneNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers( diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h index 6bd8454f27..ffac593ff7 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h @@ -36,8 +36,6 @@ public: ~SkeletonNodeReader(); static SkeletonNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); ax::Node* createNodeWithFlatBuffers(const flatbuffers::Table* boneOptions) override; diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h index be74893bec..ae7273c158 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -39,8 +39,6 @@ public: virtual ~SliderReader(); static SliderReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp index f2a708fd8f..d4558f2933 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.cpp @@ -60,11 +60,6 @@ SpineSkeletonReader* SpineSkeletonReader::getInstance() return _instanceSpriteReader; } -void SpineSkeletonReader::purge() -{ - AX_SAFE_DELETE(_instanceSpriteReader); -} - void SpineSkeletonReader::destroyInstance() { AX_SAFE_DELETE(_instanceSpriteReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h index 0e3d0a1b79..89b617e295 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h @@ -42,8 +42,6 @@ public: ~SpineSkeletonReader(); static SpineSkeletonReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index 20b523782e..310dc7252c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -63,11 +63,6 @@ SpriteReader* SpriteReader::getInstance() return _instanceSpriteReader; } -void SpriteReader::purge() -{ - AX_SAFE_DELETE(_instanceSpriteReader); -} - void SpriteReader::destroyInstance() { AX_SAFE_DELETE(_instanceSpriteReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index f8f2fdd8f6..3aa4db7847 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -40,8 +40,6 @@ public: ~SpriteReader(); static SpriteReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 24dd85a966..19d0df19b9 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -39,8 +39,6 @@ public: virtual ~TextAtlasReader(); static TextAtlasReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index e4704e7e47..cf328ab2a3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -39,8 +39,6 @@ public: virtual ~TextBMFontReader(); static TextBMFontReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h index a69d977a4c..9546fb6783 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h @@ -39,8 +39,6 @@ public: virtual ~TextFieldExReader(); static TextFieldExReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index 3e202d9ce4..82b3e109db 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -39,8 +39,6 @@ public: virtual ~TextFieldReader(); static TextFieldReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h index 66a7678d68..9f042831c6 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h @@ -39,8 +39,6 @@ public: virtual ~TextReader(); static TextReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 6d8b686114..6003599196 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -58,11 +58,6 @@ UserCameraReader* UserCameraReader::getInstance() return _instanceUserCameraReader; } -void UserCameraReader::purge() -{ - AX_SAFE_DELETE(_instanceUserCameraReader); -} - void UserCameraReader::destroyInstance() { AX_SAFE_DELETE(_instanceUserCameraReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index e4a57c6430..7829789243 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -41,8 +41,6 @@ public: ~UserCameraReader(); static UserCameraReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(pugi::xml_node objectData, diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.cpp b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.cpp index cf412cd0d7..482ae971d4 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.cpp +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.cpp @@ -126,11 +126,6 @@ WidgetReader* WidgetReader::getInstance() return instanceWidgetReader; } -void WidgetReader::purge() -{ - AX_SAFE_DELETE(instanceWidgetReader); -} - void WidgetReader::destroyInstance() { AX_SAFE_DELETE(instanceWidgetReader); diff --git a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h index 8a6cc1959f..d86d217f0c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h @@ -46,8 +46,6 @@ public: virtual ~WidgetReader(); static WidgetReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - AX_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options); diff --git a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp index 90c7fd3ec0..9811cb9969 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_base_auto.cpp @@ -31911,55 +31911,42 @@ int lua_ax_base_FileUtils_getStringFromFile(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_getStringFromFile'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:getStringFromFile"); + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - std::function arg1; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->getStringFromFile(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:getStringFromFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_getStringFromFile'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:getStringFromFile"); - - if (!ok) { break; } - std::string ret = cobj->getStringFromFile(arg0); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:getStringFromFile",argc, 1); + auto&& ret = cobj->getStringFromFile(arg0); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:getStringFromFile",argc, 1); return 0; #if _AX_DEBUG >= 1 @@ -32832,63 +32819,45 @@ int lua_ax_base_FileUtils_writeStringToFile(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_writeStringToFile'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ax.FileUtils:writeStringToFile"); + if (argc == 2) + { + std::string_view arg0; + std::string_view arg1; - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeStringToFile"); + ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:writeStringToFile"); - if (!ok) { break; } - std::function arg2; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->writeStringToFile(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeStringToFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_writeStringToFile'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:writeStringToFile"); - - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeStringToFile"); - - if (!ok) { break; } - bool ret = cobj->writeStringToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeStringToFile",argc, 2); + auto&& ret = cobj->writeStringToFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeStringToFile",argc, 2); return 0; #if _AX_DEBUG >= 1 @@ -32903,63 +32872,45 @@ int lua_ax_base_FileUtils_writeValueMapToFile(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_writeValueMapToFile'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - ax::ValueMap arg0; - ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "ax.FileUtils:writeValueMapToFile"); + if (argc == 2) + { + ax::ValueMap arg0; + std::string_view arg1; - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueMapToFile"); + ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "ax.FileUtils:writeValueMapToFile"); - if (!ok) { break; } - std::function arg2; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->writeValueMapToFile(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueMapToFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_writeValueMapToFile'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 2) { - ax::ValueMap arg0; - ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "ax.FileUtils:writeValueMapToFile"); - - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueMapToFile"); - - if (!ok) { break; } - bool ret = cobj->writeValueMapToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeValueMapToFile",argc, 2); + auto&& ret = cobj->writeValueMapToFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeValueMapToFile",argc, 2); return 0; #if _AX_DEBUG >= 1 @@ -32974,63 +32925,45 @@ int lua_ax_base_FileUtils_writeValueVectorToFile(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_writeValueVectorToFile'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - ax::ValueVector arg0; - ok &= luaval_to_ccvaluevector(tolua_S, 2, &arg0, "ax.FileUtils:writeValueVectorToFile"); + if (argc == 2) + { + ax::ValueVector arg0; + std::string_view arg1; - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueVectorToFile"); + ok &= luaval_to_ccvaluevector(tolua_S, 2, &arg0, "ax.FileUtils:writeValueVectorToFile"); - if (!ok) { break; } - std::function arg2; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->writeValueVectorToFile(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueVectorToFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_writeValueVectorToFile'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 2) { - ax::ValueVector arg0; - ok &= luaval_to_ccvaluevector(tolua_S, 2, &arg0, "ax.FileUtils:writeValueVectorToFile"); - - if (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "ax.FileUtils:writeValueVectorToFile"); - - if (!ok) { break; } - bool ret = cobj->writeValueVectorToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeValueVectorToFile",argc, 2); + auto&& ret = cobj->writeValueVectorToFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:writeValueVectorToFile",argc, 2); return 0; #if _AX_DEBUG >= 1 @@ -33095,55 +33028,42 @@ int lua_ax_base_FileUtils_isFileExist(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_isFileExist'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isFileExist"); + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - std::function arg1; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->isFileExist(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isFileExist"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_isFileExist'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isFileExist"); - - if (!ok) { break; } - bool ret = cobj->isFileExist(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:isFileExist",argc, 1); + auto&& ret = cobj->isFileExist(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:isFileExist",argc, 1); return 0; #if _AX_DEBUG >= 1 @@ -33208,55 +33128,42 @@ int lua_ax_base_FileUtils_isDirectoryExist(lua_State* tolua_S) int argc = 0; ax::FileUtils* cobj = nullptr; bool ok = true; + #if _AX_DEBUG >= 1 tolua_Error tolua_err; #endif + #if _AX_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ax.FileUtils",0,&tolua_err)) goto tolua_lerror; #endif + cobj = (ax::FileUtils*)tolua_tousertype(tolua_S,1,0); + #if _AX_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_base_FileUtils_isDirectoryExist'", nullptr); return 0; } #endif + argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isDirectoryExist"); + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - std::function arg1; - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - - if (!ok) { break; } - cobj->isDirectoryExist(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; + ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isDirectoryExist"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_ax_base_FileUtils_isDirectoryExist'", nullptr); + return 0; } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string_view arg0; - ok &= luaval_to_std_string_view(tolua_S, 2,&arg0, "ax.FileUtils:isDirectoryExist"); - - if (!ok) { break; } - bool ret = cobj->isDirectoryExist(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:isDirectoryExist",argc, 1); + auto&& ret = cobj->isDirectoryExist(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.FileUtils:isDirectoryExist",argc, 1); return 0; #if _AX_DEBUG >= 1 diff --git a/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp b/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp index bafd4cac07..a4b031d2a8 100644 --- a/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/axlua_studio_auto.cpp @@ -15495,53 +15495,6 @@ int lua_register_ax_studio_SceneReader(lua_State* tolua_S) return 1; } -int lua_ax_studio_ActionTimelineCache_purge(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimelineCache* cobj = nullptr; - bool ok = true; - -#if _AX_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if _AX_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimelineCache",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimelineCache*)tolua_tousertype(tolua_S,1,0); - -#if _AX_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_ax_studio_ActionTimelineCache_purge'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_ax_studio_ActionTimelineCache_purge'", nullptr); - return 0; - } - cobj->purge(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimelineCache:purge",argc, 0); - return 0; - -#if _AX_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_ax_studio_ActionTimelineCache_purge'.",&tolua_err); -#endif - - return 0; -} int lua_ax_studio_ActionTimelineCache_init(lua_State* tolua_S) { int argc = 0; @@ -16077,7 +16030,6 @@ int lua_register_ax_studio_ActionTimelineCache(lua_State* tolua_S) tolua_cclass(tolua_S,"ActionTimelineCache","ccs.ActionTimelineCache","",nullptr); tolua_beginmodule(tolua_S,"ActionTimelineCache"); - tolua_function(tolua_S,"purge",lua_ax_studio_ActionTimelineCache_purge); tolua_function(tolua_S,"init",lua_ax_studio_ActionTimelineCache_init); tolua_function(tolua_S,"removeAction",lua_ax_studio_ActionTimelineCache_removeAction); tolua_function(tolua_S,"createActionFromJson",lua_ax_studio_ActionTimelineCache_createActionFromJson); diff --git a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h index 0a0b7d4066..c0210d65fb 100644 --- a/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/extensions/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -474,14 +474,14 @@ static inline bool luaval_to_point(lua_State* L, int lo, ax::Vec2* outValue, con return luaval_to_vec2(L, lo, outValue); } -AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, +AX_DEPRECATED(2.1) static inline bool luaval_to_kmMat4(lua_State* L, int lo, ax::Mat4* outValue, const char* funcName = "") { return luaval_to_mat4(L, lo, outValue); } -AX_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L, +AX_DEPRECATED(2.1) static inline bool luaval_to_array_of_Point(lua_State* L, int lo, ax::Vec2** points, int* numPoints, @@ -1047,7 +1047,7 @@ static inline void point_to_luaval(lua_State* L, const ax::Vec2& pt) vec2_to_luaval(L, pt); } -AX_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L, const ax::Vec2* points, int count) +AX_DEPRECATED(2.1) static inline void points_to_luaval(lua_State* L, const ax::Vec2* points, int count) { vec2_array_to_luaval(L, points, count); } diff --git a/extensions/scripting/lua-bindings/manual/LuaEngine.h b/extensions/scripting/lua-bindings/manual/LuaEngine.h index 390e4f5d2d..c21f6151c8 100644 --- a/extensions/scripting/lua-bindings/manual/LuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/LuaEngine.h @@ -65,7 +65,7 @@ public: * * @return the instance of LuaEngine. */ - AX_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } + AX_DEPRECATED(2.1) static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } /** * Destructor of LuaEngine. diff --git a/extensions/spine/src/spine/SkeletonAnimation.h b/extensions/spine/src/spine/SkeletonAnimation.h index 42ae00e7bc..da8a793f2f 100644 --- a/extensions/spine/src/spine/SkeletonAnimation.h +++ b/extensions/spine/src/spine/SkeletonAnimation.h @@ -56,11 +56,11 @@ namespace spine { static SkeletonAnimation *createWithBinaryFile(const std::string &skeletonBinaryFile, const std::string &atlasFile, float scale = 1); // Use createWithJsonFile instead - AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, Atlas *atlas, float scale = 1) { + AX_DEPRECATED(2.1) static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, Atlas *atlas, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } // Use createWithJsonFile instead - AX_DEPRECATED_ATTRIBUTE static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, float scale = 1) { + AX_DEPRECATED(2.1) static SkeletonAnimation *createWithFile(const std::string &skeletonJsonFile, const std::string &atlasFile, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale); } diff --git a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp index fb5353deb5..67582224e2 100644 --- a/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp +++ b/tests/cpp-tests/Source/MeshRendererTest/MeshRendererTest.cpp @@ -1026,9 +1026,6 @@ std::string AsyncLoadMeshRendererTest::subtitle() const void AsyncLoadMeshRendererTest::menuCallback_asyncLoadMesh(Object* sender) { - // Note that you must stop the tasks before leaving the scene. - AsyncTaskPool::getInstance()->stopTasks(AsyncTaskPool::TaskType::TASK_IO); - auto node = getChildByTag(101); node->removeAllChildren(); // remove all loaded mesh diff --git a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp index 8a64c02c2b..44bbbaaecd 100644 --- a/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp +++ b/tests/cpp-tests/Source/NewAudioEngineTest/NewAudioEngineTest.cpp @@ -484,7 +484,7 @@ bool AudioWavTest::init() AudioEngine::stop(_audioID); _audioID = AudioEngine::play2d(_wavFiles[--_curIndex]); _stateLabel->setString(fmt::format("[index: {}] {}", _curIndex, - FileUtils::getFileShortName(_wavFiles[_curIndex]))); + FileUtils::getPathBaseName(_wavFiles[_curIndex]))); } }); playPrev->setPosition(layerSize.width * 0.35f, layerSize.height * 0.5f); @@ -495,8 +495,7 @@ bool AudioWavTest::init() { AudioEngine::stop(_audioID); _audioID = AudioEngine::play2d(_wavFiles[++_curIndex]); - _stateLabel->setString(fmt::format("[index: {}] {}", _curIndex, - FileUtils::getFileShortName(_wavFiles[_curIndex]))); + _stateLabel->setString(fmt::format("[index: {}] {}", _curIndex, FileUtils::getPathBaseName(_wavFiles[_curIndex]))); } }); playNext->setPosition(layerSize.width * 0.65f, layerSize.height * 0.5f); @@ -517,7 +516,7 @@ void AudioWavTest::onEnter() _curIndex = 0; _audioID = AudioEngine::play2d(_wavFiles[_curIndex]); _stateLabel->setString(fmt::format("[index: {}] {}", _curIndex, - FileUtils::getFileShortName(_wavFiles[_curIndex]))); + FileUtils::getPathBaseName(_wavFiles[_curIndex]))); } } diff --git a/tests/unit-tests/Source/core/platform/FileUtilsTests.cpp b/tests/unit-tests/Source/core/platform/FileUtilsTests.cpp index 09343976a2..6eb8097b76 100644 --- a/tests/unit-tests/Source/core/platform/FileUtilsTests.cpp +++ b/tests/unit-tests/Source/core/platform/FileUtilsTests.cpp @@ -114,12 +114,6 @@ TEST_SUITE("platform/FileUtils") { CHECK(not fu->isFileExist("/text/doesnt_exist")); CHECK(not fu->isFileExist("text")); CHECK(not fu->isFileExist(fu->fullPathForDirectory("text"))); - - auto run = AsyncRunner(); - fu->isFileExist("text/123.txt", [&](bool exists) { - run.finish(exists); - }); - CHECK(run()); } @@ -130,12 +124,6 @@ TEST_SUITE("platform/FileUtils") { CHECK(not fu->isDirectoryExist("/doesnt_exist")); CHECK(not fu->isDirectoryExist("text/123.txt")); CHECK(not fu->isDirectoryExist(fu->fullPathForFilename("text/123.txt"))); - - auto run = AsyncRunner(); - fu->isDirectoryExist(fu->fullPathForDirectory("text"), [&](bool exists) { - run.finish(exists); - }); - CHECK(run()); } @@ -143,12 +131,6 @@ TEST_SUITE("platform/FileUtils") { CHECK(fu->getFileSize(fu->fullPathForFilename("text/123.txt")) == 3); CHECK(fu->getFileSize(fu->fullPathForFilename("text/hello.txt")) == 12); CHECK(fu->getFileSize("text/doesnt_exist.txt") == -1); - - auto run = AsyncRunner(); - fu->getFileSize("text/123.txt", [&](int size) { - run.finish(size); - }); - CHECK(run() == 3); } @@ -167,15 +149,6 @@ TEST_SUITE("platform/FileUtils") { REQUIRE(fu->renameFile(fu->getWritablePath(), "__test1.txt", "__test2.txt")); CHECK(not fu->isFileExist(file1)); CHECK(fu->isFileExist(file2)); - - auto run = AsyncRunner(); - fu->renameFile(fu->getWritablePath(), "__test2.txt", "__test1.txt", [&](bool success) { - run.finish(success); - }); - CHECK(run()); - CHECK(fu->isFileExist(file1)); - - CHECK(fu->removeFile(file1)); } @@ -194,16 +167,6 @@ TEST_SUITE("platform/FileUtils") { CHECK(not fu->isFileExist(file)); CHECK(not fu->removeFile(file)); } - - - SUBCASE("async") { - auto run = AsyncRunner(); - fu->removeFile(file, [&](bool success) { - run.finish(success); - }); - CHECK(run()); - CHECK(not fu->isFileExist(file)); - } } @@ -224,19 +187,7 @@ TEST_SUITE("platform/FileUtils") { CHECK(fu->getStringFromFile(file1) == "Hello!"); REQUIRE(fu->removeFile(file1)); - auto run = AsyncRunner(); - fu->writeStringToFile("Hello!", file1, [&](bool success) { - run.finish(success); - }); - REQUIRE(run()); - - auto run2 = AsyncRunner(); - fu->getStringFromFile(file1, [&](std::string_view value) { - run2.finish(std::string(value)); - }); - CHECK(run2() == "Hello!"); - - CHECK(fu->removeFile(file1)); + CHECK(not fu->removeFile(file1)); } } @@ -267,7 +218,7 @@ TEST_SUITE("platform/FileUtils") { CHECK(buffer[0] == '1'); CHECK(buffer[1] == '2'); CHECK(buffer[2] == '3'); - + fu->getContents("text/hello.txt", &buffer); REQUIRE(buffer.size() == 12); auto expected = std::string_view("Hello world!"); @@ -337,14 +288,6 @@ TEST_SUITE("platform/FileUtils") { REQUIRE(fu->isFileExist(file)); CHECK(fu->getStringFromFile(file) == writeDataStr); fu->removeFile(file); - - auto run = AsyncRunner(); - fu->writeDataToFile(writeData, file, [&](bool success) { - run.finish(success); - }); - REQUIRE(run()); - CHECK(fu->getStringFromFile(file) == writeDataStr); - fu->removeFile(file); } @@ -353,16 +296,6 @@ TEST_SUITE("platform/FileUtils") { REQUIRE(not readData.isNull()); CHECK(readData.getSize() == 12); CHECK(std::equal(readData.getBytes(), readData.getBytes() + readData.getSize(), "Hello world!")); - - readData.clear(); - auto run = AsyncRunner(); - fu->getDataFromFile("text/hello.txt", [&](const Data& readData) { - run.finish(readData); - }); - auto result = run(); - REQUIRE(not result.isNull()); - CHECK(result.getSize() == 12); - CHECK(std::equal(result.getBytes(), result.getBytes() + result.getSize(), "Hello world!")); } } @@ -519,7 +452,7 @@ TEST_SUITE("platform/FileUtils") { REQUIRE(fu->removeFile(filename)); REQUIRE(not fu->isDirectoryExist(dir)); - REQUIRE(fu->createDirectory(dir)); + REQUIRE(fu->createDirectories(dir)); REQUIRE(fu->isDirectoryExist(dir)); std::string writeDataStr = " 测试字符串.";