Changeset 3d588be in mainline
- Timestamp:
- 2024-09-13T15:06:04Z (2 months ago)
- Branches:
- master
- Children:
- 1e221ec
- Parents:
- 4c2339b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
r4c2339b r3d588be 78 78 static gfx_coord_t vpad; 79 79 static console_ctrl_t *con = NULL; 80 static bool textmode; 80 81 static ui_t *ui; 81 82 82 83 /** Determine if we are running in text mode. 83 84 * 84 * @param w Screen width85 * @param h Screen height86 85 * @return @c true iff we are running in text mode 87 86 */ 88 static 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; 87 static bool demo_is_text(void) 88 { 89 return textmode; 92 90 } 93 91 … … 181 179 182 180 /* XXX Crude way of detecting text mode */ 183 if ( w < 256) {181 if (demo_is_text()) { 184 182 /* Create dummy font for text mode */ 185 183 rc = gfx_typeface_create(gc, &tface); … … 270 268 271 269 if (font != NULL) { 272 if (demo_is_text( w, h)) {270 if (demo_is_text()) { 273 271 rc = gfx_color_new_ega(0x1e, &color); 274 272 if (rc != EOK) … … 719 717 gfx_color_delete(color); 720 718 721 if (demo_is_text( w, h)) {719 if (demo_is_text()) { 722 720 rc = gfx_color_new_ega(0x1f, &color); 723 721 if (rc != EOK) … … 807 805 808 806 for (i = 0; i < 8; i++) { 809 if (demo_is_text( w, h)) {807 if (demo_is_text()) { 810 808 rc = gfx_color_new_ega(i != 0 ? i : 0x10, &color); 811 809 if (rc != EOK) … … 884 882 gfx_color_delete(color); 885 883 886 if (demo_is_text( w, h)) {884 if (demo_is_text()) { 887 885 rc = gfx_color_new_ega(0x1f, &color); 888 886 if (rc != EOK) … … 1093 1091 1094 1092 gc = console_gc_get_ctx(cgc); 1093 1094 /* Currently console is always text. */ 1095 textmode = true; 1095 1096 1096 1097 rc = demo_loop(gc, cols, rows); … … 1192 1193 task_retval(0); 1193 1194 1195 textmode = ui_is_textmode(ui); 1196 1194 1197 args.gc = gc; 1195 1198 args.dims = dims; … … 1252 1255 1253 1256 task_retval(0); 1257 1258 /* FIXME Assuming display service is not text mode. */ 1259 textmode = false; 1254 1260 1255 1261 rc = demo_loop(gc, 400, 300);
Note:
See TracChangeset
for help on using the changeset viewer.