Ignore:
File:
1 edited

Legend:

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

    r50cfa6c r96b02eb9  
    4949#include <stdio.h>
    5050#include <stdlib.h>
    51 #include <string.h>
     51#include <str.h>
    5252#include <unistd.h>
    5353#include <vfs/vfs.h>
    5454#include <async.h>
     55#include <bool.h>
     56#include <io/console.h>
     57#include <io/style.h>
    5558#include "screen.h"
    5659#include "tetris.h"
    57 #include <io/console.h>
    5860
    5961#define STOP  (B_COLS - 3)
     
    6365static int isset;               /* true => terminal is in game mode */
    6466
    65 static int use_color;           /* true => use colors */
     67static bool use_color;          /* true => use colors */
    6668
    6769static const struct shape *lastshape;
     
    7274 * simply literal strings);
    7375 */
    74 static inline void putstr(char *s)
     76static inline void putstr(const char *s)
    7577{
    7678        while (*s)
     
    8183{
    8284        fflush(stdout);
    83         console_set_rgb_color(fphone(stdout), 0xf0f0f0,
     85        console_set_rgb_color(fphone(stdout), 0xffffff,
    8486            use_color ? color : 0x000000);
    8587}
     
    8890{
    8991        fflush(stdout);
    90         console_set_rgb_color(fphone(stdout), 0, 0xf0f0f0);
     92        console_set_style(fphone(stdout), STYLE_NORMAL);
    9193}
    9294
     
    118120}
    119121
    120 void moveto(int r, int c)
     122void moveto(sysarg_t r, sysarg_t c)
    121123{
    122124        fflush(stdout);
    123         console_goto(fphone(stdout), c, r);
     125        console_set_pos(fphone(stdout), c, r);
    124126}
    125127
     
    131133}
    132134
    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);
     135static bool get_display_color_sup(void)
     136{
     137        sysarg_t ccap;
     138        int rc = console_get_color_cap(fphone(stdout), &ccap);
     139       
    139140        if (rc != 0)
    140                 return 0;
    141 
     141                return false;
     142       
    142143        return (ccap >= CONSOLE_CCAP_RGB);
    143144}
     
    181182}
    182183
    183 void stop(char *why)
     184void stop(const char *why)
    184185{
    185186        if (isset)
     
    308309 * (We need its length in case we have to overwrite with blanks.)
    309310 */
    310 void scr_msg(char *s, int set)
     311void scr_msg(char *s, bool set)
    311312{
    312313        int l = str_size(s);
Note: See TracChangeset for help on using the changeset viewer.