void initPlugins ( void ) { customPluginMap.clear(); OSDir dir; std::string path = getAutoLoadDir(); if (getAutoLoadDir().size()) { dir.setOSDir(getAutoLoadDir()); OSFile file; std::string searchdir = "*" + extension; while(dir.getNextFile(file,searchdir.c_str(),false) ) loadPlugin(file.getOSName(),std::string("")); } }
void FontManager::loadAll(std::string directory) { if (directory.size() == 0) return; OSFile file; OSDir dir(directory.c_str()); while (dir.getNextFile(file, true)) { const char *ext = file.getExtension(); if (ext) { if (strcasecmp(ext, "fmt") == 0) { TextureFont *pFont = new TextureFont; if (pFont) { if (pFont->load(file)) { std::string str = pFont->getFaceName(); GetTypeFaceName((char*)str.c_str()); FontFaceMap::iterator faceItr = faceNames.find(str); int faceID = 0; if (faceItr == faceNames.end()) { // its new FontSizeMap faceList; fontFaces.push_back(faceList); faceID = (int)fontFaces.size() - 1; faceNames[str] = faceID; } else { faceID = faceItr->second; } fontFaces[faceID][pFont->getSize()] = pFont; } else { DEBUG4("Font Texture load failed: %s\n", file.getOSName()); delete(pFont); } } } } } }