get rid of NetHack macro conflict with curses routine delay_output()
This commit is contained in:
@@ -145,7 +145,7 @@ extern
|
||||
#define getlin (*windowprocs.win_getlin)
|
||||
#define get_ext_cmd (*windowprocs.win_get_ext_cmd)
|
||||
#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
|
||||
#define change_color (*windowprocs.win_change_color)
|
||||
#ifdef MAC
|
||||
|
||||
@@ -294,9 +294,6 @@ E void tty_refresh_inventory(int start, int stop, int y);
|
||||
/* termcap is implied if NO_TERMS is not defined */
|
||||
#ifndef NO_TERMS
|
||||
#ifndef NO_TERMCAP_HEADERS
|
||||
#ifdef delay_output /* avoid conflict in curses.h */
|
||||
#undef delay_output
|
||||
#endif
|
||||
#include <curses.h>
|
||||
#ifdef clear_screen /* avoid a conflict */
|
||||
#undef clear_screen
|
||||
|
||||
@@ -122,7 +122,7 @@ mkcavearea(boolean rockit)
|
||||
}
|
||||
|
||||
flush_screen(1); /* make sure the new glyphs shows up */
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
|
||||
if (!rockit && levl[u.ux][u.uy].typ == CORR) {
|
||||
@@ -1492,7 +1492,7 @@ zap_dig(void)
|
||||
break;
|
||||
room = &levl[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 */
|
||||
coord cc;
|
||||
|
||||
@@ -1032,7 +1032,7 @@ shieldeff(coordxy x, coordxy y)
|
||||
for (i = 0; i < SHIELD_COUNT; i++) {
|
||||
show_glyph(x, y, cmap_to_glyph(shield_static[i]));
|
||||
flush_screen(1); /* make sure the glyph shows up */
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
newsym(x, y); /* restore the old information */
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ tether_glyph(coordxy x, coordxy y)
|
||||
/*
|
||||
* 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
|
||||
* but explode() wants to delay].
|
||||
*
|
||||
@@ -1145,7 +1145,7 @@ tmp_at(coordxy x, coordxy y)
|
||||
show_glyph(tglyph->saved[i - 1].x,
|
||||
tglyph->saved[i - 1].y, tglyph->glyph);
|
||||
flush_screen(0); /* make sure it shows up */
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
tglyph->sidx = 1;
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ flash_glyph_at(coordxy x, coordxy y, int tg, int rpt)
|
||||
for (i = 0; i < rpt; i++) {
|
||||
show_glyph(x, y, glyph[i % 2]);
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -971,7 +971,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y)
|
||||
if (--*range < 0) /* make sure our range never goes negative */
|
||||
*range = 0;
|
||||
if (*range != 0)
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1014,7 +1014,7 @@ mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
|
||||
vision_recalc(0); /* new location => different lines of sight */
|
||||
}
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
set_apparxy(mon);
|
||||
if (is_waterwall(x, y))
|
||||
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));
|
||||
while (isok(x,y) && (x != u.ux || y != u.uy)) {
|
||||
tmp_at(x, y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
x -= u.dx;
|
||||
y -= u.dy;
|
||||
}
|
||||
@@ -1707,7 +1707,7 @@ throwit(struct obj *obj,
|
||||
|| obj->oclass == VENOM_CLASS) {
|
||||
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
|
||||
tmp_at(gb.bhitpos.x, gb.bhitpos.y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
tmp_at(DISP_END, 0);
|
||||
breakmsg(obj, cansee(gb.bhitpos.x, gb.bhitpos.y));
|
||||
breakobj(obj, gb.bhitpos.x, gb.bhitpos.y, TRUE, TRUE);
|
||||
|
||||
@@ -415,7 +415,7 @@ explode(
|
||||
cmap_to_glyph(shield_static[k]));
|
||||
}
|
||||
curs_on_u(); /* will flush screen and output */
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
|
||||
/* Cover last shield glyph with blast symbol. */
|
||||
@@ -430,8 +430,8 @@ explode(
|
||||
}
|
||||
|
||||
} else { /* delay a little bit. */
|
||||
delay_output();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
|
||||
tmp_at(DISP_END, 0); /* clear the explosion */
|
||||
@@ -871,7 +871,7 @@ scatter(coordxy sx, coordxy sy, /* location of objects to scatter */
|
||||
} else {
|
||||
if (scflags & VIS_EFFECTS) {
|
||||
/* tmp_at(gb.bhitpos.x, gb.bhitpos.y); */
|
||||
/* delay_output(); */
|
||||
/* nh_delay_output(); */
|
||||
}
|
||||
}
|
||||
stmp->ox = gb.bhitpos.x;
|
||||
|
||||
26
src/hack.c
26
src/hack.c
@@ -1322,10 +1322,10 @@ findtravelpath(int mode)
|
||||
for (i = 0; i < nn; ++i) {
|
||||
tmp_at(travelstepx[1 - set][i], travelstepy[1 - set][i]);
|
||||
}
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
if (flags.runmode == RUN_CRAWL) {
|
||||
delay_output();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
tmp_at(DISP_END, 0);
|
||||
}
|
||||
@@ -1381,12 +1381,12 @@ findtravelpath(int mode)
|
||||
/* Use of warning glyph is arbitrary. It stands out. */
|
||||
tmp_at(DISP_ALL, warning_to_glyph(2));
|
||||
tmp_at(px, py);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
if (flags.runmode == RUN_CRAWL) {
|
||||
delay_output();
|
||||
delay_output();
|
||||
delay_output();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
tmp_at(DISP_END, 0);
|
||||
}
|
||||
@@ -2623,12 +2623,12 @@ runmode_delay_output(void)
|
||||
/* moveloop() suppresses time_botl when running */
|
||||
iflags.time_botl = flags.time;
|
||||
curs_on_u();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
if (flags.runmode == RUN_CRAWL) {
|
||||
delay_output();
|
||||
delay_output();
|
||||
delay_output();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
remove_object(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ md_rush(struct monst *md,
|
||||
place_monster(md, fx, fy); /* put md down */
|
||||
newsym(fx, fy); /* see it */
|
||||
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_monster(fx, fy);
|
||||
@@ -380,7 +380,7 @@ md_rush(struct monst *md,
|
||||
place_monster(md, fx, fy); /* place at final spot */
|
||||
newsym(fx, fy);
|
||||
flush_screen(0);
|
||||
delay_output(); /* wait a little bit */
|
||||
nh_delay_output(); /* wait a little bit */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2001,7 +2001,7 @@ mkinvokearea(void)
|
||||
}
|
||||
|
||||
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!");
|
||||
|
||||
@@ -757,10 +757,10 @@ m_throw(
|
||||
break;
|
||||
}
|
||||
tmp_at(gb.bhitpos.x, gb.bhitpos.y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
tmp_at(gb.bhitpos.x, gb.bhitpos.y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
tmp_at(DISP_END, 0);
|
||||
gm.mesg_given = 0; /* reset */
|
||||
|
||||
|
||||
@@ -3680,7 +3680,7 @@ shkcatch(
|
||||
the(xname(obj)));
|
||||
if (!canspotmon(shkp))
|
||||
map_invisible(x, y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
mark_synch();
|
||||
}
|
||||
subfrombill(obj, shkp);
|
||||
|
||||
@@ -2943,7 +2943,7 @@ launch_obj(
|
||||
/* dstage@u.washington.edu -- Delay only if hero sees it */
|
||||
if (cansee(gb.bhitpos.x, gb.bhitpos.y))
|
||||
while (tmp-- > 0)
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
|
||||
gb.bhitpos.x += dx;
|
||||
gb.bhitpos.y += dy;
|
||||
|
||||
@@ -4605,8 +4605,8 @@ start_engulf(struct monst *mdef)
|
||||
You("%s %s%s!",
|
||||
u_digest ? "swallow" : u_enfold ? "enclose" : "engulf",
|
||||
mon_nam(mdef), u_digest ? " whole" : "");
|
||||
delay_output();
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
nh_delay_output();
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -562,7 +562,7 @@ static struct window_procs hup_procs = {
|
||||
hup_int_ndecl, /* doprev_message */
|
||||
hup_yn_function, hup_getlin, hup_int_ndecl, /* get_ext_cmd */
|
||||
hup_void_fdecl_int, /* number_pad */
|
||||
hup_void_ndecl, /* delay_output */
|
||||
hup_void_ndecl, /* nh_delay_output */
|
||||
#ifdef CHANGE_COLOR
|
||||
hup_change_color,
|
||||
#ifdef MAC
|
||||
|
||||
@@ -3772,7 +3772,7 @@ bhit(
|
||||
newsym(x, y);
|
||||
}
|
||||
tmp_at(gb.bhitpos.x, gb.bhitpos.y);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
/* kicked objects fall in pools */
|
||||
if ((weapon == KICKED_WEAPON)
|
||||
&& (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);
|
||||
delay_output();
|
||||
nh_delay_output();
|
||||
if (IS_SINK(levl[gb.bhitpos.x][gb.bhitpos.y].typ)) {
|
||||
Soundeffect(se_boomerang_klonk, 75);
|
||||
if (!Deaf)
|
||||
@@ -4467,7 +4467,7 @@ dobuzz(
|
||||
if (ZAP_POS(levl[sx][sy].typ)
|
||||
|| (isok(lsx, lsy) && cansee(lsx, lsy)))
|
||||
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 */
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#endif /* POSIX_TYPES */
|
||||
#ifdef LINUX
|
||||
#include <sys/ioctl.h>
|
||||
#undef delay_output /* curses redefines this */
|
||||
#include <curses.h>
|
||||
#endif
|
||||
#define kill_sym c_cc[VKILL]
|
||||
|
||||
@@ -1725,10 +1725,10 @@ X11_sig_cb(XtPointer not_used, XtSignalId *id)
|
||||
}
|
||||
#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.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
|
||||
@@ -8,7 +8,7 @@ NETHACK INTERFACE
|
||||
* Implement curses_rip for optional fancier color tombstone, as well
|
||||
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?
|
||||
|
||||
* Both PDCurses and Ncurses have mouse support, so the poskey function
|
||||
@@ -34,7 +34,7 @@ DISPLAY
|
||||
PDCurses, however.
|
||||
|
||||
* 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
|
||||
windows
|
||||
|
||||
@@ -837,7 +837,6 @@ cl_eos(void) /* free after Robert Viduya */
|
||||
macros used elsewhere within nethack; fortunately they're
|
||||
not needed beyond this point, so we don't need to worry
|
||||
about reconstructing them after the header file inclusion. */
|
||||
#undef delay_output
|
||||
#undef TRUE
|
||||
#undef FALSE
|
||||
#define m_move curses_m_move /* Some curses.h decl m_move(), not used here */
|
||||
|
||||
Reference in New Issue
Block a user