From: nethack.allison Date: Sun, 21 Sep 2003 11:57:26 +0000 (+0000) Subject: trunk only: preserving context (remaining files) X-Git-Tag: MOVE2GIT~1765 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c12d7975312445988bb937f7be7bd08124697f8a;p=nethack 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 --- diff --git a/Files b/Files index 3019334d8..1f0f44951 100644 --- a/Files +++ b/Files @@ -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) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 2e1a90edb..9a0911770 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -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(); } } diff --git a/win/win32/dgncomp.dsp b/win/win32/dgncomp.dsp index 618265586..c63dd265b 100644 --- a/win/win32/dgncomp.dsp +++ b/win/win32/dgncomp.dsp @@ -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 diff --git a/win/win32/makedefs.dsp b/win/win32/makedefs.dsp index 0a2f6ca47..780c57a39 100644 --- a/win/win32/makedefs.dsp +++ b/win/win32/makedefs.dsp @@ -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 diff --git a/win/win32/nethackw.dsp b/win/win32/nethackw.dsp index 43d178edb..8e28fccf9 100644 --- a/win/win32/nethackw.dsp +++ b/win/win32/nethackw.dsp @@ -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 diff --git a/win/win32/tilemap.dsp b/win/win32/tilemap.dsp index 75bd7c24d..024c0f17e 100644 --- a/win/win32/tilemap.dsp +++ b/win/win32/tilemap.dsp @@ -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