Allow turn on/off deprecated features, follow #2111 (#2136)

- Add new cmake option: `AX_CORE_PROFILE`
- Remove deprecated stubs from extension: `cocostudio`
- Remove `AX_DEPRECATED_ATTRIBUTE`
This commit is contained in:
halx99 2024-09-13 02:17:35 +08:00 committed by GitHub
parent c3d54767a2
commit a6dd7e932d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
115 changed files with 512 additions and 1078 deletions

View File

@ -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),

View File

@ -204,9 +204,9 @@ public:
* animations are not enabled by default
*/
void setTileAnimEnabled(bool enabled);
AX_DEPRECATED_ATTRIBUTE int getLayerNum() const { return getLayerCount(); }
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) int getLayerNum() const { return getLayerCount(); }
#endif
int getLayerCount() const { return _layerCount; }
std::string_view getResourceFile() const { return _tmxFile; }
@ -268,4 +268,4 @@ private:
// @API compatible
typedef FastTMXTiledMap TMXTiledMap;
}
} // namespace ax

View File

@ -144,12 +144,12 @@ FontAtlas* FontAtlasCache::getFontAtlasFNT(std::string_view fontFileName, const
return nullptr;
}
#ifndef AX_CORE_PROFILE
FontAtlas* FontAtlasCache::getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset)
{
return getFontAtlasFNT(fontFileName, Rect(imageOffset.x, imageOffset.y, 0, 0), false);
}
#endif
FontAtlas* FontAtlasCache::getFontAtlasCharMap(std::string_view plistFile)
{
std::string_view atlasName = plistFile;
@ -260,11 +260,12 @@ void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Rec
_atlasMap.emplace(std::move(atlasName), tempAtlas);
}
}
#ifndef AX_CORE_PROFILE
void FontAtlasCache::reloadFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset)
{
reloadFontAtlasFNT(fontFileName, Rect(imageOffset.x, imageOffset.y, 0, 0), false);
}
#endif
void FontAtlasCache::unloadFontAtlasTTF(std::string_view fontFileName)
{

View File

@ -52,8 +52,9 @@ public:
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName);
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, std::string_view subTextureKey);
static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated);
AX_DEPRECATED_ATTRIBUTE static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset);
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) static FontAtlas* getFontAtlasFNT(std::string_view fontFileName, const Vec2& imageOffset);
#endif
static FontAtlas* getFontAtlasCharMap(std::string_view charMapFile,
int itemWidth,
int itemHeight,
@ -73,10 +74,10 @@ public:
otherwise, it will cause program crash!
*/
static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated);
AX_DEPRECATED_ATTRIBUTE static void reloadFontAtlasFNT(std::string_view fontFileName,
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) static void reloadFontAtlasFNT(std::string_view fontFileName,
const Vec2& imageOffset = Vec2::ZERO);
#endif
/** Unload all texture atlas texture create by special file name.
CAUTION : All component use this font texture should be reset font name, though the file name is same!
otherwise, it will cause program crash!

View File

@ -590,12 +590,12 @@ FontFNT* FontFNT::create(std::string_view fntFilePath)
tempFont->autorelease();
return tempFont;
}
#ifndef AX_CORE_PROFILE
FontFNT* FontFNT::create(std::string_view fntFilePath, const Vec2& imageOffset)
{
return create(fntFilePath, Rect(imageOffset.x, imageOffset.y, 0, 0), false);
}
#endif
FontFNT::FontFNT(BMFontConfiguration* theContfig, const Rect& imageRect, bool imageRotated)
: _configuration(theContfig), _imageRectInPoints(AX_RECT_PIXELS_TO_POINTS(imageRect)), _imageRotated(imageRotated)
{

View File

@ -149,9 +149,9 @@ public:
static FontFNT* create(std::string_view fntFilePath, const Rect& imageRect, bool imageRotated);
static FontFNT* create(std::string_view fntFilePath, std::string_view subTextureKey);
static FontFNT* create(std::string_view fntFilePath);
AX_DEPRECATED_ATTRIBUTE static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) static FontFNT* create(std::string_view fntFilePath, const Vec2& imageOffset = Vec2::ZERO);
#endif
/** Purges the cached data.
Removes from memory the cached configurations and the atlas name dictionary.
*/

View File

