Work on fixing compile.

This commit is contained in:
Relintai 2023-01-09 20:03:37 +01:00
parent 0fd63f6cb6
commit df35c65995
2 changed files with 13 additions and 16 deletions

View File

@ -147,10 +147,10 @@ void PropMaterialCachePCM::_setup_material_albedo(Ref<Texture2D> texture) {
for (int i = 0; i < count; ++i) {
Ref<Material> m = material_get(i);
Ref<SpatialMaterial> spmat = m;
Ref<StandardMaterial3D> spmat = m;
if (spmat.is_valid()) {
spmat->set_texture(SpatialMaterial::TEXTURE_ALBEDO, texture);
spmat->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, texture);
continue;
}
@ -165,11 +165,8 @@ void PropMaterialCachePCM::_setup_material_albedo(Ref<Texture2D> texture) {
PropMaterialCachePCM::PropMaterialCachePCM() {
_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);

View File

@ -591,7 +591,7 @@ _FORCE_INLINE_ Vector2 PropMesher::transform_uv(const Vector2 &uv, const Rect2 &
#ifdef MESH_DATA_RESOURCE_PRESENT
void PropMesher::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);
}
@ -602,11 +602,11 @@ void PropMesher::add_mesh_data_resource_transform(Ref<MeshDataResource> mesh, co
const Array &arr = mesh->get_array();
PoolVector3Array vertices = arr[Mesh::ARRAY_VERTEX];
PoolVector3Array normals = arr[Mesh::ARRAY_NORMAL];
PoolVector2Array uvs = arr[Mesh::ARRAY_TEX_UV];
PoolColorArray colors = arr[Mesh::ARRAY_COLOR];
PoolIntArray indices = arr[Mesh::ARRAY_INDEX];
PackedVector3Array vertices = arr[Mesh::ARRAY_VERTEX];
PackedVector3Array normals = arr[Mesh::ARRAY_NORMAL];
PackedVector2Array uvs = arr[Mesh::ARRAY_TEX_UV];
PackedColorArray colors = arr[Mesh::ARRAY_COLOR];
PackedInt32Array indices = arr[Mesh::ARRAY_INDEX];
if (vertices.size() == 0)
return;
@ -646,10 +646,10 @@ void PropMesher::add_mesh_data_resource_transform_colored(Ref<MeshDataResource>
const Array &arr = mesh->get_array();
PoolVector3Array vertices = arr[Mesh::ARRAY_VERTEX];
PoolVector3Array normals = arr[Mesh::ARRAY_NORMAL];
PoolVector2Array uvs = arr[Mesh::ARRAY_TEX_UV];
PoolIntArray indices = arr[Mesh::ARRAY_INDEX];
PackedVector3Array vertices = arr[Mesh::ARRAY_VERTEX];
PackedVector3Array normals = arr[Mesh::ARRAY_NORMAL];
PackedVector2Array uvs = arr[Mesh::ARRAY_TEX_UV];
PackedInt32Array indices = arr[Mesh::ARRAY_INDEX];
if (vertices.size() == 0)
return;