Author: ilor
Date: Thu Aug 21 02:02:44 2008
New Revision: 28816

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28816&view=rev
Log:
editor2: more pronounced selection display -- draw a bold grid around selected 
hexes instead of just highlighting them. Should be very noticeable both with 
and without the standard grid active.

Added:
    trunk/images/editor/selection-overlay.png   (with props)
Modified:
    trunk/src/editor2/action.cpp
    trunk/src/editor2/editor_display.cpp
    trunk/src/editor2/editor_display.hpp

Added: trunk/images/editor/selection-overlay.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/editor/selection-overlay.png?rev=28816&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/images/editor/selection-overlay.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: trunk/src/editor2/action.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/action.cpp?rev=28816&r1=28815&r2=28816&view=diff
==============================================================================
--- trunk/src/editor2/action.cpp (original)
+++ trunk/src/editor2/action.cpp Thu Aug 21 02:02:44 2008
@@ -96,7 +96,6 @@
 
 void editor_action_paste::extend(const editor_map& map, const 
std::set<gamemap::location>& locs)
 {
-       LOG_ED << "Area extend\n";
        paste_.add_tiles(map, locs);
 }
 editor_action_paste* editor_action_paste::perform(map_context& mc) const

Modified: trunk/src/editor2/editor_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_display.cpp?rev=28816&r1=28815&r2=28816&view=diff
==============================================================================
--- trunk/src/editor2/editor_display.cpp (original)
+++ trunk/src/editor2/editor_display.cpp Thu Aug 21 02:02:44 2008
@@ -75,6 +75,21 @@
     return image::SCALED_TO_HEX;
 }
 
+void editor_display::draw_hex(const gamemap::location& loc)
+{
+       const bool on_map = map_.on_board(loc);
+       const bool is_shrouded = shrouded(loc);
+       int xpos = get_location_x(loc);
+       int ypos = get_location_y(loc);
+       int drawing_order = gamemap::get_drawing_order(loc);
+       tblit blit(xpos, ypos);
+       display::draw_hex(loc);
+       if (on_map && map().in_selection(loc)) {
+               drawing_buffer_add(LAYER_FOG_SHROUD, drawing_order, tblit(xpos, 
ypos,
+                       image::get_image("editor/selection-overlay.png", 
image::SCALED_TO_HEX)));
+       }
+}
+
 const SDL_Rect& editor_display::get_clip_rect()
 {
     return map_outside_area();

Modified: trunk/src/editor2/editor_display.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_display.hpp?rev=28816&r1=28815&r2=28816&view=diff
==============================================================================
--- trunk/src/editor2/editor_display.hpp (original)
+++ trunk/src/editor2/editor_display.hpp Thu Aug 21 02:02:44 2008
@@ -40,6 +40,9 @@
        * The editor uses different rules for terrain highligting (e.g. 
selections)
        */
        image::TYPE get_image_type(const gamemap::location& loc);
+       
+       void draw_hex(const gamemap::location& loc);
+       
        const SDL_Rect& get_clip_rect();
        void draw_sidebar();
        


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to