diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-28 23:33:32 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-29 01:07:35 +0100 |
commit | 5f4ae1ef05d92d9da03cde00b07d187f2f53a06d (patch) | |
tree | 01dbc85606ad5ab882333b1695c915b63e97b96d /crawl-ref/source/areas.cc | |
parent | 2965f04181dcb6530b93acb194ba5f7561d8adc9 (diff) | |
download | crawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.tar.gz crawl-ref-5f4ae1ef05d92d9da03cde00b07d187f2f53a06d.zip |
Replace `mpr(s, ch)` with `mprf(ch, s)`
Also simplify quite a few cases.
It turns out in >90% cases of non-literals the argument had .c_str(),
which meant it was pointlessly malloc()ed and converted from and to
std::string. I believe a sprintf is faster, so even the argument of
miniscule speed-up doesn't apply.
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r-- | crawl-ref/source/areas.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index c779bdbb0c..e9774d1ecd 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -344,7 +344,7 @@ void decrease_sanctuary_radius() if (you.running && is_sanctuary(you.pos())) { - mpr("The sanctuary starts shrinking.", MSGCH_DURATION); + mprf(MSGCH_DURATION, "The sanctuary starts shrinking."); stop_running(); } @@ -362,7 +362,7 @@ void decrease_sanctuary_radius() { _remove_sanctuary_property(env.sanctuary_pos); if (you.see_cell(env.sanctuary_pos)) - mpr("The sanctuary disappears.", MSGCH_DURATION); + mprf(MSGCH_DURATION, "The sanctuary disappears."); } } @@ -466,27 +466,21 @@ void create_sanctuary(const coord_def& center, int time) // Messaging. if (trap_count > 0) - { - mpr("By Zin's power, hidden traps are revealed to you.", - MSGCH_GOD); - } + mprf(MSGCH_GOD, "By Zin's power, hidden traps are revealed to you."); if (cloud_count == 1) { - mpr("By Zin's power, the foul cloud within the sanctuary is " - "swept away.", MSGCH_GOD); + mprf(MSGCH_GOD, "By Zin's power, the foul cloud within the sanctuary " + "is swept away."); } else if (cloud_count > 1) { - mpr("By Zin's power, all foul fumes within the sanctuary are " - "swept away.", MSGCH_GOD); + mprf(MSGCH_GOD, "By Zin's power, all foul fumes within the sanctuary " + "are swept away."); } if (blood_count > 0) - { - mpr("By Zin's power, all blood is cleared from the sanctuary.", - MSGCH_GOD); - } + mprf(MSGCH_GOD, "By Zin's power, all blood is cleared from the sanctuary."); if (scare_count == 1 && seen_mon != NULL) simple_monster_message(seen_mon, " turns to flee the light!"); |