| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008-2010 Travis Geiselbrecht | 2 * Copyright (c) 2008-2010 Travis Geiselbrecht |
| 3 * | 3 * |
| 4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
| 5 * a copy of this software and associated documentation files | 5 * a copy of this software and associated documentation files |
| 6 * (the "Software"), to deal in the Software without restriction, | 6 * (the "Software"), to deal in the Software without restriction, |
| 7 * including without limitation the rights to use, copy, modify, merge, | 7 * including without limitation the rights to use, copy, modify, merge, |
| 8 * publish, distribute, sublicense, and/or sell copies of the Software, | 8 * publish, distribute, sublicense, and/or sell copies of the Software, |
| 9 * and to permit persons to whom the Software is furnished to do so, | 9 * and to permit persons to whom the Software is furnished to do so, |
| 10 * subject to the following conditions: | 10 * subject to the following conditions: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 list_add_head(&text_list, &line->node); | 69 list_add_head(&text_list, &line->node); |
| 70 | 70 |
| 71 text_update(); | 71 text_update(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * @brief Refresh the display | 75 * @brief Refresh the display |
| 76 */ | 76 */ |
| 77 void text_update(void) | 77 void text_update(void) |
| 78 { | 78 { |
| 79 struct display_info info; | 79 struct display_framebuffer fb; |
| 80 if (display_get_info(&info) < 0) | 80 if (display_get_framebuffer(&fb) < 0) |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 /* get the display's surface */ | 83 /* get the display's surface */ |
| 84 gfx_surface *surface = gfx_create_surface_from_display(&info); | 84 gfx_surface *surface = gfx_create_surface_from_display(&fb); |
| 85 | 85 |
| 86 struct text_line *line; | 86 struct text_line *line; |
| 87 list_for_every_entry(&text_list, line, struct text_line, node) { | 87 list_for_every_entry(&text_list, line, struct text_line, node) { |
| 88 const char *c; | 88 const char *c; |
| 89 int x = line->x; | 89 int x = line->x; |
| 90 for (c = line->str; *c; c++) { | 90 for (c = line->str; *c; c++) { |
| 91 font_draw_char(surface, *c, x, line->y, TEXT_COLOR); | 91 font_draw_char(surface, *c, x, line->y, TEXT_COLOR); |
| 92 x += FONT_X; | 92 x += FONT_X; |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 gfx_flush(surface); | 96 gfx_flush(surface); |
| 97 | 97 |
| 98 gfx_surface_destroy(surface); | 98 gfx_surface_destroy(surface); |
| 99 } | 99 } |
| 100 | 100 |
| OLD | NEW |