diff --git a/hch/CLodHandler.cpp b/hch/CLodHandler.cpp index c37120013..cbafd9486 100644 --- a/hch/CLodHandler.cpp +++ b/hch/CLodHandler.cpp @@ -418,73 +418,102 @@ CDefEssential * CLodHandler::giveDefEss(std::string defName) } std::vector CLodHandler::extractManyFiles(std::vector defNamesIn) { - std::vector ret(defNamesIn.size()); + std::vector ret(defNamesIn.size()); for(int hh=0; hh found(defNamesIn.size(), 0); - for (int i=0;ioffset, 0); unsigned char * outp; - if (entries[i].size==0) //file is not compressed + if (e->size==0) //file is not compressed { - outp = new unsigned char[entries[i].realSize]; - fread((char*)outp, 1, entries[i].realSize, FLOD); + outp = new unsigned char[e->realSize]; + fread((char*)outp, 1, e->realSize, FLOD); CDefHandler * nh = new CDefHandler; - nh->openFromMemory(outp, entries[i].realSize, std::string((char*)entries[i].name)); + nh->openFromMemory(outp, e->realSize, std::string((char*)e->name)); nh->alphaTransformed = false; - ret[curDef] = nh; + ret[hh] = nh; } else //we will decompressing file { - outp = new unsigned char[entries[i].size]; - fread((char*)outp, 1, entries[i].size, FLOD); + outp = new unsigned char[e->size]; + fread((char*)outp, 1, e->size, FLOD); fseek(FLOD, 0, 0); unsigned char * decomp = NULL; - int decRes = infs2(outp, entries[i].size, entries[i].realSize, decomp); + int decRes = infs2(outp, e->size, e->realSize, decomp); CDefHandler * nh = new CDefHandler; - nh->openFromMemory(decomp, entries[i].realSize, std::string((char*)entries[i].name)); + nh->openFromMemory(decomp, e->realSize, std::string((char*)e->name)); nh->alphaTransformed = false; delete [] decomp; - ret[curDef] = nh; + ret[hh] = nh; } delete[] outp; } - //std::cout<<'\r'<<"Reading defs: 100% "< found(defNamesIn.size(), 0); + //for (int i=0;iopenFromMemory(outp, entries[i].realSize, std::string((char*)entries[i].name)); + // nh->alphaTransformed = false; + // ret[curDef] = nh; + // } + // else //we will decompressing file + // { + // outp = new unsigned char[entries[i].size]; + // fread((char*)outp, 1, entries[i].size, FLOD); + // fseek(FLOD, 0, 0); + // unsigned char * decomp = NULL; + // int decRes = infs2(outp, entries[i].size, entries[i].realSize, decomp); + // CDefHandler * nh = new CDefHandler; + // nh->openFromMemory(decomp, entries[i].realSize, std::string((char*)entries[i].name)); + // nh->alphaTransformed = false; + // delete [] decomp; + // ret[curDef] = nh; + // } + // delete[] outp; + //} + ////std::cout<<'\r'<<"Reading defs: 100% "<