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

* [bugfix] poprawne przypisywanie handlerów defom (nie trafiają już w próżnię)

* [bugfix] naprawiony straszliwy błąd z rozwalaniem sterty
This commit is contained in:
Michał W. Urbańczyk 2007-07-07 12:28:15 +00:00
parent 7b77d94f57
commit dd24f5cd40
4 changed files with 10 additions and 3 deletions

View File

@ -450,6 +450,8 @@ void CAmbarCendamo::deh3m()
//teceDef();
}
std::vector<CDefHandler *> dhandlers = CGameInfo::mainObj->lodh->extractManyFiles(defsToUnpack, std::string("newh3sprite.lod"));
for (int i=0;i<dhandlers.size();i++)
map.defy[i].handler=dhandlers[i];
std::cout<<'\r'<<"Reading defs: 100% "<<std::endl;
SDL_FreeSurface(alphaTransSurf);
THC std::cout<<"Wczytywanie defow: "<<th.getDif()<<std::endl;

View File

@ -486,7 +486,7 @@ int CLodHandler::infs2(unsigned char * in, int size, int realSize, unsigned char
z_stream strm;
unsigned char inx[NLoadHandlerHelp::fCHUNK];
unsigned char outx[NLoadHandlerHelp::fCHUNK];
out = new unsigned char [size];
out = new unsigned char [realSize];
int latPosOut = 0;
/* allocate inflate state */

View File

@ -337,7 +337,7 @@ int _tmain(int argc, _TCHAR* argv[])
ac->deh3m();
THC std::cout<<"Rozpoznawianie pliku lacznie: "<<tmh.getDif()<<std::endl;
ac->loadDefs();
THC std::cout<<"Wczytywanie defow: "<<tmh.getDif()<<std::endl;
THC std::cout<<"Wczytywanie defow terenu: "<<tmh.getDif()<<std::endl;
CMapHandler * mh = new CMapHandler();
mh->reader = ac;
THC std::cout<<"Stworzenie mapHandlera: "<<tmh.getDif()<<std::endl;

View File

@ -330,7 +330,12 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
else if(CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].printPriority==0)
{
ObjSorter os;
os.bitmap = CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].handler->ourImages[anim%CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].handler->ourImages.size()].bitmap;
int defyod = CGameInfo::mainObj->objh->objInstances[gg].defNumber;
int ourimagesod = anim%CGameInfo::mainObj->ac->map.defy[defyod].handler->ourImages.size();
os.bitmap = CGameInfo::mainObj->ac->map.defy[defyod].handler->ourImages[ourimagesod].bitmap;
os.xpos = (CGameInfo::mainObj->objh->objInstances[gg].x-x+4)*32;
os.ypos = (CGameInfo::mainObj->objh->objInstances[gg].y-y+4)*32;
if (CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].isVisitable())