mail[Wesnoth-commits] r44527 - in /trunk/src/whiteboard: manager.cpp side_actions.cpp


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

Header


Content

Posted by gabrielmorin on July 22, 2010 - 07:18:
Author: gabba
Date: Thu Jul 22 07:18:59 2010
New Revision: 44527

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44527&view=rev
Log:
Whiteboard: More logging adjustments.

Modified:
    trunk/src/whiteboard/manager.cpp
    trunk/src/whiteboard/side_actions.cpp

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=44527&r1=44526&r2=44527&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Thu Jul 22 07:18:59 2010
@@ -416,7 +416,6 @@
        {
                erase_temp_move();
                validate_viewer_actions();
-               LOG_WB << *viewer_actions() << "\n";
 
                action_ptr action;
                side_actions::iterator it;
@@ -441,7 +440,6 @@
                        viewer_actions()->execute_next();
                        executing_actions_ = false;
                }
-               LOG_WB << *viewer_actions() << "\n";
        }
 }
 
@@ -451,7 +449,6 @@
        {
                erase_temp_move();
                validate_viewer_actions();
-               LOG_WB << *viewer_actions() << "\n";
 
                action_ptr action;
                side_actions::iterator it;
@@ -470,7 +467,6 @@
                {
                        
viewer_actions()->remove_action(viewer_actions()->end() - 1);
                }
-               LOG_WB << *viewer_actions() << "\n";
        }
 }
 
@@ -480,12 +476,10 @@
        {
 
                validate_viewer_actions();
-               LOG_WB << *viewer_actions() << "\n";
                action_ptr action = highlighter_->get_bump_target();
                if (action)
                {
                        
viewer_actions()->bump_earlier(viewer_actions()->get_position_of(action));
-                       LOG_WB << *viewer_actions() << "\n";
                }
        }
 }
@@ -496,12 +490,10 @@
        {
 
                validate_viewer_actions();
-               LOG_WB << *viewer_actions() << "\n";
                action_ptr action = highlighter_->get_bump_target();
                if (action)
                {
                        
viewer_actions()->bump_later(viewer_actions()->get_position_of(action));
-                       LOG_WB << *viewer_actions() << "\n";
                }
        }
 }

Modified: trunk/src/whiteboard/side_actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/side_actions.cpp?rev=44527&r1=44526&r2=44527&view=diff
==============================================================================
--- trunk/src/whiteboard/side_actions.cpp (original)
+++ trunk/src/whiteboard/side_actions.cpp Thu Jul 22 07:18:59 2010
@@ -102,12 +102,14 @@
 
        if (!actions_.empty() && validate_iterator(position))
        {
+               LOG_WB << "Before execution, " << *this << "\n";
                size_t distance = std::distance(begin(), position);
                action_ptr action = *position;
                bool finished = action->execute();
                if (finished)
                {
                        actions_.erase(position);
+                       LOG_WB << "After execution and deletion, " << *this 
<< "\n";
                        validate_actions();
                        return begin() + distance;
                }
@@ -115,6 +117,7 @@
                {
                        actions_.erase(position);
                        actions_.insert(end(), action);
+                       LOG_WB << "After execution *without* deletion, " << 
*this << "\n";
                        validate_actions();
                        return end() - 1;
                }
@@ -135,7 +138,6 @@
 side_actions::iterator side_actions::queue_move(const 
pathfind::marked_route& route, arrow_ptr arrow, fake_unit_ptr fake_unit)
 {
        action_ptr action(new move(route, arrow, fake_unit));
-       LOG_WB << "Queued: " << action <<"\n";
        return queue_action(action);
 }
 
@@ -144,7 +146,6 @@
                arrow_ptr arrow, fake_unit_ptr fake_unit)
 {
        action_ptr action(new attack(target_hex, weapon_choice, route, arrow, 
fake_unit));
-       LOG_WB << "Queued: " << action <<"\n";
        return queue_action(action);
 }
 
@@ -156,6 +157,8 @@
        }
        assert(position >= begin() && position < end());
        iterator valid_position = actions_.insert(position, action);
+       LOG_WB << "Inserted at position #" << std::distance(begin(), 
valid_position) + 1
+                  << " : " << action <<"\n";
        validate_actions();
        return valid_position;
 }
@@ -164,6 +167,7 @@
 {
        actions_.push_back(action);
        // Contrary to insert_action, no need to validate actions here since 
we're adding to the end of the queue
+       LOG_WB << "Queued: " << action <<"\n";
        return end() - 1;
 }
 
@@ -184,6 +188,8 @@
        side_actions::iterator previous = position - 1;
        if ((*previous)->get_unit() == (*position)->get_unit())
                return end();
+
+       LOG_WB << "Before bumping earlier, " << *this << "\n";
 
        int action_number = std::distance(begin(), position) + 1;
        int last_position = actions_.size() + 1;
@@ -198,6 +204,7 @@
        action_queue::iterator valid_position = actions_.insert(destination, 
action);
        assert(validate_iterator(valid_position));
        validate_actions();
+       LOG_WB << "After bumping earlier, " << *this << "\n";
        return valid_position;
 }
 
@@ -218,6 +225,8 @@
        side_actions::iterator next = position + 1;
        if ((*next)->get_unit() == (*position)->get_unit())
                return end();
+
+       LOG_WB << "Before bumping later, " << *this << "\n";
 
        int action_number = std::distance(begin(), position) + 1;
        int last_position = actions_.size() + 1;
@@ -233,6 +242,7 @@
        action_queue::iterator valid_position = actions_.insert(destination, 
action);
        assert(validate_iterator(valid_position));
        validate_actions();
+       LOG_WB << "After bumping later, " << *this << "\n";
        return valid_position;
 }
 




Related Messages


Powered by MHonArc, Updated Thu Jul 22 07:20:12 2010