1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-13 23:57:41 +02:00

- music player uses URI's instead of enum from music base

- #1045 and #1046 should be fixed
- moved pregame backgrounds to config/mainmenu
- animation can be overriden with .json multiple times
This commit is contained in:
Ivan Savenko
2012-08-06 07:34:37 +00:00
parent 385be09248
commit 708ad6ac7f
24 changed files with 212 additions and 256 deletions

View File

@@ -2,6 +2,7 @@
#include <SDL_image.h>
#include "../lib/Filesystem/CResourceLoader.h"
#include "../lib/Filesystem/ISimpleResourceLoader.h"
#include "../lib/JsonNode.h"
#include "../lib/vcmi_endian.h"
@@ -934,9 +935,16 @@ void CAnimation::init(CDefFile * file)
source[mapIt->first].resize(mapIt->second);
}
if (CResourceHandler::get()->existsResource(ResourceID(std::string("SPRITES/") + name, EResType::TEXT)))
auto & configList = CResourceHandler::get()->getResourcesWithName(
ResourceID(std::string("SPRITES/") + name, EResType::TEXT));
BOOST_FOREACH(auto & entry, configList)
{
const JsonNode config(ResourceID(std::string("SPRITES/") + name, EResType::TEXT));
auto stream = entry.getLoader()->load(entry.getResourceName());
std::unique_ptr<ui8[]> textData(new ui8[stream->getSize()]);
stream->read(textData.get(), stream->getSize());
const JsonNode config((char*)textData.get(), stream->getSize());
std::string basepath;
basepath = config["basepath"].String();