diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-12-10 05:32:19 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-12-10 17:48:48 +0100 |
commit | 44efaac9094d00ba10424f30f27f9e1dd5f0a93e (patch) | |
tree | d775f17a82a34d840d2d4ff17612aea5114947ab /crawl-ref/source/itemname.h | |
parent | e3f8c6adc96be8246a1da3aa9955b30c2b1d5c78 (diff) | |
download | crawl-ref-44efaac9094d00ba10424f30f27f9e1dd5f0a93e.tar.gz crawl-ref-44efaac9094d00ba10424f30f27f9e1dd5f0a93e.zip |
Massively speed up reading .des files.
A majority of time was spent parsing item names by repeatedly generating all
possible items and comparing their names. We already have an item name cache.
Diffstat (limited to 'crawl-ref/source/itemname.h')
-rw-r--r-- | crawl-ref/source/itemname.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h index d1c5f99341..da4af1df4f 100644 --- a/crawl-ref/source/itemname.h +++ b/crawl-ref/source/itemname.h @@ -12,10 +12,11 @@ #define CORPSE_NAME_KEY "corpse_name_key" #define CORPSE_NAME_TYPE_KEY "corpse_name_type_key" -struct item_types_pair +struct item_kind { object_class_type base_type; uint8_t sub_type; + int8_t plus, plus2; }; // [dshaligram] If you edit potion colours/descriptions, also update @@ -123,7 +124,7 @@ std::string get_menu_colour_prefix_tags(const item_def &item, description_level_type desc); void init_item_name_cache(); -item_types_pair item_types_by_name(std::string name); +item_kind item_kind_by_name(std::string name); std::vector<std::string> item_name_list_for_glyph(unsigned glyph); |