+
+void my_draw_text_deferred(std::vector<TextDefer> &td, const widestring &str, double size, int xpos, int ypos)
+{
+ TextDefer newtd;
+ newtd.str = str;
+ newtd.size = size;
+ newtd.xpos = xpos;
+ newtd.ypos = ypos;
+ 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) {
+ int r, g, b;
+ if (i < old.size() && current[i].str != old[i].str) {
+ // changed text
+ r = 255;
+ g = 0;
+ b = 0;
+ } else {
+ r = g = b = 255;
+ }
+
+ my_draw_text(current[i].str, buf, current[i].size, current[i].xpos, current[i].ypos, r, g, b);
+ }
+}
+