I've had problems with the same thing so long and I've been using puttext() for it. Of course bubba's idea in his last message depends on pc's power but it's still much slower than puttext() for I have tried it.
Puttext() is for console and draws an 1D array, like char view[80 * 24 * 2], on screen pretty effectively. Because every pixel on screen takes 2 bytes of memory, for example view[0] holds glyph and view[1] color of one coordinate of map. In this case, view can save 80x24 sized screen and draw it with
puttext(1, 1, 80, 24, view). But note that puttext draws the view from left to right and top to bottom, like text is normally written (if not japan style ).
So, if u'd like to fill screen with yellow 'T' marks, for a simple version u could do:
Code:
struct Pixel {
char mark;
char color;
Pixel() {
mark = 'T';
color = YELLOW // (or 14)
}
}
void main() {
Pixel map[24][80] // actual map
char view[24 * 80 * 2] // screen buffer
int vidx = 0;
for (int i = 0; i < 24; ++i)
for (int j = 0; j < 80; ++j) {
view[vidx] = map[i][j].mark;
view[vidx + 1] = map[i][j].color;
vidx += 2;
}
puttext(1, 1, 80, 24, view);
}
Now, I'd do this kind of thing every time I want to refresh the map But in my game, I use a map drawing function that centers the view on given coordinates.
Maybe this is not what u wanted but at least u have another idea