mail[Wesnoth-commits] r33240 - in /trunk: changelog src/game_display.cpp src/generate_report.cpp src/replay_controller.cpp src/reports.hpp


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

Header


Content

Posted by soliton . de on March 01, 2009 - 16:46:
Author: soliton
Date: Sun Mar  1 16:46:42 2009
New Revision: 33240

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33240&view=rev
Log:
* properly check for shroud/fog in various places; fixes bug #13029: Problem 
with mouse-over unit identification in replays

Modified:
    trunk/changelog
    trunk/src/game_display.cpp
    trunk/src/generate_report.cpp
    trunk/src/replay_controller.cpp
    trunk/src/reports.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33240&r1=33239&r2=33240&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Mar  1 16:46:42 2009
@@ -23,6 +23,7 @@
    * The multiplayer dialog shows tooltips again
    * The textbox history now uses CTRL+TAB and CTRL+SHIFT+TAB
    * Properly set the cursor when opening a dialog (bug #12961)
+   * Fixed bug #13029: Problem with mouse-over unit identification in replays
  * WML Engine:
    * Fix incorrect or doubled "sighted" events when delaying shroud update
    * Fix sometimes doubled "select" events

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=33240&r1=33239&r2=33240&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Sun Mar  1 16:46:42 2009
@@ -206,12 +206,12 @@
 
 void game_display::highlight_hex(map_location hex)
 {
-       unit_map::const_iterator u = find_visible_unit(units_,hex, get_map(), 
teams_,teams_[viewing_team()]);
+       unit_map::const_iterator u = find_visible_unit(units_, hex, 
get_map(), teams_, teams_[viewing_team()], !viewpoint_);
        if (u != units_.end()) {
                displayedUnitHex_ = hex;
                invalidate_unit();
        } else {
-               u = find_visible_unit(units_,mouseoverHex_, get_map(), 
teams_,teams_[viewing_team()]);
+               u = find_visible_unit(units_, mouseoverHex_, get_map(), 
teams_, teams_[viewing_team()], !viewpoint_);
                if (u != units_.end()) {
                        // mouse moved from unit hex to non-unit hex
                        if (units_.count(selectedHex_)) {
@@ -228,7 +228,7 @@
 
 void game_display::display_unit_hex(map_location hex)
 {
-       unit_map::const_iterator u = find_visible_unit(units_,hex, get_map(), 
teams_,teams_[viewing_team()]);
+       unit_map::const_iterator u = find_visible_unit(units_, hex, 
get_map(), teams_, teams_[viewing_team()], !viewpoint_);
        if (u != units_.end()) {
                displayedUnitHex_ = hex;
                invalidate_unit();
@@ -295,7 +295,7 @@
                        return image::BRIGHTENED;
                } else if (loc == selectedHex_) {
                        unit_map::iterator un = find_visible_unit(units_, 
loc, get_map(),
-                               teams_,teams_[currentTeam_]);
+                                       teams_, teams_[currentTeam_], 
!viewpoint_);
                        if (un != units_.end()) {
                                return image::BRIGHTENED;
                        }
@@ -432,14 +432,14 @@
                                                          units_, teams_,
                                                          
teams_[viewing_team()],
                                                          
size_t(currentTeam_+1),size_t(activeTeam_+1),
-                                                         
selectedHex_,mouseoverHex_,displayedUnitHex_,status_,observers_,level_);
+                                                         selectedHex_, 
mouseoverHex_, displayedUnitHex_,
+                                                         status_, 
observers_, level_, !viewpoint_);
 
        brighten = false;
        if(report_num == reports::TIME_OF_DAY) {
                time_of_day tod = 
timeofday_at(status_,units_,mouseoverHex_,get_map());
                // Don't show illuminated time on fogged/shrouded tiles
-               if (teams_[viewing_team()].fogged(mouseoverHex_) ||
-                               
teams_[viewing_team()].shrouded(mouseoverHex_)) {
+               if (fogged(mouseoverHex_) || shrouded(mouseoverHex_)) {
 
                        tod = status_.get_time_of_day(false,mouseoverHex_);
                }
@@ -472,15 +472,8 @@
        if(invalidateUnit_) {
                // We display the unit the mouse is over if it is over a unit,
                // otherwise we display the unit that is selected.
-               unit_map::const_iterator i =
-                       find_visible_unit(units_,displayedUnitHex_,
-                                       get_map(),
-                                       teams_,teams_[viewing_team()]);
-
-               if(i != units_.end()) {
-                       for(size_t r = reports::UNIT_REPORTS_BEGIN; r != 
reports::UNIT_REPORTS_END; ++r) {
-                               draw_report(reports::TYPE(r));
-                       }
+               for(size_t r = reports::UNIT_REPORTS_BEGIN; r != 
reports::UNIT_REPORTS_END; ++r) {
+                       draw_report(reports::TYPE(r));
                }
 
                invalidateUnit_ = false;
@@ -1038,11 +1031,11 @@
        return std::string();
 }
 
-void game_display::set_team(size_t teamindex, bool observe)
+void game_display::set_team(size_t teamindex, bool show_everything)
 {
        assert(teamindex < teams_.size());
        currentTeam_ = teamindex;
-       if (!observe)
+       if (!show_everything)
        {
                labels().set_team(&teams_[teamindex]);
                viewpoint_ = &teams_[teamindex];

Modified: trunk/src/generate_report.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/generate_report.cpp?rev=33240&r1=33239&r2=33240&view=diff
==============================================================================
--- trunk/src/generate_report.cpp (original)
+++ trunk/src/generate_report.cpp Sun Mar  1 16:46:42 2009
@@ -38,15 +38,13 @@
                        unsigned int current_side, unsigned int playing_side,
                        const map_location& loc, const map_location& 
mouseover, const map_location& displayed_unit_hex,
                        const gamestatus& status, const 
std::set<std::string>& observers,
-                       const config& level)
+                       const config& level, bool show_everything)
 {
        unit_map::iterator u = units.end();
 
        if((int(type) >= int(UNIT_REPORTS_BEGIN) && int(type) < 
int(UNIT_REPORTS_END)) || type == POSITION) {
 
-               u = find_visible_unit(units,displayed_unit_hex,
-                                     map,
-                                     teams,current_team);
+               u = find_visible_unit(units, displayed_unit_hex, map, teams, 
current_team, show_everything);
                if(u == units.end() && type != POSITION) {
                        return report();
                }

Modified: trunk/src/replay_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/replay_controller.cpp?rev=33240&r1=33239&r2=33240&view=diff
==============================================================================
--- trunk/src/replay_controller.cpp (original)
+++ trunk/src/replay_controller.cpp Sun Mar  1 16:46:42 2009
@@ -253,7 +253,6 @@
 void replay_controller::replay_show_team1(){
        show_everything_ = false;
        show_team_ = 1;
-       gui_->set_team(show_team_ - 1, show_everything_);
        update_teams();
        update_gui();
 }

Modified: trunk/src/reports.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.hpp?rev=33240&r1=33239&r2=33240&view=diff
==============================================================================
--- trunk/src/reports.hpp (original)
+++ trunk/src/reports.hpp Sun Mar  1 16:46:42 2009
@@ -97,7 +97,7 @@
                               unsigned int current_side, int unsigned 
active_side,
                               const map_location& loc, const map_location& 
mouseover, const map_location& displayed_unit_hex,
                               const gamestatus& status, const 
std::set<std::string>& observers,
-                              const config& level);
+                              const config& level, bool show_everything = 
false);
 }
 
 #endif




Related Messages


Powered by MHonArc, Updated Sun Mar 01 17:40:06 2009