-pm.h
-vis_tab.h
-onames.h
-date.h
-dgn_comp.h
-tile.h
-lev_comp.h
+.cvsignore
+date.h onames.h pm.h vis_tab.h
+dgn_comp.h lev_comp.h
// NetHack 3.5 qt_win.h $Date$ $Revision$
-// SCCS Id: @(#)qt_win.h 3.5 1999/11/19
// Copyright (c) Warwick Allison, 1999.
// NetHack may be freely redistributed. See license for details.
//
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
virtual void ClipAround(int x,int y);
virtual void PrintGlyph(int x,int y,int glyph);
- virtual void UseRIP(int how);
+ virtual void UseRIP(int how, time_t when);
int nhid;
};
virtual bool Destroy();
virtual void Display(bool block);
virtual void PutStr(int attr, const char* text);
- virtual void UseRIP(int how);
+ virtual void UseRIP(int how, time_t when);
public slots:
void Search();
static void qt_start_screen();
static void qt_end_screen();
- static void qt_outrip(winid wid, int how);
+ static void qt_outrip(winid wid, int how, time_t when);
static int qt_kbhit();
private:
E void FDECL(clear_text_buffer,(struct text_buffer*));
E void FDECL(free_text_buffer,(struct text_buffer*));
#ifdef GRAPHIC_TOMBSTONE
-E void FDECL(calculate_rip_text, (int));
+E void FDECL(calculate_rip_text, (int,time_t));
#endif
E void NDECL(X11_end_screen);
#ifdef GRAPHIC_TOMBSTONE
-E void FDECL(X11_outrip, (winid,int));
+E void FDECL(X11_outrip, (winid,int,time_t));
#else
-E void FDECL(genl_outrip, (winid,int));
+E void FDECL(genl_outrip, (winid,int,time_t));
#endif
E void FDECL(X11_preference_update, (const char *));
E void NDECL(Gem_start_screen);
E void NDECL(Gem_end_screen);
-E void FDECL(genl_outrip, (winid,int));
+E void FDECL(genl_outrip, (winid,int,time_t));
#undef E
static boolean Schroedingers_cat = FALSE;
-extern const char * const killed_by_prefix[]; /* from topten.c */
-
/*ARGSUSED*/
void
done1(sig_unused) /* called as signal() handler, so sent at least one arg */
urace.femalenum : urace.malenum;
}
corpse = mk_named_object(CORPSE, &mons[mnum],
- u.ux, u.uy, plname);
- Sprintf(pbuf, "%s, %s%s", plname,
- killer.format == NO_KILLER_PREFIX ? "" :
- killed_by_prefix[how],
- killer.format == KILLED_BY_AN ? an(killer.name) :
- killer.name);
+ u.ux, u.uy, plname);
+ Sprintf(pbuf, "%s, ", plname);
+ formatkiller(eos(pbuf), sizeof pbuf - strlen(pbuf), how);
make_grave(u.ux, u.uy, pbuf);
}
/* if pets will contribute to score, populate mydogs list now
STATIC_DCL void FDECL(center, (int, char *));
-extern const char * const killed_by_prefix[]; /* from topten.c */
-
#if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(GEM_GRAPHICS) || defined(MSWIN_GRAPHICS)
# define TEXT_TOMBSTONE
#endif
STATIC_DCL void FDECL(nsb_unmung_line,(char*));
#endif
-/* must fit with end.c; used in rip.c */
-NEARDATA const char * const killed_by_prefix[] = {
- "killed by ", "choked on ", "poisoned by ", "died of ", "drowned in ",
- "burned by ", "dissolved in ", "crushed to death by ", "petrified by ",
- "turned to slime by ", "killed by ", "", "", "", "", ""
-};
static winid toptenwin = WIN_ERR;
unsigned siz;
int how;
{
+ static NEARDATA const char * const killed_by_prefix[] = {
+ /* DIED, CHOKING, POISONING, STARVING, */
+ "killed by ", "choked on ", "poisoned by ", "died of ",
+ /* DROWNING, BURNING, DISSOLVED, CRUSHING, */
+ "drowned in ", "burned by ", "dissolved in ", "crushed to death by ",
+ /* STONING, TURNED_SLIME, GENOCIDED, */
+ "petrified by ", "turned to slime by ", "killed by ",
+ /* PANICKED, TRICKED, QUIT, ESCAPED, ASCENDED */
+ "", "", "", "", ""
+ };
unsigned l;
char *kname = killer.name;
/* NetHack 3.5 amirip.c $Date$ $Revision$ */
-/* SCCS Id: @(#)amirip.c 3.5 1996/02/04 */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996. */
/* NetHack may be freely redistributed. See license for details. */
# endif
#endif /* AZTEC_C */
-extern char *killed_by_prefix[];
static struct Window *ripwin=0;
static void tomb_text(char*);
static void dofade(int,int,int);
int cmap_white, cmap_black;
void
-amii_outrip( tmpwin, how )
+amii_outrip( tmpwin, how, when )
winid tmpwin;
int how;
+time_t when;
{
int just_return = 0;
int done, rtxth;
char buf[ 200 ];
int line, tw, ww;
char *errstr = NULL;
+ long year;
if(!WINVERS_AMIV || HackScreen->RastPort.BitMap->Depth < 4)goto cleanup;
BltBitMap(*tbmp, 0, 0, rp->BitMap, xoff, yoff, tomb_bmhd.w, tomb_bmhd.h, 0xc0, 0xff, NULL);
/* Put together death description */
- switch (killer.format) {
- default:
- impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
tw = TextLength(rp,buf,STONE_LINE_LEN) + 40;
tomb_text(buf);
/* Put together death description */
- switch (killer.format) {
- default:
- impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
/* Put death type on stone */
for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++)
}
/* Put year on stone */
- Sprintf(buf, "%4d", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(buf, "%4ld", year);
tomb_text(buf);
#ifdef NH320_DEDICATION
if(tbmp[0])FreeImageFiles(load_list, tbmp);
if(just_return) return;
/* fall back to the straight-ASCII version */
- genl_outrip(tmpwin, how);
+ genl_outrip(tmpwin, how, when);
}
static void tomb_text(p)
/* NetHack 3.5 winproto.h $Date$ $Revision$ */
-/* SCCS Id: @(#)winproto.h 3.5 1996/01/15 */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#endif
/* amirip.c */
-void FDECL(amii_outrip, ( winid tmpwin, int how ));
+void FDECL(amii_outrip, ( winid tmpwin, int how, time_t when ));
/* winchar.c */
void SetMazeType(MazeType);
}
/*
-outrip(winid, int)
+outrip(winid, int, when)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
*/
-void mswin_outrip(winid wid, int how)
+void mswin_outrip(winid wid, int how, time_t when)
{
- logDebug("mswin_outrip(%d)\n", wid, how);
+ logDebug("mswin_outrip(%d, %d, %ld)\n", wid, how, (long)when);
if ((wid >= 0) && (wid < MAXWINDOWS) ) {
DestroyWindow(GetNHApp()->windowlist[wid].win);
GetNHApp()->windowlist[wid].win = mswin_init_RIP_window();
GetNHApp()->windowlist[wid].type = NHW_RIP;
GetNHApp()->windowlist[wid].dead = 0;
}
-
- genl_outrip(wid, how);
+ genl_outrip(wid, how, when);
}
/* handle options updates here */
char *mswin_get_color_string(void);
void mswin_start_screen(void);
void mswin_end_screen(void);
-void mswin_outrip(winid wid, int how);
+void mswin_outrip(winid wid, int how, time_t when);
void mswin_preference_update(const char *pref);
/* helper function */
// NetHack 3.5 qt_win.cpp $Date$ $Revision$
-// SCCS Id: @(#)qt_win.cpp 3.5 2005/11/19
// Copyright (c) Warwick Allison, 1999.
// NetHack may be freely redistributed. See license for details.
#endif
extern const char *enc_stat[]; /* from botl.c */
extern const char *hu_stat[]; /* from eat.c */
-extern const char *killed_by_prefix[];
extern int total_tiles_used; // from tile.c
extern short glyph2tile[]; // from tile.c
}
void NetHackQtWindow::ClipAround(int x,int y) { puts("unexpected ClipAround"); }
void NetHackQtWindow::PrintGlyph(int x,int y,int glyph) { puts("unexpected PrintGlyph"); }
//void NetHackQtWindow::PrintGlyphCompose(int x,int y,int,int) { puts("unexpected PrintGlyphCompose"); }
-void NetHackQtWindow::UseRIP(int how) { puts("unexpected UseRIP"); }
+void NetHackQtWindow::UseRIP(int how, time_t when) { puts("unexpected UseRIP"); }
return !isVisible();
}
-void NetHackQtTextWindow::UseRIP(int how)
+void NetHackQtTextWindow::UseRIP(int how, time_t when)
{
// Code from X11 windowport
#define STONE_LINE_LEN 16 /* # chars that fit on one line */
char buf[BUFSZ];
char *dpx;
int line;
+ long year;
/* Put name on stone */
Sprintf(rip_line[NAME_LINE], "%s", plname);
#endif
/* Put together death description */
- switch (killer.format) {
- default: impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
/* Put death type on stone */
for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++) {
}
/* Put year on stone */
- Sprintf(rip_line[YEAR_LINE], "%4d", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(rip_line[YEAR_LINE], "%4ld", year);
rip.setLines(rip_line,YEAR_LINE+1);
// Ignore.
}
-void NetHackQtBind::qt_outrip(winid wid, int how)
+void NetHackQtBind::qt_outrip(winid wid, int how, time_t when)
{
NetHackQtWindow* window=id_to_window[wid];
- window->UseRIP(how);
+ window->UseRIP(how, when);
}
bool NetHackQtBind::notify(QObject *receiver, QEvent *event)
void X11_end_screen() { return; } /* called from settty() in unixtty.c */
#ifdef GRAPHIC_TOMBSTONE
-void X11_outrip(window, how)
+void X11_outrip(window, how, when)
winid window;
int how;
+ time_t when;
{
struct xwindow *wp;
panic("ripout on non-text window (window type [%d])", wp->type);
}
- calculate_rip_text(how);
+ calculate_rip_text(how, when);
}
#endif
static char rip_line[YEAR_LINE+1][STONE_LINE_LEN+1];
-extern const char *killed_by_prefix[];
-
void
-calculate_rip_text(int how)
+calculate_rip_text(int how, time_t when)
{
/* Follows same algorithm as genl_outrip() */
char buf[BUFSZ];
char *dpx;
int line;
+ long year;
/* Put name on stone */
Sprintf(rip_line[NAME_LINE], "%s", plname);
done_money);
#endif
/* Put together death description */
- switch (killer.format) {
- default: impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
/* Put death type on stone */
for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++) {
}
/* Put year on stone */
- Sprintf(rip_line[YEAR_LINE], "%4d", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(rip_line[YEAR_LINE], "%4ld", year);
}
extern short glyph2tile[MAX_GLYPH]; /* from tile.c */
extern void mar_display_nhwindow(winid); /* from wingem1.c */
-void Gem_outrip(winid,int);
+void Gem_outrip(winid,int,time_t);
void Gem_preference_update(const char *);
/* Interface definition, for windows.c */
struct window_procs Gem_procs = {
/** Gem_outrip **/
void mar_set_text_to_rip(winid);
char** rip_line=0;
-extern const char *killed_by_prefix[];
+
void
-Gem_outrip(w, how)
+Gem_outrip(w, how, when)
winid w;
int how;
+time_t when;
{
/* Code from X11 windowport */
#define STONE_LINE_LEN 15 /* # chars that fit on one line */
char buf[BUFSZ];
char *dpx;
int line;
+ long year;
+
if (!rip_line) {
int i;
rip_line= (char **)malloc((YEAR_LINE+1)*sizeof(char *));
done_money);
#endif
/* Put together death description */
- switch (killer.format) {
- default: impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
+
/* Put death type on stone */
for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++) {
register int i,i0;
} else dpx= &dpx[i0+1];
}
/* Put year on stone */
- Sprintf(rip_line[YEAR_LINE], "%4d", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(rip_line[YEAR_LINE], "%4ld", year);
+
mar_set_text_to_rip(w);
for(line=0;line<13;line++)
putstr(w, 0, "");
}
/*
-outrip(winid, int)
+outrip(winid, int, when)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
*/
-void gnome_outrip(winid wid, int how)
+void gnome_outrip(winid wid, int how, time_t when)
{
/* Follows roughly the same algorithm as genl_outrip() */
char buf[BUFSZ];
char ripString[BUFSZ]="\0";
- extern const char *killed_by_prefix[];
+ long year;
/* Put name on stone */
Sprintf(buf, "%s\n", plname);
Strcat(ripString, buf);
/* Put together death description */
- switch (killer.format) {
- default: impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
+
/* Put death type on stone */
Strcat(ripString, buf);
Strcat(ripString, "\n");
/* Put year on stone */
- Sprintf(buf, "%4d\n", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(buf, "%4ld\n", year);
Strcat(ripString, buf);
ghack_text_window_rip_string( ripString);
void gnome_delay_output(void);
void gnome_start_screen(void);
void gnome_end_screen(void);
-void gnome_outrip(winid wid, int how);
+void gnome_outrip(winid wid, int how, time_t when);
void gnome_delete_nhwindow_by_reference( GtkWidget *menuWin);
#define LLEN 128
-extern const char *killed_by_prefix[];
extern winid WIN_STATUS;
#ifdef _DEBUG
}
/*
-outrip(winid, int)
+outrip(winid, int, when)
-- The tombstone code. If you want the traditional code use
genl_outrip for the value and check the #if in rip.c.
*/
#define STONE_LINE_LEN 16
-void mswin_outrip(winid wid, int how)
+void mswin_outrip(winid wid, int how, time_t when)
{
char buf[BUFSZ];
+ long year;
- logDebug("mswin_outrip(%d)\n", wid, how);
+ logDebug("mswin_outrip(%d, %d, %ld)\n", wid, how, (long)when);
if ((wid >= 0) && (wid < MAXWINDOWS) ) {
DestroyWindow(GetNHApp()->windowlist[wid].win);
GetNHApp()->windowlist[wid].win = mswin_init_RIP_window();
putstr(wid, 0, buf);
/* Put together death description */
- switch (killer.format) {
- default: impossible("bad killer format?");
- case KILLED_BY_AN:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, an(killer.name));
- break;
- case KILLED_BY:
- Strcpy(buf, killed_by_prefix[how]);
- Strcat(buf, killer.name);
- break;
- case NO_KILLER_PREFIX:
- Strcpy(buf, killer.name);
- break;
- }
+ formatkiller(buf, sizeof buf, how);
/* Put death type on stone */
putstr(wid, 0, buf);
/* Put year on stone */
- Sprintf(buf, "%4d", getyear());
+ year = yyyymmdd(when) / 10000L;
+ Sprintf(buf, "%4ld", year);
putstr(wid, 0, buf);
mswin_finish_rip_text(wid);
}
char *mswin_get_color_string(void);
void mswin_start_screen(void);
void mswin_end_screen(void);
-void mswin_outrip(winid wid, int how);
+void mswin_outrip(winid wid, int how, time_t when);
void mswin_preference_update(const char *pref);
char *mswin_getmsghistory(BOOLEAN_P init);
void mswin_putmsghistory(const char * msg,BOOLEAN_P);