mirror of
https://github.com/Relintai/voxelman.git
synced 2024-11-20 10:47:19 +01:00
Work on fixing compile.
This commit is contained in:
parent
a3ceb1d866
commit
089f70ccba
@ -208,7 +208,7 @@ Rect2 VoxelLibraryMerger::get_prop_uv_rect(const Ref<Texture> &texture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if VERSION_MAJOR < 4
|
#if VERSION_MAJOR < 4
|
||||||
Ref<Image> image = tex->get_data();
|
Ref<Image> image = tex->get_image();
|
||||||
#else
|
#else
|
||||||
Ref<Image> image = tex->get_image();
|
Ref<Image> image = tex->get_image();
|
||||||
#endif
|
#endif
|
||||||
@ -371,11 +371,8 @@ void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const
|
|||||||
VoxelLibraryMerger::VoxelLibraryMerger() {
|
VoxelLibraryMerger::VoxelLibraryMerger() {
|
||||||
_packer.INSTANCE();
|
_packer.INSTANCE();
|
||||||
|
|
||||||
#if GODOT4
|
|
||||||
#warning implement
|
#warning implement
|
||||||
#else
|
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_packer->set_max_atlas_size(1024);
|
_packer->set_max_atlas_size(1024);
|
||||||
_packer->set_keep_original_atlases(false);
|
_packer->set_keep_original_atlases(false);
|
||||||
@ -383,11 +380,8 @@ VoxelLibraryMerger::VoxelLibraryMerger() {
|
|||||||
|
|
||||||
_prop_packer.INSTANCE();
|
_prop_packer.INSTANCE();
|
||||||
|
|
||||||
#if GODOT4
|
|
||||||
#warning implement
|
#warning implement
|
||||||
#else
|
//_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||||
_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_prop_packer->set_max_atlas_size(1024);
|
_prop_packer->set_max_atlas_size(1024);
|
||||||
_prop_packer->set_keep_original_atlases(false);
|
_prop_packer->set_keep_original_atlases(false);
|
||||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/io/resource.h"
|
#include "core/io/resource.h"
|
||||||
#include "core/templates/map.h"
|
#include "core/templates/hash_map.h"
|
||||||
#else
|
#else
|
||||||
#include "core/resource.h"
|
#include "core/resource.h"
|
||||||
#include "core/map.h"
|
#include "core/map.h"
|
||||||
|
@ -550,7 +550,7 @@ Rect2 VoxelLibraryMergerPCM::get_prop_uv_rect(const Ref<Texture> &texture) {
|
|||||||
return Rect2(0, 0, 1, 1);
|
return Rect2(0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> image = tex->get_data();
|
Ref<Image> image = tex->get_image();
|
||||||
|
|
||||||
if (!image.is_valid()) {
|
if (!image.is_valid()) {
|
||||||
return Rect2(0, 0, 1, 1);
|
return Rect2(0, 0, 1, 1);
|
||||||
@ -710,11 +710,8 @@ void VoxelLibraryMergerPCM::_setup_material_albedo(const int material_index, con
|
|||||||
VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() {
|
VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() {
|
||||||
_packer.instantiate();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
|
||||||
#warning implement
|
#warning implement
|
||||||
#else
|
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_packer->set_max_atlas_size(1024);
|
_packer->set_max_atlas_size(1024);
|
||||||
_packer->set_keep_original_atlases(false);
|
_packer->set_keep_original_atlases(false);
|
||||||
@ -722,11 +719,8 @@ VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() {
|
|||||||
|
|
||||||
_prop_packer.instantiate();
|
_prop_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
|
||||||
#warning implement
|
#warning implement
|
||||||
#else
|
//_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||||
_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_prop_packer->set_max_atlas_size(1024);
|
_prop_packer->set_max_atlas_size(1024);
|
||||||
_prop_packer->set_keep_original_atlases(false);
|
_prop_packer->set_keep_original_atlases(false);
|
||||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#if VERSION_MAJOR > 3
|
#if VERSION_MAJOR > 3
|
||||||
#include "core/io/resource.h"
|
#include "core/io/resource.h"
|
||||||
#include "core/templates/map.h"
|
#include "core/templates/hash_map.h"
|
||||||
#else
|
#else
|
||||||
#include "core/resource.h"
|
#include "core/resource.h"
|
||||||
#include "core/map.h"
|
#include "core/map.h"
|
||||||
|
@ -88,7 +88,7 @@ Rect2 VoxelMaterialCachePCM::additional_texture_get_uv_rect(const Ref<Texture> &
|
|||||||
return Rect2(0, 0, 1, 1);
|
return Rect2(0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> image = tex->get_data();
|
Ref<Image> image = tex->get_image();
|
||||||
|
|
||||||
if (!image.is_valid()) {
|
if (!image.is_valid()) {
|
||||||
return Rect2(0, 0, 1, 1);
|
return Rect2(0, 0, 1, 1);
|
||||||
@ -181,11 +181,8 @@ void VoxelMaterialCachePCM::_setup_material_albedo(Ref<Texture> texture) {
|
|||||||
VoxelMaterialCachePCM::VoxelMaterialCachePCM() {
|
VoxelMaterialCachePCM::VoxelMaterialCachePCM() {
|
||||||
_packer.instantiate();
|
_packer.instantiate();
|
||||||
|
|
||||||
#if GODOT4
|
|
||||||
#warning implement
|
#warning implement
|
||||||
#else
|
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_packer->set_max_atlas_size(1024);
|
_packer->set_max_atlas_size(1024);
|
||||||
_packer->set_keep_original_atlases(false);
|
_packer->set_keep_original_atlases(false);
|
||||||
|
@ -460,7 +460,7 @@ void VoxelMesher::add_chunk(Ref<VoxelChunk> chunk) {
|
|||||||
|
|
||||||
#ifdef MESH_DATA_RESOURCE_PRESENT
|
#ifdef MESH_DATA_RESOURCE_PRESENT
|
||||||
void VoxelMesher::add_mesh_data_resource(Ref<MeshDataResource> mesh, const Vector3 position, const Vector3 rotation, const Vector3 scale, const Rect2 uv_rect) {
|
void VoxelMesher::add_mesh_data_resource(Ref<MeshDataResource> mesh, const Vector3 position, const Vector3 rotation, const Vector3 scale, const Rect2 uv_rect) {
|
||||||
Transform transform = Transform(Basis(rotation).scaled(scale), position);
|
Transform3D transform = Transform3D(Basis::from_euler(rotation).scaled(scale), position);
|
||||||
|
|
||||||
add_mesh_data_resource_transform(mesh, transform, uv_rect);
|
add_mesh_data_resource_transform(mesh, transform, uv_rect);
|
||||||
}
|
}
|
||||||
|
@ -86,12 +86,12 @@ void VoxelChunkDefault::set_current_lod_level(const int value) {
|
|||||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||||
|
|
||||||
if (rid != RID())
|
if (rid != RID())
|
||||||
VisualServer::get_singleton()->instance_set_visible(rid, vis);
|
RenderingServer::get_singleton()->instance_set_visible(rid, vis);
|
||||||
|
|
||||||
rid = mesh_rid_get_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
rid = mesh_rid_get_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||||
|
|
||||||
if (rid != RID())
|
if (rid != RID())
|
||||||
VisualServer::get_singleton()->instance_set_visible(rid, vis);
|
RenderingServer::get_singleton()->instance_set_visible(rid, vis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -538,11 +538,11 @@ int VoxelChunkDefault::get_light_count() const {
|
|||||||
|
|
||||||
void VoxelChunkDefault::debug_mesh_allocate() {
|
void VoxelChunkDefault::debug_mesh_allocate() {
|
||||||
if (_debug_mesh_rid == RID()) {
|
if (_debug_mesh_rid == RID()) {
|
||||||
_debug_mesh_rid = VisualServer::get_singleton()->mesh_create();
|
_debug_mesh_rid = RenderingServer::get_singleton()->mesh_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_debug_mesh_instance == RID()) {
|
if (_debug_mesh_instance == RID()) {
|
||||||
_debug_mesh_instance = VisualServer::get_singleton()->instance_create();
|
_debug_mesh_instance = RenderingServer::get_singleton()->instance_create();
|
||||||
|
|
||||||
if (get_voxel_world()->GET_WORLD().is_valid())
|
if (get_voxel_world()->GET_WORLD().is_valid())
|
||||||
VS::get_singleton()->instance_set_scenario(_debug_mesh_instance, get_voxel_world()->GET_WORLD()->get_scenario());
|
VS::get_singleton()->instance_set_scenario(_debug_mesh_instance, get_voxel_world()->GET_WORLD()->get_scenario());
|
||||||
@ -554,11 +554,11 @@ void VoxelChunkDefault::debug_mesh_allocate() {
|
|||||||
}
|
}
|
||||||
void VoxelChunkDefault::debug_mesh_free() {
|
void VoxelChunkDefault::debug_mesh_free() {
|
||||||
if (_debug_mesh_instance != RID()) {
|
if (_debug_mesh_instance != RID()) {
|
||||||
VisualServer::get_singleton()->free(_debug_mesh_instance);
|
RenderingServer::get_singleton()->free(_debug_mesh_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_debug_mesh_rid != RID()) {
|
if (_debug_mesh_rid != RID()) {
|
||||||
VisualServer::get_singleton()->free(_debug_mesh_rid);
|
RenderingServer::get_singleton()->free(_debug_mesh_rid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool VoxelChunkDefault::debug_mesh_has() {
|
bool VoxelChunkDefault::debug_mesh_has() {
|
||||||
@ -566,7 +566,7 @@ bool VoxelChunkDefault::debug_mesh_has() {
|
|||||||
}
|
}
|
||||||
void VoxelChunkDefault::debug_mesh_clear() {
|
void VoxelChunkDefault::debug_mesh_clear() {
|
||||||
if (_debug_mesh_rid != RID()) {
|
if (_debug_mesh_rid != RID()) {
|
||||||
VisualServer::get_singleton()->mesh_clear(_debug_mesh_rid);
|
RenderingServer::get_singleton()->mesh_clear(_debug_mesh_rid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void VoxelChunkDefault::debug_mesh_array_clear() {
|
void VoxelChunkDefault::debug_mesh_array_clear() {
|
||||||
@ -589,13 +589,13 @@ void VoxelChunkDefault::debug_mesh_send() {
|
|||||||
SceneTree *st = SceneTree::get_singleton();
|
SceneTree *st = SceneTree::get_singleton();
|
||||||
|
|
||||||
Array arr;
|
Array arr;
|
||||||
arr.resize(VisualServer::ARRAY_MAX);
|
arr.resize(RenderingServer::ARRAY_MAX);
|
||||||
arr[VisualServer::ARRAY_VERTEX] = _debug_mesh_array;
|
arr[RenderingServer::ARRAY_VERTEX] = _debug_mesh_array;
|
||||||
|
|
||||||
VisualServer::get_singleton()->mesh_add_surface_from_arrays(_debug_mesh_rid, VisualServer::PRIMITIVE_LINES, arr);
|
RenderingServer::get_singleton()->mesh_add_surface_from_arrays(_debug_mesh_rid, RenderingServer::PRIMITIVE_LINES, arr);
|
||||||
|
|
||||||
if (st) {
|
if (st) {
|
||||||
VisualServer::get_singleton()->mesh_surface_set_material(_debug_mesh_rid, 0, SceneTree::get_singleton()->get_debug_collision_material()->get_rid());
|
RenderingServer::get_singleton()->mesh_surface_set_material(_debug_mesh_rid, 0, SceneTree::get_singleton()->get_debug_collision_material()->get_rid());
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_mesh_array_clear();
|
debug_mesh_array_clear();
|
||||||
@ -720,17 +720,17 @@ void VoxelChunkDefault::_visibility_changed(bool visible) {
|
|||||||
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
RID rid = mesh_rid_get_index(MESH_INDEX_TERRAIN, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||||
|
|
||||||
if (rid != RID())
|
if (rid != RID())
|
||||||
VisualServer::get_singleton()->instance_set_visible(rid, false);
|
RenderingServer::get_singleton()->instance_set_visible(rid, false);
|
||||||
|
|
||||||
rid = mesh_rid_get_index(MESH_INDEX_LIQUID, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
rid = mesh_rid_get_index(MESH_INDEX_LIQUID, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||||
|
|
||||||
if (rid != RID())
|
if (rid != RID())
|
||||||
VisualServer::get_singleton()->instance_set_visible(rid, false);
|
RenderingServer::get_singleton()->instance_set_visible(rid, false);
|
||||||
|
|
||||||
rid = mesh_rid_get_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
rid = mesh_rid_get_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH_INSTANCE, i);
|
||||||
|
|
||||||
if (rid != RID())
|
if (rid != RID())
|
||||||
VisualServer::get_singleton()->instance_set_visible(rid, false);
|
RenderingServer::get_singleton()->instance_set_visible(rid, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user