From 38e4bb3203e773bebc405cff5f9a015849836756 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 9 Jan 2023 01:17:02 +0100 Subject: [PATCH] Work on fixing compile. --- clutter/ground_clutter_2d_foliage.cpp | 2 +- jobs/prop_2d_texture_job.h | 2 +- lights/prop_2d_light.h | 2 +- material_cache/prop_2d_material_cache.cpp | 2 +- material_cache/prop_2d_material_cache_pcm.cpp | 2 +- prop_2d_instance_job.h | 2 +- prop_2d_instance_merger.cpp | 4 ++-- prop_2d_instance_prop_job.cpp | 2 +- prop_2d_mesher.cpp | 6 +++--- prop_2d_mesher.h | 2 +- props/prop_2d_data.cpp | 4 ++-- props/prop_2d_data.h | 8 ++++---- props/prop_2d_data_entry.cpp | 2 +- props/prop_2d_data_entry.h | 2 +- props/prop_2d_data_light.cpp | 2 +- props/prop_2d_data_portal.cpp | 2 +- props/prop_2d_data_prop.cpp | 2 +- props/prop_2d_data_scene.cpp | 2 +- props/prop_2d_data_sprite.cpp | 2 +- props/prop_2d_data_tiled_wall_2d.cpp | 2 +- singleton/prop_2d_cache.h | 2 +- singleton/prop_2d_utils.cpp | 2 +- singleton/prop_2d_utils.h | 2 +- tiled_wall/tiled_wall_2d.cpp | 2 +- tiled_wall/tiled_wall_2d_data.cpp | 8 ++++---- tiled_wall/tiled_wall_2d_data.h | 4 ++-- 26 files changed, 37 insertions(+), 37 deletions(-) diff --git a/clutter/ground_clutter_2d_foliage.cpp b/clutter/ground_clutter_2d_foliage.cpp index 499bbb7..885ade6 100644 --- a/clutter/ground_clutter_2d_foliage.cpp +++ b/clutter/ground_clutter_2d_foliage.cpp @@ -33,7 +33,7 @@ Ref GroundClutter2DFoliage::get_texture(const int index) { void GroundClutter2DFoliage::remove_texture(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); } void GroundClutter2DFoliage::add_texture(Ref texture) { _textures.push_back(texture); diff --git a/jobs/prop_2d_texture_job.h b/jobs/prop_2d_texture_job.h index b1f6f6a..8e94def 100644 --- a/jobs/prop_2d_texture_job.h +++ b/jobs/prop_2d_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" diff --git a/lights/prop_2d_light.h b/lights/prop_2d_light.h index a7757df..c355f83 100644 --- a/lights/prop_2d_light.h +++ b/lights/prop_2d_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 diff --git a/material_cache/prop_2d_material_cache.cpp b/material_cache/prop_2d_material_cache.cpp index ff21a6d..ddbd5c8 100644 --- a/material_cache/prop_2d_material_cache.cpp +++ b/material_cache/prop_2d_material_cache.cpp @@ -108,7 +108,7 @@ void Prop2DMaterialCache::texture_remove(const Ref &texture) { void Prop2DMaterialCache::texture_remove_index(const int index) { ERR_FAIL_INDEX(index, _textures.size()); - _textures.remove(index); + _textures.remove_at(index); } void Prop2DMaterialCache::textures_clear() { _textures.clear(); diff --git a/material_cache/prop_2d_material_cache_pcm.cpp b/material_cache/prop_2d_material_cache_pcm.cpp index 4388bc0..022d2d1 100644 --- a/material_cache/prop_2d_material_cache_pcm.cpp +++ b/material_cache/prop_2d_material_cache_pcm.cpp @@ -156,7 +156,7 @@ void Prop2DMaterialCachePCM::_setup_material_albedo(Ref texture) { } Prop2DMaterialCachePCM::Prop2DMaterialCachePCM() { - _packer.instance(); + _packer.instantiate(); #if GODOT4 #warning implement diff --git a/prop_2d_instance_job.h b/prop_2d_instance_job.h index 13a6830..3c79a86 100644 --- a/prop_2d_instance_job.h +++ b/prop_2d_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_2d_instance_merger.cpp b/prop_2d_instance_merger.cpp index d36f61f..ff91fb9 100644 --- a/prop_2d_instance_merger.cpp +++ b/prop_2d_instance_merger.cpp @@ -420,7 +420,7 @@ void Prop2DInstanceMerger::_prop_preprocess(Transform2D 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; @@ -464,7 +464,7 @@ void Prop2DInstanceMerger::_prop_preprocess(Transform2D transform, const Ref light; - light.instance(); + light.instantiate(); Vector2 v = t.xform(Vector2()); diff --git a/prop_2d_instance_prop_job.cpp b/prop_2d_instance_prop_job.cpp index e7744c3..1752c08 100644 --- a/prop_2d_instance_prop_job.cpp +++ b/prop_2d_instance_prop_job.cpp @@ -521,7 +521,7 @@ Prop2DInstanceProp2DJob::Prop2DInstanceProp2DJob() { _prop_instace = NULL; //todo allocate this in a virtual method - _prop_mesher.instance(); + _prop_mesher.instantiate(); _prop_mesher->set_build_flags(Prop2DMesher::BUILD_FLAG_USE_LIGHTING | Prop2DMesher::BUILD_FLAG_USE_AO | Prop2DMesher::BUILD_FLAG_USE_RAO | Prop2DMesher::BUILD_FLAG_BAKE_LIGHTS); } diff --git a/prop_2d_mesher.cpp b/prop_2d_mesher.cpp index 59b9562..33ead7d 100644 --- a/prop_2d_mesher.cpp +++ b/prop_2d_mesher.cpp @@ -268,7 +268,7 @@ void Prop2DMesher::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) { @@ -317,7 +317,7 @@ void Prop2DMesher::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) { @@ -1129,7 +1129,7 @@ Prop2DMesher::Prop2DMesher() { _format = 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_2d_mesher.h b/prop_2d_mesher.h index faab152..cd3bc43 100644 --- a/prop_2d_mesher.h +++ b/prop_2d_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 diff --git a/props/prop_2d_data.cpp b/props/prop_2d_data.cpp index 7437ca5..eba44ee 100644 --- a/props/prop_2d_data.cpp +++ b/props/prop_2d_data.cpp @@ -58,7 +58,7 @@ void Prop2DData::add_prop(const Ref prop) { void Prop2DData::remove_prop(const int index) { ERR_FAIL_INDEX(index, _props.size()); - _props.remove(index); + _props.remove_at(index); } int Prop2DData::get_prop_count() const { @@ -162,7 +162,7 @@ void Prop2DData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_room_bounds"), &Prop2DData::get_room_bounds); ClassDB::bind_method(D_METHOD("set_room_bounds", "value"), &Prop2DData::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"), &Prop2DData::copy_from); } diff --git a/props/prop_2d_data.h b/props/prop_2d_data.h index f96486b..e0f4893 100644 --- a/props/prop_2d_data.h +++ b/props/prop_2d_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" @@ -74,8 +74,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); @@ -93,7 +93,7 @@ private: Vector> _props; bool _is_room; - PoolVector3Array _room_bounds; + PackedVector3Array _room_bounds; }; #endif diff --git a/props/prop_2d_data_entry.cpp b/props/prop_2d_data_entry.cpp index 42b5b63..39dbcd0 100644 --- a/props/prop_2d_data_entry.cpp +++ b/props/prop_2d_data_entry.cpp @@ -143,7 +143,7 @@ void Prop2DDataEntry::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { e = entry; } else { - e.instance(); + e.instantiate(); } e->set_transform_2d(transform * n->get_transform()); diff --git a/props/prop_2d_data_entry.h b/props/prop_2d_data_entry.h index 6b80d59..2808341 100644 --- a/props/prop_2d_data_entry.h +++ b/props/prop_2d_data_entry.h @@ -33,7 +33,7 @@ SOFTWARE. #define Transform Transform3D #endif #else -#include "core/math/transform.h" +#include "core/math/transform_3d.h" #include "core/math/transform_2d.h" #include "core/resource.h" #endif diff --git a/props/prop_2d_data_light.cpp b/props/prop_2d_data_light.cpp index ed5460c..427799e 100644 --- a/props/prop_2d_data_light.cpp +++ b/props/prop_2d_data_light.cpp @@ -84,7 +84,7 @@ void Prop2DDataLight::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { l = entry; } else { - l.instance(); + l.instantiate(); } l->set_light_color(i->get_color()); diff --git a/props/prop_2d_data_portal.cpp b/props/prop_2d_data_portal.cpp index 8d14f90..f70a317 100644 --- a/props/prop_2d_data_portal.cpp +++ b/props/prop_2d_data_portal.cpp @@ -77,7 +77,7 @@ void Prop2DDataPortal::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { l = entry; } else { - l.instance(); + l.instantiate(); } l->set_is_active(p->get_portal_active()); diff --git a/props/prop_2d_data_prop.cpp b/props/prop_2d_data_prop.cpp index 8108e95..69ff52b 100644 --- a/props/prop_2d_data_prop.cpp +++ b/props/prop_2d_data_prop.cpp @@ -56,7 +56,7 @@ void Prop2DDataProp2D::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { l = entry; } else { - l.instance(); + l.instantiate(); } l->set_prop(i->get_prop_data()); diff --git a/props/prop_2d_data_scene.cpp b/props/prop_2d_data_scene.cpp index d6a89ab..c5e6896 100644 --- a/props/prop_2d_data_scene.cpp +++ b/props/prop_2d_data_scene.cpp @@ -48,7 +48,7 @@ void Prop2DDataScene::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { l = entry; } else { - l.instance(); + l.instantiate(); } l->set_scene(i->get_scene()); diff --git a/props/prop_2d_data_sprite.cpp b/props/prop_2d_data_sprite.cpp index 69ef594..086794d 100644 --- a/props/prop_2d_data_sprite.cpp +++ b/props/prop_2d_data_sprite.cpp @@ -133,7 +133,7 @@ void Prop2DDataSprite::_processor_process(Ref prop_data, Node *node, if (entry.is_valid()) { l = entry; } else { - l.instance(); + l.instantiate(); } l->set_texture(s->get_texture()); diff --git a/props/prop_2d_data_tiled_wall_2d.cpp b/props/prop_2d_data_tiled_wall_2d.cpp index 23ef346..0d604c5 100644 --- a/props/prop_2d_data_tiled_wall_2d.cpp +++ b/props/prop_2d_data_tiled_wall_2d.cpp @@ -71,7 +71,7 @@ void Prop2DDataTiledWall2D::_processor_process(Ref prop_data, Node * if (entry.is_valid()) { tw = entry; } else { - tw.instance(); + tw.instantiate(); } tw->set_width(t->get_width()); diff --git a/singleton/prop_2d_cache.h b/singleton/prop_2d_cache.h index bbe110a..717ded9 100644 --- a/singleton/prop_2d_cache.h +++ b/singleton/prop_2d_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_2d_utils.cpp b/singleton/prop_2d_utils.cpp index 2440a84..c8a4bbf 100644 --- a/singleton/prop_2d_utils.cpp +++ b/singleton/prop_2d_utils.cpp @@ -61,7 +61,7 @@ Ref Prop2DUtils::convert_tree(Node *root) { #endif Ref data; - data.instance(); + data.instantiate(); Transform2D t; _convert_tree(data, root, t); diff --git a/singleton/prop_2d_utils.h b/singleton/prop_2d_utils.h index b246d6b..b8a0ad2 100644 --- a/singleton/prop_2d_utils.h +++ b/singleton/prop_2d_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_2d.cpp b/tiled_wall/tiled_wall_2d.cpp index 4eafd05..16dcbc2 100644 --- a/tiled_wall/tiled_wall_2d.cpp +++ b/tiled_wall/tiled_wall_2d.cpp @@ -267,7 +267,7 @@ TiledWall2D::TiledWall2D() { _width = 1; _height = 1; - _mesher.instance(); + _mesher.instantiate(); //_mesher->set_build_flags(Prop2DMesher::BUILD_FLAG_USE_LIGHTING | Prop2DMesher::BUILD_FLAG_USE_AO | Prop2DMesher::BUILD_FLAG_USE_RAO | Prop2DMesher::BUILD_FLAG_BAKE_LIGHTS); } TiledWall2D::~TiledWall2D() { diff --git a/tiled_wall/tiled_wall_2d_data.cpp b/tiled_wall/tiled_wall_2d_data.cpp index 3be4a2f..e7f386d 100644 --- a/tiled_wall/tiled_wall_2d_data.cpp +++ b/tiled_wall/tiled_wall_2d_data.cpp @@ -88,7 +88,7 @@ void TiledWall2DData::add_texture(const Ref &texture) { void TiledWall2DData::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 TiledWall2DData::add_flavour_texture(const Ref &texture) { void TiledWall2DData::remove_flavour_texture(const int index) { ERR_FAIL_INDEX(index, _flavour_textures.size()); - _flavour_textures.remove(index); + _flavour_textures.remove_at(index); emit_changed(); } @@ -298,7 +298,7 @@ void TiledWall2DData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_flavour_chance"), &TiledWall2DData::get_flavour_chance); ClassDB::bind_method(D_METHOD("set_flavour_chance", "texture"), &TiledWall2DData::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_get"), &TiledWall2DData::material_get); @@ -309,7 +309,7 @@ void TiledWall2DData::_bind_methods() { ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWall2DData::add_textures_into); #endif - BIND_VMETHOD(MethodInfo("_setup_cache", PropertyInfo(Variant::OBJECT, "cache", PROPERTY_HINT_RESOURCE_TYPE, "Prop2DMaterialCache"))); + //BIND_VMETHOD(MethodInfo("_setup_cache", PropertyInfo(Variant::OBJECT, "cache", PROPERTY_HINT_RESOURCE_TYPE, "Prop2DMaterialCache"))); ClassDB::bind_method(D_METHOD("setup_cache", "cache"), &TiledWall2DData::setup_cache); ClassDB::bind_method(D_METHOD("_setup_cache", "cache"), &TiledWall2DData::_setup_cache); diff --git a/tiled_wall/tiled_wall_2d_data.h b/tiled_wall/tiled_wall_2d_data.h index a9674a6..88a69f5 100644 --- a/tiled_wall/tiled_wall_2d_data.h +++ b/tiled_wall/tiled_wall_2d_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"