mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Change font::len text argument from std::string to const char*
See the previous two commits, a lot of the time we don't need std::string objects to be passed to these functions because we already have C strings. Commit 1/3: font::print_wrap Commit 2/3: font::print -> Commit 3/3: font::len
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
5e3a4e69ce
commit
d112dee72c
@@ -1147,13 +1147,12 @@ bool glyph_dimensions(uint32_t flags, uint8_t* glyph_w, uint8_t* glyph_h)
|
||||
return true;
|
||||
}
|
||||
|
||||
int len(const uint32_t flags, const std::string& t)
|
||||
int len(const uint32_t flags, const char* text)
|
||||
{
|
||||
PrintFlags pf = decode_print_flags(flags);
|
||||
|
||||
int text_len = 0;
|
||||
uint32_t codepoint;
|
||||
const char* text = t.c_str(); // TODO no std::string
|
||||
while ((codepoint = UTF8_next(&text)))
|
||||
{
|
||||
text_len += get_advance(pf.font_sel, codepoint);
|
||||
|
||||
Reference in New Issue
Block a user