From 21ae69a1de56afa3b8b7deb5b8cccd2cacd9e096 Mon Sep 17 00:00:00 2001 From: Griffin Kroah-Hartman Date: Sat, 13 Jan 2024 19:05:38 +0100 Subject: [PATCH] fix build warning with memset value being too large same resolution for issue #83342 for texture_storage.cpp --- .../rendering/renderer_rd/storage_rd/texture_storage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index d8baf260f973..7784ad5d498b 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -2552,7 +2552,7 @@ void TextureStorage::update_decal_atlas() { //generate atlas Vector itemsv; itemsv.resize(decal_atlas.textures.size()); - int base_size = 8; + uint32_t base_size = 8; int idx = 0; @@ -2565,7 +2565,7 @@ void TextureStorage::update_decal_atlas() { si.size.height = (src_tex->height / border) + 1; si.pixel_size = Size2i(src_tex->width, src_tex->height); - if (base_size < si.size.width) { + if (base_size < (uint32_t)si.size.width) { base_size = nearest_power_of_2_templated(si.size.width); } @@ -2596,7 +2596,7 @@ void TextureStorage::update_decal_atlas() { DecalAtlas::SortItem &si = items[i]; int best_idx = -1; int best_height = 0x7FFFFFFF; - for (int j = 0; j <= base_size - si.size.width; j++) { + for (uint32_t j = 0; j <= base_size - si.size.width; j++) { int height = 0; for (int k = 0; k < si.size.width; k++) { int h = v_offsets[k + j]; @@ -2627,7 +2627,7 @@ void TextureStorage::update_decal_atlas() { } } - if (max_height <= base_size * 2) { + if ((uint32_t)max_height <= base_size * 2) { atlas_height = max_height; break; //good ratio, break; }