Skip to content

Commit

Permalink
Rename ax::Ref ==> ax::Object (#1877)
Browse files Browse the repository at this point in the history
* Rename ax::Ref ==> ax::Object

* Update Object.h [skip ci]
  • Loading branch information
halx99 authored May 3, 2024
1 parent b122a1b commit 004065a
Show file tree
Hide file tree
Showing 415 changed files with 1,491 additions and 1,488 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

### Break Changes

- Rename `ax::Ref` ==> `ax::Object`
- Remove `ax::log`, use `AXLOGD` instead
- Remove cmake function: `ax_uwp_set_all_targets_deploy_min_version`
- Remove deprecated pixel formats L8, A8, LA8 in https://github.com/axmolengine/axmol/pull/1839
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
#ifndef __ACTIONS_CCACTION_H__
#define __ACTIONS_CCACTION_H__

#include "base/Ref.h"
#include "base/Object.h"
#include "math/Math.h"
#include "base/ScriptSupport.h"

Expand All @@ -50,7 +50,7 @@ enum
/**
* @brief Base class for Action objects.
*/
class AX_DLL Action : public Ref, public Clonable
class AX_DLL Action : public Object, public Clonable
{
public:
/** Default tag used for all the actions. */
Expand Down
2 changes: 1 addition & 1 deletion core/2d/ActionCatmullRom.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Node;
* @ingroup Actions
* @js NA
*/
class AX_DLL PointArray : public Ref, public Clonable
class AX_DLL PointArray : public Object, public Clonable
{
public:
/** Creates and initializes a Points array with capacity.
Expand Down
2 changes: 1 addition & 1 deletion core/2d/ActionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void ActionManager::removeAction(Action* action)
return;
}

Ref* target = action->getOriginalTarget();
Object* target = action->getOriginalTarget();
auto actionIt = _targets.find(static_cast<Node*>(target));
if (actionIt != _targets.end())
{
Expand Down
4 changes: 2 additions & 2 deletions core/2d/ActionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.

#include "2d/Action.h"
#include "base/Vector.h"
#include "base/Ref.h"
#include "base/Object.h"

NS_AX_BEGIN

Expand Down Expand Up @@ -61,7 +61,7 @@ struct ActionHandle
@since v0.8
*/
class AX_DLL ActionManager : public Ref
class AX_DLL ActionManager : public Object
{
public:
/**
Expand Down
6 changes: 3 additions & 3 deletions core/2d/Animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
#define __AX_ANIMATION_H__

#include "platform/PlatformConfig.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "base/Value.h"
#include "base/Vector.h"
#include "2d/SpriteFrame.h"
Expand All @@ -55,7 +55,7 @@ class SpriteFrame;
@since v2.0
*/
class AX_DLL AnimationFrame : public Ref, public Clonable
class AX_DLL AnimationFrame : public Object, public Clonable
{
public:
/** @struct DisplayedEventInfo
Expand Down Expand Up @@ -157,7 +157,7 @@ class AX_DLL AnimationFrame : public Ref, public Clonable
* sprite->runAction(Animate::create(animation));
* @endcode
*/
class AX_DLL Animation : public Ref, public Clonable
class AX_DLL Animation : public Object, public Clonable
{
public:
/** Creates an animation.
Expand Down
2 changes: 1 addition & 1 deletion core/2d/AnimationCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
#ifndef __AX_ANIMATION_CACHE_H__
#define __AX_ANIMATION_CACHE_H__

#include "base/Ref.h"
#include "base/Object.h"
#include "base/Map.h"
#include "base/Value.h"
#include "2d/Animation.h"
Expand Down
4 changes: 2 additions & 2 deletions core/2d/CameraBackgroundBrush.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#pragma once

#include "base/Types.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "base/EventListenerCustom.h"
#include "3d/Frustum.h"
#include "renderer/QuadCommand.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ class Buffer;
* background with given color and depth, Skybox brush clear the background with a skybox. Camera uses depth brush by
* default.
*/
class AX_DLL CameraBackgroundBrush : public Ref
class AX_DLL CameraBackgroundBrush : public Object
{
public:
/**
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Component.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.

/// @cond DO_NOT_SHOW
#include <string>
#include "base/Ref.h"
#include "base/Object.h"
#include "base/ScriptSupport.h"

NS_AX_BEGIN
Expand All @@ -44,7 +44,7 @@ enum
kComponentOnUpdate
};

class AX_DLL Component : public Ref
class AX_DLL Component : public Object
{
public:
static Component* create();
Expand Down
4 changes: 2 additions & 2 deletions core/2d/FastTMXLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class AX_DLL FastTMXLayer : public Node
/** @brief TMXTileAnimTask represents the frame-tick task of an animated tile.
* It is a assistant class for TMXTileAnimTicker.
*/
class AX_DLL TMXTileAnimTask : public Ref
class AX_DLL TMXTileAnimTask : public Object
{
public:
TMXTileAnimTask(FastTMXLayer* layer, TMXTileAnimInfo* animation, const Vec2& tilePos, uint32_t flag = 0);
Expand Down Expand Up @@ -429,7 +429,7 @@ class AX_DLL TMXTileAnimTask : public Ref

/** @brief TMXTileAnimManager controls all tile animation of a layer.
*/
class AX_DLL TMXTileAnimManager : public Ref
class AX_DLL TMXTileAnimManager : public Object
{
public:
static TMXTileAnimManager* create(FastTMXLayer* layer);
Expand Down
2 changes: 1 addition & 1 deletion core/2d/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NS_AX_BEGIN

class FontAtlas;

class AX_DLL Font : public Ref
class AX_DLL Font : public Object
{
public:
virtual FontAtlas* newFontAtlas() = 0;
Expand Down
4 changes: 2 additions & 2 deletions core/2d/FontAtlas.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <unordered_map>

#include "platform/PlatformMacros.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "platform/StdC.h" // ssize_t on windows
#include "renderer/Texture2D.h"

Expand Down Expand Up @@ -62,7 +62,7 @@ struct FontLetterDefinition
bool rotated;
};

class AX_DLL FontAtlas : public Ref
class AX_DLL FontAtlas : public Object
{
public:
static const int CacheTextureWidth;
Expand Down
2 changes: 1 addition & 1 deletion core/2d/FontFNT.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef struct _BMFontPadding
/** @brief BMFontConfiguration has parsed configuration of the .fnt file
@since v0.8
*/
class AX_DLL BMFontConfiguration : public Ref
class AX_DLL BMFontConfiguration : public Object
{
// FIXME: Creating a public interface so that the bitmapFontArray[] is accessible
public: //@public
Expand Down
4 changes: 2 additions & 2 deletions core/2d/Grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
****************************************************************************/
#pragma once

#include "base/Ref.h"
#include "base/Object.h"
#include "base/Types.h"
#include "base/Director.h"
#include "renderer/GroupCommand.h"
Expand All @@ -53,7 +53,7 @@ class RenderTarget;

/** Base class for Other grid.
*/
class AX_DLL GridBase : public Ref
class AX_DLL GridBase : public Object
{
public:
/**
Expand Down
2 changes: 1 addition & 1 deletion core/2d/MenuItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ THE SOFTWARE.

NS_AX_BEGIN

typedef std::function<void(Ref*)> ccMenuCallback;
typedef std::function<void(Object*)> ccMenuCallback;

class Label;
class LabelAtlas;
Expand Down
2 changes: 1 addition & 1 deletion core/2d/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ void Node::setUserData(void* userData)
_userData = userData;
}

void Node::setUserObject(Ref* userObject)
void Node::setUserObject(Object* userObject)
{
#if AX_ENABLE_GC_FOR_NATIVE_OBJECTS
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
Expand Down
10 changes: 5 additions & 5 deletions core/2d/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Node and override `draw`.
*/

class AX_DLL Node : public Ref
class AX_DLL Node : public Object
{
public:
/** Default tag used for all the nodes */
Expand Down Expand Up @@ -1031,11 +1031,11 @@ class AX_DLL Node : public Ref
* @return A user assigned Object.
* @lua NA
*/
virtual Ref* getUserObject() { return _userObject; }
virtual Object* getUserObject() { return _userObject; }
/**
* @lua NA
*/
virtual const Ref* getUserObject() const { return _userObject; }
virtual const Object* getUserObject() const { return _userObject; }

/**
* Returns a user assigned Object.
Expand All @@ -1047,7 +1047,7 @@ class AX_DLL Node : public Ref
*
* @param userObject A user assigned Object.
*/
virtual void setUserObject(Ref* userObject);
virtual void setUserObject(Object* userObject);

/// @} end of Tag & User Data

Expand Down Expand Up @@ -1972,7 +1972,7 @@ class AX_DLL Node : public Ref
uint64_t _hashOfName; ///< hash value of _name, used for speed in getChildByName

void* _userData; ///< A user assigned void pointer, Can be point to any cpp object
Ref* _userObject; ///< A user assigned Object
Object* _userObject; ///< A user assigned Object

Scheduler* _scheduler; ///< scheduler used to schedule timers and updates

Expand Down
2 changes: 1 addition & 1 deletion core/2d/ParallaxNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.

NS_AX_BEGIN

class PointObject : public Ref
class PointObject : public Object
{
public:
static PointObject* create(Vec2 ratio, Vec2 offset)
Expand Down
8 changes: 4 additions & 4 deletions core/2d/ParallaxNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class AX_DLL ParallaxNode : public Node
*
* @param parallaxArray An array of layers for the Parallax node.
*/
void setParallaxArray(Vector<Ref*> parallaxArray) { _parallaxArray = std::move(parallaxArray); }
void setParallaxArray(Vector<Object*> parallaxArray) { _parallaxArray = std::move(parallaxArray); }
/** Returns the array of layers of the Parallax node.
*
* @return An array of layers for the Parallax node.
*/
Vector<Ref*>& getParallaxArray() { return _parallaxArray; }
const Vector<Ref*>& getParallaxArray() const { return _parallaxArray; }
Vector<Object*>& getParallaxArray() { return _parallaxArray; }
const Vector<Object*>& getParallaxArray() const { return _parallaxArray; }

//
// Overrides
Expand All @@ -102,7 +102,7 @@ class AX_DLL ParallaxNode : public Node
Vec2 absolutePosition();

Vec2 _lastPosition;
Vector<Ref*> _parallaxArray;
Vector<Object*> _parallaxArray;

private:
AX_DISALLOW_COPY_AND_ASSIGN(ParallaxNode);
Expand Down
2 changes: 1 addition & 1 deletion core/2d/SpriteBatchNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ ssize_t SpriteBatchNode::rebuildIndexInOrder(Sprite* parent, ssize_t index)
}

// ignore self (batch node)
if (parent != static_cast<Ref*>(this))
if (parent != static_cast<Object*>(this))
{
parent->setAtlasIndex(static_cast<unsigned int>(index));
index++;
Expand Down
4 changes: 2 additions & 2 deletions core/2d/SpriteFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ THE SOFTWARE.

#include "2d/Node.h"
#include "2d/AutoPolygon.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "math/Math.h"

NS_AX_BEGIN
Expand All @@ -56,7 +56,7 @@ class Texture2D;
sprite->setSpriteFrame(frame);
@endcode
*/
class AX_DLL SpriteFrame : public Ref, public Clonable
class AX_DLL SpriteFrame : public Object, public Clonable
{
public:
/** Create a SpriteFrame with a texture filename, rect in points.
Expand Down
2 changes: 1 addition & 1 deletion core/2d/SpriteFrameCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ THE SOFTWARE.
#include <string>
#include "2d/SpriteFrame.h"
#include "2d/SpriteSheetLoader.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "base/Value.h"
#include "base/Map.h"
#include "base/Data.h"
Expand Down
2 changes: 1 addition & 1 deletion core/2d/SpriteSheetLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ THE SOFTWARE.
#include <unordered_map>
#include <string>
#include "2d/SpriteFrame.h"
#include "base/Ref.h"
#include "base/Object.h"
#include "base/Value.h"
#include "base/Map.h"
#include "base/Data.h"
Expand Down
4 changes: 2 additions & 2 deletions core/2d/TMXObjectGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ THE SOFTWARE.

#include "math/Math.h"
#include "base/Value.h"
#include "base/Ref.h"
#include "base/Object.h"

NS_AX_BEGIN

Expand All @@ -43,7 +43,7 @@ NS_AX_BEGIN
/** @brief TMXObjectGroup represents the TMX object group.
* @since v0.99.0
*/
class AX_DLL TMXObjectGroup : public Ref
class AX_DLL TMXObjectGroup : public Object
{
public:
/**
Expand Down
8 changes: 4 additions & 4 deletions core/2d/TMXXMLParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct AX_DLL TMXTileAnimFlag
This information is obtained from the TMX file.
*/
struct AX_DLL TMXTileAnimInfo : public Ref
struct AX_DLL TMXTileAnimInfo : public Object
{
static TMXTileAnimInfo* create(uint32_t tileID);
explicit TMXTileAnimInfo(uint32_t tileID);
Expand All @@ -178,7 +178,7 @@ struct AX_DLL TMXTileAnimInfo : public Ref
This information is obtained from the TMX file.
*/
class AX_DLL TMXLayerInfo : public Ref
class AX_DLL TMXLayerInfo : public Object
{
public:
/**
Expand Down Expand Up @@ -214,7 +214,7 @@ class AX_DLL TMXLayerInfo : public Ref
This information is obtained from the TMX file.
*/
class AX_DLL TMXTilesetInfo : public Ref
class AX_DLL TMXTilesetInfo : public Object
{
public:
std::string _name;
Expand Down Expand Up @@ -257,7 +257,7 @@ And it also contains:
This information is obtained from the TMX file.
*/
class AX_DLL TMXMapInfo : public Ref, public SAXDelegator
class AX_DLL TMXMapInfo : public Object, public SAXDelegator
{
public:
/** creates a TMX Format with a tmx file */
Expand Down
Loading

0 comments on commit 004065a

Please sign in to comment.