pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.14,1.15


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.14,1.15
Date: 14 Oct 2002 10:19:33 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv11279/worldmap

Modified Files:
        pingus.cxx 
Log Message:
pingu walks now correctly, only speed is a bit wrong and walk-direction in't 
shown in the sprite

Index: pingus.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/pingus.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- pingus.cxx  14 Oct 2002 00:38:22 -0000      1.14
+++ pingus.cxx  14 Oct 2002 10:19:31 -0000      1.15
@@ -63,7 +63,7 @@
 {
   float velocity = 50.0f;
 
-  std::cout << "Updating Walk: " << edge_path_position << "/" << 
edge_path_length << std::endl;
+  //std::cout << "Updating Walk: " << edge_path_position << "/" << 
edge_path_length << std::endl;
   // Update the edge_path_position
   edge_path_position += velocity * delta;
 
@@ -157,12 +157,15 @@
 
           if (comp_length + length > edge_path_position) 
             {
+              // FIXME: this is incorrect, it causses speed miss match
               float perc = (edge_path_position - comp_length) // length to 
walk from current node
                 / length;
 
               return interpolate (*current, *next, perc);
             }
 
+          comp_length += length;
+
           ++current;
           ++next;
         }
@@ -213,7 +216,8 @@
   Path* partial_path = path->graph.resolve_edge(source_node, target_node).data;
           
   edge_path.push_back(path->graph.resolve_node(source_node).data->get_pos());
-  edge_path.insert(edge_path.end(), partial_path->begin(), 
partial_path->end());
+  // Why do we need to reverse this?!
+  edge_path.insert(edge_path.end(), partial_path->rbegin(), 
partial_path->rend());
   edge_path.push_back(path->graph.resolve_node(target_node).data->get_pos());
   
   edge_path_length = calc_edge_path_length();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]