Changes in uspace/app/tetris/screen.c [e116461:87822ce] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
re116461 r87822ce 72 72 static int isset; /* true => terminal is in game mode */ 73 73 74 static bool use_rgb; /* true => use RGB colors */ 75 static bool use_color; /* true => use indexed colors */ 74 static bool use_color; /* true => use colors */ 76 75 77 76 static const struct shape *lastshape; … … 93 92 static void start_standout(uint32_t color) 94 93 { 95 uint8_t bg;96 uint8_t attr;97 98 94 console_flush(console); 99 if (use_rgb) { 100 console_set_rgb_color(console, color, 0xffffff); 101 } else if (use_color) { 102 bg = 0x00; 103 attr = 0; 104 if ((color & 0xff0000) != 0) 105 bg |= 0x4; 106 if ((color & 0x00ff00) != 0) 107 bg |= 0x2; 108 if ((color & 0x0000ff) != 0) 109 bg |= 0x1; 110 console_set_color(console, bg, 0x00, attr); 111 } 95 console_set_rgb_color(console, use_color ? color : 0x000000, 96 0xffffff); 112 97 } 113 98 … … 158 143 } 159 144 160 static void get_display_color_sup(bool *rgb, bool *color)145 static bool get_display_color_sup(void) 161 146 { 162 147 sysarg_t ccap; 163 148 errno_t rc = console_get_color_cap(console, &ccap); 164 149 165 if (rc != EOK) { 166 *rgb = false; 167 *color = false; 168 return; 169 } 170 171 *rgb = ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB); 172 *color = ((ccap & CONSOLE_CAP_INDEXED) == CONSOLE_CAP_INDEXED); 150 if (rc != EOK) 151 return false; 152 153 return ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB); 173 154 } 174 155 … … 188 169 } 189 170 190 get_display_color_sup(&use_rgb, &use_color);171 use_color = get_display_color_sup(); 191 172 192 173 if ((Rows < MINROWS) || (Cols < MINCOLS)) {
Note:
See TracChangeset
for help on using the changeset viewer.