summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shout.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2011-01-07 04:10:41 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2011-01-07 04:11:31 +0530
commitae6dc4e354481ced662dceef799fffe55e69bc74 (patch)
tree3c80bd4929c05433a1aa50260d163dc746ad5449 /crawl-ref/source/shout.cc
parentb79762af95378bd9bafcd80af32f75a8e58e7860 (diff)
downloadcrawl-ref-ae6dc4e354481ced662dceef799fffe55e69bc74.tar.gz
crawl-ref-ae6dc4e354481ced662dceef799fffe55e69bc74.zip
Protect spammy noise dprfs with DEBUG_NOISE_PROPAGATION.
Diffstat (limited to 'crawl-ref/source/shout.cc')
-rw-r--r--crawl-ref/source/shout.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/shout.cc b/crawl-ref/source/shout.cc
index aab348cf00..584486a5ef 100644
--- a/crawl-ref/source/shout.cc
+++ b/crawl-ref/source/shout.cc
@@ -744,7 +744,11 @@ void noise_grid::propagate_noise()
#ifdef DEBUG_NOISE_PROPAGATION
if (affected_actor_count)
+ {
+ mprf(MSGCH_WARN, "Writing noise grid with %d noise sources",
+ noises.size());
dump_noise_grid("noise-grid.html");
+ }
#endif
}
@@ -883,6 +887,7 @@ coord_def noise_grid::noise_perceived_position(actor *act,
_point_clamped_in_bounds(perceived_point)
: perceived_point;
+#ifdef DEBUG_NOISE_PROPAGATION
dprf("[NOISE] Noise perceived by %s at (%d,%d) centroid (%d,%d) "
"source (%d,%d) "
"heard at (%d,%d), distance: %d (traveled %d)",
@@ -892,6 +897,7 @@ coord_def noise_grid::noise_perceived_position(actor *act,
noise.noise_source.x, noise.noise_source.y,
affected_pos.x, affected_pos.y,
cell_grid_distance, noise_travel_distance);
+#endif
return (final_perceived_point);
}
@@ -1008,6 +1014,7 @@ static void _actor_apply_noise(actor *act,
const noise_t &noise,
int noise_travel_distance)
{
+#ifdef DEBUG_NOISE_PROPAGATION
dprf("[NOISE] Actor %s (%d,%d) perceives noise (%d) "
"from (%d,%d), real source (%d,%d), distance: %d, noise traveled: %d",
act->name(DESC_PLAIN, true).c_str(),
@@ -1017,6 +1024,7 @@ static void _actor_apply_noise(actor *act,
noise.noise_source.x, noise.noise_source.y,
grid_distance(act->pos(), noise.noise_source),
noise_travel_distance);
+#endif
const bool player = act->is_player();
if (player)