1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Simplified terrainRect prototype.

This commit is contained in:
Frank Zago
2009-06-17 01:08:24 +00:00
parent 8231a6e6cc
commit cb1c31ac49
3 changed files with 5 additions and 5 deletions

View File

@@ -945,18 +945,18 @@ void CTerrainRect::show(SDL_Surface * to)
CGI->mh->terrainRect CGI->mh->terrainRect
(LOCPLINT->adventureInt->position, LOCPLINT->adventureInt->anim, (LOCPLINT->adventureInt->position, LOCPLINT->adventureInt->anim,
&LOCPLINT->cb->getVisibilityMap(), true, LOCPLINT->adventureInt->heroAnim, &LOCPLINT->cb->getVisibilityMap(), true, LOCPLINT->adventureInt->heroAnim,
to, &genRect(pos.h, pos.w, pos.x, pos.y), moveX, moveY); to, &pos, moveX, moveY);
else else
CGI->mh->terrainRect CGI->mh->terrainRect
(LOCPLINT->adventureInt->position, LOCPLINT->adventureInt->anim, (LOCPLINT->adventureInt->position, LOCPLINT->adventureInt->anim,
&LOCPLINT->cb->getVisibilityMap(), true, LOCPLINT->adventureInt->heroAnim, &LOCPLINT->cb->getVisibilityMap(), true, LOCPLINT->adventureInt->heroAnim,
to, &genRect(pos.h, pos.w, pos.x, pos.y), 0, 0); to, &pos, 0, 0);
//SDL_BlitSurface(teren,&genRect(pos.h,pos.w,0,0),screen,&genRect(547,594,7,6)); //SDL_BlitSurface(teren,&genRect(pos.h,pos.w,0,0),screen,&genRect(547,594,7,6));
//SDL_FreeSurface(teren); //SDL_FreeSurface(teren);
if (currentPath && LOCPLINT->adventureInt->position.z==currentPath->startPos().z) //drawing path if (currentPath && LOCPLINT->adventureInt->position.z==currentPath->startPos().z) //drawing path
{ {
showPath(&genRect(pos.h, pos.w, pos.x, pos.y)); showPath(&pos);
} }
} }

View File

@@ -560,7 +560,7 @@ void CMapHandler::init()
// top_tile top left tile to draw. Not necessarily visible. // top_tile top left tile to draw. Not necessarily visible.
// extRect, extRect = map window on screen // extRect, extRect = map window on screen
// moveX, moveY: when a hero is in movement indicates how to shift the map. Range is -31 to + 31. // moveX, moveY: when a hero is in movement indicates how to shift the map. Range is -31 to + 31.
void CMapHandler::terrainRect(int3 top_tile, unsigned char anim, std::vector< std::vector< std::vector<unsigned char> > > * visibilityMap, bool otherHeroAnim, unsigned char heroAnim, SDL_Surface * extSurf, SDL_Rect * extRect, int moveX, int moveY) void CMapHandler::terrainRect(int3 top_tile, unsigned char anim, std::vector< std::vector< std::vector<unsigned char> > > * visibilityMap, bool otherHeroAnim, unsigned char heroAnim, SDL_Surface * extSurf, const SDL_Rect * extRect, int moveX, int moveY)
{ {
// Width and height of the portion of the map to process. Units in tiles. // Width and height of the portion of the map to process. Units in tiles.
unsigned int dx = tilesW; unsigned int dx = tilesW;

View File

@@ -135,7 +135,7 @@ public:
void roadsRiverTerrainInit(); void roadsRiverTerrainInit();
void prepareFOWDefs(); void prepareFOWDefs();
void terrainRect(int3 top_tile, unsigned char anim, std::vector< std::vector< std::vector<unsigned char> > > * visibilityMap, bool otherHeroAnim, unsigned char heroAnim, SDL_Surface * extSurf, SDL_Rect * extRect, int moveX, int moveY); void terrainRect(int3 top_tile, unsigned char anim, std::vector< std::vector< std::vector<unsigned char> > > * visibilityMap, bool otherHeroAnim, unsigned char heroAnim, SDL_Surface * extSurf, const SDL_Rect * extRect, int moveX, int moveY);
void updateWater(); void updateWater();
unsigned char getHeroFrameNum(const unsigned char & dir, const bool & isMoving) const; //terrainRect helper function unsigned char getHeroFrameNum(const unsigned char & dir, const bool & isMoving) const; //terrainRect helper function
void validateRectTerr(SDL_Rect * val, const SDL_Rect * ext); //terrainRect helper void validateRectTerr(SDL_Rect * val, const SDL_Rect * ext); //terrainRect helper