Author: alink
Date: Tue May 12 21:49:02 2009
New Revision: 35606
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35606&view=rev
Log:
Revert r35599 and rename tile_on_screen to tile_fully_on_screen
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
trunk/src/unit_display.cpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=35606&r1=35605&r2=35606&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Tue May 12 21:49:02 2009
@@ -1548,10 +1548,11 @@
}
}
-bool display::tile_on_screen(const map_location& loc)
-{
- SDL_Rect r = { get_location_x(loc), get_location_y(loc), hex_size(),
hex_size()};
- return rects_overlap(r, map_area());
+bool display::tile_fully_on_screen(const map_location& loc)
+{
+ int x = get_location_x(loc);
+ int y = get_location_y(loc);
+ return !outside_area(map_area(), x, y);
}
bool display::tile_nearly_on_screen(const map_location& loc)
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=35606&r1=35605&r2=35606&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Tue May 12 21:49:02 2009
@@ -436,8 +436,8 @@
/** Expose the event, so observers can be notified about map scrolling.
*/
events::generic_event &scroll_event() const { return scroll_event_; }
- /** Check if a tile is fully on screen. */
- bool tile_on_screen(const map_location& loc);
+ /** Check if a tile is fully visible on screen. */
+ bool tile_fully_on_screen(const map_location& loc);
/** Checks if location @a loc or one of the adjacent tiles is visible
on screen. */
bool tile_nearly_on_screen(const map_location &loc);
Modified: trunk/src/unit_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_display.cpp?rev=35606&r1=35605&r2=35606&view=diff
==============================================================================
--- trunk/src/unit_display.cpp (original)
+++ trunk/src/unit_display.cpp Tue May 12 21:49:02 2009
@@ -173,7 +173,7 @@
temp_unit.invisible(path[i+1],units,teams);
if(!invisible) {
- if (!disp->tile_on_screen(path[i]) ||
!disp->tile_on_screen(path[i+1])) {
+ if (!disp->tile_fully_on_screen(path[i]) ||
!disp->tile_fully_on_screen(path[i+1])) {
// prevent the unit from dissappearing if we
scroll here with i == 0
disp->place_temporary_unit(temp_unit,path[i]);
// scroll in as much of the remaining path as
possible
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits