get rid of NetHack macro conflict with curses routine delay_output()

This commit is contained in:
nhmall
2023-04-21 08:25:53 -04:00
parent 71decafefd
commit 826ce951e7
20 changed files with 46 additions and 51 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ extern
#define getlin (*windowprocs.win_getlin) #define getlin (*windowprocs.win_getlin)
#define get_ext_cmd (*windowprocs.win_get_ext_cmd) #define get_ext_cmd (*windowprocs.win_get_ext_cmd)
#define number_pad (*windowprocs.win_number_pad) #define number_pad (*windowprocs.win_number_pad)
#define delay_output (*windowprocs.win_delay_output) #define nh_delay_output (*windowprocs.win_delay_output)
#ifdef CHANGE_COLOR #ifdef CHANGE_COLOR
#define change_color (*windowprocs.win_change_color) #define change_color (*windowprocs.win_change_color)
#ifdef MAC #ifdef MAC
-3
View File
@@ -294,9 +294,6 @@ E void tty_refresh_inventory(int start, int stop, int y);
/* termcap is implied if NO_TERMS is not defined */ /* termcap is implied if NO_TERMS is not defined */
#ifndef NO_TERMS #ifndef NO_TERMS
#ifndef NO_TERMCAP_HEADERS #ifndef NO_TERMCAP_HEADERS
#ifdef delay_output /* avoid conflict in curses.h */
#undef delay_output
#endif
#include <curses.h> #include <curses.h>
#ifdef clear_screen /* avoid a conflict */ #ifdef clear_screen /* avoid a conflict */
#undef clear_screen #undef clear_screen
+2 -2
View File
@@ -122,7 +122,7 @@ mkcavearea(boolean rockit)
} }
flush_screen(1); /* make sure the new glyphs shows up */ flush_screen(1); /* make sure the new glyphs shows up */
delay_output(); nh_delay_output();
} }
if (!rockit && levl[u.ux][u.uy].typ == CORR) { if (!rockit && levl[u.ux][u.uy].typ == CORR) {
@@ -1492,7 +1492,7 @@ zap_dig(void)
break; break;
room = &levl[zx][zy]; room = &levl[zx][zy];
tmp_at(zx, zy); tmp_at(zx, zy);
delay_output(); /* wait a little bit */ nh_delay_output(); /* wait a little bit */
if (pitdig) { /* we are already in a pit if this is true */ if (pitdig) { /* we are already in a pit if this is true */
coord cc; coord cc;
+4 -4
View File
@@ -1032,7 +1032,7 @@ shieldeff(coordxy x, coordxy y)
for (i = 0; i < SHIELD_COUNT; i++) { for (i = 0; i < SHIELD_COUNT; i++) {
show_glyph(x, y, cmap_to_glyph(shield_static[i])); show_glyph(x, y, cmap_to_glyph(shield_static[i]));
flush_screen(1); /* make sure the glyph shows up */ flush_screen(1); /* make sure the glyph shows up */
delay_output(); nh_delay_output();
} }
newsym(x, y); /* restore the old information */ newsym(x, y); /* restore the old information */
} }
@@ -1050,7 +1050,7 @@ tether_glyph(coordxy x, coordxy y)
/* /*
* tmp_at() * tmp_at()
* *
* Temporarily place glyphs on the screen. Do not call delay_output(). It * Temporarily place glyphs on the screen. Do not call nh_delay_output(). It
* is up to the caller to decide if it wants to wait [presently, everyone * is up to the caller to decide if it wants to wait [presently, everyone
* but explode() wants to delay]. * but explode() wants to delay].
* *
@@ -1145,7 +1145,7 @@ tmp_at(coordxy x, coordxy y)
show_glyph(tglyph->saved[i - 1].x, show_glyph(tglyph->saved[i - 1].x,
tglyph->saved[i - 1].y, tglyph->glyph); tglyph->saved[i - 1].y, tglyph->glyph);
flush_screen(0); /* make sure it shows up */ flush_screen(0); /* make sure it shows up */
delay_output(); nh_delay_output();
} }
tglyph->sidx = 1; tglyph->sidx = 1;
} }
@@ -1229,7 +1229,7 @@ flash_glyph_at(coordxy x, coordxy y, int tg, int rpt)
for (i = 0; i < rpt; i++) { for (i = 0; i < rpt; i++) {
show_glyph(x, y, glyph[i % 2]); show_glyph(x, y, glyph[i % 2]);
flush_screen(1); flush_screen(1);
delay_output(); nh_delay_output();
} }
} }
+4 -4
View File
@@ -971,7 +971,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y)
if (--*range < 0) /* make sure our range never goes negative */ if (--*range < 0) /* make sure our range never goes negative */
*range = 0; *range = 0;
if (*range != 0) if (*range != 0)
delay_output(); nh_delay_output();
return TRUE; return TRUE;
} }
@@ -1014,7 +1014,7 @@ mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
vision_recalc(0); /* new location => different lines of sight */ vision_recalc(0); /* new location => different lines of sight */
} }
flush_screen(1); flush_screen(1);
delay_output(); nh_delay_output();
set_apparxy(mon); set_apparxy(mon);
if (is_waterwall(x, y)) if (is_waterwall(x, y))
return FALSE; return FALSE;
@@ -1411,7 +1411,7 @@ sho_obj_return_to_u(struct obj *obj)
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng)); tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
while (isok(x,y) && (x != u.ux || y != u.uy)) { while (isok(x,y) && (x != u.ux || y != u.uy)) {
tmp_at(x, y); tmp_at(x, y);
delay_output(); nh_delay_output();
x -= u.dx; x -= u.dx;
y -= u.dy; y -= u.dy;
} }
@@ -1707,7 +1707,7 @@ throwit(struct obj *obj,
|| obj->oclass == VENOM_CLASS) { || obj->oclass == VENOM_CLASS) {
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng)); tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
tmp_at(gb.bhitpos.x, gb.bhitpos.y); tmp_at(gb.bhitpos.x, gb.bhitpos.y);
delay_output(); nh_delay_output();
tmp_at(DISP_END, 0); tmp_at(DISP_END, 0);
breakmsg(obj, cansee(gb.bhitpos.x, gb.bhitpos.y)); breakmsg(obj, cansee(gb.bhitpos.x, gb.bhitpos.y));
breakobj(obj, gb.bhitpos.x, gb.bhitpos.y, TRUE, TRUE); breakobj(obj, gb.bhitpos.x, gb.bhitpos.y, TRUE, TRUE);
+4 -4
View File
@@ -415,7 +415,7 @@ explode(
cmap_to_glyph(shield_static[k])); cmap_to_glyph(shield_static[k]));
} }
curs_on_u(); /* will flush screen and output */ curs_on_u(); /* will flush screen and output */
delay_output(); nh_delay_output();
} }
/* Cover last shield glyph with blast symbol. */ /* Cover last shield glyph with blast symbol. */
@@ -430,8 +430,8 @@ explode(
} }
} else { /* delay a little bit. */ } else { /* delay a little bit. */
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
} }
tmp_at(DISP_END, 0); /* clear the explosion */ tmp_at(DISP_END, 0); /* clear the explosion */
@@ -871,7 +871,7 @@ scatter(coordxy sx, coordxy sy, /* location of objects to scatter */
} else { } else {
if (scflags & VIS_EFFECTS) { if (scflags & VIS_EFFECTS) {
/* tmp_at(gb.bhitpos.x, gb.bhitpos.y); */ /* tmp_at(gb.bhitpos.x, gb.bhitpos.y); */
/* delay_output(); */ /* nh_delay_output(); */
} }
} }
stmp->ox = gb.bhitpos.x; stmp->ox = gb.bhitpos.x;
+13 -13
View File
@@ -1322,10 +1322,10 @@ findtravelpath(int mode)
for (i = 0; i < nn; ++i) { for (i = 0; i < nn; ++i) {
tmp_at(travelstepx[1 - set][i], travelstepy[1 - set][i]); tmp_at(travelstepx[1 - set][i], travelstepy[1 - set][i]);
} }
delay_output(); nh_delay_output();
if (flags.runmode == RUN_CRAWL) { if (flags.runmode == RUN_CRAWL) {
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
} }
tmp_at(DISP_END, 0); tmp_at(DISP_END, 0);
} }
@@ -1381,12 +1381,12 @@ findtravelpath(int mode)
/* Use of warning glyph is arbitrary. It stands out. */ /* Use of warning glyph is arbitrary. It stands out. */
tmp_at(DISP_ALL, warning_to_glyph(2)); tmp_at(DISP_ALL, warning_to_glyph(2));
tmp_at(px, py); tmp_at(px, py);
delay_output(); nh_delay_output();
if (flags.runmode == RUN_CRAWL) { if (flags.runmode == RUN_CRAWL) {
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
} }
tmp_at(DISP_END, 0); tmp_at(DISP_END, 0);
} }
@@ -2623,12 +2623,12 @@ runmode_delay_output(void)
/* moveloop() suppresses time_botl when running */ /* moveloop() suppresses time_botl when running */
iflags.time_botl = flags.time; iflags.time_botl = flags.time;
curs_on_u(); curs_on_u();
delay_output(); nh_delay_output();
if (flags.runmode == RUN_CRAWL) { if (flags.runmode == RUN_CRAWL) {
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
} }
} }
} }
+1 -1
View File
@@ -282,7 +282,7 @@ show_transient_light(struct obj *obj, coordxy x, coordxy y)
} }
if (obj) { /* take thrown/kicked candle or lamp off the map */ if (obj) { /* take thrown/kicked candle or lamp off the map */
delay_output(); nh_delay_output();
remove_object(obj); remove_object(obj);
} }
} }
+2 -2
View File
@@ -343,7 +343,7 @@ md_rush(struct monst *md,
place_monster(md, fx, fy); /* put md down */ place_monster(md, fx, fy); /* put md down */
newsym(fx, fy); /* see it */ newsym(fx, fy); /* see it */
flush_screen(0); /* make sure md shows up */ flush_screen(0); /* make sure md shows up */
delay_output(); /* wait a little bit */ nh_delay_output(); /* wait a little bit */
/* Remove md from the dungeon. Restore original mon, if necessary. */ /* Remove md from the dungeon. Restore original mon, if necessary. */
remove_monster(fx, fy); remove_monster(fx, fy);
@@ -380,7 +380,7 @@ md_rush(struct monst *md,
place_monster(md, fx, fy); /* place at final spot */ place_monster(md, fx, fy); /* place at final spot */
newsym(fx, fy); newsym(fx, fy);
flush_screen(0); flush_screen(0);
delay_output(); /* wait a little bit */ nh_delay_output(); /* wait a little bit */
return TRUE; return TRUE;
} }
+1 -1
View File
@@ -2001,7 +2001,7 @@ mkinvokearea(void)
} }
flush_screen(1); /* make sure the new glyphs shows up */ flush_screen(1); /* make sure the new glyphs shows up */
delay_output(); nh_delay_output();
} }
You("are standing at the top of a stairwell leading down!"); You("are standing at the top of a stairwell leading down!");
+2 -2
View File
@@ -757,10 +757,10 @@ m_throw(
break; break;
} }
tmp_at(gb.bhitpos.x, gb.bhitpos.y); tmp_at(gb.bhitpos.x, gb.bhitpos.y);
delay_output(); nh_delay_output();
} }
tmp_at(gb.bhitpos.x, gb.bhitpos.y); tmp_at(gb.bhitpos.x, gb.bhitpos.y);
delay_output(); nh_delay_output();
tmp_at(DISP_END, 0); tmp_at(DISP_END, 0);
gm.mesg_given = 0; /* reset */ gm.mesg_given = 0; /* reset */
+1 -1
View File
@@ -3680,7 +3680,7 @@ shkcatch(
the(xname(obj))); the(xname(obj)));
if (!canspotmon(shkp)) if (!canspotmon(shkp))
map_invisible(x, y); map_invisible(x, y);
delay_output(); nh_delay_output();
mark_synch(); mark_synch();
} }
subfrombill(obj, shkp); subfrombill(obj, shkp);
+1 -1
View File
@@ -2943,7 +2943,7 @@ launch_obj(
/* dstage@u.washington.edu -- Delay only if hero sees it */ /* dstage@u.washington.edu -- Delay only if hero sees it */
if (cansee(gb.bhitpos.x, gb.bhitpos.y)) if (cansee(gb.bhitpos.x, gb.bhitpos.y))
while (tmp-- > 0) while (tmp-- > 0)
delay_output(); nh_delay_output();
gb.bhitpos.x += dx; gb.bhitpos.x += dx;
gb.bhitpos.y += dy; gb.bhitpos.y += dy;
+2 -2
View File
@@ -4605,8 +4605,8 @@ start_engulf(struct monst *mdef)
You("%s %s%s!", You("%s %s%s!",
u_digest ? "swallow" : u_enfold ? "enclose" : "engulf", u_digest ? "swallow" : u_enfold ? "enclose" : "engulf",
mon_nam(mdef), u_digest ? " whole" : ""); mon_nam(mdef), u_digest ? " whole" : "");
delay_output(); nh_delay_output();
delay_output(); nh_delay_output();
} }
static void static void
+1 -1
View File
@@ -562,7 +562,7 @@ static struct window_procs hup_procs = {
hup_int_ndecl, /* doprev_message */ hup_int_ndecl, /* doprev_message */
hup_yn_function, hup_getlin, hup_int_ndecl, /* get_ext_cmd */ hup_yn_function, hup_getlin, hup_int_ndecl, /* get_ext_cmd */
hup_void_fdecl_int, /* number_pad */ hup_void_fdecl_int, /* number_pad */
hup_void_ndecl, /* delay_output */ hup_void_ndecl, /* nh_delay_output */
#ifdef CHANGE_COLOR #ifdef CHANGE_COLOR
hup_change_color, hup_change_color,
#ifdef MAC #ifdef MAC
+3 -3
View File
@@ -3772,7 +3772,7 @@ bhit(
newsym(x, y); newsym(x, y);
} }
tmp_at(gb.bhitpos.x, gb.bhitpos.y); tmp_at(gb.bhitpos.x, gb.bhitpos.y);
delay_output(); nh_delay_output();
/* kicked objects fall in pools */ /* kicked objects fall in pools */
if ((weapon == KICKED_WEAPON) if ((weapon == KICKED_WEAPON)
&& (is_pool(gb.bhitpos.x, gb.bhitpos.y) && (is_pool(gb.bhitpos.x, gb.bhitpos.y)
@@ -3891,7 +3891,7 @@ boomhit(struct obj *obj, coordxy dx, coordxy dy)
} }
} }
tmp_at(gb.bhitpos.x, gb.bhitpos.y); tmp_at(gb.bhitpos.x, gb.bhitpos.y);
delay_output(); nh_delay_output();
if (IS_SINK(levl[gb.bhitpos.x][gb.bhitpos.y].typ)) { if (IS_SINK(levl[gb.bhitpos.x][gb.bhitpos.y].typ)) {
Soundeffect(se_boomerang_klonk, 75); Soundeffect(se_boomerang_klonk, 75);
if (!Deaf) if (!Deaf)
@@ -4467,7 +4467,7 @@ dobuzz(
if (ZAP_POS(levl[sx][sy].typ) if (ZAP_POS(levl[sx][sy].typ)
|| (isok(lsx, lsy) && cansee(lsx, lsy))) || (isok(lsx, lsy) && cansee(lsx, lsy)))
tmp_at(sx, sy); tmp_at(sx, sy);
delay_output(); /* wait a little */ nh_delay_output(); /* wait a little */
} }
/* hit() and miss() need gb.bhitpos to match the target */ /* hit() and miss() need gb.bhitpos to match the target */
-1
View File
@@ -38,7 +38,6 @@
#endif /* POSIX_TYPES */ #endif /* POSIX_TYPES */
#ifdef LINUX #ifdef LINUX
#include <sys/ioctl.h> #include <sys/ioctl.h>
#undef delay_output /* curses redefines this */
#include <curses.h> #include <curses.h>
#endif #endif
#define kill_sym c_cc[VKILL] #define kill_sym c_cc[VKILL]
+2 -2
View File
@@ -1725,10 +1725,10 @@ X11_sig_cb(XtPointer not_used, XtSignalId *id)
} }
#endif #endif
/* delay_output ----------------------------------------------------------- */ /* X11_delay_output ------------------------------------------------------- */
/* /*
* Timeout callback for delay_output(). Send a fake message to the map * Timeout callback for X11_delay_output(). Send a fake message to the map
* window. * window.
*/ */
/* ARGSUSED */ /* ARGSUSED */
+2 -2
View File
@@ -8,7 +8,7 @@ NETHACK INTERFACE
* Implement curses_rip for optional fancier color tombstone, as well * Implement curses_rip for optional fancier color tombstone, as well
as one that will display correctly on smaller terminals. as one that will display correctly on smaller terminals.
* I am confused as to how mark_synch, wait_synch, and delay_output * I am confused as to how mark_synch, wait_synch, and nh_delay_output
should work. Help, please? should work. Help, please?
* Both PDCurses and Ncurses have mouse support, so the poskey function * Both PDCurses and Ncurses have mouse support, so the poskey function
@@ -34,7 +34,7 @@ DISPLAY
PDCurses, however. PDCurses, however.
* Animation effects do not display properly - this could probably be * Animation effects do not display properly - this could probably be
fixed with a correct implementation of the delay_output function. fixed with a correct implementation of the curses_delay_output function.
* Support option to set forground and background colors for individual * Support option to set forground and background colors for individual
windows windows
-1
View File
@@ -837,7 +837,6 @@ cl_eos(void) /* free after Robert Viduya */
macros used elsewhere within nethack; fortunately they're macros used elsewhere within nethack; fortunately they're
not needed beyond this point, so we don't need to worry not needed beyond this point, so we don't need to worry
about reconstructing them after the header file inclusion. */ about reconstructing them after the header file inclusion. */
#undef delay_output
#undef TRUE #undef TRUE
#undef FALSE #undef FALSE
#define m_move curses_m_move /* Some curses.h decl m_move(), not used here */ #define m_move curses_m_move /* Some curses.h decl m_move(), not used here */