From 2834b114cfe13279b5742649cc655506c53dde8c Mon Sep 17 00:00:00 2001 From: rodri Date: Thu, 28 Sep 2023 17:18:54 +0000 Subject: added a border to the boards and corrected a bug when placing a ship. the bug allowed the player to move the ship when the cursor was outside the board in the negative side of its rframe. by using floor(2) instead of a cast to int the problem is over. --- dat.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dat.h') diff --git a/dat.h b/dat.h index f53caf9..b7fa1f8 100644 --- a/dat.h +++ b/dat.h @@ -30,8 +30,12 @@ enum { TH = TW, MAPW = 17, MAPH = MAPW, - SCRW = Boardmargin+MAPW*TW+Boardmargin, - SCRH = Boardmargin+MAPH*TH+TH+MAPH*TH+Boardmargin, + SCRW = Boardmargin + Borderwidth+MAPW*TW+Borderwidth + Boardmargin, + SCRH = Boardmargin+ + Borderwidth+MAPH*TH+Borderwidth+ + TH+ + Borderwidth+MAPH*TH+Borderwidth+ + Boardmargin, KB = 1024, BY2MAP = (TBITS*MAPW*MAPH+7)/8, @@ -136,7 +140,7 @@ struct Mlist { Mentry *entries; int nentries; - int filling; + int filling; /* lock-alike */ }; struct Menulist -- cgit v1.2.3