trunk only: preserving context (remaining files)

Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
This commit is contained in:
nethack.allison
2003-09-21 11:57:26 +00:00
parent 18e971e442
commit c12d797531
6 changed files with 34 additions and 17 deletions

27
Files
View File

@@ -31,19 +31,20 @@ nethack.txt recover.6 recover.txt tmac.n window.doc
include:
(files for all versions)
align.h amiconf.h artifact.h artilist.h attrib.h
beconf.h color.h config.h config1.h coord.h
decl.h def_os2.h dgn_file.h display.h dlb.h
dungeon.h edog.h emin.h engrave.h epri.h
eshk.h extern.h flag.h func_tab.h global.h
hack.h lev.h mail.h mfndpos.h micro.h
mkroom.h monattk.h mondata.h monflag.h monst.h
monsym.h nhlan.h ntconf.h obj.h objclass.h
os2conf.h patchlevel.h pcconf.h permonst.h prop.h
qtext.h quest.h rect.h region.h rm.h
skills.h sp_lev.h spell.h system.h tcap.h
timeout.h tosconf.h tradstdc.h trampoli.h trap.h
unixconf.h vault.h vision.h vmsconf.h wceconf.h
winami.h winprocs.h wintype.h you.h youprop.h
beconf.h color.h config.h config1.h context.h
coord.h decl.h def_os2.h dgn_file.h display.h
dlb.h dungeon.h edog.h emin.h engrave.h
epri.h eshk.h extern.h flag.h func_tab.h
global.h hack.h lev.h mail.h mfndpos.h
micro.h mkroom.h monattk.h mondata.h monflag.h
monst.h monsym.h nhlan.h ntconf.h obj.h
objclass.h os2conf.h patchlevel.h pcconf.h permonst.h
prop.h qtext.h quest.h rect.h region.h
rm.h skills.h sp_lev.h spell.h system.h
tcap.h timeout.h tosconf.h tradstdc.h trampoli.h
trap.h unixconf.h vault.h vision.h vmsconf.h
wceconf.h winami.h winprocs.h wintype.h you.h
youprop.h
(file for tty versions)
wintty.h
(files for X versions)

View File

@@ -988,7 +988,7 @@ tty_clear_nhwindow(window)
break;
case NHW_MAP:
/* cheap -- clear the whole thing and tell nethack to redraw botl */
flags.botlx = 1;
context.botlx = 1;
/* fall into ... */
case NHW_BASE:
clear_screen();
@@ -1766,7 +1766,7 @@ tty_putstr(window, attr, str)
case NHW_STATUS:
ob = &cw->data[cw->cury][j = cw->curx];
if(flags.botlx) *ob = 0;
if(context.botlx) *ob = 0;
if(!cw->cury && (int)strlen(str) >= CO) {
/* the characters before "St:" are unnecessary */
nb = index(str, ':');
@@ -1776,7 +1776,7 @@ tty_putstr(window, attr, str)
nb = str;
for(i = cw->curx+1, n0 = cw->cols; i < n0; i++, nb++) {
if(!*nb) {
if(*ob || flags.botlx) {
if(*ob || context.botlx) {
/* last char printed may be in middle of line */
tty_curs(WIN_STATUS, i, cw->cury);
cl_end();
@@ -2281,7 +2281,7 @@ docorner(xmin, ymax)
end_glyphout();
if (ymax >= (int) wins[WIN_STATUS]->offy) {
/* we have wrecked the bottom line */
flags.botlx = 1;
context.botlx = 1;
bot();
}
}

View File

@@ -142,6 +142,10 @@ SOURCE=..\include\config1.h
# End Source File
# Begin Source File
SOURCE=..\include\context.h
# End Source File
# Begin Source File
SOURCE=..\include\coord.h
# End Source File
# Begin Source File

View File

@@ -147,6 +147,10 @@ SOURCE=..\include\config1.h
# End Source File
# Begin Source File
SOURCE=..\include\context.h
# End Source File
# Begin Source File
SOURCE=..\include\coord.h
# End Source File
# Begin Source File

View File

@@ -628,6 +628,10 @@ SOURCE=..\include\config1.h
# End Source File
# Begin Source File
SOURCE=..\include\context.h
# End Source File
# Begin Source File
SOURCE=..\include\coord.h
# End Source File
# Begin Source File

View File

@@ -126,6 +126,10 @@ SOURCE=..\include\config1.h
# End Source File
# Begin Source File
SOURCE=..\include\context.h
# End Source File
# Begin Source File
SOURCE=..\include\coord.h
# End Source File
# Begin Source File