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 Camera Camera3D
#define ToolButton Button
#define Shape Shape3D
typedef class World3D World;

View File

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

View File

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