mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Overload font::print text argument for both std::string and const char*
Turns out I was overplaying my hand a little when changing font::print from std::string to const char*, so instead, I'll overload the function: it can take either a const char* (the main function) or a std::string (a wrapper). This means any C string that's printed everywhere else (which is common, especially because loc::gettext gives them) no longer needs to be converted to a std::string object each call. 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
264b6474be
commit
5e3a4e69ce
@@ -84,6 +84,15 @@ bool glyph_dimensions(uint32_t flags, uint8_t* glyph_w, uint8_t* glyph_h);
|
||||
int len(uint32_t flags, const std::string& t);
|
||||
int height(const uint32_t flags);
|
||||
|
||||
void print(
|
||||
uint32_t flags,
|
||||
int x,
|
||||
int y,
|
||||
const char* text,
|
||||
uint8_t r, uint8_t g, uint8_t b
|
||||
);
|
||||
|
||||
// std::string overload for only font::print (use .c_str() for the others)
|
||||
void print(
|
||||
uint32_t flags,
|
||||
int x,
|
||||
|
||||
Reference in New Issue
Block a user