Move E() from joystick code to general text panel code

This commit is contained in:
Ilari Liusvaara 2013-08-13 11:37:02 +03:00
parent d4698e6380
commit 29fbf12e90
2 changed files with 7 additions and 8 deletions

View file

@ -32,6 +32,13 @@ struct text_framebuffer
size_t write(const std::string& str, size_t w, size_t x, size_t y, uint32_t fg, uint32_t bg); size_t write(const std::string& str, size_t w, size_t x, size_t y, uint32_t fg, uint32_t bg);
size_t write(const std::u32string& str, size_t w, size_t x, size_t y, uint32_t fg, uint32_t bg); size_t write(const std::u32string& str, size_t w, size_t x, size_t y, uint32_t fg, uint32_t bg);
static size_t text_width(const std::string& text); static size_t text_width(const std::string& text);
element E(char32_t ch, uint32_t fg, uint32_t bg)
{
element e;
e.ch = ch;
e.fg = fg;
e.bg = bg;
}
private: private:
std::vector<element> buffer; std::vector<element> buffer;
size_t width; size_t width;

View file

@ -329,14 +329,6 @@ namespace
return U' '; return U' ';
return U'0' + ((val / div) % 10); return U'0' + ((val / div) % 10);
} }
text_framebuffer::element E(char32_t ch, unsigned fg, unsigned bg)
{
text_framebuffer::element e;
e.ch = ch;
e.fg = fg;
e.bg = bg;
return e;
}
}; };
class joystick_config_window : public settings_tab class joystick_config_window : public settings_tab