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

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