Skip to content

Commit

Permalink
Allow negative values for music category
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Jun 7, 2024
1 parent 7d06401 commit d15bb96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/common/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ MusicList::MusicList()
}
}

void MusicList::setRandomMusic(size_t musicCategory, const std::string& mapName, const std::string& background)
void MusicList::setRandomMusic(short musicCategory, const std::string& mapName, const std::string& background)
{
m_currentMusic = m_entries[m_currentIndex]->randomMusic(musicCategory, mapName, background);
}

void MusicList::setNextMusic(size_t musicCategory, const std::string& mapName, const std::string& background)
void MusicList::setNextMusic(short musicCategory, const std::string& mapName, const std::string& background)
{
m_currentMusic = m_entries[m_currentIndex]->nextMusic(musicCategory, mapName, background);
}
Expand Down Expand Up @@ -575,7 +575,7 @@ const std::string& MusicEntry::music(size_t musicID) const
: songFileNames[musicID];
}

const std::string& MusicEntry::randomMusic(size_t musicCategory, const std::string& mapName, const std::string& background)
const std::string& MusicEntry::randomMusic(short musicCategory, const std::string& mapName, const std::string& background)
{
//First check if there is specific map music
const auto mapIter = mapoverride.find(mapName);
Expand All @@ -600,7 +600,7 @@ const std::string& MusicEntry::randomMusic(size_t musicCategory, const std::stri
return songFileNames[4];
}

const std::string& MusicEntry::nextMusic(size_t musicCategory, const std::string& mapName, const std::string& background)
const std::string& MusicEntry::nextMusic(short musicCategory, const std::string& mapName, const std::string& background)
{
//First check if there is specific map music
const auto mapIter = mapoverride.find(mapName);
Expand Down
8 changes: 4 additions & 4 deletions src/common/FileList.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class MusicEntry {

const std::string& name() const { return m_name; }
const std::string& music(size_t musicID) const;
const std::string& randomMusic(size_t categoryID, const std::string& mapName, const std::string& background);
const std::string& nextMusic(size_t categoryID, const std::string& mapName, const std::string& background);
const std::string& randomMusic(short categoryID, const std::string& mapName, const std::string& background);
const std::string& nextMusic(short categoryID, const std::string& mapName, const std::string& background);

private:
std::string m_name;
Expand All @@ -148,8 +148,8 @@ class MusicList
const std::string& currentMusic() const {
return m_currentMusic;
}
void setRandomMusic(size_t iCategoryID, const std::string& szMapName, const std::string& szBackground);
void setNextMusic(size_t iCategoryID, const std::string& szMapName, const std::string& szBackground);
void setRandomMusic(short iCategoryID, const std::string& szMapName, const std::string& szBackground);
void setNextMusic(short iCategoryID, const std::string& szMapName, const std::string& szBackground);

size_t currentIndex() const {
return m_currentIndex;
Expand Down

0 comments on commit d15bb96

Please sign in to comment.