浏览代码

Simplified terrainRect prototype.

Frank Zago 16 年之前
父节点
当前提交
cb1c31ac49
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 3 3
      client/CAdvmapInterface.cpp
  2. 1 1
      mapHandler.cpp
  3. 1 1
      mapHandler.h

+ 3 - 3
client/CAdvmapInterface.cpp

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

+ 1 - 1
mapHandler.cpp

@@ -560,7 +560,7 @@ void CMapHandler::init()
 // top_tile top left tile to draw. Not necessarily visible.
 // 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.
-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.
 	unsigned int dx = tilesW;

+ 1 - 1
mapHandler.h

@@ -135,7 +135,7 @@ public:
 	void roadsRiverTerrainInit();
 	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();
 	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