diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-12-06 03:56:05 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-12-06 04:00:23 +0100 |
commit | c9c663e6f2d6cd4547decd6466a7571e09ad0430 (patch) | |
tree | 99f8c4c273bcd7d85f2acb69c16f3d14dc17975b /crawl-ref/source/feature.h | |
parent | f6a881ee62a7f4699649faca211e05d2783b62bc (diff) | |
download | crawl-ref-c9c663e6f2d6cd4547decd6466a7571e09ad0430.tar.gz crawl-ref-c9c663e6f2d6cd4547decd6466a7571e09ad0430.zip |
Optimize get_feature_def().
This bizarre map took around 4% of qw CPU. Separating the defs into
something directly addressable costs nothing but a minor duplication during
initialization that could be put into a function.
Diffstat (limited to 'crawl-ref/source/feature.h')
-rw-r--r-- | crawl-ref/source/feature.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/feature.h b/crawl-ref/source/feature.h index 7690f6b2b4..d6225d2272 100644 --- a/crawl-ref/source/feature.h +++ b/crawl-ref/source/feature.h @@ -29,6 +29,21 @@ struct feature_def minimap(MF_UNSEEN) {} + // FIXME: my kingdom for C++11 !!! + // Please drop this constructor for a proper initializer in feature.cc then. + feature_def(dungeon_char_type dc, ucs_t ms) : + dchar(dc), + symbol(0), + magic_symbol(ms), + colour(BLACK), + map_colour(DARKGREY), + seen_colour(BLACK), + em_colour(BLACK), + seen_em_colour(BLACK), + flags(FFT_NONE), + minimap(MF_UNSEEN) + {} + bool is_notable() const { return flags & FFT_NOTABLE; } }; |