示例#1
0
void keybscr::write(const buffer &data) {
	for (int i = 0; i < data.get_size(); i++) {

		if (data[i] == '\n') {
			if (y < get_height() - 1)
				y++;
			else
				scr_scroll();
			x = 0;
		} else if (data[i] == '\t') {
			x = (x/8 + 1) * 8;
		} else {
			screen_print(data[i], foreground | (background << 4), x, y);
			x++;
		}

		y += x / get_width();
		if (x / get_width() > 0 && y >= get_height() - 1)
			scr_scroll();
		y = y < get_height() ? y : get_height() - 1;
		x = x % get_width();
	}

}
示例#2
0
void keybscr::read(buffer &data) {
	for (int i = 0; i < data.get_size(); i++)
		data[i] = buf.pop();
}