1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

large filesystem update. Filesysytem is now fully functional, everything should work.

- completely replaced CLodHandler, removed bitmaph and spriteh
- replaced CLodStream in favour of CCompressedStream (2 new files)
- renamed CResourceLoaderFactory and ResourceIndetifier to shorter names
NOTES:
- campaign loading is currently broken. Will fix.
- I am going to remove several unused files in several days (e.g. LodHandler)
This commit is contained in:
Ivan Savenko
2012-08-01 12:02:54 +00:00
parent 17a513c01b
commit b3c17d2788
55 changed files with 1319 additions and 767 deletions

View File

@ -1,6 +1,7 @@
#include "StdInc.h"
#include "CHeroHandler.h"
#include "Filesystem/CResourceLoader.h"
#include "CLodHandler.h"
#include "../lib/VCMI_Lib.h"
#include "../lib/JsonNode.h"
@ -8,7 +9,6 @@
#include <boost/version.hpp>
#include "BattleHex.h"
extern CLodHandler * bitmaph;
void loadToIt(std::string &dest, const std::string &src, int &iter, int mode);
/*
* CHeroHandler.cpp, part of VCMI engine
@ -165,7 +165,8 @@ void CHeroHandler::loadPuzzleInfo()
void CHeroHandler::loadHeroes()
{
VLC->heroh = this;
std::string buf = bitmaph->getTextFile("HOTRAITS.TXT");
auto textFile = CResourceHandler::get()->loadData(ResourceID("DATA/HOTRAITS.TXT"));
std::string buf((char*)textFile.first.get(), textFile.second);
int it=0;
std::string dump;
for(int i=0; i<2; ++i)
@ -286,7 +287,8 @@ void CHeroHandler::loadHeroes()
expPerLevel.pop_back();//last value is broken
//ballistics info
buf = bitmaph->getTextFile("BALLIST.TXT");
textFile = CResourceHandler::get()->loadData(ResourceID("DATA/BALLIST.TXT"));
buf = std::string((char*)textFile.first.get(), textFile.second);
it = 0;
for(int i=0; i<22; ++i)
{
@ -324,7 +326,8 @@ void CHeroHandler::loadHeroes()
void CHeroHandler::loadHeroClasses()
{
std::istringstream str(bitmaph->getTextFile("HCTRAITS.TXT")); //we'll be reading from it
auto textFile = CResourceHandler::get()->loadData(ResourceID("DATA/HCTRAITS.TXT"));
std::istringstream str(std::string((char*)textFile.first.get(), textFile.second)); //we'll be reading from it
const int BUFFER_SIZE = 5000;
char buffer[BUFFER_SIZE+1];