Support clearing existing text
This commit is contained in:
@@ -63,13 +63,17 @@ namespace JabyEngine {
|
||||
this->last_primitive = nullptr;
|
||||
}
|
||||
|
||||
void FontWriter :: clear() {
|
||||
this->last_primitive = &this->tex_page[GPU::update_id()];
|
||||
}
|
||||
|
||||
void FontWriter :: write(State& state, const char* str, GPU::Color24 color, const Wiggle* wiggle, va_list list) {
|
||||
static const auto exchang_str = [](const char* str, const char* new_str) -> pair<const char*, const char*> {
|
||||
return {str + 1, new_str};
|
||||
};
|
||||
|
||||
if(!this->last_primitive) {
|
||||
this->last_primitive = &this->tex_page[GPU::update_id()];
|
||||
FontWriter::clear();
|
||||
}
|
||||
|
||||
const auto row_count = 256/font_size.width;
|
||||
|
Reference in New Issue
Block a user