fix cgastream color but (flush erased all colors)
This commit is contained in:
@ -67,15 +67,19 @@ public:
|
|||||||
// Change stream color
|
// Change stream color
|
||||||
template<typename T>
|
template<typename T>
|
||||||
friend T& operator<<(T& os, const fgc& fg) {
|
friend T& operator<<(T& os, const fgc& fg) {
|
||||||
|
CGA::color old_bg = os.color_bg;
|
||||||
os.flush();
|
os.flush();
|
||||||
|
os.color_bg = old_bg;
|
||||||
os.color_fg = fg.fg;
|
os.color_fg = fg.fg;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
friend T& operator<<(T& os, const bgc& bg) {
|
friend T& operator<<(T& os, const bgc& bg) {
|
||||||
|
CGA::color old_fg = os.color_fg;
|
||||||
os.flush();
|
os.flush();
|
||||||
os.color_fg = bg.bg;
|
os.color_fg = old_fg;
|
||||||
|
os.color_bg = bg.bg;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user