1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

* refactoring of map handler and minor changes

This commit is contained in:
mateuszb
2010-08-16 13:51:31 +00:00
parent 9445e5b184
commit 9aa6d0a7b9
10 changed files with 201 additions and 458 deletions

View File

@@ -206,7 +206,7 @@ void CPlayerInterface::yourTurn()
acceptTurn();
}
inline void subRect(const int & x, const int & y, const int & z, const SDL_Rect & r, const int & hid)
STRONG_INLINE void subRect(const int & x, const int & y, const int & z, const SDL_Rect & r, const int & hid)
{
TerrainTile2 & hlp = CGI->mh->ttiles[x][y][z];
for(int h=0; h<hlp.objects.size(); ++h)
@@ -217,7 +217,7 @@ inline void subRect(const int & x, const int & y, const int & z, const SDL_Rect
}
}
inline void delObjRect(const int & x, const int & y, const int & z, const int & hid)
STRONG_INLINE void delObjRect(const int & x, const int & y, const int & z, const int & hid)
{
TerrainTile2 & hlp = CGI->mh->ttiles[x][y][z];
for(int h=0; h<hlp.objects.size(); ++h)
@@ -392,10 +392,10 @@ int3 CPlayerInterface::repairScreenPos(int3 pos)
pos.x = -CGI->mh->frameW;
if(pos.y<-CGI->mh->frameH)
pos.y = -CGI->mh->frameH;
if(pos.x>CGI->mh->map->width - adventureInt->terrain.tilesw + CGI->mh->frameW)
pos.x = CGI->mh->map->width - adventureInt->terrain.tilesw + CGI->mh->frameW;
if(pos.y>CGI->mh->map->height - adventureInt->terrain.tilesh + CGI->mh->frameH)
pos.y = CGI->mh->map->height - adventureInt->terrain.tilesh + CGI->mh->frameH;
if(pos.x>CGI->mh->sizes.x - adventureInt->terrain.tilesw + CGI->mh->frameW)
pos.x = CGI->mh->sizes.x - adventureInt->terrain.tilesw + CGI->mh->frameW;
if(pos.y>CGI->mh->sizes.y - adventureInt->terrain.tilesh + CGI->mh->frameH)
pos.y = CGI->mh->sizes.y - adventureInt->terrain.tilesh + CGI->mh->frameH;
return pos;
}
void CPlayerInterface::heroPrimarySkillChanged(const CGHeroInstance * hero, int which, si64 val)