diff -Naurbd slashem-0.0.8E0/configure slashem-0.0.8E0F1/configure --- slashem-0.0.8E0/configure 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/configure 2006-05-15 12:13:10.000000000 +0100 @@ -1,5 +1,4 @@ #! /bin/sh -# From configure.ac Revision: . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for SLASHEM 0.0.8. # @@ -274,6 +273,7 @@ PACKAGE_STRING='SLASHEM 0.0.8' PACKAGE_BUGREPORT='http://sourceforge.net/bugs/?group_id=9746' +ac_unique_file="slamfaq.txt" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -311,7 +311,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CHGRP CHOWN LN_S CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LEX LEXLIB LEX_OUTPUT_ROOT YACC ac_ct_CHOWN ac_ct_CHGRP WINTTYLIB PKG_CONFIG NETHACK_PROXY_CFLAGS NETHACK_PROXY_LIBS SDL_CONFIG ac_ct_SDL_CONFIG SDL_CONFIG_CFLAGS SDL_CONFIG_LIBS WINSRC WINOBJ WINLIB CNF_SHARE_DATND CPP EGREP LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SRCDIR CC CHGRP CHOWN CHMOD ZLIB_CFLAGS ZLIB_LIBS LN_S AWK CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LFLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os HOST_MSWIN HOST_UNIX SYSTEM SYSSRC SYSOBJ NHKEYDLL_GCC LEX LEXLIB LEX_OUTPUT_ROOT YACC ac_ct_CHOWN ac_ct_CHGRP ac_ct_CHMOD WINDRES ac_ct_WINDRES PKG_CONFIG NETHACK__LIBPNG_CFLAGS NETHACK__LIBPNG_LIBS NETHACK_LIBPNG_CFLAGS NETHACK_LIBPNG_LIBS EXTRA_UNSHARE WINTTYLIB NETHACK_PROXY_CFLAGS NETHACK_PROXY_LIBS SDL_CONFIG ac_ct_SDL_CONFIG SDL_CONFIG_CFLAGS SDL_CONFIG_LIBS WINSRC WINOBJ WINLIB CNF_SHARE_DATND CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -764,6 +764,18 @@ ac_env_CHOWN_value=$CHOWN ac_cv_env_CHOWN_set=${CHOWN+set} ac_cv_env_CHOWN_value=$CHOWN +ac_env_CHMOD_set=${CHMOD+set} +ac_env_CHMOD_value=$CHMOD +ac_cv_env_CHMOD_set=${CHMOD+set} +ac_cv_env_CHMOD_value=$CHMOD +ac_env_ZLIB_CFLAGS_set=${ZLIB_CFLAGS+set} +ac_env_ZLIB_CFLAGS_value=$ZLIB_CFLAGS +ac_cv_env_ZLIB_CFLAGS_set=${ZLIB_CFLAGS+set} +ac_cv_env_ZLIB_CFLAGS_value=$ZLIB_CFLAGS +ac_env_ZLIB_LIBS_set=${ZLIB_LIBS+set} +ac_env_ZLIB_LIBS_value=$ZLIB_LIBS +ac_cv_env_ZLIB_LIBS_set=${ZLIB_LIBS+set} +ac_cv_env_ZLIB_LIBS_value=$ZLIB_LIBS ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} @@ -844,7 +856,6 @@ System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi @@ -857,16 +868,18 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-tty-graphics use tty-graphics (default=yes) --enable-proxy-graphics use proxy-graphics (default=auto) + --enable-tty-graphics use tty-graphics (default=auto) --enable-x11-graphics use x11-graphics (default=no) --enable-sdl-graphics use sdl-graphics (default=no) --enable-gl-graphics use gl-graphics (enables sdl-graphics) (default=no) + --enable-mswin-graphics use Microsoft Window's native graphics (default=no) + --enable-data-librarian Data librarian (default=auto) --enable-sinks Kitchen sinks (default=yes) --enable-light-src-spell Spells are light sources (default=yes) --enable-wallified-maze Fancy mazes (default=yes) - --enable-reincarnation Special Rogue-like levels (default=yes) + --enable-reincarnation Special Rogue-like levels (default=no) --enable-blackmarket Blackmarket (default=yes) --enable-kops Keystone Kops (default=yes) --enable-seduce Succubi/incubi seduction (default=yes) @@ -884,39 +897,39 @@ --enable-dwarf Dwarf race (default=yes) --enable-tourist Tourist class (default=yes) --enable-yeoman Yeoman class (default=yes) - --enable-zouthern Zoutherner class (default=yes) + --enable-zouthern Zoutherner class (default=no) --enable-redo Redo last command (default=yes) --enable-clipping Allow smaller screens (default=yes) --enable-menu-color TTY graphics menu color (default=yes) --enable-elbereth Engraving the E-word repels monsters (default=yes) - --enable-noartifactwish Prevent wishing for special artifacts (default=yes) - --enable-no-bones Disable loading and saving bones levels - (default=yes) + --enable-noartifactwish Prevent wishing for special artifacts (default=no) + --enable-no-bones Disable loading and saving bones levels (default=no) --enable-user-sounds Allow user-defined regex mapping from messages to - sounds (Qt with NAS only) (default=yes) + sounds (Qt with NAS only) (default=no) --enable-exp-on-botl Show experience on bottom line (default=yes) - --enable-score-on-botl Show score on bottom line (default=yes) - --enable-borg Borg player (only under DOS) (default=yes) - --enable-keep-save Keep save files after restore (default=yes) + --enable-score-on-botl Show score on bottom line (default=no) + --enable-keep-save Keep save files after restore (default=no) --enable-charon Charon's boat, enables Cerebus (not implemented) - (default=yes) + (default=no) --enable-show-dmg Display damage reports (default=yes) --enable-show-weight Display object weight (default=yes) --enable-other-services Shopkeeper services (default=yes) --enable-dungeon-growth Dungeon growth (default=yes) - --enable-shout Shouting and pet commands (not implemented) - (default=yes) --enable-display-layers Support transparent tilesets (default=yes) --enable-goldobj Gold is kept on object chains (experimental) - (default=yes) + (default=no) --enable-autopickup-exceptions - Exceptions to autopickup (experimental) - (default=yes) + Exceptions to autopickup (experimental) (default=no) + --enable-wizmode=USER enable wizard mode for the specified user + (default=wizard) Some influential environment variables: CC C compiler CHGRP sets GAMEUID (set this to true as a no op) CHOWN sets GAMEGRP (set this to true as a no op) + CHMOD sets file modes (set this to true as a no op) + ZLIB_CFLAGS Compiler flags to find zlib header files + ZLIB_LIBS Linker flags to find zlib library files CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory @@ -1373,6 +1386,9 @@ +# $Revision: 1.9 $ + +SRCDIR=../$srcdir/src ac_aux_dir= for ac_dir in sys/autoconf $srcdir/sys/autoconf; do @@ -1404,6 +1420,9 @@ + + + echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s @@ -1415,16 +1434,48 @@ echo "${ECHO_T}no, using $LN_S" >&6 fi +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -echo "$as_me:$LINENO: checking for valid window system configuration" >&5 -echo $ECHO_N "checking for valid window system configuration... $ECHO_C" >&6 -# Check whether --enable-tty-graphics or --disable-tty-graphics was given. -if test "${enable_tty_graphics+set}" = set; then - enableval="$enable_tty_graphics" - enable_tty_graphics="$enableval" +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - enable_tty_graphics="yes" -fi; + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + + + # Check whether --enable-proxy-graphics or --disable-proxy-graphics was given. if test "${enable_proxy_graphics+set}" = set; then enableval="$enable_proxy_graphics" @@ -1432,6 +1483,21 @@ else enable_proxy_graphics="auto" fi; + if test "$enable_proxy_graphics" != "no"; then + nethack_wins="proxy $nethack_wins" + fi +nethack_default_win="" +# Note: Order is important: The last listed enabled port will be the default. +# Check whether --enable-tty-graphics or --disable-tty-graphics was given. +if test "${enable_tty_graphics+set}" = set; then + enableval="$enable_tty_graphics" + enable_tty_graphics="$enableval" +else + enable_tty_graphics="auto" +fi; + if test "$enable_tty_graphics" != "no"; then + nethack_wins="tty $nethack_wins" + fi # Check whether --enable-x11-graphics or --disable-x11-graphics was given. if test "${enable_x11_graphics+set}" = set; then enableval="$enable_x11_graphics" @@ -1439,6 +1505,9 @@ else enable_x11_graphics="no" fi; + if test "$enable_x11_graphics" != "no"; then + nethack_wins="x11 $nethack_wins" + fi # Check whether --enable-sdl-graphics or --disable-sdl-graphics was given. if test "${enable_sdl_graphics+set}" = set; then enableval="$enable_sdl_graphics" @@ -1446,29 +1515,33 @@ else enable_sdl_graphics="no" fi; + if test "$enable_sdl_graphics" != "no"; then + nethack_wins="sdl $nethack_wins" + fi # Check whether --enable-gl-graphics or --disable-gl-graphics was given. if test "${enable_gl_graphics+set}" = set; then enableval="$enable_gl_graphics" enable_gl_graphics="$enableval" - if test "$enable_gl_graphics" != "no" - then - enable_sdl_graphics="yes" - fi else enable_gl_graphics="no" fi; - - -if test "$enable_tty_graphics" = "no" && test "$enable_x11_graphics" = "no" -then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - { { echo "$as_me:$LINENO: error: need to enable at least one window system" >&5 -echo "$as_me: error: need to enable at least one window system" >&2;} - { (exit 1); exit 1; }; } + if test "$enable_gl_graphics" != "no"; then + nethack_wins="gl $nethack_wins" + fi +if test "$enable_gl_graphics" != no -a "$enable_sdl_graphics" = no; then + enable_sdl_graphics="yes" + nethack_wins=`echo $nethack_wins | sed 's/^gl/gl sdl/'` fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +# Check whether --enable-mswin-graphics or --disable-mswin-graphics was given. +if test "${enable_mswin_graphics+set}" = set; then + enableval="$enable_mswin_graphics" + enable_mswin_graphics="$enableval" +else + enable_mswin_graphics="no" +fi; + if test "$enable_mswin_graphics" != "no"; then + nethack_wins="mswin $nethack_wins" + fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2401,6 +2474,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 @@ -2455,47 +2529,73 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} - { (exit 1); exit 1; }; } +case $host_os in + mingw32 ) +cat >>confdefs.h <<\_ACEOF +#define WIN32 +_ACEOF -fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 -target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + HOST_UNIX=# -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- -case $target_os in + SYSTEM="Syswinnt" + SYSSRC="\${SYSMSWINSRC}" + SYSOBJ="\${SYSMSWINOBJ}" + ;; *bsd* ) cat >>confdefs.h <<\_ACEOF #define BSD _ACEOF -;; + + HOST_MSWIN=# + + + SYSTEM="Sysunix" + SYSSRC="\${SYSUNIXSRC}" + SYSOBJ="\${SYSUNIXOBJ}" + ;; * ) cat >>confdefs.h <<\_ACEOF #define SYSV _ACEOF -;; + + HOST_MSWIN=# + + + SYSTEM="Sysunix" + SYSSRC="\${SYSUNIXSRC}" + SYSOBJ="\${SYSUNIXOBJ}" + ;; esac -case $target_os in + + + + +if test $host_os = mingw32; then + echo "$as_me:$LINENO: checking for how to build NetHack key dynamic libraries" >&5 +echo $ECHO_N "checking for how to build NetHack key dynamic libraries... $ECHO_C" >&6 + if test "$GCC" = yes; then + echo "$as_me:$LINENO: result: gcc" >&5 +echo "${ECHO_T}gcc" >&6 + + else + echo "$as_me:$LINENO: result: unknown" >&5 +echo "${ECHO_T}unknown" >&6 + if test "$enable_tty_graphics" = yes; then + { { echo "$as_me:$LINENO: error: Don't know how to build NetHack key DLLs with $CC" >&5 +echo "$as_me: error: Don't know how to build NetHack key DLLs with $CC" >&2;} + { (exit 1); exit 1; }; } + else + { echo "$as_me:$LINENO: WARNING: Can't enable tty graphics (key dynamic libraries)" >&5 +echo "$as_me: WARNING: Can't enable tty graphics (key dynamic libraries)" >&2;} + enable_tty_graphics="no" + nethack_wins=`echo $nethack_wins | sed 's/tty //'` + + fi + fi +fi + +case $host_os in *cygwin* ) cat >>confdefs.h <<\_ACEOF #define CYGWIN32 @@ -2997,6 +3097,724 @@ CHGRP=$ac_ct_CHGRP fi +if test -n "$ac_tool_prefix"; then + for ac_prog in chmod true + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CHMOD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CHMOD"; then + ac_cv_prog_CHMOD="$CHMOD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CHMOD="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CHMOD=$ac_cv_prog_CHMOD +if test -n "$CHMOD"; then + echo "$as_me:$LINENO: result: $CHMOD" >&5 +echo "${ECHO_T}$CHMOD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CHMOD" && break + done +fi +if test -z "$CHMOD"; then + ac_ct_CHMOD=$CHMOD + for ac_prog in chmod true +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CHMOD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CHMOD"; then + ac_cv_prog_ac_ct_CHMOD="$ac_ct_CHMOD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CHMOD="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CHMOD=$ac_cv_prog_ac_ct_CHMOD +if test -n "$ac_ct_CHMOD"; then + echo "$as_me:$LINENO: result: $ac_ct_CHMOD" >&5 +echo "${ECHO_T}$ac_ct_CHMOD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CHMOD" && break +done + + CHMOD=$ac_ct_CHMOD +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_WINDRES" && ac_cv_prog_ac_ct_WINDRES="no" +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 +echo "${ECHO_T}$ac_ct_WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + WINDRES=$ac_ct_WINDRES +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + + + + # Slash'EM may well work with earlier versions, + # but 1.2.4 is the earliest tested to date. + + succeeded=no + + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo "$as_me:$LINENO: checking for libpng >= 1.2.4" >&5 +echo $ECHO_N "checking for libpng >= 1.2.4... $ECHO_C" >&6 + + if $PKG_CONFIG --exists "libpng >= 1.2.4" ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + succeeded=yes + + echo "$as_me:$LINENO: checking NETHACK__LIBPNG_CFLAGS" >&5 +echo $ECHO_N "checking NETHACK__LIBPNG_CFLAGS... $ECHO_C" >&6 + NETHACK__LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng >= 1.2.4"` + echo "$as_me:$LINENO: result: $NETHACK__LIBPNG_CFLAGS" >&5 +echo "${ECHO_T}$NETHACK__LIBPNG_CFLAGS" >&6 + + echo "$as_me:$LINENO: checking NETHACK__LIBPNG_LIBS" >&5 +echo $ECHO_N "checking NETHACK__LIBPNG_LIBS... $ECHO_C" >&6 + NETHACK__LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng >= 1.2.4"` + echo "$as_me:$LINENO: result: $NETHACK__LIBPNG_LIBS" >&5 +echo "${ECHO_T}$NETHACK__LIBPNG_LIBS" >&6 + else + NETHACK__LIBPNG_CFLAGS="" + NETHACK__LIBPNG_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + NETHACK__LIBPNG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng >= 1.2.4"` + + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + nethack__succeeded=maybe + else + nethack__succeeded=no + fi + + # Slash'EM doesn't use zlib directly, but libpng does. This should + # all be handled in libpng.pc, but isn't in many versions of libpng. + if test $nethack__succeeded = maybe; then + + for flag in -lz; do + + case "$flag" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_LIBS; do + if test $flag = "$flag"; then + break + fi + done + if test $flag = "$flag"; then + nethack__libs="$NETHACK__LIBPNG_LIBS" + else + case "$flag" in + -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + fi + ;; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + + done + + + nethack__save_cflags=$CFLAGS + nethack__save_libs=$LIBS + CFLAGS="$CFLAGS $NETHACK__LIBPNG_CFLAGS" + LIBS="$LIBS $nethack__libs" + echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5 +echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +png_structp ptr= + png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + NETHACK_LIBPNG_CFLAGS="$NETHACK__LIBPNG_CFLAGS"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; nethack__succeeded=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$nethack__save_cflags + LIBS=$nethack__save_libs + fi + # If the user has supplied flags, then believe them. + if test $nethack__succeeded = maybe -a \ + \( -n "$ZLIB_CFLAGS" -o -n "$ZLIB_LIBS" \); then + + for flag in $ZLIB_CFLAGS; do + + case "$flag" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_CFLAGS; do + if test $flag = "$flag"; then + break + fi + done + if test $flag = "$flag"; then + nethack__cflags="$NETHACK__LIBPNG_CFLAGS" + else + case "$flag" in + -L*)nethack__cflags="$flag $NETHACK__LIBPNG_CFLAGS";; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";; + esac + fi + ;; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";; + esac + + done + + + for flag in $ZLIB_LIBS; do + + case "$flag" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_LIBS; do + if test $flag = "$flag"; then + break + fi + done + if test $flag = "$flag"; then + nethack__libs="$NETHACK__LIBPNG_LIBS" + else + case "$flag" in + -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + fi + ;; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + + done + + + nethack__save_cflags=$CFLAGS + nethack__save_libs=$LIBS + CFLAGS="$CFLAGS $nethack__cflags" + LIBS="$LIBS $nethack__libs" + echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5 +echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +png_structp ptr= + png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; nethack__succeeded=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$nethack__save_cflags + LIBS=$nethack__save_libs + fi + # Otherwise, try pkg-config. + if test $nethack__succeeded = maybe; then + echo "$as_me:$LINENO: checking for zlib" >&5 +echo $ECHO_N "checking for zlib... $ECHO_C" >&6 + if $PKG_CONFIG --exists zlib; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + + for flag in `$PKG_CONFIG --cflags zlib`; do + + case "$flag" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_CFLAGS; do + if test $flag = "$flag"; then + break + fi + done + if test $flag = "$flag"; then + nethack__cflags="$NETHACK__LIBPNG_CFLAGS" + else + case "$flag" in + -L*)nethack__cflags="$flag $NETHACK__LIBPNG_CFLAGS";; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";; + esac + fi + ;; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS $flag";; + esac + + done + + + for flag in `$PKG_CONFIG --libs zlib`; do + + case "$flag" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_LIBS; do + if test $flag = "$flag"; then + break + fi + done + if test $flag = "$flag"; then + nethack__libs="$NETHACK__LIBPNG_LIBS" + else + case "$flag" in + -L*)nethack__libs="$flag $NETHACK__LIBPNG_LIBS";; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + fi + ;; + *) nethack__libs="$NETHACK__LIBPNG_LIBS $flag";; + esac + + done + + + nethack__save_cflags=$CFLAGS + nethack__save_libs=$LIBS + CFLAGS="$CFLAGS $nethack__cflags" + LIBS="$LIBS $nethack__libs" + echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5 +echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +png_structp ptr= + png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; nethack__succeeded=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$nethack__save_cflags + LIBS=$nethack__save_libs + else + echo "$as_me:$LINENO: result: not found by pkg-config" >&5 +echo "${ECHO_T}not found by pkg-config" >&6 + fi + fi + # Try the same prefix as libpng since zlib is + # likely to be installed in the same place. + if test $nethack__succeeded = maybe; then + nethack__libpng_prefix=`$PKG_CONFIG --variable=prefix libpng` + + case "-I$nethack__libpng_prefix/include" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_CFLAGS; do + if test $flag = "-I$nethack__libpng_prefix/include"; then + break + fi + done + if test $flag = "-I$nethack__libpng_prefix/include"; then + nethack__cflags="$NETHACK__LIBPNG_CFLAGS" + else + case "-I$nethack__libpng_prefix/include" in + -L*)nethack__cflags="-I$nethack__libpng_prefix/include $NETHACK__LIBPNG_CFLAGS";; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS -I$nethack__libpng_prefix/include";; + esac + fi + ;; + *) nethack__cflags="$NETHACK__LIBPNG_CFLAGS -I$nethack__libpng_prefix/include";; + esac + + + case "-L$nethack__libpng_prefix/lib" in + -I*|-L*|-l*) + for flag in $NETHACK__LIBPNG_LIBS; do + if test $flag = "-L$nethack__libpng_prefix/lib"; then + break + fi + done + if test $flag = "-L$nethack__libpng_prefix/lib"; then + nethack__libs="$NETHACK__LIBPNG_LIBS" + else + case "-L$nethack__libpng_prefix/lib" in + -L*)nethack__libs="-L$nethack__libpng_prefix/lib $NETHACK__LIBPNG_LIBS";; + *) nethack__libs="$NETHACK__LIBPNG_LIBS -L$nethack__libpng_prefix/lib";; + esac + fi + ;; + *) nethack__libs="$NETHACK__LIBPNG_LIBS -L$nethack__libpng_prefix/lib";; + esac + + + case "-lz" in + -I*|-L*|-l*) + for flag in $nethack__libs; do + if test $flag = "-lz"; then + break + fi + done + if test $flag = "-lz"; then + nethack__libs="$nethack__libs" + else + case "-lz" in + -L*)nethack__libs="-lz $nethack__libs";; + *) nethack__libs="$nethack__libs -lz";; + esac + fi + ;; + *) nethack__libs="$nethack__libs -lz";; + esac + + + nethack__save_cflags=$CFLAGS + nethack__save_libs=$LIBS + CFLAGS="$CFLAGS $nethack__cflags" + LIBS="$LIBS $nethack__libs" + echo "$as_me:$LINENO: checking if libpng is useable with $CFLAGS and $LIBS" >&5 +echo $ECHO_N "checking if libpng is useable with $CFLAGS and $LIBS... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +png_structp ptr= + png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + NETHACK_LIBPNG_CFLAGS="$nethack__cflags"; NETHACK_LIBPNG_LIBS="$nethack__libs"; echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; nethack__succeeded=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$nethack__save_cflags + LIBS=$nethack__save_libs + fi + if test $nethack__succeeded = yes; then + echo "$as_me:$LINENO: checking NETHACK_LIBPNG_CFLAGS" >&5 +echo $ECHO_N "checking NETHACK_LIBPNG_CFLAGS... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: ${NETHACK_LIBPNG_CFLAGS}" >&5 +echo "${ECHO_T}${NETHACK_LIBPNG_CFLAGS}" >&6 + + echo "$as_me:$LINENO: checking NETHACK_LIBPNG_LIBS" >&5 +echo $ECHO_N "checking NETHACK_LIBPNG_LIBS... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: ${NETHACK_LIBPNG_LIBS}" >&5 +echo "${ECHO_T}${NETHACK_LIBPNG_LIBS}" >&6 + + have_libpng=yes + else have_libpng=no + fi @@ -3006,10 +3824,25 @@ CNF_SHARE_DATND= WINTTYLIB= -if test "$enable_tty_graphics" != "no" -then -TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo" -for termlib in ${TERMLIB_VARIANTS}; do +if test "$enable_tty_graphics" != "no"; then + if test $host_os = mingw32; then + EXTRA_UNSHARE=nhdefkey.dll nh340key.dll nhraykey.dll + + CFLAGS="$CFLAGS -DWIN32CON" + WINTTYLIB="" + WINSRC="${WINSRC} \$(WINTTYSRC)" + WINOBJ="${WINOBJ} \$(WINTTYOBJ)" + WINLIB="${WINLIB} \$(WINTTYLIB)" + +cat >>confdefs.h <<\_ACEOF +#define TTY_GRAPHICS +_ACEOF + + else + # For TTY, determine the termlib + # Check for termlib before termcap because Solaris termcap needs libucb. + TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo" + for termlib in ${TERMLIB_VARIANTS}; do as_ac_Lib=`echo "ac_cv_lib_${termlib}''_tgetent" | $as_tr_sh` echo "$as_me:$LINENO: checking for tgetent in -l${termlib}" >&5 echo $ECHO_N "checking for tgetent in -l${termlib}... $ECHO_C" >&6 @@ -3088,14 +3921,39 @@ break fi -done + done + if test -z "$termlib"; then + if test "$enable_tty_graphics" = yes; then + { { echo "$as_me:$LINENO: error: Can't find tgetent (needed for tty graphics)" >&5 +echo "$as_me: error: Can't find tgetent (needed for tty graphics)" >&2;} + { (exit 1); exit 1; }; } + else + { echo "$as_me:$LINENO: WARNING: Can't enable tty graphics (no tgetent)" >&5 +echo "$as_me: WARNING: Can't enable tty graphics (no tgetent)" >&2;} + enable_tty_graphics="no" + nethack_wins=`echo $nethack_wins | sed 's/tty //'` + + fi + fi + fi +fi +if test "$enable_tty_graphics" = "no" -a $host_os = mingw32; then + LFLAGS="$LFLAGS -mwindows" fi -if test "$enable_proxy_graphics" != "no" -then - if test "$enable_proxy_graphics" = "yes" - then +if test "$enable_proxy_graphics" != "no"; then + if test "$have_libpng" = "no"; then + if test "$enable_proxy_graphics" = "yes"; then + { { echo "$as_me:$LINENO: error: Need libpng for proxy graphics" >&5 +echo "$as_me: error: Need libpng for proxy graphics" >&2;} + { (exit 1); exit 1; }; } + else + { echo "$as_me:$LINENO: WARNING: Can't enable proxy graphics (no useable libpng)" >&5 +echo "$as_me: WARNING: Can't enable proxy graphics (no useable libpng)" >&2;} + fi + else + if test "$enable_proxy_graphics" = "yes"; then succeeded=no @@ -3292,8 +4150,9 @@ fi fi - if test -n "$NETHACK_PROXY_LIBS" - then + if test -n "$NETHACK_PROXY_LIBS"; then + CFLAGS="${CFLAGS} ${NETHACK_LIBPNG_CFLAGS}" + LFLAGS="${LFLAGS} ${NETHACK_LIBPNG_LFLAGS}" WINSRC="${WINSRC} \$(WINPROXYSRC)" WINOBJ="${WINOBJ} \$(WINPROXYOBJ)" WINLIB="${WINLIB} ${NETHACK_PROXY_LIBS}" @@ -3304,6 +4163,7 @@ _ACEOF fi + fi fi @@ -3583,13 +4443,51 @@ +if test "$enable_mswin_graphics" != "no"; then + if test "$WINDRES" = "no"; then + { { echo "$as_me:$LINENO: error: Need windres for Microsoft Window's native graphics" >&5 +echo "$as_me: error: Need windres for Microsoft Window's native graphics" >&2;} + { (exit 1); exit 1; }; } + fi + WINSRC="${WINSRC} \$(WINMSSRC)" + WINOBJ="${WINOBJ} \$(WINMSOBJ)" + WINLIB="${WINLIB} \$(WINMSLIB)" + CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_MSND)" +cat >>confdefs.h <<\_ACEOF +#define MSWIN_GRAPHICS +_ACEOF +fi + + +echo "$as_me:$LINENO: checking for valid window system configuration" >&5 +echo $ECHO_N "checking for valid window system configuration... $ECHO_C" >&6 +if test -n "$nethack_wins"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + for win in $nethack_wins; do + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_WINDOW_SYS "$win" +_ACEOF + + break + done +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: need to enable at least one window system" >&5 +echo "$as_me: error: need to enable at least one window system" >&2;} + { (exit 1); exit 1; }; } +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4006,9 +4904,26 @@ fi -echo "$as_me:$LINENO: checking for regex.h" >&5 -echo $ECHO_N "checking for regex.h... $ECHO_C" >&6 -if test "${ac_cv_header_regex_h+set}" = set; then +# Due to what may be a bug in autoconf, we have to call AC_CHECK_HEADERS() +# to get the various HAVE_xxx_H preprocessor variables detected by +# AC_HEADER_STDC active. These are needed for AC_CHECK_DECLS(), below. +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4017,9 +4932,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* TEST_REGEX */ +$ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -4043,53 +4958,50 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_header_regex_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_regex_h=no +eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5 -echo "${ECHO_T}$ac_cv_header_regex_h" >&6 -if test $ac_cv_header_regex_h = yes; then - have_regex_h=yes -else - have_regex_h=no -fi - - - -if test "$have_regex_h" = "yes"; then - # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi +done -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h +for ac_header in string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - #include <$ac_header> _ACEOF rm -f conftest.$ac_objext @@ -4114,17 +5026,100 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" +ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------------------------------- ## +## Report this to http://sourceforge.net/bugs/?group_id=9746 ## +## --------------------------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -4134,8 +5129,64 @@ done +echo "$as_me:$LINENO: checking for regex.h" >&5 +echo $ECHO_N "checking for regex.h... $ECHO_C" >&6 +if test "${ac_cv_header_regex_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* TEST_REGEX */ -echo "$as_me:$LINENO: checking for struct re_pattern_buffer" >&5 +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_regex_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_regex_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_regex_h" >&5 +echo "${ECHO_T}$ac_cv_header_regex_h" >&6 +if test $ac_cv_header_regex_h = yes; then + have_regex_h=yes +else + have_regex_h=no +fi + + + +if test "$have_regex_h" = "yes"; then + echo "$as_me:$LINENO: checking for struct re_pattern_buffer" >&5 echo $ECHO_N "checking for struct re_pattern_buffer... $ECHO_C" >&6 if test "${ac_cv_type_struct_re_pattern_buffer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4404,19 +5455,127 @@ echo "${ECHO_T}$ac_cv_have_decl_strncmpi" >&6 if test $ac_cv_have_decl_strncmpi = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCMPI 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define STRNCMPI +_ACEOF + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCMPI 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether strnicmp is declared" >&5 +echo $ECHO_N "checking whether strnicmp is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strnicmp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strnicmp + char *p = (char *) strnicmp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strnicmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_strnicmp=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnicmp" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strnicmp" >&6 +if test $ac_cv_have_decl_strnicmp = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNICMP 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF #define STRNCMPI _ACEOF +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNICMP 0 +_ACEOF + + fi + +# We use auto for data librarian to avoid breaking the rule that autoconf +# should use the same defaults as the manual configuration, but all platforms +# that support autoconf also support DLB, so the automatic choice is always yes. +echo "$as_me:$LINENO: checking whether to enable data-librarian" >&5 +echo $ECHO_N "checking whether to enable data-librarian... $ECHO_C" >&6 + # Check whether --enable-data-librarian or --disable-data-librarian was given. +if test "${enable_data_librarian+set}" = set; then + enableval="$enable_data_librarian" + +else + enable_data_librarian=yes +fi; + echo "$as_me:$LINENO: result: $enable_data_librarian" >&5 +echo "${ECHO_T}$enable_data_librarian" >&6 + if test "$enable_data_librarian" != "no" ; then + +cat >>confdefs.h <<_ACEOF +#define DLB +_ACEOF + + fi + echo "$as_me:$LINENO: checking whether to enable sinks" >&5 echo $ECHO_N "checking whether to enable sinks... $ECHO_C" >&6 # Check whether --enable-sinks or --disable-sinks was given. if test "${enable_sinks+set}" = set; then enableval="$enable_sinks" - enable_sinks="$enableval" + else enable_sinks="yes" fi; @@ -4432,10 +5591,10 @@ echo "$as_me:$LINENO: checking whether to enable light-src-spell" >&5 echo $ECHO_N "checking whether to enable light-src-spell... $ECHO_C" >&6 - # Check whether --enable-light_src_spell or --disable-light_src_spell was given. + # Check whether --enable-light-src-spell or --disable-light-src-spell was given. if test "${enable_light_src_spell+set}" = set; then enableval="$enable_light_src_spell" - enable_light_src_spell="$enableval" + else enable_light_src_spell="yes" fi; @@ -4451,10 +5610,10 @@ echo "$as_me:$LINENO: checking whether to enable wallified-maze" >&5 echo $ECHO_N "checking whether to enable wallified-maze... $ECHO_C" >&6 - # Check whether --enable-wallified_maze or --disable-wallified_maze was given. + # Check whether --enable-wallified-maze or --disable-wallified-maze was given. if test "${enable_wallified_maze+set}" = set; then enableval="$enable_wallified_maze" - enable_wallified_maze="$enableval" + else enable_wallified_maze="yes" fi; @@ -4473,7 +5632,7 @@ # Check whether --enable-reincarnation or --disable-reincarnation was given. if test "${enable_reincarnation+set}" = set; then enableval="$enable_reincarnation" - enable_reincarnation="$enableval" + else enable_reincarnation="no" fi; @@ -4492,7 +5651,7 @@ # Check whether --enable-blackmarket or --disable-blackmarket was given. if test "${enable_blackmarket+set}" = set; then enableval="$enable_blackmarket" - enable_blackmarket="$enableval" + else enable_blackmarket="yes" fi; @@ -4511,7 +5670,7 @@ # Check whether --enable-kops or --disable-kops was given. if test "${enable_kops+set}" = set; then enableval="$enable_kops" - enable_kops="$enableval" + else enable_kops="yes" fi; @@ -4530,7 +5689,7 @@ # Check whether --enable-seduce or --disable-seduce was given. if test "${enable_seduce+set}" = set; then enableval="$enable_seduce" - enable_seduce="$enableval" + else enable_seduce="yes" fi; @@ -4546,10 +5705,10 @@ echo "$as_me:$LINENO: checking whether to enable invisible-objects" >&5 echo $ECHO_N "checking whether to enable invisible-objects... $ECHO_C" >&6 - # Check whether --enable-invisible_objects or --disable-invisible_objects was given. + # Check whether --enable-invisible-objects or --disable-invisible-objects was given. if test "${enable_invisible_objects+set}" = set; then enableval="$enable_invisible_objects" - enable_invisible_objects="$enableval" + else enable_invisible_objects="yes" fi; @@ -4568,7 +5727,7 @@ # Check whether --enable-unpolypile or --disable-unpolypile was given. if test "${enable_unpolypile+set}" = set; then enableval="$enable_unpolypile" - enable_unpolypile="$enableval" + else enable_unpolypile="yes" fi; @@ -4584,10 +5743,10 @@ echo "$as_me:$LINENO: checking whether to enable wallet-o-p" >&5 echo $ECHO_N "checking whether to enable wallet-o-p... $ECHO_C" >&6 - # Check whether --enable-wallet_o_p or --disable-wallet_o_p was given. + # Check whether --enable-wallet-o-p or --disable-wallet-o-p was given. if test "${enable_wallet_o_p+set}" = set; then enableval="$enable_wallet_o_p" - enable_wallet_o_p="$enableval" + else enable_wallet_o_p="yes" fi; @@ -4606,7 +5765,7 @@ # Check whether --enable-lightsabers or --disable-lightsabers was given. if test "${enable_lightsabers+set}" = set; then enableval="$enable_lightsabers" - enable_lightsabers="$enableval" + else enable_lightsabers="yes" fi; @@ -4622,10 +5781,10 @@ echo "$as_me:$LINENO: checking whether to enable d-saber" >&5 echo $ECHO_N "checking whether to enable d-saber... $ECHO_C" >&6 - # Check whether --enable-d_saber or --disable-d_saber was given. + # Check whether --enable-d-saber or --disable-d-saber was given. if test "${enable_d_saber+set}" = set; then enableval="$enable_d_saber" - enable_d_saber="$enableval" + else enable_d_saber="yes" fi; @@ -4641,10 +5800,10 @@ echo "$as_me:$LINENO: checking whether to enable p-spoon" >&5 echo $ECHO_N "checking whether to enable p-spoon... $ECHO_C" >&6 - # Check whether --enable-p_spoon or --disable-p_spoon was given. + # Check whether --enable-p-spoon or --disable-p-spoon was given. if test "${enable_p_spoon+set}" = set; then enableval="$enable_p_spoon" - enable_p_spoon="$enableval" + else enable_p_spoon="yes" fi; @@ -4663,7 +5822,7 @@ # Check whether --enable-firearms or --disable-firearms was given. if test "${enable_firearms+set}" = set; then enableval="$enable_firearms" - enable_firearms="$enableval" + else enable_firearms="yes" fi; @@ -4679,10 +5838,10 @@ echo "$as_me:$LINENO: checking whether to enable eaten-memory" >&5 echo $ECHO_N "checking whether to enable eaten-memory... $ECHO_C" >&6 - # Check whether --enable-eaten_memory or --disable-eaten_memory was given. + # Check whether --enable-eaten-memory or --disable-eaten-memory was given. if test "${enable_eaten_memory+set}" = set; then enableval="$enable_eaten_memory" - enable_eaten_memory="$enableval" + else enable_eaten_memory="yes" fi; @@ -4701,7 +5860,7 @@ # Check whether --enable-steed or --disable-steed was given. if test "${enable_steed+set}" = set; then enableval="$enable_steed" - enable_steed="$enableval" + else enable_steed="yes" fi; @@ -4720,7 +5879,7 @@ # Check whether --enable-dwarf or --disable-dwarf was given. if test "${enable_dwarf+set}" = set; then enableval="$enable_dwarf" - enable_dwarf="$enableval" + else enable_dwarf="yes" fi; @@ -4739,7 +5898,7 @@ # Check whether --enable-tourist or --disable-tourist was given. if test "${enable_tourist+set}" = set; then enableval="$enable_tourist" - enable_tourist="$enableval" + else enable_tourist="yes" fi; @@ -4758,7 +5917,7 @@ # Check whether --enable-yeoman or --disable-yeoman was given. if test "${enable_yeoman+set}" = set; then enableval="$enable_yeoman" - enable_yeoman="$enableval" + else enable_yeoman="yes" fi; @@ -4777,7 +5936,7 @@ # Check whether --enable-zouthern or --disable-zouthern was given. if test "${enable_zouthern+set}" = set; then enableval="$enable_zouthern" - enable_zouthern="$enableval" + else enable_zouthern="no" fi; @@ -4796,7 +5955,7 @@ # Check whether --enable-redo or --disable-redo was given. if test "${enable_redo+set}" = set; then enableval="$enable_redo" - enable_redo="$enableval" + else enable_redo="yes" fi; @@ -4815,7 +5974,7 @@ # Check whether --enable-clipping or --disable-clipping was given. if test "${enable_clipping+set}" = set; then enableval="$enable_clipping" - enable_clipping="$enableval" + else enable_clipping="yes" fi; @@ -4831,10 +5990,10 @@ echo "$as_me:$LINENO: checking whether to enable menu-color" >&5 echo $ECHO_N "checking whether to enable menu-color... $ECHO_C" >&6 - # Check whether --enable-menu_color or --disable-menu_color was given. + # Check whether --enable-menu-color or --disable-menu-color was given. if test "${enable_menu_color+set}" = set; then enableval="$enable_menu_color" - enable_menu_color="$enableval" + else enable_menu_color="yes" fi; @@ -4853,7 +6012,7 @@ # Check whether --enable-elbereth or --disable-elbereth was given. if test "${enable_elbereth+set}" = set; then enableval="$enable_elbereth" - enable_elbereth="$enableval" + else enable_elbereth="yes" fi; @@ -4872,7 +6031,7 @@ # Check whether --enable-noartifactwish or --disable-noartifactwish was given. if test "${enable_noartifactwish+set}" = set; then enableval="$enable_noartifactwish" - enable_noartifactwish="$enableval" + else enable_noartifactwish="no" fi; @@ -4888,10 +6047,10 @@ echo "$as_me:$LINENO: checking whether to enable no-bones" >&5 echo $ECHO_N "checking whether to enable no-bones... $ECHO_C" >&6 - # Check whether --enable-no_bones or --disable-no_bones was given. + # Check whether --enable-no-bones or --disable-no-bones was given. if test "${enable_no_bones+set}" = set; then enableval="$enable_no_bones" - enable_no_bones="$enableval" + else enable_no_bones="no" fi; @@ -4907,10 +6066,10 @@ echo "$as_me:$LINENO: checking whether to enable user-sounds" >&5 echo $ECHO_N "checking whether to enable user-sounds... $ECHO_C" >&6 - # Check whether --enable-user_sounds or --disable-user_sounds was given. + # Check whether --enable-user-sounds or --disable-user-sounds was given. if test "${enable_user_sounds+set}" = set; then enableval="$enable_user_sounds" - enable_user_sounds="$enableval" + else enable_user_sounds="no" fi; @@ -4926,10 +6085,10 @@ echo "$as_me:$LINENO: checking whether to enable exp-on-botl" >&5 echo $ECHO_N "checking whether to enable exp-on-botl... $ECHO_C" >&6 - # Check whether --enable-exp_on_botl or --disable-exp_on_botl was given. + # Check whether --enable-exp-on-botl or --disable-exp-on-botl was given. if test "${enable_exp_on_botl+set}" = set; then enableval="$enable_exp_on_botl" - enable_exp_on_botl="$enableval" + else enable_exp_on_botl="yes" fi; @@ -4945,10 +6104,10 @@ echo "$as_me:$LINENO: checking whether to enable score-on-botl" >&5 echo $ECHO_N "checking whether to enable score-on-botl... $ECHO_C" >&6 - # Check whether --enable-score_on_botl or --disable-score_on_botl was given. + # Check whether --enable-score-on-botl or --disable-score-on-botl was given. if test "${enable_score_on_botl+set}" = set; then enableval="$enable_score_on_botl" - enable_score_on_botl="$enableval" + else enable_score_on_botl="no" fi; @@ -4962,31 +6121,13 @@ fi -echo "$as_me:$LINENO: checking whether to enable borg" >&5 -echo $ECHO_N "checking whether to enable borg... $ECHO_C" >&6 - # Check whether --enable-borg or --disable-borg was given. -if test "${enable_borg+set}" = set; then - enableval="$enable_borg" - enable_borg="$enableval" -else - enable_borg="no" -fi; - echo "$as_me:$LINENO: result: $enable_borg" >&5 -echo "${ECHO_T}$enable_borg" >&6 - if test "$enable_borg" != "no" ; then - -cat >>confdefs.h <<_ACEOF -#define BORG -_ACEOF - - fi - +#NETHACK_ARG(borg,[Borg player (only under DOS)],BORG,no) echo "$as_me:$LINENO: checking whether to enable keep-save" >&5 echo $ECHO_N "checking whether to enable keep-save... $ECHO_C" >&6 - # Check whether --enable-keep_save or --disable-keep_save was given. + # Check whether --enable-keep-save or --disable-keep-save was given. if test "${enable_keep_save+set}" = set; then enableval="$enable_keep_save" - enable_keep_save="$enableval" + else enable_keep_save="no" fi; @@ -5005,7 +6146,7 @@ # Check whether --enable-charon or --disable-charon was given. if test "${enable_charon+set}" = set; then enableval="$enable_charon" - enable_charon="$enableval" + else enable_charon="no" fi; @@ -5021,10 +6162,10 @@ echo "$as_me:$LINENO: checking whether to enable show-dmg" >&5 echo $ECHO_N "checking whether to enable show-dmg... $ECHO_C" >&6 - # Check whether --enable-show_dmg or --disable-show_dmg was given. + # Check whether --enable-show-dmg or --disable-show-dmg was given. if test "${enable_show_dmg+set}" = set; then enableval="$enable_show_dmg" - enable_show_dmg="$enableval" + else enable_show_dmg="yes" fi; @@ -5040,10 +6181,10 @@ echo "$as_me:$LINENO: checking whether to enable show-weight" >&5 echo $ECHO_N "checking whether to enable show-weight... $ECHO_C" >&6 - # Check whether --enable-show_weight or --disable-show_weight was given. + # Check whether --enable-show-weight or --disable-show-weight was given. if test "${enable_show_weight+set}" = set; then enableval="$enable_show_weight" - enable_show_weight="$enableval" + else enable_show_weight="yes" fi; @@ -5059,10 +6200,10 @@ echo "$as_me:$LINENO: checking whether to enable other-services" >&5 echo $ECHO_N "checking whether to enable other-services... $ECHO_C" >&6 - # Check whether --enable-other_services or --disable-other_services was given. + # Check whether --enable-other-services or --disable-other-services was given. if test "${enable_other_services+set}" = set; then enableval="$enable_other_services" - enable_other_services="$enableval" + else enable_other_services="yes" fi; @@ -5078,10 +6219,10 @@ echo "$as_me:$LINENO: checking whether to enable dungeon-growth" >&5 echo $ECHO_N "checking whether to enable dungeon-growth... $ECHO_C" >&6 - # Check whether --enable-dungeon_growth or --disable-dungeon_growth was given. + # Check whether --enable-dungeon-growth or --disable-dungeon-growth was given. if test "${enable_dungeon_growth+set}" = set; then enableval="$enable_dungeon_growth" - enable_dungeon_growth="$enableval" + else enable_dungeon_growth="yes" fi; @@ -5095,31 +6236,13 @@ fi -echo "$as_me:$LINENO: checking whether to enable shout" >&5 -echo $ECHO_N "checking whether to enable shout... $ECHO_C" >&6 - # Check whether --enable-shout or --disable-shout was given. -if test "${enable_shout+set}" = set; then - enableval="$enable_shout" - enable_shout="$enableval" -else - enable_shout="no" -fi; - echo "$as_me:$LINENO: result: $enable_shout" >&5 -echo "${ECHO_T}$enable_shout" >&6 - if test "$enable_shout" != "no" ; then - -cat >>confdefs.h <<_ACEOF -#define SHOUT -_ACEOF - - fi - +#NETHACK_ARG(shout,[Shouting and pet commands (not implemented)],SHOUT,no) echo "$as_me:$LINENO: checking whether to enable display-layers" >&5 echo $ECHO_N "checking whether to enable display-layers... $ECHO_C" >&6 - # Check whether --enable-display_layers or --disable-display_layers was given. + # Check whether --enable-display-layers or --disable-display-layers was given. if test "${enable_display_layers+set}" = set; then enableval="$enable_display_layers" - enable_display_layers="$enableval" + else enable_display_layers="yes" fi; @@ -5138,7 +6261,7 @@ # Check whether --enable-goldobj or --disable-goldobj was given. if test "${enable_goldobj+set}" = set; then enableval="$enable_goldobj" - enable_goldobj="$enableval" + else enable_goldobj="no" fi; @@ -5154,10 +6277,10 @@ echo "$as_me:$LINENO: checking whether to enable autopickup-exceptions" >&5 echo $ECHO_N "checking whether to enable autopickup-exceptions... $ECHO_C" >&6 - # Check whether --enable-autopickup_exceptions or --disable-autopickup_exceptions was given. + # Check whether --enable-autopickup-exceptions or --disable-autopickup-exceptions was given. if test "${enable_autopickup_exceptions+set}" = set; then enableval="$enable_autopickup_exceptions" - enable_autopickup_exceptions="$enableval" + else enable_autopickup_exceptions="no" fi; @@ -5172,57 +6295,84 @@ fi +echo "$as_me:$LINENO: checking whether to enable wizmode" >&5 +echo $ECHO_N "checking whether to enable wizmode... $ECHO_C" >&6 +# Check whether --enable-wizmode or --disable-wizmode was given. +if test "${enable_wizmode+set}" = set; then + enableval="$enable_wizmode" + if test "$enableval" != no; then enable_wizmode=yes; wizard=$enableval; + else enable_wizmode=no; fi +else + enable_wizmode=yes; wizard="wizard" +fi; +if test "$enable_wizmode" != "no" ; then + echo "$as_me:$LINENO: result: yes (user $wizard)" >&5 +echo "${ECHO_T}yes (user $wizard)" >&6 + +cat >>confdefs.h <<_ACEOF +#define WIZARD "$wizard" +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + NETHACK_LINKS= -if test ${srcdir}/include/file.h -nt include/file.h ; then - NETHACK_LINKS="${LINKS_LIST} include/file.h:include/file.h" +if test ! -f include/file.h -o ${srcdir}/include/file.h -nt include/file.h ; then + NETHACK_LINKS="${NETHACK_LINKS} include/file.h:include/file.h" fi -if test ${srcdir}/dat/data.base -nt dat/data.base ; then - NETHACK_LINKS="${LINKS_LIST} dat/data.base:dat/data.base" +if test ! -f dat/data.base -o ${srcdir}/dat/data.base -nt dat/data.base ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/data.base:dat/data.base" fi -if test ${srcdir}/dat/rumors.tru:dat/rumors.tru -nt dat/rumors.tru:dat/rumors.tru ; then - NETHACK_LINKS="${LINKS_LIST} dat/rumors.tru:dat/rumors.tru:dat/rumors.tru:dat/rumors.tru" +if test ! -f dat/rumors.tru -o ${srcdir}/dat/rumors.tru -nt dat/rumors.tru ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/rumors.tru:dat/rumors.tru" fi -if test ${srcdir}/dat/rumors.fal:dat/rumors.fal -nt dat/rumors.fal:dat/rumors.fal ; then - NETHACK_LINKS="${LINKS_LIST} dat/rumors.fal:dat/rumors.fal:dat/rumors.fal:dat/rumors.fal" +if test ! -f dat/rumors.fal -o ${srcdir}/dat/rumors.fal -nt dat/rumors.fal ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/rumors.fal:dat/rumors.fal" fi -if test ${srcdir}/dat/quest.txt:dat/quest.txt -nt dat/quest.txt:dat/quest.txt ; then - NETHACK_LINKS="${LINKS_LIST} dat/quest.txt:dat/quest.txt:dat/quest.txt:dat/quest.txt" +if test ! -f dat/quest.txt -o ${srcdir}/dat/quest.txt -nt dat/quest.txt ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/quest.txt:dat/quest.txt" fi -if test ${srcdir}/dat/oracles.txt:dat/oracles.txt -nt dat/oracles.txt:dat/oracles.txt ; then - NETHACK_LINKS="${LINKS_LIST} dat/oracles.txt:dat/oracles.txt:dat/oracles.txt:dat/oracles.txt" +if test ! -f dat/oracles.txt -o ${srcdir}/dat/oracles.txt -nt dat/oracles.txt ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/oracles.txt:dat/oracles.txt" fi -if test ${srcdir}/dat/dungeon.def:dat/dungeon.def -nt dat/dungeon.def:dat/dungeon.def ; then - NETHACK_LINKS="${LINKS_LIST} dat/dungeon.def:dat/dungeon.def:dat/dungeon.def:dat/dungeon.def" +if test ! -f dat/dungeon.def -o ${srcdir}/dat/dungeon.def -nt dat/dungeon.def ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/dungeon.def:dat/dungeon.def" fi -if test ${srcdir}/dat/help:dat/help -nt dat/help:dat/help ; then - NETHACK_LINKS="${LINKS_LIST} dat/help:dat/help:dat/help:dat/help" +if test ! -f dat/help -o ${srcdir}/dat/help -nt dat/help ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/help:dat/help" fi -if test ${srcdir}/dat/hh:dat/hh -nt dat/hh:dat/hh ; then - NETHACK_LINKS="${LINKS_LIST} dat/hh:dat/hh:dat/hh:dat/hh" +if test ! -f dat/hh -o ${srcdir}/dat/hh -nt dat/hh ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/hh:dat/hh" fi -if test ${srcdir}/dat/cmdhelp:dat/cmdhelp -nt dat/cmdhelp:dat/cmdhelp ; then - NETHACK_LINKS="${LINKS_LIST} dat/cmdhelp:dat/cmdhelp:dat/cmdhelp:dat/cmdhelp" +if test ! -f dat/cmdhelp -o ${srcdir}/dat/cmdhelp -nt dat/cmdhelp ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/cmdhelp:dat/cmdhelp" fi -if test ${srcdir}/dat/history:dat/history -nt dat/history:dat/history ; then - NETHACK_LINKS="${LINKS_LIST} dat/history:dat/history:dat/history:dat/history" +if test ! -f dat/history -o ${srcdir}/dat/history -nt dat/history ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/history:dat/history" fi -if test ${srcdir}/dat/opthelp:dat/opthelp -nt dat/opthelp:dat/opthelp ; then - NETHACK_LINKS="${LINKS_LIST} dat/opthelp:dat/opthelp:dat/opthelp:dat/opthelp" +if test ! -f dat/opthelp -o ${srcdir}/dat/opthelp -nt dat/opthelp ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/opthelp:dat/opthelp" fi -if test ${srcdir}/dat/wizhelp:dat/wizhelp -nt dat/wizhelp:dat/wizhelp ; then - NETHACK_LINKS="${LINKS_LIST} dat/wizhelp:dat/wizhelp:dat/wizhelp:dat/wizhelp" +if test ! -f dat/wizhelp -o ${srcdir}/dat/wizhelp -nt dat/wizhelp ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/wizhelp:dat/wizhelp" fi -if test ${srcdir}/dat/gypsy.txt:dat/gypsy.txt -nt dat/gypsy.txt:dat/gypsy.txt ; then - NETHACK_LINKS="${LINKS_LIST} dat/gypsy.txt:dat/gypsy.txt:dat/gypsy.txt:dat/gypsy.txt" +if test ! -f dat/gypsy.txt -o ${srcdir}/dat/gypsy.txt -nt dat/gypsy.txt ; then + NETHACK_LINKS="${NETHACK_LINKS} dat/gypsy.txt:dat/gypsy.txt" fi -if test ${srcdir}/win/share/tile_t.h:win/share/tile_t.h -nt win/share/tile_t.h:win/share/tile_t.h ; then - NETHACK_LINKS="${LINKS_LIST} win/share/tile_t.h:win/share/tile_t.h:win/share/tile_t.h:win/share/tile_t.h" +if test ! -f win/share/tile_t.h -o ${srcdir}/win/share/tile_t.h -nt win/share/tile_t.h ; then + NETHACK_LINKS="${NETHACK_LINKS} win/share/tile_t.h:win/share/tile_t.h" + fi +if test ! -f include/win32api.h -o ${srcdir}/sys/winnt/win32api.h -nt include/win32api.h ; then + NETHACK_LINKS="${NETHACK_LINKS} include/win32api.h:sys/winnt/win32api.h" fi ac_config_links="$ac_config_links ${NETHACK_LINKS}" - ac_config_files="$ac_config_files Makefile:sys/autoconf/Makefile.top src/Makefile:sys/autoconf/Makefile.src doc/Makefile:sys/autoconf/Makefile.doc dat/Makefile:sys/autoconf/Makefile.dat util/Makefile:sys/autoconf/Makefile.utl" + ac_config_files="$ac_config_files Makefile:sys/autoconf/Makefile.top src/Makefile:sys/autoconf/Makefile.src doc/Makefile:sys/autoconf/Makefile.doc dat/Makefile:sys/autoconf/Makefile.dat util/Makefile:sys/autoconf/Makefile.utl sys/autoconf/depend.awk:sys/autoconf/depend.in" ac_config_headers="$ac_config_headers include/autoconf.h:sys/autoconf/autoconf.hin" @@ -5760,6 +6910,7 @@ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile:sys/autoconf/Makefile.doc" ;; "dat/Makefile" ) CONFIG_FILES="$CONFIG_FILES dat/Makefile:sys/autoconf/Makefile.dat" ;; "util/Makefile" ) CONFIG_FILES="$CONFIG_FILES util/Makefile:sys/autoconf/Makefile.utl" ;; + "sys/autoconf/depend.awk" ) CONFIG_FILES="$CONFIG_FILES sys/autoconf/depend.awk:sys/autoconf/depend.in" ;; "${NETHACK_LINKS}" ) CONFIG_LINKS="$CONFIG_LINKS ${NETHACK_LINKS}" ;; "include/autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/autoconf.h:sys/autoconf/autoconf.hin" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -5847,16 +6998,22 @@ s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t +s,@SRCDIR@,$SRCDIR,;t t s,@CC@,$CC,;t t s,@CHGRP@,$CHGRP,;t t s,@CHOWN@,$CHOWN,;t t +s,@CHMOD@,$CHMOD,;t t +s,@ZLIB_CFLAGS@,$ZLIB_CFLAGS,;t t +s,@ZLIB_LIBS@,$ZLIB_LIBS,;t t s,@LN_S@,$LN_S,;t t +s,@AWK@,$AWK,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t +s,@LFLAGS@,$LFLAGS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t @@ -5865,18 +7022,28 @@ s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t +s,@HOST_MSWIN@,$HOST_MSWIN,;t t +s,@HOST_UNIX@,$HOST_UNIX,;t t +s,@SYSTEM@,$SYSTEM,;t t +s,@SYSSRC@,$SYSSRC,;t t +s,@SYSOBJ@,$SYSOBJ,;t t +s,@NHKEYDLL_GCC@,$NHKEYDLL_GCC,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@ac_ct_CHOWN@,$ac_ct_CHOWN,;t t s,@ac_ct_CHGRP@,$ac_ct_CHGRP,;t t -s,@WINTTYLIB@,$WINTTYLIB,;t t +s,@ac_ct_CHMOD@,$ac_ct_CHMOD,;t t +s,@WINDRES@,$WINDRES,;t t +s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@NETHACK__LIBPNG_CFLAGS@,$NETHACK__LIBPNG_CFLAGS,;t t +s,@NETHACK__LIBPNG_LIBS@,$NETHACK__LIBPNG_LIBS,;t t +s,@NETHACK_LIBPNG_CFLAGS@,$NETHACK_LIBPNG_CFLAGS,;t t +s,@NETHACK_LIBPNG_LIBS@,$NETHACK_LIBPNG_LIBS,;t t +s,@EXTRA_UNSHARE@,$EXTRA_UNSHARE,;t t +s,@WINTTYLIB@,$WINTTYLIB,;t t s,@NETHACK_PROXY_CFLAGS@,$NETHACK_PROXY_CFLAGS,;t t s,@NETHACK_PROXY_LIBS@,$NETHACK_PROXY_LIBS,;t t s,@SDL_CONFIG@,$SDL_CONFIG,;t t @@ -6347,8 +7514,9 @@ fi # Run the commands associated with the file. case $ac_file in - include/autoconf.h ) sed 's,^/\* \(#undef .*\) \*/,\1,' < include/autoconf.h \ - > include/autoconf.new + include/autoconf.h ) sed -e 's,^/\* \(#undef .*\) \*/,\1,' \ + -e '/#define [^ ]*/ { h; s,#define \([^ ]*\).*,#undef \1,p; g; }' \ + < include/autoconf.h > include/autoconf.new mv include/autoconf.new \ include/autoconf.h ;; esac diff -Naurbd slashem-0.0.8E0/dat/data.base slashem-0.0.8E0F1/dat/data.base --- slashem-0.0.8E0/dat/data.base 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/dat/data.base 2006-05-15 12:13:10.000000000 +0100 @@ -1,5 +1,5 @@ # SCCS Id: @(#)data.base 3.4 2003/07/23 -# $Id: data.base,v 1.14 2003/12/11 09:49:05 j_ali Exp $ +# $Id: data.base,v 1.16 2006/04/17 11:14:33 prousu Exp $ # Copyright (c) 1994, 1995, 1996 by the NetHack Development Team # Copyright (c) 1994 by Boudewijn Wayers # Copyright (c) 2002 by the Slash'EM Development Team @@ -455,8 +455,9 @@ barbed devil Barbed devils lack any real special abilities, though they are quite difficult to kill. -+~mongbat -+~vampire bat +~mongbat +~vampire bat +~wombat *bat A bat, flitting in the darkness outside, took the wrong turn as it made its nightly rounds and came in through the window @@ -2851,7 +2852,8 @@ and harry, and overcome all the gods, and burn all the world with fire. [ The Prose Edda, by Snorri Sturluson ] -lug* +lug +lugh Lugh, or Lug, was the sun god of the Irish Celts. One of his weapons was a rod-sling which worshippers sometimes saw in the sky as a rainbow. As a tribal god, he was particularly diff -Naurbd slashem-0.0.8E0/dat/nightmar.des slashem-0.0.8E0F1/dat/nightmar.des --- slashem-0.0.8E0/dat/nightmar.des 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/dat/nightmar.des 2006-05-15 12:13:10.000000000 +0100 @@ -1,5 +1,5 @@ # SCCS Id: @(#)nightmar.des 0.0.7 2002/03/13 -# $Id: nightmar.des,v 1.6 2003/05/08 17:42:14 j_ali Exp $ +# $Id: nightmar.des,v 1.7 2005/12/03 16:21:22 j_ali Exp $ # NetHack may be freely redistributed. See license for details. # # Nightmare's Nightmare World @@ -113,7 +113,7 @@ MONSTER[80%]:'%',"bad egg",place[1],asleep MONSTER[60%]:'%',"bad egg",place[1],asleep MONSTER[40%]:'%',"bad egg",place[1],asleep -OBJECT:'%',"egg",place[1],"giant louse",1 +OBJECT:'%',"egg",place[1],"giant louse",2 OBJECT[40%]:'%',"egg",place[1],"giant flea",0 OBJECT[20%]:'%',"mushroom",place[1],cursed,0 OBJECT[50%]:'%',"tin",place[1],"asphynx meat",0 diff -Naurbd slashem-0.0.8E0/doc/Guidebook.mn slashem-0.0.8E0F1/doc/Guidebook.mn --- slashem-0.0.8E0/doc/Guidebook.mn 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/doc/Guidebook.mn 2006-05-15 12:13:10.000000000 +0100 @@ -1,4 +1,4 @@ -.\" $Revision: 1.18 $ $Date: 2004/09/18 15:00:49 $ +.\" $Revision: 1.19 $ $Date: 2005/08/13 11:27:03 $ .ds h0 "SLASH'EM Guidebook .ds h1 .ds h2 % @@ -2482,6 +2482,12 @@ The order of colors is red, green, brown, blue, magenta, cyan, bright.white, bright.red, bright.green, yellow, bright.blue, bright.magenta, and bright.cyan. +Unix and OS/2 ports compiled with VIDEOSHADES option allow defining +three more colors. The order of colors is red, green, brown, blue, +magenta, cyan, gray, black, bright.red, bright.green, yellow, +bright.blue, bright.magenta, bright.cyan and white. +MS-Windows and Mac ports don't use this option. In Windows colors can be +redefined from window properties. Cannot be set with the `O' command. .lp videoshades Set the intensity level of the three gray scales available diff -Naurbd slashem-0.0.8E0/doc/Guidebook.tex slashem-0.0.8E0F1/doc/Guidebook.tex --- slashem-0.0.8E0/doc/Guidebook.tex 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/doc/Guidebook.tex 2006-05-15 12:13:10.000000000 +0100 @@ -46,7 +46,7 @@ % input file: Guidebook.mn % -% $Revision: 1.17 $ $Date: 2004/09/18 15:00:49 $ +% $Revision: 1.18 $ $Date: 2005/08/13 11:27:03 $ \DefineString{h0}{{\it SLASH'EM\/} Guidebook} \DefineString{h1}{} \DefineString{h2}{\%} @@ -3449,6 +3449,12 @@ The order of colors is red, green, brown, blue, magenta, cyan, bright.white, bright.red, bright.green, yellow, bright.blue, bright.magenta, and bright.cyan. +Unix and OS/2 ports compiled with VIDEOSHADES option allow defining +three more colors. The order of colors is red, green, brown, blue, +magenta, cyan, gray, black, bright.red, bright.green, yellow, +bright.blue, bright.magenta, bright.cyan and white. +MS-Windows and Mac ports don't use this option. In Windows colors can be +redefined from window properties. Cannot be set with the `{\tt O}' command. %.lp diff -Naurbd slashem-0.0.8E0/history.txt slashem-0.0.8E0F1/history.txt --- slashem-0.0.8E0/history.txt 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/history.txt 2006-05-15 12:13:10.000000000 +0100 @@ -29,6 +29,114 @@ | Section 1: Yesterday's News | +-----------------------------+ +ver 0.0.8E0 [July 2/2005] [Released by Ali] +-Added dumplog patch (Tom Friedetzky and Jukka Lahtinen) +-fixed bug 923003: Invisible mirrors can be applied +-fixed bug 916544: Wrong weight of corpses on Nightmare level +-fixed bug 947369: Crash when multiple wands explode +-fixed bug 950120: crash when wishing for Wallet of Perseus +-fixed bug 933365: wand of draining does not interrupt ctrl-run +-fixed bug 933379: weird behaviour with polyself into monsters like migo drone +-fixed bug 929546: Flaming spheres won't attack acid blobs +-fixed bug 951991: Reading spellbooks not safe for wizards +-fixed bug 914894: "Beautiful" gnome thief seduced female character +-fixed bug 918178: Double message "You are suddenly very hot/cold!" +-fixed bug 921810: Invisible books can be read (?!) +-fixed bug 934076: Dipping amnesia into amnesia gives water +-fixed bug 946306: do_look: bad glyph 3726 at (7, 16) +-fixed bug 929220: Prayer and chi healing +-fixed bug 946157: Water elementals created over lava on Flame mage quest +-fixed bug 946161: Bad message when two-weaponing against a rust monster +-fixed bug 946566: Partly eaten more nutritious while raising drained corpses +-fixed bug 946984: arch-liches are not MR_HITAS* +-fixed bug 949016: Draining a rotten corpse +-fixed bug 951439: Invisible Corpses and Ressurection +-fixed bug 941453: Grand slam against monsters needing +n weapons +-fixed bug 962515: Disarming fire trap doesn't use up water +-fixed bug 1001167: Is this a Gray Stone bug? +-fixed bug 992247: wolfname & ghoulname in default.nh doesn't work +-fixed bug 931679: Space Bar not working as rest +-fixed bug 912588: Molds stagger from your powerful strike +-fixed bug 962574: Display bug when setting OPTIONS=tiles:Small tiles +-fixed bug 1011313: SEGV using technique "raise zombies" +-fixed bug 1018229: impossible splitbill: no resident shopkeeper?? +-fixed bug 1018447: Game crash when Hero with ball displace displacer beast +-fixed bug 1020983: Typo in doc/sources.txt (cloack) +-fixed bug 956891: Breeders are explosive +-fixed bug 1007127: diluted potion of water +-fixed bug 1010421: Thiefbane drains your levels even if you aren't hit +-fixed bug 976157: Dipping into !oAmnesia didn't use up potion +-fixed bug 982331: Can't name Cursed scrolls of teleport after reading them +-fixed some theoretical bugs thrown up by valgrind +-fixed bug 980258: Guidebook doesn't describe showdmg option accurately + (Andy Ruse) +-fixed bug 926202: Gnome thieves don't eat (Andy Ruse) +-fixed bug 926200: Dwarf thieves have M2_NOPOLY (Andy Ruse) +-fixed bug 962568: Mjollnir can't be thrown - code comment incorrect (Andy Ruse) +-fixed bug 1005587: Beholder killed by "it's" own gaze (Andy Ruse) +-fixed bug 1022460: [C343-8] The plural of Nazgul is Nazgul (Andy Ruse) +-fixed bug 1039689: malloc_consolidate hang after using cursed bag of holding +-fixed bug 1028955: Surgery technique doesn't work with polymorph +-fixed bug 1035356: God gave Deathsword to "human" character +-fixed bug 1024200: Problems about Thiefbane +-fixed bug 1024202: Dipping a loadstone into a potion of amnesia +-fixed bug 1038151: Power surge becomes permanent if lost +-fixed bug 1025486: Pets can't follow lvl telep from Blk Mkt +-fixed bug 1029750: Lycanthropes and eating wolfsbane while polymorphed +-fixed bug 1030725: Doppelganger liquid leap does not release from chain +-fixed bug 1032419: Eviscerate tech should not work while wearing gloves +-fixed bug 1055724: Raise Zombies gives tame troll +-fixed bug 1020980: Objects are forgotten when you search blind +-fixed bug 954414: pickup_thrown option includes some non-throw weapons +-fixed bug 937239: Wrong cause of death from exploding wands +-fixed bug 962572: Inventory item prints to console instead of chat buffer +-fixed bug 936167: Started with empty medical kit (Pasi Kallinen) +-fixed bug 934077: Wrote an invisible scroll (Pasi Kallinen) +-fixed bug 1015079: Spurious "it snatches the boulder" message (Pasi Kallinen) +-fixed bug 957731: Shop purchases free after 200 objects +-fixed bug 1062624: GTK Interface is not resizable +-fixed bug 931684: Inventory window behaving strangely +-Fixed build of proxy tests +-fixed bug 1071688: cannot compile on FreeBSD (termcap) +-fixed bug 1071623: Cannot compile on FreeBSD due to menucolor inclusion +-Unbundled proxy and gtk modules: + http://www.nongnu.org/nhproxy/ + http://www.gtkhack.org/ +-fixed bug 993420: Crashes when typing symbols on drop menu +-fixed bug 1084366: ghoul queen don't has M2_FEMALE +-fixed bug 1066530: Fired/thrown items get new inventory letter when retrieved +-fixed bug 992244: Alt Gr key doesn't work +-fixed bug 1076125: Unsuccessful use of medical kits +-fixed bug 1076123: Vampires can eat white pills +-fixed bug 994993: when polying, you take off T-shirt after scales merge +-fixed bug 961914: Deep dragons should resist their own breath +-fixed bug 963344: Stat exercise effects calculated while polymorphed +-fixed bug 1097792: Duplicate message when hit by sleep gaze +-fixed bug 1065927: Should bars stop bullets? +-fixed bug 947009: Scroll of taming exercises skill in healing spells +-fixed bug 1077355: game crashes with: "panic monsndx - could not index monster" +-fixed bug 1098686: Restoring a mounted character wielding Sting can fail +-fixed bug 1105100: Escaping from pits by polymorphing into a mind flayer +-Proxy: Implement get_no_glyph method for compatibility with nhproxy 0.9.1 +-fixed bug 1110081: in_container() uses obj->quan after deallocatin obj +-fixed bug 1116877: Dereferencing freed memory when applying bags which explode +-fixed bug 951483: Wands of cancellation can be held in a bag of holding +-fixed bug 1155634: charm spell or command undead spell invoke genocide +-fixed incorrect #ifdef resulting in compilation failure on ANSI only DOS builds +-fixed bug 1193070: Engraving with a wand of draining keeps illiterate + conduct (Nico Kist) +-fixed bug 924811: Fire vampires leave corpses +-fixed bug 1028948: casting stone to flesh on a gargoyle +-fixed bug 1213881: Lieutenants lack Firearms +-fixed bug 1212903: Int and Wis stats not correct (in obscure case) +-fixed bug 1175912: Deity-gifted pets should not attack like aligned unicorns + (Nico Kist) +-fixed bug 1205563: suppress_alert still says NetHack +-fixed bug 1157414: Do not "loose" faith +-fixed bug 1021014: leashed pet movement bug +-fixed bug 1197822: necromancer zombie's hp +-fixed bug 1185759: Shopkeeper "looks at corpse" through wall +-Experimental support for GNU autoconf ver 0.0.7E6F2 [May 3/2004] [Released by Ali] -fixed bug 910334: Vampire blood and foodless conduct -fixed bug 924384: Inconsistency with shoggoth corroding items diff -Naurbd slashem-0.0.8E0/include/artilist.h slashem-0.0.8E0F1/include/artilist.h --- slashem-0.0.8E0/include/artilist.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/artilist.h 2006-05-15 12:13:10.000000000 +0100 @@ -153,7 +153,7 @@ PHYS(5,5), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, PM_GNOME, 1000L ), A("Sword of Balance", SILVER_SHORT_SWORD, - SPFX_DALIGN, 0, 0, + (SPFX_RESTR|SPFX_DALIGN), 0, 0, PHYS(2,5), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 5000L ), A("Frost Brand", LONG_SWORD, diff -Naurbd slashem-0.0.8E0/include/color.h slashem-0.0.8E0F1/include/color.h --- slashem-0.0.8E0/include/color.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/color.h 2006-05-15 12:13:10.000000000 +0100 @@ -17,7 +17,12 @@ * exceptions, these are listed below. Bright black doesn't mean very * much, so it is used as the "default" foreground color of the screen. */ -#define CLR_BLACK 0 + +#ifndef VIDEOSHADES +# define CLR_BLACK 0 +#else +# define CLR_BLACK 8 +#endif #define CLR_RED 1 #define CLR_GREEN 2 #define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */ @@ -25,7 +30,11 @@ #define CLR_MAGENTA 5 #define CLR_CYAN 6 #define CLR_GRAY 7 /* low-intensity white */ -#define NO_COLOR 8 +#ifndef VIDEOSHADES +# define NO_COLOR 8 +#else +# define NO_COLOR 0 +#endif #define CLR_ORANGE 9 #define CLR_BRIGHT_GREEN 10 #define CLR_YELLOW 11 @@ -73,4 +82,8 @@ }; #endif +#if defined(VIDEOSHADES) && !defined(MSDOS) +extern char ttycolors[CLR_MAX]; +#endif + #endif /* COLOR_H */ diff -Naurbd slashem-0.0.8E0/include/config.h slashem-0.0.8E0F1/include/config.h --- slashem-0.0.8E0/include/config.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/config.h 2006-05-15 12:13:10.000000000 +0100 @@ -159,10 +159,6 @@ # endif #endif -#ifndef DEFAULT_WINDOW_SYS -# define DEFAULT_WINDOW_SYS "tty" -#endif - #ifdef X11_GRAPHICS /* * There are two ways that X11 tiles may be defined. (1) using a custom @@ -177,6 +173,13 @@ # ifdef USE_XPM # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */ # endif +# ifndef DEFAULT_WINDOW_SYS +# define DEFAULT_WINDOW_SYS "X11" +# endif +#endif + +#ifndef DEFAULT_WINDOW_SYS +# define DEFAULT_WINDOW_SYS "tty" #endif /* diff -Naurbd slashem-0.0.8E0/include/decl.h.orig slashem-0.0.8E0F1/include/decl.h.orig --- slashem-0.0.8E0/include/decl.h.orig 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/decl.h.orig 1970-01-01 01:00:00.000000000 +0100 @@ -1,488 +0,0 @@ -/* SCCS Id: @(#)decl.h 3.4 2001/12/10 */ -/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ -/* NetHack may be freely redistributed. See license for details. */ - -#ifndef DECL_H -#define DECL_H - -#define E extern - -E int NDECL((*occupation)); -E int NDECL((*afternmv)); - -E const char *hname; -E int hackpid; -#if defined(UNIX) || defined(VMS) -E int locknum; -#endif -#ifdef DEF_PAGER -E char *catmore; -#endif /* DEF_PAGER */ - -E char SAVEF[]; -#ifdef MICRO -E char SAVEP[]; -#endif - -E NEARDATA int bases[MAXOCLASSES]; - -E NEARDATA int multi; -#if 0 -E NEARDATA int warnlevel; -#endif -E NEARDATA int lastuse; -E NEARDATA int nextuse; -E NEARDATA int nroom; -E NEARDATA int nsubroom; -E NEARDATA int occtime; - -#define WARNCOUNT 6 /* number of different warning levels */ -E uchar warnsyms[WARNCOUNT]; - -E int x_maze_max, y_maze_max; -E int otg_temp; - -#ifdef REDO -E NEARDATA int in_doagain; -#endif - -E struct dgn_topology { /* special dungeon levels for speed */ - d_level d_oracle_level; - d_level d_bigroom_level; /* unused */ -#ifdef REINCARNATION - d_level d_rogue_level; -#endif - d_level d_medusa_level; - d_level d_mineend_level; - d_level d_stronghold_level; - d_level d_valley_level; - d_level d_wiz1_level; - d_level d_wiz2_level; - d_level d_wiz3_level; - d_level d_juiblex_level; - d_level d_orcus_level; - d_level d_baalzebub_level; /* unused */ - d_level d_demogorgon_level; /* unused */ - d_level d_dispater_level; /* unused */ - d_level d_geryon_level; /* unused */ - d_level d_yeenoghu_level; /* unused */ - d_level d_asmodeus_level; /* unused */ - d_level d_portal_level; /* only in goto_level() [do.c] */ - d_level d_sanctum_level; - d_level d_earth_level; - d_level d_water_level; - d_level d_fire_level; - d_level d_air_level; - d_level d_astral_level; - xchar d_tower_dnum; - xchar d_sokoban_dnum; - xchar d_mines_dnum, d_quest_dnum; - xchar d_spiders_dnum; - d_level d_lawful_quest_level; - d_level d_neutral_quest_level; - d_level d_chaotic_quest_level; - d_level d_qstart_level, d_qlocate_level, d_nemesis_level; - d_level d_knox_level; -#ifdef BLACKMARKET - d_level d_blackmarket_level; -#endif /* BLACKMARKET */ -} dungeon_topology; -/* macros for accesing the dungeon levels by their old names */ -#define oracle_level (dungeon_topology.d_oracle_level) -#define bigroom_level (dungeon_topology.d_bigroom_level) -#ifdef REINCARNATION -#define rogue_level (dungeon_topology.d_rogue_level) -#endif -#define medusa_level (dungeon_topology.d_medusa_level) -#define stronghold_level (dungeon_topology.d_stronghold_level) -#define valley_level (dungeon_topology.d_valley_level) -#define mineend_level (dungeon_topology.d_mineend_level) -#define wiz1_level (dungeon_topology.d_wiz1_level) -#define wiz2_level (dungeon_topology.d_wiz2_level) -#define wiz3_level (dungeon_topology.d_wiz3_level) -#define juiblex_level (dungeon_topology.d_juiblex_level) -#define orcus_level (dungeon_topology.d_orcus_level) -#define baalzebub_level (dungeon_topology.d_baalzebub_level) -#define yeenoghu_level (dungeon_topology.d_yeenoghu_level) -#define geryon_level (dungeon_topology.d_geryon_level) -#define dispater_level (dungeon_topology.d_dispater_level) -#define demogorgon_level (dungeon_topology.d_demogorgon_level) -#define asmodeus_level (dungeon_topology.d_asmodeus_level) -#define portal_level (dungeon_topology.d_portal_level) -#define sanctum_level (dungeon_topology.d_sanctum_level) -#define earth_level (dungeon_topology.d_earth_level) -#define water_level (dungeon_topology.d_water_level) -#define fire_level (dungeon_topology.d_fire_level) -#define air_level (dungeon_topology.d_air_level) -#define astral_level (dungeon_topology.d_astral_level) -#define tower_dnum (dungeon_topology.d_tower_dnum) -#define sokoban_dnum (dungeon_topology.d_sokoban_dnum) -#define mines_dnum (dungeon_topology.d_mines_dnum) -#define quest_dnum (dungeon_topology.d_quest_dnum) -#define qstart_level (dungeon_topology.d_qstart_level) -#define qlocate_level (dungeon_topology.d_qlocate_level) -#define nemesis_level (dungeon_topology.d_nemesis_level) -#define knox_level (dungeon_topology.d_knox_level) -#define spiders_dnum (dungeon_topology.d_spiders_dnum) -#define lawful_quest_level (dungeon_topology.d_lawful_quest_level) -#define neutral_quest_level (dungeon_topology.d_neutral_quest_level) -#define chaotic_quest_level (dungeon_topology.d_chaotic_quest_level) -#ifdef BLACKMARKET -#define blackmarket_level (dungeon_topology.d_blackmarket_level) -#endif /* BLACKMARKET */ - -E NEARDATA stairway dnstair, upstair; /* stairs up and down */ -#define xdnstair (dnstair.sx) -#define ydnstair (dnstair.sy) -#define xupstair (upstair.sx) -#define yupstair (upstair.sy) - -E NEARDATA stairway dnladder, upladder; /* ladders up and down */ -#define xdnladder (dnladder.sx) -#define ydnladder (dnladder.sy) -#define xupladder (upladder.sx) -#define yupladder (upladder.sy) - -E NEARDATA stairway sstairs; - -E NEARDATA dest_area updest, dndest; /* level-change destination areas */ - -E NEARDATA coord inv_pos; -E NEARDATA dungeon dungeons[]; -E NEARDATA s_level *sp_levchn; -#define dunlev_reached(x) (dungeons[(x)->dnum].dunlev_ureached) - -#include "quest.h" -E struct q_score quest_status; - -E NEARDATA char pl_fruit[PL_FSIZ]; -E NEARDATA int current_fruit; -E NEARDATA struct fruit *ffruit; - -E NEARDATA char tune[6]; - -#define MAXLINFO (MAXDUNGEON * MAXLEVEL) -E struct linfo level_info[MAXLINFO]; - -E NEARDATA struct sinfo { - int gameover; /* self explanatory? */ - int stopprint; /* inhibit further end of game disclosure */ -#if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32) - int done_hup; /* SIGHUP or moral equivalent received - * -- no more screen output */ -#endif - int something_worth_saving; /* in case of panic */ - int panicking; /* `panic' is in progress */ -#if defined(VMS) || defined(WIN32) - int exiting; /* an exit handler is executing */ -#endif - int in_impossible; -#ifdef PANICLOG - int in_paniclog; -#endif -} program_state; - -E boolean restoring; - -E const char quitchars[]; -E const char vowels[]; -E const char ynchars[]; -E const char ynqchars[]; -E const char ynaqchars[]; -E const char ynNaqchars[]; -E NEARDATA long yn_number; - -E const char disclosure_options[]; - -E NEARDATA int smeq[]; -E NEARDATA int doorindex; -E NEARDATA char *save_cm; -#define KILLED_BY_AN 0 -#define KILLED_BY 1 -#define NO_KILLER_PREFIX 2 -E NEARDATA int killer_format; -E const char *killer; -E const char *delayed_killer; -#ifdef GOLDOBJ -E long done_money; -#endif -E char killer_buf[BUFSZ]; -#ifdef DUMP_LOG -E char dump_fn[]; /* dumpfile name (dump patch) */ -#endif -E const char *configfile; -E NEARDATA char plname[PL_NSIZ]; -E NEARDATA char dogname[]; -E NEARDATA char catname[]; -E NEARDATA char ghoulname[]; -E NEARDATA char horsename[]; -E NEARDATA char wolfname[]; -#if 0 -E NEARDATA char batname[]; -E NEARDATA char snakename[]; -E NEARDATA char ratname[]; -E NEARDATA char badgername[]; -E NEARDATA char reddragonname[]; -E NEARDATA char whitedragonname[]; -#endif -E char preferred_pet; -E const char *occtxt; /* defined when occupation != NULL */ -E const char *nomovemsg; -E const char nul[]; -E char lock[]; - -E const char sdir[], ndir[]; -E const schar xdir[], ydir[], zdir[]; - -E NEARDATA schar tbx, tby; /* set in mthrowu.c */ - -E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot; - -E NEARDATA struct dig_info { /* apply.c, hack.c */ - int effort; - d_level level; - coord pos; - long lastdigtime; - boolean down, chew, warned, quiet; -} digging; - -E NEARDATA long moves, monstermoves; -E NEARDATA long wailmsg; - -E NEARDATA boolean in_mklev; -E NEARDATA boolean stoned; -E NEARDATA boolean unweapon; -E NEARDATA boolean mrg_to_wielded; -E NEARDATA struct obj *current_wand; - -E NEARDATA boolean in_steed_dismounting; - -E const int shield_static[]; - - -/*** Objects ***/ -#include "obj.h" - -E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf, -#ifdef TOURIST - *uarmu, /* under-wear, so to speak */ -#endif -#ifdef STEED - *usaddle, -#endif - *uskin, *uamul, *uleft, *uright, *ublindf, - *uwep, *uswapwep, *uquiver; - -E NEARDATA struct obj *uchain; /* defined only when punished */ -E NEARDATA struct obj *uball; -E NEARDATA struct obj *migrating_objs; -E NEARDATA struct obj *billobjs; -E NEARDATA struct obj zeroobj; /* init'd and defined in decl.c */ -E NEARDATA struct obj thisplace; /* init'd and defined in decl.c */ - -#include "spell.h" -E NEARDATA struct spell spl_book[]; /* sized in decl.c */ - -#ifndef TECH_H -#include "tech.h" -#endif -E NEARDATA struct tech tech_list[]; /* sized in decl.c */ - - -/*** The player ***/ -E NEARDATA char pl_character[PL_CSIZ]; -E NEARDATA char pl_race; /* character's race */ -/* KMH, role patch -- more maintainable when declared as an array */ -E const char pl_classes[]; - -#include "you.h" -#include "onames.h" - -E NEARDATA struct you u; -E NEARDATA struct Role urole; - - -/*** Monsters ***/ -#ifndef PM_H -#include "pm.h" -#endif - -E NEARDATA struct permonst playermon, *uasmon; - /* also decl'd extern in permonst.h */ - /* init'd in monst.c */ - -E NEARDATA struct monst youmonst; /* init'd and defined in decl.c */ -E NEARDATA struct monst *mydogs, *migrating_mons; - -E NEARDATA struct permonst upermonst; /* init'd in decl.c, - * defined in polyself.c - */ - -E NEARDATA struct mvitals { - uchar born; - uchar died; - uchar mvflags; -#ifdef EATEN_MEMORY - uchar eaten; /* WAC -- eaten memory */ -#endif -} mvitals[NUMMONS]; - - -/* The names of the colors used for gems, etc. */ -E const char *c_obj_colors[]; - -E struct c_common_strings { - const char *const c_nothing_happens, *const c_thats_enough_tries, - *const c_silly_thing_to, *const c_shudder_for_moment, - *const c_something, *const c_Something, - *const c_You_can_move_again, - *const c_Never_mind, *c_vision_clears, - *const c_the_your[2]; -} c_common_strings; -#define nothing_happens c_common_strings.c_nothing_happens -#define thats_enough_tries c_common_strings.c_thats_enough_tries -#define silly_thing_to c_common_strings.c_silly_thing_to -#define shudder_for_moment c_common_strings.c_shudder_for_moment -#define something c_common_strings.c_something -#define Something c_common_strings.c_Something -#define You_can_move_again c_common_strings.c_You_can_move_again -#define Never_mind c_common_strings.c_Never_mind -#define vision_clears c_common_strings.c_vision_clears -#define the_your c_common_strings.c_the_your - -E const char no_elbow_room[]; - -/* material strings */ -E const char *materialnm[]; - -/* Monster name articles */ -#define ARTICLE_NONE 0 -#define ARTICLE_THE 1 -#define ARTICLE_A 2 -#define ARTICLE_YOUR 3 - -/* Monster name suppress masks */ -#define SUPPRESS_IT 0x01 -#define SUPPRESS_INVISIBLE 0x02 -#define SUPPRESS_HALLUCINATION 0x04 -#define SUPPRESS_SADDLE 0x08 -#define EXACT_NAME 0x0F - - -/*** Vision ***/ -E NEARDATA boolean vision_full_recalc; /* TRUE if need vision recalc */ -E NEARDATA char **viz_array; /* could see/in sight row pointers */ - - -/*** Window system stuff ***/ -#include "color.h" -#ifdef TEXTCOLOR -E const int zapcolors[]; -#endif - -E const char def_oc_syms[MAXOCLASSES]; /* default class symbols */ -E uchar oc_syms[MAXOCLASSES]; /* current class symbols */ -E const char def_monsyms[MAXMCLASSES]; /* default class symbols */ -E uchar monsyms[MAXMCLASSES]; /* current class symbols */ - -E NEARDATA struct c_color_names { - const char *const c_black, *const c_amber, *const c_golden, - *const c_light_blue,*const c_red, *const c_green, - *const c_silver, *const c_blue, *const c_purple, - *const c_white; -} c_color_names; -#define NH_BLACK c_color_names.c_black -#define NH_AMBER c_color_names.c_amber -#define NH_GOLDEN c_color_names.c_golden -#define NH_LIGHT_BLUE c_color_names.c_light_blue -#define NH_RED c_color_names.c_red -#define NH_GREEN c_color_names.c_green -#define NH_SILVER c_color_names.c_silver -#define NH_BLUE c_color_names.c_blue -#define NH_PURPLE c_color_names.c_purple -#define NH_WHITE c_color_names.c_white - -E NEARDATA winid WIN_MESSAGE, WIN_STATUS; -E NEARDATA winid WIN_MAP, WIN_INVEN; -E char toplines[]; -#ifndef TCAP_H -E struct tc_gbl_data { /* also declared in tcap.h */ - char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */ - int tc_LI, tc_CO; /* lines and columns */ -} tc_gbl_data; -#define AS tc_gbl_data.tc_AS -#define AE tc_gbl_data.tc_AE -#define LI tc_gbl_data.tc_LI -#define CO tc_gbl_data.tc_CO -#endif - -E struct authentication { - char prog[BUFSZ]; - char args[BUFSZ]; -} authentication; - -#define MAXNOTILESETS 20 -#ifndef TILESET_MAX_FILENAME -#define TILESET_MAX_FILENAME 256 -#endif - -#define TILESET_TRANSPARENT 1 -#define TILESET_PSEUDO3D 2 - -E struct tileset { - char name[PL_PSIZ]; - char file[TILESET_MAX_FILENAME]; - unsigned long flags; - void *data; /* For windowing port's use */ -} tilesets[MAXNOTILESETS]; -E int no_tilesets; -E struct tileset def_tilesets[]; -E char tileset[PL_PSIZ]; - -/* xxxexplain[] is in drawing.c */ -E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[]; - -/* Some systems want to use full pathnames for some subsets of file names, - * rather than assuming that they're all in the current directory. This - * provides all the subclasses that seem reasonable, and sets up for all - * prefixes being null. Port code can set those that it wants. - */ -#define HACKPREFIX 0 -#define LEVELPREFIX 1 -#define SAVEPREFIX 2 -#define BONESPREFIX 3 -#define DATAPREFIX 4 /* this one must match hardcoded value in dlb.c */ -#define SCOREPREFIX 5 -#define LOCKPREFIX 6 -#define CONFIGPREFIX 7 -#define TROUBLEPREFIX 8 -#define PREFIX_COUNT 9 -/* used in files.c; xxconf.h can override if needed */ -# ifndef FQN_MAX_FILENAME -#define FQN_MAX_FILENAME 512 -# endif - -#if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND) -/* the bare-bones stuff is unconditional above to simplify coding; for - * ports that actually use prefixes, add some more localized things - */ -#define PREFIXES_IN_USE -#endif - -E char *fqn_prefix[PREFIX_COUNT]; -#ifdef PREFIXES_IN_USE -E char *fqn_prefix_names[PREFIX_COUNT]; -#endif - - -#ifdef AUTOPICKUP_EXCEPTIONS -struct autopickup_exception { - char *pattern; - boolean grab; - struct autopickup_exception *next; -}; -#endif /* AUTOPICKUP_EXCEPTIONS */ - -#undef E - -#endif /* DECL_H */ diff -Naurbd slashem-0.0.8E0/include/global.h slashem-0.0.8E0F1/include/global.h --- slashem-0.0.8E0/include/global.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/global.h 2006-05-15 12:13:10.000000000 +0100 @@ -209,6 +209,12 @@ * config.h and *conf.h */ #include "autoconf.h" +#if HAVE_STRING_H +#include +#endif +#if HAVE_DECL_STRNICMP && !HAVE_DECL_STRNCMPI +#define strncmpi(a,b,c) strnicmp(a,b,c) +#endif #endif #ifndef FILE_AREAS diff -Naurbd slashem-0.0.8E0/include/mondata.h slashem-0.0.8E0F1/include/mondata.h --- slashem-0.0.8E0/include/mondata.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/mondata.h 2006-05-15 12:13:10.000000000 +0100 @@ -176,7 +176,8 @@ ((ptr) == &mons[PM_FIRE_ELEMENTAL]) ? 2 : \ ((ptr) == &mons[PM_FIRE_VAMPIRE])? 2 : \ ((ptr) == &mons[PM_FLAMING_SPHERE]) ? 1 : \ - ((ptr) == &mons[PM_SHOCKING_SPHERE]) ? 1 : 0) + ((ptr) == &mons[PM_SHOCKING_SPHERE]) ? 1 : \ + ((ptr) == &mons[PM_WAX_GOLEM]) ? 1 : 0) /* [note: the light ranges above were reduced to 1 for performance...] */ /* WAC increased to 3 and 2?*/ #define likes_lava(ptr) (ptr == &mons[PM_FIRE_ELEMENTAL] || \ diff -Naurbd slashem-0.0.8E0/include/ntconf.h slashem-0.0.8E0F1/include/ntconf.h --- slashem-0.0.8E0/include/ntconf.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/ntconf.h 2006-05-15 12:13:10.000000000 +0100 @@ -46,7 +46,9 @@ #ifdef NH_OPTIONS_USED #undef NH_OPTIONS_USED #endif -#if defined(MSWIN_GRAPHICS) || defined(GTK_GRAPHICS) +#if defined(AUTOCONF) +#define NH_OPTIONS_USED "options" +#elif defined(MSWIN_GRAPHICS) || defined(GTK_GRAPHICS) #define NH_OPTIONS_USED "guioptions" #else #define NH_OPTIONS_USED "ttyoptions" @@ -70,12 +72,14 @@ #include /* Provides prototypes of exit(), spawn() */ #endif +#ifndef AUTOCONF #include /* Provides prototypes of strncmpi(), etc. */ #ifdef STRNCMPI #ifndef __CYGWIN__ #define strncmpi(a,b,c) strnicmp(a,b,c) #endif #endif +#endif /* AUTOCONF */ #include #include diff -Naurbd slashem-0.0.8E0/include/os2conf.h slashem-0.0.8E0F1/include/os2conf.h --- slashem-0.0.8E0/include/os2conf.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/os2conf.h 2006-05-15 12:13:10.000000000 +0100 @@ -43,6 +43,10 @@ #define MAIL /* Allows for fake mail daemon to deliver mail */ #define TIMED_DELAY /* enable the `timed_delay' run-time option */ +#ifdef TEXTCOLOR +# define VIDEOSHADES +#endif + /* * The remaining code shouldn't need modification. */ diff -Naurbd slashem-0.0.8E0/include/patchlevel.h slashem-0.0.8E0F1/include/patchlevel.h --- slashem-0.0.8E0/include/patchlevel.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/patchlevel.h 2006-05-15 12:13:10.000000000 +0100 @@ -16,10 +16,10 @@ */ #define PATCHLEVEL 8 #define EDITLEVEL 0 -/* #define FIXLEVEL 0 */ +#define FIXLEVEL 1 #define COPYRIGHT_BANNER_A \ -"This is SuperLotsoAddedStuffHack-Extended Magic 1997-2004" +"This is SuperLotsoAddedStuffHack-Extended Magic 1997-2005" #define COPYRIGHT_BANNER_B \ "NetHack, Copyright 1985-2003 Stichting Mathematisch Centrum, M. Stephenson." diff -Naurbd slashem-0.0.8E0/include/unixconf.h slashem-0.0.8E0F1/include/unixconf.h --- slashem-0.0.8E0/include/unixconf.h 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/include/unixconf.h 2006-05-15 12:13:10.000000000 +0100 @@ -196,6 +196,10 @@ * a fine-grained timer. */ /* #define TIMED_DELAY */ /* usleep() */ + +# ifdef TEXTCOLOR +# define VIDEOSHADES +# endif #endif /* diff -Naurbd slashem-0.0.8E0/readme.txt slashem-0.0.8E0F1/readme.txt --- slashem-0.0.8E0/readme.txt 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/readme.txt 2006-05-15 12:13:10.000000000 +0100 @@ -65,114 +65,68 @@ 1.2 Changes ----------- -ver 0.0.8E0 [July 2/2005] [Released by Ali] --Added dumplog patch (Tom Friedetzky and Jukka Lahtinen) --fixed bug 923003: Invisible mirrors can be applied --fixed bug 916544: Wrong weight of corpses on Nightmare level --fixed bug 947369: Crash when multiple wands explode --fixed bug 950120: crash when wishing for Wallet of Perseus --fixed bug 933365: wand of draining does not interrupt ctrl-run --fixed bug 933379: weird behaviour with polyself into monsters like migo drone --fixed bug 929546: Flaming spheres won't attack acid blobs --fixed bug 951991: Reading spellbooks not safe for wizards --fixed bug 914894: "Beautiful" gnome thief seduced female character --fixed bug 918178: Double message "You are suddenly very hot/cold!" --fixed bug 921810: Invisible books can be read (?!) --fixed bug 934076: Dipping amnesia into amnesia gives water --fixed bug 946306: do_look: bad glyph 3726 at (7, 16) --fixed bug 929220: Prayer and chi healing --fixed bug 946157: Water elementals created over lava on Flame mage quest --fixed bug 946161: Bad message when two-weaponing against a rust monster --fixed bug 946566: Partly eaten more nutritious while raising drained corpses --fixed bug 946984: arch-liches are not MR_HITAS* --fixed bug 949016: Draining a rotten corpse --fixed bug 951439: Invisible Corpses and Ressurection --fixed bug 941453: Grand slam against monsters needing +n weapons --fixed bug 962515: Disarming fire trap doesn't use up water --fixed bug 1001167: Is this a Gray Stone bug? --fixed bug 992247: wolfname & ghoulname in default.nh doesn't work --fixed bug 931679: Space Bar not working as rest --fixed bug 912588: Molds stagger from your powerful strike --fixed bug 962574: Display bug when setting OPTIONS=tiles:Small tiles --fixed bug 1011313: SEGV using technique "raise zombies" --fixed bug 1018229: impossible splitbill: no resident shopkeeper?? --fixed bug 1018447: Game crash when Hero with ball displace displacer beast --fixed bug 1020983: Typo in doc/sources.txt (cloack) --fixed bug 956891: Breeders are explosive --fixed bug 1007127: diluted potion of water --fixed bug 1010421: Thiefbane drains your levels even if you aren't hit --fixed bug 976157: Dipping into !oAmnesia didn't use up potion --fixed bug 982331: Can't name Cursed scrolls of teleport after reading them --fixed some theoretical bugs thrown up by valgrind --fixed bug 980258: Guidebook doesn't describe showdmg option accurately - (Andy Ruse) --fixed bug 926202: Gnome thieves don't eat (Andy Ruse) --fixed bug 926200: Dwarf thieves have M2_NOPOLY (Andy Ruse) --fixed bug 962568: Mjollnir can't be thrown - code comment incorrect (Andy Ruse) --fixed bug 1005587: Beholder killed by "it's" own gaze (Andy Ruse) --fixed bug 1022460: [C343-8] The plural of Nazgul is Nazgul (Andy Ruse) --fixed bug 1039689: malloc_consolidate hang after using cursed bag of holding --fixed bug 1028955: Surgery technique doesn't work with polymorph --fixed bug 1035356: God gave Deathsword to "human" character --fixed bug 1024200: Problems about Thiefbane --fixed bug 1024202: Dipping a loadstone into a potion of amnesia --fixed bug 1038151: Power surge becomes permanent if lost --fixed bug 1025486: Pets can't follow lvl telep from Blk Mkt --fixed bug 1029750: Lycanthropes and eating wolfsbane while polymorphed --fixed bug 1030725: Doppelganger liquid leap does not release from chain --fixed bug 1032419: Eviscerate tech should not work while wearing gloves --fixed bug 1055724: Raise Zombies gives tame troll --fixed bug 1020980: Objects are forgotten when you search blind --fixed bug 954414: pickup_thrown option includes some non-throw weapons --fixed bug 937239: Wrong cause of death from exploding wands --fixed bug 962572: Inventory item prints to console instead of chat buffer --fixed bug 936167: Started with empty medical kit (Pasi Kallinen) --fixed bug 934077: Wrote an invisible scroll (Pasi Kallinen) --fixed bug 1015079: Spurious "it snatches the boulder" message (Pasi Kallinen) --fixed bug 957731: Shop purchases free after 200 objects --fixed bug 1062624: GTK Interface is not resizable --fixed bug 931684: Inventory window behaving strangely --Fixed build of proxy tests --fixed bug 1071688: cannot compile on FreeBSD (termcap) --fixed bug 1071623: Cannot compile on FreeBSD due to menucolor inclusion --Unbundled proxy and gtk modules: - http://www.nongnu.org/nhproxy/ - http://www.gtkhack.org/ --fixed bug 993420: Crashes when typing symbols on drop menu --fixed bug 1084366: ghoul queen don't has M2_FEMALE --fixed bug 1066530: Fired/thrown items get new inventory letter when retrieved --fixed bug 992244: Alt Gr key doesn't work --fixed bug 1076125: Unsuccessful use of medical kits --fixed bug 1076123: Vampires can eat white pills --fixed bug 994993: when polying, you take off T-shirt after scales merge --fixed bug 961914: Deep dragons should resist their own breath --fixed bug 963344: Stat exercise effects calculated while polymorphed --fixed bug 1097792: Duplicate message when hit by sleep gaze --fixed bug 1065927: Should bars stop bullets? --fixed bug 947009: Scroll of taming exercises skill in healing spells --fixed bug 1077355: game crashes with: "panic monsndx - could not index monster" --fixed bug 1098686: Restoring a mounted character wielding Sting can fail --fixed bug 1105100: Escaping from pits by polymorphing into a mind flayer --Proxy: Implement get_no_glyph method for compatibility with nhproxy 0.9.1 --fixed bug 1110081: in_container() uses obj->quan after deallocatin obj --fixed bug 1116877: Dereferencing freed memory when applying bags which explode --fixed bug 951483: Wands of cancellation can be held in a bag of holding --fixed bug 1155634: charm spell or command undead spell invoke genocide --fixed incorrect #ifdef resulting in compilation failure on ANSI only DOS builds --fixed bug 1193070: Engraving with a wand of draining keeps illiterate - conduct (Nico Kist) --fixed bug 924811: Fire vampires leave corpses --fixed bug 1028948: casting stone to flesh on a gargoyle --fixed bug 1213881: Lieutenants lack Firearms --fixed bug 1212903: Int and Wis stats not correct (in obscure case) --fixed bug 1175912: Deity-gifted pets should not attack like aligned unicorns - (Nico Kist) --fixed bug 1205563: suppress_alert still says NetHack --fixed bug 1157414: Do not "loose" faith --fixed bug 1021014: leashed pet movement bug --fixed bug 1197822: necromancer zombie's hp --fixed bug 1185759: Shopkeeper "looks at corpse" through wall --Experimental support for GNU autoconf +ver 0.0.8E0F1 [?] [Released by ?] +-fixed bug 1231549: GNU autoconf vpath support is broken +-fixed bug 1231579: Can't specify wizard with GNU autoconf +-fixed bug 1232707: engraving with lightsabers +-fixed bug 1239041: engrave dialog doesn't show lightsabers +-fixed bug 1231766: Food shown in Medical Kits +-fixed bug 1238060: grammatical error when burning through a door + (Benjamin Schieder) +-fixed bug 1104713: Pet and Frozen food stores can charge +-fixed bug 988827: Monster wearing CoI left invisible corpse +-fixed bug 934078: Mold "wiggle" out of bag +-fixed bug 933587: One-Eyed Sam referred to as "it" +-fixed bug 1240794: Pets don't grow up properly +-fixed bug 1240799: Steed ridden onto poly trap polymorphs permanently +-fixed bug 1243904: chameleon as statue trap +-fixed bug 1223226: Some creatures are missing horns +-fixed bug 1223222: Female Bulls?? +-fixed bug 1244470: shopkeeper don't have shotgun +Autoconf improvements: + -support for data librarian, + -fix default values in help strings, + -more portable use of test and sed, + -drop useless borg and shout features, + -recognize mingw32 platform for msys, + -support aclocal 1.7 (needed for msys development), + -basic support for Microsoft Window's native graphics, + -better determination of default windowing system, + -improved detection of libpng/zlib, + -support "make depend". +-fixed bug 215062: no black color + Extends videocolors option, see Guidebook for details. +-Macintosh: fixed calculation of version for About Box +-fixed bug 1258354: msys autoconf fails to detect strncmpi +-fixed bug 1258355: autoconf Makefile.src assumes UNIX +-fixed bug 1258357: configure doesn't set TTY_GRAPHICS under mingw32 +-fixed bug 1258358: No autoconf support for key handlers +-fixed bug 1244468: different spitting venom when polymorph +-fixed bug 1179557: Found egg marked (laid by you) +-fixed bug 1206099: Torches are not extinguished with rust traps +-fixed bug 1294907: 'Raise Zombies' technique cannot raise dwarf zombies! (Xeno) +-fixed bug 1355972: Monsters Don't gain Drain resistance due to worn items! + (Xeno) +-inserted missing #ifdef resulting in compilation of pure ansi tty version for DOS failure. +-fixed bug 1461660: Misaligned door +-fixed bug 1449238: #youpoly takes a turn when denied +-fixed bug 1432473: help for Luggage shows help for Lug/Lugh +-fixed bug 1428520: Poisoned ID'd weapon gives description as well as ID +-fixed bug 1375292: help for wombat shows text for bat +-fixed bug 1375286: pummel strikes nothing, inside ochre jelly +-fixed bug 1355891: Cannot wish for multiple potions of vampire blood +-fixed bug 1314114: Shopkeepers cant see Shirts through invisible armour +-fixed bug 1304954: You can Name the Sword of Balance +-fixed bug 1223533: Typo error in the Install.X11 file +-fixed bug 1407275: Wrong weight of medical kits +-fixed bug 1213658: Death message missing with gas spore explosion when blind +-fixed bug 1291161: #force command doesn't work on locked box +-fixed bug 1223632: #force on shop doors +-fixed bug 879247: gender & alignment select dont focus on "random" button +-fixed bug 943553: Eating off floor while levitating +-fixed bug 1432411: Knew the colour of a potion thrown on me, when blind +-fixed bug 1449159: DEFAULT_WINDOW_SYS wrong if only X11 enabled +-fixed bug 1400802: wax golems don't emit light See history.txt for changes made in previous versions. diff -Naurbd slashem-0.0.8E0/src/allmain.c.orig slashem-0.0.8E0F1/src/allmain.c.orig --- slashem-0.0.8E0/src/allmain.c.orig 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/allmain.c.orig 1970-01-01 01:00:00.000000000 +0100 @@ -1,718 +0,0 @@ -/* SCCS Id: @(#)allmain.c 3.4 2003/04/02 */ -/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* various code that was replicated in *main.c */ - -#include "hack.h" -#ifndef NO_SIGNAL -#include -#endif -#ifdef SHORT_FILENAMES -#include "patchlev.h" -#else -#include "patchlevel.h" -#endif - -#ifdef POSITIONBAR -STATIC_DCL void NDECL(do_positionbar); -#endif - -#define decrnknow(spell) spl_book[spell].sp_know-- -#define spellid(spell) spl_book[spell].sp_id -#define spellknow(spell) spl_book[spell].sp_know - -#ifdef OVL0 - -void -moveloop() -{ -#if defined(MICRO) || defined(WIN32) - char ch; - int abort_lev; -#endif - int moveamt = 0, wtcap = 0, change = 0; - boolean didmove = FALSE, monscanmove = FALSE; - - flags.moonphase = phase_of_the_moon(); - if(flags.moonphase == FULL_MOON) { - You("are lucky! Full moon tonight."); - change_luck(1); - } else if(flags.moonphase == NEW_MOON) { - pline("Be careful! New moon tonight."); - } - flags.friday13 = friday_13th(); - if (flags.friday13) { - pline("Watch out! Bad things can happen on Friday the 13th."); - change_luck(-1); - } - /* KMH -- February 2 */ - flags.groundhogday = groundhog_day(); - if (flags.groundhogday) - pline("Happy Groundhog Day!"); - - initrack(); - - - /* Note: these initializers don't do anything except guarantee that - we're linked properly. - */ - decl_init(); - monst_init(); - monstr_init(); /* monster strengths */ - objects_init(); - -#ifdef WIZARD - if (wizard) add_debug_extended_commands(); -#endif - - (void) encumber_msg(); /* in case they auto-picked up something */ - - u.uz0.dlevel = u.uz.dlevel; - youmonst.movement = NORMAL_SPEED; /* give the hero some movement points */ - - for(;;) { - get_nh_event(); -#ifdef POSITIONBAR - do_positionbar(); -#endif - - didmove = flags.move; - if(didmove) { - /* actual time passed */ - youmonst.movement -= NORMAL_SPEED; - - do { /* hero can't move this turn loop */ - wtcap = encumber_msg(); - - flags.mon_moving = TRUE; - do { - monscanmove = movemon(); - if (youmonst.movement > NORMAL_SPEED) - break; /* it's now your turn */ - } while (monscanmove); - flags.mon_moving = FALSE; - - if (!monscanmove && youmonst.movement < NORMAL_SPEED) { - /* both you and the monsters are out of steam this round */ - /* set up for a new turn */ - struct monst *mtmp; - mcalcdistress(); /* adjust monsters' trap, blind, etc */ - - /* reallocate movement rations to monsters */ - for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) - mtmp->movement += mcalcmove(mtmp); - - if(!rn2(u.uevent.udemigod ? 25 : - (depth(&u.uz) > depth(&stronghold_level)) ? 50 : 70)) - (void) makemon((struct permonst *)0, 0, 0, NO_MM_FLAGS); - - /* calculate how much time passed. */ -#ifdef STEED - if (u.usteed && u.umoved) { - /* your speed doesn't augment steed's speed */ - moveamt = mcalcmove(u.usteed); - } else -#endif - { - moveamt = youmonst.data->mmove; - - if (Very_fast) { /* speed boots or potion */ - /* average movement is 1.67 times normal */ - moveamt += NORMAL_SPEED / 2; - if (rn2(3) == 0) moveamt += NORMAL_SPEED / 2; - } else if (Fast) { - /* average movement is 1.33 times normal */ - if (rn2(3) != 0) moveamt += NORMAL_SPEED / 2; - } - if (tech_inuse(T_BLINK)) { /* TECH: Blinking! */ - /* Case Average Variance - * ------------------------- - * Normal 12 0 - * Fast 16 12 - * V fast 20 12 - * Blinking 24 12 - * F & B 28 18 - * V F & B 30 18 - */ - moveamt += NORMAL_SPEED * 2 / 3; - if (rn2(3) == 0) moveamt += NORMAL_SPEED / 2; - } - } - - switch (wtcap) { - case UNENCUMBERED: break; - case SLT_ENCUMBER: moveamt -= (moveamt / 4); break; - case MOD_ENCUMBER: moveamt -= (moveamt / 2); break; - case HVY_ENCUMBER: moveamt -= ((moveamt * 3) / 4); break; - case EXT_ENCUMBER: moveamt -= ((moveamt * 7) / 8); break; - default: break; - } - - youmonst.movement += moveamt; - if (youmonst.movement < 0) youmonst.movement = 0; - settrack(); - - monstermoves++; - moves++; - - /********************************/ - /* once-per-turn things go here */ - /********************************/ - - if (flags.bypasses) clear_bypasses(); - if(Glib) glibr(); - nh_timeout(); - run_regions(); - -#ifdef DUNGEON_GROWTH - dgn_growths(TRUE, TRUE); -#endif - - if (u.ublesscnt) u.ublesscnt--; - - if(flags.time && !flags.run) - flags.botl = 1; - - /* One possible result of prayer is healing. Whether or - * not you get healed depends on your current hit points. - * If you are allowed to regenerate during the prayer, the - * end-of-prayer calculation messes up on this. - * Another possible result is rehumanization, which requires - * that encumbrance and movement rate be recalculated. - */ - if (u.uinvulnerable) { - /* for the moment at least, you're in tiptop shape */ - wtcap = UNENCUMBERED; - } else if (Upolyd && youmonst.data->mlet == S_EEL && !is_pool(u.ux,u.uy) && !Is_waterlevel(&u.uz)) { - if (u.mh > 1) { - u.mh--; - flags.botl = 1; - } else if (u.mh < 1) - rehumanize(); - } else if (Upolyd && u.mh < u.mhmax) { - if (u.mh < 1) - rehumanize(); - else if (Regeneration || - (wtcap < MOD_ENCUMBER && !(moves%20))) { - flags.botl = 1; - u.mh++; - } - } else if (u.uhp < u.uhpmax && - (wtcap < MOD_ENCUMBER || !u.umoved || Regeneration)) { -/* - * KMH, balance patch -- New regeneration code - * Healthstones have been added, which alter your effective - * experience level and constitution (-2 cursed, +1 uncursed, - * +2 blessed) for the basis of regeneration calculations. - */ - - int efflev = u.ulevel + u.uhealbonus; - int effcon = ACURR(A_CON) + u.uhealbonus; - int heal = 1; - - - if (efflev > 9 && !(moves % 3)) { - if (effcon <= 12) { - heal = 1; - } else { - heal = rnd(effcon); - if (heal > efflev-9) heal = efflev-9; - } - flags.botl = 1; - u.uhp += heal; - if(u.uhp > u.uhpmax) - u.uhp = u.uhpmax; - } else if (Regeneration || - (efflev <= 9 && - !(moves % ((MAXULEV+12) / (u.ulevel+2) + 1)))) { - flags.botl = 1; - u.uhp++; - } - } - - if (!u.uinvulnerable && u.uen > 0 && u.uhp < u.uhpmax && - tech_inuse(T_CHI_HEALING)) { - u.uen--; - u.uhp++; - flags.botl = 1; - } - - /* moving around while encumbered is hard work */ - if (wtcap > MOD_ENCUMBER && u.umoved) { - if(!(wtcap < EXT_ENCUMBER ? moves%30 : moves%10)) { - if (Upolyd && u.mh > 1) { - u.mh--; - } else if (!Upolyd && u.uhp > 1) { - u.uhp--; - } else { - You("pass out from exertion!"); - exercise(A_CON, FALSE); - fall_asleep(-10, FALSE); - } - } - } - - - /* KMH -- OK to regenerate if you don't move */ - if ((u.uen < u.uenmax) && (Energy_regeneration || - ((wtcap < MOD_ENCUMBER || !flags.mv) && - (!(moves%((MAXULEV + 15 - u.ulevel) * - (Role_if(PM_WIZARD) ? 3 : 4) / 6)))))) { - u.uen += rn1((int)(ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1,1); -#ifdef WIZ_PATCH_DEBUG - pline("mana was = %d now = %d",temp,u.uen); -#endif - - if (u.uen > u.uenmax) u.uen = u.uenmax; - flags.botl = 1; - } - - if(!u.uinvulnerable) { - if(Teleportation && !rn2(85)) { - xchar old_ux = u.ux, old_uy = u.uy; - tele(); - if (u.ux != old_ux || u.uy != old_uy) { - if (!next_to_u()) { - check_leash(old_ux, old_uy); - } -#ifdef REDO - /* clear doagain keystrokes */ - pushch(0); - savech(0); -#endif - } - } - /* delayed change may not be valid anymore */ - if ((change == 1 && !Polymorph) || - (change == 2 && u.ulycn == NON_PM)) - change = 0; - if(Polymorph && !rn2(100)) - change = 1; - else if (u.ulycn >= LOW_PM && !Upolyd && - !rn2(80 - (20 * night()))) - change = 2; - if (change && !Unchanging) { - if (multi >= 0) { - if (occupation) - stop_occupation(); - else - nomul(0); - if (change == 1) polyself(FALSE); - else you_were(); - change = 0; - } - } - } /* !u.uinvulnerable */ - - if(Searching && multi >= 0) (void) dosearch0(1); - dosounds(); - do_storms(); - gethungry(); - age_spells(); - exerchk(); - invault(); - if (u.uhave.amulet) amulet(); - if (!rn2(40+(int)(ACURR(A_DEX)*3))) u_wipe_engr(rnd(3)); - if (u.uevent.udemigod && !u.uinvulnerable) { - if (u.udg_cnt) u.udg_cnt--; - if (!u.udg_cnt) { - intervene(); - u.udg_cnt = rn1(200, 50); - } - } - restore_attrib(); - - /* underwater and waterlevel vision are done here */ - if (Is_waterlevel(&u.uz)) - movebubbles(); - else if (Underwater) - under_water(0); - /* vision while buried done here */ - else if (u.uburied) under_ground(0); - - /* when immobile, count is in turns */ - if(multi < 0) { - if (++multi == 0) { /* finished yet? */ - unmul((char *)0); - /* if unmul caused a level change, take it now */ - if (u.utotype) deferred_goto(); - } - } - } - } while (youmonst.movement= 0 && occupation) { -#if defined(MICRO) || defined(WIN32) - abort_lev = 0; - if (kbhit()) { - if ((ch = Getchar()) == ABORT) - abort_lev++; -# ifdef REDO - else - pushch(ch); -# endif /* REDO */ - } - if (!abort_lev && (*occupation)() == 0) -#else - if ((*occupation)() == 0) -#endif - occupation = 0; - if( -#if defined(MICRO) || defined(WIN32) - abort_lev || -#endif - monster_nearby()) { - stop_occupation(); - reset_eat(); - } -#if defined(MICRO) || defined(WIN32) - if (!(++occtime % 7)) - display_nhwindow(WIN_MAP, FALSE); -#endif - continue; - } - - if ((u.uhave.amulet || Clairvoyant) && - !In_endgame(&u.uz) && !BClairvoyant && - !(moves % 15) && !rn2(2)) - do_vicinity_map(); - - if(u.utrap && u.utraptype == TT_LAVA) { - if(!is_lava(u.ux,u.uy)) - u.utrap = 0; - else if (!u.uinvulnerable) { - u.utrap -= 1<<8; - if(u.utrap < 1<<8) { - killer_format = KILLED_BY; - killer = "molten lava"; - You("sink below the surface and die."); - done(DISSOLVED); - } else if(didmove && !u.umoved) { - Norep("You sink deeper into the lava."); - u.utrap += rnd(4); - } - } - } - -#ifdef WIZARD - if (iflags.sanity_check) - sanity_check(); -#endif - -#ifdef CLIPPING - /* just before rhack */ - cliparound(u.ux, u.uy); -#endif - - u.umoved = FALSE; - - if (multi > 0) { - lookaround(); - if (!multi) { - /* lookaround may clear multi */ - flags.move = 0; - if (flags.time) flags.botl = 1; - continue; - } - if (flags.mv) { - if(multi < COLNO && !--multi) - flags.travel = iflags.travel1 = flags.mv = flags.run = 0; - domove(); - } else { - --multi; - rhack(save_cm); - } - } else if (multi == 0) { -#ifdef MAIL - ckmailstatus(); -#endif - rhack((char *)0); - } - if (u.utotype) /* change dungeon level */ - deferred_goto(); /* after rhack() */ - /* !flags.move here: multiple movement command stopped */ - else if (flags.time && (!flags.move || !flags.mv)) - flags.botl = 1; - - if (vision_full_recalc) vision_recalc(0); /* vision! */ - /* when running in non-tport mode, this gets done through domove() */ - if ((!flags.run || iflags.runmode == RUN_TPORT) && - (multi && (!flags.travel ? !(multi % 7) : !(moves % 7L)))) { - if (flags.time && flags.run) flags.botl = 1; - display_nhwindow(WIN_MAP, FALSE); - } - } -} - - -#endif /* OVL0 */ -#ifdef OVL1 - -void -stop_occupation() -{ - if(occupation) { - if (!maybe_finished_meal(TRUE)) - You("stop %s.", occtxt); - occupation = 0; - flags.botl = 1; /* in case u.uhs changed */ -/* fainting stops your occupation, there's no reason to sync. - sync_hunger(); -*/ -#ifdef REDO - nomul(0); - pushch(0); -#endif - } -} - -#endif /* OVL1 */ -#ifdef OVLB - -void -display_gamewindows() -{ - WIN_MESSAGE = create_nhwindow(NHW_MESSAGE); - WIN_STATUS = create_nhwindow(NHW_STATUS); - WIN_MAP = create_nhwindow(NHW_MAP); - WIN_INVEN = create_nhwindow(NHW_MENU); - -#ifdef MAC - /* - * This _is_ the right place for this - maybe we will - * have to split display_gamewindows into create_gamewindows - * and show_gamewindows to get rid of this ifdef... - */ - if ( ! strcmp ( windowprocs . name , "mac" ) ) { - SanePositions ( ) ; - } -#endif - - /* - * The mac port is not DEPENDENT on the order of these - * displays, but it looks a lot better this way... - */ - display_nhwindow(WIN_STATUS, FALSE); - display_nhwindow(WIN_MESSAGE, FALSE); - clear_glyph_buffer(); - display_nhwindow(WIN_MAP, FALSE); -} - -void -newgame() -{ - int i; - -#ifdef MFLOPPY - gameDiskPrompt(); -#endif - - flags.ident = 1; - - for (i = 0; i < NUMMONS; i++) - mvitals[i].mvflags = mons[i].geno & G_NOCORPSE; - - init_objects(); /* must be before u_init() */ - - flags.pantheon = -1; /* role_init() will reset this */ - role_init(); /* must be before init_dungeons(), u_init(), - * and init_artifacts() */ - - init_dungeons(); /* must be before u_init() to avoid rndmonst() - * creating odd monsters for any tins and eggs - * in hero's initial inventory */ - init_artifacts(); /* before u_init() in case $WIZKIT specifies - * any artifacts */ - u_init(); - init_artifacts1(); /* must be after u_init() */ - -#ifndef NO_SIGNAL - (void) signal(SIGINT, (SIG_RET_TYPE) done1); -#endif -#ifdef NEWS - if(iflags.news) display_file_area(NEWS_AREA, NEWS, FALSE); -#endif - - load_qtlist(); /* load up the quest text info */ -/* quest_init();*/ /* Now part of role_init() */ - - mklev(); - u_on_upstairs(); - vision_reset(); /* set up internals for level (after mklev) */ - check_special_room(FALSE); - - flags.botlx = 1; - - /* Move the monster from under you or else - * makedog() will fail when it calls makemon(). - * - ucsfcgl!kneller - */ - - if(MON_AT(u.ux, u.uy)) mnexto(m_at(u.ux, u.uy)); - (void) makedog(); - - docrt(); - - if (flags.legacy) { - flush_screen(1); - com_pager(1); - } -#ifdef INSURANCE - save_currentstate(); -#endif - program_state.something_worth_saving++; /* useful data now exists */ - - /* Success! */ - welcome(TRUE); - return; -} - -/* show "welcome [back] to nethack" message at program startup */ -void -welcome(new_game) -boolean new_game; /* false => restoring an old game */ -{ - char buf[BUFSZ]; - boolean currentgend = Upolyd ? u.mfemale : flags.female; - - /* - * The "welcome back" message always describes your innate form - * even when polymorphed or wearing a helm of opposite alignment. - * Alignment is shown unconditionally for new games; for restores - * it's only shown if it has changed from its original value. - * Sex is shown for new games except when it is redundant; for - * restores it's only shown if different from its original value. - */ - *buf = '\0'; - if (new_game || u.ualignbase[A_ORIGINAL] != u.ualignbase[A_CURRENT]) - Sprintf(eos(buf), " %s", align_str(u.ualignbase[A_ORIGINAL])); - if (!urole.name.f && - (new_game ? (urole.allow & ROLE_GENDMASK) == (ROLE_MALE|ROLE_FEMALE) : - currentgend != flags.initgend)) - Sprintf(eos(buf), " %s", genders[currentgend].adj); - -#if 0 - pline(new_game ? "%s %s, welcome to NetHack! You are a%s %s %s." - : "%s %s, the%s %s %s, welcome back to NetHack!", - Hello((struct monst *) 0), plname, buf, urace.adj, - (currentgend && urole.name.f) ? urole.name.f : urole.name.m); -#endif - if (new_game) pline("%s %s, welcome to %s! You are a%s %s %s.", - Hello((struct monst *) 0), plname, DEF_GAME_NAME, buf, urace.adj, - (currentgend && urole.name.f) ? urole.name.f : urole.name.m); - else pline("%s %s, the%s %s %s, welcome back to %s!", - Hello((struct monst *) 0), plname, buf, urace.adj, - (currentgend && urole.name.f) ? urole.name.f : urole.name.m, - DEF_GAME_NAME); -} - -#ifdef POSITIONBAR -STATIC_DCL void -do_positionbar() -{ - static char pbar[COLNO]; - char *p; - - p = pbar; - /* up stairway */ - if (upstair.sx && -#ifdef DISPLAY_LAYERS - (level.locations[upstair.sx][upstair.sy].mem_bg == S_upstair || - level.locations[upstair.sx][upstair.sy].mem_bg == S_upladder)) { -#else - (glyph_to_cmap(level.locations[upstair.sx][upstair.sy].glyph) == - S_upstair || - glyph_to_cmap(level.locations[upstair.sx][upstair.sy].glyph) == - S_upladder)) { -#endif - *p++ = '<'; - *p++ = upstair.sx; - } - if (sstairs.sx && -#ifdef DISPLAY_LAYERS - (level.locations[sstairs.sx][sstairs.sy].mem_bg == S_upstair || - level.locations[sstairs.sx][sstairs.sy].mem_bg == S_upladder)) { -#else - (glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) == - S_upstair || - glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) == - S_upladder)) { -#endif - *p++ = '<'; - *p++ = sstairs.sx; - } - - /* down stairway */ - if (dnstair.sx && -#ifdef DISPLAY_LAYERS - (level.locations[dnstair.sx][dnstair.sy].mem_bg == S_dnstair || - level.locations[dnstair.sx][dnstair.sy].mem_bg == S_dnladder)) { -#else - (glyph_to_cmap(level.locations[dnstair.sx][dnstair.sy].glyph) == - S_dnstair || - glyph_to_cmap(level.locations[dnstair.sx][dnstair.sy].glyph) == - S_dnladder)) { -#endif - *p++ = '>'; - *p++ = dnstair.sx; - } - if (sstairs.sx && -#ifdef DISPLAY_LAYERS - (level.locations[sstairs.sx][sstairs.sy].mem_bg == S_dnstair || - level.locations[sstairs.sx][sstairs.sy].mem_bg == S_dnladder)) { -#else - (glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) == - S_dnstair || - glyph_to_cmap(level.locations[sstairs.sx][sstairs.sy].glyph) == - S_dnladder)) { -#endif - *p++ = '>'; - *p++ = sstairs.sx; - } - - /* hero location */ - if (u.ux) { - *p++ = '@'; - *p++ = u.ux; - } - /* fence post */ - *p = 0; - - update_positionbar(pbar); -} -#endif - -#endif /* OVLB */ - -/*allmain.c*/ diff -Naurbd slashem-0.0.8E0/src/apply.c slashem-0.0.8E0F1/src/apply.c --- slashem-0.0.8E0/src/apply.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/apply.c 2006-05-15 12:13:10.000000000 +0100 @@ -3836,9 +3836,10 @@ yname(obj)); else { check_unpaid(obj); - if (otmp->quan > 1L) + if (otmp->quan > 1L) { otmp->quan--; - else { + obj->owt = weight(obj); + } else { obj_extract_self(otmp); obfree(otmp, (struct obj *)0); } diff -Naurbd slashem-0.0.8E0/src/decl.c.orig slashem-0.0.8E0F1/src/decl.c.orig --- slashem-0.0.8E0/src/decl.c.orig 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/decl.c.orig 1970-01-01 01:00:00.000000000 +0100 @@ -1,344 +0,0 @@ -/* SCCS Id: @(#)decl.c 3.2 2001/12/10 */ -/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ -/* NetHack may be freely redistributed. See license for details. */ - -#include "hack.h" - -int NDECL((*afternmv)); -int NDECL((*occupation)); - -/* from xxxmain.c */ -const char *hname = 0; /* name of the game (argv[0] of main) */ -int hackpid = 0; /* current process id */ -#if defined(UNIX) || defined(VMS) -int locknum = 0; /* max num of simultaneous users */ -#endif -#ifdef DEF_PAGER -char *catmore = 0; /* default pager */ -#endif - -NEARDATA int bases[MAXOCLASSES] = DUMMY; - -NEARDATA int multi = 0; -NEARDATA boolean multi_one = FALSE; /* used by dofire() and throw_the_obj() */ -#if 0 -NEARDATA int warnlevel = 0; /* used by movemon and dochugw */ -#endif -NEARDATA int nroom = 0; -NEARDATA int nsubroom = 0; -NEARDATA int occtime = 0; - -int x_maze_max, y_maze_max; /* initialized in main, used in mkmaze.c */ -int otg_temp; /* used by object_to_glyph() [otg] */ - -#ifdef REDO -NEARDATA int in_doagain = 0; -#endif - -/* - * The following structure will be initialized at startup time with - * the level numbers of some "important" things in the game. - */ -struct dgn_topology dungeon_topology = {DUMMY}; - -#include "quest.h" -struct q_score quest_status = DUMMY; - -NEARDATA int smeq[MAXNROFROOMS+1] = DUMMY; -NEARDATA int doorindex = 0; - -NEARDATA char *save_cm = 0; -NEARDATA int killer_format = 0; -const char *killer = 0; -const char *delayed_killer = 0; -#ifdef GOLDOBJ -NEARDATA long done_money = 0; -#endif -char killer_buf[BUFSZ] = DUMMY; -const char *nomovemsg = 0; -const char nul[40] = DUMMY; /* contains zeros */ -NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ -NEARDATA char pl_character[PL_CSIZ] = DUMMY; -NEARDATA char pl_race = '\0'; - -NEARDATA char pl_fruit[PL_FSIZ] = DUMMY; -NEARDATA int current_fruit = 0; -NEARDATA struct fruit *ffruit = (struct fruit *)0; - -NEARDATA char tune[6] = DUMMY; - -const char *occtxt = DUMMY; -const char quitchars[] = " \r\n\033"; -const char vowels[] = "aeiouAEIOU"; -const char ynchars[] = "yn"; -const char ynqchars[] = "ynq"; -const char ynaqchars[] = "ynaq"; -const char ynNaqchars[] = "yn#aq"; -NEARDATA long yn_number = 0L; - -const char disclosure_options[] = "iavgc"; - -#if defined(MICRO) || defined(WIN32) -char hackdir[PATHLEN]; /* where rumors, help, record are */ -# ifdef MICRO -char levels[PATHLEN]; /* where levels are */ -# endif -#endif /* MICRO || WIN32 */ - - -#ifdef MFLOPPY -char permbones[PATHLEN]; /* where permanent copy of bones go */ -int ramdisk = FALSE; /* whether to copy bones to levels or not */ -int saveprompt = TRUE; -const char *alllevels = "levels.*"; -const char *allbones = "bones*.*"; -#endif - -struct linfo level_info[MAXLINFO]; - -NEARDATA struct sinfo program_state; - -/* 'rogue'-like direction commands (cmd.c) */ -const char sdir[] = "hykulnjb><"; -const char ndir[] = "47896321><"; /* number pad mode */ -const schar xdir[10] = { -1,-1, 0, 1, 1, 1, 0,-1, 0, 0 }; -const schar ydir[10] = { 0,-1,-1,-1, 0, 1, 1, 1, 0, 0 }; -const schar zdir[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1,-1 }; - -NEARDATA schar tbx = 0, tby = 0; /* mthrowu: target */ - -/* for xname handling of multiple shot missile volleys: - number of shots, index of current one, validity check, shoot vs throw */ -NEARDATA struct multishot m_shot = { 0, 0, STRANGE_OBJECT, FALSE }; - -NEARDATA struct dig_info digging; - -NEARDATA dungeon dungeons[MAXDUNGEON]; /* ini'ed by init_dungeon() */ -NEARDATA s_level *sp_levchn; -NEARDATA stairway upstair = { 0, 0 }, dnstair = { 0, 0 }; -NEARDATA stairway upladder = { 0, 0 }, dnladder = { 0, 0 }; -NEARDATA stairway sstairs = { 0, 0 }; -NEARDATA dest_area updest = { 0, 0, 0, 0, 0, 0, 0, 0 }; -NEARDATA dest_area dndest = { 0, 0, 0, 0, 0, 0, 0, 0 }; -NEARDATA coord inv_pos = { 0, 0 }; - -NEARDATA boolean in_mklev = FALSE; -NEARDATA boolean stoned = FALSE; /* done to monsters hit by 'c' */ -NEARDATA boolean unweapon = FALSE; -NEARDATA boolean mrg_to_wielded = FALSE; - /* weapon picked is merged with wielded one */ -NEARDATA struct obj *current_wand = 0; /* wand currently zapped/applied */ - -NEARDATA boolean in_steed_dismounting = FALSE; - -NEARDATA coord bhitpos = DUMMY; -NEARDATA struct door doors[DOORMAX] = {DUMMY}; - -NEARDATA struct mkroom rooms[(MAXNROFROOMS+1)*2] = {DUMMY}; -NEARDATA struct mkroom* subrooms = &rooms[MAXNROFROOMS+1]; -struct mkroom *upstairs_room, *dnstairs_room, *sstairs_room; - -dlevel_t level; /* level map */ -struct trap *ftrap = (struct trap *)0; -NEARDATA struct monst youmonst = DUMMY; -NEARDATA struct permonst upermonst = DUMMY; -NEARDATA struct flag flags = DUMMY; -NEARDATA struct instance_flags iflags = DUMMY; -NEARDATA struct you u = DUMMY; - -NEARDATA struct obj *invent = (struct obj *)0, - *uwep = (struct obj *)0, *uarm = (struct obj *)0, - *uswapwep = (struct obj *)0, - *uquiver = (struct obj *)0, /* quiver */ -#ifdef TOURIST - *uarmu = (struct obj *)0, /* under-wear, so to speak */ -#endif - *uskin = (struct obj *)0, /* dragon armor, if a dragon */ - *uarmc = (struct obj *)0, *uarmh = (struct obj *)0, - *uarms = (struct obj *)0, *uarmg = (struct obj *)0, - *uarmf = (struct obj *)0, *uamul = (struct obj *)0, - *uright = (struct obj *)0, - *uleft = (struct obj *)0, - *ublindf = (struct obj *)0, -#ifdef STEED - *usaddle = (struct obj *)0, -#endif - *uchain = (struct obj *)0, - *uball = (struct obj *)0; - -#ifdef TEXTCOLOR -/* - * This must be the same order as used for buzz() in zap.c. - */ -const int zapcolors[NUM_ZAP] = { - HI_ZAP, /* 0 - missile */ - CLR_ORANGE, /* 1 - fire */ - CLR_WHITE, /* 2 - frost */ - HI_ZAP, /* 3 - sleep */ - CLR_BLACK, /* 4 - death */ - CLR_WHITE, /* 5 - lightning */ - CLR_YELLOW, /* 6 - poison gas */ - CLR_GREEN, /* 7 - acid */ -}; -#endif /* text color */ - -const int shield_static[SHIELD_COUNT] = { - S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, /* 7 per row */ - S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, - S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4, -}; - -NEARDATA struct spell spl_book[MAXSPELL + 1] = {DUMMY}; - -NEARDATA struct tech tech_list[MAXTECH + 1] = {DUMMY}; - -NEARDATA long moves = 1L, monstermoves = 1L; - /* These diverge when player is Fast or Very_fast */ -NEARDATA long wailmsg = 0L; - -/* objects that are moving to another dungeon level */ -NEARDATA struct obj *migrating_objs = (struct obj *)0; -/* objects not yet paid for */ -NEARDATA struct obj *billobjs = (struct obj *)0; - -/* used to zero all elements of a struct obj */ -NEARDATA struct obj zeroobj = DUMMY; - -/* used as an address returned by getobj() */ -NEARDATA struct obj thisplace = DUMMY; - -/* originally from dog.c */ -NEARDATA char dogname[PL_PSIZ] = DUMMY; -NEARDATA char catname[PL_PSIZ] = DUMMY; -NEARDATA char ghoulname[PL_PSIZ] = DUMMY; -NEARDATA char horsename[PL_PSIZ] = DUMMY; -NEARDATA char wolfname[PL_PSIZ] = DUMMY; -#if 0 -NEARDATA char batname[PL_PSIZ] = DUMMY; -NEARDATA char snakename[PL_PSIZ] = DUMMY; -NEARDATA char ratname[PL_PSIZ] = DUMMY; -NEARDATA char badgername[PL_PSIZ] = DUMMY; -NEARDATA char reddragonname[PL_PSIZ] = DUMMY; -NEARDATA char whitedragonname[PL_PSIZ] = DUMMY; -#endif -char preferred_pet; /* '\0', 'c', 'd', 'n' (none) */ -/* monsters that went down/up together with @ */ -NEARDATA struct monst *mydogs = (struct monst *)0; -/* monsters that are moving to another dungeon level */ -NEARDATA struct monst *migrating_mons = (struct monst *)0; - -NEARDATA struct mvitals mvitals[NUMMONS]; - -/* originally from end.c */ -#ifdef DUMP_LOG -#ifdef DUMP_FN -char dump_fn[] = DUMP_FN; -#else -char dump_fn[PL_PSIZ] = DUMMY; -#endif -#endif /* DUMP_LOG */ - -NEARDATA struct c_color_names c_color_names = { - "black", "amber", "golden", - "light blue", "red", "green", - "silver", "blue", "purple", - "white" -}; - -const char *c_obj_colors[] = { - "black", /* CLR_BLACK */ - "red", /* CLR_RED */ - "green", /* CLR_GREEN */ - "brown", /* CLR_BROWN */ - "blue", /* CLR_BLUE */ - "magenta", /* CLR_MAGENTA */ - "cyan", /* CLR_CYAN */ - "gray", /* CLR_GRAY */ - "transparent", /* no_color */ - "orange", /* CLR_ORANGE */ - "bright green", /* CLR_BRIGHT_GREEN */ - "yellow", /* CLR_YELLOW */ - "bright blue", /* CLR_BRIGHT_BLUE */ - "bright magenta", /* CLR_BRIGHT_MAGENTA */ - "bright cyan", /* CLR_BRIGHT_CYAN */ - "white", /* CLR_WHITE */ -}; - -#ifdef MENU_COLOR -struct menucoloring *menu_colorings = 0; -#endif - -struct c_common_strings c_common_strings = { - "Nothing happens.", "That's enough tries!", - "That is a silly thing to %s.", "shudder for a moment.", - "something", "Something", "You can move again.", "Never mind.", - "vision quickly clears.", {"the", "your"} -}; - -/* NOTE: the order of these words exactly corresponds to the - order of oc_material values #define'd in objclass.h. */ -const char *materialnm[] = { - "mysterious", "liquid", "wax", "organic", "flesh", - "paper", "cloth", "leather", "wooden", "bone", "dragonhide", - "iron", "metal", "copper", "silver", "gold", "platinum", "mithril", - "plastic", "glass", "gemstone", "stone" -}; - -/* Vision */ -NEARDATA boolean vision_full_recalc = 0; -NEARDATA char **viz_array = 0;/* used in cansee() and couldsee() macros */ - -/* Global windowing data, defined here for multi-window-system support */ -NEARDATA winid WIN_MESSAGE = WIN_ERR, WIN_STATUS = WIN_ERR; -NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR; -char toplines[TBUFSZ]; -/* Windowing stuff that's really tty oriented, but present for all ports */ -struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 }; /* AS,AE, LI,CO */ - -struct authentication authentication = { "", "" }; - -struct tileset tilesets[MAXNOTILESETS]; -int no_tilesets = 0; -struct tileset def_tilesets[] = { -#if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GTK_GRAPHICS) || \ - defined(GNOME_GRAPHICS) || defined(GL_GRAPHICS) || defined(SDL_GRAPHICS) - { "Small tiles", "x11tiles", 0 }, - { "Big tiles", "x11bigtiles", TILESET_TRANSPARENT }, -#endif -#if defined(GTK_GRAPHICS) - { "Big 3D tiles", "x11big3dtiles", TILESET_TRANSPARENT | TILESET_PSEUDO3D }, -#endif -#if defined(GEM_GRAPHICS) - { "Monochrome tiles", "nh2.img", 0 }, - { "Colour tiles", "nh16.img", 0 }, -#endif -#if defined(MSDOS) - { "Planer style tiles", "slashem1.tib", 0 }, -#endif -#if defined(ALLEG_FX) - { "Small tiles", "slam16.bmp", 0 }, - { "Big tiles", "slam32.bmp", TILESET_TRANSPARENT }, - { "Big 3D tiles", "slam3D.bmp", TILESET_TRANSPARENT | TILESET_PSEUDO3D }, -#endif - { "", "", 0, } -}; - -char tileset[PL_PSIZ] = DUMMY; - -char *fqn_prefix[PREFIX_COUNT] = { (char *)0, (char *)0, (char *)0, (char *)0, - (char *)0, (char *)0, (char *)0, (char *)0, (char *)0 }; - -#ifdef PREFIXES_IN_USE -char *fqn_prefix_names[PREFIX_COUNT] = { "hackdir", "leveldir", "savedir", - "bonesdir", "datadir", "scoredir", - "lockdir", "configdir", "troubledir" }; -#endif - -/* dummy routine used to force linkage */ -void -decl_init() -{ - return; -} - -/*decl.c*/ diff -Naurbd slashem-0.0.8E0/src/detect.c slashem-0.0.8E0F1/src/detect.c --- slashem-0.0.8E0/src/detect.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/detect.c 2006-05-15 12:13:10.000000000 +0100 @@ -31,10 +31,19 @@ if (obj->oclass == oclass) return obj; - if (Has_contents(obj)) { + /* + * Pills inside medical kits are specially handled (see apply.c). + * We don't want them to detect as food because then they will be + * shown as pink pills, which are something quite different. In + * practice the only other possible contents of medical kits are + * bandages and phials, neither of which is detectable by any + * means so we can simply avoid looking in medical kits. + */ + if (Has_contents(obj) && obj->otyp != MEDICAL_KIT) { for (otmp = obj->cobj; otmp; otmp = otmp->nobj) if (otmp->oclass == oclass) return otmp; - else if (Has_contents(otmp) && (temp = o_in(otmp, oclass))) + else if (Has_contents(otmp) && otmp->otyp != MEDICAL_KIT && + (temp = o_in(otmp, oclass))) return temp; } return (struct obj *) 0; diff -Naurbd slashem-0.0.8E0/src/dig.c slashem-0.0.8E0F1/src/dig.c --- slashem-0.0.8E0/src/dig.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/dig.c 2006-05-15 12:13:10.000000000 +0100 @@ -463,7 +463,7 @@ if(!did_dig_msg) { #ifdef LIGHTSABERS if (is_lightsaber(uwep)) You("burn steadily through %s.", - d_target[dig_target]); + the(d_target[dig_target])); else #endif You("hit the %s with all your might.", diff -Naurbd slashem-0.0.8E0/src/display.c.orig slashem-0.0.8E0F1/src/display.c.orig --- slashem-0.0.8E0/src/display.c.orig 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/display.c.orig 1970-01-01 01:00:00.000000000 +0100 @@ -1,2508 +0,0 @@ -/* SCCS Id: @(#)display.c 3.4 2003/02/19 */ -/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ -/* and Dave Cohrs, 1990. */ -/* NetHack may be freely redistributed. See license for details. */ - -/* - * THE NEW DISPLAY CODE - * - * The old display code has been broken up into three parts: vision, display, - * and drawing. Vision decides what locations can and cannot be physically - * seen by the hero. Display decides _what_ is displayed at a given location. - * Drawing decides _how_ to draw a monster, fountain, sword, etc. - * - * The display system uses information from the vision system to decide - * what to draw at a given location. The routines for the vision system - * can be found in vision.c and vision.h. The routines for display can - * be found in this file (display.c) and display.h. The drawing routines - * are part of the window port. See doc/window.doc for the drawing - * interface. - * - * The display system deals with an abstraction called a glyph. Anything - * that could possibly be displayed has a unique glyph identifier. - * - * What is seen on the screen is a combination of what the hero remembers - * and what the hero currently sees. Objects and dungeon features (walls - * doors, etc) are remembered when out of sight. Monsters and temporary - * effects are not remembered. Each location on the level has an - * associated glyph. This is the hero's _memory_ of what he or she has - * seen there before. - * - * Display rules: - * - * If the location is in sight, display in order: - * visible (or sensed) monsters - * visible objects - * known traps - * background - * - * If the location is out of sight, display in order: - * sensed monsters (telepathy) - * memory - * - * - * - * Here is a list of the major routines in this file to be used externally: - * - * newsym - * - * Possibly update the screen location (x,y). This is the workhorse routine. - * It is always correct --- where correct means following the in-sight/out- - * of-sight rules. **Most of the code should use this routine.** This - * routine updates the map and displays monsters. - * - * - * map_background - * map_object - * map_trap - * map_invisible - * unmap_object - * - * If you absolutely must override the in-sight/out-of-sight rules, there - * are two possibilities. First, you can mess with vision to force the - * location in sight then use newsym(), or you can use the map_* routines. - * The first has not been tried [no need] and the second is used in the - * detect routines --- detect object, magic mapping, etc. The map_* - * routines *change* what the hero remembers. All changes made by these - * routines will be sticky --- they will survive screen redraws. Do *not* - * use these for things that only temporarily change the screen. These - * routines are also used directly by newsym(). unmap_object is used to - * clear a remembered object when/if detection reveals it isn't there. - * - * - * show_glyph - * - * This is direct (no processing in between) buffered access to the screen. - * Temporary screen effects are run through this and its companion, - * flush_screen(). There is yet a lower level routine, print_glyph(), - * but this is unbuffered and graphic dependent (i.e. it must be surrounded - * by graphic set-up and tear-down routines). Do not use print_glyph(). - * - * - * see_monsters - * see_objects - * see_traps - * - * These are only used when something affects all of the monsters or - * objects or traps. For objects and traps, the only thing is hallucination. - * For monsters, there are hallucination and changing from/to blindness, etc. - * - * - * tmp_at - * - * This is a useful interface for displaying temporary items on the screen. - * Its interface is different than previously, so look at it carefully. - * - * - * - * Parts of the rm structure that are used: - * - * typ - What is really there. - * glyph - What the hero remembers. This will never be a monster. - * Monsters "float" above this. - * lit - True if the position is lit. An optimization for - * lit/unlit rooms. - * waslit - True if the position was *remembered* as lit. - * seenv - A vector of bits representing the directions from which the - * hero has seen this position. The vector's primary use is - * determining how walls are seen. E.g. a wall sometimes looks - * like stone on one side, but is seen as a wall from the other. - * Other uses are for unmapping detected objects and felt - * locations, where we need to know if the hero has ever - * seen the location. - * flags - Additional information for the typ field. Different for - * each typ. - * horizontal - Indicates whether the wall or door is horizontal or - * vertical. - */ -#include "hack.h" -#include "region.h" - -STATIC_DCL void FDECL(display_monster,(XCHAR_P,XCHAR_P,struct monst *,int,XCHAR_P)); -STATIC_DCL int FDECL(swallow_to_glyph, (int, int)); -STATIC_DCL void FDECL(display_warning,(struct monst *)); - -STATIC_DCL int FDECL(check_pos, (int, int, int)); -#ifdef WA_VERBOSE -STATIC_DCL boolean FDECL(more_than_one, (int, int, int, int, int)); -#endif -STATIC_DCL int FDECL(set_twall, (int,int, int,int, int,int, int,int)); -STATIC_DCL int FDECL(set_wall, (int, int, int)); -STATIC_DCL int FDECL(set_corn, (int,int, int,int, int,int, int,int)); -STATIC_DCL int FDECL(set_crosswall, (int, int)); -STATIC_DCL void FDECL(set_seenv, (struct rm *, int, int, int, int)); -STATIC_DCL void FDECL(t_warn, (struct rm *)); -STATIC_DCL int FDECL(wall_angle, (struct rm *)); -STATIC_DCL int FDECL(back_to_cmap, (XCHAR_P, XCHAR_P)); - -STATIC_VAR boolean transp; /* cached transparency flag for current tileset */ - -#ifdef INVISIBLE_OBJECTS -/* - * vobj_at() - * - * Returns a pointer to an object if the hero can see an object at the - * given location. This takes care of invisible objects. NOTE, this - * assumes that the hero is not blind and on top of the object pile. - * It does NOT take into account that the location is out of sight, or, - * say, one can see blessed, etc. - */ -struct obj * -vobj_at(x,y) - xchar x,y; -{ - register struct obj *obj = level.objects[x][y]; - - while (obj) { - if (!obj->oinvis || See_invisible) return obj; - obj = obj->nexthere; - } - return ((struct obj *) 0); -} -#endif /* else vobj_at() is defined in display.h */ - -/* - * magic_map_background() - * - * This function is similar to map_background (see below) except we pay - * attention to and correct unexplored, lit ROOM and CORR spots. - */ -void -magic_map_background(x, y, show) - xchar x,y; - int show; -{ - int cmap = back_to_cmap(x,y); /* assumes hero can see x,y */ - struct rm *lev = &levl[x][y]; - - /* - * Correct for out of sight lit corridors and rooms that the hero - * doesn't remember as lit. - */ - if (!cansee(x,y) && !lev->waslit) { - /* Floor spaces are dark if unlit. Corridors are dark if unlit. */ - if (lev->typ == ROOM && cmap == S_room) - cmap = S_stone; - else if (lev->typ == CORR && cmap == S_litcorr) - cmap = S_corr; - } - if (level.flags.hero_memory) -#ifdef DISPLAY_LAYERS - lev->mem_bg = cmap; -#else - lev->glyph = cmap_to_glyph(cmap); -#endif - if (show || transp) show_glyph(x,y, cmap_to_glyph(cmap)); -} - -/* - * The routines map_background(), map_object(), and map_trap() could just - * as easily be: - * - * map_glyph(x,y,glyph,show) - * - * Which is called with the xx_to_glyph() in the call. Then I can get - * rid of 3 routines that don't do very much anyway. And then stop - * having to create fake objects and traps. However, I am reluctant to - * make this change. - */ -/* FIXME: some of these use xchars for x and y, and some use ints. Make - * this consistent. - */ - -/* - * map_background() - * - * Make the real background part of our map. This routine assumes that - * the hero can physically see the location. Update the screen if directed. - */ -void -map_background(x, y, show) - register xchar x,y; - register int show; -{ - register int cmap = back_to_cmap(x,y); - - if (level.flags.hero_memory) -#ifdef DISPLAY_LAYERS - levl[x][y].mem_bg = cmap; -#else - levl[x][y].glyph = cmap_to_glyph(cmap); -#endif - if (show || transp) show_glyph(x,y, cmap_to_glyph(cmap)); -} - -/* - * map_trap() - * - * Map the trap and print it out if directed. This routine assumes that the - * hero can physically see the location. - */ -void -map_trap(trap, show) - register struct trap *trap; - register int show; -{ - register int x = trap->tx, y = trap->ty; - register int cmap = trap_to_cmap(trap); - - if (level.flags.hero_memory) -#ifdef DISPLAY_LAYERS - levl[x][y].mem_trap = 1 + cmap - MAXDCHARS; -#else - levl[x][y].glyph = cmap_to_glyph(cmap); -#endif - if (show || transp) show_glyph(x, y, cmap_to_glyph(cmap)); -} - -/* - * map_object() - * - * Map the given object. This routine assumes that the hero can physically - * see the location of the object. Update the screen if directed. - */ -void -map_object(obj, show) - register struct obj *obj; - register int show; -{ - register int x = obj->ox, y = obj->oy; - register int glyph = obj_to_glyph(obj); - - if (level.flags.hero_memory) -#ifdef DISPLAY_LAYERS - if ((levl[x][y].mem_corpse = glyph_is_body(glyph))) - levl[x][y].mem_obj = 1 + glyph_to_body(glyph); - else - levl[x][y].mem_obj = 1 + glyph_to_obj(glyph); -#else - levl[x][y].glyph = glyph; -#endif - if (show) show_glyph(x, y, glyph); -} - -/* - * map_invisible() - * - * Make the hero remember that a square contains an invisible monster. - * This is a special case in that the square will continue to be displayed - * this way even when the hero is close enough to see it. To get rid of - * this and display the square's actual contents, use unmap_object() followed - * by newsym() if necessary. - */ -void -map_invisible(x, y) -register xchar x, y; -{ - if (x != u.ux || y != u.uy) { /* don't display I at hero's location */ - if (level.flags.hero_memory) -#ifdef DISPLAY_LAYERS - levl[x][y].mem_invis = 1; -#else - levl[x][y].glyph = GLYPH_INVISIBLE; -#endif - show_glyph(x, y, GLYPH_INVISIBLE); - } -} - -/* - * unmap_object() - * - * Remove something from the map when the hero realizes it's not there any - * more. Replace it with background or known trap, but not with any other - * If this is used for detection, a full screen update is imminent anyway; - * if this is used to get rid of an invisible monster notation, we might have - * to call newsym(). - */ -void -unmap_object(x, y) - register int x, y; -{ -#ifndef DISPLAY_LAYERS - register struct trap *trap; -#endif - - if (!level.flags.hero_memory) return; - -#ifdef DISPLAY_LAYERS - levl[x][y].mem_invis = levl[x][y].mem_corpse = levl[x][y].mem_obj = 0; -#else - if ((trap = t_at(x,y)) != 0 && trap->tseen && !covers_traps(x,y)) - map_trap(trap, 0); - else if (levl[x][y].seenv) { - struct rm *lev = &levl[x][y]; - - map_background(x, y, 0); - - /* turn remembered dark room squares dark */ - if (!lev->waslit && lev->glyph == cmap_to_glyph(S_room) && - lev->typ == ROOM) - lev->glyph = cmap_to_glyph(S_stone); - } else - levl[x][y].glyph = cmap_to_glyph(S_stone); /* default val */ -#endif -} - -#define DETECTED 2 -#define PHYSICALLY_SEEN 1 -#define is_worm_tail(mon) ((mon) && ((x != (mon)->mx) || (y != (mon)->my))) - -/* - * map_location() - * - * Make whatever at this location show up. This is only for non-living - * things. This will not handle feeling invisible objects correctly. - * - * Internal to display.c, this is a #define for speed. - */ -#ifdef DISPLAY_LAYERS -#define _map_location(x,y,show) \ -{ \ - register struct obj *obj; \ - register struct trap *trap; \ - \ - if (level.flags.hero_memory) { \ - if ((obj = vobj_at(x, y)) && !covers_objects(x, y)) \ - map_object(obj, FALSE); \ - else \ - levl[x][y].mem_corpse = levl[x][y].mem_obj = 0; \ - if ((trap = t_at(x, y)) && trap->tseen && !covers_traps(x, y)) \ - map_trap(trap, FALSE); \ - else \ - levl[x][y].mem_trap = 0; \ - map_background(x, y, FALSE); \ - if (show) show_glyph(x, y, memory_glyph(x, y)); \ - } else if ((obj = vobj_at(x,y)) && !covers_objects(x,y)) \ - map_object(obj,show); \ - else if ((trap = t_at(x,y)) && trap->tseen && !covers_traps(x,y)) \ - map_trap(trap,show); \ - else \ - map_background(x,y,show); \ -} -#else /* DISPLAY_LAYERS */ -#define _map_location(x,y,show) \ -{ \ - register struct obj *obj; \ - register struct trap *trap; \ - \ - if ((obj = vobj_at(x,y)) && !covers_objects(x,y)) \ - map_object(obj,show); \ - else if ((trap = t_at(x,y)) && trap->tseen && !covers_traps(x,y)) \ - map_trap(trap,show); \ - else \ - map_background(x,y,show); \ -} -#endif /* DISPLAY_LAYERS */ - -void -map_location(x,y,show) - int x, y, show; -{ - _map_location(x,y,show); -} - -int memory_glyph(x, y) - int x, y; -{ -#ifdef DISPLAY_LAYERS - if (levl[x][y].mem_invis) - return GLYPH_INVISIBLE; - else if (levl[x][y].mem_obj) - if (levl[x][y].mem_corpse) - return body_to_glyph(levl[x][y].mem_obj - 1); - else - return objnum_to_glyph(levl[x][y].mem_obj - 1); - else if (levl[x][y].mem_trap) - return cmap_to_glyph(levl[x][y].mem_trap - 1 + MAXDCHARS); - else - return cmap_to_glyph(levl[x][y].mem_bg); -#else - return levl[x][y].glyph; -#endif -} - -void clear_memory_glyph(x, y, to) - int x, y, to; -{ -#ifdef DISPLAY_LAYERS - levl[x][y].mem_bg = to; - levl[x][y].mem_trap = 0; - levl[x][y].mem_obj = 0; - levl[x][y].mem_corpse = 0; - levl[x][y].mem_invis = 0; -#else - levl[x][y].glyph = cmap_to_glyph(to); -#endif -} - -/* - * display_monster() - * - * Note that this is *not* a map_XXXX() function! Monsters sort of float - * above everything. - * - * Yuck. Display body parts by recognizing that the display position is - * not the same as the monster position. Currently the only body part is - * a worm tail. - * - */ -STATIC_OVL void -display_monster(x, y, mon, sightflags, worm_tail) - register xchar x, y; /* display position */ - register struct monst *mon; /* monster to display */ - int sightflags; /* 1 if the monster is physically seen */ - /* 2 if detected using Detect_monsters */ - register xchar worm_tail; /* mon is actually a worm tail */ -{ - register boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING); - register int sensed = mon_mimic && - (Protection_from_shape_changers || sensemon(mon)); - /* - * We must do the mimic check first. If the mimic is mimicing something, - * and the location is in sight, we have to change the hero's memory - * so that when the position is out of sight, the hero remembers what - * the mimic was mimicing. - */ - - if (mon_mimic && (sightflags == PHYSICALLY_SEEN)) { - switch (mon->m_ap_type) { - default: - impossible("display_monster: bad m_ap_type value [ = %d ]", - (int) mon->m_ap_type); - case M_AP_NOTHING: - show_glyph(x, y, mon_to_glyph(mon)); - break; - - case M_AP_FURNITURE: { - /* - * This is a poor man's version of map_background(). I can't - * use map_background() because we are overriding what is in - * the 'typ' field. Maybe have map_background()'s parameters - * be (x,y,glyph) instead of just (x,y). - * - * mappearance is currently set to an S_ index value in - * makemon.c. - */ - register int glyph = cmap_to_glyph(mon->mappearance); -#ifdef DISPLAY_LAYERS - levl[x][y].mem_bg = mon->mappearance; -#else - levl[x][y].glyph = glyph; -#endif - if (!sensed) show_glyph(x,y, glyph); - break; - } - - case M_AP_OBJECT: { - struct obj obj; /* Make a fake object to send */ - /* to map_object(). */ - obj.ox = x; - obj.oy = y; - obj.otyp = mon->mappearance; - obj.corpsenm = PM_TENGU; /* if mimicing a corpse */ - map_object(&obj,!sensed); - break; - } - - case M_AP_MONSTER: - show_glyph(x,y, monnum_to_glyph(what_mon((int)mon->mappearance))); - break; - } - - } - - /* If the mimic is unsucessfully mimicing something, display the monster */ - if (!mon_mimic || sensed) { - int num; - - /* [ALI] Only use detected glyphs when monster wouldn't be - * visible by any other means. - */ - if (sightflags == DETECTED) { - if (worm_tail) - num = detected_monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)); - else - num = detected_mon_to_glyph(mon); - } else if (mon->mtame && !Hallucination) { - if (worm_tail) - num = petnum_to_glyph(PM_LONG_WORM_TAIL); - else - num = pet_to_glyph(mon); - } else { - if (worm_tail) - num = monnum_to_glyph(what_mon(PM_LONG_WORM_TAIL)); - else - num = mon_to_glyph(mon); - } - show_glyph(x,y,num); - } -} -/* - * display_warning() - * - * This is also *not* a map_XXXX() function! Monster warnings float - * above everything just like monsters do, but only if the monster - * is not showing. - * - * Do not call for worm tails. - */ -STATIC_OVL void -display_warning(mon) - register struct monst *mon; -{ - int x = mon->mx, y = mon->my; - int wl = (int) (mon->m_lev / 4); - int glyph; - - if (mon_warning(mon)) { - if (wl > WARNCOUNT - 1) wl = WARNCOUNT - 1; - /* 3.4.1: this really ought to be rn2(WARNCOUNT), but value "0" - isn't handled correctly by the what_is routine so avoid it */ - if (Hallucination) wl = rn1(WARNCOUNT-1,1); - glyph = warning_to_glyph(wl); - } else if (MATCH_WARN_OF_MON(mon)) { - glyph = mon_to_glyph(mon); - } else { - impossible("display_warning did not match warning type?"); - return; - } - show_glyph(x, y, glyph); -} - -/* - * feel_location() - * - * Feel the given location. This assumes that the hero is blind and that - * the given position is either the hero's or one of the eight squares - * adjacent to the hero (except for a boulder push). - */ -void -feel_location(x, y) - xchar x, y; -{ - struct rm *lev = &(levl[x][y]); - struct obj *boulder; - register struct monst *mon; - - /* If the hero's memory of an invisible monster is accurate, we want to keep - * him from detecting the same monster over and over again on each turn. - * We must return (so we don't erase the monster). (We must also, in the - * search function, be sure to skip over previously detected 'I's.) - */ - if (memory_is_invisible(x,y) && m_at(x,y)) return; - - /* The hero can't feel non pool locations while under water. */ - if (Underwater && !Is_waterlevel(&u.uz) && ! is_pool(x,y)) - return; - - /* Set the seen vector as if the hero had seen it. It doesn't matter */ - /* if the hero is levitating or not. */ - set_seenv(lev, u.ux, u.uy, x, y); - - if (Levitation && !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz)) { - /* - * Levitation Rules. It is assumed that the hero can feel the state - * of the walls around herself and can tell if she is in a corridor, - * room, or doorway. Boulders are felt because they are large enough. - * Anything else is unknown because the hero can't reach the ground. - * This makes things difficult. - * - * Check (and display) in order: - * - * + Stone, walls, and closed doors. - * + Boulders. [see a boulder before a doorway] - * + Doors. - * + Room/water positions - * + Everything else (hallways!) - */ - if (IS_ROCK(lev->typ) || (IS_DOOR(lev->typ) && - (lev->doormask & (D_LOCKED | D_CLOSED)))) { - map_background(x, y, 1); - } else if ((boulder = sobj_at(BOULDER,x,y)) != 0) { - map_object(boulder, 1); - } else if (IS_DOOR(lev->typ)) { - map_background(x, y, 1); - } else if (IS_ROOM(lev->typ) || IS_POOL(lev->typ)) { - /* - * An open room or water location. Normally we wouldn't touch - * this, but we have to get rid of remembered boulder symbols. - * This will only occur in rare occations when the hero goes - * blind and doesn't find a boulder where expected (something - * came along and picked it up). We know that there is not a - * boulder at this location. Show fountains, pools, etc. - * underneath if already seen. Otherwise, show the appropriate - * floor symbol. - * - * Similarly, if the hero digs a hole in a wall or feels a location - * that used to contain an unseen monster. In these cases, - * there's no reason to assume anything was underneath, so - * just show the appropriate floor symbol. If something was - * embedded in the wall, the glyph will probably already - * reflect that. Don't change the symbol in this case. - * - * This isn't quite correct. If the boulder was on top of some - * other objects they should be seen once the boulder is removed. - * However, we have no way of knowing that what is there now - * was there then. So we let the hero have a lapse of memory. - * We could also just display what is currently on the top of the - * object stack (if anything). - */ - if (remembered_object(x, y) == BOULDER) { - if (lev->typ != ROOM && lev->seenv) { - map_background(x, y, 1); - } else { -#ifdef DISPLAY_LAYERS - lev->mem_bg = lev->waslit ? S_room : S_stone; -#else - lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : - cmap_to_glyph(S_stone); -#endif - show_glyph(x, y, memory_glyph(x, y)); - } -#ifdef DISPLAY_LAYERS - } else if ((lev->mem_bg >= S_stone && lev->mem_bg < S_room) || - memory_is_invisible(x, y)) { - lev->mem_bg = lev->waslit ? S_room : S_stone; -#else - } else if ((lev->glyph >= cmap_to_glyph(S_stone) && - lev->glyph < cmap_to_glyph(S_room)) || - glyph_is_invisible(levl[x][y].glyph)) { - lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : - cmap_to_glyph(S_stone); -#endif - show_glyph(x, y, memory_glyph(x, y)); - } - } else { - /* We feel it (I think hallways are the only things left). */ - map_background(x, y, 1); - /* Corridors are never felt as lit (unless remembered that way) */ - /* (lit_corridor only). */ -#ifdef DISPLAY_LAYERS - if (lev->typ == CORR && lev->mem_bg == S_litcorr && !lev->waslit) - show_glyph(x, y, cmap_to_glyph(lev->mem_bg = S_corr)); -#else - if (lev->typ == CORR && - lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit) - show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr)); -#endif - } - } else { - _map_location(x, y, 1); - - if (Punished) { - /* - * A ball or chain is only felt if it is first on the object - * location list. Otherwise, we need to clear the felt bit --- - * something has been dropped on the ball/chain. If the bit is - * not cleared, then when the ball/chain is moved it will drop - * the wrong glyph. - */ - if (uchain->ox == x && uchain->oy == y) { - if (level.objects[x][y] == uchain) - u.bc_felt |= BC_CHAIN; - else - u.bc_felt &= ~BC_CHAIN; /* do not feel the chain */ - } - if (!carried(uball) && uball->ox == x && uball->oy == y) { - if (level.objects[x][y] == uball) - u.bc_felt |= BC_BALL; - else - u.bc_felt &= ~BC_BALL; /* do not feel the ball */ - } - } - - /* Floor spaces are dark if unlit. Corridors are dark if unlit. */ -#ifdef DISPLAY_LAYERS - if (lev->typ == ROOM && lev->mem_bg == S_room && !lev->waslit) { - lev->mem_bg = S_stone; - show_glyph(x,y, memory_glyph(x, y)); - } else if (lev->typ == CORR && - lev->mem_bg == S_litcorr && !lev->waslit) { - lev->mem_bg = S_corr; - show_glyph(x,y, memory_glyph(x, y)); - } -#else - if (lev->typ == ROOM && - lev->glyph == cmap_to_glyph(S_room) && !lev->waslit) - show_glyph(x,y, lev->glyph = cmap_to_glyph(S_stone)); - else if (lev->typ == CORR && - lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit) - show_glyph(x,y, lev->glyph = cmap_to_glyph(S_corr)); -#endif - } - /* draw monster on top if we can sense it */ - if ((x != u.ux || y != u.uy) && (mon = m_at(x,y)) && sensemon(mon)) - display_monster(x, y, mon, - (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)) ? PHYSICALLY_SEEN : DETECTED, - is_worm_tail(mon)); -} - -/* - * newsym() - * - * Possibly put a new glyph at the given location. - */ -void -newsym(x,y) - register int x,y; -{ - register struct monst *mon; - register struct rm *lev = &(levl[x][y]); - register int see_it; - register xchar worm_tail; - - if (in_mklev) return; - - /* only permit updating the hero when swallowed */ - if (u.uswallow) { - if (x == u.ux && y == u.uy) display_self(); - return; - } - if (Underwater && !Is_waterlevel(&u.uz)) { - /* don't do anything unless (x,y) is an adjacent underwater position */ - int dx, dy; - if (!is_pool(x,y)) return; - dx = x - u.ux; if (dx < 0) dx = -dx; - dy = y - u.uy; if (dy < 0) dy = -dy; - if (dx > 1 || dy > 1) return; - } - - /* Can physically see the location. */ - if (cansee(x,y)) { - NhRegion* reg = visible_region_at(x,y); - /* - * Don't use templit here: E.g. - * - * lev->waslit = !!(lev->lit || templit(x,y)); - * - * Otherwise we have the "light pool" problem, where non-permanently - * lit areas just out of sight stay remembered as lit. They should - * re-darken. - * - * Perhaps ALL areas should revert to their "unlit" look when - * out of sight. - */ - lev->waslit = (lev->lit!=0); /* remember lit condition */ - - if (reg != NULL && ACCESSIBLE(lev->typ)) { - show_region(reg,x,y); - return; - } - if (x == u.ux && y == u.uy) { - if (senseself()) { - _map_location(x,y,0); /* map *under* self */ - display_self(); - } else - /* we can see what is there */ - _map_location(x,y,1); - } - else { - mon = m_at(x,y); - worm_tail = is_worm_tail(mon); - see_it = mon && (worm_tail - ? (!mon->minvis || See_invisible) - : (mon_visible(mon)) || tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)); - if (mon && (see_it || (!worm_tail && Detect_monsters))) { - if (mon->mtrapped) { - struct trap *trap = t_at(x, y); - int tt = trap ? trap->ttyp : NO_TRAP; - - /* if monster is in a physical trap, you see the trap too */ - if (tt == BEAR_TRAP || tt == PIT || - tt == SPIKED_PIT ||tt == WEB) { - trap->tseen = TRUE; - } - } - _map_location(x,y,0); /* map under the monster */ - /* also gets rid of any invisibility glyph */ - display_monster(x, y, mon, see_it? PHYSICALLY_SEEN : DETECTED, worm_tail); - } - else if (mon && mon_warning(mon) && !is_worm_tail(mon)) - display_warning(mon); - else if (memory_is_invisible(x,y)) - map_invisible(x, y); - else - _map_location(x,y,1); /* map the location */ - } - } - - /* Can't see the location. */ - else { - if (x == u.ux && y == u.uy) { - feel_location(u.ux, u.uy); /* forces an update */ - - if (senseself()) display_self(); - } - else if ((mon = m_at(x,y)) - && ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon) - || (see_with_infrared(mon) && mon_visible(mon)))) - || Detect_monsters) - && !is_worm_tail(mon)) { - /* Monsters are printed every time. */ - /* This also gets rid of any invisibility glyph */ - display_monster(x, y, mon, see_it ? 0 : DETECTED, 0); - } - else if ((mon = m_at(x,y)) && mon_warning(mon) && - !is_worm_tail(mon)) { - display_warning(mon); - } - - /* - * If the location is remembered as being both dark (waslit is false) - * and lit (glyph is a lit room or lit corridor) then it was either: - * - * (1) A dark location that the hero could see through night - * vision. - * - * (2) Darkened while out of the hero's sight. This can happen - * when cursed scroll of light is read. - * - * In either case, we have to manually correct the hero's memory to - * match waslit. Deciding when to change waslit is non-trivial. - * - * Note: If flags.lit_corridor is set, then corridors act like room - * squares. That is, they light up if in night vision range. - * If flags.lit_corridor is not set, then corridors will - * remain dark unless lit by a light spell and may darken - * again, as discussed above. - * - * These checks and changes must be here and not in back_to_glyph(). - * They are dependent on the position being out of sight. - */ - else if (!lev->waslit) { -#ifdef DISPLAY_LAYERS - if (lev->mem_bg == S_litcorr && lev->typ == CORR) { - lev->mem_bg = S_corr; - show_glyph(x, y, memory_glyph(x, y)); - } else if (lev->mem_bg == S_room && lev->typ == ROOM) { - lev->mem_bg = S_stone; - show_glyph(x, y, memory_glyph(x, y)); - } -#else /* DISPLAY_LAYERS */ - if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR) - show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr)); - else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM) - show_glyph(x, y, lev->glyph = cmap_to_glyph(S_stone)); -#endif /* DISPLAY_LAYERS */ - else - goto show_mem; - } else { -show_mem: - show_glyph(x, y, memory_glyph(x, y)); - } - } -} - -#undef is_worm_tail - -/* - * shieldeff() - * - * Put magic shield pyrotechnics at the given location. This *could* be - * pulled into a platform dependent routine for fancier graphics if desired. - */ -void -shieldeff(x,y) - xchar x,y; -{ - register int i; - - if (!flags.sparkle) return; - if (cansee(x,y)) { /* Don't see anything if can't see the location */ -#ifdef ALLEG_FX - if (iflags.usealleg) { - newsym(x,y); - if(alleg_shield(x,y)) - return; - } -#endif - for (i = 0; i < SHIELD_COUNT; i++) { - show_glyph(x, y, cmap_to_glyph(shield_static[i])); - flush_screen(1); /* make sure the glyph shows up */ - delay_output(); - } - newsym(x,y); /* restore the old information */ - } -} - - -/* - * tmp_at() - * - * Temporarily place glyphs on the screen. Do not call delay_output(). It - * is up to the caller to decide if it wants to wait [presently, everyone - * but explode() wants to delay]. - * - * Call: - * (DISP_BEAM, glyph) open, initialize glyph - * (DISP_BEAM_ALWAYS, glyph) open, initialize glyph - * (DISP_FLASH, glyph) open, initialize glyph - * (DISP_ALWAYS, glyph) open, initialize glyph - * (DISP_CHANGE, glyph) change glyph - * (DISP_END, 0) close & clean up (second argument doesn't - * matter) - * (DISP_FREEMEM, 0) only used to prevent memory leak during - * exit) - * (x, y) display the glyph at the location - * - * DISP_BEAM - Display the given glyph at each location, but do not erase - * any until the close call. - * WAC added beam_always for lightning strikes - * DISP_BEAM_ALWAYS- Like DISP_BEAM, but vision is not taken into account. - * DISP_FLASH - Display the given glyph at each location, but erase the - * previous location's glyph. - * DISP_ALWAYS- Like DISP_FLASH, but vision is not taken into account. - */ - -static struct tmp_glyph { - coord saved[COLNO]; /* previously updated positions */ - int sidx; /* index of next unused slot in saved[] */ - int style; /* either DISP_BEAM or DISP_FLASH or DISP_ALWAYS */ - int glyph; /* glyph to use when printing */ - struct tmp_glyph *cont; /* Used if saved[] is full */ - struct tmp_glyph *prev; -} tgfirst; -static struct tmp_glyph *tglyph = (struct tmp_glyph *)0; - -void -tmp_at(x, y) - int x, y; -{ - struct tmp_glyph *tmp, *cont; - - switch (x) { - case DISP_BEAM: - case DISP_BEAM_ALWAYS: - case DISP_FLASH: - case DISP_ALWAYS: - if (!tglyph) - tmp = &tgfirst; - else /* nested effect; we need dynamic memory */ - tmp = (struct tmp_glyph *)alloc(sizeof (struct tmp_glyph)); - tmp->prev = tglyph; - tglyph = tmp; - tglyph->sidx = 0; - tglyph->style = x; - tglyph->glyph = y; - tglyph->cont = (struct tmp_glyph *)0; - flush_screen(0); /* flush buffered glyphs */ - return; - case DISP_FREEMEM: /* in case game ends with tmp_at() in progress */ - while (tglyph) { - cont = tglyph->cont; - while (cont) { - tmp = cont->cont; - if (cont != &tgfirst) free((genericptr_t)cont); - cont = tmp; - } - tmp = tglyph->prev; - if (tglyph != &tgfirst) free((genericptr_t)tglyph); - tglyph = tmp; - } - return; - - default: - break; - } - - if (!tglyph) panic("tmp_at: tglyph not initialized"); - - switch (x) { - case DISP_CHANGE: - tglyph->glyph = y; - break; - - case DISP_END: - if (tglyph->style == DISP_BEAM || tglyph->style == DISP_BEAM_ALWAYS) { - register int i; - - /* Erase (reset) from source to end */ - for (i = 0; i < tglyph->sidx; i++) - newsym(tglyph->saved[i].x, tglyph->saved[i].y); - cont = tglyph->cont; - while (cont) { - for (i = 0; i < cont->sidx; i++) - newsym(cont->saved[i].x, cont->saved[i].y); - tmp = cont->cont; - if (cont != &tgfirst) free((genericptr_t)cont); - cont = tmp; - } - /* tglyph->cont = (struct tmp_glyph *)0; */ - } else { /* DISP_FLASH or DISP_ALWAYS */ - if (tglyph->sidx) /* been called at least once */ - newsym(tglyph->saved[0].x, tglyph->saved[0].y); - } - /* tglyph->sidx = 0; -- about to be freed, so not necessary */ - tmp = tglyph->prev; - if (tglyph != &tgfirst) free((genericptr_t)tglyph); - tglyph = tmp; - break; - - default: /* do it */ - if (tglyph->style == DISP_BEAM || tglyph->style == DISP_BEAM_ALWAYS) { - if (!cansee(x,y) && tglyph->style == DISP_BEAM) break; - /* save pos for later erasing */ - if (tglyph->sidx >= SIZE(tglyph->saved)) { - tmp = (struct tmp_glyph *)alloc(sizeof (struct tmp_glyph)); - *tmp = *tglyph; - tglyph->prev = (struct tmp_glyph *)0; - tmp->cont = tglyph; - tglyph = tmp; - tglyph->sidx = 0; - } - tglyph->saved[tglyph->sidx].x = x; - tglyph->saved[tglyph->sidx].y = y; - tglyph->sidx += 1; - } else { /* DISP_FLASH/ALWAYS */ - if (tglyph->sidx) { /* not first call, so reset previous pos */ - newsym(tglyph->saved[0].x, tglyph->saved[0].y); - tglyph->sidx = 0; /* display is presently up to date */ - } - if (!cansee(x,y) && tglyph->style != DISP_ALWAYS) break; - tglyph->saved[0].x = x; - tglyph->saved[0].y = y; - tglyph->sidx = 1; - } - - show_glyph(x, y, tglyph->glyph); /* show it */ - flush_screen(0); /* make sure it shows up */ - break; - } /* end case */ -} - -#ifdef DISPLAY_LAYERS -int -glyph_is_floating(glyph) -int glyph; -{ - return glyph_is_monster(glyph) || glyph_is_explosion(glyph) || - glyph_is_zap_beam(glyph) || glyph_is_swallow(glyph) || - glyph_is_warning(glyph) || tglyph && glyph == tglyph->glyph; -} -#endif - -/* - * swallowed() - * - * The hero is swallowed. Show a special graphics sequence for this. This - * bypasses all of the display routines and messes with buffered screen - * directly. This method works because both vision and display check for - * being swallowed. - */ -void -swallowed(first) - int first; -{ - static xchar lastx, lasty; /* last swallowed position */ - int swallower, left_ok, rght_ok; - - if (first) - cls(); - else { - register int x, y; - - /* Clear old location */ - for (y = lasty-1; y <= lasty+1; y++) - for (x = lastx-1; x <= lastx+1; x++) - if (isok(x,y)) show_glyph(x,y,cmap_to_glyph(S_stone)); - } - -#ifdef ALLEG_FX - if(!iflags.usealleg || !alleg_swallowed(u.ux,u.uy)) { -#endif - swallower = monsndx(u.ustuck->data); - /* assume isok(u.ux,u.uy) */ - left_ok = isok(u.ux-1,u.uy); - rght_ok = isok(u.ux+1,u.uy); - /* - * Display the hero surrounded by the monster's stomach. - */ - if(isok(u.ux, u.uy-1)) { - if (left_ok) - show_glyph(u.ux-1, u.uy-1, swallow_to_glyph(swallower, S_sw_tl)); - show_glyph(u.ux , u.uy-1, swallow_to_glyph(swallower, S_sw_tc)); - if (rght_ok) - show_glyph(u.ux+1, u.uy-1, swallow_to_glyph(swallower, S_sw_tr)); - } - - if (left_ok) - show_glyph(u.ux-1, u.uy , swallow_to_glyph(swallower, S_sw_ml)); - display_self(); - if (rght_ok) - show_glyph(u.ux+1, u.uy , swallow_to_glyph(swallower, S_sw_mr)); - - if(isok(u.ux, u.uy+1)) { - if (left_ok) - show_glyph(u.ux-1, u.uy+1, swallow_to_glyph(swallower, S_sw_bl)); - show_glyph(u.ux , u.uy+1, swallow_to_glyph(swallower, S_sw_bc)); - if (rght_ok) - show_glyph(u.ux+1, u.uy+1, swallow_to_glyph(swallower, S_sw_br)); - } -#ifdef ALLEG_FX - } -#endif - - /* Update the swallowed position. */ - lastx = u.ux; - lasty = u.uy; -} - -/* - * under_water() - * - * Similar to swallowed() in operation. Shows hero when underwater - * except when in water level. Special routines exist for that. - */ -void -under_water(mode) - int mode; -{ - static xchar lastx, lasty; - static boolean dela; - register int x, y; - - /* swallowing has a higher precedence than under water */ - if (Is_waterlevel(&u.uz) || u.uswallow) return; - - /* full update */ - if (mode == 1 || dela) { - cls(); - dela = FALSE; - } - /* delayed full update */ - else if (mode == 2) { - dela = TRUE; - return; - } - /* limited update */ - else { - for (y = lasty-1; y <= lasty+1; y++) - for (x = lastx-1; x <= lastx+1; x++) - if (isok(x,y)) - show_glyph(x,y,cmap_to_glyph(S_stone)); - } - for (x = u.ux-1; x <= u.ux+1; x++) - for (y = u.uy-1; y <= u.uy+1; y++) - if (isok(x,y) && is_pool(x,y)) { - if (Blind && !(x == u.ux && y == u.uy)) - show_glyph(x,y,cmap_to_glyph(S_stone)); - else - newsym(x,y); - } - lastx = u.ux; - lasty = u.uy; -} - -/* - * under_ground() - * - * Very restricted display. You can only see yourself. - */ -void -under_ground(mode) - int mode; -{ - static boolean dela; - - /* swallowing has a higher precedence than under ground */ - if (u.uswallow) return; - - /* full update */ - if (mode == 1 || dela) { - cls(); - dela = FALSE; - } - /* delayed full update */ - else if (mode == 2) { - dela = TRUE; - return; - } - /* limited update */ - else - newsym(u.ux,u.uy); -} - - -/* ========================================================================= */ - -/* - * Loop through all of the monsters and update them. Called when: - * + going blind & telepathic - * + regaining sight & telepathic - * + getting and losing infravision - * + hallucinating - * + doing a full screen redraw - * + see invisible times out or a ring of see invisible is taken off - * + when a potion of see invisible is quaffed or a ring of see - * invisible is put on - * + gaining telepathy when blind [givit() in eat.c, pleased() in pray.c] - * + losing telepathy while blind [xkilled() in mon.c, attrcurse() in - * sit.c] - */ -void -see_monsters() -{ - register struct monst *mon; - - for (mon = fmon; mon; mon = mon->nmon) { - if (DEADMONSTER(mon)) continue; - newsym(mon->mx,mon->my); - if (mon->wormno) see_wsegs(mon); - } -#ifdef STEED - /* when mounted, hero's location gets caught by monster loop */ - if (!u.usteed) -#endif - newsym(u.ux, u.uy); -} - -/* - * Block/unblock light depending on what a mimic is mimicing and if it's - * invisible or not. Should be called only when the state of See_invisible - * changes. - */ -void -set_mimic_blocking() -{ - register struct monst *mon; - - for (mon = fmon; mon; mon = mon->nmon) { - if (DEADMONSTER(mon)) continue; - if (mon->minvis && - ((mon->m_ap_type == M_AP_FURNITURE && - (mon->mappearance == S_vcdoor || mon->mappearance == S_hcdoor)) || - (mon->m_ap_type == M_AP_OBJECT && mon->mappearance == BOULDER))) { - if(See_invisible) - block_point(mon->mx, mon->my); - else - unblock_point(mon->mx, mon->my); - } - } -} - -/* - * Loop through all of the object *locations* and update them. Called when - * + hallucinating. - */ -void -see_objects() -{ - register struct obj *obj; - for(obj = fobj; obj; obj = obj->nobj) - if (vobj_at(obj->ox,obj->oy) == obj) newsym(obj->ox, obj->oy); -} - -/* - * Update hallucinated traps. - */ -void -see_traps() -{ - struct trap *trap; - int glyph; - - for (trap = ftrap; trap; trap = trap->ntrap) { - glyph = glyph_at(trap->tx, trap->ty); - if (glyph_is_trap(glyph)) - newsym(trap->tx, trap->ty); - } -} - -/* - * Put the cursor on the hero. Flush all accumulated glyphs before doing it. - */ -void -curs_on_u() -{ - flush_screen(1); /* Flush waiting glyphs & put cursor on hero */ -} - -int -doredraw() -{ - docrt(); - return 0; -} - -void -docrt() -{ - register int x,y; - register struct rm *lev; - int i, glyph; - - if (!u.ux) return; /* display isn't ready yet */ - - transp = FALSE; - if (tileset[0]) - for(i = 0; i < no_tilesets; ++i) - if (!strcmpi(tileset, tilesets[i].name)) { - transp = !!(tilesets[i].flags & TILESET_TRANSPARENT); - break; - } - - if (u.uswallow) { - swallowed(1); - return; - } - if (Underwater && !Is_waterlevel(&u.uz)) { - under_water(1); - return; - } - if (u.uburied) { - under_ground(1); - return; - } - - /* shut down vision */ - vision_recalc(2); - - /* - * This routine assumes that cls() does the following: - * + fills the physical screen with the symbol for rock - * + clears the glyph buffer - */ - cls(); - - /* display memory */ - for (x = 1; x < COLNO; x++) { - lev = &levl[x][0]; - for (y = 0; y < ROWNO; y++, lev++) - if ((glyph = memory_glyph(x,y)) != cmap_to_glyph(S_stone)) - show_glyph(x,y,glyph); - } - - /* see what is to be seen */ - vision_recalc(0); - - /* overlay with monsters */ - see_monsters(); - - flags.botlx = 1; /* force a redraw of the bottom line */ - -} - - -/* ========================================================================= */ -/* Glyph Buffering (3rd screen) ============================================ */ - -typedef struct { - xchar new; /* perhaps move this bit into the rm strucure. */ - int glyph; -} gbuf_entry; - -static gbuf_entry gbuf[ROWNO][COLNO]; -static char gbuf_start[ROWNO]; -static char gbuf_stop[ROWNO]; - -#ifdef DUMP_LOG -/* D: Added to dump screen to output file */ -STATIC_PTR uchar get_glyph_char(glyph) -int glyph; -{ - uchar ch; - register int offset; - - if (glyph >= NO_GLYPH) - return ; - - /* - * Map the glyph back to a character. - * - * Warning: For speed, this makes an assumption on the order of - * offsets. The order is set in display.h. - */ - if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ - ch = def_warnsyms[offset].sym; - } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ - /* see swallow_to_glyph() in display.c */ - ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym; - } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ - /* see zapdir_to_glyph() in display.c */ - ch = defsyms[S_vbeam + (offset & 0x3)].sym; - } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ - ch = defsyms[offset].sym; - } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */ - ch = def_oc_syms[(int)objects[offset].oc_class]; - } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ - ch = def_monsyms[(int)mons[offset].mlet]; - } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ - ch = def_oc_syms[(int)objects[CORPSE].oc_class]; - } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ - ch = def_monsyms[(int)mons[offset].mlet]; - } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ - ch = DEF_INVISIBLE; - } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ - ch = def_monsyms[(int)mons[offset].mlet]; - } else { /* a monster */ - ch = monsyms[(int)mons[glyph].mlet]; - } - return ch; -} - -#ifdef TTY_GRAPHICS -extern const char * FDECL(compress_str, (const char *)); -#else -const char* -compress_str(str) /* copied from win/tty/wintty.c */ -const char *str; -{ - static char cbuf[BUFSZ]; - /* compress in case line too long */ - if((int)strlen(str) >= 80) { - register const char *bp0 = str; - register char *bp1 = cbuf; - - do { - if(*bp0 != ' ' || bp0[1] != ' ') - *bp1++ = *bp0; - } while(*bp0++); - } else - return str; - return cbuf; -} -#endif /* TTY_GRAPHICS */ - -/* Take a screen dump */ -void dump_screen() -{ - register int x,y; - int lastc; - /* D: botl.c has a closer approximation to the size, but we'll go with - * this */ - char buf[300], *ptr; - - for (y = 0; y < ROWNO; y++) { - lastc = 0; - ptr = buf; - for (x = 1; x < COLNO; x++) { - uchar c = get_glyph_char(gbuf[y][x].glyph); - *ptr++ = c; - if (c != ' ') - lastc = x; - } - buf[lastc] = '\0'; - dump("", buf); - } - dump("", ""); - bot1str(buf); - ptr = (char *) compress_str((const char *) buf); - dump("", ptr); - bot2str(buf); - dump("", buf); - dump("", ""); - dump("", ""); -} -#endif /* DUMP_LOG */ - -/* - * Store the glyph in the 3rd screen for later flushing. - */ -void -show_glyph(x,y,glyph) - int x, y, glyph; -{ - /* - * Check for bad positions and glyphs. - */ - if (!isok(x, y)) { - const char *text; - int offset; - - /* column 0 is invalid, but it's often used as a flag, so ignore it */ - if (x == 0) return; - - /* - * This assumes an ordering of the offsets. See display.h for - * the definition. - */ - - if (glyph >= GLYPH_WARNING_OFF) { /* a warning */ - text = "warning"; offset = glyph - GLYPH_WARNING_OFF; - } else if (glyph >= GLYPH_SWALLOW_OFF) { /* swallow border */ - text = "swallow border"; offset = glyph - GLYPH_SWALLOW_OFF; - } else if (glyph >= GLYPH_ZAP_OFF) { /* zap beam */ - text = "zap beam"; offset = glyph - GLYPH_ZAP_OFF; - } else if (glyph >= GLYPH_EXPLODE_OFF) { /* explosion */ - text = "explosion"; offset = glyph - GLYPH_EXPLODE_OFF; - } else if (glyph >= GLYPH_CMAP_OFF) { /* cmap */ - text = "cmap_index"; offset = glyph - GLYPH_CMAP_OFF; - } else if (glyph >= GLYPH_OBJ_OFF) { /* object */ - text = "object"; offset = glyph - GLYPH_OBJ_OFF; - } else if (glyph >= GLYPH_RIDDEN_OFF) { /* ridden mon */ - text = "ridden mon"; offset = glyph - GLYPH_RIDDEN_OFF; - } else if (glyph >= GLYPH_BODY_OFF) { /* a corpse */ - text = "corpse"; offset = glyph - GLYPH_BODY_OFF; - } else if (glyph >= GLYPH_DETECT_OFF) { /* detected mon */ - text = "detected mon"; offset = glyph - GLYPH_DETECT_OFF; - } else if (glyph >= GLYPH_INVIS_OFF) { /* invisible mon */ - text = "invisible mon"; offset = glyph - GLYPH_INVIS_OFF; - } else if (glyph >= GLYPH_PET_OFF) { /* a pet */ - text = "pet"; offset = glyph - GLYPH_PET_OFF; - } else { /* a monster */ - text = "monster"; offset = glyph; - } - - impossible("show_glyph: bad pos %d %d with glyph %d [%s %d].", - x, y, glyph, text, offset); - return; - } - - if (glyph >= MAX_GLYPH) { - impossible("show_glyph: bad glyph %d [max %d] at (%d,%d).", - glyph, MAX_GLYPH, x, y); - return; - } - - /* [ALI] In transparent mode it is not sufficient just to consider - * the foreground glyph, we also need to consider the background. - * Rather than extend the display module to do this, for the time - * being we just turn off optimization and rely on the windowing port - * to ignore redundant calls to print_glyph(). - */ - if (transp || gbuf[y][x].glyph != glyph) { - gbuf[y][x].glyph = glyph; - gbuf[y][x].new = 1; - if (gbuf_start[y] > x) gbuf_start[y] = x; - if (gbuf_stop[y] < x) gbuf_stop[y] = x; - } -} - - -/* - * Reset the changed glyph borders so that none of the 3rd screen has - * changed. - */ -#define reset_glyph_bbox() \ - { \ - int i; \ - \ - for (i = 0; i < ROWNO; i++) { \ - gbuf_start[i] = COLNO-1; \ - gbuf_stop[i] = 0; \ - } \ - } - - -static gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) }; -/* - * Turn the 3rd screen into stone. - */ -void -clear_glyph_buffer() -{ - register int x, y; - register gbuf_entry *gptr; - - for (y = 0; y < ROWNO; y++) { - gptr = &gbuf[y][0]; - for (x = COLNO; x; x--) { - *gptr++ = nul_gbuf; - } - } - reset_glyph_bbox(); -} - -/* - * Assumes that the indicated positions are filled with S_stone glyphs. - */ -void -row_refresh(start,stop,y) - int start,stop,y; -{ - register int x; - - for (x = start; x <= stop; x++) - if (gbuf[y][x].glyph != cmap_to_glyph(S_stone)) - print_glyph(WIN_MAP,x,y,gbuf[y][x].glyph); -} - -void -cls() -{ - display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */ - flags.botlx = 1; /* force update of botl window */ - clear_nhwindow(WIN_MAP); /* clear physical screen */ - clear_glyph_buffer(); /* this is sort of an extra effort, but OK */ -} - -/* - * Synch the third screen with the display. - */ -void -flush_screen(cursor_on_u) - int cursor_on_u; -{ - /* Prevent infinite loops on errors: - * flush_screen->print_glyph->impossible->pline->flush_screen - */ - static boolean flushing = 0; - static boolean delay_flushing = 0; - register int x,y; - - if (cursor_on_u == -1) delay_flushing = !delay_flushing; - if (delay_flushing) return; - if (flushing) return; /* if already flushing then return */ - flushing = 1; - - for (y = 0; y < ROWNO; y++) { - register gbuf_entry *gptr = &gbuf[y][x = gbuf_start[y]]; - for (; x <= gbuf_stop[y]; gptr++, x++) - if (gptr->new) { - print_glyph(WIN_MAP,x,y,gptr->glyph); - gptr->new = 0; - } - } - - if (cursor_on_u) curs(WIN_MAP, u.ux,u.uy); /* move cursor to the hero */ - display_nhwindow(WIN_MAP, FALSE); - reset_glyph_bbox(); -#ifdef ALLEG_FX - if (iflags.usealleg) alleg_vid_refresh(); -#endif - flushing = 0; - if(flags.botl || flags.botlx) bot(); -} - -/* ========================================================================= */ - -/* - * back_to_cmap() - * - * Use the information in the rm structure at the given position to create - * a glyph of a background. - * - * I had to add a field in the rm structure (horizontal) so that we knew - * if open doors and secret doors were horizontal or vertical. Previously, - * the screen symbol had the horizontal/vertical information set at - * level generation time. - * - * I used the 'ladder' field (really doormask) for deciding if stairwells - * were up or down. I didn't want to check the upstairs and dnstairs - * variables. - */ -STATIC_OVL int -back_to_cmap(x,y) - xchar x,y; -{ - int idx; - struct rm *ptr = &(levl[x][y]); - - switch (ptr->typ) { - /* KMH -- support arboreal levels */ - case SCORR: - case STONE: - idx = level.flags.arboreal ? S_tree : S_stone; - break; - case ROOM: idx = S_room; break; - case CORR: - idx = (ptr->waslit || flags.lit_corridor) ? S_litcorr : S_corr; - break; - case HWALL: - case VWALL: - case TLCORNER: - case TRCORNER: - case BLCORNER: - case BRCORNER: - case CROSSWALL: - case TUWALL: - case TDWALL: - case TLWALL: - case TRWALL: - case SDOOR: - idx = ptr->seenv ? wall_angle(ptr) : S_stone; - break; - case IRONBARS: idx = S_bars; break; - case DOOR: - if (ptr->doormask) { - if (ptr->doormask & D_BROKEN) - idx = S_ndoor; - else if (ptr->doormask & D_ISOPEN) - idx = (ptr->horizontal) ? S_hodoor : S_vodoor; - else /* else is closed */ - idx = (ptr->horizontal) ? S_hcdoor : S_vcdoor; - } else - idx = S_ndoor; - break; - case TREE: idx = S_tree; break; - case POOL: - case MOAT: idx = S_pool; break; - case STAIRS: - idx = (ptr->ladder & LA_DOWN) ? S_dnstair : S_upstair; - break; - case LADDER: - idx = (ptr->ladder & LA_DOWN) ? S_dnladder : S_upladder; - break; - case FOUNTAIN: idx = S_fountain; break; - case SINK: idx = S_sink; break; - case TOILET: idx = S_toilet; break; - case GRAVE: idx = S_grave; break; - case ALTAR: idx = S_altar; break; - case THRONE: idx = S_throne; break; - case LAVAPOOL: idx = S_lava; break; - case ICE: idx = S_ice; break; - case AIR: idx = S_air; break; - case CLOUD: idx = S_cloud; break; - case WATER: idx = S_water; break; - case DBWALL: - idx = (ptr->horizontal) ? S_hcdbridge : S_vcdbridge; - break; - case DRAWBRIDGE_UP: - switch(ptr->drawbridgemask & DB_UNDER) { - case DB_MOAT: idx = S_pool; break; - case DB_LAVA: idx = S_lava; break; - case DB_ICE: idx = S_ice; break; - case DB_FLOOR: idx = S_room; break; - default: - impossible("Strange db-under: %d", - ptr->drawbridgemask & DB_UNDER); - idx = S_room; /* something is better than nothing */ - break; - } - break; - case DRAWBRIDGE_DOWN: - idx = (ptr->horizontal) ? S_hodbridge : S_vodbridge; - break; - default: - impossible("back_to_glyph: unknown level type [ = %d ]",ptr->typ); - idx = S_room; - break; - } - return idx; -} - -int -back_to_glyph(x,y) - xchar x,y; -{ - return cmap_to_glyph(back_to_cmap(x,y)); -} - - -/* - * swallow_to_glyph() - * - * Convert a monster number and a swallow location into the correct glyph. - * If you don't want a patchwork monster while hallucinating, decide on - * a random monster in swallowed() and don't use what_mon() here. - */ -STATIC_OVL int -swallow_to_glyph(mnum, loc) - int mnum; - int loc; -{ - if (loc < S_sw_tl || S_sw_br < loc) { - impossible("swallow_to_glyph: bad swallow location"); - loc = S_sw_br; - } - return ((int) (what_mon(mnum)<<3) | (loc - S_sw_tl)) + GLYPH_SWALLOW_OFF; -} - - - -/* - * zapdir_to_glyph() - * - * Change the given zap direction and beam type into a glyph. Each beam - * type has four glyphs, one for each of the symbols below. The order of - * the zap symbols [0-3] as defined in rm.h are: - * - * | S_vbeam ( 0, 1) or ( 0,-1) - * - S_hbeam ( 1, 0) or (-1, 0) - * \ S_lslant ( 1, 1) or (-1,-1) - * / S_rslant (-1, 1) or ( 1,-1) - */ -int -zapdir_to_glyph(dx, dy, beam_type) - register int dx, dy; - int beam_type; -{ - if (beam_type >= NUM_ZAP) { - impossible("zapdir_to_glyph: illegal beam type"); - beam_type = 0; - } - dx = (dx == dy) ? 2 : (dx && dy) ? 3 : dx ? 1 : 0; - - return ((int) ((beam_type << 2) | dx)) + GLYPH_ZAP_OFF; -} - - -/* - * Utility routine for dowhatis() used to find out the glyph displayed at - * the location. This isn't necessarily the same as the glyph in the levl - * structure, so we must check the "third screen". - */ -int -glyph_at(x, y) - xchar x,y; -{ - if(x < 0 || y < 0 || x >= COLNO || y >= ROWNO) - return cmap_to_glyph(S_room); /* XXX */ - return gbuf[y][x].glyph; -} - - -/* ------------------------------------------------------------------------- */ -/* Wall Angle -------------------------------------------------------------- */ - -/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */ - -#ifdef WA_VERBOSE - -static const char *FDECL(type_to_name, (int)); -static void FDECL(error4, (int,int,int,int,int,int)); - -static int bad_count[MAX_TYPE]; /* count of positions flagged as bad */ -static const char *type_names[MAX_TYPE] = { - "STONE", "VWALL", "HWALL", "TLCORNER", - "TRCORNER", "BLCORNER", "BRCORNER", "CROSSWALL", - "TUWALL", "TDWALL", "TLWALL", "TRWALL", - "DBWALL", "SDOOR", "SCORR", "POOL", - "MOAT", "WATER", "DRAWBRIDGE_UP","LAVAPOOL", - "DOOR", "CORR", "ROOM", "STAIRS", - "LADDER", "FOUNTAIN", "THRONE", "SINK", - "ALTAR", "ICE", "DRAWBRIDGE_DOWN","AIR", - "CLOUD" -}; - - -static const char * -type_to_name(type) - int type; -{ - return (type < 0 || type > MAX_TYPE) ? "unknown" : type_names[type]; -} - -STATIC_OVL void -error4(x, y, a, b, c, dd) - int x, y, a, b, c, dd; -{ - pline("set_wall_state: %s @ (%d,%d) %s%s%s%s", - type_to_name(levl[x][y].typ), x, y, - a ? "1":"", b ? "2":"", c ? "3":"", dd ? "4":""); - bad_count[levl[x][y].typ]++; -} -#endif /* WA_VERBOSE */ - -/* - * Return 'which' if position is implies an unfinshed exterior. Return - * zero otherwise. Unfinished implies outer area is rock or a corridor. - * - * Things that are ambigious: lava - */ -STATIC_OVL int -check_pos(x, y, which) - int x, y, which; -{ - int type; - if (!isok(x,y)) return which; - type = levl[x][y].typ; - if (IS_ROCK(type) || type == CORR || type == SCORR) return which; - return 0; -} - -/* Return TRUE if more than one is non-zero. */ -/*ARGSUSED*/ -#ifdef WA_VERBOSE -STATIC_OVL boolean -more_than_one(x, y, a, b, c) - int x, y, a, b, c; -{ -#if defined(MAC_MPW) -# pragma unused ( x,y ) -#endif - if ((a && (b|c)) || (b && (a|c)) || (c && (a|b))) { - error4(x,y,a,b,c,0); - return TRUE; - } - return FALSE; -} -#else -#define more_than_one(x, y, a, b, c) (((a) && ((b)|(c))) || ((b) && ((a)|(c))) || ((c) && ((a)|(b)))) -#endif - -/* Return the wall mode for a T wall. */ -STATIC_OVL int -set_twall(x0,y0, x1,y1, x2,y2, x3,y3) -int x0,y0, x1,y1, x2,y2, x3,y3; -{ - int wmode, is_1, is_2, is_3; - - is_1 = check_pos(x1, y1, WM_T_LONG); - is_2 = check_pos(x2, y2, WM_T_BL); - is_3 = check_pos(x3, y3, WM_T_BR); - if (more_than_one(x0, y0, is_1, is_2, is_3)) { - wmode = 0; - } else { - wmode = is_1 + is_2 + is_3; - } - return wmode; -} - -/* Return wall mode for a horizontal or vertical wall. */ -STATIC_OVL int -set_wall(x, y, horiz) - int x, y, horiz; -{ - int wmode, is_1, is_2; - - if (horiz) { - is_1 = check_pos(x,y-1, WM_W_TOP); - is_2 = check_pos(x,y+1, WM_W_BOTTOM); - } else { - is_1 = check_pos(x-1,y, WM_W_LEFT); - is_2 = check_pos(x+1,y, WM_W_RIGHT); - } - if (more_than_one(x, y, is_1, is_2, 0)) { - wmode = 0; - } else { - wmode = is_1 + is_2; - } - return wmode; -} - -/* - * If an invisible monster has gone away, that will be discovered. If an - * invisible monster has appeared, this will _not_ be discovered since - * searching only finds one monster per turn so we must check that separately. - * - * Return a wall mode for a corner wall. (x4,y4) is the "inner" position. - */ -STATIC_OVL int -set_corn(x1,y1, x2,y2, x3,y3, x4,y4) - int x1, y1, x2, y2, x3, y3, x4, y4; -{ - int wmode, is_1, is_2, is_3, is_4; - - is_1 = check_pos(x1, y1, 1); - is_2 = check_pos(x2, y2, 1); - is_3 = check_pos(x3, y3, 1); - is_4 = check_pos(x4, y4, 1); /* inner location */ - - /* - * All 4 should not be true. So if the inner location is rock, - * use it. If all of the outer 3 are true, use outer. We currently - * can't cover the case where only part of the outer is rock, so - * we just say that all the walls are finished (if not overridden - * by the inner section). - */ - if (is_4) { - wmode = WM_C_INNER; - } else if (is_1 && is_2 && is_3) - wmode = WM_C_OUTER; - else - wmode = 0; /* finished walls on all sides */ - - return wmode; -} - -/* Return mode for a crosswall. */ -STATIC_OVL int -set_crosswall(x, y) - int x, y; -{ - int wmode, is_1, is_2, is_3, is_4; - - is_1 = check_pos(x-1, y-1, 1); - is_2 = check_pos(x+1, y-1, 1); - is_3 = check_pos(x+1, y+1, 1); - is_4 = check_pos(x-1, y+1, 1); - - wmode = is_1+is_2+is_3+is_4; - if (wmode > 1) { - if (is_1 && is_3 && (is_2+is_4 == 0)) { - wmode = WM_X_TLBR; - } else if (is_2 && is_4 && (is_1+is_3 == 0)) { - wmode = WM_X_BLTR; - } else { -#ifdef WA_VERBOSE - error4(x,y,is_1,is_2,is_3,is_4); -#endif - wmode = 0; - } - } else if (is_1) - wmode = WM_X_TL; - else if (is_2) - wmode = WM_X_TR; - else if (is_3) - wmode = WM_X_BR; - else if (is_4) - wmode = WM_X_BL; - - return wmode; -} - -/* Called from mklev. Scan the level and set the wall modes. */ -void -set_wall_state() -{ - int x, y; - int wmode; - struct rm *lev; - -#ifdef WA_VERBOSE - for (x = 0; x < MAX_TYPE; x++) bad_count[x] = 0; -#endif - - for (x = 0; x < COLNO; x++) - for (lev = &levl[x][0], y = 0; y < ROWNO; y++, lev++) { - switch (lev->typ) { - case SDOOR: - wmode = set_wall(x, y, (int) lev->horizontal); - break; - case VWALL: - wmode = set_wall(x, y, 0); - break; - case HWALL: - wmode = set_wall(x, y, 1); - break; - case TDWALL: - wmode = set_twall(x,y, x,y-1, x-1,y+1, x+1,y+1); - break; - case TUWALL: - wmode = set_twall(x,y, x,y+1, x+1,y-1, x-1,y-1); - break; - case TLWALL: - wmode = set_twall(x,y, x+1,y, x-1,y-1, x-1,y+1); - break; - case TRWALL: - wmode = set_twall(x,y, x-1,y, x+1,y+1, x+1,y-1); - break; - case TLCORNER: - wmode = set_corn(x-1,y-1, x,y-1, x-1,y, x+1,y+1); - break; - case TRCORNER: - wmode = set_corn(x,y-1, x+1,y-1, x+1,y, x-1,y+1); - break; - case BLCORNER: - wmode = set_corn(x,y+1, x-1,y+1, x-1,y, x+1,y-1); - break; - case BRCORNER: - wmode = set_corn(x+1,y, x+1,y+1, x,y+1, x-1,y-1); - break; - case CROSSWALL: - wmode = set_crosswall(x, y); - break; - - default: - wmode = -1; /* don't set wall info */ - break; - } - - if (wmode >= 0) - lev->wall_info = (lev->wall_info & ~WM_MASK) | wmode; - } - -#ifdef WA_VERBOSE - /* check if any bad positions found */ - for (x = y = 0; x < MAX_TYPE; x++) - if (bad_count[x]) { - if (y == 0) { - y = 1; /* only print once */ - pline("set_wall_type: wall mode problems with: "); - } - pline("%s %d;", type_names[x], bad_count[x]); - } -#endif /* WA_VERBOSE */ -} - -/* ------------------------------------------------------------------------- */ -/* This matrix is used here and in vision.c. */ -unsigned char seenv_matrix[3][3] = { {SV2, SV1, SV0}, - {SV3, SVALL, SV7}, - {SV4, SV5, SV6} }; - -#define sign(z) ((z) < 0 ? -1 : ((z) > 0 ? 1 : 0)) - -/* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */ -STATIC_OVL void -set_seenv(lev, x0, y0, x, y) - struct rm *lev; - int x0, y0, x, y; /* from, to */ -{ - int dx = x-x0, dy = y0-y; - lev->seenv |= seenv_matrix[sign(dy)+1][sign(dx)+1]; -} - -/* ------------------------------------------------------------------------- */ - -/* T wall types, one for each row in wall_matrix[][]. */ -#define T_d 0 -#define T_l 1 -#define T_u 2 -#define T_r 3 - -/* - * These are the column names of wall_matrix[][]. They are the "results" - * of a tdwall pattern match. All T walls are rotated so they become - * a tdwall. Then we do a single pattern match, but return the - * correct result for the original wall by using different rows for - * each of the wall types. - */ -#define T_stone 0 -#define T_tlcorn 1 -#define T_trcorn 2 -#define T_hwall 3 -#define T_tdwall 4 - -static const int wall_matrix[4][5] = { - { S_stone, S_tlcorn, S_trcorn, S_hwall, S_tdwall }, /* tdwall */ - { S_stone, S_trcorn, S_brcorn, S_vwall, S_tlwall }, /* tlwall */ - { S_stone, S_brcorn, S_blcorn, S_hwall, S_tuwall }, /* tuwall */ - { S_stone, S_blcorn, S_tlcorn, S_vwall, S_trwall }, /* trwall */ -}; - - -/* Cross wall types, one for each "solid" quarter. Rows of cross_matrix[][]. */ -#define C_bl 0 -#define C_tl 1 -#define C_tr 2 -#define C_br 3 - -/* - * These are the column names for cross_matrix[][]. They express results - * in C_br (bottom right) terms. All crosswalls with a single solid - * quarter are rotated so the solid section is at the bottom right. - * We pattern match on that, but return the correct result depending - * on which row we'ere looking at. - */ -#define C_trcorn 0 -#define C_brcorn 1 -#define C_blcorn 2 -#define C_tlwall 3 -#define C_tuwall 4 -#define C_crwall 5 - -static const int cross_matrix[4][6] = { - { S_brcorn, S_blcorn, S_tlcorn, S_tuwall, S_trwall, S_crwall }, - { S_blcorn, S_tlcorn, S_trcorn, S_trwall, S_tdwall, S_crwall }, - { S_tlcorn, S_trcorn, S_brcorn, S_tdwall, S_tlwall, S_crwall }, - { S_trcorn, S_brcorn, S_blcorn, S_tlwall, S_tuwall, S_crwall }, -}; - - -/* Print out a T wall warning and all interesting info. */ -STATIC_OVL void -t_warn(lev) - struct rm *lev; -{ - static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x"; - const char *wname; - - if (lev->typ == TUWALL) wname = "tuwall"; - else if (lev->typ == TLWALL) wname = "tlwall"; - else if (lev->typ == TRWALL) wname = "trwall"; - else if (lev->typ == TDWALL) wname = "tdwall"; - else wname = "unknown"; - impossible(warn_str, wname, lev->wall_info & WM_MASK, - (unsigned int) lev->seenv); -} - - -/* - * Return the correct graphics character index using wall type, wall mode, - * and the seen vector. It is expected that seenv is non zero. - * - * All T-wall vectors are rotated to be TDWALL. All single crosswall - * blocks are rotated to bottom right. All double crosswall are rotated - * to W_X_BLTR. All results are converted back. - * - * The only way to understand this is to take out pen and paper and - * draw diagrams. See rm.h for more details on the wall modes and - * seen vector (SV). - */ -STATIC_OVL int -wall_angle(lev) - struct rm *lev; -{ - register unsigned int seenv = lev->seenv & 0xff; - const int *row; - int col, idx; - -#define only(sv, bits) (((sv) & (bits)) && ! ((sv) & ~(bits))) - switch (lev->typ) { - case TUWALL: - row = wall_matrix[T_u]; - seenv = (seenv >> 4 | seenv << 4) & 0xff;/* rotate to tdwall */ - goto do_twall; - case TLWALL: - row = wall_matrix[T_l]; - seenv = (seenv >> 2 | seenv << 6) & 0xff;/* rotate to tdwall */ - goto do_twall; - case TRWALL: - row = wall_matrix[T_r]; - seenv = (seenv >> 6 | seenv << 2) & 0xff;/* rotate to tdwall */ - goto do_twall; - case TDWALL: - row = wall_matrix[T_d]; -do_twall: - switch (lev->wall_info & WM_MASK) { - case 0: - if (seenv == SV4) { - col = T_tlcorn; - } else if (seenv == SV6) { - col = T_trcorn; - } else if (seenv & (SV3|SV5|SV7) || - ((seenv & SV4) && (seenv & SV6))) { - col = T_tdwall; - } else if (seenv & (SV0|SV1|SV2)) { - col = (seenv & (SV4|SV6) ? T_tdwall : T_hwall); - } else { - t_warn(lev); - col = T_stone; - } - break; - case WM_T_LONG: - if (seenv & (SV3|SV4) && !(seenv & (SV5|SV6|SV7))) { - col = T_tlcorn; - } else if (seenv&(SV6|SV7) && !(seenv&(SV3|SV4|SV5))) { - col = T_trcorn; - } else if ((seenv & SV5) || - ((seenv & (SV3|SV4)) && (seenv & (SV6|SV7)))) { - col = T_tdwall; - } else { - /* only SV0|SV1|SV2 */ - if (! only(seenv, SV0|SV1|SV2) ) - t_warn(lev); - col = T_stone; - } - break; - case WM_T_BL: -#if 0 /* older method, fixed */ - if (only(seenv, SV4|SV5)) { - col = T_tlcorn; - } else if ((seenv & (SV0|SV1|SV2)) && - only(seenv, SV0|SV1|SV2|SV6|SV7)) { - col = T_hwall; - } else if (seenv & SV3 || - ((seenv & (SV0|SV1|SV2)) && (seenv & (SV4|SV5)))) { - col = T_tdwall; - } else { - if (seenv != SV6) - t_warn(lev); - col = T_stone; - } -#endif /* 0 */ - if (only(seenv, SV4|SV5)) - col = T_tlcorn; - else if ((seenv & (SV0|SV1|SV2|SV7)) && - !(seenv & (SV3|SV4|SV5))) - col = T_hwall; - else if (only(seenv, SV6)) - col = T_stone; - else - col = T_tdwall; - break; - case WM_T_BR: -#if 0 /* older method, fixed */ - if (only(seenv, SV5|SV6)) { - col = T_trcorn; - } else if ((seenv & (SV0|SV1|SV2)) && - only(seenv, SV0|SV1|SV2|SV3|SV4)) { - col = T_hwall; - } else if (seenv & SV7 || - ((seenv & (SV0|SV1|SV2)) && (seenv & (SV5|SV6)))) { - col = T_tdwall; - } else { - if (seenv != SV4) - t_warn(lev); - col = T_stone; - } -#endif /* 0 */ - if (only(seenv, SV5|SV6)) - col = T_trcorn; - else if ((seenv & (SV0|SV1|SV2|SV3)) && - !(seenv & (SV5|SV6|SV7))) - col = T_hwall; - else if (only(seenv, SV4)) - col = T_stone; - else - col = T_tdwall; - - break; - default: - impossible("wall_angle: unknown T wall mode %d", - lev->wall_info & WM_MASK); - col = T_stone; - break; - } - idx = row[col]; - break; - - case SDOOR: - if (lev->horizontal) goto horiz; - /* fall through */ - case VWALL: - switch (lev->wall_info & WM_MASK) { - case 0: idx = seenv ? S_vwall : S_stone; break; - case 1: idx = seenv & (SV1|SV2|SV3|SV4|SV5) ? S_vwall : - S_stone; - break; - case 2: idx = seenv & (SV0|SV1|SV5|SV6|SV7) ? S_vwall : - S_stone; - break; - default: - impossible("wall_angle: unknown vwall mode %d", - lev->wall_info & WM_MASK); - idx = S_stone; - break; - } - break; - - case HWALL: -horiz: - switch (lev->wall_info & WM_MASK) { - case 0: idx = seenv ? S_hwall : S_stone; break; - case 1: idx = seenv & (SV3|SV4|SV5|SV6|SV7) ? S_hwall : - S_stone; - break; - case 2: idx = seenv & (SV0|SV1|SV2|SV3|SV7) ? S_hwall : - S_stone; - break; - default: - impossible("wall_angle: unknown hwall mode %d", - lev->wall_info & WM_MASK); - idx = S_stone; - break; - } - break; - -#define set_corner(idx, lev, which, outer, inner, name) \ - switch ((lev)->wall_info & WM_MASK) { \ - case 0: idx = which; break; \ - case WM_C_OUTER: idx = seenv & (outer) ? which : S_stone; break; \ - case WM_C_INNER: idx = seenv & ~(inner) ? which : S_stone; break; \ - default: \ - impossible("wall_angle: unknown %s mode %d", name, \ - (lev)->wall_info & WM_MASK); \ - idx = S_stone; \ - break; \ - } - - case TLCORNER: - set_corner(idx, lev, S_tlcorn, (SV3|SV4|SV5), SV4, "tlcorn"); - break; - case TRCORNER: - set_corner(idx, lev, S_trcorn, (SV5|SV6|SV7), SV6, "trcorn"); - break; - case BLCORNER: - set_corner(idx, lev, S_blcorn, (SV1|SV2|SV3), SV2, "blcorn"); - break; - case BRCORNER: - set_corner(idx, lev, S_brcorn, (SV7|SV0|SV1), SV0, "brcorn"); - break; - - - case CROSSWALL: - switch (lev->wall_info & WM_MASK) { - case 0: - if (seenv == SV0) - idx = S_brcorn; - else if (seenv == SV2) - idx = S_blcorn; - else if (seenv == SV4) - idx = S_tlcorn; - else if (seenv == SV6) - idx = S_trcorn; - else if (!(seenv & ~(SV0|SV1|SV2)) && - (seenv & SV1 || seenv == (SV0|SV2))) - idx = S_tuwall; - else if (!(seenv & ~(SV2|SV3|SV4)) && - (seenv & SV3 || seenv == (SV2|SV4))) - idx = S_trwall; - else if (!(seenv & ~(SV4|SV5|SV6)) && - (seenv & SV5 || seenv == (SV4|SV6))) - idx = S_tdwall; - else if (!(seenv & ~(SV0|SV6|SV7)) && - (seenv & SV7 || seenv == (SV0|SV6))) - idx = S_tlwall; - else - idx = S_crwall; - break; - - case WM_X_TL: - row = cross_matrix[C_tl]; - seenv = (seenv >> 4 | seenv << 4) & 0xff; - goto do_crwall; - case WM_X_TR: - row = cross_matrix[C_tr]; - seenv = (seenv >> 6 | seenv << 2) & 0xff; - goto do_crwall; - case WM_X_BL: - row = cross_matrix[C_bl]; - seenv = (seenv >> 2 | seenv << 6) & 0xff; - goto do_crwall; - case WM_X_BR: - row = cross_matrix[C_br]; -do_crwall: - if (seenv == SV4) - idx = S_stone; - else { - seenv = seenv & ~SV4; /* strip SV4 */ - if (seenv == SV0) { - col = C_brcorn; - } else if (seenv & (SV2|SV3)) { - if (seenv & (SV5|SV6|SV7)) - col = C_crwall; - else if (seenv & (SV0|SV1)) - col = C_tuwall; - else - col = C_blcorn; - } else if (seenv & (SV5|SV6)) { - if (seenv & (SV1|SV2|SV3)) - col = C_crwall; - else if (seenv & (SV0|SV7)) - col = C_tlwall; - else - col = C_trcorn; - } else if (seenv & SV1) { - col = seenv & SV7 ? C_crwall : C_tuwall; - } else if (seenv & SV7) { - col = seenv & SV1 ? C_crwall : C_tlwall; - } else { - impossible( - "wall_angle: bottom of crwall check"); - col = C_crwall; - } - - idx = row[col]; - } - break; - - case WM_X_TLBR: - if ( only(seenv, SV1|SV2|SV3) ) - idx = S_blcorn; - else if ( only(seenv, SV5|SV6|SV7) ) - idx = S_trcorn; - else if ( only(seenv, SV0|SV4) ) - idx = S_stone; - else - idx = S_crwall; - break; - - case WM_X_BLTR: - if ( only(seenv, SV0|SV1|SV7) ) - idx = S_brcorn; - else if ( only(seenv, SV3|SV4|SV5) ) - idx = S_tlcorn; - else if ( only(seenv, SV2|SV6) ) - idx = S_stone; - else - idx = S_crwall; - break; - - default: - impossible("wall_angle: unknown crosswall mode"); - idx = S_stone; - break; - } - break; - - default: - impossible("wall_angle: unexpected wall type %d", lev->typ); - idx = S_stone; - } - return idx; -} - -/*display.c*/ diff -Naurbd slashem-0.0.8E0/src/do.c slashem-0.0.8E0F1/src/do.c --- slashem-0.0.8E0/src/do.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/do.c 2006-05-15 12:13:10.000000000 +0100 @@ -1621,7 +1621,7 @@ } else if (container_where == OBJ_INVENT && container) { char sackname[BUFSZ]; Strcpy(sackname, an(xname(container))); - pline("%s %s out of %s in your pack!", + pline("%s %ss out of %s in your pack!", Blind ? Something : Amonnam(mtmp), locomotion(mtmp->data,"writhes"), sackname); diff -Naurbd slashem-0.0.8E0/src/engrave.c slashem-0.0.8E0F1/src/engrave.c --- slashem-0.0.8E0/src/engrave.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/engrave.c 2006-05-15 12:13:10.000000000 +0100 @@ -845,12 +845,6 @@ break; case WEAPON_CLASS: -#ifdef LIGHTSABERS - if (is_lightsaber(otmp)) { - if (otmp->lamplit) type = BURN; - else Your("%s is deactivated!", aobjnam(otmp,"are")); - } else -#endif if(is_blade(otmp)) { if ((int)otmp->spe > -3) type = ENGRAVE; @@ -865,6 +859,13 @@ "That is a bit difficult to engrave with, don't you think?"); return(0); } + +#ifdef LIGHTSABERS + if (is_lightsaber(otmp)) { + if (otmp->lamplit) type = BURN; + else Your("%s is deactivated!", aobjnam(otmp,"are")); + } else +#endif switch (otmp->otyp) { case MAGIC_MARKER: if (otmp->spe <= 0) diff -Naurbd slashem-0.0.8E0/src/invent.c slashem-0.0.8E0F1/src/invent.c --- slashem-0.0.8E0/src/invent.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/invent.c 2006-05-15 12:13:10.000000000 +0100 @@ -867,6 +867,9 @@ otyp != AMULET_OF_YENDOR && otyp != FAKE_AMULET_OF_YENDOR)) || (!strcmp(word, "write with") && (otmp->oclass == TOOL_CLASS && +#ifdef LIGHTSABERS + (!is_lightsaber(otmp) || !otmp->lamplit) && +#endif otyp != MAGIC_MARKER && otyp != TOWEL)) || (!strcmp(word, "tin") && (otyp != CORPSE || !tinnable(otmp))) @@ -1205,6 +1208,9 @@ pline(silly_thing_to, word); return(struct obj *)0; } else if (!allowfloor) { + if ((Levitation || Flying)) + You("cannot reach the floor to %s while %sing.", word, Levitation ? "float" : "fly"); + else pline("There's nothing here to %s.", word); return(struct obj *)0; } diff -Naurbd slashem-0.0.8E0/src/lock.c slashem-0.0.8E0F1/src/lock.c --- slashem-0.0.8E0/src/lock.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/lock.c 2006-05-15 12:13:10.000000000 +0100 @@ -27,7 +27,7 @@ picking_lock(x, y) int *x, *y; { - if (occupation == picklock) { + if (occupation == picklock || occupation == forcedoor) { *x = u.ux + u.dx; *y = u.uy + u.dy; return TRUE; @@ -259,8 +259,32 @@ xlock.door->doormask = D_BROKEN; else xlock.door->doormask = D_NODOOR; unblock_point(u.ux+u.dx, u.uy+u.dy); - if (*in_rooms(u.ux+u.dx, u.uy+u.dy, SHOPBASE)) - add_damage(u.ux+u.dx, u.uy+u.dy, 0L); + if (*in_rooms(u.ux+u.dx, u.uy+u.dy, SHOPBASE)) { + add_damage(u.ux+u.dx, u.uy+u.dy, 400L); + pay_for_damage("break", FALSE); + + if (in_town(u.ux+u.dx, u.uy+u.dy)) { + struct monst *mtmp; + for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (DEADMONSTER(mtmp)) continue; + if((mtmp->data == &mons[PM_WATCHMAN] || + mtmp->data == &mons[PM_WATCH_CAPTAIN]) && + couldsee(mtmp->mx, mtmp->my) && + mtmp->mpeaceful) { + if (canspotmon(mtmp)) + pline("%s yells:", Amonnam(mtmp)); + else + You_hear("someone yell:"); + verbalize("Halt, thief! You're under arrest!"); + (void) angry_guards(FALSE); + break; + } + } + } + } + if (Blind) + feel_location(u.ux+u.dx, u.uy+u.dy); /* we know we broke it */ + else newsym(u.ux+u.dx, u.uy+u.dy); exercise(A_STR, TRUE); @@ -598,6 +622,10 @@ picktyp = is_blade(uwep) ? 1 : 0; if(xlock.usedtime && picktyp == xlock.picktyp) { if (xlock.box) { + if (!can_reach_floor()) { + pline("Unfortunately, you can no longer reach the lock."); + return 0; + } You("resume your attempt to force the lock."); set_occupation(forcelock, "forcing the lock", 0); return(1); @@ -615,9 +643,27 @@ x = u.ux + u.dx; y = u.uy + u.dy; - if (x == u.ux && y == u.uy && !u.dz) { + if (x == u.ux && y == u.uy) { + if (u.dz < 0) { + There("isn't any sort of lock up %s.", + Levitation ? "here" : "there"); + return 0; + } else if (is_lava(u.ux, u.uy)) { + pline("Doing that would probably melt your %s.", + xname(uwep)); + return 0; + } else if (is_pool(u.ux, u.uy) && !Underwater) { + pline_The("water has no lock."); + return 0; + } + for(otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) if(Is_box(otmp)) { + if (!can_reach_floor()) { + You_cant("reach %s from up here.", the(xname(otmp))); + return 0; + } + if (otmp->obroken || !otmp->olocked) { There("is %s here, but its lock is already %s.", doname(otmp), otmp->obroken ? "broken" : "unlocked"); diff -Naurbd slashem-0.0.8E0/src/makemon.c slashem-0.0.8E0F1/src/makemon.c --- slashem-0.0.8E0/src/makemon.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/makemon.c 2006-05-15 12:13:10.000000000 +0100 @@ -241,7 +241,7 @@ BOULDER : CLUB); break; case S_HUMAN: - if(is_mercenary(ptr) + if(is_mercenary(ptr) || mm == PM_SHOPKEEPER #ifdef YEOMAN || mm == PM_CHIEF_YEOMAN_WARDER || mm == PM_YEOMAN_WARDER #endif @@ -1593,7 +1593,7 @@ mtmp->cham = CHAM_ORDINARY; else { mtmp->cham = mcham; - (void) newcham(mtmp, rndmonst(), FALSE, FALSE); + (void) mon_spec_poly(mtmp, rndmonst(), 0L, FALSE, FALSE, FALSE, FALSE); } } else if (mndx == PM_WIZARD_OF_YENDOR) { mtmp->iswiz = TRUE; @@ -2157,6 +2157,7 @@ if (mtmp->m_enmax > 50*8) mtmp->m_enmax = 50*8; /* absolute limit */ if (mtmp->m_en > mtmp->m_enmax) mtmp->m_en = mtmp->m_enmax; + if (mtmp->oldmonnm != monsndx(ptr)) mtmp->oldmonnm = monsndx(ptr); return ptr; } diff -Naurbd slashem-0.0.8E0/src/mhitu.c slashem-0.0.8E0F1/src/mhitu.c --- slashem-0.0.8E0/src/mhitu.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/mhitu.c 2006-05-15 12:13:10.000000000 +0100 @@ -1168,7 +1168,7 @@ } if (otmp->opoisoned) { - poisoned(obj_typename(otmp->otyp), A_STR, + poisoned(simple_typename(otmp->otyp), A_STR, killer_xname(otmp), 10); if (nopoison < 2) nopoison = 2; if (!rn2(nopoison)) { diff -Naurbd slashem-0.0.8E0/src/mon.c slashem-0.0.8E0F1/src/mon.c --- slashem-0.0.8E0/src/mon.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/mon.c 2006-05-15 12:13:10.000000000 +0100 @@ -429,7 +429,7 @@ #ifdef INVISIBLE_OBJECTS /* Invisible monster ==> invisible corpse */ - obj->oinvis = mtmp->minvis; + obj->oinvis = mtmp->perminvis; #endif stackobj(obj); @@ -1728,8 +1728,6 @@ /* Gas spores always explode upon death */ for(i = 0; i < NATTK; i++) { if (mdat->mattk[i].aatyp == AT_BOOM) { - char buf[BUFSZ]; - if (mdat->mattk[i].damn) tmp = d((int)mdat->mattk[i].damn, (int)mdat->mattk[i].damd); @@ -1759,8 +1757,8 @@ return FALSE; } - Sprintf(buf, "%s explosion", s_suffix(mdat->mname)); - killer = buf; + Sprintf(killer_buf, "%s explosion", s_suffix(mdat->mname)); + killer = killer_buf; killer_format = KILLED_BY_AN; explode(mon->mx, mon->my, -1, tmp, MON_EXPLODE, EXPL_NOXIOUS); return (FALSE); diff -Naurbd slashem-0.0.8E0/src/mondata.c slashem-0.0.8E0F1/src/mondata.c --- slashem-0.0.8E0/src/mondata.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/mondata.c 2006-05-15 12:13:10.000000000 +0100 @@ -100,7 +100,7 @@ return FALSE; } -/* TRUE iff monster is resistant to light-induced blindness */ +/* TRUE if monster is resistant to light-induced blindness */ boolean resists_blnd(mon) struct monst *mon; @@ -298,6 +298,11 @@ struct permonst *ptr; { switch (monsndx(ptr)) { + case PM_LAMB: + case PM_SHEEP: + case PM_GOAT: + case PM_COW: + case PM_BULL: case PM_HORNED_DEVIL: /* ? "more than one" */ case PM_MINOTAUR: case PM_ASMODEUS: @@ -526,7 +531,7 @@ pronoun_gender(mtmp) register struct monst *mtmp; { - if (is_neuter(mtmp->data) || !canspotmon(mtmp)) return 2; + if (!mtmp->isshk && (is_neuter(mtmp->data) || !canspotmon(mtmp))) return 2; return (humanoid(mtmp->data) || (mtmp->data->geno & G_UNIQ) || type_is_pname(mtmp->data)) ? (int)mtmp->female : 2; } diff -Naurbd slashem-0.0.8E0/src/monst.c slashem-0.0.8E0F1/src/monst.c --- slashem-0.0.8E0/src/monst.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/monst.c 2006-05-15 12:13:10.000000000 +0100 @@ -1327,8 +1327,8 @@ A(ATTK(AT_BUTT, AD_PHYS, 1, 8), ATTK(AT_KICK, AD_PHYS, 2, 4), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(2000, 300, 0, MS_COW, MZ_MEDIUM), 0, 0, - M1_ANIMAL|M1_NOHANDS|M1_HERBIVORE, M2_WANDER|M2_DOMESTIC|M2_PEACEFUL, - M3_INFRAVISIBLE, CLR_WHITE), + M1_ANIMAL|M1_NOHANDS|M1_HERBIVORE, M2_WANDER|M2_DOMESTIC|M2_PEACEFUL| + M2_FEMALE,M3_INFRAVISIBLE, CLR_WHITE), MON("mangler", S_QUADRUPED, LVL(8, 9, 7, 0, 0), (G_NOHELL|G_GENO|G_SGROUP|1), A(ATTK(AT_CLAW, AD_PHYS, 3, 3), ATTK(AT_CLAW, AD_PHYS, 3, 3), @@ -1347,8 +1347,8 @@ A(ATTK(AT_BUTT, AD_PHYS, 2, 8), ATTK(AT_KICK, AD_PHYS, 2, 4), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(3000, 500, 0, MS_COW, MZ_MEDIUM), 0, 0, - M1_ANIMAL|M1_NOHANDS|M1_HERBIVORE, M2_WANDER|M2_DOMESTIC|M2_HOSTILE, - M3_INFRAVISIBLE, CLR_BLACK), + M1_ANIMAL|M1_NOHANDS|M1_HERBIVORE, M2_WANDER|M2_DOMESTIC|M2_HOSTILE| + M2_MALE,M3_INFRAVISIBLE, CLR_BLACK), MON("titanothere", S_QUADRUPED, LVL(12, 12, 6, 0, 0), (G_NOHELL|G_GENO|2), A(ATTK(AT_CLAW, AD_PHYS, 2, 8), @@ -2639,9 +2639,8 @@ A(ATTK(AT_CLAW, AD_PHYS, 3,10), ATTK(AT_CLAW, AD_PHYS, 3,10), ATTK(AT_BUTT, AD_PHYS, 2, 8), NO_ATTK, NO_ATTK, NO_ATTK), SIZ(1500, 700, 0, MS_SILENT, MZ_LARGE), MR_DEATH|MR_HITASTWO, 0, - M1_ANIMAL|M1_HUMANOID|M1_CARNIVORE, - M2_HOSTILE|M2_STRONG|M2_NASTY, M3_INFRAVISIBLE|M3_INFRAVISION, - CLR_BROWN), + M1_ANIMAL|M1_HUMANOID|M1_CARNIVORE,M2_MALE|M2_HOSTILE|M2_STRONG| + M2_NASTY, M3_INFRAVISIBLE|M3_INFRAVISION,CLR_BROWN), MON("the Largest Giant", S_GIANT, LVL(26, 12, 0, 15, -3), (G_UNIQ|1), A(ATTK(AT_WEAP, AD_PHYS, 3, 10), NO_ATTK, NO_ATTK, @@ -3493,7 +3492,7 @@ NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(400, 0, 0, MS_SILENT, MZ_LARGE), MR_SLEEP|MR_POISON, 0, M1_BREATHLESS|M1_MINDLESS|M1_HUMANOID, - M2_HOSTILE|M2_NEUTER, 0, CLR_GRAY), + M2_HOSTILE|M2_NEUTER, M3_INFRAVISIBLE, CLR_GRAY), MON("plastic golem", S_GOLEM, LVL(4, 12, 9, 0, 0), (G_NOCORPSE|1), A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3), diff -Naurbd slashem-0.0.8E0/src/objnam.c slashem-0.0.8E0F1/src/objnam.c --- slashem-0.0.8E0/src/objnam.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/objnam.c 2006-05-15 12:13:10.000000000 +0100 @@ -836,7 +836,9 @@ mvitals[obj->corpsenm].mvflags & MV_KNOWS_EGG)) { Strcat(prefix, mons[obj->corpsenm].mname); Strcat(prefix, " "); - if (obj->spe) + if (obj->spe == 2) + Strcat(bp, " (with your markings)"); + else if (obj->spe) Strcat(bp, " (laid by you)"); } } @@ -2257,6 +2259,7 @@ && !strstri(bp, "medallion ") && !strstri(bp, "stake ") && !strstri(bp, "potion ") + && !strstri(bp, "potions ") && !strstri(bp, "finger ")) { if ((p = strstri(bp, " of ")) != 0 && (mntmp = name_to_mon(p+4)) >= LOW_PM) diff -Naurbd slashem-0.0.8E0/src/options.c slashem-0.0.8E0F1/src/options.c --- slashem-0.0.8E0/src/options.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/options.c 2006-05-15 12:13:10.000000000 +0100 @@ -386,9 +386,11 @@ #ifdef VIDEOSHADES { "videocolors", "color mappings for internal screen routines", 40, DISP_IN_GAME }, +#ifdef MSDOS { "videoshades", "gray shades to map to black/gray/white", 32, DISP_IN_GAME }, #endif +#endif #ifdef WIN32CON {"subkeyvalue", "override keystroke value", 7, SET_IN_FILE}, #endif @@ -424,7 +426,7 @@ #ifdef VIDEOSHADES extern char *shade[3]; /* in sys/msdos/video.c */ -extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c */ +extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c, win/tty/termcap.c*/ #endif static char def_inv_order[MAXOCLASSES] = { @@ -2177,7 +2179,7 @@ return; } -#ifdef VIDEOSHADES +#if defined(VIDEOSHADES) && !defined(NO_TERMS) /* videocolors:string */ fullname = "videocolors"; if (match_optname(opts, fullname, 6, TRUE) || @@ -2193,6 +2195,7 @@ badoption(opts); return; } +# ifdef MSDOS /* videoshades:string */ fullname = "videoshades"; if (match_optname(opts, fullname, 6, TRUE)) { @@ -2207,6 +2210,7 @@ badoption(opts); return; } +# endif #endif /* VIDEOSHADES */ #ifdef MSDOS # ifdef NO_TERMS @@ -3624,6 +3628,7 @@ Sprintf(buf, "%s", to_be_done); #endif #ifdef VIDEOSHADES +# ifdef MSDOS else if (!strcmp(optname, "videoshades")) Sprintf(buf, "%s-%s-%s", shade[0],shade[1],shade[2]); else if (!strcmp(optname, "videocolors")) @@ -3635,6 +3640,18 @@ ttycolors[CLR_YELLOW], ttycolors[CLR_BRIGHT_BLUE], ttycolors[CLR_BRIGHT_MAGENTA], ttycolors[CLR_BRIGHT_CYAN]); +# else + else if (!strcmp(optname, "videocolors")) + Sprintf(buf, "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d", + ttycolors[CLR_RED], ttycolors[CLR_GREEN], + ttycolors[CLR_BROWN], ttycolors[CLR_BLUE], + ttycolors[CLR_MAGENTA], ttycolors[CLR_CYAN], + ttycolors[CLR_GRAY], ttycolors[CLR_BLACK], + ttycolors[CLR_ORANGE], ttycolors[CLR_BRIGHT_GREEN], + ttycolors[CLR_YELLOW], ttycolors[CLR_BRIGHT_BLUE], + ttycolors[CLR_BRIGHT_MAGENTA], + ttycolors[CLR_BRIGHT_CYAN], ttycolors[CLR_WHITE]); +# endif /* MSDOS */ #endif /* VIDEOSHADES */ else if (!strcmp(optname, "windowtype")) Sprintf(buf, "%s", windowprocs.name); diff -Naurbd slashem-0.0.8E0/src/polyself.c slashem-0.0.8E0F1/src/polyself.c --- slashem-0.0.8E0/src/polyself.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/polyself.c 2006-05-15 12:13:10.000000000 +0100 @@ -1019,12 +1019,28 @@ dospit() { struct obj *otmp; + struct attack *mattk; if (!getdir((char *)0)) return(0); - otmp = mksobj(u.umonnum==PM_COBRA ? BLINDING_VENOM : ACID_VENOM, - TRUE, FALSE); + mattk = attacktype_fordmg(youmonst.data, AT_SPIT, AD_ANY); + if (!mattk) + impossible("bad spit attack?"); + else { + switch (mattk->adtyp) { + case AD_BLND: + case AD_DRST: + otmp = mksobj(BLINDING_VENOM, TRUE, FALSE); + break; + default: + impossible("bad attack type in do_spit"); + /* fall through */ + case AD_ACID: + otmp = mksobj(ACID_VENOM, TRUE, FALSE); + break; + } otmp->spe = 1; /* to indicate it's yours */ throwit(otmp, 0L, FALSE, 0); + } return(1); } @@ -1631,9 +1647,6 @@ (uarm && uarm->otyp == WHITE_DRAGON_SCALE_MAIL && Role_if(PM_ICE_MAGE))); - /* Set to TRUE when you can polyatwill but choose not to */ - boolean can_polyatwill = FALSE; - /* KMH, balance patch -- new intrinsic */ if (Unchanging) { pline("You cannot change your form."); @@ -1689,7 +1702,7 @@ * is unaffected by blindness, confusion, stun etc. */ if (yn("Transform into your draconic form?") == 'n') - can_polyatwill = TRUE; + return 0; else if (!scales && !scale_mail && u.uen <= EN_BABY_DRAGON) { You("don't have the energy to polymorph."); return 0; @@ -1726,7 +1739,7 @@ } if (Race_if(PM_DOPPELGANGER)) { if (yn("Polymorph at will?") == 'n') - can_polyatwill = TRUE; + return 0; else if (u.uen < EN_DOPP) { You("don't have the energy to polymorph!"); return 0; @@ -1749,7 +1762,7 @@ } else if (Race_if(PM_HUMAN_WEREWOLF) && (!Upolyd || u.umonnum == u.ulycn)) { if (yn("Change form?") == 'n') - can_polyatwill = TRUE; + return 0; else if (u.ulycn == NON_PM) { /* Very serious */ You("are no longer a lycanthrope!"); @@ -1768,13 +1781,12 @@ else nomul(0); } you_were(); - return 1; } else { rehumanize(); - return 1; } + return 1; } - } else if (!can_polyatwill) { + } else { pline("You can't polymorph at will%s.", ((Role_if(PM_FLAME_MAGE) || Role_if(PM_ICE_MAGE) || Race_if(PM_HUMAN_WEREWOLF) || Race_if(PM_DOPPELGANGER)) ? diff -Naurbd slashem-0.0.8E0/src/potion.c slashem-0.0.8E0F1/src/potion.c --- slashem-0.0.8E0/src/potion.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/potion.c 2006-05-15 12:13:10.000000000 +0100 @@ -1663,7 +1663,7 @@ if (kn) makeknown(obj->otyp); else if (!objects[obj->otyp].oc_name_known && - !objects[obj->otyp].oc_uname) + !objects[obj->otyp].oc_uname && !Blind) docall(obj); } } diff -Naurbd slashem-0.0.8E0/src/restore.c.orig slashem-0.0.8E0F1/src/restore.c.orig --- slashem-0.0.8E0/src/restore.c.orig 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/restore.c.orig 1970-01-01 01:00:00.000000000 +0100 @@ -1,1135 +0,0 @@ -/* SCCS Id: @(#)restore.c 3.4 2003/09/06 */ -/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ -/* NetHack may be freely redistributed. See license for details. */ - -#include "hack.h" -#include "lev.h" -#include "tcap.h" /* for TERMLIB and ASCIIGRAPH */ - -#if defined(MICRO) -extern int dotcnt; /* shared with save */ -extern int dotrow; /* shared with save */ -#endif - -#ifdef USE_TILES -extern void FDECL(substitute_tiles, (d_level *)); /* from tile.c */ -#endif - -#ifdef ZEROCOMP -static int NDECL(mgetc); -#endif -STATIC_DCL void NDECL(find_lev_obj); -STATIC_DCL void FDECL(restlevchn, (int)); -STATIC_DCL void FDECL(restdamage, (int,BOOLEAN_P)); -STATIC_DCL struct obj *FDECL(restobjchn, (int,BOOLEAN_P,BOOLEAN_P)); -STATIC_DCL struct monst *FDECL(restmonchn, (int,BOOLEAN_P)); -STATIC_DCL struct fruit *FDECL(loadfruitchn, (int)); -STATIC_DCL void FDECL(freefruitchn, (struct fruit *)); -STATIC_DCL void FDECL(ghostfruit, (struct obj *)); -STATIC_DCL boolean FDECL(restgamestate, (int, unsigned int *, unsigned int *)); -STATIC_DCL void FDECL(restlevelstate, (unsigned int, unsigned int)); -STATIC_DCL int FDECL(restlevelfile, (int,XCHAR_P)); -STATIC_DCL void FDECL(reset_oattached_mids, (BOOLEAN_P)); - -/* - * Save a mapping of IDs from ghost levels to the current level. This - * map is used by the timer routines when restoring ghost levels. - */ -#define N_PER_BUCKET 64 -struct bucket { - struct bucket *next; - struct { - unsigned gid; /* ghost ID */ - unsigned nid; /* new ID */ - } map[N_PER_BUCKET]; -}; - -STATIC_DCL void NDECL(clear_id_mapping); -STATIC_DCL void FDECL(add_id_mapping, (unsigned, unsigned)); - -static int n_ids_mapped = 0; -static struct bucket *id_map = 0; - - -#ifdef AMII_GRAPHICS -void FDECL( amii_setpens, (int) ); /* use colors from save file */ -extern int amii_numcolors; -#endif - -#include "quest.h" - -boolean restoring = FALSE; -static NEARDATA struct fruit *oldfruit; -static NEARDATA long omoves; - -#define Is_IceBox(o) ((o)->otyp == ICE_BOX ? TRUE : FALSE) - -/* Recalculate level.objects[x][y], since this info was not saved. */ -STATIC_OVL void -find_lev_obj() -{ - register struct obj *fobjtmp = (struct obj *)0; - register struct obj *otmp; - int x,y; - - for(x=0; xnobj; - otmp->nobj = fobjtmp; - otmp->where = OBJ_FREE; - fobjtmp = otmp; - } - /* fobj should now be empty */ - - /* Set level.objects (as well as reversing the chain back again) */ - while ((otmp = fobjtmp) != 0) { - fobjtmp = otmp->nobj; - place_object(otmp, otmp->ox, otmp->oy); - } -} - -/* Things that were marked "in_use" when the game was saved (ex. via the - * infamous "HUP" cheat) get used up here. - */ -void -inven_inuse(quietly) -boolean quietly; -{ - register struct obj *otmp, *otmp2; - - for (otmp = invent; otmp; otmp = otmp2) { - otmp2 = otmp->nobj; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - /* in_use gold is created by some menu operations */ - if (!otmp->in_use) { - impossible("inven_inuse: !in_use gold in inventory"); - } - extract_nobj(otmp, &invent); - otmp->in_use = FALSE; - dealloc_obj(otmp); - } else -#endif /* GOLDOBJ */ - if (otmp->in_use) { - if (!quietly) pline("Finishing off %s...", xname(otmp)); - useup(otmp); - } - } -} - -STATIC_OVL void -restlevchn(fd) -register int fd; -{ - int cnt; - s_level *tmplev, *x; - - sp_levchn = (s_level *) 0; - mread(fd, (genericptr_t) &cnt, sizeof(int)); - for(; cnt > 0; cnt--) { - - tmplev = (s_level *)alloc(sizeof(s_level)); - mread(fd, (genericptr_t) tmplev, sizeof(s_level)); - if(!sp_levchn) sp_levchn = tmplev; - else { - - for(x = sp_levchn; x->next; x = x->next); - x->next = tmplev; - } - tmplev->next = (s_level *)0; - } -} - -STATIC_OVL void -restdamage(fd, ghostly) -int fd; -boolean ghostly; -{ - int counter; - struct damage *tmp_dam; - - mread(fd, (genericptr_t) &counter, sizeof(counter)); - if (!counter) - return; - tmp_dam = (struct damage *)alloc(sizeof(struct damage)); - while (--counter >= 0) { - char damaged_shops[5], *shp = (char *)0; - - mread(fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam)); - if (ghostly) - tmp_dam->when += (monstermoves - omoves); - Strcpy(damaged_shops, - in_rooms(tmp_dam->place.x, tmp_dam->place.y, SHOPBASE)); - if (u.uz.dlevel) { - /* when restoring, there are two passes over the current - * level. the first time, u.uz isn't set, so neither is - * shop_keeper(). just wait and process the damage on - * the second pass. - */ - for (shp = damaged_shops; *shp; shp++) { - struct monst *shkp = shop_keeper(*shp); - - if (shkp && inhishop(shkp) && - repair_damage(shkp, tmp_dam, TRUE)) - break; - } - } - if (!shp || !*shp) { - tmp_dam->next = level.damagelist; - level.damagelist = tmp_dam; - tmp_dam = (struct damage *)alloc(sizeof(*tmp_dam)); - } - } - free((genericptr_t)tmp_dam); -} - -STATIC_OVL struct obj * -restobjchn(fd, ghostly, frozen) -register int fd; -boolean ghostly, frozen; -{ - register struct obj *otmp, *otmp2 = 0; - register struct obj *first = (struct obj *)0; - int xl; - - while(1) { - mread(fd, (genericptr_t) &xl, sizeof(xl)); - if(xl == -1) break; - otmp = newobj(xl); - if(!first) first = otmp; - else otmp2->nobj = otmp; - mread(fd, (genericptr_t) otmp, - (unsigned) xl + sizeof(struct obj)); - if (ghostly) { - unsigned nid = flags.ident++; - add_id_mapping(otmp->o_id, nid); - otmp->o_id = nid; - } - if (ghostly && otmp->otyp == SLIME_MOLD) ghostfruit(otmp); - /* Ghost levels get object age shifted from old player's clock - * to new player's clock. Assumption: new player arrived - * immediately after old player died. - */ - if (ghostly && !frozen && !age_is_relative(otmp)) - otmp->age = monstermoves - omoves + otmp->age; - - /* get contents of a container or statue */ - if (Has_contents(otmp)) { - struct obj *otmp3; - otmp->cobj = restobjchn(fd, ghostly, Is_IceBox(otmp)); - /* restore container back pointers */ - for (otmp3 = otmp->cobj; otmp3; otmp3 = otmp3->nobj) - otmp3->ocontainer = otmp; - } - if (otmp->bypass) otmp->bypass = 0; - - otmp2 = otmp; - } - if(first && otmp2->nobj){ - impossible("Restobjchn: error reading objchn."); - otmp2->nobj = 0; - } - - return(first); -} - -STATIC_OVL struct monst * -restmonchn(fd, ghostly) -register int fd; -boolean ghostly; -{ - register struct monst *mtmp, *mtmp2 = 0; - register struct monst *first = (struct monst *)0; - int xl; - struct permonst *monbegin; - boolean moved; - - /* get the original base address */ - mread(fd, (genericptr_t)&monbegin, sizeof(monbegin)); - moved = (monbegin != mons); - - while(1) { - mread(fd, (genericptr_t) &xl, sizeof(xl)); - if(xl == -1) break; - mtmp = newmonst(xl); - if(!first) first = mtmp; - else mtmp2->nmon = mtmp; - mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst)); - if (ghostly) { - unsigned nid = flags.ident++; - add_id_mapping(mtmp->m_id, nid); - mtmp->m_id = nid; - } - if (moved && mtmp->data) { - int offset = mtmp->data - monbegin; /*(ptrdiff_t)*/ - mtmp->data = mons + offset; /* new permonst location */ - } - if (ghostly) { - int mndx = monsndx(mtmp->data); - if (propagate(mndx, TRUE, ghostly) == 0) { - /* cookie to trigger purge in getbones() */ - mtmp->mhpmax = DEFUNCT_MONSTER; - } - } - if (mtmp->isshk) restore_shk_bill(fd, mtmp); - if(mtmp->minvent) { - struct obj *obj; - mtmp->minvent = restobjchn(fd, ghostly, FALSE); - /* restore monster back pointer */ - for (obj = mtmp->minvent; obj; obj = obj->nobj) - obj->ocarry = mtmp; - } - if (mtmp->mw) { - struct obj *obj; - - for(obj = mtmp->minvent; obj; obj = obj->nobj) - if (obj->owornmask & W_WEP) break; - if (obj) mtmp->mw = obj; - else { - MON_NOWEP(mtmp); - /* KMH -- this is more an annoyance than a bug */ -/* impossible("bad monster weapon restore"); */ - } - } - - if (mtmp->isshk) restshk(mtmp, ghostly); - if (mtmp->ispriest) restpriest(mtmp, ghostly); - if (mtmp->isgyp && ghostly) gypsy_init(mtmp); - - mtmp2 = mtmp; - } - if(first && mtmp2->nmon){ - impossible("Restmonchn: error reading monchn."); - mtmp2->nmon = 0; - } - return(first); -} - -STATIC_OVL struct fruit * -loadfruitchn(fd) -int fd; -{ - register struct fruit *flist, *fnext; - - flist = 0; - while (fnext = newfruit(), - mread(fd, (genericptr_t)fnext, sizeof *fnext), - fnext->fid != 0) { - fnext->nextf = flist; - flist = fnext; - } - dealloc_fruit(fnext); - return flist; -} - -STATIC_OVL void -freefruitchn(flist) -register struct fruit *flist; -{ - register struct fruit *fnext; - - while (flist) { - fnext = flist->nextf; - dealloc_fruit(flist); - flist = fnext; - } -} - -STATIC_OVL void -ghostfruit(otmp) -register struct obj *otmp; -{ - register struct fruit *oldf; - - for (oldf = oldfruit; oldf; oldf = oldf->nextf) - if (oldf->fid == otmp->spe) break; - - if (!oldf) impossible("no old fruit?"); - else otmp->spe = fruitadd(oldf->fname); -} - -STATIC_OVL -boolean -restgamestate(fd, stuckid, steedid) -register int fd; -unsigned int *stuckid, *steedid; /* STEED */ -{ - /* discover is actually flags.explore */ - boolean remember_discover = discover; - struct obj *otmp; - int uid; - - mread(fd, (genericptr_t) &uid, sizeof uid); - if (uid != getuid()) { /* strange ... */ - /* for wizard mode, issue a reminder; for others, treat it - as an attempt to cheat and refuse to restore this file */ - pline("Saved game was not yours."); -#ifdef WIZARD - if(!wizard) -#endif - return FALSE; - } - - mread(fd, (genericptr_t) &flags, sizeof(struct flag)); - flags.bypasses = 0; /* never use the saved value of bypasses */ - if (remember_discover) discover = remember_discover; - - role_init(); /* Reset the initial role, gender, and alignment */ - -#ifdef AMII_GRAPHICS - amii_setpens(amii_numcolors); /* use colors from save file */ -#endif - mread(fd, (genericptr_t) &u, sizeof(struct you)); - init_uasmon(); -#ifdef CLIPPING - cliparound(u.ux, u.uy); -#endif - if(u.uhp <= 0 && (!Upolyd || u.mh <= 0)) { - u.ux = u.uy = 0; /* affects pline() [hence You()] */ - You("were not healthy enough to survive restoration."); - /* wiz1_level.dlevel is used by mklev.c to see if lots of stuff is - * uninitialized, so we only have to set it and not the other stuff. - */ - wiz1_level.dlevel = 0; - u.uz.dnum = 0; - u.uz.dlevel = 1; - return(FALSE); - } - - /* this stuff comes after potential aborted restore attempts */ - restore_timers(fd, RANGE_GLOBAL, FALSE, 0L); - restore_light_sources(fd); - invent = restobjchn(fd, FALSE, FALSE); - migrating_objs = restobjchn(fd, FALSE, FALSE); - migrating_mons = restmonchn(fd, FALSE); - mread(fd, (genericptr_t) mvitals, sizeof(mvitals)); - - /* this comes after inventory has been loaded */ - for(otmp = invent; otmp; otmp = otmp->nobj) - if(otmp->owornmask) -#ifdef DEBUG - { - pline ("obj(%s),", xname(otmp)); -#endif - setworn(otmp, otmp->owornmask); -#ifdef DEBUG - } -#endif - /* reset weapon so that player will get a reminder about "bashing" - during next fight when bare-handed or wielding an unconventional - item; for pick-axe, we aren't able to distinguish between having - applied or wielded it, so be conservative and assume the former */ - otmp = uwep; /* `uwep' usually init'd by setworn() in loop above */ - uwep = 0; /* clear it and have setuwep() reinit */ - setuwep(otmp,FALSE); /* (don't need any null check here) */ - /* KMH, balance patch -- added fishing pole */ - if (!uwep || uwep->otyp == PICK_AXE || uwep->otyp == GRAPPLING_HOOK || - uwep->otyp == FISHING_POLE) - unweapon = TRUE; - - restore_dungeon(fd); - - restlevchn(fd); - mread(fd, (genericptr_t) &moves, sizeof moves); - mread(fd, (genericptr_t) &monstermoves, sizeof monstermoves); - mread(fd, (genericptr_t) &quest_status, sizeof(struct q_score)); - mread(fd, (genericptr_t) spl_book, - sizeof(struct spell) * (MAXSPELL + 1)); - mread(fd, (genericptr_t) tech_list, - sizeof(struct tech) * (MAXTECH + 1)); - restore_artifacts(fd); - restore_oracles(fd); - if (u.ustuck) - mread(fd, (genericptr_t) stuckid, sizeof (*stuckid)); -#ifdef STEED - if (u.usteed) - mread(fd, (genericptr_t) steedid, sizeof (*steedid)); -#endif - mread(fd, (genericptr_t) pl_character, sizeof (pl_character)); - - mread(fd, (genericptr_t) pl_fruit, sizeof pl_fruit); - mread(fd, (genericptr_t) ¤t_fruit, sizeof current_fruit); - freefruitchn(ffruit); /* clean up fruit(s) made by initoptions() */ - ffruit = loadfruitchn(fd); - - restnames(fd); - restore_waterlevel(fd); - /* must come after all mons & objs are restored */ - relink_timers(FALSE); - relink_light_sources(FALSE); - return(TRUE); -} - -/* update game state pointers to those valid for the current level (so we - * don't dereference a wild u.ustuck when saving the game state, for instance) - */ -STATIC_OVL void -restlevelstate(stuckid, steedid) -unsigned int stuckid, steedid; /* STEED */ -{ - register struct monst *mtmp; - - if (stuckid) { - for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if (mtmp->m_id == stuckid) break; - if (!mtmp) panic("Cannot find the monster ustuck."); - setustuck(mtmp); - } -#ifdef STEED - if (steedid) { - for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) - if (mtmp->m_id == steedid) break; - if (!mtmp) panic("Cannot find the monster usteed."); - u.usteed = mtmp; - remove_monster(mtmp->mx, mtmp->my); - } -#endif -} - -/*ARGSUSED*/ /* fd used in MFLOPPY only */ -STATIC_OVL int -restlevelfile(fd, ltmp) -register int fd; -xchar ltmp; -{ -#ifdef MAC_MPW -# pragma unused(fd) -#endif - register int nfd; - char whynot[BUFSZ]; - - nfd = create_levelfile(ltmp, whynot); - if (nfd < 0) { - /* BUG: should suppress any attempt to write a panic - save file if file creation is now failing... */ - panic("restlevelfile: %s", whynot); - } -#ifdef MFLOPPY - if (!savelev(nfd, ltmp, COUNT_SAVE)) { - - /* The savelev can't proceed because the size required - * is greater than the available disk space. - */ - pline("Not enough space on `%s' to restore your game.", - levels); - - /* Remove levels and bones that may have been created. - */ - (void) close(nfd); -# ifdef AMIGA - clearlocks(); -# else - eraseall(levels, alllevels); - eraseall(levels, allbones); - - /* Perhaps the person would like to play without a - * RAMdisk. - */ - /* Maybe not [Tom] */ -#if 0 - if (ramdisk) { - /* PlaywoRAMdisk may not return, but if it does - * it is certain that ramdisk will be 0. - */ - playwoRAMdisk(); - /* Rewind save file and try again */ - (void) lseek(fd, (off_t)0, 0); - (void) uptodate(fd, (char *)0); /* skip version */ - return dorecover(fd); /* 0 or 1 */ - } else -#endif - { -# endif - pline("Be seeing you..."); - terminate(EXIT_SUCCESS); -# ifndef AMIGA - } -# endif - } -#endif - bufon(nfd); - savelev(nfd, ltmp, WRITE_SAVE | FREE_SAVE); - bclose(nfd); - return(2); -} - -int -dorecover(fd) -register int fd; -{ - unsigned int stuckid = 0, steedid = 0; /* not a register */ - xchar ltmp; - int rtmp; - struct obj *otmp; - -#ifdef STORE_PLNAME_IN_FILE - mread(fd, (genericptr_t) plname, PL_NSIZ); -#endif - - restoring = TRUE; - getlev(fd, 0, (xchar)0, FALSE); - if (!restgamestate(fd, &stuckid, &steedid)) { - display_nhwindow(WIN_MESSAGE, TRUE); - savelev(-1, 0, FREE_SAVE); /* discard current level */ - (void) close(fd); - (void) delete_savefile(); - restoring = FALSE; - return(0); - } - restlevelstate(stuckid, steedid); -#ifdef INSURANCE - savestateinlock(); -#endif - rtmp = restlevelfile(fd, ledger_no(&u.uz)); - if (rtmp < 2) return(rtmp); /* dorecover called recursively */ - - /* these pointers won't be valid while we're processing the - * other levels, but they'll be reset again by restlevelstate() - * afterwards, and in the meantime at least u.usteed may mislead - * place_monster() on other levels - */ - setustuck((struct monst *)0); -#ifdef STEED - u.usteed = (struct monst *)0; -#endif - -#ifdef MICRO -# ifdef AMII_GRAPHICS - { - extern struct window_procs amii_procs; - if(windowprocs.win_init_nhwindows== amii_procs.win_init_nhwindows){ - extern winid WIN_BASE; - clear_nhwindow(WIN_BASE); /* hack until there's a hook for this */ - } - } -# else - clear_nhwindow(WIN_MAP); -# endif - clear_nhwindow(WIN_MESSAGE); - /* moved lower */ - curs(WIN_MAP, 1, 1); - dotcnt = 0; - dotrow = 2; -# ifdef TTY_GRAPHICS - if (!strncmpi("tty", windowprocs.name, 3)) - putstr(WIN_MAP, 0, "Restoring:"); -# endif -#endif - while(1) { -#ifdef ZEROCOMP - if(mread(fd, (genericptr_t) <mp, sizeof ltmp) < 0) -#else - if(read(fd, (genericptr_t) <mp, sizeof ltmp) != sizeof ltmp) -#endif - break; - getlev(fd, 0, ltmp, FALSE); -#if defined(MICRO) && defined(TTY_GRAPHICS) - if (!strncmpi("tty", windowprocs.name, 3)) { - curs(WIN_MAP, 1+dotcnt++, dotrow); - if (dotcnt >= (COLNO - 1)) { - dotrow++; - dotcnt = 0; - } - putstr(WIN_MAP, 0, "."); - mark_synch(); - } -#endif - rtmp = restlevelfile(fd, ltmp); - if (rtmp < 2) return(rtmp); /* dorecover called recursively */ - } - -#ifdef BSD - (void) lseek(fd, 0L, 0); -#else - (void) lseek(fd, 0L, 0); -/* (void) lseek(fd, (off_t)0, 0); */ -#endif - (void) uptodate(fd, (char *)0); /* skip version info */ -#ifdef STORE_PLNAME_IN_FILE - mread(fd, (genericptr_t) plname, PL_NSIZ); -#endif - getlev(fd, 0, (xchar)0, FALSE); - (void) close(fd); - - if (!wizard && !discover) - (void) delete_savefile(); -#ifdef REINCARNATION - if (Is_rogue_level(&u.uz)) assign_rogue_graphics(TRUE); -#endif -#ifdef USE_TILES - substitute_tiles(&u.uz); -#endif - restlevelstate(stuckid, steedid); - - /* WAC -- This needs to be after the second restlevelstate - * You() writes to the message line, which also updates the - * status line. However, u.usteed needs to be corrected or else - * weight/carrying capacities will be calculated by dereferencing - * garbage pointers. - * Side effect of this is that you don't see this message until after the - * all the levels are loaded - */ - You("return to level %d in %s%s.", - depth(&u.uz), dungeons[u.uz.dnum].dname, - flags.debug ? " while in debug mode" : - flags.explore ? " while in explore mode" : ""); - -#ifdef MFLOPPY - gameDiskPrompt(); -#endif - max_rank_sz(); /* to recompute mrank_sz (botl.c) */ - /* take care of iron ball & chain */ - for(otmp = fobj; otmp; otmp = otmp->nobj) - if(otmp->owornmask) - setworn(otmp, otmp->owornmask); - - /* in_use processing must be after: - * + The inventory has been read so that freeinv() works. - * + The current level has been restored so billing information - * is available. - */ - inven_inuse(FALSE); - - load_qtlist(); /* re-load the quest text info */ - reset_attribute_clock(); - /* Set up the vision internals, after levl[] data is loaded */ - /* but before docrt(). */ - vision_reset(); - vision_full_recalc = 1; /* recompute vision (not saved) */ - - run_timers(); /* expire all timers that have gone off while away */ - docrt(); - restoring = FALSE; - clear_nhwindow(WIN_MESSAGE); - program_state.something_worth_saving++; /* useful data now exists */ - - /* Success! */ - welcome(FALSE); - return(1); -} - -void -trickery(reason) -char *reason; -{ - pline("Strange, this map is not as I remember it."); - pline("Somebody is trying some trickery here..."); - pline("This game is void."); - killer = reason; - done(TRICKED); -} - -void -getlev(fd, pid, lev, ghostly) -int fd, pid; -xchar lev; -boolean ghostly; -{ - register struct trap *trap; - register struct monst *mtmp; - branch *br; - int hpid; - xchar dlvl; - int x, y; -#ifdef TOS - short tlev; -#endif - - if (ghostly) - clear_id_mapping(); - -#if defined(MSDOS) || defined(OS2) - setmode(fd, O_BINARY); -#endif - /* Load the old fruit info. We have to do it first, so the - * information is available when restoring the objects. - */ - if (ghostly) oldfruit = loadfruitchn(fd); - - /* First some sanity checks */ - mread(fd, (genericptr_t) &hpid, sizeof(hpid)); -/* CHECK: This may prevent restoration */ -#ifdef TOS - mread(fd, (genericptr_t) &tlev, sizeof(tlev)); - dlvl=tlev&0x00ff; -#else - mread(fd, (genericptr_t) &dlvl, sizeof(dlvl)); -#endif - if ((pid && pid != hpid) || (lev && dlvl != lev)) { - char trickbuf[BUFSZ]; - - if (pid && pid != hpid) - Sprintf(trickbuf, "PID (%d) doesn't match saved PID (%d)!", - hpid, pid); - else - Sprintf(trickbuf, "This is level %d, not %d!", dlvl, lev); -#ifdef WIZARD - if (wizard) pline(trickbuf); -#endif - trickery(trickbuf); - } - -#ifdef RLECOMP - { - short i, j; - uchar len; - struct rm r; - -#if defined(MAC) - /* Suppress warning about used before set */ - (void) memset((genericptr_t) &r, 0, sizeof(r)); -#endif - i = 0; j = 0; len = 0; - while(i < ROWNO) { - while(j < COLNO) { - if(len > 0) { - levl[j][i] = r; - len -= 1; - j += 1; - } else { - mread(fd, (genericptr_t)&len, sizeof(uchar)); - mread(fd, (genericptr_t)&r, sizeof(struct rm)); - } - } - j = 0; - i += 1; - } - } -#else - mread(fd, (genericptr_t) levl, sizeof(levl)); -#endif /* RLECOMP */ - - mread(fd, (genericptr_t)&omoves, sizeof(omoves)); - mread(fd, (genericptr_t)&upstair, sizeof(stairway)); - mread(fd, (genericptr_t)&dnstair, sizeof(stairway)); - mread(fd, (genericptr_t)&upladder, sizeof(stairway)); - mread(fd, (genericptr_t)&dnladder, sizeof(stairway)); - mread(fd, (genericptr_t)&sstairs, sizeof(stairway)); - mread(fd, (genericptr_t)&updest, sizeof(dest_area)); - mread(fd, (genericptr_t)&dndest, sizeof(dest_area)); - mread(fd, (genericptr_t)&level.flags, sizeof(level.flags)); - mread(fd, (genericptr_t)doors, sizeof(doors)); - rest_rooms(fd); /* No joke :-) */ - /* ALI - regenerate doorindex */ - if (nroom) - doorindex = rooms[nroom - 1].fdoor + rooms[nroom - 1].doorct; - else { - doorindex = 0; - for (y = 0; y < ROWNO; y++) - for (x = 0; x < COLNO; x++) - if (IS_DOOR(levl[x][y].typ)) - doorindex++; - } - - restore_timers(fd, RANGE_LEVEL, ghostly, monstermoves - omoves); - restore_light_sources(fd); - fmon = restmonchn(fd, ghostly); - - /* regenerate animals while on another level */ - if (u.uz.dlevel) { - register struct monst *mtmp2; - - for(mtmp = fmon; mtmp; mtmp = mtmp2) { - mtmp2 = mtmp->nmon; - if (ghostly) { - /* reset peaceful/malign relative to new character */ - if(!mtmp->isshk) - /* shopkeepers will reset based on name */ - mtmp->mpeaceful = peace_minded(mtmp->data); - set_malign(mtmp); - } else if (monstermoves > omoves) - mon_catchup_elapsed_time(mtmp, monstermoves - omoves); - - /* update shape-changers in case protection against - them is different now than when the level was saved */ - restore_cham(mtmp); - } - } - - rest_worm(fd); /* restore worm information */ - ftrap = 0; - while (trap = newtrap(), - mread(fd, (genericptr_t)trap, sizeof(struct trap)), - trap->tx != 0) { /* need "!= 0" to work around DICE 3.0 bug */ - trap->ntrap = ftrap; - ftrap = trap; - } - dealloc_trap(trap); - fobj = restobjchn(fd, ghostly, FALSE); - find_lev_obj(); - /* restobjchn()'s `frozen' argument probably ought to be a callback - routine so that we can check for objects being buried under ice */ - level.buriedobjlist = restobjchn(fd, ghostly, FALSE); - billobjs = restobjchn(fd, ghostly, FALSE); - rest_engravings(fd); - - /* reset level.monsters for new level */ - for (x = 0; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) - level.monsters[x][y] = (struct monst *) 0; - for (mtmp = level.monlist; mtmp; mtmp = mtmp->nmon) { - if (mtmp->isshk) - set_residency(mtmp, FALSE); - place_monster(mtmp, mtmp->mx, mtmp->my); - if (mtmp->wormno) place_wsegs(mtmp); - } - restdamage(fd, ghostly); - - rest_regions(fd, ghostly); - if (ghostly) { - /* Now get rid of all the temp fruits... */ - freefruitchn(oldfruit), oldfruit = 0; - - if (lev > ledger_no(&medusa_level) && - lev < ledger_no(&stronghold_level) && xdnstair == 0) { - coord cc; - - mazexy(&cc); - xdnstair = cc.x; - ydnstair = cc.y; - levl[cc.x][cc.y].typ = STAIRS; - } - - br = Is_branchlev(&u.uz); - if (br && u.uz.dlevel == 1) { - d_level ltmp; - - if (on_level(&u.uz, &br->end1)) - assign_level(<mp, &br->end2); - else - assign_level(<mp, &br->end1); - - switch(br->type) { - case BR_STAIR: - case BR_NO_END1: - case BR_NO_END2: /* OK to assign to sstairs if it's not used */ - assign_level(&sstairs.tolev, <mp); - break; - case BR_PORTAL: /* max of 1 portal per level */ - { - register struct trap *ttmp; - for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) - if (ttmp->ttyp == MAGIC_PORTAL) - break; - if (!ttmp) panic("getlev: need portal but none found"); - assign_level(&ttmp->dst, <mp); - } - break; - } - } else if (!br) { - /* Remove any dangling portals. */ - register struct trap *ttmp; - for (ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) - if (ttmp->ttyp == MAGIC_PORTAL) { - deltrap(ttmp); - break; /* max of 1 portal/level */ - } - } - } - - /* must come after all mons & objs are restored */ - relink_timers(ghostly); - relink_light_sources(ghostly); - reset_oattached_mids(ghostly); -#ifdef DUNGEON_GROWTH - if (!ghostly) catchup_dgn_growths((monstermoves - omoves) / 5); -#endif - if (ghostly) - clear_id_mapping(); -} - - -/* Clear all structures for object and monster ID mapping. */ -STATIC_OVL void -clear_id_mapping() -{ - struct bucket *curr; - - while ((curr = id_map) != 0) { - id_map = curr->next; - free((genericptr_t) curr); - } - n_ids_mapped = 0; -} - -/* Add a mapping to the ID map. */ -STATIC_OVL void -add_id_mapping(gid, nid) - unsigned gid, nid; -{ - int idx; - - idx = n_ids_mapped % N_PER_BUCKET; - /* idx is zero on first time through, as well as when a new bucket is */ - /* needed */ - if (idx == 0) { - struct bucket *gnu = (struct bucket *) alloc(sizeof(struct bucket)); - gnu->next = id_map; - id_map = gnu; - } - - id_map->map[idx].gid = gid; - id_map->map[idx].nid = nid; - n_ids_mapped++; -} - -/* - * Global routine to look up a mapping. If found, return TRUE and fill - * in the new ID value. Otherwise, return false and return -1 in the new - * ID. - */ -boolean -lookup_id_mapping(gid, nidp) - unsigned gid, *nidp; -{ - int i; - struct bucket *curr; - - if (n_ids_mapped) - for (curr = id_map; curr; curr = curr->next) { - /* first bucket might not be totally full */ - if (curr == id_map) { - i = n_ids_mapped % N_PER_BUCKET; - if (i == 0) i = N_PER_BUCKET; - } else - i = N_PER_BUCKET; - - while (--i >= 0) - if (gid == curr->map[i].gid) { - *nidp = curr->map[i].nid; - return TRUE; - } - } - - return FALSE; -} - -STATIC_OVL void -reset_oattached_mids(ghostly) -boolean ghostly; -{ - struct obj *otmp; - unsigned oldid, nid; - for (otmp = fobj; otmp; otmp = otmp->nobj) { - if (ghostly && otmp->oattached == OATTACHED_MONST && otmp->oxlth) { - struct monst *mtmp = (struct monst *)otmp->oextra; - - mtmp->m_id = 0; - mtmp->mpeaceful = mtmp->mtame = 0; /* pet's owner died! */ - } - if (ghostly && otmp->oattached == OATTACHED_M_ID) { - (void) memcpy((genericptr_t)&oldid, (genericptr_t)otmp->oextra, - sizeof(oldid)); - if (lookup_id_mapping(oldid, &nid)) - (void) memcpy((genericptr_t)otmp->oextra, (genericptr_t)&nid, - sizeof(nid)); - else - otmp->oattached = OATTACHED_NOTHING; - } - } -} - - -#ifdef ZEROCOMP -#define RLESC '\0' /* Leading character for run of RLESC's */ - -#ifndef ZEROCOMP_BUFSIZ -#define ZEROCOMP_BUFSIZ BUFSZ -#endif -static NEARDATA unsigned char inbuf[ZEROCOMP_BUFSIZ]; -static NEARDATA unsigned short inbufp = 0; -static NEARDATA unsigned short inbufsz = 0; -static NEARDATA short inrunlength = -1; -static NEARDATA int mreadfd; - -static int -mgetc() -{ - if (inbufp >= inbufsz) { - inbufsz = read(mreadfd, (genericptr_t)inbuf, sizeof inbuf); - if (!inbufsz) { - if (inbufp > sizeof inbuf) - error("EOF on file #%d.\n", mreadfd); - inbufp = 1 + sizeof inbuf; /* exactly one warning :-) */ - return -1; - } - inbufp = 0; - } - return inbuf[inbufp++]; -} - -void -minit() -{ - inbufsz = 0; - inbufp = 0; - inrunlength = -1; -} - -int -mread(fd, buf, len) -int fd; -genericptr_t buf; -register unsigned len; -{ - /*register int readlen = 0;*/ - if (fd < 0) error("Restore error; mread attempting to read file %d.", fd); - mreadfd = fd; - while (len--) { - if (inrunlength > 0) { - inrunlength--; - *(*((char **)&buf))++ = '\0'; - } else { - register short ch = mgetc(); - if (ch < 0) return -1; /*readlen;*/ - if ((*(*(char **)&buf)++ = (char)ch) == RLESC) { - inrunlength = mgetc(); - } - } - /*readlen++;*/ - } - return 0; /*readlen;*/ -} - -#else /* ZEROCOMP */ - -void -minit() -{ - return; -} - -void -mread(fd, buf, len) -register int fd; -register genericptr_t buf; -register unsigned int len; -{ - register int rlen; - -#if defined(BSD) || defined(ULTRIX) - rlen = read(fd, buf, (int) len); - if(rlen != len){ -#else /* e.g. SYSV, __TURBOC__ */ - rlen = read(fd, buf, (unsigned) len); - if((unsigned)rlen != len){ -#endif - pline("Read %d instead of %u bytes.", rlen, len); - if(restoring) { - (void) close(fd); - (void) delete_savefile(); - error("Error restoring old game."); - } - panic("Error reading level file."); - } -} -#endif /* ZEROCOMP */ - -/*restore.c*/ diff -Naurbd slashem-0.0.8E0/src/shk.c slashem-0.0.8E0F1/src/shk.c --- slashem-0.0.8E0/src/shk.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/shk.c 2006-05-15 12:13:10.000000000 +0100 @@ -2368,11 +2368,12 @@ } #ifdef TOURIST if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) - || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ + || ((uarmu && !uarmu->oinvis) && (!uarm || uarm->oinvis) + && (!uarmc || uarmc->oinvis))) /* touristy shirt visible */ tmp += tmp / 3L; else #endif - if (uarmh && uarmh->otyp == DUNCE_CAP) + if (uarmh && !uarmh->oinvis && uarmh->otyp == DUNCE_CAP) tmp += tmp / 3L; if (ACURR(A_CHA) > 18) tmp /= 2L; @@ -2522,11 +2523,12 @@ #ifdef TOURIST if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) - || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ + || ((uarmu && !uarmu->oinvis) && (!uarm || uarm->oinvis) + && (!uarmc || uarmc->oinvis))) /* touristy shirt visible */ tmp /= 3L; else #endif - if (uarmh && uarmh->otyp == DUNCE_CAP) + if (uarmh && !uarmh->oinvis && uarmh->otyp == DUNCE_CAP) tmp /= 3L; else tmp /= 2L; diff -Naurbd slashem-0.0.8E0/src/shknam.c slashem-0.0.8E0F1/src/shknam.c --- slashem-0.0.8E0/src/shknam.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/shknam.c 2006-05-15 12:13:10.000000000 +0100 @@ -253,7 +253,7 @@ * random shopkeepers) */ /* STEPHEN WHITE'S NEW CODE */ - {"pet store", TOOL_CLASS, 4, D_SHOP, { + {"pet store", FOOD_CLASS, 4, D_SHOP, { #ifdef STEED {67, -FIGURINE}, {5, -LEASH},{10, -TRIPE_RATION}, {5, -SADDLE}, #else @@ -261,7 +261,7 @@ #endif {10, -TIN_WHISTLE}, {3, -MAGIC_WHISTLE}}, shkpet}, /* Robin Johnson -- 4% taken from pet store */ - {"frozen food store", TOOL_CLASS, 4, D_SHOP, + {"frozen food store", FOOD_CLASS, 4, D_SHOP, {{90, -ICE_BOX}, {10, -TIN}, /* shopkeeper will pay for corpses, but they aren't generated */ /* on the shop floor */ @@ -347,6 +347,12 @@ /* special-case minetown lighting shk */ shname = "Izchak"; shk->female = FALSE; +#ifdef BLACKMARKET + } else if (nlp == shkblack) { + /* special-case black marketeer */ + shname = "One-eyed Sam"; + shk->female = shk->data->mflags2 & M2_MALE ? FALSE : TRUE; +#endif /* BLACKMARKET */ } else { /* We want variation from game to game, without needing the save and restore support which would be necessary for randomization; diff -Naurbd slashem-0.0.8E0/src/sp_lev.c slashem-0.0.8E0F1/src/sp_lev.c --- slashem-0.0.8E0/src/sp_lev.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/sp_lev.c 2006-05-15 12:13:10.000000000 +0100 @@ -2515,6 +2515,12 @@ typ = D_CLOSED; /* force it to be closed */ } levl[x][y].doormask = typ; + + /* Fix random door alignment */ + + if (y > 0 && (IS_WALL(levl[x][y-1].typ) || + levl[x][y-1].horizontal)) + levl[x][y].horizontal = 0; } /* Now the complicated part, list it with each subroom */ diff -Naurbd slashem-0.0.8E0/src/tech.c slashem-0.0.8E0F1/src/tech.c --- slashem-0.0.8E0/src/tech.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/tech.c 2006-05-15 12:13:10.000000000 +0100 @@ -703,9 +703,10 @@ "dress your wounds with"); if (otmp) { check_unpaid(otmp); - if (otmp->quan > 1L) + if (otmp->quan > 1L) { otmp->quan--; - else { + otmp->ocontainer->owt = weight(otmp->ocontainer); + } else { obj_extract_self(otmp); obfree(otmp, (struct obj *)0); } @@ -1708,6 +1709,7 @@ if ((&mons[monnum])->mlet == S_KOBOLD) return PM_KOBOLD_ZOMBIE; if ((&mons[monnum])->mlet == S_GNOME) return PM_GNOME_ZOMBIE; if (is_orc(&mons[monnum])) return PM_ORC_ZOMBIE; + if (is_dwarf(&mons[monnum])) return PM_DWARF_ZOMBIE; if (is_elf(&mons[monnum])) return PM_ELF_ZOMBIE; if (is_human(&mons[monnum])) return PM_HUMAN_ZOMBIE; if (monnum == PM_ETTIN) return PM_ETTIN_ZOMBIE; @@ -2063,7 +2065,11 @@ You("let loose a barrage of blows!"); + if (u.uswallow) + mtmp = u.ustuck; + else mtmp = m_at(u.ux + u.dx, u.uy + u.dy); + if (!mtmp) { You("strike nothing."); return (0); @@ -2074,7 +2080,12 @@ */ for (i = 0; (i < 4); i++) { if (rn2(70) > (techlev(tech_no) + 30)) break; + + if (u.uswallow) + mtmp = u.ustuck; + else mtmp = m_at(u.ux + u.dx, u.uy + u.dy); + if (!mtmp) return (1); if (!attack(mtmp)) return (1); } diff -Naurbd slashem-0.0.8E0/src/trap.c slashem-0.0.8E0F1/src/trap.c --- slashem-0.0.8E0/src/trap.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/trap.c 2006-05-15 12:13:10.000000000 +0100 @@ -838,8 +838,11 @@ body_part(ARM)); if (rust_dmg(uarms, "shield", 1, TRUE, &youmonst)) break; - if (u.twoweap || (uwep && bimanual(uwep))) - erode_obj(u.twoweap ? uswapwep : uwep, FALSE, TRUE); + if (u.twoweap || (uwep && bimanual(uwep))) { + otmp = u.twoweap ? uswapwep : uwep; + if (otmp && !snuff_lit(otmp)) + erode_obj(otmp, FALSE, TRUE); + } glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); /* Not "metal gauntlets" since it gets called * even if it's leather for the message @@ -848,6 +851,7 @@ case 2: pline("%s your right %s!", A_gush_of_water_hits, body_part(ARM)); + if (uwep && !snuff_lit(uwep)) erode_obj(uwep, FALSE, TRUE); goto glovecheck; default: @@ -1272,7 +1276,7 @@ case POLY_TRAP: if (!resists_magm(mtmp)) { if (!resist(mtmp, WAND_CLASS, 0, NOTELL)) { - (void) newcham(mtmp, (struct permonst *)0, FALSE, FALSE); + (void) mon_spec_poly(mtmp, (struct permonst *)0, 0L, FALSE, FALSE, FALSE, TRUE); if (!can_saddle(mtmp) || !can_ride(mtmp)) { dismount_steed(DISMOUNT_POLY); } else { @@ -1281,14 +1285,13 @@ mtmp->mnamelth ? ARTICLE_NONE : ARTICLE_A, (char *)0, SUPPRESS_SADDLE, FALSE)); } - } steedhit = TRUE; + } break; default: return 0; } - } if(trapkilled) { dismount_steed(DISMOUNT_POLY); return 2; @@ -1891,6 +1894,7 @@ if (in_sight) pline("%s %s's right %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); + if (MON_WEP(mtmp) && !snuff_lit(MON_WEP(mtmp))) erode_obj(MON_WEP(mtmp), FALSE, TRUE); goto glovecheck; default: diff -Naurbd slashem-0.0.8E0/src/worn.c slashem-0.0.8E0F1/src/worn.c --- slashem-0.0.8E0/src/worn.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/src/worn.c 2006-05-15 12:13:10.000000000 +0100 @@ -231,7 +231,7 @@ boolean on, silently; { int unseen; - uchar mask; + unsigned long mask; struct obj *otmp; int which = (int) objects[obj->otyp].oc_oprop; @@ -270,6 +270,9 @@ case JUMPING: case PROTECTION: break; + case DRAIN_RES: + mon->mintrinsics |= MR_DRAIN; + break; default: if (which <= 8) { /* 1 thru 8 correspond to MR_xxx mask values */ /* FIRE,COLD,SLEEP,DISINT,SHOCK,POISON,ACID,STONE */ @@ -291,6 +294,9 @@ in_mklev = save_in_mklev; break; } + case DRAIN_RES: + mask = MR_DRAIN; + goto maybe_loose; case FIRE_RES: case COLD_RES: case SLEEP_RES: @@ -300,6 +306,7 @@ case ACID_RES: case STONE_RES: mask = (uchar) (1 << (which - 1)); + maybe_loose: /* If the monster doesn't have this resistance intrinsically, check whether any other worn item confers it. Note that we don't currently check for anything conferred via simply @@ -310,7 +317,7 @@ (int) objects[otmp->otyp].oc_oprop == which) break; if (!otmp) - mon->mintrinsics &= ~((unsigned short) mask); + mon->mintrinsics &= ~mask; } break; default: diff -Naurbd slashem-0.0.8E0/sys/autoconf/Makefile.dat slashem-0.0.8E0F1/sys/autoconf/Makefile.dat --- slashem-0.0.8E0/sys/autoconf/Makefile.dat 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/Makefile.dat 2006-05-15 12:13:10.000000000 +0100 @@ -5,6 +5,8 @@ VPATH=@srcdir@ srcdir=@srcdir@ +EXEEXT = @EXEEXT@ + # for Atari # SHELL=E:/GEMINI2/MUPFEL.TTP # UUDECODE=uudecode @@ -46,8 +48,11 @@ ../util/mapmerge: (cd ../util ; make mapmerge) -../util/tile2bmp: - (cd ../util ; make tile2bmp) +../util/tile2bmp$(EXEEXT): + (cd ../util ; make tile2bmp$(EXEEXT)) + +../util/uudecode$(EXEEXT): + (cd ../util ; make uudecode$(EXEEXT)) x11tiles: ../util/tile2x11 $(srcdir)/../win/share/monsters.txt $(srcdir)/../win/share/objects.txt \ $(srcdir)/../win/share/other.txt @@ -195,11 +200,34 @@ ../win/share/othbig.txt -b $(srcdir)/../win/share/oth3dmi.txt \ -b $(srcdir)/../win/share/oth-2kmi.txt -b $(srcdir)/../win/share/oth3dse.txt -nhtiles.bmp: ../util/tile2bmp $(srcdir)/../win/share/monsters.txt $(srcdir)/../win/share/objects.txt \ +tiles.bmp: ../util/tile2bmp$(EXEEXT) $(srcdir)/../win/share/monsters.txt \ + $(srcdir)/../win/share/objects.txt \ $(srcdir)/../win/share/other.txt - ../util/tile2bmp $@ $(srcdir)/../win/share/monsters.txt $(srcdir)/../win/share/objects.txt \ + ../util/tile2bmp $@ $(srcdir)/../win/share/monsters.txt \ + $(srcdir)/../win/share/objects.txt \ $(srcdir)/../win/share/other.txt +mnsel.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/mnsel.uu + ../util/uudecode $(srcdir)/../win/win32/mnsel.uu + +mnselcnt.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/mnselcnt.uu + ../util/uudecode $(srcdir)/../win/win32/mnselcnt.uu + +mnunsel.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/mnunsel.uu + ../util/uudecode $(srcdir)/../win/win32/mnunsel.uu + +rip.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/rip.uu + ../util/uudecode $(srcdir)/../win/win32/rip.uu + +petmark.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/petmark.uu + ../util/uudecode $(srcdir)/../win/win32/petmark.uu + +SlashEM.ico: ../util/uudecode$(EXEEXT) $(srcdir)/../sys/winnt/seico.uu + ../util/uudecode $(srcdir)/../sys/winnt/seico.uu + +splash.bmp: ../util/uudecode$(EXEEXT) $(srcdir)/../win/win32/splash.uu + ../util/uudecode $(srcdir)/../win/win32/splash.uu + SlashEM.ad: $(srcdir)/../win/X11/SlashEM.ad cp $(srcdir)/../win/X11/SlashEM.ad SlashEM.ad diff -Naurbd slashem-0.0.8E0/sys/autoconf/Makefile.src slashem-0.0.8E0F1/sys/autoconf/Makefile.src --- slashem-0.0.8E0/sys/autoconf/Makefile.src 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/Makefile.src 2006-05-15 12:13:10.000000000 +0100 @@ -5,21 +5,33 @@ VPATH = @srcdir@ srcdir = @srcdir@ -SYSTEM = Sysunix +SYSTEM = @SYSTEM@ +EXEEXT = @EXEEXT@ SHELL=/bin/sh LINK=$(CC) # for UNIX systems -SYSSRC = $(srcdir)/../sys/share/ioctl.c $(srcdir)/../sys/share/unixtty.c $(srcdir)/../sys/unix/unixmain.c \ - $(srcdir)/../sys/unix/unixunix.c $(srcdir)/../sys/unix/unixres.c -SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o +SYSUNIXSRC = $(srcdir)/../sys/share/ioctl.c $(srcdir)/../sys/share/unixtty.c \ + $(srcdir)/../sys/unix/unixmain.c $(srcdir)/../sys/unix/unixunix.c \ + $(srcdir)/../sys/unix/unixres.c +SYSUNIXOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o +# for Microsoft Window systems +SYSMSWINSRC = $(srcdir)/../sys/winnt/nttty.c $(srcdir)/../sys/winnt/winnt.c \ + $(srcdir)/../sys/share/pcsys.c $(srcdir)/../sys/share/pcunix.c \ + $(srcdir)/../sys/share/pcmain.c $(srcdir)/../sys/share/random.c \ + $(srcdir)/../sys/share/nhlan.c +SYSMSWINOBJ = nttty.o winnt.o pcsys.o pcunix.o pcmain.o random.o nhlan.o +# +SYSSRC=@SYSSRC@ +SYSOBJ=@SYSOBJ@ CC = @CC@ -DAUTOCONF +WINDRES = @WINDRES@ -CFLAGS = -O -I../include -I$(srcdir)/../include -LFLAGS = +CFLAGS = -O -I../include -I$(srcdir)/../include @CFLAGS@ +LFLAGS = @LFLAGS@ # Only used for the Gnome interface. GNOMEINC=`gnome-config gnome --cflags` -I$(srcdir)/../win/gnome @@ -99,6 +111,20 @@ gl_rendu.o gl_role.o gl_softw.o gl_stat.o \ gl_text.o gl_tile.o gl_unit.o gl_win.o nhwin.a SDLGL_CFLAGS = @SDL_CONFIG_CFLAGS@ +# +# files for a native MS-Windows port +# (tile.c is included in the defn. for WINCSRC, below) +WINMSSRC = $(srcdir)/../win/win32/mswproc.c $(srcdir)/../win/win32/winhack.c \ + $(srcdir)/../win/win32/mhdlg.c $(srcdir)/../win/win32/mhaskyn.c \ + $(srcdir)/../win/win32/mhfont.c $(srcdir)/../win/win32/mhinput.c \ + $(srcdir)/../win/win32/mhmain.c $(srcdir)/../win/win32/mhmsgwnd.c \ + $(srcdir)/../win/win32/mhsplash.c $(srcdir)/../win/win32/mhstatus.c \ + $(srcdir)/../win/win32/mhtext.c $(srcdir)/../win/win32/mhmenu.c \ + $(srcdir)/../win/win32/mhmap.c $(srcdir)/../win/win32/mhrip.c +WINMSOBJ = mswproc.o winhack.o mhdlg.o mhaskyn.o mhfont.o mhinput.o mhmain.o \ + mhmsgwnd.o mhsplash.o mhstatus.o mhtext.o mhmenu.o mhmap.o mhrip.o \ + winres.o +WINMSCFLAGS=-I$(srcdir)/../win/win32 -D_WIN32_IE=0x0400 WINSRC = @WINSRC@ WINOBJ = @WINOBJ@ @@ -123,19 +149,22 @@ # libraries for SDL/GL window port WINSDLLIB = @SDL_CONFIG_LIBS@ -lz -lpng WINGLLIB = -lGL +# +# libraries for native MS-Windows +WINMSLIB = -lcomctl32 -lgdi32 WINLIB = @WINLIB@ LIBS = # make NetHack -GAME = slashem +GAME = slashem$(EXEEXT) RANDOBJ = # used by `make depend' to reconstruct this Makefile; you shouldn't need this -AWK = nawk +AWK = @AWK@ MAKEDEFS = ../util/makedefs @@ -145,35 +174,56 @@ # all .c that are part of the main NetHack program and are not operating- or # windowing-system specific -HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \ - botl.c cmd.c dbridge.c decl.c detect.c dig.c display.c dlb.c do.c \ - do_name.c do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c \ - dungeon.c eat.c end.c engrave.c exper.c explode.c extralev.c \ - files.c fountain.c hack.c hacklib.c invent.c light.c lock.c \ - mail.c makemon.c mapglyph.c mcastu.c mhitm.c mhitu.c minion.c \ - mklev.c mkmap.c \ - mkmaze.c mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c \ - mplayer.c mthrowu.c muse.c music.c o_init.c objects.c objnam.c \ - options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \ - priest.c quest.c questpgr.c read.c rect.c region.c restore.c rip.c \ - rnd.c role.c rumors.c save.c shk.c shknam.c sit.c sounds.c sp_lev.c \ - spell.c steal.c steed.c teleport.c timeout.c topten.c track.c trap.c \ - u_init.c uhitm.c vault.c version.c vision.c weapon.c were.c wield.c \ - windows.c wizard.c worm.c worn.c write.c zap.c \ - gypsy.c tech.c +HACKCSRC = $(srcdir)/allmain.c $(srcdir)/alloc.c $(srcdir)/apply.c \ + $(srcdir)/artifact.c $(srcdir)/attrib.c $(srcdir)/ball.c \ + $(srcdir)/bones.c $(srcdir)/botl.c $(srcdir)/cmd.c $(srcdir)/dbridge.c \ + $(srcdir)/decl.c $(srcdir)/detect.c $(srcdir)/dig.c $(srcdir)/display.c\ + $(srcdir)/dlb.c $(srcdir)/do.c $(srcdir)/do_name.c $(srcdir)/do_wear.c \ + $(srcdir)/dog.c $(srcdir)/dogmove.c $(srcdir)/dokick.c \ + $(srcdir)/dothrow.c $(srcdir)/drawing.c $(srcdir)/dungeon.c \ + $(srcdir)/eat.c $(srcdir)/end.c $(srcdir)/engrave.c $(srcdir)/exper.c \ + $(srcdir)/explode.c $(srcdir)/extralev.c $(srcdir)/files.c \ + $(srcdir)/fountain.c $(srcdir)/hack.c $(srcdir)/hacklib.c \ + $(srcdir)/invent.c $(srcdir)/light.c $(srcdir)/lock.c $(srcdir)/mail.c \ + $(srcdir)/makemon.c $(srcdir)/mapglyph.c $(srcdir)/mcastu.c \ + $(srcdir)/mhitm.c $(srcdir)/mhitu.c $(srcdir)/minion.c \ + $(srcdir)/mklev.c $(srcdir)/mkmap.c $(srcdir)/mkmaze.c \ + $(srcdir)/mkobj.c $(srcdir)/mkroom.c $(srcdir)/mon.c \ + $(srcdir)/mondata.c $(srcdir)/monmove.c $(srcdir)/monst.c \ + $(srcdir)/mplayer.c $(srcdir)/mthrowu.c $(srcdir)/muse.c \ + $(srcdir)/music.c $(srcdir)/o_init.c $(srcdir)/objects.c \ + $(srcdir)/objnam.c $(srcdir)/options.c $(srcdir)/pager.c \ + $(srcdir)/pickup.c $(srcdir)/pline.c $(srcdir)/polyself.c \ + $(srcdir)/potion.c $(srcdir)/pray.c $(srcdir)/priest.c \ + $(srcdir)/quest.c $(srcdir)/questpgr.c $(srcdir)/read.c \ + $(srcdir)/rect.c $(srcdir)/region.c $(srcdir)/restore.c $(srcdir)/rip.c\ + $(srcdir)/rnd.c $(srcdir)/role.c $(srcdir)/rumors.c $(srcdir)/save.c \ + $(srcdir)/shk.c $(srcdir)/shknam.c $(srcdir)/sit.c $(srcdir)/sounds.c \ + $(srcdir)/sp_lev.c $(srcdir)/spell.c $(srcdir)/steal.c \ + $(srcdir)/steed.c $(srcdir)/teleport.c $(srcdir)/timeout.c \ + $(srcdir)/topten.c $(srcdir)/track.c $(srcdir)/trap.c \ + $(srcdir)/u_init.c $(srcdir)/uhitm.c $(srcdir)/vault.c \ + $(srcdir)/version.c $(srcdir)/vision.c $(srcdir)/weapon.c \ + $(srcdir)/were.c $(srcdir)/wield.c $(srcdir)/windows.c \ + $(srcdir)/wizard.c $(srcdir)/worm.c $(srcdir)/worn.c $(srcdir)/write.c \ + $(srcdir)/zap.c $(srcdir)/gypsy.c $(srcdir)/tech.c # all operating-system-dependent .c (for dependencies and such) -SYSCSRC = $(srcdir)/../sys/atari/tos.c $(srcdir)/../sys/share/pcmain.c $(srcdir)/../sys/share/pcsys.c \ - $(srcdir)/../sys/share/pctty.c $(srcdir)/../sys/share/pcunix.c $(srcdir)/../sys/share/random.c \ - $(srcdir)/../sys/share/ioctl.c $(srcdir)/../sys/share/unixtty.c $(srcdir)/../sys/unix/unixmain.c \ - $(srcdir)/../sys/unix/unixunix.c $(srcdir)/../sys/unix/unixres.c $(srcdir)/../sys/be/bemain.c +SYSCSRC = $(srcdir)/../sys/share/nhlan.c $(srcdir)/../sys/share/ioctl.c \ + $(srcdir)/../sys/share/pcmain.c $(srcdir)/../sys/share/pcsys.c \ + $(srcdir)/../sys/share/pctty.c $(srcdir)/../sys/share/pcunix.c \ + $(srcdir)/../sys/share/random.c $(srcdir)/../sys/share/unixtty.c \ + $(srcdir)/../sys/atari/tos.c $(srcdir)/../sys/be/bemain.c \ + $(srcdir)/../sys/unix/unixmain.c $(srcdir)/../sys/unix/unixres.c \ + $(srcdir)/../sys/unix/unixunix.c $(srcdir)/../sys/winnt/nttty.c \ + $(srcdir)/../sys/winnt/winnt.c # generated source files (tile.c is handled separately) GENCSRC = monstr.c vis_tab.c #tile.c # all windowing-system-dependent .c (for dependencies and such) WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) \ - $(WINPROXYSRC) $(WINGLSRC) tile.c + $(WINPROXYSRC) $(WINGLSRC) $(WINMSSRC) tile.c # all windowing-system-dependent .cpp (for dependencies and such) WINCXXSRC = $(WINQTSRC) $(WINBESRC) @@ -231,6 +281,11 @@ @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) $(LIBS) @touch Sysunix +Syswinnt: $(HOBJ) @EXTRA_UNSHARE@ Makefile + @echo "Loading ..." + @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) $(LIBS) + @touch Syswinnt + Sys3B2: $(HOBJ) Makefile @echo "Loading ..." @$(LINK) $(LFLAGS) -o $(GAME) $(HOBJ) $(WINLIB) -lmalloc @@ -278,6 +333,21 @@ cp ../include/extern.DUMB ../include/extern.h @touch DUMB.Setup +.SUFFIXES: .dll .o + +.o.dll: + @NHKEYDLL_GCC@$(CC) -shared -Wl,--export-all-symbols \ + @NHKEYDLL_GCC@ -Wl,--add-stdcall-alias -o $@ $< + +nhdefkey.o: $(srcdir)/../sys/winnt/nhdefkey.c + $(CC) $(CFLAGS) -DBUILD_DLL -c $(srcdir)/../sys/winnt/nhdefkey.c + +nh340key.o: $(srcdir)/../sys/winnt/nh340key.c + $(CC) $(CFLAGS) -DBUILD_DLL -c $(srcdir)/../sys/winnt/nh340key.c + +nhraykey.o: $(srcdir)/../sys/winnt/nhraykey.c + $(CC) $(CFLAGS) -DBUILD_DLL -c $(srcdir)/../sys/winnt/nhraykey.c + all: $(GAME) # dependencies for makedefs and its outputs, which the util @@ -307,6 +377,18 @@ qttableview.moc: ../include/qttableview.h $(QTDIR)/bin/moc -o qttableview.moc ../include/qttableview.h +# Microsoft Window's native port resources +../dat/tiles.bmp: + (cd ../util; make tile2bmp$(EXEEXT)) + (cd ../dat; $(MAKE) tiles.bmp) + +winres.o: $(srcdir)/../win/win32/winhack.rc ../dat/tiles.bmp + (cd ../util; make uudecode$(EXEEXT)) + (cd ../dat; $(MAKE) mnsel.bmp mnselcnt.bmp mnunsel.bmp rip.bmp) + (cd ../dat; $(MAKE) petmark.bmp SlashEM.ico splash.bmp) + $(WINDRES) -o$@ --include-dir=../dat -DNODEBUG -i \ + $(srcdir)/../win/win32/winhack.rc + # NetHack windows library for modules needed by more than one windows # interface. nhwin.a: tile.o @@ -372,16 +454,15 @@ -rm -f $(srcdir)/../win/gnome/gn_rip.h -rm -f ../include/filename.h -depend: $(srcdir)/../sys/unix/depend.awk \ +depend: ../sys/autoconf/depend.awk \ $(SYSCSRC) $(WINCSRC) $(WINCXXSRC) $(GENCSRC) $(HACKCSRC) - $(AWK) -f $(srcdir)/../sys/unix/depend.awk ../include/*.h \ - $(SYSCSRC) $(WINCSRC) $(WINCXXSRC) $(GENCSRC) $(HACKCSRC) >makedep - @echo '/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/+2,$$d' >eddep - @echo '$$r makedep' >>eddep - @echo 'w' >>eddep @cp Makefile Makefile.bak - ed - Makefile < eddep - @rm -f eddep makedep + @sed -n '1,/^# DO NOT DELETE THIS LINE OR CHANGE ANYTHING BEYOND IT/p' \ + < Makefile.bak > Makefile + @echo '' >> Makefile + @$(AWK) -f ../sys/autoconf/depend.awk ../include/*.h \ + $(srcdir)/../include/*.h $(SYSCSRC) $(WINCSRC) $(WINCXXSRC) \ + $(GENCSRC) $(HACKCSRC) >> Makefile @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile @echo '# see make depend above' >> Makefile @@ -415,8 +496,10 @@ ../include/winprocs.h ../include/wintty.h ../include/trampoli.h touch $(HACK_H) # -tos.o: $(srcdir)/../sys/atari/tos.c $(HACK_H) ../include/tcap.h - $(CC) $(CFLAGS) -c $(srcdir)/../sys/atari/tos.c +nhlan.o: $(srcdir)/../sys/share/nhlan.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/nhlan.c +ioctl.o: $(srcdir)/../sys/share/ioctl.c $(HACK_H) ../include/tcap.h + $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/ioctl.c pcmain.o: $(srcdir)/../sys/share/pcmain.c $(HACK_H) ../include/dlb.h \ ../include/patchlevel.h #../include/win32api.h $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/pcmain.c @@ -428,18 +511,22 @@ $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/pcunix.c random.o: $(srcdir)/../sys/share/random.c $(HACK_H) $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/random.c -ioctl.o: $(srcdir)/../sys/share/ioctl.c $(HACK_H) ../include/tcap.h - $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/ioctl.c unixtty.o: $(srcdir)/../sys/share/unixtty.c $(HACK_H) $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/unixtty.c +tos.o: $(srcdir)/../sys/atari/tos.c $(HACK_H) ../include/tcap.h + $(CC) $(CFLAGS) -c $(srcdir)/../sys/atari/tos.c +bemain.o: $(srcdir)/../sys/be/bemain.c $(HACK_H) ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/../sys/be/bemain.c unixmain.o: $(srcdir)/../sys/unix/unixmain.c $(HACK_H) ../include/dlb.h $(CC) $(CFLAGS) -c $(srcdir)/../sys/unix/unixmain.c -unixunix.o: $(srcdir)/../sys/unix/unixunix.c $(HACK_H) - $(CC) $(CFLAGS) -c $(srcdir)/../sys/unix/unixunix.c unixres.o: $(srcdir)/../sys/unix/unixres.c $(CONFIG_H) $(CC) $(CFLAGS) -c $(srcdir)/../sys/unix/unixres.c -bemain.o: $(srcdir)/../sys/be/bemain.c $(HACK_H) ../include/dlb.h - $(CC) $(CFLAGS) -c $(srcdir)/../sys/be/bemain.c +unixunix.o: $(srcdir)/../sys/unix/unixunix.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/../sys/unix/unixunix.c +nttty.o: $(srcdir)/../sys/winnt/nttty.c $(HACK_H) #../include/win32api.h + $(CC) $(CFLAGS) -c $(srcdir)/../sys/winnt/nttty.c +winnt.o: $(srcdir)/../sys/winnt/winnt.c $(HACK_H) #../include/win32api.h + $(CC) $(CFLAGS) -c $(srcdir)/../sys/winnt/winnt.c getline.o: $(srcdir)/../win/tty/getline.c $(HACK_H) ../include/func_tab.h $(CC) $(CFLAGS) -c $(srcdir)/../win/tty/getline.c termcap.o: $(srcdir)/../win/tty/termcap.c $(HACK_H) ../include/tcap.h @@ -449,85 +536,95 @@ wintty.o: $(srcdir)/../win/tty/wintty.c $(HACK_H) ../include/dlb.h \ ../include/patchlevel.h ../include/tcap.h $(CC) $(CFLAGS) -c $(srcdir)/../win/tty/wintty.c -Window.o: $(srcdir)/../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \ - $(CONFIG_H) +Window.o: $(srcdir)/../win/X11/Window.c ../include/xwindowp.h \ + ../include/xwindow.h $(CONFIG_H) $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/Window.c dialogs.o: $(srcdir)/../win/X11/dialogs.c $(CONFIG_H) $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/dialogs.c -winX.o: $(srcdir)/../win/X11/winX.c $(HACK_H) ../include/winX.h ../include/dlb.h \ - ../include/patchlevel.h $(srcdir)/../win/X11/nh72icon \ - $(srcdir)/../win/X11/nh56icon $(srcdir)/../win/X11/nh32icon +winX.o: $(srcdir)/../win/X11/winX.c $(HACK_H) ../include/winX.h \ + ../include/dlb.h ../include/patchlevel.h ../win/X11/nh72icon \ + ../win/X11/nh56icon ../win/X11/nh32icon $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winX.c -winmap.o: $(srcdir)/../win/X11/winmap.c ../include/xwindow.h $(HACK_H) ../include/dlb.h \ - ../include/winX.h ../include/patchlevel.h ../include/tile2x11.h +winmap.o: $(srcdir)/../win/X11/winmap.c ../include/xwindow.h $(HACK_H) \ + ../include/dlb.h ../include/winX.h ../include/patchlevel.h \ + ../include/tile2x11.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winmap.c winmenu.o: $(srcdir)/../win/X11/winmenu.c $(HACK_H) ../include/winX.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winmenu.c -winmesg.o: $(srcdir)/../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) ../include/winX.h +winmesg.o: $(srcdir)/../win/X11/winmesg.c ../include/xwindow.h $(HACK_H) \ + ../include/winX.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winmesg.c winmisc.o: $(srcdir)/../win/X11/winmisc.c $(HACK_H) ../include/func_tab.h \ ../include/winX.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winmisc.c winstat.o: $(srcdir)/../win/X11/winstat.c $(HACK_H) ../include/winX.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winstat.c -wintext.o: $(srcdir)/../win/X11/wintext.c $(HACK_H) ../include/winX.h ../include/xwindow.h +wintext.o: $(srcdir)/../win/X11/wintext.c $(HACK_H) ../include/winX.h \ + ../include/xwindow.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/wintext.c winval.o: $(srcdir)/../win/X11/winval.c $(HACK_H) ../include/winX.h $(CC) $(CFLAGS) -c $(srcdir)/../win/X11/winval.c -gnaskstr.o: $(srcdir)/../win/gnome/gnaskstr.c $(srcdir)/../win/gnome/gnaskstr.h \ - $(srcdir)/../win/gnome/gnmain.h +gnaskstr.o: $(srcdir)/../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \ + ../win/gnome/gnmain.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnaskstr.c -gnbind.o: $(srcdir)/../win/gnome/gnbind.c $(srcdir)/../win/gnome/gnbind.h $(srcdir)/../win/gnome/gnmain.h \ - $(srcdir)/../win/gnome/gnmenu.h $(srcdir)/../win/gnome/gnaskstr.h \ - $(srcdir)/../win/gnome/gnyesno.h +gnbind.o: $(srcdir)/../win/gnome/gnbind.c ../win/gnome/gnbind.h \ + ../win/gnome/gnmain.h ../win/gnome/gnmenu.h \ + ../win/gnome/gnaskstr.h ../win/gnome/gnyesno.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnbind.c -gnglyph.o: $(srcdir)/../win/gnome/gnglyph.c $(srcdir)/../win/gnome/gnglyph.h +gnglyph.o: $(srcdir)/../win/gnome/gnglyph.c ../win/gnome/gnglyph.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnglyph.c -gnmain.o: $(srcdir)/../win/gnome/gnmain.c $(srcdir)/../win/gnome/gnmain.h $(srcdir)/../win/gnome/gnsignal.h \ - $(srcdir)/../win/gnome/gnbind.h $(srcdir)/../win/gnome/gnopts.h $(HACK_H) \ - ../include/date.h +gnmain.o: $(srcdir)/../win/gnome/gnmain.c ../win/gnome/gnmain.h \ + ../win/gnome/gnsignal.h ../win/gnome/gnbind.h \ + ../win/gnome/gnopts.h $(HACK_H) ../include/date.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnmain.c -gnmap.o: $(srcdir)/../win/gnome/gnmap.c $(srcdir)/../win/gnome/gnmap.h $(srcdir)/../win/gnome/gnglyph.h \ - $(srcdir)/../win/gnome/gnsignal.h $(HACK_H) +gnmap.o: $(srcdir)/../win/gnome/gnmap.c ../win/gnome/gnmap.h \ + ../win/gnome/gnglyph.h ../win/gnome/gnsignal.h $(HACK_H) $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnmap.c -gnmenu.o: $(srcdir)/../win/gnome/gnmenu.c $(srcdir)/../win/gnome/gnmenu.h $(srcdir)/../win/gnome/gnmain.h \ - $(srcdir)/../win/gnome/gnbind.h ../include/func_tab.h +gnmenu.o: $(srcdir)/../win/gnome/gnmenu.c ../win/gnome/gnmenu.h \ + ../win/gnome/gnmain.h ../win/gnome/gnbind.h \ + ../include/func_tab.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnmenu.c -gnmesg.o: $(srcdir)/../win/gnome/gnmesg.c $(srcdir)/../win/gnome/gnmesg.h $(srcdir)/../win/gnome/gnsignal.h +gnmesg.o: $(srcdir)/../win/gnome/gnmesg.c ../win/gnome/gnmesg.h \ + ../win/gnome/gnsignal.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnmesg.c -gnopts.o: $(srcdir)/../win/gnome/gnopts.c $(srcdir)/../win/gnome/gnopts.h $(srcdir)/../win/gnome/gnglyph.h \ - $(srcdir)/../win/gnome/gnmain.h $(srcdir)/../win/gnome/gnmap.h $(HACK_H) +gnopts.o: $(srcdir)/../win/gnome/gnopts.c ../win/gnome/gnopts.h \ + ../win/gnome/gnglyph.h ../win/gnome/gnmain.h \ + ../win/gnome/gnmap.h $(HACK_H) $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnopts.c -gnplayer.o: $(srcdir)/../win/gnome/gnplayer.c $(srcdir)/../win/gnome/gnplayer.h \ - $(srcdir)/../win/gnome/gnmain.h $(HACK_H) +gnplayer.o: $(srcdir)/../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \ + ../win/gnome/gnmain.h $(HACK_H) $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnplayer.c -gnsignal.o: $(srcdir)/../win/gnome/gnsignal.c $(srcdir)/../win/gnome/gnsignal.h \ - $(srcdir)/../win/gnome/gnmain.h +gnsignal.o: $(srcdir)/../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \ + ../win/gnome/gnmain.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnsignal.c -gnstatus.o: $(srcdir)/../win/gnome/gnstatus.c $(srcdir)/../win/gnome/gnstatus.h \ - $(srcdir)/../win/gnome/gnsignal.h $(srcdir)/../win/gnome/gn_xpms.h \ - $(srcdir)/../win/gnome/gnomeprv.h +gnstatus.o: $(srcdir)/../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \ + ../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \ + ../win/gnome/gnomeprv.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnstatus.c -gntext.o: $(srcdir)/../win/gnome/gntext.c $(srcdir)/../win/gnome/gntext.h $(srcdir)/../win/gnome/gnmain.h \ - $(srcdir)/../win/gnome/gn_rip.h +gntext.o: $(srcdir)/../win/gnome/gntext.c ../win/gnome/gntext.h \ + ../win/gnome/gnmain.h ../win/gnome/gn_rip.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gntext.c -gnyesno.o: $(srcdir)/../win/gnome/gnyesno.c $(srcdir)/../win/gnome/gnbind.h $(srcdir)/../win/gnome/gnyesno.h +gnyesno.o: $(srcdir)/../win/gnome/gnyesno.c ../win/gnome/gnbind.h \ + ../win/gnome/gnyesno.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnyesno.c -gnworn.o: $(srcdir)/../win/gnome/gnworn.c $(srcdir)/../win/gnome/gnworn.h $(srcdir)/../win/gnome/gnglyph.h \ - $(srcdir)/../win/gnome/gnsignal.h $(srcdir)/../win/gnome/gnomeprv.h +gnworn.o: $(srcdir)/../win/gnome/gnworn.c ../win/gnome/gnworn.h \ + ../win/gnome/gnglyph.h ../win/gnome/gnsignal.h \ + ../win/gnome/gnomeprv.h $(CC) $(CFLAGS) $(GNOMEINC) -c $(srcdir)/../win/gnome/gnworn.c -wingem.o: $(srcdir)/../win/gem/wingem.c $(HACK_H) ../include/func_tab.h ../include/dlb.h \ - ../include/patchlevel.h ../include/wingem.h +wingem.o: $(srcdir)/../win/gem/wingem.c $(HACK_H) ../include/func_tab.h \ + ../include/dlb.h ../include/patchlevel.h ../include/wingem.h $(CC) $(CFLAGS) -c $(srcdir)/../win/gem/wingem.c -wingem1.o: $(srcdir)/../win/gem/wingem1.c ../include/gem_rsc.h ../include/load_img.h \ - ../include/gr_rect.h ../include/wintype.h ../include/wingem.h +wingem1.o: $(srcdir)/../win/gem/wingem1.c ../include/gem_rsc.h \ + ../include/load_img.h ../include/gr_rect.h \ + ../include/wintype.h ../include/wingem.h $(CC) $(CFLAGS) -c $(srcdir)/../win/gem/wingem1.c load_img.o: $(srcdir)/../win/gem/load_img.c ../include/load_img.h $(CC) $(CFLAGS) -c $(srcdir)/../win/gem/load_img.c gr_rect.o: $(srcdir)/../win/gem/gr_rect.c ../include/gr_rect.h $(CC) $(CFLAGS) -c $(srcdir)/../win/gem/gr_rect.c -winproxy.o: $(srcdir)/../win/proxy/winproxy.c $(HACK_H) ../include/patchlevel.h \ - ../include/date.h ../include/winproxy.h #../include/win32api.h +winproxy.o: $(srcdir)/../win/proxy/winproxy.c $(HACK_H) \ + ../include/patchlevel.h ../include/date.h \ + ../include/winproxy.h #../include/win32api.h $(CC) $(CFLAGS) $(WINPROXYCFLAGS) -c $(srcdir)/../win/proxy/winproxy.c callback.o: $(srcdir)/../win/proxy/callback.c $(HACK_H) ../include/func_tab.h \ ../include/winproxy.h @@ -591,6 +688,70 @@ gl_win.o: $(srcdir)/../win/gl/gl_win.c $(HACK_H) ../include/dlb.h \ ../include/patchlevel.h ../include/winGL.h $(CC) $(CFLAGS) $(SDLGL_CFLAGS) -c $(srcdir)/../win/gl/gl_win.c +mswproc.o: $(srcdir)/../win/win32/mswproc.c $(HACK_H) ../include/dlb.h \ + ../include/func_tab.h ../win/win32/winMS.h \ + ../win/win32/mhmap.h ../win/win32/mhstatus.h \ + ../win/win32/mhtext.h ../win/win32/mhmsgwnd.h \ + ../win/win32/mhmenu.h ../win/win32/mhsplash.h \ + ../win/win32/mhmsg.h ../win/win32/mhinput.h \ + ../win/win32/mhaskyn.h ../win/win32/mhdlg.h \ + ../win/win32/mhrip.h ../win/win32/mhmain.h \ + ../win/win32/mhfont.h ../win/win32/resource.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mswproc.c +winhack.o: $(srcdir)/../win/win32/winhack.c ../win/win32/winMS.h $(HACK_H) \ + ../include/dlb.h ../win/win32/resource.h ../win/win32/mhmain.h \ + ../win/win32/mhmap.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/winhack.c +mhdlg.o: $(srcdir)/../win/win32/mhdlg.c ../win/win32/winMS.h $(HACK_H) \ + ../include/func_tab.h ../win/win32/resource.h \ + ../win/win32/mhdlg.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhdlg.c +mhaskyn.o: $(srcdir)/../win/win32/mhaskyn.c ../win/win32/winMS.h \ + ../win/win32/mhaskyn.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhaskyn.c +mhfont.o: $(srcdir)/../win/win32/mhfont.c ../win/win32/mhfont.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhfont.c +mhinput.o: $(srcdir)/../win/win32/mhinput.c ../win/win32/winMS.h \ + ../win/win32/mhinput.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhinput.c +mhmain.o: $(srcdir)/../win/win32/mhmain.c ../win/win32/winMS.h \ + ../include/patchlevel.h ../win/win32/resource.h \ + ../win/win32/mhmsg.h ../win/win32/mhinput.h \ + ../win/win32/mhmain.h ../win/win32/mhmenu.h \ + ../win/win32/mhstatus.h ../win/win32/mhmsgwnd.h \ + ../win/win32/mhmap.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhmain.c +mhmsgwnd.o: $(srcdir)/../win/win32/mhmsgwnd.c ../win/win32/winMS.h \ + ../win/win32/mhmsgwnd.h ../win/win32/mhmsg.h \ + ../win/win32/mhfont.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhmsgwnd.c +mhsplash.o: $(srcdir)/../win/win32/mhsplash.c ../win/win32/winMS.h \ + ../win/win32/resource.h ../win/win32/mhsplash.h \ + ../win/win32/mhmsg.h ../win/win32/mhfont.h \ + ../include/patchlevel.h ../include/dlb.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhsplash.c +mhstatus.o: $(srcdir)/../win/win32/mhstatus.c ../win/win32/winMS.h \ + ../win/win32/mhstatus.h ../win/win32/mhmsg.h \ + ../win/win32/mhfont.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhstatus.c +mhtext.o: $(srcdir)/../win/win32/mhtext.c ../win/win32/winMS.h \ + ../win/win32/resource.h ../win/win32/mhtext.h \ + ../win/win32/mhmsg.h ../win/win32/mhfont.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhtext.c +mhmenu.o: $(srcdir)/../win/win32/mhmenu.c ../win/win32/winMS.h \ + ../win/win32/resource.h ../win/win32/mhmenu.h \ + ../win/win32/mhmain.h ../win/win32/mhmsg.h \ + ../win/win32/mhfont.h ../win/win32/mhdlg.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhmenu.c +mhmap.o: $(srcdir)/../win/win32/mhmap.c ../win/win32/winMS.h \ + ../win/win32/resource.h ../win/win32/mhmap.h \ + ../win/win32/mhmsg.h ../win/win32/mhinput.h \ + ../win/win32/mhfont.h ../include/patchlevel.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhmap.c +mhrip.o: $(srcdir)/../win/win32/mhrip.c ../win/win32/winMS.h \ + ../win/win32/resource.h ../win/win32/mhrip.h \ + ../win/win32/mhmsg.h ../win/win32/mhfont.h + $(CC) $(CFLAGS) $(WINMSCFLAGS) -c $(srcdir)/../win/win32/mhrip.c tile.o: tile.c $(HACK_H) qt_win.o: $(srcdir)/../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \ ../include/dlb.h ../include/date.h ../include/patchlevel.h \ @@ -604,127 +765,241 @@ $(CXX) $(CXXFLAGS) -c $(srcdir)/../win/Qt/qttableview.cpp monstr.o: monstr.c $(CONFIG_H) vis_tab.o: vis_tab.c $(CONFIG_H) ../include/vis_tab.h -allmain.o: allmain.c $(HACK_H) ../include/patchlevel.h -alloc.o: alloc.c $(CONFIG_H) -apply.o: apply.c $(HACK_H) ../include/edog.h ../include/eleash.h -artifact.o: artifact.c $(HACK_H) ../include/artifact.h ../include/artilist.h -attrib.o: attrib.c $(HACK_H) -ball.o: ball.c $(HACK_H) -bones.o: bones.c $(HACK_H) ../include/lev.h -botl.o: botl.c $(HACK_H) -cmd.o: cmd.c $(HACK_H) ../include/func_tab.h -dbridge.o: dbridge.c $(HACK_H) -decl.o: decl.c $(HACK_H) -detect.o: detect.c $(HACK_H) ../include/artifact.h -dig.o: dig.c $(HACK_H) ../include/edog.h -display.o: display.c $(HACK_H) -dlb.o: dlb.c $(CONFIG_H) ../include/dlb.h -do.o: do.c $(HACK_H) ../include/lev.h -do_name.o: do_name.c $(HACK_H) -do_wear.o: do_wear.c $(HACK_H) -dog.o: dog.c $(HACK_H) ../include/edog.h ../include/emin.h ../include/epri.h -dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h ../include/edog.h \ - ../include/emin.h ../include/epri.h ../include/eleash.h -dokick.o: dokick.c $(HACK_H) ../include/eshk.h -dothrow.o: dothrow.c $(HACK_H) ../include/edog.h -drawing.o: drawing.c $(HACK_H) ../include/tcap.h -dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h -eat.o: eat.c $(HACK_H) -end.o: end.c $(HACK_H) ../include/eshk.h ../include/dlb.h -engrave.o: engrave.c $(HACK_H) ../include/lev.h -exper.o: exper.c $(HACK_H) -explode.o: explode.c $(HACK_H) -extralev.o: extralev.c $(HACK_H) -files.o: files.c $(HACK_H) ../include/dlb.h ../include/filename.h \ +allmain.o: $(srcdir)/allmain.c $(HACK_H) ../include/patchlevel.h + $(CC) $(CFLAGS) -c $(srcdir)/allmain.c +alloc.o: $(srcdir)/alloc.c $(CONFIG_H) + $(CC) $(CFLAGS) -c $(srcdir)/alloc.c +apply.o: $(srcdir)/apply.c $(HACK_H) ../include/edog.h ../include/eleash.h + $(CC) $(CFLAGS) -c $(srcdir)/apply.c +artifact.o: $(srcdir)/artifact.c $(HACK_H) ../include/artifact.h \ + ../include/artilist.h + $(CC) $(CFLAGS) -c $(srcdir)/artifact.c +attrib.o: $(srcdir)/attrib.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/attrib.c +ball.o: $(srcdir)/ball.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/ball.c +bones.o: $(srcdir)/bones.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/bones.c +botl.o: $(srcdir)/botl.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/botl.c +cmd.o: $(srcdir)/cmd.c $(HACK_H) ../include/func_tab.h + $(CC) $(CFLAGS) -c $(srcdir)/cmd.c +dbridge.o: $(srcdir)/dbridge.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/dbridge.c +decl.o: $(srcdir)/decl.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/decl.c +detect.o: $(srcdir)/detect.c $(HACK_H) ../include/artifact.h + $(CC) $(CFLAGS) -c $(srcdir)/detect.c +dig.o: $(srcdir)/dig.c $(HACK_H) ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/dig.c +display.o: $(srcdir)/display.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/display.c +dlb.o: $(srcdir)/dlb.c $(CONFIG_H) ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/dlb.c +do.o: $(srcdir)/do.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/do.c +do_name.o: $(srcdir)/do_name.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/do_name.c +do_wear.o: $(srcdir)/do_wear.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/do_wear.c +dog.o: $(srcdir)/dog.c $(HACK_H) ../include/edog.h ../include/emin.h \ + ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/dog.c +dogmove.o: $(srcdir)/dogmove.c $(HACK_H) ../include/mfndpos.h \ + ../include/edog.h ../include/emin.h ../include/epri.h \ + ../include/eleash.h + $(CC) $(CFLAGS) -c $(srcdir)/dogmove.c +dokick.o: $(srcdir)/dokick.c $(HACK_H) ../include/eshk.h + $(CC) $(CFLAGS) -c $(srcdir)/dokick.c +dothrow.o: $(srcdir)/dothrow.c $(HACK_H) ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/dothrow.c +drawing.o: $(srcdir)/drawing.c $(HACK_H) ../include/tcap.h + $(CC) $(CFLAGS) -c $(srcdir)/drawing.c +dungeon.o: $(srcdir)/dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/dungeon.c +eat.o: $(srcdir)/eat.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/eat.c +end.o: $(srcdir)/end.c $(HACK_H) ../include/eshk.h ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/end.c +engrave.o: $(srcdir)/engrave.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/engrave.c +exper.o: $(srcdir)/exper.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/exper.c +explode.o: $(srcdir)/explode.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/explode.c +extralev.o: $(srcdir)/extralev.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/extralev.c +files.o: $(srcdir)/files.c $(HACK_H) ../include/dlb.h ../include/filename.h \ ../include/winGL.h ../include/winproxy.h -fountain.o: fountain.c $(HACK_H) -hack.o: hack.c $(HACK_H) -hacklib.o: hacklib.c $(HACK_H) -invent.o: invent.c $(HACK_H) -light.o: light.c $(HACK_H) ../include/lev.h -lock.o: lock.c $(HACK_H) -mail.o: mail.c $(HACK_H) ../include/mail.h -makemon.o: makemon.c $(HACK_H) ../include/epri.h ../include/emin.h \ + $(CC) $(CFLAGS) -c $(srcdir)/files.c +fountain.o: $(srcdir)/fountain.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/fountain.c +hack.o: $(srcdir)/hack.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/hack.c +hacklib.o: $(srcdir)/hacklib.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/hacklib.c +invent.o: $(srcdir)/invent.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/invent.c +light.o: $(srcdir)/light.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/light.c +lock.o: $(srcdir)/lock.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/lock.c +mail.o: $(srcdir)/mail.c $(HACK_H) ../include/mail.h + $(CC) $(CFLAGS) -c $(srcdir)/mail.c +makemon.o: $(srcdir)/makemon.c $(HACK_H) ../include/epri.h ../include/emin.h \ ../include/edog.h -mapglyph.o: mapglyph.c $(HACK_H) -mcastu.o: mcastu.c $(HACK_H) -mhitm.o: mhitm.c $(HACK_H) ../include/artifact.h ../include/edog.h -mhitu.o: mhitu.c $(HACK_H) ../include/artifact.h ../include/edog.h -minion.o: minion.c $(HACK_H) ../include/emin.h ../include/epri.h -mklev.o: mklev.c $(HACK_H) -mkmap.o: mkmap.c $(HACK_H) ../include/sp_lev.h -mkmaze.o: mkmaze.c $(HACK_H) ../include/sp_lev.h ../include/lev.h -mkobj.o: mkobj.c $(HACK_H) -mkroom.o: mkroom.c $(HACK_H) -mon.o: mon.c $(HACK_H) ../include/mfndpos.h ../include/edog.h \ + $(CC) $(CFLAGS) -c $(srcdir)/makemon.c +mapglyph.o: $(srcdir)/mapglyph.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mapglyph.c +mcastu.o: $(srcdir)/mcastu.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mcastu.c +mhitm.o: $(srcdir)/mhitm.c $(HACK_H) ../include/artifact.h ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/mhitm.c +mhitu.o: $(srcdir)/mhitu.c $(HACK_H) ../include/artifact.h ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/mhitu.c +minion.o: $(srcdir)/minion.c $(HACK_H) ../include/emin.h ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/minion.c +mklev.o: $(srcdir)/mklev.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mklev.c +mkmap.o: $(srcdir)/mkmap.c $(HACK_H) ../include/sp_lev.h + $(CC) $(CFLAGS) -c $(srcdir)/mkmap.c +mkmaze.o: $(srcdir)/mkmaze.c $(HACK_H) ../include/sp_lev.h ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/mkmaze.c +mkobj.o: $(srcdir)/mkobj.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mkobj.c +mkroom.o: $(srcdir)/mkroom.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mkroom.c +mon.o: $(srcdir)/mon.c $(HACK_H) ../include/mfndpos.h ../include/edog.h \ ../include/artifact.h -mondata.o: mondata.c $(HACK_H) ../include/eshk.h ../include/epri.h -monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h ../include/artifact.h \ - ../include/epri.h -monst.o: monst.c $(CONFIG_H) ../include/permonst.h ../include/align.h \ - ../include/monattk.h ../include/monflag.h ../include/monsym.h \ - ../include/dungeon.h ../include/eshk.h ../include/vault.h \ - ../include/epri.h ../include/egyp.h ../include/color.h -mplayer.o: mplayer.c $(HACK_H) -mthrowu.o: mthrowu.c $(HACK_H) -muse.o: muse.c $(HACK_H) ../include/edog.h -music.o: music.c $(HACK_H) #interp.c -o_init.o: o_init.c $(HACK_H) ../include/lev.h -objects.o: objects.c $(CONFIG_H) ../include/obj.h ../include/objclass.h \ - ../include/prop.h ../include/skills.h ../include/color.h -objnam.o: objnam.c $(HACK_H) -options.o: options.c $(CONFIG_H) ../include/objclass.h ../include/flag.h \ - $(HACK_H) ../include/tcap.h ../include/winGL.h \ - ../include/filename.h -pager.o: pager.c $(HACK_H) ../include/dlb.h -pickup.o: pickup.c $(HACK_H) -pline.o: pline.c $(HACK_H) ../include/epri.h ../include/edog.h -polyself.o: polyself.c $(HACK_H) -potion.o: potion.c $(HACK_H) -pray.o: pray.c $(HACK_H) ../include/epri.h -priest.o: priest.c $(HACK_H) ../include/mfndpos.h ../include/eshk.h \ + $(CC) $(CFLAGS) -c $(srcdir)/mon.c +mondata.o: $(srcdir)/mondata.c $(HACK_H) ../include/eshk.h ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/mondata.c +monmove.o: $(srcdir)/monmove.c $(HACK_H) ../include/mfndpos.h \ + ../include/artifact.h ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/monmove.c +monst.o: $(srcdir)/monst.c $(CONFIG_H) ../include/permonst.h \ + ../include/align.h ../include/monattk.h ../include/monflag.h \ + ../include/monsym.h ../include/dungeon.h ../include/eshk.h \ + ../include/vault.h ../include/epri.h ../include/egyp.h \ + ../include/color.h + $(CC) $(CFLAGS) -c $(srcdir)/monst.c +mplayer.o: $(srcdir)/mplayer.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mplayer.c +mthrowu.o: $(srcdir)/mthrowu.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/mthrowu.c +muse.o: $(srcdir)/muse.c $(HACK_H) ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/muse.c +music.o: $(srcdir)/music.c $(HACK_H) #interp.c + $(CC) $(CFLAGS) -c $(srcdir)/music.c +o_init.o: $(srcdir)/o_init.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/o_init.c +objects.o: $(srcdir)/objects.c $(CONFIG_H) ../include/obj.h \ + ../include/objclass.h ../include/prop.h ../include/skills.h \ + ../include/color.h objects.c + $(CC) $(CFLAGS) -c $(srcdir)/objects.c +objnam.o: $(srcdir)/objnam.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/objnam.c +options.o: $(srcdir)/options.c $(CONFIG_H) ../include/objclass.h \ + ../include/flag.h $(HACK_H) ../include/tcap.h \ + ../include/winGL.h ../include/filename.h + $(CC) $(CFLAGS) -c $(srcdir)/options.c +pager.o: $(srcdir)/pager.c $(HACK_H) ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/pager.c +pickup.o: $(srcdir)/pickup.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/pickup.c +pline.o: $(srcdir)/pline.c $(HACK_H) ../include/epri.h ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/pline.c +polyself.o: $(srcdir)/polyself.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/polyself.c +potion.o: $(srcdir)/potion.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/potion.c +pray.o: $(srcdir)/pray.c $(HACK_H) ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/pray.c +priest.o: $(srcdir)/priest.c $(HACK_H) ../include/mfndpos.h ../include/eshk.h \ ../include/epri.h ../include/emin.h -quest.o: quest.c $(HACK_H) ../include/qtext.h -questpgr.o: questpgr.c $(HACK_H) ../include/dlb.h ../include/qtext.h -read.o: read.c $(HACK_H) -rect.o: rect.c $(HACK_H) -region.o: region.c $(HACK_H) ../include/lev.h -restore.o: restore.c $(HACK_H) ../include/lev.h ../include/tcap.h -rip.o: rip.c $(HACK_H) -rnd.o: rnd.c $(HACK_H) -role.o: role.c $(HACK_H) -rumors.o: rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h -save.o: save.c $(HACK_H) ../include/lev.h -shk.o: shk.c $(HACK_H) ../include/eshk.h -shknam.o: shknam.c $(HACK_H) ../include/eshk.h -sit.o: sit.c $(HACK_H) ../include/artifact.h -sounds.o: sounds.c $(HACK_H) ../include/edog.h -sp_lev.o: sp_lev.c $(HACK_H) ../include/dlb.h ../include/sp_lev.h -spell.o: spell.c $(HACK_H) ../include/edog.h -steal.o: steal.c $(HACK_H) -steed.o: steed.c $(HACK_H) -teleport.o: teleport.c $(HACK_H) -timeout.o: timeout.c $(HACK_H) ../include/lev.h -topten.o: topten.c $(HACK_H) ../include/dlb.h ../include/patchlevel.h -track.o: track.c $(HACK_H) -trap.o: trap.c $(HACK_H) -u_init.o: u_init.c $(HACK_H) -uhitm.o: uhitm.c $(HACK_H) -vault.o: vault.c $(HACK_H) ../include/vault.h -version.o: version.c $(HACK_H) ../include/date.h ../include/patchlevel.h -vision.o: vision.c $(HACK_H) ../include/vis_tab.h -weapon.o: weapon.c $(HACK_H) -were.o: were.c $(HACK_H) -wield.o: wield.c $(HACK_H) -windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \ - ../include/winGL.h ../include/winproxy.h -wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h -worm.o: worm.c $(HACK_H) ../include/lev.h -worn.o: worn.c $(HACK_H) -write.o: write.c $(HACK_H) -zap.o: zap.c $(HACK_H) -gypsy.o: gypsy.c $(HACK_H) ../include/egyp.h ../include/qtext.h -tech.o: tech.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/priest.c +quest.o: $(srcdir)/quest.c $(HACK_H) ../include/qtext.h + $(CC) $(CFLAGS) -c $(srcdir)/quest.c +questpgr.o: $(srcdir)/questpgr.c $(HACK_H) ../include/dlb.h ../include/qtext.h + $(CC) $(CFLAGS) -c $(srcdir)/questpgr.c +read.o: $(srcdir)/read.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/read.c +rect.o: $(srcdir)/rect.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/rect.c +region.o: $(srcdir)/region.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/region.c +restore.o: $(srcdir)/restore.c $(HACK_H) ../include/lev.h ../include/tcap.h + $(CC) $(CFLAGS) -c $(srcdir)/restore.c +rip.o: $(srcdir)/rip.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/rip.c +rnd.o: $(srcdir)/rnd.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/rnd.c +role.o: $(srcdir)/role.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/role.c +rumors.o: $(srcdir)/rumors.c $(HACK_H) ../include/lev.h ../include/dlb.h + $(CC) $(CFLAGS) -c $(srcdir)/rumors.c +save.o: $(srcdir)/save.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/save.c +shk.o: $(srcdir)/shk.c $(HACK_H) ../include/eshk.h + $(CC) $(CFLAGS) -c $(srcdir)/shk.c +shknam.o: $(srcdir)/shknam.c $(HACK_H) ../include/eshk.h + $(CC) $(CFLAGS) -c $(srcdir)/shknam.c +sit.o: $(srcdir)/sit.c $(HACK_H) ../include/artifact.h + $(CC) $(CFLAGS) -c $(srcdir)/sit.c +sounds.o: $(srcdir)/sounds.c $(HACK_H) ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/sounds.c +sp_lev.o: $(srcdir)/sp_lev.c $(HACK_H) ../include/dlb.h ../include/sp_lev.h + $(CC) $(CFLAGS) -c $(srcdir)/sp_lev.c +spell.o: $(srcdir)/spell.c $(HACK_H) ../include/edog.h + $(CC) $(CFLAGS) -c $(srcdir)/spell.c +steal.o: $(srcdir)/steal.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/steal.c +steed.o: $(srcdir)/steed.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/steed.c +teleport.o: $(srcdir)/teleport.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/teleport.c +timeout.o: $(srcdir)/timeout.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/timeout.c +topten.o: $(srcdir)/topten.c $(HACK_H) ../include/dlb.h ../include/patchlevel.h + $(CC) $(CFLAGS) -c $(srcdir)/topten.c +track.o: $(srcdir)/track.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/track.c +trap.o: $(srcdir)/trap.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/trap.c +u_init.o: $(srcdir)/u_init.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/u_init.c +uhitm.o: $(srcdir)/uhitm.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/uhitm.c +vault.o: $(srcdir)/vault.c $(HACK_H) ../include/vault.h + $(CC) $(CFLAGS) -c $(srcdir)/vault.c +version.o: $(srcdir)/version.c $(HACK_H) ../include/date.h \ + ../include/patchlevel.h + $(CC) $(CFLAGS) -c $(srcdir)/version.c +vision.o: $(srcdir)/vision.c $(HACK_H) ../include/vis_tab.h + $(CC) $(CFLAGS) -c $(srcdir)/vision.c +weapon.o: $(srcdir)/weapon.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/weapon.c +were.o: $(srcdir)/were.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/were.c +wield.o: $(srcdir)/wield.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/wield.c +windows.o: $(srcdir)/windows.c $(HACK_H) ../include/wingem.h \ + ../include/winGnome.h ../include/winGL.h ../include/winproxy.h + $(CC) $(CFLAGS) -c $(srcdir)/windows.c +wizard.o: $(srcdir)/wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h + $(CC) $(CFLAGS) -c $(srcdir)/wizard.c +worm.o: $(srcdir)/worm.c $(HACK_H) ../include/lev.h + $(CC) $(CFLAGS) -c $(srcdir)/worm.c +worn.o: $(srcdir)/worn.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/worn.c +write.o: $(srcdir)/write.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/write.c +zap.o: $(srcdir)/zap.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/zap.c +gypsy.o: $(srcdir)/gypsy.c $(HACK_H) ../include/egyp.h ../include/qtext.h + $(CC) $(CFLAGS) -c $(srcdir)/gypsy.c +tech.o: $(srcdir)/tech.c $(HACK_H) + $(CC) $(CFLAGS) -c $(srcdir)/tech.c # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above diff -Naurbd slashem-0.0.8E0/sys/autoconf/Makefile.top slashem-0.0.8E0F1/sys/autoconf/Makefile.top --- slashem-0.0.8E0/sys/autoconf/Makefile.top 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/Makefile.top 2006-05-15 12:13:10.000000000 +0100 @@ -19,7 +19,9 @@ # make NetHack PREFIX = @prefix@ -GAME = slashem +EXEEXT = @EXEEXT@ +SCRIPT = slashem +GAME = slashem$(EXEEXT) # GAME = slashem.prg GAMEUID = games GAMEGRP = bin @@ -119,10 +121,7 @@ # will only work if setuid (or setgid) behavior is not desired or required. CHOWN = @CHOWN@ CHGRP = @CHGRP@ -# CHOWN = chown -# CHGRP = chgrp -# CHOWN = true -# CHGRP = true +CHMOD = @CHMOD@ # # end of configuration @@ -152,7 +151,7 @@ $(GAME): ( cd src ; $(MAKE) ) -all: $(GAME) recover Guidebook $(CNF_SHARE_DAT) dungeon spec_levs check-dlb +all: $(GAME) recover$(EXEEXT) Guidebook $(CNF_SHARE_DAT) dungeon spec_levs check-dlb @echo "Done." # Note: many of the dependencies below are here to allow parallel make @@ -192,8 +191,8 @@ Guidebook.txt: ( cd doc; $(MAKE) Guidebook.txt ) -nhtiles.bmp: $(GAME) - ( cd dat ; $(MAKE) nhtiles.bmp ) +tiles.bmp: $(GAME) + ( cd dat ; $(MAKE) tiles.bmp ) x11tiles: $(GAME) ( cd util ; $(MAKE) tile2x11 ) @@ -278,8 +277,8 @@ # recover can be used when INSURANCE is defined in include/config.h # and the checkpoint option is true -recover: $(GAME) - ( cd util ; $(MAKE) recover ) +recover$(EXEEXT): $(GAME) + ( cd util ; $(MAKE) recover$(EXEEXT) ) dofiles: target=`sed -n \ @@ -289,27 +288,28 @@ -e '}' \ -e '$$s/.*/nodlb/p' < dat/options` ; \ $(MAKE) dofiles-$${target-nodlb} - cp src/$(GAME) $(FILE_AREA_UNSHARE) - cp util/recover $(FILE_AREA_UNSHARE) + (cd src; cp $(GAME) @EXTRA_UNSHARE@ $(FILE_AREA_UNSHARE)) + @HOST_MSWIN@cp $(srcdir)/sys/winnt/defaults.nh $(FILE_AREA_UNSHARE) + cp util/recover$(EXEEXT) $(FILE_AREA_UNSHARE) cp $(srcdir)/dat/license $(srcdir)/doc/Guidebook.txt $(FILE_AREA_DOC) # cp win/Qt/KDE/kslashem.kdelnk $(KDEDIR)/share/applnk/Games - -rm -f $(SHELLDIR)/$(GAME) - sed -e 's;/usr/games/lib/nethackdir;$(FILE_AREA_UNSHARE);' \ - -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ - < $(srcdir)/sys/unix/nethack.sh \ - > $(SHELLDIR)/$(GAME) + @HOST_UNIX@-rm -f $(SHELLDIR)/$(SCRIPT) + @HOST_UNIX@sed -e 's;/usr/games/lib/nethackdir;$(FILE_AREA_UNSHARE);' \ + @HOST_UNIX@ -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ + @HOST_UNIX@ < $(srcdir)/sys/unix/nethack.sh \ + @HOST_UNIX@ > $(SHELLDIR)/$(SCRIPT) # set up their permissions - -( cd $(FILE_AREA_UNSHARE) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \ - $(CHGRP) $(GAMEGRP) $(GAME) recover ) + -( cd $(FILE_AREA_UNSHARE) ; $(CHOWN) $(GAMEUID) $(GAME) recover$(EXEEXT) ; \ + $(CHGRP) $(GAMEGRP) $(GAME) recover$(EXEEXT) ) chmod $(GAMEPERM) $(FILE_AREA_UNSHARE)/$(GAME) - chmod $(EXEPERM) $(FILE_AREA_UNSHARE)/recover + chmod $(EXEPERM) $(FILE_AREA_UNSHARE)/recover$(EXEEXT) -( cd $(FILE_AREA_DOC) ; \ $(CHOWN) $(GAMEUID) license Guidebook.txt ; \ $(CHGRP) $(GAMEGRP) license Guidebook.txt ; \ chmod $(FILEPERM) license Guidebook.txt ) - -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME) - $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME) - chmod $(EXEPERM) $(SHELLDIR)/$(GAME) + @HOST_UNIX@-$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(SCRIPT) + @HOST_UNIX@$(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(SCRIPT) + @HOST_UNIX@chmod $(EXEPERM) $(SHELLDIR)/$(SCRIPT) dofiles-dlb: check-dlb ( cd dat ; cp nhshare $(SHARE_DATNODLB) $(FILE_AREA_SHARE) ) @@ -336,7 +336,7 @@ $(CHGRP) $(GAMEGRP) $(UNSHARE_DAT) ; \ chmod $(FILEPERM) $(UNSHARE_DAT) ) -update: $(GAME) recover $(CNF_SHARE_DAT) dungeon spec_levs Guidebook.txt +update: $(GAME) recover$(EXEEXT) $(CNF_SHARE_DAT) dungeon spec_levs Guidebook.txt # (don't yank the old version out from under people who're playing it) -mv $(FILE_AREA_UNSHARE)/$(GAME) $(FILE_AREA_UNSHARE)/$(GAME).old # quest.dat is also kept open and has the same problems over NFS @@ -352,7 +352,7 @@ # and a reminder @echo You may also want to install the man pages via the doc Makefile. -install: $(GAME) recover $(CNF_SHARE_DAT) dungeon spec_levs Guidebook.txt +install: $(GAME) recover$(EXEEXT) $(CNF_SHARE_DAT) dungeon spec_levs Guidebook.txt # set up the directories # not all mkdirs have -p; those that don't will create a -p directory -mkdir -p $(SHELLDIR) diff -Naurbd slashem-0.0.8E0/sys/autoconf/Makefile.utl slashem-0.0.8E0F1/sys/autoconf/Makefile.utl --- slashem-0.0.8E0/sys/autoconf/Makefile.utl 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/Makefile.utl 2006-05-15 12:13:10.000000000 +0100 @@ -17,6 +17,7 @@ # execute things like 'foo.o') # MAKE = make +EXEEXT = @EXEEXT@ CC = @CC@ -DAUTOCONF # if you are using gcc as your compiler, @@ -95,7 +96,7 @@ # flags for debugging: # CFLAGS = -g -I../include -I$(srcdir)/../include -CFLAGS = -O -I../include -I$(srcdir)/../include +CFLAGS = -O -I../include -I$(srcdir)/../include @CFLAGS@ LFLAGS = LIBS = @@ -280,8 +281,8 @@ # dependencies for recover # -recover: $(RECOVOBJS) - $(CC) $(LFLAGS) -o recover $(RECOVOBJS) $(LIBS) +recover$(EXEEXT): $(RECOVOBJS) + $(CC) $(LFLAGS) -o recover$(EXEEXT) $(RECOVOBJS) $(LIBS) recover.o: recover.c $(CONFIG_H) ../include/date.h @@ -292,9 +293,17 @@ $(CC) $(LFLAGS) -o dlb $(DLBOBJS) $(LIBS) dlb_main.o: dlb_main.c $(CONFIG_H) ../include/dlb.h ../include/date.h - $(CC) $(CFLAGS) -c dlb_main.c + $(CC) $(CFLAGS) -c $(srcdir)/dlb_main.c +# dependencies for uudecode +# +uudecode$(EXEEXT): uudecode.o + $(CC) $(LFLAGS) -o $@ uudecode.o + +uudecode.o: $(srcdir)/../sys/share/uudecode.c + $(CC) $(CFLAGS) -c $(srcdir)/../sys/share/uudecode.c + # dependencies for tile utilities # @@ -332,8 +341,8 @@ tile2img.ttp: tile2img.o bitmfile.o $(TEXT_IO) $(CC) $(LFLAGS) -o tile2img.ttp tile2img.o bitmfile.o $(TEXT_IO) $(LIBS) -tile2bmp: tile2bmp.o $(TEXT_IO) - $(CC) $(LFLAGS) -o tile2bmp tile2bmp.o $(TEXT_IO) +tile2bmp$(EXEEXT): tile2bmp.o $(TEXT_IO) + $(CC) $(LFLAGS) -o $@ tile2bmp.o $(TEXT_IO) xpm2img.ttp: xpm2img.o bitmfile.o $(CC) $(LFLAGS) -o xpm2img.ttp xpm2img.o bitmfile.o $(LIBS) @@ -342,7 +351,7 @@ $(CC) $(LFLAGS) -o tile2beos tile2beos.o $(TEXT_IO) -lbe tile2png: tile2png.o $(TEXT_IO) - $(CC) $(LFLAGS) -o tile2png tile2png.o $(TEXT_IO) -lz -lpng + $(CC) $(LFLAGS) -o tile2png tile2png.o $(TEXT_IO) @NETHACK_LIBPNG_LIBS@ tilemap: $(srcdir)/../win/share/tilemap.c $(HACK_H) $(CC) $(CFLAGS) $(LFLAGS) -o tilemap $(srcdir)/../win/share/tilemap.c $(LIBS) @@ -441,7 +450,7 @@ -rm -f lev_lex.c lev_yacc.c dgn_lex.c dgn_yacc.c -rm -f ../include/lev_comp.h ../include/dgn_comp.h -rm -f ../include/tile.h - -rm -f makedefs lev_comp dgn_comp recover dlb + -rm -f makedefs lev_comp dgn_comp recover$(EXEEXT) dlb -rm -f gif2txt xpm2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp tilemap -rm -f magtile bigtile txtmerge txtfilt txtbg mapmerge tile2png diff -Naurbd slashem-0.0.8E0/sys/autoconf/acinclude.m4 slashem-0.0.8E0F1/sys/autoconf/acinclude.m4 --- slashem-0.0.8E0/sys/autoconf/acinclude.m4 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/acinclude.m4 2006-05-15 12:13:10.000000000 +0100 @@ -1,38 +1,173 @@ -# $Id: acinclude.m4,v 1.1 2005/06/11 15:52:45 j_ali Exp $ +# $Id: acinclude.m4,v 1.5 2005/09/17 14:58:33 j_ali Exp $ -AC_DEFUN([NETHACK_ENABLE], +# Front-end of AC_ARG_ENABLE +# Usage: +# NETHACK_ARG([feature], [description], [pre-processor switch], [default], +# [action-if-auto]) +# Note that the action-if-auto argument is only used if the default is auto +# (and the user doesn't specify). The action should set the shell variable +# enable_feature, with any '-' characters changed into '_'. +AC_DEFUN([NETHACK_ARG], [AC_MSG_CHECKING(whether to enable $1) - AC_ARG_ENABLE([$2], AC_HELP_STRING([--enable-$1],[$3 (default=yes)]), - enable_$2="$enableval",enable_$2="no") - AC_MSG_RESULT($enable_$2) - if test "$enable_$2" != "no" ; then - AC_DEFINE_UNQUOTED([$4], [], [$3]) + AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1],[$2 (default=$4)]), + [],m4_if([$4], [auto], [$5], [enable_]m4_bpatsubst([$1], -, _)="[$4]")) + AC_MSG_RESULT([$enable_]m4_bpatsubst([$1], -, _)) + if test "[$enable_]m4_bpatsubst([$1], -, _)" != "no" ; then + AC_DEFINE_UNQUOTED([$3], [], [$2]) fi ]) -AC_DEFUN([NETHACK_DISABLE], - [AC_MSG_CHECKING(whether to enable $1) - AC_ARG_ENABLE([$2], AC_HELP_STRING([--enable-$1],[$3 (default=yes)]), - enable_$2="$enableval",enable_$2="yes") - AC_MSG_RESULT($enable_$2) - if test "$enable_$2" != "no" ; then - AC_DEFINE_UNQUOTED([$4], [], [$3]) - fi - ]) +# NETHACK_WIN_ENABLE(win, default, help-text) +# ------------------------------------------- +AC_DEFUN([NETHACK_WIN_ENABLE],[AC_ARG_ENABLE($1-graphics, + [AC_HELP_STRING([--enable-$1-graphics], + m4_ifval([$3],[$3],[use $1-graphics]) [(default=$2)])], + [enable_$1_graphics="$enableval"], [enable_$1_graphics="$2"]) + if test "$enable_$1_graphics" != "no"; then + nethack_wins="$1 $nethack_wins" + fi]) + +# NETHACK_AUTO_WIN_DISABLE(win) +# ----------------------------- +# Disable a windowing system previously set to auto. +AC_DEFUN([NETHACK_AUTO_WIN_DISABLE],[enable_$1_graphics="no" + nethack_wins=`echo $nethack_wins | sed 's/$1 //'` +]) +# NETHACK__LINK_ADD(DEST, [SOURCE]) +# --------------------------------- # Update if there is a newer source +AC_DEFUN([NETHACK__LINK_ADD], + [m4_ifval([$2],[if test ! -f $1 -o ${srcdir}/$2 -nt $1 ; then + NETHACK_LINKS="${NETHACK_LINKS} $1:$2" + fi],[NETHACK__LINK_ADD([$1],[$1])])]) AC_DEFUN([NETHACK_LINKS_ADD], - if test ${srcdir}/$1 -nt $1 ; then - NETHACK_LINKS="${LINKS_LIST} $1:$1" - fi) + [AC_FOREACH([NETHACK_File],[$1], + [NETHACK__LINK_ADD(m4_bpatsubst(NETHACK_File,[:],[,]))])]) # Autoconf's standard AC_CONFIG_HEADERS() avoids undefining switches because # of concern that it might undefine system switches (eg., POSIX_SOURCE). -# However, we need to override the settings in config.h etc., so we -# post-process the generated headers and force an explicit define or undefine. +# However, we need to override the settings in config.h etc., so we post-process +# the generated headers and force an explicit define and/or undefine. AC_DEFUN([NETHACK_CONFIG_HEADER], [AC_CONFIG_HEADERS([$1], - [sed 's,^/\* \(#undef .*\) \*/,\1,'] < m4_bpatsubst([$1], [:.*]) \ - > m4_bpatsubst([$1], [[^.]*:.*], [new]) + [sed -e 's,^/\* \(#undef .*\) \*/,\1,' \ + -e '/#define [^ ]*/ { h; s,#define \([^ ]*\).*,#undef \1,p; g; }'] \ + < m4_bpatsubst([$1], [:.*]) > m4_bpatsubst([$1], [[^.]*:.*], [new]) [mv] m4_bpatsubst([$1], [[^.]*:.*], [new]) \ m4_bpatsubst([$1], [:.*]),[])]) + +# NETHACK__ADD_FLAG(output-variable, existing-flags, flag) +# --------------------------------- +# Add a compiler flag to a variable. A number of flags are recognized and +# handled specially (specifically, -I, -L and -l). +AC_DEFUN([NETHACK__ADD_FLAG],[[ + case "$3" in + -I*|-L*|-l*) + for flag in $2; do + if test $flag = "$3"; then + break + fi + done + if test $flag = "$3"; then + $1="$2" + else + case "$3" in + -L*)$1="$3 $2";; + *) $1="$2 $3";; + esac + fi + ;; + *) $1="$2 $3";; + esac +]]) + +# NETHACK__ADD_FLAGS(output-variable, existing-flags, new-flags) +# --------------------------------- +# Front-end to NETHACK__ADD_FLAG. Add compiler flags to a variable. +AC_DEFUN([NETHACK__ADD_FLAGS],[ + for flag in $3; do + NETHACK__ADD_FLAG([$1], [$2], [$flag]) + done +]) + +# NETHACK__TRY_LIBPNG(STUFF, cflags, libs, action-if, action-if-not) +# --------------------------------- +# Try linking with libpng using the given cflags and libs. +AC_DEFUN([NETHACK__TRY_LIBPNG],[ + nethack__save_cflags=$CFLAGS + nethack__save_libs=$LIBS + CFLAGS="$CFLAGS $2" + LIBS="$LIBS $3" + AC_MSG_CHECKING([if libpng is useable with $CFLAGS and $LIBS]) + AC_TRY_LINK([#include ], + [png_structp ptr= + png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);], + [$1_CFLAGS="$2"; $1_LIBS="$3"; AC_MSG_RESULT([yes]); $4], + [AC_MSG_RESULT([no]); $5]) + CFLAGS=$nethack__save_cflags + LIBS=$nethack__save_libs]) + +# NETHACK_CHECK_LIBPNG(stuff, action-if, action-if-not) +# --------------------------------- +# Check if libpng can be used +AC_DEFUN([NETHACK_CHECK_LIBPNG],[ + # Slash'EM may well work with earlier versions, + # but 1.2.4 is the earliest tested to date. + PKG_CHECK_MODULES(NETHACK__LIBPNG, libpng >= 1.2.4, + [nethack__succeeded=maybe], [nethack__succeeded=no]) + # Slash'EM doesn't use zlib directly, but libpng does. This should + # all be handled in libpng.pc, but isn't in many versions of libpng. + if test $nethack__succeeded = maybe; then + NETHACK__ADD_FLAGS(nethack__libs, [$NETHACK__LIBPNG_LIBS], [-lz]) + NETHACK__TRY_LIBPNG($1, $NETHACK__LIBPNG_CFLAGS, $nethack__libs, + [nethack__succeeded=yes], []) + fi + # If the user has supplied flags, then believe them. + if test $nethack__succeeded = maybe -a \ + \( -n "$ZLIB_CFLAGS" -o -n "$ZLIB_LIBS" \); then + NETHACK__ADD_FLAGS(nethack__cflags, [$NETHACK__LIBPNG_CFLAGS], + [$ZLIB_CFLAGS]) + NETHACK__ADD_FLAGS(nethack__libs, [$NETHACK__LIBPNG_LIBS], + [$ZLIB_LIBS]) + NETHACK__TRY_LIBPNG($1, [$nethack__cflags], [$nethack__libs], + [nethack__succeeded=yes], []) + fi + # Otherwise, try pkg-config. + if test $nethack__succeeded = maybe; then + AC_MSG_CHECKING([for zlib]) + if $PKG_CONFIG --exists zlib; then + AC_MSG_RESULT([yes]) + NETHACK__ADD_FLAGS(nethack__cflags, [$NETHACK__LIBPNG_CFLAGS], + [`$PKG_CONFIG --cflags zlib`]) + NETHACK__ADD_FLAGS(nethack__libs, [$NETHACK__LIBPNG_LIBS], + [`$PKG_CONFIG --libs zlib`]) + NETHACK__TRY_LIBPNG($1, [$nethack__cflags], [$nethack__libs], + [nethack__succeeded=yes], []) + else + AC_MSG_RESULT([not found by pkg-config]) + fi + fi + # Try the same prefix as libpng since zlib is + # likely to be installed in the same place. + if test $nethack__succeeded = maybe; then + nethack__libpng_prefix=`$PKG_CONFIG --variable=prefix libpng` + NETHACK__ADD_FLAG(nethack__cflags, [$NETHACK__LIBPNG_CFLAGS], + [-I$nethack__libpng_prefix/include]) + NETHACK__ADD_FLAG(nethack__libs, [$NETHACK__LIBPNG_LIBS], + [-L$nethack__libpng_prefix/lib]) + NETHACK__ADD_FLAG(nethack__libs, [$nethack__libs], [-lz]) + NETHACK__TRY_LIBPNG($1, [$nethack__cflags], [$nethack__libs], + [nethack__succeeded=yes], []) + fi + if test $nethack__succeeded = yes; then + AC_MSG_CHECKING([$1_CFLAGS]) + AC_MSG_RESULT([${$1_CFLAGS}]) + AC_SUBST($1_CFLAGS) + AC_MSG_CHECKING([$1_LIBS]) + AC_MSG_RESULT([${$1_LIBS}]) + AC_SUBST($1_LIBS) + $2 + m4_ifval([$3],[else $3],[]) + fi +]) diff -Naurbd slashem-0.0.8E0/sys/autoconf/autoconf.hin slashem-0.0.8E0F1/sys/autoconf/autoconf.hin --- slashem-0.0.8E0/sys/autoconf/autoconf.hin 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/autoconf.hin 2006-05-15 12:13:10.000000000 +0100 @@ -6,9 +6,6 @@ /* Blackmarket */ #undef BLACKMARKET -/* Borg player (only under DOS) */ -#undef BORG - /* A BSD like system */ #undef BSD @@ -21,9 +18,15 @@ /* Unix on win32 */ #undef CYGWIN32 +/* The default windowing system */ +#undef DEFAULT_WINDOW_SYS + /* Support transparent tilesets */ #undef DISPLAY_LAYERS +/* Data librarian */ +#undef DLB + /* Dungeon growth */ #undef DUNGEON_GROWTH @@ -51,6 +54,14 @@ /* Gold is kept on object chains (experimental) */ #undef GOLDOBJ +/* Define to 1 if you have the declaration of `strncmpi', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCMPI + +/* Define to 1 if you have the declaration of `strnicmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNICMP + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -102,6 +113,9 @@ /* TTY graphics menu color */ #undef MENU_COLOR +/* Microsoft Window's native graphics */ +#undef MSWIN_GRAPHICS + /* Prevent wishing for special artifacts */ #undef NOARTIFACTWISH @@ -153,9 +167,6 @@ /* Succubi/incubi seduction */ #undef SEDUCE -/* Shouting and pet commands (not implemented) */ -#undef SHOUT - /* Display damage reports */ #undef SHOW_DMG @@ -171,7 +182,7 @@ /* Ability to ride monsters */ #undef STEED -/* strncmpi available */ +/* Use strncmpi */ #undef STRNCMPI /* A System V like system */ @@ -199,6 +210,12 @@ /* Fancy mazes */ #undef WALLIFIED_MAZE +/* An MS-Windows system */ +#undef WIN32 + +/* The person allowed to use the -D option */ +#undef WIZARD + /* X11 graphics */ #undef X11_GRAPHICS diff -Naurbd slashem-0.0.8E0/sys/autoconf/bootstrap.sh slashem-0.0.8E0F1/sys/autoconf/bootstrap.sh --- slashem-0.0.8E0/sys/autoconf/bootstrap.sh 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/bootstrap.sh 2006-05-15 12:13:10.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: bootstrap.sh,v 1.1 2005/06/11 15:52:45 j_ali Exp $ +# $Id: bootstrap.sh,v 1.2 2005/09/17 14:58:33 j_ali Exp $ # case "$0" in */*) confdir=`echo $0 | sed 's:/[^/]*$::'` ;; @@ -13,8 +13,10 @@ aclocal # We can't avoid running autotools in multiple directories, # but at least we can have only one cache. -rm -rf ../../autom4te.cache -mv autom4te.cache ../.. +if [ -d autom4te.cache ]; then # aclocal v1.7 doesn't create cache + rm -rf ../../autom4te.cache + mv autom4te.cache ../.. +fi # autoheader must be run from topdir since configure.ac refers # to sys/autoconf/autoconf.hin (cd ../.. && autoheader -I sys/autoconf sys/autoconf/configure.ac) diff -Naurbd slashem-0.0.8E0/sys/autoconf/configure.ac slashem-0.0.8E0F1/sys/autoconf/configure.ac --- slashem-0.0.8E0/sys/autoconf/configure.ac 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/configure.ac 2006-05-15 12:13:10.000000000 +0100 @@ -1,65 +1,93 @@ dnl SLASHEM autoconf template AC_INIT(SLASHEM, 0.0.8, http://sourceforge.net/bugs/?group_id=9746) -AC_REVISION($Revision: 1.1 $) +dnl Avoid AC_REVISION() because we check configure into CVS +dnl and it will cause confusing revision numbers to be included +dnl in configure if developers forget to check in configure.ac +dnl before running bootstrap.sh and checking in configure. +# $Revision: 1.5 $ +AC_CONFIG_SRCDIR(slamfaq.txt) +AC_SUBST(SRCDIR,[../$srcdir/src]) AC_CONFIG_AUX_DIR(sys/autoconf) dnl ----- Precious variables AC_ARG_VAR(CC, [C compiler]) AC_ARG_VAR(CHGRP, [sets GAMEUID (set this to true as a no op)]) AC_ARG_VAR(CHOWN, [sets GAMEGRP (set this to true as a no op)]) +AC_ARG_VAR(CHMOD, [sets file modes (set this to true as a no op)]) +AC_ARG_VAR(ZLIB_CFLAGS, [Compiler flags to find zlib header files]) +AC_ARG_VAR(ZLIB_LIBS, [Linker flags to find zlib library files]) AC_PROG_LN_S +AC_PROG_AWK dnl ----- Check options dnl ----- Window systems -AC_MSG_CHECKING(for valid window system configuration) -AC_ARG_ENABLE(tty-graphics, - AC_HELP_STRING([--enable-tty-graphics], - [use tty-graphics (default=yes)]), - enable_tty_graphics="$enableval",enable_tty_graphics="yes") -AC_ARG_ENABLE(proxy-graphics, - AC_HELP_STRING([--enable-proxy-graphics], - [use proxy-graphics (default=auto)]), - enable_proxy_graphics="$enableval",enable_proxy_graphics="auto") -AC_ARG_ENABLE(x11-graphics, - AC_HELP_STRING([--enable-x11-graphics], - [use x11-graphics (default=no)]), - enable_x11_graphics="$enableval",enable_x11_graphics="no") -AC_ARG_ENABLE(sdl-graphics, - AC_HELP_STRING([--enable-sdl-graphics], - [use sdl-graphics (default=no)]), - enable_sdl_graphics="$enableval",enable_sdl_graphics="no") -AC_ARG_ENABLE(gl-graphics, - AC_HELP_STRING([--enable-gl-graphics], - [use gl-graphics (enables sdl-graphics) (default=no)]), - [enable_gl_graphics="$enableval" - if test "$enable_gl_graphics" != "no" - then - enable_sdl_graphics="yes" - fi], - enable_gl_graphics="no") - -dnl ----- Sanity check - Must choose at least one -if test "$enable_tty_graphics" = "no" && test "$enable_x11_graphics" = "no" -then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([need to enable at least one window system]) +NETHACK_WIN_ENABLE(proxy, auto) +nethack_default_win="" +# Note: Order is important: The last listed enabled port will be the default. +NETHACK_WIN_ENABLE(tty, auto) +NETHACK_WIN_ENABLE(x11, no) +NETHACK_WIN_ENABLE(sdl, no) +NETHACK_WIN_ENABLE(gl, no, [use gl-graphics (enables sdl-graphics)]) +if test "$enable_gl_graphics" != no -a "$enable_sdl_graphics" = no; then + enable_sdl_graphics="yes" + nethack_wins=`echo $nethack_wins | sed 's/^gl/gl sdl/'` fi -AC_MSG_RESULT([yes]) +NETHACK_WIN_ENABLE(mswin, no, [use Microsoft Window's native graphics]) dnl ----- Figure out a C compiler to use; set @CC@ AC_PROG_CC +AC_SUBST(LFLAGS) dnl ----- Check OS -AC_CANONICAL_TARGET -dnl ------ Main unix types -case $target_os in - *bsd* ) AC_DEFINE(BSD,[],[A BSD like system]);; - * ) AC_DEFINE(SYSV,[],[A System V like system]);; +AC_CANONICAL_HOST +dnl ------ Main OS types +case $host_os in + mingw32 ) AC_DEFINE(WIN32,[],[An MS-Windows system]) + AC_SUBST(HOST_MSWIN,[]) + AC_SUBST(HOST_UNIX,[#]) + SYSTEM="Syswinnt" + SYSSRC="\${SYSMSWINSRC}" + SYSOBJ="\${SYSMSWINOBJ}" + ;; + *bsd* ) AC_DEFINE(BSD,[],[A BSD like system]) + AC_SUBST(HOST_MSWIN,[#]) + AC_SUBST(HOST_UNIX,[]) + SYSTEM="Sysunix" + SYSSRC="\${SYSUNIXSRC}" + SYSOBJ="\${SYSUNIXOBJ}" + ;; + * ) AC_DEFINE(SYSV,[],[A System V like system]) + AC_SUBST(HOST_MSWIN,[#]) + AC_SUBST(HOST_UNIX,[]) + SYSTEM="Sysunix" + SYSSRC="\${SYSUNIXSRC}" + SYSOBJ="\${SYSUNIXOBJ}" + ;; esac +AC_SUBST(SYSTEM) +AC_SUBST(SYSSRC) +AC_SUBST(SYSOBJ) + +if test $host_os = mingw32; then + AC_MSG_CHECKING([for how to build NetHack key dynamic libraries]) + if test "$GCC" = yes; then + AC_MSG_RESULT([gcc]) + AC_SUBST(NHKEYDLL_GCC,[]) + else + AC_MSG_RESULT([unknown]) + if test "$enable_tty_graphics" = yes; then + AC_MSG_ERROR([Don't know how to build NetHack key DLLs with $CC]) + else + AC_MSG_WARN([Can't enable tty graphics (key dynamic libraries)]) + NETHACK_AUTO_WIN_DISABLE(tty) + fi + fi +fi + dnl ------ Common subtypes -case $target_os in +case $host_os in *cygwin* ) AC_DEFINE(CYGWIN32,[],[Unix on win32]);; *linux* ) AC_DEFINE(LINUX,[],[GNU Linux]);; esac @@ -70,9 +98,13 @@ AC_PROG_YACC AC_CHECK_TOOLS(CHOWN,[chown true]) AC_CHECK_TOOLS(CHGRP,[chgrp true]) +AC_CHECK_TOOLS(CHMOD,[chmod true]) +AC_CHECK_TOOL(WINDRES,windres,no) dnl ----- Check for libraries +NETHACK_CHECK_LIBPNG(NETHACK_LIBPNG, have_libpng=yes, have_libpng=no) + dnl ----- Select window systems WINSRC= @@ -81,12 +113,20 @@ CNF_SHARE_DATND= WINTTYLIB= -if test "$enable_tty_graphics" != "no" -then -dnl ----- For TTY, determine the termlib -dnl ----- Check for termlib before termcap because Solaris termcap needs libucb. -TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo" -for termlib in ${TERMLIB_VARIANTS}; do +if test "$enable_tty_graphics" != "no"; then + if test $host_os = mingw32; then + AC_SUBST(EXTRA_UNSHARE,[nhdefkey.dll nh340key.dll nhraykey.dll]) + CFLAGS="$CFLAGS -DWIN32CON" + WINTTYLIB="" + WINSRC="${WINSRC} \$(WINTTYSRC)" + WINOBJ="${WINOBJ} \$(WINTTYOBJ)" + WINLIB="${WINLIB} \$(WINTTYLIB)" + AC_DEFINE(TTY_GRAPHICS, [], [Console output]) + else + # For TTY, determine the termlib + # Check for termlib before termcap because Solaris termcap needs libucb. + TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo" + for termlib in ${TERMLIB_VARIANTS}; do AC_CHECK_LIB(${termlib}, tgetent, [WINTTYLIB="-l${termlib}" WINSRC="${WINSRC} \$(WINTTYSRC)" @@ -94,26 +134,45 @@ WINLIB="${WINLIB} \$(WINTTYLIB)" AC_DEFINE(TTY_GRAPHICS, [], [Console output]) break]) -done + done + if test -z "$termlib"; then + if test "$enable_tty_graphics" = yes; then + AC_MSG_ERROR([Can't find tgetent (needed for tty graphics)]) + else + AC_MSG_WARN([Can't enable tty graphics (no tgetent)]) + NETHACK_AUTO_WIN_DISABLE(tty) + fi + fi + fi +fi +if test "$enable_tty_graphics" = "no" -a $host_os = mingw32; then + LFLAGS="$LFLAGS -mwindows" fi AC_SUBST(WINTTYLIB) -if test "$enable_proxy_graphics" != "no" -then - if test "$enable_proxy_graphics" = "yes" - then +if test "$enable_proxy_graphics" != "no"; then + if test "$have_libpng" = "no"; then + if test "$enable_proxy_graphics" = "yes"; then + AC_MSG_ERROR([Need libpng for proxy graphics]) + else + AC_MSG_WARN([Can't enable proxy graphics (no useable libpng)]) + fi + else + if test "$enable_proxy_graphics" = "yes"; then PKG_CHECK_MODULES(NETHACK_PROXY, nhproxy >= 0.9.0) else PKG_CHECK_MODULES(NETHACK_PROXY, nhproxy >= 0.9.0, :, :) fi - if test -n "$NETHACK_PROXY_LIBS" - then + if test -n "$NETHACK_PROXY_LIBS"; then + CFLAGS="${CFLAGS} ${NETHACK_LIBPNG_CFLAGS}" + LFLAGS="${LFLAGS} ${NETHACK_LIBPNG_LFLAGS}" WINSRC="${WINSRC} \$(WINPROXYSRC)" WINOBJ="${WINOBJ} \$(WINPROXYOBJ)" WINLIB="${WINLIB} ${NETHACK_PROXY_LIBS}" CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_PROXYND)" AC_DEFINE(PROXY_GRAPHICS, [], [proxy graphics]) fi + fi fi AC_SUBST(NETHACK_PROXY_CFLAGS) @@ -162,15 +221,43 @@ AC_SUBST(SDL_CONFIG_CFLAGS) AC_SUBST(SDL_CONFIG_LIBS) +if test "$enable_mswin_graphics" != "no"; then + if test "$WINDRES" = "no"; then + AC_MSG_ERROR([Need windres for Microsoft Window's native graphics]) + fi + WINSRC="${WINSRC} \$(WINMSSRC)" + WINOBJ="${WINOBJ} \$(WINMSOBJ)" + WINLIB="${WINLIB} \$(WINMSLIB)" + CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_MSND)" + AC_DEFINE(MSWIN_GRAPHICS, [], [Microsoft Window's native graphics]) +fi + AC_SUBST(WINSRC) AC_SUBST(WINOBJ) AC_SUBST(WINLIB) AC_SUBST(CNF_SHARE_DATND) +AC_MSG_CHECKING(for valid window system configuration) +if test -n "$nethack_wins"; then + AC_MSG_RESULT([yes]) + for win in $nethack_wins; do + AC_DEFINE_UNQUOTED(DEFAULT_WINDOW_SYS,["$win"], + [The default windowing system]) + break + done +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([need to enable at least one window system]) +fi + dnl ----- Check for header files AC_HEADER_STDC +# Due to what may be a bug in autoconf, we have to call AC_CHECK_HEADERS() +# to get the various HAVE_xxx_H preprocessor variables detected by +# AC_HEADER_STDC active. These are needed for AC_CHECK_DECLS(), below. +AC_CHECK_HEADERS([string.h]) AC_CHECK_HEADER(regex.h, [have_regex_h=yes],[have_regex_h=no],/* TEST_REGEX */) dnl ------ Check for data types @@ -189,106 +276,90 @@ dnl ----- Check for library functions -AC_CHECK_DECL(strncmpi, AC_DEFINE(STRNCMPI, [], [strncmpi available])) +AC_CHECK_DECLS([strncmpi, strnicmp], AC_DEFINE(STRNCMPI, [], [Use strncmpi])) dnl ----- Check for compile-time options -NETHACK_DISABLE(sinks,sinks,[Kitchen sinks],SINKS) -NETHACK_DISABLE(light-src-spell,light_src_spell, - [Spells are light sources],LIGHT_SRC_SPELL) -NETHACK_DISABLE(wallified-maze,wallified_maze, - [Fancy mazes],WALLIFIED_MAZE) -NETHACK_ENABLE(reincarnation,reincarnation, - [Special Rogue-like levels],REINCARNATION) -NETHACK_DISABLE(blackmarket,blackmarket, - [Blackmarket],BLACKMARKET) -NETHACK_DISABLE(kops,kops, - [Keystone Kops],KOPS) -NETHACK_DISABLE(seduce,seduce, - [Succubi/incubi seduction],SEDUCE) -NETHACK_DISABLE(invisible-objects,invisible_objects, - [Invisible objects],INVISIBLE_OBJECTS) -NETHACK_DISABLE(unpolypile,unpolypile, - [Object unpolymorphing],UNPOLYPILE) -NETHACK_DISABLE(wallet-o-p,wallet_o_p, - [Perseus' Wallet],WALLET_O_P) -NETHACK_DISABLE(lightsabers,lightsabers, - [Lightsabers],LIGHTSABERS) -NETHACK_DISABLE(d-saber,d_saber, - [Dimsabers],LIGHTSABERS) -NETHACK_DISABLE(p-spoon,p_spoon, - [Spoon],P_SPOON) -NETHACK_DISABLE(firearms,firearms, - [Guns and Bullets],FIREARMS) -NETHACK_DISABLE(eaten-memory,eaten_memory, - [Remember which monsters have been eaten],EATEN_MEMORY) -NETHACK_DISABLE(steed,steed, - [Ability to ride monsters],STEED) -NETHACK_DISABLE(dwarf,dwarf, - [Dwarf race],DWARF) -NETHACK_DISABLE(tourist,tourist, - [Tourist class],TOURIST) -NETHACK_DISABLE(yeoman,yeoman, - [Yeoman class],YEOMAN) -NETHACK_ENABLE(zouthern,zouthern, - [Zoutherner class],ZOUTHERN) -NETHACK_DISABLE(redo,redo, - [Redo last command],REDO) -NETHACK_DISABLE(clipping,clipping, - [Allow smaller screens],CLIPPING) -NETHACK_DISABLE(menu-color,menu_color, - [TTY graphics menu color],MENU_COLOR) -NETHACK_DISABLE(elbereth,elbereth, - [Engraving the E-word repels monsters],ELBERETH) -NETHACK_ENABLE(noartifactwish,noartifactwish, - [Prevent wishing for special artifacts],NOARTIFACTWISH) -NETHACK_ENABLE(no-bones,no_bones, - [Disable loading and saving bones levels],NO_BONES) -NETHACK_ENABLE(user-sounds,user_sounds, +# We use auto for data librarian to avoid breaking the rule that autoconf +# should use the same defaults as the manual configuration, but all platforms +# that support autoconf also support DLB, so the automatic choice is always yes. +NETHACK_ARG(data-librarian,[Data librarian],DLB,auto, + [enable_data_librarian=yes]) +NETHACK_ARG(sinks,[Kitchen sinks],SINKS,yes) +NETHACK_ARG(light-src-spell,[Spells are light sources],LIGHT_SRC_SPELL,yes) +NETHACK_ARG(wallified-maze,[Fancy mazes],WALLIFIED_MAZE,yes) +NETHACK_ARG(reincarnation,[Special Rogue-like levels],REINCARNATION,no) +NETHACK_ARG(blackmarket,[Blackmarket],BLACKMARKET,yes) +NETHACK_ARG(kops,[Keystone Kops],KOPS,yes) +NETHACK_ARG(seduce,[Succubi/incubi seduction],SEDUCE,yes) +NETHACK_ARG(invisible-objects,[Invisible objects],INVISIBLE_OBJECTS,yes) +NETHACK_ARG(unpolypile,[Object unpolymorphing],UNPOLYPILE,yes) +NETHACK_ARG(wallet-o-p,[Perseus' Wallet],WALLET_O_P,yes) +NETHACK_ARG(lightsabers,[Lightsabers],LIGHTSABERS,yes) +NETHACK_ARG(d-saber,[Dimsabers],LIGHTSABERS,yes) +NETHACK_ARG(p-spoon,[Spoon],P_SPOON,yes) +NETHACK_ARG(firearms,[Guns and Bullets],FIREARMS,yes) +NETHACK_ARG(eaten-memory,[Remember which monsters have been eaten], + EATEN_MEMORY,yes) +NETHACK_ARG(steed,[Ability to ride monsters],STEED,yes) +NETHACK_ARG(dwarf,[Dwarf race],DWARF,yes) +NETHACK_ARG(tourist,[Tourist class],TOURIST,yes) +NETHACK_ARG(yeoman,[Yeoman class],YEOMAN,yes) +NETHACK_ARG(zouthern,[Zoutherner class],ZOUTHERN,no) +NETHACK_ARG(redo,[Redo last command],REDO,yes) +NETHACK_ARG(clipping,[Allow smaller screens],CLIPPING,yes) +NETHACK_ARG(menu-color,[TTY graphics menu color],MENU_COLOR,yes) +NETHACK_ARG(elbereth,[Engraving the E-word repels monsters],ELBERETH,yes) +NETHACK_ARG(noartifactwish,[Prevent wishing for special artifacts], + NOARTIFACTWISH,no) +NETHACK_ARG(no-bones,[Disable loading and saving bones levels],NO_BONES,no) +NETHACK_ARG(user-sounds, [Allow user-defined regex mapping from messages to sounds (Qt with NAS only)], - USER_SOUNDS) -NETHACK_DISABLE(exp-on-botl,exp_on_botl, - [Show experience on bottom line],EXP_ON_BOTL) -NETHACK_ENABLE(score-on-botl,score_on_botl, - [Show score on bottom line],SCORE_ON_BOTL) -NETHACK_ENABLE(borg,borg, - [Borg player (only under DOS)],BORG) -NETHACK_ENABLE(keep-save,keep_save, - [Keep save files after restore],KEEP_SAVE) -NETHACK_ENABLE(charon,charon, - [Charon's boat, enables Cerebus (not implemented)],CHARON) -NETHACK_DISABLE(show-dmg,show_dmg, - [Display damage reports],SHOW_DMG) -NETHACK_DISABLE(show-weight,show_weight, - [Display object weight],SHOW_WEIGHT) -NETHACK_DISABLE(other-services,other_services, - [Shopkeeper services],OTHER_SERVICES) -NETHACK_DISABLE(dungeon-growth,dungeon_growth, - [Dungeon growth],DUNGEON_GROWTH) -NETHACK_ENABLE(shout,shout, - [Shouting and pet commands (not implemented)],SHOUT) -NETHACK_DISABLE(display-layers,display_layers, - [Support transparent tilesets],DISPLAY_LAYERS) -NETHACK_ENABLE(goldobj,goldobj, - [Gold is kept on object chains (experimental)],GOLDOBJ) -NETHACK_ENABLE(autopickup-exceptions,autopickup_exceptions, - [Exceptions to autopickup (experimental)],AUTOPICKUP_EXCEPTIONS) + USER_SOUNDS,no) +NETHACK_ARG(exp-on-botl,[Show experience on bottom line],EXP_ON_BOTL,yes) +NETHACK_ARG(score-on-botl,[Show score on bottom line],SCORE_ON_BOTL,no) +#NETHACK_ARG(borg,[Borg player (only under DOS)],BORG,no) +NETHACK_ARG(keep-save,[Keep save files after restore],KEEP_SAVE,no) +NETHACK_ARG(charon,[Charon's boat, enables Cerebus (not implemented)],CHARON,no) +NETHACK_ARG(show-dmg,[Display damage reports],SHOW_DMG,yes) +NETHACK_ARG(show-weight,[Display object weight],SHOW_WEIGHT,yes) +NETHACK_ARG(other-services,[Shopkeeper services],OTHER_SERVICES,yes) +NETHACK_ARG(dungeon-growth,[Dungeon growth],DUNGEON_GROWTH,yes) +#NETHACK_ARG(shout,[Shouting and pet commands (not implemented)],SHOUT,no) +NETHACK_ARG(display-layers,[Support transparent tilesets],DISPLAY_LAYERS,yes) +NETHACK_ARG(goldobj,[Gold is kept on object chains (experimental)],GOLDOBJ,no) +NETHACK_ARG(autopickup-exceptions,[Exceptions to autopickup (experimental)], + AUTOPICKUP_EXCEPTIONS,no) + +AC_MSG_CHECKING([whether to enable wizmode]) +AC_ARG_ENABLE([wizmode], AC_HELP_STRING([--enable-wizmode=USER], + [enable wizard mode for the specified user (default=wizard)]), + if test "$enableval" != no; then enable_wizmode=yes; wizard=$enableval; + else enable_wizmode=no; fi, enable_wizmode=yes; wizard="wizard") +if test "$enable_wizmode" != "no" ; then + AC_MSG_RESULT([yes (user $wizard)]) + AC_DEFINE_UNQUOTED([WIZARD], ["$wizard"], [The person allowed to use the -D option]) +else + AC_MSG_RESULT([no]) +fi + NETHACK_LINKS= NETHACK_LINKS_ADD([include/file.h]) NETHACK_LINKS_ADD([dat/data.base]) -NETHACK_LINKS_ADD([dat/rumors.tru:dat/rumors.tru]) -NETHACK_LINKS_ADD([dat/rumors.fal:dat/rumors.fal]) -NETHACK_LINKS_ADD([dat/quest.txt:dat/quest.txt]) -NETHACK_LINKS_ADD([dat/oracles.txt:dat/oracles.txt]) -NETHACK_LINKS_ADD([dat/dungeon.def:dat/dungeon.def]) -NETHACK_LINKS_ADD([dat/help:dat/help]) -NETHACK_LINKS_ADD([dat/hh:dat/hh]) -NETHACK_LINKS_ADD([dat/cmdhelp:dat/cmdhelp]) -NETHACK_LINKS_ADD([dat/history:dat/history]) -NETHACK_LINKS_ADD([dat/opthelp:dat/opthelp]) -NETHACK_LINKS_ADD([dat/wizhelp:dat/wizhelp]) -NETHACK_LINKS_ADD([dat/gypsy.txt:dat/gypsy.txt]) -NETHACK_LINKS_ADD([win/share/tile_t.h:win/share/tile_t.h]) +NETHACK_LINKS_ADD([dat/rumors.tru]) +NETHACK_LINKS_ADD([dat/rumors.fal]) +NETHACK_LINKS_ADD([dat/quest.txt]) +NETHACK_LINKS_ADD([dat/oracles.txt]) +NETHACK_LINKS_ADD([dat/dungeon.def]) +NETHACK_LINKS_ADD([dat/help]) +NETHACK_LINKS_ADD([dat/hh]) +NETHACK_LINKS_ADD([dat/cmdhelp]) +NETHACK_LINKS_ADD([dat/history]) +NETHACK_LINKS_ADD([dat/opthelp]) +NETHACK_LINKS_ADD([dat/wizhelp]) +NETHACK_LINKS_ADD([dat/gypsy.txt]) +NETHACK_LINKS_ADD([win/share/tile_t.h]) +NETHACK_LINKS_ADD([include/win32api.h:sys/winnt/win32api.h]) AC_CONFIG_LINKS(${NETHACK_LINKS}) @@ -297,7 +368,8 @@ [src/Makefile:sys/autoconf/Makefile.src] [doc/Makefile:sys/autoconf/Makefile.doc] [dat/Makefile:sys/autoconf/Makefile.dat] - [util/Makefile:sys/autoconf/Makefile.utl]) + [util/Makefile:sys/autoconf/Makefile.utl] + [sys/autoconf/depend.awk:sys/autoconf/depend.in]) NETHACK_CONFIG_HEADER([include/autoconf.h:sys/autoconf/autoconf.hin]) diff -Naurbd slashem-0.0.8E0/sys/autoconf/depend.in slashem-0.0.8E0F1/sys/autoconf/depend.in --- slashem-0.0.8E0/sys/autoconf/depend.in 1970-01-01 01:00:00.000000000 +0100 +++ slashem-0.0.8E0F1/sys/autoconf/depend.in 2006-05-15 12:13:10.000000000 +0100 @@ -0,0 +1,165 @@ +# depend.awk -- awk script used to construct makefile dependencies +# for nethack's source files (`make depend' support for Makefile.src). +# +# usage: +# cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files +# +# This awk program scans each file in sequence, looking for lines beginning +# with `#include "' and recording the name inside the quotes. For .h files, +# that's all it does. For each .c file, it writes out a make rule for the +# corresponding .o file; dependencies in nested header files are propagated +# to the .o target. +# +# config.h and hack.h get special handling because of their heavy use; +# timestamps for them allow make to avoid rechecking dates on +# subsidiary headers for every source file; +# extern.h gets special handling to avoid excessive recompilation +# during development; +# patchlev.h gets special handling because it only exists on systems +# which consider filename patchlevel.h to be too long; +# interp.c gets special handling because it usually doesn't exist; it's +# assumed to be the last #include in the file where it occurs. +# win32api.h gets special handling because it only exists for some ports; +# it's assumed to be the last #include in the file where it occurs +# +BEGIN { FS = "\"" #for `#include "X"', $2 is X + special[++sp_cnt] = "../include/config.h" + special[++sp_cnt] = "../include/hack.h" + alt_deps["../include/extern.h"] = "" + alt_deps["../include/patchlev.h"] = "" + alt_deps["interp.c"] = " #interp.c" #comment it out + alt_deps["../include/win32api.h"] = " #../include/win32api.h" + srcdir_len = length("@SRCDIR@/") + } +FNR == 1 { output_dep() #finish previous file + file = FILENAME #setup for current file + } +/^\#[ \t]*include[ \t]+\"/ { #find `#include "X"' + incl = $2; + #[3.4.0: gnomehack headers currently aren't in include] + #[0.0.8: win32 headers aren't in include either] + if (incl ~ /\.h$/) { + if (incl ~ /^gn/) # gnomehack special case + incl = "../win/gnome/" incl + else if (incl == "winMS.h" || incl == "resource.h" || + incl ~ /^mh/) # win32 special cases + incl = "../win/win32/" incl + else + incl = "../include/" incl + } + deps[file] = deps[file] " " incl + } +END { output_dep() } #finish the last file + + +# +# `file' has been fully scanned, so process it now; for .h files, +# don't do anything (we've just been collecting their dependencies); +# for .c files, output the `make' rule for corresponding .o file +# +function output_dep( targ) +{ + if (file ~ /\.cp*$/) { + #prior to very first .c|.cpp file, handle some special header file cases + if (!c_count++) + output_specials() + #construct object filename from source filename + targ = file; sub("^.+/", "", targ); sub("\\.cp*$", ".o", targ) + #format and write the collected dependencies + format_dep(targ, file) + } +} + +# +# handle some targets (config.h, hack.h) via special timestamping rules +# +function output_specials( i, sp, alt_sp) +{ + for (i = 1; i <= sp_cnt; i++) { + sp = special[i] + #change "../include/foo.h" first to "foo.h", then ultimately to "$(FOO_H)" + alt_sp = sp; sub("^.+/", "", alt_sp) + print "#", alt_sp, "timestamp" #output a `make' comment + #- sub("\\.", "_", alt_sp); alt_sp = "$(" toupper(alt_sp) ")" + #+ Some nawks don't have toupper(), so hardwire these instead. + sub("config.h", "$(CONFIG_H)", alt_sp); sub("hack.h", "$(HACK_H)", alt_sp); + format_dep(alt_sp, sp) #output the target + print "\ttouch " alt_sp #output a build command + alt_deps[sp] = alt_sp #alternate dependency for depend() + } + print "#" +} + +# +# write a target and its dependency list in pretty-printed format; +# if target's primary source file has a path prefix, also write build command +# +function format_dep(target, source, n, i, list) +{ + split("", done) #``for (x in done) delete done[x]'' + printf("%s:", target); col = length(target) + 1 + #- printf("\t"); col += 8 - (col % 8); + #- if (col == 8) { printf("\t"); col += 8 } + source = depend("", source, 0) + n = split(source, list, " +") + for (i = 2; i <= n; i++) { #(leading whitespace yields empty 1st element) + if (substr(list[i], 1, srcdir_len) == "@SRCDIR@/") + list[i] = "$(srcdir)" substr(list[i], srcdir_len) + if (col + length(list[i]) >= (i < n ? 78 : 80)) { + printf(" \\\n\t\t"); col = 16 #make a backslash+newline split + } else { + printf(" "); col++; + } + printf("%s", list[i]); col += length(list[i]) + } + printf("\n") #terminate + #write build command if first source entry has non-include path prefix + source = list[2] + if (source ~ /\// && substr(source, 1, 11) != "../include/") { + if (source ~ /\.cpp$/ ) + print "\t$(CXX) $(CXXFLAGS) -c " source + else if (source ~ /..\/win\/proxy\// ) + print "\t$(CC) $(CFLAGS) $(WINPROXYCFLAGS) -c " source + else if (source ~ /..\/win\/win32\// ) + print "\t$(CC) $(CFLAGS) $(WINMSCFLAGS) -c " source + else if (source ~ /..\/win\/gl\// ) + print "\t$(CC) $(CFLAGS) $(SDLGL_CFLAGS) -c " source + else if (source ~ /\/gnome\//) # "../win/gnome/foo.c" + print "\t$(CC) $(CFLAGS) $(GNOMEINC) -c " source + else + print "\t$(CC) $(CFLAGS) -c " source + } +} + +# +# recursively add the dependencies for file `name' to string `inout' +# (unless `skip', in which case we're only marking files as already done) +# +function depend(inout, name, skip, n, i, list) +{ + if (!done[name]++) { + if (name in alt_deps) { #some names have non-conventional dependencies + if (!skip) inout = inout " " alt_deps[name] + skip = 1 + } else { #ordinary name + if (!skip) inout = inout " " name + } + if (!(name in deps)) name = "@SRCDIR@/" name + if (name in deps) { + #- n = split(deps[name], list, " +") + #- for (i = 2; i <= n; i++) #(leading whitespace yields empty 1st element) + #- inout = depend(inout, list[i], skip) + #+ At least one implementation of nawk handles the local array `list' wrong, + #+ so the clumsier substitute code below is used as a workaround. + list = deps[name]; sub("^ +", "", list) + while (list) { + match((list " "), " +"); i = RSTART; n = RLENGTH + inout = depend(inout, substr(list, 1, i-1), skip) + list = substr(list, i+n) + } + } + } + return inout +} + +#depend.awk# diff -Naurbd slashem-0.0.8E0/sys/mac/README.txt slashem-0.0.8E0F1/sys/mac/README.txt --- slashem-0.0.8E0/sys/mac/README.txt 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/mac/README.txt 2006-05-15 12:13:10.000000000 +0100 @@ -1,4 +1,4 @@ -This is the binary distribution of Slash'EM 0.0.8E0 for Mac OS Classic. This is a Power PC binary, so it will run only on a Macintosh with a Power PC processor. +This is the binary distribution of Slash'EM 0.0.8E0F1 for Mac OS Classic. This is a Power PC binary, so it will run only on a Macintosh with a Power PC processor. This package is freely distributable; see the file 'License' for details. diff -Naurbd slashem-0.0.8E0/sys/mac/macmenu.c slashem-0.0.8E0F1/sys/mac/macmenu.c --- slashem-0.0.8E0/sys/mac/macmenu.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/mac/macmenu.c 2006-05-15 12:13:10.000000000 +0100 @@ -1126,16 +1126,22 @@ aboutStr[++aboutStr[0]] = '0' + PATCHLEVEL % 10; - if (EDITLEVEL) { - aboutStr[++aboutStr[0]] = 'e'; +#ifdef FIXLEVEL + if (EDITLEVEL || FIXLEVEL) { + aboutStr[++aboutStr[0]] = 'E'; aboutStr[++aboutStr[0]] = '0' + EDITLEVEL; } -#ifdef FIXLEVEL if (FIXLEVEL) { - aboutStr[++aboutStr[0]] = 'f'; + aboutStr[++aboutStr[0]] = 'F'; aboutStr[++aboutStr[0]] = '0' + FIXLEVEL; } +#else + if (EDITLEVEL) { + aboutStr[++aboutStr[0]] = 'E'; + aboutStr[++aboutStr[0]] = '0' + EDITLEVEL; + } + #endif aboutStr[++aboutStr[0]] = CHAR_CR; diff -Naurbd slashem-0.0.8E0/sys/winnt/nttty.c slashem-0.0.8E0F1/sys/winnt/nttty.c --- slashem-0.0.8E0/sys/winnt/nttty.c 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/sys/winnt/nttty.c 2006-05-15 12:13:10.000000000 +0100 @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)nttty.c 3.4 $Date: 2003/12/11 09:49:08 $ */ +/* SCCS Id: @(#)nttty.c 3.4 $Date: 2005/09/17 15:09:03 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ @@ -136,7 +136,6 @@ #endif int ttycolors[CLR_MAX]; # ifdef TEXTCOLOR -int ttycolors[CLR_MAX]; static void NDECL(init_ttycolor); # endif static void NDECL(really_move_cursor); diff -Naurbd slashem-0.0.8E0/win/X11/Install.X11 slashem-0.0.8E0F1/win/X11/Install.X11 --- slashem-0.0.8E0/win/X11/Install.X11 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/win/X11/Install.X11 2006-05-15 12:13:10.000000000 +0100 @@ -37,7 +37,7 @@ If you want to use the optional tiles (multicolored pictures instead of a replacement font), you will need to have the win/share files and change -the CF_SHARE_DATND setting in the top Makefile to contain the tile files before +the CNF_SHARE_DATND setting in the top Makefile to contain the tile files before you do your 'make all'. Include x11tiles for the 16x16 tile set and x11bigtiles for the 32x32 set. The available tile sets should be defined in the configuration file. The tiles option can then be used to select the initial @@ -65,7 +65,7 @@ If you define USE_XPM in config.h, you may also define GRAPHIC_TOMBSTONE which causes the closing tombstone to be displayed from the image file specified by the "tombstone" X resource (rip.xpm by default). In this -case, make sure the top Makefile CF_SHARE_X11ND also contains rip.xpm. +case, make sure the top Makefile CNF_SHARE_X11ND also contains rip.xpm. Whether or not you install tile support, you can provide support for diff -Naurbd slashem-0.0.8E0/win/X11/SlashEM.ad slashem-0.0.8E0F1/win/X11/SlashEM.ad --- slashem-0.0.8E0/win/X11/SlashEM.ad 2005-07-02 08:31:37.000000000 +0100 +++ slashem-0.0.8E0F1/win/X11/SlashEM.ad 2006-05-15 12:13:10.000000000 +0100 @@ -132,6 +132,30 @@ SlashEM*race_selection*quit.accelerators: #override\n\ Escape: set() notify() unset() +SlashEM*gender_selection*random.borderColor: blue +SlashEM*gender_selection*random.borderWidth: 2 +SlashEM*gender_selection*random.foreground: blue +SlashEM*gender_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +SlashEM*gender_selection*quit.borderColor: blue +SlashEM*gender_selection*quit.foreground: blue +SlashEM*gender_selection*Command.borderColor: red +SlashEM*gender_selection*Command.foreground: red +SlashEM*gender_selection*quit.accelerators: #override\n\ + Return: set() notify() unset() + +SlashEM*alignment_selection*random.borderColor: blue +SlashEM*alignment_selection*random.borderWidth: 2 +SlashEM*alignment_selection*random.foreground: blue +SlashEM*alignment_selection*random.accelerators: #override\n\ + Return: set() notify() unset() +SlashEM*alignment_selection*quit.borderColor: blue +SlashEM*alignment_selection*quit.foreground: blue +SlashEM*alignment_selection*Command.borderColor: red +SlashEM*alignment_selection*Command.foreground: red +SlashEM*alignment_selection*quit.accelerators: #override\n\ + Return: set() notify() unset() + SlashEM*extended_commands*dismiss.borderColor: blue SlashEM*extended_commands*dismiss.foreground: blue SlashEM*extended_commands*help.borderColor: blue diff -Naurbd slashem-0.0.8E0/win/proxy/getopt.c slashem-0.0.8E0F1/win/proxy/getopt.c --- slashem-0.0.8E0/win/proxy/getopt.c 2005-07-02 08:31:38.000000000 +0100 +++ slashem-0.0.8E0F1/win/proxy/getopt.c 2006-05-15 12:13:10.000000000 +0100 @@ -1,4 +1,4 @@ -/* $Id: getopt.c,v 1.4 2003/12/28 18:43:40 j_ali Exp $ */ +/* $Id: getopt.c,v 1.5 2005/08/13 11:27:04 prousu Exp $ */ /* Copyright (c) Slash'EM Development Team 2002 */ /* NetHack may be freely redistributed. See license for details. */ @@ -203,6 +203,7 @@ } return buf; } +# ifdef MSDOS if (!strcmp(option, "videoshades")) { sprintf(buf, "%s-%s-%s", ttycolors[CLR_BLACK] == M_BLACK ? "dark" : @@ -212,6 +213,7 @@ ttycolors[CLR_WHITE] == M_BLACK ? "dark" : ttycolors[CLR_WHITE] == M_GRAY ? "normal" : "light"); } +# endif #endif if (!strcmp(option, "menustyle")) { switch (flags.menu_style) { diff -Naurbd slashem-0.0.8E0/win/tty/termcap.c slashem-0.0.8E0F1/win/tty/termcap.c --- slashem-0.0.8E0/win/tty/termcap.c 2005-07-02 08:31:38.000000000 +0100 +++ slashem-0.0.8E0F1/win/tty/termcap.c 2006-05-15 12:13:10.000000000 +0100 @@ -87,6 +87,116 @@ # endif #endif /* TERMLIB */ +#ifndef MSDOS + +STATIC_DCL void NDECL(init_ttycolor); + +#ifdef VIDEOSHADES +boolean colorflag = FALSE; /* colors are initialized */ +char ttycolors[CLR_MAX]; +#endif + +void +init_ttycolor() +{ +#ifdef VIDEOSHADES + if (!colorflag) { + ttycolors[CLR_RED] = CLR_RED; + ttycolors[CLR_GREEN] = CLR_GREEN; + ttycolors[CLR_BROWN] = CLR_BROWN; + ttycolors[CLR_BLUE] = CLR_BLUE; + ttycolors[CLR_MAGENTA] = CLR_MAGENTA; + ttycolors[CLR_CYAN] = CLR_CYAN; + ttycolors[CLR_GRAY] = CLR_GRAY; + ttycolors[CLR_BLACK] = CLR_BLACK; + ttycolors[CLR_ORANGE] = CLR_ORANGE; + ttycolors[CLR_BRIGHT_GREEN] = CLR_BRIGHT_GREEN; + ttycolors[CLR_YELLOW] = CLR_YELLOW; + ttycolors[CLR_BRIGHT_BLUE] = CLR_BRIGHT_BLUE; + ttycolors[CLR_BRIGHT_MAGENTA] = CLR_BRIGHT_MAGENTA; + ttycolors[CLR_BRIGHT_CYAN] = CLR_BRIGHT_CYAN; + ttycolors[CLR_WHITE] = CLR_WHITE; + } +#endif +} + +# ifdef VIDEOSHADES + +static int FDECL(convert_uchars,(char *, uchar *, int)); + +/* + * OPTIONS=videocolors:1-2-3-4-5-6-7-8-9-10-11-12-13-14-15 + * Left to right assignments for: + * red green brown blue magenta cyan gray black + * orange br.green yellow br.blue br.mag br.cyan white + */ +int assign_videocolors(char *colorvals) +{ + int i,icolor; + uchar *tmpcolor; + + init_ttycolor(); + + i = strlen(colorvals); + tmpcolor = (uchar *)alloc(i); + if (convert_uchars(colorvals,tmpcolor,i) < 0) return FALSE; + + icolor = CLR_RED; + for( i = 0; tmpcolor[i] != 0; ++i) { + if (icolor <= CLR_WHITE) + ttycolors[icolor++] = tmpcolor[i]; + } + + colorflag = TRUE; + free((genericptr_t)tmpcolor); + return 1; +} + +static int +convert_uchars(bufp,list,size) + char *bufp; /* current pointer */ + uchar *list; /* return list */ + int size; +{ + unsigned int num = 0; + int count = 0; + + list[count] = 0; + + while (1) { + switch(*bufp) { + case ' ': case '\0': + case '\t': case '-': + case '\n': + if (num) { + list[count++] = num; + list[count] = 0; + num = 0; + } + if ((count==size) || !*bufp) return count; + bufp++; + break; + case '#': + if (num) { + list[count++] = num; + list[count] = 0; + } + return count; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + num = num*10 + (*bufp-'0'); + if (num > 15) return -1; + bufp++; + break; + default: return -1; + } + } + /*NOTREACHED*/ +} +# endif /* !MSDOS */ +# endif /* VIDEOSHADES*/ + #ifdef OVLB void @@ -98,6 +208,15 @@ register const char *term; register char *tptr; char *tbufptr, *pc; +#endif + +#ifdef TEXTCOLOR +# ifndef MSDOS + init_ttycolor(); +# endif +#endif + +#ifdef TERMLIB # ifdef VMS term = verify_termcap(); @@ -177,11 +296,13 @@ if (i != CLR_BLACK) { hilites[i|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm")); Sprintf(hilites[i|BRIGHT], "\033[1;3%dm", i); +# ifndef VIDEOSHADES if (i != CLR_GRAY) # ifdef MICRO if (i == CLR_BLUE) hilites[CLR_BLUE] = hilites[CLR_BLUE|BRIGHT]; else # endif +# endif { hilites[i] = (char *) alloc(sizeof("\033[0;3%dm")); Sprintf(hilites[i], "\033[0;3%dm", i); @@ -446,10 +567,14 @@ if (c != CLR_BLACK) { hilites[c|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm")); Sprintf(hilites[c|BRIGHT], "\033[1;3%dm", c); +#ifndef VIDEOSHADES if (c != CLR_GRAY) { +#endif hilites[c] = (char *) alloc(sizeof("\033[0;3%dm")); Sprintf(hilites[c], "\033[0;3%dm", c); +#ifndef VIDEOSHADES } +#endif } } #endif /* PC9800 */ @@ -840,9 +965,14 @@ #endif # ifdef COLOR_BLACK /* trust include file */ +#ifndef VIDEOSHADES #undef COLOR_BLACK +#endif # else # ifndef _M_UNIX /* guess BGR */ +#ifdef VIDEOSHADES +#define COLOR_BLACK 0 +#endif #define COLOR_BLUE 1 #define COLOR_GREEN 2 #define COLOR_CYAN 3 @@ -860,7 +990,9 @@ #define COLOR_WHITE 7 # endif # endif +#ifndef VIDEOSHADES #define COLOR_BLACK COLOR_BLUE +#endif const int ti_map[8] = { COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, @@ -883,10 +1015,14 @@ for (c = 0; c < CLR_MAX / 2; c++) { scratch = tparm(setf, ti_map[c]); +#ifndef VIDEOSHADES if (c != CLR_GRAY) { +#endif hilites[c] = (char *) alloc(strlen(scratch) + 1); Strcpy(hilites[c], scratch); +#ifndef VIDEOSHADES } +#endif if (c != CLR_BLACK) { hilites[c|BRIGHT] = (char*) alloc(strlen(scratch)+strlen(MD)+1); Strcpy(hilites[c|BRIGHT], MD); @@ -1018,7 +1154,7 @@ for (c = 0; c < SIZE(hilites); c++) /* avoid invisibility */ if ((backg & ~BRIGHT) != c) { -# ifdef MICRO +# if defined(MICRO) && !defined(VIDEOSHADES) if (c == CLR_BLUE) continue; # endif if (c == foreg) @@ -1034,7 +1170,7 @@ } } -# ifdef MICRO +# if defined(MICRO) && !defined(VIDEOSHADES) /* brighten low-visibility colors */ hilites[CLR_BLUE] = hilites[CLR_BLUE|BRIGHT]; # endif @@ -1146,7 +1282,11 @@ term_start_color(color) int color; { +#ifdef VIDEOSHADES + xputs(hilites[ttycolors[color]]); +#else xputs(hilites[color]); +#endif }