+
+void my_draw_text_deferred(std::vector<TextDefer> &td, const widestring &str, double size, const std::string &theme_element, const std::string &fresh_theme_element, int xpos, int ypos)
+{
+ TextDefer newtd;
+ newtd.str = str;
+ newtd.size = size;
+ newtd.xpos = xpos;
+ newtd.ypos = ypos;
+ newtd.theme_element = theme_element;
+ newtd.fresh_theme_element = fresh_theme_element;
+ td.push_back(newtd);
+}
+
+void draw_all_deferred_text(unsigned char *buf, std::vector<TextDefer> ¤t, std::vector<TextDefer> &old)
+{
+ for (unsigned i = 0; i < current.size(); ++i) {
+ std::string theme_element;
+ if (i < old.size() && current[i].str != old[i].str) {
+ // changed text
+ theme_element = current[i].fresh_theme_element;
+ } else {
+ theme_element = current[i].theme_element;
+ }
+
+ my_draw_text(current[i].str, buf, current[i].size, theme_element, current[i].xpos, current[i].ypos);
+ }
+}
+