@ -360,6 +360,7 @@ Label* Label::createWithBMFont(std::string_view bmfontPath,
return nullptr;
}
#ifndef AX_CORE_PROFILE
Label* Label::createWithBMFont(std::string_view bmfontPath,
std::string_view text,
const TextHAlignment& hAlignment,
@ -369,7 +370,7 @@ Label* Label::createWithBMFont(std::string_view bmfontPath,
return createWithBMFont(bmfontPath, text, hAlignment, maxLineWidth, Rect(imageOffset.x, imageOffset.y, 0, 0),
false);
}
#endif
Label* Label::createWithCharMap(std::string_view plistFile)
{
auto ret = new Label();
@ -927,12 +928,12 @@ bool Label::setBMFontFilePath(std::string_view bmfontFilePath, std::string_view
return true;
}
#ifndef AX_CORE_PROFILE
bool Label::setBMFontFilePath(std::string_view bmfontFilePath, const Vec2& imageOffset, float fontSize)
{
return setBMFontFilePath(bmfontFilePath, Rect(imageOffset.x, imageOffset.y, 0, 0), false);
}
#endif
void Label::setString(std::string_view text)
{
if (text.compare(_utf8Text))

View File

@ -273,12 +273,13 @@ public:
* @return An automatically released Label object.
* @see setBMFontFilePath setMaxLineWidth
*/
AX_DEPRECATED_ATTRIBUTE static Label* createWithBMFont(std::string_view bmfontPath,
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) static Label* createWithBMFont(std::string_view bmfontPath,
std::string_view text,
const TextHAlignment& hAlignment,
int maxLineWidth,
const Vec2& imageOffset);
#endif
/**
* Allocates and initializes a Label, with char map configuration.
*
@ -341,12 +342,12 @@ public:
/** Sets a new bitmap font to Label */
virtual bool setBMFontFilePath(std::string_view bmfontFilePath, std::string_view subTextureKey, float fontSize = 0);
#ifndef AX_CORE_PROFILE
/** Sets a new bitmap font to Label */
AX_DEPRECATED_ATTRIBUTE virtual bool setBMFontFilePath(std::string_view bmfontFilePath,
AX_DEPRECATED(2.1) virtual bool setBMFontFilePath(std::string_view bmfontFilePath,
const Vec2& imageOffset,
float fontSize = 0);
#endif
/** Returns the bitmap font used by the Label.*/
std::string_view getBMFontFilePath() const { return _bmFontPath; }
@ -794,8 +795,10 @@ protected:
virtual void updateShaderProgram();
virtual void updateFontScale();
#ifndef AX_CORE_PROFILE
/* DEPRECATED: use updateFontScale instead */
AX_DEPRECATED_ATTRIBUTE virtual void updateBMFontScale() { updateFontScale(); }
AX_DEPRECATED(2.1) virtual void updateBMFontScale() { updateFontScale(); }
#endif
void scaleFontSize(float fontSize);
bool setTTFConfigInternal(const TTFConfig& ttfConfig);
bool updateTTFConfigInternal();

View File

@ -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)

View File

@ -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"

View File

@ -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)

View File

@ -38,7 +38,6 @@
* @addtogroup base
* @js NA
* @lua NA
* @DEPRECATED use axstd::byte_buffer directly
*/
namespace ax
{

View File

@ -57,7 +57,9 @@ THE SOFTWARE.
#include "base/Logging.h"
#include "base/AutoreleasePool.h"
#include "base/Configuration.h"
#include "base/AsyncTaskPool.h"
#ifndef AX_CORE_PROFILE
# include "base/AsyncTaskPool.h"
#endif
#include "base/ObjectFactory.h"
#include "platform/Application.h"
#if defined(AX_ENABLE_AUDIO)
@ -1057,7 +1059,9 @@ void Director::reset()
AnimationCache::destroyInstance();
SpriteFrameCache::destroyInstance();
FileUtils::destroyInstance();
#ifndef AX_CORE_PROFILE
AsyncTaskPool::destroyInstance();
#endif
backend::ProgramStateRegistry::destroyInstance();
backend::ProgramManager::destroyInstance();

View File

@ -230,7 +230,7 @@ AX_DLL void writeLog(LogItem& item, const char* tag)
# endif
#endif
}
#ifndef AX_CORE_PROFILE
AX_API void print(const char* format, ...)
{
va_list args;
@ -243,5 +243,5 @@ AX_API void print(const char* format, ...)
outputLog(LogItem::vformat(FMT_COMPILE("{}{}\n"), preprocessLog(LogItem{LogLevel::Silent}), message),
"axmol debug info");
}
#endif
}

View File

@ -160,9 +160,10 @@ inline void printLogT(_FmtType&& fmt, LogItem& item, _Types&&... args)
#define AXLOGT AXLOGV
#ifndef AX_CORE_PROFILE
/**
@brief Output Debug message.
*/
/* AX_DEPRECATED_ATTRIBUTE*/ AX_API void print(const char* format, ...) AX_FORMAT_PRINTF(1, 2); // use AXLOGD instead
/* AX_DEPRECATED(2.1)*/ AX_API void print(const char* format, ...) AX_FORMAT_PRINTF(1, 2); // use AXLOGD instead
#endif
}

View File

@ -471,12 +471,12 @@ public:
@js NA
*/
void runOnAxmolThread(std::function<void()> action);
AX_DEPRECATED_ATTRIBUTE void performFunctionInCocosThread(std::function<void()> action)
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) void performFunctionInCocosThread(std::function<void()> action)
{
runOnAxmolThread(std::move(action));
}
#endif
/**
* Remove all pending functions queued to be performed with Scheduler::runOnAxmolThread
* Functions unscheduled in this manner will not be executed
@ -485,8 +485,9 @@ public:
* @js NA
*/
void removeAllPendingActions();
AX_DEPRECATED_ATTRIBUTE void removeAllFunctionsToBePerformedInCocosThread() { removeAllPendingActions(); }
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) void removeAllFunctionsToBePerformedInCocosThread() { removeAllPendingActions(); }
#endif
protected:
/** Schedules the 'callback' function for a given target with a given priority.
The 'callback' selector will be called every frame.

View File

@ -59,7 +59,7 @@ ScriptHandlerEntry::~ScriptHandlerEntry()
if (_handler != 0)
{
ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_handler);
LUALOG("[LUA] Remove event handler: %d", _handler);
AXLOGD("[LUA] Remove event handler: %d", _handler);
_handler = 0;
}
}
@ -80,14 +80,14 @@ bool SchedulerScriptHandlerEntry::init(float interval, bool paused)
_timer = new TimerScriptHandler();
_timer->initWithScriptHandler(_handler, interval);
_paused = paused;
LUALOG("[LUA] ADD script schedule: %d, entryID: %d", _handler, _entryId);
AXLOGD("[LUA] ADD script schedule: {}, entryID: {}", _handler, _entryId);
return true;
}
SchedulerScriptHandlerEntry::~SchedulerScriptHandlerEntry()
{
_timer->release();
LUALOG("[LUA] DEL script schedule %d, entryID: %d", _handler, _entryId);
AXLOGD("[LUA] DEL script schedule {}, entryID: {}", _handler, _entryId);
}
//

View File

@ -38,7 +38,7 @@ namespace ax
namespace StringUtils
{
//#ifndef AX_CORE_PROFILE
std::string AX_DLL format(const char* format, ...)
{
va_list args;
@ -116,7 +116,7 @@ std::string vformat(const char* format, va_list ap)
return buf;
}
//#endif
/*
* @str: the string to search through.
* @c: the character to not look for.

View File

@ -66,10 +66,11 @@ inline std::string toString(T arg)
{
return fmt::to_string(arg);
}
//#ifndef AX_CORE_PROFILE
// DEPRECATED since axmol-2.1.4, use fmt::format instead
std::string AX_DLL format(const char* format, ...) AX_FORMAT_PRINTF(1, 2);
std::string AX_DLL vformat(const char* format, va_list ap);
//#endif
/**
* @brief Converts from UTF8 string to UTF16 string.

View File

@ -25,10 +25,14 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
!!! The cocos2d-x compatibility header, please reserve this file, because some
extensions use it, i.g fairygui, live2d ...
****************************************************************************/
#ifndef __COCOS2D_H__
#define __COCOS2D_H__
#ifndef __AX_COCOS2DX_H__
#define __AX_COCOS2DX_H__
#include "axmol.h"
@ -49,23 +53,22 @@ using Ref = Object;
#define setDisplayStats setStatsDisplay
}
} // namespace ax
namespace cocos2d = ax;
#define CC_SAFE_RELEASE AX_SAFE_RELEASE
#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL
#define CC_SAFE_DELETE AX_SAFE_DELETE
#define CCASSERT AXASSERT
#define CC_ASSERT AX_ASSERT
#define CC_CONSTRUCTOR_ACCESS public
#define CCLOG AXLOG
#define CCLOGINFO AXLOGINFO
#define CCLOGWARN AXLOGWARN
#define CCLOGERROR AXLOGERROR
#define CC_DEPRECATED_ATTRIBUTE AX_DEPRECATED_ATTRIBUTE
#define CC_SAFE_RELEASE AX_SAFE_RELEASE
#define CC_SAFE_RELEASE_NULL AX_SAFE_RELEASE_NULL
#define CC_SAFE_DELETE AX_SAFE_DELETE
#define CCASSERT AXASSERT
#define CC_ASSERT AX_ASSERT
#define CC_CONSTRUCTOR_ACCESS public
#ifndef AX_CORE_PROFILE
# define CCLOG AXLOG
# define CCLOGINFO AXLOGINFO
# define CCLOGWARN AXLOGWARN
# define CCLOGERROR AXLOGERROR
#endif
#define CC_SAFE_RETAIN AX_SAFE_RETAIN

