Changes in uspace/app/tetris/screen.c [96b02eb9:50cfa6c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
r96b02eb9 r50cfa6c 49 49 #include <stdio.h> 50 50 #include <stdlib.h> 51 #include <str .h>51 #include <string.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>58 55 #include "screen.h" 59 56 #include "tetris.h" 57 #include <io/console.h> 60 58 61 59 #define STOP (B_COLS - 3) … … 65 63 static int isset; /* true => terminal is in game mode */ 66 64 67 static bool use_color;/* true => use colors */65 static int use_color; /* true => use colors */ 68 66 69 67 static const struct shape *lastshape; … … 74 72 * simply literal strings); 75 73 */ 76 static inline void putstr(c onst char *s)74 static inline void putstr(char *s) 77 75 { 78 76 while (*s) … … 83 81 { 84 82 fflush(stdout); 85 console_set_rgb_color(fphone(stdout), 0xf fffff,83 console_set_rgb_color(fphone(stdout), 0xf0f0f0, 86 84 use_color ? color : 0x000000); 87 85 } … … 90 88 { 91 89 fflush(stdout); 92 console_set_ style(fphone(stdout), STYLE_NORMAL);90 console_set_rgb_color(fphone(stdout), 0, 0xf0f0f0); 93 91 } 94 92 … … 120 118 } 121 119 122 void moveto( sysarg_t r, sysarg_t c)120 void moveto(int r, int c) 123 121 { 124 122 fflush(stdout); 125 console_ set_pos(fphone(stdout), c, r);123 console_goto(fphone(stdout), c, r); 126 124 } 127 125 … … 133 131 } 134 132 135 static bool get_display_color_sup(void) 136 { 137 sysarg_t ccap; 138 int rc = console_get_color_cap(fphone(stdout), &ccap); 139 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); 140 139 if (rc != 0) 141 return false;142 140 return 0; 141 143 142 return (ccap >= CONSOLE_CCAP_RGB); 144 143 } … … 182 181 } 183 182 184 void stop(c onst char *why)183 void stop(char *why) 185 184 { 186 185 if (isset) … … 309 308 * (We need its length in case we have to overwrite with blanks.) 310 309 */ 311 void scr_msg(char *s, boolset)310 void scr_msg(char *s, int set) 312 311 { 313 312 int l = str_size(s);
Note:
See TracChangeset
for help on using the changeset viewer.