diff options
author | rodri <rgl@antares-labs.eu> | 2023-09-15 15:56:10 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-09-15 15:56:10 +0000 |
commit | b6bc5d9b2c4fdb5b49042a98541e6f9758debe66 (patch) | |
tree | f0c45eaa90f168e46e232cb3927074504b0f3047 | |
parent | f343924623cdddc0037bdad31adaf593ab8c2719 (diff) | |
download | battleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.tar.gz battleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.tar.bz2 battleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.zip |
draw the game's title.
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.0-0 | bin | 0 -> 2019 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.20-3B | bin | 0 -> 25294 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.2018-2019 | bin | 0 -> 474 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.201C-201D | bin | 0 -> 834 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.2022-2022 | bin | 0 -> 378 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.3D-3D | bin | 0 -> 940 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.3F-3F | bin | 0 -> 908 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.41-5A | bin | 0 -> 22338 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.5C-5C | bin | 0 -> 1148 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.5E-5F | bin | 0 -> 4092 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.61-7A | bin | 0 -> 22338 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.E0-E0 | bin | 0 -> 1308 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.FFFD-FFFD | bin | 0 -> 2019 bytes | |||
-rw-r--r-- | assets/font/gunmetal/gunmetal.48.font | 14 | ||||
-rw-r--r-- | bts.c | 15 |
15 files changed, 29 insertions, 0 deletions
diff --git a/assets/font/gunmetal/gunmetal.48.0-0 b/assets/font/gunmetal/gunmetal.48.0-0 Binary files differnew file mode 100644 index 0000000..49f1de8 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.0-0 diff --git a/assets/font/gunmetal/gunmetal.48.20-3B b/assets/font/gunmetal/gunmetal.48.20-3B Binary files differnew file mode 100644 index 0000000..4228f0a --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.20-3B diff --git a/assets/font/gunmetal/gunmetal.48.2018-2019 b/assets/font/gunmetal/gunmetal.48.2018-2019 Binary files differnew file mode 100644 index 0000000..e889533 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.2018-2019 diff --git a/assets/font/gunmetal/gunmetal.48.201C-201D b/assets/font/gunmetal/gunmetal.48.201C-201D Binary files differnew file mode 100644 index 0000000..47aebcb --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.201C-201D diff --git a/assets/font/gunmetal/gunmetal.48.2022-2022 b/assets/font/gunmetal/gunmetal.48.2022-2022 Binary files differnew file mode 100644 index 0000000..2109d63 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.2022-2022 diff --git a/assets/font/gunmetal/gunmetal.48.3D-3D b/assets/font/gunmetal/gunmetal.48.3D-3D Binary files differnew file mode 100644 index 0000000..4e2733f --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.3D-3D diff --git a/assets/font/gunmetal/gunmetal.48.3F-3F b/assets/font/gunmetal/gunmetal.48.3F-3F Binary files differnew file mode 100644 index 0000000..1d68395 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.3F-3F diff --git a/assets/font/gunmetal/gunmetal.48.41-5A b/assets/font/gunmetal/gunmetal.48.41-5A Binary files differnew file mode 100644 index 0000000..1a2d86e --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.41-5A diff --git a/assets/font/gunmetal/gunmetal.48.5C-5C b/assets/font/gunmetal/gunmetal.48.5C-5C Binary files differnew file mode 100644 index 0000000..b9605d6 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.5C-5C diff --git a/assets/font/gunmetal/gunmetal.48.5E-5F b/assets/font/gunmetal/gunmetal.48.5E-5F Binary files differnew file mode 100644 index 0000000..585334e --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.5E-5F diff --git a/assets/font/gunmetal/gunmetal.48.61-7A b/assets/font/gunmetal/gunmetal.48.61-7A Binary files differnew file mode 100644 index 0000000..1a2d86e --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.61-7A diff --git a/assets/font/gunmetal/gunmetal.48.E0-E0 b/assets/font/gunmetal/gunmetal.48.E0-E0 Binary files differnew file mode 100644 index 0000000..82b8a3d --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.E0-E0 diff --git a/assets/font/gunmetal/gunmetal.48.FFFD-FFFD b/assets/font/gunmetal/gunmetal.48.FFFD-FFFD Binary files differnew file mode 100644 index 0000000..49f1de8 --- /dev/null +++ b/assets/font/gunmetal/gunmetal.48.FFFD-FFFD 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 @@ -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; @@ -252,6 +254,14 @@ drawboard(Image *dst, Board *b) } 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) { static char s[] = "press p to play, w to watch"; @@ -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(); |