diff options
Diffstat (limited to 'modules/xatlas_unwrap')
-rw-r--r-- | modules/xatlas_unwrap/register_types.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index 9f6e7efb27..fb4df10904 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -154,6 +154,7 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver float h = *r_size_hint_y; if (w == 0 || h == 0) { + xatlas::Destroy(atlas); return false; //could not bake because there is no area } @@ -163,8 +164,8 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver *r_uvs = (float *)malloc(sizeof(float) * output.vertexCount * 2); *r_indices = (int *)malloc(sizeof(int) * output.indexCount); - float max_x = 0; - float max_y = 0; + float max_x = 0.0; + float max_y = 0.0; for (uint32_t i = 0; i < output.vertexCount; i++) { (*r_vertices)[i] = output.vertexArray[i].xref; (*r_uvs)[i * 2 + 0] = output.vertexArray[i].uv[0] / w; |