1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* bugfixes

* general improvements
This commit is contained in:
mateuszb 2007-10-18 20:14:26 +00:00
parent c1e9e9b750
commit f3b5d07aa5
6 changed files with 98 additions and 40 deletions

View File

@ -102,16 +102,6 @@ bool CCallback::moveHero(int ID, CPath * path, int idtype, int pathType)
{
hero->pos = endpos;
}*/
for(int xd=0; xd<CGI->ac->map.width; ++xd) //revealing part of map around heroes
{
for(int yd=0; yd<CGI->ac->map.height; ++yd)
{
int deltaX = (endpos.x-xd)*(endpos.x-xd);
int deltaY = (endpos.y-yd)*(endpos.y-yd);
if(deltaX+deltaY<=hero->getSightDistance()*hero->getSightDistance())
gs->players[player].fogOfWarMap[xd][yd][endpos.z] = 1;
}
}
if((hero->movement>=CGI->mh->getCost(stpos, endpos, hero)) || player==-1)
{ //performing move
hero->movement-=CGI->mh->getCost(stpos, endpos, hero);
@ -125,6 +115,17 @@ bool CCallback::moveHero(int ID, CPath * path, int idtype, int pathType)
++nn;
break; //for testing only
}
for(int xd=0; xd<CGI->ac->map.width; ++xd) //revealing part of map around heroes
{
for(int yd=0; yd<CGI->ac->map.height; ++yd)
{
int deltaX = (hero->getPosition(false).x-xd)*(hero->getPosition(false).x-xd);
int deltaY = (hero->getPosition(false).y-yd)*(hero->getPosition(false).y-yd);
if(deltaX+deltaY<hero->getSightDistance()*hero->getSightDistance())
gs->players[player].fogOfWarMap[xd][yd][hero->getPosition(false).z] = 1;
}
}
}
else
return true; //move ended - no more movement points

View File

@ -806,7 +806,7 @@ SDL_Surface * CPlayerInterface::infoWin(void * specific) //specific=0 => draws i
char * buf = new char[10];
SDL_Surface * ret = copySurface(hInfo);
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format,0,255,255));
//blueToPlayersAdv(ret,playerID); // zygzyg - nie koloruje, tylko odrobine smieci
blueToPlayersAdv(ret,playerID); // zygzyg - nie koloruje, tylko odrobine smieci
const CHeroInstance * curh = (const CHeroInstance *)adventureInt->selection.selected;
printAt(curh->name,75,15,GEOR13,zwykly,ret);
for (int i=0;i<PRIMARY_SKILLS;i++)

View File

@ -164,7 +164,7 @@ void initGameState(CGameInfo * cgi)
{
int deltaX = (k->second.heroes[ch]->getPosition(false).x-xd)*(k->second.heroes[ch]->getPosition(false).x-xd);
int deltaY = (k->second.heroes[ch]->getPosition(false).y-yd)*(k->second.heroes[ch]->getPosition(false).y-yd);
if(deltaX+deltaY<=k->second.heroes[ch]->getSightDistance()*k->second.heroes[ch]->getSightDistance())
if(deltaX+deltaY<k->second.heroes[ch]->getSightDistance()*k->second.heroes[ch]->getSightDistance())
k->second.fogOfWarMap[xd][yd][k->second.heroes[ch]->getPosition(false).z] = 1;
}
}
@ -193,7 +193,7 @@ void initGameState(CGameInfo * cgi)
{
int deltaX = (k->second.towns[ch]->pos.x-xd)*(k->second.towns[ch]->pos.x-xd);
int deltaY = (k->second.towns[ch]->pos.y-yd)*(k->second.towns[ch]->pos.y-yd);
if(deltaX+deltaY<=k->second.towns[ch]->getSightDistance()*k->second.towns[ch]->getSightDistance())
if(deltaX+deltaY<k->second.towns[ch]->getSightDistance()*k->second.towns[ch]->getSightDistance())
k->second.fogOfWarMap[xd][yd][k->second.towns[ch]->pos.z] = 1;
}
}

View File

