mail[Wesnoth-commits] r40408 - in /trunk/src: display.cpp display.hpp game_display.cpp generate_report.cpp


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

Header


Content

Posted by guillaume . melquiond on December 26, 2009 - 11:31:
Author: silene
Date: Sat Dec 26 11:31:37 2009
New Revision: 40408

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40408&view=rev
Log:
Made generate_report the sole responsible for ToD brightening.

Modified:
    trunk/src/display.cpp
    trunk/src/display.hpp
    trunk/src/game_display.cpp
    trunk/src/generate_report.cpp

Modified: trunk/src/display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=40408&r1=40407&r2=40408&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sat Dec 26 11:31:37 2009
@@ -2096,8 +2096,7 @@
        report_[which_report] = content;
 }
 
-void display::refresh_report(reports::TYPE report_num, reports::report 
report,
-                            bool brighten)
+void display::refresh_report(reports::TYPE report_num, reports::report 
report)
 {
        const theme::status_item* const item = 
theme_.get_status_item(reports::report_name(report_num));
        if (!item) {
@@ -2227,12 +2226,6 @@
                        if (img->h < area.h) area.h = img->h;
                        draw_image_for_report(img, area);
 
-                       if (brighten) {
-                               surface 
tod_bright(image::get_image(game_config:: tod_bright_image));
-                               if (tod_bright)
-                                       draw_image_for_report(tod_bright, 
area);
-                       }
-
                        ++image_count;
                        if (area.h > tallest) {
                                tallest = area.h;

Modified: trunk/src/display.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=40408&r1=40407&r2=40408&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Sat Dec 26 11:31:37 2009
@@ -261,8 +261,7 @@
        void create_buttons();
        void invalidate_theme() { panelsDrawn_ = false; }
 
-       void refresh_report(reports::TYPE report_num, reports::report report,
-                     bool brightened = false);
+       void refresh_report(reports::TYPE report_num, reports::report report);
 
        // Will be overridden in the display subclass
        virtual void draw_minimap_units() {};

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=40408&r1=40407&r2=40408&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Sat Dec 26 11:31:37 2009
@@ -438,18 +438,7 @@
                                                          selectedHex_, 
mouseoverHex_, displayedUnitHex_,
                observers_, level_, !viewpoint_);
 
-       bool brighten = false;
-       if(report_num == reports::TIME_OF_DAY) {
-               time_of_day tod = 
tod_manager_.time_of_day_at(units_,mouseoverHex_,get_map());
-               // Don't show illuminated time on fogged/shrouded tiles
-               if (fogged(mouseoverHex_) || shrouded(mouseoverHex_)) {
-
-                       tod = 
tod_manager_.get_time_of_day(false,mouseoverHex_);
-               }
-               brighten = (tod.bonus_modified > 0);
-       }
-
-       refresh_report(report_num, report, brighten);
+       refresh_report(report_num, report);
 }
 
 void game_display::draw_game_status()

Modified: trunk/src/generate_report.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=40408&r1=40407&r2=40408&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Sat Dec 26 11:31:37 2009
@@ -368,7 +368,6 @@
                return report("", u->profile(), "");
        case TIME_OF_DAY: {
                time_of_day tod = 
resources::tod_manager->time_of_day_at(units, mouseover, 
*resources::game_map);
-               const std::string tod_image = tod.image + 
(preferences::flip_time() ? "~FL(horiz)" : "");
 
                // Don't show illuminated time on fogged/shrouded tiles
                if (current_team.fogged(mouseover) || 
current_team.shrouded(mouseover)) {
@@ -382,6 +381,10 @@
                                << _("Neutral units: ") << "0%\n"
                                << _("Chaotic units: ")
                                << (tod.lawful_bonus < 0 ? "+" : "") << 
(tod.lawful_bonus*-1) << "%";
+
+               std::string tod_image = tod.image;
+               if (tod.bonus_modified > 0) tod_image += "~BRIGHTEN()";
+               if (preferences::flip_time()) tod_image += "~FL(horiz)";
 
                return report("",tod_image,tooltip.str());
        }




Related Messages


Powered by MHonArc, Updated Sat Dec 26 11:40:12 2009