[Top][All Lists]
[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();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.14,1.15,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap graph.cxx,1.10,1.11 graph.hxx,1.17,1.18 path_drawable.cxx,1.3,1.4 path_graph.cxx,1.8,1.9 pathfinder.hxx,1.3,1.4 pingus.cxx,1.13,1.14 pingus.hxx,1.15,1.16 worldmap.cxx,1.20,1.21
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/data/images/pingus bash_radius.png,1.3,1.4 bash_radius_gfx.png,1.3,1.4
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap graph.cxx,1.10,1.11 graph.hxx,1.17,1.18 path_drawable.cxx,1.3,1.4 path_graph.cxx,1.8,1.9 pathfinder.hxx,1.3,1.4 pingus.cxx,1.13,1.14 pingus.hxx,1.15,1.16 worldmap.cxx,1.20,1.21
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/data/images/pingus bash_radius.png,1.3,1.4 bash_radius_gfx.png,1.3,1.4
- Index(es):