void CProfileReader::LoadAll(void) { LoadUIInfo(); //加载赛前观光信息 LoadTourInfo(); //加载路线信息 LoadRouteInfo(); //加载赛程起点终点信息 LoadGameInfo(); //加载地图:根据*.map中的内容加载模型 LoadSceneInfo(); //加载地图:根据*.map中的内容加载模型 LoadMusicInfo("BACK_MUSIC", &m_BackMusicMap); LoadMusicInfo("ASIDE_MUSIC", &m_AsideMap); }
bool PlayData::LoadMusicData( const wchar_t* const pFilePath ) { WIN32_FIND_DATA FindFileData; HANDLE hFind = INVALID_HANDLE_VALUE; // ────────────────────────────── // Exception // ────────────────────────────── // Directory does not exist? if (( hFind = FindFirstFile( pFilePath, &FindFileData )) == INVALID_HANDLE_VALUE ) { WARN( L"폴더가 존재하지 않습니다. ( %s )", pFilePath ); return false; } // Directory is empty? if ( PathIsDirectoryEmpty( L"Notes\\" )) { WARN( L"노트 데이터 폴더가 비어있습니다. ( %s )", pFilePath ); return false; } // ────────────────────────────── // Load data // ────────────────────────────── const wchar_t* const pTag[] = { L"\\info.txt", L"\\enemy.png", L"\\background.png", L"\\cover.png", L"\\music.wav", L"\\note.txt", }; int tagCount = _countof( pTag ); hFind = FindFirstFile( pFilePath, &FindFileData ); FindNextFile( hFind, &FindFileData ); // Save all of path data or info data to repository. while ( FindNextFile( hFind, &FindFileData ) != 0 ) { CMusicData musicData; for ( int i = 0; i <tagCount; i++ ) { musicData.tagPath[i] = pFilePath; musicData.tagPath[i].pop_back( ); musicData.tagPath[i] += FindFileData.cFileName; musicData.tagPath[i] += pTag[i]; } LoadMusicInfo( &musicData ); g_mdRepository.push_back( std::move( musicData )); } FindClose( hFind ); return true; }