Merge pull request #110837 from wheatear-dev/add-gdsoftclass-deeper

Add `GDSOFTCLASS` to deeper inheritors of `Object`
This commit is contained in:
Thaddeus Crews
2025-09-25 12:13:56 -05:00
51 changed files with 154 additions and 18 deletions

View File

@@ -91,6 +91,8 @@ Error _betsy_compress_bptc(Image *r_img, Image::UsedChannels p_channels);
Error _betsy_compress_s3tc(Image *r_img, Image::UsedChannels p_channels);
class BetsyCompressor : public Object {
GDSOFTCLASS(BetsyCompressor, Object);
mutable CommandQueueMT command_queue;
bool exit = false;
WorkerThreadPool::TaskID task_id = WorkerThreadPool::INVALID_TASK_ID;

View File

@@ -33,6 +33,8 @@
#include "core/io/resource_loader.h"
class ResourceFormatDDS : public ResourceFormatLoader {
GDSOFTCLASS(ResourceFormatDDS, ResourceFormatLoader);
public:
virtual Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
virtual void get_recognized_extensions(List<String> *p_extensions) const override;

View File

@@ -677,6 +677,8 @@ public:
};
class ResourceFormatLoaderGDScript : public ResourceFormatLoader {
GDSOFTCLASS(ResourceFormatLoaderGDScript, ResourceFormatLoader);
public:
virtual Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
virtual void get_recognized_extensions(List<String> *p_extensions) const override;
@@ -687,6 +689,8 @@ public:
};
class ResourceFormatSaverGDScript : public ResourceFormatSaver {
GDSOFTCLASS(ResourceFormatSaverGDScript, ResourceFormatSaver);
public:
virtual Error save(const Ref<Resource> &p_resource, const String &p_path, uint32_t p_flags = 0) override;
virtual void get_recognized_extensions(const Ref<Resource> &p_resource, List<String> *p_extensions) const override;

View File

@@ -34,6 +34,8 @@
#include "scene/resources/texture.h"
class ResourceFormatKTX : public ResourceFormatLoader {
GDSOFTCLASS(ResourceFormatKTX, ResourceFormatLoader);
public:
virtual Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
virtual void get_recognized_extensions(List<String> *p_extensions) const override;

View File

@@ -43,6 +43,8 @@
class TLSContextMbedTLS;
class CookieContextMbedTLS : public RefCounted {
GDSOFTCLASS(CookieContextMbedTLS, RefCounted);
friend class TLSContextMbedTLS;
protected:
@@ -60,6 +62,8 @@ public:
};
class TLSContextMbedTLS : public RefCounted {
GDSOFTCLASS(TLSContextMbedTLS, RefCounted);
protected:
bool inited = false;

View File

@@ -589,6 +589,8 @@ public:
};
class ResourceFormatLoaderCSharpScript : public ResourceFormatLoader {
GDSOFTCLASS(ResourceFormatLoaderCSharpScript, ResourceFormatLoader);
public:
Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
void get_recognized_extensions(List<String> *p_extensions) const override;
@@ -597,6 +599,8 @@ public:
};
class ResourceFormatSaverCSharpScript : public ResourceFormatSaver {
GDSOFTCLASS(ResourceFormatSaverCSharpScript, ResourceFormatSaver);
public:
Error save(const Ref<Resource> &p_resource, const String &p_path, uint32_t p_flags = 0) override;
void get_recognized_extensions(const Ref<Resource> &p_resource, List<String> *p_extensions) const override;

View File

@@ -77,6 +77,8 @@ public:
private:
class BandwidthProfiler : public EngineProfiler {
GDSOFTCLASS(BandwidthProfiler, EngineProfiler);
protected:
struct BandwidthFrame {
uint32_t timestamp;
@@ -92,12 +94,14 @@ private:
int bandwidth_usage(const Vector<BandwidthFrame> &p_buffer, int p_pointer);
public:
void toggle(bool p_enable, const Array &p_opts);
void add(const Array &p_data);
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time);
void toggle(bool p_enable, const Array &p_opts) override;
void add(const Array &p_data) override;
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time) override;
};
class RPCProfiler : public EngineProfiler {
GDSOFTCLASS(RPCProfiler, EngineProfiler);
private:
HashMap<ObjectID, RPCNodeInfo> rpc_node_data;
uint64_t last_profile_time = 0;
@@ -105,20 +109,22 @@ private:
void init_node(const ObjectID p_node);
public:
void toggle(bool p_enable, const Array &p_opts);
void add(const Array &p_data);
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time);
void toggle(bool p_enable, const Array &p_opts) override;
void add(const Array &p_data) override;
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time) override;
};
class ReplicationProfiler : public EngineProfiler {
GDSOFTCLASS(ReplicationProfiler, EngineProfiler);
private:
HashMap<ObjectID, SyncInfo> sync_data;
uint64_t last_profile_time = 0;
public:
void toggle(bool p_enable, const Array &p_opts);
void add(const Array &p_data);
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time);
void toggle(bool p_enable, const Array &p_opts) override;
void add(const Array &p_data) override;
void tick(double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time) override;
};
static Error _capture(void *p_user, const String &p_msg, const Array &p_args, bool &r_captured);

View File

@@ -42,6 +42,8 @@ class NavigationPolygon;
class NavigationMeshSourceGeometryData2D;
class NavMeshGenerator2D : public Object {
GDSOFTCLASS(NavMeshGenerator2D, Object);
static NavMeshGenerator2D *singleton;
static Mutex baking_navmesh_mutex;

View File

@@ -40,6 +40,8 @@ class NavigationMesh;
class NavigationMeshSourceGeometryData3D;
class NavMeshGenerator3D : public Object {
GDSOFTCLASS(NavMeshGenerator3D, Object);
static NavMeshGenerator3D *singleton;
static Mutex baking_navmesh_mutex;

View File

@@ -173,6 +173,8 @@ public:
};
class ResourceFormatLoaderTheora : public ResourceFormatLoader {
GDSOFTCLASS(ResourceFormatLoaderTheora, ResourceFormatLoader);
public:
virtual Ref<Resource> load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE) override;
virtual void get_recognized_extensions(List<String> *p_extensions) const override;

View File

@@ -34,6 +34,8 @@
#include "core/io/resource_saver.h"
class ResourceSaverWebP : public ResourceFormatSaver {
GDSOFTCLASS(ResourceSaverWebP, ResourceFormatSaver);
public:
static Error save_image(const String &p_path, const Ref<Image> &p_img, const bool p_lossy = false, const float p_quality = 0.75f);
static Vector<uint8_t> save_image_to_buffer(const Ref<Image> &p_img, const bool p_lossy = false, const float p_quality = 0.75f);

View File

@@ -35,6 +35,8 @@
#include "core/debugger/remote_debugger_peer.h"
class RemoteDebuggerPeerWebSocket : public RemoteDebuggerPeer {
GDSOFTCLASS(RemoteDebuggerPeerWebSocket, RemoteDebuggerPeer);
Ref<WebSocketPeer> ws_peer;
List<Array> in_queue;
List<Array> out_queue;