diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-09 11:29:55 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-09 11:29:55 +0100 |
commit | a56dd6ca52186f67dce208ecbfc385df9a876543 (patch) | |
tree | f1a3b9b4eda2b67832c575600c5d71a25f0b6cc4 | |
parent | 1d3f98ac6a797b664282e87466f89734332fe31a (diff) | |
parent | b97cb5ec5908569dd80dcfc38548e9925a05cc5a (diff) | |
download | redot-engine-a56dd6ca52186f67dce208ecbfc385df9a876543.tar.gz |
Merge pull request #86920 from griffinkh/build_warning_fix
Fix build warning with memset value being too large
-rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index dc47338b05..5a59f6c772 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1475,7 +1475,7 @@ void TextureStorage::update_texture_atlas() { //generate atlas Vector<TextureAtlas::SortItem> itemsv; itemsv.resize(texture_atlas.textures.size()); - int base_size = 8; + uint32_t base_size = 8; int idx = 0; @@ -1488,7 +1488,7 @@ void TextureStorage::update_texture_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); } @@ -1519,7 +1519,7 @@ void TextureStorage::update_texture_atlas() { TextureAtlas::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]; @@ -1550,7 +1550,7 @@ void TextureStorage::update_texture_atlas() { } } - if (max_height <= base_size * 2) { + if ((uint32_t)max_height <= base_size * 2) { atlas_height = max_height; break; //good ratio, break; } |