[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src pingu_holder.cxx,1.2,1.3
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src pingu_holder.cxx,1.2,1.3 |
Date: |
17 Jun 2002 09:54:46 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv11038
Modified Files:
pingu_holder.cxx
Log Message:
changed for loop to while in draw_offset since it's cleaner in this case
Index: pingu_holder.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_holder.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pingu_holder.cxx 13 Jun 2002 14:25:12 -0000 1.2
+++ pingu_holder.cxx 17 Jun 2002 09:54:44 -0000 1.3
@@ -34,8 +34,8 @@
{
// Deleting all Pingu objects
std::cout << "PinguHolder: Deleting pingus" << std::endl;
- for(std::vector<Pingu*>::iterator i = all_pingus.begin();
- i != all_pingus.end(); ++i)
+ for(std::vector<Pingu*>::iterator i = all_pingus.begin();
+ i != all_pingus.end(); ++i)
delete *i;
}
@@ -66,7 +66,9 @@
void
PinguHolder::draw_offset(int x_of, int y_of, float s)
{
- for(PinguIter pingu = pingus.begin(); pingu != pingus.end(); ++pingu)
+ PinguIter pingu = pingus.begin();
+
+ while(pingu != pingus.end())
{
if ((*pingu)->get_status() == PS_DEAD)
{
@@ -74,13 +76,11 @@
// the correct possition, no memory hole since pingus will
// keep track of the allocated Pingus
pingu = pingus.erase(pingu);
- pingu--;
}
else if ((*pingu)->get_status() == PS_EXITED)
{
saved_pingus++;
pingu = pingus.erase(pingu);
- pingu--;
}
else
{
@@ -88,11 +88,14 @@
// all other pingus, for better visibility
if (!(*pingu)->get_action())
(*pingu)->draw_offset(x_of, y_of, s);
+
+ // move to the next Pingu
+ pingu++;
}
}
// We draw all actions here, so we have them above all others
- for(PinguIter pingu = pingus.begin(); pingu != pingus.end(); pingu++)
+ for(pingu = pingus.begin(); pingu != pingus.end(); pingu++)
{
if ((*pingu)->get_action())
(*pingu)->draw_offset(x_of, y_of, s);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src pingu_holder.cxx,1.2,1.3,
torangan <=
- Prev by Date:
[Pingus-CVS] [Bug #663] Some levels are still in PLF format
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src button_panel.cxx,1.2,1.3 button_panel.hxx,1.1,1.2 pingus_counter.cxx,1.2,1.3 pingus_counter.hxx,1.1,1.2 playfield.cxx,1.2,1.3 playfield.hxx,1.1,1.2 smallmap.cxx,1.2,1.3 smallmap.hxx,1.1,1.2 world.cxx,1.4,1.5
- Previous by thread:
[Pingus-CVS] [Bug #663] Some levels are still in PLF format
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src button_panel.cxx,1.2,1.3 button_panel.hxx,1.1,1.2 pingus_counter.cxx,1.2,1.3 pingus_counter.hxx,1.1,1.2 playfield.cxx,1.2,1.3 playfield.hxx,1.1,1.2 smallmap.cxx,1.2,1.3 smallmap.hxx,1.1,1.2 world.cxx,1.4,1.5
- Index(es):