diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 13:39:46 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 13:39:46 +0000 |
commit | d976570ee5fbcc53481d76b2d55d389908968bd5 (patch) | |
tree | 2d21214d5876063cb72ddd798dc2e8bd60d4645a /crawl-ref/source/output.cc | |
parent | 9732543e9f33ed367f108f7b00509f67e8e9db81 (diff) | |
download | crawl-ref-d976570ee5fbcc53481d76b2d55d389908968bd5.tar.gz crawl-ref-d976570ee5fbcc53481d76b2d55d389908968bd5.zip |
Apply commits r6556 and r6557 to 0.4.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6558 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r-- | crawl-ref/source/output.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 8c7fdaf49d..2d5b9a6e97 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1195,14 +1195,17 @@ monster_pane_info::monster_pane_info(const monsters *m) if (m->has_ench(ENCH_BERSERK)) m_brands |= 4; } -// Sort monsters by: -// attitude -// difficulty -// type -// brand -bool // static -monster_pane_info::less_than(const monster_pane_info& m1, - const monster_pane_info& m2, bool zombified) +// Needed because gcc 4.3 sort does not like comparison functions that take +// more than 2 arguments. +bool monster_pane_info::less_than_wrapper(const monster_pane_info& m1, + const monster_pane_info& m2) +{ + return monster_pane_info::less_than(m1, m2, true); +} + +// Sort monsters by (in that order): attitude, difficulty, type, brand +bool monster_pane_info::less_than(const monster_pane_info& m1, + const monster_pane_info& m2, bool zombified) { if (m1.m_attitude < m2.m_attitude) return (true); @@ -1473,7 +1476,7 @@ void get_monster_pane_info(std::vector<monster_pane_info>& mons) mons.push_back(monster_pane_info(visible[i])); } } - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); } #define BOTTOM_JUSTIFY_MONSTER_LIST 0 @@ -1489,7 +1492,7 @@ int update_monster_pane() std::vector<monster_pane_info> mons; get_monster_pane_info(mons); - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); // Count how many groups of monsters there are unsigned int lines_needed = mons.size(); @@ -1506,7 +1509,9 @@ int update_monster_pane() // "rat zombie") in order to take up less lines. for (unsigned int i = 0; i < mons.size(); i++) mons[i].m_fullname = false; - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + + std::sort(mons.begin(), mons.end(), + monster_pane_info::less_than_wrapper); lines_needed = mons.size(); for (unsigned int i = 1; i < mons.size(); i++) |