Changeset bc52b5b in mainline for uspace/app/gfxdemo/gfxdemo.c
- Timestamp:
- 2021-08-15T10:02:32Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99589a9
- Parents:
- de0c55a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
rde0c55a rbc52b5b 1 1 /* 2 * Copyright (c) 202 0Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 73 73 static gfx_coord_t vpad; 74 74 75 /** Determine if we are running in text mode. 76 * 77 * @param w Screen width 78 * @param h Screen height 79 * @return @c true iff we are running in text mode 80 */ 81 static bool demo_is_text(gfx_coord_t w, gfx_coord_t h) 82 { 83 // XXX Need a proper way to determine text mode 84 return w <= 80; 85 } 86 75 87 /** Clear screen. 76 88 * … … 215 227 216 228 if (font != NULL) { 217 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color); 218 if (rc != EOK) 219 goto error; 229 if (demo_is_text(w, h)) { 230 rc = gfx_color_new_ega(0x1e, &color); 231 if (rc != EOK) 232 goto error; 233 } else { 234 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color); 235 if (rc != EOK) 236 goto error; 237 } 220 238 221 239 gfx_text_fmt_init(&fmt); … … 740 758 741 759 for (i = 0; i < 8; i++) { 742 rc = gfx_color_new_rgb_i16((i & 4) ? 0xffff : 0, 743 (i & 2) ? 0xffff : 0, (i & 1) ? 0xffff : 0, &color); 744 if (rc != EOK) 745 goto error; 760 if (demo_is_text(w, h)) { 761 rc = gfx_color_new_ega(i, &color); 762 if (rc != EOK) 763 goto error; 764 } else { 765 rc = gfx_color_new_rgb_i16((i & 4) ? 0xffff : 0, 766 (i & 2) ? 0xffff : 0, (i & 1) ? 0xffff : 0, &color); 767 if (rc != EOK) 768 goto error; 769 } 746 770 747 771 fmt.color = color;
Note:
See TracChangeset
for help on using the changeset viewer.