Rename Reference to RefCounted
This commit is contained in:
parent
fbb5a541ef
commit
04688b92ff
270 changed files with 926 additions and 926 deletions
|
|
@ -36,7 +36,7 @@
|
|||
#include "core/math/transform_3d.h"
|
||||
#include "core/math/vector2.h"
|
||||
#include "core/math/vector3.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/templates/list.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/oa_hash_map.h"
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
struct PivotTransform;
|
||||
|
||||
struct FBXBone : public Reference {
|
||||
struct FBXBone : public RefCounted {
|
||||
uint64_t parent_bone_id = 0;
|
||||
uint64_t bone_id = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@
|
|||
|
||||
#include "tools/import_utils.h"
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
||||
struct FBXMaterial : public Reference {
|
||||
struct FBXMaterial : public RefCounted {
|
||||
String material_name = String();
|
||||
bool warning_non_pbr_material = false;
|
||||
FBXDocParser::Material *material = nullptr;
|
||||
|
|
@ -266,7 +266,7 @@ struct FBXMaterial : public Reference {
|
|||
|
||||
/* storing the texture properties like color */
|
||||
template <class T>
|
||||
struct TexturePropertyMapping : Reference {
|
||||
struct TexturePropertyMapping : RefCounted {
|
||||
StandardMaterial3D::TextureParam map_mode = StandardMaterial3D::TextureParam::TEXTURE_ALBEDO;
|
||||
const T property = T();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ struct VertexData {
|
|||
};
|
||||
|
||||
// Caches mesh information and instantiates meshes for you using helper functions.
|
||||
struct FBXMeshData : Reference {
|
||||
struct FBXMeshData : RefCounted {
|
||||
struct MorphVertexData {
|
||||
// TODO we have only these??
|
||||
/// Each element is a vertex. Not supposed to be void.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
class Node3D;
|
||||
struct PivotTransform;
|
||||
|
||||
struct FBXNode : Reference, ModelAbstraction {
|
||||
struct FBXNode : RefCounted, ModelAbstraction {
|
||||
uint64_t current_node_id = 0;
|
||||
String node_name = String();
|
||||
Node3D *godot_node = nullptr;
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@
|
|||
#include "fbx_node.h"
|
||||
#include "model_abstraction.h"
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "scene/3d/skeleton_3d.h"
|
||||
|
||||
struct FBXNode;
|
||||
struct ImportState;
|
||||
struct FBXBone;
|
||||
|
||||
struct FBXSkeleton : Reference {
|
||||
struct FBXSkeleton : RefCounted {
|
||||
Ref<FBXNode> fbx_node = Ref<FBXNode>();
|
||||
Vector<Ref<FBXBone>> skeleton_bones = Vector<Ref<FBXBone>>();
|
||||
Skeleton3D *skeleton = nullptr;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#define PIVOT_TRANSFORM_H
|
||||
|
||||
#include "core/math/transform_3d.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#include "model_abstraction.h"
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ enum TransformationComp {
|
|||
TransformationComp_MAXIMUM
|
||||
};
|
||||
// Abstract away pivot data so its simpler to handle
|
||||
struct PivotTransform : Reference, ModelAbstraction {
|
||||
struct PivotTransform : RefCounted, ModelAbstraction {
|
||||
// at the end we want to keep geometric_ everything, post and pre rotation
|
||||
// these are used during animation data processing / keyframe ingestion the rest can be simplified down / out.
|
||||
Quaternion pre_rotation = Quaternion();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="GDNative" inherits="Reference" version="4.0">
|
||||
<class name="GDNative" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
|
|
|||
|
|
@ -138,8 +138,8 @@ struct GDNativeCallRegistry {
|
|||
Vector<StringName> get_native_call_types();
|
||||
};
|
||||
|
||||
class GDNative : public Reference {
|
||||
GDCLASS(GDNative, Reference);
|
||||
class GDNative : public RefCounted {
|
||||
GDCLASS(GDNative, RefCounted);
|
||||
|
||||
Ref<GDNativeLibrary> library;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "gdnative/variant.h"
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -200,17 +200,17 @@ void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p
|
|||
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj) {
|
||||
Variant *dest = (Variant *)r_dest;
|
||||
const Object *obj = (const Object *)p_obj;
|
||||
const Reference *reference = Object::cast_to<Reference>(obj);
|
||||
const RefCounted *ref_counted = Object::cast_to<RefCounted>(obj);
|
||||
REF ref;
|
||||
if (reference) {
|
||||
ref = REF(reference);
|
||||
if (ref_counted) {
|
||||
ref = REF(ref_counted);
|
||||
}
|
||||
if (!ref.is_null()) {
|
||||
memnew_placement_custom(dest, Variant, Variant(ref));
|
||||
} else {
|
||||
#if defined(DEBUG_METHODS_ENABLED)
|
||||
if (reference) {
|
||||
ERR_PRINT("Reference object has 0 refcount in godot_variant_new_object - you lost it somewhere.");
|
||||
if (ref_counted) {
|
||||
ERR_PRINT("RefCounted object has 0 refcount in godot_variant_new_object - you lost it somewhere.");
|
||||
}
|
||||
#endif
|
||||
memnew_placement_custom(dest, Variant, Variant(obj));
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ struct ClassAPI {
|
|||
String singleton_name;
|
||||
bool is_instantiable = false;
|
||||
// @Unclear
|
||||
bool is_reference = false;
|
||||
bool is_ref_counted = false;
|
||||
bool has_indexing = false; // For builtin types.
|
||||
String indexed_type; // For builtin types.
|
||||
bool is_keyed = false; // For builtin types.
|
||||
|
|
@ -254,10 +254,10 @@ List<ClassAPI> generate_c_api_classes() {
|
|||
|
||||
{
|
||||
List<StringName> inheriters;
|
||||
ClassDB::get_inheriters_from_class("Reference", &inheriters);
|
||||
bool is_reference = !!inheriters.find(class_name) || class_name == "Reference";
|
||||
ClassDB::get_inheriters_from_class("RefCounted", &inheriters);
|
||||
bool is_ref_counted = !!inheriters.find(class_name) || class_name == "RefCounted";
|
||||
// @Unclear
|
||||
class_api.is_reference = !class_api.is_singleton && is_reference;
|
||||
class_api.is_ref_counted = !class_api.is_singleton && is_ref_counted;
|
||||
}
|
||||
|
||||
// constants
|
||||
|
|
@ -509,10 +509,10 @@ List<ClassAPI> generate_c_builtin_api_types() {
|
|||
case Variant::PACKED_VECTOR2_ARRAY:
|
||||
case Variant::PACKED_VECTOR3_ARRAY:
|
||||
case Variant::PACKED_COLOR_ARRAY:
|
||||
class_api.is_reference = true;
|
||||
class_api.is_ref_counted = true;
|
||||
break;
|
||||
default:
|
||||
class_api.is_reference = false;
|
||||
class_api.is_ref_counted = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) {
|
|||
source.push_back(String("\t\t\"singleton\": ") + (api.is_singleton ? "true" : "false") + ",\n");
|
||||
source.push_back("\t\t\"singleton_name\": \"" + api.singleton_name + "\",\n");
|
||||
source.push_back(String("\t\t\"instantiable\": ") + (api.is_instantiable ? "true" : "false") + ",\n");
|
||||
source.push_back(String("\t\t\"is_reference\": ") + (api.is_reference ? "true" : "false") + ",\n");
|
||||
source.push_back(String("\t\t\"is_ref_counted\": ") + (api.is_ref_counted ? "true" : "false") + ",\n");
|
||||
|
||||
source.push_back("\t\t\"constants\": {\n");
|
||||
for (List<ConstantAPI>::Element *e = api.constants.front(); e; e = e->next()) {
|
||||
|
|
@ -794,7 +794,7 @@ static List<String> generate_c_builtin_api_json(const List<ClassAPI> &p_api) {
|
|||
|
||||
append_indented(source, vformat(R"("name": "%s",)", class_api.class_name));
|
||||
append_indented(source, vformat(R"("is_instantiable": %s,)", class_api.is_instantiable ? "true" : "false"));
|
||||
append_indented(source, vformat(R"("is_reference": %s,)", class_api.is_reference ? "true" : "false"));
|
||||
append_indented(source, vformat(R"("is_ref_counted": %s,)", class_api.is_ref_counted ? "true" : "false"));
|
||||
append_indented(source, vformat(R"("has_indexing": %s,)", class_api.has_indexing ? "true" : "false"));
|
||||
append_indented(source, vformat(R"("indexed_type": "%s",)", class_api.has_indexing && class_api.indexed_type == "Nil" ? "Variant" : class_api.indexed_type));
|
||||
append_indented(source, vformat(R"("is_keyed": %s,)", class_api.is_keyed ? "true" : "false"));
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
if (!(script_data->base_native_type == "")) {
|
||||
owner = ClassDB::instance(script_data->base_native_type);
|
||||
} else {
|
||||
owner = memnew(Reference);
|
||||
owner = memnew(RefCounted);
|
||||
}
|
||||
|
||||
if (!owner) {
|
||||
|
|
@ -513,7 +513,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
return Variant();
|
||||
}
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(owner);
|
||||
RefCounted *r = Object::cast_to<RefCounted>(owner);
|
||||
if (r) {
|
||||
ref = REF(r);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
Object *owner = nullptr;
|
||||
|
||||
if (get_instance_base_type() == "") {
|
||||
owner = memnew(Reference);
|
||||
owner = memnew(RefCounted);
|
||||
} else {
|
||||
owner = ClassDB::instance(get_instance_base_type());
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
return Variant();
|
||||
}
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(owner);
|
||||
RefCounted *r = Object::cast_to<RefCounted>(owner);
|
||||
if (r) {
|
||||
ref = REF(r);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ Variant GDScriptNativeClass::_new() {
|
|||
Object *o = instance();
|
||||
ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
|
||||
|
||||
Reference *ref = Object::cast_to<Reference>(o);
|
||||
if (ref) {
|
||||
return REF(ref);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(o);
|
||||
if (rc) {
|
||||
return REF(rc);
|
||||
} else {
|
||||
return o;
|
||||
}
|
||||
|
|
@ -98,11 +98,11 @@ void GDScript::_super_implicit_constructor(GDScript *p_script, GDScriptInstance
|
|||
p_script->implicit_initializer->call(p_instance, nullptr, 0, r_error);
|
||||
}
|
||||
|
||||
GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) {
|
||||
GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_is_ref_counted, Callable::CallError &r_error) {
|
||||
/* STEP 1, CREATE */
|
||||
|
||||
GDScriptInstance *instance = memnew(GDScriptInstance);
|
||||
instance->base_ref = p_isref;
|
||||
instance->base_ref_counted = p_is_ref_counted;
|
||||
instance->members.resize(member_indices.size());
|
||||
instance->script = Ref<GDScript>(this);
|
||||
instance->owner = p_owner;
|
||||
|
|
@ -172,11 +172,11 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallErr
|
|||
if (_baseptr->native.ptr()) {
|
||||
owner = _baseptr->native->instance();
|
||||
} else {
|
||||
owner = memnew(Reference); //by default, no base means use reference
|
||||
owner = memnew(RefCounted); //by default, no base means use reference
|
||||
}
|
||||
ERR_FAIL_COND_V_MSG(!owner, Variant(), "Can't inherit from a virtual class.");
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(owner);
|
||||
RefCounted *r = Object::cast_to<RefCounted>(owner);
|
||||
if (r) {
|
||||
ref = REF(r);
|
||||
}
|
||||
|
|
@ -353,7 +353,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) {
|
|||
}
|
||||
|
||||
Callable::CallError unchecked_error;
|
||||
return _create_instance(nullptr, 0, p_this, Object::cast_to<Reference>(p_this) != nullptr, unchecked_error);
|
||||
return _create_instance(nullptr, 0, p_this, Object::cast_to<RefCounted>(p_this) != nullptr, unchecked_error);
|
||||
}
|
||||
|
||||
PlaceHolderScriptInstance *GDScript::placeholder_instance_create(Object *p_this) {
|
||||
|
|
@ -1576,7 +1576,7 @@ void GDScriptInstance::reload_members() {
|
|||
|
||||
GDScriptInstance::GDScriptInstance() {
|
||||
owner = nullptr;
|
||||
base_ref = false;
|
||||
base_ref_counted = false;
|
||||
}
|
||||
|
||||
GDScriptInstance::~GDScriptInstance() {
|
||||
|
|
@ -2132,7 +2132,7 @@ String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_b
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
*r_base_type = "Reference";
|
||||
*r_base_type = "RefCounted";
|
||||
subclass = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@
|
|||
#include "core/object/script_language.h"
|
||||
#include "gdscript_function.h"
|
||||
|
||||
class GDScriptNativeClass : public Reference {
|
||||
GDCLASS(GDScriptNativeClass, Reference);
|
||||
class GDScriptNativeClass : public RefCounted {
|
||||
GDCLASS(GDScriptNativeClass, RefCounted);
|
||||
|
||||
StringName name;
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class GDScript : public Script {
|
|||
SelfList<GDScriptFunctionState>::List pending_func_states;
|
||||
|
||||
void _super_implicit_constructor(GDScript *p_script, GDScriptInstance *p_instance, Callable::CallError &r_error);
|
||||
GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error);
|
||||
GDScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_is_ref_counted, Callable::CallError &r_error);
|
||||
|
||||
void _set_subclass_path(Ref<GDScript> &p_sc, const String &p_path);
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ class GDScript : public Script {
|
|||
void _get_script_method_list(List<MethodInfo> *r_list, bool p_include_base) const;
|
||||
void _get_script_signal_list(List<MethodInfo> *r_list, bool p_include_base) const;
|
||||
|
||||
// This method will map the class name from "Reference" to "MyClass.InnerClass".
|
||||
// This method will map the class name from "RefCounted" to "MyClass.InnerClass".
|
||||
static String _get_gdscript_reference_class_name(const GDScript *p_gdscript);
|
||||
|
||||
protected:
|
||||
|
|
@ -270,7 +270,7 @@ class GDScriptInstance : public ScriptInstance {
|
|||
Map<StringName, int> member_indices_cache; //used only for hot script reloading
|
||||
#endif
|
||||
Vector<Variant> members;
|
||||
bool base_ref;
|
||||
bool base_ref_counted;
|
||||
|
||||
SelfList<GDScriptFunctionState>::List pending_func_states;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ Error GDScriptAnalyzer::resolve_inheritance(GDScriptParser::ClassNode *p_class,
|
|||
if (!p_class->extends_used) {
|
||||
result.type_source = GDScriptParser::DataType::ANNOTATED_INFERRED;
|
||||
result.kind = GDScriptParser::DataType::NATIVE;
|
||||
result.native_type = "Reference";
|
||||
result.native_type = "RefCounted";
|
||||
} else {
|
||||
result.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#define GDSCRIPT_ANALYZER_H
|
||||
|
||||
#include "core/object/object.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/templates/set.h"
|
||||
#include "gdscript_cache.h"
|
||||
#include "gdscript_parser.h"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef GDSCRIPT_CACHE_H
|
||||
#define GDSCRIPT_CACHE_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/os/mutex.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/set.h"
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
class GDScriptAnalyzer;
|
||||
class GDScriptParser;
|
||||
|
||||
class GDScriptParserRef : public Reference {
|
||||
class GDScriptParserRef : public RefCounted {
|
||||
public:
|
||||
enum Status {
|
||||
EMPTY,
|
||||
|
|
|
|||
|
|
@ -2512,7 +2512,7 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa
|
|||
p_script->placeholders.erase(psi); //remove placeholder
|
||||
|
||||
GDScriptInstance *instance = memnew(GDScriptInstance);
|
||||
instance->base_ref = Object::cast_to<Reference>(E->get());
|
||||
instance->base_ref_counted = Object::cast_to<RefCounted>(E->get());
|
||||
instance->members.resize(p_script->member_indices.size());
|
||||
instance->script = Ref<GDScript>(p_script);
|
||||
instance->owner = E->get();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef GDSCRIPT_FUNCTION_H
|
||||
#define GDSCRIPT_FUNCTION_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/os/thread.h"
|
||||
#include "core/string/string_name.h"
|
||||
|
|
@ -597,8 +597,8 @@ public:
|
|||
~GDScriptFunction();
|
||||
};
|
||||
|
||||
class GDScriptFunctionState : public Reference {
|
||||
GDCLASS(GDScriptFunctionState, Reference);
|
||||
class GDScriptFunctionState : public RefCounted {
|
||||
GDCLASS(GDScriptFunctionState, RefCounted);
|
||||
friend class GDScriptFunction;
|
||||
GDScriptFunction *function = nullptr;
|
||||
GDScriptFunction::CallState state;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef GDSCRIPT_LAMBDA_CALLABLE
|
||||
#define GDSCRIPT_LAMBDA_CALLABLE
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/variant/callable.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include "core/io/multiplayer_api.h"
|
||||
#include "core/io/resource.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/string/string_name.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class GDScriptLanguageProtocol : public JSONRPC {
|
|||
GDCLASS(GDScriptLanguageProtocol, JSONRPC)
|
||||
|
||||
private:
|
||||
struct LSPeer : Reference {
|
||||
struct LSPeer : RefCounted {
|
||||
Ref<StreamPeerTCP> connection;
|
||||
|
||||
uint8_t req_buf[LSP_MAX_BUFFER_SIZE];
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@
|
|||
#define GDSCRIPT_TEXT_DOCUMENT_H
|
||||
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "lsp.hpp"
|
||||
|
||||
class GDScriptTextDocument : public Reference {
|
||||
GDCLASS(GDScriptTextDocument, Reference)
|
||||
class GDScriptTextDocument : public RefCounted {
|
||||
GDCLASS(GDScriptTextDocument, RefCounted)
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@
|
|||
#include "gdscript_extend_parser.h"
|
||||
#include "lsp.hpp"
|
||||
|
||||
class GDScriptWorkspace : public Reference {
|
||||
GDCLASS(GDScriptWorkspace, Reference);
|
||||
class GDScriptWorkspace : public RefCounted {
|
||||
GDCLASS(GDScriptWorkspace, RefCounted);
|
||||
|
||||
private:
|
||||
void _get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners);
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ struct MarkupContent {
|
|||
|
||||
// Use namespace instead of enumeration to follow the LSP specifications
|
||||
// lsp::EnumName::EnumValue is OK but lsp::EnumValue is not
|
||||
// And here C++ compilers are unhappy with our enumeration name like Color, File, Reference etc.
|
||||
// And here C++ compilers are unhappy with our enumeration name like Color, File, RefCounted etc.
|
||||
/**
|
||||
* The kind of a completion entry.
|
||||
*/
|
||||
|
|
@ -788,7 +788,7 @@ static const int Keyword = 14;
|
|||
static const int Snippet = 15;
|
||||
static const int Color = 16;
|
||||
static const int File = 17;
|
||||
static const int Reference = 18;
|
||||
static const int RefCounted = 18;
|
||||
static const int Folder = 19;
|
||||
static const int EnumMember = 20;
|
||||
static const int Constant = 21;
|
||||
|
|
|
|||
|
|
@ -511,9 +511,9 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
|
|||
|
||||
// Create object instance for test.
|
||||
Object *obj = ClassDB::instance(script->get_native()->get_name());
|
||||
Ref<Reference> obj_ref;
|
||||
if (obj->is_reference()) {
|
||||
obj_ref = Ref<Reference>(Object::cast_to<Reference>(obj));
|
||||
Ref<RefCounted> obj_ref;
|
||||
if (obj->is_ref_counted()) {
|
||||
obj_ref = Ref<RefCounted>(Object::cast_to<RefCounted>(obj));
|
||||
}
|
||||
obj->set_script(script);
|
||||
GDScriptInstance *instance = static_cast<GDScriptInstance *>(obj->get_script_instance());
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ TEST_SUITE("[Modules][GDScript]") {
|
|||
TEST_CASE("[Modules][GDScript] Load source code dynamically and run it") {
|
||||
Ref<GDScript> gdscript = memnew(GDScript);
|
||||
gdscript->set_source_code(R"(
|
||||
extends Reference
|
||||
extends RefCounted
|
||||
|
||||
func _init():
|
||||
set_meta("result", 42)
|
||||
|
|
@ -64,9 +64,9 @@ func _init():
|
|||
CHECK_MESSAGE(error == OK, "The script should parse successfully.");
|
||||
|
||||
// Run the script by assigning it to a reference-counted object.
|
||||
Ref<Reference> reference = memnew(Reference);
|
||||
reference->set_script(gdscript);
|
||||
CHECK_MESSAGE(int(reference->get_meta("result")) == 42, "The script should assign object metadata successfully.");
|
||||
Ref<RefCounted> ref_counted = memnew(RefCounted);
|
||||
ref_counted->set_script(gdscript);
|
||||
CHECK_MESSAGE(int(ref_counted->get_meta("result")) == 42, "The script should assign object metadata successfully.");
|
||||
}
|
||||
|
||||
} // namespace GDScriptTests
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
#include "core/io/file_access.h"
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#include <mbedtls/config.h>
|
||||
#include <mbedtls/ctr_drbg.h>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
class SSLContextMbedTLS;
|
||||
|
||||
class CookieContextMbedTLS : public Reference {
|
||||
class CookieContextMbedTLS : public RefCounted {
|
||||
friend class SSLContextMbedTLS;
|
||||
|
||||
protected:
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
~CookieContextMbedTLS();
|
||||
};
|
||||
|
||||
class SSLContextMbedTLS : public Reference {
|
||||
class SSLContextMbedTLS : public RefCounted {
|
||||
protected:
|
||||
bool inited = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -863,13 +863,13 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
|
|||
List<Ref<CSharpScript>> to_reload;
|
||||
|
||||
// We need to keep reference instances alive during reloading
|
||||
List<Ref<Reference>> ref_instances;
|
||||
List<Ref<RefCounted>> rc_instances;
|
||||
|
||||
for (Map<Object *, CSharpScriptBinding>::Element *E = script_bindings.front(); E; E = E->next()) {
|
||||
CSharpScriptBinding &script_binding = E->value();
|
||||
Reference *ref = Object::cast_to<Reference>(script_binding.owner);
|
||||
if (ref) {
|
||||
ref_instances.push_back(Ref<Reference>(ref));
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(script_binding.owner);
|
||||
if (rc) {
|
||||
rc_instances.push_back(Ref<RefCounted>(rc));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -892,9 +892,9 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
|
|||
Object *obj = F->get();
|
||||
script->pending_reload_instances.insert(obj->get_instance_id());
|
||||
|
||||
Reference *ref = Object::cast_to<Reference>(obj);
|
||||
if (ref) {
|
||||
ref_instances.push_back(Ref<Reference>(ref));
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(obj);
|
||||
if (rc) {
|
||||
rc_instances.push_back(Ref<RefCounted>(rc));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -903,9 +903,9 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
|
|||
Object *obj = F->get()->get_owner();
|
||||
script->pending_reload_instances.insert(obj->get_instance_id());
|
||||
|
||||
Reference *ref = Object::cast_to<Reference>(obj);
|
||||
if (ref) {
|
||||
ref_instances.push_back(Ref<Reference>(ref));
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(obj);
|
||||
if (rc) {
|
||||
rc_instances.push_back(Ref<RefCounted>(rc));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1438,16 +1438,16 @@ bool CSharpLanguage::setup_csharp_script_binding(CSharpScriptBinding &r_script_b
|
|||
r_script_binding.owner = p_object;
|
||||
|
||||
// Tie managed to unmanaged
|
||||
Reference *ref = Object::cast_to<Reference>(p_object);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(p_object);
|
||||
|
||||
if (ref) {
|
||||
if (rc) {
|
||||
// Unsafe refcount increment. The managed instance also counts as a reference.
|
||||
// This way if the unmanaged world has no references to our owner
|
||||
// but the managed instance is alive, the refcount will be 1 instead of 0.
|
||||
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
|
||||
|
||||
ref->reference();
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(ref);
|
||||
rc->reference();
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(rc);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -1511,10 +1511,10 @@ void CSharpLanguage::free_instance_binding_data(void *p_data) {
|
|||
}
|
||||
|
||||
void CSharpLanguage::refcount_incremented_instance_binding(Object *p_object) {
|
||||
Reference *ref_owner = Object::cast_to<Reference>(p_object);
|
||||
RefCounted *rc_owner = Object::cast_to<RefCounted>(p_object);
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!ref_owner);
|
||||
CRASH_COND(!rc_owner);
|
||||
CRASH_COND(!p_object->has_script_instance_binding(get_language_index()));
|
||||
#endif
|
||||
|
||||
|
|
@ -1528,7 +1528,7 @@ void CSharpLanguage::refcount_incremented_instance_binding(Object *p_object) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ref_owner->reference_get_count() > 1 && gchandle.is_weak()) { // The managed side also holds a reference, hence 1 instead of 0
|
||||
if (rc_owner->reference_get_count() > 1 && gchandle.is_weak()) { // The managed side also holds a reference, hence 1 instead of 0
|
||||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
||||
// The reference count was increased after the managed side was the only one referencing our owner.
|
||||
|
|
@ -1548,10 +1548,10 @@ void CSharpLanguage::refcount_incremented_instance_binding(Object *p_object) {
|
|||
}
|
||||
|
||||
bool CSharpLanguage::refcount_decremented_instance_binding(Object *p_object) {
|
||||
Reference *ref_owner = Object::cast_to<Reference>(p_object);
|
||||
RefCounted *rc_owner = Object::cast_to<RefCounted>(p_object);
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!ref_owner);
|
||||
CRASH_COND(!rc_owner);
|
||||
CRASH_COND(!p_object->has_script_instance_binding(get_language_index()));
|
||||
#endif
|
||||
|
||||
|
|
@ -1561,7 +1561,7 @@ bool CSharpLanguage::refcount_decremented_instance_binding(Object *p_object) {
|
|||
CSharpScriptBinding &script_binding = ((Map<Object *, CSharpScriptBinding>::Element *)data)->get();
|
||||
MonoGCHandleData &gchandle = script_binding.gchandle;
|
||||
|
||||
int refcount = ref_owner->reference_get_count();
|
||||
int refcount = rc_owner->reference_get_count();
|
||||
|
||||
if (!script_binding.inited) {
|
||||
return refcount == 0;
|
||||
|
|
@ -1592,13 +1592,13 @@ bool CSharpLanguage::refcount_decremented_instance_binding(Object *p_object) {
|
|||
CSharpInstance *CSharpInstance::create_for_managed_type(Object *p_owner, CSharpScript *p_script, const MonoGCHandleData &p_gchandle) {
|
||||
CSharpInstance *instance = memnew(CSharpInstance(Ref<CSharpScript>(p_script)));
|
||||
|
||||
Reference *ref = Object::cast_to<Reference>(p_owner);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(p_owner);
|
||||
|
||||
instance->base_ref = ref != nullptr;
|
||||
instance->base_ref_counted = rc != nullptr;
|
||||
instance->owner = p_owner;
|
||||
instance->gchandle = p_gchandle;
|
||||
|
||||
if (instance->base_ref) {
|
||||
if (instance->base_ref_counted) {
|
||||
instance->_reference_owner_unsafe();
|
||||
}
|
||||
|
||||
|
|
@ -1900,7 +1900,7 @@ Variant CSharpInstance::call(const StringName &p_method, const Variant **p_args,
|
|||
|
||||
bool CSharpInstance::_reference_owner_unsafe() {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!base_ref);
|
||||
CRASH_COND(!base_ref_counted);
|
||||
CRASH_COND(owner == nullptr);
|
||||
CRASH_COND(unsafe_referenced); // already referenced
|
||||
#endif
|
||||
|
|
@ -1911,7 +1911,7 @@ bool CSharpInstance::_reference_owner_unsafe() {
|
|||
// See: _unreference_owner_unsafe()
|
||||
|
||||
// May not me referenced yet, so we must use init_ref() instead of reference()
|
||||
if (static_cast<Reference *>(owner)->init_ref()) {
|
||||
if (static_cast<RefCounted *>(owner)->init_ref()) {
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(owner);
|
||||
unsafe_referenced = true;
|
||||
}
|
||||
|
|
@ -1921,7 +1921,7 @@ bool CSharpInstance::_reference_owner_unsafe() {
|
|||
|
||||
bool CSharpInstance::_unreference_owner_unsafe() {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!base_ref);
|
||||
CRASH_COND(!base_ref_counted);
|
||||
CRASH_COND(owner == nullptr);
|
||||
#endif
|
||||
|
||||
|
|
@ -1938,7 +1938,7 @@ bool CSharpInstance::_unreference_owner_unsafe() {
|
|||
|
||||
// Destroying the owner here means self destructing, so we defer the owner destruction to the caller.
|
||||
CSharpLanguage::get_singleton()->pre_unsafe_unreference(owner);
|
||||
return static_cast<Reference *>(owner)->unreference();
|
||||
return static_cast<RefCounted *>(owner)->unreference();
|
||||
}
|
||||
|
||||
MonoObject *CSharpInstance::_internal_new_managed() {
|
||||
|
|
@ -1970,7 +1970,7 @@ MonoObject *CSharpInstance::_internal_new_managed() {
|
|||
// Tie managed to unmanaged
|
||||
gchandle = MonoGCHandleData::new_strong_handle(mono_object);
|
||||
|
||||
if (base_ref) {
|
||||
if (base_ref_counted) {
|
||||
_reference_owner_unsafe(); // Here, after assigning the gchandle (for the refcount_incremented callback)
|
||||
}
|
||||
|
||||
|
|
@ -1987,7 +1987,7 @@ void CSharpInstance::mono_object_disposed(MonoObject *p_obj) {
|
|||
disconnect_event_signals();
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(base_ref);
|
||||
CRASH_COND(base_ref_counted);
|
||||
CRASH_COND(gchandle.is_released());
|
||||
#endif
|
||||
CSharpLanguage::get_singleton()->release_script_gchandle(p_obj, gchandle);
|
||||
|
|
@ -1995,7 +1995,7 @@ void CSharpInstance::mono_object_disposed(MonoObject *p_obj) {
|
|||
|
||||
void CSharpInstance::mono_object_disposed_baseref(MonoObject *p_obj, bool p_is_finalizer, bool &r_delete_owner, bool &r_remove_script_instance) {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!base_ref);
|
||||
CRASH_COND(!base_ref_counted);
|
||||
CRASH_COND(gchandle.is_released());
|
||||
#endif
|
||||
|
||||
|
|
@ -2056,13 +2056,13 @@ void CSharpInstance::disconnect_event_signals() {
|
|||
|
||||
void CSharpInstance::refcount_incremented() {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!base_ref);
|
||||
CRASH_COND(!base_ref_counted);
|
||||
CRASH_COND(owner == nullptr);
|
||||
#endif
|
||||
|
||||
Reference *ref_owner = Object::cast_to<Reference>(owner);
|
||||
RefCounted *rc_owner = Object::cast_to<RefCounted>(owner);
|
||||
|
||||
if (ref_owner->reference_get_count() > 1 && gchandle.is_weak()) { // The managed side also holds a reference, hence 1 instead of 0
|
||||
if (rc_owner->reference_get_count() > 1 && gchandle.is_weak()) { // The managed side also holds a reference, hence 1 instead of 0
|
||||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
||||
// The reference count was increased after the managed side was the only one referencing our owner.
|
||||
|
|
@ -2078,13 +2078,13 @@ void CSharpInstance::refcount_incremented() {
|
|||
|
||||
bool CSharpInstance::refcount_decremented() {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(!base_ref);
|
||||
CRASH_COND(!base_ref_counted);
|
||||
CRASH_COND(owner == nullptr);
|
||||
#endif
|
||||
|
||||
Reference *ref_owner = Object::cast_to<Reference>(owner);
|
||||
RefCounted *rc_owner = Object::cast_to<RefCounted>(owner);
|
||||
|
||||
int refcount = ref_owner->reference_get_count();
|
||||
int refcount = rc_owner->reference_get_count();
|
||||
|
||||
if (refcount == 1 && !gchandle.is_weak()) { // The managed side also holds a reference, hence 1 instead of 0
|
||||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
|
@ -2119,12 +2119,12 @@ void CSharpInstance::notification(int p_notification) {
|
|||
|
||||
predelete_notified = true;
|
||||
|
||||
if (base_ref) {
|
||||
// It's not safe to proceed if the owner derives Reference and the refcount reached 0.
|
||||
if (base_ref_counted) {
|
||||
// It's not safe to proceed if the owner derives RefCounted and the refcount reached 0.
|
||||
// At this point, Dispose() was already called (manually or from the finalizer) so
|
||||
// that's not a problem. The refcount wouldn't have reached 0 otherwise, since the
|
||||
// managed side references it and Dispose() needs to be called to release it.
|
||||
// However, this means C# Reference scripts can't receive NOTIFICATION_PREDELETE, but
|
||||
// However, this means C# RefCounted scripts can't receive NOTIFICATION_PREDELETE, but
|
||||
// this is likely the case with GDScript as well: https://github.com/godotengine/godot/issues/6784
|
||||
return;
|
||||
}
|
||||
|
|
@ -2250,15 +2250,15 @@ CSharpInstance::~CSharpInstance() {
|
|||
}
|
||||
|
||||
// If not being called from the owner's destructor, and we still hold a reference to the owner
|
||||
if (base_ref && !ref_dying && owner && unsafe_referenced) {
|
||||
if (base_ref_counted && !ref_dying && owner && unsafe_referenced) {
|
||||
// The owner's script or script instance is being replaced (or removed)
|
||||
|
||||
// Transfer ownership to an "instance binding"
|
||||
|
||||
Reference *ref_owner = static_cast<Reference *>(owner);
|
||||
RefCounted *rc_owner = static_cast<RefCounted *>(owner);
|
||||
|
||||
// We will unreference the owner before referencing it again, so we need to keep it alive
|
||||
Ref<Reference> scope_keep_owner_alive(ref_owner);
|
||||
Ref<RefCounted> scope_keep_owner_alive(rc_owner);
|
||||
(void)scope_keep_owner_alive;
|
||||
|
||||
// Unreference the owner here, before the new "instance binding" references it.
|
||||
|
|
@ -2283,7 +2283,7 @@ CSharpInstance::~CSharpInstance() {
|
|||
|
||||
#ifdef DEBUG_ENABLED
|
||||
// The "instance binding" holds a reference so the refcount should be at least 2 before `scope_keep_owner_alive` goes out of scope
|
||||
CRASH_COND(ref_owner->reference_get_count() <= 1);
|
||||
CRASH_COND(rc_owner->reference_get_count() <= 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -2511,7 +2511,7 @@ bool CSharpScript::_update_exports() {
|
|||
#ifdef TOOLS_ENABLED
|
||||
if (is_editor) {
|
||||
// Need to check this here, before disposal
|
||||
bool base_ref = Object::cast_to<Reference>(tmp_native) != nullptr;
|
||||
bool base_ref_counted = Object::cast_to<RefCounted>(tmp_native) != nullptr;
|
||||
|
||||
// Dispose the temporary managed instance
|
||||
|
||||
|
|
@ -2526,7 +2526,7 @@ bool CSharpScript::_update_exports() {
|
|||
GDMonoUtils::free_gchandle(tmp_pinned_gchandle);
|
||||
tmp_object = nullptr;
|
||||
|
||||
if (tmp_native && !base_ref) {
|
||||
if (tmp_native && !base_ref_counted) {
|
||||
Node *node = Object::cast_to<Node>(tmp_native);
|
||||
if (node && node->is_inside_tree()) {
|
||||
ERR_PRINT("Temporary instance was added to the scene tree.");
|
||||
|
|
@ -3077,7 +3077,7 @@ StringName CSharpScript::get_instance_base_type() const {
|
|||
}
|
||||
}
|
||||
|
||||
CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error) {
|
||||
CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_is_ref_counted, Callable::CallError &r_error) {
|
||||
GD_MONO_ASSERT_THREAD_ATTACHED;
|
||||
|
||||
/* STEP 1, CREATE */
|
||||
|
|
@ -3093,10 +3093,10 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg
|
|||
ERR_FAIL_V_MSG(nullptr, "Constructor not found.");
|
||||
}
|
||||
|
||||
Ref<Reference> ref;
|
||||
if (p_isref) {
|
||||
Ref<RefCounted> ref;
|
||||
if (p_is_ref_counted) {
|
||||
// Hold it alive. Important if we have to dispose a script instance binding before creating the CSharpInstance.
|
||||
ref = Ref<Reference>(static_cast<Reference *>(p_owner));
|
||||
ref = Ref<RefCounted>(static_cast<RefCounted *>(p_owner));
|
||||
}
|
||||
|
||||
// If the object had a script instance binding, dispose it before adding the CSharpInstance
|
||||
|
|
@ -3122,7 +3122,7 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg
|
|||
}
|
||||
|
||||
CSharpInstance *instance = memnew(CSharpInstance(Ref<CSharpScript>(this)));
|
||||
instance->base_ref = p_isref;
|
||||
instance->base_ref_counted = p_is_ref_counted;
|
||||
instance->owner = p_owner;
|
||||
instance->owner->set_script_instance(instance);
|
||||
|
||||
|
|
@ -3147,7 +3147,7 @@ CSharpInstance *CSharpScript::_create_instance(const Variant **p_args, int p_arg
|
|||
// Tie managed to unmanaged
|
||||
instance->gchandle = MonoGCHandleData::new_strong_handle(mono_object);
|
||||
|
||||
if (instance->base_ref) {
|
||||
if (instance->base_ref_counted) {
|
||||
instance->_reference_owner_unsafe(); // Here, after assigning the gchandle (for the refcount_incremented callback)
|
||||
}
|
||||
|
||||
|
|
@ -3182,7 +3182,7 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Callable::Cal
|
|||
Object *owner = ClassDB::instance(NATIVE_GDMONOCLASS_NAME(native));
|
||||
|
||||
REF ref;
|
||||
Reference *r = Object::cast_to<Reference>(owner);
|
||||
RefCounted *r = Object::cast_to<RefCounted>(owner);
|
||||
if (r) {
|
||||
ref = REF(r);
|
||||
}
|
||||
|
|
@ -3223,7 +3223,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
|
|||
GD_MONO_SCOPE_THREAD_ATTACH;
|
||||
|
||||
Callable::CallError unchecked_error;
|
||||
return _create_instance(nullptr, 0, p_this, Object::cast_to<Reference>(p_this) != nullptr, unchecked_error);
|
||||
return _create_instance(nullptr, 0, p_this, Object::cast_to<RefCounted>(p_this) != nullptr, unchecked_error);
|
||||
}
|
||||
|
||||
PlaceHolderScriptInstance *CSharpScript::placeholder_instance_create(Object *p_this) {
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ private:
|
|||
static int _try_get_member_export_hint(IMonoClassMember *p_member, ManagedType p_type, Variant::Type p_variant_type, bool p_allow_generics, PropertyHint &r_hint, String &r_hint_string);
|
||||
#endif
|
||||
|
||||
CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Callable::CallError &r_error);
|
||||
CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_is_ref_counted, Callable::CallError &r_error);
|
||||
Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
|
||||
|
||||
// Do not use unless you know what you are doing
|
||||
|
|
@ -251,7 +251,7 @@ class CSharpInstance : public ScriptInstance {
|
|||
friend class CSharpLanguage;
|
||||
|
||||
Object *owner = nullptr;
|
||||
bool base_ref = false;
|
||||
bool base_ref_counted = false;
|
||||
bool ref_dying = false;
|
||||
bool unsafe_referenced = false;
|
||||
bool predelete_notified = false;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Path = System.IO.Path;
|
|||
namespace GodotTools.Build
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class BuildInfo : Reference // TODO Remove Reference once we have proper serialization
|
||||
public sealed class BuildInfo : RefCounted // TODO Remove RefCounted once we have proper serialization
|
||||
{
|
||||
public string Solution { get; }
|
||||
public string[] Targets { get; }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace GodotTools.Build
|
|||
public class BuildOutputView : VBoxContainer, ISerializationListener
|
||||
{
|
||||
[Serializable]
|
||||
private class BuildIssue : Reference // TODO Remove Reference once we have proper serialization
|
||||
private class BuildIssue : RefCounted // TODO Remove RefCounted once we have proper serialization
|
||||
{
|
||||
public bool Warning { get; set; }
|
||||
public string File { get; set; }
|
||||
|
|
|
|||
|
|
@ -1260,7 +1260,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
|
|||
CRASH_COND(itype.cname != name_cache.type_Object);
|
||||
CRASH_COND(!itype.is_instantiable);
|
||||
CRASH_COND(itype.api_type != ClassDB::API_CORE);
|
||||
CRASH_COND(itype.is_reference);
|
||||
CRASH_COND(itype.is_ref_counted);
|
||||
CRASH_COND(itype.is_singleton);
|
||||
}
|
||||
|
||||
|
|
@ -2284,8 +2284,8 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
|
|||
}
|
||||
|
||||
if (return_type->is_object_type) {
|
||||
ptrcall_return_type = return_type->is_reference ? "Ref<Reference>" : return_type->c_type;
|
||||
initialization = return_type->is_reference ? "" : " = nullptr";
|
||||
ptrcall_return_type = return_type->is_ref_counted ? "Ref<RefCounted>" : return_type->c_type;
|
||||
initialization = return_type->is_ref_counted ? "" : " = nullptr";
|
||||
} else {
|
||||
ptrcall_return_type = return_type->c_type;
|
||||
}
|
||||
|
|
@ -2600,12 +2600,12 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
itype.base_name = ClassDB::get_parent_class(type_cname);
|
||||
itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name);
|
||||
itype.is_instantiable = class_info->creation_func && !itype.is_singleton;
|
||||
itype.is_reference = ClassDB::is_parent_class(type_cname, name_cache.type_Reference);
|
||||
itype.memory_own = itype.is_reference;
|
||||
itype.is_ref_counted = ClassDB::is_parent_class(type_cname, name_cache.type_RefCounted);
|
||||
itype.memory_own = itype.is_ref_counted;
|
||||
|
||||
itype.c_out = "\treturn ";
|
||||
itype.c_out += C_METHOD_UNMANAGED_GET_MANAGED;
|
||||
itype.c_out += itype.is_reference ? "(%1.ptr());\n" : "(%1);\n";
|
||||
itype.c_out += itype.is_ref_counted ? "(%1.ptr());\n" : "(%1);\n";
|
||||
|
||||
itype.cs_in = itype.is_singleton ? BINDINGS_PTR_FIELD : "Object." CS_SMETHOD_GETINSTANCE "(%0)";
|
||||
|
||||
|
|
@ -2741,7 +2741,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
imethod.return_type.cname = return_info.class_name;
|
||||
|
||||
bool bad_reference_hint = !imethod.is_virtual && return_info.hint != PROPERTY_HINT_RESOURCE_TYPE &&
|
||||
ClassDB::is_parent_class(return_info.class_name, name_cache.type_Reference);
|
||||
ClassDB::is_parent_class(return_info.class_name, name_cache.type_RefCounted);
|
||||
ERR_FAIL_COND_V_MSG(bad_reference_hint, false,
|
||||
String() + "Return type is reference but hint is not '" _STR(PROPERTY_HINT_RESOURCE_TYPE) "'." +
|
||||
" Are you returning a reference type by pointer? Method: '" + itype.name + "." + imethod.name + "'.");
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class BindingsGenerator {
|
|||
bool is_enum = false;
|
||||
bool is_object_type = false;
|
||||
bool is_singleton = false;
|
||||
bool is_reference = false;
|
||||
bool is_ref_counted = false;
|
||||
|
||||
/**
|
||||
* Used only by Object-derived types.
|
||||
|
|
@ -228,7 +228,7 @@ class BindingsGenerator {
|
|||
/**
|
||||
* Used only by Object-derived types.
|
||||
* Determines if the C# class owns the native handle and must free it somehow when disposed.
|
||||
* e.g.: Reference types must notify when the C# instance is disposed, for proper refcounting.
|
||||
* e.g.: RefCounted types must notify when the C# instance is disposed, for proper refcounting.
|
||||
*/
|
||||
bool memory_own = false;
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ class BindingsGenerator {
|
|||
* VarArg (fictitious type to represent variable arguments): Array
|
||||
* float: double (because ptrcall only supports double)
|
||||
* int: int64_t (because ptrcall only supports int64_t and uint64_t)
|
||||
* Reference types override this for the type of the return variable: Ref<Reference>
|
||||
* RefCounted types override this for the type of the return variable: Ref<RefCounted>
|
||||
*/
|
||||
String c_type;
|
||||
|
||||
|
|
@ -534,7 +534,7 @@ class BindingsGenerator {
|
|||
StringName type_Variant = StaticCString::create("Variant");
|
||||
StringName type_VarArg = StaticCString::create("VarArg");
|
||||
StringName type_Object = StaticCString::create("Object");
|
||||
StringName type_Reference = StaticCString::create("Reference");
|
||||
StringName type_RefCounted = StaticCString::create("RefCounted");
|
||||
StringName type_RID = StaticCString::create("RID");
|
||||
StringName type_String = StaticCString::create("String");
|
||||
StringName type_StringName = StaticCString::create("StringName");
|
||||
|
|
@ -623,7 +623,7 @@ class BindingsGenerator {
|
|||
}
|
||||
|
||||
inline String get_unique_sig(const TypeInterface &p_type) {
|
||||
if (p_type.is_reference) {
|
||||
if (p_type.is_ref_counted) {
|
||||
return "Ref";
|
||||
} else if (p_type.is_object_type) {
|
||||
return "Obj";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#ifdef MONO_GLUE_ENABLED
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/string/string_name.h"
|
||||
|
||||
#include "../csharp_script.h"
|
||||
|
|
@ -81,13 +81,13 @@ void godot_icall_Object_Disposed(MonoObject *p_obj, Object *p_ptr) {
|
|||
void godot_icall_Reference_Disposed(MonoObject *p_obj, Object *p_ptr, MonoBoolean p_is_finalizer) {
|
||||
#ifdef DEBUG_ENABLED
|
||||
CRASH_COND(p_ptr == nullptr);
|
||||
// This is only called with Reference derived classes
|
||||
CRASH_COND(!Object::cast_to<Reference>(p_ptr));
|
||||
// This is only called with RefCounted derived classes
|
||||
CRASH_COND(!Object::cast_to<RefCounted>(p_ptr));
|
||||
#endif
|
||||
|
||||
Reference *ref = static_cast<Reference *>(p_ptr);
|
||||
RefCounted *rc = static_cast<RefCounted *>(p_ptr);
|
||||
|
||||
if (ref->get_script_instance()) {
|
||||
if (rc->get_script_instance()) {
|
||||
CSharpInstance *cs_instance = CAST_CSHARP_INSTANCE(ref->get_script_instance());
|
||||
if (cs_instance) {
|
||||
if (!cs_instance->is_destructing_script_instance()) {
|
||||
|
|
@ -97,9 +97,9 @@ void godot_icall_Reference_Disposed(MonoObject *p_obj, Object *p_ptr, MonoBoolea
|
|||
cs_instance->mono_object_disposed_baseref(p_obj, p_is_finalizer, delete_owner, remove_script_instance);
|
||||
|
||||
if (delete_owner) {
|
||||
memdelete(ref);
|
||||
memdelete(rc);
|
||||
} else if (remove_script_instance) {
|
||||
ref->set_script_instance(nullptr);
|
||||
rc->set_script_instance(nullptr);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
@ -145,10 +145,10 @@ MonoObject *godot_icall_Object_weakref(Object *p_ptr) {
|
|||
}
|
||||
|
||||
Ref<WeakRef> wref;
|
||||
Reference *ref = Object::cast_to<Reference>(p_ptr);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(p_ptr);
|
||||
|
||||
if (ref) {
|
||||
REF r = ref;
|
||||
if (rc) {
|
||||
REF r = rc;
|
||||
if (!r.is_valid()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ void godot_register_glue_header_icalls() {
|
|||
#include "core/config/engine.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/object/method_bind.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/string/node_path.h"
|
||||
#include "core/string/ustring.h"
|
||||
#include "core/typedefs.h"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <mono/jit/jit.h>
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
namespace gdmono {
|
||||
|
||||
|
|
@ -79,8 +79,8 @@ struct MonoGCHandleData {
|
|||
static MonoGCHandleData new_weak_handle(MonoObject *p_object);
|
||||
};
|
||||
|
||||
class MonoGCHandleRef : public Reference {
|
||||
GDCLASS(MonoGCHandleRef, Reference);
|
||||
class MonoGCHandleRef : public RefCounted {
|
||||
GDCLASS(MonoGCHandleRef, RefCounted);
|
||||
|
||||
MonoGCHandleData data;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
|
|||
// All mono objects created from the managed world (e.g.: 'new Player()')
|
||||
// need to have a CSharpScript in order for their methods to be callable from the unmanaged side
|
||||
|
||||
Reference *ref = Object::cast_to<Reference>(unmanaged);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(unmanaged);
|
||||
|
||||
GDMonoClass *klass = GDMonoUtils::get_object_class(managed);
|
||||
|
||||
|
|
@ -73,18 +73,18 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
|
|||
script_binding.inited = true;
|
||||
script_binding.type_name = NATIVE_GDMONOCLASS_NAME(klass);
|
||||
script_binding.wrapper_class = klass;
|
||||
script_binding.gchandle = ref ? MonoGCHandleData::new_weak_handle(managed) : MonoGCHandleData::new_strong_handle(managed);
|
||||
script_binding.gchandle = rc ? MonoGCHandleData::new_weak_handle(managed) : MonoGCHandleData::new_strong_handle(managed);
|
||||
script_binding.owner = unmanaged;
|
||||
|
||||
if (ref) {
|
||||
if (rc) {
|
||||
// Unsafe refcount increment. The managed instance also counts as a reference.
|
||||
// This way if the unmanaged world has no references to our owner
|
||||
// but the managed instance is alive, the refcount will be 1 instead of 0.
|
||||
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
|
||||
|
||||
// May not me referenced yet, so we must use init_ref() instead of reference()
|
||||
if (ref->init_ref()) {
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(ref);
|
||||
if (rc->init_ref()) {
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(rc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
|
|||
return;
|
||||
}
|
||||
|
||||
MonoGCHandleData gchandle = ref ? MonoGCHandleData::new_weak_handle(managed) : MonoGCHandleData::new_strong_handle(managed);
|
||||
MonoGCHandleData gchandle = rc ? MonoGCHandleData::new_weak_handle(managed) : MonoGCHandleData::new_strong_handle(managed);
|
||||
|
||||
Ref<CSharpScript> script = CSharpScript::create_for_managed_type(klass, native);
|
||||
|
||||
|
|
|
|||
|
|
@ -1136,8 +1136,8 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
|
|||
if (CACHED_CLASS(GodotObject)->is_assignable_from(type_class)) {
|
||||
Object *ptr = unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_obj));
|
||||
if (ptr != nullptr) {
|
||||
Reference *ref = Object::cast_to<Reference>(ptr);
|
||||
return ref ? Variant(Ref<Reference>(ref)) : Variant(ptr);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(ptr);
|
||||
return rc ? Variant(Ref<RefCounted>(rc)) : Variant(ptr);
|
||||
}
|
||||
return Variant();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "core/debugger/engine_debugger.h"
|
||||
#include "core/debugger/script_debugger.h"
|
||||
#include "core/io/dir_access.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/os/mutex.h"
|
||||
#include "core/os/os.h"
|
||||
|
||||
|
|
@ -108,15 +108,15 @@ MonoObject *unmanaged_get_managed(Object *unmanaged) {
|
|||
gchandle = MonoGCHandleData::new_strong_handle(mono_object);
|
||||
|
||||
// Tie managed to unmanaged
|
||||
Reference *ref = Object::cast_to<Reference>(unmanaged);
|
||||
RefCounted *rc = Object::cast_to<RefCounted>(unmanaged);
|
||||
|
||||
if (ref) {
|
||||
if (rc) {
|
||||
// Unsafe refcount increment. The managed instance also counts as a reference.
|
||||
// This way if the unmanaged world has no references to our owner
|
||||
// but the managed instance is alive, the refcount will be 1 instead of 0.
|
||||
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
|
||||
ref->reference();
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(ref);
|
||||
rc->reference();
|
||||
CSharpLanguage::get_singleton()->post_unsafe_reference(rc);
|
||||
}
|
||||
|
||||
return mono_object;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#endif
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#define UNHANDLED_EXCEPTION(m_exc) \
|
||||
if (unlikely(m_exc != nullptr)) { \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef SIGNAL_AWAITER_UTILS_H
|
||||
#define SIGNAL_AWAITER_UTILS_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#include "csharp_script.h"
|
||||
#include "mono_gc_handle.h"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include "open_simplex_noise.h"
|
||||
|
||||
#include "core/io/image.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#define OPEN_SIMPLEX_NOISE_H
|
||||
|
||||
#include "core/io/image.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
#include "thirdparty/misc/open-simplex-noise.h"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "image_compress_pvrtc.h"
|
||||
|
||||
#include "core/io/image.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#include <PvrTcEncoder.h>
|
||||
#include <RgbaBitmap.h>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include "core/io/image.h"
|
||||
#include "core/math/camera_matrix.h"
|
||||
#include "core/object/object.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/templates/local_vector.h"
|
||||
#include "core/templates/rid_owner.h"
|
||||
#include "scene/resources/mesh.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="RegEx" inherits="Reference" version="4.0">
|
||||
<class name="RegEx" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
Class for searching text for patterns using regular expressions.
|
||||
</brief_description>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="RegExMatch" inherits="Reference" version="4.0">
|
||||
<class name="RegExMatch" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
Contains the results of a [RegEx] search.
|
||||
</brief_description>
|
||||
|
|
|
|||
|
|
@ -31,15 +31,15 @@
|
|||
#ifndef REGEX_H
|
||||
#define REGEX_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/string/ustring.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/variant/array.h"
|
||||
#include "core/variant/dictionary.h"
|
||||
|
||||
class RegExMatch : public Reference {
|
||||
GDCLASS(RegExMatch, Reference);
|
||||
class RegExMatch : public RefCounted {
|
||||
GDCLASS(RegExMatch, RefCounted);
|
||||
|
||||
struct Range {
|
||||
int start = 0;
|
||||
|
|
@ -68,8 +68,8 @@ public:
|
|||
int get_end(const Variant &p_name) const;
|
||||
};
|
||||
|
||||
class RegEx : public Reference {
|
||||
GDCLASS(RegEx, Reference);
|
||||
class RegEx : public RefCounted {
|
||||
GDCLASS(RegEx, RefCounted);
|
||||
|
||||
void *general_ctx;
|
||||
void *code = nullptr;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="UPNP" inherits="Reference" version="4.0">
|
||||
<class name="UPNP" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
UPNP network functions.
|
||||
</brief_description>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="UPNPDevice" inherits="Reference" version="4.0">
|
||||
<class name="UPNPDevice" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
UPNP device.
|
||||
</brief_description>
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@
|
|||
#ifndef GODOT_UPNP_H
|
||||
#define GODOT_UPNP_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
#include "upnp_device.h"
|
||||
|
||||
#include <miniupnpc/miniupnpc.h>
|
||||
|
||||
class UPNP : public Reference {
|
||||
GDCLASS(UPNP, Reference);
|
||||
class UPNP : public RefCounted {
|
||||
GDCLASS(UPNP, RefCounted);
|
||||
|
||||
private:
|
||||
String discover_multicast_if = "";
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
#ifndef GODOT_UPNP_DEVICE_H
|
||||
#define GODOT_UPNP_DEVICE_H
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
|
||||
class UPNPDevice : public Reference {
|
||||
GDCLASS(UPNPDevice, Reference);
|
||||
class UPNPDevice : public RefCounted {
|
||||
GDCLASS(UPNPDevice, RefCounted);
|
||||
|
||||
public:
|
||||
enum IGDStatus {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="VisualScriptFunctionState" inherits="Reference" version="4.0">
|
||||
<class name="VisualScriptFunctionState" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
</brief_description>
|
||||
<description>
|
||||
|
|
|
|||
|
|
@ -449,8 +449,8 @@ public:
|
|||
~VisualScriptInstance();
|
||||
};
|
||||
|
||||
class VisualScriptFunctionState : public Reference {
|
||||
GDCLASS(VisualScriptFunctionState, Reference);
|
||||
class VisualScriptFunctionState : public RefCounted {
|
||||
GDCLASS(VisualScriptFunctionState, RefCounted);
|
||||
friend class VisualScriptInstance;
|
||||
|
||||
ObjectID instance_id;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include "core/io/marshalls.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/os/os.h"
|
||||
#include "core/variant/variant_parser.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="WebRTCPeerConnection" inherits="Reference" version="4.0">
|
||||
<class name="WebRTCPeerConnection" inherits="RefCounted" version="4.0">
|
||||
<brief_description>
|
||||
Interface to a WebRTC peer connection.
|
||||
</brief_description>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ private:
|
|||
CH_RESERVED_MAX = 3
|
||||
};
|
||||
|
||||
class ConnectedPeer : public Reference {
|
||||
class ConnectedPeer : public RefCounted {
|
||||
public:
|
||||
Ref<WebRTCPeerConnection> connection;
|
||||
List<Ref<WebRTCDataChannel>> channels;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
#include "core/io/packet_peer.h"
|
||||
#include "modules/webrtc/webrtc_data_channel.h"
|
||||
|
||||
class WebRTCPeerConnection : public Reference {
|
||||
GDCLASS(WebRTCPeerConnection, Reference);
|
||||
class WebRTCPeerConnection : public RefCounted {
|
||||
GDCLASS(WebRTCPeerConnection, RefCounted);
|
||||
|
||||
public:
|
||||
enum ConnectionState {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "emws_peer.h"
|
||||
#include "websocket_server.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#define WEBSOCKET_H
|
||||
|
||||
#include "core/crypto/crypto.h"
|
||||
#include "core/object/reference.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "websocket_multiplayer_peer.h"
|
||||
#include "websocket_peer.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class WSLServer : public WebSocketServer {
|
|||
GDCIIMPL(WSLServer, WebSocketServer);
|
||||
|
||||
private:
|
||||
class PendingPeer : public Reference {
|
||||
class PendingPeer : public RefCounted {
|
||||
private:
|
||||
bool _parse_request(const Vector<String> p_protocols);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue