diff --git a/clutter/ground_clutter_foliage.cpp b/clutter/ground_clutter_foliage.cpp index 2f399f1..a74ffa0 100644 --- a/clutter/ground_clutter_foliage.cpp +++ b/clutter/ground_clutter_foliage.cpp @@ -33,7 +33,7 @@ Ref GroundClutterFoliage::get_texture(const int index) { void GroundClutterFoliage::remove_texture(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); } void GroundClutterFoliage::add_texture(Ref texture) { _textures.push_back(texture); diff --git a/jobs/prop_mesher_job_step.h b/jobs/prop_mesher_job_step.h index 4ed5791..fa0f9b8 100644 --- a/jobs/prop_mesher_job_step.h +++ b/jobs/prop_mesher_job_step.h @@ -26,7 +26,7 @@ SOFTWARE. #include "core/version.h" #if VERSION_MAJOR > 3 -#include "core/io/reference.h" +#include "core/object/ref_counted.h" #else #include "core/reference.h" #endif @@ -35,8 +35,8 @@ SOFTWARE. #include "../../mesh_utils/fast_quadratic_mesh_simplifier.h" #endif -class PropMesherJobStep : public Reference { - GDCLASS(PropMesherJobStep, Reference); +class PropMesherJobStep : public RefCounted { + GDCLASS(PropMesherJobStep, RefCounted); public: //todo add: diff --git a/jobs/prop_texture_job.h b/jobs/prop_texture_job.h index 526a28d..ce9d474 100644 --- a/jobs/prop_texture_job.h +++ b/jobs/prop_texture_job.h @@ -32,7 +32,7 @@ SOFTWARE. #include "core/version.h" #if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #define Texture Texture2D #else #include "core/reference.h" @@ -46,8 +46,8 @@ class TexturePacker; class PropTextureJob : public ThreadPoolJob { GDCLASS(PropTextureJob, ThreadPoolJob); #else -class PropTextureJob : public Reference { - GDCLASS(PropTextureJob, Reference); +class PropTextureJob : public RefCounted { + GDCLASS(PropTextureJob, RefCounted); #endif public: diff --git a/lights/prop_light.h b/lights/prop_light.h index 0778d4f..708e551 100644 --- a/lights/prop_light.h +++ b/lights/prop_light.h @@ -26,7 +26,7 @@ SOFTWARE. #include "core/version.h" #if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #include "core/math/color.h" #else @@ -35,8 +35,8 @@ SOFTWARE. #include "core/color.h" #endif -class PropLight : public Reference { - GDCLASS(PropLight, Reference); +class PropLight : public RefCounted { + GDCLASS(PropLight, RefCounted); public: Vector3 get_position(); diff --git a/material_cache/prop_material_cache.cpp b/material_cache/prop_material_cache.cpp index c5a7f94..27005f1 100644 --- a/material_cache/prop_material_cache.cpp +++ b/material_cache/prop_material_cache.cpp @@ -118,7 +118,7 @@ void PropMaterialCache::material_set(const int index, const Ref &value } void PropMaterialCache::material_remove(const int index) { - _materials.remove(index); + _materials.remove_at(index); } int PropMaterialCache::material_get_num() const { @@ -149,7 +149,7 @@ void PropMaterialCache::texture_add(const Ref &texture) { void PropMaterialCache::texture_remove(const Ref &texture) { for (int i = 0; i < _textures.size(); ++i) { if (_textures[i] == texture) { - _textures.remove(i); + _textures.remove_at(i); return; } } @@ -157,7 +157,7 @@ void PropMaterialCache::texture_remove(const Ref &texture) { void PropMaterialCache::texture_remove_index(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); } void PropMaterialCache::textures_clear() { _textures.clear(); @@ -330,7 +330,7 @@ void PropMaterialCache::_bind_methods() { ClassDB::bind_method(D_METHOD("inc_ref_count"), &PropMaterialCache::inc_ref_count); ClassDB::bind_method(D_METHOD("dec_ref_count"), &PropMaterialCache::dec_ref_count); - BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"))); + //BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"))); ClassDB::bind_method(D_METHOD("material_get", "index"), &PropMaterialCache::material_get); ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &PropMaterialCache::material_lod_get); diff --git a/material_cache/prop_material_cache_pcm.cpp b/material_cache/prop_material_cache_pcm.cpp index eb35af8..048a943 100644 --- a/material_cache/prop_material_cache_pcm.cpp +++ b/material_cache/prop_material_cache_pcm.cpp @@ -163,7 +163,7 @@ void PropMaterialCachePCM::_setup_material_albedo(Ref texture) { } PropMaterialCachePCM::PropMaterialCachePCM() { - _packer.instance(); + _packer.instantiate(); #if GODOT4 #warning implement diff --git a/prop_instance_job.h b/prop_instance_job.h index 65d66b5..4855673 100644 --- a/prop_instance_job.h +++ b/prop_instance_job.h @@ -32,7 +32,7 @@ SOFTWARE. #include "core/version.h" #if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #define Texture Texture2D #else #include "core/reference.h" diff --git a/prop_instance_merger.cpp b/prop_instance_merger.cpp index 303a215..18da4dc 100644 --- a/prop_instance_merger.cpp +++ b/prop_instance_merger.cpp @@ -624,7 +624,7 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Refget_collision()) { Ref tws; - tws.instance(); + tws.instantiate(); float hew = tiled_wall_data->get_width() / 2.0; float heh = tiled_wall_data->get_heigth() / 2.0; @@ -668,7 +668,7 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Ref light; - light.instance(); + light.instantiate(); Vector3 v = t.xform(Vector3()); @@ -725,15 +725,15 @@ void PropInstanceMerger::_create_job() { Ref js; - js.instance(); + js.instantiate(); js->set_job_type(PropMesherJobStep::TYPE_NORMAL); _job->add_jobs_step(js); - js.instance(); + js.instantiate(); js->set_job_type(PropMesherJobStep::TYPE_MERGE_VERTS); _job->add_jobs_step(js); - js.instance(); + js.instantiate(); js->set_job_type(PropMesherJobStep::TYPE_BAKE_TEXTURE); _job->add_jobs_step(js); } diff --git a/prop_instance_prop_job.cpp b/prop_instance_prop_job.cpp index bd4ed00..c43e5ad 100644 --- a/prop_instance_prop_job.cpp +++ b/prop_instance_prop_job.cpp @@ -533,13 +533,13 @@ void PropInstancePropJob::step_type_merge_verts() { void PropInstancePropJob::step_type_bake_texture() { Ref mat = _material_cache->material_lod_get(0); - Ref spmat = _material_cache->material_lod_get(0); + Ref spmat = _material_cache->material_lod_get(0); Ref tex; if (mat.is_valid()) { tex = mat->get_shader_param("texture_albedo"); } else if (spmat.is_valid()) { - tex = spmat->get_texture(SpatialMaterial::TEXTURE_ALBEDO); + tex = spmat->get_texture(StandardMaterial3D::TEXTURE_ALBEDO); } if (tex.is_valid()) { @@ -725,7 +725,7 @@ PropInstancePropJob::PropInstancePropJob() { _current_job_step = 0; //todo allocate this in a virtual method - _prop_mesher.instance(); + _prop_mesher.instantiate(); _prop_mesher->set_build_flags(PropMesher::BUILD_FLAG_USE_LIGHTING | PropMesher::BUILD_FLAG_USE_AO | PropMesher::BUILD_FLAG_USE_RAO | PropMesher::BUILD_FLAG_BAKE_LIGHTS); } diff --git a/prop_mesher.cpp b/prop_mesher.cpp index b77d2c0..38480f9 100644 --- a/prop_mesher.cpp +++ b/prop_mesher.cpp @@ -374,7 +374,7 @@ void PropMesher::remove_doubles() { for (int j = 0; j < indices.size(); ++j) { int index = indices[j]; - _vertices.remove(index); + _vertices.remove_at(index); //make all indices that were bigger than the one we replaced one lower for (int k = 0; k < _indices.size(); ++k) { @@ -427,7 +427,7 @@ void PropMesher::remove_doubles_hashed() { int index = indices[j]; hashes.remove(index); - _vertices.remove(index); + _vertices.remove_at(index); //make all indices that were bigger than the one we replaced one lower for (int k = 0; k < _indices.size(); ++k) { @@ -1303,7 +1303,7 @@ PropMesher::PropMesher() { _format = VisualServer::ARRAY_FORMAT_NORMAL | VisualServer::ARRAY_FORMAT_TEX_UV; - _noise.instance(); + _noise.instantiate(); //todo add properties for these if needed _noise->set_octaves(4); _noise->set_period(30); diff --git a/prop_mesher.h b/prop_mesher.h index c648b4a..6d8d9c3 100644 --- a/prop_mesher.h +++ b/prop_mesher.h @@ -27,7 +27,7 @@ SOFTWARE. #if VERSION_MAJOR > 3 #include "core/math/color.h" -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" template @@ -65,8 +65,8 @@ class PropLight; class PropMaterialCache; class TiledWallData; -class PropMesher : public Reference { - GDCLASS(PropMesher, Reference); +class PropMesher : public RefCounted { + GDCLASS(PropMesher, RefCounted); public: static const String BINDING_STRING_BUILD_FLAGS; diff --git a/props/prop_data.cpp b/props/prop_data.cpp index 7015e11..6102710 100644 --- a/props/prop_data.cpp +++ b/props/prop_data.cpp @@ -71,7 +71,7 @@ void PropData::add_prop(const Ref prop) { void PropData::remove_prop(const int index) { ERR_FAIL_INDEX(index, _props.size()); - _props.remove(index); + _props.remove_at(index); } int PropData::get_prop_count() const { @@ -119,10 +119,10 @@ void PropData::set_is_room(const bool value) { _is_room = value; } -PoolVector3Array PropData::get_room_bounds() { +PackedVector3Array PropData::get_room_bounds() { return _room_bounds; } -void PropData::set_room_bounds(const PoolVector3Array &bounds) { +void PropData::set_room_bounds(const PackedVector3Array &bounds) { _room_bounds = bounds; } @@ -183,7 +183,7 @@ void PropData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_room_bounds"), &PropData::get_room_bounds); ClassDB::bind_method(D_METHOD("set_room_bounds", "value"), &PropData::set_room_bounds); - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "room_bounds"), "set_room_bounds", "get_room_bounds"); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "room_bounds"), "set_room_bounds", "get_room_bounds"); ClassDB::bind_method(D_METHOD("copy_from", "prop_data"), &PropData::copy_from); } diff --git a/props/prop_data.h b/props/prop_data.h index f5ff102..41ffc54 100644 --- a/props/prop_data.h +++ b/props/prop_data.h @@ -35,7 +35,7 @@ SOFTWARE. #else #include "core/reference.h" #include "core/vector.h" -#include "core/math/transform.h" +#include "core/math/transform_3d.h" #endif #include "core/math/rect2.h" @@ -80,8 +80,8 @@ public: bool get_is_room() const; void set_is_room(const bool value); - PoolVector3Array get_room_bounds(); - void set_room_bounds(const PoolVector3Array &bounds); + PackedVector3Array get_room_bounds(); + void set_room_bounds(const PackedVector3Array &bounds); void copy_from(const Ref &prop_data); @@ -99,7 +99,7 @@ private: Vector> _props; bool _is_room; - PoolVector3Array _room_bounds; + PackedVector3Array _room_bounds; }; #endif diff --git a/props/prop_data_entry.h b/props/prop_data_entry.h index ceeafa7..6ee621a 100644 --- a/props/prop_data_entry.h +++ b/props/prop_data_entry.h @@ -34,7 +34,7 @@ SOFTWARE. #endif #else #include "core/resource.h" -#include "core/math/transform.h" +#include "core/math/transform_3d.h" #endif class PropData; diff --git a/props/prop_data_light.cpp b/props/prop_data_light.cpp index e2b61e7..09a7144 100644 --- a/props/prop_data_light.cpp +++ b/props/prop_data_light.cpp @@ -58,7 +58,7 @@ void PropDataLight::_processor_process(Ref prop_data, Node *node, cons ERR_FAIL_COND(!i); Ref l; - l.instance(); + l.instantiate(); l->set_light_color(i->get_color()); l->set_light_size(i->get_param(Light::PARAM_RANGE)); l->set_transform(transform * i->get_transform()); diff --git a/props/prop_data_portal.cpp b/props/prop_data_portal.cpp index 538d13d..763d0c7 100644 --- a/props/prop_data_portal.cpp +++ b/props/prop_data_portal.cpp @@ -73,7 +73,7 @@ void PropDataPortal::_processor_process(Ref prop_data, Node *node, con ERR_FAIL_COND(!p); Ref l; - l.instance(); + l.instantiate(); l->set_is_active(p->get_portal_active()); l->set_is_two_way(p->is_two_way()); l->set_use_default_margin(p->get_use_default_margin()); diff --git a/props/prop_data_prop.cpp b/props/prop_data_prop.cpp index 10317b8..723db08 100644 --- a/props/prop_data_prop.cpp +++ b/props/prop_data_prop.cpp @@ -66,7 +66,7 @@ void PropDataProp::_processor_process(Ref prop_data, Node *node, const ERR_FAIL_COND(!i); Ref l; - l.instance(); + l.instantiate(); l->set_prop(i->get_prop_data()); l->set_transform(transform * i->get_transform()); prop_data->add_prop(l); diff --git a/props/prop_data_scene.cpp b/props/prop_data_scene.cpp index ea814d9..68d1325 100644 --- a/props/prop_data_scene.cpp +++ b/props/prop_data_scene.cpp @@ -58,7 +58,7 @@ void PropDataScene::_processor_process(Ref prop_data, Node *node, cons ERR_FAIL_COND(!i); Ref l; - l.instance(); + l.instantiate(); l->set_scene(i->get_scene()); l->set_transform(transform * i->get_transform()); prop_data->add_prop(l); diff --git a/props/prop_data_tiled_wall.cpp b/props/prop_data_tiled_wall.cpp index 71fd130..76d3b88 100644 --- a/props/prop_data_tiled_wall.cpp +++ b/props/prop_data_tiled_wall.cpp @@ -67,7 +67,7 @@ void PropDataTiledWall::_processor_process(Ref prop_data, Node *node, ERR_FAIL_COND(!t); Ref tw; - tw.instance(); + tw.instantiate(); tw->set_width(t->get_width()); tw->set_heigth(t->get_heigth()); diff --git a/singleton/prop_cache.cpp b/singleton/prop_cache.cpp index 49d38e8..9b275d3 100644 --- a/singleton/prop_cache.cpp +++ b/singleton/prop_cache.cpp @@ -142,7 +142,7 @@ void PropCache::material_set(const int index, const Ref &value) { } void PropCache::material_remove(const int index) { - _materials.remove(index); + _materials.remove_at(index); } int PropCache::material_get_num() const { diff --git a/singleton/prop_cache.h b/singleton/prop_cache.h index 15529e6..c61f742 100644 --- a/singleton/prop_cache.h +++ b/singleton/prop_cache.h @@ -29,7 +29,7 @@ SOFTWARE. #include "core/core_bind.h" #include "core/math/color.h" #include "core/object/object.h" -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/hash_map.h" #include "core/templates/vector.h" #else diff --git a/singleton/prop_utils.cpp b/singleton/prop_utils.cpp index 26f5c81..59f7f4b 100644 --- a/singleton/prop_utils.cpp +++ b/singleton/prop_utils.cpp @@ -59,7 +59,7 @@ Ref PropUtils::convert_tree(Node *root) { #endif Ref data; - data.instance(); + data.instantiate(); Transform t; _convert_tree(data, root, t); diff --git a/singleton/prop_utils.h b/singleton/prop_utils.h index 32dcc54..e224fb4 100644 --- a/singleton/prop_utils.h +++ b/singleton/prop_utils.h @@ -27,7 +27,7 @@ SOFTWARE. #if VERSION_MAJOR > 3 #include "core/object/object.h" -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #include "scene/3d/node_3d.h" #else diff --git a/tiled_wall/tiled_wall.cpp b/tiled_wall/tiled_wall.cpp index b1488ee..61c68b8 100644 --- a/tiled_wall/tiled_wall.cpp +++ b/tiled_wall/tiled_wall.cpp @@ -294,7 +294,7 @@ TiledWall::TiledWall() { set_portal_mode(PORTAL_MODE_GLOBAL); #endif - _mesher.instance(); + _mesher.instantiate(); } TiledWall::~TiledWall() { _data.unref(); diff --git a/tiled_wall/tiled_wall.h b/tiled_wall/tiled_wall.h index 5e54962..8e685f3 100644 --- a/tiled_wall/tiled_wall.h +++ b/tiled_wall/tiled_wall.h @@ -29,7 +29,7 @@ SOFTWARE. #if VERSION_MAJOR < 4 #include "scene/3d/visual_instance.h" #else -#include "scene/3d/node_3d.h" +#include "scene/3d/visual_instance_3d.h" #define SpatialMaterial StandardMaterial3D #define Spatial Node3D @@ -42,8 +42,8 @@ class TiledWallData; class PropMaterialCache; class PropMesher; -class TiledWall : public GeometryInstance { - GDCLASS(TiledWall, GeometryInstance); +class TiledWall : public GeometryInstance3D { + GDCLASS(TiledWall, GeometryInstance3D); public: int get_width() const; diff --git a/tiled_wall/tiled_wall_data.cpp b/tiled_wall/tiled_wall_data.cpp index 31a7be6..0353655 100644 --- a/tiled_wall/tiled_wall_data.cpp +++ b/tiled_wall/tiled_wall_data.cpp @@ -44,7 +44,7 @@ SOFTWARE. #define VARIANT_ARRAY_GET(arr) \ Vector r; \ for (int i = 0; i < arr.size(); i++) { \ - r.push_back(arr[i].get_ref_ptr()); \ + r.push_back(arr[i]); \ } \ return r; @@ -88,7 +88,7 @@ void TiledWallData::add_texture(const Ref &texture) { void TiledWallData::remove_texture(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); emit_changed(); } @@ -136,7 +136,7 @@ void TiledWallData::add_flavour_texture(const Ref &texture) { void TiledWallData::remove_flavour_texture(const int index) { ERR_FAIL_INDEX(index, _flavour_textures.size()); - _flavour_textures.remove(index); + _flavour_textures.remove_at(index); emit_changed(); } @@ -190,7 +190,7 @@ void TiledWallData::material_set(const int index, const Ref &value) { } void TiledWallData::material_remove(const int index) { - _materials.remove(index); + _materials.remove_at(index); emit_changed(); } @@ -337,7 +337,7 @@ void TiledWallData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_flavour_chance"), &TiledWallData::get_flavour_chance); ClassDB::bind_method(D_METHOD("set_flavour_chance", "texture"), &TiledWallData::set_flavour_chance); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "flavour_chance"), "set_flavour_chance", "get_flavour_chance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "flavour_chance"), "set_flavour_chance", "get_flavour_chance"); //materials ClassDB::bind_method(D_METHOD("material_add", "value"), &TiledWallData::material_add); @@ -354,7 +354,7 @@ void TiledWallData::_bind_methods() { ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWallData::add_textures_into); #endif - BIND_VMETHOD(MethodInfo("_setup_cache", PropertyInfo(Variant::OBJECT, "cache", PROPERTY_HINT_RESOURCE_TYPE, "PropMaterialCache"))); + //BIND_VMETHOD(MethodInfo("_setup_cache", PropertyInfo(Variant::OBJECT, "cache", PROPERTY_HINT_RESOURCE_TYPE, "PropMaterialCache"))); ClassDB::bind_method(D_METHOD("setup_cache", "cache"), &TiledWallData::setup_cache); ClassDB::bind_method(D_METHOD("_setup_cache", "cache"), &TiledWallData::_setup_cache); diff --git a/tiled_wall/tiled_wall_data.h b/tiled_wall/tiled_wall_data.h index eeeb422..dc917dc 100644 --- a/tiled_wall/tiled_wall_data.h +++ b/tiled_wall/tiled_wall_data.h @@ -26,7 +26,7 @@ SOFTWARE. #include "core/version.h" #if VERSION_MAJOR > 3 -#include "core/object/reference.h" +#include "core/object/ref_counted.h" #include "core/templates/vector.h" #else #include "core/reference.h" @@ -34,7 +34,7 @@ SOFTWARE. #endif #include "core/math/rect2.h" -#include "core/math/transform.h" +#include "core/math/transform_3d.h" #include "core/math/vector2.h" #include "core/math/vector3.h"