summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-06-08 20:08:15 -0400
committerNeil Moore <neil@s-z.org>2014-06-08 20:08:15 -0400
commit855d067cd5c2d27e921fb4d6ad8b2fe6b4c09f04 (patch)
tree2747db69fdc7293e5d73b1e4d5f2b2c5b8c4f7e7 /crawl-ref/source/beam.cc
parent24a81542c72a237fd133c9a51da01a9effe7c1b8 (diff)
downloadcrawl-ref-855d067cd5c2d27e921fb4d6ad8b2fe6b4c09f04.tar.gz
crawl-ref-855d067cd5c2d27e921fb4d6ad8b2fe6b4c09f04.zip
Don't pause the game for offscreen explosions.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 7ff70341af..7e55b915f0 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -6149,6 +6149,7 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
{
for (siter ci = sweep.begin(); ci != sweep.end(); ++ci)
{
+ bool pass_visible = false;
for (viter cci = ci->begin(); cci != ci->end(); ++cci)
{
const coord_def delta = *cci;
@@ -6157,11 +6158,13 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
continue;
if (exp_map(delta + centre) < INT_MAX)
- explosion_draw_cell(delta + pos());
+ pass_visible |= explosion_draw_cell(delta + pos());
+ }
+ if (pass_visible)
+ {
+ update_screen();
+ scaled_delay(explode_delay);
}
- update_screen();
-
- scaled_delay(explode_delay);
}
}
@@ -6193,29 +6196,34 @@ bool bolt::explode(bool show_more, bool hole_in_the_middle)
return cells_seen > 0;
}
-void bolt::explosion_draw_cell(const coord_def& p)
+/**
+ * Draw one tile of an explosion, if that cell is visible.
+ *
+ * @param p The cell to draw, in grid coordinates.
+ * @return True if the cell was actually drawn.
+ */
+bool bolt::explosion_draw_cell(const coord_def& p)
{
if (you.see_cell(p))
{
const coord_def drawpos = grid2view(p);
-#ifdef USE_TILE
+ // bounds check
if (in_los_bounds_v(drawpos))
{
+#ifdef USE_TILE
int dist = (p - source).rdist();
tileidx_t tile = tileidx_bolt(*this);
tiles.add_overlay(p, vary_bolt_tile(tile, dist));
- }
#endif
#ifndef USE_TILE_LOCAL
- // bounds check
- if (in_los_bounds_v(drawpos))
- {
cgotoxy(drawpos.x, drawpos.y, GOTO_DNGN);
put_colour_ch(colour == BLACK ? random_colour() : colour,
dchar_glyph(DCHAR_EXPLOSION));
- }
#endif
+ return true;
+ }
}
+ return false;
}
void bolt::explosion_affect_cell(const coord_def& p)