1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Merged "music" resource type into "sound", enables ogg's use as sounds

This commit is contained in:
Ivan Savenko 2023-05-10 21:18:20 +03:00
parent ca19fc7fcc
commit 9eac3eaafa
4 changed files with 7 additions and 9 deletions

View File

@ -335,7 +335,7 @@ CMusicHandler::CMusicHandler():
auto mp3files = CResourceHandler::get()->getFilteredFiles([](const ResourceID & id) -> bool
{
if(id.getType() != EResType::MUSIC)
if(id.getType() != EResType::SOUND)
return false;
if(!boost::algorithm::istarts_with(id.getName(), "MUSIC/"))
@ -561,7 +561,7 @@ void MusicEntry::load(std::string musicURI)
try
{
auto musicFile = MakeSDLRWops(CResourceHandler::get()->load(ResourceID(std::move(musicURI), EResType::MUSIC)));
auto musicFile = MakeSDLRWops(CResourceHandler::get()->load(ResourceID(std::move(musicURI), EResType::SOUND)));
music = Mix_LoadMUS_RW(musicFile, SDL_TRUE);
}
catch(std::exception &e)

View File

@ -1047,8 +1047,8 @@ namespace
std::string musicFile(const JsonNode & node)
{
TEST_FILE(node.meta, "Music/", node.String(), EResType::MUSIC);
TEST_FILE(node.meta, "", node.String(), EResType::MUSIC);
TEST_FILE(node.meta, "Music/", node.String(), EResType::SOUND);
TEST_FILE(node.meta, "", node.String(), EResType::SOUND);
return "Music file \"" + node.String() + "\" was not found";
}

View File

@ -139,14 +139,14 @@ EResType::Type EResTypeHelper::getTypeFromExtension(std::string extension)
{".TGA", EResType::IMAGE},
{".WAV", EResType::SOUND},
{".82M", EResType::SOUND},
{".MP3", EResType::SOUND},
{".OGG", EResType::SOUND},
{".FLAC", EResType::SOUND},
{".SMK", EResType::VIDEO},
{".BIK", EResType::VIDEO},
{".MJPG", EResType::VIDEO},
{".MPG", EResType::VIDEO},
{".AVI", EResType::VIDEO},
{".MP3", EResType::MUSIC},
{".OGG", EResType::MUSIC},
{".FLAC", EResType::MUSIC},
{".ZIP", EResType::ARCHIVE_ZIP},
{".LOD", EResType::ARCHIVE_LOD},
{".PAC", EResType::ARCHIVE_LOD},
@ -186,7 +186,6 @@ std::string EResTypeHelper::getEResTypeAsString(EResType::Type type)
MAP_ENUM(IMAGE)
MAP_ENUM(VIDEO)
MAP_ENUM(SOUND)
MAP_ENUM(MUSIC)
MAP_ENUM(ARCHIVE_ZIP)
MAP_ENUM(ARCHIVE_LOD)
MAP_ENUM(ARCHIVE_SND)

View File

@ -45,7 +45,6 @@ namespace EResType
IMAGE,
VIDEO,
SOUND,
MUSIC,
ARCHIVE_VID,
ARCHIVE_ZIP,
ARCHIVE_SND,