diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-09-23 09:37:01 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-09-23 09:37:01 -0400 |
| commit | ed6b1a537939b37a7a66bfa6b10eb594a4c597e6 (patch) | |
| tree | dbd2f44a3ac45a76839429d4111eeb0f3c70012b /src/font.cpp | |
| parent | ccf107a65e566b1372907ae95e099f3dfa0a076e (diff) | |
pke: FontType_AddStringRender increment index
Diffstat (limited to 'src/font.cpp')
| -rw-r--r-- | src/font.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/font.cpp b/src/font.cpp index 58d5f50..3dba635 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -888,13 +888,14 @@ FontRenderHandle FontType_AddStringRender(FontTypeIndex idx_ft, const pk_cstr && assert(settings != nullptr); FontType *ft = &ftd.arr_ft[(FontTypeIndex_T)idx_ft]; FontRender *fr; + FontRenderIndex_T fri; uint32_t i, count; FontRenderIndex idx_fr = FontRenderIndex{0}; - for (i = 0; i < (FontRenderIndex_T)ft->n_render; ++i) { - if ((ft->unused_frs & (1llu << i)) != 0) { - ft->unused_frs &= ~(1llu << i); - idx_fr = FontRenderIndex{0}; + for (fri = 0; fri < (FontRenderIndex_T)ft->n_render; ++fri) { + if ((ft->unused_frs & (1llu << fri)) != 0) { + ft->unused_frs &= ~(1llu << fri); + idx_fr = FontRenderIndex{fri}; break; } } |
