]> granicus.if.org Git - nethack/commitdiff
another shot at H2344 (large window)
authorkeni <keni>
Tue, 10 Jan 2012 02:33:36 +0000 (02:33 +0000)
committerkeni <keni>
Tue, 10 Jan 2012 02:33:36 +0000 (02:33 +0000)
Conditional on H2344_BROKEN which can be disabled at the top of the file if
necessary.  This appears to handle all the cases I was able to reproduce from
Pat's list, with the caveat that msg_window=f fails on very wide windows on
Mac OSX Lion with the default terminal emulation.  When the emulation is set
to ANSI, it works (the failure mode is the output from a simple putchar() loop
across the contents of history called up from ^P wraps at about the middle
of the window).

doc/fixes35.0
win/tty/wintty.c

index 2220ed6079f0ca8f13b5a4f8c7f8d5fd484ebd95..f185bc4c5eda4f9be04929a75739b95a073aaecf 100644 (file)
@@ -429,6 +429,7 @@ platforms that support hangup: SAFERHANGUP to avoid losing objects in transit
        well-timed hangups to stop a long melee
 X11: support dynamic switching of map mode via tiled_map option
 X11: added support for hilite_pet to text map mode
+tty: various bugfixes for very wide and/or tall screens
 
 
 General New Features
index 2c8b005f8a5e1a91e414fcef07f83969d5fbf089..8347945d5be2b2d8ef12d079e5b67e4d7e505379 100644 (file)
@@ -9,6 +9,12 @@
  * h+ 930227
  */
 
+/* It's still not clear I've caught all the cases for H2344.  #undef this
+ * to back out the changes. */
+#define H2344_BROKEN
+
+#include <stdio.h>
+
 #include "hack.h"
 #include "dlb.h"
 #include "date.h"
@@ -1806,7 +1812,7 @@ tty_display_nhwindow(window, blocking)
 */
        cw->offx = (cw->type==NHW_TEXT)
                ? 0
-               : min(10, ttyDisplay->cols - cw->maxcol - 1);
+               : min( min(82,ttyDisplay->cols/2), ttyDisplay->cols - cw->maxcol - 1);
 #else
        /* avoid converting to uchar before calculations are finished */
        cw->offx = (uchar) (int)
@@ -2194,7 +2200,12 @@ tty_putstr_core(window, attr, symstr)
        break;
     case NHW_MENU:
     case NHW_TEXT:
-       if(cw->type == NHW_TEXT && cw->cury == ttyDisplay->rows-1) {
+#ifdef H2344_BROKEN
+       if(cw->type == NHW_TEXT && (cw->cury+cw->offy) == ttyDisplay->rows-1)
+#else
+       if(cw->type == NHW_TEXT && cw->cury == ttyDisplay->rows-1)
+#endif
+       {
            /* not a menu, so save memory and output 1 page at a time */
            cw->maxcol = ttyDisplay->cols; /* force full-screen mode */
            tty_display_nhwindow(window, TRUE);