7
static char lines[CONSOLE_LINES][CONSOLE_COLUMNS+1];
9
static int atline,atcol; /*atline is counted _from fistline_ */
11
static SDL_Surface *bg = 0;
19
void console_set_pos(int x, int y)
25
void console_load_bg(char *filename)
28
assert(tmp = IMG_Load(filename));
29
bg = SDL_DisplayFormatAlpha(tmp);
43
SDL_BlitSurface(bg,0,sprite_global.display,&r);
52
text_render(sprite_global.display,&r,big_font,
53
xpos,y,ALIGN_LEFT,ALIGN_TOP,
56
row = (row + 1) % CONSOLE_LINES;
58
while (row != firstline);
66
void console_write(const char *s)
70
assert(atcol <= CONSOLE_COLUMNS);
71
if ((atcol >= CONSOLE_COLUMNS) || (*s == '\n'))
73
lines[(firstline + atline) % CONSOLE_LINES][atcol] = 0;
76
lines[(firstline + atline) % CONSOLE_LINES][atcol] = 0;
77
if (atline >= CONSOLE_LINES)
79
atline = CONSOLE_LINES - 1;
80
firstline = (firstline + 1) % CONSOLE_LINES;
85
lines[(firstline + atline) % CONSOLE_LINES][atcol++] = *s;
89
lines[(firstline + atline) % CONSOLE_LINES][atcol] = 0;
98
for (i=0;i<CONSOLE_LINES;i++)