summaryrefslogtreecommitdiff
path: root/examples/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ui.c')
-rwxr-xr-xexamples/ui.c70
1 files changed, 1 insertions, 69 deletions
diff --git a/examples/ui.c b/examples/ui.c
index 32d694e..cdc34ef 100755
--- a/examples/ui.c
+++ b/examples/ui.c
@@ -176,7 +176,7 @@ Platform platform = {0};
#define CHAR_NUM_BITS_Y 7
u64 bitfont[] = {
-#include "bitfont.inl.c"
+ 0x1041040000000000, 0x14500100, 0x38538429f28a7ca0, 0x621421f085084394, 0x10472450c614, 0x420410410420000, 0x233f312042082082, 0x411f10400001, 0x1f0000010800000, 0x4100040000000000, 0xc51451c004108208, 0x1c00070820830001, 0x71021070001c1084, 0x470001041c514000, 0x1c51c11800031070, 0x51c0002082107000, 0x31071470001c51c, 0x800000400010000, 0x102042100042000, 0x20400003c03c000, 0x20021050800421, 0xf24918e05955944e, 0x801c924724700924, 0x2492470062410491, 0xf00f0411c13c01c9, 0x4d04918004104704, 0x1c024924f2490062, 0x5104107007082082, 0x410092450c524008, 0x4557db4401c10410, 0x91804516554d1011, 0x411c924700624924, 0x2472062492491800, 0x62481811802491c9, 0x4924010410411f00, 0x10a4514510062492, 0x429100a7d5551440, 0x108429144045128, 0x410c03c108420f0, 0x41020820410c1041, 0x112840c20820820c, 0x3c00000000000000, 0xf206000000000081, 0x1c924704000624, 0x24e2000062412460, 0x604f246000389, 0x892460000821c218, 0x2491c10401883, 0x20c0080007083002, 0x4100514314500108, 0x55554f0000810410, 0x60002492491c0015, 0x472491c000624924, 0x14000838924e0000, 0x6206046000041043, 0x490000820821c000, 0x10a45144000e2492, 0xa44000a7d5451000, 0x108429100044a10, 0x821003c11883c00, 0x1041041041102081, 0x66604208408204, 0x0, 0x1,
};
void print_text(u32 color, i32 x, i32 y, f64 width, f64 height, i64 num_chars, c8 *text) {
@@ -252,74 +252,6 @@ void print_text(u32 color, i32 x, i32 y, f64 width, f64 height, i64 num_chars, c
}
i32 main(i32 argc, c8 **argv) {
- c8 static data[] =
- " ! ' ' $ % && ' ( ) * * / "
- " ! ' ' # # $$$ % % & & ' ( ) ** + / "
- " ! ##### $ $ % && ( ) ****** + / "
- " ! # # $$$ %%%%% && ( ) ** +++++ ----- / "
- " # # $ $ % & & ( ) * * + / "
- " ! ##### $$$ % % & & ( ) + , . / "
- " # # $ % &&& ( ) , / "
- " ? "
- "000 11 222 333 4 4 555 66 777 888 999 < > ? ? "
- "0 0 1 2 3 4 4 5 6 7 8 8 9 9 : ; < ==== > ? "
- "0 0 1 2 3 444 555 666 7 888 999 < > ? "
- "0 0 1 2 3 4 5 6 6 7 8 8 9 < ==== > "
- "000 111 222 333 4 55 666 7 888 99 : ; < > ? "
- " ; "
- " @@@ AA BBB CC DDD EEEE FFFF GG H H III JJJ K K L M M N N OO "
- "@ @ A A B B C C D D E F G G H H I J K K L MM MM NN N O O "
- "@ @@ A A BBB C D D EEE FFF G HHHH I J KK L MMMMM N N N O O "
- "@ @ @ AAAA B B C D D E F G GG H H I J K K L M M M N NN O O "
- "@ @@ A A B B C C D D E F G G H H I J J K K L M M N N O O "
- "@ A A BBB CC DDD EEEE F GG H H III J K K LLL M M N N OO "
- " @@@ "
- "PPP QQ RRR SS TTTTT U U V V W W X X Y Y ZZZZ [[ x ]] ^ "
- "P P Q Q R R S T U U V V W W X X Y Y Z [ x ] ^ ^ "
- "P P Q Q R R SS T U U V V W W W X Y Y Z [ x ] ^ ^ "
- "PPP Q Q RRR S T U U V V W W W X X Y Z [ x ] "
- "P Q Q R R S S T U U V V WWWWW X X Y Z [ x ] "
- "P QQ R R SS T UU V W W X X Y ZZZZ [ x ] "
- " Q [[ x ]] ____ "
- "` l "
- " ` aa b cc d ee ff gg h i j k k l mmmm nnn oo "
- " a bbb c c ddd e e f g g h k k l m m m n n o o "
- " aaaa b b c d d eeee fff g g hhh ii jj kk l m m m n n o o "
- " a a b b c c d d e f ggg h h i j k k l m m m n n o o "
- " aa bbb cc ddd ee f g h h iii j k k l m m m n n oo "
- " gg j "
- " { | } ~~ ~ "
- "ppp qqq r r ss ttt u u v v w w x x y y zzzz { | } ~ ~~ "
- "p p q q rr s t u u v v w w x x y y z { | } "
- "p p q q r ss t u u v v w w w x y zz { | } "
- "ppp qqq r s t u u v v wwwww x x y z { | } "
- "p q r ss t uuu v w w x x y zzzz { | } "
- " { | } "
- ;
-
- u64 bits[(16 * 8 * CHAR_NUM_BITS_X * CHAR_NUM_BITS_Y) / 64] = {0};
-
- for (i64 j = 0; j < 8; ++j)
- for (i64 i = 0; i < 16; ++i)
- for (i64 y = 0; y < CHAR_NUM_BITS_Y; ++y)
- for (i64 x = 0; x < CHAR_NUM_BITS_X; ++x) {
- i64 num_char = j * 16 + i;
- i64 num_bit = y * CHAR_NUM_BITS_X + x;
- i64 bit_index = num_char * CHAR_NUM_BITS_X * CHAR_NUM_BITS_Y + num_bit;
- i64 qword_index = bit_index / 64;
- u64 mask = 1ull << (bit_index % 64);
- i64 dx = i * CHAR_NUM_BITS_X + x;
- i64 dy = j * CHAR_NUM_BITS_Y + y;
- i64 index = dy * CHAR_NUM_BITS_X * 16 + dx;
- if (index < (i64) (sizeof data / sizeof *data) && data[index] != ' ')
- bits[qword_index] |= mask;
- }
-
- FILE *f = fopen("bitfont.inl.c", "wb");
- for (i64 i = 0; i < (i64) (sizeof bits / sizeof *bits); ++i)
- fprintf(f, "0x%llx,%s", bits[i], i + 1 < (i64) (sizeof bits / sizeof *bits) ? " " : "\n");
- fclose(f);
-
(void) argc;
(void) argv;