Changes in uspace/app/tetris/screen.c [50cfa6c:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
r50cfa6c r96b02eb9 49 49 #include <stdio.h> 50 50 #include <stdlib.h> 51 #include <str ing.h>51 #include <str.h> 52 52 #include <unistd.h> 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; … … 72 74 * simply literal strings); 73 75 */ 74 static inline void putstr(c har *s)76 static inline void putstr(const char *s) 75 77 { 76 78 while (*s) … … 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( int r, int c)122 void moveto(sysarg_t r, sysarg_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 sysarg_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 } … … 181 182 } 182 183 183 void stop(c har *why)184 void stop(const char *why) 184 185 { 185 186 if (isset) … … 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);
Note:
See TracChangeset
for help on using the changeset viewer.