diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-28 17:39:14 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-29 01:07:35 +0100 |
commit | 2965f04181dcb6530b93acb194ba5f7561d8adc9 (patch) | |
tree | 3bde1791031add1297e063a2c1d1458d300f30ba /crawl-ref | |
parent | dbdbaf16e9ad6400c5232cd3b87583acfc996267 (diff) | |
download | crawl-ref-2965f04181dcb6530b93acb194ba5f7561d8adc9.tar.gz crawl-ref-2965f04181dcb6530b93acb194ba5f7561d8adc9.zip |
Revert "Replace `mprf(ch, s)` with `mpr(s, ch)`"
It trades readability and consistency for an utterly negligible bit of
speed. With the amount of further processing mpr() does, a single sprintf
is nothing.
This reverts commit d9dfa8fc9755fb0a4e8954c7eb94f32fe97b82e0.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/art-func.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/dbg-maps.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/dbg-scan.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/dgl-message.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/dgn-shoals.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/directn.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/main.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/mapmark.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/mon-abil.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/terrain.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/wiz-item.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/wiz-mon.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/wiz-you.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 2 |
18 files changed, 34 insertions, 34 deletions
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h index 7725997947..b56b0bf54a 100644 --- a/crawl-ref/source/art-func.h +++ b/crawl-ref/source/art-func.h @@ -335,7 +335,7 @@ static void _SINGING_SWORD_equip(item_def *item, bool *show_msgs, bool unmeld) if (!item->props.exists("ss_welcome")) { - mpr("The sword says, \"Hi! I'm the Singing Sword!\"", MSGCH_TALK); + mprf(MSGCH_TALK, "The sword says, \"Hi! I'm the Singing Sword!\""); item->props["ss_welcome"].get_bool() = true; } else diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc index 794524d69f..a335a3732c 100644 --- a/crawl-ref/source/dbg-maps.cc +++ b/crawl-ref/source/dbg-maps.cc @@ -82,7 +82,7 @@ static bool mg_do_build_level(int niters) { if (kbhit() && key_is_escape(getchk())) { - mpr("User requested cancel", MSGCH_WARN); + mprf(MSGCH_WARN, "User requested cancel"); return false; } diff --git a/crawl-ref/source/dbg-scan.cc b/crawl-ref/source/dbg-scan.cc index 8a42c06752..6ebadb3c22 100644 --- a/crawl-ref/source/dbg-scan.cc +++ b/crawl-ref/source/dbg-scan.cc @@ -220,7 +220,7 @@ void debug_item_scan(void) if (mons.name(DESC_PLAIN, true).find("questionable") != string::npos) { - mpr("Program bug detected!", MSGCH_ERROR); + mprf(MSGCH_ERROR, "Program bug detected!"); mprf(MSGCH_ERROR, "Buggy monster detected: monster #%d; position (%d,%d)", i, mons.pos().x, mons.pos().y); diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 4ec608d7e7..721d289e48 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -863,7 +863,7 @@ void handle_delay() break; case DELAY_BUTCHER: - mpr("You continue butchering the corpse.", MSGCH_MULTITURN_ACTION); + mprf(MSGCH_MULTITURN_ACTION, "You continue butchering the corpse."); break; case DELAY_BOTTLE_BLOOD: @@ -916,7 +916,7 @@ void handle_delay() stop_delay(); return; } - mpr("You continue drinking.", MSGCH_MULTITURN_ACTION); + mprf(MSGCH_MULTITURN_ACTION, "You continue drinking."); vampire_nutrition_per_turn(corpse, 0); break; } @@ -1725,7 +1725,7 @@ void autotoggle_autopickup(bool off) else if (Options.autopickup_on < 0) // was turned off automatically { Options.autopickup_on = 1; - mpr("Reactivating autopickup.", MSGCH_WARN); + mprf(MSGCH_WARN, "Reactivating autopickup."); } } diff --git a/crawl-ref/source/dgl-message.cc b/crawl-ref/source/dgl-message.cc index 6b057f4d1a..dbb4803300 100644 --- a/crawl-ref/source/dgl-message.cc +++ b/crawl-ref/source/dgl-message.cc @@ -84,7 +84,7 @@ static void _read_each_message() if (say_got_msg) { - mpr("Your messages:", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "Your messages:"); say_got_msg = false; } diff --git a/crawl-ref/source/dgn-shoals.cc b/crawl-ref/source/dgn-shoals.cc index 90d4d562ed..50c3f37b5c 100644 --- a/crawl-ref/source/dgn-shoals.cc +++ b/crawl-ref/source/dgn-shoals.cc @@ -1050,7 +1050,7 @@ static void _shoals_apply_tide_at(coord_def c, int tide, bool incremental_tide) && !you.ground_level() && !you.permanent_flight()) { - mpr("The tide rushes in under you.", MSGCH_WARN); + mprf(MSGCH_WARN, "The tide rushes in under you."); } } @@ -1270,7 +1270,7 @@ void wizard_mod_tide() { if (!player_in_branch(BRANCH_SHOALS) || !env.heightmap.get()) { - mpr("Not in Shoals or no heightmap; tide not available.", MSGCH_WARN); + mprf(MSGCH_WARN, "Not in Shoals or no heightmap; tide not available."); return; } diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index a7266c09ba..d5e893f72e 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1552,7 +1552,7 @@ void direction_chooser::print_items_description() const get_menu_colour_prefix_tags(*item, DESC_A).c_str()); if (multiple_items_at(target())) - mpr("There is something else lying underneath.", MSGCH_FLOOR_ITEMS); + mprf(MSGCH_FLOOR_ITEMS, "There is something else lying underneath."); } void direction_chooser::print_floor_description(bool boring_too) const @@ -1608,7 +1608,7 @@ void direction_chooser::toggle_beam() { if (!needs_path) { - mpr("This spell doesn't need a beam path.", MSGCH_EXAMINE_FILTER); + mprf(MSGCH_EXAMINE_FILTER, "This spell doesn't need a beam path."); return; } diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 273c2e91df..37447f5c29 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1102,7 +1102,7 @@ static int _prompt_ring_to_remove(int new_ring) mprf(MSGCH_PROMPT, "You're wearing all the rings you can. Remove which one?"); - mpr("(<w>?</w> for menu, <w>Esc</w> to cancel)", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "(<w>?</w> for menu, <w>Esc</w> to cancel)"); // FIXME: Needs TOUCH_UI version diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index 40a0423c26..abf4827e65 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -1308,7 +1308,7 @@ static void _input() if (!has_pending_input() && !kbhit()) { if (++crawl_state.lua_calls_no_turn > 1000) - mpr("Infinite lua loop detected, aborting.", MSGCH_ERROR); + mprf(MSGCH_ERROR, "Infinite lua loop detected, aborting."); else clua.callfn("ready", 0, 0); } diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index a65913ab53..7da368b3dd 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -222,7 +222,7 @@ void map_lua_marker::check_register_table() { if (!lua_istable(dlua, -1)) { - mpr("lua_marker: Expected table, didn't get it.", MSGCH_ERROR); + mprf(MSGCH_ERROR, "lua_marker: Expected table, didn't get it."); initialised = false; return; } @@ -251,7 +251,7 @@ void map_lua_marker::write(writer &outf) const bool init = initialised; if (!get_table()) { - mpr("Couldn't find table.", MSGCH_ERROR); + mprf(MSGCH_ERROR, "Couldn't find table."); init = false; } diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 8f9eff15aa..3cc1f59bdb 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -1115,7 +1115,7 @@ static bool _orange_statue_effects(monster* mons) if (you.can_see(foe)) { if (foe->is_player()) - mpr("A hostile presence attacks your mind!", MSGCH_WARN); + mprf(MSGCH_WARN, "A hostile presence attacks your mind!"); else if (you.can_see(mons)) mprf(MSGCH_WARN, "%s fixes %s piercing gaze on %s.", mons->name(DESC_THE).c_str(), diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 9ebb9b2fd6..dfe86311b6 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2652,7 +2652,7 @@ static void _gain_piety_point() if (!one_chance_in(4) && !you_worship(GOD_JIYVA)) { #ifdef DEBUG_PIETY - mpr("Piety slowdown due to gift timeout.", MSGCH_DIAGNOSTICS); + mprf(MSGCH_DIAGNOSTICS, "Piety slowdown due to gift timeout."); #endif return; } diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 5aa1383ed4..b7a3599597 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -605,12 +605,12 @@ bool feat_destroys_item(dungeon_feature_type feat, const item_def &item, case DNGN_SHALLOW_WATER: case DNGN_DEEP_WATER: if (noisy) - mpr("You hear a splash.", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You hear a splash."); return false; case DNGN_LAVA: if (noisy) - mpr("You hear a sizzling splash.", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You hear a sizzling splash."); return true; default: @@ -627,17 +627,17 @@ bool feat_virtually_destroys_item(dungeon_feature_type feat, const item_def &ite { case DNGN_SHALLOW_WATER: if (noisy) - mpr("You hear a splash.", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You hear a splash."); return false; case DNGN_DEEP_WATER: if (noisy) - mpr("You hear a splash.", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You hear a splash."); return true; case DNGN_LAVA: if (noisy) - mpr("You hear a sizzling splash.", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You hear a sizzling splash."); return true; default: diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index d708d057e7..81a4112d1d 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -4074,7 +4074,7 @@ bool runrest::run_should_stop() const { #ifndef USE_TILE_LOCAL // XXX: Remove this once exclusions are visible. - mpr("Stopped running for exclusion.", MSGCH_WARN); + mprf(MSGCH_WARN, "Stopped running for exclusion."); #endif return true; } diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index 05de002c1e..0e55bd9292 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -68,7 +68,7 @@ static void _make_all_books() void wizard_create_spec_object_by_name() { char buf[1024]; - mpr("Enter name of item (or ITEM spec): ", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "Enter name of item (or ITEM spec): "); if (cancellable_get_line_autohist(buf, sizeof buf) || !*buf) { canned_msg(MSG_OK); diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc index 0a482c7d8c..e4381bd3db 100644 --- a/crawl-ref/source/wiz-mon.cc +++ b/crawl-ref/source/wiz-mon.cc @@ -1051,13 +1051,13 @@ void wizard_give_monster_item(monster* mon) if ((mon->flags & MF_HARD_RESET) && !(item.flags & ISFLAG_SUMMONED)) { - mpr("WARNING: Monster has MF_HARD_RESET and all its " - "items will disappear when it does.", MSGCH_WARN); + mprf(MSGCH_WARN, "WARNING: Monster has MF_HARD_RESET and all its " + "items will disappear when it does."); } else if ((item.flags & ISFLAG_SUMMONED) && !mon->is_summoned()) { - mpr("WARNING: Item is summoned and will disappear when " - "the monster does.", MSGCH_WARN); + mprf(MSGCH_WARN, "WARNING: Item is summoned and will disappear when " + "the monster does."); } // Monster's old item moves to player's inventory. if (old_eq != NON_ITEM) @@ -1065,8 +1065,8 @@ void wizard_give_monster_item(monster* mon) mpr("Fetching monster's old item."); if (mitm[old_eq].flags & ISFLAG_SUMMONED) { - mpr("WARNING: Item is summoned and shouldn't really be anywhere " - "but in the inventory of a summoned monster.", MSGCH_WARN); + mprf(MSGCH_WARN, "WARNING: Item is summoned and shouldn't really " + "be anywhere but in the inventory of a summoned monster."); } mitm[old_eq].pos.reset(); mitm[old_eq].link = NON_ITEM; diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc index f3c44f0d4a..c9bb2ea7df 100644 --- a/crawl-ref/source/wiz-you.cc +++ b/crawl-ref/source/wiz-you.cc @@ -703,7 +703,7 @@ bool wizard_add_mutation() void wizard_set_abyss() { char buf[80]; - mpr("Enter values for X, Y, Z (space separated) or return: ", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "Enter values for X, Y, Z (space separated) or return: "); if (!cancellable_get_line_autohist(buf, sizeof buf)) abyss_teleport(true); @@ -715,7 +715,7 @@ void wizard_set_abyss() void wizard_set_stats() { char buf[80]; - mpr("Enter values for Str, Int, Dex (space separated): ", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "Enter values for Str, Int, Dex (space separated): "); if (cancellable_get_line_autohist(buf, sizeof buf)) return; @@ -1004,7 +1004,7 @@ static void debug_downtick_xl(int newxl) void wizard_set_xl() { - mpr("Enter new experience level: ", MSGCH_PROMPT); + mprf(MSGCH_PROMPT, "Enter new experience level: "); char buf[30]; if (cancellable_get_line_autohist(buf, sizeof buf)) { diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 632910fbda..62a0a9c136 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -4124,7 +4124,7 @@ void debug_xom_effects() FILE *ostat = fopen("xom_debug.stat", "a"); if (!ostat) { - mpr("Can't write 'xom_debug.stat'. Aborting.", MSGCH_ERROR); + mprf(MSGCH_ERROR, "Can't write 'xom_debug.stat'. Aborting."); return; } |