Skip to content

Commit

Permalink
Remove deprecated stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Oct 4, 2024
1 parent 8a9ad35 commit b28015d
Show file tree
Hide file tree
Showing 26 changed files with 20 additions and 616 deletions.
4 changes: 1 addition & 3 deletions core/2d/FastTMXTiledMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ class AX_DLL FastTMXTiledMap : public Node
* animations are not enabled by default
*/
void setTileAnimEnabled(bool enabled);
#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; }
Expand Down
13 changes: 1 addition & 12 deletions core/2d/FontAtlasCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,7 @@ 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;
Expand Down Expand Up @@ -260,12 +255,6 @@ 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)
{
Expand Down
9 changes: 2 additions & 7 deletions core/2d/FontAtlasCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ 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);
#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,
Expand All @@ -74,10 +72,7 @@ class AX_DLL FontAtlasCache
otherwise, it will cause program crash!
*/
static void reloadFontAtlasFNT(std::string_view fontFileName, const Rect& imageRect, bool imageRotated);
#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!
Expand Down
7 changes: 1 addition & 6 deletions core/2d/FontFNT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,7 @@ 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)
{
Expand Down
4 changes: 1 addition & 3 deletions core/2d/FontFNT.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ 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);
#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.
*/
Expand Down
18 changes: 1 addition & 17 deletions core/2d/Label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,17 +360,6 @@ 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,
int maxLineWidth,
const Vec2& imageOffset)
{
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();
Expand Down Expand Up @@ -928,12 +917,7 @@ 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))
Expand Down
31 changes: 2 additions & 29 deletions core/2d/Label.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,25 +261,6 @@ class AX_DLL Label : public Node, public LabelProtocol, public BlendProtocol
int maxLineWidth,
std::string_view subTextureKey);

/**
* Allocates and initializes a Label, with a bitmap font file.
*
* @param bmfontPath A bitmap font file, it's a FNT format.
* @param text The initial text.
* @param hAlignment Text horizontal alignment.
* @param maxLineWidth The max line width.
* @param imageOffset Offset into larger texture
*
* @return An automatically released Label object.
* @see setBMFontFilePath setMaxLineWidth
*/
#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.
*
Expand Down Expand Up @@ -342,12 +323,7 @@ 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(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; }

Expand Down Expand Up @@ -795,10 +771,7 @@ 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(2.1) virtual void updateBMFontScale() { updateFontScale(); }
#endif

void scaleFontSize(float fontSize);
bool setTTFConfigInternal(const TTFConfig& ttfConfig);
bool updateTTFConfigInternal();
Expand Down
3 changes: 0 additions & 3 deletions core/axmol.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ THE SOFTWARE.
#include "base/Config.h"

// base
#ifndef AX_CORE_PROFILE
# include "base/AsyncTaskPool.h"
#endif
#include "base/AutoreleasePool.h"
#include "base/Configuration.h"
#include "base/Logging.h"
Expand Down
7 changes: 1 addition & 6 deletions core/base/Director.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ THE SOFTWARE.
#include "base/Logging.h"
#include "base/AutoreleasePool.h"
#include "base/Configuration.h"
#ifndef AX_CORE_PROFILE
# include "base/AsyncTaskPool.h"
#endif
#include "base/ObjectFactory.h"
#include "platform/Application.h"
#if defined(AX_ENABLE_AUDIO)
Expand Down Expand Up @@ -1059,9 +1056,7 @@ void Director::reset()
AnimationCache::destroyInstance();
SpriteFrameCache::destroyInstance();
FileUtils::destroyInstance();
#ifndef AX_CORE_PROFILE
AsyncTaskPool::destroyInstance();
#endif

backend::ProgramStateRegistry::destroyInstance();
backend::ProgramManager::destroyInstance();

Expand Down
14 changes: 0 additions & 14 deletions core/base/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,4 @@ 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;

va_start(args, format);
auto message = StringUtils::vformat(format, args);
va_end(args);

if (!message.empty())
outputLog(LogItem::vformat(FMT_COMPILE("{}{}\n"), preprocessLog(LogItem{LogLevel::Silent}), message),
"axmol debug info");
}
#endif
}
7 changes: 0 additions & 7 deletions core/base/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,4 @@ inline void printLogT(_FmtType&& fmt, LogItem& item, _Types&&... args)
#define AXLOGE(fmtOrMsg, ...) AXLOG_WITH_LEVEL(ax::LogLevel::Error, fmtOrMsg, ##__VA_ARGS__)

#define AXLOGT AXLOGV

#ifndef AX_CORE_PROFILE
/**
@brief Output Debug message.
*/
/* AX_DEPRECATED(2.1)*/ AX_API void print(const char* format, ...) AX_FORMAT_PRINTF(1, 2); // use AXLOGD instead
#endif
}
10 changes: 1 addition & 9 deletions core/base/Scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,7 @@ class AX_DLL Scheduler : public Object
@js NA
*/
void runOnAxmolThread(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
Expand All @@ -485,9 +480,6 @@ class AX_DLL Scheduler : public Object
* @js NA
*/
void 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.
Expand Down
6 changes: 0 additions & 6 deletions core/cocos2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ namespace cocos2d = ax;
#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

Expand Down
Loading

0 comments on commit b28015d

Please sign in to comment.