mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Merge pull request #67521 from nikitalita/speed_up_texture_pos
Speed up `find_texture_pos_for_glyph()`
This commit is contained in:
commit
3c4b110ae0
@ -810,12 +810,12 @@ _FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_
|
||||
|
||||
ret.y = 0x7fffffff;
|
||||
ret.x = 0;
|
||||
const int *ct_offsets_ptr = ct.offsets.ptr();
|
||||
|
||||
for (int j = 0; j < ct.texture_w - mw; j++) {
|
||||
int max_y = 0;
|
||||
|
||||
for (int k = j; k < j + mw; k++) {
|
||||
int y = ct.offsets[k];
|
||||
int y = ct_offsets_ptr[k];
|
||||
if (y > max_y) {
|
||||
max_y = y;
|
||||
}
|
||||
|
@ -233,12 +233,13 @@ _FORCE_INLINE_ TextServerFallback::FontTexturePosition TextServerFallback::find_
|
||||
|
||||
ret.y = 0x7fffffff;
|
||||
ret.x = 0;
|
||||
const int *ct_offsets_ptr = ct.offsets.ptr();
|
||||
|
||||
for (int j = 0; j < ct.texture_w - mw; j++) {
|
||||
int max_y = 0;
|
||||
|
||||
for (int k = j; k < j + mw; k++) {
|
||||
int y = ct.offsets[k];
|
||||
int y = ct_offsets_ptr[k];
|
||||
if (y > max_y) {
|
||||
max_y = y;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user