Skip to content

Commit 1ed5767

Browse files
committed
New alpha
1 parent d5d76b3 commit 1ed5767

File tree

14 files changed

+88
-21
lines changed

14 files changed

+88
-21
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mangband.cfg
22
mangband.drc
33
*.exe
44
mangband.map
5-
mangband.tds
5+
*.tds
66
mangclient.ini
77
Roadmap.txt
88
/debug

changes.txt

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Angband 4.2.x:
2020
- Allow fuel to be drawn from the quiver
2121
- Display average damage for devices, spells, and activations
2222
- Allow CMD_WIELD to select from the quiver
23+
- Take into account sidebar/topbar in double-height tile rendering
2324

2425
MAngband 1.5.x:
2526

@@ -34,6 +35,8 @@ MAngband 1.5.x:
3435
- Add Ctrl+E toggle_inven_equip command from V
3536
- Add some shared monster messages
3637
- Hitpoint warning toggle hotkey
38+
- Use font-tng.prf instead of font-sdl.prf for "tg" fonts
39+
- Change visual mapping for PvP arena wall
3740

3841
PWMAngband:
3942

@@ -237,6 +240,8 @@ MAngband 1.5.x:
237240
- Stop resending whole equipment/inventory when a single item is affected
238241
- Add most of the missing bell() calls
239242
- Fix ESC key not clearing the queue
243+
- Add error condition check to file_putf
244+
- Don't use handle_stuff() in adjust_level()
240245

241246
PWMAngband:
242247

lib/customize/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include $(MKPATH)buildsys.mk
33

44
CONFIG = \
55
font-gcu.prf font-sdl.prf font-win.prf font-x11.prf font.prf \
6+
font-tng.prf \
67
keys-gcu.prf message.prf pref.prf user.prf sound.prf \
78
class.prf presets.prf race.prf
89

lib/customize/font-tng.prf

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# File: font-tng.prf
2+
3+
#
4+
# Tangar 1-bit roguelike font mapping.
5+
#
6+
# Note that this file is a pure copy of the font-sdl.prf file by default and
7+
# doesn't include any mapping. These have to be added manually.
8+
#
9+
10+
11+
### Terrain features ###
12+
13+
# Floors (white : centered dot)
14+
#feat:open floor:*:1:7
15+
feat:open floor:*:7:7
16+
17+
# Simplified version to specify default attribute for all lighting effects
18+
# glyph : terrain name : symbol
19+
# glyph:open floor:7
20+
21+
22+
### Monster features ###
23+
24+
# Regular version to bypass default value from monster.txt
25+
# monster : name : attr : char
26+
# monster:Uvatha the Horseman:1:205
27+
#
28+
# Simplified version to specify default attribute (client only)
29+
# monster-char : name : char
30+
# monster-char:Uvatha the Horseman:205
31+
#
32+
# Alternate version to specify attr by symbol (client only)
33+
# monster-attr : name : attr : char
34+
# monster-attr:Uvatha the Horseman:w:205

lib/customize/font.prf

+3
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
?:[EQU $SYS gcu]
1919
%:font-gcu.prf
2020

21+
?:[IOR [EQU $FONTNAME 21x31tg.fon] [EQU $FONTNAME 24x36tg.fon]]
22+
%:font-tng.prf
23+
2124
?:1

lib/tiles/gervais/32x32.png

5.6 KB
Loading

lib/tiles/gervais/graf-dvg.prf

+4-4
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,10 @@ feat:house wall:los:0x99:0x81
281281
feat:house wall:lit:0x99:0x82
282282
feat:house wall:dark:0x99:0x82
283283

284-
feat:arena wall:torch:0x99:0x80
285-
feat:arena wall:los:0x99:0x81
286-
feat:arena wall:lit:0x99:0x82
287-
feat:arena wall:dark:0x99:0x82
284+
feat:arena wall:torch:0x98:0xF5
285+
feat:arena wall:los:0x98:0xF6
286+
feat:arena wall:lit:0x98:0xF7
287+
feat:arena wall:dark:0x98:0xF7
288288

289289
# water
290290
feat:water:torch:0x97:0x92