View File

@ -489,7 +489,7 @@ bool FileUtils::writeStringToFile(std::string_view dataStr, std::string_view ful
{
return FileUtils::writeBinaryToFile(dataStr.data(), dataStr.size(), fullPath);
}
#ifndef AX_CORE_PROFILE
void FileUtils::writeStringToFile(std::string dataStr,
std::string_view fullPath,
std::function<void(bool)> callback) const
@ -500,12 +500,12 @@ void FileUtils::writeStringToFile(std::string dataStr,
},
std::move(callback), std::move(dataStr));
}
#endif
bool FileUtils::writeDataToFile(const Data& data, std::string_view fullPath) const
{
return FileUtils::writeBinaryToFile(data.getBytes(), data.getSize(), fullPath);
}
#ifndef AX_CORE_PROFILE
void FileUtils::writeDataToFile(Data data, std::string_view fullPath, std::function<void(bool)> callback) const
{
performOperationOffthread(
@ -514,7 +514,7 @@ void FileUtils::writeDataToFile(Data data, std::string_view fullPath, std::funct
},
std::move(callback), std::move(data));
}
#endif
bool FileUtils::writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath)
{
AXASSERT(!fullPath.empty() && dataSize > 0, "Invalid parameters.");
@ -553,7 +553,7 @@ std::string FileUtils::getStringFromFile(std::string_view filename) const
getContents(filename, &s);
return s;
}
#ifndef AX_CORE_PROFILE
void FileUtils::getStringFromFile(std::string_view path, std::function<void(std::string)> callback) const
{
// Get the full path on the main thread, to avoid the issue that FileUtil's is not
@ -563,14 +563,14 @@ void FileUtils::getStringFromFile(std::string_view path, std::function<void(std:
[path = std::string{fullPath}]() -> 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<void(Data)> callback) const
{
auto fullPath = fullPathForFilename(filename);
@ -578,7 +578,7 @@ void FileUtils::getDataFromFile(std::string_view filename, std::function<void(Da
[path = std::string{fullPath}]() -> Data { return FileUtils::getInstance()->getDataFromFile(path); },
std::move(callback));
}
#endif
FileUtils::Status FileUtils::getContents(std::string_view filename, ResizableBuffer* buffer) const
{
if (filename.empty())
@ -614,7 +614,7 @@ FileUtils::Status FileUtils::getContents(std::string_view filename, ResizableBuf
return Status::OK;
}
#ifndef AX_CORE_PROFILE
void FileUtils::writeValueMapToFile(ValueMap dict, std::string_view fullPath, std::function<void(bool)> callback) const
{
@ -635,7 +635,7 @@ void FileUtils::writeValueVectorToFile(ValueVector vecData,
},
std::move(callback), std::move(vecData));
}
#endif
std::string FileUtils::getPathForFilename(std::string_view filename, std::string_view searchPath) const
{
auto file = filename;
@ -923,7 +923,7 @@ bool FileUtils::isFileExist(std::string_view filename) const
return !fullpath.empty();
}
}
#ifndef AX_CORE_PROFILE
void FileUtils::isFileExist(std::string_view filename, std::function<void(bool)> callback) const
{
auto fullPath = fullPathForFilename(filename);
@ -931,7 +931,7 @@ void FileUtils::isFileExist(std::string_view filename, std::function<void(bool)>
[path = std::string{fullPath}]() -> bool { return FileUtils::getInstance()->isFileExist(path); },
std::move(callback));
}
#endif
bool FileUtils::isAbsolutePath(std::string_view path) const
{
return isAbsolutePathInternal(path);
@ -970,6 +970,8 @@ bool FileUtils::isDirectoryExist(std::string_view dirPath) const
}
}
#ifndef AX_CORE_PROFILE
void FileUtils::isDirectoryExist(std::string_view fullPath, std::function<void(bool)> callback) const
{
AXASSERT(isAbsolutePath(fullPath), "Async isDirectoryExist only accepts absolute file paths");
@ -1049,6 +1051,7 @@ void FileUtils::listFilesRecursivelyAsync(std::string_view dirPath,
},
std::move(callback));
}
#endif
std::unique_ptr<IFileStream> FileUtils::openFileStream(std::string_view filePath, IFileStream::Mode mode) const
{

View File

@ -144,30 +144,12 @@ public:
*/
virtual std::string getStringFromFile(std::string_view filename) const;
/**
* Gets string from a file, async off the main cocos thread
*
* @param path filepath for the string to be read. Can be relative or absolute path
* @param callback Function that will be called when file is read. Will be called
* on the main cocos thread.
*/
virtual void getStringFromFile(std::string_view path, std::function<void(std::string)> 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<void(Data)> callback) const;
enum class Status
{
OK = 0,
@ -433,23 +415,6 @@ public:
*/
virtual bool writeStringToFile(std::string_view dataStr, std::string_view fullPath) const;
/**
* Write a string to a file, done async off the main cocos thread
* Use this function if you need file access without blocking the main thread.
*
* This function takes a std::string by value on purpose, to leverage move sematics.
* If you want to avoid a copy of your datastr, use std::move/std::forward if appropriate
*
* @param dataStr the string want to save
* @param fullPath The full path to the file you want to save a string
* @param callback The function called once the string has been written to a file. This
* function will be executed on the main cocos thread. It will have on boolean argument
* signifying if the write was successful.
*/
virtual void writeStringToFile(std::string dataStr,
std::string_view fullPath,
std::function<void(bool)> callback) const;
/**
* write Data into a file
*
@ -464,22 +429,6 @@ public:
*/
static bool writeBinaryToFile(const void* data, size_t dataSize, std::string_view fullPath);
/**
* Write Data into a file, done async off the main cocos thread.
*
* Use this function if you need to write Data while not blocking the main cocos thread.
*
* This function takes Data by value on purpose, to leverage move sematics.
* If you want to avoid a copy of your data, use std::move/std::forward if appropriate
*
*@param data The data that will be written to disk
*@param fullPath The absolute file path that the data will be written to
*@param callback The function that will be called when data is written to disk. This
* function will be executed on the main cocos thread. It will have on boolean argument
* signifying if the write was successful.
*/
virtual void writeDataToFile(Data data, std::string_view fullPath, std::function<void(bool)> callback) const;
/**
* write ValueMap into a plist file
*
@ -489,24 +438,6 @@ public:
*/
virtual bool writeValueMapToFile(const ValueMap& dict, std::string_view fullPath) const;
/**
* Write a ValueMap into a file, done async off the main cocos thread.
*
* Use this function if you need to write a ValueMap while not blocking the main cocos thread.
*
* This function takes ValueMap by value on purpose, to leverage move sematics.
* If you want to avoid a copy of your dict, use std::move/std::forward if appropriate
*
*@param dict The ValueMap that will be written to disk
*@param fullPath The absolute file path that the data will be written to
*@param callback The function that will be called when dict is written to disk. This
* function will be executed on the main cocos thread. It will have on boolean argument
* signifying if the write was successful.
*/
virtual void writeValueMapToFile(ValueMap dict,
std::string_view fullPath,
std::function<void(bool)> callback) const;
/**
* write ValueVector into a plist file
*
@ -516,24 +447,6 @@ public:
*/
virtual bool writeValueVectorToFile(const ValueVector& vecData, std::string_view fullPath) const;
/**
* Write a ValueVector into a file, done async off the main cocos thread.
*
* Use this function if you need to write a ValueVector while not blocking the main cocos thread.
*
* This function takes ValueVector by value on purpose, to leverage move sematics.
* If you want to avoid a copy of your dict, use std::move/std::forward if appropriate
*
*@param vecData The ValueVector that will be written to disk
*@param fullPath The absolute file path that the data will be written to
*@param callback The function that will be called when vecData is written to disk. This
* function will be executed on the main cocos thread. It will have on boolean argument
* signifying if the write was successful.
*/
virtual void writeValueVectorToFile(ValueVector vecData,
std::string_view fullPath,
std::function<void(bool)> callback) const;
// Converts the contents of a file to a ValueVector.
// This method is used internally.
virtual ValueVector getValueVectorFromFile(std::string_view filename) const;
@ -547,34 +460,14 @@ public:
*/
virtual bool isFileExist(std::string_view filename) const;
/**
* Checks if a file exists, done async off the main cocos thread.
*
* Use this function if you need to check if a file exists while not blocking the main cocos thread.
*
* @note If a relative path was passed in, it will be inserted a default root path at the beginning.
* @param filename The path of the file, it could be a relative or absolute path.
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file exists, false otherwise.
*/
virtual void isFileExist(std::string_view filename, std::function<void(bool)> callback) const;
/**
* Gets filename extension is a suffix (separated from the base filename by a dot) in lower case.
* Examples of filename extensions are .png, .jpeg, .exe, .dmg and .txt.
* @param filePath The path of the file, it could be a relative or absolute path.
* @return suffix for filename in lower case or empty if a dot not found.
*/
AX_DEPRECATED_ATTRIBUTE static std::string getFileExtension(std::string_view filePath) { return getPathExtension(filePath); }
static std::string getPathExtension(std::string_view filePath);
/**
* Gets filename shotName
* @param filePath The path of the file, it could be a relative or absolute path.
* @return fileName.Extension without path
*/
AX_DEPRECATED_ATTRIBUTE static std::string getFileShortName(std::string_view filePath) { return getPathBaseName(filePath); }
/*
* @since axmol-2.1.5
*/
@ -611,15 +504,6 @@ public:
*/
virtual bool isDirectoryExist(std::string_view dirPath) const;
/**
* Checks whether the absoulate path is a directory, async off of the main cocos thread.
*
* @param dirPath The path of the directory, it must be an absolute path
* @param callback that will accept a boolean, true if the file exists, false otherwise.
* Callback will happen on the main cocos thread.
*/
virtual void isDirectoryExist(std::string_view fullPath, std::function<void(bool)> callback) const;
/**
* Creates a directory.
*
@ -627,16 +511,6 @@ public:
* @return True if the directory have been created successfully, false if not.
*/
virtual bool createDirectories(std::string_view dirPath) const;
AX_DEPRECATED_ATTRIBUTE bool createDirectory(std::string_view dirPath) const { return createDirectories(dirPath); }
/**
* Create a directory, async off the main cocos thread.
*
* @param dirPath the path of the directory, it must be an absolute path
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the directory was successfully, false otherwise.
*/
AX_DEPRECATED_ATTRIBUTE void createDirectory(std::string_view dirPath, std::function<void(bool)> callback) const;
/**
* Removes a directory.
@ -646,15 +520,6 @@ public:
*/
virtual bool removeDirectory(std::string_view dirPath) const;
/**
* Removes a directory, async off the main cocos thread.
*
* @param dirPath the path of the directory, it must be an absolute path
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the directory was successfully removed, false otherwise.
*/
AX_DEPRECATED_ATTRIBUTE void removeDirectory(std::string_view dirPath, std::function<void(bool)> callback) const;
/**
* Removes a file.
*
@ -663,15 +528,6 @@ public:
*/
virtual bool removeFile(std::string_view filepath) const;
/**
* Removes a file, async off the main cocos thread.
*
* @param filepath the path of the file to remove, it must be an absolute path
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file was successfully removed, false otherwise.
*/
AX_DEPRECATED_ATTRIBUTE virtual void removeFile(std::string_view filepath, std::function<void(bool)> callback) const;
/**
* Renames a file under the given directory.
*
@ -682,20 +538,6 @@ public:
*/
virtual bool renameFile(std::string_view path, std::string_view oldname, std::string_view name) const;
/**
* Renames a file under the given directory, async off the main cocos thread.
*
* @param path The parent directory path of the file, it must be an absolute path.
* @param oldname The current name of the file.
* @param name The new name of the file.
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file was successfully renamed, false otherwise.
*/
AX_DEPRECATED_ATTRIBUTE virtual void renameFile(std::string_view path,
std::string_view oldname,
std::string_view name,
std::function<void(bool)> callback) const;
/**
* Renames a file under the given directory.
*
@ -705,18 +547,6 @@ public:
*/
virtual bool renameFile(std::string_view oldfullpath, std::string_view newfullpath) const;
/**
* Renames a file under the given directory, async off the main cocos thread.
*
* @param oldfullpath The current fullpath of the file. Includes path and name.
* @param newfullpath The new fullpath of the file. Includes path and name.
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file was successfully renamed, false otherwise.
*/
AX_DEPRECATED_ATTRIBUTE void renameFile(std::string_view oldfullpath,
std::string_view newfullpath,
std::function<void(bool)> callback) const;
/**
* Retrieve the file size.
*
@ -726,6 +556,183 @@ public:
*/
virtual int64_t getFileSize(std::string_view filepath) const;
/**
* List all files in a directory.
*
* @param dirPath The path of the directory, it could be a relative or an absolute path.
* @return File paths in a string vector
*/
virtual std::vector<std::string> 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<std::string>* 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<void(std::string)> 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<void(Data)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> 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<void(bool)> callback) const;
/**
* Renames a file under the given directory, async off the main cocos thread.
*
* @param path The parent directory path of the file, it must be an absolute path.
* @param oldname The current name of the file.
* @param name The new name of the file.
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file was successfully renamed, false otherwise.
*/
AX_DEPRECATED(2.1) virtual void renameFile(std::string_view path,
std::string_view oldname,
std::string_view name,
std::function<void(bool)> callback) const;
/**
* Renames a file under the given directory, async off the main cocos thread.
*
* @param oldfullpath The current fullpath of the file. Includes path and name.
* @param newfullpath The new fullpath of the file. Includes path and name.
* @param callback The function that will be called when the operation is complete. Will have one boolean
* argument, true if the file was successfully renamed, false otherwise.
*/
AX_DEPRECATED(2.1) void renameFile(std::string_view oldfullpath,
std::string_view newfullpath,
std::function<void(bool)> callback) const;
/**
* Retrieve the file size, async off the main cocos thread.
*
@ -734,15 +741,7 @@ public:
* @param callback The function that will be called when the operation is complete. Will have one long
* argument, the file size.
*/
AX_DEPRECATED_ATTRIBUTE void getFileSize(std::string_view filepath, std::function<void(int64_t)> 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<std::string> listFiles(std::string_view dirPath) const;
AX_DEPRECATED(2.1) void getFileSize(std::string_view filepath, std::function<void(int64_t)> callback) const;
/**
* List all files in a directory async, off of the main cocos thread.
@ -753,15 +752,7 @@ public:
* @js NA
* @lua NA
*/
AX_DEPRECATED_ATTRIBUTE void listFilesAsync(std::string_view dirPath, std::function<void(std::vector<std::string>)> 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<std::string>* files) const;
AX_DEPRECATED(2.1) void listFilesAsync(std::string_view dirPath, std::function<void(std::vector<std::string>)> callback) const;
/**
* List all files recursively in a directory, async off the main cocos thread.
@ -772,9 +763,9 @@ public:
* @js NA
* @lua NA
*/
AX_DEPRECATED_ATTRIBUTE void listFilesRecursivelyAsync(std::string_view dirPath,
AX_DEPRECATED(2.1) void listFilesRecursivelyAsync(std::string_view dirPath,
std::function<void(std::vector<std::string>)> callback) const;
#endif
/** Returns the full path cache. */
const hlookup::string_map<std::string> getFullPathCache() const { return _fullPathCache; }

View File

@ -314,52 +314,52 @@ public: \
#define AX_BREAK_IF(cond) \
if (cond) \
break
#define __AXLOGWITHFUNCTION(s, ...) \
ax::print("%s : %s", __FUNCTION__, ax::StringUtils::format(s, ##__VA_ARGS__).c_str())
#ifndef AX_CORE_PROFILE
# define __AXLOGWITHFUNCTION(s, ...) \
ax::print("%s : %s", __FUNCTION__, ax::StringUtils::format(s, ##__VA_ARGS__).c_str())
/// @name legacy log macros, deprecated since axmol 2.1.4, use AXLOGD, AXLOGI, AXLOGW, ... instead
/// @{
#if !defined(_AX_DEBUG) || _AX_DEBUG == 0
# define AXLOG(...) \
do \
{ \
} while (0)
# define AXLOGINFO(...) \
do \
{ \
} while (0)
# define AXLOGERROR(...) \
do \
{ \
} while (0)
# define AXLOGWARN(...) \
do \
{ \
} while (0)
# if !defined(_AX_DEBUG) || _AX_DEBUG == 0
# define AXLOG(...) \
do \
{ \
} while (0)
# define AXLOGINFO(...) \
do \
{ \
} while (0)
# define AXLOGERROR(...) \
do \
{ \
} while (0)
# define AXLOGWARN(...) \
do \
{ \
} while (0)
#elif _AX_DEBUG == 1
# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGINFO(format, ...) \
do \
{ \
} while (0)
# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)
# elif _AX_DEBUG == 1
# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGINFO(format, ...) \
do \
{ \
} while (0)
# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)
#elif _AX_DEBUG > 1
# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)
#endif // _AX_DEBUG
# elif _AX_DEBUG > 1
# define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__)
# define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)
# endif // _AX_DEBUG
/** Lua engine debug */
#if !defined(_AX_DEBUG) || _AX_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0
# define LUALOG(...)
#else
# define LUALOG(format, ...) ax::print(format, ##__VA_ARGS__)
#endif // Lua engine debug
# if !defined(_AX_DEBUG) || _AX_DEBUG == 0 || AX_LUA_ENGINE_DEBUG == 0
# define LUALOG(...)
# else
# define LUALOG(format, ...) ax::print(format, ##__VA_ARGS__)
# endif // Lua engine debug
#endif
// end of debug group
/// @}
@ -391,23 +391,18 @@ public: \
TypeName(); \
AX_DISALLOW_COPY_AND_ASSIGN(TypeName)
/** @def AX_DEPRECATED_ATTRIBUTE
* Only certain compilers support __attribute__((deprecated)).
*/
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
# define AX_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#elif _MSC_VER >= 1400 // vs 2005 or higher
# define AX_DEPRECATED_ATTRIBUTE __declspec(deprecated)
#else
# define AX_DEPRECATED_ATTRIBUTE
#endif
/** @def AX_DEPRECATED(...)
* Macro to mark things deprecated as of a particular version
* can be used with arbitrary parameters which are thrown away.
* e.g. AX_DEPRECATED(4.0) or AX_DEPRECATED(4.0, "not going to need this anymore") etc.
*/
#define AX_DEPRECATED(...) AX_DEPRECATED_ATTRIBUTE
#if defined(_WIN32)
# define AX_DEPRECATED(...) __declspec(deprecated)
#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
# define AX_DEPRECATED(...) __attribute__((deprecated))
#else
# define AX_DEPRECATED(...)
#endif
/** @def AX_FORMAT_PRINTF(formatPos, argPos)
* Only certain compiler support __attribute__((format))

View File

@ -61,10 +61,10 @@ public:
@return Current application instance pointer.
*/
static Application* getInstance();
#ifndef AX_CORE_PROFILE
/** @deprecated Use getInstance() instead */
AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
AX_DEPRECATED(2.1) static Application* sharedApplication();
#endif
/**
@brief Get current language config
@return Current language config

View File

@ -64,10 +64,10 @@ public:
@return Current application instance pointer.
*/
static Application* getInstance();
#ifndef AX_CORE_PROFILE
/** @deprecated Use getInstance() instead */
AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
AX_DEPRECATED(2.1) static Application* sharedApplication();
#endif
/* override functions */
virtual LanguageType getCurrentLanguage() override;

View File

@ -69,10 +69,10 @@ public:
@return Current application instance pointer.
*/
static Application* getInstance();
#ifndef AX_CORE_PROFILE
/** @deprecated Use getInstance() instead */
AX_DEPRECATED_ATTRIBUTE static Application* sharedApplication();
AX_DEPRECATED(2.1) static Application* sharedApplication();
#endif
/* override functions */
virtual LanguageType getCurrentLanguage() override;
@ -94,19 +94,19 @@ public:
*/
virtual bool openURL(std::string_view url) override;
#ifndef AX_CORE_PROFILE
/**
* Sets the Resource root path.
* @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.
*/
AX_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);
AX_DEPRECATED(2.1) void setResourceRootPath(const std::string& rootResDir);
/**
* Gets the Resource root path.
* @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead.
*/
AX_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath();
AX_DEPRECATED(2.1) const std::string& getResourceRootPath();
#endif
/**
@brief Get target platform
*/

View File

@ -192,7 +192,7 @@ bool Texture2D::updateWithImage(Image* image, backend::PixelFormat format, int i
{
if (image == nullptr)
{
__AXLOGWITHFUNCTION("axmol: Texture2D. Can't create Texture. UIImage is nil");
AXLOGW("axmol: Texture2D. Can't create Texture. UIImage is nil");
return false;
}

View File

@ -103,23 +103,23 @@ public:
* Unload all program objects from cache.
*/
void unloadAllPrograms();
#ifndef AX_CORE_PROFILE
/**
* Remove a program object from cache.
* @param program Specifies the program object to move.
*/
AX_DEPRECATED_ATTRIBUTE void removeProgram(Program* prog) { unloadProgram(prog); }
AX_DEPRECATED(2.1) void removeProgram(Program* prog) { unloadProgram(prog); }
/**
* Remove all unused program objects from cache.
*/
AX_DEPRECATED_ATTRIBUTE void removeUnusedProgram() { unloadUnusedPrograms(); }
AX_DEPRECATED(2.1) void removeUnusedProgram() { unloadUnusedPrograms(); }
/**
* Remove all program objects from cache.
*/
AX_DEPRECATED_ATTRIBUTE void removeAllPrograms() { unloadAllPrograms(); }
AX_DEPRECATED(2.1) void removeAllPrograms() { unloadAllPrograms(); }
#endif
protected:
ProgramManager();
virtual ~ProgramManager();

View File

@ -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())

View File

@ -306,17 +306,17 @@ public:
* so batch ID was set to -1 indicate batch was disabled
*/
void updateBatchId();
#ifndef AX_CORE_PROFILE
/*
* Follow API is deprecated, use getMutableVertexLayout instead
*/
AX_DEPRECATED_ATTRIBUTE void setVertexAttrib(std::string_view name,
AX_DEPRECATED(2.1) void setVertexAttrib(std::string_view name,
std::size_t index,
VertexFormat format,
std::size_t offset,
bool needToBeNormallized);
AX_DEPRECATED_ATTRIBUTE void setVertexStride(uint32_t stride);
AX_DEPRECATED(2.1) void setVertexStride(uint32_t stride);
#endif
/** Custom shader program's vertex layout maybe not setup
* so engine specific render node(such as Sprite) should invoke this API when ProgramState changed
*/

View File

@ -81,8 +81,8 @@ public:
VertexFormat format,
std::size_t offset,
bool needNormalized);
AX_DEPRECATED_ATTRIBUTE void setAttribute(std::string_view name,
#ifndef AX_CORE_PROFILE
AX_DEPRECATED(2.1) void setAttribute(std::string_view name,
std::size_t index,
VertexFormat format,
std::size_t offset,
@ -90,7 +90,7 @@ public:
{
setAttrib(name, index, format, offset, needNormalized);
}
#endif
/**
* Set stride of vertices.
* @param stride Specifies the distance between the data of two vertices, in bytes.

View File

@ -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
}

View File

@ -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);

View File

@ -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);

View File

@ -102,11 +102,6 @@ void ActionTimelineCache::destroyInstance()
AX_SAFE_DELETE(_sharedActionCache);
}
void ActionTimelineCache::purge()
{
_animationActions.clear();
}
void ActionTimelineCache::init()
{
using namespace std::placeholders;

View File

@ -66,8 +66,6 @@ public:
/** Destroys the singleton */
static void destroyInstance();
void purge();
void init();
/** Remove action with filename, and also remove other resource relate with this file */

View File

@ -248,8 +248,6 @@ CSLoader::CSLoader()
CREATE_CLASS_NODE_READER_INFO(TextFieldExReader);
}
void CSLoader::purge() {}
void CSLoader::init()
{
using namespace std::placeholders;

View File

@ -75,8 +75,6 @@ public:
static void destroyInstance();
CSLoader();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE void purge();
void init();

View File

@ -316,10 +316,6 @@ public:
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
virtual Frame* clone() override;
/** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */
AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; }
AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; }
inline void setColor(const ax::Color3B& color) { _color = color; }
inline ax::Color3B getColor() const { return _color; }

View File

@ -39,36 +39,6 @@ struct cpBody;
namespace cocostudio
{
AX_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase;
AX_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData;
AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData;
AX_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData;
AX_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData;
AX_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData;
AX_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData;
AX_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData;
AX_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData;
AX_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData;
AX_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData;
AX_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData;
AX_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData;
AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay;
AX_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData;
AX_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory;
AX_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode;
AX_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay;
AX_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager;
AX_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody;
AX_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector;
AX_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper;
AX_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData;
AX_DEPRECATED_ATTRIBUTE typedef Bone CCBone;
AX_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation;
AX_DEPRECATED_ATTRIBUTE typedef Armature CCArmature;
AX_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager;
AX_DEPRECATED_ATTRIBUTE typedef ax::tweenfunc::TweenType CCTweenType;
class CCS_DLL Armature : public ax::Node, public ax::BlendProtocol
{
@ -195,7 +165,7 @@ public:
#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT
virtual void setColliderFilter(ColliderFilter* filter);
#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX
AX_DEPRECATED_ATTRIBUTE virtual void drawContour();
AX_DEPRECATED(2.1) virtual void drawContour();
#endif
virtual void setArmatureData(ArmatureData* armatureData) { _armatureData = armatureData; }

View File

@ -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<std::string>& 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<void(Armature* armature, MovementEventType movementType, std::string_view movementID)> listener)
{

View File

@ -90,14 +90,6 @@ public:
*/
virtual bool init(Armature* armature);
/**
* Scale animation play speed.
* This method is deprecated, please use setSpeedScale.
* @param animationScale Scale value
*/
AX_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale);
AX_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const;
/**
* Scale animation play speed.
* @param animationScale Scale value
@ -105,9 +97,6 @@ public:
virtual void setSpeedScale(float speedScale);
virtual float getSpeedScale() const;
//! The animation update speed
AX_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {}
using ProcessBase::play;
/**
* Play animation by animation name.
@ -130,7 +119,6 @@ public:
* @deprecated, please use playWithIndex
* @param animationIndex the animation index you want to play
*/
AX_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1);
virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1);
virtual void playWithNames(const std::vector<std::string>& movementNames, int durationTo = -1, bool loop = true);
@ -179,18 +167,6 @@ public:
*/
std::string getCurrentMovementID() const;
/**
* Set armature's movement event callback function
* To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr);
*/
AX_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(ax::Object* target, SEL_MovementEventCallFunc callFunc);
/**
* Set armature's frame event callback function
* To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr);
*/
AX_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(ax::Object* target, SEL_FrameEventCallFunc callFunc);
void setMovementEventCallFunc(
std::function<void(Armature* armature, MovementEventType movementType, std::string_view movementID)> listener);
void setFrameEventCallFunc(

View File

@ -50,8 +50,8 @@ ArmatureDataManager* ArmatureDataManager::getInstance()
void ArmatureDataManager::destroyInstance()
{
SpriteFrameCacheHelper::purge();
DataReaderHelper::purge();
SpriteFrameCacheHelper::destroyInstance();
DataReaderHelper::destroyInstance();
AX_SAFE_RELEASE_NULL(s_sharedArmatureDataManager);
}

View File

@ -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();

View File

@ -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);

View File

@ -94,9 +94,6 @@ public:
void removeDisplay(int index);
AX_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force);
AX_DEPRECATED_ATTRIBUTE void changeDisplayByName(std::string_view name, bool force);
void changeDisplayWithIndex(int index, bool force);
void changeDisplayWithName(std::string_view name, bool force);
@ -190,12 +187,6 @@ public:
virtual void setIgnoreMovementBoneData(bool ignore) { _ignoreMovementBoneData = ignore; }
virtual bool isIgnoreMovementBoneData() const { return _ignoreMovementBoneData; }
/*
* This function is deprecated, please use isIgnoreMovementBoneData()
* @lua NA
*/
AX_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); }
/*
* Set blend function
*/

View File

@ -237,7 +237,7 @@ float DataReaderHelper::getPositionReadScale()
return s_PositionReadScale;
}
void DataReaderHelper::purge()
void DataReaderHelper::destroyInstance()
{
_configFileList.clear();
AX_SAFE_RELEASE_NULL(_dataReaderHelper);

View File

@ -86,13 +86,9 @@ protected:
} DataInfo;
public:
/** @deprecated Use getInstance() instead */
AX_DEPRECATED_ATTRIBUTE static DataReaderHelper* sharedDataReaderHelper()
{
return DataReaderHelper::getInstance();
}
static DataReaderHelper* getInstance();
static void destroyInstance();
/**
* Scale the position data, used for multiresolution adapter
@ -101,8 +97,6 @@ public:
static void setPositionReadScale(float scale);
static float getPositionReadScale();
static void purge();
public:
/**
* @js ctor

View File

@ -76,12 +76,6 @@ public:
const ax::Vector<DecorativeDisplay*>& 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.

View File

@ -122,11 +122,6 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance()
return _instanceFlatBuffersSerialize;
}
void FlatBuffersSerialize::purge()
{
AX_SAFE_DELETE(_instanceFlatBuffersSerialize);
}
void FlatBuffersSerialize::destroyInstance()
{
AX_SAFE_DELETE(_instanceFlatBuffersSerialize);

View File

@ -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();

View File

@ -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*/) {}

View File

@ -65,44 +65,6 @@ public:
virtual ax::Touch::DispatchMode getTouchMode() const;
virtual void setTouchPriority(int priority);
virtual int getTouchPriority() const;
/** @deprecated Please override onAcceleration */
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void didAccelerate(ax::Acceleration* accelerationValue) final;
// Deprecated touch callbacks.
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(ax::Touch* touch, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(ax::Touch* touch, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(ax::Touch* touch, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(ax::Touch* touch, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(ax::__Set* touches, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(ax::__Set* touches, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(ax::__Set* touches, ax::Event* event) final;
/**
* @js NA
*/
AX_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(ax::__Set* touches, ax::Event* event) final;
/**
* @js NA
*/

View File

@ -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();

View File

@ -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)

View File

@ -29,8 +29,6 @@ public:
SpineSkeletonDataCache();
void setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...));
SkeletonData* addData(const char* dataFile, const char* atlasFile, float scale);
void removeData(const char* dataFile);
@ -40,7 +38,6 @@ public:
public:
hlookup::string_map<SkeletonData*> _cacheTable;
void (*_reportError)(const char* pszFormat, ...);
};
#else
@ -64,8 +61,6 @@ public:
SpineSkeletonDataCache();
void setErrorReportFunc(void (*errorfunc)(const char* pszFormat, ...));
static SpineSkeletonDataCache* getInstance();
SkeletonData* addData(const char* dataFile, const char* atlasFile, float scale);
@ -77,7 +72,6 @@ public:
public:
hlookup::string_map<SkeletonData*> _cacheTable;
void (*_reportError)(const char* pszFormat, ...);
};
#endif

View File

@ -44,7 +44,7 @@ SpriteFrameCacheHelper* SpriteFrameCacheHelper::getInstance()
return _spriteFrameCacheHelper;
}
void SpriteFrameCacheHelper::purge()
void SpriteFrameCacheHelper::destroyInstance()
{
delete _spriteFrameCacheHelper;
_spriteFrameCacheHelper = nullptr;

View File

@ -46,15 +46,10 @@ namespace cocostudio
class CCS_DLL SpriteFrameCacheHelper
{
public:
/** @deprecated Use getInstance() instead */
AX_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper* sharedSpriteFrameCacheHelper()
{
return SpriteFrameCacheHelper::getInstance();
}
static SpriteFrameCacheHelper* getInstance();
static void purge();
static void destroyInstance();
public:
/**

View File

@ -46,8 +46,6 @@ public:
~ArmatureNodeReader();
static ArmatureNodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(

View File

@ -54,11 +54,6 @@ ButtonReader* ButtonReader::getInstance()
return instanceButtonReader;
}
void ButtonReader::purge()
{
AX_SAFE_DELETE(instanceButtonReader);
}
void ButtonReader::destroyInstance()
{
AX_SAFE_DELETE(instanceButtonReader);

View File

@ -39,8 +39,6 @@ public:
virtual ~ButtonReader();
static ButtonReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -39,8 +39,6 @@ public:
virtual ~CheckBoxReader();
static CheckBoxReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -51,11 +51,6 @@ ComAudioReader* ComAudioReader::getInstance()
return _instanceComAudioReader;
}
void ComAudioReader::purge()
{
AX_SAFE_DELETE(_instanceComAudioReader);
}
void ComAudioReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceComAudioReader);

View File

@ -41,8 +41,6 @@ public:
~ComAudioReader();
static ComAudioReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -40,8 +40,6 @@ public:
~GameMapReader();
static GameMapReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -63,11 +63,6 @@ CameraBackgroundBrush* GameNode3DReader::getSceneBrushInstance()
return _sceneBrushInstance;
}
void GameNode3DReader::purge()
{
AX_SAFE_DELETE(_instanceNode3DReader);
}
void GameNode3DReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceNode3DReader);

View File

@ -42,8 +42,6 @@ public:
static GameNode3DReader* getInstance();
static ax::CameraBackgroundBrush* getSceneBrushInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~ImageViewReader();
static ImageViewReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -40,8 +40,6 @@ public:
virtual ~LayoutReader();
static LayoutReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -56,11 +56,6 @@ Light3DReader* Light3DReader::getInstance()
return _instanceLight3DReader;
}
void Light3DReader::purge()
{
AX_SAFE_DELETE(_instanceLight3DReader);
}
void Light3DReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceLight3DReader);

View File

@ -40,8 +40,6 @@ public:
~Light3DReader();
static Light3DReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~ListViewReader();
static ListViewReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -39,8 +39,6 @@ public:
virtual ~LoadingBarReader();
static LoadingBarReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -61,11 +61,6 @@ MeshReader* MeshReader::getInstance()
return _instanceMeshReader;
}
void MeshReader::purge()
{
AX_SAFE_DELETE(_instanceMeshReader);
}
void MeshReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceMeshReader);

View File

@ -41,8 +41,6 @@ public:
~MeshReader();
static MeshReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -55,11 +55,6 @@ Node3DReader* Node3DReader::getInstance()
return _instanceNode3DReader;
}
void Node3DReader::purge()
{
AX_SAFE_DELETE(_instanceNode3DReader);
}
void Node3DReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceNode3DReader);

View File

@ -41,8 +41,6 @@ public:
~Node3DReader();
static Node3DReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -40,8 +40,6 @@ public:
~NodeReader();
static NodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~PageViewReader();
static PageViewReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -57,11 +57,6 @@ Particle3DReader* Particle3DReader::getInstance()
return _instanceParticle3DReader;
}
void Particle3DReader::purge()
{
AX_SAFE_DELETE(_instanceParticle3DReader);
}
void Particle3DReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceParticle3DReader);

View File

@ -40,8 +40,6 @@ public:
~Particle3DReader();
static Particle3DReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -56,11 +56,6 @@ ParticleReader* ParticleReader::getInstance()
return _instanceParticleReader;
}
void ParticleReader::purge()
{
AX_SAFE_DELETE(_instanceParticleReader);
}
void ParticleReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceParticleReader);

View File

@ -40,8 +40,6 @@ public:
~ParticleReader();
static ParticleReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -50,11 +50,6 @@ ProjectNodeReader* ProjectNodeReader::getInstance()
return _instanceProjectNodeReader;
}
void ProjectNodeReader::purge()
{
AX_SAFE_DELETE(_instanceProjectNodeReader);
}
void ProjectNodeReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceProjectNodeReader);

View File

@ -39,8 +39,6 @@ public:
~ProjectNodeReader();
static ProjectNodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~RadioButtonGroupReader();
static RadioButtonGroupReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~RadioButtonReader();
static RadioButtonReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~RichTextReader();
static RichTextReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~ScrollViewReader();
static ScrollViewReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -53,11 +53,6 @@ SingleNodeReader* SingleNodeReader::getInstance()
return _instanceSingleNodeReader;
}
void SingleNodeReader::purge()
{
AX_SAFE_DELETE(_instanceSingleNodeReader);
}
void SingleNodeReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceSingleNodeReader);

View File

@ -40,8 +40,6 @@ public:
~SingleNodeReader();
static SingleNodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -37,8 +37,6 @@ public:
~BoneNodeReader();
static BoneNodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(

View File

@ -36,8 +36,6 @@ public:
~SkeletonNodeReader();
static SkeletonNodeReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
ax::Node* createNodeWithFlatBuffers(const flatbuffers::Table* boneOptions) override;

View File

@ -39,8 +39,6 @@ public:
virtual ~SliderReader();
static SliderReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -60,11 +60,6 @@ SpineSkeletonReader* SpineSkeletonReader::getInstance()
return _instanceSpriteReader;
}
void SpineSkeletonReader::purge()
{
AX_SAFE_DELETE(_instanceSpriteReader);
}
void SpineSkeletonReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceSpriteReader);

View File

@ -42,8 +42,6 @@ public:
~SpineSkeletonReader();
static SpineSkeletonReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -63,11 +63,6 @@ SpriteReader* SpriteReader::getInstance()
return _instanceSpriteReader;
}
void SpriteReader::purge()
{
AX_SAFE_DELETE(_instanceSpriteReader);
}
void SpriteReader::destroyInstance()
{
AX_SAFE_DELETE(_instanceSpriteReader);

View File

@ -40,8 +40,6 @@ public:
~SpriteReader();
static SpriteReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(pugi::xml_node objectData,

View File

@ -39,8 +39,6 @@ public:
virtual ~TextAtlasReader();
static TextAtlasReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

View File

@ -39,8 +39,6 @@ public:
virtual ~TextBMFontReader();
static TextBMFontReader* getInstance();
/** @deprecated Use method destroyInstance() instead */
AX_DEPRECATED_ATTRIBUTE static void purge();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(ax::ui::Widget* widget, const rapidjson::Value& options);

Some files were not shown because too many files have changed in this diff Show More