diff --git a/CMakeOptions.md b/CMakeOptions.md index 6ccd0498aab3..87bb4d127237 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 e0e76620f70d..b50288a74e0a 100644 --- a/core/2d/FastTMXTiledMap.h +++ b/core/2d/FastTMXTiledMap.h @@ -203,9 +203,9 @@ class AX_DLL FastTMXTiledMap : public Node * 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; } diff --git a/core/2d/FontAtlasCache.cpp b/core/2d/FontAtlasCache.cpp index 1cd9f613b57a..752279137d55 100644 --- a/core/2d/FontAtlasCache.cpp +++ b/core/2d/FontAtlasCache.cpp @@ -143,12 +143,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; @@ -259,11 +259,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 44bf3dbf7c7f..a71ce2192453 100644 --- a/core/2d/FontAtlasCache.h +++ b/core/2d/FontAtlasCache.h @@ -51,8 +51,9 @@ class AX_DLL FontAtlasCache 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, @@ -72,10 +73,10 @@ class AX_DLL FontAtlasCache 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 755fdfc09ef1..cde6a0e714d0 100644 --- a/core/2d/FontFNT.cpp +++ b/core/2d/FontFNT.cpp @@ -589,12 +589,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 d412e793cabf..f0d01964e9df 100644 --- a/core/2d/FontFNT.h +++ b/core/2d/FontFNT.h @@ -148,9 +148,9 @@ class AX_DLL FontFNT : public Font 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 9ebd44160981..fed3a840ec77 100644 --- a/core/2d/Label.cpp +++ b/core/2d/Label.cpp @@ -359,6 +359,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, @@ -368,7 +369,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(); @@ -926,12 +927,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 0b2e8fac89b2..7ddaab2e2076 100644 --- a/core/2d/Label.h +++ b/core/2d/Label.h @@ -272,12 +272,13 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol * @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. * @@ -340,12 +341,12 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol /** 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; } @@ -793,8 +794,10 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol 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 abbd1d8be9b5..6deed277adea 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 1cee7e1b5cb8..669ee8eeae3b 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 c3c752b79d82..371dc8592400 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 6488f64a30c0..cd3a4096dbbc 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 */ NS_AX_BEGIN diff --git a/core/base/Director.cpp b/core/base/Director.cpp index f83fc7062b93..c2814383f5bc 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) @@ -1056,7 +1058,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 be112666ab70..b5b743bb2119 100644 --- a/core/base/Logging.cpp +++ b/core/base/Logging.cpp @@ -229,7 +229,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; diff --git a/core/base/Logging.h b/core/base/Logging.h index 650543442dc4..41970c614804 100644 --- a/core/base/Logging.h +++ b/core/base/Logging.h @@ -159,9 +159,14 @@ 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 +// } NS_AX_END diff --git a/core/base/Scheduler.h b/core/base/Scheduler.h index 39eae7e12dd3..4e11bbff6973 100644 --- a/core/base/Scheduler.h +++ b/core/base/Scheduler.h @@ -470,12 +470,12 @@ class AX_DLL Scheduler : public Object @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 @@ -484,8 +484,9 @@ class AX_DLL Scheduler : public Object * @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 61e5876fa0ab..1d9931a03a10 100644 --- a/core/base/ScriptSupport.cpp +++ b/core/base/ScriptSupport.cpp @@ -58,7 +58,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; } } @@ -79,14 +79,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 f3fef1df0803..9c407110019c 100644 --- a/core/base/UTF8.cpp +++ b/core/base/UTF8.cpp @@ -37,7 +37,7 @@ NS_AX_BEGIN namespace StringUtils { - +//#ifndef AX_CORE_PROFILE std::string AX_DLL format(const char* format, ...) { va_list args; @@ -115,7 +115,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 5d09b5e7a280..df95d1d3c176 100644 --- a/core/base/UTF8.h +++ b/core/base/UTF8.h @@ -65,10 +65,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 41bf6332e02e..f736aff4fcf8 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" @@ -51,22 +55,20 @@ using Ref = Object; NS_AX_END namespace cocos2d = ax; - #define USING_NS_CC USING_NS_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 3b97368ec1f3..6fa6d854d384 100644 --- a/core/platform/FileUtils.cpp +++ b/core/platform/FileUtils.cpp @@ -488,7 +488,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 @@ -499,12 +499,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( @@ -513,7 +513,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."); @@ -552,7 +552,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 @@ -562,14 +562,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); @@ -577,7 +577,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()) @@ -613,7 +613,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 { @@ -634,7 +634,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; @@ -922,7 +922,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); @@ -930,7 +930,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); @@ -969,6 +969,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"); @@ -1048,6 +1050,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 54302b3c5316..f69913e0e9e4 100644 --- a/core/platform/FileUtils.h +++ b/core/platform/FileUtils.h @@ -143,30 +143,12 @@ class AX_DLL FileUtils */ 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, @@ -432,23 +414,6 @@ class AX_DLL FileUtils */ 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 * @@ -463,22 +428,6 @@ class AX_DLL FileUtils */ 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 * @@ -488,24 +437,6 @@ class AX_DLL FileUtils */ 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 * @@ -515,24 +446,6 @@ class AX_DLL FileUtils */ 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; @@ -546,34 +459,14 @@ class AX_DLL FileUtils */ 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 */ @@ -610,15 +503,6 @@ class AX_DLL FileUtils */ 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. * @@ -626,16 +510,6 @@ class AX_DLL FileUtils * @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. @@ -645,15 +519,6 @@ class AX_DLL FileUtils */ 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. * @@ -662,15 +527,6 @@ class AX_DLL FileUtils */ 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. * @@ -681,6 +537,175 @@ class AX_DLL FileUtils */ virtual bool renameFile(std::string_view path, std::string_view oldname, std::string_view name) const; + /** + * Renames a file under the given directory. + * + * @param oldfullpath The current fullpath of the file. Includes path and name. + * @param newfullpath The new fullpath of the file. Includes path and name. + * @return True if the file have been renamed successfully, false if not. + */ + virtual bool renameFile(std::string_view oldfullpath, std::string_view newfullpath) const; + + /** + * Retrieve the file size. + * + * @note If a relative path was passed in, it will be inserted a default root path at the beginning. + * @param filepath The path of the file, it could be a relative or absolute path. + * @return The file size. + */ + 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. * @@ -690,20 +715,11 @@ class AX_DLL FileUtils * @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, + 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. - * - * @param oldfullpath The current fullpath of the file. Includes path and name. - * @param newfullpath The new fullpath of the file. Includes path and name. - * @return True if the file have been renamed successfully, false if not. - */ - 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. * @@ -712,19 +728,10 @@ class AX_DLL FileUtils * @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, + AX_DEPRECATED(2.1) void renameFile(std::string_view oldfullpath, std::string_view newfullpath, std::function callback) const; - /** - * Retrieve the file size. - * - * @note If a relative path was passed in, it will be inserted a default root path at the beginning. - * @param filepath The path of the file, it could be a relative or absolute path. - * @return The file size. - */ - virtual int64_t getFileSize(std::string_view filepath) const; - /** * Retrieve the file size, async off the main cocos thread. * @@ -733,15 +740,7 @@ class AX_DLL FileUtils * @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. @@ -752,15 +751,7 @@ class AX_DLL FileUtils * @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. @@ -771,9 +762,9 @@ class AX_DLL FileUtils * @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 a48c4779e604..e1b615f66aa5 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) - -#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 +# 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, ...) 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 4b3f6b3bf8a5..eefd00c626a9 100644 --- a/core/platform/android/Application-android.h +++ b/core/platform/android/Application-android.h @@ -60,10 +60,10 @@ class AX_DLL Application : public ApplicationBase @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 1ade031b4f17..12022c53f61f 100644 --- a/core/platform/linux/Application-linux.h +++ b/core/platform/linux/Application-linux.h @@ -63,10 +63,10 @@ class Application : public ApplicationBase @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 97c33550840a..0119291ef47b 100644 --- a/core/platform/wasm/Application-wasm.h +++ b/core/platform/wasm/Application-wasm.h @@ -68,10 +68,10 @@ class Application : public ApplicationBase @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; @@ -93,19 +93,19 @@ class Application : public ApplicationBase */ 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 9ae2da8780e6..245acc22d6e7 100644 --- a/core/renderer/Texture2D.cpp +++ b/core/renderer/Texture2D.cpp @@ -191,7 +191,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 bf5683b00d9d..63ce0ae48cca 100644 --- a/core/renderer/backend/ProgramManager.h +++ b/core/renderer/backend/ProgramManager.h @@ -103,23 +103,23 @@ class AX_DLL ProgramManager * 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 18a5c41e2c97..70da1bcc8e6d 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 f310cfa6ab0e..64036af783c0 100644 --- a/core/renderer/backend/ProgramState.h +++ b/core/renderer/backend/ProgramState.h @@ -306,17 +306,17 @@ class AX_DLL ProgramState : public Object * 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 4cba06cb76d7..ff2ed5658e62 100644 --- a/core/renderer/backend/VertexLayout.h +++ b/core/renderer/backend/VertexLayout.h @@ -81,8 +81,8 @@ class AX_DLL VertexLayout 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 @@ class AX_DLL VertexLayout { 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 b57c11e158fa..fc17ce99c88e 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 4e4436b77c3d..4a7f36205361 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 efe053a47cd1..4c645c513301 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 4b7d4dff7fa7..3e3e2b533f87 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 bba73ff84fae..9203d4b0dc53 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/ActionTimelineCache.h @@ -66,8 +66,6 @@ class CCS_DLL ActionTimelineCache /** 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 137742df050c..d7ff1c6c9810 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.cpp @@ -247,8 +247,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 77dd9940f142..6ae4d213e461 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/CSLoader.h @@ -74,8 +74,6 @@ class CCS_DLL CSLoader 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 01231b6003a7..146995bb0c92 100644 --- a/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h +++ b/extensions/cocostudio/src/cocostudio/ActionTimeline/Frame.h @@ -316,10 +316,6 @@ class CCS_DLL ColorFrame : public Frame 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 388a604786a5..59d8d5bd874e 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 @@ class CCS_DLL Armature : public ax::Node, public ax::BlendProtocol #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 059d6456155f..faff87ccf3a1 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 722332a7b4f3..6bea37856be5 100644 --- a/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h +++ b/extensions/cocostudio/src/cocostudio/ArmatureAnimation.h @@ -90,14 +90,6 @@ class CCS_DLL ArmatureAnimation : public ProcessBase */ 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 @@ class CCS_DLL ArmatureAnimation : public ProcessBase 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 @@ class CCS_DLL ArmatureAnimation : public ProcessBase * @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 @@ class CCS_DLL ArmatureAnimation : public ProcessBase */ 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 9b059905514a..b67459c39377 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 d268512ee954..6bebc68d3b59 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 8909cae0006b..463951835bb8 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 e088aa6fdf93..0a4d79b91453 100644 --- a/extensions/cocostudio/src/cocostudio/Bone.h +++ b/extensions/cocostudio/src/cocostudio/Bone.h @@ -94,9 +94,6 @@ class CCS_DLL Bone : public ax::Node 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 @@ class CCS_DLL Bone : public ax::Node 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 21cee4a11e33..6f5a3612a054 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 c8fe1ede94b0..eb2777871410 100644 --- a/extensions/cocostudio/src/cocostudio/DataReaderHelper.h +++ b/extensions/cocostudio/src/cocostudio/DataReaderHelper.h @@ -86,13 +86,9 @@ class CCS_DLL DataReaderHelper : ax::Object } 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 @@ class CCS_DLL DataReaderHelper : ax::Object 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 a0291a9c5f99..1bf8b18f419c 100644 --- a/extensions/cocostudio/src/cocostudio/DisplayManager.h +++ b/extensions/cocostudio/src/cocostudio/DisplayManager.h @@ -76,12 +76,6 @@ class CCS_DLL DisplayManager : public ax::Object 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 ba493783be3d..6a4b07f5eca8 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 5eb11a224b11..00c49a6a1f8a 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 7ced0f57b20b..8c22076b337c 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 68807090e38b..e173b3e0755c 100644 --- a/extensions/cocostudio/src/cocostudio/InputDelegate.h +++ b/extensions/cocostudio/src/cocostudio/InputDelegate.h @@ -64,44 +64,6 @@ class CCS_DLL InputDelegate 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 f346fc710269..e9e5ffa68c45 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 d4b5c6db5cc5..3395a6f9d2ab 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 400cfe4e3f80..9197da346816 100644 --- a/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h +++ b/extensions/cocostudio/src/cocostudio/SpineSkeletonDataCache.h @@ -29,8 +29,6 @@ class CCS_DLL SpineSkeletonDataCache 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 @@ class CCS_DLL SpineSkeletonDataCache public: hlookup::string_map _cacheTable; - void (*_reportError)(const char* pszFormat, ...); }; #else @@ -64,8 +61,6 @@ class SpineSkeletonDataCache 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 @@ class SpineSkeletonDataCache 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 7e894a92fab2..67c0ab5f586b 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 c9de644df56c..cba84288f3eb 100644 --- a/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h +++ b/extensions/cocostudio/src/cocostudio/SpriteFrameCacheHelper.h @@ -45,15 +45,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 80fd307a4910..0d5c2046f400 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -46,8 +46,6 @@ class ArmatureNodeReader : public ax::Object, public cocostudio::NodeReaderProto ~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 1b0247c0dd23..5288b3a25d6a 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 e6d2eec3fcb5..451b890f16fd 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -39,8 +39,6 @@ class CCS_DLL ButtonReader : public WidgetReader 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 42578f579f88..e1d6f9c980e1 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -39,8 +39,6 @@ class CCS_DLL CheckBoxReader : public WidgetReader 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 8f99495c5e12..37a4ca5aab46 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 d15871752fae..546f567216bf 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -41,8 +41,6 @@ class CCS_DLL ComAudioReader : public ax::Object, public NodeReaderProtocol ~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 ab1af9c57103..51b770a2e088 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -40,8 +40,6 @@ class CCS_DLL GameMapReader : public ax::Object, public NodeReaderProtocol ~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 601acd70947b..22b42e91ee28 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 d2579df4fe3d..f6168c0b50a6 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -42,8 +42,6 @@ class CCS_DLL GameNode3DReader : public ax::Object, public NodeReaderProtocol 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 f1bd726103d0..d7254f149182 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -39,8 +39,6 @@ class CCS_DLL ImageViewReader : public WidgetReader 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 675d4ab0c82d..dbec83323bb0 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -40,8 +40,6 @@ class CCS_DLL LayoutReader : public WidgetReader 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 ecf12f470a10..602db4eb6efd 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 e948552215bd..abe656375f36 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -40,8 +40,6 @@ class CCS_DLL Light3DReader : public ax::Object, public NodeReaderProtocol ~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 ce3760636b7b..19591467b3f3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -39,8 +39,6 @@ class CCS_DLL ListViewReader : public ScrollViewReader 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 9b10815bbb34..e5b74d4816fc 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -39,8 +39,6 @@ class CCS_DLL LoadingBarReader : public WidgetReader 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 3fe7e3599f34..f32e85cc2788 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 b0478e8426f1..e675aace3c48 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/MeshReader/MeshReader.h @@ -41,8 +41,6 @@ class CCS_DLL MeshReader : public ax::Object, public NodeReaderProtocol ~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 946f85bb72bb..ad3aa1a5c7e9 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 6604cada1b0e..18057bab44a6 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -41,8 +41,6 @@ class CCS_DLL Node3DReader : public ax::Object, public NodeReaderProtocol ~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 ae8ba5c2e2df..fe6bcf952a18 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -40,8 +40,6 @@ class CCS_DLL NodeReader : public ax::Object, public NodeReaderProtocol ~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 f8cf913031d4..a6593ccc00f2 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -39,8 +39,6 @@ class CCS_DLL PageViewReader : public LayoutReader 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 085dc0fa346f..6b1d6a885d01 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 af60c2d41484..3f8b3e5a92a9 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -40,8 +40,6 @@ class CCS_DLL Particle3DReader : public ax::Object, public NodeReaderProtocol ~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 502484660477..7793cb161a97 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 1d6aa86e781e..8d2990709d5d 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -40,8 +40,6 @@ class CCS_DLL ParticleReader : public ax::Object, public NodeReaderProtocol ~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 1d6a4e82b685..814104e607e6 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 8b00d9c7f54e..c7be9b54c126 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -39,8 +39,6 @@ class CCS_DLL ProjectNodeReader : public ax::Object, public NodeReaderProtocol ~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 bd9867cdd6e9..239043918bae 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonGroupReader.h @@ -39,8 +39,6 @@ class CCS_DLL RadioButtonGroupReader : public WidgetReader 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 a1d54abe2738..9882c3f4572c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RadioButtonReader/RadioButtonReader.h @@ -39,8 +39,6 @@ class CCS_DLL RadioButtonReader : public WidgetReader 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 9a2c5802cf1b..67fdf1a1a5ad 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/RichTextReader/RichTextReader.h @@ -39,8 +39,6 @@ class CCS_DLL RichTextReader : public WidgetReader 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 e87ba214ec4c..ae35342eb9b4 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -39,8 +39,6 @@ class CCS_DLL ScrollViewReader : public LayoutReader 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 aa7b095b77a1..b92def504eab 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 ee606c992ed6..e06f293b6edf 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -40,8 +40,6 @@ class CCS_DLL SingleNodeReader : public ax::Object, public NodeReaderProtocol ~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 c9004e7404e3..f32aa5a1ef96 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -37,8 +37,6 @@ class BoneNodeReader : public ax::Object, public cocostudio::NodeReaderProtocol ~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 6bd8454f276f..ffac593ff7e6 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h @@ -36,8 +36,6 @@ class SkeletonNodeReader : public BoneNodeReader ~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 be74893bec72..ae7273c15879 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -39,8 +39,6 @@ class CCS_DLL SliderReader : public WidgetReader 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 0eaad8509869..3d5f2b264e89 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 0e3d0a1b7902..89b617e29593 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpineSkeletonReader/SpineSkeletonReader.h @@ -42,8 +42,6 @@ class CCS_DLL SpineSkeletonReader : public ax::Object, public NodeReaderProtocol ~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 36b66b138ef7..328577263fe2 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 f8f2fdd8f646..3aa4db78471c 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -40,8 +40,6 @@ class CCS_DLL SpriteReader : public ax::Object, public NodeReaderProtocol ~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 24dd85a966fa..19d0df19b94e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -39,8 +39,6 @@ class CCS_DLL TextAtlasReader : public WidgetReader 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 e4704e7e47ad..cf328ab2a343 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -39,8 +39,6 @@ class CCS_DLL TextBMFontReader : public WidgetReader 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 a69d977a4c41..9546fb678319 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldExReader.h @@ -39,8 +39,6 @@ class CCS_DLL TextFieldExReader : public ax::Object, public NodeReaderProtocol 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 3e202d9ce4d6..82b3e109dbac 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -39,8 +39,6 @@ class CCS_DLL TextFieldReader : public WidgetReader 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 66a7678d681d..9f042831c684 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/TextReader/TextReader.h @@ -39,8 +39,6 @@ class CCS_DLL TextReader : public WidgetReader 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 495dd5990905..0b9ca37ea9ba 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 e4a57c6430fe..7829789243d3 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -41,8 +41,6 @@ class CCS_DLL UserCameraReader : public ax::Object, public NodeReaderProtocol ~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 946b72f0108e..4baa92131ce7 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 8a6cc1959f87..d86d217f0c0e 100644 --- a/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h +++ b/extensions/cocostudio/src/cocostudio/WidgetReader/WidgetReader.h @@ -46,8 +46,6 @@ class CCS_DLL WidgetReader : public ax::Object, public WidgetReaderProtocol, pub 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 90c7fd3ec091..9811cb9969cd 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 (!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; - } - }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"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - std::string ret = cobj->getStringFromFile(arg0); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - 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; - 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 (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "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; - } - }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"); + argc = lua_gettop(tolua_S)-1; + 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; } - bool ret = cobj->writeStringToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - 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; - 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 (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "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; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - ax::ValueMap arg0; - ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "ax.FileUtils:writeValueMapToFile"); + argc = lua_gettop(tolua_S)-1; + 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; } - bool ret = cobj->writeValueMapToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - 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; - 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 (!ok) { break; } - std::string_view arg1; - ok &= luaval_to_std_string_view(tolua_S, 3,&arg1, "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; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - ax::ValueVector arg0; - ok &= luaval_to_ccvaluevector(tolua_S, 2, &arg0, "ax.FileUtils:writeValueVectorToFile"); + argc = lua_gettop(tolua_S)-1; + 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; } - bool ret = cobj->writeValueVectorToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - 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; - 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 (!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; - } - }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"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - bool ret = cobj->isFileExist(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - 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; - 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 (!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; - } - }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"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string_view arg0; - if (!ok) { break; } - bool ret = cobj->isDirectoryExist(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - 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; - 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 bafd4cac077d..a4b031d2a8bf 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 e46eb55d6230..1bf5a612b201 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 04988ee1af02..f1b9fbe2fe93 100644 --- a/extensions/scripting/lua-bindings/manual/LuaEngine.h +++ b/extensions/scripting/lua-bindings/manual/LuaEngine.h @@ -64,7 +64,7 @@ class AX_LUA_DLL LuaEngine : public ScriptEngineProtocol * * @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 42ae00e7bc3b..da8a793f2f44 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 403dfc1a6539..dc535165c2b8 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 33938b051556..23adb9763b42 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 e8f7f86d72d4..51dfc51e1749 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 = " 测试字符串.";