Removed useless variable

This commit is contained in:
Marc Gilleron 2017-08-15 21:37:08 +02:00
parent df13e025ca
commit 7be5d78e4b
2 changed files with 1 additions and 5 deletions

View File

@ -27,7 +27,6 @@ void VoxelLibrary::load_default() {
create_voxel(1, "solid") create_voxel(1, "solid")
->set_transparent(false) ->set_transparent(false)
->set_geometry_type(Voxel::GEOMETRY_CUBE); ->set_geometry_type(Voxel::GEOMETRY_CUBE);
_max_count = 2;
} }
// TODO Add a way to add voxels // TODO Add a way to add voxels
@ -52,6 +51,7 @@ bool VoxelLibrary::_set(const StringName &p_name, const Variant &p_value) {
_voxel_types[idx] = voxel; _voxel_types[idx] = voxel;
if(voxel.is_valid()) { if(voxel.is_valid()) {
voxel->set_library(Ref<VoxelLibrary>(this)); voxel->set_library(Ref<VoxelLibrary>(this));
voxel->set_id(idx);
} }
// Note: if the voxel is set to null, we could set the previous one's library reference to null. // Note: if the voxel is set to null, we could set the previous one's library reference to null.
// however it Voxels use a weak reference, so it's not really needed // however it Voxels use a weak reference, so it's not really needed
@ -105,9 +105,6 @@ Ref<Voxel> VoxelLibrary::create_voxel(int id, String name) {
voxel->set_id(id); voxel->set_id(id);
voxel->set_voxel_name(name); voxel->set_voxel_name(name);
_voxel_types[id] = voxel; _voxel_types[id] = voxel;
if(id >= _max_count) {
_max_count = id + 1;
}
return voxel; return voxel;
} }

View File

@ -39,7 +39,6 @@ protected:
private: private:
Ref<Voxel> _voxel_types[MAX_VOXEL_TYPES]; Ref<Voxel> _voxel_types[MAX_VOXEL_TYPES];
int _max_count;
int _atlas_size; int _atlas_size;
}; };