@ -577,7 +577,7 @@ void CSDL_Ext::blueToPlayersAdv(SDL_Surface * sur, int player)
{
for(int x=0; x<sur->w; ++x)
{
Uint8* cp = (Uint8*)sur->pixels + y+sur->pitch + x*3;
Uint8* cp = (Uint8*)sur->pixels + y*sur->pitch + x*3;
if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
{
if(cp[2]>cp[1] && cp[2]>cp[0])

View File

@ -25,9 +25,48 @@ void CMapHandler::init()
fullHide = CGameInfo::mainObj->spriteh->giveDef("TSHRC.DEF");
partialHide = CGameInfo::mainObj->spriteh->giveDef("TSHRE.DEF");
//adding necessary rotations
Cimage nw = partialHide->ourImages[22]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[15]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[2]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[13]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[12]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[16]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[18]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[17]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[20]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[19]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[7]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[24]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[26]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[25]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[30]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[32]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[27]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
nw = partialHide->ourImages[28]; nw.bitmap = CSDL_Ext::rotate01(nw.bitmap);
partialHide->ourImages.push_back(nw);
//necessaary rotations added
for(int i=0; i<partialHide->ourImages.size(); ++i)
{
CSDL_Ext::alphaTransform(partialHide->ourImages[i].bitmap);
CSDL_Ext::fullAlphaTransform(partialHide->ourImages[i].bitmap);
}
//visibility.resize(reader->map.width+2*Woff);
@ -911,9 +950,9 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
if(bx+x>=0 && by+y>=0 && bx+x<CGI->mh->reader->map.width && bx+x<CGI->mh->reader->map.height && !visibilityMap[bx+x][by+y][0])
{
SDL_Surface * hide = getVisBitmap(bx+x, by+y, visibilityMap, 0);
SDL_Surface * hide2 = CSDL_Ext::secondAlphaTransform(hide, su);
SDL_BlitSurface(hide2, NULL, su, &sr);
SDL_FreeSurface(hide2);
//SDL_Surface * hide2 = CSDL_Ext::secondAlphaTransform(hide, su);
SDL_BlitSurface(hide, NULL, su, &sr);
//SDL_FreeSurface(hide2);
}
}
else
@ -922,9 +961,9 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
if(bx+x>=0 && by+y>=0 && bx+x<CGI->mh->reader->map.width && bx+x<CGI->mh->reader->map.height && !visibilityMap[bx+x][by+y][1])
{
SDL_Surface * hide = getVisBitmap(bx+x, by+y, visibilityMap, 1);
SDL_Surface * hide2 = CSDL_Ext::secondAlphaTransform(hide, su);
SDL_BlitSurface(hide2, NULL, su, &sr);
SDL_FreeSurface(hide2);
//SDL_Surface * hide2 = CSDL_Ext::secondAlphaTransform(hide, su);
SDL_BlitSurface(hide, NULL, su, &sr);
//SDL_FreeSurface(hide2);
}
}
}
@ -1016,11 +1055,13 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[22].bitmap); //visible left bottom corner
//return CSDL_Ext::rotate01(partialHide->ourImages[22].bitmap); //visible left bottom corner
return partialHide->ourImages[34].bitmap; //visible left bottom corner
}
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && !visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[15].bitmap); //visible left top corner
//return CSDL_Ext::rotate01(partialHide->ourImages[15].bitmap); //visible left top corner
return partialHide->ourImages[35].bitmap;
}
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && !visibilityMap[x-1][y+1][lvl])
{
@ -1035,7 +1076,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
//return CSDL_Ext::rotate01(partialHide->ourImages[2+rand()%2].bitmap); //visible left
return CSDL_Ext::rotate01(partialHide->ourImages[2].bitmap); //visible left
//return CSDL_Ext::rotate01(partialHide->ourImages[2].bitmap); //visible left
return partialHide->ourImages[36].bitmap;
}
else if(!visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && !visibilityMap[x-1][y+1][lvl])
{
@ -1053,12 +1095,14 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && !visibilityMap[x+1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[13].bitmap); //visible top, top - left, left; right bottom corner hidden
//return CSDL_Ext::rotate01(partialHide->ourImages[13].bitmap); //visible top, top - left, left; right bottom corner hidden
return partialHide->ourImages[37].bitmap;
}
else if(visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x+1][y-1][lvl])
{
//return CSDL_Ext::rotate01(partialHide->ourImages[12+2*(rand()%2)].bitmap); //visible left, left - bottom, bottom; right top corner hidden
return CSDL_Ext::rotate01(partialHide->ourImages[12].bitmap); //visible left, left - bottom, bottom; right top corner hidden
//return CSDL_Ext::rotate01(partialHide->ourImages[12].bitmap); //visible left, left - bottom, bottom; right top corner hidden
return partialHide->ourImages[38].bitmap;
}
else if(visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
@ -1074,11 +1118,13 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[16].bitmap); //visible left corners
//return CSDL_Ext::rotate01(partialHide->ourImages[16].bitmap); //visible left corners
return partialHide->ourImages[39].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::hFlip(partialHide->ourImages[18].bitmap); //visible bottom corners
//return CSDL_Ext::hFlip(partialHide->ourImages[18].bitmap); //visible bottom corners
return partialHide->ourImages[40].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
@ -1086,7 +1132,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && !visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::hFlip(partialHide->ourImages[17].bitmap); //visible top - left and bottom - right corners
//return CSDL_Ext::hFlip(partialHide->ourImages[17].bitmap); //visible top - left and bottom - right corners
return partialHide->ourImages[41].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
@ -1098,11 +1145,13 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[20].bitmap); //visible corners without right bottom
//return CSDL_Ext::rotate01(partialHide->ourImages[20].bitmap); //visible corners without right bottom
return partialHide->ourImages[42].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[19].bitmap); //visible corners without right top
//return CSDL_Ext::rotate01(partialHide->ourImages[19].bitmap); //visible corners without right top
return partialHide->ourImages[43].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
@ -1122,7 +1171,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[7].bitmap); //hidden left
//return CSDL_Ext::rotate01(partialHide->ourImages[7].bitmap); //hidden left
return partialHide->ourImages[44].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl])
{
@ -1138,7 +1188,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[24].bitmap); //visible top and left bottom corner
//return CSDL_Ext::rotate01(partialHide->ourImages[24].bitmap); //visible top and left bottom corner
return partialHide->ourImages[45].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x-1][y+1][lvl])
{
@ -1146,11 +1197,13 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[26].bitmap); //visible left and right top corner
//return CSDL_Ext::rotate01(partialHide->ourImages[26].bitmap); //visible left and right top corner
return partialHide->ourImages[46].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && !visibilityMap[x+1][y-1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[25].bitmap); //visible left and right bottom corner
//return CSDL_Ext::rotate01(partialHide->ourImages[25].bitmap); //visible left and right bottom corner
return partialHide->ourImages[47].bitmap;
}
if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x+1][y+1][lvl] && visibilityMap[x+1][y-1][lvl])
{
@ -1158,7 +1211,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && !visibilityMap[x+1][y-1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[30].bitmap); //visible bottom and left top corner
//return CSDL_Ext::rotate01(partialHide->ourImages[30].bitmap); //visible bottom and left top corner
return partialHide->ourImages[48].bitmap;
}
if(visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && !visibilityMap[x-1][y-1][lvl] && visibilityMap[x+1][y-1][lvl])
{
@ -1178,7 +1232,8 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
if(!visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl] && visibilityMap[x-1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[32].bitmap); //visible right and left cornres
//return CSDL_Ext::rotate01(partialHide->ourImages[32].bitmap); //visible right and left cornres
return partialHide->ourImages[49].bitmap;
}
if(visibilityMap[x][y+1][lvl] && visibilityMap[x+1][y][lvl] && !visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x-1][y-1][lvl])
{
@ -1190,11 +1245,13 @@ SDL_Surface * CMapHandler::getVisBitmap(int x, int y, PseudoV< PseudoV< PseudoV<
}
else if(!visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && visibilityMap[x][y-1][lvl] && visibilityMap[x+1][y+1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[27].bitmap); //visible top, top - left, left; right bottom corner visible
//return CSDL_Ext::rotate01(partialHide->ourImages[27].bitmap); //visible top, top - left, left; right bottom corner visible
return partialHide->ourImages[50].bitmap;
}
else if(visibilityMap[x][y+1][lvl] && !visibilityMap[x+1][y][lvl] && visibilityMap[x-1][y][lvl] && !visibilityMap[x][y-1][lvl] && visibilityMap[x+1][y-1][lvl])
{
return CSDL_Ext::rotate01(partialHide->ourImages[28].bitmap); //visible left, left - bottom, bottom; right top corner visible
//return CSDL_Ext::rotate01(partialHide->ourImages[28].bitmap); //visible left, left - bottom, bottom; right top corner visible
return partialHide->ourImages[51].bitmap;
}
return fullHide->ourImages[0].bitmap; //this case should never happen, but it is better to hide too much than reveal it....
}

View File

@ -65,7 +65,7 @@ public:
CDefHandler * fullHide;
CDefHandler * partialHide;
PseudoV< PseudoV< PseudoV<unsigned char> > > visibility; //true means that pointed place is visible
PseudoV< PseudoV< PseudoV<unsigned char> > > visibility; //true means that pointed place is visible //not used now
//std::vector< std::vector<char> > undVisibility; //true means that pointed place is visible
std::vector<CDefHandler *> roadDefs;
std::vector<CDefHandler *> staticRiverDefs;