Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tetris/screen.c

    re116461 r87822ce  
    7272static int isset;               /* true => terminal is in game mode */
    7373
    74 static bool use_rgb;          /* true => use RGB colors */
    75 static bool use_color;          /* true => use indexed colors */
     74static bool use_color;          /* true => use colors */
    7675
    7776static const struct shape *lastshape;
     
    9392static void start_standout(uint32_t color)
    9493{
    95         uint8_t bg;
    96         uint8_t attr;
    97 
    9894        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);
    11297}
    11398
     
    158143}
    159144
    160 static void get_display_color_sup(bool *rgb, bool *color)
     145static bool get_display_color_sup(void)
    161146{
    162147        sysarg_t ccap;
    163148        errno_t rc = console_get_color_cap(console, &ccap);
    164149
    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);
    173154}
    174155
     
    188169        }
    189170
    190         get_display_color_sup(&use_rgb, &use_color);
     171        use_color = get_display_color_sup();
    191172
    192173        if ((Rows < MINROWS) || (Cols < MINCOLS)) {
Note: See TracChangeset for help on using the changeset viewer.