You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix build warning with memset value being too large
Should resolve issue #83342 (cherry picked from commitsb97cb5ec59and21ae69a1de)
This commit is contained in:
committed by
Rémi Verschelde
parent
36e2050eea
commit
484cd60f2e
@@ -1475,7 +1475,7 @@ void TextureStorage::update_texture_atlas() {
|
|||||||
//generate atlas
|
//generate atlas
|
||||||
Vector<TextureAtlas::SortItem> itemsv;
|
Vector<TextureAtlas::SortItem> itemsv;
|
||||||
itemsv.resize(texture_atlas.textures.size());
|
itemsv.resize(texture_atlas.textures.size());
|
||||||
int base_size = 8;
|
uint32_t base_size = 8;
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
@@ -1488,7 +1488,7 @@ void TextureStorage::update_texture_atlas() {
|
|||||||
si.size.height = (src_tex->height / border) + 1;
|
si.size.height = (src_tex->height / border) + 1;
|
||||||
si.pixel_size = Size2i(src_tex->width, src_tex->height);
|
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);
|
base_size = nearest_power_of_2_templated(si.size.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1519,7 +1519,7 @@ void TextureStorage::update_texture_atlas() {
|
|||||||
TextureAtlas::SortItem &si = items[i];
|
TextureAtlas::SortItem &si = items[i];
|
||||||
int best_idx = -1;
|
int best_idx = -1;
|
||||||
int best_height = 0x7FFFFFFF;
|
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;
|
int height = 0;
|
||||||
for (int k = 0; k < si.size.width; k++) {
|
for (int k = 0; k < si.size.width; k++) {
|
||||||
int h = v_offsets[k + j];
|
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;
|
atlas_height = max_height;
|
||||||
break; //good ratio, break;
|
break; //good ratio, break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2552,7 +2552,7 @@ void TextureStorage::update_decal_atlas() {
|
|||||||
//generate atlas
|
//generate atlas
|
||||||
Vector<DecalAtlas::SortItem> itemsv;
|
Vector<DecalAtlas::SortItem> itemsv;
|
||||||
itemsv.resize(decal_atlas.textures.size());
|
itemsv.resize(decal_atlas.textures.size());
|
||||||
int base_size = 8;
|
uint32_t base_size = 8;
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
@@ -2565,7 +2565,7 @@ void TextureStorage::update_decal_atlas() {
|
|||||||
si.size.height = (src_tex->height / border) + 1;
|
si.size.height = (src_tex->height / border) + 1;
|
||||||
si.pixel_size = Size2i(src_tex->width, src_tex->height);
|
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);
|
base_size = nearest_power_of_2_templated(si.size.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2596,7 +2596,7 @@ void TextureStorage::update_decal_atlas() {
|
|||||||
DecalAtlas::SortItem &si = items[i];
|
DecalAtlas::SortItem &si = items[i];
|
||||||
int best_idx = -1;
|
int best_idx = -1;
|
||||||
int best_height = 0x7FFFFFFF;
|
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;
|
int height = 0;
|
||||||
for (int k = 0; k < si.size.width; k++) {
|
for (int k = 0; k < si.size.width; k++) {
|
||||||
int h = v_offsets[k + j];
|
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;
|
atlas_height = max_height;
|
||||||
break; //good ratio, break;
|
break; //good ratio, break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user