]> granicus.if.org Git - nethack/commitdiff
(from Yitzhak) part1
authornethack.allison <nethack.allison>
Sun, 10 Mar 2002 17:35:16 +0000 (17:35 +0000)
committernethack.allison <nethack.allison>
Sun, 10 Mar 2002 17:35:16 +0000 (17:35 +0000)
part 1 touches core files
ntconf.h changes differ slightly from Yitzhak's original.

Makes Borland happy with current sources.
Hides "rawio" on Graphical Port which doesn't do anything with rawio

include/ntconf.h
src/drawing.c
src/options.c

index 2ce336a31aed0f17635ce9a9ec1555240dfaf0a7..532a003e084a34707d3079df64dcf0f9ce023667 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)ntconf.h   3.4     1996/10/14      */
+/*     SCCS Id: @(#)ntconf.h   3.4     2002/03/10      */
 /* Copyright (c) NetHack PC Development Team 1993, 1994.  */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -8,15 +8,12 @@
 /* #define SHELL       /* nt use of pcsys routines caused a hang */
 
 #define RANDOM         /* have Berkeley random(3) */
-
 #define TEXTCOLOR      /* Color text */
 
-#define PATHLEN                64      /* maximum pathlength */
-#define FILENAME       80      /* maximum filename length (conservative) */
 #define EXEPATH                        /* Allow .exe location to be used as HACKDIR */
 #define TRADITIONAL_GLYPHMAP   /* Store glyph mappings at level change time */
 #ifdef WIN32CON
-#define LAN_FEATURES           /* Include code for lan-aware features. */
+#define LAN_FEATURES           /* Include code for lan-aware features. Untested in 3.4.0*/
 #endif
 
 #define PC_LOCKING             /* Prevent overwrites of aborted or in-progress games */
 #undef random
 #endif
 
+#define PATHLEN                BUFSZ /* maximum pathlength */
+#define FILENAME       BUFSZ /* maximum filename length (conservative) */
+
+#if defined(_MAX_PATH) && defined(_MAX_FNAME)
+# if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
+#undef PATHLEN
+#undef FILENAME
+#define PATHLEN                _MAX_PATH
+#define FILENAME       _MAX_FNAME
+# endif
+#endif
+
+
 #define NO_SIGNAL
 #define index  strchr
 #define rindex strrchr
index ceb7fedde5162a3bc9822675365841abd8930940..02d96e92c27c8bf17edde8355da1a53dfdbde304 100644 (file)
@@ -794,15 +794,12 @@ boolean is_rlevel;
        /* Use a loop: char != uchar on some machines. */
        for (i = 0; i < MAXMCLASSES; i++)
            monsyms[i] = def_monsyms[i];
-# ifdef ASCIIGRAPH
+# if defined(ASCIIGRAPH) && !defined(MSWIN_GRAPHICS)
        if (iflags.IBMgraphics
 #  if defined(USE_TILES) && defined(MSDOS)
                && !iflags.grmode
 #  endif
-#  if defined(MSWIN_GRAPHICS)
-               && 0
-#  endif
-                               )
+               )
            monsyms[S_HUMAN] = 0x01; /* smiley face */
 # endif
        for (i = 0; i < MAXPCHARS; i++)
index f74cdaef07ee7fa309971dd0496e5ccca89e6bd5..2f9a46490cb1bc55214e4cfbfb9a5ec096efd944 100644 (file)
@@ -140,7 +140,7 @@ static struct Bool_Opt
        {"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
        {"preload_tiles", &iflags.wc_preload_tiles, TRUE, DISP_IN_GAME},        /*WC*/
        {"pushweapon", &flags.pushweapon, FALSE, SET_IN_GAME},
-#if defined(MICRO) && !defined(AMIGA)
+#if defined(MICRO) && !defined(AMIGA) && !defined(MSWIN_GRAPHICS)
        {"rawio", &iflags.rawio, FALSE, DISP_IN_GAME},
 #else
        {"rawio", (boolean *)0, FALSE, SET_IN_FILE},
@@ -3166,36 +3166,37 @@ char *op;
 
                wn = tfg = tbg = (char *)0;
 
-               /* until first non-space in case there's leading spaces*/
+               /* until first non-space in case there's leading spaces - before colorname*/
                while(*newop && isspace(*newop)) newop++;
                if (*newop) wn = newop;
                else return 0;
 
-               /* until first space */
+               /* until first space - colorname*/
                while(*newop && !isspace(*newop)) newop++;
                if (*newop) *newop = '\0';
+               else return 0;
                newop++;
 
-               /* until first non-space */
+               /* until first non-space - before foreground*/
                while(*newop && isspace(*newop)) newop++;
                if (*newop) tfg = newop;
                else return 0;
 
-               /* until slash */
+               /* until slash - foreground */
                while(*newop && *newop != '/') newop++;
                if (*newop) *newop = '\0';
                else return 0;
                newop++;
 
-               /* until first non-space (in case there's leading space after slash) */
+               /* until first non-space (in case there's leading space after slash) - before background */
                while(*newop && isspace(*newop)) newop++;
                if (*newop) tbg = newop;
                else return 0;
 
-               /* until first space */
+               /* until first space - background */
                while(*newop && !isspace(*newop)) newop++;
-               if (*newop) *newop = '\0';
-               newop++;
+               if (*newop) *newop++ = '\0';
+
                for (j = 0; j < 4; ++j) {
                        if (!strcmpi(wn, wnames[j]) ||
                            !strcmpi(wn, shortnames[j])) {