summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-07-19 01:21:22 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-07-19 01:21:22 -0400
commit09f0596eb22a7931f008d2da79f9c4fe2af230ab (patch)
tree96aa2135921ec5dec0e36ea125e861ae4cde3177 /scene
parentb76dfde329592ecfd6f6b952082ae21859039e67 (diff)
Explicitly cast to float when creating a float array
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/sprite_3d.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 13f8002721..2a53dd6aca 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -583,10 +583,10 @@ void Sprite3D::_draw() {
aabb.expand_to(vtx);
}
- float v_uv[2] = { uvs[i].x, uvs[i].y };
+ float v_uv[2] = { (float)uvs[i].x, (float)uvs[i].y };
memcpy(&attribute_write_buffer[i * attrib_stride + mesh_surface_offsets[RS::ARRAY_TEX_UV]], v_uv, 8);
- float v_vertex[3] = { vtx.x, vtx.y, vtx.z };
+ float v_vertex[3] = { (float)vtx.x, (float)vtx.y, (float)vtx.z };
memcpy(&vertex_write_buffer[i * vertex_stride + mesh_surface_offsets[RS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
memcpy(&vertex_write_buffer[i * vertex_stride + mesh_surface_offsets[RS::ARRAY_NORMAL]], &v_normal, 4);
@@ -949,10 +949,10 @@ void AnimatedSprite3D::_draw() {
aabb.expand_to(vtx);
}
- float v_uv[2] = { uvs[i].x, uvs[i].y };
+ float v_uv[2] = { (float)uvs[i].x, (float)uvs[i].y };
memcpy(&attribute_write_buffer[i * attrib_stride + mesh_surface_offsets[RS::ARRAY_TEX_UV]], v_uv, 8);
- float v_vertex[3] = { vtx.x, vtx.y, vtx.z };
+ float v_vertex[3] = { (float)vtx.x, (float)vtx.y, (float)vtx.z };
memcpy(&vertex_write_buffer[i * vertex_stride + mesh_surface_offsets[RS::ARRAY_VERTEX]], &v_vertex, sizeof(float) * 3);
memcpy(&vertex_write_buffer[i * vertex_stride + mesh_surface_offsets[RS::ARRAY_NORMAL]], &v_normal, 4);
memcpy(&vertex_write_buffer[i * vertex_stride + mesh_surface_offsets[RS::ARRAY_TANGENT]], &v_tangent, 4);