parent
d730844f65
commit
1cce3bbeaf
|
@ -24,6 +24,7 @@ set(ASSETS
|
|||
)
|
||||
|
||||
set(ASSETS_fx
|
||||
assets-fx/kenney_mini.png
|
||||
)
|
||||
|
||||
set(ASSETS_cg
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
kenney_mini.png:
|
||||
name: font_kenney_mini
|
||||
type: font
|
||||
charset: print
|
||||
grid.size: 6x9
|
||||
proportional: true
|
Binary file not shown.
After Width: | Height: | Size: 490 B |
|
@ -1,27 +1,41 @@
|
|||
#include "disp.h"
|
||||
#include <gint/display.h>
|
||||
#include <gint/keyboard.h>
|
||||
|
||||
#ifdef FX9860G
|
||||
extern font_t font_kenney_mini;
|
||||
#endif
|
||||
|
||||
static int line_height = 0;
|
||||
|
||||
static void draw_line(int x, int y, char *buffer, int len);
|
||||
|
||||
void
|
||||
disp_display(void)
|
||||
{
|
||||
static int line_height = 0;
|
||||
const int x = 2;
|
||||
#ifdef FX9860G
|
||||
int y = -2;
|
||||
#else
|
||||
int y = 2;
|
||||
#endif
|
||||
char *buffer_cursor = disp_buffer;
|
||||
int line_length = 0;
|
||||
|
||||
if (!line_height)
|
||||
if (!line_height) {
|
||||
#ifdef FX9860G
|
||||
dfont(&font_kenney_mini);
|
||||
line_height = 6;
|
||||
#else
|
||||
line_height = dfont_default()->line_height;
|
||||
#endif
|
||||
}
|
||||
|
||||
while (buffer_cursor[line_length] != '\0') {
|
||||
if (buffer_cursor[line_length] == '\n') {
|
||||
draw_line(x, y, buffer_cursor, line_length);
|
||||
buffer_cursor += line_length + 1;
|
||||
line_length = 0;
|
||||
y += line_height;
|
||||
y += line_height + 1;
|
||||
} else
|
||||
line_length += 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue