From cb6a93641b5a56791c0072e3225c15ed9aa66f9c Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 3 Feb 2002 05:31:47 +0000 Subject: [PATCH] Adjust window-port related option processing to allow common parsing in the core, and direct access to the results by the window port. Notes: o Adds a new field, wincap, to the window_procs structure for setting bits related to the preference features that the window port supports. This allows run-time determination of whether a particular option setting is applicable to the running window port. A window-port is free to support as many, or as few, of the available options as it wants. Ensure that only the ones supported have their corresponding bit set in window_proc.wincap. [see chart in doc/window.doc for help with that.] o The settings I stuck into wincap for each window port are almost certainly not accurate, so each port team should review them. You should only include the ones that you will actually react to and make adjustments for if the user changes that option. Without the setting in wincap, the option won't even show up in the 'O'ptions menu. o preference_update() added to the window-port interface, so that the window-port can be notified if an option of interest (an option with its corresponding bit set in wincap field) is changed. o provided a genl_preference_update() routine in windows.c and used it for all the existing window ports since they don't have a functional one of their own yet. o this messes around heavily with iflags and the options arrays in options.c o I hope I didn't break any port's existing code. I tried not to. The Mac however, in particular, should be looked at because it suffered a namespace collision with what I was working on around fontname. It had Mac specific font stuff in options.c. Please test the Mac. --- doc/Guidebook.mn | 100 +++++-- doc/Guidebook.tex | 133 +++++++-- doc/window.doc | 132 ++++++++- include/extern.h | 1 + include/flag.h | 97 ++++--- include/winprocs.h | 70 +++++ src/options.c | 636 ++++++++++++++++++++++++++++++-------------- src/save.c | 7 + src/windows.c | 12 + sys/amiga/winami.c | 8 +- sys/mac/macwin.c | 2 + win/Qt/qt_win.cpp | 2 + win/X11/winX.c | 2 + win/gem/wingem.c | 4 +- win/gnome/gnbind.c | 2 + win/tty/wintty.c | 7 +- win/win32/mswproc.c | 5 +- 17 files changed, 925 insertions(+), 295 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index a99056a45..547c03bb0 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1635,9 +1635,6 @@ Check free disk space before writing files to disk (default on). You may have to turn this off if you have more than 2 GB free space on the partition used for your save and level files. Only applies when MFLOPPY was defined during compilation. -.lp "color " -Use color for different monsters, objects, and dungeon features -(default on for microcomputers). .lp "confirm " Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). @@ -1748,11 +1745,6 @@ Note that in the next release, new symbols may be added, or the present ones rearranged. Cannot be set with the `O' command. -.lp eight_bit_tty -Pass eight-bit character values (for example, specified with the -.op traps -option) straight through to your terminal (default off). Only applies -to the tty port. .lp extmenu Changes the extended commands interface to pop-up a menu of available commands. It is keystroke compatible with the traditional interface except that it does @@ -1783,11 +1775,6 @@ with the `/' command, ask if you want to see it (default on). Turning help off makes just looking at things faster, since you aren't interrupted with the ``More info?'' prompt, but it also means that you might miss some interesting and/or important information. -.lp hilite_pet -Visually distinguish pets from similar animals (default off). -The behavior of this option depends on the type of windowing you use. -In text windowing, text highlighting or inverse video is often used; -with tiles, generally displays a heart symbol near pets. .lp horsename Name your starting horse (ex. ``horsename:Trigger''). Cannot be set with the `O' command. @@ -1954,11 +1941,6 @@ Specify the object types to be picked up when is on. Default is all types. .lp prayconfirm Prompt for confirmation before praying (default on). -.lp preload_tiles -For 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 pushweapon Using the `w' (wield) command when already wielding something pushes the old item into your secondary weapon slot (default off). @@ -2054,6 +2036,88 @@ Select which windowing system to use, such as ``tty'' or ``X11'' (default depends on version). Cannot be set with the `O' command. .hn 2 +Window Port Customization options +.pg +Here are explanations of the various options that are +used to customize and change the characteristics of the +windowtype that you have chosen. +Character strings that are too long may be truncated. +Not all window ports will adjust for all settings listed +here. You can safely add any of these options to your config +file, and if the window port is capable of adjusting to +suit your preferences, it will attempt to do so. If it +can't it will silently ignore it. You can find out if an +option is supported by the window port that you are currently +using by checking to see if it shows up in the Options list. +Some options are dynamic and can be specified during the game +with the `O' command. +.lp align_message +Where to align or place the message window (top, bottom, left, or right) +.lp align_status +Where to align or place the status window (top, bottom, left, or right). +.lp ascii_map +NetHack should display an ascii character map if it can. +.lp color +NetHack should display color if it can for different monsters, +objects, and dungeon features +.lp eight_bit_tty +NetHack should pass eight-bit character values (for example, specified with the +.op traps +option) straight through to your terminal (default off). +.lp font_map +NetHack should use a font by the chosen name for the map window. +.lp font_menu +NetHack should use a font by the chosen name for menu windows. +.lp font_message +NetHack should use a font by the chosen name for the message window. +.lp font_status +NetHack should use a font by the chosen name for the status window. +.lp font_text +NetHack should use a font by the chosen name for text windows. +.lp font_size_map +NetHack should use this size font for the map window. +.lp font_size_menu +NetHack should use this size font for menu windows. +.lp font_size_message +NetHack should use this size font for the message window. +.lp font_size_status +NetHack should use this size font for the status window. +.lp font_size_text +NetHack should use this size font for text windows. +.lp hilite_pet +Visually distinguish pets from similar animals (default off). +The behavior of this option depends on the type of windowing you use. +In text windowing, text highlighting or inverse video is often used; +with tiles, generally displays a heart symbol near pets. +.lp large_font +NetHack should use a large font. +.lp map_mode +NetHack should display the map in the manner specified. +.lp popup_dialog +NetHack should pop up dialog boxes for input. +.lp preload_tiles +NetHack should preload tiles into memory. +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 +NetHack should scroll the display when the hero or cursor +is this number of cells away from the edge of the window. +.lp tiled_map +NetHack should display a tiled map if it can. +.lp tiles_16x16 +NetHack should display 16x16 tiles if it can. +.lp tiles_32x32 +NetHack should display 32x32 tiles if it can. +.lp tiles_8x16 +NetHack should display 8x16 tiles if it can. +.lp use_inverse +NetHack should display inverse when the game specifies it. +.lp vary_msgcount +NetHack should display this number of messages at a time in +the message window. +.hn 2 Configuring NetHack for Play by the Blind .pg NetHack can be set up to use only standard ASCII characters for making diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index dd04ce014..662fdf881 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2053,10 +2053,6 @@ You may have to turn this off if you have more than 2 GB free space on the partition used for your save and level files. Only applies when MFLOPPY was defined during compilation. %.lp -\item[\ib{color}] -Use color for different monsters, objects, and dungeon features -(default on for microcomputers). -%.lp \item[\ib{confirm}] Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). @@ -2167,11 +2163,6 @@ or the present ones rearranged. Cannot be set with the `{\tt O}' command. %.lp -\item[\ib{eight\_bit\_tty}] -Pass eight-bit character values (for example, specified with the {\it -traps \/} option) straight through to your terminal (default off). -Only applies to the tty port. -%.lp \item[\ib{extmenu}] Changes the extended commands interface to pop-up a menu of available commands. It is keystroke compatible with the traditional interface except that it does @@ -2208,12 +2199,6 @@ Turning help off makes just looking at things faster, since you aren't interrupted with the ``{\tt More info?}'' prompt, but it also means that you might miss some interesting and/or important information. %.lp -\item[\ib{hilite\_pet}] -Visually distinguish pets from similar animals (default off). -The behavior of this option depends on the type of windowing you use. -In text windowing, text highlighting or inverse video is often used; -with tiles, generally displays a heart symbol near pets. -%.lp \item[\ib{horsename}] Name your starting horse (ex.\ ``{\tt horsename:Trigger}''). Cannot be set with the `{\tt O}' command. @@ -2397,12 +2382,6 @@ is on. Default is all types. \item[\ib{prayconfirm}] Prompt for confirmation before praying (default on). %.lp -\item[\ib{preload\_tiles}] -For 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 `{\tt O}' command. -%.lp \item[\ib{pushweapon}] Using the `w' (wield) command when already wielding something pushes the old item into your secondary weapon slot (default off). @@ -2519,6 +2498,118 @@ Select which windowing system to use, such as ``{\tt tty}'' or ``{\tt X11}'' Cannot be set with the `{\tt O}' command. \elist +%.hn 2 +\subsection*{Window Port Customization options} + +%.pg +Here are explanations of the various options that are +used to customize and change the characteristics of the +windowtype that you have chosen. +Character strings that are too long may be truncated. +Not all window ports will adjust for all settings listed +here. You can safely add any of these options to your +config file, and if the window port is capable of adjusting +to suit your preferences, it will attempt to do so. If it +can't it will silently ignore it. You can find out if an +option is supported by the window port that you are currently +using by checking to see if it shows up in the Options list. +Some options are dynamic and can be specified during the game +with the `{\tt O}' command. + +\blist{} +%.lp +\item[\ib{align\_message}] + Where to align or place the message window (top, bottom, left, or right) +%.lp +\item[\ib{align\_status}] + Where to align or place the status window (top, bottom, left, or right). +%.lp +\item[\ib{ascii\_map}] +NetHack should display an ascii map if it can. +%.lp +\item[\ib{color}] +NetHack should display color if it can for different monsters, +objects, and dungeon features +%.lp +\item[\ib{eight\_bit\_tty}] +Pass eight-bit character values (for example, specified with the {\it +traps \/} option) straight through to your terminal (default off). +%.lp +\item[\ib{font\_map}] +NetHack should use a font by the chosen name for the map window. +%.lp +\item[\ib{font\_menu}] +NetHack should use a font by the chosen name for menu windows. +%.lp +\item[\ib{font\_message}] +NetHack should use a font by the chosen name for the message window. +%.lp +\item[\ib{font\_status}] +NetHack should use a font by the chosen name for the status window. +%.lp +\item[\ib{font\_text}] +NetHack should use a font by the chosen name for text windows. +%.lp +\item[\ib{font\_size\_map}] +NetHack should use this size font for the map window. +%.lp +\item[\ib{font\_size\_menu}] +NetHack should use this size font for menu windows. +%.lp +\item[\ib{font\_size\_message}] +NetHack should use this size font for the message window. +%.lp +\item[\ib{font\_size\_status}] +NetHack should use this size font for the status window. +%.lp +\item[\ib{font\_size\_text}] +NetHack should use this size font for text windows. +%.lp +\item[\ib{hilite\_pet}] +Visually distinguish pets from similar animals (default off). +The behavior of this option depends on the type of windowing you use. +In text windowing, text highlighting or inverse video is often used; +with tiles, generally displays a heart symbol near pets. +%.lp +\item[\ib{large\_font}] +NetHack should use a large font. +%.lp +\item[\ib{map\_mode}] +NetHack should display the map in the manner specified. +%.lp +\item[\ib{popup\_dialog}] +NetHack should pop up dialog boxes for input. +%.lp +\item[\ib{preload\_tiles}] +NetHack should preload tiles into memory. +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 `{\tt O}' command. +%.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. +%.lp +\item[\ib{tiled\_map}] +NetHack should display a tiled map if it can. +%.lp +\item[\ib{tiles\_16x16}] +NetHack should display 16x16 tiles if it can. +%.lp +\item[\ib{tiles\_32x32}] +NetHack should display 32x32 tiles if it can. +%.lp +\item[\ib{tiles\_8x16}] +NetHack should display 8x16 tiles if it can. +%.lp +\item[\ib{use\_inverse}] +NetHack should display inverse when the game specifies it. +%.lp +\item[\ib{vary\_msgcount}] +NetHack should display this number of messages at a time in the message window. +\elist + %.hn 2 \subsection*{Configuring NetHack for Play by the Blind} diff --git a/doc/window.doc b/doc/window.doc index de6f3a5ad..5e20f7c70 100644 --- a/doc/window.doc +++ b/doc/window.doc @@ -5,17 +5,18 @@ NetHack. The support is through a standard interface, separating the main NetHack code from window-system specific code. The implementation supports multiple window systems in the same binary. Even if you only wish to support one window-port on your port, you will need to follow -the instructions in Section VIII to get a compilable binary. +the instructions in Section IX to get a compilable binary. Contents: I. Window Types and Terminology II. Interface Specification III. Global variables - IV. New or respecified common, high level routines - V. Helper routines - VI. Game startup - VII. Conventions - VIII. Implementation and Multi-window support + IV. WINCAP preferences support + V. New or respecified common, high level routines + VI. Helper routines + VII. Game startup + VIII. Conventions + IX. Implementation and Multi-window support I. Window Types and Terminology @@ -351,6 +352,15 @@ outrip(winid, int) -- The tombstone code. If you want the traditional code use genl_outrip for the value and check the #if in rip.c. +preference_update(preference) + -- The player has just changed one of the wincap preference + settings, and the NetHack core is notifying your window + port of that change. If your window-port is capable of + dynamically adjusting to the change then it should do so. + Your window-port will only be notified of a particular + change if it indicated that it wants to be by setting the + corresponding bit in the wincap mask. + III. Global variables The following global variables are defined in decl.c and must be used by @@ -370,7 +380,101 @@ window-port should also declare this variable in one of your sys/*.c files. short ospeed; Set and declared in sys/unix/unixtty.c (don't know about other sys files). -IV. New or respecified common, high level routines +IV. WINCAP preferences support + +Starting with NetHack 3.3.2, the window interface was enhanced to provide +a common way of setting window port user preferences from the config file, +and from the command line for some settings. + +The wincap preference settings all have their underlying values stored +in iflags fields. The names of the wincap related fields are all pre- +fixed with wc_ to make it easy to identify them. Your window port can +access the fields directly. + +Your window port identifies what options it will react to and support +by setting bits in the window_procs wincap mask. See section IX for +details of where the wincap mask resides. Any preference settings +marked as being supported by having its bit set in the wincap mask +will be available for the user of your window port to set via the 'O' +command, while those not marked as supported will not appear in the +menus of the 'O' command. + +Setting of any wincap option is handled by the NetHack core option +code, you do not have to provide a parser in your window port. + +Here are the wincap preference settings that your port can choose +to support: + + +-------------------+--------------------+-------------------+--------+ + | | | iflags field | data | + | player option | bit in wincap mask | for value | type | + |-------------------+--------------------+-------------------+--------+ + | align_message | WC_ALIGN_MESSAGE | wc_align_message |int | + | align_status | WC_ALIGN_STATUS | wc_align_status |int | + | ascii_map | WC_ASCII_MAP | wc_ascii_map |boolean | + | color | WC_COLOR | wc_color |boolean | + | eight_bit_tty | WC_EIGHT_BIT_IN | wc_eight_bit_input|boolean | + | font_map | WC_FONT_MAP | wc_font_map |char * | + | font_menu | WC_FONT_MENU | wc_font_menu |char * | + | font_message | WC_FONT_MESSAGE | wc_font_message |char * | + | font_size_map | WC_FONTSIZ_MAP | wc_fontsiz_map |int | + | font_size_menu | WC_FONTSIZ_MENU | wc_fontsiz_menu |int | + | font_size_message| WC_FONTSIZ_MESSAGE | wc_fontsiz_message|int | + | font_size_status | WC_FONTSIZ_STATUS | wc_fontsiz_status |int | + | font_size_text | WC_FONTSIZ_TEXT | wc_fontsiz_text |int | + | font_status | WC_FONT_STATUS | wc_font_status |char * | + | font_text | WC_FONT_TEXT | wc_font_text |char * | + | 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 | + | popup_dialog | WC_POPUP_DIALOG | wc_popup_dialog |boolean | + | preload_tiles | WC_PRELOAD_TILES | wc_preload_tiles |boolean | + | scroll_margin | WC_SCROLL_MARGIN | wc_scroll_margin |int | + | tiled_map | WC_TILED_MAP | wc_tiled_map |boolean | + | tiles_16x16 | WC_TILES_16x16 | wc_tiles_16x16 |boolean | + | tiles_32x32 | WC_TILES_32x32 | wc_tiles_32x32 |boolean | + | tiles_8x16 | WC_TILES_8x16 | wc_tiles_8x16 |boolean | + | use_inverse | WC_INVERSE | wc_inverse |boolean | + | vary_msgcount | WC_VARY_MSGCOUNT | wc_vary_msgcount |int | + +-------------------+--------------------+-------------------+--------+ + +align_message -- where to place message window (top, bottom, left, right) +align_status -- where to place status window (top, bottom, left, right). +ascii_map -- port should display an ascii map if it can. +color -- port should display color if it can. +eight_bit_tty -- port should allow eight bit input. +font_map -- port should use a font by this name for map window. +font_menu -- port should use a font by this name for menu windows. +font_message -- port should use a font by this name for message window. +font_size_map -- port should use this size font for the map window. +font_size_menu -- port should use this size font for menu windows. +font_size_message + -- port should use this size font for the message window. +font_size_status-- port should use this size font for the status window. +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. +popup_dialog -- port should pop up dialog boxes for input. +preload_tiles -- port should preload tiles into memory. +scroll_margin -- port should scroll the display when the hero or cursor + is this number of cells away from the edge of the window. +tiled_map -- port should display a tiled map if it can. +tiles_16x16 -- port should display 16x16 tiles if it can. +tiles_32x32 -- port should display 32x32 tiles if it can. +tiles_8x16 -- port should display 8x16 tiles if it can. +use_inverse -- port should display inverse when NetHack asks for it. +vary_msgcount -- port should display this number of messages at a time in + the message window. + +Whenever one of these settings is adjusted (and if supported by the port +by marking it so in the wincap mask), the port is notified of a change +to a setting by calling the port's preference_update() routine. The port +can choose to adjust for the change or ignore it. + +V. New or respecified common, high level routines These are not part of the interface, but mentioned here for your information. @@ -392,7 +496,7 @@ pline(str, ...) by Norep() and pline(). If the window system is not active (!iflags.window_inited) pline() uses raw_print(). -V. Helper Routines +VI. Helper Routines These are not part of the interface. They may be called by your window port routines to perform the desired task, instead of duplicating @@ -405,7 +509,7 @@ mapglyph(int glyph, int *ochar, int *ocolor, unsigned *special, int x, int y) Usually called from the window port's print_glyph() routine. -VI. Game startup +VII. Game startup The following is the general order in which calls from main() should be made, as they relate to the window system. The actual code may differ, but the @@ -438,7 +542,7 @@ Process_options() is currently still unique to each port. There may be need in the future to make it possible to replace this on a per window-port basis. -VII. Conventions +VIII. Conventions init_nhwindows() is expected to display a gee-whiz banner window, including the Copyright message. It is recommended that the COPYRIGHT_BANNER_A, @@ -463,7 +567,7 @@ in win/X11. The files in these directories contain _only_ window port code, and may be replaced completely by other window ports. -VIII. Implementation and Multi-window support +IX. Implementation and Multi-window support NetHack 3.2 and higher support multiple window systems in the same binary. When writing a new window-port, you need to follow the following guidelines: @@ -494,7 +598,9 @@ When writing a new window-port, you need to follow the following guidelines: 3) Declare a structure, "struct window_procs prefix_procs", (with your prefix instead of "prefix") and fill in names of all of your interface functions. The first entry in this structure is the name - of your window-port, which should be the prefix. The other entries + of your window-port, which should be the prefix. The second entry + is the wincap mask that identifies what window port preference + settings your port will react to and support. The other entries are the function addresses. Assuming that you followed the convention in (2), you can safely copy @@ -541,7 +647,7 @@ When writing a new window-port, you need to follow the following guidelines: 9) Look at your port's portmain.c (the file containing main()) and make sure that all of the calls match the the requirements laid out in - Section VI. + Section VII. Now, proceed with compilation and installation as usual. Don't forget to edit Makefile.src (or its equivalent) and config.h to set the diff --git a/include/extern.h b/include/extern.h index 2fe4fb7ea..6550e5fc4 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2196,6 +2196,7 @@ E void FDECL(setmnotwielded, (struct monst *,struct obj *)); E void FDECL(choose_windows, (const char *)); E char FDECL(genl_message_menu, (CHAR_P,int,const char *)); +E void FDECL(genl_preference_update, (const char *)); /* ### wizard.c ### */ diff --git a/include/flag.h b/include/flag.h index 579272d75..526932d5a 100644 --- a/include/flag.h +++ b/include/flag.h @@ -158,10 +158,6 @@ struct instance_flags { boolean cbreak; /* in cbreak mode, rogue format */ boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean echo; /* 1 to echo characters */ -#ifdef TTY_GRAPHICS - boolean eight_bit_tty; /* pass eight-bit characters through to tty */ - boolean extmenu; /* extended commands use menu interface */ -#endif boolean IBMgraphics; /* use IBM extended character set */ unsigned msg_history; /* hint: # of top lines to save */ boolean num_pad; /* use numbers for movement commands */ @@ -170,26 +166,14 @@ struct instance_flags { int purge_monsters; /* # of dead monsters still on fmon list */ int *opt_booldup; /* for duplication of boolean opts in config file */ int *opt_compdup; /* for duplication of compound opts in config file */ - + uchar bouldersym; /* symbol for boulder display */ #ifdef WIZARD boolean sanity_check; /* run sanity checks */ boolean mon_polycontrol; /* debug: control monster polymorphs */ #endif -#ifdef TEXTCOLOR - boolean use_color; /* use color graphics */ -#endif - boolean hilite_pet; /* hilight pets on supported environments */ - boolean use_inverse; /* inverse attribute is available on display */ -#ifdef MAC_GRAPHICS_ENV - boolean large_font; /* draw in larger fonts (say, 12pt instead - of 9pt) */ - boolean MACgraphics; /* use Macintosh extended character set, as - as defined in the special font HackFont */ - unsigned use_stone; /* use the stone ppats */ -#endif -#ifdef MAC - boolean popup_dialog; /* put queries in pop up dialogs instead of - in the message window */ +#ifdef TTY_GRAPHICS + boolean prevmsg_window; /* show more old messages at a time */ + boolean extmenu; /* extended commands use menu interface */ #endif #ifdef MFLOPPY boolean checkspace; /* check disk space before writing files */ @@ -200,33 +184,82 @@ struct instance_flags { boolean BIOS; /* use IBM or ST BIOS calls when appropriate */ boolean rawio; /* whether can use rawio (IOCTL call) */ #endif -#ifdef MSDOS - boolean hasvga; /* has a vga adapter */ - boolean usevga; /* use the vga adapter */ - boolean has8514; - boolean use8514; - boolean hasvesa; - boolean usevesa; - boolean grmode; /* currently in graphics mode */ +#ifdef MAC_GRAPHICS_ENV + boolean MACgraphics; /* use Macintosh extended character set, as + as defined in the special font HackFont */ + unsigned use_stone; /* use the stone ppats */ #endif #if defined(MSDOS) || defined(WIN32) boolean hassound; /* has a sound card */ boolean usesound; /* use the sound card */ boolean usepcspeaker; /* use the pc speaker */ - boolean preload_tiles; /* preload the tiles into RAM */ boolean tile_view; boolean over_view; boolean traditional_view; #endif +#ifdef MSDOS + boolean hasvga; /* has a vga adapter */ + boolean usevga; /* use the vga adapter */ + boolean grmode; /* currently in graphics mode */ +#endif #ifdef LAN_FEATURES boolean lan_mail; /* mail is initialized */ boolean lan_mail_fetched; /* mail is awaiting display */ #endif - uchar bouldersym; /* alternative boulder symbol */ +/* + * Window capability support. + */ + boolean wc_color; /* use color graphics */ + boolean wc_hilite_pet; /* hilight pets */ + boolean wc_ascii_map; /* show map using traditional ascii */ + boolean wc_tiled_map; /* show map using tiles */ + boolean wc_preload_tiles; /* preload tiles into memory */ + boolean wc_tiles_8x16; /* use 8x16 tiles */ + boolean wc_tiles_16x16; /* use 16x16 tiles */ + boolean wc_tiles_32x32; /* use 32x32 tiles */ + boolean wc_inverse; /* use inverse video for some things */ + int wc_align_status; /* status win at top|bot|right|left */ + int wc_align_message; /* message win at top|bot|right|left */ + int wc_vary_msgcount; /* show more old messages at a time */ + char *wc_font_map; /* points to font name for the map win */ + char *wc_font_message; /* points to font name for message win */ + char *wc_font_status; /* points to font name for status win */ + char *wc_font_menu; /* points to font name for menu win */ + char *wc_font_text; /* points to font name for text win */ + int wc_fontsiz_map; /* font size for the map win */ + int wc_fontsiz_message; /* font size for the message window */ + 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_margin; /* scroll map when this far from + the edge */ + int wc_map_mode; /* specify map viewing options, mostly + for backward compatibility */ + 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 */ +}; + +/* + * Old deprecated names + */ #ifdef TTY_GRAPHICS - boolean prevmsg_window; /* show more old messages at a time */ +#define eight_bit_tty wc_eight_bit_input #endif -}; +#ifdef TEXTCOLOR +#define use_color wc_color +#endif +#define hilite_pet wc_hilite_pet +#define use_inverse wc_inverse +#ifdef MAC_GRAPHICS_ENV +#define large_font wc_large_font +#endif +#ifdef MAC +#define popup_dialog wc_popup_dialog +#endif +#define preload_tiles wc_preload_tiles extern NEARDATA struct flag flags; extern NEARDATA struct instance_flags iflags; diff --git a/include/winprocs.h b/include/winprocs.h index 28d4f28e3..c26f68a15 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -7,6 +7,7 @@ struct window_procs { const char *name; + unsigned long wincap; /* window port capability options supported */ void FDECL((*win_init_nhwindows), (int *, char **)); void NDECL((*win_player_selection)); void NDECL((*win_askname)); @@ -62,6 +63,7 @@ struct window_procs { void NDECL((*win_end_screen)); void FDECL((*win_outrip), (winid,int)); + void FDECL((*win_preference_update), (const char *)); }; extern NEARDATA struct window_procs windowprocs; @@ -125,4 +127,72 @@ extern NEARDATA struct window_procs windowprocs; #define end_screen (*windowprocs.win_end_screen) #define outrip (*windowprocs.win_outrip) +#define preference_update (*windowprocs.win_preference_update) + +/* + * WINCAP + * Window port preference capability bits. + * Some day this might be better in its own wincap.h file. + */ +#define WC_COLOR 0x01L /* 01 Port can display things in color */ +#define WC_HILITE_PET 0x02L /* 02 supports hilite pet */ +#define WC_ASCII_MAP 0x04L /* 03 supports an ascii map */ +#define WC_TILED_MAP 0x08L /* 04 supports a tiled map */ +#define WC_PRELOAD_TILES 0x10L /* 05 supports pre-loading tiles */ +#define WC_TILES_8x16 0x20L /* 06 supports 8x16 tiles */ +#define WC_TILES_16x16 0x40L /* 07 supports 16x16 tiles */ +#define WC_TILES_32x32 0x80L /* 08 supports 32x32 tiles */ +#define WC_INVERSE 0x100L /* 09 Port supports inverse video */ +#define WC_ALIGN_MESSAGE 0x200L /* 10 supports message alignmt top|b|l|r */ +#define WC_ALIGN_STATUS 0x400L /* 11 supports status alignmt top|b|l|r */ +#define WC_VARY_MSGCOUNT 0x800L /* 12 supports varying message window */ +#define WC_FONT_MAP 0x1000L /* 13 supports specification of map win font */ +#define WC_FONT_MESSAGE 0x2000L /* 14 supports specification of msg win font */ +#define WC_FONT_STATUS 0x4000L /* 15 supports specification of sts win font */ +#define WC_FONT_MENU 0x8000L /* 16 supports specification of mnu win font */ +#define WC_FONT_TEXT 0x10000L /* 17 supports specification of txt win font */ +#define WC_FONTSIZ_MAP 0x20000L /* 18 supports specification of map win font */ +#define WC_FONTSIZ_MESSAGE 0x40000L /* 19 supports specification of msg win font */ +#define WC_FONTSIZ_STATUS 0x80000L /* 20 supports specification of sts win font */ +#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_POPUP_DIALOG 0x800000L /* 24 supports queries in pop dialogs */ +#define WC_LARGE_FONT 0x1000000L /* 25 Port supports large font */ +#define WC_EIGHT_BIT_IN 0x2000000L /* 26 8-bit character input */ +#define WC_PERM_INVENT 0x4000000L /* 27 8-bit character input */ +#define WC_MAP_MODE 0x8000000L /* 28 map_mode option */ + /* 4 free bits */ +#define ALIGN_LEFT 1 +#define ALIGN_RIGHT 2 +#define ALIGN_TOP 3 +#define ALIGN_BOTTOM 4 + +#define MAP_MODE_TILES 0 +#define MAP_MODE_ASCII4x6 1 +#define MAP_MODE_ASCII6x8 2 +#define MAP_MODE_ASCII8x8 3 +#define MAP_MODE_ASCII16x8 4 +#define MAP_MODE_ASCII7x12 5 +#define MAP_MODE_ASCII8x12 6 +#define MAP_MODE_ASCII16x12 7 +#define MAP_MODE_ASCII12x16 8 +#define MAP_MODE_ASCII10x18 9 +#define MAP_MODE_ASCII_FIT_TO_SCREEN 10 + +#if 0 +#define WC_SND_SOUND 0x01L /* 01 Port has some sound capabilities */ +#define WC_SND_SPEAKER 0x02L /* 02 Sound supported via built-in speaker */ +#define WC_SND_STEREO 0x04L /* 03 Stereo sound supported */ +#define WC_SND_RAW 0x08L /* 04 Raw sound supported */ +#define WC_SND_WAVE 0x10L /* 05 Wave support */ +#define WC_SND_MIDI 0x20L /* 06 Midi support */ + /* 26 free bits */ #endif + +struct wc_Opt { + char *wc_name; + unsigned long wc_bit; +}; + +#endif /* WINPROCS_H */ diff --git a/src/options.c b/src/options.c index 5300540b5..8c9047075 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)options.c 3.3 2000/08/01 */ +/* SCCS Id: @(#)options.c 3.3 2002/02/02 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,175 +24,170 @@ NEARDATA struct instance_flags iflags; /* provide linkage */ * and also the Guidebooks. */ +/* + * Option flags + * Each higher number includes the characteristics of the numbers + * below it. + */ +#define SET_IN_FILE 0 /* config file option only, not visible in game + * or via program */ +#define SET_VIA_PROG 1 /* may be set via extern program, not seen in game */ +#define DISP_IN_GAME 2 /* may be set via extern program, displayed in game */ +#define SET_IN_GAME 3 /* may be set via extern program or set in the game */ + static struct Bool_Opt { const char *name; boolean *addr, initvalue; + int optflags; } boolopt[] = { #ifdef AMIGA - {"altmeta", &flags.altmeta, TRUE}, + {"altmeta", &flags.altmeta, TRUE, DISP_IN_GAME}, #else - {"altmeta", (boolean *)0, TRUE}, + {"altmeta", (boolean *)0, TRUE, DISP_IN_GAME}, #endif + {"ascii_map", &iflags.wc_ascii_map, TRUE, SET_IN_GAME}, /*WC*/ #ifdef MFLOPPY - {"asksavedisk", &flags.asksavedisk, FALSE}, + {"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME}, #else - {"asksavedisk", (boolean *)0, FALSE}, + {"asksavedisk", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"autodig", &flags.autodig, FALSE}, - {"autopickup", &flags.pickup, TRUE}, - {"autoquiver", &flags.autoquiver, FALSE}, + {"autodig", &flags.autodig, FALSE, SET_IN_GAME}, + {"autopickup", &flags.pickup, TRUE, SET_IN_GAME}, + {"autoquiver", &flags.autoquiver, FALSE, SET_IN_GAME}, #if defined(MICRO) && !defined(AMIGA) - {"BIOS", &iflags.BIOS, FALSE}, + {"BIOS", &iflags.BIOS, FALSE, SET_IN_FILE}, #else - {"BIOS", (boolean *)0, FALSE}, + {"BIOS", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef INSURANCE - {"checkpoint", &flags.ins_chkpt, TRUE}, + {"checkpoint", &flags.ins_chkpt, TRUE, DISP_IN_GAME}, #else - {"checkpoint", (boolean *)0, FALSE}, + {"checkpoint", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef MFLOPPY - {"checkspace", &iflags.checkspace, TRUE}, + {"checkspace", &iflags.checkspace, TRUE, SET_IN_GAME}, #else - {"checkspace", (boolean *)0, FALSE}, + {"checkspace", (boolean *)0, FALSE, SET_IN_FILE}, #endif -#ifdef TEXTCOLOR # ifdef MICRO - {"color", &iflags.use_color, TRUE}, + {"color", &iflags.wc_color,TRUE, SET_IN_GAME}, /*WC*/ # else /* systems that support multiple terminals, many monochrome */ - {"color", &iflags.use_color, FALSE}, + {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/ # endif -#else - {"color", (boolean *)0, FALSE}, -#endif - {"confirm",&flags.confirm, TRUE}, + {"confirm",&flags.confirm, TRUE, SET_IN_GAME}, #ifdef TERMLIB - {"DECgraphics", &iflags.DECgraphics, FALSE}, + {"DECgraphics", &iflags.DECgraphics, FALSE, DISP_IN_GAME}, #else - {"DECgraphics", (boolean *)0, FALSE}, + {"DECgraphics", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, DISP_IN_GAME}, /*WC*/ #ifdef TTY_GRAPHICS - {"eight_bit_tty", &iflags.eight_bit_tty, FALSE}, - {"extmenu", &iflags.extmenu, FALSE}, + {"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME}, #else - {"eight_bit_tty", (boolean *)0, FALSE}, - {"extmenu", (boolean *)0, FALSE}, + {"extmenu", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef OPT_DISPMAP - {"fast_map", &flags.fast_map, TRUE}, + {"fast_map", &flags.fast_map, TRUE, SET_IN_GAME}, #else - {"fast_map", (boolean *)0, TRUE}, + {"fast_map", (boolean *)0, TRUE, SET_IN_FILE}, #endif - {"female", &flags.female, FALSE}, - {"fixinv", &flags.invlet_constant, TRUE}, + {"female", &flags.female, FALSE, DISP_IN_GAME}, + {"fixinv", &flags.invlet_constant, TRUE, DISP_IN_GAME}, #ifdef AMIFLUSH - {"flush", &flags.amiflush, FALSE}, + {"flush", &flags.amiflush, FALSE, SET_IN_GAME}, #else - {"flush", (boolean *)0, FALSE}, + {"flush", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"help", &flags.help, TRUE}, - {"hilite_pet", &iflags.hilite_pet, FALSE}, + {"help", &flags.help, TRUE, SET_IN_GAME}, + {"hilite_pet", &iflags.wc_hilite_pet, FALSE, SET_IN_GAME}, /*WC*/ #ifdef ASCIIGRAPH - {"IBMgraphics", &iflags.IBMgraphics, FALSE}, + {"IBMgraphics", &iflags.IBMgraphics, FALSE, DISP_IN_GAME}, #else - {"IBMgraphics", (boolean *)0, FALSE}, + {"IBMgraphics", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"ignintr", &flags.ignintr, FALSE}, + {"ignintr", &flags.ignintr, FALSE, SET_IN_GAME}, + {"large_font", &iflags.wc_large_font, FALSE, SET_IN_GAME}, /*WC*/ + {"legacy", &flags.legacy, TRUE, DISP_IN_GAME}, + {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME}, #ifdef MAC_GRAPHICS_ENV - {"large_font", &iflags.large_font, FALSE}, + {"Macgraphics", &iflags.MACgraphics, TRUE, DISP_IN_GAME}, #else - {"large_font", (boolean *)0, FALSE}, -#endif - {"legacy", &flags.legacy, TRUE}, - {"lit_corridor", &flags.lit_corridor, FALSE}, -#ifdef MAC_GRAPHICS_ENV - {"Macgraphics", &iflags.MACgraphics, TRUE}, -#else - {"Macgraphics", (boolean *)0, FALSE}, + {"Macgraphics", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef MAIL - {"mail", &flags.biff, TRUE}, + {"mail", &flags.biff, TRUE, SET_IN_GAME}, #else - {"mail", (boolean *)0, TRUE}, + {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif #ifdef TTY_GRAPHICS - {"msg_window", &iflags.prevmsg_window, FALSE}, + {"msg_window", &iflags.prevmsg_window, FALSE, SET_IN_GAME}, #else - {"msg_window", (boolean *)0, FALSE}, + {"msg_window", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef NEWS - {"news", &iflags.news, TRUE}, -#else - {"news", (boolean *)0, FALSE}, -#endif - {"null", &flags.null, TRUE}, - {"number_pad", &iflags.num_pad, FALSE}, -#ifdef MAC - {"page_wait", &flags.page_wait, TRUE}, + {"news", &iflags.news, TRUE, DISP_IN_GAME}, #else - {"page_wait", (boolean *)0, FALSE}, + {"news", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"perm_invent", &flags.perm_invent, FALSE}, + {"null", &flags.null, TRUE, SET_IN_GAME}, + {"number_pad", &iflags.num_pad, FALSE, SET_IN_GAME}, #ifdef MAC - {"popup_dialog", &iflags.popup_dialog, FALSE}, -#else - {"popup_dialog", (boolean *)0, FALSE}, -#endif - {"prayconfirm", &flags.prayconfirm, TRUE}, -#if defined(MSDOS) && defined(USE_TILES) - {"preload_tiles", &iflags.preload_tiles, TRUE}, + {"page_wait", &flags.page_wait, TRUE, SET_IN_GAME}, #else - {"preload_tiles", (boolean *)0, FALSE}, + {"page_wait", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"pushweapon", &flags.pushweapon, FALSE}, + {"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME}, + {"popup_dialog", &iflags.wc_popup_dialog, FALSE, SET_IN_GAME}, /*WC*/ + {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME}, + {"preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME}, /*WC*/ + {"pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME}, #if defined(MICRO) && !defined(AMIGA) - {"rawio", &iflags.rawio, FALSE}, + {"rawio", &iflags.rawio, FALSE, DISP_IN_GAME}, #else - {"rawio", (boolean *)0, FALSE}, + {"rawio", (boolean *)0, FALSE, SET_IN_FILE}, #endif - {"rest_on_space", &flags.rest_on_space, FALSE}, - {"safe_pet", &flags.safe_dog, TRUE}, + {"rest_on_space", &flags.rest_on_space, FALSE, SET_IN_GAME}, + {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME}, #ifdef WIZARD - {"sanity_check", &iflags.sanity_check, FALSE}, + {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME}, #else - {"sanity_check", (boolean *)0, FALSE}, + {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef EXP_ON_BOTL - {"showexp", &flags.showexp, FALSE}, + {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, #else - {"showexp", (boolean *)0, FALSE}, + {"showexp", (boolean *)0, FALSE, SET_IN_FILE}, #endif #ifdef SCORE_ON_BOTL - {"showscore", &flags.showscore, FALSE}, + {"showscore", &flags.showscore, FALSE, SET_IN_GAME}, #else - {"showscore", (boolean *)0, FALSE}, -#endif - {"silent", &flags.silent, TRUE}, - {"sortpack", &flags.sortpack, TRUE}, - {"sound", &flags.soundok, TRUE}, - {"sparkle", &flags.sparkle, TRUE}, - {"standout", &flags.standout, FALSE}, - {"time", &flags.time, FALSE}, + {"showscore", (boolean *)0, FALSE, SET_IN_FILE}, +#endif + {"silent", &flags.silent, TRUE, SET_IN_GAME}, + {"sortpack", &flags.sortpack, TRUE, SET_IN_GAME}, + {"sound", &flags.soundok, TRUE, SET_IN_GAME}, + {"sparkle", &flags.sparkle, TRUE, SET_IN_GAME}, + {"standout", &flags.standout, FALSE, SET_IN_GAME}, + {"time", &flags.time, FALSE, SET_IN_GAME}, + {"tiled_map", &iflags.wc_tiled_map, FALSE, DISP_IN_GAME}, /*WC*/ + {"tiles_8x16", &iflags.wc_tiles_8x16, FALSE, DISP_IN_GAME}, /*WC*/ + {"tiles_16x16", &iflags.wc_tiles_16x16, FALSE, DISP_IN_GAME}, /*WC*/ + {"tiles_32x32", &iflags.wc_tiles_32x32, FALSE, DISP_IN_GAME}, /*WC*/ #ifdef TIMED_DELAY - {"timed_delay", &flags.nap, TRUE}, + {"timed_delay", &flags.nap, TRUE, SET_IN_GAME}, #else - {"timed_delay", (boolean *)0, FALSE}, + {"timed_delay", (boolean *)0, FALSE, SET_IN_GAME}, #endif - {"tombstone",&flags.tombstone, TRUE}, - {"toptenwin",&flags.toptenwin, FALSE}, - {"use_inverse", &iflags.use_inverse, FALSE}, - {"verbose", &flags.verbose, TRUE}, - {(char *)0, (boolean *)0, FALSE} + {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME}, + {"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME}, + {"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/ + {"verbose", &flags.verbose, TRUE, SET_IN_GAME}, + {(char *)0, (boolean *)0, FALSE, 0} }; /* compound options, for option_help() and external programs like Amiga * frontend */ -#define SET_IN_FILE 0 /* config file option only, not visible in game - * or via program */ -#define SET_VIA_PROG 1 /* may be set via extern program, not seen in game */ -#define DISP_IN_GAME 2 /* may be set via extern program, displayed in game */ -#define SET_IN_GAME 3 /* may be set via extern program or set in the game */ static struct Comp_Opt { const char *name, *descr; @@ -205,6 +200,8 @@ static struct Comp_Opt } compopt[] = { { "align", "your starting alignment (lawful, neutral, or chaotic)", 8, DISP_IN_GAME }, + { "align_message", "message window alignment", 20, DISP_IN_GAME }, /*WC*/ + { "align_status", "status window alignment", 20, DISP_IN_GAME }, /*WC*/ #ifdef MAC { "background", "the color of the background (black or white)", 6, SET_IN_FILE }, @@ -222,18 +219,24 @@ static struct Comp_Opt MAXDCHARS+1, SET_IN_FILE }, { "effects", "the symbols to use in drawing special effects", MAXECHARS+1, SET_IN_FILE }, -#ifdef MAC - { "fontmap", "the font to use in the map window", 40, SET_IN_FILE }, - { "fontmessage", "the font to use in the message window", - 40, SET_IN_FILE }, - { "fonttext", "the font to use in text windows", 40, SET_IN_FILE }, -#endif + { "font_map", "the font to use in the map window", 40, DISP_IN_GAME }, /*WC*/ + { "font_menu", "the font to use in menus", 40, DISP_IN_GAME }, /*WC*/ + { "font_message", "the font to use in the message window", + 40, DISP_IN_GAME }, /*WC*/ + { "font_size_map", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/ + { "font_size_menu", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/ + { "font_size_message", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/ + { "font_size_status", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/ + { "font_size_text", "the size of the map font", 20, DISP_IN_GAME }, /*WC*/ + { "font_status", "the font to use in status window", 40, DISP_IN_GAME }, /*WC*/ + { "font_text", "the font to use in text windows", 40, DISP_IN_GAME }, /*WC*/ { "fruit", "the name of a fruit you enjoy eating", PL_FSIZ, SET_IN_GAME }, { "gender", "your starting gender (male or female)", 8, DISP_IN_GAME }, { "horsename", "the name of your (first) horse (e.g., horsename:Silver)", PL_PSIZ, DISP_IN_GAME }, + { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/ { "menustyle", "user interface for object selection", MENUTYPELEN, SET_IN_GAME }, { "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE }, @@ -280,6 +283,7 @@ static struct Comp_Opt PL_CSIZ, DISP_IN_GAME }, { "scores", "the parts of the score list you wish to see", 32, SET_IN_GAME }, + { "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 }, #endif @@ -290,6 +294,7 @@ static struct Comp_Opt #ifdef MAC {"use_stone", "use stone background patterns", 8, SET_IN_FILE }, #endif + { "vary_msgcount", "show more old messages at a time", 20, DISP_IN_GAME }, /*WC*/ #ifdef MSDOS { "video", "method of video updating", 20, SET_IN_FILE }, #endif @@ -298,14 +303,6 @@ static struct Comp_Opt 40, DISP_IN_GAME }, { "videoshades", "gray shades to map to black/gray/white", 32, DISP_IN_GAME }, -#endif -#if 0 - { "warnlevel", "minimum monster level to trigger warning", 4, SET_IN_GAME }, -#endif -#ifdef MSWIN_GRAPHICS - { "win32_map_mode", "map display mode under Windows", 20, SET_IN_FILE }, - { "win32_align_status", "status window alignment", 20, SET_IN_FILE }, - { "win32_align_message", "message window alignment", 20, SET_IN_FILE }, #endif { "windowtype", "windowing system to use", WINTYPELEN, DISP_IN_GAME }, { (char *)0, (char *)0, 0, 0 } @@ -412,6 +409,10 @@ STATIC_DCL int FDECL(warnlevel_opts, (char *, const char *)); #endif STATIC_DCL void FDECL(duplicate_opt_detection, (const char *, int)); +STATIC_OVL void FDECL(wc_set_font_name, (int, char *)); +STATIC_OVL boolean FDECL(is_wc_option, (const char *)); +STATIC_OVL boolean FDECL(wc_supported, (const char *)); + /* check whether a user-supplied option string is a proper leading substring of a particular option name; option string might have a colon or equals sign and arbitrary value appended to it */ @@ -644,6 +645,7 @@ char *tp; *tp = '\0'; } +#if 0 /* some boolean options can only be set on start-up */ STATIC_OVL int boolopt_only_initial(i) @@ -660,6 +662,7 @@ int i; #endif ); } +#endif STATIC_OVL void rejectoption(optname) @@ -1110,6 +1113,70 @@ boolean tinitial, tfrom_file; return; } + /* WINCAP + * setting font options */ + fullname = "font"; + if (!strncmpi(opts, fullname, 4)) + { int wintype = -1; + + opts += 4; + if (!strncmpi(opts, "map", 3) || + !strncmpi(opts, "_map", 4)) + wintype = NHW_MAP; + else if (!strncmpi(opts, "message", 7) || + !strncmpi(opts, "_message", 8)) + wintype = NHW_MESSAGE; + else if (!strncmpi(opts, "text", 4) || + !strncmpi(opts, "_text", 5)) + wintype = NHW_TEXT; + else if (!strncmpi(opts, "menu", 4) || + !strncmpi(opts, "_menu", 5)) + wintype = NHW_MENU; + else if (!strncmpi(opts, "status", 6) || + !strncmpi(opts, "_status", 7)) + wintype = NHW_STATUS; + + if (wintype > 0 && + (op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + wc_set_font_name(wintype, op); +#ifdef MAC + set_font_name (wintype, op); +#endif + return; + } + if (!strncmpi(opts, "_size_map", 8)) + wintype = NHW_MAP; + else if (!strncmpi(opts, "_size_message", 12)) + wintype = NHW_MESSAGE; + else if (!strncmpi(opts, "_size_text", 9)) + wintype = NHW_TEXT; + else if (!strncmpi(opts, "_size_menu", 9)) + wintype = NHW_MENU; + else if (!strncmpi(opts, "_size_status", 11)) + wintype = NHW_STATUS; + + if (wintype > 0 && !negated && + (op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + switch(wintype) { + case NHW_MAP: + iflags.wc_fontsiz_map = atoi(op); + break; + case NHW_MESSAGE: + iflags.wc_fontsiz_message = atoi(op); + break; + case NHW_TEXT: + iflags.wc_fontsiz_text = atoi(op); + break; + case NHW_MENU: + iflags.wc_fontsiz_menu = atoi(op); + break; + case NHW_STATUS: + iflags.wc_fontsiz_status = atoi(op); + break; + } + } else if (negated) bad_negation(fullname, TRUE); + return; + } #ifdef CHANGE_COLOR #ifdef MAC fullname = "use_stone"; @@ -1133,25 +1200,8 @@ boolean tinitial, tfrom_file; } return; } - - fullname = "font"; - if (!strncmpi(opts, fullname, 4)) - { int wintype = -1; - - opts += 4; - if (!strncmpi (opts, "map", 3)) - wintype = NHW_MAP; - else if (!strncmpi (opts, "message", 7)) - wintype = NHW_MESSAGE; - else if (!strncmpi (opts, "text", 4)) - wintype = NHW_TEXT; - - if (wintype > 0 && (op = string_for_env_opt(fullname, opts, FALSE)) != 0) - { set_font_name (wintype, op); - } - return; - } -#endif +#endif + if (match_optname(opts, "palette", 3, TRUE) # ifdef MAC || match_optname(opts, "hicolor", 3, TRUE) @@ -1224,7 +1274,7 @@ boolean tinitial, tfrom_file; } return; } -#endif +#endif /* CHANGE_COLOR */ if (match_optname(opts, "fruit", 2, TRUE)) { char empty_str = '\0'; @@ -1352,7 +1402,7 @@ goodfruit: else warning_opts(opts, fullname); return; } -#if 0 +#if 0 /* do not enable post 3.3.0 */ fullname = "warnlevel"; if (match_optname(opts, fullname, 5, TRUE)) { op = string_for_opt(opts, negated); @@ -1430,9 +1480,47 @@ goodfruit: return; } + /* WINCAP + * align_status:[left|top|right|bottom] */ + fullname = "align_status"; + if (match_optname(opts, fullname, sizeof("align_status")-1, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); + if (!negated) { + if (!strncmpi (op, "left", sizeof("left")-1)) + iflags.wc_align_status = ALIGN_LEFT; + else if (!strncmpi (op, "top", sizeof("top")-1)) + iflags.wc_align_status = ALIGN_TOP; + else if (!strncmpi (op, "right", sizeof("right")-1)) + iflags.wc_align_status = ALIGN_RIGHT; + else if (!strncmpi (op, "bottom", sizeof("bottom")-1)) + iflags.wc_align_status = ALIGN_BOTTOM; + else + badoption(opts); + } else if (negated) bad_negation(fullname, TRUE); + return; + } + /* WINCAP + * align_message:[left|top|right|bottom] */ + fullname = "align_message"; + if (match_optname(opts, fullname, sizeof("align_message")-1, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); + if (!negated) { + if (!strncmpi (op, "left", sizeof("left")-1)) + iflags.wc_align_message = ALIGN_LEFT; + else if (!strncmpi (op, "top", sizeof("top")-1)) + iflags.wc_align_message = ALIGN_TOP; + else if (!strncmpi (op, "right", sizeof("right")-1)) + iflags.wc_align_message = ALIGN_RIGHT; + else if (!strncmpi (op, "bottom", sizeof("bottom")-1)) + iflags.wc_align_message = ALIGN_BOTTOM; + else + badoption(opts); + } else if (negated) bad_negation(fullname, TRUE); + return; + } /* align:string */ fullname = "align"; - if (match_optname(opts, fullname, 4, TRUE)) { + if (match_optname(opts, fullname, sizeof("align")-1, TRUE)) { if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) if ((flags.initalign = str2align(op)) == ROLE_NONE) @@ -1745,80 +1833,60 @@ goodfruit: } #endif /* MSDOS */ -#ifdef MSWIN_GRAPHICS - /* win32_map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|ascii7x12|ascii8x12|ascii15x12 - |ascii12x16|ascii10x18|fit_to_screen] */ - fullname = "win32_map_mode"; - if (match_optname(opts, fullname, sizeof("win32_map_mode")-1, TRUE)) { - if (negated) { - bad_negation(fullname, FALSE); - return; - } - else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { - return; - } - if (!set_win32_option(fullname, opts)) - badoption(opts); - return; - } - - /* win32_align_status:[left|top|right|bottom] */ - fullname = "win32_align_status"; - if (match_optname(opts, fullname, sizeof("win32_align_status")-1, TRUE)) { - if (negated) { - bad_negation(fullname, FALSE); - return; - } - else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { - return; - } - if (!set_win32_option(fullname, opts)) - badoption(opts); + /* WINCAP + * map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|ascii7x12|ascii8x12| + ascii15x12|ascii12x16|ascii10x18|fit_to_screen] */ + fullname = "map_mode"; + if (match_optname(opts, fullname, sizeof("map_mode")-1, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); + if (!negated) { + if (!strncmpi (op, "tiles", sizeof("tiles")-1)) + iflags.wc_map_mode = MAP_MODE_TILES; + else if (!strncmpi (op, "ascii4x6", sizeof("ascii4x6")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII4x6; + else if (!strncmpi (op, "ascii6x8", sizeof("ascii6x8")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII6x8; + else if (!strncmpi (op, "ascii8x8", sizeof("ascii8x8")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII8x8; + else if (!strncmpi (op, "ascii16x8", sizeof("ascii16x8")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII16x8; + else if (!strncmpi (op, "ascii7x12", sizeof("ascii7x12")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII7x12; + else if (!strncmpi (op, "ascii8x12", sizeof("ascii8x12")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII8x12; + else if (!strncmpi (op, "ascii15x12", sizeof("ascii15x12")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII16x12; + else if (!strncmpi (op, "ascii12x16", sizeof("ascii12x16")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII12x16; + else if (!strncmpi (op, "ascii10x18", sizeof("ascii10x18")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII10x18; + else if (!strncmpi (op, "fit_to_screen", sizeof("fit_to_screen")-1)) + iflags.wc_map_mode = MAP_MODE_ASCII_FIT_TO_SCREEN; + else + badoption(opts); + } else if (negated) bad_negation(fullname, TRUE); return; } - /* win32_align_message:[left|top|right|bottom] */ - fullname = "win32_align_message"; - if (match_optname(opts, fullname, sizeof("win32_align_message")-1, TRUE)) { - if (negated) { - bad_negation(fullname, FALSE); - return; - } - else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { - return; - } - if (!set_win32_option(fullname, opts)) - badoption(opts); + /* WINCAP + * scroll_margin:nn */ + fullname = "scroll_margin"; + if (match_optname(opts, fullname, sizeof("scroll_margin")-1, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); + if ((negated && !op) || (!negated && op)) { + iflags.wc_scroll_margin = negated ? 5 : atoi(op); + } else if (negated) bad_negation(fullname, TRUE); return; } - /* win32_map_cliparound_margin:nn */ - fullname = "win32_map_cliparound_margin"; - if (match_optname(opts, fullname, sizeof("win32_map_cliparound_margin")-1, TRUE)) { - if (negated) { - bad_negation(fullname, FALSE); - return; - } - else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { - return; - } - if (!set_win32_option(fullname, opts)) - badoption(opts); + /* WINCAP + * vary_msgcount:nn */ + fullname = "vary_msgcount"; + if (match_optname(opts, fullname, sizeof("vary_msgcount")-1, TRUE)) { + op = string_for_env_opt(fullname, opts, negated); + if ((negated && !op) || (!negated && op)) { + iflags.wc_vary_msgcount = negated ? 0 : atoi(op); + } else if (negated) bad_negation(fullname, TRUE); return; } -#endif /* MSWIN_GRAPHICS */ -#ifdef WIN32CON - /* ignore the graphical win32 graphical options silently, - * so defaults.nh can be easily used by both tty and win32 - */ - if (match_optname(opts, "win32_map_mode", - sizeof("win32_map_mode")-1, TRUE) || - match_optname(opts, "win32_align_status", - sizeof("win32_align_status")-1, TRUE) || - match_optname(opts, "win32_align_message", - sizeof("win32_align_message")-1, TRUE) || - match_optname(opts, "win32_map_cliparound_margin", - sizeof("win32_map_cliparound_margin")-1, TRUE)) - return; -#endif fullname = "windowtype"; if (match_optname(opts, fullname, 3, TRUE)) { @@ -1910,7 +1978,11 @@ goodfruit: return; } /* options that must come from config file */ +#if 0 if (!initial && boolopt_only_initial(i)) { +#else + if (!initial && (boolopt[i].optflags == SET_IN_FILE)) { +#endif rejectoption(boolopt[i].name); return; } @@ -2157,11 +2229,14 @@ doset() for (pass = 0; pass <= 1; pass++) for (i = 0; boolopt[i].name; i++) if ((bool_p = boolopt[i].addr) != 0 && - (boolopt_only_initial(i) ^ pass)) { + ((boolopt[i].optflags == DISP_IN_GAME && pass == 0) || + (boolopt[i].optflags == SET_IN_GAME && pass == 1))) { if (bool_p == &flags.female) continue; /* obsolete */ #ifdef WIZARD if (bool_p == &iflags.sanity_check && !wizard) continue; #endif + if (is_wc_option(boolopt[i].name) && + !wc_supported(boolopt[i].name)) continue; any.a_int = (pass == 0) ? 0 : i + 1; Sprintf(buf, "%s%-13s [%s]", pass == 0 ? " " : "", @@ -2205,6 +2280,9 @@ doset() !strcmp(compopt[i].name, "race") || !strcmp(compopt[i].name, "gender")) continue; + else if (is_wc_option(compopt[i].name) && + !wc_supported(compopt[i].name)) + continue; else doset_add_menu(tmpwin, compopt[i].name, (pass == DISP_IN_GAME) ? 0 : indexoffset); @@ -2232,6 +2310,8 @@ doset() Sprintf(buf, "%s%s", *boolopt[opt_indx].addr ? "!" : "", boolopt[opt_indx].name); parseoptions(buf, setinitial, fromfile); + if (wc_supported(boolopt[opt_indx].name)) + preference_update(boolopt[opt_indx].name); } else { /* compound option */ opt_indx -= boolcount; @@ -2244,6 +2324,8 @@ doset() /* pass the buck */ parseoptions(buf, setinitial, fromfile); } + if (wc_supported(compopt[opt_indx].name)) + preference_update(boolopt[opt_indx].name); } } free((genericptr_t)pick_list); @@ -2395,7 +2477,19 @@ char *buf; int i; buf[0] = '\0'; - if (!strcmp(optname,"align")) + if (!strcmp(optname,"align_message")) + Sprintf(buf, "%s", iflags.wc_align_message == ALIGN_TOP ? "top" : + iflags.wc_align_message == ALIGN_LEFT ? "left" : + iflags.wc_align_message == ALIGN_BOTTOM ? "bottom" : + iflags.wc_align_message == ALIGN_RIGHT ? "right" : + "unknown"); + else if (!strcmp(optname,"align_status")) + Sprintf(buf, "%s", iflags.wc_align_message == ALIGN_TOP ? "top" : + iflags.wc_align_message == ALIGN_LEFT ? "left" : + iflags.wc_align_message == ALIGN_BOTTOM ? "bottom" : + iflags.wc_align_message == ALIGN_RIGHT ? "right" : + "unknown"); + else if (!strcmp(optname,"align")) Sprintf(buf, "%s", rolestring(flags.initalign, aligns, adj)); else if (!strcmp(optname, "boulder")) Sprintf(buf, "%c", iflags.bouldersym ? @@ -2419,12 +2513,46 @@ char *buf; Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "effects")) Sprintf(buf, "%s", to_be_done); + else if (!strcmp(optname, "font_map")) + Sprintf(buf, "%s", iflags.wc_font_map ? iflags.wc_font_map : none); + else if (!strcmp(optname, "font_message")) + Sprintf(buf, "%s", iflags.wc_font_message ? iflags.wc_font_message : none); + else if (!strcmp(optname, "font_status")) + Sprintf(buf, "%s", iflags.wc_font_status ? iflags.wc_font_status : none); + else if (!strcmp(optname, "font_menu")) + Sprintf(buf, "%s", iflags.wc_font_menu ? iflags.wc_font_menu : none); + else if (!strcmp(optname, "font_text")) + Sprintf(buf, "%s", iflags.wc_font_text ? iflags.wc_font_text : none); + else if (!strcmp(optname, "font_size_map")) + Sprintf(buf, "%d", iflags.wc_fontsiz_map); + else if (!strcmp(optname, "font_size_message")) + Sprintf(buf, "%d", iflags.wc_fontsiz_message); + else if (!strcmp(optname, "font_size_status")) + Sprintf(buf, "%d", iflags.wc_fontsiz_status); + else if (!strcmp(optname, "font_size_menu")) + Sprintf(buf, "%d", iflags.wc_fontsiz_menu); + else if (!strcmp(optname, "font_size_text")) + Sprintf(buf, "%d", iflags.wc_fontsiz_text); else if (!strcmp(optname, "fruit")) Sprintf(buf, "%s", pl_fruit); else if (!strcmp(optname, "gender")) Sprintf(buf, "%s", rolestring(flags.initgend, genders, adj)); else if (!strcmp(optname, "horsename")) Sprintf(buf, "%s", horsename[0] ? horsename : none); + else if (!strcmp(optname, "map_mode")) + Sprintf(buf, "%s", + iflags.wc_map_mode == MAP_MODE_TILES ? "tiles" : + iflags.wc_map_mode == MAP_MODE_ASCII4x6 ? "ascii4x6" : + iflags.wc_map_mode == MAP_MODE_ASCII6x8 ? "ascii6x8" : + iflags.wc_map_mode == MAP_MODE_ASCII8x8 ? "ascii8x8" : + iflags.wc_map_mode == MAP_MODE_ASCII16x8 ? "ascii16x8" : + iflags.wc_map_mode == MAP_MODE_ASCII7x12 ? "ascii7x12" : + iflags.wc_map_mode == MAP_MODE_ASCII8x12 ? "ascii8x12" : + iflags.wc_map_mode == MAP_MODE_ASCII16x12 ? "ascii16x12" : + iflags.wc_map_mode == MAP_MODE_ASCII12x16 ? "ascii12x16" : + iflags.wc_map_mode == MAP_MODE_ASCII10x18 ? "ascii10x18" : + iflags.wc_map_mode == MAP_MODE_ASCII_FIT_TO_SCREEN ? + "fit_to_screen" : "unknown"); else if (!strcmp(optname, "menustyle")) Sprintf(buf, "%s", menutype[(int)flags.menu_style] ); else if (!strcmp(optname, "menu_deselect_all")) @@ -2482,7 +2610,9 @@ char *buf; else if (!strcmp(optname, "scores")) { Sprintf(buf, "%d top/%d around%s", flags.end_top, flags.end_around, flags.end_own ? "/own" : ""); - } + } + else if (!strcmp(optname, "scroll_margin")) + Sprintf(buf, "%d", iflags.wc_scroll_margin); #ifdef MSDOS else if (!strcmp(optname, "soundcard")) Sprintf(buf, "%s", to_be_done); @@ -2497,6 +2627,8 @@ char *buf; FEATURE_NOTICE_VER_PATCH); } else if (!strcmp(optname, "traps")) Sprintf(buf, "%s", to_be_done); + else if (!strcmp(optname, "vary_msgcount")) + Sprintf(buf, "%d", iflags.wc_vary_msgcount); #ifdef MSDOS else if (!strcmp(optname, "video")) Sprintf(buf, "%s", to_be_done); @@ -2836,6 +2968,98 @@ char *class_select; return ret; } +struct wc_Opt wc_options[] = { + {"ascii_map", WC_ASCII_MAP}, + {"color", WC_COLOR}, + {"eight_bit_tty", WC_EIGHT_BIT_IN}, + {"hilite_pet", WC_HILITE_PET}, + {"large_font", WC_LARGE_FONT}, + {"popup_dialog", WC_POPUP_DIALOG}, + {"preload_tiles", WC_PRELOAD_TILES}, + {"tiled_map", WC_TILED_MAP}, + {"tiles_16x16", WC_TILES_16x16}, + {"tiles_32x32", WC_TILES_32x32}, + {"tiles_8x16", WC_TILES_8x16}, + {"use_inverse", WC_INVERSE}, + {"align_message", WC_ALIGN_MESSAGE}, + {"align_status", WC_ALIGN_STATUS}, + {"font_map", WC_FONT_MAP}, + {"font_menu", WC_FONT_MENU}, + {"font_message",WC_FONT_MESSAGE}, +#if 0 + {"perm_invent",WC_PERM_INVENT}, +#endif + {"font_size_map", WC_FONTSIZ_MAP}, + {"font_size_menu", WC_FONTSIZ_MENU}, + {"font_size_message", WC_FONTSIZ_MESSAGE}, + {"font_size_status", WC_FONTSIZ_STATUS}, + {"font_size_text", WC_FONTSIZ_TEXT}, + {"font_status", WC_FONT_STATUS}, + {"font_text", WC_FONT_TEXT}, + {"map_mode", WC_MAP_MODE}, + {"scroll_margin", WC_SCROLL_MARGIN}, + {"vary_msgcount",WC_VARY_MSGCOUNT}, + {(char *)0, 0L} +}; + +STATIC_OVL boolean +is_wc_option(optnam) +const char *optnam; +{ + int k = 0; + while (wc_options[k].wc_name) { + if (strcmp(wc_options[k].wc_name, optnam) == 0) + return TRUE; + k++; + } + return FALSE; +} + +STATIC_OVL boolean +wc_supported(optnam) +const char *optnam; +{ + int k = 0; + while (wc_options[k].wc_name) { + if (!strcmp(wc_options[k].wc_name, optnam) && + (windowprocs.wincap & wc_options[k].wc_bit)) + return TRUE; + k++; + } + return FALSE; +} + +STATIC_OVL void +wc_set_font_name(wtype, fontname) +int wtype; +char *fontname; +{ + char **fn = (char **)0; + switch(wtype) { + case NHW_MAP: + fn = &iflags.wc_font_map; + break; + case NHW_MESSAGE: + fn = &iflags.wc_font_message; + break; + case NHW_TEXT: + fn = &iflags.wc_font_text; + break; + case NHW_MENU: + fn = &iflags.wc_font_menu; + break; + case NHW_STATUS: + fn = &iflags.wc_font_status; + break; + } + if (fn) { + if (*fn) free(*fn); + *fn = (char *)alloc(strlen(fontname) + 1); + Strcpy(*fn, fontname); + } + return; +} + #endif /* OPTION_LISTS_ONLY */ /*options.c*/ diff --git a/src/save.c b/src/save.c index f70fbfbdf..a2bd8de28 100644 --- a/src/save.c +++ b/src/save.c @@ -991,6 +991,13 @@ freedynamicdata() free_waterlevel(); free_dungeons(); + /* some pointers in iflags */ + if (iflags.wc_font_map) free(iflags.wc_font_map); + if (iflags.wc_font_message) free(iflags.wc_font_message); + if (iflags.wc_font_text) free(iflags.wc_font_text); + if (iflags.wc_font_menu) free(iflags.wc_font_menu); + if (iflags.wc_font_status) free(iflags.wc_font_status); + #endif /* FREE_ALL_MEMORY */ return; } diff --git a/src/windows.c b/src/windows.c index dacde257d..6da8ecb5c 100644 --- a/src/windows.c +++ b/src/windows.c @@ -133,4 +133,16 @@ const char *mesg; return 0; } +void +genl_preference_update(pref) +const char *pref; +{ + extern struct wc_Opt wc_options[]; /* in options.c */ + /* window ports are expected to provide + their own preference update routine + for the preference capabilities that + they support. + Just return in this genl one. */ + return; +} /*windows.c*/ diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 43f0d6829..2f214b482 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -29,6 +29,7 @@ long amii_scrnmode; struct window_procs amii_procs = { "amii", + WC_COLOR|WC_HILITE_PET|WC_INVERSE, amii_init_nhwindows, amii_player_selection, amii_askname, @@ -76,7 +77,8 @@ struct window_procs amii_procs = /* other defs that really should go away (they're tty specific) */ amii_delay_output, amii_delay_output, - amii_outrip + amii_outrip, + genl_preference_update }; /* The view window layout uses the same function names so we can use @@ -85,6 +87,7 @@ struct window_procs amii_procs = struct window_procs amiv_procs = { "amitile", + WC_COLOR|WC_HILITE_PET|WC_INVERSE, amii_init_nhwindows, amii_player_selection, amii_askname, @@ -132,7 +135,8 @@ struct window_procs amiv_procs = /* other defs that really should go away (they're tty specific) */ amii_delay_output, amii_delay_output, - amii_outrip + amii_outrip, + genl_preference_update }; unsigned short amii_initmap[ AMII_MAXCOLORS ]; diff --git a/sys/mac/macwin.c b/sys/mac/macwin.c index 0cbbdc0a9..95a1ad180 100644 --- a/sys/mac/macwin.c +++ b/sys/mac/macwin.c @@ -2488,6 +2488,7 @@ try_key_queue (char *bufp) { /* Interface definition, for windows.c */ struct window_procs mac_procs = { "mac", + WC_ASCII_MAP|WC_COLOR|WC_LARGE_FONT, mac_init_nhwindows, mac_unimplemented, /* see macmenu.c:mac_askname() for player selection */ mac_askname, @@ -2538,6 +2539,7 @@ struct window_procs mac_procs = { 0, // mac_start_screen, 0, // mac_end_screen, genl_outrip, + genl_preference_update, }; /*macwin.c*/ diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 1705720db..cd7e48eee 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -5059,6 +5059,7 @@ extern "C" struct window_procs Qt_procs; struct window_procs Qt_procs = { "Qt", + WC_COLOR|WC_HILITE_PET, NetHackQtBind::qt_init_nhwindows, NetHackQtBind::qt_player_selection, NetHackQtBind::qt_askname, @@ -5112,6 +5113,7 @@ struct window_procs Qt_procs = { #else genl_outrip, #endif + genl_preference_update, }; extern "C" void play_usersound(const char* filename, int volume) diff --git a/win/X11/winX.c b/win/X11/winX.c index cb68d05cf..9d1d6597e 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -92,6 +92,7 @@ int updated_inventory; /* Interface definition, for windows.c */ struct window_procs X11_procs = { "X11", + WC_COLOR|WC_HILITE_PET, X11_init_nhwindows, X11_player_selection, X11_askname, @@ -144,6 +145,7 @@ struct window_procs X11_procs = { #else genl_outrip, #endif + genl_preference_update, }; /* diff --git a/win/gem/wingem.c b/win/gem/wingem.c index d7084310d..221dae2de 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -27,6 +27,7 @@ extern void mar_display_nhwindow(winid); /* from wingem1.c */ /* Interface definition, for windows.c */ struct window_procs Gem_procs = { "Gem", + WC_COLOR|WC_HILITE_PET|WC_INVERSE, Gem_init_nhwindows, Gem_player_selection, Gem_askname, @@ -79,7 +80,8 @@ struct window_procs Gem_procs = { /* other defs that really should go away (they're tty specific) */ Gem_start_screen, Gem_end_screen, - genl_outrip + genl_outrip, + genl_preference_update }; #ifdef MAC diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index a874fde2c..c5759c739 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -21,6 +21,7 @@ extern void tty_raw_print_bold(const char *); /* Interface definition, for windows.c */ struct window_procs Gnome_procs = { "Gnome", + WC_COLOR|WC_HILITE_PET|WC_INVERSE, gnome_init_nhwindows, gnome_player_selection, gnome_askname, @@ -69,6 +70,7 @@ struct window_procs Gnome_procs = { gnome_start_screen, gnome_end_screen, gnome_outrip, + genl_preference_update, }; /* diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 31d8516e1..842bf1d4b 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -45,6 +45,10 @@ extern char mapped_menu_cmds[]; /* from options.c */ /* Interface definition, for windows.c */ struct window_procs tty_procs = { "tty", +#ifdef MSDOS + WC_TILED_MAP|WC_TILES_16x16|WC_TILES_8x16|WC_ASCII_MAP +#endif + WC_COLOR|WC_HILITE_PET|WC_INVERSE, tty_init_nhwindows, tty_player_selection, tty_askname, @@ -97,7 +101,8 @@ struct window_procs tty_procs = { /* other defs that really should go away (they're tty specific) */ tty_start_screen, tty_end_screen, - genl_outrip + genl_outrip, + genl_preference_update, }; static int maxwin = 0; /* number of windows in use */ diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index d641951d6..3f64005af 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -33,6 +33,8 @@ static void mswin_main_loop(); /* Interface definition, for windows.c */ 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, mswin_init_nhwindows, mswin_player_selection, mswin_askname, @@ -81,6 +83,7 @@ struct window_procs mswin_procs = { mswin_start_screen, mswin_end_screen, mswin_outrip, + genl_preference_update, }; @@ -1039,4 +1042,4 @@ logDebug(const char *fmt, ...) } } -#endif \ No newline at end of file +#endif -- 2.50.1