Changeset e116461 in mainline
- Timestamp:
- 2021-07-19T11:04:14Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ead72f2
- Parents:
- 4afb6c9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
r4afb6c9 re116461 72 72 static int isset; /* true => terminal is in game mode */ 73 73 74 static bool use_color; /* true => use colors */ 74 static bool use_rgb; /* true => use RGB colors */ 75 static bool use_color; /* true => use indexed colors */ 75 76 76 77 static const struct shape *lastshape; … … 92 93 static void start_standout(uint32_t color) 93 94 { 95 uint8_t bg; 96 uint8_t attr; 97 94 98 console_flush(console); 95 console_set_rgb_color(console, use_color ? color : 0x000000, 96 0xffffff); 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 } 97 112 } 98 113 … … 143 158 } 144 159 145 static bool get_display_color_sup(void)160 static void get_display_color_sup(bool *rgb, bool *color) 146 161 { 147 162 sysarg_t ccap; 148 163 errno_t rc = console_get_color_cap(console, &ccap); 149 164 150 if (rc != EOK) 151 return false; 152 153 return ((ccap & CONSOLE_CAP_RGB) == CONSOLE_CAP_RGB); 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); 154 173 } 155 174 … … 169 188 } 170 189 171 use_color = get_display_color_sup();190 get_display_color_sup(&use_rgb, &use_color); 172 191 173 192 if ((Rows < MINROWS) || (Cols < MINCOLS)) {
Note:
See TracChangeset
for help on using the changeset viewer.