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