Work on fixing compile.

This commit is contained in:
Relintai 2023-01-09 01:16:33 +01:00
parent a0ba4f2cab
commit 7ccb1b7819
27 changed files with 60 additions and 60 deletions

View File

@ -33,7 +33,7 @@ Ref<Texture> 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> texture) {
_textures.push_back(texture);

View File

@ -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:

View File

@ -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:

View File

@ -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();

View File

@ -118,7 +118,7 @@ void PropMaterialCache::material_set(const int index, const Ref<Material> &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> &texture) {
void PropMaterialCache::texture_remove(const Ref<Texture> &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> &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);

View File

@ -163,7 +163,7 @@ void PropMaterialCachePCM::_setup_material_albedo(Ref<Texture> texture) {
}
PropMaterialCachePCM::PropMaterialCachePCM() {
_packer.instance();
_packer.instantiate();
#if GODOT4
#warning implement

View File

@ -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"

View File

@ -624,7 +624,7 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Ref<PropDat
if (tiled_wall_data->get_collision()) {
Ref<BoxShape> 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<PropDat
if (light_data.is_valid()) {
Ref<PropLight> light;
light.instance();
light.instantiate();
Vector3 v = t.xform(Vector3());
@ -725,15 +725,15 @@ void PropInstanceMerger::_create_job() {
Ref<PropMesherJobStep> 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);
}

View File

@ -533,13 +533,13 @@ void PropInstancePropJob::step_type_merge_verts() {
void PropInstancePropJob::step_type_bake_texture() {
Ref<ShaderMaterial> mat = _material_cache->material_lod_get(0);
Ref<SpatialMaterial> spmat = _material_cache->material_lod_get(0);
Ref<StandardMaterial3D> spmat = _material_cache->material_lod_get(0);
Ref<Texture> 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);
}

View File

@ -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);

View File

@ -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 <class N>
@ -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;

View File

@ -71,7 +71,7 @@ void PropData::add_prop(const Ref<PropDataEntry> 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);
}

View File

@ -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<PropData> &prop_data);
@ -99,7 +99,7 @@ private:
Vector<Ref<PropDataEntry>> _props;
bool _is_room;
PoolVector3Array _room_bounds;
PackedVector3Array _room_bounds;
};
#endif

View File

@ -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;

View File

@ -58,7 +58,7 @@ void PropDataLight::_processor_process(Ref<PropData> prop_data, Node *node, cons
ERR_FAIL_COND(!i);
Ref<PropDataLight> 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());

View File

@ -73,7 +73,7 @@ void PropDataPortal::_processor_process(Ref<PropData> prop_data, Node *node, con
ERR_FAIL_COND(!p);
Ref<PropDataPortal> 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());

View File

@ -66,7 +66,7 @@ void PropDataProp::_processor_process(Ref<PropData> prop_data, Node *node, const
ERR_FAIL_COND(!i);
Ref<PropDataProp> l;
l.instance();
l.instantiate();
l->set_prop(i->get_prop_data());
l->set_transform(transform * i->get_transform());
prop_data->add_prop(l);

View File

@ -58,7 +58,7 @@ void PropDataScene::_processor_process(Ref<PropData> prop_data, Node *node, cons
ERR_FAIL_COND(!i);
Ref<PropDataScene> l;
l.instance();
l.instantiate();
l->set_scene(i->get_scene());
l->set_transform(transform * i->get_transform());
prop_data->add_prop(l);

View File

@ -67,7 +67,7 @@ void PropDataTiledWall::_processor_process(Ref<PropData> prop_data, Node *node,
ERR_FAIL_COND(!t);
Ref<PropDataTiledWall> tw;
tw.instance();
tw.instantiate();
tw->set_width(t->get_width());
tw->set_heigth(t->get_heigth());

View File

@ -142,7 +142,7 @@ void PropCache::material_set(const int index, const Ref<Material> &value) {
}
void PropCache::material_remove(const int index) {
_materials.remove(index);
_materials.remove_at(index);
}
int PropCache::material_get_num() const {

View File

@ -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

View File

@ -59,7 +59,7 @@ Ref<PropData> PropUtils::convert_tree(Node *root) {
#endif
Ref<PropData> data;
data.instance();
data.instantiate();
Transform t;
_convert_tree(data, root, t);

View File

@ -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

View File

@ -294,7 +294,7 @@ TiledWall::TiledWall() {
set_portal_mode(PORTAL_MODE_GLOBAL);
#endif
_mesher.instance();
_mesher.instantiate();
}
TiledWall::~TiledWall() {
_data.unref();

View File

@ -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;

View File

@ -44,7 +44,7 @@ SOFTWARE.
#define VARIANT_ARRAY_GET(arr) \
Vector<Variant> 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> &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> &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<Material> &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);

View File

@ -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"