Changeset 9f1362d4 in mainline for uspace/app/tetris
- Timestamp:
- 2010-04-19T19:58:18Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 369a5f8
- Parents:
- caad59a
- Location:
- uspace/app/tetris
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
rcaad59a r9f1362d4 53 53 #include <vfs/vfs.h> 54 54 #include <async.h> 55 #include <bool.h> 56 #include <io/console.h> 57 #include <io/style.h> 55 58 #include "screen.h" 56 59 #include "tetris.h" 57 #include <io/console.h>58 60 59 61 #define STOP (B_COLS - 3) … … 63 65 static int isset; /* true => terminal is in game mode */ 64 66 65 static int use_color;/* true => use colors */67 static bool use_color; /* true => use colors */ 66 68 67 69 static const struct shape *lastshape; … … 81 83 { 82 84 fflush(stdout); 83 console_set_rgb_color(fphone(stdout), 0xf 0f0f0,85 console_set_rgb_color(fphone(stdout), 0xffffff, 84 86 use_color ? color : 0x000000); 85 87 } … … 88 90 { 89 91 fflush(stdout); 90 console_set_ rgb_color(fphone(stdout), 0, 0xf0f0f0);92 console_set_style(fphone(stdout), STYLE_NORMAL); 91 93 } 92 94 … … 118 120 } 119 121 120 void moveto(i nt r, int c)122 void moveto(ipcarg_t r, ipcarg_t c) 121 123 { 122 124 fflush(stdout); 123 console_ goto(fphone(stdout), c, r);125 console_set_pos(fphone(stdout), c, r); 124 126 } 125 127 … … 131 133 } 132 134 133 static int get_display_color_sup(void) 134 { 135 int rc; 136 int ccap; 137 138 rc = console_get_color_cap(fphone(stdout), &ccap); 135 static bool get_display_color_sup(void) 136 { 137 ipcarg_t ccap; 138 int rc = console_get_color_cap(fphone(stdout), &ccap); 139 139 140 if (rc != 0) 140 return 0;141 141 return false; 142 142 143 return (ccap >= CONSOLE_CCAP_RGB); 143 144 } … … 308 309 * (We need its length in case we have to overwrite with blanks.) 309 310 */ 310 void scr_msg(char *s, intset)311 void scr_msg(char *s, bool set) 311 312 { 312 313 int l = str_size(s); -
uspace/app/tetris/screen.h
rcaad59a r9f1362d4 48 48 49 49 #include <sys/types.h> 50 #include <ipc/ipc.h> 50 51 #include <async.h> 52 #include <bool.h> 51 53 52 54 typedef struct { 53 i nt ws_row;54 i nt ws_col;55 ipcarg_t ws_row; 56 ipcarg_t ws_col; 55 57 } winsize_t; 56 58 57 59 extern winsize_t winsize; 58 60 59 extern void moveto(i nt r, int c);61 extern void moveto(ipcarg_t r, ipcarg_t c); 60 62 extern void clear_screen(void); 61 63 … … 65 67 extern void scr_end(void); 66 68 extern void scr_init(void); 67 extern void scr_msg(char *, int);69 extern void scr_msg(char *, bool); 68 70 extern void scr_set(void); 69 71 extern void scr_update(void);
Note:
See TracChangeset
for help on using the changeset viewer.