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
|
||||
Ref<Image> image = tex->get_data();
|
||||
Ref<Image> image = tex->get_image();
|
||||
#else
|
||||
Ref<Image> image = tex->get_image();
|
||||
#endif
|
||||
@ -371,11 +371,8 @@ void VoxelLibraryMerger::_setup_material_albedo(const int material_index, const
|
||||
VoxelLibraryMerger::VoxelLibraryMerger() {
|
||||
_packer.INSTANCE();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
#else
|
||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
#endif
|
||||
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
|
||||
_packer->set_max_atlas_size(1024);
|
||||
_packer->set_keep_original_atlases(false);
|
||||
@ -383,11 +380,8 @@ VoxelLibraryMerger::VoxelLibraryMerger() {
|
||||
|
||||
_prop_packer.INSTANCE();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
#else
|
||||
_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
#endif
|
||||
//_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
|
||||
_prop_packer->set_max_atlas_size(1024);
|
||||
_prop_packer->set_keep_original_atlases(false);
|
||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
#include "core/io/resource.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#else
|
||||
#include "core/resource.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);
|
||||
}
|
||||
|
||||
Ref<Image> image = tex->get_data();
|
||||
Ref<Image> image = tex->get_image();
|
||||
|
||||
if (!image.is_valid()) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
@ -710,11 +710,8 @@ void VoxelLibraryMergerPCM::_setup_material_albedo(const int material_index, con
|
||||
VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() {
|
||||
_packer.instantiate();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
#else
|
||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
#endif
|
||||
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
|
||||
_packer->set_max_atlas_size(1024);
|
||||
_packer->set_keep_original_atlases(false);
|
||||
@ -722,11 +719,8 @@ VoxelLibraryMergerPCM::VoxelLibraryMergerPCM() {
|
||||
|
||||
_prop_packer.instantiate();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
#else
|
||||
_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
#endif
|
||||
//_prop_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
|
||||
_prop_packer->set_max_atlas_size(1024);
|
||||
_prop_packer->set_keep_original_atlases(false);
|
||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
#include "core/io/resource.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/hash_map.h"
|
||||
#else
|
||||
#include "core/resource.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);
|
||||
}
|
||||
|
||||
Ref<Image> image = tex->get_data();
|
||||
Ref<Image> image = tex->get_image();
|
||||
|
||||
if (!image.is_valid()) {
|
||||
return Rect2(0, 0, 1, 1);
|
||||
@ -181,11 +181,8 @@ void VoxelMaterialCachePCM::_setup_material_albedo(Ref<Texture> texture) {
|
||||
VoxelMaterialCachePCM::VoxelMaterialCachePCM() {
|
||||
_packer.instantiate();
|
||||
|
||||
#if GODOT4
|
||||
#warning implement
|
||||
#else
|
||||
_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
#endif
|
||||
//_packer->set_texture_flags(Texture::FLAG_MIPMAPS | Texture::FLAG_FILTER);
|
||||
|
||||
_packer->set_max_atlas_size(1024);
|
||||
_packer->set_keep_original_atlases(false);
|
||||
|
@ -460,7 +460,7 @@ void VoxelMesher::add_chunk(Ref<VoxelChunk> chunk) {
|
||||
|
||||
#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) {
|
||||
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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
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);
|
||||
|
||||
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() {
|
||||
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()) {
|
||||
_debug_mesh_instance = VisualServer::get_singleton()->instance_create();
|
||||
_debug_mesh_instance = RenderingServer::get_singleton()->instance_create();
|
||||
|
||||
if (get_voxel_world()->GET_WORLD().is_valid())
|
||||
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() {
|
||||
if (_debug_mesh_instance != RID()) {
|
||||
VisualServer::get_singleton()->free(_debug_mesh_instance);
|
||||
RenderingServer::get_singleton()->free(_debug_mesh_instance);
|
||||
}
|
||||
|
||||
if (_debug_mesh_rid != RID()) {
|
||||
VisualServer::get_singleton()->free(_debug_mesh_rid);
|
||||
RenderingServer::get_singleton()->free(_debug_mesh_rid);
|
||||
}
|
||||
}
|
||||
bool VoxelChunkDefault::debug_mesh_has() {
|
||||
@ -566,7 +566,7 @@ bool VoxelChunkDefault::debug_mesh_has() {
|
||||
}
|
||||
void VoxelChunkDefault::debug_mesh_clear() {
|
||||
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() {
|
||||
@ -589,13 +589,13 @@ void VoxelChunkDefault::debug_mesh_send() {
|
||||
SceneTree *st = SceneTree::get_singleton();
|
||||
|
||||
Array arr;
|
||||
arr.resize(VisualServer::ARRAY_MAX);
|
||||
arr[VisualServer::ARRAY_VERTEX] = _debug_mesh_array;
|
||||
arr.resize(RenderingServer::ARRAY_MAX);
|
||||
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) {
|
||||
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();
|
||||
@ -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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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