Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5871
Modified Files:
gameloop.cpp
Log Message:
- moved a few int's inside the for-loops
- replaced a old '.' with 0
Index: gameloop.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- gameloop.cpp 25 Mar 2004 12:15:47 -0000 1.29
+++ gameloop.cpp 25 Mar 2004 19:01:35 -0000 1.30
@@ -1405,7 +1405,7 @@
c = current_level.ia_tiles[yy][xx];
}
else
- c = '.';
+ c = 0;
return(c);
}
@@ -1559,7 +1559,6 @@
/* Empty a box: */
-
void tryemptybox(float x, float y, int col_side)
{
Tile* tile = gettile(x,y);
@@ -1567,13 +1566,11 @@
return;
// according to the collision side, set the upgrade direction
-
if(col_side == LEFT)
col_side = RIGHT;
else
col_side = LEFT;
- // FIXME: Content of boxes must be handled otherwise
switch(tile->data)
{
case 1: //'A': /* Box with a distro! */
@@ -1582,6 +1579,7 @@
score = score + SCORE_DISTRO;
distros++;
break;
+
case 2: // 'B': /* Add an upgrade! */
if (tux.size == SMALL) /* Tux is small, add mints! */
add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_MINTS);
@@ -1589,6 +1587,7 @@
add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_COFFEE);
play_sound(sounds[SND_UPGRADE], SOUND_CENTER_SPEAKER);
break;
+
case 3:// '!': /* Add a golden herring */
add_upgrade((int)((x + 1) / 32) * 32, (int)(y / 32) * 32 - 32, col_side, UPGRADE_HERRING);
break;
@@ -1600,9 +1599,7 @@
level_change(¤t_level,x, y, TM_IA, tile->next_tile);
}
-
/* Try to grab a distro: */
-
void trygrabdistro(float x, float y, int bounciness)
{
Tile* tile = gettile(x, y);
@@ -1623,13 +1620,10 @@
}
/* Try to bump a bad guy from below: */
-
void trybumpbadguy(float x, float y)
{
- unsigned int i;
-
/* Bad guys: */
- for (i = 0; i < bad_guys.size(); i++)
+ for (unsigned int i; i = 0; i < bad_guys.size(); i++)
{
if (bad_guys[i].base.x >= x - 32 && bad_guys[i].base.x <= x + 32 &&
bad_guys[i].base.y >= y - 16 && bad_guys[i].base.y <= y + 16)
@@ -1646,7 +1640,7 @@
/* Upgrades: */
- for (i = 0; i < upgrades.size(); i++)
+ for (unsigned int i = 0; i < upgrades.size(); i++)
{
if (upgrades[i].base.height == 32 &&
upgrades[i].base.x >= x - 32 && upgrades[i].base.x <= x + 32 &&
@@ -1755,7 +1749,6 @@
if (fi == NULL)
{
fprintf(stderr, "Warning: I could not open the slot file ");
-
}
else
{
|