Add 64-bit versions of core power of 2 functions

This commit is contained in:
Aaron Franke 2025-05-19 09:53:53 -07:00
parent 64b09905c7
commit f6f1df7d73
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
25 changed files with 161 additions and 124 deletions

View file

@ -853,17 +853,17 @@ _FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_
// Could not find texture to fit, create one.
int texsize = MAX(p_data->size.x * 0.125, 256);
texsize = next_power_of_2(texsize);
texsize = next_power_of_2((uint32_t)texsize);
if (p_msdf) {
texsize = MIN(texsize, 2048);
} else {
texsize = MIN(texsize, 1024);
}
if (mw > texsize) { // Special case, adapt to it?
texsize = next_power_of_2(mw);
texsize = next_power_of_2((uint32_t)mw);
}
if (mh > texsize) { // Special case, adapt to it?
texsize = next_power_of_2(mh);
texsize = next_power_of_2((uint32_t)mh);
}
ShelfPackTexture tex = ShelfPackTexture(texsize, texsize);