diff options
author | rodri <rgl@antares-labs.eu> | 2024-11-15 22:28:23 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-11-15 22:28:23 +0000 |
commit | 30ac819359e5d6de7f6622ba6c01e79457fe8277 (patch) | |
tree | e6cb97d446f753d403ed20c95a6a6d739d239656 /bts.c | |
parent | 671c2cac38ffada7f9185b87ec27b84566db8c2b (diff) | |
download | battleship-30ac819359e5d6de7f6622ba6c01e79457fe8277.tar.gz battleship-30ac819359e5d6de7f6622ba6c01e79457fe8277.tar.bz2 battleship-30ac819359e5d6de7f6622ba6c01e79457fe8277.zip |
bts: add a cover image.
Diffstat (limited to 'bts.c')
-rw-r--r-- | bts.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -135,6 +135,7 @@ char titlefontpath[] = "font/gunmetal/gunmetal.48.font"; Font *titlefont; char winspec[32]; char uid[8+1], oid[8+1]; +Image *coverimg; Sprite *spritetab[NVFX]; Vfx vfxqueue; Channel *drawchan; @@ -353,6 +354,7 @@ drawtitle(Image *dst) static char s[] = "BATTLESHIP"; string(dst, Pt(SCRW/2 - stringwidth(titlefont, s)/2, 0), pal[PCWhite], ZP, titlefont, s); + draw(dst, rectaddpt(coverimg->r, subpt(dst->r.max, subpt(coverimg->r.max, coverimg->r.min))), coverimg, nil, ZP); } void @@ -612,6 +614,8 @@ initvfx(void) { char aux[64]; + snprint(aux, sizeof aux, "%s/%s", assetdir, "vfx/battleship.png"); + coverimg = readpngimage(aux); snprint(aux, sizeof aux, "%s/%s", assetdir, "vfx/hit.png"); spritetab[VFXHit] = readpngsprite(aux, ZP, Rect(0, 0, 32, 32), 12, 100); snprint(aux, sizeof aux, "%s/%s", assetdir, "vfx/miss.png"); |