Hidden units are not displayed in the minimap (again *grin*)
This commit is contained in:
parent
097978a9f2
commit
9ca6eb262a
3 changed files with 8 additions and 6 deletions
|
@ -918,7 +918,10 @@ void display::draw_minimap(int x, int y, int w, int h)
|
||||||
SDL_BlitSurface(surface,NULL,video().getSurface(),&loc);
|
SDL_BlitSurface(surface,NULL,video().getSurface(),&loc);
|
||||||
|
|
||||||
for(unit_map::const_iterator u = units_.begin(); u != units_.end(); ++u) {
|
for(unit_map::const_iterator u = units_.begin(); u != units_.end(); ++u) {
|
||||||
if(fogged(u->first.x,u->first.y))
|
if(fogged(u->first.x,u->first.y) || u->second.invisible(
|
||||||
|
map_.underlying_terrain(map_[u->first.x][u->first.y]),
|
||||||
|
status_.get_time_of_day().lawful_bonus,u->first,
|
||||||
|
units_,teams_))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const int side = u->second.side();
|
const int side = u->second.side();
|
||||||
|
@ -1670,7 +1673,7 @@ SDL_Surface* display::getMinimap(int w, int h)
|
||||||
std::cerr << "regetting minimap\n";
|
std::cerr << "regetting minimap\n";
|
||||||
minimap_ = image::getMinimap(w,h,map_,
|
minimap_ = image::getMinimap(w,h,map_,
|
||||||
status_.get_time_of_day().lawful_bonus,
|
status_.get_time_of_day().lawful_bonus,
|
||||||
team_valid() ? &teams_[currentTeam_] : NULL, &units_, &teams_);
|
team_valid() ? &teams_[currentTeam_] : NULL);
|
||||||
std::cerr << "done regetting minimap\n";
|
std::cerr << "done regetting minimap\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,8 +224,7 @@ SDL_Surface* get_image_dim(const std::string& filename, size_t x, size_t y)
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Surface* getMinimap(int w, int h, const gamemap& map,
|
SDL_Surface* getMinimap(int w, int h, const gamemap& map,
|
||||||
int lawful_bonus,
|
int lawful_bonus, const team* tm)
|
||||||
const team* tm, const unit_map* units, const std::vector<team>* teams)
|
|
||||||
{
|
{
|
||||||
SDL_Surface* minimap = NULL;
|
SDL_Surface* minimap = NULL;
|
||||||
if(minimap == NULL) {
|
if(minimap == NULL) {
|
||||||
|
@ -300,4 +299,4 @@ SDL_Surface* getMinimap(int w, int h, const gamemap& map,
|
||||||
return minimap;
|
return minimap;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace image {
|
||||||
|
|
||||||
//the surface returned must be freed by the user
|
//the surface returned must be freed by the user
|
||||||
SDL_Surface* getMinimap(int w, int h, const gamemap& map_, int lawful_bonus,
|
SDL_Surface* getMinimap(int w, int h, const gamemap& map_, int lawful_bonus,
|
||||||
const team* tm=NULL, const unit_map* units=NULL, const std::vector<team>* teams=NULL);
|
const team* tm=NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue