]> granicus.if.org Git - nethack/commitdiff
Since the touchstone uses objclass oc_color we need
authornethack.allison <nethack.allison>
Sat, 12 Jan 2002 02:16:09 +0000 (02:16 +0000)
committernethack.allison <nethack.allison>
Sat, 12 Jan 2002 02:16:09 +0000 (02:16 +0000)
to make that field unconditional, otherwise
NetHack won't compile without TEXTCOLOR defined.

Also provides at least an interim solution for the has_color()
problem that Warwick pointed out.

Lastly, Archeologists know touchstones.

include/objclass.h
include/patchlevel.h
src/mapglyph.c
src/o_init.c
src/objects.c
src/u_init.c

index 6dae474dea9d5a0a1becbe41c1d65fcfe87b86e8..38dfb585080662567d3bfa628f5651417eeac651 100644 (file)
@@ -91,9 +91,8 @@ struct objclass {
        uchar   oc_oprop;               /* property (invis, &c.) conveyed */
        char    oc_class;               /* object class */
        schar   oc_delay;               /* delay when using such an object */
-#ifdef TEXTCOLOR
-       uchar   oc_color;               /* display color of the object */
-#endif /* TEXTCOLOR */
+       uchar   oc_color;               /* color of the object */
+
        short   oc_prob;                /* probability, used in mkobj() */
        unsigned short  oc_weight;      /* encumbrance (1 cn = 0.1 lb.) */
        short   oc_cost;                /* base cost in shops */
index 80d5178b76a69f2e7cb8d6310bde2bc671d19e71..97fea65cbd9dcea4032515aa4a3ef368ae8d295e 100644 (file)
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      1
+#define EDITLEVEL      2
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2002"
index 91ad008c126864e938074fe5abc52a99d3278799..226f920f23fdb4021e5b52efa86331a9e987e7ec 100644 (file)
@@ -6,6 +6,7 @@
 #if defined(TTY_GRAPHICS)
 #include "wintty.h"    /* for prototype of has_color() only */
 #endif
+#include "color.h"
 
 int explcolors[] = {
        CLR_BLACK,      /* dark    */
@@ -17,6 +18,10 @@ int explcolors[] = {
        CLR_WHITE,      /* frosty  */
 };
 
+#if !defined(TTY_GRAPHICS)
+#define has_color(n)  TRUE
+#endif
+
 #ifdef TEXTCOLOR
 #define zap_color(n)  color = iflags.use_color ? zapcolors[n] : NO_COLOR
 #define cmap_color(n) color = iflags.use_color ? defsyms[n].color : NO_COLOR
index 4c5a0c499cfda23c5ce3ae5b74cee3fe0bcbab92..e15e66e450e33be4392f35f0baf63aacba7601c6 100644 (file)
@@ -75,9 +75,7 @@ shuffle(o_low, o_high, domaterial)
 {
        int i, j, num_to_shuffle;
        short sw;
-#ifdef TEXTCOLOR
        int color;
-#endif /* TEXTCOLOR */
 
        for (num_to_shuffle = 0, j=o_low; j <= o_high; j++)
                if (!objects[j].oc_name_known) num_to_shuffle++;
@@ -94,11 +92,10 @@ shuffle(o_low, o_high, domaterial)
                sw = objects[j].oc_tough;
                objects[j].oc_tough = objects[i].oc_tough;
                objects[i].oc_tough = sw;
-#ifdef TEXTCOLOR
                color = objects[j].oc_color;
                objects[j].oc_color = objects[i].oc_color;
                objects[i].oc_color = color;
-#endif /* TEXTCOLOR */
+
                /* shuffle material */
                if (domaterial) {
                        sw = objects[j].oc_material;
index b13994981ad41c8d038ac17239ef1b40d19232d7..03eb954897cde8923696c057d0dead52cbc75a89 100644 (file)
@@ -13,12 +13,8 @@ struct monst { struct monst *dummy; };       /* lint: struct obj's union */
 
 #else  /* !OBJECTS_PASS_2_ */
 /* second pass */
-# ifdef TEXTCOLOR
 #include "color.h"
 #  define COLOR_FIELD(X) X,
-# else
-#  define COLOR_FIELD(X) /*empty*/
-# endif
 #endif /* !OBJECTS_PASS_2_ */
 
 
index b4b61066dc34a0e406d40501bf89f75e16a27bb6..6d2a93314bab35f68cc99eb670af1872d847f5f3 100644 (file)
@@ -608,6 +608,7 @@ u_init()
                else if(!rn2(4)) ini_inv(Lamp);
                else if(!rn2(10)) ini_inv(Magicmarker);
                knows_object(SACK);
+               knows_object(TOUCHSTONE);
                skill_init(Skill_A);
                break;
        case PM_BARBARIAN: