1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Filesystem handling is now more flexible

- removed CResourceLoader class in favor of one that implements resource loader interface
- removed global pool of files, in favour of more dynamic approach
- renamed some files to match current situation
All these changes are needed mostly for future mod manager + .zip support
This commit is contained in:
Ivan Savenko
2013-07-28 14:49:50 +00:00
parent aa6626bc35
commit b87897096c
64 changed files with 1203 additions and 1521 deletions

View File

@ -2,7 +2,7 @@
#include "SDL.h"
#include "CDefHandler.h"
#include "../lib/filesystem/CResourceLoader.h"
#include "../lib/filesystem/Filesystem.h"
#include "../lib/VCMI_Lib.h"
#include "CBitmapHandler.h"
@ -362,8 +362,9 @@ CDefEssential * CDefHandler::essentialize()
CDefHandler * CDefHandler::giveDef(const std::string & defName)
{
ui8 * data = CResourceHandler::get()->loadData(
ResourceID(std::string("SPRITES/") + defName, EResType::ANIMATION)).first.release();
ResourceID resID(std::string("SPRITES/") + defName, EResType::ANIMATION);
ui8 * data = CResourceHandler::get()->load(resID)->readAll().first.release();
if(!data)
throw std::runtime_error("bad def name!");
auto nh = new CDefHandler();