Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4152 → Rev 4153

/branches/network/uspace/app/tetris/screen.c
50,13 → 50,12
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <io/stream.h>
#include <console.h>
 
 
#include <async.h>
#include "screen.h"
#include "tetris.h"
#include "../../srv/console/console.h"
#include <ipc/console.h>
 
static cell curscreen[B_SIZE]; /* 1 => standout (or otherwise marked) */
static int curscore;
73,29 → 72,19
putchar(*(s++));
}
 
static int con_phone;
 
 
 
static void set_style(int fgcolor, int bgcolor)
{
async_msg_2(con_phone, CONSOLE_SET_STYLE, fgcolor, bgcolor);
}
 
static void start_standout(void)
{
set_style(0xf0f0f0, 0);
console_set_rgb_color(0xf0f0f0, 0);
}
 
static void resume_normal(void)
{
set_style(0, 0xf0f0f0);
console_set_rgb_color(0, 0xf0f0f0);
}
 
 
void clear_screen(void)
{
async_msg_0(con_phone, CONSOLE_CLEAR);
console_clear();
moveto(0, 0);
}
 
107,7 → 96,7
{
 
resume_normal();
async_msg_0(con_phone, CONSOLE_CLEAR);
console_clear();
curscore = -1;
memset((char *)curscreen, 0, sizeof(curscreen));
}
118,8 → 107,7
void
scr_init(void)
{
con_phone = get_cons_phone();
async_msg_1(con_phone, CONSOLE_CURSOR_VISIBILITY, 0);
console_cursor_visibility(0);
resume_normal();
scr_clear();
}
126,12 → 114,12
 
void moveto(int r, int c)
{
async_msg_2(con_phone, CONSOLE_GOTO, r, c);
console_goto(r, c);
}
 
static void fflush(void)
{
async_msg_0(con_phone, CONSOLE_FLUSH);
console_flush();
}
 
winsize_t winsize;
138,8 → 126,7
 
static int get_display_size(winsize_t *ws)
{
return async_req_0_2(con_phone, CONSOLE_GETSIZE, &ws->ws_row,
&ws->ws_col);
return console_get_size(&ws->ws_row, &ws->ws_col);
}
 
/*