Author: mordante
Date: Sat May 26 22:39:51 2007
New Revision: 17876
URL: http://svn.gna.org/viewcvs/wesnoth?rev=17876&view=rev
Log:
added some const modifiers, need them for testing and the functions can be
const anyway
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=17876&r1=17875&r2=17876&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sat May 26 22:39:51 2007
@@ -241,7 +241,9 @@
}
}
-gamemap::location display::hex_clicked_on(int xclick, int yclick,
gamemap::location::DIRECTION* nearest_hex, gamemap::location::DIRECTION*
second_nearest_hex)
+const gamemap::location display::hex_clicked_on(int xclick, int yclick,
+ gamemap::location::DIRECTION* nearest_hex,
+ gamemap::location::DIRECTION* second_nearest_hex) const
{
const SDL_Rect& rect = map_area();
if(point_in_rect(xclick,yclick,rect) == false) {
@@ -254,7 +256,9 @@
return pixel_position_to_hex(xpos_ + xclick, ypos_ + yclick,
nearest_hex, second_nearest_hex);
}
-gamemap::location display::pixel_position_to_hex(int x, int y,
gamemap::location::DIRECTION* nearest_hex, gamemap::location::DIRECTION*
second_nearest_hex)
+const gamemap::location display::pixel_position_to_hex(int x, int y,
+ gamemap::location::DIRECTION* nearest_hex,
+ gamemap::location::DIRECTION* second_nearest_hex) const
{
const int s = hex_size();
const int tesselation_x_size = hex_width() * 2;
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=17876&r1=17875&r2=17876&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Sat May 26 22:39:51 2007
@@ -157,12 +157,16 @@
//given x,y co-ordinates of an onscreen pixel, will return the
//location of the hex that this pixel corresponds to. Returns an
//invalid location is the mouse isn't over any valid location.
- gamemap::location hex_clicked_on(int x, int y,
gamemap::location::DIRECTION* nearest_hex=NULL, gamemap::location::DIRECTION*
second_nearest_hex=NULL);
+ const gamemap::location hex_clicked_on(int x, int y,
+ gamemap::location::DIRECTION* nearest_hex=NULL,
+ gamemap::location::DIRECTION* second_nearest_hex=NULL) const;
//given x,y co-ordinates of a pixel on the map, will return the
//location of the hex that this pixel corresponds to. Returns an
//invalid location if the mouse isn't over any valid location.
- gamemap::location pixel_position_to_hex(int x, int y,
gamemap::location::DIRECTION* nearest_hex=NULL, gamemap::location::DIRECTION*
second_nearest_hex=NULL);
+ const gamemap::location pixel_position_to_hex(int x, int y,
+ gamemap::location::DIRECTION* nearest_hex=NULL,
+ gamemap::location::DIRECTION* second_nearest_hex=NULL) const;
//given x,y co-ordinates of the mouse, will return the location of the
//hex in the minimap that the mouse is currently over, or an invalid
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits