Author: esr
Date: Tue Jul 17 00:40:57 2007
New Revision: 18833
URL: http://svn.gna.org/viewcvs/wesnoth?rev=18833&view=rev
Log:
Restore the brightened time display I inadertenrtly disabled a few
commits ago.
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
trunk/src/game_display.cpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=18833&r1=18832&r2=18833&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Tue Jul 17 00:40:57 2007
@@ -1471,7 +1471,8 @@
report_[which_report] = content;
}
-void display::refresh_report(reports::TYPE report_num, reports::report report)
+void display::refresh_report(reports::TYPE report_num, reports::report report,
+ bool brighten)
{
const theme::status_item* const item =
theme_.get_status_item(reports::report_name(report_num));
if(item != NULL) {
@@ -1592,6 +1593,13 @@
area.h = minimum<int>(rect.h + rect.y -
y, img->h);
draw_image_for_report(img, area);
+ if(brighten > 0) {
+ surface
tod_bright(image::get_image(game_config:: tod_bright_image,image::UNSCALED));
+ if(tod_bright != NULL) {
+
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=18833&r1=18832&r2=18833&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Tue Jul 17 00:40:57 2007
@@ -169,7 +169,8 @@
void create_buttons();
void invalidate_theme() { panelsDrawn_ = false; }
- void refresh_report(reports::TYPE report_num, reports::report report);
+ void refresh_report(reports::TYPE report_num, reports::report report,
+ bool brightened = false);
// Will be overridden in the display subclass
virtual void invalidate(const gamemap::location& loc)
{invalidated_.insert(loc);};
Modified: trunk/src/game_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=18833&r1=18832&r2=18833&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Tue Jul 17 00:40:57 2007
@@ -621,6 +621,8 @@
void game_display::draw_report(reports::TYPE report_num)
{
+ bool brighten;
+
if(!team_valid()) {
return;
}
@@ -631,7 +633,19 @@
size_t(currentTeam_+1),size_t(activeTeam_+1),
selectedHex_,mouseoverHex_,status_,observers_);
- refresh_report(report_num, report);
+ brighten = false;
+ if(report_num == reports::TIME_OF_DAY) {
+ time_of_day tod =
timeofday_at(status_,units_,mouseoverHex_,map_);
+ // don't show illuminated time on fogged/shrouded tiles
+ if (teams_[viewing_team()].fogged(mouseoverHex_.x,
mouseoverHex_.y) ||
+
teams_[viewing_team()].shrouded(mouseoverHex_.x, mouseoverHex_.y)) {
+
+ tod = status_.get_time_of_day(false,mouseoverHex_);
+ }
+ brighten = (tod.bonus_modified > 0);
+ }
+
+ refresh_report(report_num, report, brighten);
}
void game_display::draw_game_status()
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits