]> granicus.if.org Git - nethack/commitdiff
B08021 scroll_amount wincap option
authornethack.allison <nethack.allison>
Fri, 23 Aug 2002 01:03:59 +0000 (01:03 +0000)
committernethack.allison <nethack.allison>
Fri, 23 Aug 2002 01:03:59 +0000 (01:03 +0000)
> - I'd like to see another option added: scroll_amount. In
>   combination with scroll_margin, this would control the amount
>   of squares the screen is scrolled when the scroll_margin is
>   reached (currently, this amount is 1, but if I recall
>   correctly, it used to be more). For example, if both were 5,
>   when you came within 5 spaces of the left screen border, the
>   screen would shift 5 spaces to the right).

doc/Guidebook.mn
doc/Guidebook.tex
doc/fixes34.1
doc/window.doc
include/flag.h
include/winprocs.h
src/options.c
win/win32/mhmap.c
win/win32/mhmap.h
win/win32/mswproc.c

index 8587889c0295768899f369c14eb44fc12ee7df71..7b27d574288beaddbb3559551cdc90ed9156f690 100644 (file)
@@ -5,7 +5,7 @@
 .ds vr "NetHack 3.4
 .ds f0 "\*(vr
 .ds f1
-.ds f2 "July 27, 2002
+.ds f2 "August 22, 2002
 .mt
 A Guide to the Mazes of Menace
 (Guidebook for NetHack)
@@ -2147,7 +2147,10 @@ For example, in the protected mode MSDOS version, control whether tiles
 get pre-loaded into RAM at the start of the game.  Doing so
 enhances performance of the tile graphics, but uses more memory. (default on).
 Cannot be set with the `O' command.
-.lp scroll_margin      
+.lp scroll_amount
+NetHack should scroll the display by this number of cells
+when the hero reaches the scroll_margin.
+.lp scroll_margin
 NetHack should scroll the display when the hero or cursor
 is this number of cells away from the edge of the window.
 .lp splash_screen
index 3847b004c23410113c6f635e17ff1cbcc529ea3f..9c5282c5ea802f5d9d0db382baa97311149b3b6a 100644 (file)
@@ -27,7 +27,7 @@
 \begin{document}
 %
 % input file: guidebook.mn
-% $Revision: 1.50 $ $Date: 2002/08/12 01:39:55 $
+% $Revision: 1.51 $ $Date: 2002/08/22 04:18:41 $
 %
 %.ds h0 "
 %.ds h1 %.ds h2 \%
@@ -2643,6 +2643,10 @@ get pre-loaded into RAM at the start of the game.  Doing so
 enhances performance of the tile graphics, but uses more memory. (default on).
 Cannot be set with the `{\tt O}' command.
 %.lp
+\item[\ib{scroll\_amount}]
+NetHack should scroll the display by this number of cells
+when the hero reaches the scroll\_margin.
+%.lp
 \item[\ib{scroll\_margin}]
 NetHack should scroll the display when the hero or cursor
 is this number of cells away from the edge of the window.
index cb6a14f39363680bc3ce7995208a1ff847bd8eaf..ff63e304c96f780edccf7b5a6627e777c312372d 100644 (file)
@@ -276,6 +276,7 @@ showrace option
 travel option
 cmdassist option to provide additional error feedback for some commands
 mouse_support wincap option
+scroll_amount wincap option to adjust how many cells to scroll at scroll_margin
 debug mode: #panic routine to test panic() and panic save file generation
 a new PANICLOG optional file to log the reason for panic and impossible messages
 added validate_prefix_locations() for early directory prefix validation
index 47fe7791535751f6ef60443500163bc5d2c67655..70cc6da8bb4e484549dd535fb3cae8d8e5de6091 100644 (file)
@@ -482,11 +482,11 @@ to support:
   |  font_size_status  | WC_FONTSIZ_STATUS  | wc_fontsiz_status  |int     |
   |  font_size_text    | WC_FONTSIZ_TEXT    | wc_fontsiz_text    |int     |
   |  hilite_pet        | WC_HILITE_PET      | wc_hilite_pet      |boolean |
-  |  large_font        | WC_LARGE_FONT      | wc_large_font      |boolean |
   |  map_mode          | WC_MAP_MODE        | wc_map_mode        |int     |
   |  player_selection  | WC_PLAYER_SELECTION| wc_player_selection|int     |
   |  popup_dialog      | WC_POPUP_DIALOG    | wc_popup_dialog    |boolean |
   |  preload_tiles     | WC_PRELOAD_TILES   | wc_preload_tiles   |boolean |
+  |  scroll_amount     | WC_SCROLL_AMOUNT   | wc_scroll_amount   |int     |
   |  scroll_margin     | WC_SCROLL_MARGIN   | wc_scroll_margin   |int     |
   |  splash_screen     | WC_SPLASH_SCREEN   | wc_splash_screen   |boolean |
   |  tiled_map         | WC_TILED_MAP       | wc_tiled_map       |boolean |
@@ -523,12 +523,12 @@ font_size_text    -- port should use this size font for text windows.
 font_status    -- port should use a font by this name for status window.
 font_text      -- port should use a font by this name for text windows.
 hilite_pet     -- port should mark pets in some special way on the map.
-large_font     -- port should use a large font.
 map_mode       -- port should display the map in the manner specified.
 player_selection
                -- dialog or prompts for choosing character.
 popup_dialog   -- port should pop up dialog boxes for input.
 preload_tiles  -- port should preload tiles into memory.
+scroll_amount   -- scroll this amount when scroll_margin is reached.
 scroll_margin  -- port should scroll the display when the hero or cursor
                   is this number of cells away from the edge of the window.
 splash_screen   -- port should/should not display an opening splashscreen.
index cb84d19187b36823972a932ad0ff1947404bd6a3..11b746d1deafaed3dab34c2cd37331d22190ddd5 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)flag.h     3.4     2002/07/27      */
+/*     SCCS Id: @(#)flag.h     3.4     2002/08/22      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -241,6 +241,7 @@ struct instance_flags {
        int     wc_fontsiz_status;      /* font size for the status window     */
        int     wc_fontsiz_menu;        /* font size for the menu window       */
        int     wc_fontsiz_text;        /* font size for text windows          */
+       int     wc_scroll_amount;       /* scroll this amount at scroll_margin */
        int     wc_scroll_margin;       /* scroll map when this far from
                                                the edge */
        int     wc_map_mode;            /* specify map viewing options, mostly
@@ -249,12 +250,11 @@ struct instance_flags {
        boolean wc_splash_screen;       /* display an opening splash screen or not */
        boolean wc_popup_dialog;        /* put queries in pop up dialogs instead of
                                                in the message window */
-       boolean wc_large_font;          /* draw in larger fonts (say, 12pt instead
-                                               of 9pt) */
        boolean wc_eight_bit_input;     /* allow eight bit input               */
        boolean wc_mouse_support;       /* allow mouse support */
 
        boolean  cmdassist;     /* provide detailed assistance for some commands */
+       boolean  obsolete;      /* obsolete options can point at this, it isn't used */
        /* Items which belong in flags, but are here to allow save compatibility */
        boolean  lootabc;       /* use "a/b/c" rather than "o/i/b" when looting */
        boolean  showrace;      /* show hero glyph by race rather than by role */
@@ -274,7 +274,7 @@ struct instance_flags {
 #define hilite_pet wc_hilite_pet
 #define use_inverse wc_inverse
 #ifdef MAC_GRAPHICS_ENV
-#define large_font wc_large_font
+#define large_font obsolete
 #endif
 #ifdef MAC
 #define popup_dialog wc_popup_dialog
index 76ce49f27802f3b3dfd820f8d59ee3c1c8eecb97..3f574370ffebfb5c850afed8c689c616fccb85bd 100644 (file)
@@ -157,9 +157,9 @@ extern NEARDATA struct window_procs windowprocs;
 #define WC_FONTSIZ_MENU         0x100000L      /* 21 supports specification of mnu win font */
 #define WC_FONTSIZ_TEXT         0x200000L      /* 22 supports specification of txt win font */
 #define WC_SCROLL_MARGIN 0x400000L     /* 23 supports setting scroll margin for map */
-#define WC_SPLASH_SCREEN 0x800000L     /* 24 supports setting scroll margin for map */
+#define WC_SPLASH_SCREEN 0x800000L     /* 24 supports display of splash screen      */
 #define WC_POPUP_DIALOG         0x1000000L     /* 25 supports queries in pop dialogs        */
-#define WC_LARGE_FONT   0x2000000L     /* 26 Port supports large font               */
+#define WC_SCROLL_AMOUNT 0x2000000L    /* 26 scroll this amount at scroll margin    */
 #define WC_EIGHT_BIT_IN         0x4000000L     /* 27 8-bit character input                  */
 #define WC_PERM_INVENT  0x8000000L     /* 28 8-bit character input                  */
 #define WC_MAP_MODE     0x10000000L    /* 29 map_mode option                        */
index 9ea08e9b45781a095838a0f99d71b8cb1d9e7a99..e059c2a3b5efe5c80c1ba73f11d3a9638c6edb80 100644 (file)
@@ -110,7 +110,7 @@ static struct Bool_Opt
 #else
        {"ignintr", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
-       {"large_font", &iflags.wc_large_font, FALSE, SET_IN_FILE},      /*WC*/
+       {"large_font", &iflags.obsolete, FALSE, SET_IN_FILE},   /* OBSOLETE */
        {"legacy", &flags.legacy, TRUE, DISP_IN_GAME},
        {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
        {"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
@@ -294,6 +294,8 @@ static struct Comp_Opt
                                                sizeof "teleport", SET_IN_GAME },
        { "scores",   "the parts of the score list you wish to see",
                                                32, SET_IN_GAME },
+       { "scroll_amount", "scroll the map this amount when scroll_margin is reached",
+                                               20, DISP_IN_GAME }, /*WC*/
        { "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
 #ifdef MSDOS
        { "soundcard", "type of sound card to use", 20, SET_IN_FILE },
@@ -1866,6 +1868,16 @@ goodfruit:
                } else if (negated) bad_negation(fullname, TRUE);
                return;
        }
+       /* WINCAP
+        * scroll_amount:nn */
+       fullname = "scroll_amount";
+       if (match_optname(opts, fullname, sizeof("scroll_amount")-1, TRUE)) {
+               op = string_for_opt(opts, negated);
+               if ((negated && !op) || (!negated && op)) {
+                       iflags.wc_scroll_amount = negated ? 1 : atoi(op);
+               } else if (negated) bad_negation(fullname, TRUE);
+               return;
+       }
        /* WINCAP
         * scroll_margin:nn */
        fullname = "scroll_margin";
@@ -2759,6 +2771,10 @@ char *buf;
                Sprintf(buf, "%d top/%d around%s", flags.end_top,
                                flags.end_around, flags.end_own ? "/own" : "");
        }
+       else if (!strcmp(optname, "scroll_amount")) {
+               if (iflags.wc_scroll_amount) Sprintf(buf, "%d",iflags.wc_scroll_amount);
+               else Strcpy(buf, defopt);
+       }
        else if (!strcmp(optname, "scroll_margin")) {
                if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
                else Strcpy(buf, defopt);
@@ -3145,7 +3161,6 @@ struct wc_Opt wc_options[] = {
        {"color", WC_COLOR},
        {"eight_bit_tty", WC_EIGHT_BIT_IN},
        {"hilite_pet", WC_HILITE_PET},
-       {"large_font", WC_LARGE_FONT},  /* now obsolete */
        {"popup_dialog", WC_POPUP_DIALOG},
        {"player_selection", WC_PLAYER_SELECTION},
        {"preload_tiles", WC_PRELOAD_TILES},
@@ -3170,6 +3185,7 @@ struct wc_Opt wc_options[] = {
        {"font_status", WC_FONT_STATUS},
        {"font_text", WC_FONT_TEXT},
        {"map_mode", WC_MAP_MODE},
+       {"scroll_amount", WC_SCROLL_AMOUNT},
        {"scroll_margin", WC_SCROLL_MARGIN},
        {"splash_screen", WC_SPLASH_SCREEN},
        {"vary_msgcount",WC_VARY_MSGCOUNT},
index d155d4dbd9d4c3ff5d4028bcb5642153002c41c5..da30acc33a17d6816f5cd8d85dd50d4fc60bc103 100644 (file)
@@ -420,6 +420,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
                        ( msg_data->y<(data->yPos+mcam) ||
                          msg_data->y>(data->yPos+data->yPageSize-mcam) );
                
+     mcam += iflags.wc_scroll_amount;
                /* get page size and center horizontally on x-position */
                if( scroll_x ) {
                        if( data->xPageSize<=2*mcam ) {
index c7d7d3a0037ec2acac84b32e553c9d90667bd0f9..401561d9ee88462194cc9b47a2f1c2fd32f32a9b 100644 (file)
@@ -16,5 +16,6 @@ int mswin_map_mode(HWND hWnd, int mode);
 #define ROGUE_LEVEL_MAP_MODE           MAP_MODE_ASCII12x16     
 
 #define DEF_CLIPAROUND_MARGIN  5
+#define DEF_CLIPAROUND_AMOUNT  1
 
 #endif /* MSWINMapWindow_h */
index eca61105f8f0a6c406468a6053b76d86e18c0a75..a1c0ab24e2ab9f0233f2fec201a77fafef363ae9 100644 (file)
@@ -65,7 +65,7 @@ COLORREF message_fg_color = RGB(0xFF, 0xFF, 0xFF);
 struct window_procs mswin_procs = {
     "MSWIN",
     WC_COLOR|WC_HILITE_PET|WC_ALIGN_MESSAGE|WC_ALIGN_STATUS|
-       WC_INVERSE|WC_SCROLL_MARGIN|WC_MAP_MODE|
+       WC_INVERSE|WC_SCROLL_AMOUNT|WC_SCROLL_MARGIN|WC_MAP_MODE|
        WC_FONT_MESSAGE|WC_FONT_STATUS|WC_FONT_MENU|WC_FONT_TEXT|
        WC_FONTSIZ_MESSAGE|WC_FONTSIZ_STATUS|WC_FONTSIZ_MENU|WC_FONTSIZ_TEXT|
        WC_TILE_WIDTH|WC_TILE_HEIGHT|WC_TILE_FILE|WC_VARY_MSGCOUNT|
@@ -187,6 +187,7 @@ void mswin_init_nhwindows(int* argc, char** argv)
        if( iflags.wc_align_message==0 ) iflags.wc_align_message = ALIGN_TOP;
        if( iflags.wc_align_status==0 ) iflags.wc_align_status = ALIGN_BOTTOM;
        if( iflags.wc_scroll_margin==0 ) iflags.wc_scroll_margin = DEF_CLIPAROUND_MARGIN;
+       if( iflags.wc_scroll_amount==0 ) iflags.wc_scroll_amount = DEF_CLIPAROUND_AMOUNT;
        if( iflags.wc_tile_width==0 ) iflags.wc_tile_width = TILE_X;
        if( iflags.wc_tile_height==0 ) iflags.wc_tile_height = TILE_Y;
 
@@ -216,7 +217,8 @@ void mswin_init_nhwindows(int* argc, char** argv)
                WC_HILITE_PET |
                WC_ALIGN_MESSAGE | 
                WC_ALIGN_STATUS |
-               WC_SCROLL_MARGIN | 
+               WC_SCROLL_AMOUNT |
+               WC_SCROLL_MARGIN |
                WC_MAP_MODE |
                WC_FONT_MESSAGE |
                WC_FONT_STATUS |
@@ -1828,6 +1830,11 @@ void mswin_preference_update(const char *pref)
                return;
        }
 
+       if( stricmp( pref, "scroll_amount")==0 ) {
+               mswin_cliparound(u.ux, u.uy);
+               return;
+       }
+
        if( stricmp( pref, "scroll_margin")==0 ) {
                mswin_cliparound(u.ux, u.uy);
                return;