MCPcopy Create free account
hub / github.com/crawl/crawl / _initialize

Function _initialize

crawl-ref/source/startup.cc:83–211  ·  view source on GitHub ↗

Initialise a whole lot of stuff...

Source from the content-addressed store, hash-verified

81
82// Initialise a whole lot of stuff...
83static void _initialize()
84{
85 Options.fixup_options();
86
87 you.symbol = MONS_PLAYER;
88 msg::initialise_mpr_streams();
89
90 rng::seed(); // don't use any chosen seed yet
91
92 clua.init_libraries();
93
94 init_char_table(Options.char_set);
95 init_show_table();
96 init_monster_symbols();
97 init_spell_descs(); // This needs to be way up top. {dlb}
98 init_zap_index();
99 init_mut_index();
100 init_sac_index();
101 init_duration_index();
102 init_mon_name_cache();
103 init_mons_spells();
104 init_parchment_overlays();
105
106 // init_item_name_cache() needs to be redone after init_char_table()
107 // and init_show_table() have been called, so that the glyphs will
108 // be set to use with item_names_by_glyph_cache.
109 init_item_name_cache();
110
111 unwind_bool no_more(crawl_state.show_more_prompt, false);
112
113 // Init item array.
114 for (int i = 0; i < MAX_ITEMS; ++i)
115 init_item(i);
116
117 reset_all_monsters();
118 init_anon();
119
120 env.igrid.init(NON_ITEM);
121 env.mgrid.init(NON_MONSTER);
122 env.map_knowledge.init(map_cell());
123 env.pgrid.init(terrain_property_t{});
124
125 you.unique_creatures.reset();
126 you.unique_items.init(UNIQ_NOT_EXISTS);
127
128 // Set up the Lua interpreter for the dungeon builder.
129 init_dungeon_lua();
130
131#ifdef USE_TILE_LOCAL
132 // Draw the splash screen before the database gets initialised as that
133 // may take awhile and it's better if the player can look at a pretty
134 // screen while this happens.
135 loading_screen_open();
136#endif
137
138 // Initialise internal databases.
139 _loading_message("Loading databases...");
140 databaseSystemInit();

Callers 1

startup_stepFunction · 0.85

Calls 15

initialise_mpr_streamsFunction · 0.85
seedFunction · 0.85
init_char_tableFunction · 0.85
init_show_tableFunction · 0.85
init_monster_symbolsFunction · 0.85
init_spell_descsFunction · 0.85
init_zap_indexFunction · 0.85
init_mut_indexFunction · 0.85
init_sac_indexFunction · 0.85
init_duration_indexFunction · 0.85
init_mon_name_cacheFunction · 0.85
init_mons_spellsFunction · 0.85

Tested by

no test coverage detected