Author: mordante
Date: Sun May 27 01:53:57 2007
New Revision: 17885
URL: http://svn.gna.org/viewcvs/wesnoth?rev=17885&view=rev
Log:
converted get_flag() to use gamemap::location
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=17885&r1=17884&r2=17885&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sun May 27 01:53:57 2007
@@ -1481,7 +1481,7 @@
if(!is_shrouded) {
draw_terrain_on_tile(loc.x,loc.y,image_type,ADJACENT_BACKGROUND);
- surface flag(get_flag(terrain,loc.x,loc.y));
+ surface flag(get_flag(terrain,loc));
if(flag != NULL) {
SDL_Rect dstrect = { xpos, ypos, 0, 0 };
SDL_BlitSurface(flag,NULL,dst,&dstrect);
@@ -1901,14 +1901,11 @@
return res;
}
-surface display::get_flag(t_translation::t_letter terrain, int x, int y)
-{
- const bool village = map_.is_village(terrain);
- if(!village) {
+surface display::get_flag(const t_translation::t_letter& terrain, const
gamemap::location& loc)
+{
+ if(!map_.is_village(terrain)) {
return surface(NULL);
}
-
- const gamemap::location loc(x,y);
for(size_t i = 0; i != teams_.size(); ++i) {
if(teams_[i].owns_village(loc) && (!fogged(loc)) ||
!shrouded(loc) && !teams_[currentTeam_].is_enemy(i+1)) {
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=17885&r1=17884&r2=17885&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Sun May 27 01:53:57 2007
@@ -433,7 +433,7 @@
std::vector<std::string> get_fog_shroud_graphics(const
gamemap::location& loc);
//this surface must be freed by the caller
- surface get_flag(t_translation::t_letter, int x, int y);
+ surface get_flag(const t_translation::t_letter& terrain, const
gamemap::location& loc);
//this surface must be freed by the caller
surface get_minimap(int w, int h);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits