mirror of
https://github.com/Relintai/props.git
synced 2024-11-12 10:15:25 +01:00
Work on fixing compile.
This commit is contained in:
parent
a0ba4f2cab
commit
7ccb1b7819
@ -33,7 +33,7 @@ Ref<Texture> GroundClutterFoliage::get_texture(const int index) {
|
|||||||
void GroundClutterFoliage::remove_texture(const int index) {
|
void GroundClutterFoliage::remove_texture(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _textures.size());
|
ERR_FAIL_INDEX(index, _textures.size());
|
||||||
|
|
||||||
_textures.remove(index);
|
_textures.remove_at(index);
|
||||||
}
|
}
|
||||||
void GroundClutterFoliage::add_texture(Ref<Texture> texture) {
|
void GroundClutterFoliage::add_texture(Ref<Texture> texture) {
|
||||||
_textures.push_back(texture);
|
_textures.push_back(texture);
|
||||||
|
@ -26,7 +26,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/io/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#endif
|
#endif
|
||||||
@ -35,8 +35,8 @@ SOFTWARE.
|
|||||||
#include "../../mesh_utils/fast_quadratic_mesh_simplifier.h"
|
#include "../../mesh_utils/fast_quadratic_mesh_simplifier.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class PropMesherJobStep : public Reference {
|
class PropMesherJobStep : public RefCounted {
|
||||||
GDCLASS(PropMesherJobStep, Reference);
|
GDCLASS(PropMesherJobStep, RefCounted);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//todo add:
|
//todo add:
|
||||||
|
@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#define Texture Texture2D
|
#define Texture Texture2D
|
||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
@ -46,8 +46,8 @@ class TexturePacker;
|
|||||||
class PropTextureJob : public ThreadPoolJob {
|
class PropTextureJob : public ThreadPoolJob {
|
||||||
GDCLASS(PropTextureJob, ThreadPoolJob);
|
GDCLASS(PropTextureJob, ThreadPoolJob);
|
||||||
#else
|
#else
|
||||||
class PropTextureJob : public Reference {
|
class PropTextureJob : public RefCounted {
|
||||||
GDCLASS(PropTextureJob, Reference);
|
GDCLASS(PropTextureJob, RefCounted);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -26,7 +26,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#include "core/templates/vector.h"
|
#include "core/templates/vector.h"
|
||||||
#include "core/math/color.h"
|
#include "core/math/color.h"
|
||||||
#else
|
#else
|
||||||
@ -35,8 +35,8 @@ SOFTWARE.
|
|||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class PropLight : public Reference {
|
class PropLight : public RefCounted {
|
||||||
GDCLASS(PropLight, Reference);
|
GDCLASS(PropLight, RefCounted);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Vector3 get_position();
|
Vector3 get_position();
|
||||||
|
@ -118,7 +118,7 @@ void PropMaterialCache::material_set(const int index, const Ref<Material> &value
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PropMaterialCache::material_remove(const int index) {
|
void PropMaterialCache::material_remove(const int index) {
|
||||||
_materials.remove(index);
|
_materials.remove_at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PropMaterialCache::material_get_num() const {
|
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) {
|
void PropMaterialCache::texture_remove(const Ref<Texture> &texture) {
|
||||||
for (int i = 0; i < _textures.size(); ++i) {
|
for (int i = 0; i < _textures.size(); ++i) {
|
||||||
if (_textures[i] == texture) {
|
if (_textures[i] == texture) {
|
||||||
_textures.remove(i);
|
_textures.remove_at(i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ void PropMaterialCache::texture_remove(const Ref<Texture> &texture) {
|
|||||||
void PropMaterialCache::texture_remove_index(const int index) {
|
void PropMaterialCache::texture_remove_index(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _textures.size());
|
ERR_FAIL_INDEX(index, _textures.size());
|
||||||
|
|
||||||
_textures.remove(index);
|
_textures.remove_at(index);
|
||||||
}
|
}
|
||||||
void PropMaterialCache::textures_clear() {
|
void PropMaterialCache::textures_clear() {
|
||||||
_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("inc_ref_count"), &PropMaterialCache::inc_ref_count);
|
||||||
ClassDB::bind_method(D_METHOD("dec_ref_count"), &PropMaterialCache::dec_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_get", "index"), &PropMaterialCache::material_get);
|
||||||
ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &PropMaterialCache::material_lod_get);
|
ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &PropMaterialCache::material_lod_get);
|
||||||
|
@ -163,7 +163,7 @@ void PropMaterialCachePCM::_setup_material_albedo(Ref<Texture> texture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PropMaterialCachePCM::PropMaterialCachePCM() {
|
PropMaterialCachePCM::PropMaterialCachePCM() {
|
||||||
_packer.instance();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
#if GODOT4
|
||||||
#warning implement
|
#warning implement
|
||||||
|
@ -32,7 +32,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#define Texture Texture2D
|
#define Texture Texture2D
|
||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
|
@ -624,7 +624,7 @@ void PropInstanceMerger::_prop_preprocess(Transform transform, const Ref<PropDat
|
|||||||
|
|
||||||
if (tiled_wall_data->get_collision()) {
|
if (tiled_wall_data->get_collision()) {
|
||||||
Ref<BoxShape> tws;
|
Ref<BoxShape> tws;
|
||||||
tws.instance();
|
tws.instantiate();
|
||||||
|
|
||||||
float hew = tiled_wall_data->get_width() / 2.0;
|
float hew = tiled_wall_data->get_width() / 2.0;
|
||||||
float heh = tiled_wall_data->get_heigth() / 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()) {
|
if (light_data.is_valid()) {
|
||||||
Ref<PropLight> light;
|
Ref<PropLight> light;
|
||||||
light.instance();
|
light.instantiate();
|
||||||
|
|
||||||
Vector3 v = t.xform(Vector3());
|
Vector3 v = t.xform(Vector3());
|
||||||
|
|
||||||
@ -725,15 +725,15 @@ void PropInstanceMerger::_create_job() {
|
|||||||
|
|
||||||
Ref<PropMesherJobStep> js;
|
Ref<PropMesherJobStep> js;
|
||||||
|
|
||||||
js.instance();
|
js.instantiate();
|
||||||
js->set_job_type(PropMesherJobStep::TYPE_NORMAL);
|
js->set_job_type(PropMesherJobStep::TYPE_NORMAL);
|
||||||
_job->add_jobs_step(js);
|
_job->add_jobs_step(js);
|
||||||
|
|
||||||
js.instance();
|
js.instantiate();
|
||||||
js->set_job_type(PropMesherJobStep::TYPE_MERGE_VERTS);
|
js->set_job_type(PropMesherJobStep::TYPE_MERGE_VERTS);
|
||||||
_job->add_jobs_step(js);
|
_job->add_jobs_step(js);
|
||||||
|
|
||||||
js.instance();
|
js.instantiate();
|
||||||
js->set_job_type(PropMesherJobStep::TYPE_BAKE_TEXTURE);
|
js->set_job_type(PropMesherJobStep::TYPE_BAKE_TEXTURE);
|
||||||
_job->add_jobs_step(js);
|
_job->add_jobs_step(js);
|
||||||
}
|
}
|
||||||
|
@ -533,13 +533,13 @@ void PropInstancePropJob::step_type_merge_verts() {
|
|||||||
|
|
||||||
void PropInstancePropJob::step_type_bake_texture() {
|
void PropInstancePropJob::step_type_bake_texture() {
|
||||||
Ref<ShaderMaterial> mat = _material_cache->material_lod_get(0);
|
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;
|
Ref<Texture> tex;
|
||||||
|
|
||||||
if (mat.is_valid()) {
|
if (mat.is_valid()) {
|
||||||
tex = mat->get_shader_param("texture_albedo");
|
tex = mat->get_shader_param("texture_albedo");
|
||||||
} else if (spmat.is_valid()) {
|
} else if (spmat.is_valid()) {
|
||||||
tex = spmat->get_texture(SpatialMaterial::TEXTURE_ALBEDO);
|
tex = spmat->get_texture(StandardMaterial3D::TEXTURE_ALBEDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tex.is_valid()) {
|
if (tex.is_valid()) {
|
||||||
@ -725,7 +725,7 @@ PropInstancePropJob::PropInstancePropJob() {
|
|||||||
_current_job_step = 0;
|
_current_job_step = 0;
|
||||||
|
|
||||||
//todo allocate this in a virtual method
|
//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);
|
_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ void PropMesher::remove_doubles() {
|
|||||||
for (int j = 0; j < indices.size(); ++j) {
|
for (int j = 0; j < indices.size(); ++j) {
|
||||||
int index = indices[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
|
//make all indices that were bigger than the one we replaced one lower
|
||||||
for (int k = 0; k < _indices.size(); ++k) {
|
for (int k = 0; k < _indices.size(); ++k) {
|
||||||
@ -427,7 +427,7 @@ void PropMesher::remove_doubles_hashed() {
|
|||||||
int index = indices[j];
|
int index = indices[j];
|
||||||
|
|
||||||
hashes.remove(index);
|
hashes.remove(index);
|
||||||
_vertices.remove(index);
|
_vertices.remove_at(index);
|
||||||
|
|
||||||
//make all indices that were bigger than the one we replaced one lower
|
//make all indices that were bigger than the one we replaced one lower
|
||||||
for (int k = 0; k < _indices.size(); ++k) {
|
for (int k = 0; k < _indices.size(); ++k) {
|
||||||
@ -1303,7 +1303,7 @@ PropMesher::PropMesher() {
|
|||||||
|
|
||||||
_format = VisualServer::ARRAY_FORMAT_NORMAL | VisualServer::ARRAY_FORMAT_TEX_UV;
|
_format = VisualServer::ARRAY_FORMAT_NORMAL | VisualServer::ARRAY_FORMAT_TEX_UV;
|
||||||
|
|
||||||
_noise.instance();
|
_noise.instantiate();
|
||||||
//todo add properties for these if needed
|
//todo add properties for these if needed
|
||||||
_noise->set_octaves(4);
|
_noise->set_octaves(4);
|
||||||
_noise->set_period(30);
|
_noise->set_period(30);
|
||||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/math/color.h"
|
#include "core/math/color.h"
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#include "core/templates/vector.h"
|
#include "core/templates/vector.h"
|
||||||
|
|
||||||
template <class N>
|
template <class N>
|
||||||
@ -65,8 +65,8 @@ class PropLight;
|
|||||||
class PropMaterialCache;
|
class PropMaterialCache;
|
||||||
class TiledWallData;
|
class TiledWallData;
|
||||||
|
|
||||||
class PropMesher : public Reference {
|
class PropMesher : public RefCounted {
|
||||||
GDCLASS(PropMesher, Reference);
|
GDCLASS(PropMesher, RefCounted);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const String BINDING_STRING_BUILD_FLAGS;
|
static const String BINDING_STRING_BUILD_FLAGS;
|
||||||
|
@ -71,7 +71,7 @@ void PropData::add_prop(const Ref<PropDataEntry> prop) {
|
|||||||
void PropData::remove_prop(const int index) {
|
void PropData::remove_prop(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _props.size());
|
ERR_FAIL_INDEX(index, _props.size());
|
||||||
|
|
||||||
_props.remove(index);
|
_props.remove_at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PropData::get_prop_count() const {
|
int PropData::get_prop_count() const {
|
||||||
@ -119,10 +119,10 @@ void PropData::set_is_room(const bool value) {
|
|||||||
_is_room = value;
|
_is_room = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
PoolVector3Array PropData::get_room_bounds() {
|
PackedVector3Array PropData::get_room_bounds() {
|
||||||
return _room_bounds;
|
return _room_bounds;
|
||||||
}
|
}
|
||||||
void PropData::set_room_bounds(const PoolVector3Array &bounds) {
|
void PropData::set_room_bounds(const PackedVector3Array &bounds) {
|
||||||
_room_bounds = 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("get_room_bounds"), &PropData::get_room_bounds);
|
||||||
ClassDB::bind_method(D_METHOD("set_room_bounds", "value"), &PropData::set_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);
|
ClassDB::bind_method(D_METHOD("copy_from", "prop_data"), &PropData::copy_from);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ SOFTWARE.
|
|||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
#include "core/math/transform.h"
|
#include "core/math/transform_3d.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
@ -80,8 +80,8 @@ public:
|
|||||||
bool get_is_room() const;
|
bool get_is_room() const;
|
||||||
void set_is_room(const bool value);
|
void set_is_room(const bool value);
|
||||||
|
|
||||||
PoolVector3Array get_room_bounds();
|
PackedVector3Array get_room_bounds();
|
||||||
void set_room_bounds(const PoolVector3Array &bounds);
|
void set_room_bounds(const PackedVector3Array &bounds);
|
||||||
|
|
||||||
void copy_from(const Ref<PropData> &prop_data);
|
void copy_from(const Ref<PropData> &prop_data);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ private:
|
|||||||
Vector<Ref<PropDataEntry>> _props;
|
Vector<Ref<PropDataEntry>> _props;
|
||||||
|
|
||||||
bool _is_room;
|
bool _is_room;
|
||||||
PoolVector3Array _room_bounds;
|
PackedVector3Array _room_bounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,7 +34,7 @@ SOFTWARE.
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#include "core/resource.h"
|
#include "core/resource.h"
|
||||||
#include "core/math/transform.h"
|
#include "core/math/transform_3d.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class PropData;
|
class PropData;
|
||||||
|
@ -58,7 +58,7 @@ void PropDataLight::_processor_process(Ref<PropData> prop_data, Node *node, cons
|
|||||||
ERR_FAIL_COND(!i);
|
ERR_FAIL_COND(!i);
|
||||||
|
|
||||||
Ref<PropDataLight> l;
|
Ref<PropDataLight> l;
|
||||||
l.instance();
|
l.instantiate();
|
||||||
l->set_light_color(i->get_color());
|
l->set_light_color(i->get_color());
|
||||||
l->set_light_size(i->get_param(Light::PARAM_RANGE));
|
l->set_light_size(i->get_param(Light::PARAM_RANGE));
|
||||||
l->set_transform(transform * i->get_transform());
|
l->set_transform(transform * i->get_transform());
|
||||||
|
@ -73,7 +73,7 @@ void PropDataPortal::_processor_process(Ref<PropData> prop_data, Node *node, con
|
|||||||
ERR_FAIL_COND(!p);
|
ERR_FAIL_COND(!p);
|
||||||
|
|
||||||
Ref<PropDataPortal> l;
|
Ref<PropDataPortal> l;
|
||||||
l.instance();
|
l.instantiate();
|
||||||
l->set_is_active(p->get_portal_active());
|
l->set_is_active(p->get_portal_active());
|
||||||
l->set_is_two_way(p->is_two_way());
|
l->set_is_two_way(p->is_two_way());
|
||||||
l->set_use_default_margin(p->get_use_default_margin());
|
l->set_use_default_margin(p->get_use_default_margin());
|
||||||
|
@ -66,7 +66,7 @@ void PropDataProp::_processor_process(Ref<PropData> prop_data, Node *node, const
|
|||||||
ERR_FAIL_COND(!i);
|
ERR_FAIL_COND(!i);
|
||||||
|
|
||||||
Ref<PropDataProp> l;
|
Ref<PropDataProp> l;
|
||||||
l.instance();
|
l.instantiate();
|
||||||
l->set_prop(i->get_prop_data());
|
l->set_prop(i->get_prop_data());
|
||||||
l->set_transform(transform * i->get_transform());
|
l->set_transform(transform * i->get_transform());
|
||||||
prop_data->add_prop(l);
|
prop_data->add_prop(l);
|
||||||
|
@ -58,7 +58,7 @@ void PropDataScene::_processor_process(Ref<PropData> prop_data, Node *node, cons
|
|||||||
ERR_FAIL_COND(!i);
|
ERR_FAIL_COND(!i);
|
||||||
|
|
||||||
Ref<PropDataScene> l;
|
Ref<PropDataScene> l;
|
||||||
l.instance();
|
l.instantiate();
|
||||||
l->set_scene(i->get_scene());
|
l->set_scene(i->get_scene());
|
||||||
l->set_transform(transform * i->get_transform());
|
l->set_transform(transform * i->get_transform());
|
||||||
prop_data->add_prop(l);
|
prop_data->add_prop(l);
|
||||||
|
@ -67,7 +67,7 @@ void PropDataTiledWall::_processor_process(Ref<PropData> prop_data, Node *node,
|
|||||||
ERR_FAIL_COND(!t);
|
ERR_FAIL_COND(!t);
|
||||||
|
|
||||||
Ref<PropDataTiledWall> tw;
|
Ref<PropDataTiledWall> tw;
|
||||||
tw.instance();
|
tw.instantiate();
|
||||||
|
|
||||||
tw->set_width(t->get_width());
|
tw->set_width(t->get_width());
|
||||||
tw->set_heigth(t->get_heigth());
|
tw->set_heigth(t->get_heigth());
|
||||||
|
@ -142,7 +142,7 @@ void PropCache::material_set(const int index, const Ref<Material> &value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PropCache::material_remove(const int index) {
|
void PropCache::material_remove(const int index) {
|
||||||
_materials.remove(index);
|
_materials.remove_at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PropCache::material_get_num() const {
|
int PropCache::material_get_num() const {
|
||||||
|
@ -29,7 +29,7 @@ SOFTWARE.
|
|||||||
#include "core/core_bind.h"
|
#include "core/core_bind.h"
|
||||||
#include "core/math/color.h"
|
#include "core/math/color.h"
|
||||||
#include "core/object/object.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/hash_map.h"
|
||||||
#include "core/templates/vector.h"
|
#include "core/templates/vector.h"
|
||||||
#else
|
#else
|
||||||
|
@ -59,7 +59,7 @@ Ref<PropData> PropUtils::convert_tree(Node *root) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Ref<PropData> data;
|
Ref<PropData> data;
|
||||||
data.instance();
|
data.instantiate();
|
||||||
Transform t;
|
Transform t;
|
||||||
|
|
||||||
_convert_tree(data, root, t);
|
_convert_tree(data, root, t);
|
||||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/object.h"
|
#include "core/object/object.h"
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#include "core/templates/vector.h"
|
#include "core/templates/vector.h"
|
||||||
#include "scene/3d/node_3d.h"
|
#include "scene/3d/node_3d.h"
|
||||||
#else
|
#else
|
||||||
|
@ -294,7 +294,7 @@ TiledWall::TiledWall() {
|
|||||||
set_portal_mode(PORTAL_MODE_GLOBAL);
|
set_portal_mode(PORTAL_MODE_GLOBAL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_mesher.instance();
|
_mesher.instantiate();
|
||||||
}
|
}
|
||||||
TiledWall::~TiledWall() {
|
TiledWall::~TiledWall() {
|
||||||
_data.unref();
|
_data.unref();
|
||||||
|
@ -29,7 +29,7 @@ SOFTWARE.
|
|||||||
#if VERSION_MAJOR < 4
|
#if VERSION_MAJOR < 4
|
||||||
#include "scene/3d/visual_instance.h"
|
#include "scene/3d/visual_instance.h"
|
||||||
#else
|
#else
|
||||||
#include "scene/3d/node_3d.h"
|
#include "scene/3d/visual_instance_3d.h"
|
||||||
|
|
||||||
#define SpatialMaterial StandardMaterial3D
|
#define SpatialMaterial StandardMaterial3D
|
||||||
#define Spatial Node3D
|
#define Spatial Node3D
|
||||||
@ -42,8 +42,8 @@ class TiledWallData;
|
|||||||
class PropMaterialCache;
|
class PropMaterialCache;
|
||||||
class PropMesher;
|
class PropMesher;
|
||||||
|
|
||||||
class TiledWall : public GeometryInstance {
|
class TiledWall : public GeometryInstance3D {
|
||||||
GDCLASS(TiledWall, GeometryInstance);
|
GDCLASS(TiledWall, GeometryInstance3D);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int get_width() const;
|
int get_width() const;
|
||||||
|
@ -44,7 +44,7 @@ SOFTWARE.
|
|||||||
#define VARIANT_ARRAY_GET(arr) \
|
#define VARIANT_ARRAY_GET(arr) \
|
||||||
Vector<Variant> r; \
|
Vector<Variant> r; \
|
||||||
for (int i = 0; i < arr.size(); i++) { \
|
for (int i = 0; i < arr.size(); i++) { \
|
||||||
r.push_back(arr[i].get_ref_ptr()); \
|
r.push_back(arr[i]); \
|
||||||
} \
|
} \
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ void TiledWallData::add_texture(const Ref<Texture> &texture) {
|
|||||||
void TiledWallData::remove_texture(const int index) {
|
void TiledWallData::remove_texture(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _textures.size());
|
ERR_FAIL_INDEX(index, _textures.size());
|
||||||
|
|
||||||
_textures.remove(index);
|
_textures.remove_at(index);
|
||||||
|
|
||||||
emit_changed();
|
emit_changed();
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ void TiledWallData::add_flavour_texture(const Ref<Texture> &texture) {
|
|||||||
void TiledWallData::remove_flavour_texture(const int index) {
|
void TiledWallData::remove_flavour_texture(const int index) {
|
||||||
ERR_FAIL_INDEX(index, _flavour_textures.size());
|
ERR_FAIL_INDEX(index, _flavour_textures.size());
|
||||||
|
|
||||||
_flavour_textures.remove(index);
|
_flavour_textures.remove_at(index);
|
||||||
|
|
||||||
emit_changed();
|
emit_changed();
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ void TiledWallData::material_set(const int index, const Ref<Material> &value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TiledWallData::material_remove(const int index) {
|
void TiledWallData::material_remove(const int index) {
|
||||||
_materials.remove(index);
|
_materials.remove_at(index);
|
||||||
|
|
||||||
emit_changed();
|
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("get_flavour_chance"), &TiledWallData::get_flavour_chance);
|
||||||
ClassDB::bind_method(D_METHOD("set_flavour_chance", "texture"), &TiledWallData::set_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
|
//materials
|
||||||
ClassDB::bind_method(D_METHOD("material_add", "value"), &TiledWallData::material_add);
|
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);
|
ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &TiledWallData::add_textures_into);
|
||||||
#endif
|
#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);
|
||||||
ClassDB::bind_method(D_METHOD("_setup_cache", "cache"), &TiledWallData::_setup_cache);
|
ClassDB::bind_method(D_METHOD("_setup_cache", "cache"), &TiledWallData::_setup_cache);
|
||||||
|
@ -26,7 +26,7 @@ SOFTWARE.
|
|||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/object/reference.h"
|
#include "core/object/ref_counted.h"
|
||||||
#include "core/templates/vector.h"
|
#include "core/templates/vector.h"
|
||||||
#else
|
#else
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
@ -34,7 +34,7 @@ SOFTWARE.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
#include "core/math/transform.h"
|
#include "core/math/transform_3d.h"
|
||||||
#include "core/math/vector2.h"
|
#include "core/math/vector2.h"
|
||||||
#include "core/math/vector3.h"
|
#include "core/math/vector3.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user