//----------------------------------------------- // buildIdVector // //----------------------------------------------- void CSheetId::buildIdVector(std::vector <CSheetId> &result, std::vector <std::string> &resultFilenames,const std::string &fileExtension) { uint32 type=typeFromFileExtension(fileExtension); if (type != std::numeric_limits<uint32>::max()) buildIdVector(result,resultFilenames, type); } // buildIdVector //
//----------------------------------------------- // init // //----------------------------------------------- void CSheetId::init(bool removeUnknownSheet) { // allow multiple calls to init in case libraries depending on sheetid call this init from their own if (_Initialised) { if (_DontHaveSheetKnowledge) nlinfo("SHEETID: CSheetId is already initialized without sheet_id.bin"); return; } // CFile::addFileChangeCallback ("sheet_id.bin", cbFileChange); _RemoveUnknownSheet = removeUnknownSheet; loadSheetId (); _Initialised=true; #ifdef NL_TEMP_YUBO_NO_SOUND_SHEET_ID if (typeFromFileExtension("sound") == std::numeric_limits<uint32>::max()) { nlwarning("SHEETID: Loading without known sound sheet id, please update sheet_id.bin with .sound sheets"); nlassert(_FileExtensions.size() == 1 << (NL_SHEET_ID_TYPE_BITS)); nlassert(_FileExtensions[a_NoSoundSheetType].empty()); _FileExtensions[a_NoSoundSheetType] = "sound"; _DevSheetIdToName.push_back(std::vector<std::string>()); _DevSheetIdToName[0].push_back("unknown.sound"); TSheetId id; id.IdInfos.Type = a_NoSoundSheetType; id.IdInfos.Id = _DevSheetIdToName[0].size() - 1; nlassert(id.IdInfos.Id == 0); _DevSheetNameToId["unknown.sound"] = id.Id; a_NoSoundSheetId = true; } #endif } // init //