Fix compile for 4.0.

This commit is contained in:
Relintai 2020-07-29 00:02:42 +02:00
parent 35cf2037df
commit 768728139e
4 changed files with 14 additions and 16 deletions

View File

@ -62,6 +62,7 @@
#define MeshInstance MeshInstance3D #define MeshInstance MeshInstance3D
#define Camera Camera3D #define Camera Camera3D
#define ToolButton Button #define ToolButton Button
#define Shape Shape3D
typedef class World3D World; typedef class World3D World;

View File

@ -159,21 +159,11 @@ void VoxelmanLibrary::clear_prop_materials() {
} }
Vector<Variant> VoxelmanLibrary::get_prop_materials() { Vector<Variant> VoxelmanLibrary::get_prop_materials() {
Vector<Variant> r; VARIANT_ARRAY_GET(_prop_materials);
for (int i = 0; i < _prop_materials.size(); i++) {
r.push_back(_prop_materials[i].get_ref_ptr());
}
return r;
} }
void VoxelmanLibrary::set_prop_materials(const Vector<Variant> &materials) { void VoxelmanLibrary::set_prop_materials(const Vector<Variant> &materials) {
_prop_materials.clear(); VARIANT_ARRAY_SET(materials, _prop_materials, Material);
for (int i = 0; i < materials.size(); i++) {
Ref<Material> material = Ref<Material>(materials[i]);
_prop_materials.push_back(material);
}
} }
//Surfaces //Surfaces

View File

@ -23,12 +23,19 @@ SOFTWARE.
#ifndef VOXELMAN_LIBRARY_H #ifndef VOXELMAN_LIBRARY_H
#define VOXELMAN_LIBRARY_H #define VOXELMAN_LIBRARY_H
#include "core/math/rect2.h"
#include "core/resource.h" #include "core/resource.h"
#include "scene/resources/material.h" #include "scene/resources/material.h"
#include "../data/voxel_light.h" #include "../data/voxel_light.h"
#include "voxel_surface.h" #include "voxel_surface.h"
#include "../defines.h"
#if GODOT4
#define Texture Texture2D
#endif
class VoxelSurface; class VoxelSurface;
class VoxelMesher; class VoxelMesher;
class PackedScene; class PackedScene;