mail[Wesnoth-commits] r44048 - in /trunk: data/game_config.cfg src/game_config.cpp src/game_config.hpp src/game_display.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on July 09, 2010 - 19:43:
Author: alink
Date: Fri Jul  9 19:43:09 2010
New Revision: 44048

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44048&view=rev
Log:
Add a selected_image image key in game_config to render an overlay on the 
selected unit.
No image defined yet, edit game_config.cfg to use it

Modified:
    trunk/data/game_config.cfg
    trunk/src/game_config.cpp
    trunk/src/game_config.hpp
    trunk/src/game_display.cpp

Modified: trunk/data/game_config.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/game_config.cfg?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- trunk/data/game_config.cfg (original)
+++ trunk/data/game_config.cfg Fri Jul  9 19:43:09 2010
@@ -100,6 +100,7 @@
     grid_image_top="terrain/grid-top.png"
     grid_image_bottom="terrain/grid-bottom.png"
     mouseover_image="misc/hover-hex.png"
+    selected_image=""
     unreachable_image="terrain/darken.png"
 
     fog_prefix="terrain/fog"

Modified: trunk/src/game_config.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_config.cpp?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- trunk/src/game_config.cpp (original)
+++ trunk/src/game_config.cpp Fri Jul  9 19:43:09 2010
@@ -62,6 +62,7 @@
        std::string grid_image_top = "terrain/grid-top.png";
        std::string grid_image_bottom = "terrain/grid-bottom.png";
        std::string mouseover_image = "";
+       std::string selected_image = "";
        std::string unreachable_image = "terrain/darken.png";    /**< overlay 
image for unreachable tiles. */
        std::string linger_image = "terrain/darken-linger.png";  /**< overlay 
image for tiles in linger mode. */
 
@@ -206,6 +207,7 @@
                grid_image_top = v["grid_image_top"].str();
                grid_image_bottom = v["grid_image_bottom"].str();
                mouseover_image = v["mouseover_image"].str();
+               selected_image = v["selected_image"].str();
                unreachable_image = v["unreachable_image"].str();
 
                shroud_prefix = v["shroud_prefix"].str();

Modified: trunk/src/game_config.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_config.hpp?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- trunk/src/game_config.hpp (original)
+++ trunk/src/game_config.hpp Fri Jul  9 19:43:09 2010
@@ -70,7 +70,7 @@
                flag_image, flag_icon_image,
                terrain_mask_image,
                grid_image_top, grid_image_bottom,
-               mouseover_image,
+               mouseover_image, selected_image,
                unreachable_image, linger_image,
                shroud_prefix, fog_prefix,
                observer_image, tod_bright_image, tod_dark_image,

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=44048&r1=44047&r2=44048&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Fri Jul  9 19:43:09 2010
@@ -384,6 +384,11 @@
                
blit.surf.push_back(image::get_image(game_config::linger_image, 
image::SCALED_TO_HEX));
                drawing_buffer_add(LAYER_LINGER_OVERLAY, loc, blit);
                blit.surf.clear();
+       }
+
+       if(on_map && loc == selectedHex_ && 
!game_config::selected_image.empty()) {
+               drawing_buffer_add(LAYER_MOVE_INFO, loc, tblit(xpos, ypos,
+                       image::get_image(game_config::selected_image, 
image::UNMASKED)));
        }
 
        if(on_map && loc == mouseoverHex_ && 
!game_config::mouseover_image.empty()) {




Related Messages


Powered by MHonArc, Updated Fri Jul 09 20:40:11 2010