mirror of
https://github.com/Relintai/terraman.git
synced 2025-04-23 21:43:23 +02:00
Renamed voxel_surface methods / properties to terra_surface.
This commit is contained in:
parent
29c68e5fb0
commit
aaeca66f80
@ -343,37 +343,37 @@
|
|||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surface_add">
|
<method name="terra_surface_add">
|
||||||
<return type="void" />
|
<return type="void" />
|
||||||
<argument index="0" name="value" type="TerrainSurface" />
|
<argument index="0" name="value" type="TerrainSurface" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surface_get">
|
<method name="terra_surface_get">
|
||||||
<return type="TerrainSurface" />
|
<return type="TerrainSurface" />
|
||||||
<argument index="0" name="index" type="int" />
|
<argument index="0" name="index" type="int" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surface_get_num" qualifiers="const">
|
<method name="terra_surface_get_num" qualifiers="const">
|
||||||
<return type="int" />
|
<return type="int" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surface_remove">
|
<method name="terra_surface_remove">
|
||||||
<return type="void" />
|
<return type="void" />
|
||||||
<argument index="0" name="index" type="int" />
|
<argument index="0" name="index" type="int" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surface_set">
|
<method name="terra_surface_set">
|
||||||
<return type="void" />
|
<return type="void" />
|
||||||
<argument index="0" name="index" type="int" />
|
<argument index="0" name="index" type="int" />
|
||||||
<argument index="1" name="surface" type="TerrainSurface" />
|
<argument index="1" name="surface" type="TerrainSurface" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="voxel_surfaces_clear">
|
<method name="terra_surfaces_clear">
|
||||||
<return type="void" />
|
<return type="void" />
|
||||||
<description>
|
<description>
|
||||||
</description>
|
</description>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="texture_flags" type="int" setter="set_texture_flags" getter="get_texture_flags" default="5">
|
<member name="texture_flags" type="int" setter="set_texture_flags" getter="get_texture_flags" default="5">
|
||||||
</member>
|
</member>
|
||||||
<member name="voxel_surfaces" type="Array" setter="set_voxel_surfaces" getter="get_voxel_surfaces" default="[ ]">
|
<member name="terra_surfaces" type="Array" setter="set_terra_surfaces" getter="get_terra_surfaces" default="[ ]">
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="texture_flags" type="int" setter="set_texture_flags" getter="get_texture_flags" default="5">
|
<member name="texture_flags" type="int" setter="set_texture_flags" getter="get_texture_flags" default="5">
|
||||||
</member>
|
</member>
|
||||||
<member name="voxel_surfaces" type="Array" setter="set_voxel_surfaces" getter="get_voxel_surfaces" default="[ ]">
|
<member name="terra_surfaces" type="Array" setter="set_terra_surfaces" getter="get_terra_surfaces" default="[ ]">
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="atlas_rows" type="int" setter="set_atlas_rows" getter="get_atlas_rows" default="8">
|
<member name="atlas_rows" type="int" setter="set_atlas_rows" getter="get_atlas_rows" default="8">
|
||||||
</member>
|
</member>
|
||||||
<member name="voxel_surfaces" type="Array" setter="set_voxel_surfaces" getter="get_voxel_surfaces" default="[ ]">
|
<member name="terra_surfaces" type="Array" setter="set_terra_surfaces" getter="get_terra_surfaces" default="[ ]">
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
@ -394,19 +394,19 @@ void TerrainLibrary::prop_materials_set(const Vector<Variant> &materials) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Surfaces
|
//Surfaces
|
||||||
Ref<TerrainSurface> TerrainLibrary::voxel_surface_get(const int index) {
|
Ref<TerrainSurface> TerrainLibrary::terra_surface_get(const int index) {
|
||||||
return Ref<TerrainSurface>();
|
return Ref<TerrainSurface>();
|
||||||
}
|
}
|
||||||
void TerrainLibrary::voxel_surface_add(Ref<TerrainSurface> value) {
|
void TerrainLibrary::terra_surface_add(Ref<TerrainSurface> value) {
|
||||||
}
|
}
|
||||||
void TerrainLibrary::voxel_surface_set(int index, Ref<TerrainSurface> value) {
|
void TerrainLibrary::terra_surface_set(int index, Ref<TerrainSurface> value) {
|
||||||
}
|
}
|
||||||
void TerrainLibrary::voxel_surface_remove(const int index) {
|
void TerrainLibrary::terra_surface_remove(const int index) {
|
||||||
}
|
}
|
||||||
int TerrainLibrary::voxel_surface_get_num() const {
|
int TerrainLibrary::terra_surface_get_num() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void TerrainLibrary::voxel_surfaces_clear() {
|
void TerrainLibrary::terra_surfaces_clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<PackedScene> TerrainLibrary::scene_get(const int id) {
|
Ref<PackedScene> TerrainLibrary::scene_get(const int id) {
|
||||||
@ -593,12 +593,12 @@ void TerrainLibrary::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("prop_materials_set"), &TerrainLibrary::prop_materials_set);
|
ClassDB::bind_method(D_METHOD("prop_materials_set"), &TerrainLibrary::prop_materials_set);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "prop_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "prop_materials_set", "prop_materials_get");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surface_get", "index"), &TerrainLibrary::voxel_surface_get);
|
ClassDB::bind_method(D_METHOD("terra_surface_get", "index"), &TerrainLibrary::terra_surface_get);
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surface_add", "value"), &TerrainLibrary::voxel_surface_add);
|
ClassDB::bind_method(D_METHOD("terra_surface_add", "value"), &TerrainLibrary::terra_surface_add);
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surface_set", "index", "surface"), &TerrainLibrary::voxel_surface_set);
|
ClassDB::bind_method(D_METHOD("terra_surface_set", "index", "surface"), &TerrainLibrary::terra_surface_set);
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surface_remove", "index"), &TerrainLibrary::voxel_surface_remove);
|
ClassDB::bind_method(D_METHOD("terra_surface_remove", "index"), &TerrainLibrary::terra_surface_remove);
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surface_get_num"), &TerrainLibrary::voxel_surface_get_num);
|
ClassDB::bind_method(D_METHOD("terra_surface_get_num"), &TerrainLibrary::terra_surface_get_num);
|
||||||
ClassDB::bind_method(D_METHOD("voxel_surfaces_clear"), &TerrainLibrary::voxel_surfaces_clear);
|
ClassDB::bind_method(D_METHOD("terra_surfaces_clear"), &TerrainLibrary::terra_surfaces_clear);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("scene_get", "index"), &TerrainLibrary::scene_get);
|
ClassDB::bind_method(D_METHOD("scene_get", "index"), &TerrainLibrary::scene_get);
|
||||||
ClassDB::bind_method(D_METHOD("scene_add", "value"), &TerrainLibrary::scene_add);
|
ClassDB::bind_method(D_METHOD("scene_add", "value"), &TerrainLibrary::scene_add);
|
||||||
|
@ -145,12 +145,12 @@ public:
|
|||||||
Vector<Variant> prop_materials_get();
|
Vector<Variant> prop_materials_get();
|
||||||
void prop_materials_set(const Vector<Variant> &materials);
|
void prop_materials_set(const Vector<Variant> &materials);
|
||||||
|
|
||||||
virtual Ref<TerrainSurface> voxel_surface_get(const int index);
|
virtual Ref<TerrainSurface> terra_surface_get(const int index);
|
||||||
virtual void voxel_surface_add(Ref<TerrainSurface> value);
|
virtual void terra_surface_add(Ref<TerrainSurface> value);
|
||||||
virtual void voxel_surface_set(const int index, Ref<TerrainSurface> value);
|
virtual void terra_surface_set(const int index, Ref<TerrainSurface> value);
|
||||||
virtual void voxel_surface_remove(const int index);
|
virtual void terra_surface_remove(const int index);
|
||||||
virtual int voxel_surface_get_num() const;
|
virtual int terra_surface_get_num() const;
|
||||||
virtual void voxel_surfaces_clear();
|
virtual void terra_surfaces_clear();
|
||||||
|
|
||||||
virtual Ref<PackedScene> scene_get(const int id);
|
virtual Ref<PackedScene> scene_get(const int id);
|
||||||
virtual void scene_add(Ref<PackedScene> value);
|
virtual void scene_add(Ref<PackedScene> value);
|
||||||
|
@ -78,67 +78,67 @@ void TerrainLibraryMerger::set_margin(const int margin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Surfaces
|
//Surfaces
|
||||||
Ref<TerrainSurface> TerrainLibraryMerger::voxel_surface_get(const int index) {
|
Ref<TerrainSurface> TerrainLibraryMerger::terra_surface_get(const int index) {
|
||||||
ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref<TerrainSurface>(NULL));
|
ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref<TerrainSurface>(NULL));
|
||||||
|
|
||||||
return _voxel_surfaces[index];
|
return _terra_surfaces[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMerger::voxel_surface_add(Ref<TerrainSurface> value) {
|
void TerrainLibraryMerger::terra_surface_add(Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(!value.is_valid());
|
ERR_FAIL_COND(!value.is_valid());
|
||||||
|
|
||||||
value->set_library(Ref<TerrainLibraryMerger>(this));
|
value->set_library(Ref<TerrainLibraryMerger>(this));
|
||||||
value->set_id(_voxel_surfaces.size());
|
value->set_id(_terra_surfaces.size());
|
||||||
|
|
||||||
_voxel_surfaces.push_back(value);
|
_terra_surfaces.push_back(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMerger::voxel_surface_set(const int index, Ref<TerrainSurface> value) {
|
void TerrainLibraryMerger::terra_surface_set(const int index, Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(index < 0);
|
ERR_FAIL_COND(index < 0);
|
||||||
|
|
||||||
if (_voxel_surfaces.size() < index) {
|
if (_terra_surfaces.size() < index) {
|
||||||
_voxel_surfaces.resize(index + 1);
|
_terra_surfaces.resize(index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_voxel_surfaces[index].is_valid()) {
|
if (_terra_surfaces[index].is_valid()) {
|
||||||
_voxel_surfaces.get(index)->set_library(Ref<TerrainLibraryMerger>(NULL));
|
_terra_surfaces.get(index)->set_library(Ref<TerrainLibraryMerger>(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.is_valid()) {
|
if (value.is_valid()) {
|
||||||
value->set_library(Ref<TerrainLibraryMerger>(this));
|
value->set_library(Ref<TerrainLibraryMerger>(this));
|
||||||
|
|
||||||
_voxel_surfaces.set(index, value);
|
_terra_surfaces.set(index, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMerger::voxel_surface_remove(const int index) {
|
void TerrainLibraryMerger::terra_surface_remove(const int index) {
|
||||||
_voxel_surfaces.remove(index);
|
_terra_surfaces.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerrainLibraryMerger::voxel_surface_get_num() const {
|
int TerrainLibraryMerger::terra_surface_get_num() const {
|
||||||
return _voxel_surfaces.size();
|
return _terra_surfaces.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMerger::voxel_surfaces_clear() {
|
void TerrainLibraryMerger::terra_surfaces_clear() {
|
||||||
_packer->clear();
|
_packer->clear();
|
||||||
|
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = _voxel_surfaces[i];
|
Ref<TerrainSurfaceMerger> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->set_library(NULL);
|
surface->set_library(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<Variant> TerrainLibraryMerger::get_voxel_surfaces() {
|
Vector<Variant> TerrainLibraryMerger::get_terra_surfaces() {
|
||||||
VARIANT_ARRAY_GET(_voxel_surfaces);
|
VARIANT_ARRAY_GET(_terra_surfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMerger::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
void TerrainLibraryMerger::set_terra_surfaces(const Vector<Variant> &surfaces) {
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
|
|
||||||
for (int i = 0; i < surfaces.size(); i++) {
|
for (int i = 0; i < surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(surfaces[i]);
|
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(surfaces[i]);
|
||||||
@ -147,7 +147,7 @@ void TerrainLibraryMerger::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
|||||||
surface->set_library(Ref<TerrainLibraryMerger>(this));
|
surface->set_library(Ref<TerrainLibraryMerger>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.push_back(surface);
|
_terra_surfaces.push_back(surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,8 +229,8 @@ Ref<TexturePacker> TerrainLibraryMerger::get_prop_packer() {
|
|||||||
|
|
||||||
void TerrainLibraryMerger::refresh_rects() {
|
void TerrainLibraryMerger::refresh_rects() {
|
||||||
bool texture_added = false;
|
bool texture_added = false;
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(_voxel_surfaces[i]);
|
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(_terra_surfaces[i]);
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) {
|
for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) {
|
||||||
@ -284,8 +284,8 @@ void TerrainLibraryMerger::refresh_rects() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = _voxel_surfaces[i];
|
Ref<TerrainSurfaceMerger> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->refresh_rects();
|
surface->refresh_rects();
|
||||||
@ -391,15 +391,15 @@ TerrainLibraryMerger::TerrainLibraryMerger() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TerrainLibraryMerger::~TerrainLibraryMerger() {
|
TerrainLibraryMerger::~TerrainLibraryMerger() {
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); ++i) {
|
for (int i = 0; i < _terra_surfaces.size(); ++i) {
|
||||||
Ref<TerrainSurface> surface = _voxel_surfaces[i];
|
Ref<TerrainSurface> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->set_library(Ref<TerrainLibraryMerger>());
|
surface->set_library(Ref<TerrainLibraryMerger>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
|
|
||||||
_packer->clear();
|
_packer->clear();
|
||||||
_packer.unref();
|
_packer.unref();
|
||||||
@ -466,9 +466,9 @@ void TerrainLibraryMerger::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMerger::set_margin);
|
ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMerger::set_margin);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibraryMerger::get_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMerger::get_terra_surfaces);
|
||||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibraryMerger::set_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMerger::set_terra_surfaces);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMerger::get_props);
|
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMerger::get_props);
|
||||||
|
@ -63,15 +63,15 @@ public:
|
|||||||
int get_margin() const;
|
int get_margin() const;
|
||||||
void set_margin(const int margin);
|
void set_margin(const int margin);
|
||||||
|
|
||||||
Ref<TerrainSurface> voxel_surface_get(const int index);
|
Ref<TerrainSurface> terra_surface_get(const int index);
|
||||||
void voxel_surface_add(Ref<TerrainSurface> value);
|
void terra_surface_add(Ref<TerrainSurface> value);
|
||||||
void voxel_surface_set(const int index, Ref<TerrainSurface> value);
|
void terra_surface_set(const int index, Ref<TerrainSurface> value);
|
||||||
void voxel_surface_remove(const int index);
|
void terra_surface_remove(const int index);
|
||||||
int voxel_surface_get_num() const;
|
int terra_surface_get_num() const;
|
||||||
void voxel_surfaces_clear();
|
void terra_surfaces_clear();
|
||||||
|
|
||||||
Vector<Variant> get_voxel_surfaces();
|
Vector<Variant> get_terra_surfaces();
|
||||||
void set_voxel_surfaces(const Vector<Variant> &surfaces);
|
void set_terra_surfaces(const Vector<Variant> &surfaces);
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
Ref<PropData> get_prop(const int index);
|
Ref<PropData> get_prop(const int index);
|
||||||
@ -104,7 +104,7 @@ protected:
|
|||||||
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
Vector<Ref<TerrainSurfaceMerger> > _voxel_surfaces;
|
Vector<Ref<TerrainSurfaceMerger> > _terra_surfaces;
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
Vector<Ref<PropData> > _props;
|
Vector<Ref<PropData> > _props;
|
||||||
#endif
|
#endif
|
||||||
|
@ -132,11 +132,11 @@ void TerrainLibraryMergerPCM::_material_cache_get_key(Ref<TerrainChunk> chunk) {
|
|||||||
for (int i = 0; i < surfaces.size(); ++i) {
|
for (int i = 0; i < surfaces.size(); ++i) {
|
||||||
int s = surfaces[i] - 1;
|
int s = surfaces[i] - 1;
|
||||||
|
|
||||||
if (_voxel_surfaces.size() <= s) {
|
if (_terra_surfaces.size() <= s) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<TerrainSurfaceMerger> ms = _voxel_surfaces[s];
|
Ref<TerrainSurfaceMerger> ms = _terra_surfaces[s];
|
||||||
|
|
||||||
if (!ms.is_valid()) {
|
if (!ms.is_valid()) {
|
||||||
continue;
|
continue;
|
||||||
@ -421,67 +421,67 @@ void TerrainLibraryMergerPCM::set_margin(const int margin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Surfaces
|
//Surfaces
|
||||||
Ref<TerrainSurface> TerrainLibraryMergerPCM::voxel_surface_get(const int index) {
|
Ref<TerrainSurface> TerrainLibraryMergerPCM::terra_surface_get(const int index) {
|
||||||
ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref<TerrainSurface>(NULL));
|
ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref<TerrainSurface>(NULL));
|
||||||
|
|
||||||
return _voxel_surfaces[index];
|
return _terra_surfaces[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMergerPCM::voxel_surface_add(Ref<TerrainSurface> value) {
|
void TerrainLibraryMergerPCM::terra_surface_add(Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(!value.is_valid());
|
ERR_FAIL_COND(!value.is_valid());
|
||||||
|
|
||||||
value->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
value->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
||||||
value->set_id(_voxel_surfaces.size());
|
value->set_id(_terra_surfaces.size());
|
||||||
|
|
||||||
_voxel_surfaces.push_back(value);
|
_terra_surfaces.push_back(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMergerPCM::voxel_surface_set(const int index, Ref<TerrainSurface> value) {
|
void TerrainLibraryMergerPCM::terra_surface_set(const int index, Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(index < 0);
|
ERR_FAIL_COND(index < 0);
|
||||||
|
|
||||||
if (_voxel_surfaces.size() < index) {
|
if (_terra_surfaces.size() < index) {
|
||||||
_voxel_surfaces.resize(index + 1);
|
_terra_surfaces.resize(index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_voxel_surfaces[index].is_valid()) {
|
if (_terra_surfaces[index].is_valid()) {
|
||||||
_voxel_surfaces.get(index)->set_library(Ref<TerrainLibraryMergerPCM>(NULL));
|
_terra_surfaces.get(index)->set_library(Ref<TerrainLibraryMergerPCM>(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.is_valid()) {
|
if (value.is_valid()) {
|
||||||
value->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
value->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
||||||
|
|
||||||
_voxel_surfaces.set(index, value);
|
_terra_surfaces.set(index, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMergerPCM::voxel_surface_remove(const int index) {
|
void TerrainLibraryMergerPCM::terra_surface_remove(const int index) {
|
||||||
_voxel_surfaces.remove(index);
|
_terra_surfaces.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerrainLibraryMergerPCM::voxel_surface_get_num() const {
|
int TerrainLibraryMergerPCM::terra_surface_get_num() const {
|
||||||
return _voxel_surfaces.size();
|
return _terra_surfaces.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMergerPCM::voxel_surfaces_clear() {
|
void TerrainLibraryMergerPCM::terra_surfaces_clear() {
|
||||||
_packer->clear();
|
_packer->clear();
|
||||||
|
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = _voxel_surfaces[i];
|
Ref<TerrainSurfaceMerger> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->set_library(NULL);
|
surface->set_library(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<Variant> TerrainLibraryMergerPCM::get_voxel_surfaces() {
|
Vector<Variant> TerrainLibraryMergerPCM::get_terra_surfaces() {
|
||||||
VARIANT_ARRAY_GET(_voxel_surfaces);
|
VARIANT_ARRAY_GET(_terra_surfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibraryMergerPCM::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
void TerrainLibraryMergerPCM::set_terra_surfaces(const Vector<Variant> &surfaces) {
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
|
|
||||||
for (int i = 0; i < surfaces.size(); i++) {
|
for (int i = 0; i < surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(surfaces[i]);
|
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(surfaces[i]);
|
||||||
@ -490,7 +490,7 @@ void TerrainLibraryMergerPCM::set_voxel_surfaces(const Vector<Variant> &surfaces
|
|||||||
surface->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
surface->set_library(Ref<TerrainLibraryMergerPCM>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.push_back(surface);
|
_terra_surfaces.push_back(surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,8 +572,8 @@ Ref<TexturePacker> TerrainLibraryMergerPCM::get_prop_packer() {
|
|||||||
|
|
||||||
void TerrainLibraryMergerPCM::refresh_rects() {
|
void TerrainLibraryMergerPCM::refresh_rects() {
|
||||||
bool texture_added = false;
|
bool texture_added = false;
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(_voxel_surfaces[i]);
|
Ref<TerrainSurfaceMerger> surface = Ref<TerrainSurfaceMerger>(_terra_surfaces[i]);
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) {
|
for (int j = 0; j < TerrainSurface::TERRAIN_SIDES_COUNT; ++j) {
|
||||||
@ -627,8 +627,8 @@ void TerrainLibraryMergerPCM::refresh_rects() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceMerger> surface = _voxel_surfaces[i];
|
Ref<TerrainSurfaceMerger> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->refresh_rects();
|
surface->refresh_rects();
|
||||||
@ -734,15 +734,15 @@ TerrainLibraryMergerPCM::TerrainLibraryMergerPCM() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TerrainLibraryMergerPCM::~TerrainLibraryMergerPCM() {
|
TerrainLibraryMergerPCM::~TerrainLibraryMergerPCM() {
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); ++i) {
|
for (int i = 0; i < _terra_surfaces.size(); ++i) {
|
||||||
Ref<TerrainSurface> surface = _voxel_surfaces[i];
|
Ref<TerrainSurface> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->set_library(Ref<TerrainLibraryMergerPCM>());
|
surface->set_library(Ref<TerrainLibraryMergerPCM>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
|
|
||||||
_packer->clear();
|
_packer->clear();
|
||||||
_packer.unref();
|
_packer.unref();
|
||||||
@ -807,9 +807,9 @@ void TerrainLibraryMergerPCM::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMergerPCM::set_margin);
|
ClassDB::bind_method(D_METHOD("set_margin", "size"), &TerrainLibraryMergerPCM::set_margin);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "margin"), "set_margin", "get_margin");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibraryMergerPCM::get_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibraryMergerPCM::get_terra_surfaces);
|
||||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibraryMergerPCM::set_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibraryMergerPCM::set_terra_surfaces);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_voxel_surfaces", "get_voxel_surfaces");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceMerger", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceMerger"), "set_terra_surfaces", "get_terra_surfaces");
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMergerPCM::get_props);
|
ClassDB::bind_method(D_METHOD("get_props"), &TerrainLibraryMergerPCM::get_props);
|
||||||
|
@ -78,15 +78,15 @@ public:
|
|||||||
int get_margin() const;
|
int get_margin() const;
|
||||||
void set_margin(const int margin);
|
void set_margin(const int margin);
|
||||||
|
|
||||||
Ref<TerrainSurface> voxel_surface_get(const int index);
|
Ref<TerrainSurface> terra_surface_get(const int index);
|
||||||
void voxel_surface_add(Ref<TerrainSurface> value);
|
void terra_surface_add(Ref<TerrainSurface> value);
|
||||||
void voxel_surface_set(const int index, Ref<TerrainSurface> value);
|
void terra_surface_set(const int index, Ref<TerrainSurface> value);
|
||||||
void voxel_surface_remove(const int index);
|
void terra_surface_remove(const int index);
|
||||||
int voxel_surface_get_num() const;
|
int terra_surface_get_num() const;
|
||||||
void voxel_surfaces_clear();
|
void terra_surfaces_clear();
|
||||||
|
|
||||||
Vector<Variant> get_voxel_surfaces();
|
Vector<Variant> get_terra_surfaces();
|
||||||
void set_voxel_surfaces(const Vector<Variant> &surfaces);
|
void set_terra_surfaces(const Vector<Variant> &surfaces);
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
Ref<PropData> get_prop(const int index);
|
Ref<PropData> get_prop(const int index);
|
||||||
@ -122,7 +122,7 @@ protected:
|
|||||||
Map<int, Ref<TerrainMaterialCachePCM> > _material_cache;
|
Map<int, Ref<TerrainMaterialCachePCM> > _material_cache;
|
||||||
Map<int, Ref<TerrainMaterialCachePCM> > _prop_material_cache;
|
Map<int, Ref<TerrainMaterialCachePCM> > _prop_material_cache;
|
||||||
|
|
||||||
Vector<Ref<TerrainSurfaceMerger> > _voxel_surfaces;
|
Vector<Ref<TerrainSurfaceMerger> > _terra_surfaces;
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
Vector<Ref<PropData> > _props;
|
Vector<Ref<PropData> > _props;
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,57 +43,57 @@ void TerrainLibrarySimple::set_atlas_rows(int s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Surfaces
|
//Surfaces
|
||||||
Ref<TerrainSurface> TerrainLibrarySimple::voxel_surface_get(const int index) {
|
Ref<TerrainSurface> TerrainLibrarySimple::terra_surface_get(const int index) {
|
||||||
ERR_FAIL_INDEX_V(index, _voxel_surfaces.size(), Ref<TerrainSurface>(NULL));
|
ERR_FAIL_INDEX_V(index, _terra_surfaces.size(), Ref<TerrainSurface>(NULL));
|
||||||
|
|
||||||
return _voxel_surfaces[index];
|
return _terra_surfaces[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::voxel_surface_add(Ref<TerrainSurface> value) {
|
void TerrainLibrarySimple::terra_surface_add(Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(!value.is_valid());
|
ERR_FAIL_COND(!value.is_valid());
|
||||||
|
|
||||||
value->set_library(Ref<TerrainLibrarySimple>(this));
|
value->set_library(Ref<TerrainLibrarySimple>(this));
|
||||||
value->set_id(_voxel_surfaces.size());
|
value->set_id(_terra_surfaces.size());
|
||||||
|
|
||||||
_voxel_surfaces.push_back(value);
|
_terra_surfaces.push_back(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::voxel_surface_set(const int index, Ref<TerrainSurface> value) {
|
void TerrainLibrarySimple::terra_surface_set(const int index, Ref<TerrainSurface> value) {
|
||||||
ERR_FAIL_COND(index < 0);
|
ERR_FAIL_COND(index < 0);
|
||||||
|
|
||||||
if (_voxel_surfaces.size() < index) {
|
if (_terra_surfaces.size() < index) {
|
||||||
_voxel_surfaces.resize(index + 1);
|
_terra_surfaces.resize(index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_voxel_surfaces[index].is_valid()) {
|
if (_terra_surfaces[index].is_valid()) {
|
||||||
_voxel_surfaces.get(index)->set_library(Ref<TerrainLibrarySimple>(NULL));
|
_terra_surfaces.get(index)->set_library(Ref<TerrainLibrarySimple>(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.is_valid()) {
|
if (value.is_valid()) {
|
||||||
value->set_library(Ref<TerrainLibrarySimple>(this));
|
value->set_library(Ref<TerrainLibrarySimple>(this));
|
||||||
|
|
||||||
_voxel_surfaces.set(index, value);
|
_terra_surfaces.set(index, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::voxel_surface_remove(const int index) {
|
void TerrainLibrarySimple::terra_surface_remove(const int index) {
|
||||||
_voxel_surfaces.VREMOVE(index);
|
_terra_surfaces.VREMOVE(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerrainLibrarySimple::voxel_surface_get_num() const {
|
int TerrainLibrarySimple::terra_surface_get_num() const {
|
||||||
return _voxel_surfaces.size();
|
return _terra_surfaces.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::voxel_surfaces_clear() {
|
void TerrainLibrarySimple::terra_surfaces_clear() {
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<Variant> TerrainLibrarySimple::get_voxel_surfaces() {
|
Vector<Variant> TerrainLibrarySimple::get_terra_surfaces() {
|
||||||
VARIANT_ARRAY_GET(_voxel_surfaces);
|
VARIANT_ARRAY_GET(_terra_surfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
void TerrainLibrarySimple::set_terra_surfaces(const Vector<Variant> &surfaces) {
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
|
|
||||||
for (int i = 0; i < surfaces.size(); i++) {
|
for (int i = 0; i < surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceSimple> surface = Ref<TerrainSurfaceSimple>(surfaces[i]);
|
Ref<TerrainSurfaceSimple> surface = Ref<TerrainSurfaceSimple>(surfaces[i]);
|
||||||
@ -103,15 +103,15 @@ void TerrainLibrarySimple::set_voxel_surfaces(const Vector<Variant> &surfaces) {
|
|||||||
surface->refresh_rects();
|
surface->refresh_rects();
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.push_back(surface);
|
_terra_surfaces.push_back(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_initialized(true);
|
set_initialized(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::refresh_rects() {
|
void TerrainLibrarySimple::refresh_rects() {
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); i++) {
|
for (int i = 0; i < _terra_surfaces.size(); i++) {
|
||||||
Ref<TerrainSurfaceSimple> surface = Ref<TerrainSurfaceSimple>(_voxel_surfaces[i]);
|
Ref<TerrainSurfaceSimple> surface = Ref<TerrainSurfaceSimple>(_terra_surfaces[i]);
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->refresh_rects();
|
surface->refresh_rects();
|
||||||
@ -125,15 +125,15 @@ TerrainLibrarySimple::TerrainLibrarySimple() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TerrainLibrarySimple::~TerrainLibrarySimple() {
|
TerrainLibrarySimple::~TerrainLibrarySimple() {
|
||||||
for (int i = 0; i < _voxel_surfaces.size(); ++i) {
|
for (int i = 0; i < _terra_surfaces.size(); ++i) {
|
||||||
Ref<TerrainSurface> surface = _voxel_surfaces[i];
|
Ref<TerrainSurface> surface = _terra_surfaces[i];
|
||||||
|
|
||||||
if (surface.is_valid()) {
|
if (surface.is_valid()) {
|
||||||
surface->set_library(Ref<TerrainLibrarySimple>());
|
surface->set_library(Ref<TerrainLibrarySimple>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_voxel_surfaces.clear();
|
_terra_surfaces.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainLibrarySimple::_bind_methods() {
|
void TerrainLibrarySimple::_bind_methods() {
|
||||||
@ -145,7 +145,7 @@ void TerrainLibrarySimple::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_atlas_rows", "value"), &TerrainLibrarySimple::set_atlas_rows);
|
ClassDB::bind_method(D_METHOD("set_atlas_rows", "value"), &TerrainLibrarySimple::set_atlas_rows);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "atlas_rows"), "set_atlas_rows", "get_atlas_rows");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "atlas_rows"), "set_atlas_rows", "get_atlas_rows");
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_voxel_surfaces"), &TerrainLibrarySimple::get_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("get_terra_surfaces"), &TerrainLibrarySimple::get_terra_surfaces);
|
||||||
ClassDB::bind_method(D_METHOD("set_voxel_surfaces"), &TerrainLibrarySimple::set_voxel_surfaces);
|
ClassDB::bind_method(D_METHOD("set_terra_surfaces"), &TerrainLibrarySimple::set_terra_surfaces);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "voxel_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_voxel_surfaces", "get_voxel_surfaces");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "terra_surfaces", PROPERTY_HINT_NONE, "17/17:TerrainSurfaceSimple", PROPERTY_USAGE_DEFAULT, "TerrainSurfaceSimple"), "set_terra_surfaces", "get_terra_surfaces");
|
||||||
}
|
}
|
||||||
|
@ -51,15 +51,15 @@ public:
|
|||||||
int get_atlas_rows() const;
|
int get_atlas_rows() const;
|
||||||
void set_atlas_rows(int s);
|
void set_atlas_rows(int s);
|
||||||
|
|
||||||
Ref<TerrainSurface> voxel_surface_get(const int index);
|
Ref<TerrainSurface> terra_surface_get(const int index);
|
||||||
void voxel_surface_add(Ref<TerrainSurface> value);
|
void terra_surface_add(Ref<TerrainSurface> value);
|
||||||
void voxel_surface_set(const int index, Ref<TerrainSurface> value);
|
void terra_surface_set(const int index, Ref<TerrainSurface> value);
|
||||||
void voxel_surface_remove(const int index);
|
void terra_surface_remove(const int index);
|
||||||
int voxel_surface_get_num() const;
|
int terra_surface_get_num() const;
|
||||||
void voxel_surfaces_clear();
|
void terra_surfaces_clear();
|
||||||
|
|
||||||
Vector<Variant> get_voxel_surfaces();
|
Vector<Variant> get_terra_surfaces();
|
||||||
void set_voxel_surfaces(const Vector<Variant> &surfaces);
|
void set_terra_surfaces(const Vector<Variant> &surfaces);
|
||||||
|
|
||||||
void refresh_rects();
|
void refresh_rects();
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ protected:
|
|||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vector<Ref<TerrainSurfaceSimple> > _voxel_surfaces;
|
Vector<Ref<TerrainSurfaceSimple> > _terra_surfaces;
|
||||||
|
|
||||||
//atlas
|
//atlas
|
||||||
int _atlas_columns;
|
int _atlas_columns;
|
||||||
|
@ -120,7 +120,7 @@ void TerrainMesherBlocky::add_chunk_normal(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ void TerrainMesherBlocky::add_chunk_lod(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -456,7 +456,7 @@ void TerrainMesherBlocky::create_margin_zmin(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -628,7 +628,7 @@ void TerrainMesherBlocky::create_margin_zmax(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -800,7 +800,7 @@ void TerrainMesherBlocky::create_margin_xmin(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -970,7 +970,7 @@ void TerrainMesherBlocky::create_margin_xmax(Ref<TerrainChunkDefault> chunk) {
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
@ -1133,7 +1133,7 @@ void TerrainMesherBlocky::create_face(Ref<TerrainChunkDefault> chunk, int dataxm
|
|||||||
Ref<TerrainSurface> surface;
|
Ref<TerrainSurface> surface;
|
||||||
|
|
||||||
if (!mcache.is_valid()) {
|
if (!mcache.is_valid()) {
|
||||||
surface = _library->voxel_surface_get(type - 1);
|
surface = _library->terra_surface_get(type - 1);
|
||||||
} else {
|
} else {
|
||||||
surface = mcache->surface_id_get(type - 1);
|
surface = mcache->surface_id_get(type - 1);
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,8 @@ void TerrainMesherLiquidBlocky::_add_chunk(Ref<TerrainChunk> p_chunk) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector<uint8_t> liquids;
|
Vector<uint8_t> liquids;
|
||||||
for (int i = 0; i < _library->voxel_surface_get_num(); ++i) {
|
for (int i = 0; i < _library->terra_surface_get_num(); ++i) {
|
||||||
Ref<TerrainSurface> surface = _library->voxel_surface_get(i);
|
Ref<TerrainSurface> surface = _library->terra_surface_get(i);
|
||||||
|
|
||||||
if (!surface.is_valid())
|
if (!surface.is_valid())
|
||||||
continue;
|
continue;
|
||||||
@ -94,7 +94,7 @@ void TerrainMesherLiquidBlocky::_add_chunk(Ref<TerrainChunk> p_chunk) {
|
|||||||
if (liquids.find(type) == -1)
|
if (liquids.find(type) == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Ref<TerrainSurface> surface = _library->voxel_surface_get(type - 1);
|
Ref<TerrainSurface> surface = _library->terra_surface_get(type - 1);
|
||||||
|
|
||||||
if (!surface.is_valid())
|
if (!surface.is_valid())
|
||||||
continue;
|
continue;
|
||||||
|
@ -182,8 +182,8 @@ void TerrainWorldEditor::edit(TerrainWorld *p_world) {
|
|||||||
library->refresh_rects();
|
library->refresh_rects();
|
||||||
|
|
||||||
bool f = false;
|
bool f = false;
|
||||||
for (int i = 0; i < library->voxel_surface_get_num(); ++i) {
|
for (int i = 0; i < library->terra_surface_get_num(); ++i) {
|
||||||
Ref<TerrainSurface> surface = library->voxel_surface_get(i);
|
Ref<TerrainSurface> surface = library->terra_surface_get(i);
|
||||||
|
|
||||||
if (!surface.is_valid())
|
if (!surface.is_valid())
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user