From b6bc5d9b2c4fdb5b49042a98541e6f9758debe66 Mon Sep 17 00:00:00 2001 From: rodri Date: Fri, 15 Sep 2023 15:56:10 +0000 Subject: draw the game's title. --- assets/font/gunmetal/gunmetal.48.0-0 | Bin 0 -> 2019 bytes assets/font/gunmetal/gunmetal.48.20-3B | Bin 0 -> 25294 bytes assets/font/gunmetal/gunmetal.48.2018-2019 | Bin 0 -> 474 bytes assets/font/gunmetal/gunmetal.48.201C-201D | Bin 0 -> 834 bytes assets/font/gunmetal/gunmetal.48.2022-2022 | Bin 0 -> 378 bytes assets/font/gunmetal/gunmetal.48.3D-3D | Bin 0 -> 940 bytes assets/font/gunmetal/gunmetal.48.3F-3F | Bin 0 -> 908 bytes assets/font/gunmetal/gunmetal.48.41-5A | Bin 0 -> 22338 bytes assets/font/gunmetal/gunmetal.48.5C-5C | Bin 0 -> 1148 bytes assets/font/gunmetal/gunmetal.48.5E-5F | Bin 0 -> 4092 bytes assets/font/gunmetal/gunmetal.48.61-7A | Bin 0 -> 22338 bytes assets/font/gunmetal/gunmetal.48.E0-E0 | Bin 0 -> 1308 bytes assets/font/gunmetal/gunmetal.48.FFFD-FFFD | Bin 0 -> 2019 bytes assets/font/gunmetal/gunmetal.48.font | 14 ++++++++++++++ bts.c | 15 +++++++++++++++ 15 files changed, 29 insertions(+) create mode 100644 assets/font/gunmetal/gunmetal.48.0-0 create mode 100644 assets/font/gunmetal/gunmetal.48.20-3B create mode 100644 assets/font/gunmetal/gunmetal.48.2018-2019 create mode 100644 assets/font/gunmetal/gunmetal.48.201C-201D create mode 100644 assets/font/gunmetal/gunmetal.48.2022-2022 create mode 100644 assets/font/gunmetal/gunmetal.48.3D-3D create mode 100644 assets/font/gunmetal/gunmetal.48.3F-3F create mode 100644 assets/font/gunmetal/gunmetal.48.41-5A create mode 100644 assets/font/gunmetal/gunmetal.48.5C-5C create mode 100644 assets/font/gunmetal/gunmetal.48.5E-5F create mode 100644 assets/font/gunmetal/gunmetal.48.61-7A create mode 100644 assets/font/gunmetal/gunmetal.48.E0-E0 create mode 100644 assets/font/gunmetal/gunmetal.48.FFFD-FFFD create mode 100644 assets/font/gunmetal/gunmetal.48.font diff --git a/assets/font/gunmetal/gunmetal.48.0-0 b/assets/font/gunmetal/gunmetal.48.0-0 new file mode 100644 index 0000000..49f1de8 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.0-0 differ diff --git a/assets/font/gunmetal/gunmetal.48.20-3B b/assets/font/gunmetal/gunmetal.48.20-3B new file mode 100644 index 0000000..4228f0a Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.20-3B differ diff --git a/assets/font/gunmetal/gunmetal.48.2018-2019 b/assets/font/gunmetal/gunmetal.48.2018-2019 new file mode 100644 index 0000000..e889533 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.2018-2019 differ diff --git a/assets/font/gunmetal/gunmetal.48.201C-201D b/assets/font/gunmetal/gunmetal.48.201C-201D new file mode 100644 index 0000000..47aebcb Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.201C-201D differ diff --git a/assets/font/gunmetal/gunmetal.48.2022-2022 b/assets/font/gunmetal/gunmetal.48.2022-2022 new file mode 100644 index 0000000..2109d63 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.2022-2022 differ diff --git a/assets/font/gunmetal/gunmetal.48.3D-3D b/assets/font/gunmetal/gunmetal.48.3D-3D new file mode 100644 index 0000000..4e2733f Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.3D-3D differ diff --git a/assets/font/gunmetal/gunmetal.48.3F-3F b/assets/font/gunmetal/gunmetal.48.3F-3F new file mode 100644 index 0000000..1d68395 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.3F-3F differ diff --git a/assets/font/gunmetal/gunmetal.48.41-5A b/assets/font/gunmetal/gunmetal.48.41-5A new file mode 100644 index 0000000..1a2d86e Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.41-5A differ diff --git a/assets/font/gunmetal/gunmetal.48.5C-5C b/assets/font/gunmetal/gunmetal.48.5C-5C new file mode 100644 index 0000000..b9605d6 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.5C-5C differ diff --git a/assets/font/gunmetal/gunmetal.48.5E-5F b/assets/font/gunmetal/gunmetal.48.5E-5F new file mode 100644 index 0000000..585334e Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.5E-5F differ diff --git a/assets/font/gunmetal/gunmetal.48.61-7A b/assets/font/gunmetal/gunmetal.48.61-7A new file mode 100644 index 0000000..1a2d86e Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.61-7A differ diff --git a/assets/font/gunmetal/gunmetal.48.E0-E0 b/assets/font/gunmetal/gunmetal.48.E0-E0 new file mode 100644 index 0000000..82b8a3d Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.E0-E0 differ diff --git a/assets/font/gunmetal/gunmetal.48.FFFD-FFFD b/assets/font/gunmetal/gunmetal.48.FFFD-FFFD new file mode 100644 index 0000000..49f1de8 Binary files /dev/null and b/assets/font/gunmetal/gunmetal.48.FFFD-FFFD differ diff --git a/assets/font/gunmetal/gunmetal.48.font b/assets/font/gunmetal/gunmetal.48.font new file mode 100644 index 0000000..6517ba5 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.font @@ -0,0 +1,14 @@ +51 40 +0x20 0x3B gunmetal.48.20-3B +0x3D 0x3D gunmetal.48.3D-3D +0x3F 0x3F gunmetal.48.3F-3F +0x41 0x5A gunmetal.48.41-5A +0x5C 0x5C gunmetal.48.5C-5C +0x5E 0x5F gunmetal.48.5E-5F +0x61 0x7A gunmetal.48.61-7A +0xE0 0xE0 gunmetal.48.E0-E0 +0x2018 0x2019 gunmetal.48.2018-2019 +0x201C 0x201D gunmetal.48.201C-201D +0x2022 0x2022 gunmetal.48.2022-2022 +0x0 0x0 gunmetal.48.0-0 +0xFFFD 0xFFFD gunmetal.48.FFFD-FFFD diff --git a/bts.c b/bts.c index 380336d..0b9911e 100644 --- a/bts.c +++ b/bts.c @@ -64,6 +64,8 @@ Cursor aimcursor = { } }; char deffont[] = "/lib/font/bit/pelm/unicode.9.font"; +char titlefontpath[] = "assets/font/gunmetal/gunmetal.48.font"; +Font *titlefont; char winspec[32]; char uid[8+1], oid[8+1]; Channel *drawchan; @@ -251,6 +253,14 @@ drawboard(Image *dst, Board *b) drawtile(dst, b, Pt2(i,j,1), b->map[i][j]); } +void +drawtitle(Image *dst) +{ + static char s[] = "BATTLESHIP"; + + string(dst, Pt(SCRW/2 - stringwidth(titlefont, s)/2, 0), display->white, ZP, titlefont, s); +} + void drawgameoptions(Image *dst) { @@ -327,6 +337,7 @@ redraw(void) draw(screenb, screenb->r, display->black, nil, ZP); switch(game.state){ case Waiting0: + drawtitle(screenb); drawgameoptions(screenb); break; default: @@ -879,6 +890,10 @@ threadmain(int argc, char *argv[]) worldrf.bx = Vec2(1,0); worldrf.by = Vec2(0,1); + titlefont = openfont(display, titlefontpath); + if(titlefont == nil) + sysfatal("openfont: %r"); + inittiles(); initboards(); initarmada(); -- cgit v1.2.3