[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp
From: |
Philippe Plantier |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp |
Date: |
Sun, 21 Aug 2005 12:22:15 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Philippe Plantier <address@hidden> 05/08/21 16:22:15
Modified files:
src : display.cpp display.hpp
Log message:
Fixed #13995: now, steps go below units & foregrounds (as before), but
movement text goes above.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.324&tr2=1.325&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.hpp.diff?tr1=1.105&tr2=1.106&r1=text&r2=text
Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.324 wesnoth/src/display.cpp:1.325
--- wesnoth/src/display.cpp:1.324 Sat Aug 6 15:58:32 2005
+++ wesnoth/src/display.cpp Sun Aug 21 16:22:15 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.324 2005/08/06 15:58:32 ott Exp $ */
+/* $Id: display.cpp,v 1.325 2005/08/21 16:22:15 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -1550,7 +1550,6 @@
SDL_BlitSurface(overlay_surface,NULL,dst,&dstrect);
}
}
- draw_footstep(loc,xpos,ypos);
} else {
//FIXME: shouldn't void.png and fog.png be in the program
configuration?
surface surface(image::get_image("terrain/void.png"));
@@ -1564,10 +1563,12 @@
SDL_BlitSurface(surface,NULL,dst,&dstrect);
}
+ draw_footstep(loc,xpos,ypos);
draw_unit_on_tile(x,y,unit_image,alpha,blend_to);
- if(!shrouded(x,y)) {
+ if(!is_shrouded) {
draw_terrain_on_tile(x,y,image_type,ADJACENT_FOREGROUND);
+ draw_movement_info(loc,xpos,ypos);
}
if(fogged(x,y) && shrouded(x,y) == false) {
@@ -1626,8 +1627,6 @@
if(i == route_.steps.begin() || i == route_.steps.end())
return;
- const bool show_time = (i+1 == route_.steps.end());
-
const bool left_foot = is_even(i - route_.steps.begin());
//generally we want the footsteps facing toward the direction they're
going
@@ -1698,6 +1697,13 @@
}
draw_unit(xloc,yloc,image,vflip,ftofxp(0.5));
+}
+
+void display::draw_movement_info(const gamemap::location& loc, int xloc, int
yloc)
+{
+ std::vector<gamemap::location>::const_iterator i =
+ std::find(route_.steps.begin(),route_.steps.end(),loc);
+ const bool show_time = (i+1 == route_.steps.end());
if(show_time == false) {
return;
@@ -1706,6 +1712,7 @@
std::stringstream text;
#ifndef USE_TINY_GUI
+ const unit_map::const_iterator un = units_.find(route_.steps.front());
if(un != units_.end() && zoom_ >= DefaultZoom) {
text <<
(100-un->second.defense_modifier(map_,map_.get_terrain(loc))) << "%";
}
Index: wesnoth/src/display.hpp
diff -u wesnoth/src/display.hpp:1.105 wesnoth/src/display.hpp:1.106
--- wesnoth/src/display.hpp:1.105 Sat Jul 2 21:37:18 2005
+++ wesnoth/src/display.hpp Sun Aug 21 16:22:15 2005
@@ -1,4 +1,4 @@
-/* $Id: display.hpp,v 1.105 2005/07/02 21:37:18 ott Exp $ */
+/* $Id: display.hpp,v 1.106 2005/08/21 16:22:15 gruikya Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -207,6 +207,9 @@
//loc is on the current route set by set_route. Otherwise it will
//return with no effect.
void draw_footstep(const gamemap::location& loc, int xloc, int yloc);
+
+ //draws the movement info (turns available) for a given location
+ void draw_movement_info(const gamemap::location& loc, int xloc, int
yloc);
//gets the underlying screen object.
CVideo& video() { return screen_; }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src display.cpp display.hpp,
Philippe Plantier <=