manager::~manager() { deinit(); clear_fonts(); TTF_Quit(); }
//sets the font list to be used. static void set_font_list(const std::vector<subset_descriptor>& fontlist) { clear_fonts(); std::vector<subset_descriptor>::const_iterator itor; for(itor = fontlist.begin(); itor != fontlist.end(); ++itor) { // Insert fonts only if the font file exists if(game_config::path.empty() == false) { if(!filesystem::file_exists(game_config::path + "/fonts/" + itor->name)) { if(!filesystem::file_exists("fonts/" + itor->name)) { if(!filesystem::file_exists(itor->name)) { WRN_FT << "Failed opening font file '" << itor->name << "': No such file or directory" << std::endl; continue; } } } } else { if(!filesystem::file_exists("fonts/" + itor->name)) { if(!filesystem::file_exists(itor->name)) { WRN_FT << "Failed opening font file '" << itor->name << "': No such file or directory" << std::endl; continue; } } } const subset_id subset = font_names.size(); font_names.push_back(itor->name); BOOST_FOREACH(const subset_descriptor::range &cp_range, itor->present_codepoints) { char_blocks.insert(cp_range.first, cp_range.second, subset); } } char_blocks.compress(); }
void clear_all() { clear_fonts(); clear_gbitmap(); clear_marvin(); clear_time(); clear_date(); clear_bolt(); clear_explosion(); clear_animations(); clear_background(); }
//sets the font list to be used. static void set_font_list(const std::vector<subset_descriptor>& fontlist) { clear_fonts(); // font_map.reserve(0x10000); // KP: 65,536 ints = 262,144k std::vector<subset_descriptor>::const_iterator itor; for(itor = fontlist.begin(); itor != fontlist.end(); ++itor) { // Insert fonts only if the font file exists if(game_config::path.empty() == false) { if(!file_exists(game_config::path + "/fonts/" + itor->name)) { if(!file_exists("fonts/" + itor->name)) { if(!file_exists(itor->name)) { WRN_FT << "Failed opening font file '" << itor->name << "': No such file or directory\n"; continue; } } } } else { if(!file_exists("fonts/" + itor->name)) { if(!file_exists(itor->name)) { WRN_FT << "Failed opening font file '" << itor->name << "': No such file or directory\n"; continue; } } } // const subset_id subset = font_names.size(); font_names.push_back(itor->name); /* std::vector<std::pair<size_t,size_t> >::const_iterator cp_range; for(cp_range = itor->present_codepoints.begin(); cp_range != itor->present_codepoints.end(); ++cp_range) { size_t cp_max = std::max<size_t>(cp_range->first, cp_range->second); if(cp_max >= font_map.size()) { font_map.resize(cp_max+1, -1); } for(size_t cp = cp_range->first; cp <= cp_range->second; ++cp) { if(font_map[cp] < 0) font_map[cp] = subset; } } */ } }