mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +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:
@ -450,6 +450,8 @@ void CAmbarCendamo::deh3m()
|
|||||||
//teceDef();
|
//teceDef();
|
||||||
}
|
}
|
||||||
std::vector<CDefHandler *> dhandlers = CGameInfo::mainObj->lodh->extractManyFiles(defsToUnpack, std::string("newh3sprite.lod"));
|
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;
|
std::cout<<'\r'<<"Reading defs: 100% "<<std::endl;
|
||||||
SDL_FreeSurface(alphaTransSurf);
|
SDL_FreeSurface(alphaTransSurf);
|
||||||
THC std::cout<<"Wczytywanie defow: "<<th.getDif()<<std::endl;
|
THC std::cout<<"Wczytywanie defow: "<<th.getDif()<<std::endl;
|
||||||
|
@ -486,7 +486,7 @@ int CLodHandler::infs2(unsigned char * in, int size, int realSize, unsigned char
|
|||||||
z_stream strm;
|
z_stream strm;
|
||||||
unsigned char inx[NLoadHandlerHelp::fCHUNK];
|
unsigned char inx[NLoadHandlerHelp::fCHUNK];
|
||||||
unsigned char outx[NLoadHandlerHelp::fCHUNK];
|
unsigned char outx[NLoadHandlerHelp::fCHUNK];
|
||||||
out = new unsigned char [size];
|
out = new unsigned char [realSize];
|
||||||
int latPosOut = 0;
|
int latPosOut = 0;
|
||||||
|
|
||||||
/* allocate inflate state */
|
/* allocate inflate state */
|
||||||
|
2
CMT.cpp
2
CMT.cpp
@ -337,7 +337,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
|||||||
ac->deh3m();
|
ac->deh3m();
|
||||||
THC std::cout<<"Rozpoznawianie pliku lacznie: "<<tmh.getDif()<<std::endl;
|
THC std::cout<<"Rozpoznawianie pliku lacznie: "<<tmh.getDif()<<std::endl;
|
||||||
ac->loadDefs();
|
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();
|
CMapHandler * mh = new CMapHandler();
|
||||||
mh->reader = ac;
|
mh->reader = ac;
|
||||||
THC std::cout<<"Stworzenie mapHandlera: "<<tmh.getDif()<<std::endl;
|
THC std::cout<<"Stworzenie mapHandlera: "<<tmh.getDif()<<std::endl;
|
||||||
|
@ -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)
|
else if(CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].printPriority==0)
|
||||||
{
|
{
|
||||||
ObjSorter os;
|
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.xpos = (CGameInfo::mainObj->objh->objInstances[gg].x-x+4)*32;
|
||||||
os.ypos = (CGameInfo::mainObj->objh->objInstances[gg].y-y+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())
|
if (CGameInfo::mainObj->ac->map.defy[CGameInfo::mainObj->objh->objInstances[gg].defNumber].isVisitable())
|
||||||
|
Reference in New Issue
Block a user