aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-09-15 15:56:10 +0000
committerrodri <rgl@antares-labs.eu>2023-09-15 15:56:10 +0000
commitb6bc5d9b2c4fdb5b49042a98541e6f9758debe66 (patch)
treef0c45eaa90f168e46e232cb3927074504b0f3047
parentf343924623cdddc0037bdad31adaf593ab8c2719 (diff)
downloadbattleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.tar.gz
battleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.tar.bz2
battleship-b6bc5d9b2c4fdb5b49042a98541e6f9758debe66.zip
draw the game's title.
-rw-r--r--assets/font/gunmetal/gunmetal.48.0-0bin0 -> 2019 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.20-3Bbin0 -> 25294 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.2018-2019bin0 -> 474 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.201C-201Dbin0 -> 834 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.2022-2022bin0 -> 378 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.3D-3Dbin0 -> 940 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.3F-3Fbin0 -> 908 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.41-5Abin0 -> 22338 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.5C-5Cbin0 -> 1148 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.5E-5Fbin0 -> 4092 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.61-7Abin0 -> 22338 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.E0-E0bin0 -> 1308 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.FFFD-FFFDbin0 -> 2019 bytes
-rw-r--r--assets/font/gunmetal/gunmetal.48.font14
-rw-r--r--bts.c15
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
new file mode 100644
index 0000000..49f1de8
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.0-0
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.20-3B
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.2018-2019
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.201C-201D
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.2022-2022
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.3D-3D
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.3F-3F
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.41-5A
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.5C-5C
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.5E-5F
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.61-7A
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.E0-E0
Binary files 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
--- /dev/null
+++ b/assets/font/gunmetal/gunmetal.48.FFFD-FFFD
Binary files 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;
@@ -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();