diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-11 14:35:54 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-11 14:35:54 +0100 |
commit | 5e9251bd48acafff575ed1c740e4dc05ec175508 (patch) | |
tree | 00f95aafd4e0399bcb1858f24b7e79b06a216f30 /res | |
parent | 052ca1dc143b1df2800f9c4e43daf80c96fb472e (diff) | |
download | kogata-5e9251bd48acafff575ed1c740e4dc05ec175508.tar.gz kogata-5e9251bd48acafff575ed1c740e4dc05ec175508.zip |
Add simple drawing code & font loading.
Diffstat (limited to 'res')
-rw-r--r-- | res/fonts/Makefile | 5 | ||||
-rw-r--r-- | res/fonts/default.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/res/fonts/Makefile b/res/fonts/Makefile index e1daf03..c4de63d 100644 --- a/res/fonts/Makefile +++ b/res/fonts/Makefile @@ -1,5 +1,8 @@ +CC=gcc +CFLAGS=-I../../src/lib/include -std=c11 + %.bf: %.c - gcc -o $<.bin $< + $(CC) $(CFLAGS) -o $<.bin $< ./$<.bin > $@ rm $<.bin diff --git a/res/fonts/default.c b/res/fonts/default.c index 374c191..43fddce 100644 --- a/res/fonts/default.c +++ b/res/fonts/default.c @@ -1,6 +1,8 @@ #include <stdlib.h> #include <stdio.h> +#include <proto/font_file.h> + char font_data[256][16] = { /* 0x00 */ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x01 */ {0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, @@ -260,6 +262,13 @@ char font_data[256][16] = { /* 0xff */ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, }; +ascii_bitmap_font_header h = { + .magic = ASCII_BITMAP_FONT_MAGIC, + .cw = 8, + .ch = 16, + .nchars = 256, +}; + int main() { FILE *f = fopen("default.bf", "wb"); if (f == 0) { @@ -267,6 +276,7 @@ int main() { exit(1); } + fwrite(&h, 1, sizeof(h), f); fwrite(font_data, 256, 16, f); return 0; |