src/client/main-sdl.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static errr sdl_FontCreate(sdl_Font *font, const char *fontname, SDL_Surface *su
407407
/*
408408
* Draw some text onto a surface, allowing shaded backgrounds.
409409
* The surface is first checked to see if it is compatible with
410-
* this font, if it isn't the the font will be 're-precalculated'.
410+
* this font, if it isn't then the font will be 're-precalculated'.
411411
*
412412
* You can, I suppose, use one font on many surfaces, but it is
413413
* definitely not recommended. One font per surface is good enough.
@@ -448,7 +448,7 @@ static errr sdl_mapFontDraw(sdl_Font *font, SDL_Surface *surface, SDL_Color colo
448448
/*
449449
* Draw some text onto a surface
450450
* The surface is first checked to see if it is compatible with
451-
* this font, if it isn't the the font will be 're-precalculated'
451+
* this font, if it isn't then the font will be 're-precalculated'
452452
*
453453
* You can, I suppose, use one font on many surfaces, but it is
454454
* definitely not recommended. One font per surface is good enough.
@@ -2906,7 +2906,7 @@ static errr Term_bigcurs_sdl(int col, int row)
29062906

29072907
/* If we are using overdraw, draw a double height cursor (disabled for now) */
29082908
/*if (!Term_info(col, row, &a, &c, &ta, &tc)) j = (a & 0x7F);
2909-
if (overdraw && (j > 2) && (j >= overdraw) && (j <= overdraw_max))
2909+
if (overdraw && (j > ROW_MAP + 1) && (j >= overdraw) && (j <= overdraw_max))
29102910
{
29112911
rc.y -= rc.h;
29122912
rc.h = (rc.h << 1);
@@ -3184,7 +3184,7 @@ static void sdl_DrawTile(term_window *win, int col, int row, SDL_Rect rc, SDL_Re
31843184
}
31853185

31863186
/* If we are using overdraw, draw the top rectangle */
3187-
if (overdraw && (row > 2) && (j >= overdraw) && (j <= overdraw_max))
3187+
if (overdraw && (row > ROW_MAP + 1) && (j >= overdraw) && (j <= overdraw_max))
31883188
{
31893189
/* Double the height */
31903190
src.y -= rc.h;
@@ -3325,7 +3325,7 @@ static errr Term_text_sdl(int col, int row, int n, u16b a, const char *s)
33253325
tilex = COL_MAP + ((col - COL_MAP + i) / tile_wid) * tile_wid;
33263326
tiley = ROW_MAP + ((row - ROW_MAP) / tile_hgt + j) * tile_hgt;
33273327

3328-
if (overdraw && (tiley > 2) && !Term_info(tilex, tiley, &fa, &fc, &ta, &tc))
3328+
if (overdraw && (tiley > ROW_MAP + 1) && !Term_info(tilex, tiley, &fa, &fc, &ta, &tc))
33293329
{
33303330
int row = (fa & 0x7F);
33313331
int trow = (ta & 0x7F);
@@ -3440,7 +3440,7 @@ static errr Term_pict_sdl(int col, int row, int n, const u16b *ap, const char *c
34403440
/* Redraw the bottom tile (recursively) */
34413441
while (j)
34423442
{
3443-
if (overdraw && (row + j * tile_hgt > 2) &&
3443+
if (overdraw && (row + j * tile_hgt > ROW_MAP + 1) &&
34443444
!Term_info(col + i * tile_wid, row + j * tile_hgt, &a, &c, &ta, &tc))
34453445
{
34463446
int frow = (a & 0x7F);
@@ -3743,6 +3743,9 @@ static void init_windows(void)
37433743

37443744
/* Term 0 is at the top */
37453745
Zorder[i] = ANGBAND_TERM_MAX - i - 1;
3746+
3747+
/* Hack -- set ANGBAND_FONTNAME for main window */
3748+
if (i == 0) ANGBAND_FONTNAME = win->req_font;
37463749
}
37473750

37483751
/* Good to go... */

src/client/main-win.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ static errr Term_bigcurs_win(int x, int y)
16411641
int j = 0;
16421642

16431643
if (!Term_info(x, y, &a, &c, &ta, &tc)) j = (a & 0x7F);
1644-
if ((j > 2) && (j >= overdraw) && (j <= overdrawmax))
1644+
if ((j > ROW_MAP + 1) && (j >= overdraw) && (j <= overdrawmax))
16451645
{
16461646
rc.top -= tile_height * tile_hgt;
16471647
rc.bottom = rc.top + ((tile_height * tile_hgt) << 1);
@@ -1973,14 +1973,14 @@ static void Term_pict_win_aux(int x, int y, int n, const u16b *ap, const char *c
19731973
StretchBlt(hdc, x2, y2, tw2, th2, hdcSrc, x3, y3, w1, h1, SRCCOPY);
19741974
}
19751975

1976-
if (overdraw && (trow >= overdraw) && (y > 2) && (trow <= overdrawmax))
1976+
if (overdraw && (trow >= overdraw) && (y > ROW_MAP + 1) && (trow <= overdrawmax))
19771977
AlphaBlend(hdc, x2, y2 - th2, tw2, th2, hdcSrc, x3, y3 - h1, w1, h1, blendfn);
19781978

19791979
/* Only draw if terrain and overlay are different */
19801980
if ((x1 != x3) || (y1 != y3))
19811981
{
19821982
/* Copy the picture from the bitmap to the window */
1983-
if (overdraw && (row >= overdraw) && (y > 2) && (row <= overdrawmax))
1983+
if (overdraw && (row >= overdraw) && (y > ROW_MAP + 1) && (row <= overdrawmax))
19841984
{
19851985
AlphaBlend(hdc, x2, y2 - th2, tw2, th2 * 2, hdcSrc, x1, y1 - h1, w1, h1 * 2,
19861986
blendfn);
@@ -2064,7 +2064,7 @@ static errr Term_text_win(int x, int y, int n, u16b a, const char *s)
20642064
tilex = COL_MAP + ((x - COL_MAP + i) / tile_wid) * tile_wid;
20652065
tiley = ROW_MAP + ((y - ROW_MAP) / tile_hgt + j) * tile_hgt;
20662066

2067-
if (overdraw && (tiley > 2) && !Term_info(tilex, tiley, &fa, &fc, &ta, &tc))
2067+
if (overdraw && (tiley > ROW_MAP + 1) && !Term_info(tilex, tiley, &fa, &fc, &ta, &tc))
20682068
{
20692069
int row = (fa & 0x7F);
20702070
int trow = (ta & 0x7F);
@@ -2147,7 +2147,7 @@ static errr Term_pict_win(int x, int y, int n, const u16b *ap, const char *cp, c
21472147

21482148
while (j)
21492149
{
2150-
if (overdraw && (y + j * tile_hgt > 2) &&
2150+
if (overdraw && (y + j * tile_hgt > ROW_MAP + 1) &&
21512151
!Term_info(x + i * tile_wid, y + j * tile_hgt, &a, &c, &ta, &tc))
21522152
{
21532153
int row = (a & 0x7F);

src/client/ui-prefs.c

+3
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ static const char *process_pref_file_expr(char **sp, char *fp)
475475
/* System */
476476
if (streq(b+1, "SYS")) v = ANGBAND_SYS;
477477

478+
/* Specific font */
479+
else if (streq(b+1, "FONTNAME")) v = ANGBAND_FONTNAME;
480+
478481
/* Race */
479482
else if (streq(b+1, "RACE")) v = player->race->name;
480483

src/common/z-file.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,20 @@ bool file_vputf(ang_file *f, const char *fmt, va_list vp)
750750
#else
751751
char buf[MSG_LEN];
752752
#endif
753+
int n;
753754

754755
if (!f) return false;
755756

756-
vstrnfmt(buf, sizeof(buf), fmt, vp);
757+
n = vstrnfmt(buf, sizeof(buf), fmt, vp);
758+
759+
/*
760+
* The semantics of vstrnfmt are weird and its return
761+
* value is ill-defined. However, return value of zero
762+
* almost definitely means there was an error (unless you pass it
763+
* an empty format string with zero varargs, I guess).
764+
*/
765+
if (n == 0) return false;
766+
757767
return file_put(f, buf);
758768
}
759769

src/common/z-type.c

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
const char *ANGBAND_SYS = "xxx";
2929

3030

31+
/*
32+
* Hack -- the font used
33+
* This variable is used to choose an appropriate "pref-xxx" file
34+
*/
35+
const char *ANGBAND_FONTNAME = "xxx";
36+
37+
3138
/*
3239
* Various directories. These are no longer necessarily all subdirs of "lib"
3340
*/

src/common/z-type.h

+1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ struct angband_constants
308308
extern struct angband_constants *z_info;
309309

310310
extern const char *ANGBAND_SYS;
311+
extern const char *ANGBAND_FONTNAME;
311312

312313
extern char *ANGBAND_DIR_GAMEDATA;
313314
extern char *ANGBAND_DIR_CUSTOMIZE;

src/server/player.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ static void adjust_level(struct player *p)
155155
/* Redraw experience */
156156
p->upkeep->redraw |= (PR_EXP);
157157

158-
/* Handle stuff */
159-
handle_stuff(p);
158+
/* Update stuff */
159+
update_stuff(p, chunk_get(&p->wpos));
160160

161161
/* Lose levels while possible */
162162
while ((p->lev > 1) && (p->exp < adv_exp(p->lev - 1, p->expfact)))
@@ -233,8 +233,8 @@ static void adjust_level(struct player *p)
233233
set_redraw_equip(p, NULL);
234234
}
235235

236-
/* Handle stuff */
237-
handle_stuff(p);
236+
/* Update stuff */
237+
update_stuff(p, chunk_get(&p->wpos));
238238
}
239239

240240

0 commit comments

Comments
 (0)