summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc2
-rw-r--r--crawl-ref/source/dungeon.cc10
-rw-r--r--crawl-ref/source/externs.h5
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/mon-util.cc17
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/shopping.cc3
7 files changed, 19 insertions, 22 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 835615e60e..343cf55052 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -212,7 +212,7 @@ int main( int argc, char *argv[] )
}
// Init monsters up front - needed to handle the mon_glyph option right.
- init_monsters(mcolour);
+ init_monsters();
// Init name cache so that we can parse stash_filter by item name.
init_properties();
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 14823938f1..d462e30f44 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -1673,7 +1673,10 @@ void dgn_set_colours_from_monsters()
env.floor_colour = LIGHTGREY;
}
else
- env.floor_colour = _fix_black_colour((char)mcolour[env.mons_alloc[9]]);
+ {
+ env.floor_colour =
+ _fix_black_colour(mons_class_colour(env.mons_alloc[9]));
+ }
if (env.mons_alloc[8] < 0 || env.mons_alloc[8] == MONS_PROGRAM_BUG
|| env.mons_alloc[8] >= NUM_MONSTERS)
@@ -1682,7 +1685,10 @@ void dgn_set_colours_from_monsters()
env.rock_colour = BROWN;
}
else
- env.rock_colour = _fix_black_colour((char)mcolour[env.mons_alloc[8]]);
+ {
+ env.rock_colour =
+ _fix_black_colour(mons_class_colour(env.mons_alloc[8]));
+ }
}
static void _dgn_set_floor_colours()
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 6b3eb875e2..221d6d6187 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -63,11 +63,6 @@ protected:
extern char info[INFO_SIZE]; // defined in acr.cc {dlb}
-extern unsigned char show_green; // defined in view.cc {dlb}
-
-// defined in mon-util.cc -- w/o this screen redraws *really* slow {dlb}
-extern FixedVector<unsigned short, 1000> mcolour;
-
const int kNameLen = 30;
#ifdef SHORT_FILE_NAMES
const int kFileNameLen = 6;
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0dd08b3ef8..e94909fe9b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1969,7 +1969,7 @@ void setup_missile_beam(const actor *agent, bolt &beam, item_def &item,
beam.can_see_invis = agent->can_see_invisible();
- item_def *launcher = const_cast<actor*>(agent)->weapon(0);
+ const item_def *launcher = const_cast<actor*>(agent)->weapon(0);
if (launcher && !item.launched_by(*launcher))
launcher = NULL;
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 11317612cf..4114891a32 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -232,24 +232,19 @@ monster_type get_monster_by_name(std::string name, bool exact)
return (mon);
}
-void init_monsters(FixedVector < unsigned short, 1000 > &colour)
+void init_monsters()
{
- unsigned int x; // must be unsigned to match size_t {dlb}
-
- for (x = 0; x < MONDATASIZE; x++)
- colour[mondata[x].mc] = mondata[x].colour;
-
// First, fill static array with dummy values. {dlb}
mon_entry.init(-1);
// Next, fill static array with location of entry in mondata[]. {dlb}:
- for (x = 0; x < MONDATASIZE; x++)
- mon_entry[mondata[x].mc] = x;
+ for (unsigned int i = 0; i < MONDATASIZE; ++i)
+ mon_entry[mondata[i].mc] = i;
// Finally, monsters yet with dummy entries point to TTTSNB(tm). {dlb}:
- for (x = 0; x < NUM_MONSTERS; x++)
- if (mon_entry[x] == -1)
- mon_entry[x] = mon_entry[MONS_PROGRAM_BUG];
+ for (unsigned int i = 0; i < NUM_MONSTERS; ++i)
+ if (mon_entry[i] == -1)
+ mon_entry[i] = mon_entry[MONS_PROGRAM_BUG];
init_monster_symbols();
}
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 842518314f..4adc20468f 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -459,7 +459,7 @@ mon_resist_def get_mons_resists(const monsters *mon);
/* ***********************************************************************
* called from: acr
* *********************************************************************** */
-void init_monsters( FixedVector<unsigned short, 1000>& colour );
+void init_monsters();
void init_monster_symbols();
monsters *monster_at(const coord_def &pos);
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index ecb0a4898d..742f991b14 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -463,7 +463,8 @@ static bool _in_a_shop( int shopidx )
}
item_def& item = mitm[stock[ft]];
- const int gp_value = _shop_get_item_value(item, shop.greed, id_stock);
+ const int gp_value = _shop_get_item_value(item, shop.greed,
+ id_stock);
selected[ft] = !selected[ft];
if (selected[ft])