Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/gfxdemo/gfxdemo.c

    r3d588be r0a411bbf  
    7878static gfx_coord_t vpad;
    7979static console_ctrl_t *con = NULL;
    80 static bool textmode;
    8180static ui_t *ui;
    8281
    8382/** Determine if we are running in text mode.
    8483 *
     84 * @param w Screen width
     85 * @param h Screen height
    8586 * @return @c true iff we are running in text mode
    8687 */
    87 static bool demo_is_text(void)
    88 {
    89         return textmode;
     88static bool demo_is_text(gfx_coord_t w, gfx_coord_t h)
     89{
     90        // XXX Need a proper way to determine text mode
     91        return w <= 80;
    9092}
    9193
     
    179181
    180182        /* XXX Crude way of detecting text mode */
    181         if (demo_is_text()) {
     183        if (w < 256) {
    182184                /* Create dummy font for text mode */
    183185                rc = gfx_typeface_create(gc, &tface);
     
    268270
    269271        if (font != NULL) {
    270                 if (demo_is_text()) {
     272                if (demo_is_text(w, h)) {
    271273                        rc = gfx_color_new_ega(0x1e, &color);
    272274                        if (rc != EOK)
     
    717719        gfx_color_delete(color);
    718720
    719         if (demo_is_text()) {
     721        if (demo_is_text(w, h)) {
    720722                rc = gfx_color_new_ega(0x1f, &color);
    721723                if (rc != EOK)
     
    805807
    806808        for (i = 0; i < 8; i++) {
    807                 if (demo_is_text()) {
     809                if (demo_is_text(w, h)) {
    808810                        rc = gfx_color_new_ega(i != 0 ? i : 0x10, &color);
    809811                        if (rc != EOK)
     
    882884                gfx_color_delete(color);
    883885
    884                 if (demo_is_text()) {
     886                if (demo_is_text(w, h)) {
    885887                        rc = gfx_color_new_ega(0x1f, &color);
    886888                        if (rc != EOK)
     
    10911093
    10921094        gc = console_gc_get_ctx(cgc);
    1093 
    1094         /* Currently console is always text. */
    1095         textmode = true;
    10961095
    10971096        rc = demo_loop(gc, cols, rows);
     
    11931192                task_retval(0);
    11941193
    1195         textmode = ui_is_textmode(ui);
    1196 
    11971194        args.gc = gc;
    11981195        args.dims = dims;
     
    12551252
    12561253        task_retval(0);
    1257 
    1258         /* FIXME Assuming display service is not text mode. */
    1259         textmode = false;
    12601254
    12611255        rc = demo_loop(gc, 400, 300);
Note: See TracChangeset for help on using the changeset viewer.