| 1394 | } |
| 1395 | |
| 1396 | void CFamiTrackerDocIO::LoadBookmarks(CFamiTrackerModule &modfile, int ver) { |
| 1397 | for (int i = 0, n = file_.GetBlockInt(); i < n; ++i) { |
| 1398 | auto pMark = std::make_unique<CBookmark>(); |
| 1399 | unsigned int Track = AssertRange( |
| 1400 | static_cast<unsigned char>(file_.GetBlockChar()), 0, modfile.GetSongCount() - 1, "Bookmark song index"); |
| 1401 | int Frame = static_cast<unsigned char>(file_.GetBlockChar()); |
| 1402 | int Row = static_cast<unsigned char>(file_.GetBlockChar()); |
| 1403 | |
| 1404 | auto *pSong = modfile.GetSong(Track); |
| 1405 | pMark->m_iFrame = AssertRange(Frame, 0, static_cast<int>(pSong->GetFrameCount()) - 1, "Bookmark frame index"); |
| 1406 | pMark->m_iRow = AssertRange(Row, 0, static_cast<int>(pSong->GetPatternLength()) - 1, "Bookmark row index"); |
| 1407 | pMark->m_Highlight.First = file_.GetBlockInt(); |
| 1408 | pMark->m_Highlight.Second = file_.GetBlockInt(); |
| 1409 | pMark->m_bPersist = file_.GetBlockChar() != 0; |
| 1410 | pMark->m_sName = file_.ReadString(); |
| 1411 | pSong->GetBookmarks().AddBookmark(std::move(pMark)); |
| 1412 | } |
| 1413 | } |
| 1414 | |
| 1415 | void CFamiTrackerDocIO::SaveBookmarks(const CFamiTrackerModule &modfile, int ver) { |
| 1416 | int Count = 0; |
nothing calls this directly
no test coverage detected